mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Modernization of drivers part 8 (no whatsnew)
This commit is contained in:
parent
30585a50b7
commit
64763777a1
@ -374,42 +374,41 @@ Notes:
|
||||
*
|
||||
*************************************/
|
||||
|
||||
INLINE int determine_irq_state(itech32_state *state, int vint, int xint, int qint)
|
||||
inline int itech32_state::determine_irq_state(int vint, int xint, int qint)
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
|
||||
/* determine which level is active */
|
||||
if (state->m_vint_state) level = 1;
|
||||
if (state->m_xint_state) level = 2;
|
||||
if (state->m_qint_state) level = 3;
|
||||
if (m_vint_state) level = 1;
|
||||
if (m_xint_state) level = 2;
|
||||
if (m_qint_state) level = 3;
|
||||
|
||||
/* Driver's Edge shifts the interrupts a bit */
|
||||
if (state->m_is_drivedge && level) level += 2;
|
||||
if (m_is_drivedge && level) level += 2;
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
|
||||
void itech32_update_interrupts(running_machine &machine, int vint, int xint, int qint)
|
||||
void itech32_state::itech32_update_interrupts(int vint, int xint, int qint)
|
||||
{
|
||||
itech32_state *state = machine.driver_data<itech32_state>();
|
||||
/* update the states */
|
||||
if (vint != -1) state->m_vint_state = vint;
|
||||
if (xint != -1) state->m_xint_state = xint;
|
||||
if (qint != -1) state->m_qint_state = qint;
|
||||
if (vint != -1) m_vint_state = vint;
|
||||
if (xint != -1) m_xint_state = xint;
|
||||
if (qint != -1) m_qint_state = qint;
|
||||
|
||||
if (state->m_is_drivedge)
|
||||
if (m_is_drivedge)
|
||||
{
|
||||
machine.device("maincpu")->execute().set_input_line(3, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine.device("maincpu")->execute().set_input_line(4, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine.device("maincpu")->execute().set_input_line(5, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(3, m_vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(4, m_xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(5, m_qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.device("maincpu")->execute().set_input_line(1, state->m_vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine.device("maincpu")->execute().set_input_line(2, state->m_xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine.device("maincpu")->execute().set_input_line(3, state->m_qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(1, m_vint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(2, m_xint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(3, m_qint_state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,14 +416,14 @@ void itech32_update_interrupts(running_machine &machine, int vint, int xint, int
|
||||
INTERRUPT_GEN_MEMBER(itech32_state::generate_int1)
|
||||
{
|
||||
/* signal the NMI */
|
||||
itech32_update_interrupts(machine(), 1, -1, -1);
|
||||
itech32_update_interrupts(1, -1, -1);
|
||||
if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", machine().primary_screen->vpos());
|
||||
}
|
||||
|
||||
|
||||
WRITE16_MEMBER(itech32_state::int1_ack_w)
|
||||
{
|
||||
itech32_update_interrupts(machine(), 0, -1, -1);
|
||||
itech32_update_interrupts(0, -1, -1);
|
||||
}
|
||||
|
||||
|
||||
@ -873,15 +872,14 @@ WRITE32_MEMBER(itech32_state::int1_ack32_w)
|
||||
|
||||
void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
|
||||
{
|
||||
itech32_state *state = machine().driver_data<itech32_state>();
|
||||
// if nvram is the main RAM, don't overwrite exception vectors
|
||||
int start = (base == state->m_main_ram) ? 0x80 : 0x00;
|
||||
int start = (base == m_main_ram) ? 0x80 : 0x00;
|
||||
for (int i = start; i < length; i++)
|
||||
((UINT8 *)base)[i] = machine().rand();
|
||||
|
||||
// due to accessing uninitialized RAM, we need this hack
|
||||
if (state->m_is_drivedge)
|
||||
((UINT32 *)state->m_main_ram.target())[0x2ce4/4] = 0x0000001e;
|
||||
if (m_is_drivedge)
|
||||
((UINT32 *)m_main_ram.target())[0x2ce4/4] = 0x0000001e;
|
||||
}
|
||||
|
||||
|
||||
@ -4111,18 +4109,17 @@ ROM_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void init_program_rom(running_machine &machine)
|
||||
void itech32_state::init_program_rom()
|
||||
{
|
||||
itech32_state *state = machine.driver_data<itech32_state>();
|
||||
if (state->m_main_ram == NULL)
|
||||
state->m_main_ram.set_target(state->m_nvram, state->m_nvram.bytes());
|
||||
memcpy(state->m_main_ram, state->m_main_rom, 0x80);
|
||||
if (m_main_ram == NULL)
|
||||
m_main_ram.set_target(m_nvram, m_nvram.bytes());
|
||||
memcpy(m_main_ram, m_main_rom, 0x80);
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,timekill)
|
||||
{
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 512;
|
||||
m_planes = 2;
|
||||
m_is_drivedge = 0;
|
||||
@ -4131,7 +4128,7 @@ DRIVER_INIT_MEMBER(itech32_state,timekill)
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,hardyard)
|
||||
{
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
m_is_drivedge = 0;
|
||||
@ -4140,7 +4137,7 @@ DRIVER_INIT_MEMBER(itech32_state,hardyard)
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,bloodstm)
|
||||
{
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
m_is_drivedge = 0;
|
||||
@ -4149,7 +4146,7 @@ DRIVER_INIT_MEMBER(itech32_state,bloodstm)
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,drivedge)
|
||||
{
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
m_is_drivedge = 1;
|
||||
@ -4167,7 +4164,7 @@ DRIVER_INIT_MEMBER(itech32_state,wcbowl)
|
||||
ROM P/N 1079 Rev 1 (contains graphic roms, 4MHz OSC + ITBWL-1 security PIC chip)
|
||||
Sound P/N 1060 Rev 0 (see Hot Memory PCB layout above)
|
||||
*/
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
|
||||
@ -4187,7 +4184,7 @@ DRIVER_INIT_MEMBER(itech32_state,wcbowlj)
|
||||
ROM P/N 1079 Rev 1 (contains graphic roms, 4MHz OSC + ITBWL-1 security PIC chip)
|
||||
Sound P/N 1060 Rev 0 (see Hot Memory PCB layout above)
|
||||
*/
|
||||
init_program_rom(machine());
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
|
||||
@ -4200,90 +4197,87 @@ DRIVER_INIT_MEMBER(itech32_state,wcbowlj)
|
||||
}
|
||||
|
||||
|
||||
static void init_sftm_common(running_machine &machine, int prot_addr)
|
||||
void itech32_state::init_sftm_common(int prot_addr)
|
||||
{
|
||||
itech32_state *state = machine.driver_data<itech32_state>();
|
||||
init_program_rom(machine);
|
||||
state->m_vram_height = 1024;
|
||||
state->m_planes = 1;
|
||||
state->m_is_drivedge = 0;
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
m_is_drivedge = 0;
|
||||
|
||||
state->m_itech020_prot_address = prot_addr;
|
||||
m_itech020_prot_address = prot_addr;
|
||||
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state));
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),this));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),this));
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,sftm)
|
||||
{
|
||||
init_sftm_common(machine(), 0x7a6a);
|
||||
init_sftm_common(0x7a6a);
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,sftm110)
|
||||
{
|
||||
init_sftm_common(machine(), 0x7a66);
|
||||
init_sftm_common(0x7a66);
|
||||
}
|
||||
|
||||
|
||||
static void init_shuffle_bowl_common(running_machine &machine, int prot_addr)
|
||||
void itech32_state::init_shuffle_bowl_common(int prot_addr)
|
||||
{
|
||||
itech32_state *state = machine.driver_data<itech32_state>();
|
||||
/*
|
||||
The newest versions of World Class Bowling are on the same exact
|
||||
platform as Shuffle Shot. So We'll use the same general INIT
|
||||
routine for these two programs. IE: PCB P/N 1083 Rev 2
|
||||
*/
|
||||
init_program_rom(machine);
|
||||
state->m_vram_height = 1024;
|
||||
state->m_planes = 1;
|
||||
state->m_is_drivedge = 0;
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 1;
|
||||
m_is_drivedge = 0;
|
||||
|
||||
state->m_itech020_prot_address = prot_addr;
|
||||
m_itech020_prot_address = prot_addr;
|
||||
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),state));
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),state));
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),state));
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),state));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(itech32_state::itech020_color2_w),this));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x380000, 0x380003, write32_delegate(FUNC(itech32_state::itech020_color1_w),this));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),this));
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,shufshot)
|
||||
{
|
||||
init_shuffle_bowl_common(machine(), 0x111a);
|
||||
init_shuffle_bowl_common(0x111a);
|
||||
}
|
||||
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,wcbowln)
|
||||
{
|
||||
/* The security PROM is NOT interchangeable between the Deluxe and "normal" versions. */
|
||||
init_shuffle_bowl_common(machine(), 0x1116);
|
||||
init_shuffle_bowl_common(0x1116);
|
||||
}
|
||||
|
||||
static void install_timekeeper(running_machine &machine)
|
||||
void itech32_state::install_timekeeper()
|
||||
{
|
||||
device_t *device = machine.device("m48t02");
|
||||
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_r), FUNC(timekeeper_w), 0xffffffff);
|
||||
device_t *device = machine().device("m48t02");
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_r), FUNC(timekeeper_w), 0xffffffff);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(itech32_state,wcbowlt)
|
||||
{
|
||||
/* Tournament Version, Same protection memory address as WCB Deluxe, but uses the standard WCB pic ITBWL-3 */
|
||||
init_shuffle_bowl_common(machine(), 0x111a);
|
||||
init_shuffle_bowl_common(0x111a);
|
||||
|
||||
install_timekeeper(machine());
|
||||
install_timekeeper();
|
||||
}
|
||||
|
||||
static void init_gt_common(running_machine &machine)
|
||||
void itech32_state::init_gt_common()
|
||||
{
|
||||
itech32_state *state = machine.driver_data<itech32_state>();
|
||||
init_program_rom(machine);
|
||||
state->m_vram_height = 1024;
|
||||
state->m_planes = 2;
|
||||
state->m_is_drivedge = 0;
|
||||
init_program_rom();
|
||||
m_vram_height = 1024;
|
||||
m_planes = 2;
|
||||
m_is_drivedge = 0;
|
||||
|
||||
state->m_itech020_prot_address = 0x112f;
|
||||
m_itech020_prot_address = 0x112f;
|
||||
}
|
||||
|
||||
|
||||
@ -4297,7 +4291,7 @@ DRIVER_INIT_MEMBER(itech32_state,gt3d)
|
||||
through GTClassic. This is _NOT_ a factory modification
|
||||
*/
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200003, read32_delegate(FUNC(itech32_state::trackball32_8bit_r),this));
|
||||
init_gt_common(machine());
|
||||
init_gt_common();
|
||||
}
|
||||
|
||||
|
||||
@ -4311,7 +4305,7 @@ DRIVER_INIT_MEMBER(itech32_state,aama)
|
||||
*/
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x180800, 0x180803, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this));
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x181000, 0x181003, read32_delegate(FUNC(itech32_state::trackball32_4bit_p2_r),this));
|
||||
init_gt_common(machine());
|
||||
init_gt_common();
|
||||
}
|
||||
|
||||
|
||||
@ -4322,7 +4316,7 @@ DRIVER_INIT_MEMBER(itech32_state,aamat)
|
||||
*/
|
||||
DRIVER_INIT_CALL(aama);
|
||||
|
||||
install_timekeeper(machine());
|
||||
install_timekeeper();
|
||||
}
|
||||
|
||||
|
||||
@ -4335,7 +4329,7 @@ DRIVER_INIT_MEMBER(itech32_state,s_ver)
|
||||
Trackball info is read through 200202 (actually 200203).
|
||||
*/
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200200, 0x200203, read32_delegate(FUNC(itech32_state::trackball32_4bit_p1_r),this));
|
||||
init_gt_common(machine());
|
||||
init_gt_common();
|
||||
}
|
||||
|
||||
|
||||
@ -4349,7 +4343,7 @@ DRIVER_INIT_MEMBER(itech32_state,gt3dl)
|
||||
Player 2 trackball read through 200002
|
||||
*/
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000, 0x200003, read32_delegate(FUNC(itech32_state::trackball32_4bit_combined_r),this));
|
||||
init_gt_common(machine());
|
||||
init_gt_common();
|
||||
}
|
||||
|
||||
|
||||
|
@ -569,30 +569,29 @@ static const via6522_interface via_interface =
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void itech8_update_interrupts(running_machine &machine, int periodic, int tms34061, int blitter)
|
||||
void itech8_state::itech8_update_interrupts(int periodic, int tms34061, int blitter)
|
||||
{
|
||||
itech8_state *state = machine.driver_data<itech8_state>();
|
||||
device_type main_cpu_type = machine.device("maincpu")->type();
|
||||
device_type main_cpu_type = machine().device("maincpu")->type();
|
||||
|
||||
/* update the states */
|
||||
if (periodic != -1) state->m_periodic_int = periodic;
|
||||
if (tms34061 != -1) state->m_tms34061_int = tms34061;
|
||||
if (blitter != -1) state->m_blitter_int = blitter;
|
||||
if (periodic != -1) m_periodic_int = periodic;
|
||||
if (tms34061 != -1) m_tms34061_int = tms34061;
|
||||
if (blitter != -1) m_blitter_int = blitter;
|
||||
|
||||
/* handle the 6809 case */
|
||||
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
|
||||
{
|
||||
/* just modify lines that have changed */
|
||||
if (periodic != -1) machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (tms34061 != -1) machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (blitter != -1) machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (periodic != -1) machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (tms34061 != -1) machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, tms34061 ? ASSERT_LINE : CLEAR_LINE);
|
||||
if (blitter != -1) machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, blitter ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
/* handle the 68000 case */
|
||||
else
|
||||
{
|
||||
machine.device("maincpu")->execute().set_input_line(2, state->m_blitter_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine.device("maincpu")->execute().set_input_line(3, state->m_periodic_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(2, m_blitter_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(3, m_periodic_int ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,14 +605,14 @@ void itech8_update_interrupts(running_machine &machine, int periodic, int tms340
|
||||
|
||||
TIMER_CALLBACK_MEMBER(itech8_state::irq_off)
|
||||
{
|
||||
itech8_update_interrupts(machine(), 0, -1, -1);
|
||||
itech8_update_interrupts(0, -1, -1);
|
||||
}
|
||||
|
||||
|
||||
INTERRUPT_GEN_MEMBER(itech8_state::generate_nmi)
|
||||
{
|
||||
/* signal the NMI */
|
||||
itech8_update_interrupts(machine(), 1, -1, -1);
|
||||
itech8_update_interrupts(1, -1, -1);
|
||||
machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(itech8_state::irq_off),this));
|
||||
|
||||
if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", machine().primary_screen->vpos());
|
||||
|
@ -37,4 +37,5 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_ikki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(ikki_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
@ -83,8 +83,12 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(scanline_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback);
|
||||
void _irobot_poly_clear(UINT8 *bitmap_base);
|
||||
void irobot_poly_clear();
|
||||
void draw_line(UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col);
|
||||
void irobot_run_video();
|
||||
UINT32 irmb_din(const irmb_ops *curop);
|
||||
void irmb_dout(const irmb_ops *curop, UINT32 d);
|
||||
void load_oproms();
|
||||
void irmb_run();
|
||||
};
|
||||
|
||||
/*----------- defined in video/irobot.c -----------*/
|
||||
void irobot_poly_clear(running_machine &machine);
|
||||
void irobot_run_video(running_machine &machine);
|
||||
|
@ -52,4 +52,6 @@ public:
|
||||
UINT32 screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(ironhors_irq);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(farwest_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
@ -163,7 +163,25 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(generate_int1);
|
||||
TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
|
||||
TIMER_CALLBACK_MEMBER(scanline_interrupt);
|
||||
inline offs_t compute_safe_address(int x, int y);
|
||||
inline void disable_clipping();
|
||||
inline void enable_clipping();
|
||||
void logblit(const char *tag);
|
||||
void update_interrupts(int fast);
|
||||
void draw_raw(UINT16 *base, UINT16 color);
|
||||
void draw_raw_drivedge(UINT16 *base, UINT16 *zbase, UINT16 color);
|
||||
inline void draw_rle_fast(UINT16 *base, UINT16 color);
|
||||
inline void draw_rle_fast_xflip(UINT16 *base, UINT16 color);
|
||||
inline void draw_rle_slow(UINT16 *base, UINT16 color);
|
||||
void draw_rle(UINT16 *base, UINT16 color);
|
||||
void shiftreg_clear(UINT16 *base, UINT16 *zbase);
|
||||
void handle_video_command();
|
||||
inline int determine_irq_state(int vint, int xint, int qint);
|
||||
void itech32_update_interrupts(int vint, int xint, int qint);
|
||||
void init_program_rom();
|
||||
void init_sftm_common(int prot_addr);
|
||||
void init_shuffle_bowl_common(int prot_addr);
|
||||
void install_timekeeper();
|
||||
void init_gt_common();
|
||||
};
|
||||
|
||||
/*----------- defined in drivers/itech32.c -----------*/
|
||||
void itech32_update_interrupts(running_machine &machine, int vint, int xint, int qint);
|
||||
|
@ -104,14 +104,14 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
|
||||
TIMER_CALLBACK_MEMBER(blitter_done);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update);
|
||||
inline UINT8 fetch_next_raw();
|
||||
inline void consume_raw(int count);
|
||||
inline UINT8 fetch_next_rle();
|
||||
inline void consume_rle(int count);
|
||||
void perform_blit(address_space &space);
|
||||
void itech8_update_interrupts(int periodic, int tms34061, int blitter);
|
||||
};
|
||||
|
||||
|
||||
/*----------- defined in drivers/itech8.c -----------*/
|
||||
|
||||
void itech8_update_interrupts(running_machine &machine, int periodic, int tms34061, int blitter);
|
||||
|
||||
|
||||
/*----------- defined in machine/slikshot.c -----------*/
|
||||
|
||||
DECLARE_READ8_HANDLER( slikz80_port_r );
|
||||
|
@ -27,13 +27,6 @@
|
||||
"%s, scanline: %d\n", (m).describe_context(), (m).primary_screen->vpos())
|
||||
|
||||
|
||||
static void irmb_run(running_machine &machine);
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
READ8_MEMBER(irobot_state::irobot_sharedmem_r)
|
||||
{
|
||||
if (m_outx == 3)
|
||||
@ -76,13 +69,13 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w)
|
||||
m_combase_mb = m_comRAM[(data >> 7) ^ 1];
|
||||
m_bufsel = data & 0x02;
|
||||
if (((data & 0x01) == 0x01) && (m_vg_clear == 0))
|
||||
irobot_poly_clear(machine());
|
||||
irobot_poly_clear();
|
||||
|
||||
m_vg_clear = data & 0x01;
|
||||
|
||||
if ((data & 0x04) && !(m_statwr & 0x04))
|
||||
{
|
||||
irobot_run_video(machine());
|
||||
irobot_run_video();
|
||||
#if IR_TIMING
|
||||
if (m_irvg_running == 0)
|
||||
logerror("vg start ");
|
||||
@ -94,7 +87,7 @@ WRITE8_MEMBER(irobot_state::irobot_statwr_w)
|
||||
m_irvg_running=1;
|
||||
}
|
||||
if ((data & 0x10) && !(m_statwr & 0x10))
|
||||
irmb_run(machine());
|
||||
irmb_run();
|
||||
m_statwr = data;
|
||||
}
|
||||
|
||||
@ -287,86 +280,85 @@ static void disassemble_instruction(irmb_ops *op);
|
||||
#endif
|
||||
|
||||
|
||||
static UINT32 irmb_din(irobot_state *state, const irmb_ops *curop)
|
||||
UINT32 irobot_state::irmb_din(const irmb_ops *curop)
|
||||
{
|
||||
UINT32 d = 0;
|
||||
|
||||
if (!(curop->flags & FL_MBMEMDEC) && (curop->flags & FL_MBRW))
|
||||
{
|
||||
UINT32 ad = curop->diradd | (state->m_irmb_latch & curop->latchmask);
|
||||
UINT32 ad = curop->diradd | (m_irmb_latch & curop->latchmask);
|
||||
|
||||
if (curop->diren || (state->m_irmb_latch & 0x6000) == 0)
|
||||
d = ((UINT16 *)state->m_mbRAM)[ad & 0xfff]; /* MB RAM read */
|
||||
else if (state->m_irmb_latch & 0x4000)
|
||||
d = ((UINT16 *)state->m_mbROM)[ad + 0x2000]; /* MB ROM read, CEMATH = 1 */
|
||||
if (curop->diren || (m_irmb_latch & 0x6000) == 0)
|
||||
d = ((UINT16 *)m_mbRAM)[ad & 0xfff]; /* MB RAM read */
|
||||
else if (m_irmb_latch & 0x4000)
|
||||
d = ((UINT16 *)m_mbROM)[ad + 0x2000]; /* MB ROM read, CEMATH = 1 */
|
||||
else
|
||||
d = ((UINT16 *)state->m_mbROM)[ad & 0x1fff]; /* MB ROM read, CEMATH = 0 */
|
||||
d = ((UINT16 *)m_mbROM)[ad & 0x1fff]; /* MB ROM read, CEMATH = 0 */
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
static void irmb_dout(irobot_state *state, const irmb_ops *curop, UINT32 d)
|
||||
void irobot_state::irmb_dout(const irmb_ops *curop, UINT32 d)
|
||||
{
|
||||
/* Write to video com ram */
|
||||
if (curop->ramsel == 3)
|
||||
((UINT16 *)state->m_combase_mb)[state->m_irmb_latch & 0x7ff] = d;
|
||||
((UINT16 *)m_combase_mb)[m_irmb_latch & 0x7ff] = d;
|
||||
|
||||
/* Write to mathox ram */
|
||||
if (!(curop->flags & FL_MBMEMDEC))
|
||||
{
|
||||
UINT32 ad = curop->diradd | (state->m_irmb_latch & curop->latchmask);
|
||||
UINT32 ad = curop->diradd | (m_irmb_latch & curop->latchmask);
|
||||
|
||||
if (curop->diren || (state->m_irmb_latch & 0x6000) == 0)
|
||||
((UINT16 *)state->m_mbRAM)[ad & 0xfff] = d; /* MB RAM write */
|
||||
if (curop->diren || (m_irmb_latch & 0x6000) == 0)
|
||||
((UINT16 *)m_mbRAM)[ad & 0xfff] = d; /* MB RAM write */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Convert microcode roms to a more usable form */
|
||||
static void load_oproms(running_machine &machine)
|
||||
void irobot_state::load_oproms()
|
||||
{
|
||||
irobot_state *state = machine.driver_data<irobot_state>();
|
||||
UINT8 *MB = state->memregion("proms")->base() + 0x20;
|
||||
UINT8 *MB = memregion("proms")->base() + 0x20;
|
||||
int i;
|
||||
|
||||
/* allocate RAM */
|
||||
state->m_mbops = auto_alloc_array(machine, irmb_ops, 1024);
|
||||
m_mbops = auto_alloc_array(machine(), irmb_ops, 1024);
|
||||
|
||||
for (i = 0; i < 1024; i++)
|
||||
{
|
||||
int nxtadd, func, ramsel, diradd, latchmask, dirmask, time;
|
||||
|
||||
state->m_mbops[i].areg = &state->m_irmb_regs[MB[0x0000 + i] & 0x0F];
|
||||
state->m_mbops[i].breg = &state->m_irmb_regs[MB[0x0400 + i] & 0x0F];
|
||||
m_mbops[i].areg = &m_irmb_regs[MB[0x0000 + i] & 0x0F];
|
||||
m_mbops[i].breg = &m_irmb_regs[MB[0x0400 + i] & 0x0F];
|
||||
func = (MB[0x0800 + i] & 0x0F) << 5;
|
||||
func |= ((MB[0x0C00 +i] & 0x0F) << 1);
|
||||
func |= (MB[0x1000 + i] & 0x08) >> 3;
|
||||
time = MB[0x1000 + i] & 0x03;
|
||||
state->m_mbops[i].flags = (MB[0x1000 + i] & 0x04) >> 2;
|
||||
m_mbops[i].flags = (MB[0x1000 + i] & 0x04) >> 2;
|
||||
nxtadd = (MB[0x1400 + i] & 0x0C) >> 2;
|
||||
diradd = MB[0x1400 + i] & 0x03;
|
||||
nxtadd |= ((MB[0x1800 + i] & 0x0F) << 6);
|
||||
nxtadd |= ((MB[0x1C00 + i] & 0x0F) << 2);
|
||||
diradd |= (MB[0x2000 + i] & 0x0F) << 2;
|
||||
func |= (MB[0x2400 + i] & 0x0E) << 9;
|
||||
state->m_mbops[i].flags |= (MB[0x2400 + i] & 0x01) << 1;
|
||||
state->m_mbops[i].flags |= (MB[0x2800 + i] & 0x0F) << 2;
|
||||
state->m_mbops[i].flags |= ((MB[0x2C00 + i] & 0x01) << 6);
|
||||
state->m_mbops[i].flags |= (MB[0x2C00 + i] & 0x08) << 4;
|
||||
m_mbops[i].flags |= (MB[0x2400 + i] & 0x01) << 1;
|
||||
m_mbops[i].flags |= (MB[0x2800 + i] & 0x0F) << 2;
|
||||
m_mbops[i].flags |= ((MB[0x2C00 + i] & 0x01) << 6);
|
||||
m_mbops[i].flags |= (MB[0x2C00 + i] & 0x08) << 4;
|
||||
ramsel = (MB[0x2C00 + i] & 0x06) >> 1;
|
||||
diradd |= (MB[0x3000 + i] & 0x03) << 6;
|
||||
|
||||
if (state->m_mbops[i].flags & FL_shift) func |= 0x200;
|
||||
if (m_mbops[i].flags & FL_shift) func |= 0x200;
|
||||
|
||||
state->m_mbops[i].func = func;
|
||||
state->m_mbops[i].nxtop = &state->m_mbops[nxtadd];
|
||||
m_mbops[i].func = func;
|
||||
m_mbops[i].nxtop = &m_mbops[nxtadd];
|
||||
|
||||
/* determine the number of 12MHz cycles for this operation */
|
||||
if (time == 3)
|
||||
state->m_mbops[i].cycles = 2;
|
||||
m_mbops[i].cycles = 2;
|
||||
else
|
||||
state->m_mbops[i].cycles = 3 + time;
|
||||
m_mbops[i].cycles = 3 + time;
|
||||
|
||||
/* precompute the hardcoded address bits and the mask to be used on the latch value */
|
||||
if (ramsel == 0)
|
||||
@ -384,13 +376,13 @@ static void load_oproms(running_machine &machine)
|
||||
else
|
||||
dirmask |= 0x0003;
|
||||
|
||||
state->m_mbops[i].ramsel = ramsel;
|
||||
state->m_mbops[i].diradd = diradd & dirmask;
|
||||
state->m_mbops[i].latchmask = latchmask;
|
||||
state->m_mbops[i].diren = (ramsel == 0);
|
||||
m_mbops[i].ramsel = ramsel;
|
||||
m_mbops[i].diradd = diradd & dirmask;
|
||||
m_mbops[i].latchmask = latchmask;
|
||||
m_mbops[i].diren = (ramsel == 0);
|
||||
|
||||
#if DISASSEMBLE_MB_ROM
|
||||
disassemble_instruction(&state->m_mbops[i]);
|
||||
disassemble_instruction(&m_mbops[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -406,7 +398,7 @@ DRIVER_INIT_MEMBER(irobot_state,irobot)
|
||||
m_irmb_regs[i] = 0;
|
||||
}
|
||||
m_irmb_latch=0;
|
||||
load_oproms(machine());
|
||||
load_oproms();
|
||||
}
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irmb_done_callback)
|
||||
@ -525,16 +517,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irmb_done_callback)
|
||||
#define JUMP3 if (!nflag) curop = curop->nxtop; else curop++;
|
||||
#define JUMP4 if (nflag) curop = curop->nxtop; else curop++;
|
||||
#define JUMP5 curop = curop->nxtop;
|
||||
#define JUMP6 state->m_irmb_stack[SP] = curop + 1; SP = (SP + 1) & 15; curop = curop->nxtop;
|
||||
#define JUMP7 SP = (SP - 1) & 15; curop = state->m_irmb_stack[SP];
|
||||
#define JUMP6 m_irmb_stack[SP] = curop + 1; SP = (SP + 1) & 15; curop = curop->nxtop;
|
||||
#define JUMP7 SP = (SP - 1) & 15; curop = m_irmb_stack[SP];
|
||||
|
||||
|
||||
/* Run mathbox */
|
||||
static void irmb_run(running_machine &machine)
|
||||
void irobot_state::irmb_run()
|
||||
{
|
||||
irobot_state *state = machine.driver_data<irobot_state>();
|
||||
const irmb_ops *prevop = &state->m_mbops[0];
|
||||
const irmb_ops *curop = &state->m_mbops[0];
|
||||
const irmb_ops *prevop = &m_mbops[0];
|
||||
const irmb_ops *curop = &m_mbops[0];
|
||||
|
||||
UINT32 Q = 0;
|
||||
UINT32 Y = 0;
|
||||
@ -579,65 +570,65 @@ static void irmb_run(running_machine &machine)
|
||||
case 0x02: ADD(0, Q); break;
|
||||
case 0x03: ADD(0, *curop->breg); break;
|
||||
case 0x04: ADD(0, *curop->areg); break;
|
||||
case 0x05: tmp = irmb_din(state, curop); ADD(tmp, *curop->areg); break;
|
||||
case 0x06: tmp = irmb_din(state, curop); ADD(tmp, Q); break;
|
||||
case 0x07: tmp = irmb_din(state, curop); ADD(tmp, 0); break;
|
||||
case 0x05: tmp = irmb_din(curop); ADD(tmp, *curop->areg); break;
|
||||
case 0x06: tmp = irmb_din(curop); ADD(tmp, Q); break;
|
||||
case 0x07: tmp = irmb_din(curop); ADD(tmp, 0); break;
|
||||
case 0x08: SUBR(*curop->areg, Q); break;
|
||||
case 0x09: SUBR(*curop->areg, *curop->breg); break;
|
||||
case 0x0a: SUBR(0, Q); break;
|
||||
case 0x0b: SUBR(0, *curop->breg); break;
|
||||
case 0x0c: SUBR(0, *curop->areg); break;
|
||||
case 0x0d: tmp = irmb_din(state, curop); SUBR(tmp, *curop->areg); break;
|
||||
case 0x0e: tmp = irmb_din(state, curop); SUBR(tmp, Q); break;
|
||||
case 0x0f: tmp = irmb_din(state, curop); SUBR(tmp, 0); break;
|
||||
case 0x0d: tmp = irmb_din(curop); SUBR(tmp, *curop->areg); break;
|
||||
case 0x0e: tmp = irmb_din(curop); SUBR(tmp, Q); break;
|
||||
case 0x0f: tmp = irmb_din(curop); SUBR(tmp, 0); break;
|
||||
case 0x10: SUB(*curop->areg, Q); break;
|
||||
case 0x11: SUB(*curop->areg, *curop->breg); break;
|
||||
case 0x12: SUB(0, Q); break;
|
||||
case 0x13: SUB(0, *curop->breg); break;
|
||||
case 0x14: SUB(0, *curop->areg); break;
|
||||
case 0x15: tmp = irmb_din(state, curop); SUB(tmp, *curop->areg); break;
|
||||
case 0x16: tmp = irmb_din(state, curop); SUB(tmp, Q); break;
|
||||
case 0x17: tmp = irmb_din(state, curop); SUB(tmp, 0); break;
|
||||
case 0x15: tmp = irmb_din(curop); SUB(tmp, *curop->areg); break;
|
||||
case 0x16: tmp = irmb_din(curop); SUB(tmp, Q); break;
|
||||
case 0x17: tmp = irmb_din(curop); SUB(tmp, 0); break;
|
||||
case 0x18: OR(*curop->areg, Q); break;
|
||||
case 0x19: OR(*curop->areg, *curop->breg); break;
|
||||
case 0x1a: OR(0, Q); break;
|
||||
case 0x1b: OR(0, *curop->breg); break;
|
||||
case 0x1c: OR(0, *curop->areg); break;
|
||||
case 0x1d: OR(irmb_din(state, curop), *curop->areg); break;
|
||||
case 0x1e: OR(irmb_din(state, curop), Q); break;
|
||||
case 0x1f: OR(irmb_din(state, curop), 0); break;
|
||||
case 0x1d: OR(irmb_din(curop), *curop->areg); break;
|
||||
case 0x1e: OR(irmb_din(curop), Q); break;
|
||||
case 0x1f: OR(irmb_din(curop), 0); break;
|
||||
case 0x20: AND(*curop->areg, Q); break;
|
||||
case 0x21: AND(*curop->areg, *curop->breg); break;
|
||||
case 0x22: AND(0, Q); break;
|
||||
case 0x23: AND(0, *curop->breg); break;
|
||||
case 0x24: AND(0, *curop->areg); break;
|
||||
case 0x25: AND(irmb_din(state, curop), *curop->areg); break;
|
||||
case 0x26: AND(irmb_din(state, curop), Q); break;
|
||||
case 0x27: AND(irmb_din(state, curop), 0); break;
|
||||
case 0x25: AND(irmb_din(curop), *curop->areg); break;
|
||||
case 0x26: AND(irmb_din(curop), Q); break;
|
||||
case 0x27: AND(irmb_din(curop), 0); break;
|
||||
case 0x28: IAND(*curop->areg, Q); break;
|
||||
case 0x29: IAND(*curop->areg, *curop->breg); break;
|
||||
case 0x2a: IAND(0, Q); break;
|
||||
case 0x2b: IAND(0, *curop->breg); break;
|
||||
case 0x2c: IAND(0, *curop->areg); break;
|
||||
case 0x2d: IAND(irmb_din(state, curop), *curop->areg); break;
|
||||
case 0x2e: IAND(irmb_din(state, curop), Q); break;
|
||||
case 0x2f: IAND(irmb_din(state, curop), 0); break;
|
||||
case 0x2d: IAND(irmb_din(curop), *curop->areg); break;
|
||||
case 0x2e: IAND(irmb_din(curop), Q); break;
|
||||
case 0x2f: IAND(irmb_din(curop), 0); break;
|
||||
case 0x30: XOR(*curop->areg, Q); break;
|
||||
case 0x31: XOR(*curop->areg, *curop->breg); break;
|
||||
case 0x32: XOR(0, Q); break;
|
||||
case 0x33: XOR(0, *curop->breg); break;
|
||||
case 0x34: XOR(0, *curop->areg); break;
|
||||
case 0x35: XOR(irmb_din(state, curop), *curop->areg); break;
|
||||
case 0x36: XOR(irmb_din(state, curop), Q); break;
|
||||
case 0x37: XOR(irmb_din(state, curop), 0); break;
|
||||
case 0x35: XOR(irmb_din(curop), *curop->areg); break;
|
||||
case 0x36: XOR(irmb_din(curop), Q); break;
|
||||
case 0x37: XOR(irmb_din(curop), 0); break;
|
||||
case 0x38: IXOR(*curop->areg, Q); break;
|
||||
case 0x39: IXOR(*curop->areg, *curop->breg); break;
|
||||
case 0x3a: IXOR(0, Q); break;
|
||||
case 0x3b: IXOR(0, *curop->breg); break;
|
||||
case 0x3c: IXOR(0, *curop->areg); break;
|
||||
case 0x3d: IXOR(irmb_din(state, curop), *curop->areg); break;
|
||||
case 0x3e: IXOR(irmb_din(state, curop), Q); break;
|
||||
default: case 0x3f: IXOR(irmb_din(state, curop), 0); break;
|
||||
case 0x3d: IXOR(irmb_din(curop), *curop->areg); break;
|
||||
case 0x3e: IXOR(irmb_din(curop), Q); break;
|
||||
default: case 0x3f: IXOR(irmb_din(curop), 0); break;
|
||||
}
|
||||
|
||||
/* Evaluate flags */
|
||||
@ -788,15 +779,15 @@ default: case 0x3f: IXOR(irmb_din(state, curop), 0);
|
||||
|
||||
/* Do write */
|
||||
if (!(prevop->flags & FL_MBRW))
|
||||
irmb_dout(state, prevop, Y);
|
||||
irmb_dout(prevop, Y);
|
||||
|
||||
/* ADDEN */
|
||||
if (!(prevop->flags & FL_ADDEN))
|
||||
{
|
||||
if (prevop->flags & FL_MBRW)
|
||||
state->m_irmb_latch = irmb_din(state, prevop);
|
||||
m_irmb_latch = irmb_din(prevop);
|
||||
else
|
||||
state->m_irmb_latch = Y;
|
||||
m_irmb_latch = Y;
|
||||
}
|
||||
}
|
||||
g_profiler.stop();
|
||||
@ -805,22 +796,22 @@ default: case 0x3f: IXOR(irmb_din(state, curop), 0);
|
||||
|
||||
|
||||
#if IR_TIMING
|
||||
if (state->m_irmb_running == 0)
|
||||
if (m_irmb_running == 0)
|
||||
{
|
||||
state->m_irmb_timer->adjust(attotime::from_hz(12000000) * icount);
|
||||
m_irmb_timer->adjust(attotime::from_hz(12000000) * icount);
|
||||
logerror("mb start ");
|
||||
IR_CPU_STATE(machine);
|
||||
IR_CPU_STATE(machine());
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("mb start [busy!] ");
|
||||
IR_CPU_STATE(machine);
|
||||
state->m_irmb_timer->adjust(attotime::from_hz(200) * icount);
|
||||
IR_CPU_STATE(machine());
|
||||
m_irmb_timer->adjust(attotime::from_hz(200) * icount);
|
||||
}
|
||||
#else
|
||||
machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
|
||||
#endif
|
||||
state->m_irmb_running=1;
|
||||
m_irmb_running=1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,16 +61,15 @@ WRITE8_MEMBER(ikki_state::ikki_scrn_ctrl_w)
|
||||
}
|
||||
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void ikki_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
ikki_state *state = machine.driver_data<ikki_state>();
|
||||
UINT8 *spriteram = state->m_spriteram;
|
||||
UINT8 *spriteram = m_spriteram;
|
||||
int y;
|
||||
offs_t offs;
|
||||
|
||||
state->m_sprite_bitmap.fill(state->m_punch_through_pen, cliprect);
|
||||
m_sprite_bitmap.fill(m_punch_through_pen, cliprect);
|
||||
|
||||
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
|
||||
for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
|
||||
{
|
||||
int code = (spriteram[offs + 2] & 0x80) | (spriteram[offs + 1] >> 1);
|
||||
int color = spriteram[offs + 2] & 0x3f;
|
||||
@ -78,7 +77,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
int x = spriteram[offs + 3];
|
||||
y = spriteram[offs + 0];
|
||||
|
||||
if (state->m_flipscreen)
|
||||
if (m_flipscreen)
|
||||
x = 240 - x;
|
||||
else
|
||||
y = 224 - y;
|
||||
@ -92,11 +91,11 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
if (y > 240)
|
||||
y = y - 256;
|
||||
|
||||
drawgfx_transmask(state->m_sprite_bitmap,cliprect, machine.gfx[1],
|
||||
drawgfx_transmask(m_sprite_bitmap,cliprect, machine().gfx[1],
|
||||
code, color,
|
||||
state->m_flipscreen,state->m_flipscreen,
|
||||
m_flipscreen,m_flipscreen,
|
||||
x,y,
|
||||
colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
|
||||
colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0));
|
||||
}
|
||||
|
||||
/* copy the sprite bitmap into the main bitmap, skipping the transparent pixels */
|
||||
@ -106,9 +105,9 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
|
||||
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
|
||||
{
|
||||
UINT16 pen = state->m_sprite_bitmap.pix16(y, x);
|
||||
UINT16 pen = m_sprite_bitmap.pix16(y, x);
|
||||
|
||||
if (colortable_entry_get_value(machine.colortable, pen) != 0x100)
|
||||
if (colortable_entry_get_value(machine().colortable, pen) != 0x100)
|
||||
bitmap.pix16(y, x) = pen;
|
||||
}
|
||||
}
|
||||
@ -182,7 +181,7 @@ UINT32 ikki_state::screen_update_ikki(screen_device &screen, bitmap_ind16 &bitma
|
||||
x,y);
|
||||
}
|
||||
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
/* mask sprites */
|
||||
|
||||
|
@ -76,16 +76,15 @@ WRITE8_MEMBER(irobot_state::irobot_paletteram_w)
|
||||
}
|
||||
|
||||
|
||||
static void _irobot_poly_clear(running_machine &machine, UINT8 *bitmap_base)
|
||||
void irobot_state::_irobot_poly_clear(UINT8 *bitmap_base)
|
||||
{
|
||||
memset(bitmap_base, 0, BITMAP_WIDTH * machine.primary_screen->height());
|
||||
memset(bitmap_base, 0, BITMAP_WIDTH * machine().primary_screen->height());
|
||||
}
|
||||
|
||||
void irobot_poly_clear(running_machine &machine)
|
||||
void irobot_state::irobot_poly_clear()
|
||||
{
|
||||
irobot_state *state = machine.driver_data<irobot_state>();
|
||||
UINT8 *bitmap_base = state->m_bufsel ? state->m_polybitmap2 : state->m_polybitmap1;
|
||||
_irobot_poly_clear(machine, bitmap_base);
|
||||
UINT8 *bitmap_base = m_bufsel ? m_polybitmap2 : m_polybitmap1;
|
||||
_irobot_poly_clear(bitmap_base);
|
||||
}
|
||||
|
||||
|
||||
@ -102,8 +101,8 @@ void irobot_state::video_start()
|
||||
m_polybitmap2 = auto_alloc_array(machine(), UINT8, BITMAP_WIDTH * height);
|
||||
|
||||
/* clear the bitmaps so we start with valid palette look-up values for drawing */
|
||||
_irobot_poly_clear(machine(), m_polybitmap1);
|
||||
_irobot_poly_clear(machine(), m_polybitmap2);
|
||||
_irobot_poly_clear(m_polybitmap1);
|
||||
_irobot_poly_clear(m_polybitmap2);
|
||||
|
||||
/* Set clipping */
|
||||
m_ir_xmin = m_ir_ymin = 0;
|
||||
@ -162,9 +161,8 @@ void irobot_state::video_start()
|
||||
modified from a routine written by Andrew Caldwell
|
||||
*/
|
||||
|
||||
static void draw_line(running_machine &machine, UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col)
|
||||
void irobot_state::draw_line(UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col)
|
||||
{
|
||||
irobot_state *state = machine.driver_data<irobot_state>();
|
||||
int dx,dy,sx,sy,cx,cy;
|
||||
|
||||
dx = abs(x1-x2);
|
||||
@ -178,7 +176,7 @@ static void draw_line(running_machine &machine, UINT8 *polybitmap, int x1, int y
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
if (x1 >= state->m_ir_xmin && x1 < state->m_ir_xmax && y1 >= state->m_ir_ymin && y1 < state->m_ir_ymax)
|
||||
if (x1 >= m_ir_xmin && x1 < m_ir_xmax && y1 >= m_ir_ymin && y1 < m_ir_ymax)
|
||||
draw_pixel (x1, y1, col);
|
||||
if (x1 == x2) break;
|
||||
x1 += sx;
|
||||
@ -194,7 +192,7 @@ static void draw_line(running_machine &machine, UINT8 *polybitmap, int x1, int y
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
if (x1 >= state->m_ir_xmin && x1 < state->m_ir_xmax && y1 >= state->m_ir_ymin && y1 < state->m_ir_ymax)
|
||||
if (x1 >= m_ir_xmin && x1 < m_ir_xmax && y1 >= m_ir_ymin && y1 < m_ir_ymax)
|
||||
draw_pixel (x1, y1, col);
|
||||
if (y1 == y2) break;
|
||||
y1 += sy;
|
||||
@ -211,11 +209,10 @@ static void draw_line(running_machine &machine, UINT8 *polybitmap, int x1, int y
|
||||
|
||||
#define ROUND_TO_PIXEL(x) ((x >> 7) - 128)
|
||||
|
||||
void irobot_run_video(running_machine &machine)
|
||||
void irobot_state::irobot_run_video()
|
||||
{
|
||||
irobot_state *state = machine.driver_data<irobot_state>();
|
||||
UINT8 *polybitmap;
|
||||
UINT16 *combase16 = (UINT16 *)state->m_combase;
|
||||
UINT16 *combase16 = (UINT16 *)m_combase;
|
||||
int sx,sy,ex,ey,sx2,ey2;
|
||||
int color;
|
||||
UINT32 d1;
|
||||
@ -223,12 +220,12 @@ void irobot_run_video(running_machine &machine)
|
||||
int shp;
|
||||
INT32 word1,word2;
|
||||
|
||||
logerror("Starting Polygon Generator, Clear=%d\n",state->m_vg_clear);
|
||||
logerror("Starting Polygon Generator, Clear=%d\n",m_vg_clear);
|
||||
|
||||
if (state->m_bufsel)
|
||||
polybitmap = state->m_polybitmap2;
|
||||
if (m_bufsel)
|
||||
polybitmap = m_polybitmap2;
|
||||
else
|
||||
polybitmap = state->m_polybitmap1;
|
||||
polybitmap = m_polybitmap1;
|
||||
|
||||
lpnt=0;
|
||||
while (lpnt < 0x7ff)
|
||||
@ -249,7 +246,7 @@ void irobot_run_video(running_machine &machine)
|
||||
color = sy & 0x3f;
|
||||
sx = ROUND_TO_PIXEL(sx);
|
||||
sy = ROUND_TO_PIXEL(sy);
|
||||
if (sx >= state->m_ir_xmin && sx < state->m_ir_xmax && sy >= state->m_ir_ymin && sy < state->m_ir_ymax)
|
||||
if (sx >= m_ir_xmin && sx < m_ir_xmax && sy >= m_ir_ymin && sy < m_ir_ymax)
|
||||
draw_pixel(sx,sy,color);
|
||||
spnt+=2;
|
||||
}//while object
|
||||
@ -269,7 +266,7 @@ void irobot_run_video(running_machine &machine)
|
||||
sx = combase16[spnt+3];
|
||||
word1 = (INT16)combase16[spnt+2];
|
||||
ex = sx + word1 * (ey - sy + 1);
|
||||
draw_line(machine, polybitmap, ROUND_TO_PIXEL(sx),sy,ROUND_TO_PIXEL(ex),ey,color);
|
||||
draw_line(polybitmap, ROUND_TO_PIXEL(sx),sy,ROUND_TO_PIXEL(ex),ey,color);
|
||||
spnt+=4;
|
||||
}//while object
|
||||
}//if line
|
||||
@ -303,15 +300,15 @@ void irobot_run_video(running_machine &machine)
|
||||
|
||||
while(1)
|
||||
{
|
||||
if (sy >= state->m_ir_ymin && sy < state->m_ir_ymax)
|
||||
if (sy >= m_ir_ymin && sy < m_ir_ymax)
|
||||
{
|
||||
int x1 = ROUND_TO_PIXEL(sx);
|
||||
int x2 = ROUND_TO_PIXEL(sx2);
|
||||
int temp;
|
||||
|
||||
if (x1 > x2) temp = x1, x1 = x2, x2 = temp;
|
||||
if (x1 < state->m_ir_xmin) x1 = state->m_ir_xmin;
|
||||
if (x2 >= state->m_ir_xmax) x2 = state->m_ir_xmax - 1;
|
||||
if (x1 < m_ir_xmin) x1 = m_ir_xmin;
|
||||
if (x2 >= m_ir_xmax) x2 = m_ir_xmax - 1;
|
||||
if (x1 < x2)
|
||||
fill_hline(x1 + 1, x2, sy, color);
|
||||
}
|
||||
|
@ -150,28 +150,27 @@ void ironhors_state::video_start()
|
||||
m_bg_tilemap->set_scroll_rows(32);
|
||||
}
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void ironhors_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
ironhors_state *state = machine.driver_data<ironhors_state>();
|
||||
int offs;
|
||||
UINT8 *sr;
|
||||
|
||||
if (state->m_spriterambank != 0)
|
||||
sr = state->m_spriteram;
|
||||
if (m_spriterambank != 0)
|
||||
sr = m_spriteram;
|
||||
else
|
||||
sr = state->m_spriteram2;
|
||||
sr = m_spriteram2;
|
||||
|
||||
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 5)
|
||||
for (offs = 0; offs < m_spriteram.bytes(); offs += 5)
|
||||
{
|
||||
int sx = sr[offs + 3];
|
||||
int sy = sr[offs + 2];
|
||||
int flipx = sr[offs + 4] & 0x20;
|
||||
int flipy = sr[offs + 4] & 0x40;
|
||||
int code = (sr[offs] << 2) + ((sr[offs + 1] & 0x03) << 10) + ((sr[offs + 1] & 0x0c) >> 2);
|
||||
int color = ((sr[offs + 1] & 0xf0) >> 4) + 16 * state->m_palettebank;
|
||||
// int mod = state->flip_screen() ? -8 : 8;
|
||||
int color = ((sr[offs + 1] & 0xf0) >> 4) + 16 * m_palettebank;
|
||||
// int mod = flip_screen() ? -8 : 8;
|
||||
|
||||
if (state->flip_screen())
|
||||
if (flip_screen())
|
||||
{
|
||||
sx = 240 - sx;
|
||||
sy = 240 - sy;
|
||||
@ -182,7 +181,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
switch (sr[offs + 4] & 0x0c)
|
||||
{
|
||||
case 0x00: /* 16x16 */
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
|
||||
code/4,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -191,14 +190,14 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
|
||||
case 0x04: /* 16x8 */
|
||||
{
|
||||
if (state->flip_screen()) sy += 8; // this fixes the train wheels' position
|
||||
if (flip_screen()) sy += 8; // this fixes the train wheels' position
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code & ~1,
|
||||
color,
|
||||
flipx,flipy,
|
||||
flipx?sx+8:sx,sy,0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code | 1,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -208,12 +207,12 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
|
||||
case 0x08: /* 8x16 */
|
||||
{
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code & ~2,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,flipy?sy+8:sy,0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code | 2,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -223,7 +222,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
|
||||
case 0x0c: /* 8x8 */
|
||||
{
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -242,7 +241,7 @@ UINT32 ironhors_state::screen_update_ironhors(screen_device &screen, bitmap_ind1
|
||||
m_bg_tilemap->set_scrollx(row, m_scroll[row]);
|
||||
|
||||
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -263,21 +262,20 @@ VIDEO_START_MEMBER(ironhors_state,farwest)
|
||||
m_bg_tilemap->set_scroll_rows(32);
|
||||
}
|
||||
|
||||
static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void ironhors_state::farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
ironhors_state *state = machine.driver_data<ironhors_state>();
|
||||
int offs;
|
||||
UINT8 *sr = state->m_spriteram2;
|
||||
UINT8 *sr2 = state->m_spriteram;
|
||||
UINT8 *sr = m_spriteram2;
|
||||
UINT8 *sr2 = m_spriteram;
|
||||
|
||||
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
|
||||
for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
|
||||
{
|
||||
int sx = sr[offs + 2];
|
||||
int sy = sr[offs + 1];
|
||||
int flipx = sr[offs + 3] & 0x20;
|
||||
int flipy = sr[offs + 3] & 0x40;
|
||||
int code = (sr[offs] << 2) + ((sr2[offs] & 0x03) << 10) + ((sr2[offs] & 0x0c) >> 2);
|
||||
int color = ((sr2[offs] & 0xf0) >> 4) + 16 * state->m_palettebank;
|
||||
int color = ((sr2[offs] & 0xf0) >> 4) + 16 * m_palettebank;
|
||||
|
||||
// int mod = flip_screen() ? -8 : 8;
|
||||
|
||||
@ -292,7 +290,7 @@ static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap
|
||||
switch (sr[offs + 3] & 0x0c)
|
||||
{
|
||||
case 0x00: /* 16x16 */
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
|
||||
code/4,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -301,14 +299,14 @@ static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap
|
||||
|
||||
case 0x04: /* 16x8 */
|
||||
{
|
||||
if (state->flip_screen()) sy += 8; // this fixes the train wheels' position
|
||||
if (flip_screen()) sy += 8; // this fixes the train wheels' position
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code & ~1,
|
||||
color,
|
||||
flipx,flipy,
|
||||
flipx?sx+8:sx,sy,0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code | 1,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -318,12 +316,12 @@ static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap
|
||||
|
||||
case 0x08: /* 8x16 */
|
||||
{
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code & ~2,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,flipy?sy+8:sy,0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code | 2,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -333,7 +331,7 @@ static void farwest_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap
|
||||
|
||||
case 0x0c: /* 8x8 */
|
||||
{
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
|
||||
code,
|
||||
color,
|
||||
flipx,flipy,
|
||||
@ -352,6 +350,6 @@ UINT32 ironhors_state::screen_update_farwest(screen_device &screen, bitmap_ind16
|
||||
m_bg_tilemap->set_scrollx(row, m_scroll[row]);
|
||||
|
||||
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
farwest_draw_sprites(machine(), bitmap, cliprect);
|
||||
farwest_draw_sprites(bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -138,11 +138,12 @@
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void generate_interrupt(running_machine &machine, int state)
|
||||
static void generate_interrupt(running_machine &machine, int state_num)
|
||||
{
|
||||
itech8_update_interrupts(machine, -1, state, -1);
|
||||
itech8_state *state = machine.driver_data<itech8_state>();
|
||||
state->itech8_update_interrupts(-1, state_num, -1);
|
||||
|
||||
if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", machine.primary_screen->vpos());
|
||||
if (FULL_LOGGING && state_num) logerror("------------ DISPLAY INT (%d) --------------\n", machine.primary_screen->vpos());
|
||||
}
|
||||
|
||||
|
||||
@ -215,60 +216,60 @@ WRITE8_MEMBER(itech8_state::itech8_page_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
INLINE UINT8 fetch_next_raw(itech8_state *state)
|
||||
inline UINT8 itech8_state::fetch_next_raw()
|
||||
{
|
||||
return state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
return m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
}
|
||||
|
||||
|
||||
INLINE void consume_raw(itech8_state *state, int count)
|
||||
inline void itech8_state::consume_raw(int count)
|
||||
{
|
||||
state->m_fetch_offset += count;
|
||||
m_fetch_offset += count;
|
||||
}
|
||||
|
||||
|
||||
INLINE UINT8 fetch_next_rle(itech8_state *state)
|
||||
inline UINT8 itech8_state::fetch_next_rle()
|
||||
{
|
||||
if (state->m_fetch_rle_count == 0)
|
||||
if (m_fetch_rle_count == 0)
|
||||
{
|
||||
state->m_fetch_rle_count = state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
state->m_fetch_rle_literal = state->m_fetch_rle_count & 0x80;
|
||||
state->m_fetch_rle_count &= 0x7f;
|
||||
m_fetch_rle_count = m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
m_fetch_rle_literal = m_fetch_rle_count & 0x80;
|
||||
m_fetch_rle_count &= 0x7f;
|
||||
|
||||
if (!state->m_fetch_rle_literal)
|
||||
state->m_fetch_rle_value = state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
if (!m_fetch_rle_literal)
|
||||
m_fetch_rle_value = m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
}
|
||||
|
||||
state->m_fetch_rle_count--;
|
||||
if (state->m_fetch_rle_literal)
|
||||
state->m_fetch_rle_value = state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
m_fetch_rle_count--;
|
||||
if (m_fetch_rle_literal)
|
||||
m_fetch_rle_value = m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
|
||||
return state->m_fetch_rle_value;
|
||||
return m_fetch_rle_value;
|
||||
}
|
||||
|
||||
|
||||
INLINE void consume_rle(itech8_state *state, int count)
|
||||
inline void itech8_state::consume_rle(int count)
|
||||
{
|
||||
while (count)
|
||||
{
|
||||
int num_to_consume;
|
||||
|
||||
if (state->m_fetch_rle_count == 0)
|
||||
if (m_fetch_rle_count == 0)
|
||||
{
|
||||
state->m_fetch_rle_count = state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
state->m_fetch_rle_literal = state->m_fetch_rle_count & 0x80;
|
||||
state->m_fetch_rle_count &= 0x7f;
|
||||
m_fetch_rle_count = m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
m_fetch_rle_literal = m_fetch_rle_count & 0x80;
|
||||
m_fetch_rle_count &= 0x7f;
|
||||
|
||||
if (!state->m_fetch_rle_literal)
|
||||
state->m_fetch_rle_value = state->m_grom_base[state->m_fetch_offset++ % state->m_grom_size];
|
||||
if (!m_fetch_rle_literal)
|
||||
m_fetch_rle_value = m_grom_base[m_fetch_offset++ % m_grom_size];
|
||||
}
|
||||
|
||||
num_to_consume = (count < state->m_fetch_rle_count) ? count : state->m_fetch_rle_count;
|
||||
num_to_consume = (count < m_fetch_rle_count) ? count : m_fetch_rle_count;
|
||||
count -= num_to_consume;
|
||||
|
||||
state->m_fetch_rle_count -= num_to_consume;
|
||||
if (state->m_fetch_rle_literal)
|
||||
state->m_fetch_offset += num_to_consume;
|
||||
m_fetch_rle_count -= num_to_consume;
|
||||
if (m_fetch_rle_literal)
|
||||
m_fetch_offset += num_to_consume;
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,12 +281,11 @@ INLINE void consume_rle(itech8_state *state, int count)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void perform_blit(address_space &space)
|
||||
void itech8_state::perform_blit(address_space &space)
|
||||
{
|
||||
itech8_state *state = space.machine().driver_data<itech8_state>();
|
||||
struct tms34061_display &tms_state = state->m_tms_state;
|
||||
UINT8 *blitter_data = state->m_blitter_data;
|
||||
offs_t addr = state->m_tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8);
|
||||
struct tms34061_display &tms_state = m_tms_state;
|
||||
UINT8 *blitter_data = m_blitter_data;
|
||||
offs_t addr = m_tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8);
|
||||
UINT8 shift = (BLITTER_FLAGS & BLITFLAG_SHIFT) ? 4 : 0;
|
||||
int transparent = (BLITTER_FLAGS & BLITFLAG_TRANSPARENT);
|
||||
int ydir = (BLITTER_FLAGS & BLITFLAG_YFLIP) ? -1 : 1;
|
||||
@ -304,17 +304,17 @@ static void perform_blit(address_space &space)
|
||||
if (FULL_LOGGING)
|
||||
logerror("Blit: scan=%d src=%06x @ (%05x) for %dx%d ... flags=%02x\n",
|
||||
space.machine().primary_screen->vpos(),
|
||||
(state->m_grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO,
|
||||
(m_grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO,
|
||||
tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8),
|
||||
BLITTER_WIDTH, BLITTER_HEIGHT, BLITTER_FLAGS);
|
||||
|
||||
/* initialize the fetcher */
|
||||
state->m_fetch_offset = (state->m_grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO;
|
||||
state->m_fetch_rle_count = 0;
|
||||
m_fetch_offset = (m_grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO;
|
||||
m_fetch_rle_count = 0;
|
||||
|
||||
/* RLE starts with a couple of extra 0's */
|
||||
if (rle)
|
||||
state->m_fetch_offset += 2;
|
||||
m_fetch_offset += 2;
|
||||
|
||||
/* select 4-bit versus 8-bit transparency */
|
||||
if (BLITTER_OUTPUT & 0x40)
|
||||
@ -346,9 +346,9 @@ static void perform_blit(address_space &space)
|
||||
/* skip src and dest */
|
||||
addr += xdir * (width + skip[0] + skip[1]);
|
||||
if (rle)
|
||||
consume_rle(state, width + skip[0] + skip[1]);
|
||||
consume_rle(width + skip[0] + skip[1]);
|
||||
else
|
||||
consume_raw(state, width + skip[0] + skip[1]);
|
||||
consume_raw(width + skip[0] + skip[1]);
|
||||
|
||||
/* back up one and reverse directions */
|
||||
addr -= xdir;
|
||||
@ -363,14 +363,14 @@ static void perform_blit(address_space &space)
|
||||
/* skip left */
|
||||
addr += xdir * skip[y & 1];
|
||||
if (rle)
|
||||
consume_rle(state, skip[y & 1]);
|
||||
consume_rle(skip[y & 1]);
|
||||
else
|
||||
consume_raw(state, skip[y & 1]);
|
||||
consume_raw(skip[y & 1]);
|
||||
|
||||
/* loop over width */
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
UINT8 pix = rle ? fetch_next_rle(state) : fetch_next_raw(state);
|
||||
UINT8 pix = rle ? fetch_next_rle() : fetch_next_raw();
|
||||
|
||||
/* swap pixels for X flip in 4bpp mode */
|
||||
if (xflip && transmaskhi != 0xff)
|
||||
@ -399,9 +399,9 @@ static void perform_blit(address_space &space)
|
||||
/* skip right */
|
||||
addr += xdir * skip[~y & 1];
|
||||
if (rle)
|
||||
consume_rle(state, skip[~y & 1]);
|
||||
consume_rle(skip[~y & 1]);
|
||||
else
|
||||
consume_raw(state, skip[~y & 1]);
|
||||
consume_raw(skip[~y & 1]);
|
||||
|
||||
/* back up one and reverse directions */
|
||||
addr -= xdir;
|
||||
@ -423,7 +423,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
|
||||
{
|
||||
/* turn off blitting and generate an interrupt */
|
||||
m_blit_in_progress = 0;
|
||||
itech8_update_interrupts(machine(), -1, -1, 1);
|
||||
itech8_update_interrupts(-1, -1, 1);
|
||||
|
||||
if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", machine().primary_screen->vpos());
|
||||
}
|
||||
@ -450,7 +450,7 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
|
||||
/* a read from offset 3 clears the interrupt and returns the status */
|
||||
if (offset == 3)
|
||||
{
|
||||
itech8_update_interrupts(machine(), -1, -1, 0);
|
||||
itech8_update_interrupts(-1, -1, 0);
|
||||
if (m_blit_in_progress)
|
||||
result |= 0x80;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user