mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Merge copies of Apple II screen_update function (#10777)
Following the merge of text_update and plot_text_character (93500d7
),
this merges apple2_state::screen_update{,_jp,_ultr},
apple2e_state::screen_update, and a2_video_device::screen_update_GS_8bit
into a single function in a2_video_device.
This commit is contained in:
parent
63ac506dc6
commit
42159f1b5a
@ -119,16 +119,6 @@ public:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
template <bool Invert, bool Flip>
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
u32 screen_update_ff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<false, false>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_ft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<false, true>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_tf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<true, false>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_tt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<true, true>(screen, bitmap, cliprect); }
|
||||
|
||||
u8 ram_r(offs_t offset);
|
||||
void ram_w(offs_t offset, u8 data);
|
||||
u8 keyb_data_r();
|
||||
@ -373,127 +363,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2_state::apple2_interrupt)
|
||||
}
|
||||
}
|
||||
|
||||
template <bool Invert, bool Flip>
|
||||
u32 apple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
// always update the flash timer here so it's smooth regardless of mode switches
|
||||
m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
|
||||
|
||||
if (m_video->m_graphics)
|
||||
{
|
||||
if (m_video->m_hires)
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::II, Invert, Flip>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
else // lo-res
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::II, Invert, Flip>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->text_update<a2_video_device::model::II, Invert, Flip>(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 apple2_state::screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
// always update the flash timer here so it's smooth regardless of mode switches
|
||||
m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
|
||||
|
||||
if (m_video->m_graphics)
|
||||
{
|
||||
if (m_video->m_hires)
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::II_J_PLUS, true, true>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
else // lo-res
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::II_J_PLUS, true, true>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->text_update<a2_video_device::model::II_J_PLUS, true, true>(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 apple2_state::screen_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
// always update the flash timer here so it's smooth regardless of mode switches
|
||||
m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
|
||||
|
||||
if (m_video->m_graphics)
|
||||
{
|
||||
if (m_video->m_hires)
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::IVEL_ULTRA, true, false>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
else // lo-res
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 159);
|
||||
m_video->text_update<a2_video_device::model::IVEL_ULTRA, true, false>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->text_update<a2_video_device::model::IVEL_ULTRA, true, false>(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
I/O
|
||||
***************************************************************************/
|
||||
@ -1248,7 +1117,7 @@ void apple2_state::apple2_common(machine_config &config)
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_raw(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192);
|
||||
m_screen->set_screen_update(FUNC(apple2_state::screen_update_tt));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::II, true, true>)));
|
||||
m_screen->set_palette(m_video);
|
||||
|
||||
/* sound hardware */
|
||||
@ -1340,25 +1209,25 @@ void apple2_state::space84(machine_config &config)
|
||||
void apple2_state::apple2jp(machine_config &config)
|
||||
{
|
||||
apple2p(config);
|
||||
m_screen->set_screen_update(FUNC(apple2_state::screen_update_jp));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::II_J_PLUS, true, true>)));
|
||||
}
|
||||
|
||||
void apple2_state::dodo(machine_config &config)
|
||||
{
|
||||
apple2p(config);
|
||||
m_screen->set_screen_update(FUNC(apple2_state::screen_update_tf));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::II, true, false>)));
|
||||
}
|
||||
|
||||
void apple2_state::albert(machine_config &config)
|
||||
{
|
||||
apple2p(config);
|
||||
m_screen->set_screen_update(FUNC(apple2_state::screen_update_ft));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::II, false, true>)));
|
||||
}
|
||||
|
||||
void apple2_state::ivelultr(machine_config &config)
|
||||
{
|
||||
apple2p(config);
|
||||
m_screen->set_screen_update(FUNC(apple2_state::screen_update_ultr));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IVEL_ULTRA, true, false>)));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -290,14 +290,6 @@ public:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
template <bool Invert, bool Flip>
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
u32 screen_update_ff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<false, false>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_ft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<false, true>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_tf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<true, false>(screen, bitmap, cliprect); }
|
||||
u32 screen_update_tt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update<true, true>(screen, bitmap, cliprect); }
|
||||
|
||||
u8 ram0000_r(offs_t offset);
|
||||
void ram0000_w(offs_t offset, u8 data);
|
||||
u8 ram0200_r(offs_t offset);
|
||||
@ -1226,6 +1218,7 @@ void apple2e_state::machine_reset()
|
||||
}
|
||||
|
||||
m_80store = false;
|
||||
m_video->m_80store = false;
|
||||
m_altzp = false;
|
||||
m_ramrd = false;
|
||||
m_ramwrt = false;
|
||||
@ -1351,87 +1344,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2e_state::apple2_interrupt)
|
||||
}
|
||||
}
|
||||
|
||||
template <bool Invert, bool Flip>
|
||||
u32 apple2e_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bool old_page2 = m_video->m_page2;
|
||||
|
||||
// don't display page2 if 80store is set (we just saved the previous value, don't worry)
|
||||
if (m_80store)
|
||||
{
|
||||
m_video->m_page2 = false;
|
||||
}
|
||||
|
||||
// always update the flash timer here so it's smooth regardless of mode switches
|
||||
m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
|
||||
|
||||
if (m_video->m_graphics)
|
||||
{
|
||||
if (m_video->m_hires)
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
if ((m_video->m_dhires) && (m_video->m_80col))
|
||||
{
|
||||
m_video->dhgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
|
||||
m_video->text_update<a2_video_device::model::IIE, Invert, Flip>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((m_video->m_dhires) && (m_video->m_80col))
|
||||
{
|
||||
m_video->dhgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->hgr_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // lo-res
|
||||
{
|
||||
if (m_video->m_mix)
|
||||
{
|
||||
if ((m_video->m_dhires) && (m_video->m_80col))
|
||||
{
|
||||
m_video->dlores_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
|
||||
m_video->text_update<a2_video_device::model::IIE, Invert, Flip>(screen, bitmap, cliprect, 160, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((m_video->m_dhires) && (m_video->m_80col))
|
||||
{
|
||||
m_video->dlores_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->lores_update(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_video->text_update<a2_video_device::model::IIE, Invert, Flip>(screen, bitmap, cliprect, 0, 191);
|
||||
}
|
||||
|
||||
m_video->m_page2 = old_page2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
I/O
|
||||
***************************************************************************/
|
||||
@ -2237,11 +2149,13 @@ void apple2e_state::c000_w(offs_t offset, u8 data)
|
||||
{
|
||||
case 0x00: // 80STOREOFF
|
||||
m_80store = false;
|
||||
m_video->m_80store = false;
|
||||
auxbank_update();
|
||||
break;
|
||||
|
||||
case 0x01: // 80STOREON
|
||||
m_80store = true;
|
||||
m_video->m_80store = true;
|
||||
auxbank_update();
|
||||
break;
|
||||
|
||||
@ -2557,11 +2471,13 @@ void apple2e_state::c000_iic_w(offs_t offset, u8 data)
|
||||
{
|
||||
case 0x00: // 80STOREOFF
|
||||
m_80store = false;
|
||||
m_video->m_80store = false;
|
||||
auxbank_update();
|
||||
break;
|
||||
|
||||
case 0x01: // 80STOREON
|
||||
m_80store = true;
|
||||
m_video->m_80store = true;
|
||||
auxbank_update();
|
||||
break;
|
||||
|
||||
@ -5045,7 +4961,7 @@ void apple2e_state::apple2e(machine_config &config)
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_raw(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192);
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_ff));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, false, false>)));
|
||||
m_screen->set_palette(m_video);
|
||||
|
||||
/* sound hardware */
|
||||
@ -5153,7 +5069,7 @@ void apple2e_state::spectred(machine_config &config)
|
||||
apple2e(config);
|
||||
i8035_device &keyb_mcu(I8035(config, "keyb_mcu", XTAL(4'000'000))); /* guessed frequency */
|
||||
keyb_mcu.set_addrmap(AS_PROGRAM, &apple2e_state::spectred_keyb_map);
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_ft));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, false, true>)));
|
||||
|
||||
// TODO: implement the actual interfacing to this 8035 MCU and
|
||||
// and then remove the keyb CPU inherited from apple2e
|
||||
@ -5280,7 +5196,7 @@ void apple2e_state::laser128(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::laser128_map);
|
||||
m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline));
|
||||
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_tf));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, true, false>)));
|
||||
|
||||
IWM(config, m_iwm, A2BUS_7M_CLOCK, 1021800 * 2);
|
||||
m_iwm->phases_cb().set(FUNC(apple2e_state::phases_w));
|
||||
@ -5315,7 +5231,7 @@ void apple2e_state::laser128o(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::laser128_map);
|
||||
m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline));
|
||||
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_tf));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, true, false>)));
|
||||
|
||||
IWM(config, m_iwm, A2BUS_7M_CLOCK, 1021800 * 2);
|
||||
m_iwm->phases_cb().set(FUNC(apple2e_state::phases_w));
|
||||
@ -5351,7 +5267,7 @@ void apple2e_state::laser128ex2(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::laser128_map);
|
||||
m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline));
|
||||
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_tf));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, true, false>)));
|
||||
|
||||
IWM(config, m_iwm, A2BUS_7M_CLOCK, 1021800 * 2);
|
||||
m_iwm->phases_cb().set(FUNC(apple2e_state::phases_w));
|
||||
@ -5388,7 +5304,7 @@ void apple2e_state::ace500(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::ace500_map);
|
||||
m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline));
|
||||
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_tt));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, true, true>)));
|
||||
|
||||
CENTRONICS(config, m_printer_conn, centronics_devices, "printer");
|
||||
m_printer_conn->busy_handler().set(FUNC(apple2e_state::busy_w));
|
||||
@ -5430,7 +5346,7 @@ void apple2e_state::ace2200(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &apple2e_state::ace2200_map);
|
||||
m_maincpu->set_dasm_override(FUNC(apple2e_state::dasm_trampoline));
|
||||
|
||||
m_screen->set_screen_update(FUNC(apple2e_state::screen_update_tt));
|
||||
m_screen->set_screen_update(m_video, NAME((&a2_video_device::screen_update<a2_video_device::model::IIE, true, true>)));
|
||||
|
||||
// The Ace 2000 series has 3 physical slots, 2, 4/7, and 5.
|
||||
// 4/7 can be slot 4 or 7 via a jumper; we fix it to slot 7 here
|
||||
|
@ -224,9 +224,11 @@ void a2_video_device::plot_text_character(bitmap_ind16 &bitmap, int xpos, int yp
|
||||
}
|
||||
}
|
||||
|
||||
inline bool a2_video_device::use_page_2() const { return m_page2 && !m_80store; }
|
||||
|
||||
void a2_video_device::lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
|
||||
{
|
||||
uint32_t const start_address = m_80store ? 0x400 : m_page2 ? 0x0800 : 0x0400;
|
||||
uint32_t const start_address = use_page_2() ? 0x0800 : 0x0400;
|
||||
int fg = 0;
|
||||
|
||||
switch (m_sysconfig & 0x03)
|
||||
@ -342,7 +344,7 @@ void a2_video_device::lores_update(screen_device &screen, bitmap_ind16 &bitmap,
|
||||
|
||||
void a2_video_device::dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
|
||||
{
|
||||
uint32_t const start_address = m_page2 ? 0x0800 : 0x0400;
|
||||
uint32_t const start_address = use_page_2() ? 0x0800 : 0x0400;
|
||||
static const int aux_colors[16] = { 0, 2, 4, 6, 8, 0xa, 0xc, 0xe, 1, 3, 5, 7, 9, 0xb, 0xd, 0xf };
|
||||
int fg = 0;
|
||||
|
||||
@ -541,7 +543,7 @@ void a2_video_device::text_update(screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
{
|
||||
uint8_t const *const aux_page = m_aux_ptr ? m_aux_ptr : m_ram_ptr;
|
||||
|
||||
uint32_t const start_address = m_page2 ? 0x800 : 0x400;
|
||||
uint32_t const start_address = use_page_2() ? 0x0800 : 0x0400;
|
||||
|
||||
beginrow = (std::max)(beginrow, cliprect.top() - (cliprect.top() % 8));
|
||||
endrow = (std::min)(endrow, cliprect.bottom() - (cliprect.bottom() % 8) + 7);
|
||||
@ -703,7 +705,7 @@ void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, co
|
||||
case 3: fg = ORANGE; break;
|
||||
}
|
||||
|
||||
uint8_t const *const vram = &m_ram_ptr[(m_page2 ? 0x4000 : 0x2000)];
|
||||
uint8_t const *const vram = &m_ram_ptr[use_page_2() ? 0x4000 : 0x2000];
|
||||
|
||||
// verified on h/w: setting dhires w/o 80col emulates a rev. 0 Apple ][ with no orange/blue
|
||||
uint8_t const bit7_mask = m_dhires ? 0x7f : 0xff;
|
||||
@ -756,7 +758,7 @@ void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, co
|
||||
void a2_video_device::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
|
||||
{
|
||||
uint16_t v;
|
||||
int const page = m_page2 ? 0x4000 : 0x2000;
|
||||
int const page = use_page_2() ? 0x4000 : 0x2000;
|
||||
int mon_type = m_sysconfig & 0x03;
|
||||
bool const bIsRGB = ((m_sysconfig & 7) == 4);
|
||||
bool const bIsRGBMixed = ((bIsRGB) && (m_rgbmode == 1));
|
||||
@ -1121,7 +1123,7 @@ uint32_t a2_video_device::screen_update_GS(screen_device &screen, bitmap_rgb32 &
|
||||
if (beamy >= BORDER_TOP)
|
||||
{
|
||||
rectangle const new_cliprect(0, 559, cliprect.top() - BORDER_TOP, cliprect.bottom() - BORDER_TOP);
|
||||
screen_update_GS_8bit(screen, *m_8bit_graphics, new_cliprect);
|
||||
screen_update<model::IIGS, false, false>(screen, *m_8bit_graphics, new_cliprect);
|
||||
}
|
||||
|
||||
if ((beamy < (BORDER_TOP+4)) || (beamy >= (192+4+BORDER_TOP)))
|
||||
@ -1158,86 +1160,63 @@ uint32_t a2_video_device::screen_update_GS(screen_device &screen, bitmap_rgb32 &
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t a2_video_device::screen_update_GS_8bit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
template <a2_video_device::model Model, bool Invert, bool Flip>
|
||||
uint32_t a2_video_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bool old_page2 = m_page2;
|
||||
|
||||
if (cliprect.bottom() > 191)
|
||||
if (Model == model::IIGS && cliprect.bottom() > 191)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// don't display page2 if 80store is set (we just saved the previous value, don't worry)
|
||||
if (m_80store)
|
||||
{
|
||||
m_page2 = false;
|
||||
}
|
||||
|
||||
// always update the flash timer here so it's smooth regardless of mode switches
|
||||
m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
|
||||
|
||||
int text_start_row = 0;
|
||||
|
||||
if (m_graphics)
|
||||
{
|
||||
text_start_row = m_mix ? 160 : 192;
|
||||
|
||||
if (m_hires)
|
||||
{
|
||||
if (m_mix)
|
||||
if ((Model == model::IIE || Model == model::IIGS) && m_dhires && m_80col)
|
||||
{
|
||||
if ((m_dhires) && (m_80col))
|
||||
{
|
||||
dhgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
else
|
||||
{
|
||||
hgr_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
text_update<model::IIGS, false, false>(screen, bitmap, cliprect, 160, 191);
|
||||
dhgr_update(screen, bitmap, cliprect, 0, text_start_row - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((m_dhires) && (m_80col))
|
||||
{
|
||||
dhgr_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
|
||||
}
|
||||
else
|
||||
{
|
||||
hgr_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
|
||||
}
|
||||
hgr_update(screen, bitmap, cliprect, 0, text_start_row - 1);
|
||||
}
|
||||
}
|
||||
else // lo-res
|
||||
{
|
||||
if (m_mix)
|
||||
if ((Model == model::IIE || Model == model::IIGS) && m_dhires && m_80col)
|
||||
{
|
||||
if ((m_dhires) && (m_80col))
|
||||
{
|
||||
dlores_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
else
|
||||
{
|
||||
lores_update(screen, bitmap, cliprect, 0, 159);
|
||||
}
|
||||
|
||||
text_update<model::IIGS, false, false>(screen, bitmap, cliprect, 160, 191);
|
||||
dlores_update(screen, bitmap, cliprect, 0, text_start_row - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((m_dhires) && (m_80col))
|
||||
{
|
||||
dlores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
|
||||
}
|
||||
else
|
||||
{
|
||||
lores_update(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
|
||||
}
|
||||
lores_update(screen, bitmap, cliprect, 0, text_start_row - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
text_update<model::IIGS, false, false>(screen, bitmap, cliprect, cliprect.top(), cliprect.bottom());
|
||||
}
|
||||
|
||||
m_page2 = old_page2;
|
||||
if (text_start_row < 192)
|
||||
{
|
||||
text_update<Model, Invert, Flip>(screen, bitmap, cliprect, text_start_row, 191);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::II, true, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::II, true, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::II, false, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::II, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, true, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, true, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, false, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIGS, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::II_J_PLUS, true, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
template uint32_t a2_video_device::screen_update<a2_video_device::model::IVEL_ULTRA, true, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
@ -53,15 +53,12 @@ public:
|
||||
enum class model { II, IIE, IIGS, II_J_PLUS, IVEL_ULTRA };
|
||||
|
||||
template <model Model, bool Invert, bool Flip>
|
||||
void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
|
||||
void lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
void dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
void hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
void dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
uint32_t screen_update_GS(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_GS_8bit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// This is called directly by the superga2 and tk2000 drivers.
|
||||
void hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
|
||||
protected:
|
||||
virtual void device_reset() override;
|
||||
@ -71,8 +68,17 @@ protected:
|
||||
void init_palette();
|
||||
|
||||
private:
|
||||
template <model Model, bool Invert, bool Flip>
|
||||
void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
|
||||
template <model Model, bool Invert, bool Flip>
|
||||
void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, int fg, int bg);
|
||||
|
||||
void lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
void dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
void dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
|
||||
|
||||
bool use_page_2() const;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
Loading…
Reference in New Issue
Block a user