Previous 199869 Revisions Next

r36809 Monday 30th March, 2015 at 18:33:58 UTC by Miodrag Milanović
Merge branch 'master' of https://github.com/mamedev/mame
[src/mame/drivers]m72.c
[src/mame/includes]m72.h
[src/mame/video]m72.c

trunk/src/mame/drivers/m72.c
r245320r245321
9696
9797
9898
99
100
101
10299/***************************************************************************/
103100
104101void m72_state::machine_start()
105102{
106   m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::m72_scanline_interrupt),this));
107
108   save_item(NAME(m_mcu_sample_addr));
109   save_item(NAME(m_mcu_snd_cmd_latch));
103   m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::scanline_interrupt),this));
110104}
111105
112106MACHINE_START_MEMBER(m72_state,kengo)
113107{
114108   m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::kengo_scanline_interrupt),this));
115
116   save_item(NAME(m_mcu_sample_addr));
117   save_item(NAME(m_mcu_snd_cmd_latch));
118109}
119110
120111TIMER_CALLBACK_MEMBER(m72_state::synch_callback)
r245320r245321
144135   m_scanline_timer->adjust(m_screen->time_until_pos(0));
145136}
146137
147TIMER_CALLBACK_MEMBER(m72_state::m72_scanline_interrupt)
138TIMER_CALLBACK_MEMBER(m72_state::scanline_interrupt)
148139{
149140   int scanline = param;
150141
r245320r245321
200191
201192Protection emulation
202193
203Currently only available for lohtb2, since this is the only game
204with a dumped 8751.
205
206194The protection device does
207195
208196* provide startup code
r245320r245321
221209}
222210
223211
224WRITE16_MEMBER(m72_state::m72_main_mcu_sound_w)
212WRITE16_MEMBER(m72_state::main_mcu_sound_w)
225213{
226214   if (data & 0xfff0)
227215      logerror("sound_w: %04x %04x\n", mem_mask, data);
r245320r245321
233221   }
234222}
235223
236WRITE16_MEMBER(m72_state::m72_main_mcu_w)
224WRITE16_MEMBER(m72_state::main_mcu_w)
237225{
238226   UINT16 val = m_protection_ram[offset];
239227
r245320r245321
255243      machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), (offset<<16) | val, m_protection_ram);
256244}
257245
258WRITE8_MEMBER(m72_state::m72_mcu_data_w)
246WRITE8_MEMBER(m72_state::mcu_data_w)
259247{
260248   UINT16 val;
261249   if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8);
r245320r245321
264252   machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), ((offset >>1 ) << 16) | val, m_protection_ram);
265253}
266254
267READ8_MEMBER(m72_state::m72_mcu_data_r)
255READ8_MEMBER(m72_state::mcu_data_r)
268256{
269257   UINT8 ret;
270258
r245320r245321
279267   return ret;
280268}
281269
282INTERRUPT_GEN_MEMBER(m72_state::m72_mcu_int)
270INTERRUPT_GEN_MEMBER(m72_state::mcu_int)
283271{
284272   //m_mcu_snd_cmd_latch |= 0x11; /* 0x10 is special as well - FIXME */
285273   m_mcu_snd_cmd_latch = 0x11;// | (machine.rand() & 1); /* 0x10 is special as well - FIXME */
286274   device.execute().set_input_line(1, ASSERT_LINE);
287275}
288276
289READ8_MEMBER(m72_state::m72_mcu_sample_r)
277READ8_MEMBER(m72_state::mcu_sample_r)
290278{
291279   UINT8 sample;
292280   sample = memregion("samples")->base()[m_mcu_sample_addr++];
293281   return sample;
294282}
295283
296WRITE8_MEMBER(m72_state::m72_mcu_ack_w)
284WRITE8_MEMBER(m72_state::mcu_ack_w)
297285{
298286   m_mcu->set_input_line(1, CLEAR_LINE);
299287   m_mcu_snd_cmd_latch = 0;
300288}
301289
302READ8_MEMBER(m72_state::m72_mcu_snd_r)
290READ8_MEMBER(m72_state::mcu_snd_r)
303291{
304292   return m_mcu_snd_cmd_latch;
305293}
306294
307READ8_MEMBER(m72_state::m72_mcu_port_r)
295READ8_MEMBER(m72_state::mcu_port_r)
308296{
309297   logerror("port read: %02x\n", offset);
310298   return 0;
311299}
312300
313WRITE8_MEMBER(m72_state::m72_mcu_port_w)
301WRITE8_MEMBER(m72_state::mcu_port_w)
314302{
315303   if (offset == 1)
316304   {
r245320r245321
322310
323311}
324312
325WRITE8_MEMBER(m72_state::m72_mcu_low_w)
313WRITE8_MEMBER(m72_state::mcu_low_w)
326314{
327315   m_mcu_sample_addr = (m_mcu_sample_addr & 0xffe000) | (data<<5);
328316   logerror("low: %02x %02x %08x\n", offset, data, m_mcu_sample_addr);
329317}
330318
331WRITE8_MEMBER(m72_state::m72_mcu_high_w)
319WRITE8_MEMBER(m72_state::mcu_high_w)
332320{
333321   m_mcu_sample_addr = (m_mcu_sample_addr & 0x1fff) | (data<<(8+5));
334322   logerror("high: %02x %02x %08x\n", offset, data, m_mcu_sample_addr);
335323}
336324
337WRITE8_MEMBER(m72_state::m72_snd_cpu_sample_w)
325READ8_MEMBER(m72_state::snd_cpu_sample_r)
338326{
339   //m_dac->write_signed8(data);
340   m_dac->write_unsigned8(data);
341}
342
343READ8_MEMBER(m72_state::m72_snd_cpu_sample_r)
344{
345327   return m_mcu_sample_latch;
346328}
347329
r245320r245321
353335
354336   m_protection_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
355337   program.install_read_bank(0xb0000, 0xbffff, "bank1");
356   program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::m72_main_mcu_w),this));
357   membank("bank1")->set_base(m_protection_ram);
338   program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::main_mcu_w),this));
339   membank("bank1")->configure_entry(0, m_protection_ram);
340   
341   save_pointer(NAME(m_protection_ram), 0x10000/2);
342   save_item(NAME(m_mcu_sample_latch));
343   save_item(NAME(m_mcu_sample_addr));
344   save_item(NAME(m_mcu_snd_cmd_latch));
358345
359346   //io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::loht_sample_trigger_w),this));
360   io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::m72_main_mcu_sound_w),this));
347   io.install_write_handler(0xc0, 0xc1, write16_delegate(FUNC(m72_state::main_mcu_sound_w),this));
361348
362349   /* sound cpu */
363   sndio.install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(m72_state::m72_snd_cpu_sample_w),this));
364   sndio.install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::m72_snd_cpu_sample_r),this));
350   sndio.install_write_handler(0x82, 0x82, 0xff, 0, write8_delegate(FUNC(dac_device::write_unsigned8),(dac_device*)m_dac));
351   sndio.install_read_handler (0x84, 0x84, 0xff, 0, read8_delegate(FUNC(m72_state::snd_cpu_sample_r),this));
365352
366353   /* lohtb2 */
367354#if 0
r245320r245321
697684   m_maincpu->space(AS_PROGRAM).install_read_bank(0xb0000, 0xb0fff, "bank1");
698685   m_maincpu->space(AS_PROGRAM).install_read_handler(0xb0ffa, 0xb0ffb, read16_delegate(FUNC(m72_state::protection_r),this));
699686   m_maincpu->space(AS_PROGRAM).install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::protection_w),this));
700   membank("bank1")->set_base(m_protection_ram);
687   membank("bank1")->configure_entry(0, m_protection_ram);
688   
689   save_pointer(NAME(m_protection_ram), 0x1000/2);
701690}
702691
703692DRIVER_INIT_MEMBER(m72_state,bchopper)
r245320r245321
808797   AM_RANGE(0x00000, ROMSIZE-1) AM_ROM                                 \
809798   AM_RANGE(WORKRAM, WORKRAM+0x3fff) AM_RAM    /* work RAM */          \
810799   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram") \
811   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")          \
812   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")     \
813   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")      \
814   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")      \
800   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")          \
801   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")     \
802   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")      \
803   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")      \
815804   AM_RANGE(0xe0000, 0xeffff) AM_READWRITE(soundram_r, soundram_w)                         \
816805   AM_RANGE(0xffff0, 0xfffff) AM_ROM                                   \
817806ADDRESS_MAP_END
r245320r245321
828817   AM_RANGE(0x9c000, 0x9ffff) AM_RAM   /* work RAM */
829818   AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */
830819   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
831   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
832   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
833   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
834   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
820   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
821   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
822   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
823   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
835824   AM_RANGE(0xffff0, 0xfffff) AM_ROM
836825ADDRESS_MAP_END
837826
r245320r245321
840829   AM_RANGE(0x88000, 0x8bfff) AM_RAM   /* work RAM */
841830   AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */
842831   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
843   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
844   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
845   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
846   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
832   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
833   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
834   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
835   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
847836   AM_RANGE(0xffff0, 0xfffff) AM_ROM
848837ADDRESS_MAP_END
849838
850839static ADDRESS_MAP_START( rtype2_map, AS_PROGRAM, 16, m72_state )
851840   AM_RANGE(0x00000, 0x7ffff) AM_ROM
852   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w)
853   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w)
841   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w)
842   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w)
854843   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
855   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
856   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
857   AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
858   AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
844   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
845   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
846   AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
847   AM_RANGE(0xd8000, 0xd8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
859848   AM_RANGE(0xe0000, 0xe3fff) AM_RAM   /* work RAM */
860849   AM_RANGE(0xffff0, 0xfffff) AM_ROM
861850ADDRESS_MAP_END
r245320r245321
863852static ADDRESS_MAP_START( majtitle_map, AS_PROGRAM, 16, m72_state )
864853   AM_RANGE(0x00000, 0x7ffff) AM_ROM
865854   AM_RANGE(0xa0000, 0xa03ff) AM_RAM AM_SHARE("majtitle_rowscr")
866   AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
867   AM_RANGE(0xac000, 0xaffff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
868   AM_RANGE(0xb0000, 0xbffff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")  /* larger than the other games */
855   AM_RANGE(0xa4000, 0xa4bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
856   AM_RANGE(0xac000, 0xaffff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
857   AM_RANGE(0xb0000, 0xbffff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")  /* larger than the other games */
869858   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
870859   AM_RANGE(0xc8000, 0xc83ff) AM_RAM AM_SHARE("spriteram2")
871   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
860   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
872861   AM_RANGE(0xd0000, 0xd3fff) AM_RAM   /* work RAM */
873   AM_RANGE(0xe0000, 0xe0001) AM_WRITE(m72_irq_line_w)
862   AM_RANGE(0xe0000, 0xe0001) AM_WRITE(irq_line_w)
874863   AM_RANGE(0xe4000, 0xe4001) AM_WRITEONLY /* playfield enable? 1 during screen transitions, 0 otherwise */
875   AM_RANGE(0xec000, 0xec001) AM_WRITE(m72_dmaon_w)
864   AM_RANGE(0xec000, 0xec001) AM_WRITE(dmaon_w)
876865   AM_RANGE(0xffff0, 0xfffff) AM_ROM
877866ADDRESS_MAP_END
878867
r245320r245321
881870   AM_RANGE(0xa0000, 0xa3fff) AM_RAM   /* work RAM */
882871   AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */
883872   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
884   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
885   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
886   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
887   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
873   AM_RANGE(0xc8000, 0xc8bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
874   AM_RANGE(0xcc000, 0xccbff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
875   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
876   AM_RANGE(0xd8000, 0xdbfff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
888877   AM_RANGE(0xffff0, 0xfffff) AM_ROM
889878ADDRESS_MAP_END
890879
891880static ADDRESS_MAP_START( hharryu_map, AS_PROGRAM, 16, m72_state )
892881   AM_RANGE(0x00000, 0x7ffff) AM_ROM
893   AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
894   AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
895   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w)
896   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w)
882   AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
883   AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
884   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w)
885   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w)
897886   AM_RANGE(0xb0ffe, 0xb0fff) AM_WRITEONLY /* leftover from protection?? */
898887   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
899   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
900   AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
888   AM_RANGE(0xd0000, 0xd3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
889   AM_RANGE(0xd4000, 0xd7fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
901890   AM_RANGE(0xe0000, 0xe3fff) AM_RAM   /* work RAM */
902891   AM_RANGE(0xffff0, 0xfffff) AM_ROM
903892ADDRESS_MAP_END
904893
905894static ADDRESS_MAP_START( kengo_map, AS_PROGRAM, 16, m72_state )
906895   AM_RANGE(0x00000, 0x7ffff) AM_ROM
907   AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(m72_palette1_r, m72_palette1_w) AM_SHARE("paletteram")
908   AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(m72_palette2_r, m72_palette2_w) AM_SHARE("paletteram2")
909   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(m72_irq_line_w)
896   AM_RANGE(0xa0000, 0xa0bff) AM_READWRITE(palette1_r, palette1_w) AM_SHARE("paletteram")
897   AM_RANGE(0xa8000, 0xa8bff) AM_READWRITE(palette2_r, palette2_w) AM_SHARE("paletteram2")
898   AM_RANGE(0xb0000, 0xb0001) AM_WRITE(irq_line_w)
910899   AM_RANGE(0xb4000, 0xb4001) AM_WRITENOP  /* ??? */
911   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(m72_dmaon_w)
900   AM_RANGE(0xbc000, 0xbc001) AM_WRITE(dmaon_w)
912901   AM_RANGE(0xc0000, 0xc03ff) AM_RAM AM_SHARE("spriteram")
913   AM_RANGE(0x80000, 0x83fff) AM_RAM_WRITE(m72_videoram1_w) AM_SHARE("videoram1")
914   AM_RANGE(0x84000, 0x87fff) AM_RAM_WRITE(m72_videoram2_w) AM_SHARE("videoram2")
902   AM_RANGE(0x80000, 0x83fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
903   AM_RANGE(0x84000, 0x87fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
915904   AM_RANGE(0xe0000, 0xe3fff) AM_RAM   /* work RAM */
916905   AM_RANGE(0xffff0, 0xfffff) AM_ROM
917906ADDRESS_MAP_END
r245320r245321
921910   AM_RANGE(0x02, 0x03) AM_READ_PORT("IN1")
922911   AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW")
923912   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
924   AM_RANGE(0x02, 0x03) AM_WRITE(m72_port02_w) /* coin counters, reset sound cpu, other stuff? */
925   AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w)
926   AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w)
913   AM_RANGE(0x02, 0x03) AM_WRITE(port02_w) /* coin counters, reset sound cpu, other stuff? */
914   AM_RANGE(0x04, 0x05) AM_WRITE(dmaon_w)
915   AM_RANGE(0x06, 0x07) AM_WRITE(irq_line_w)
927916   //AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */
928   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
929   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
930   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
931   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
917   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
918   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
919   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
920   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
932921/*  { 0xc0, 0xc0      trigger sample, filled by init_ function */
933922ADDRESS_MAP_END
934923
r245320r245321
939928   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
940929   AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w)
941930   AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */
942   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
943   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
944   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
945   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
931   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
932   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
933   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
934   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
946935ADDRESS_MAP_END
947936
948937static ADDRESS_MAP_START( poundfor_portmap, AS_IO, 16, m72_state )
r245320r245321
952941   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
953942   AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w)
954943   AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */
955   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
956   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
957   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
958   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
944   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
945   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
946   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
947   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
959948ADDRESS_MAP_END
960949
961950static ADDRESS_MAP_START( majtitle_portmap, AS_IO, 16, m72_state )
r245320r245321
965954   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
966955   AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w)
967956   AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */
968   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
969   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
970   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
971   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
957   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
958   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
959   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
960   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
972961   AM_RANGE(0x8e, 0x8f) AM_WRITE(majtitle_gfx_ctrl_w)
973962ADDRESS_MAP_END
974963
r245320r245321
978967   AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW")
979968   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
980969   AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w)  /* coin counters, reset sound cpu, other stuff? */
981   AM_RANGE(0x04, 0x05) AM_WRITE(m72_dmaon_w)
982   AM_RANGE(0x06, 0x07) AM_WRITE(m72_irq_line_w)
970   AM_RANGE(0x04, 0x05) AM_WRITE(dmaon_w)
971   AM_RANGE(0x06, 0x07) AM_WRITE(irq_line_w)
983972   AM_RANGE(0x40, 0x43) AM_WRITENOP /* Interrupt controller, only written to at bootup */
984   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
985   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
986   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
987   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
973   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
974   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
975   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
976   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
988977ADDRESS_MAP_END
989978
990979static ADDRESS_MAP_START( kengo_portmap, AS_IO, 16, m72_state )
r245320r245321
993982   AM_RANGE(0x04, 0x05) AM_READ_PORT("DSW")
994983   AM_RANGE(0x00, 0x01) AM_DEVWRITE("m72", m72_audio_device, sound_command_w)
995984   AM_RANGE(0x02, 0x03) AM_WRITE(rtype2_port02_w)
996   AM_RANGE(0x80, 0x81) AM_WRITE(m72_scrolly1_w)
997   AM_RANGE(0x82, 0x83) AM_WRITE(m72_scrollx1_w)
998   AM_RANGE(0x84, 0x85) AM_WRITE(m72_scrolly2_w)
999   AM_RANGE(0x86, 0x87) AM_WRITE(m72_scrollx2_w)
985   AM_RANGE(0x80, 0x81) AM_WRITE(scrolly1_w)
986   AM_RANGE(0x82, 0x83) AM_WRITE(scrollx1_w)
987   AM_RANGE(0x84, 0x85) AM_WRITE(scrolly2_w)
988   AM_RANGE(0x86, 0x87) AM_WRITE(scrollx2_w)
1000989//  AM_RANGE(0x8c, 0x8f) AM_WRITENOP    /* ??? */
1001990ADDRESS_MAP_END
1002991
r245320r245321
10481037
10491038static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, m72_state )
10501039   /* External access */
1051   AM_RANGE(0x0000, 0x0000) AM_READWRITE(m72_mcu_sample_r, m72_mcu_low_w)
1052   AM_RANGE(0x0001, 0x0001) AM_WRITE(m72_mcu_high_w)
1053   AM_RANGE(0x0002, 0x0002) AM_READWRITE(m72_mcu_snd_r, m72_mcu_ack_w)
1040   AM_RANGE(0x0000, 0x0000) AM_READWRITE(mcu_sample_r, mcu_low_w)
1041   AM_RANGE(0x0001, 0x0001) AM_WRITE(mcu_high_w)
1042   AM_RANGE(0x0002, 0x0002) AM_READWRITE(mcu_snd_r, mcu_ack_w)
10541043   /* shared at b0000 - b0fff on the main cpu */
1055   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(m72_mcu_data_r,m72_mcu_data_w )
1044   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(mcu_data_r,mcu_data_w )
10561045
10571046   /* Ports */
1058   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(m72_mcu_port_r, m72_mcu_port_w)
1047   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(mcu_port_r, mcu_port_w)
10591048ADDRESS_MAP_END
10601049
10611050#define COIN_MODE_1 \
r245320r245321
17931782
17941783   MCFG_SCREEN_ADD("screen", RASTER)
17951784   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
1796   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
1785   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
17971786   MCFG_SCREEN_PALETTE("palette")
17981787
17991788   MCFG_VIDEO_START_OVERRIDE(m72_state,m72)
r245320r245321
18111800
18121801   MCFG_CPU_ADD("mcu",I8751, XTAL_8MHz) /* Uses its own XTAL */
18131802   MCFG_CPU_IO_MAP(mcu_io_map)
1814   MCFG_CPU_VBLANK_INT_DRIVER("screen", m72_state,  m72_mcu_int)
1803   MCFG_CPU_VBLANK_INT_DRIVER("screen", m72_state,  mcu_int)
18151804
18161805MACHINE_CONFIG_END
18171806
r245320r245321
19261915
19271916   MCFG_SCREEN_ADD("screen", RASTER)
19281917   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
1929   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
1918   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
19301919   MCFG_SCREEN_PALETTE("palette")
19311920
19321921   MCFG_VIDEO_START_OVERRIDE(m72_state,rtype2)
r245320r245321
19571946
19581947   MCFG_SCREEN_ADD("screen", RASTER)
19591948   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
1960   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
1949   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
19611950   MCFG_SCREEN_PALETTE("palette")
19621951
19631952   MCFG_VIDEO_START_OVERRIDE(m72_state,hharry)
r245320r245321
19881977
19891978   MCFG_SCREEN_ADD("screen", RASTER)
19901979   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
1991   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
1980   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
19921981   MCFG_SCREEN_PALETTE("palette")
19931982
19941983   MCFG_VIDEO_START_OVERRIDE(m72_state,hharry)
r245320r245321
20202009
20212010   MCFG_SCREEN_ADD("screen", RASTER)
20222011   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
2023   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
2012   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
20242013   MCFG_SCREEN_PALETTE("palette")
20252014
20262015   MCFG_VIDEO_START_OVERRIDE(m72_state,hharryu)
r245320r245321
20492038
20502039   MCFG_SCREEN_ADD("screen", RASTER)
20512040   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
2052   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
2041   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
20532042   MCFG_SCREEN_PALETTE("palette")
20542043
20552044   MCFG_VIDEO_START_OVERRIDE(m72_state,poundfor)
r245320r245321
20802069
20812070   MCFG_SCREEN_ADD("screen", RASTER)
20822071   MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
2083   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update_m72)
2072   MCFG_SCREEN_UPDATE_DRIVER(m72_state, screen_update)
20842073   MCFG_SCREEN_PALETTE("palette")
20852074
20862075   MCFG_VIDEO_START_OVERRIDE(m72_state,poundfor)
r245320r245321
35023491// the program roms failing their tests.  This is why we still have simulation code for many games
35033492// despite having Japanese version MCU roms for several of them.  See notes next to the sets
35043493
3505GAME( 1987, rtype,       0,        rtype,       rtype,    driver_device, 0,           ROT0,   "Irem", "R-Type (World)", GAME_NO_COCKTAIL )
3506GAME( 1987, rtypej,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL )
3507GAME( 1987, rtypejp,     rtype,    rtype,       rtypep,   driver_device, 0,           ROT0,   "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL )
3508GAME( 1987, rtypeu,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL )
3509GAME( 1987, rtypeb,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "bootleg", "R-Type (World bootleg)", GAME_NO_COCKTAIL )
3494GAME( 1987, rtype,       0,        rtype,       rtype,    driver_device, 0,           ROT0,   "Irem", "R-Type (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3495GAME( 1987, rtypej,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3496GAME( 1987, rtypejp,     rtype,    rtype,       rtypep,   driver_device, 0,           ROT0,   "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3497GAME( 1987, rtypeu,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3498GAME( 1987, rtypeb,      rtype,    rtype,       rtype,    driver_device, 0,           ROT0,   "bootleg", "R-Type (World bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35103499
3511GAME( 1987, bchopper,    0,        m72,         bchopper, m72_state,     bchopper,    ROT0,   "Irem", "Battle Chopper", GAME_NO_COCKTAIL )
3512GAME( 1987, mrheli,      bchopper, m72_8751,    bchopper, m72_state,     m72_8751,    ROT0,   "Irem", "Mr. HELI no Daibouken (Japan)", GAME_NO_COCKTAIL )
3500GAME( 1987, bchopper,    0,        m72,         bchopper, m72_state,     bchopper,    ROT0,   "Irem", "Battle Chopper", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3501GAME( 1987, mrheli,      bchopper, m72_8751,    bchopper, m72_state,     m72_8751,    ROT0,   "Irem", "Mr. HELI no Daibouken (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35133502
3514GAME( 1988, nspirit,     0,        m72,         nspirit,  m72_state,     nspirit,     ROT0,   "Irem", "Ninja Spirit", GAME_NO_COCKTAIL )                 // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?)
3515GAME( 1988, nspiritj,    nspirit,  m72_8751,    nspirit,  m72_state,     m72_8751,    ROT0,   "Irem", "Saigo no Nindou (Japan)", GAME_NO_COCKTAIL )      // waits for japan warning screen, works with our mcu dump, corrupt warning screen due to priority / mixing errors (Japan Version)
3503GAME( 1988, nspirit,     0,        m72,         nspirit,  m72_state,     nspirit,     ROT0,   "Irem", "Ninja Spirit", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )                 // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?)
3504GAME( 1988, nspiritj,    nspirit,  m72_8751,    nspirit,  m72_state,     m72_8751,    ROT0,   "Irem", "Saigo no Nindou (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )      // waits for japan warning screen, works with our mcu dump, corrupt warning screen due to priority / mixing errors (Japan Version)
35163505
3517GAME( 1988, imgfight,    0,        m72,         imgfight, m72_state,     imgfight,    ROT270, "Irem", "Image Fight (World, revision A)", 0 )             // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?)
3518GAME( 1988, imgfightj,   imgfight, m72_8751,    imgfight, m72_state,     m72_8751,    ROT270, "Irem", "Image Fight (Japan)", 0 )                         // waits for japan warning screen, works with our mcu dump, can't actually see warning screen due to priority / mixing errors, check tilemap viewer (Japan Version)
3506GAME( 1988, imgfight,    0,        m72,         imgfight, m72_state,     imgfight,    ROT270, "Irem", "Image Fight (World, revision A)", GAME_SUPPORTS_SAVE )             // doesn't wait / check for japan warning string.. fails rom check if used with japanese mcu rom (World version?)
3507GAME( 1988, imgfightj,   imgfight, m72_8751,    imgfight, m72_state,     m72_8751,    ROT270, "Irem", "Image Fight (Japan)", GAME_SUPPORTS_SAVE )                         // waits for japan warning screen, works with our mcu dump, can't actually see warning screen due to priority / mixing errors, check tilemap viewer (Japan Version)
35193508
3520GAME( 1989, loht,        0,        m72,         loht,     m72_state,     loht,        ROT0,   "Irem", "Legend of Hero Tonma", GAME_NO_COCKTAIL )         // fails rom check if used with Japan MCU rom (World version?)
3521GAME( 1989, lohtj,       loht,     m72_8751,    loht,     m72_state,     m72_8751,    ROT0,   "Irem", "Legend of Hero Tonma (Japan)", GAME_NO_COCKTAIL ) // waits for japan warning screen, works with our mcu dump (Japan Version)
3522GAME( 1989, lohtb2,      loht,     m72_8751,    loht,     m72_state,     m72_8751,    ROT0,   "bootleg", "Legend of Hero Tonma (Japan, bootleg with i8751)", GAME_NO_COCKTAIL ) // works like above, mcu code is the same as the real code, probably just an alt revision on a bootleg board
3523GAME( 1989, lohtb,       loht,     m72,         loht,     driver_device, 0,           ROT0,   "bootleg", "Legend of Hero Tonma (unprotected bootleg)", GAME_NOT_WORKING| GAME_NO_COCKTAIL )
3509GAME( 1989, loht,        0,        m72,         loht,     m72_state,     loht,        ROT0,   "Irem", "Legend of Hero Tonma", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )         // fails rom check if used with Japan MCU rom (World version?)
3510GAME( 1989, lohtj,       loht,     m72_8751,    loht,     m72_state,     m72_8751,    ROT0,   "Irem", "Legend of Hero Tonma (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // waits for japan warning screen, works with our mcu dump (Japan Version)
3511GAME( 1989, lohtb2,      loht,     m72_8751,    loht,     m72_state,     m72_8751,    ROT0,   "bootleg", "Legend of Hero Tonma (Japan, bootleg with i8751)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // works like above, mcu code is the same as the real code, probably just an alt revision on a bootleg board
3512GAME( 1989, lohtb,       loht,     m72,         loht,     driver_device, 0,           ROT0,   "bootleg", "Legend of Hero Tonma (unprotected bootleg)", GAME_NOT_WORKING| GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35243513
3525GAME( 1989, xmultipl,    0,        xmultipl,    xmultipl, driver_device, 0,           ROT0,   "Irem", "X Multiply (World, M81)", GAME_NO_COCKTAIL )
3526GAME( 1989, xmultiplm72, xmultipl, xmultiplm72, xmultipl, m72_state,     m72_8751,    ROT0,   "Irem", "X Multiply (Japan, M72)", GAME_NO_COCKTAIL )
3514GAME( 1989, xmultipl,    0,        xmultipl,    xmultipl, driver_device, 0,           ROT0,   "Irem", "X Multiply (World, M81)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3515GAME( 1989, xmultiplm72, xmultipl, xmultiplm72, xmultipl, m72_state,     m72_8751,    ROT0,   "Irem", "X Multiply (Japan, M72)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35273516
3528GAME( 1989, dbreed,      0,        dbreed,      dbreed,   driver_device, 0,           ROT0,   "Irem", "Dragon Breed (M81 PCB version)", GAME_NO_COCKTAIL )
3529GAME( 1989, dbreedm72,   dbreed,   dbreedm72,   dbreed,   m72_state,     dbreedm72,   ROT0,   "Irem", "Dragon Breed (M72 PCB version)", GAME_NO_COCKTAIL )
3517GAME( 1989, dbreed,      0,        dbreed,      dbreed,   driver_device, 0,           ROT0,   "Irem", "Dragon Breed (M81 PCB version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3518GAME( 1989, dbreedm72,   dbreed,   dbreedm72,   dbreed,   m72_state,     dbreedm72,   ROT0,   "Irem", "Dragon Breed (M72 PCB version)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35303519
3531GAME( 1989, rtype2,      0,        rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II", GAME_NO_COCKTAIL )
3532GAME( 1989, rtype2j,     rtype2,   rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II (Japan)", GAME_NO_COCKTAIL )
3533GAME( 1989, rtype2jc,    rtype2,   rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II (Japan, revision C)", GAME_NO_COCKTAIL )
3520GAME( 1989, rtype2,      0,        rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3521GAME( 1989, rtype2j,     rtype2,   rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3522GAME( 1989, rtype2jc,    rtype2,   rtype2,      rtype2,   driver_device, 0,           ROT0,   "Irem", "R-Type II (Japan, revision C)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35343523
3535GAME( 1990, majtitle,    0,        majtitle,    rtype2,   driver_device, 0,           ROT0,   "Irem", "Major Title (World)", GAME_NO_COCKTAIL )
3536GAME( 1990, majtitlej,   majtitle, majtitle,    rtype2,   driver_device, 0,           ROT0,   "Irem", "Major Title (Japan)", GAME_NO_COCKTAIL )
3524GAME( 1990, majtitle,    0,        majtitle,    rtype2,   driver_device, 0,           ROT0,   "Irem", "Major Title (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3525GAME( 1990, majtitlej,   majtitle, majtitle,    rtype2,   driver_device, 0,           ROT0,   "Irem", "Major Title (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35373526
3538GAME( 1990, hharry,      0,        hharry,      hharry,   driver_device, 0,           ROT0,   "Irem", "Hammerin' Harry (World)", GAME_NO_COCKTAIL )
3539GAME( 1990, hharryu,     hharry,   hharryu,     hharry,   driver_device, 0,           ROT0,   "Irem America", "Hammerin' Harry (US)", GAME_NO_COCKTAIL )
3540GAME( 1990, dkgensan,    hharry,   hharryu,     hharry,   driver_device, 0,           ROT0,   "Irem", "Daiku no Gensan (Japan, M82)", GAME_NO_COCKTAIL )
3541GAME( 1990, dkgensanm72, hharry,   dkgenm72,    hharry,   m72_state,     dkgenm72,    ROT0,   "Irem", "Daiku no Gensan (Japan, M72)", GAME_NO_COCKTAIL )
3527GAME( 1990, hharry,      0,        hharry,      hharry,   driver_device, 0,           ROT0,   "Irem", "Hammerin' Harry (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3528GAME( 1990, hharryu,     hharry,   hharryu,     hharry,   driver_device, 0,           ROT0,   "Irem America", "Hammerin' Harry (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3529GAME( 1990, dkgensan,    hharry,   hharryu,     hharry,   driver_device, 0,           ROT0,   "Irem", "Daiku no Gensan (Japan, M82)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3530GAME( 1990, dkgensanm72, hharry,   dkgenm72,    hharry,   m72_state,     dkgenm72,    ROT0,   "Irem", "Daiku no Gensan (Japan, M72)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35423531
3543GAME( 1990, poundfor,    0,        poundfor,    poundfor, driver_device, 0,           ROT270, "Irem", "Pound for Pound (World)", GAME_NO_COCKTAIL )
3544GAME( 1990, poundforj,   poundfor, poundfor,    poundfor, driver_device, 0,           ROT270, "Irem", "Pound for Pound (Japan)", GAME_NO_COCKTAIL )
3545GAME( 1990, poundforu,   poundfor, poundfor,    poundfor, driver_device, 0,           ROT270, "Irem America", "Pound for Pound (US)", GAME_NO_COCKTAIL )
3532GAME( 1990, poundfor,    0,        poundfor,    poundfor, driver_device, 0,           ROT270, "Irem", "Pound for Pound (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3533GAME( 1990, poundforj,   poundfor, poundfor,    poundfor, driver_device, 0,           ROT270, "Irem", "Pound for Pound (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3534GAME( 1990, poundforu,   poundfor, poundfor,    poundfor, driver_device, 0,           ROT270, "Irem America", "Pound for Pound (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35463535
3547GAME( 1990, airduel,     0,        m72,         airduel,  m72_state,     airduel,     ROT270, "Irem", "Air Duel (Japan)", 0 )
3536GAME( 1990, airduel,     0,        m72,         airduel,  m72_state,     airduel,     ROT270, "Irem", "Air Duel (Japan)", GAME_SUPPORTS_SAVE )
35483537
3549GAME( 1991, cosmccop,    0,        cosmccop,    gallop,   driver_device, 0,           ROT0,   "Irem", "Cosmic Cop (World)", GAME_NO_COCKTAIL )
3550GAME( 1991, gallop,      cosmccop, m72,         gallop,   m72_state,     gallop,      ROT0,   "Irem", "Gallop - Armed Police Unit (Japan)", GAME_NO_COCKTAIL )
3538GAME( 1991, cosmccop,    0,        cosmccop,    gallop,   driver_device, 0,           ROT0,   "Irem", "Cosmic Cop (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
3539GAME( 1991, gallop,      cosmccop, m72,         gallop,   m72_state,     gallop,      ROT0,   "Irem", "Gallop - Armed Police Unit (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
35513540
3552GAME( 1991, kengo,       0,        kengo,       kengo,    driver_device, 0,           ROT0,   "Irem", "Ken-Go", GAME_NO_COCKTAIL )
3541GAME( 1991, kengo,       0,        kengo,       kengo,    driver_device, 0,           ROT0,   "Irem", "Ken-Go", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/m72.h
r245320r245321
1111public:
1212   m72_state(const machine_config &mconfig, device_type type, const char *tag)
1313      : driver_device(mconfig, type, tag),
14      m_spriteram(*this, "spriteram"),
15      m_videoram1(*this, "videoram1"),
16      m_videoram2(*this, "videoram2"),
17      m_majtitle_rowscrollram(*this, "majtitle_rowscr"),
18      m_spriteram2(*this, "spriteram2"),
19      m_soundram(*this, "soundram"),
2014      m_maincpu(*this, "maincpu"),
2115      m_soundcpu(*this, "soundcpu"),
2216      m_mcu(*this, "mcu"),
r245320r245321
2519      m_gfxdecode(*this, "gfxdecode"),
2620      m_screen(*this, "screen"),
2721      m_palette(*this, "palette"),
22      m_spriteram(*this, "spriteram"),
23      m_videoram1(*this, "videoram1"),
24      m_videoram2(*this, "videoram2"),
25      m_majtitle_rowscrollram(*this, "majtitle_rowscr"),
26      m_spriteram2(*this, "spriteram2"),
27      m_soundram(*this, "soundram"),
2828      m_generic_paletteram_16(*this, "paletteram"),
2929      m_generic_paletteram2_16(*this, "paletteram2") { }
3030
31   required_shared_ptr<UINT16> m_spriteram;
32   required_shared_ptr<UINT16> m_videoram1;
33   required_shared_ptr<UINT16> m_videoram2;
34   optional_shared_ptr<UINT16> m_majtitle_rowscrollram;
35   optional_shared_ptr<UINT16> m_spriteram2;
36   optional_shared_ptr<UINT8> m_soundram;
37
3831   required_device<cpu_device> m_maincpu;
3932   required_device<cpu_device> m_soundcpu;
4033   optional_device<cpu_device> m_mcu;
r245320r245321
4336   required_device<gfxdecode_device> m_gfxdecode;
4437   required_device<screen_device> m_screen;
4538   required_device<palette_device> m_palette;
39
40   required_shared_ptr<UINT16> m_spriteram;
41   required_shared_ptr<UINT16> m_videoram1;
42   required_shared_ptr<UINT16> m_videoram2;
43   optional_shared_ptr<UINT16> m_majtitle_rowscrollram;
44   optional_shared_ptr<UINT16> m_spriteram2;
45   optional_shared_ptr<UINT8> m_soundram;
4646   required_shared_ptr<UINT16> m_generic_paletteram_16;
4747   required_shared_ptr<UINT16> m_generic_paletteram2_16;
4848
4949   UINT16 *m_protection_ram;
5050   emu_timer *m_scanline_timer;
5151   UINT8 m_irq_base;
52   UINT8 m_mcu_snd_cmd_latch;
53   UINT8 m_mcu_sample_latch;
54   UINT32 m_mcu_sample_addr;
5552   const UINT8 *m_protection_code;
5653   const UINT8 *m_protection_crc;
57   int m_prev[4];
58   int m_diff[4];
5954   UINT32 m_raster_irq_position;
6055   UINT16 *m_buffered_spriteram;
6156   tilemap_t *m_fg_tilemap;
r245320r245321
6560   INT32 m_scrollx2;
6661   INT32 m_scrolly2;
6762   INT32 m_video_off;
63
64   //poundfor specific
65   int m_prev[4];
66   int m_diff[4];
67
68   // majtitle specific
6869   int m_majtitle_rowscroll;
69   DECLARE_WRITE16_MEMBER(m72_main_mcu_sound_w);
70   DECLARE_WRITE16_MEMBER(m72_main_mcu_w);
71   DECLARE_WRITE8_MEMBER(m72_mcu_data_w);
72   DECLARE_READ8_MEMBER(m72_mcu_data_r);
73   DECLARE_READ8_MEMBER(m72_mcu_sample_r);
74   DECLARE_WRITE8_MEMBER(m72_mcu_ack_w);
75   DECLARE_READ8_MEMBER(m72_mcu_snd_r);
76   DECLARE_READ8_MEMBER(m72_mcu_port_r);
77   DECLARE_WRITE8_MEMBER(m72_mcu_port_w);
78   DECLARE_WRITE8_MEMBER(m72_mcu_low_w);
79   DECLARE_WRITE8_MEMBER(m72_mcu_high_w);
80   DECLARE_READ8_MEMBER(m72_snd_cpu_sample_r);
70   
71   // m72_i8751 specific
72   UINT8 m_mcu_snd_cmd_latch;
73   UINT8 m_mcu_sample_latch;
74   UINT32 m_mcu_sample_addr;
75   
76   // common
77   DECLARE_READ16_MEMBER(palette1_r);
78   DECLARE_READ16_MEMBER(palette2_r);
79   DECLARE_WRITE16_MEMBER(palette1_w);
80   DECLARE_WRITE16_MEMBER(palette2_w);
81   DECLARE_WRITE16_MEMBER(videoram1_w);
82   DECLARE_WRITE16_MEMBER(videoram2_w);
83   DECLARE_READ16_MEMBER(soundram_r);
84   DECLARE_WRITE16_MEMBER(soundram_w);
85   
86   // m72_i8751 specific
87   DECLARE_WRITE16_MEMBER(main_mcu_sound_w);
88   DECLARE_WRITE16_MEMBER(main_mcu_w);
89   DECLARE_WRITE8_MEMBER(mcu_data_w);
90   DECLARE_READ8_MEMBER(mcu_data_r);
91   DECLARE_READ8_MEMBER(mcu_sample_r);
92   DECLARE_WRITE8_MEMBER(mcu_ack_w);
93   DECLARE_READ8_MEMBER(mcu_snd_r);
94   DECLARE_READ8_MEMBER(mcu_port_r);
95   DECLARE_WRITE8_MEMBER(mcu_port_w);
96   DECLARE_WRITE8_MEMBER(mcu_low_w);
97   DECLARE_WRITE8_MEMBER(mcu_high_w);
98   DECLARE_READ8_MEMBER(snd_cpu_sample_r);
99   DECLARE_WRITE16_MEMBER(irq_line_w);
100   DECLARE_WRITE16_MEMBER(scrollx1_w);
101   DECLARE_WRITE16_MEMBER(scrollx2_w);
102   DECLARE_WRITE16_MEMBER(scrolly1_w);
103   DECLARE_WRITE16_MEMBER(scrolly2_w);
104   DECLARE_WRITE16_MEMBER(dmaon_w);
105   DECLARE_WRITE16_MEMBER(port02_w);
106   DECLARE_READ16_MEMBER(protection_r);
107   DECLARE_WRITE16_MEMBER(protection_w);
108
109   // game specific
81110   DECLARE_WRITE16_MEMBER(bchopper_sample_trigger_w);
82111   DECLARE_WRITE16_MEMBER(nspirit_sample_trigger_w);
83112   DECLARE_WRITE16_MEMBER(imgfight_sample_trigger_w);
r245320r245321
86115   DECLARE_WRITE16_MEMBER(airduel_sample_trigger_w);
87116   DECLARE_WRITE16_MEMBER(dkgenm72_sample_trigger_w);
88117   DECLARE_WRITE16_MEMBER(gallop_sample_trigger_w);
89   DECLARE_READ16_MEMBER(protection_r);
90   DECLARE_WRITE16_MEMBER(protection_w);
91   DECLARE_READ16_MEMBER(soundram_r);
92   DECLARE_WRITE16_MEMBER(soundram_w);
93118   DECLARE_READ16_MEMBER(poundfor_trackball_r);
94   DECLARE_READ16_MEMBER(m72_palette1_r);
95   DECLARE_READ16_MEMBER(m72_palette2_r);
96   DECLARE_WRITE16_MEMBER(m72_palette1_w);
97   DECLARE_WRITE16_MEMBER(m72_palette2_w);
98   DECLARE_WRITE16_MEMBER(m72_videoram1_w);
99   DECLARE_WRITE16_MEMBER(m72_videoram2_w);
100   DECLARE_WRITE16_MEMBER(m72_irq_line_w);
101   DECLARE_WRITE16_MEMBER(m72_scrollx1_w);
102   DECLARE_WRITE16_MEMBER(m72_scrollx2_w);
103   DECLARE_WRITE16_MEMBER(m72_scrolly1_w);
104   DECLARE_WRITE16_MEMBER(m72_scrolly2_w);
105   DECLARE_WRITE16_MEMBER(m72_dmaon_w);
106   DECLARE_WRITE16_MEMBER(m72_port02_w);
107119   DECLARE_WRITE16_MEMBER(rtype2_port02_w);
108120   DECLARE_WRITE16_MEMBER(majtitle_gfx_ctrl_w);
109   DECLARE_WRITE8_MEMBER(m72_snd_cpu_sample_w);
110   DECLARE_DRIVER_INIT(dkgenm72);
111   DECLARE_DRIVER_INIT(bchopper);
112   DECLARE_DRIVER_INIT(gallop);
113   DECLARE_DRIVER_INIT(m72_8751);
114   DECLARE_DRIVER_INIT(dbreedm72);
115   DECLARE_DRIVER_INIT(airduel);
116   DECLARE_DRIVER_INIT(nspirit);
117   DECLARE_DRIVER_INIT(loht);
118   DECLARE_DRIVER_INIT(imgfight);
119   TILE_GET_INFO_MEMBER(m72_get_bg_tile_info);
120   TILE_GET_INFO_MEMBER(m72_get_fg_tile_info);
121   
122   TILE_GET_INFO_MEMBER(get_bg_tile_info);
123   TILE_GET_INFO_MEMBER(get_fg_tile_info);
121124   TILE_GET_INFO_MEMBER(hharry_get_bg_tile_info);
122125   TILE_GET_INFO_MEMBER(rtype2_get_bg_tile_info);
123126   TILE_GET_INFO_MEMBER(rtype2_get_fg_tile_info);
124127   TILEMAP_MAPPER_MEMBER(majtitle_scan_rows);
128   
125129   void machine_start();
126130   void machine_reset();
127131   DECLARE_VIDEO_START(m72);
r245320r245321
134138   DECLARE_VIDEO_START(poundfor);
135139   DECLARE_MACHINE_START(kengo);
136140   DECLARE_MACHINE_RESET(kengo);
137   UINT32 screen_update_m72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
138   UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
139   INTERRUPT_GEN_MEMBER(m72_mcu_int);
141   DECLARE_DRIVER_INIT(dkgenm72);
142   DECLARE_DRIVER_INIT(bchopper);
143   DECLARE_DRIVER_INIT(gallop);
144   DECLARE_DRIVER_INIT(m72_8751);
145   DECLARE_DRIVER_INIT(dbreedm72);
146   DECLARE_DRIVER_INIT(airduel);
147   DECLARE_DRIVER_INIT(nspirit);
148   DECLARE_DRIVER_INIT(loht);
149   DECLARE_DRIVER_INIT(imgfight);
150   
151   INTERRUPT_GEN_MEMBER(mcu_int);
140152   INTERRUPT_GEN_MEMBER(fake_nmi);
141153   TIMER_CALLBACK_MEMBER(synch_callback);
142   TIMER_CALLBACK_MEMBER(m72_scanline_interrupt);
154   TIMER_CALLBACK_MEMBER(scanline_interrupt);
143155   TIMER_CALLBACK_MEMBER(kengo_scanline_interrupt);
144156   TIMER_CALLBACK_MEMBER(delayed_ram16_w);
145   inline void m72_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum);
157   
158   
159   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
160   UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
161   inline void get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum);
146162   inline void rtype2_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum);
147163   void register_savestate();
148164   inline void changecolor(int color,int r,int g,int b);
149   void m72_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
165   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
150166   void majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
151167   int find_sample(int num);
152168   void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes);
trunk/src/mame/video/m72.c
r245320r245321
77
88***************************************************************************/
99
10inline void m72_state::m72_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
10inline void m72_state::get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
1111{
1212   int code,attr,color,pri;
1313
r245320r245321
5454}
5555
5656
57TILE_GET_INFO_MEMBER(m72_state::m72_get_bg_tile_info)
57TILE_GET_INFO_MEMBER(m72_state::get_bg_tile_info)
5858{
59   m72_get_tile_info(tileinfo,tile_index,m_videoram2,2);
59   get_tile_info(tileinfo,tile_index,m_videoram2,2);
6060}
6161
62TILE_GET_INFO_MEMBER(m72_state::m72_get_fg_tile_info)
62TILE_GET_INFO_MEMBER(m72_state::get_fg_tile_info)
6363{
64   m72_get_tile_info(tileinfo,tile_index,m_videoram1,1);
64   get_tile_info(tileinfo,tile_index,m_videoram1,1);
6565}
6666
6767TILE_GET_INFO_MEMBER(m72_state::hharry_get_bg_tile_info)
6868{
69   m72_get_tile_info(tileinfo,tile_index,m_videoram2,1);
69   get_tile_info(tileinfo,tile_index,m_videoram2,1);
7070}
7171
7272TILE_GET_INFO_MEMBER(m72_state::rtype2_get_bg_tile_info)
r245320r245321
107107
108108VIDEO_START_MEMBER(m72_state,m72)
109109{
110   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
111   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
110   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
111   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
112112
113113   m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
114114
r245320r245321
178178   m_bg_tilemap->set_scrolldx(6,0);
179179   m_fg_tilemap->set_scrolldy(-128,-128);
180180   m_bg_tilemap->set_scrolldy(-128,-128);
181   
182   save_item(NAME(m_prev));
183   save_item(NAME(m_diff));
181184}
182185
183186VIDEO_START_MEMBER(m72_state,hharryu)
r245320r245321
218221   m_bg_tilemap->set_scrolldy(-128,-128);
219222
220223   register_savestate();
224   save_item(NAME(m_majtitle_rowscroll));
221225}
222226
223227VIDEO_START_MEMBER(m72_state,hharry)
224228{
225229   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::hharry_get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,64);
226   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::m72_get_fg_tile_info),this),   TILEMAP_SCAN_ROWS,8,8,64,64);
230   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m72_state::get_fg_tile_info),this),   TILEMAP_SCAN_ROWS,8,8,64,64);
227231
228232   m_buffered_spriteram = auto_alloc_array(machine(), UINT16, m_spriteram.bytes()/2);
229233
r245320r245321
253257
254258***************************************************************************/
255259
256READ16_MEMBER(m72_state::m72_palette1_r)
260READ16_MEMBER(m72_state::palette1_r)
257261{
258262   /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
259263   offset &= ~0x100;
r245320r245321
261265   return m_generic_paletteram_16[offset] | 0xffe0;    /* only D0-D4 are connected */
262266}
263267
264READ16_MEMBER(m72_state::m72_palette2_r)
268READ16_MEMBER(m72_state::palette2_r)
265269{
266270   /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
267271   offset &= ~0x100;
r245320r245321
274278   m_palette->set_pen_color(color,pal5bit(r),pal5bit(g),pal5bit(b));
275279}
276280
277WRITE16_MEMBER(m72_state::m72_palette1_w)
281WRITE16_MEMBER(m72_state::palette1_w)
278282{
279283   /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
280284   offset &= ~0x100;
r245320r245321
287291         m_generic_paletteram_16[offset + 0x400]);
288292}
289293
290WRITE16_MEMBER(m72_state::m72_palette2_w)
294WRITE16_MEMBER(m72_state::palette2_w)
291295{
292296   /* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
293297   offset &= ~0x100;
r245320r245321
300304         m_generic_paletteram2_16[offset + 0x400]);
301305}
302306
303WRITE16_MEMBER(m72_state::m72_videoram1_w)
307WRITE16_MEMBER(m72_state::videoram1_w)
304308{
305309   COMBINE_DATA(&m_videoram1[offset]);
306310   m_fg_tilemap->mark_tile_dirty(offset/2);
307311}
308312
309WRITE16_MEMBER(m72_state::m72_videoram2_w)
313WRITE16_MEMBER(m72_state::videoram2_w)
310314{
311315   COMBINE_DATA(&m_videoram2[offset]);
312316   m_bg_tilemap->mark_tile_dirty(offset/2);
313317}
314318
315WRITE16_MEMBER(m72_state::m72_irq_line_w)
319WRITE16_MEMBER(m72_state::irq_line_w)
316320{
317321   COMBINE_DATA(&m_raster_irq_position);
318322}
319323
320WRITE16_MEMBER(m72_state::m72_scrollx1_w)
324WRITE16_MEMBER(m72_state::scrollx1_w)
321325{
322326   COMBINE_DATA(&m_scrollx1);
323327}
324328
325WRITE16_MEMBER(m72_state::m72_scrollx2_w)
329WRITE16_MEMBER(m72_state::scrollx2_w)
326330{
327331   COMBINE_DATA(&m_scrollx2);
328332}
329333
330WRITE16_MEMBER(m72_state::m72_scrolly1_w)
334WRITE16_MEMBER(m72_state::scrolly1_w)
331335{
332336   COMBINE_DATA(&m_scrolly1);
333337}
334338
335WRITE16_MEMBER(m72_state::m72_scrolly2_w)
339WRITE16_MEMBER(m72_state::scrolly2_w)
336340{
337341   COMBINE_DATA(&m_scrolly2);
338342}
339343
340WRITE16_MEMBER(m72_state::m72_dmaon_w)
344WRITE16_MEMBER(m72_state::dmaon_w)
341345{
342346   if (ACCESSING_BITS_0_7)
343347      memcpy(m_buffered_spriteram, m_spriteram, m_spriteram.bytes());
344348}
345349
346350
347WRITE16_MEMBER(m72_state::m72_port02_w)
351WRITE16_MEMBER(m72_state::port02_w)
348352{
349353   if (ACCESSING_BITS_0_7)
350354   {
r245320r245321
409413
410414***************************************************************************/
411415
412void m72_state::m72_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
416void m72_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
413417{
414418   UINT16 *spriteram = m_buffered_spriteram;
415419   int offs;
r245320r245321
512516   }
513517}
514518
515UINT32 m72_state::screen_update_m72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
519UINT32 m72_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
516520{
517521   if (m_video_off)
518522   {
r245320r245321
528532
529533   m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
530534   m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
531   m72_draw_sprites(bitmap,cliprect);
535   draw_sprites(bitmap,cliprect);
532536   m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
533537   m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
534538   return 0;
r245320r245321
565569   m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
566570   m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
567571   majtitle_draw_sprites(bitmap,cliprect);
568   m72_draw_sprites(bitmap,cliprect);
572   draw_sprites(bitmap,cliprect);
569573   m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
570574   m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
571575   return 0;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team