| Previous | 199869 Revisions | Next |
| r18572 Wednesday 17th October, 2012 at 09:24:23 UTC by Aaron Giles |
|---|
| Initial round of atarigen cleanup. |
| [src/mame/audio] | atarijsa.c atarijsa.h |
| [src/mame/drivers] | arcadecl.c atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c atarisy2.c badlands.c batman.c beathead.c blstroid.c cyberbal.c eprom.c foodf.c gauntlet.c harddriv.c klax.c offtwall.c rampart.c relief.c shuuz.c skullxbo.c thunderj.c toobin.c vindictr.c xybots.c |
| [src/mame/includes] | arcadecl.h atarig1.h atarig42.h atarigt.h atarigx2.h atarisy1.h atarisy2.h badlands.h batman.h beathead.h blstroid.h cyberbal.h eprom.h foodf.h gauntlet.h harddriv.h klax.h liberatr.h offtwall.h rampart.h relief.h shuuz.h skullxbo.h thunderj.h toobin.h vindictr.h xybots.h |
| [src/mame/machine] | atarigen.c atarigen.h harddriv.c |
| [src/mame/video] | atarig1.c atarig42.c atarigt.c atarigx2.c atarisy1.c batman.c blstroid.c cyberbal.c eprom.c vindictr.c |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void klax_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | klax_state *state = machine.driver_data<klax_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state || state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(4, m_video_int_state || m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | |
| 41 | ||
| 40 | void klax_state::scanline_update(screen_device &screen, int scanline) | |
| 42 | 41 | { |
| 43 | 42 | /* generate 32V signals */ |
| 44 | if ((scanline & 32) == 0 && !(screen.machine().root_device().ioport("P1")->read() & 0x800)) | |
| 45 | atarigen_scanline_int_gen(screen.machine().device("maincpu")); | |
| 43 | if ((scanline & 32) == 0 && !(ioport("P1")->read() & 0x800)) | |
| 44 | scanline_int_gen(*subdevice("maincpu")); | |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | |
| 49 | 48 | WRITE16_MEMBER(klax_state::interrupt_ack_w) |
| 50 | 49 | { |
| 51 | | |
| 50 | scanline_int_ack_w(space, offset, data, mem_mask); | |
| 52 | 51 | atarigen_video_int_ack_w(space, offset, data, mem_mask); |
| 53 | 52 | } |
| 54 | 53 | |
| r18571 | r18572 | |
| 60 | 59 | * |
| 61 | 60 | *************************************/ |
| 62 | 61 | |
| 63 | MACHINE_START_MEMBER(klax_state,klax) | |
| 64 | { | |
| 65 | atarigen_init(machine()); | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | 62 | MACHINE_RESET_MEMBER(klax_state,klax) |
| 70 | 63 | { |
| 71 | ||
| 72 | atarigen_eeprom_reset(this); | |
| 73 | atarigen_interrupt_reset(this, update_interrupts); | |
| 74 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32); | |
| 64 | atarigen_state::machine_reset(); | |
| 65 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 75 | 66 | } |
| 76 | 67 | |
| 77 | 68 | |
| r18571 | r18572 | |
| 171 | 162 | MCFG_CPU_PROGRAM_MAP(klax_map) |
| 172 | 163 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 173 | 164 | |
| 174 | MCFG_MACHINE_START_OVERRIDE(klax_state,klax) | |
| 175 | 165 | MCFG_MACHINE_RESET_OVERRIDE(klax_state,klax) |
| 176 | 166 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 177 | 167 |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | * |
| 33 | 33 | *************************************/ |
| 34 | 34 | |
| 35 | ||
| 35 | void xybots_state::update_interrupts() | |
| 36 | 36 | { |
| 37 | xybots_state *state = machine.driver_data<xybots_state>(); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | subdevice("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 39 | } |
| 41 | 40 | |
| 42 | 41 | |
| 43 | MACHINE_START_MEMBER(xybots_state,xybots) | |
| 44 | { | |
| 45 | atarigen_init(machine()); | |
| 46 | } | |
| 47 | ||
| 48 | ||
| 49 | 42 | MACHINE_RESET_MEMBER(xybots_state,xybots) |
| 50 | 43 | { |
| 51 | ||
| 52 | atarigen_eeprom_reset(this); | |
| 53 | atarigen_slapstic_reset(this); | |
| 54 | atarigen_interrupt_reset(this, update_interrupts); | |
| 55 | atarijsa_reset(); | |
| 44 | atarigen_state::machine_reset(); | |
| 45 | atarijsa_reset(machine()); | |
| 56 | 46 | } |
| 57 | 47 | |
| 58 | 48 | |
| r18571 | r18572 | |
| 92 | 82 | AM_RANGE(0xffb000, 0xffbfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| 93 | 83 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x7f8800) AM_RAM_WRITE(paletteram_IIIIRRRRGGGGBBBB_word_w) AM_SHARE("paletteram") |
| 94 | 84 | AM_RANGE(0xffd000, 0xffdfff) AM_MIRROR(0x7f8000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 95 | AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ | |
| 85 | AM_RANGE(0xffe000, 0xffe0ff) AM_MIRROR(0x7f8000) AM_READ8(sound_r, 0x00ff) | |
| 96 | 86 | AM_RANGE(0xffe100, 0xffe1ff) AM_MIRROR(0x7f8000) AM_READ_PORT("FFE100") |
| 97 | 87 | AM_RANGE(0xffe200, 0xffe2ff) AM_MIRROR(0x7f8000) AM_READ(special_port1_r) |
| 98 | 88 | AM_RANGE(0xffe800, 0xffe8ff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 99 | AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE | |
| 89 | AM_RANGE(0xffe900, 0xffe9ff) AM_MIRROR(0x7f8000) AM_WRITE8(sound_w, 0x00ff) | |
| 100 | 90 | AM_RANGE(0xffea00, 0xffeaff) AM_MIRROR(0x7f8000) AM_WRITE(watchdog_reset16_w) |
| 101 | 91 | AM_RANGE(0xffeb00, 0xffebff) AM_MIRROR(0x7f8000) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 102 | AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_WRITE | |
| 92 | AM_RANGE(0xffee00, 0xffeeff) AM_MIRROR(0x7f8000) AM_WRITE(sound_reset_w) | |
| 103 | 93 | ADDRESS_MAP_END |
| 104 | 94 | |
| 105 | 95 | |
| r18571 | r18572 | |
| 197 | 187 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 198 | 188 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 199 | 189 | |
| 200 | MCFG_MACHINE_START_OVERRIDE(xybots_state,xybots) | |
| 201 | 190 | MCFG_MACHINE_RESET_OVERRIDE(xybots_state,xybots) |
| 202 | 191 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 203 | 192 | |
| r18571 | r18572 | |
| 391 | 380 | DRIVER_INIT_MEMBER(xybots_state,xybots) |
| 392 | 381 | { |
| 393 | 382 | m_h256 = 0x0400; |
| 394 | | |
| 383 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x008000, 0, 107); | |
| 395 | 384 | atarijsa_init(machine(), "FFE200", 0x0100); |
| 396 | 385 | } |
| 397 | 386 |
| r18571 | r18572 | |
|---|---|---|
| 34 | 34 | * |
| 35 | 35 | *************************************/ |
| 36 | 36 | |
| 37 | ||
| 37 | void toobin_state::update_interrupts() | |
| 38 | 38 | { |
| 39 | toobin_state *state = machine.driver_data<toobin_state>(); | |
| 40 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 42 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | subdevice("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | subdevice("maincpu")->execute().set_input_line(3, m_scanline_int_state && m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | 44 | |
| 46 | MACHINE_START_MEMBER(toobin_state,toobin) | |
| 47 | { | |
| 48 | atarigen_init(machine()); | |
| 49 | } | |
| 50 | ||
| 51 | ||
| 52 | 45 | MACHINE_RESET_MEMBER(toobin_state,toobin) |
| 53 | 46 | { |
| 54 | ||
| 55 | atarigen_eeprom_reset(this); | |
| 56 | atarigen_interrupt_reset(this, update_interrupts); | |
| 57 | atarijsa_reset(); | |
| 47 | atarigen_state::machine_reset(); | |
| 48 | atarijsa_reset(machine()); | |
| 58 | 49 | } |
| 59 | 50 | |
| 60 | 51 | |
| r18571 | r18572 | |
| 75 | 66 | if (oldword != newword) |
| 76 | 67 | { |
| 77 | 68 | m_interrupt_scan[offset] = newword; |
| 78 | | |
| 69 | scanline_int_set(*machine().primary_screen, newword & 0x1ff); | |
| 79 | 70 | } |
| 80 | 71 | } |
| 81 | 72 | |
| r18571 | r18572 | |
| 113 | 104 | AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE_LEGACY(toobin_paletteram_w) AM_SHARE("paletteram") |
| 114 | 105 | AM_RANGE(0xff6000, 0xff6001) AM_READNOP /* who knows? read at controls time */ |
| 115 | 106 | AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x4500fe) AM_WRITE(watchdog_reset16_w) |
| 116 | AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE | |
| 107 | AM_RANGE(0xff8100, 0xff8101) AM_MIRROR(0x4500fe) AM_WRITE8(sound_w, 0x00ff) | |
| 117 | 108 | AM_RANGE(0xff8300, 0xff8301) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(toobin_intensity_w) |
| 118 | 109 | AM_RANGE(0xff8340, 0xff8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan") |
| 119 | 110 | AM_RANGE(0xff8380, 0xff8381) AM_MIRROR(0x45003e) AM_READWRITE_LEGACY(atarimo_0_slipram_r, toobin_slip_w) |
| 120 | AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE_LEGACY(atarigen_scanline_int_ack_w) | |
| 121 | AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 111 | AM_RANGE(0xff83c0, 0xff83c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w) | |
| 112 | AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x4500fe) AM_WRITE(sound_reset_w) | |
| 122 | 113 | AM_RANGE(0xff8500, 0xff8501) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 123 | 114 | AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_xscroll_w) AM_SHARE("xscroll") |
| 124 | 115 | AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE_LEGACY(toobin_yscroll_w) AM_SHARE("yscroll") |
| 125 | 116 | AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800") |
| 126 | 117 | AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ(special_port1_r) |
| 127 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ | |
| 118 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_READ8(sound_r, 0x00ff) | |
| 128 | 119 | AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 129 | 120 | AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM |
| 130 | 121 | ADDRESS_MAP_END |
| r18571 | r18572 | |
| 227 | 218 | MCFG_CPU_ADD("maincpu", M68010, MASTER_CLOCK/4) |
| 228 | 219 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 229 | 220 | |
| 230 | MCFG_MACHINE_START_OVERRIDE(toobin_state,toobin) | |
| 231 | 221 | MCFG_MACHINE_RESET_OVERRIDE(toobin_state,toobin) |
| 232 | 222 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 233 | 223 | MCFG_WATCHDOG_VBLANK_INIT(8) |
| r18571 | r18572 | |
|---|---|---|
| 82 | 82 | * |
| 83 | 83 | *************************************/ |
| 84 | 84 | |
| 85 | ||
| 85 | void arcadecl_state::update_interrupts() | |
| 86 | 86 | { |
| 87 | arcadecl_state *state = machine.driver_data<arcadecl_state>(); | |
| 88 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 87 | machine().device("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 89 | 88 | } |
| 90 | 89 | |
| 91 | 90 | |
| 92 | ||
| 91 | void arcadecl_state::scanline_update(screen_device &screen, int scanline) | |
| 93 | 92 | { |
| 94 | 93 | /* generate 32V signals */ |
| 95 | 94 | if ((scanline & 32) == 0) |
| 96 | | |
| 95 | scanline_int_gen(*subdevice("maincpu")); | |
| 97 | 96 | } |
| 98 | 97 | |
| 99 | 98 | |
| r18571 | r18572 | |
| 104 | 103 | * |
| 105 | 104 | *************************************/ |
| 106 | 105 | |
| 107 | MACHINE_START_MEMBER(arcadecl_state,arcadecl) | |
| 108 | { | |
| 109 | atarigen_init(machine()); | |
| 110 | } | |
| 111 | ||
| 112 | ||
| 113 | 106 | MACHINE_RESET_MEMBER(arcadecl_state,arcadecl) |
| 114 | 107 | { |
| 115 | ||
| 116 | atarigen_eeprom_reset(this); | |
| 117 | atarigen_interrupt_reset(this, update_interrupts); | |
| 118 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32); | |
| 108 | atarigen_state::machine_reset(); | |
| 109 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 119 | 110 | } |
| 120 | 111 | |
| 121 | 112 | |
| r18571 | r18572 | |
| 139 | 130 | { |
| 140 | 131 | okim6295_device *oki = machine().device<okim6295_device>("oki"); |
| 141 | 132 | oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000); |
| 142 | | |
| 133 | set_oki6295_volume((data & 0x001f) * 100 / 0x1f); | |
| 143 | 134 | } |
| 144 | 135 | } |
| 145 | 136 | |
| r18571 | r18572 | |
| 170 | 161 | AM_RANGE(0x640060, 0x64006f) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 171 | 162 | AM_RANGE(0x641000, 0x641fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 172 | 163 | AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00) |
| 173 | AM_RANGE(0x646000, 0x646fff) AM_WRITE | |
| 164 | AM_RANGE(0x646000, 0x646fff) AM_WRITE(scanline_int_ack_w) | |
| 174 | 165 | AM_RANGE(0x647000, 0x647fff) AM_WRITE(watchdog_reset16_w) |
| 175 | 166 | ADDRESS_MAP_END |
| 176 | 167 | |
| r18571 | r18572 | |
| 330 | 321 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 331 | 322 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 332 | 323 | |
| 333 | MCFG_MACHINE_START_OVERRIDE(arcadecl_state,arcadecl) | |
| 334 | 324 | MCFG_MACHINE_RESET_OVERRIDE(arcadecl_state,arcadecl) |
| 335 | 325 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 336 | 326 |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void skullxbo_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | skullxbo_state *state = machine.driver_data<skullxbo_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | subdevice("maincpu")->execute().set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 39 | } |
| 41 | 40 | |
| 42 | 41 | |
| 43 | 42 | TIMER_CALLBACK_MEMBER(skullxbo_state::irq_gen) |
| 44 | 43 | { |
| 45 | | |
| 44 | scanline_int_gen(*subdevice("maincpu")); | |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | |
| 49 | ||
| 48 | void skullxbo_state::scanline_update(screen_device &screen, int scanline) | |
| 50 | 49 | { |
| 51 | skullxbo_state *state = screen.machine().driver_data<skullxbo_state>(); | |
| 52 | UINT16 *check = &state->m_alpha[(scanline / 8) * 64 + 42]; | |
| 50 | UINT16 *check = &m_alpha[(scanline / 8) * 64 + 42]; | |
| 53 | 51 | |
| 54 | 52 | /* check for interrupts in the alpha ram */ |
| 55 | 53 | /* the interrupt occurs on the HBLANK of the 6th scanline following */ |
| 56 | if (check < & | |
| 54 | if (check < &m_alpha[0x7c0] && (*check & 0x8000)) | |
| 57 | 55 | { |
| 58 | 56 | int width = screen.width(); |
| 59 | 57 | attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); |
| 60 | | |
| 58 | machine().scheduler().timer_set(period, timer_expired_delegate(FUNC(skullxbo_state::irq_gen), this)); | |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | 61 | /* update the playfield and motion objects */ |
| 64 | skullxbo_scanline_update( | |
| 62 | skullxbo_scanline_update(machine(), scanline); | |
| 65 | 63 | } |
| 66 | 64 | |
| 67 | 65 | |
| 68 | 66 | WRITE16_MEMBER(skullxbo_state::skullxbo_halt_until_hblank_0_w) |
| 69 | 67 | { |
| 70 | | |
| 68 | halt_until_hblank_0(space.device(), *machine().primary_screen); | |
| 71 | 69 | } |
| 72 | 70 | |
| 73 | 71 | |
| 74 | MACHINE_START_MEMBER(skullxbo_state,skullxbo) | |
| 75 | { | |
| 76 | atarigen_init(machine()); | |
| 77 | } | |
| 78 | ||
| 79 | ||
| 80 | 72 | MACHINE_RESET_MEMBER(skullxbo_state,skullxbo) |
| 81 | 73 | { |
| 82 | ||
| 83 | atarigen_eeprom_reset(this); | |
| 84 | atarigen_interrupt_reset(this, update_interrupts); | |
| 85 | atarigen_scanline_timer_reset(*machine().primary_screen, alpha_row_update, 8); | |
| 86 | atarijsa_reset(); | |
| 74 | atarigen_state::machine_reset(); | |
| 75 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 76 | atarijsa_reset(machine()); | |
| 87 | 77 | } |
| 88 | 78 | |
| 89 | 79 | |
| r18571 | r18572 | |
| 129 | 119 | AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(skullxbo_halt_until_hblank_0_w) |
| 130 | 120 | AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 131 | 121 | AM_RANGE(0xff1000, 0xff13ff) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 132 | AM_RANGE(0xff1400, 0xff17ff) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 133 | AM_RANGE(0xff1800, 0xff1bff) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 122 | AM_RANGE(0xff1400, 0xff17ff) AM_WRITE8(sound_w, 0x00ff) | |
| 123 | AM_RANGE(0xff1800, 0xff1bff) AM_WRITE(sound_reset_w) | |
| 134 | 124 | AM_RANGE(0xff1c00, 0xff1c7f) AM_WRITE_LEGACY(skullxbo_playfieldlatch_w) |
| 135 | 125 | AM_RANGE(0xff1c80, 0xff1cff) AM_WRITE_LEGACY(skullxbo_xscroll_w) AM_SHARE("xscroll") |
| 136 | AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE | |
| 126 | AM_RANGE(0xff1d00, 0xff1d7f) AM_WRITE(scanline_int_ack_w) | |
| 137 | 127 | AM_RANGE(0xff1d80, 0xff1dff) AM_WRITE(watchdog_reset16_w) |
| 138 | 128 | AM_RANGE(0xff1e00, 0xff1e7f) AM_WRITE_LEGACY(skullxbo_playfieldlatch_w) |
| 139 | 129 | AM_RANGE(0xff1e80, 0xff1eff) AM_WRITE_LEGACY(skullxbo_xscroll_w) |
| 140 | AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE | |
| 130 | AM_RANGE(0xff1f00, 0xff1f7f) AM_WRITE(scanline_int_ack_w) | |
| 141 | 131 | AM_RANGE(0xff1f80, 0xff1fff) AM_WRITE(watchdog_reset16_w) |
| 142 | 132 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 143 | 133 | AM_RANGE(0xff4000, 0xff47ff) AM_WRITE_LEGACY(skullxbo_yscroll_w) AM_SHARE("yscroll") |
| 144 | 134 | AM_RANGE(0xff4800, 0xff4fff) AM_WRITE(skullxbo_mobwr_w) |
| 145 | 135 | AM_RANGE(0xff6000, 0xff6fff) AM_WRITE_LEGACY(atarigen_eeprom_w) AM_SHARE("eeprom") |
| 146 | AM_RANGE(0xff5000, 0xff5001) AM_READ | |
| 136 | AM_RANGE(0xff5000, 0xff5001) AM_READ8(sound_r, 0x00ff) | |
| 147 | 137 | AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800") |
| 148 | 138 | AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r) |
| 149 | 139 | AM_RANGE(0xff6000, 0xff6fff) AM_READ_LEGACY(atarigen_eeprom_r) |
| r18571 | r18572 | |
| 259 | 249 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 260 | 250 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 261 | 251 | |
| 262 | MCFG_MACHINE_START_OVERRIDE(skullxbo_state,skullxbo) | |
| 263 | 252 | MCFG_MACHINE_RESET_OVERRIDE(skullxbo_state,skullxbo) |
| 264 | 253 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 265 | 254 |
| r18571 | r18572 | |
|---|---|---|
| 207 | 207 | * |
| 208 | 208 | *************************************/ |
| 209 | 209 | |
| 210 | ||
| 210 | void atarisy1_state::update_interrupts() | |
| 211 | 211 | { |
| 212 | atarisy1_state *state = machine.driver_data<atarisy1_state>(); | |
| 213 | machine.device("maincpu")->execute().set_input_line(2, state->m_joystick_int && state->m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE); | |
| 214 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 215 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 216 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 212 | machine().device("maincpu")->execute().set_input_line(2, m_joystick_int && m_joystick_int_enable ? ASSERT_LINE : CLEAR_LINE); | |
| 213 | machine().device("maincpu")->execute().set_input_line(3, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 214 | machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 215 | machine().device("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 217 | 216 | } |
| 218 | 217 | |
| 219 | 218 | |
| 220 | 219 | MACHINE_START_MEMBER(atarisy1_state,atarisy1) |
| 221 | 220 | { |
| 222 | atarigen_ | |
| 221 | atarigen_state::machine_start(); | |
| 223 | 222 | |
| 224 | 223 | save_item(NAME(m_joystick_int)); |
| 225 | 224 | save_item(NAME(m_joystick_int_enable)); |
| r18571 | r18572 | |
| 229 | 228 | |
| 230 | 229 | MACHINE_RESET_MEMBER(atarisy1_state,atarisy1) |
| 231 | 230 | { |
| 231 | atarigen_state::machine_reset(); | |
| 232 | 232 | |
| 233 | /* initialize the system */ | |
| 234 | atarigen_eeprom_reset(this); | |
| 235 | atarigen_slapstic_reset(this); | |
| 236 | atarigen_interrupt_reset(this, update_interrupts); | |
| 237 | atarigen_sound_io_reset(machine().device("audiocpu")); | |
| 238 | ||
| 239 | 233 | /* reset the joystick parameters */ |
| 240 | 234 | m_joystick_value = 0; |
| 241 | 235 | m_joystick_int = 0; |
| r18571 | r18572 | |
| 254 | 248 | { |
| 255 | 249 | m_joystick_value = param; |
| 256 | 250 | m_joystick_int = 1; |
| 257 | | |
| 251 | update_interrupts(); | |
| 258 | 252 | } |
| 259 | 253 | |
| 260 | 254 | |
| r18571 | r18572 | |
| 281 | 275 | /* clear any existing interrupt and set a timer for a new one */ |
| 282 | 276 | m_joystick_int = 0; |
| 283 | 277 | m_joystick_timer->adjust(attotime::from_usec(50), newval); |
| 284 | | |
| 278 | update_interrupts(); | |
| 285 | 279 | |
| 286 | 280 | return m_joystick_value; |
| 287 | 281 | } |
| r18571 | r18572 | |
| 485 | 479 | AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r) |
| 486 | 480 | AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w) |
| 487 | 481 | AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r) |
| 488 | AM_RANGE(0xf80000, 0xf80001) AM_WRITE_LEGACY(atarigen_sound_w) /* used by roadbls2 */ | |
| 489 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ_LEGACY(atarigen_sound_r) | |
| 490 | AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 482 | AM_RANGE(0xf80000, 0xf80001) AM_WRITE8(sound_w, 0x00ff) /* used by roadbls2 */ | |
| 483 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ8(sound_r, 0x00ff) | |
| 484 | AM_RANGE(0xfe0000, 0xfe0001) AM_WRITE8(sound_w, 0x00ff) | |
| 491 | 485 | ADDRESS_MAP_END |
| 492 | 486 | |
| 493 | 487 | |
| r18571 | r18572 | |
| 502 | 496 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 503 | 497 | AM_RANGE(0x1000, 0x100f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write) |
| 504 | 498 | AM_RANGE(0x1800, 0x1801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) |
| 505 | AM_RANGE(0x1810, 0x1810) AM_READWRITE | |
| 499 | AM_RANGE(0x1810, 0x1810) AM_READWRITE(m6502_sound_r, m6502_sound_w) | |
| 506 | 500 | AM_RANGE(0x1820, 0x1820) AM_READ(switch_6502_r) |
| 507 | 501 | AM_RANGE(0x1824, 0x1825) AM_WRITE(led_w) |
| 508 | 502 | AM_RANGE(0x1870, 0x187f) AM_DEVREADWRITE("pokey", pokey_device, read, write) |
| r18571 | r18572 | |
| 2326 | 2320 | |
| 2327 | 2321 | DRIVER_INIT_MEMBER(atarisy1_state,marble) |
| 2328 | 2322 | { |
| 2323 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 103); | |
| 2329 | 2324 | |
| 2330 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 103); | |
| 2331 | ||
| 2332 | 2325 | m_joystick_type = 0; /* none */ |
| 2333 | 2326 | m_trackball_type = 1; /* rotated */ |
| 2334 | 2327 | } |
| r18571 | r18572 | |
| 2336 | 2329 | |
| 2337 | 2330 | DRIVER_INIT_MEMBER(atarisy1_state,peterpak) |
| 2338 | 2331 | { |
| 2332 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 107); | |
| 2339 | 2333 | |
| 2340 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 107); | |
| 2341 | ||
| 2342 | 2334 | m_joystick_type = 1; /* digital */ |
| 2343 | 2335 | m_trackball_type = 0; /* none */ |
| 2344 | 2336 | } |
| r18571 | r18572 | |
| 2346 | 2338 | |
| 2347 | 2339 | DRIVER_INIT_MEMBER(atarisy1_state,indytemp) |
| 2348 | 2340 | { |
| 2341 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 105); | |
| 2349 | 2342 | |
| 2350 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 105); | |
| 2351 | ||
| 2352 | 2343 | m_joystick_type = 1; /* digital */ |
| 2353 | 2344 | m_trackball_type = 0; /* none */ |
| 2354 | 2345 | } |
| r18571 | r18572 | |
| 2356 | 2347 | |
| 2357 | 2348 | DRIVER_INIT_MEMBER(atarisy1_state,roadrunn) |
| 2358 | 2349 | { |
| 2350 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 108); | |
| 2359 | 2351 | |
| 2360 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 108); | |
| 2361 | ||
| 2362 | 2352 | m_joystick_type = 2; /* analog */ |
| 2363 | 2353 | m_trackball_type = 0; /* none */ |
| 2364 | 2354 | } |
| r18571 | r18572 | |
| 2366 | 2356 | |
| 2367 | 2357 | DRIVER_INIT_MEMBER(atarisy1_state,roadb109) |
| 2368 | 2358 | { |
| 2359 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 109); | |
| 2369 | 2360 | |
| 2370 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 109); | |
| 2371 | ||
| 2372 | 2361 | m_joystick_type = 3; /* pedal */ |
| 2373 | 2362 | m_trackball_type = 2; /* steering wheel */ |
| 2374 | 2363 | } |
| r18571 | r18572 | |
| 2376 | 2365 | |
| 2377 | 2366 | DRIVER_INIT_MEMBER(atarisy1_state,roadb110) |
| 2378 | 2367 | { |
| 2368 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x080000, 0, 110); | |
| 2379 | 2369 | |
| 2380 | atarigen_slapstic_init(machine().device("maincpu"), 0x080000, 0, 110); | |
| 2381 | ||
| 2382 | 2370 | m_joystick_type = 3; /* pedal */ |
| 2383 | 2371 | m_trackball_type = 2; /* steering wheel */ |
| 2384 | 2372 | } |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void atarig42_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | atarig42_state *state = machine.driver_data<atarig42_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine().device("maincpu")->execute().set_input_line(5, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | |
| 42 | 41 | MACHINE_START_MEMBER(atarig42_state,atarig42) |
| 43 | 42 | { |
| 44 | atarigen_ | |
| 43 | atarigen_state::machine_start(); | |
| 45 | 44 | |
| 46 | 45 | save_item(NAME(m_analog_data)); |
| 47 | 46 | save_item(NAME(m_sloop_bank)); |
| r18571 | r18572 | |
| 53 | 52 | |
| 54 | 53 | MACHINE_RESET_MEMBER(atarig42_state,atarig42) |
| 55 | 54 | { |
| 56 | ||
| 57 | atarigen_eeprom_reset(this); | |
| 58 | atarigen_interrupt_reset(this, update_interrupts); | |
| 59 | atarigen_scanline_timer_reset(*machine().primary_screen, atarig42_scanline_update, 8); | |
| 60 | atarijsa_reset(); | |
| 55 | atarigen_state::machine_reset(); | |
| 56 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 57 | atarijsa_reset(machine()); | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | 60 | |
| r18571 | r18572 | |
| 110 | 107 | { |
| 111 | 108 | /* bit 4 resets the sound CPU */ |
| 112 | 109 | machine().device("jsa")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); |
| 113 | if (!(data & 0x10)) atarijsa_reset(); | |
| 110 | if (!(data & 0x10)) atarijsa_reset(machine()); | |
| 114 | 111 | |
| 115 | 112 | /* bit 5 is /XRESET, probably related to the ASIC */ |
| 116 | 113 | |
| r18571 | r18572 | |
| 343 | 340 | AM_RANGE(0xe00010, 0xe00011) AM_READ(special_port2_r) |
| 344 | 341 | AM_RANGE(0xe00012, 0xe00013) AM_READ_PORT("JSAIII") |
| 345 | 342 | AM_RANGE(0xe00020, 0xe00027) AM_READWRITE(a2d_data_r, a2d_select_w) |
| 346 | AM_RANGE(0xe00030, 0xe00031) AM_READ_LEGACY(atarigen_sound_r) | |
| 347 | AM_RANGE(0xe00040, 0xe00041) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 343 | AM_RANGE(0xe00030, 0xe00031) AM_READ8(sound_r, 0x00ff) | |
| 344 | AM_RANGE(0xe00040, 0xe00041) AM_WRITE8(sound_w, 0x00ff) | |
| 348 | 345 | AM_RANGE(0xe00050, 0xe00051) AM_WRITE(io_latch_w) |
| 349 | 346 | AM_RANGE(0xe00060, 0xe00061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 350 | 347 | AM_RANGE(0xe03000, 0xe03001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void vindictr_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | vindictr_state *state = machine.driver_data<vindictr_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | |
| 42 | MACHINE_START_MEMBER(vindictr_state,vindictr) | |
| 43 | { | |
| 44 | atarigen_init(machine()); | |
| 45 | } | |
| 46 | ||
| 47 | ||
| 48 | 41 | MACHINE_RESET_MEMBER(vindictr_state,vindictr) |
| 49 | 42 | { |
| 50 | ||
| 51 | atarigen_eeprom_reset(this); | |
| 52 | atarigen_interrupt_reset(this, update_interrupts); | |
| 53 | atarigen_scanline_timer_reset(*machine().primary_screen, vindictr_scanline_update, 8); | |
| 54 | atarijsa_reset(); | |
| 43 | atarigen_state::machine_reset(); | |
| 44 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 45 | atarijsa_reset(machine()); | |
| 55 | 46 | } |
| 56 | 47 | |
| 57 | 48 | |
| r18571 | r18572 | |
| 88 | 79 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 89 | 80 | AM_RANGE(0x260010, 0x26001f) AM_READ(port1_r) |
| 90 | 81 | AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020") |
| 91 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 82 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 92 | 83 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 93 | AM_RANGE(0x360000, 0x360001) AM_WRITE | |
| 84 | AM_RANGE(0x360000, 0x360001) AM_WRITE(scanline_int_ack_w) | |
| 94 | 85 | AM_RANGE(0x360010, 0x360011) AM_WRITENOP |
| 95 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 96 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 86 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 87 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 97 | 88 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(vindictr_paletteram_w) AM_SHARE("paletteram") |
| 98 | 89 | AM_RANGE(0x3f0000, 0x3f1fff) AM_MIRROR(0x8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| 99 | 90 | AM_RANGE(0x3f2000, 0x3f3fff) AM_MIRROR(0x8000) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w) |
| r18571 | r18572 | |
| 198 | 189 | MCFG_CPU_ADD("maincpu", M68010, ATARI_CLOCK_14MHz/2) |
| 199 | 190 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 200 | 191 | |
| 201 | MCFG_MACHINE_START_OVERRIDE(vindictr_state,vindictr) | |
| 202 | 192 | MCFG_MACHINE_RESET_OVERRIDE(vindictr_state,vindictr) |
| 203 | 193 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 204 | 194 |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | * |
| 33 | 33 | *************************************/ |
| 34 | 34 | |
| 35 | ||
| 35 | void atarig1_state::update_interrupts() | |
| 36 | 36 | { |
| 37 | atarig1_state *state = machine.driver_data<atarig1_state>(); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine().device("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine().device("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | 39 | } |
| 41 | 40 | |
| 42 | 41 | |
| 43 | 42 | MACHINE_START_MEMBER(atarig1_state,atarig1) |
| 44 | 43 | { |
| 45 | atarigen_ | |
| 44 | atarigen_state::machine_start(); | |
| 46 | 45 | save_item(NAME(m_which_input)); |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | |
| 50 | 49 | MACHINE_RESET_MEMBER(atarig1_state,atarig1) |
| 51 | 50 | { |
| 52 | ||
| 53 | atarigen_eeprom_reset(this); | |
| 54 | atarigen_slapstic_reset(this); | |
| 55 | atarigen_interrupt_reset(this, update_interrupts); | |
| 56 | atarigen_scanline_timer_reset(*machine().primary_screen, atarig1_scanline_update, 8); | |
| 57 | atarijsa_reset(); | |
| 51 | atarigen_state::machine_reset(); | |
| 52 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 53 | atarijsa_reset(machine()); | |
| 58 | 54 | } |
| 59 | 55 | |
| 60 | 56 | |
| r18571 | r18572 | |
| 209 | 205 | AM_RANGE(0x078000, 0x07ffff) AM_ROM /* hydra slapstic goes here */ |
| 210 | 206 | AM_RANGE(0xf80000, 0xf80001) AM_WRITE(watchdog_reset16_w) |
| 211 | 207 | AM_RANGE(0xf88000, 0xf8ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 212 | AM_RANGE(0xf90000, 0xf90001) AM_WRITE_LEGACY(atarigen_sound_upper_w) | |
| 213 | AM_RANGE(0xf98000, 0xf98001) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 208 | AM_RANGE(0xf90000, 0xf90001) AM_WRITE8(sound_w, 0xff00) | |
| 209 | AM_RANGE(0xf98000, 0xf98001) AM_WRITE(sound_reset_w) | |
| 214 | 210 | AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE(mo_control_w) |
| 215 | 211 | AM_RANGE(0xfb0000, 0xfb0001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 216 | 212 | AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r) |
| 217 | 213 | AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w) |
| 218 | AM_RANGE(0xfd0000, 0xfd0001) AM_READ | |
| 214 | AM_RANGE(0xfd0000, 0xfd0001) AM_READ8(sound_r, 0xff00) | |
| 219 | 215 | AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 220 | 216 | /* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ_LEGACY(from_r)*/ |
| 221 | 217 | AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| r18571 | r18572 | |
| 1222 | 1218 | machine.save().register_postload(save_prepost_delegate(FUNC(pitfightb_state_postload), &machine)); |
| 1223 | 1219 | } |
| 1224 | 1220 | else if (slapstic != 0) |
| 1225 | | |
| 1221 | state->slapstic_configure(*machine.device<cpu_device>("maincpu"), slapstic_base, 0, slapstic); | |
| 1226 | 1222 | atarijsa_init(machine, "IN0", 0x4000); |
| 1227 | 1223 | |
| 1228 | 1224 | state->m_is_pitfight = is_pitfight; |
| r18571 | r18572 | |
|---|---|---|
| 104 | 104 | * |
| 105 | 105 | *************************************/ |
| 106 | 106 | |
| 107 | ||
| 107 | void foodf_state::update_interrupts() | |
| 108 | 108 | { |
| 109 | foodf_state *state = machine.driver_data<foodf_state>(); | |
| 110 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 111 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 112 | machine.device("maincpu")->execute().set_input_line(3, state->m_scanline_int_state && state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 109 | subdevice("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 110 | subdevice("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 111 | subdevice("maincpu")->execute().set_input_line(3, m_scanline_int_state && m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | |
| 116 | TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update) | |
| 115 | TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update_timer) | |
| 117 | 116 | { |
| 118 | 117 | int scanline = param; |
| 119 | 118 | |
| r18571 | r18572 | |
| 123 | 122 | mystery yet */ |
| 124 | 123 | |
| 125 | 124 | /* INT 1 is on 32V */ |
| 126 | | |
| 125 | scanline_int_gen(*subdevice("maincpu")); | |
| 127 | 126 | |
| 128 | 127 | /* advance to the next interrupt */ |
| 129 | 128 | scanline += 64; |
| r18571 | r18572 | |
| 137 | 136 | |
| 138 | 137 | MACHINE_START_MEMBER(foodf_state,foodf) |
| 139 | 138 | { |
| 140 | atarigen_ | |
| 139 | atarigen_state::machine_start(); | |
| 141 | 140 | save_item(NAME(m_whichport)); |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | |
| 145 | 144 | MACHINE_RESET_MEMBER(foodf_state,foodf) |
| 146 | 145 | { |
| 147 | atarigen_interrupt_reset(this, update_interrupts); | |
| 148 | 146 | timer_device *scan_timer = machine().device<timer_device>("scan_timer"); |
| 149 | 147 | scan_timer->adjust(machine().primary_screen->time_until_pos(0)); |
| 150 | 148 | } |
| r18571 | r18572 | |
| 164 | 162 | m_nvram->store(data & 0x02); |
| 165 | 163 | |
| 166 | 164 | if (!(data & 0x04)) |
| 167 | | |
| 165 | scanline_int_ack_w(space,0,0); | |
| 168 | 166 | if (!(data & 0x08)) |
| 169 | 167 | atarigen_video_int_ack_w(space,0,0,0xffff); |
| 170 | 168 | |
| r18571 | r18572 | |
| 363 | 361 | |
| 364 | 362 | MCFG_WATCHDOG_VBLANK_INIT(8) |
| 365 | 363 | |
| 366 | MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update) | |
| 364 | MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update_timer) | |
| 367 | 365 | |
| 368 | 366 | /* video hardware */ |
| 369 | 367 | MCFG_GFXDECODE(foodf) |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | * |
| 33 | 33 | *************************************/ |
| 34 | 34 | |
| 35 | ||
| 35 | void blstroid_state::update_interrupts() | |
| 36 | 36 | { |
| 37 | blstroid_state *state = machine.driver_data<blstroid_state>(); | |
| 38 | machine.device("maincpu")->execute().set_input_line(1, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("maincpu")->execute().set_input_line(2, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | machine().device("maincpu")->execute().set_input_line(1, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine().device("maincpu")->execute().set_input_line(2, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine().device("maincpu")->execute().set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | |
| 44 | 43 | WRITE16_MEMBER(blstroid_state::blstroid_halt_until_hblank_0_w) |
| 45 | 44 | { |
| 46 | | |
| 45 | halt_until_hblank_0(space.device(), *machine().primary_screen); | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | |
| 50 | MACHINE_START_MEMBER(blstroid_state,blstroid) | |
| 51 | { | |
| 52 | atarigen_init(machine()); | |
| 53 | } | |
| 54 | ||
| 55 | ||
| 56 | 49 | MACHINE_RESET_MEMBER(blstroid_state,blstroid) |
| 57 | 50 | { |
| 58 | ||
| 59 | atarigen_eeprom_reset(this); | |
| 60 | atarigen_interrupt_reset(this, update_interrupts); | |
| 61 | atarigen_scanline_timer_reset(*machine().primary_screen, blstroid_scanline_update, 8); | |
| 62 | atarijsa_reset(); | |
| 51 | atarigen_state::machine_reset(); | |
| 52 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 53 | atarijsa_reset(machine()); | |
| 63 | 54 | } |
| 64 | 55 | |
| 65 | 56 | |
| r18571 | r18572 | |
| 93 | 84 | ADDRESS_MAP_UNMAP_HIGH |
| 94 | 85 | AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x7c0000) AM_ROM |
| 95 | 86 | AM_RANGE(0xff8000, 0xff8001) AM_MIRROR(0x7f81fe) AM_WRITE(watchdog_reset16_w) |
| 96 | AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE | |
| 87 | AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE(scanline_int_ack_w) | |
| 97 | 88 | AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 98 | 89 | AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 99 | 90 | AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITEONLY AM_SHARE("priorityram") |
| 100 | AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 101 | AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 91 | AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE8(sound_w, 0x00ff) | |
| 92 | AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(sound_reset_w) | |
| 102 | 93 | AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(blstroid_halt_until_hblank_0_w) |
| 103 | AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ | |
| 94 | AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ8(sound_r, 0x00ff) | |
| 104 | 95 | AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL0") |
| 105 | 96 | AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1") |
| 106 | 97 | AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r) |
| r18571 | r18572 | |
| 206 | 197 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 207 | 198 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 208 | 199 | |
| 209 | MCFG_MACHINE_START_OVERRIDE(blstroid_state,blstroid) | |
| 210 | 200 | MCFG_MACHINE_RESET_OVERRIDE(blstroid_state,blstroid) |
| 211 | 201 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 212 | 202 |
| r18571 | r18572 | |
|---|---|---|
| 471 | 471 | static ADDRESS_MAP_START( multisync_68k_map, AS_PROGRAM, 16, harddriv_state ) |
| 472 | 472 | ADDRESS_MAP_UNMAP_HIGH |
| 473 | 473 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 474 | AM_RANGE(0x600000, 0x603fff) AM_READWRITE | |
| 474 | AM_RANGE(0x600000, 0x603fff) AM_READWRITE8(sound_r, sound_w, 0xff00) | |
| 475 | 475 | AM_RANGE(0x604000, 0x607fff) AM_READWRITE_LEGACY(hd68k_sound_reset_r, hd68k_nwr_w) |
| 476 | 476 | AM_RANGE(0x608000, 0x60bfff) AM_WRITE(watchdog_reset16_w) |
| 477 | 477 | AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE_LEGACY(hd68k_port0_r, hd68k_irq_ack_w) |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | * |
| 33 | 33 | *************************************/ |
| 34 | 34 | |
| 35 | ||
| 35 | void thunderj_state::update_interrupts() | |
| 36 | 36 | { |
| 37 | thunderj_state *state = machine.driver_data<thunderj_state>(); | |
| 38 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine.device("extra")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | subdevice("extra")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | |
| 44 | 43 | MACHINE_START_MEMBER(thunderj_state,thunderj) |
| 45 | 44 | { |
| 46 | atarigen_init(machine()); | |
| 47 | ||
| 45 | atarigen_state::machine_start(); | |
| 48 | 46 | save_item(NAME(m_alpha_tile_bank)); |
| 49 | 47 | } |
| 50 | 48 | |
| 51 | 49 | |
| 52 | 50 | MACHINE_RESET_MEMBER(thunderj_state,thunderj) |
| 53 | 51 | { |
| 54 | ||
| 55 | atarigen_eeprom_reset(this); | |
| 56 | atarigen_interrupt_reset(this, update_interrupts); | |
| 52 | atarigen_state::machine_reset(); | |
| 57 | 53 | atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2); |
| 58 | atarijsa_reset(); | |
| 54 | atarijsa_reset(machine()); | |
| 59 | 55 | } |
| 60 | 56 | |
| 61 | 57 | |
| r18571 | r18572 | |
| 155 | 151 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 156 | 152 | AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010") |
| 157 | 153 | AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r) |
| 158 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 154 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 159 | 155 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 160 | 156 | AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w) |
| 161 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 162 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 157 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 158 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 163 | 159 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 164 | 160 | AM_RANGE(0x3effc0, 0x3effff) AM_READWRITE(thunderj_atarivc_r, thunderj_atarivc_w) AM_SHARE("atarivc_data") |
| 165 | 161 | AM_RANGE(0x3f0000, 0x3f1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield2_latched_msb_w) AM_SHARE("playfield2") |
| r18571 | r18572 | |
| 187 | 183 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 188 | 184 | AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010") |
| 189 | 185 | AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r) |
| 190 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 186 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 191 | 187 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 192 | 188 | AM_RANGE(0x360010, 0x360011) AM_WRITE(latch_w) |
| 193 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 194 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 189 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 190 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 195 | 191 | ADDRESS_MAP_END |
| 196 | 192 | |
| 197 | 193 |
| r18571 | r18572 | |
|---|---|---|
| 33 | 33 | * |
| 34 | 34 | *************************************/ |
| 35 | 35 | |
| 36 | ||
| 36 | void atarigx2_state::update_interrupts() | |
| 37 | 37 | { |
| 38 | atarigx2_state *state = machine.driver_data<atarigx2_state>(); | |
| 39 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 40 | machine.device("maincpu")->execute().set_input_line(5, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | machine().device("maincpu")->execute().set_input_line(5, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | |
| 44 | MACHINE_START_MEMBER(atarigx2_state,atarigx2) | |
| 45 | { | |
| 46 | atarigen_init(machine()); | |
| 47 | } | |
| 48 | ||
| 49 | ||
| 50 | 43 | MACHINE_RESET_MEMBER(atarigx2_state,atarigx2) |
| 51 | 44 | { |
| 52 | ||
| 53 | atarigen_eeprom_reset(this); | |
| 54 | atarigen_interrupt_reset(this, update_interrupts); | |
| 55 | atarigen_scanline_timer_reset(*machine().primary_screen, atarigx2_scanline_update, 8); | |
| 56 | atarijsa_reset(); | |
| 45 | atarigen_state::machine_reset(); | |
| 46 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 47 | atarijsa_reset(machine()); | |
| 57 | 48 | } |
| 58 | 49 | |
| 59 | 50 | |
| r18571 | r18572 | |
| 1157 | 1148 | AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command") |
| 1158 | 1149 | AM_RANGE(0xd70000, 0xd7ffff) AM_RAM |
| 1159 | 1150 | AM_RANGE(0xd80000, 0xd9ffff) AM_WRITE_LEGACY(atarigen_eeprom_enable32_w) |
| 1160 | AM_RANGE(0xe06000, 0xe06003) AM_WRITE | |
| 1151 | AM_RANGE(0xe06000, 0xe06003) AM_WRITE8(sound_w, 0xff000000) | |
| 1161 | 1152 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w) |
| 1162 | 1153 | AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w) |
| 1163 | 1154 | AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w }, |
| 1164 | 1155 | AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2") |
| 1165 | 1156 | AM_RANGE(0xe82000, 0xe82003) AM_READ(special_port2_r) |
| 1166 | 1157 | AM_RANGE(0xe82004, 0xe82007) AM_READ(special_port3_r) |
| 1167 | AM_RANGE(0xe86000, 0xe86003) AM_READ | |
| 1158 | AM_RANGE(0xe86000, 0xe86003) AM_READ8(sound_r, 0xff000000) | |
| 1168 | 1159 | AM_RANGE(0xff8000, 0xffffff) AM_RAM |
| 1169 | 1160 | ADDRESS_MAP_END |
| 1170 | 1161 | |
| r18571 | r18572 | |
| 1433 | 1424 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 1434 | 1425 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 1435 | 1426 | |
| 1436 | MCFG_MACHINE_START_OVERRIDE(atarigx2_state,atarigx2) | |
| 1437 | 1427 | MCFG_MACHINE_RESET_OVERRIDE(atarigx2_state,atarigx2) |
| 1438 | 1428 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 1439 | 1429 |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void batman_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | batman_state *state = machine.driver_data<batman_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | |
| 42 | 41 | MACHINE_START_MEMBER(batman_state,batman) |
| 43 | 42 | { |
| 44 | atarigen_ | |
| 43 | atarigen_state::machine_start(); | |
| 45 | 44 | |
| 46 | 45 | save_item(NAME(m_latch_data)); |
| 47 | 46 | save_item(NAME(m_alpha_tile_bank)); |
| r18571 | r18572 | |
| 50 | 49 | |
| 51 | 50 | MACHINE_RESET_MEMBER(batman_state,batman) |
| 52 | 51 | { |
| 53 | ||
| 54 | atarigen_eeprom_reset(this); | |
| 55 | atarigen_interrupt_reset(this, update_interrupts); | |
| 52 | atarigen_state::machine_reset(); | |
| 56 | 53 | atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2); |
| 57 | atarigen_scanline_timer_reset(*machine().primary_screen, batman_scanline_update, 8); | |
| 58 | atarijsa_reset(); | |
| 54 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 55 | atarijsa_reset(machine()); | |
| 59 | 56 | } |
| 60 | 57 | |
| 61 | 58 | |
| r18571 | r18572 | |
| 134 | 131 | AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000") |
| 135 | 132 | AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002") |
| 136 | 133 | AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ(special_port2_r) |
| 137 | AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ_LEGACY(atarigen_sound_r) | |
| 138 | AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 134 | AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_READ8(sound_r, 0x00ff) | |
| 135 | AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_WRITE8(sound_w, 0x00ff) | |
| 139 | 136 | AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w) |
| 140 | 137 | AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 141 | 138 | AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_WRITE(watchdog_reset16_w) |
| r18571 | r18572 | |
|---|---|---|
| 135 | 135 | * |
| 136 | 136 | *************************************/ |
| 137 | 137 | |
| 138 | ||
| 138 | void gauntlet_state::update_interrupts() | |
| 139 | 139 | { |
| 140 | gauntlet_state *state = machine.driver_data<gauntlet_state>(); | |
| 141 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 142 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 140 | subdevice("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 141 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 143 | 142 | } |
| 144 | 143 | |
| 145 | 144 | |
| 146 | ||
| 145 | void gauntlet_state::scanline_update(screen_device &screen, int scanline) | |
| 147 | 146 | { |
| 148 | address_space &space = s | |
| 147 | address_space &space = subdevice("audiocpu")->memory().space(AS_PROGRAM); | |
| 149 | 148 | |
| 150 | 149 | /* sound IRQ is on 32V */ |
| 151 | 150 | if (scanline & 32) |
| 152 | | |
| 151 | m6502_irq_gen(*subdevice("audiocpu")); | |
| 153 | 152 | else |
| 154 | | |
| 153 | m6502_irq_ack_r(space, 0); | |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | |
| 158 | 157 | MACHINE_START_MEMBER(gauntlet_state,gauntlet) |
| 159 | 158 | { |
| 160 | atarigen_init(machine()); | |
| 161 | ||
| 159 | atarigen_state::machine_start(); | |
| 162 | 160 | save_item(NAME(m_sound_reset_val)); |
| 163 | 161 | } |
| 164 | 162 | |
| 165 | 163 | |
| 166 | 164 | MACHINE_RESET_MEMBER(gauntlet_state,gauntlet) |
| 167 | 165 | { |
| 168 | ||
| 169 | 166 | m_sound_reset_val = 1; |
| 170 | 167 | |
| 171 | atarigen_eeprom_reset(this); | |
| 172 | atarigen_slapstic_reset(this); | |
| 173 | atarigen_interrupt_reset(this, update_interrupts); | |
| 174 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32); | |
| 175 | atarigen_sound_io_reset(machine().device("audiocpu")); | |
| 168 | atarigen_state::machine_reset(); | |
| 169 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 176 | 170 | } |
| 177 | 171 | |
| 178 | 172 | |
| r18571 | r18572 | |
| 209 | 203 | if ((oldword ^ m_sound_reset_val) & 1) |
| 210 | 204 | { |
| 211 | 205 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE); |
| 212 | | |
| 206 | sound_cpu_reset(); | |
| 213 | 207 | if (m_sound_reset_val & 1) |
| 214 | 208 | { |
| 215 | 209 | machine().device("ymsnd")->reset(); |
| 216 | 210 | machine().device("tms")->reset(); |
| 217 | 211 | tms5220_set_frequency(machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11); |
| 218 | atarigen_set_ym2151_vol(machine(), 0); | |
| 219 | atarigen_set_pokey_vol(machine(), 0); | |
| 220 | atarigen_set_tms5220_vol(machine(), 0); | |
| 212 | set_ym2151_volume(0); | |
| 213 | set_pokey_volume(0); | |
| 214 | set_tms5220_volume(0); | |
| 221 | 215 | } |
| 222 | 216 | } |
| 223 | 217 | } |
| r18571 | r18572 | |
| 284 | 278 | |
| 285 | 279 | WRITE8_MEMBER(gauntlet_state::mixer_w) |
| 286 | 280 | { |
| 287 | atarigen_set_ym2151_vol(machine(), (data & 7) * 100 / 7); | |
| 288 | atarigen_set_pokey_vol(machine(), ((data >> 3) & 3) * 100 / 3); | |
| 289 | atarigen_set_tms5220_vol(machine(), ((data >> 5) & 7) * 100 / 7); | |
| 281 | set_ym2151_volume((data & 7) * 100 / 7); | |
| 282 | set_pokey_volume(((data >> 3) & 3) * 100 / 3); | |
| 283 | set_tms5220_volume(((data >> 5) & 7) * 100 / 7); | |
| 290 | 284 | } |
| 291 | 285 | |
| 292 | 286 | |
| r18571 | r18572 | |
| 312 | 306 | AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004") |
| 313 | 307 | AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006") |
| 314 | 308 | AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ(port4_r) |
| 315 | AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ | |
| 309 | AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ8(sound_r, 0x00ff) | |
| 316 | 310 | AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w) |
| 317 | 311 | AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_WRITE(sound_reset_w) |
| 318 | 312 | AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 319 | 313 | AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 320 | AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE | |
| 314 | AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_WRITE8(sound_w, 0x00ff) | |
| 321 | 315 | |
| 322 | 316 | /* VBUS */ |
| 323 | 317 | AM_RANGE(0x900000, 0x901fff) AM_MIRROR(0x2c8000) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| r18571 | r18572 | |
| 342 | 336 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gauntlet_state ) |
| 343 | 337 | ADDRESS_MAP_UNMAP_HIGH |
| 344 | 338 | AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM |
| 345 | AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE_LEGACY(atarigen_6502_sound_w) | |
| 346 | AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ_LEGACY(atarigen_6502_sound_r) | |
| 339 | AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE(m6502_sound_w) | |
| 340 | AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ(m6502_sound_r) | |
| 347 | 341 | AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w) |
| 348 | 342 | AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w) |
| 349 | 343 | AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_DEVREADWRITE("pokey", pokey_device, read, write) |
| 350 | 344 | AM_RANGE(0x1810, 0x1811) AM_MIRROR(0x27ce) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) |
| 351 | 345 | AM_RANGE(0x1820, 0x182f) AM_MIRROR(0x27c0) AM_DEVWRITE_LEGACY("tms", tms5220_data_w) |
| 352 | AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE | |
| 346 | AM_RANGE(0x1830, 0x183f) AM_MIRROR(0x27c0) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w) | |
| 353 | 347 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 354 | 348 | ADDRESS_MAP_END |
| 355 | 349 | |
| r18571 | r18572 | |
| 1621 | 1615 | gauntlet_state *state = machine.driver_data<gauntlet_state>(); |
| 1622 | 1616 | UINT8 *rom = state->memregion("maincpu")->base(); |
| 1623 | 1617 | state->m_eeprom_default = NULL; |
| 1624 | | |
| 1618 | state->slapstic_configure(*machine.device<cpu_device>("maincpu"), 0x038000, 0, slapstic); | |
| 1625 | 1619 | |
| 1626 | 1620 | /* swap the top and bottom halves of the main CPU ROM images */ |
| 1627 | 1621 | atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000); |
| r18571 | r18572 | |
|---|---|---|
| 37 | 37 | * |
| 38 | 38 | *************************************/ |
| 39 | 39 | |
| 40 | ||
| 40 | void eprom_state::update_interrupts() | |
| 41 | 41 | { |
| 42 | e | |
| 42 | subdevice("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | 43 | |
| 44 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 44 | if (subdevice("extra") != NULL) | |
| 45 | subdevice("extra")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 45 | 46 | |
| 46 | if (machine.device("extra") != NULL) | |
| 47 | machine.device("extra")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 48 | ||
| 49 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 47 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 50 | 48 | } |
| 51 | 49 | |
| 52 | 50 | |
| 53 | MACHINE_START_MEMBER(eprom_state,eprom) | |
| 54 | { | |
| 55 | atarigen_init(machine()); | |
| 56 | } | |
| 57 | ||
| 58 | ||
| 59 | 51 | MACHINE_RESET_MEMBER(eprom_state,eprom) |
| 60 | 52 | { |
| 61 | ||
| 62 | atarigen_eeprom_reset(this); | |
| 63 | atarigen_interrupt_reset(this, update_interrupts); | |
| 64 | atarigen_scanline_timer_reset(*machine().primary_screen, eprom_scanline_update, 8); | |
| 65 | atarijsa_reset(); | |
| 53 | atarigen_state::machine_reset(); | |
| 54 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 55 | atarijsa_reset(machine()); | |
| 66 | 56 | } |
| 67 | 57 | |
| 68 | 58 | |
| r18571 | r18572 | |
| 163 | 153 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 164 | 154 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) |
| 165 | 155 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) |
| 166 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 156 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 167 | 157 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 168 | 158 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 169 | 159 | AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) |
| 170 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 171 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 160 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 161 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 172 | 162 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram") |
| 173 | 163 | AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| 174 | 164 | AM_RANGE(0x3f2000, 0x3f3fff) AM_READWRITE_LEGACY(atarimo_0_spriteram_r, atarimo_0_spriteram_w) |
| r18571 | r18572 | |
| 188 | 178 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 189 | 179 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) |
| 190 | 180 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) |
| 191 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 181 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 192 | 182 | AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w) |
| 193 | 183 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 194 | 184 | // AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) |
| 195 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 196 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 185 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 186 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 197 | 187 | AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_SHARE("paletteram") |
| 198 | 188 | AM_RANGE(0xff0000, 0xff1fff) AM_WRITE_LEGACY(atarigen_playfield_upper_w) AM_SHARE("playfield_up") |
| 199 | 189 | AM_RANGE(0xff8000, 0xff9fff) AM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| r18571 | r18572 | |
| 219 | 209 | AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000") |
| 220 | 210 | AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r) |
| 221 | 211 | AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r) |
| 222 | AM_RANGE(0x260030, 0x260031) AM_READ | |
| 212 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 223 | 213 | AM_RANGE(0x360000, 0x360001) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 224 | 214 | AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) |
| 225 | AM_RANGE(0x360020, 0x360021) AM_WRITE_LEGACY(atarigen_sound_reset_w) | |
| 226 | AM_RANGE(0x360030, 0x360031) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 215 | AM_RANGE(0x360020, 0x360021) AM_WRITE(sound_reset_w) | |
| 216 | AM_RANGE(0x360030, 0x360031) AM_WRITE8(sound_w, 0x00ff) | |
| 227 | 217 | ADDRESS_MAP_END |
| 228 | 218 | |
| 229 | 219 | |
| r18571 | r18572 | |
| 413 | 403 | |
| 414 | 404 | MCFG_QUANTUM_TIME(attotime::from_hz(6000)) |
| 415 | 405 | |
| 416 | MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) | |
| 417 | 406 | MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) |
| 418 | 407 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 419 | 408 | |
| r18571 | r18572 | |
| 444 | 433 | |
| 445 | 434 | MCFG_QUANTUM_TIME(attotime::from_hz(600)) |
| 446 | 435 | |
| 447 | MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) | |
| 448 | 436 | MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) |
| 449 | 437 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 450 | 438 | |
| r18571 | r18572 | |
| 475 | 463 | |
| 476 | 464 | MCFG_QUANTUM_TIME(attotime::from_hz(600)) |
| 477 | 465 | |
| 478 | MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom) | |
| 479 | 466 | MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom) |
| 480 | 467 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 481 | 468 |
| r18571 | r18572 | |
|---|---|---|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | void beathead_state::machine_start() | |
| 173 | { | |
| 174 | atarigen_init(machine()); | |
| 175 | } | |
| 176 | ||
| 177 | ||
| 178 | static void update_interrupts(running_machine &machine) { machine.driver_data<beathead_state>()->update_interrupts(); } | |
| 179 | 172 | void beathead_state::machine_reset() |
| 180 | 173 | { |
| 181 | 174 | /* reset the common subsystems */ |
| 182 | atarigen_eeprom_reset(this); | |
| 183 | atarigen_interrupt_reset(this, ::update_interrupts); | |
| 184 | atarijsa_reset(); | |
| 175 | atarigen_state::machine_reset(); | |
| 176 | atarijsa_reset(machine()); | |
| 185 | 177 | |
| 186 | 178 | /* the code is temporarily mapped at 0 at startup */ |
| 187 | 179 | /* just copying the first 0x40 bytes is sufficient */ |
| r18571 | r18572 | |
| 221 | 213 | { |
| 222 | 214 | m_irq_line_state = gen_int; |
| 223 | 215 | //if (m_irq_line_state != CLEAR_LINE) |
| 224 | | |
| 216 | subdevice("maincpu")->execute().set_input_line(ASAP_IRQ0, m_irq_line_state); | |
| 225 | 217 | //else |
| 226 | 218 | //asap_set_irq_line(ASAP_IRQ0, m_irq_line_state); |
| 227 | 219 | } |
| r18571 | r18572 | |
| 300 | 292 | * |
| 301 | 293 | *************************************/ |
| 302 | 294 | |
| 303 | READ32_MEMBER( beathead_state::sound_data_r ) | |
| 304 | { | |
| 305 | return atarigen_sound_r(space, offset, 0xffff); | |
| 306 | } | |
| 307 | ||
| 308 | ||
| 309 | WRITE32_MEMBER( beathead_state::sound_data_w ) | |
| 310 | { | |
| 311 | if (ACCESSING_BITS_0_7) | |
| 312 | atarigen_sound_w(space, offset, data, mem_mask); | |
| 313 | } | |
| 314 | ||
| 315 | ||
| 316 | 295 | WRITE32_MEMBER( beathead_state::sound_reset_w ) |
| 317 | 296 | { |
| 318 | 297 | logerror("Sound reset = %d\n", !offset); |
| r18571 | r18572 | |
| 344 | 323 | AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_SHARE("ram_base") |
| 345 | 324 | AM_RANGE(0x01800000, 0x01bfffff) AM_ROM AM_REGION("user1", 0) AM_SHARE("rom_base") |
| 346 | 325 | AM_RANGE(0x40000000, 0x400007ff) AM_RAM_WRITE(eeprom_data_w) AM_SHARE("nvram") |
| 347 | AM_RANGE(0x41000000, 0x41000003) AM_READWRITE(sound_ | |
| 326 | AM_RANGE(0x41000000, 0x41000003) AM_READWRITE8(sound_r, sound_w, 0x000000ff) | |
| 348 | 327 | AM_RANGE(0x41000100, 0x41000103) AM_READ(interrupt_control_r) |
| 349 | 328 | AM_RANGE(0x41000100, 0x4100011f) AM_WRITE(interrupt_control_w) |
| 350 | 329 | AM_RANGE(0x41000200, 0x41000203) AM_READ_PORT("IN1") |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | * |
| 33 | 33 | *************************************/ |
| 34 | 34 | |
| 35 | ||
| 35 | void relief_state::update_interrupts() | |
| 36 | 36 | { |
| 37 | relief_state *state = machine.driver_data<relief_state>(); | |
| 38 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | |
| r18571 | r18572 | |
| 65 | 64 | * |
| 66 | 65 | *************************************/ |
| 67 | 66 | |
| 68 | MACHINE_START_MEMBER(relief_state,relief) | |
| 69 | { | |
| 70 | atarigen_init(machine()); | |
| 71 | } | |
| 72 | ||
| 73 | ||
| 74 | 67 | MACHINE_RESET_MEMBER(relief_state,relief) |
| 75 | 68 | { |
| 76 | ||
| 77 | atarigen_eeprom_reset(this); | |
| 78 | atarigen_interrupt_reset(this, update_interrupts); | |
| 69 | atarigen_state::machine_reset(); | |
| 79 | 70 | atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2); |
| 80 | 71 | |
| 81 | 72 | machine().device<okim6295_device>("oki")->set_bank_base(0); |
| r18571 | r18572 | |
| 113 | 104 | if (ACCESSING_BITS_0_7) |
| 114 | 105 | { |
| 115 | 106 | m_ym2413_volume = (data >> 1) & 15; |
| 116 | | |
| 107 | set_ym2413_volume((m_ym2413_volume * m_overall_volume * 100) / (127 * 15)); | |
| 117 | 108 | m_adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (m_adpcm_bank_base & 0x100000); |
| 118 | 109 | } |
| 119 | 110 | if (ACCESSING_BITS_8_15) |
| r18571 | r18572 | |
| 129 | 120 | if (ACCESSING_BITS_0_7) |
| 130 | 121 | { |
| 131 | 122 | m_overall_volume = data & 127; |
| 132 | atarigen_set_ym2413_vol(machine(), (m_ym2413_volume * m_overall_volume * 100) / (127 * 15)); | |
| 133 | atarigen_set_oki6295_vol(machine(), m_overall_volume * 100 / 127); | |
| 123 | set_ym2413_volume((m_ym2413_volume * m_overall_volume * 100) / (127 * 15)); | |
| 124 | set_oki6295_volume(m_overall_volume * 100 / 127); | |
| 134 | 125 | } |
| 135 | 126 | } |
| 136 | 127 | |
| r18571 | r18572 | |
| 296 | 287 | MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) |
| 297 | 288 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 298 | 289 | |
| 299 | MCFG_MACHINE_START_OVERRIDE(relief_state,relief) | |
| 300 | 290 | MCFG_MACHINE_RESET_OVERRIDE(relief_state,relief) |
| 301 | 291 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 302 | 292 |
| r18571 | r18572 | |
|---|---|---|
| 155 | 155 | * |
| 156 | 156 | *************************************/ |
| 157 | 157 | |
| 158 | ||
| 158 | void atarisy2_state::update_interrupts() | |
| 159 | 159 | { |
| 160 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); | |
| 161 | ||
| 162 | if (state->m_video_int_state) | |
| 163 | machine.device("maincpu")->execute().set_input_line(3, ASSERT_LINE); | |
| 160 | if (m_video_int_state) | |
| 161 | machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE); | |
| 164 | 162 | else |
| 165 | machine.device("maincpu")->execute().set_input_line(3, CLEAR_LINE); | |
| 163 | machine().device("maincpu")->execute().set_input_line(3, CLEAR_LINE); | |
| 166 | 164 | |
| 167 | if (state->m_scanline_int_state) | |
| 168 | machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE); | |
| 165 | if (m_scanline_int_state) | |
| 166 | machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE); | |
| 169 | 167 | else |
| 170 | machine.device("maincpu")->execute().set_input_line(2, CLEAR_LINE); | |
| 168 | machine().device("maincpu")->execute().set_input_line(2, CLEAR_LINE); | |
| 171 | 169 | |
| 172 | if (state->m_p2portwr_state) | |
| 173 | machine.device("maincpu")->execute().set_input_line(1, ASSERT_LINE); | |
| 170 | if (m_p2portwr_state) | |
| 171 | machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE); | |
| 174 | 172 | else |
| 175 | machine.device("maincpu")->execute().set_input_line(1, CLEAR_LINE); | |
| 173 | machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE); | |
| 176 | 174 | |
| 177 | if (state->m_p2portrd_state) | |
| 178 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
| 175 | if (m_p2portrd_state) | |
| 176 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
| 179 | 177 | else |
| 180 | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
| 178 | machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
| 181 | 179 | } |
| 182 | 180 | |
| 183 | 181 | |
| r18571 | r18572 | |
| 188 | 186 | * |
| 189 | 187 | *************************************/ |
| 190 | 188 | |
| 191 | ||
| 189 | void atarisy2_state::scanline_update(screen_device &screen, int scanline) | |
| 192 | 190 | { |
| 193 | atarisy2_state *state = screen.machine().driver_data<atarisy2_state>(); | |
| 194 | 191 | if (scanline <= screen.height()) |
| 195 | 192 | { |
| 196 | 193 | /* generate the 32V interrupt (IRQ 2) */ |
| 197 | 194 | if ((scanline % 64) == 0) |
| 198 | if (state->m_interrupt_enable & 4) | |
| 199 | atarigen_scanline_int_gen(screen.machine().device("maincpu")); | |
| 195 | if (m_interrupt_enable & 4) | |
| 196 | scanline_int_gen(*subdevice("maincpu")); | |
| 200 | 197 | } |
| 201 | 198 | } |
| 202 | 199 | |
| r18571 | r18572 | |
| 222 | 219 | |
| 223 | 220 | MACHINE_START_MEMBER(atarisy2_state,atarisy2) |
| 224 | 221 | { |
| 225 | atarigen_ | |
| 222 | atarigen_state::machine_start(); | |
| 226 | 223 | |
| 227 | 224 | save_item(NAME(m_interrupt_enable)); |
| 228 | 225 | save_item(NAME(m_which_adc)); |
| r18571 | r18572 | |
| 235 | 232 | |
| 236 | 233 | MACHINE_RESET_MEMBER(atarisy2_state,atarisy2) |
| 237 | 234 | { |
| 238 | ||
| 239 | atarigen_eeprom_reset(this); | |
| 235 | atarigen_state::machine_reset(); | |
| 240 | 236 | slapstic_reset(); |
| 241 | atarigen_interrupt_reset(this, update_interrupts); | |
| 242 | atarigen_sound_io_reset(machine().device("soundcpu")); | |
| 243 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 64); | |
| 237 | scanline_timer_reset(*machine().primary_screen, 64); | |
| 244 | 238 | |
| 245 | 239 | address_space &main = machine().device<t11_device>("maincpu")->space(AS_PROGRAM); |
| 246 | 240 | main.set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this)); |
| r18571 | r18572 | |
| 272 | 266 | { |
| 273 | 267 | /* reset sound IRQ */ |
| 274 | 268 | m_p2portrd_state = 0; |
| 275 | | |
| 269 | update_interrupts(); | |
| 276 | 270 | } |
| 277 | 271 | |
| 278 | 272 | |
| r18571 | r18572 | |
| 280 | 274 | { |
| 281 | 275 | /* reset sound CPU */ |
| 282 | 276 | if (ACCESSING_BITS_0_7) |
| 283 | machine().device(" | |
| 277 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE); | |
| 284 | 278 | } |
| 285 | 279 | |
| 286 | 280 | |
| r18571 | r18572 | |
| 671 | 665 | if (!(data & 0x02)) rbott += 1.0/47; |
| 672 | 666 | if (!(data & 0x04)) rbott += 1.0/22; |
| 673 | 667 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 674 | | |
| 668 | set_ym2151_volume(gain * 100); | |
| 675 | 669 | |
| 676 | 670 | /* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */ |
| 677 | 671 | rtop = 1.0/(1.0/100 + 1.0/100); |
| r18571 | r18572 | |
| 679 | 673 | if (!(data & 0x08)) rbott += 1.0/47; |
| 680 | 674 | if (!(data & 0x10)) rbott += 1.0/22; |
| 681 | 675 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 682 | | |
| 676 | set_pokey_volume(gain * 100); | |
| 683 | 677 | |
| 684 | 678 | /* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */ |
| 685 | 679 | rtop = 1.0/(1.0/100 + 1.0/100); |
| r18571 | r18572 | |
| 688 | 682 | if (!(data & 0x40)) rbott += 1.0/47; |
| 689 | 683 | if (!(data & 0x80)) rbott += 1.0/22; |
| 690 | 684 | gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott))); |
| 691 | | |
| 685 | set_tms5220_volume(gain * 100); | |
| 692 | 686 | } |
| 693 | 687 | |
| 694 | 688 | |
| r18571 | r18572 | |
| 705 | 699 | return; |
| 706 | 700 | |
| 707 | 701 | /* a large number of signals are reset when this happens */ |
| 708 | | |
| 702 | sound_io_reset(); | |
| 709 | 703 | machine().device("ymsnd")->reset(); |
| 710 | 704 | if (m_has_tms5220) |
| 711 | 705 | { |
| r18571 | r18572 | |
| 717 | 711 | |
| 718 | 712 | READ16_MEMBER(atarisy2_state::sound_r) |
| 719 | 713 | { |
| 720 | ||
| 721 | 714 | /* clear the p2portwr state on a p1portrd */ |
| 722 | 715 | m_p2portwr_state = 0; |
| 723 | | |
| 716 | update_interrupts(); | |
| 724 | 717 | |
| 725 | 718 | /* handle it normally otherwise */ |
| 726 | return atarigen_sound_r(space,offset | |
| 719 | return atarigen_state::sound_r(space,offset) | 0xff00; | |
| 727 | 720 | } |
| 728 | 721 | |
| 729 | 722 | |
| 730 | 723 | WRITE8_MEMBER(atarisy2_state::sound_6502_w) |
| 731 | 724 | { |
| 732 | ||
| 733 | 725 | /* clock the state through */ |
| 734 | 726 | m_p2portwr_state = (m_interrupt_enable & 2) != 0; |
| 735 | | |
| 727 | update_interrupts(); | |
| 736 | 728 | |
| 737 | 729 | /* handle it normally otherwise */ |
| 738 | | |
| 730 | m6502_sound_w(space, offset, data); | |
| 739 | 731 | } |
| 740 | 732 | |
| 741 | 733 | |
| 742 | 734 | READ8_MEMBER(atarisy2_state::sound_6502_r) |
| 743 | 735 | { |
| 744 | ||
| 745 | 736 | /* clock the state through */ |
| 746 | 737 | m_p2portrd_state = (m_interrupt_enable & 1) != 0; |
| 747 | | |
| 738 | update_interrupts(); | |
| 748 | 739 | |
| 749 | 740 | /* handle it normally otherwise */ |
| 750 | return | |
| 741 | return m6502_sound_r(space, offset); | |
| 751 | 742 | } |
| 752 | 743 | |
| 753 | 744 | |
| r18571 | r18572 | |
| 802 | 793 | AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w) |
| 803 | 794 | AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w) |
| 804 | 795 | AM_RANGE(0x15a0, 0x15a1) AM_MIRROR(0x001e) AM_WRITE(int1_ack_w) |
| 805 | AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE | |
| 796 | AM_RANGE(0x15c0, 0x15c1) AM_MIRROR(0x001e) AM_WRITE(scanline_int_ack_w) | |
| 806 | 797 | AM_RANGE(0x15e0, 0x15e1) AM_MIRROR(0x001e) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 807 | 798 | AM_RANGE(0x1600, 0x1601) AM_MIRROR(0x007e) AM_WRITE(int_enable_w) |
| 808 | AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE | |
| 799 | AM_RANGE(0x1680, 0x1681) AM_MIRROR(0x007e) AM_WRITE8(sound_w, 0x00ff) | |
| 809 | 800 | AM_RANGE(0x1700, 0x1701) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_xscroll_w) AM_SHARE("xscroll") |
| 810 | 801 | AM_RANGE(0x1780, 0x1781) AM_MIRROR(0x007e) AM_WRITE_LEGACY(atarisy2_yscroll_w) AM_SHARE("yscroll") |
| 811 | 802 | AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w) |
| r18571 | r18572 | |
| 839 | 830 | AM_RANGE(0x1872, 0x1873) AM_MIRROR(0x2780) AM_WRITE(tms5220_strobe_w) |
| 840 | 831 | AM_RANGE(0x1874, 0x1874) AM_MIRROR(0x2781) AM_WRITE(sound_6502_w) |
| 841 | 832 | AM_RANGE(0x1876, 0x1876) AM_MIRROR(0x2781) AM_WRITE(coincount_w) |
| 842 | AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE | |
| 833 | AM_RANGE(0x1878, 0x1878) AM_MIRROR(0x2781) AM_WRITE(m6502_irq_ack_w) | |
| 843 | 834 | AM_RANGE(0x187a, 0x187a) AM_MIRROR(0x2781) AM_WRITE(mixer_w) |
| 844 | 835 | AM_RANGE(0x187c, 0x187c) AM_MIRROR(0x2781) AM_WRITE(switch_6502_w) |
| 845 | 836 | AM_RANGE(0x187e, 0x187e) AM_MIRROR(0x2781) AM_WRITE(sound_reset_w) |
| r18571 | r18572 | |
| 1262 | 1253 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 1263 | 1254 | MCFG_CPU_VBLANK_INT_DRIVER("screen", atarisy2_state, vblank_int) |
| 1264 | 1255 | |
| 1265 | MCFG_CPU_ADD(" | |
| 1256 | MCFG_CPU_ADD("audiocpu", M6502, SOUND_CLOCK/8) | |
| 1266 | 1257 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| 1267 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10) | |
| 1258 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10) | |
| 1268 | 1259 | |
| 1269 | 1260 | MCFG_MACHINE_START_OVERRIDE(atarisy2_state,atarisy2) |
| 1270 | 1261 | MCFG_MACHINE_RESET_OVERRIDE(atarisy2_state,atarisy2) |
| r18571 | r18572 | |
| 1330 | 1321 | ROM_LOAD16_BYTE( "cpu_l06.rv2", 0x070000, 0x004000, CRC(8a754466) SHA1(2c4c6ca797c7f4349c2893d8c0ba7e2658fdca99) ) |
| 1331 | 1322 | ROM_LOAD16_BYTE( "cpu_s06.rv2", 0x070001, 0x004000, CRC(224209f9) SHA1(c41269bfadb8fff1c8ff0f6ea0b8e8b34feb49d6) ) |
| 1332 | 1323 | |
| 1333 | ROM_REGION( 0x10000, " | |
| 1324 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1334 | 1325 | ROM_LOAD( "cpu_a02.rv3", 0x004000, 0x004000, CRC(ba251bc4) SHA1(768e42608263205e412e651082ffa2a083b04644) ) |
| 1335 | 1326 | ROM_LOAD( "cpu_b02.rv2", 0x008000, 0x004000, CRC(e4e7a8b9) SHA1(f11a0cf40d5c51ff180f0fa1cf676f95090a1010) ) |
| 1336 | 1327 | ROM_LOAD( "cpu_c02.rv2", 0x00c000, 0x004000, CRC(d44c2aa2) SHA1(f1b00e36d87f6d77746cf003198c7f19aa2f4fab) ) |
| r18571 | r18572 | |
| 1372 | 1363 | ROM_LOAD16_BYTE( "cpu_l06.rv2", 0x070000, 0x004000, CRC(8a754466) SHA1(2c4c6ca797c7f4349c2893d8c0ba7e2658fdca99) ) |
| 1373 | 1364 | ROM_LOAD16_BYTE( "cpu_s06.rv2", 0x070001, 0x004000, CRC(224209f9) SHA1(c41269bfadb8fff1c8ff0f6ea0b8e8b34feb49d6) ) |
| 1374 | 1365 | |
| 1375 | ROM_REGION( 0x10000, " | |
| 1366 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1376 | 1367 | ROM_LOAD( "cpu_a02.rv2", 0x004000, 0x004000, CRC(4a759092) SHA1(26909df77f53ac19e205411b90558488badc82bd) ) |
| 1377 | 1368 | ROM_LOAD( "cpu_b02.rv2", 0x008000, 0x004000, CRC(e4e7a8b9) SHA1(f11a0cf40d5c51ff180f0fa1cf676f95090a1010) ) |
| 1378 | 1369 | ROM_LOAD( "cpu_c02.rv2", 0x00c000, 0x004000, CRC(d44c2aa2) SHA1(f1b00e36d87f6d77746cf003198c7f19aa2f4fab) ) |
| r18571 | r18572 | |
| 1414 | 1405 | ROM_LOAD16_BYTE( "cpu_l06.rv1", 0x070000, 0x004000, CRC(ccbc58a6) SHA1(dd66317146c295524f83b8d40c20164e873752b5) ) |
| 1415 | 1406 | ROM_LOAD16_BYTE( "cpu_s06.rv1", 0x070001, 0x004000, CRC(a7f14643) SHA1(d73c8ec2493617fce2e6822e8a6cde16a2de5965) ) |
| 1416 | 1407 | |
| 1417 | ROM_REGION( 0x10000, " | |
| 1408 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1418 | 1409 | ROM_LOAD( "cpu_a02.rv1", 0x004000, 0x004000, CRC(5479a788) SHA1(4cc5145e75ac6370f54eea33531f1f96160ee82b) ) |
| 1419 | 1410 | ROM_LOAD( "cpu_b02.rv1", 0x008000, 0x004000, CRC(de4147c6) SHA1(c997510b2018291924abddfe604a8f738fd8035c) ) |
| 1420 | 1411 | ROM_LOAD( "cpu_c02.rv1", 0x00c000, 0x004000, CRC(b71505fc) SHA1(15fd156038861cb715fce10f1c56f3ded851be39) ) |
| r18571 | r18572 | |
| 1454 | 1445 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1455 | 1446 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1456 | 1447 | |
| 1457 | ROM_REGION( 0x10000, " | |
| 1448 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1458 | 1449 | ROM_LOAD( "136047-2134.2a", 0x004000, 0x004000, CRC(0db4ca28) SHA1(71c2e0eee0eee418bdd2f806bd6ce5ae1c72bf69) ) |
| 1459 | 1450 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1460 | 1451 | ROM_LOAD( "136047-2136.2cd", 0x00c000, 0x004000, CRC(00b06bec) SHA1(cd771eea329e0f6ab5bff1035f931800cc5da545) ) |
| r18571 | r18572 | |
| 1522 | 1513 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1523 | 1514 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1524 | 1515 | |
| 1525 | ROM_REGION( 0x10000, " | |
| 1516 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1526 | 1517 | ROM_LOAD( "136047-1134.2a", 0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) ) |
| 1527 | 1518 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1528 | 1519 | ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) ) |
| r18571 | r18572 | |
| 1590 | 1581 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1591 | 1582 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1592 | 1583 | |
| 1593 | ROM_REGION( 0x10000, " | |
| 1584 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1594 | 1585 | ROM_LOAD( "136047-1134.2a", 0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) ) |
| 1595 | 1586 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1596 | 1587 | ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) ) |
| r18571 | r18572 | |
| 1658 | 1649 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1659 | 1650 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1660 | 1651 | |
| 1661 | ROM_REGION( 0x10000, " | |
| 1652 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1662 | 1653 | ROM_LOAD( "136047-1134.2a", 0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) ) |
| 1663 | 1654 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1664 | 1655 | ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) ) |
| r18571 | r18572 | |
| 1726 | 1717 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1727 | 1718 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1728 | 1719 | |
| 1729 | ROM_REGION( 0x10000, " | |
| 1720 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1730 | 1721 | ROM_LOAD( "136047-2134.2a", 0x004000, 0x004000, CRC(0db4ca28) SHA1(71c2e0eee0eee418bdd2f806bd6ce5ae1c72bf69) ) |
| 1731 | 1722 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1732 | 1723 | ROM_LOAD( "136047-2136.2cd", 0x00c000, 0x004000, CRC(00b06bec) SHA1(cd771eea329e0f6ab5bff1035f931800cc5da545) ) |
| r18571 | r18572 | |
| 1794 | 1785 | ROM_LOAD16_BYTE( "136047-1130.6k", 0x050000, 0x010000, CRC(93fba845) SHA1(4de5867272af63be696855f2a4dff99476b213ad) ) |
| 1795 | 1786 | ROM_LOAD16_BYTE( "136047-1133.6r", 0x050001, 0x010000, CRC(53c177be) SHA1(a60c81899944e0dda9886e6697edc4d9309ca8f4) ) |
| 1796 | 1787 | |
| 1797 | ROM_REGION( 0x10000, " | |
| 1788 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1798 | 1789 | ROM_LOAD( "136047-1134.2a", 0x004000, 0x004000, CRC(09a418c2) SHA1(017491bbcd0def695a23ab17b1e4fbd1fdf4d5d1) ) |
| 1799 | 1790 | ROM_LOAD( "136047-1135.2b", 0x008000, 0x004000, CRC(b1f157d0) SHA1(26355324d49baa02acb777940d7f49d074a75fe5) ) |
| 1800 | 1791 | ROM_LOAD( "136047-1136.2cd", 0x00c000, 0x004000, CRC(dad40e6d) SHA1(a94bc1b5f0a5218e9e44cd32f2ca6268b48072c2) ) |
| r18571 | r18572 | |
| 1863 | 1854 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 1864 | 1855 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 1865 | 1856 | |
| 1866 | ROM_REGION( 0x10000, " | |
| 1857 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1867 | 1858 | ROM_LOAD( "136042-419.2bc", 0x008000, 0x004000, CRC(b277915a) SHA1(e0e8cd713950f45352b7c1de986b5b0b5c1703b3) ) |
| 1868 | 1859 | ROM_LOAD( "136042-420.2d", 0x00c000, 0x004000, CRC(170b2c53) SHA1(c6d5657da29cf637cea940406fcff9a7328964f8) ) |
| 1869 | 1860 | |
| r18571 | r18572 | |
| 1910 | 1901 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 1911 | 1902 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 1912 | 1903 | |
| 1913 | ROM_REGION( 0x10000, " | |
| 1904 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1914 | 1905 | ROM_LOAD( "136042-119.2bc", 0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) ) |
| 1915 | 1906 | ROM_LOAD( "136042-120.2d", 0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) ) |
| 1916 | 1907 | |
| r18571 | r18572 | |
| 1957 | 1948 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 1958 | 1949 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 1959 | 1950 | |
| 1960 | ROM_REGION( 0x10000, " | |
| 1951 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 1961 | 1952 | ROM_LOAD( "136042-119.2bc", 0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) ) |
| 1962 | 1953 | ROM_LOAD( "136042-120.2d", 0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) ) |
| 1963 | 1954 | |
| r18571 | r18572 | |
| 2004 | 1995 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 2005 | 1996 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 2006 | 1997 | |
| 2007 | ROM_REGION( 0x10000, " | |
| 1998 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2008 | 1999 | ROM_LOAD( "136042-119.2bc", 0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) ) |
| 2009 | 2000 | ROM_LOAD( "136042-120.2d", 0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) ) |
| 2010 | 2001 | |
| r18571 | r18572 | |
| 2051 | 2042 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 2052 | 2043 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 2053 | 2044 | |
| 2054 | ROM_REGION( 0x10000, " | |
| 2045 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2055 | 2046 | ROM_LOAD( "136042-319.2bc", 0x008000, 0x004000, CRC(c7f31c16) SHA1(cfacf22405da5e3cf95059ea6b9677a5a8471496) ) |
| 2056 | 2047 | ROM_LOAD( "136042-320.2d", 0x00c000, 0x004000, CRC(9815ece9) SHA1(95239e15fe3e3f9a66e0f4dae365f763656cb70b) ) |
| 2057 | 2048 | |
| r18571 | r18572 | |
| 2098 | 2089 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 2099 | 2090 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 2100 | 2091 | |
| 2101 | ROM_REGION( 0x10000, " | |
| 2092 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2102 | 2093 | ROM_LOAD( "136042-119.2bc", 0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) ) |
| 2103 | 2094 | ROM_LOAD( "136042-120.2d", 0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) ) |
| 2104 | 2095 | |
| r18571 | r18572 | |
| 2145 | 2136 | ROM_LOAD16_BYTE( "136042-126.6l", 0x070000, 0x008000, CRC(92f5392c) SHA1(064ccf24a68440caa565c0467ba4bf4246133698) ) |
| 2146 | 2137 | ROM_LOAD16_BYTE( "136042-122.6s", 0x070001, 0x008000, CRC(0381f362) SHA1(e33b6d4949cdee33f27cedf00ef20f1ce5011e24) ) |
| 2147 | 2138 | |
| 2148 | ROM_REGION( 0x10000, " | |
| 2139 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2149 | 2140 | ROM_LOAD( "136042-119.2bc", 0x008000, 0x004000, CRC(0c810231) SHA1(a5a637e12df7eae234fdc2d3957d122c196c65cd) ) |
| 2150 | 2141 | ROM_LOAD( "136042-120.2d", 0x00c000, 0x004000, CRC(647b7481) SHA1(51b1b09919eee3d98e65d48e3a2af8321ccf8a02) ) |
| 2151 | 2142 | |
| r18571 | r18572 | |
| 2192 | 2183 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2193 | 2184 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2194 | 2185 | |
| 2195 | ROM_REGION( 0x10000, " | |
| 2186 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2196 | 2187 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2197 | 2188 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2198 | 2189 | |
| r18571 | r18572 | |
| 2237 | 2228 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2238 | 2229 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2239 | 2230 | |
| 2240 | ROM_REGION( 0x10000, " | |
| 2231 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2241 | 2232 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2242 | 2233 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2243 | 2234 | |
| r18571 | r18572 | |
| 2282 | 2273 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2283 | 2274 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2284 | 2275 | |
| 2285 | ROM_REGION( 0x10000, " | |
| 2276 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2286 | 2277 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2287 | 2278 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2288 | 2279 | |
| r18571 | r18572 | |
| 2327 | 2318 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2328 | 2319 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2329 | 2320 | |
| 2330 | ROM_REGION( 0x10000, " | |
| 2321 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2331 | 2322 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2332 | 2323 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2333 | 2324 | |
| r18571 | r18572 | |
| 2372 | 2363 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2373 | 2364 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2374 | 2365 | |
| 2375 | ROM_REGION( 0x10000, " | |
| 2366 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2376 | 2367 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2377 | 2368 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2378 | 2369 | |
| r18571 | r18572 | |
| 2417 | 2408 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2418 | 2409 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2419 | 2410 | |
| 2420 | ROM_REGION( 0x10000, " | |
| 2411 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2421 | 2412 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2422 | 2413 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2423 | 2414 | |
| r18571 | r18572 | |
| 2462 | 2453 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2463 | 2454 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2464 | 2455 | |
| 2465 | ROM_REGION( 0x10000, " | |
| 2456 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2466 | 2457 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2467 | 2458 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2468 | 2459 | |
| r18571 | r18572 | |
| 2507 | 2498 | ROM_LOAD16_BYTE( "136045-1123.6l", 0x070000, 0x008000, CRC(0a4d216a) SHA1(53a4af7673c9dae1f6f2f13dce3c38a31ee12ee2) ) |
| 2508 | 2499 | ROM_LOAD16_BYTE( "136045-1120.6s", 0x070001, 0x008000, CRC(103f3fde) SHA1(9a0e82c3294369858b7a6c978143d8145a8df5a2) ) |
| 2509 | 2500 | |
| 2510 | ROM_REGION( 0x10000, " | |
| 2501 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2511 | 2502 | ROM_LOAD( "136045-1118.2bc", 0x008000, 0x004000, CRC(eba41b2f) SHA1(a0d6e9f4609f2587b0fad6845e75653c10bf4249) ) |
| 2512 | 2503 | ROM_LOAD( "136045-1119.2d", 0x00c000, 0x004000, CRC(9e49043a) SHA1(ec467fe1cd59c51e43c3acd83d300f5b3309a47a) ) |
| 2513 | 2504 | |
| r18571 | r18572 | |
| 2552 | 2543 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2553 | 2544 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2554 | 2545 | |
| 2555 | ROM_REGION( 0x10000, " | |
| 2546 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2556 | 2547 | ROM_LOAD( "136051-5134.2a", 0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) ) |
| 2557 | 2548 | ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) ) |
| 2558 | 2549 | ROM_LOAD( "136051-5136.2d", 0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) ) |
| r18571 | r18572 | |
| 2623 | 2614 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2624 | 2615 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2625 | 2616 | |
| 2626 | ROM_REGION( 0x10000, " | |
| 2617 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2627 | 2618 | ROM_LOAD( "136051-5134.2a", 0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) ) |
| 2628 | 2619 | ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) ) |
| 2629 | 2620 | ROM_LOAD( "136051-5136.2d", 0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) ) |
| r18571 | r18572 | |
| 2694 | 2685 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2695 | 2686 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2696 | 2687 | |
| 2697 | ROM_REGION( 0x10000, " | |
| 2688 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2698 | 2689 | ROM_LOAD( "136051-5134.2a", 0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) ) |
| 2699 | 2690 | ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) ) |
| 2700 | 2691 | ROM_LOAD( "136051-5136.2d", 0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) ) |
| r18571 | r18572 | |
| 2765 | 2756 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2766 | 2757 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2767 | 2758 | |
| 2768 | ROM_REGION( 0x10000, " | |
| 2759 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2769 | 2760 | ROM_LOAD( "136051-5134.2a", 0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) ) |
| 2770 | 2761 | ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) ) |
| 2771 | 2762 | ROM_LOAD( "136051-5136.2d", 0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) ) |
| r18571 | r18572 | |
| 2836 | 2827 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2837 | 2828 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2838 | 2829 | |
| 2839 | ROM_REGION( 0x10000, " | |
| 2830 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2840 | 2831 | ROM_LOAD( "136051-1134.2a", 0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) ) |
| 2841 | 2832 | ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) ) |
| 2842 | 2833 | ROM_LOAD( "136051-1136.2d", 0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) ) |
| r18571 | r18572 | |
| 2907 | 2898 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2908 | 2899 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2909 | 2900 | |
| 2910 | ROM_REGION( 0x10000, " | |
| 2901 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2911 | 2902 | ROM_LOAD( "136051-1134.2a", 0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) ) |
| 2912 | 2903 | ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) ) |
| 2913 | 2904 | ROM_LOAD( "136051-1136.2d", 0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) ) |
| r18571 | r18572 | |
| 2978 | 2969 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 2979 | 2970 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 2980 | 2971 | |
| 2981 | ROM_REGION( 0x10000, " | |
| 2972 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 2982 | 2973 | ROM_LOAD( "136051-1134.2a", 0x004000, 0x004000, CRC(a65748b9) SHA1(20d51300382543f09e47bee7273b9074e5a4618a) ) |
| 2983 | 2974 | ROM_LOAD( "136051-1135.2bc", 0x008000, 0x004000, CRC(e9692cea) SHA1(2b2d9638e012d326777e2e730e28cbacea6d9a72) ) |
| 2984 | 2975 | ROM_LOAD( "136051-1136.2d", 0x00c000, 0x004000, CRC(92fc7657) SHA1(cfda3a191a5f7ee4157f9d226bcf3dd601cabee1) ) |
| r18571 | r18572 | |
| 3049 | 3040 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 3050 | 3041 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 3051 | 3042 | |
| 3052 | ROM_REGION( 0x10000, " | |
| 3043 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 3053 | 3044 | ROM_LOAD( "136051-4134.2a", 0x004000, 0x004000, CRC(45e03b0e) SHA1(d58f5e1095fd6a7c0253fcc9f0e55812c1677387) ) |
| 3054 | 3045 | ROM_LOAD( "136051-4135.2bc", 0x008000, 0x004000, CRC(b4ca24b2) SHA1(86461da310b334f6b32c0e079de6852792284cc6) ) |
| 3055 | 3046 | ROM_LOAD( "136051-4136.2d", 0x00c000, 0x004000, CRC(11efaabf) SHA1(76446b09bf7cacd713ab88d58793460c9d1a8b9b) ) |
| r18571 | r18572 | |
| 3120 | 3111 | ROM_LOAD16_BYTE( "136051-1132.6l", 0x070000, 0x010000, CRC(6d0e7a4e) SHA1(75aae74571c50d36639d0ae69b0614e5aedeb6e3) ) |
| 3121 | 3112 | ROM_LOAD16_BYTE( "136051-1133.6s", 0x070001, 0x010000, CRC(af88d429) SHA1(432720afd4179d3df871226e0eb576d2ffde44c1) ) |
| 3122 | 3113 | |
| 3123 | ROM_REGION( 0x10000, " | |
| 3114 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for 6502 code */ | |
| 3124 | 3115 | ROM_LOAD( "136051-5134.2a", 0x004000, 0x004000, CRC(1c8bdeed) SHA1(bbdbbb9a4903f98842d9a697410a2e3a2069284c) ) |
| 3125 | 3116 | ROM_LOAD( "136051-5135.2bc", 0x008000, 0x004000, CRC(ed6adb91) SHA1(b1f1f0d1bda445a53de798fb6847c605afe53e3c) ) |
| 3126 | 3117 | ROM_LOAD( "136051-5136.2d", 0x00c000, 0x004000, CRC(341f8486) SHA1(4cea39c0d8551ce7193e51de341f7297a94b8d9b) ) |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void shuuz_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | shuuz_state *state = machine.driver_data<shuuz_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | |
| r18571 | r18572 | |
| 64 | 63 | * |
| 65 | 64 | *************************************/ |
| 66 | 65 | |
| 67 | MACHINE_START_MEMBER(shuuz_state,shuuz) | |
| 68 | { | |
| 69 | atarigen_init(machine()); | |
| 70 | } | |
| 71 | ||
| 72 | ||
| 73 | 66 | MACHINE_RESET_MEMBER(shuuz_state,shuuz) |
| 74 | 67 | { |
| 75 | ||
| 76 | atarigen_eeprom_reset(this); | |
| 77 | atarigen_interrupt_reset(this, update_interrupts); | |
| 68 | atarigen_state::machine_reset(); | |
| 78 | 69 | atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 1); |
| 79 | 70 | } |
| 80 | 71 | |
| r18571 | r18572 | |
| 263 | 254 | MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) |
| 264 | 255 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 265 | 256 | |
| 266 | MCFG_MACHINE_START_OVERRIDE(shuuz_state,shuuz) | |
| 267 | 257 | MCFG_MACHINE_RESET_OVERRIDE(shuuz_state,shuuz) |
| 268 | 258 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 269 | 259 |
| r18571 | r18572 | |
|---|---|---|
| 47 | 47 | * |
| 48 | 48 | *************************************/ |
| 49 | 49 | |
| 50 | ||
| 50 | void atarigt_state::update_interrupts() | |
| 51 | 51 | { |
| 52 | atarigt_state *state = machine.driver_data<atarigt_state>(); | |
| 53 | machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 54 | machine.device("maincpu")->execute().set_input_line(4, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 55 | machine.device("maincpu")->execute().set_input_line(6, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 52 | machine().device("maincpu")->execute().set_input_line(3, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 53 | machine().device("maincpu")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 54 | machine().device("maincpu")->execute().set_input_line(6, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 | |
| 59 | MACHINE_START_MEMBER(atarigt_state,atarigt) | |
| 60 | { | |
| 61 | atarigen_init(machine()); | |
| 62 | } | |
| 63 | ||
| 64 | ||
| 65 | 58 | MACHINE_RESET_MEMBER(atarigt_state,atarigt) |
| 66 | 59 | { |
| 67 | ||
| 68 | atarigen_eeprom_reset(this); | |
| 69 | atarigen_interrupt_reset(this, update_interrupts); | |
| 70 | atarigen_scanline_timer_reset(*machine().primary_screen, atarigt_scanline_update, 8); | |
| 60 | atarigen_state::machine_reset(); | |
| 61 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 71 | 62 | } |
| 72 | 63 | |
| 73 | 64 | |
| r18571 | r18572 | |
| 612 | 603 | AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(colorram_protection_r, colorram_protection_w) AM_SHARE("colorram") |
| 613 | 604 | AM_RANGE(0xe04000, 0xe04003) AM_WRITE(led_w) |
| 614 | 605 | AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w) |
| 615 | AM_RANGE(0xe0a000, 0xe0a003) AM_WRITE | |
| 606 | AM_RANGE(0xe0a000, 0xe0a003) AM_WRITE16(scanline_int_ack_w, 0xffffffff) | |
| 616 | 607 | AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE_LEGACY(atarigen_video_int_ack32_w) |
| 617 | 608 | AM_RANGE(0xe0e000, 0xe0e003) AM_WRITENOP//watchdog_reset_w }, |
| 618 | 609 | AM_RANGE(0xe80000, 0xe80003) AM_READ_PORT("P1_P2") |
| r18571 | r18572 | |
| 811 | 802 | MCFG_CPU_ADD("maincpu", M68EC020, ATARI_CLOCK_50MHz/2) |
| 812 | 803 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 813 | 804 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 814 | MCFG_CPU_PERIODIC_INT(atarigen_scanline_int_gen, 250) | |
| 805 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, scanline_int_gen, 250) | |
| 815 | 806 | |
| 816 | MCFG_MACHINE_START_OVERRIDE(atarigt_state,atarigt) | |
| 817 | 807 | MCFG_MACHINE_RESET_OVERRIDE(atarigt_state,atarigt) |
| 818 | 808 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 819 | 809 |
| r18571 | r18572 | |
|---|---|---|
| 36 | 36 | * |
| 37 | 37 | *************************************/ |
| 38 | 38 | |
| 39 | ||
| 39 | void cyberbal_state::update_interrupts() | |
| 40 | 40 | { |
| 41 | cyberbal_state *state = machine.driver_data<cyberbal_state>(); | |
| 42 | machine.device("maincpu")->execute().set_input_line(1, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 43 | machine.device("extra")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 41 | if (subdevice("extra") != NULL) | |
| 42 | { | |
| 43 | subdevice("maincpu")->execute().set_input_line(1, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 44 | subdevice("extra")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 45 | } | |
| 46 | else | |
| 47 | { | |
| 48 | subdevice("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 49 | subdevice("maincpu")->execute().set_input_line(3, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 50 | } | |
| 44 | 51 | } |
| 45 | 52 | |
| 46 | 53 | |
| 47 | 54 | MACHINE_START_MEMBER(cyberbal_state,cyberbal) |
| 48 | 55 | { |
| 49 | atarigen_ | |
| 56 | atarigen_state::machine_start(); | |
| 50 | 57 | |
| 51 | 58 | save_item(NAME(m_fast_68k_int)); |
| 52 | 59 | save_item(NAME(m_io_68k_int)); |
| r18571 | r18572 | |
| 59 | 66 | |
| 60 | 67 | MACHINE_RESET_MEMBER(cyberbal_state,cyberbal) |
| 61 | 68 | { |
| 69 | atarigen_state::machine_reset(); | |
| 70 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 62 | 71 | |
| 63 | atarigen_eeprom_reset(this); | |
| 64 | atarigen_slapstic_reset(this); | |
| 65 | atarigen_interrupt_reset(this, update_interrupts); | |
| 66 | atarigen_scanline_timer_reset(*machine().primary_screen, cyberbal_scanline_update, 8); | |
| 67 | atarigen_sound_io_reset(machine().device("audiocpu")); | |
| 68 | ||
| 69 | 72 | cyberbal_sound_reset(machine()); |
| 70 | 73 | |
| 71 | 74 | /* Extra CPU (second M68k) doesn't run until reset */ |
| r18571 | r18572 | |
| 73 | 76 | } |
| 74 | 77 | |
| 75 | 78 | |
| 76 | static void cyberbal2p_update_interrupts(running_machine &machine) | |
| 77 | { | |
| 78 | cyberbal_state *state = machine.driver_data<cyberbal_state>(); | |
| 79 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 80 | machine.device("maincpu")->execute().set_input_line(3, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | 79 | MACHINE_RESET_MEMBER(cyberbal_state,cyberbal2p) |
| 85 | 80 | { |
| 86 | ||
| 87 | atarigen_eeprom_reset(this); | |
| 88 | atarigen_interrupt_reset(this, cyberbal2p_update_interrupts); | |
| 89 | atarigen_scanline_timer_reset(*machine().primary_screen, cyberbal_scanline_update, 8); | |
| 90 | atarijsa_reset(); | |
| 81 | atarigen_state::machine_reset(); | |
| 82 | scanline_timer_reset(*machine().primary_screen, 8); | |
| 83 | atarijsa_reset(machine()); | |
| 91 | 84 | } |
| 92 | 85 | |
| 93 | 86 | |
| r18571 | r18572 | |
| 145 | 138 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state ) |
| 146 | 139 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 147 | 140 | AM_RANGE(0xfc0000, 0xfc0fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 148 | AM_RANGE(0xfc8000, 0xfcffff) AM_READ | |
| 141 | AM_RANGE(0xfc8000, 0xfcffff) AM_READ8(sound_r, 0xff00) | |
| 149 | 142 | AM_RANGE(0xfd0000, 0xfd1fff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 150 | AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE | |
| 143 | AM_RANGE(0xfd2000, 0xfd3fff) AM_WRITE(sound_reset_w) | |
| 151 | 144 | AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w) |
| 152 | 145 | AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w) |
| 153 | AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE | |
| 146 | AM_RANGE(0xfd8000, 0xfd9fff) AM_WRITE8(sound_w, 0xff00) | |
| 154 | 147 | AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r) |
| 155 | 148 | AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1") |
| 156 | 149 | AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE_LEGACY(cyberbal_paletteram_1_w) AM_SHARE("paletteram_1") |
| r18571 | r18572 | |
| 206 | 199 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 207 | 200 | AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) |
| 208 | 201 | AM_RANGE(0x2800, 0x2801) AM_WRITE(cyberbal_sound_68k_6502_w) |
| 209 | AM_RANGE(0x2802, 0x2803) AM_READWRITE_LEGACY(atarigen_6502_irq_ack_r, atarigen_6502_irq_ack_w) | |
| 210 | AM_RANGE(0x2804, 0x2805) AM_WRITE_LEGACY(atarigen_6502_sound_w) | |
| 202 | AM_RANGE(0x2802, 0x2803) AM_READWRITE(m6502_irq_ack_r, m6502_irq_ack_w) | |
| 203 | AM_RANGE(0x2804, 0x2805) AM_WRITE(m6502_sound_w) | |
| 211 | 204 | AM_RANGE(0x2806, 0x2807) AM_WRITE(cyberbal_sound_bank_select_w) |
| 212 | AM_RANGE(0x2c00, 0x2c01) AM_READ | |
| 205 | AM_RANGE(0x2c00, 0x2c01) AM_READ(m6502_sound_r) | |
| 213 | 206 | AM_RANGE(0x2c02, 0x2c03) AM_READ(cyberbal_special_port3_r) |
| 214 | 207 | AM_RANGE(0x2c04, 0x2c05) AM_READ(cyberbal_sound_68k_6502_r) |
| 215 | 208 | AM_RANGE(0x2c06, 0x2c07) AM_READ(cyberbal_sound_6502_stat_r) |
| r18571 | r18572 | |
| 247 | 240 | AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0") |
| 248 | 241 | AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1") |
| 249 | 242 | AM_RANGE(0xfc4000, 0xfc4003) AM_READ(special_port2_r) |
| 250 | AM_RANGE(0xfc6000, 0xfc6003) AM_READ | |
| 243 | AM_RANGE(0xfc6000, 0xfc6003) AM_READ8(sound_r, 0xff00) | |
| 251 | 244 | AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 252 | 245 | AM_RANGE(0xfca000, 0xfcafff) AM_RAM_WRITE_LEGACY(atarigen_666_paletteram_w) AM_SHARE("paletteram") |
| 253 | 246 | AM_RANGE(0xfd0000, 0xfd0003) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 254 | AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE | |
| 247 | AM_RANGE(0xfd2000, 0xfd2003) AM_WRITE(sound_reset_w) | |
| 255 | 248 | AM_RANGE(0xfd4000, 0xfd4003) AM_WRITE(watchdog_reset16_w) |
| 256 | 249 | AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| 257 | AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE | |
| 250 | AM_RANGE(0xfd8000, 0xfd8003) AM_WRITE8(sound_w, 0xff00) | |
| 258 | 251 | AM_RANGE(0xfe0000, 0xfe0003) AM_READ(sound_state_r) |
| 259 | 252 | AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE_LEGACY(atarigen_playfield_w) AM_SHARE("playfield") |
| 260 | 253 | AM_RANGE(0xff2000, 0xff2fff) AM_RAM_WRITE_LEGACY(atarigen_alpha_w) AM_SHARE("alpha") |
| r18571 | r18572 | |
| 419 | 412 | |
| 420 | 413 | MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8) |
| 421 | 414 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| 422 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14) | |
| 415 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14) | |
| 423 | 416 | |
| 424 | 417 | MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) |
| 425 | 418 | MCFG_CPU_PROGRAM_MAP(extra_map) |
| r18571 | r18572 | |
| 988 | 981 | |
| 989 | 982 | DRIVER_INIT_MEMBER(cyberbal_state,cyberbal) |
| 990 | 983 | { |
| 991 | | |
| 984 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 0); | |
| 992 | 985 | } |
| 993 | 986 | |
| 994 | 987 | |
| 995 | 988 | DRIVER_INIT_MEMBER(cyberbal_state,cyberbalt) |
| 996 | 989 | { |
| 997 | | |
| 990 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x018000, 0, 116); | |
| 998 | 991 | } |
| 999 | 992 | |
| 1000 | 993 |
| r18571 | r18572 | |
|---|---|---|
| 177 | 177 | * |
| 178 | 178 | *************************************/ |
| 179 | 179 | |
| 180 | ||
| 180 | void badlands_state::update_interrupts() | |
| 181 | 181 | { |
| 182 | badlands_state *state = machine.driver_data<badlands_state>(); | |
| 183 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 184 | machine.device("maincpu")->execute().set_input_line(2, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 182 | machine().device("maincpu")->execute().set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 183 | machine().device("maincpu")->execute().set_input_line(2, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 185 | 184 | } |
| 186 | 185 | |
| 187 | 186 | |
| 188 | ||
| 187 | void badlands_state::scanline_update(screen_device &screen, int scanline) | |
| 189 | 188 | { |
| 190 | address_space &space = s | |
| 189 | address_space &space = subdevice("audiocpu")->memory().space(AS_PROGRAM); | |
| 191 | 190 | |
| 192 | 191 | /* sound IRQ is on 32V */ |
| 193 | 192 | if (scanline & 32) |
| 194 | atarigen_6502_irq_ack_r(space, 0); | |
| 195 | else if (!(screen.machine().root_device().ioport("FE4000")->read() & 0x40)) | |
| 196 | atarigen_6502_irq_gen(screen.machine().device("audiocpu")); | |
| 193 | m6502_irq_ack_r(space, 0); | |
| 194 | else if (!(ioport("FE4000")->read() & 0x40)) | |
| 195 | m6502_irq_gen(*screen.machine().device("audiocpu")); | |
| 197 | 196 | } |
| 198 | 197 | |
| 199 | 198 | |
| 200 | 199 | MACHINE_START_MEMBER(badlands_state,badlands) |
| 201 | 200 | { |
| 201 | atarigen_state::machine_start(); | |
| 202 | 202 | |
| 203 | atarigen_init(machine()); | |
| 204 | ||
| 205 | 203 | save_item(NAME(m_pedal_value)); |
| 206 | 204 | } |
| 207 | 205 | |
| 208 | 206 | |
| 209 | 207 | MACHINE_RESET_MEMBER(badlands_state,badlands) |
| 210 | 208 | { |
| 211 | ||
| 212 | 209 | m_pedal_value[0] = m_pedal_value[1] = 0x80; |
| 213 | 210 | |
| 214 | atarigen_eeprom_reset(this); | |
| 215 | atarigen_interrupt_reset(this, update_interrupts); | |
| 216 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32); | |
| 211 | atarigen_state::machine_reset(); | |
| 212 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 217 | 213 | |
| 218 | atarigen_sound_io_reset(machine().device("audiocpu")); | |
| 219 | 214 | memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000); |
| 220 | 215 | } |
| 221 | 216 | |
| r18571 | r18572 | |
| 289 | 284 | break; |
| 290 | 285 | |
| 291 | 286 | case 0x002: /* /RDP */ |
| 292 | result = | |
| 287 | result = m6502_sound_r(space, offset); | |
| 293 | 288 | break; |
| 294 | 289 | |
| 295 | 290 | case 0x004: /* /RDIO */ |
| r18571 | r18572 | |
| 311 | 306 | break; |
| 312 | 307 | |
| 313 | 308 | case 0x006: /* /IRQACK */ |
| 314 | | |
| 309 | m6502_irq_ack_r(space, 0); | |
| 315 | 310 | break; |
| 316 | 311 | |
| 317 | 312 | case 0x200: /* /VOICE */ |
| r18571 | r18572 | |
| 328 | 323 | |
| 329 | 324 | WRITE8_MEMBER(badlands_state::audio_io_w) |
| 330 | 325 | { |
| 331 | ||
| 332 | 326 | switch (offset & 0x206) |
| 333 | 327 | { |
| 334 | 328 | case 0x000: /* n/c */ |
| r18571 | r18572 | |
| 338 | 332 | break; |
| 339 | 333 | |
| 340 | 334 | case 0x006: /* /IRQACK */ |
| 341 | | |
| 335 | m6502_irq_ack_r(space, 0); | |
| 342 | 336 | break; |
| 343 | 337 | |
| 344 | 338 | case 0x200: /* n/c */ |
| r18571 | r18572 | |
| 346 | 340 | break; |
| 347 | 341 | |
| 348 | 342 | case 0x202: /* /WRP */ |
| 349 | | |
| 343 | m6502_sound_w(space, offset, data); | |
| 350 | 344 | break; |
| 351 | 345 | |
| 352 | 346 | case 0x204: /* WRIO */ |
| r18571 | r18572 | |
| 376 | 370 | |
| 377 | 371 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state ) |
| 378 | 372 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 379 | AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_WRITE | |
| 373 | AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_WRITE(sound_reset_w) | |
| 380 | 374 | AM_RANGE(0xfd0000, 0xfd1fff) AM_READWRITE_LEGACY(atarigen_eeprom_r, atarigen_eeprom_w) AM_SHARE("eeprom") |
| 381 | 375 | AM_RANGE(0xfe0000, 0xfe1fff) AM_WRITE(watchdog_reset16_w) |
| 382 | 376 | AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE_LEGACY(atarigen_video_int_ack_w) |
| r18571 | r18572 | |
| 385 | 379 | AM_RANGE(0xfe6002, 0xfe6003) AM_READ_PORT("FE6002") |
| 386 | 380 | AM_RANGE(0xfe6004, 0xfe6005) AM_READ(pedal_0_r) |
| 387 | 381 | AM_RANGE(0xfe6006, 0xfe6007) AM_READ(pedal_1_r) |
| 388 | AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE_LEGACY(atarigen_sound_upper_w) | |
| 389 | AM_RANGE(0xfea000, 0xfebfff) AM_READ_LEGACY(atarigen_sound_upper_r) | |
| 382 | AM_RANGE(0xfe8000, 0xfe9fff) AM_WRITE8(sound_w, 0xff00) | |
| 383 | AM_RANGE(0xfea000, 0xfebfff) AM_READ8(sound_r, 0xff00) | |
| 390 | 384 | AM_RANGE(0xfec000, 0xfedfff) AM_WRITE_LEGACY(badlands_pf_bank_w) |
| 391 | 385 | AM_RANGE(0xfee000, 0xfeffff) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 392 | 386 | AM_RANGE(0xffc000, 0xffc3ff) AM_RAM_WRITE_LEGACY(atarigen_expanded_666_paletteram_w) AM_SHARE("paletteram") |
| r18571 | r18572 | |
| 672 | 666 | GFXDECODE_ENTRY( "gfx2", 0, molayout, 128, 8 ) |
| 673 | 667 | GFXDECODE_END |
| 674 | 668 | |
| 675 | static void update_interrupts_bootleg(running_machine &machine) | |
| 676 | { | |
| 677 | badlands_state *state = machine.driver_data<badlands_state>(); | |
| 678 | machine.device("maincpu")->execute().set_input_line(1, state->m_video_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 679 | } | |
| 680 | 669 | |
| 681 | ||
| 682 | static void scanline_update_bootleg(screen_device &screen, int scanline) | |
| 683 | { | |
| 684 | /* sound IRQ is on 32V */ | |
| 685 | // if (scanline & 32) | |
| 686 | // atarigen_6502_irq_ack_r(screen.machine(), 0); | |
| 687 | // else if (!(machine.root_device().ioport("FE4000")->read() & 0x40)) | |
| 688 | // atarigen_6502_irq_gen(screen.machine().device("audiocpu")); | |
| 689 | } | |
| 690 | ||
| 691 | ||
| 692 | ||
| 693 | 670 | MACHINE_RESET_MEMBER(badlands_state,badlandsb) |
| 694 | 671 | { |
| 695 | 672 | // m_pedal_value[0] = m_pedal_value[1] = 0x80; |
| 696 | 673 | |
| 697 | atarigen_eeprom_reset(this); | |
| 698 | atarigen_interrupt_reset(this, update_interrupts_bootleg); | |
| 699 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update_bootleg, 32); | |
| 674 | atarigen_state::machine_reset(); | |
| 675 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 700 | 676 | |
| 701 | // atarigen_sound_io_reset(machine().device("audiocpu")); | |
| 702 | 677 | // memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000); |
| 703 | 678 | } |
| 704 | 679 |
| r18571 | r18572 | |
|---|---|---|
| 31 | 31 | * |
| 32 | 32 | *************************************/ |
| 33 | 33 | |
| 34 | ||
| 34 | void offtwall_state::update_interrupts() | |
| 35 | 35 | { |
| 36 | offtwall_state *state = machine.driver_data<offtwall_state>(); | |
| 37 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 38 | machine.device("maincpu")->execute().set_input_line(6, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 36 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 37 | subdevice("maincpu")->execute().set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | |
| r18571 | r18572 | |
| 46 | 45 | * |
| 47 | 46 | *************************************/ |
| 48 | 47 | |
| 49 | MACHINE_START_MEMBER(offtwall_state,offtwall) | |
| 50 | { | |
| 51 | atarigen_init(machine()); | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | 48 | MACHINE_RESET_MEMBER(offtwall_state,offtwall) |
| 56 | 49 | { |
| 57 | ||
| 58 | atarigen_eeprom_reset(this); | |
| 59 | atarigen_interrupt_reset(this, update_interrupts); | |
| 50 | atarigen_state::machine_reset(); | |
| 60 | 51 | atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 1); |
| 61 | atarijsa_reset(); | |
| 52 | atarijsa_reset(machine()); | |
| 62 | 53 | } |
| 63 | 54 | |
| 64 | 55 | |
| r18571 | r18572 | |
| 103 | 94 | { |
| 104 | 95 | /* bit 4 resets the sound CPU */ |
| 105 | 96 | machine().device("jsa")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); |
| 106 | if (!(data & 0x10)) atarijsa_reset(); | |
| 97 | if (!(data & 0x10)) atarijsa_reset(machine()); | |
| 107 | 98 | } |
| 108 | 99 | |
| 109 | 100 | logerror("sound control = %04X\n", data); |
| r18571 | r18572 | |
| 281 | 272 | AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020") |
| 282 | 273 | AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022") |
| 283 | 274 | AM_RANGE(0x260024, 0x260025) AM_READ_PORT("260024") |
| 284 | AM_RANGE(0x260030, 0x260031) AM_READ_LEGACY(atarigen_sound_r) | |
| 285 | AM_RANGE(0x260040, 0x260041) AM_WRITE_LEGACY(atarigen_sound_w) | |
| 275 | AM_RANGE(0x260030, 0x260031) AM_READ8(sound_r, 0x00ff) | |
| 276 | AM_RANGE(0x260040, 0x260041) AM_WRITE8(sound_w, 0x00ff) | |
| 286 | 277 | AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w) |
| 287 | 278 | AM_RANGE(0x260060, 0x260061) AM_WRITE_LEGACY(atarigen_eeprom_enable_w) |
| 288 | 279 | AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(watchdog_reset16_w) |
| r18571 | r18572 | |
| 404 | 395 | MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2) |
| 405 | 396 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 406 | 397 | |
| 407 | MCFG_MACHINE_START_OVERRIDE(offtwall_state,offtwall) | |
| 408 | 398 | MCFG_MACHINE_RESET_OVERRIDE(offtwall_state,offtwall) |
| 409 | 399 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 410 | 400 |
| r18571 | r18572 | |
|---|---|---|
| 39 | 39 | * |
| 40 | 40 | *************************************/ |
| 41 | 41 | |
| 42 | ||
| 42 | void rampart_state::update_interrupts() | |
| 43 | 43 | { |
| 44 | rampart_state *state = machine.driver_data<rampart_state>(); | |
| 45 | machine.device("maincpu")->execute().set_input_line(4, state->m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 44 | subdevice("maincpu")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); | |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | |
| 49 | ||
| 48 | void rampart_state::scanline_update(screen_device &screen, int scanline) | |
| 50 | 49 | { |
| 51 | 50 | /* generate 32V signals */ |
| 52 | 51 | if ((scanline & 32) == 0) |
| 53 | | |
| 52 | scanline_int_gen(*subdevice("maincpu")); | |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | 55 | |
| r18571 | r18572 | |
| 61 | 60 | * |
| 62 | 61 | *************************************/ |
| 63 | 62 | |
| 64 | MACHINE_START_MEMBER(rampart_state,rampart) | |
| 65 | { | |
| 66 | atarigen_init(machine()); | |
| 67 | } | |
| 68 | ||
| 69 | ||
| 70 | 63 | MACHINE_RESET_MEMBER(rampart_state,rampart) |
| 71 | 64 | { |
| 72 | ||
| 73 | atarigen_eeprom_reset(this); | |
| 74 | atarigen_slapstic_reset(this); | |
| 75 | atarigen_interrupt_reset(this, update_interrupts); | |
| 76 | atarigen_scanline_timer_reset(*machine().primary_screen, scanline_update, 32); | |
| 65 | atarigen_state::machine_reset(); | |
| 66 | scanline_timer_reset(*machine().primary_screen, 32); | |
| 77 | 67 | } |
| 78 | 68 | |
| 79 | 69 | |
| r18571 | r18572 | |
| 114 | 104 | /* lower byte being modified? */ |
| 115 | 105 | if (ACCESSING_BITS_0_7) |
| 116 | 106 | { |
| 117 | | |
| 107 | set_oki6295_volume((data & 0x0020) ? 100 : 0); | |
| 118 | 108 | if (!(data & 0x0010)) |
| 119 | 109 | machine().device("oki")->reset(); |
| 120 | | |
| 110 | set_ym2413_volume(((data >> 1) & 7) * 100 / 7); | |
| 121 | 111 | if (!(data & 0x0001)) |
| 122 | 112 | machine().device("ymsnd")->reset(); |
| 123 | 113 | } |
| r18571 | r18572 | |
| 155 | 145 | AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK2") |
| 156 | 146 | AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ_PORT("TRACK3") |
| 157 | 147 | AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_WRITE(watchdog_reset16_w) |
| 158 | AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE | |
| 148 | AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE(scanline_int_ack_w) | |
| 159 | 149 | ADDRESS_MAP_END |
| 160 | 150 | |
| 161 | 151 | |
| r18571 | r18572 | |
| 348 | 338 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 349 | 339 | MCFG_CPU_VBLANK_INT("screen", atarigen_video_int_gen) |
| 350 | 340 | |
| 351 | MCFG_MACHINE_START_OVERRIDE(rampart_state,rampart) | |
| 352 | 341 | MCFG_MACHINE_RESET_OVERRIDE(rampart_state,rampart) |
| 353 | 342 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 354 | 343 | MCFG_WATCHDOG_VBLANK_INIT(8) |
| r18571 | r18572 | |
| 481 | 470 | UINT8 *rom = machine().root_device().memregion("maincpu")->base(); |
| 482 | 471 | |
| 483 | 472 | memcpy(&rom[0x140000], &rom[0x40000], 0x8000); |
| 484 | | |
| 473 | slapstic_configure(*machine().device<cpu_device>("maincpu"), 0x140000, 0x438000, 118); | |
| 485 | 474 | } |
| 486 | 475 | |
| 487 | 476 |
| r18571 | r18572 | |
|---|---|---|
| 150 | 150 | jsacpu->space(AS_PROGRAM).install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey)); |
| 151 | 151 | |
| 152 | 152 | init_save_state(machine); |
| 153 | atarijsa_reset(); | |
| 153 | atarijsa_reset(machine); | |
| 154 | 154 | |
| 155 | 155 | /* initialize JSA III ADPCM */ |
| 156 | 156 | { |
| r18571 | r18572 | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | void atarijsa_reset( | |
| 178 | void atarijsa_reset(running_machine &machine) | |
| 179 | 179 | { |
| 180 | 180 | /* reset the sound I/O system */ |
| 181 | atarigen_sound_io_reset( | |
| 181 | machine.driver_data<atarigen_state>()->sound_io_reset(); | |
| 182 | 182 | |
| 183 | 183 | /* reset the static states */ |
| 184 | 184 | overall_volume = 100; |
| r18571 | r18572 | |
| 213 | 213 | break; |
| 214 | 214 | |
| 215 | 215 | case 0x002: /* /RDP */ |
| 216 | result = atarigen | |
| 216 | result = atarigen->m6502_sound_r(space, offset); | |
| 217 | 217 | break; |
| 218 | 218 | |
| 219 | 219 | case 0x004: /* /RDIO */ |
| r18571 | r18572 | |
| 238 | 238 | break; |
| 239 | 239 | |
| 240 | 240 | case 0x006: /* /IRQACK */ |
| 241 | atarigen | |
| 241 | atarigen->m6502_irq_ack_r(space, 0); | |
| 242 | 242 | break; |
| 243 | 243 | |
| 244 | 244 | case 0x200: /* /VOICE */ |
| r18571 | r18572 | |
| 264 | 264 | break; |
| 265 | 265 | |
| 266 | 266 | case 0x006: /* /IRQACK */ |
| 267 | atarigen_6502_irq_ack_r(space, 0); | |
| 267 | space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0); | |
| 268 | 268 | break; |
| 269 | 269 | |
| 270 | 270 | case 0x200: /* /VOICE */ |
| r18571 | r18572 | |
| 273 | 273 | break; |
| 274 | 274 | |
| 275 | 275 | case 0x202: /* /WRP */ |
| 276 | atarigen_6502_sound_w(space, offset, data); | |
| 276 | space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data); | |
| 277 | 277 | break; |
| 278 | 278 | |
| 279 | 279 | case 0x204: /* WRIO */ |
| r18571 | r18572 | |
| 346 | 346 | break; |
| 347 | 347 | |
| 348 | 348 | case 0x002: /* /RDP */ |
| 349 | result = atarigen | |
| 349 | result = atarigen->m6502_sound_r(space, offset); | |
| 350 | 350 | break; |
| 351 | 351 | |
| 352 | 352 | case 0x004: /* /RDIO */ |
| r18571 | r18572 | |
| 367 | 367 | break; |
| 368 | 368 | |
| 369 | 369 | case 0x006: /* /IRQACK */ |
| 370 | atarigen | |
| 370 | atarigen->m6502_irq_ack_r(space, 0); | |
| 371 | 371 | break; |
| 372 | 372 | |
| 373 | 373 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 393 | 393 | break; |
| 394 | 394 | |
| 395 | 395 | case 0x006: /* /IRQACK */ |
| 396 | atarigen_6502_irq_ack_r(space, 0); | |
| 396 | space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0); | |
| 397 | 397 | break; |
| 398 | 398 | |
| 399 | 399 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 404 | 404 | break; |
| 405 | 405 | |
| 406 | 406 | case 0x202: /* /WRP */ |
| 407 | atarigen_6502_sound_w(space, offset, data); | |
| 407 | space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data); | |
| 408 | 408 | break; |
| 409 | 409 | |
| 410 | 410 | case 0x204: /* /WRIO */ |
| r18571 | r18572 | |
| 469 | 469 | break; |
| 470 | 470 | |
| 471 | 471 | case 0x002: /* /RDP */ |
| 472 | result = atarigen | |
| 472 | result = atarigen->m6502_sound_r(space, offset); | |
| 473 | 473 | break; |
| 474 | 474 | |
| 475 | 475 | case 0x004: /* /RDIO */ |
| r18571 | r18572 | |
| 490 | 490 | break; |
| 491 | 491 | |
| 492 | 492 | case 0x006: /* /IRQACK */ |
| 493 | atarigen | |
| 493 | atarigen->m6502_irq_ack_r(space, 0); | |
| 494 | 494 | break; |
| 495 | 495 | |
| 496 | 496 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 520 | 520 | break; |
| 521 | 521 | |
| 522 | 522 | case 0x006: /* /IRQACK */ |
| 523 | atarigen_6502_irq_ack_r(space, 0); | |
| 523 | space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0); | |
| 524 | 524 | break; |
| 525 | 525 | |
| 526 | 526 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 529 | 529 | break; |
| 530 | 530 | |
| 531 | 531 | case 0x202: /* /WRP */ |
| 532 | atarigen_6502_sound_w(space, offset, data); | |
| 532 | space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data); | |
| 533 | 533 | break; |
| 534 | 534 | |
| 535 | 535 | case 0x204: /* /WRIO */ |
| r18571 | r18572 | |
| 603 | 603 | break; |
| 604 | 604 | |
| 605 | 605 | case 0x002: /* /RDP */ |
| 606 | result = atarigen | |
| 606 | result = atarigen->m6502_sound_r(space, offset); | |
| 607 | 607 | break; |
| 608 | 608 | |
| 609 | 609 | case 0x004: /* /RDIO */ |
| r18571 | r18572 | |
| 624 | 624 | break; |
| 625 | 625 | |
| 626 | 626 | case 0x006: /* /IRQACK */ |
| 627 | atarigen | |
| 627 | atarigen->m6502_irq_ack_r(space, 0); | |
| 628 | 628 | break; |
| 629 | 629 | |
| 630 | 630 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 654 | 654 | break; |
| 655 | 655 | |
| 656 | 656 | case 0x006: /* /IRQACK */ |
| 657 | atarigen_6502_irq_ack_r(space, 0); | |
| 657 | space.machine().driver_data<atarigen_state>()->m6502_irq_ack_r(space, 0); | |
| 658 | 658 | break; |
| 659 | 659 | |
| 660 | 660 | case 0x200: /* /WRV */ |
| r18571 | r18572 | |
| 663 | 663 | break; |
| 664 | 664 | |
| 665 | 665 | case 0x202: /* /WRP */ |
| 666 | atarigen_6502_sound_w(space, offset, data); | |
| 666 | space.machine().driver_data<atarigen_state>()->m6502_sound_w(space, offset, data); | |
| 667 | 667 | break; |
| 668 | 668 | |
| 669 | 669 | case 0x204: /* /WRIO */ |
| r18571 | r18572 | |
| 732 | 732 | |
| 733 | 733 | static void update_all_volumes(running_machine &machine ) |
| 734 | 734 | { |
| 735 | if (pokey != NULL) atarigen_set_pokey_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1); | |
| 735 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 736 | if (pokey != NULL) state->set_pokey_volume((overall_volume * pokey_volume / 100) * ym2151_ct1); | |
| 736 | 737 | //if (pokey != NULL) atarigen_set_pokey_stereo_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1, (overall_volume * pokey_volume / 100) * ym2151_ct2); |
| 737 | if (ym2151 != NULL) atarigen_set_ym2151_vol(machine, overall_volume * ym2151_volume / 100); | |
| 738 | if (tms5220 != NULL) atarigen_set_tms5220_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1); | |
| 738 | if (ym2151 != NULL) state->set_ym2151_volume(overall_volume * ym2151_volume / 100); | |
| 739 | if (tms5220 != NULL) state->set_tms5220_volume((overall_volume * tms5220_volume / 100) * ym2151_ct1); | |
| 739 | 740 | //if (tms5220 != NULL) atarigen_set_tms5220_stereo_vol(machine, (overall_volume * tms5220_volume / 100) * ym2151_ct1, (overall_volume * tms5220_volume / 100) * ym2151_ct2); |
| 740 | if (oki6295 != NULL || oki6295_l != NULL || oki6295_r != NULL) | |
| 741 | if (oki6295 != NULL || oki6295_l != NULL || oki6295_r != NULL) state->set_oki6295_volume(overall_volume * oki6295_volume / 100); | |
| 741 | 742 | } |
| 742 | 743 | |
| 743 | 744 | |
| r18571 | r18572 | |
| 794 | 795 | /* basic machine hardware */ |
| 795 | 796 | MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) |
| 796 | 797 | MCFG_CPU_PROGRAM_MAP(atarijsa1_map) |
| 797 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 798 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 798 | 799 | |
| 799 | 800 | /* sound hardware */ |
| 800 | 801 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r18571 | r18572 | |
| 838 | 839 | /* basic machine hardware */ |
| 839 | 840 | MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) |
| 840 | 841 | MCFG_CPU_PROGRAM_MAP(atarijsa1_map) |
| 841 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 842 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 842 | 843 | |
| 843 | 844 | /* sound hardware */ |
| 844 | 845 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r18571 | r18572 | |
| 860 | 861 | /* basic machine hardware */ |
| 861 | 862 | MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) |
| 862 | 863 | MCFG_CPU_PROGRAM_MAP(atarijsa2_map) |
| 863 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 864 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 864 | 865 | |
| 865 | 866 | /* sound hardware */ |
| 866 | 867 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r18571 | r18572 | |
| 904 | 905 | /* basic machine hardware */ |
| 905 | 906 | MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) |
| 906 | 907 | MCFG_CPU_PROGRAM_MAP(atarijsa3s_map) |
| 907 | MCFG_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 908 | MCFG_CPU_PERIODIC_INT_DRIVER(atarigen_state, m6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) | |
| 908 | 909 | |
| 909 | 910 | /* sound hardware */ |
| 910 | 911 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r18571 | r18572 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | void atarijsa_init(running_machine &machine, const char *testport, int testmask); |
| 9 | void atarijsa_reset( | |
| 9 | void atarijsa_reset(running_machine &machine); | |
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | MACHINE_CONFIG_EXTERN( jsa_i_stereo ); |
| r18571 | r18572 | |
|---|---|---|
| 64 | 64 | STATIC FUNCTION DECLARATIONS |
| 65 | 65 | ***************************************************************************/ |
| 66 | 66 | |
| 67 | static void slapstic_postload(running_machine &machine); | |
| 68 | ||
| 69 | static TIMER_CALLBACK( scanline_interrupt_callback ); | |
| 70 | ||
| 71 | static void update_6502_irq(running_machine &machine); | |
| 72 | static TIMER_CALLBACK( delayed_sound_reset ); | |
| 73 | static TIMER_CALLBACK( delayed_sound_w ); | |
| 74 | static TIMER_CALLBACK( delayed_6502_sound_w ); | |
| 75 | ||
| 76 | static void atarigen_set_vol(running_machine &machine, int volume, device_type type); | |
| 77 | ||
| 78 | static TIMER_CALLBACK( scanline_timer_callback ); | |
| 79 | ||
| 80 | 67 | static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newword); |
| 81 | 68 | |
| 82 | static TIMER_CALLBACK( unhalt_cpu ); | |
| 83 | 69 | |
| 84 | static TIMER_CALLBACK( atarivc_eof_update ); | |
| 85 | 70 | |
| 86 | ||
| 87 | ||
| 88 | 71 | /*************************************************************************** |
| 89 | 72 | INLINE FUNCTIONS |
| 90 | 73 | ***************************************************************************/ |
| 91 | 74 | |
| 92 | ||
| 75 | inline const atarigen_screen_timer *get_screen_timer(screen_device &screen) | |
| 93 | 76 | { |
| 94 | 77 | atarigen_state *state = screen.machine().driver_data<atarigen_state>(); |
| 95 | 78 | int i; |
| 96 | 79 | |
| 97 | / | |
| 80 | // find the index of the timer that matches the screen | |
| 98 | 81 | for (i = 0; i < ARRAY_LENGTH(state->m_screen_timer); i++) |
| 99 | 82 | if (state->m_screen_timer[i].screen == &screen) |
| 100 | 83 | return &state->m_screen_timer[i]; |
| r18571 | r18572 | |
| 109 | 92 | OVERALL INIT |
| 110 | 93 | ***************************************************************************/ |
| 111 | 94 | |
| 112 | void atarigen_init(running_machine &machine) | |
| 95 | atarigen_state::atarigen_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 96 | : driver_device(mconfig, type, tag), | |
| 97 | m_earom(*this, "earom"), | |
| 98 | m_earom_data(0), | |
| 99 | m_earom_control(0), | |
| 100 | m_eeprom(*this, "eeprom"), | |
| 101 | m_eeprom32(*this, "eeprom"), | |
| 102 | m_scanline_int_state(0), | |
| 103 | m_sound_int_state(0), | |
| 104 | m_video_int_state(0), | |
| 105 | m_eeprom_default(NULL), | |
| 106 | m_cpu_to_sound_ready(0), | |
| 107 | m_sound_to_cpu_ready(0), | |
| 108 | m_playfield(*this, "playfield"), | |
| 109 | m_playfield2(*this, "playfield2"), | |
| 110 | m_playfield_upper(*this, "playfield_up"), | |
| 111 | m_alpha(*this, "alpha"), | |
| 112 | m_alpha2(*this, "alpha2"), | |
| 113 | m_xscroll(*this, "xscroll"), | |
| 114 | m_yscroll(*this, "yscroll"), | |
| 115 | m_playfield32(*this, "playfield32"), | |
| 116 | m_alpha32(*this, "alpha32"), | |
| 117 | m_playfield_tilemap(NULL), | |
| 118 | m_playfield2_tilemap(NULL), | |
| 119 | m_alpha_tilemap(NULL), | |
| 120 | m_alpha2_tilemap(NULL), | |
| 121 | m_atarivc_data(*this, "atarivc_data"), | |
| 122 | m_atarivc_eof_data(*this, "atarivc_eof"), | |
| 123 | m_eeprom_unlocked(false), | |
| 124 | m_slapstic_num(0), | |
| 125 | m_slapstic(NULL), | |
| 126 | m_slapstic_bank(0), | |
| 127 | m_slapstic_last_pc(0), | |
| 128 | m_slapstic_last_address(0), | |
| 129 | m_slapstic_base(0), | |
| 130 | m_slapstic_mirror(0), | |
| 131 | m_sound_cpu(*this, "audiocpu"), | |
| 132 | m_cpu_to_sound(0), | |
| 133 | m_sound_to_cpu(0), | |
| 134 | m_timed_int(0), | |
| 135 | m_ym2151_int(0), | |
| 136 | m_scanlines_per_callback(0), | |
| 137 | m_actual_vc_latch0(0), | |
| 138 | m_actual_vc_latch1(0), | |
| 139 | m_atarivc_playfields(0), | |
| 140 | m_playfield_latch(0), | |
| 141 | m_playfield2_latch(0) | |
| 113 | 142 | { |
| 114 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 143 | } | |
| 144 | ||
| 145 | void atarigen_state::machine_start() | |
| 146 | { | |
| 147 | // find the sound CPU, until JSA is moved to be independent | |
| 148 | if (m_sound_cpu == NULL) | |
| 149 | { | |
| 150 | device_t *device = subdevice("jsa"); | |
| 151 | if (device != NULL) | |
| 152 | m_sound_cpu.set_target(downcast<m6502_device *>(device)); | |
| 153 | } | |
| 154 | ||
| 115 | 155 | screen_device *screen; |
| 116 | 156 | int i; |
| 117 | 157 | |
| 118 | /* allocate timers for all screens */ | |
| 119 | screen_device_iterator iter(machine.root_device()); | |
| 120 | assert(iter.count() <= ARRAY_LENGTH(state->m_screen_timer)); | |
| 158 | // allocate timers for all screens | |
| 159 | screen_device_iterator iter(*this); | |
| 160 | assert(iter.count() <= ARRAY_LENGTH(m_screen_timer)); | |
| 121 | 161 | for (i = 0, screen = iter.first(); screen != NULL; i++, screen = iter.next()) |
| 122 | 162 | { |
| 123 | state->m_screen_timer[i].screen = screen; | |
| 124 | state->m_screen_timer[i].scanline_interrupt_timer = machine.scheduler().timer_alloc(FUNC(scanline_interrupt_callback), (void *)screen); | |
| 125 | state->m_screen_timer[i].scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_timer_callback), (void *)screen); | |
| 126 | state->m_screen_timer[i].atarivc_eof_update_timer = machine.scheduler().timer_alloc(FUNC(atarivc_eof_update), (void *)screen); | |
| 163 | m_screen_timer[i].screen = screen; | |
| 164 | m_screen_timer[i].scanline_interrupt_timer = timer_alloc(TID_SCANLINE_INTERRUPT, (void *)screen); | |
| 165 | m_screen_timer[i].scanline_timer = timer_alloc(TID_SCANLINE_TIMER, (void *)screen); | |
| 166 | m_screen_timer[i].atarivc_eof_update_timer = timer_alloc(TID_ATARIVC_EOF, (void *)screen); | |
| 127 | 167 | } |
| 128 | 168 | |
| 129 | state->save_item(NAME(state->m_scanline_int_state)); | |
| 130 | state->save_item(NAME(state->m_sound_int_state)); | |
| 131 | state->save_item(NAME(state->m_video_int_state)); | |
| 169 | save_item(NAME(m_scanline_int_state)); | |
| 170 | save_item(NAME(m_sound_int_state)); | |
| 171 | save_item(NAME(m_video_int_state)); | |
| 132 | 172 | |
| 133 | state->save_item(NAME(state->m_cpu_to_sound_ready)); | |
| 134 | state->save_item(NAME(state->m_sound_to_cpu_ready)); | |
| 173 | save_item(NAME(m_cpu_to_sound_ready)); | |
| 174 | save_item(NAME(m_sound_to_cpu_ready)); | |
| 135 | 175 | |
| 136 | state->save_item(NAME(state->m_atarivc_state.latch1)); /* latch #1 value (-1 means disabled) */ | |
| 137 | state->save_item(NAME(state->m_atarivc_state.latch2)); /* latch #2 value (-1 means disabled) */ | |
| 138 | state->save_item(NAME(state->m_atarivc_state.rowscroll_enable)); /* true if row-scrolling is enabled */ | |
| 139 | state->save_item(NAME(state->m_atarivc_state.palette_bank)); /* which palette bank is enabled */ | |
| 140 | state->save_item(NAME(state->m_atarivc_state.pf0_xscroll)); /* playfield 1 xscroll */ | |
| 141 | state->save_item(NAME(state->m_atarivc_state.pf0_xscroll_raw)); /* playfield 1 xscroll raw value */ | |
| 142 | state->save_item(NAME(state->m_atarivc_state.pf0_yscroll)); /* playfield 1 yscroll */ | |
| 143 | state->save_item(NAME(state->m_atarivc_state.pf1_xscroll)); /* playfield 2 xscroll */ | |
| 144 | state->save_item(NAME(state->m_atarivc_state.pf1_xscroll_raw)); /* playfield 2 xscroll raw value */ | |
| 145 | state->save_item(NAME(state->m_atarivc_state.pf1_yscroll)); /* playfield 2 yscroll */ | |
| 146 | state->save_item(NAME(state->m_atarivc_state.mo_xscroll)); /* sprite xscroll */ | |
| 147 | state->save_item(NAME(state->m_atarivc_state.mo_yscroll)); /* sprite xscroll */ | |
| 176 | save_item(NAME(m_atarivc_state.latch1)); // latch #1 value (-1 means disabled) | |
| 177 | save_item(NAME(m_atarivc_state.latch2)); // latch #2 value (-1 means disabled) | |
| 178 | save_item(NAME(m_atarivc_state.rowscroll_enable)); // true if row-scrolling is enabled | |
| 179 | save_item(NAME(m_atarivc_state.palette_bank)); // which palette bank is enabled | |
| 180 | save_item(NAME(m_atarivc_state.pf0_xscroll)); // playfield 1 xscroll | |
| 181 | save_item(NAME(m_atarivc_state.pf0_xscroll_raw)); // playfield 1 xscroll raw value | |
| 182 | save_item(NAME(m_atarivc_state.pf0_yscroll)); // playfield 1 yscroll | |
| 183 | save_item(NAME(m_atarivc_state.pf1_xscroll)); // playfield 2 xscroll | |
| 184 | save_item(NAME(m_atarivc_state.pf1_xscroll_raw)); // playfield 2 xscroll raw value | |
| 185 | save_item(NAME(m_atarivc_state.pf1_yscroll)); // playfield 2 yscroll | |
| 186 | save_item(NAME(m_atarivc_state.mo_xscroll)); // sprite xscroll | |
| 187 | save_item(NAME(m_atarivc_state.mo_yscroll)); // sprite xscroll | |
| 148 | 188 | |
| 149 | s | |
| 189 | save_item(NAME(m_eeprom_unlocked)); | |
| 150 | 190 | |
| 151 | state->save_item(NAME(state->m_slapstic_num)); | |
| 152 | state->save_item(NAME(state->m_slapstic_bank)); | |
| 153 | state->save_item(NAME(state->m_slapstic_last_pc)); | |
| 154 | state->save_item(NAME(state->m_slapstic_last_address)); | |
| 191 | save_item(NAME(m_slapstic_num)); | |
| 192 | save_item(NAME(m_slapstic_bank)); | |
| 193 | save_item(NAME(m_slapstic_last_pc)); | |
| 194 | save_item(NAME(m_slapstic_last_address)); | |
| 155 | 195 | |
| 156 | state->save_item(NAME(state->m_cpu_to_sound)); | |
| 157 | state->save_item(NAME(state->m_sound_to_cpu)); | |
| 158 | state->save_item(NAME(state->m_timed_int)); | |
| 159 | state->save_item(NAME(state->m_ym2151_int)); | |
| 196 | save_item(NAME(m_cpu_to_sound)); | |
| 197 | save_item(NAME(m_sound_to_cpu)); | |
| 198 | save_item(NAME(m_timed_int)); | |
| 199 | save_item(NAME(m_ym2151_int)); | |
| 160 | 200 | |
| 161 | s | |
| 201 | save_item(NAME(m_scanlines_per_callback)); | |
| 162 | 202 | |
| 163 | state->save_item(NAME(state->m_actual_vc_latch0)); | |
| 164 | state->save_item(NAME(state->m_actual_vc_latch1)); | |
| 203 | save_item(NAME(m_actual_vc_latch0)); | |
| 204 | save_item(NAME(m_actual_vc_latch1)); | |
| 165 | 205 | |
| 166 | state->save_item(NAME(state->m_playfield_latch)); | |
| 167 | state->save_item(NAME(state->m_playfield2_latch)); | |
| 206 | save_item(NAME(m_playfield_latch)); | |
| 207 | save_item(NAME(m_playfield2_latch)); | |
| 168 | 208 | |
| 169 | /* need a postload to reset the state */ | |
| 170 | machine.save().register_postload(save_prepost_delegate(FUNC(slapstic_postload), &machine)); | |
| 209 | save_item(NAME(m_earom_data)); | |
| 210 | save_item(NAME(m_earom_control)); | |
| 171 | 211 | } |
| 172 | 212 | |
| 173 | 213 | |
| 214 | void atarigen_state::machine_reset() | |
| 215 | { | |
| 216 | // reset the interrupt states | |
| 217 | m_video_int_state = m_sound_int_state = m_scanline_int_state = 0; | |
| 174 | 218 | |
| 175 | /*************************************************************************** | |
| 176 | INTERRUPT HANDLING | |
| 177 | ***************************************************************************/ | |
| 219 | // reset the control latch on the EAROM, if present | |
| 220 | if (m_earom != NULL) | |
| 221 | m_earom->set_control(0, 1, 1, 0, 0); | |
| 178 | 222 | |
| 179 | /*--------------------------------------------------------------- | |
| 180 | atarigen_interrupt_reset: Initializes the state of all | |
| 181 | the interrupt sources. | |
| 182 | ---------------------------------------------------------------*/ | |
| 223 | // reset the EEPROM | |
| 224 | m_eeprom_unlocked = false; | |
| 225 | if (m_eeprom == NULL && m_eeprom32 != NULL) | |
| 226 | m_eeprom.set_target(reinterpret_cast<UINT16 *>(m_eeprom32.target()), m_eeprom32.bytes()); | |
| 183 | 227 | |
| 184 | void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int) | |
| 185 | { | |
| 186 | /* set the callback */ | |
| 187 | state->m_update_int_callback = update_int; | |
| 188 | ||
| 189 | /* reset the interrupt states */ | |
| 190 | state->m_video_int_state = state->m_sound_int_state = state->m_scanline_int_state = 0; | |
| 228 | // reset the slapstic | |
| 229 | if (m_slapstic_num != 0) | |
| 230 | { | |
| 231 | slapstic_reset(); | |
| 232 | slapstic_update_bank(slapstic_bank()); | |
| 233 | } | |
| 234 | ||
| 235 | // reset sound I/O | |
| 236 | sound_io_reset(); | |
| 191 | 237 | } |
| 192 | 238 | |
| 193 | 239 | |
| 194 | /*--------------------------------------------------------------- | |
| 195 | atarigen_update_interrupts: Forces the interrupt callback | |
| 196 | to be called with the current VBLANK and sound interrupt | |
| 197 | states. | |
| 198 | ---------------------------------------------------------------*/ | |
| 199 | ||
| 200 | void atarigen_update_interrupts(running_machine &machine) | |
| 240 | void atarigen_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 201 | 241 | { |
| 202 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 203 | (*state->m_update_int_callback)(machine); | |
| 242 | switch (id) | |
| 243 | { | |
| 244 | case TID_SCANLINE_INTERRUPT: | |
| 245 | { | |
| 246 | scanline_int_gen(*machine().device("maincpu")); | |
| 247 | screen_device *screen = reinterpret_cast<screen_device *>(ptr); | |
| 248 | timer.adjust(screen->frame_period()); | |
| 249 | break; | |
| 250 | } | |
| 251 | ||
| 252 | case TID_SCANLINE_TIMER: | |
| 253 | scanline_timer(timer, *reinterpret_cast<screen_device *>(ptr), param); | |
| 254 | break; | |
| 255 | ||
| 256 | case TID_ATARIVC_EOF: | |
| 257 | atarivc_eof_update(timer, *reinterpret_cast<screen_device *>(ptr)); | |
| 258 | break; | |
| 259 | ||
| 260 | // sound I/O | |
| 261 | case TID_SOUND_RESET: | |
| 262 | delayed_sound_reset(param); | |
| 263 | break; | |
| 264 | ||
| 265 | case TID_SOUND_WRITE: | |
| 266 | delayed_sound_write(param); | |
| 267 | break; | |
| 268 | ||
| 269 | case TID_6502_WRITE: | |
| 270 | delayed_6502_write(param); | |
| 271 | break; | |
| 272 | ||
| 273 | // unhalt the CPU that was passed as a pointer | |
| 274 | case TID_UNHALT_CPU: | |
| 275 | reinterpret_cast<device_t *>(ptr)->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 276 | break; | |
| 277 | } | |
| 204 | 278 | } |
| 205 | 279 | |
| 206 | 280 | |
| 207 | /*--------------------------------------------------------------- | |
| 208 | atarigen_scanline_int_set: Sets the scanline when the next | |
| 209 | scanline interrupt should be generated. | |
| 210 | ---------------------------------------------------------------*/ | |
| 211 | ||
| 212 | void atarigen_scanline_int_set(screen_device &screen, int scanline) | |
| 281 | void atarigen_state::scanline_update(screen_device &screen, int scanline) | |
| 213 | 282 | { |
| 214 | emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; | |
| 215 | timer->adjust(screen.time_until_pos(scanline)); | |
| 216 | 283 | } |
| 217 | 284 | |
| 218 | 285 | |
| 219 | /*--------------------------------------------------------------- | |
| 220 | atarigen_scanline_int_gen: Standard interrupt routine | |
| 221 | which sets the scanline interrupt state. | |
| 222 | ---------------------------------------------------------------*/ | |
| 286 | /*************************************************************************** | |
| 287 | INTERRUPT HANDLING | |
| 288 | ***************************************************************************/ | |
| 223 | 289 | |
| 224 | INTERRUPT_GEN( atarigen_scanline_int_gen ) | |
| 290 | //------------------------------------------------- | |
| 291 | // scanline_int_set: Sets the scanline when the next | |
| 292 | // scanline interrupt should be generated. | |
| 293 | //------------------------------------------------- | |
| 294 | ||
| 295 | void atarigen_state::scanline_int_set(screen_device &screen, int scanline) | |
| 225 | 296 | { |
| 226 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); | |
| 227 | state->m_scanline_int_state = 1; | |
| 228 | (*state->m_update_int_callback)(device->machine()); | |
| 297 | get_screen_timer(screen)->scanline_interrupt_timer->adjust(screen.time_until_pos(scanline)); | |
| 229 | 298 | } |
| 230 | 299 | |
| 231 | 300 | |
| 232 | /*--------------------------------------------------------------- | |
| 233 | atarigen_scanline_int_ack_w: Resets the state of the | |
| 234 | scanline interrupt. | |
| 235 | ---------------------------------------------------------------*/ | |
| 301 | //------------------------------------------------- | |
| 302 | // scanline_int_gen: Standard interrupt routine | |
| 303 | // which sets the scanline interrupt state. | |
| 304 | //------------------------------------------------- | |
| 236 | 305 | |
| 237 | ||
| 306 | INTERRUPT_GEN_MEMBER(atarigen_state::scanline_int_gen) | |
| 238 | 307 | { |
| 239 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 240 | state->m_scanline_int_state = 0; | |
| 241 | (*state->m_update_int_callback)(space.machine()); | |
| 308 | m_scanline_int_state = 1; | |
| 309 | update_interrupts(); | |
| 242 | 310 | } |
| 243 | 311 | |
| 244 | WRITE32_HANDLER( atarigen_scanline_int_ack32_w ) | |
| 312 | ||
| 313 | //------------------------------------------------- | |
| 314 | // scanline_int_ack_w: Resets the state of the | |
| 315 | // scanline interrupt. | |
| 316 | //------------------------------------------------- | |
| 317 | ||
| 318 | WRITE16_MEMBER(atarigen_state::scanline_int_ack_w) | |
| 245 | 319 | { |
| 246 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 247 | state->m_scanline_int_state = 0; | |
| 248 | (*state->m_update_int_callback)(space.machine()); | |
| 320 | m_scanline_int_state = 0; | |
| 321 | update_interrupts(); | |
| 249 | 322 | } |
| 250 | 323 | |
| 251 | 324 | |
| 252 | /*--------------------------------------------------------------- | |
| 253 | atarigen_sound_int_gen: Standard interrupt routine which | |
| 254 | sets the sound interrupt state. | |
| 255 | ---------------------------------------------------------------*/ | |
| 325 | //------------------------------------------------- | |
| 326 | // atarigen_sound_int_gen: Standard interrupt routine which | |
| 327 | // sets the sound interrupt state. | |
| 328 | //------------------------------------------------- | |
| 256 | 329 | |
| 257 | 330 | INTERRUPT_GEN( atarigen_sound_int_gen ) |
| 258 | 331 | { |
| 259 | 332 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); |
| 260 | 333 | state->m_sound_int_state = 1; |
| 261 | | |
| 334 | state->update_interrupts(); | |
| 262 | 335 | } |
| 263 | 336 | |
| 264 | 337 | |
| 265 | /*--------------------------------------------------------------- | |
| 266 | atarigen_sound_int_ack_w: Resets the state of the sound | |
| 267 | interrupt. | |
| 268 | ---------------------------------------------------------------*/ | |
| 338 | //------------------------------------------------- | |
| 339 | // atarigen_sound_int_ack_w: Resets the state of the sound | |
| 340 | // interrupt. | |
| 341 | //------------------------------------------------- | |
| 269 | 342 | |
| 270 | 343 | WRITE16_HANDLER( atarigen_sound_int_ack_w ) |
| 271 | 344 | { |
| 272 | 345 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 273 | 346 | state->m_sound_int_state = 0; |
| 274 | | |
| 347 | state->update_interrupts(); | |
| 275 | 348 | } |
| 276 | 349 | |
| 277 | 350 | WRITE32_HANDLER( atarigen_sound_int_ack32_w ) |
| 278 | 351 | { |
| 279 | 352 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 280 | 353 | state->m_sound_int_state = 0; |
| 281 | | |
| 354 | state->update_interrupts(); | |
| 282 | 355 | } |
| 283 | 356 | |
| 284 | 357 | |
| 285 | /*--------------------------------------------------------------- | |
| 286 | atarigen_video_int_gen: Standard interrupt routine which | |
| 287 | sets the video interrupt state. | |
| 288 | ---------------------------------------------------------------*/ | |
| 358 | //------------------------------------------------- | |
| 359 | // atarigen_video_int_gen: Standard interrupt routine which | |
| 360 | // sets the video interrupt state. | |
| 361 | //------------------------------------------------- | |
| 289 | 362 | |
| 290 | 363 | INTERRUPT_GEN( atarigen_video_int_gen ) |
| 291 | 364 | { |
| 292 | 365 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); |
| 293 | 366 | state->m_video_int_state = 1; |
| 294 | | |
| 367 | state->update_interrupts(); | |
| 295 | 368 | } |
| 296 | 369 | |
| 297 | 370 | |
| 298 | /*--------------------------------------------------------------- | |
| 299 | atarigen_video_int_ack_w: Resets the state of the video | |
| 300 | interrupt. | |
| 301 | ---------------------------------------------------------------*/ | |
| 371 | //------------------------------------------------- | |
| 372 | // atarigen_video_int_ack_w: Resets the state of the video | |
| 373 | // interrupt. | |
| 374 | //------------------------------------------------- | |
| 302 | 375 | |
| 303 | 376 | WRITE16_HANDLER( atarigen_video_int_ack_w ) |
| 304 | 377 | { |
| 305 | 378 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 306 | 379 | state->m_video_int_state = 0; |
| 307 | | |
| 380 | state->update_interrupts(); | |
| 308 | 381 | } |
| 309 | 382 | |
| 310 | 383 | WRITE32_HANDLER( atarigen_video_int_ack32_w ) |
| 311 | 384 | { |
| 312 | 385 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 313 | 386 | state->m_video_int_state = 0; |
| 314 | | |
| 387 | state->update_interrupts(); | |
| 315 | 388 | } |
| 316 | 389 | |
| 317 | 390 | |
| 318 | /*--------------------------------------------------------------- | |
| 319 | scanline_interrupt_callback: Signals an interrupt. | |
| 320 | ---------------------------------------------------------------*/ | |
| 321 | 391 | |
| 322 | static TIMER_CALLBACK( scanline_interrupt_callback ) | |
| 323 | { | |
| 324 | screen_device &screen = *reinterpret_cast<screen_device *>(ptr); | |
| 325 | emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; | |
| 326 | ||
| 327 | /* generate the interrupt */ | |
| 328 | atarigen_scanline_int_gen(machine.device("maincpu")); | |
| 329 | ||
| 330 | /* set a new timer to go off at the same scan line next frame */ | |
| 331 | timer->adjust(screen.frame_period()); | |
| 332 | } | |
| 333 | ||
| 334 | ||
| 335 | ||
| 336 | 392 | /*************************************************************************** |
| 337 | 393 | EEPROM HANDLING |
| 338 | 394 | ***************************************************************************/ |
| 339 | 395 | |
| 340 | /*--------------------------------------------------------------- | |
| 341 | atarigen_eeprom_reset: Makes sure that the unlocked state | |
| 342 | is cleared when we reset. | |
| 343 | ---------------------------------------------------------------*/ | |
| 396 | //------------------------------------------------- | |
| 397 | // atarigen_eeprom_enable_w: Any write to this handler will | |
| 398 | // allow one byte to be written to the EEPROM data area the | |
| 399 | // next time. | |
| 400 | //------------------------------------------------- | |
| 344 | 401 | |
| 345 | void atarigen_eeprom_reset(atarigen_state *state) | |
| 346 | { | |
| 347 | state->m_eeprom_unlocked = 0; | |
| 348 | if (state->m_eeprom == NULL && state->m_eeprom32 != NULL) | |
| 349 | state->m_eeprom.set_target(reinterpret_cast<UINT16 *>(state->m_eeprom32.target()), state->m_eeprom32.bytes()); | |
| 350 | } | |
| 351 | ||
| 352 | ||
| 353 | /*--------------------------------------------------------------- | |
| 354 | atarigen_eeprom_enable_w: Any write to this handler will | |
| 355 | allow one byte to be written to the EEPROM data area the | |
| 356 | next time. | |
| 357 | ---------------------------------------------------------------*/ | |
| 358 | ||
| 359 | 402 | WRITE16_HANDLER( atarigen_eeprom_enable_w ) |
| 360 | 403 | { |
| 361 | 404 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 362 | state->m_eeprom_unlocked = | |
| 405 | state->m_eeprom_unlocked = true; | |
| 363 | 406 | } |
| 364 | 407 | |
| 365 | 408 | WRITE32_HANDLER( atarigen_eeprom_enable32_w ) |
| 366 | 409 | { |
| 367 | 410 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); |
| 368 | state->m_eeprom_unlocked = | |
| 411 | state->m_eeprom_unlocked = true; | |
| 369 | 412 | } |
| 370 | 413 | |
| 371 | 414 | |
| 372 | /*--------------------------------------------------------------- | |
| 373 | atarigen_eeprom_w: Writes a "word" to the EEPROM, which is | |
| 374 | almost always accessed via the low byte of the word only. | |
| 375 | If the EEPROM hasn't been unlocked, the write attempt is | |
| 376 | ignored. | |
| 377 | ---------------------------------------------------------------*/ | |
| 415 | //------------------------------------------------- | |
| 416 | // atarigen_eeprom_w: Writes a "word" to the EEPROM, which is | |
| 417 | // almost always accessed via the low byte of the word only. | |
| 418 | // If the EEPROM hasn't been unlocked, the write attempt is | |
| 419 | // ignored. | |
| 420 | //------------------------------------------------- | |
| 378 | 421 | |
| 379 | 422 | WRITE16_HANDLER( atarigen_eeprom_w ) |
| 380 | 423 | { |
| r18571 | r18572 | |
| 384 | 427 | return; |
| 385 | 428 | |
| 386 | 429 | COMBINE_DATA(&state->m_eeprom[offset]); |
| 387 | state->m_eeprom_unlocked = | |
| 430 | state->m_eeprom_unlocked = false; | |
| 388 | 431 | } |
| 389 | 432 | |
| 390 | 433 | WRITE32_HANDLER( atarigen_eeprom32_w ) |
| r18571 | r18572 | |
| 398 | 441 | data >>= 16; |
| 399 | 442 | mem_mask >>= 16; |
| 400 | 443 | COMBINE_DATA(&state->m_eeprom[offset * 2]); |
| 401 | state->m_eeprom_unlocked = | |
| 444 | state->m_eeprom_unlocked = false; | |
| 402 | 445 | } |
| 403 | 446 | |
| 404 | 447 | |
| 405 | /*--------------------------------------------------------------- | |
| 406 | atarigen_eeprom_r: Reads a "word" from the EEPROM, which is | |
| 407 | almost always accessed via the low byte of the word only. | |
| 408 | ---------------------------------------------------------------*/ | |
| 448 | //------------------------------------------------- | |
| 449 | // atarigen_eeprom_r: Reads a "word" from the EEPROM, which is | |
| 450 | // almost always accessed via the low byte of the word only. | |
| 451 | //------------------------------------------------- | |
| 409 | 452 | |
| 410 | 453 | READ16_HANDLER( atarigen_eeprom_r ) |
| 411 | 454 | { |
| r18571 | r18572 | |
| 431 | 474 | SLAPSTIC HANDLING |
| 432 | 475 | ***************************************************************************/ |
| 433 | 476 | |
| 434 | ||
| 477 | inline void atarigen_state::slapstic_update_bank(int bank) | |
| 435 | 478 | { |
| 436 | /* if the bank has changed, copy the memory; Pit Fighter needs this */ | |
| 437 | if (bank != state->m_slapstic_bank) | |
| 479 | // if the bank has changed, copy the memory; Pit Fighter needs this | |
| 480 | if (bank != m_slapstic_bank) | |
| 438 | 481 | { |
| 439 | / | |
| 482 | // bank 0 comes from the copy we made earlier | |
| 440 | 483 | if (bank == 0) |
| 441 | memcpy( | |
| 484 | memcpy(m_slapstic, m_slapstic_bank0, 0x2000); | |
| 442 | 485 | else |
| 443 | memcpy( | |
| 486 | memcpy(m_slapstic, &m_slapstic[bank * 0x1000], 0x2000); | |
| 444 | 487 | |
| 445 | /* remember the current bank */ | |
| 446 | state->m_slapstic_bank = bank; | |
| 488 | // remember the current bank | |
| 489 | m_slapstic_bank = bank; | |
| 447 | 490 | } |
| 448 | 491 | } |
| 449 | 492 | |
| 450 | 493 | |
| 451 | ||
| 494 | void atarigen_state::device_post_load() | |
| 452 | 495 | { |
| 453 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 454 | update_bank(state, slapstic_bank()); | |
| 496 | slapstic_update_bank(slapstic_bank()); | |
| 455 | 497 | } |
| 456 | 498 | |
| 457 | 499 | |
| 458 | DIRECT_UPDATE_MEMBER(atarigen_state:: | |
| 500 | DIRECT_UPDATE_MEMBER(atarigen_state::slapstic_setdirect) | |
| 459 | 501 | { |
| 460 | /* if we jump to an address in the slapstic region, tweak the slapstic | |
| 461 | at that address and return ~0; this will cause us to be called on | |
| 462 | subsequent fetches as well */ | |
| 502 | // if we jump to an address in the slapstic region, tweak the slapstic | |
| 503 | // at that address and return ~0; this will cause us to be called on | |
| 504 | // subsequent fetches as well | |
| 463 | 505 | address &= ~m_slapstic_mirror; |
| 464 | 506 | if (address >= m_slapstic_base && address < m_slapstic_base + 0x8000) |
| 465 | 507 | { |
| r18571 | r18572 | |
| 468 | 510 | { |
| 469 | 511 | m_slapstic_last_pc = pc; |
| 470 | 512 | m_slapstic_last_address = address; |
| 471 | | |
| 513 | slapstic_r(direct.space(), (address >> 1) & 0x3fff, 0xffff); | |
| 472 | 514 | } |
| 473 | 515 | return ~0; |
| 474 | 516 | } |
| 475 | ||
| 476 | 517 | return address; |
| 477 | 518 | } |
| 478 | 519 | |
| 479 | 520 | |
| 480 | 521 | |
| 481 | /*--------------------------------------------------------------- | |
| 482 | atarigen_slapstic_init: Installs memory handlers for the | |
| 483 | slapstic and sets the chip number. | |
| 484 | ---------------------------------------------------------------*/ | |
| 522 | //------------------------------------------------- | |
| 523 | // slapstic_configure: Installs memory handlers for the | |
| 524 | // slapstic and sets the chip number. | |
| 525 | //------------------------------------------------- | |
| 485 | 526 | |
| 486 | void atarigen_slapstic_ | |
| 527 | void atarigen_state::slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, int chipnum) | |
| 487 | 528 | { |
| 488 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); | |
| 529 | // reset in case we have no state | |
| 530 | m_slapstic_num = chipnum; | |
| 531 | m_slapstic = NULL; | |
| 489 | 532 | |
| 490 | /* reset in case we have no state */ | |
| 491 | state->m_slapstic_num = chipnum; | |
| 492 | state->m_slapstic = NULL; | |
| 493 | ||
| 494 | /* if we have a chip, install it */ | |
| 533 | // if we have a chip, install it | |
| 495 | 534 | if (chipnum != 0) |
| 496 | 535 | { |
| 497 | /* initialize the slapstic */ | |
| 498 | slapstic_init(device->machine(), chipnum); | |
| 536 | // initialize the slapstic | |
| 537 | slapstic_init(machine(), chipnum); | |
| 499 | 538 | |
| 500 | /* install the memory handlers */ | |
| 501 | state->m_slapstic = device->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(base, base + 0x7fff, 0, mirror, FUNC(atarigen_slapstic_r), FUNC(atarigen_slapstic_w)); | |
| 539 | // install the memory handlers | |
| 540 | address_space &program = device.space(AS_PROGRAM); | |
| 541 | m_slapstic = program.install_readwrite_handler(base, base + 0x7fff, 0, mirror, read16_delegate(FUNC(atarigen_state::slapstic_r), this), write16_delegate(FUNC(atarigen_state::slapstic_w), this)); | |
| 542 | program.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::slapstic_setdirect), this)); | |
| 502 | 543 | |
| 503 | /* allocate memory for a copy of bank 0 */ | |
| 504 | state->m_slapstic_bank0 = auto_alloc_array(device->machine(), UINT8, 0x2000); | |
| 505 | memcpy(state->m_slapstic_bank0, state->m_slapstic, 0x2000); | |
| 544 | // allocate memory for a copy of bank 0 | |
| 545 | m_slapstic_bank0.resize(0x2000); | |
| 546 | memcpy(m_slapstic_bank0, m_slapstic, 0x2000); | |
| 506 | 547 | |
| 507 | /* ensure we recopy memory for the bank */ | |
| 508 | state->m_slapstic_bank = 0xff; | |
| 548 | // ensure we recopy memory for the bank | |
| 549 | m_slapstic_bank = 0xff; | |
| 509 | 550 | |
| 510 | /* install an opcode base handler if we are a 68000 or variant */ | |
| 511 | state->m_slapstic_base = base; | |
| 512 | state->m_slapstic_mirror = mirror; | |
| 513 | ||
| 514 | address_space &space = device->memory().space(AS_PROGRAM); | |
| 515 | space.set_direct_update_handler(direct_update_delegate(FUNC(atarigen_state::atarigen_slapstic_setdirect), state)); | |
| 551 | // install an opcode base handler if we are a 68000 or variant | |
| 552 | m_slapstic_base = base; | |
| 553 | m_slapstic_mirror = mirror; | |
| 516 | 554 | } |
| 517 | 555 | } |
| 518 | 556 | |
| 519 | 557 | |
| 520 | /*--------------------------------------------------------------- | |
| 521 | atarigen_slapstic_reset: Makes the selected slapstic number | |
| 522 | active and resets its state. | |
| 523 | ---------------------------------------------------------------*/ | |
| 558 | //------------------------------------------------- | |
| 559 | // slapstic_w: Assuming that the slapstic sits in | |
| 560 | // ROM memory space, we just simply tweak the slapstic at this | |
| 561 | // address and do nothing more. | |
| 562 | //------------------------------------------------- | |
| 524 | 563 | |
| 525 | ||
| 564 | WRITE16_MEMBER(atarigen_state::slapstic_w) | |
| 526 | 565 | { |
| 527 | if (state->m_slapstic_num != 0) | |
| 528 | { | |
| 529 | slapstic_reset(); | |
| 530 | update_bank(state, slapstic_bank()); | |
| 531 | } | |
| 566 | slapstic_update_bank(slapstic_tweak(space, offset)); | |
| 532 | 567 | } |
| 533 | 568 | |
| 534 | 569 | |
| 535 | /*--------------------------------------------------------------- | |
| 536 | atarigen_slapstic_w: Assuming that the slapstic sits in | |
| 537 | ROM memory space, we just simply tweak the slapstic at this | |
| 538 | address and do nothing more. | |
| 539 | ---------------------------------------------------------------*/ | |
| 570 | //------------------------------------------------- | |
| 571 | // slapstic_r: Tweaks the slapstic at the appropriate | |
| 572 | // address and then reads a word from the underlying memory. | |
| 573 | //------------------------------------------------- | |
| 540 | 574 | |
| 541 | ||
| 575 | READ16_MEMBER(atarigen_state::slapstic_r) | |
| 542 | 576 | { |
| 543 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 544 | update_bank(state, slapstic_tweak(space, offset)); | |
| 545 | } | |
| 577 | // fetch the result from the current bank first | |
| 578 | int result = m_slapstic[offset & 0xfff]; | |
| 546 | 579 | |
| 547 | ||
| 548 | /*--------------------------------------------------------------- | |
| 549 | atarigen_slapstic_r: Tweaks the slapstic at the appropriate | |
| 550 | address and then reads a word from the underlying memory. | |
| 551 | ---------------------------------------------------------------*/ | |
| 552 | ||
| 553 | READ16_HANDLER( atarigen_slapstic_r ) | |
| 554 | { | |
| 555 | /* fetch the result from the current bank first */ | |
| 556 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 557 | int result = state->m_slapstic[offset & 0xfff]; | |
| 558 | ||
| 559 | /* then determine the new one */ | |
| 560 | update_bank(state, slapstic_tweak(space, offset)); | |
| 580 | // then determine the new one | |
| 581 | slapstic_update_bank(slapstic_tweak(space, offset)); | |
| 561 | 582 | return result; |
| 562 | 583 | } |
| 563 | 584 | |
| r18571 | r18572 | |
| 567 | 588 | SOUND I/O |
| 568 | 589 | ***************************************************************************/ |
| 569 | 590 | |
| 570 | /*--------------------------------------------------------------- | |
| 571 | atarigen_sound_io_reset: Resets the state of the sound I/O. | |
| 572 | ---------------------------------------------------------------*/ | |
| 591 | //------------------------------------------------- | |
| 592 | // sound_io_reset: Resets the state of the sound I/O. | |
| 593 | //------------------------------------------------- | |
| 573 | 594 | |
| 574 | void atarigen_sound_io_reset( | |
| 595 | void atarigen_state::sound_io_reset() | |
| 575 | 596 | { |
| 576 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); | |
| 597 | // reset the internal interrupts states | |
| 598 | m_timed_int = m_ym2151_int = 0; | |
| 577 | 599 | |
| 578 | /* remember which CPU is the sound CPU */ | |
| 579 | state->m_sound_cpu = device; | |
| 580 | ||
| 581 | /* reset the internal interrupts states */ | |
| 582 | state->m_timed_int = state->m_ym2151_int = 0; | |
| 583 | ||
| 584 | /* reset the sound I/O states */ | |
| 585 | state->m_cpu_to_sound = state->m_sound_to_cpu = 0; | |
| 586 | state->m_cpu_to_sound_ready = state->m_sound_to_cpu_ready = 0; | |
| 600 | // reset the sound I/O states | |
| 601 | m_cpu_to_sound = m_sound_to_cpu = 0; | |
| 602 | m_cpu_to_sound_ready = m_sound_to_cpu_ready = 0; | |
| 587 | 603 | } |
| 588 | 604 | |
| 589 | 605 | |
| 590 | /*--------------------------------------------------------------- | |
| 591 | atarigen_6502_irq_gen: Generates an IRQ signal to the 6502 | |
| 592 | sound processor. | |
| 593 | ---------------------------------------------------------------*/ | |
| 606 | //------------------------------------------------- | |
| 607 | // m6502_irq_gen: Generates an IRQ signal to the | |
| 608 | // 6502 sound processor. | |
| 609 | //------------------------------------------------- | |
| 594 | 610 | |
| 595 | INTERRUPT_GEN( | |
| 611 | INTERRUPT_GEN_MEMBER(atarigen_state::m6502_irq_gen) | |
| 596 | 612 | { |
| 597 | atarigen_state *state = device->machine().driver_data<atarigen_state>(); | |
| 598 | state->m_timed_int = 1; | |
| 599 | update_6502_irq(device->machine()); | |
| 613 | m_timed_int = 1; | |
| 614 | update_m6502_irq(); | |
| 600 | 615 | } |
| 601 | 616 | |
| 602 | 617 | |
| 603 | /*--------------------------------------------------------------- | |
| 604 | atarigen_6502_irq_ack_r: Resets the IRQ signal to the 6502 | |
| 605 | sound processor. Both reads and writes can be used. | |
| 606 | ---------------------------------------------------------------*/ | |
| 618 | //------------------------------------------------- | |
| 619 | // m6502_irq_ack_r: Resets the IRQ signal to the 6502 | |
| 620 | // sound processor. Both reads and writes can be used. | |
| 621 | //------------------------------------------------- | |
| 607 | 622 | |
| 608 | READ8_ | |
| 623 | READ8_MEMBER(atarigen_state::m6502_irq_ack_r) | |
| 609 | 624 | { |
| 610 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 611 | state->m_timed_int = 0; | |
| 612 | update_6502_irq(space.machine()); | |
| 625 | m_timed_int = 0; | |
| 626 | update_m6502_irq(); | |
| 613 | 627 | return 0; |
| 614 | 628 | } |
| 615 | 629 | |
| 616 | WRITE8_ | |
| 630 | WRITE8_MEMBER(atarigen_state::m6502_irq_ack_w) | |
| 617 | 631 | { |
| 618 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 619 | state->m_timed_int = 0; | |
| 620 | update_6502_irq(space.machine()); | |
| 632 | m_timed_int = 0; | |
| 633 | update_m6502_irq(); | |
| 621 | 634 | } |
| 622 | 635 | |
| 623 | 636 | |
| 624 | /*--------------------------------------------------------------- | |
| 625 | atarigen_ym2151_irq_gen: Sets the state of the YM2151's | |
| 626 | IRQ line. | |
| 627 | ---------------------------------------------------------------*/ | |
| 637 | //------------------------------------------------- | |
| 638 | // atarigen_ym2151_irq_gen: Sets the state of the YM2151's | |
| 639 | // IRQ line. | |
| 640 | //------------------------------------------------- | |
| 628 | 641 | |
| 629 | WRITE_LINE_MEMBER( | |
| 642 | WRITE_LINE_MEMBER(atarigen_state::ym2151_irq_gen) | |
| 630 | 643 | { |
| 631 | 644 | m_ym2151_int = state; |
| 632 | update_6502_irq( | |
| 645 | update_m6502_irq(); | |
| 633 | 646 | } |
| 634 | 647 | |
| 635 | 648 | |
| 636 | /*--------------------------------------------------------------- | |
| 637 | atarigen_sound_reset_w: Write handler which resets the | |
| 638 | sound CPU in response. | |
| 639 | ---------------------------------------------------------------*/ | |
| 649 | //------------------------------------------------- | |
| 650 | // sound_reset_w: Write handler which resets the | |
| 651 | // sound CPU in response. | |
| 652 | //------------------------------------------------- | |
| 640 | 653 | |
| 641 | WRITE16_ | |
| 654 | WRITE16_MEMBER(atarigen_state::sound_reset_w) | |
| 642 | 655 | { |
| 643 | s | |
| 656 | synchronize(TID_SOUND_RESET); | |
| 644 | 657 | } |
| 645 | 658 | |
| 646 | 659 | |
| 647 | /*--------------------------------------------------------------- | |
| 648 | atarigen_sound_reset: Resets the state of the sound CPU | |
| 649 | manually. | |
| 650 | ---------------------------------------------------------------*/ | |
| 660 | //------------------------------------------------- | |
| 661 | // sound_cpu_reset: Resets the state of the sound | |
| 662 | // CPU manually. | |
| 663 | //------------------------------------------------- | |
| 651 | 664 | |
| 652 | void atarigen_sound_reset( | |
| 665 | void atarigen_state::sound_cpu_reset() | |
| 653 | 666 | { |
| 654 | | |
| 667 | synchronize(TID_SOUND_RESET, 1); | |
| 655 | 668 | } |
| 656 | 669 | |
| 657 | 670 | |
| 658 | /*--------------------------------------------------------------- | |
| 659 | atarigen_sound_w: Handles communication from the main CPU | |
| 660 | to the sound CPU. Two versions are provided, one with the | |
| 661 | data byte in the low 8 bits, and one with the data byte in | |
| 662 | the upper 8 bits. | |
| 663 | ---------------------------------------------------------------*/ | |
| 671 | //------------------------------------------------- | |
| 672 | // atarigen_sound_w: Handles communication from the main CPU | |
| 673 | // to the sound CPU. Two versions are provided, one with the | |
| 674 | // data byte in the low 8 bits, and one with the data byte in | |
| 675 | // the upper 8 bits. | |
| 676 | //------------------------------------------------- | |
| 664 | 677 | |
| 665 | WRITE | |
| 678 | WRITE8_MEMBER(atarigen_state::sound_w) | |
| 666 | 679 | { |
| 667 | if (ACCESSING_BITS_0_7) | |
| 668 | space.machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff); | |
| 680 | synchronize(TID_SOUND_WRITE, data); | |
| 669 | 681 | } |
| 670 | 682 | |
| 671 | WRITE16_HANDLER( atarigen_sound_upper_w ) | |
| 672 | { | |
| 673 | if (ACCESSING_BITS_8_15) | |
| 674 | space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff); | |
| 675 | } | |
| 676 | 683 | |
| 677 | WRITE32_HANDLER( atarigen_sound_upper32_w ) | |
| 678 | { | |
| 679 | if (ACCESSING_BITS_24_31) | |
| 680 | space.machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff); | |
| 681 | } | |
| 684 | //------------------------------------------------- | |
| 685 | // sound_r: Handles reading data communicated from the | |
| 686 | // sound CPU to the main CPU. Two versions are provided, one | |
| 687 | // with the data byte in the low 8 bits, and one with the data | |
| 688 | // byte in the upper 8 bits. | |
| 689 | //------------------------------------------------- | |
| 682 | 690 | |
| 683 | ||
| 684 | /*--------------------------------------------------------------- | |
| 685 | atarigen_sound_r: Handles reading data communicated from the | |
| 686 | sound CPU to the main CPU. Two versions are provided, one | |
| 687 | with the data byte in the low 8 bits, and one with the data | |
| 688 | byte in the upper 8 bits. | |
| 689 | ---------------------------------------------------------------*/ | |
| 690 | ||
| 691 | READ16_HANDLER( atarigen_sound_r ) | |
| 691 | READ8_MEMBER(atarigen_state::sound_r) | |
| 692 | 692 | { |
| 693 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 694 | state->m_sound_to_cpu_ready = 0; | |
| 693 | m_sound_to_cpu_ready = 0; | |
| 695 | 694 | atarigen_sound_int_ack_w(space, 0, 0, 0xffff); |
| 696 | return | |
| 695 | return m_sound_to_cpu; | |
| 697 | 696 | } |
| 698 | 697 | |
| 699 | READ16_HANDLER( atarigen_sound_upper_r ) | |
| 700 | { | |
| 701 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 702 | state->m_sound_to_cpu_ready = 0; | |
| 703 | atarigen_sound_int_ack_w(space, 0, 0, 0xffff); | |
| 704 | return (state->m_sound_to_cpu << 8) | 0x00ff; | |
| 705 | } | |
| 706 | 698 | |
| 707 | READ32_HANDLER( atarigen_sound_upper32_r ) | |
| 708 | { | |
| 709 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 710 | state->m_sound_to_cpu_ready = 0; | |
| 711 | atarigen_sound_int_ack32_w(space, 0, 0, 0xffff); | |
| 712 | return (state->m_sound_to_cpu << 24) | 0x00ffffff; | |
| 713 | } | |
| 699 | //------------------------------------------------- | |
| 700 | // m6502_sound_w: Handles communication from the | |
| 701 | // sound CPU to the main CPU. | |
| 702 | //------------------------------------------------- | |
| 714 | 703 | |
| 715 | ||
| 716 | /*--------------------------------------------------------------- | |
| 717 | atarigen_6502_sound_w: Handles communication from the sound | |
| 718 | CPU to the main CPU. | |
| 719 | ---------------------------------------------------------------*/ | |
| 720 | ||
| 721 | WRITE8_HANDLER( atarigen_6502_sound_w ) | |
| 704 | WRITE8_MEMBER(atarigen_state::m6502_sound_w) | |
| 722 | 705 | { |
| 723 | s | |
| 706 | synchronize(TID_6502_WRITE, data); | |
| 724 | 707 | } |
| 725 | 708 | |
| 726 | 709 | |
| 727 | /*--------------------------------------------------------------- | |
| 728 | atarigen_6502_sound_r: Handles reading data communicated | |
| 729 | from the main CPU to the sound CPU. | |
| 730 | ---------------------------------------------------------------*/ | |
| 710 | //------------------------------------------------- | |
| 711 | // m6502_sound_r: Handles reading data | |
| 712 | // communicated from the main CPU to the sound | |
| 713 | // CPU. | |
| 714 | //------------------------------------------------- | |
| 731 | 715 | |
| 732 | READ8_ | |
| 716 | READ8_MEMBER(atarigen_state::m6502_sound_r) | |
| 733 | 717 | { |
| 734 | atarigen_state *state = space.machine().driver_data<atarigen_state>(); | |
| 735 | state->m_cpu_to_sound_ready = 0; | |
| 736 | state->m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
| 737 | return state->m_cpu_to_sound; | |
| 718 | m_cpu_to_sound_ready = 0; | |
| 719 | m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
| 720 | return m_cpu_to_sound; | |
| 738 | 721 | } |
| 739 | 722 | |
| 740 | 723 | |
| 741 | /*--------------------------------------------------------------- | |
| 742 | update_6502_irq: Called whenever the IRQ state changes. An | |
| 743 | interrupt is generated if either atarigen_6502_irq_gen() | |
| 744 | was called, or if the YM2151 generated an interrupt via | |
| 745 | the atarigen_ym2151_irq_gen() callback. | |
| 746 | ---------------------------------------------------------------*/ | |
| 724 | //------------------------------------------------- | |
| 725 | // update_m6502_irq: Called whenever the IRQ state changes. An | |
| 726 | // interrupt is generated if either m6502_irq_gen() | |
| 727 | // was called, or if the YM2151 generated an interrupt via | |
| 728 | // the atarigen_ym2151_irq_gen() callback. | |
| 729 | //------------------------------------------------- | |
| 747 | 730 | |
| 748 | ||
| 731 | void atarigen_state::update_m6502_irq() | |
| 749 | 732 | { |
| 750 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 751 | if (state->m_timed_int || state->m_ym2151_int) | |
| 752 | state->m_sound_cpu->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 733 | if (m_timed_int || m_ym2151_int) | |
| 734 | m_sound_cpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
| 753 | 735 | else |
| 754 | | |
| 736 | m_sound_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE); | |
| 755 | 737 | } |
| 756 | 738 | |
| 757 | 739 | |
| 758 | /*--------------------------------------------------------------- | |
| 759 | delayed_sound_reset: Synchronizes the sound reset command | |
| 760 | between the two CPUs. | |
| 761 | ---------------------------------------------------------------*/ | |
| 740 | //------------------------------------------------- | |
| 741 | // delayed_sound_reset: Synchronizes the sound reset command | |
| 742 | // between the two CPUs. | |
| 743 | //------------------------------------------------- | |
| 762 | 744 | |
| 763 | ||
| 745 | void atarigen_state::delayed_sound_reset(int param) | |
| 764 | 746 | { |
| 765 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 766 | address_space &space = state->m_sound_cpu->memory().space(AS_PROGRAM); | |
| 767 | ||
| 768 | /* unhalt and reset the sound CPU */ | |
| 747 | // unhalt and reset the sound CPU | |
| 769 | 748 | if (param == 0) |
| 770 | 749 | { |
| 771 | state->m_sound_cpu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 772 | state->m_sound_cpu->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 750 | m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 751 | m_sound_cpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
| 773 | 752 | } |
| 774 | 753 | |
| 775 | /* reset the sound write state */ | |
| 776 | state->m_sound_to_cpu_ready = 0; | |
| 777 | atarigen_sound_int_ack_w(space, 0, 0, 0xffff); | |
| 754 | // reset the sound write state | |
| 755 | m_sound_to_cpu_ready = 0; | |
| 756 | atarigen_sound_int_ack_w(m_sound_cpu->space(AS_PROGRAM), 0, 0, 0xffff); | |
| 778 | 757 | |
| 779 | /* allocate a high frequency timer until a response is generated */ | |
| 780 | /* the main CPU is *very* sensistive to the timing of the response */ | |
| 781 | machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); | |
| 758 | // allocate a high frequency timer until a response is generated | |
| 759 | // the main CPU is *very* sensistive to the timing of the response | |
| 760 | machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); | |
| 782 | 761 | } |
| 783 | 762 | |
| 784 | 763 | |
| 785 | /*--------------------------------------------------------------- | |
| 786 | delayed_sound_w: Synchronizes a data write from the main | |
| 787 | CPU to the sound CPU. | |
| 788 | ---------------------------------------------------------------*/ | |
| 764 | //------------------------------------------------- | |
| 765 | // delayed_sound_write: Synchronizes a data write | |
| 766 | // from the main CPU to the sound CPU. | |
| 767 | //------------------------------------------------- | |
| 789 | 768 | |
| 790 | ||
| 769 | void atarigen_state::delayed_sound_write(int data) | |
| 791 | 770 | { |
| 792 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 793 | ||
| 794 | /* warn if we missed something */ | |
| 795 | if (state->m_cpu_to_sound_ready) | |
| 771 | // warn if we missed something | |
| 772 | if (m_cpu_to_sound_ready) | |
| 796 | 773 | logerror("Missed command from 68010\n"); |
| 797 | 774 | |
| 798 | /* set up the states and signal an NMI to the sound CPU */ | |
| 799 | state->m_cpu_to_sound = param; | |
| 800 | state->m_cpu_to_sound_ready = 1; | |
| 801 | state->m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
| 775 | // set up the states and signal an NMI to the sound CPU | |
| 776 | m_cpu_to_sound = data; | |
| 777 | m_cpu_to_sound_ready = 1; | |
| 778 | m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
| 802 | 779 | |
| 803 | /* allocate a high frequency timer until a response is generated */ | |
| 804 | /* the main CPU is *very* sensistive to the timing of the response */ | |
| 805 | machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); | |
| 780 | // allocate a high frequency timer until a response is generated | |
| 781 | // the main CPU is *very* sensistive to the timing of the response | |
| 782 | machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST); | |
| 806 | 783 | } |
| 807 | 784 | |
| 808 | 785 | |
| 809 | /*--------------------------------------------------------------- | |
| 810 | delayed_6502_sound_w: Synchronizes a data write from the | |
| 811 | sound CPU to the main CPU. | |
| 812 | ---------------------------------------------------------------*/ | |
| 786 | //------------------------------------------------- | |
| 787 | // delayed_6502_write: Synchronizes a data write | |
| 788 | // from the sound CPU to the main CPU. | |
| 789 | //------------------------------------------------- | |
| 813 | 790 | |
| 814 | ||
| 791 | void atarigen_state::delayed_6502_write(int data) | |
| 815 | 792 | { |
| 816 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 817 | ||
| 818 | /* warn if we missed something */ | |
| 819 | if (state->m_sound_to_cpu_ready) | |
| 793 | // warn if we missed something | |
| 794 | if (m_sound_to_cpu_ready) | |
| 820 | 795 | logerror("Missed result from 6502\n"); |
| 821 | 796 | |
| 822 | /* set up the states and signal the sound interrupt to the main CPU */ | |
| 823 | state->m_sound_to_cpu = param; | |
| 824 | state->m_sound_to_cpu_ready = 1; | |
| 825 | atarigen_sound_int_gen(machine.device("maincpu")); | |
| 797 | // set up the states and signal the sound interrupt to the main CPU | |
| 798 | m_sound_to_cpu = data; | |
| 799 | m_sound_to_cpu_ready = 1; | |
| 800 | atarigen_sound_int_gen(machine().device("maincpu")); | |
| 826 | 801 | } |
| 827 | 802 | |
| 828 | 803 | |
| r18571 | r18572 | |
| 831 | 806 | SOUND HELPERS |
| 832 | 807 | ***************************************************************************/ |
| 833 | 808 | |
| 834 | /*--------------------------------------------------------------- | |
| 835 | atarigen_set_vol: Scans for a particular sound chip and | |
| 836 | changes the volume on all channels associated with it. | |
| 837 | ---------------------------------------------------------------*/ | |
| 809 | //------------------------------------------------- | |
| 810 | // set_volume_by_type: Scans for a particular | |
| 811 | // sound chip and changes the volume on all | |
| 812 | // channels associated with it. | |
| 813 | //------------------------------------------------- | |
| 838 | 814 | |
| 839 | void atarigen_set_vol | |
| 815 | void atarigen_state::set_volume_by_type(int volume, device_type type) | |
| 840 | 816 | { |
| 841 | sound_interface_iterator iter( | |
| 817 | sound_interface_iterator iter(*this); | |
| 842 | 818 | for (device_sound_interface *sound = iter.first(); sound != NULL; sound = iter.next()) |
| 843 | 819 | if (sound->device().type() == type) |
| 844 | 820 | sound->set_output_gain(ALL_OUTPUTS, volume / 100.0); |
| 845 | 821 | } |
| 846 | 822 | |
| 847 | 823 | |
| 848 | /*--------------------------------------------------------------- | |
| 849 | atarigen_set_XXXXX_vol: Sets the volume for a given type | |
| 850 | of chip. | |
| 851 | ---------------------------------------------------------------*/ | |
| 824 | //------------------------------------------------- | |
| 825 | // set_XXXXX_volume: Sets the volume for a given | |
| 826 | // type of chip. | |
| 827 | //------------------------------------------------- | |
| 852 | 828 | |
| 853 | void atarigen_set_ym2151_vol | |
| 829 | void atarigen_state::set_ym2151_volume(int volume) | |
| 854 | 830 | { |
| 855 | | |
| 831 | set_volume_by_type(volume, YM2151); | |
| 856 | 832 | } |
| 857 | 833 | |
| 858 | void atarigen_set_ym2413_vol | |
| 834 | void atarigen_state::set_ym2413_volume(int volume) | |
| 859 | 835 | { |
| 860 | | |
| 836 | set_volume_by_type(volume, YM2413); | |
| 861 | 837 | } |
| 862 | 838 | |
| 863 | void atarigen_set_pokey_vol | |
| 839 | void atarigen_state::set_pokey_volume(int volume) | |
| 864 | 840 | { |
| 865 | | |
| 841 | set_volume_by_type(volume, POKEY); | |
| 866 | 842 | } |
| 867 | 843 | |
| 868 | void atarigen_set_tms5220_vol | |
| 844 | void atarigen_state::set_tms5220_volume(int volume) | |
| 869 | 845 | { |
| 870 | | |
| 846 | set_volume_by_type(volume, TMS5220); | |
| 871 | 847 | } |
| 872 | 848 | |
| 873 | void atarigen_set_oki6295_vol | |
| 849 | void atarigen_state::set_oki6295_volume(int volume) | |
| 874 | 850 | { |
| 875 | | |
| 851 | set_volume_by_type(volume, OKIM6295); | |
| 876 | 852 | } |
| 877 | 853 | |
| 878 | 854 | |
| r18571 | r18572 | |
| 881 | 857 | SCANLINE TIMING |
| 882 | 858 | ***************************************************************************/ |
| 883 | 859 | |
| 884 | /*--------------------------------------------------------------- | |
| 885 | atarigen_scanline_timer_reset: Sets up the scanline timer. | |
| 886 | ---------------------------------------------------------------*/ | |
| 860 | //------------------------------------------------- | |
| 861 | // scanline_timer_reset: Sets up the scanline timer. | |
| 862 | //------------------------------------------------- | |
| 887 | 863 | |
| 888 | void atarigen_scanline_timer_reset(screen_device &screen | |
| 864 | void atarigen_state::scanline_timer_reset(screen_device &screen, int frequency) | |
| 889 | 865 | { |
| 890 | atarigen_state *state = screen.machine().driver_data<atarigen_state>(); | |
| 866 | // set the scanline callback | |
| 867 | m_scanlines_per_callback = frequency; | |
| 891 | 868 | |
| 892 | /* set the scanline callback */ | |
| 893 | state->m_scanline_callback = update_graphics; | |
| 894 | state->m_scanlines_per_callback = frequency; | |
| 895 | ||
| 896 | /* set a timer to go off at scanline 0 */ | |
| 897 | if (state->m_scanline_callback != NULL) | |
| 898 | { | |
| 899 | emu_timer *timer = get_screen_timer(screen)->scanline_timer; | |
| 900 | timer->adjust(screen.time_until_pos(0)); | |
| 901 | } | |
| 869 | // set a timer to go off at scanline 0 | |
| 870 | if (frequency != 0) | |
| 871 | get_screen_timer(screen)->scanline_timer->adjust(screen.time_until_pos(0)); | |
| 902 | 872 | } |
| 903 | 873 | |
| 904 | 874 | |
| 905 | /*--------------------------------------------------------------- | |
| 906 | scanline_timer_callback: Called once every n scanlines | |
| 907 | to generate the periodic callback to the main system. | |
| 908 | ---------------------------------------------------------------*/ | |
| 875 | //------------------------------------------------- | |
| 876 | // scanline_timer: Called once every n scanlines | |
| 877 | // to generate the periodic callback to the main | |
| 878 | // system. | |
| 879 | //------------------------------------------------- | |
| 909 | 880 | |
| 910 | ||
| 881 | void atarigen_state::scanline_timer(emu_timer &timer, screen_device &screen, int scanline) | |
| 911 | 882 | { |
| 912 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 913 | screen_device &screen = *reinterpret_cast<screen_device *>(ptr); | |
| 914 | int scanline = param; | |
| 883 | // callback | |
| 884 | scanline_update(screen, scanline); | |
| 915 | 885 | |
| 916 | /* callback */ | |
| 917 | if (state->m_scanline_callback != NULL) | |
| 918 | { | |
| 919 | (*state->m_scanline_callback)(screen, scanline); | |
| 920 | ||
| 921 | /* generate another */ | |
| 922 | scanline += state->m_scanlines_per_callback; | |
| 923 | if (scanline >= screen.height()) | |
| 924 | scanline = 0; | |
| 925 | get_screen_timer(screen)->scanline_timer->adjust(screen.time_until_pos(scanline), scanline); | |
| 926 | } | |
| 886 | // generate another | |
| 887 | scanline += m_scanlines_per_callback; | |
| 888 | if (scanline >= screen.height()) | |
| 889 | scanline = 0; | |
| 890 | timer.adjust(screen.time_until_pos(scanline), scanline); | |
| 927 | 891 | } |
| 928 | 892 | |
| 929 | 893 | |
| r18571 | r18572 | |
| 932 | 896 | VIDEO CONTROLLER |
| 933 | 897 | ***************************************************************************/ |
| 934 | 898 | |
| 935 | /*--------------------------------------------------------------- | |
| 936 | atarivc_eof_update: Callback that slurps up data and feeds | |
| 937 | it into the video controller registers every refresh. | |
| 938 | ---------------------------------------------------------------*/ | |
| 899 | //------------------------------------------------- | |
| 900 | // atarivc_eof_update: Callback that slurps up data and feeds | |
| 901 | // it into the video controller registers every refresh. | |
| 902 | //------------------------------------------------- | |
| 939 | 903 | |
| 940 | ||
| 904 | void atarigen_state::atarivc_eof_update(emu_timer &timer, screen_device &screen) | |
| 941 | 905 | { |
| 942 | atarigen_state *state = machine.driver_data<atarigen_state>(); | |
| 943 | screen_device &screen = *reinterpret_cast<screen_device *>(ptr); | |
| 944 | emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer; | |
| 945 | int i; | |
| 906 | // echo all the commands to the video controller | |
| 907 | for (int i = 0; i < 0x1c; i++) | |
| 908 | if (m_atarivc_eof_data[i]) | |
| 909 | atarivc_common_w(screen, i, m_atarivc_eof_data[i]); | |
| 946 | 910 | |
| 947 | /* echo all the commands to the video controller */ | |
| 948 | for (i = 0; i < 0x1c; i++) | |
| 949 | if (state->m_atarivc_eof_data[i]) | |
| 950 | atarivc_common_w(screen, i, state->m_atarivc_eof_data[i]); | |
| 911 | // update the scroll positions | |
| 912 | atarimo_set_xscroll(0, m_atarivc_state.mo_xscroll); | |
| 913 | atarimo_set_yscroll(0, m_atarivc_state.mo_yscroll); | |
| 951 | 914 | |
| 952 | /* update the scroll positions */ | |
| 953 | atarimo_set_xscroll(0, state->m_atarivc_state.mo_xscroll); | |
| 954 | atarimo_set_yscroll(0, state->m_atarivc_state.mo_yscroll); | |
| 915 | m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll); | |
| 916 | m_playfield_tilemap->set_scrolly(0, m_atarivc_state.pf0_yscroll); | |
| 955 | 917 | |
| 956 | state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll); | |
| 957 | state->m_playfield_tilemap->set_scrolly(0, state->m_atarivc_state.pf0_yscroll); | |
| 958 | ||
| 959 | if (state->m_atarivc_playfields > 1) | |
| 918 | if (m_atarivc_playfields > 1) | |
| 960 | 919 | { |
| 961 | state->m_playfield2_tilemap->set_scrollx(0, state->m_atarivc_state.pf1_xscroll); | |
| 962 | state->m_playfield2_tilemap->set_scrolly(0, state->m_atarivc_state.pf1_yscroll); | |
| 920 | m_playfield2_tilemap->set_scrollx(0, m_atarivc_state.pf1_xscroll); | |
| 921 | m_playfield2_tilemap->set_scrolly(0, m_atarivc_state.pf1_yscroll); | |
| 963 | 922 | } |
| 964 | timer | |
| 923 | timer.adjust(screen.time_until_pos(0)); | |
| 965 | 924 | |
| 966 | / | |
| 925 | // use this for debugging the video controller values | |
| 967 | 926 | #if 0 |
| 968 | if (machine.input().code_pressed(KEYCODE_8)) | |
| 927 | if (machine().input().code_pressed(KEYCODE_8)) | |
| 969 | 928 | { |
| 970 | 929 | static FILE *out; |
| 971 | 930 | if (!out) out = fopen("scroll.log", "w"); |
| r18571 | r18572 | |
| 980 | 939 | } |
| 981 | 940 | |
| 982 | 941 | |
| 983 | /*--------------------------------------------------------------- | |
| 984 | atarivc_reset: Initializes the video controller. | |
| 985 | ---------------------------------------------------------------*/ | |
| 942 | //------------------------------------------------- | |
| 943 | // atarivc_reset: Initializes the video controller. | |
| 944 | //------------------------------------------------- | |
| 986 | 945 | |
| 987 | 946 | void atarivc_reset(screen_device &screen, UINT16 *eof_data, int playfields) |
| 988 | 947 | { |
| 989 | 948 | atarigen_state *state = screen.machine().driver_data<atarigen_state>(); |
| 990 | 949 | |
| 991 | / | |
| 950 | // this allows us to manually reset eof_data to NULL if it's not used | |
| 992 | 951 | state->m_atarivc_eof_data.set_target(eof_data, 0x100); |
| 993 | 952 | state->m_atarivc_playfields = playfields; |
| 994 | 953 | |
| 995 | / | |
| 954 | // clear the RAM we use | |
| 996 | 955 | memset(state->m_atarivc_data, 0, 0x40); |
| 997 | 956 | memset(&state->m_atarivc_state, 0, sizeof(state->m_atarivc_state)); |
| 998 | 957 | |
| 999 | / | |
| 958 | // reset the latches | |
| 1000 | 959 | state->m_atarivc_state.latch1 = state->m_atarivc_state.latch2 = -1; |
| 1001 | 960 | state->m_actual_vc_latch0 = state->m_actual_vc_latch1 = -1; |
| 1002 | 961 | |
| 1003 | / | |
| 962 | // start a timer to go off a little before scanline 0 | |
| 1004 | 963 | if (state->m_atarivc_eof_data) |
| 1005 | { | |
| 1006 | emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer; | |
| 1007 | timer->adjust(screen.time_until_pos(0)); | |
| 1008 | } | |
| 964 | get_screen_timer(screen)->atarivc_eof_update_timer->adjust(screen.time_until_pos(0)); | |
| 1009 | 965 | } |
| 1010 | 966 | |
| 1011 | 967 | |
| 968 | //------------------------------------------------- | |
| 969 | // atarivc_w: Handles an I/O write to the video controller. | |
| 970 | //------------------------------------------------- | |
| 1012 | 971 | |
| 1013 | /*--------------------------------------------------------------- | |
| 1014 | atarivc_w: Handles an I/O write to the video controller. | |
| 1015 | ---------------------------------------------------------------*/ | |
| 1016 | ||
| 1017 | 972 | void atarivc_w(screen_device &screen, offs_t offset, UINT16 data, UINT16 mem_mask) |
| 1018 | 973 | { |
| 1019 | 974 | atarigen_state *state = screen.machine().driver_data<atarigen_state>(); |
| r18571 | r18572 | |
| 1026 | 981 | |
| 1027 | 982 | |
| 1028 | 983 | |
| 1029 | /*--------------------------------------------------------------- | |
| 1030 | atarivc_common_w: Does the bulk of the word for an I/O | |
| 1031 | write. | |
| 1032 | ---------------------------------------------------------------*/ | |
| 984 | //------------------------------------------------- | |
| 985 | // atarivc_common_w: Does the bulk of the word for an I/O | |
| 986 | // write. | |
| 987 | //------------------------------------------------- | |
| 1033 | 988 | |
| 1034 | 989 | static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newword) |
| 1035 | 990 | { |
| r18571 | r18572 | |
| 1037 | 992 | int oldword = state->m_atarivc_data[offset]; |
| 1038 | 993 | state->m_atarivc_data[offset] = newword; |
| 1039 | 994 | |
| 1040 | / | |
| 995 | // switch off the offset | |
| 1041 | 996 | switch (offset) |
| 1042 | 997 | { |
| 1043 | /* | |
| 1044 | additional registers: | |
| 998 | // | |
| 999 | // additional registers: | |
| 1000 | // | |
| 1001 | // 01 = vertical start (for centering) | |
| 1002 | // 04 = horizontal start (for centering) | |
| 1003 | // | |
| 1045 | 1004 | |
| 1046 | 01 = vertical start (for centering) | |
| 1047 | 04 = horizontal start (for centering) | |
| 1048 | */ | |
| 1049 | ||
| 1050 | /* set the scanline interrupt here */ | |
| 1005 | // set the scanline interrupt here | |
| 1051 | 1006 | case 0x03: |
| 1052 | 1007 | if (oldword != newword) |
| 1053 | | |
| 1008 | state->scanline_int_set(screen, newword & 0x1ff); | |
| 1054 | 1009 | break; |
| 1055 | 1010 | |
| 1056 | / | |
| 1011 | // latch enable | |
| 1057 | 1012 | case 0x0a: |
| 1058 | 1013 | |
| 1059 | / | |
| 1014 | // reset the latches when disabled | |
| 1060 | 1015 | atarigen_set_playfield_latch(state, (newword & 0x0080) ? state->m_actual_vc_latch0 : -1); |
| 1061 | 1016 | atarigen_set_playfield2_latch(state, (newword & 0x0080) ? state->m_actual_vc_latch1 : -1); |
| 1062 | 1017 | |
| 1063 | / | |
| 1018 | // check for rowscroll enable | |
| 1064 | 1019 | state->m_atarivc_state.rowscroll_enable = (newword & 0x2000) >> 13; |
| 1065 | 1020 | |
| 1066 | / | |
| 1021 | // check for palette banking | |
| 1067 | 1022 | if (state->m_atarivc_state.palette_bank != (((newword & 0x0400) >> 10) ^ 1)) |
| 1068 | 1023 | { |
| 1069 | 1024 | screen.update_partial(screen.vpos()); |
| r18571 | r18572 | |
| 1071 | 1026 | } |
| 1072 | 1027 | break; |
| 1073 | 1028 | |
| 1074 | / | |
| 1029 | // indexed parameters | |
| 1075 | 1030 | case 0x10: case 0x11: case 0x12: case 0x13: |
| 1076 | 1031 | case 0x14: case 0x15: case 0x16: case 0x17: |
| 1077 | 1032 | case 0x18: case 0x19: case 0x1a: case 0x1b: |
| r18571 | r18572 | |
| 1105 | 1060 | } |
| 1106 | 1061 | break; |
| 1107 | 1062 | |
| 1108 | / | |
| 1063 | // latch 1 value | |
| 1109 | 1064 | case 0x1c: |
| 1110 | 1065 | state->m_actual_vc_latch0 = -1; |
| 1111 | 1066 | state->m_actual_vc_latch1 = newword; |
| r18571 | r18572 | |
| 1113 | 1068 | atarigen_set_playfield2_latch(state, (state->m_atarivc_data[0x0a] & 0x80) ? state->m_actual_vc_latch1 : -1); |
| 1114 | 1069 | break; |
| 1115 | 1070 | |
| 1116 | / | |
| 1071 | // latch 2 value | |
| 1117 | 1072 | case 0x1d: |
| 1118 | 1073 | state->m_actual_vc_latch0 = newword; |
| 1119 | 1074 | state->m_actual_vc_latch1 = -1; |
| r18571 | r18572 | |
| 1121 | 1076 | atarigen_set_playfield2_latch(state, (state->m_atarivc_data[0x0a] & 0x80) ? state->m_actual_vc_latch1 : -1); |
| 1122 | 1077 | break; |
| 1123 | 1078 | |
| 1124 | / | |
| 1079 | // scanline IRQ ack here | |
| 1125 | 1080 | case 0x1e: |
| 1126 | /* hack: this should be a device */ | |
| 1127 | atarigen_scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); | |
| 1081 | // hack: this should be a device | |
| 1082 | state->scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); | |
| 1128 | 1083 | break; |
| 1129 | 1084 | |
| 1130 | / | |
| 1085 | // log anything else | |
| 1131 | 1086 | case 0x00: |
| 1132 | 1087 | default: |
| 1133 | 1088 | if (oldword != newword) |
| r18571 | r18572 | |
| 1137 | 1092 | } |
| 1138 | 1093 | |
| 1139 | 1094 | |
| 1140 | /*--------------------------------------------------------------- | |
| 1141 | atarivc_r: Handles an I/O read from the video controller. | |
| 1142 | ---------------------------------------------------------------*/ | |
| 1095 | //------------------------------------------------- | |
| 1096 | // atarivc_r: Handles an I/O read from the video controller. | |
| 1097 | //------------------------------------------------- | |
| 1143 | 1098 | |
| 1144 | 1099 | UINT16 atarivc_r(screen_device &screen, offs_t offset) |
| 1145 | 1100 | { |
| r18571 | r18572 | |
| 1147 | 1102 | |
| 1148 | 1103 | logerror("vc_r(%02X)\n", offset); |
| 1149 | 1104 | |
| 1150 | /* a read from offset 0 returns the current scanline */ | |
| 1151 | /* also sets bit 0x4000 if we're in VBLANK */ | |
| 1105 | // a read from offset 0 returns the current scanline | |
| 1106 | // also sets bit 0x4000 if we're in VBLANK | |
| 1152 | 1107 | if (offset == 0) |
| 1153 | 1108 | { |
| 1154 | 1109 | int result = screen.vpos(); |
| r18571 | r18572 | |
| 1170 | 1125 | PLAYFIELD/ALPHA MAP HELPERS |
| 1171 | 1126 | ***************************************************************************/ |
| 1172 | 1127 | |
| 1173 | /*--------------------------------------------------------------- | |
| 1174 | atarigen_alpha_w: Generic write handler for alpha RAM. | |
| 1175 | ---------------------------------------------------------------*/ | |
| 1128 | //------------------------------------------------- | |
| 1129 | // atarigen_alpha_w: Generic write handler for alpha RAM. | |
| 1130 | //------------------------------------------------- | |
| 1176 | 1131 | |
| 1177 | 1132 | WRITE16_HANDLER( atarigen_alpha_w ) |
| 1178 | 1133 | { |
| r18571 | r18572 | |
| 1200 | 1155 | |
| 1201 | 1156 | |
| 1202 | 1157 | |
| 1203 | /*--------------------------------------------------------------- | |
| 1204 | atarigen_set_playfield_latch: Sets the latch for the latched | |
| 1205 | playfield handlers below. | |
| 1206 | ---------------------------------------------------------------*/ | |
| 1158 | //------------------------------------------------- | |
| 1159 | // atarigen_set_playfield_latch: Sets the latch for the latched | |
| 1160 | // playfield handlers below. | |
| 1161 | //------------------------------------------------- | |
| 1207 | 1162 | |
| 1208 | 1163 | void atarigen_set_playfield_latch(atarigen_state *state, int data) |
| 1209 | 1164 | { |
| r18571 | r18572 | |
| 1217 | 1172 | |
| 1218 | 1173 | |
| 1219 | 1174 | |
| 1220 | /*--------------------------------------------------------------- | |
| 1221 | atarigen_playfield_w: Generic write handler for PF RAM. | |
| 1222 | ---------------------------------------------------------------*/ | |
| 1175 | //------------------------------------------------- | |
| 1176 | // atarigen_playfield_w: Generic write handler for PF RAM. | |
| 1177 | //------------------------------------------------- | |
| 1223 | 1178 | |
| 1224 | 1179 | WRITE16_HANDLER( atarigen_playfield_w ) |
| 1225 | 1180 | { |
| r18571 | r18572 | |
| 1247 | 1202 | |
| 1248 | 1203 | |
| 1249 | 1204 | |
| 1250 | /*--------------------------------------------------------------- | |
| 1251 | atarigen_playfield_large_w: Generic write handler for | |
| 1252 | large (2-word) playfield RAM. | |
| 1253 | ---------------------------------------------------------------*/ | |
| 1205 | //------------------------------------------------- | |
| 1206 | // atarigen_playfield_large_w: Generic write handler for | |
| 1207 | // large (2-word) playfield RAM. | |
| 1208 | //------------------------------------------------- | |
| 1254 | 1209 | |
| 1255 | 1210 | WRITE16_HANDLER( atarigen_playfield_large_w ) |
| 1256 | 1211 | { |
| r18571 | r18572 | |
| 1261 | 1216 | |
| 1262 | 1217 | |
| 1263 | 1218 | |
| 1264 | /*--------------------------------------------------------------- | |
| 1265 | atarigen_playfield_upper_w: Generic write handler for | |
| 1266 | upper word of split playfield RAM. | |
| 1267 | ---------------------------------------------------------------*/ | |
| 1219 | //------------------------------------------------- | |
| 1220 | // atarigen_playfield_upper_w: Generic write handler for | |
| 1221 | // upper word of split playfield RAM. | |
| 1222 | //------------------------------------------------- | |
| 1268 | 1223 | |
| 1269 | 1224 | WRITE16_HANDLER( atarigen_playfield_upper_w ) |
| 1270 | 1225 | { |
| r18571 | r18572 | |
| 1275 | 1230 | |
| 1276 | 1231 | |
| 1277 | 1232 | |
| 1278 | /*--------------------------------------------------------------- | |
| 1279 | atarigen_playfield_dual_upper_w: Generic write handler for | |
| 1280 | upper word of split dual playfield RAM. | |
| 1281 | ---------------------------------------------------------------*/ | |
| 1233 | //------------------------------------------------- | |
| 1234 | // atarigen_playfield_dual_upper_w: Generic write handler for | |
| 1235 | // upper word of split dual playfield RAM. | |
| 1236 | //------------------------------------------------- | |
| 1282 | 1237 | |
| 1283 | 1238 | WRITE16_HANDLER( atarigen_playfield_dual_upper_w ) |
| 1284 | 1239 | { |
| r18571 | r18572 | |
| 1290 | 1245 | |
| 1291 | 1246 | |
| 1292 | 1247 | |
| 1293 | /*--------------------------------------------------------------- | |
| 1294 | atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1295 | lower word of playfield RAM with a latch in the LSB of the | |
| 1296 | upper word. | |
| 1297 | ---------------------------------------------------------------*/ | |
| 1248 | //------------------------------------------------- | |
| 1249 | // atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1250 | // lower word of playfield RAM with a latch in the LSB of the | |
| 1251 | // upper word. | |
| 1252 | //------------------------------------------------- | |
| 1298 | 1253 | |
| 1299 | 1254 | WRITE16_HANDLER( atarigen_playfield_latched_lsb_w ) |
| 1300 | 1255 | { |
| r18571 | r18572 | |
| 1309 | 1264 | |
| 1310 | 1265 | |
| 1311 | 1266 | |
| 1312 | /*--------------------------------------------------------------- | |
| 1313 | atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1314 | lower word of playfield RAM with a latch in the MSB of the | |
| 1315 | upper word. | |
| 1316 | ---------------------------------------------------------------*/ | |
| 1267 | //------------------------------------------------- | |
| 1268 | // atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1269 | // lower word of playfield RAM with a latch in the MSB of the | |
| 1270 | // upper word. | |
| 1271 | //------------------------------------------------- | |
| 1317 | 1272 | |
| 1318 | 1273 | WRITE16_HANDLER( atarigen_playfield_latched_msb_w ) |
| 1319 | 1274 | { |
| r18571 | r18572 | |
| 1328 | 1283 | |
| 1329 | 1284 | |
| 1330 | 1285 | |
| 1331 | /*--------------------------------------------------------------- | |
| 1332 | atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1333 | lower word of second playfield RAM with a latch in the MSB | |
| 1334 | of the upper word. | |
| 1335 | ---------------------------------------------------------------*/ | |
| 1286 | //------------------------------------------------- | |
| 1287 | // atarigen_playfield_latched_lsb_w: Generic write handler for | |
| 1288 | // lower word of second playfield RAM with a latch in the MSB | |
| 1289 | // of the upper word. | |
| 1290 | //------------------------------------------------- | |
| 1336 | 1291 | |
| 1337 | 1292 | WRITE16_HANDLER( atarigen_playfield2_latched_msb_w ) |
| 1338 | 1293 | { |
| r18571 | r18572 | |
| 1352 | 1307 | VIDEO HELPERS |
| 1353 | 1308 | ***************************************************************************/ |
| 1354 | 1309 | |
| 1355 | /*--------------------------------------------------------------- | |
| 1356 | atarigen_get_hblank: Returns a guesstimate about the current | |
| 1357 | HBLANK state, based on the assumption that HBLANK represents | |
| 1358 | 10% of the scanline period. | |
| 1359 | ---------------------------------------------------------------*/ | |
| 1310 | //------------------------------------------------- | |
| 1311 | // atarigen_get_hblank: Returns a guesstimate about the current | |
| 1312 | // HBLANK state, based on the assumption that HBLANK represents | |
| 1313 | // 10% of the scanline period. | |
| 1314 | //------------------------------------------------- | |
| 1360 | 1315 | |
| 1361 | 1316 | int atarigen_get_hblank(screen_device &screen) |
| 1362 | 1317 | { |
| r18571 | r18572 | |
| 1364 | 1319 | } |
| 1365 | 1320 | |
| 1366 | 1321 | |
| 1367 | /*--------------------------------------------------------------- | |
| 1368 | atarigen_halt_until_hblank_0: Halts CPU 0 until the | |
| 1369 | next HBLANK. | |
| 1370 | ---------------------------------------------------------------*/ | |
| 1322 | //------------------------------------------------- | |
| 1323 | // halt_until_hblank_0: Halts CPU 0 until the | |
| 1324 | // next HBLANK. | |
| 1325 | //------------------------------------------------- | |
| 1371 | 1326 | |
| 1372 | void atarigen_halt_until_hblank_0(screen_device &screen) | |
| 1327 | void atarigen_state::halt_until_hblank_0(device_t &device, screen_device &screen) | |
| 1373 | 1328 | { |
| 1374 | device_t *cpu = screen.machine().device("maincpu"); | |
| 1375 | ||
| 1376 | /* halt the CPU until the next HBLANK */ | |
| 1329 | // halt the CPU until the next HBLANK | |
| 1377 | 1330 | int hpos = screen.hpos(); |
| 1378 | 1331 | int width = screen.width(); |
| 1379 | 1332 | int hblank = width * 9 / 10; |
| 1380 | 1333 | |
| 1381 | / | |
| 1334 | // if we're in hblank, set up for the next one | |
| 1382 | 1335 | if (hpos >= hblank) |
| 1383 | 1336 | hblank += width; |
| 1384 | 1337 | |
| 1385 | /* halt and set a timer to wake up */ | |
| 1386 | screen.machine().scheduler().timer_set(screen.scan_period() * (hblank - hpos) / width, FUNC(unhalt_cpu), 0, (void *)cpu); | |
| 1387 | cpu->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1338 | // halt and set a timer to wake up | |
| 1339 | device.execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); | |
| 1340 | timer_set(screen.scan_period() * (hblank - hpos) / width, TID_UNHALT_CPU, 0, (void *)&device); | |
| 1388 | 1341 | } |
| 1389 | 1342 | |
| 1390 | 1343 | |
| 1391 | /*--------------------------------------------------------------- | |
| 1392 | atarigen_666_paletteram_w: 6-6-6 RGB palette RAM handler. | |
| 1393 | ---------------------------------------------------------------*/ | |
| 1344 | //------------------------------------------------- | |
| 1345 | // atarigen_666_paletteram_w: 6-6-6 RGB palette RAM handler. | |
| 1346 | //------------------------------------------------- | |
| 1394 | 1347 | |
| 1395 | 1348 | WRITE16_HANDLER( atarigen_666_paletteram_w ) |
| 1396 | 1349 | { |
| r18571 | r18572 | |
| 1408 | 1361 | } |
| 1409 | 1362 | |
| 1410 | 1363 | |
| 1411 | /*--------------------------------------------------------------- | |
| 1412 | atarigen_expanded_666_paletteram_w: 6-6-6 RGB expanded | |
| 1413 | palette RAM handler. | |
| 1414 | ---------------------------------------------------------------*/ | |
| 1364 | //------------------------------------------------- | |
| 1365 | // atarigen_expanded_666_paletteram_w: 6-6-6 RGB expanded | |
| 1366 | // palette RAM handler. | |
| 1367 | //------------------------------------------------- | |
| 1415 | 1368 | |
| 1416 | 1369 | WRITE16_HANDLER( atarigen_expanded_666_paletteram_w ) |
| 1417 | 1370 | { |
| r18571 | r18572 | |
| 1434 | 1387 | } |
| 1435 | 1388 | |
| 1436 | 1389 | |
| 1437 | /*--------------------------------------------------------------- | |
| 1438 | atarigen_666_paletteram32_w: 6-6-6 RGB palette RAM handler. | |
| 1439 | ---------------------------------------------------------------*/ | |
| 1390 | //------------------------------------------------- | |
| 1391 | // atarigen_666_paletteram32_w: 6-6-6 RGB palette RAM handler. | |
| 1392 | //------------------------------------------------- | |
| 1440 | 1393 | |
| 1441 | 1394 | WRITE32_HANDLER( atarigen_666_paletteram32_w ) |
| 1442 | 1395 | { |
| r18571 | r18572 | |
| 1469 | 1422 | } |
| 1470 | 1423 | |
| 1471 | 1424 | |
| 1472 | /*--------------------------------------------------------------- | |
| 1473 | unhalt_cpu: Timer callback to release the CPU from a halted state. | |
| 1474 | ---------------------------------------------------------------*/ | |
| 1475 | 1425 | |
| 1476 | static TIMER_CALLBACK( unhalt_cpu ) | |
| 1477 | { | |
| 1478 | device_t *cpu = (device_t *)ptr; | |
| 1479 | cpu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); | |
| 1480 | } | |
| 1481 | ||
| 1482 | ||
| 1483 | ||
| 1484 | 1426 | /*************************************************************************** |
| 1485 | 1427 | MISC HELPERS |
| 1486 | 1428 | ***************************************************************************/ |
| 1487 | 1429 | |
| 1488 | /*--------------------------------------------------------------- | |
| 1489 | atarigen_swap_mem: Inverts the bits in a region. | |
| 1490 | ---------------------------------------------------------------*/ | |
| 1430 | //------------------------------------------------- | |
| 1431 | // atarigen_swap_mem: Inverts the bits in a region. | |
| 1432 | //------------------------------------------------- | |
| 1491 | 1433 | |
| 1492 | 1434 | void atarigen_swap_mem(void *ptr1, void *ptr2, int bytes) |
| 1493 | 1435 | { |
| r18571 | r18572 | |
| 1502 | 1444 | } |
| 1503 | 1445 | |
| 1504 | 1446 | |
| 1505 | /*--------------------------------------------------------------- | |
| 1506 | atarigen_blend_gfx: Takes two GFXElements and blends their | |
| 1507 | data together to form one. Then frees the second. | |
| 1508 | ---------------------------------------------------------------*/ | |
| 1447 | //------------------------------------------------- | |
| 1448 | // atarigen_blend_gfx: Takes two GFXElements and blends their | |
| 1449 | // data together to form one. Then frees the second. | |
| 1450 | //------------------------------------------------- | |
| 1509 | 1451 | |
| 1510 | 1452 | void atarigen_blend_gfx(running_machine &machine, int gfx0, int gfx1, int mask0, int mask1) |
| 1511 | 1453 | { |
| r18571 | r18572 | |
| 1514 | 1456 | UINT8 *srcdata, *dest; |
| 1515 | 1457 | int c, x, y; |
| 1516 | 1458 | |
| 1517 | / | |
| 1459 | // allocate memory for the assembled data | |
| 1518 | 1460 | srcdata = auto_alloc_array(machine, UINT8, gx0->elements() * gx0->width() * gx0->height()); |
| 1519 | 1461 | |
| 1520 | / | |
| 1462 | // loop over elements | |
| 1521 | 1463 | dest = srcdata; |
| 1522 | 1464 | for (c = 0; c < gx0->elements(); c++) |
| 1523 | 1465 | { |
| 1524 | 1466 | const UINT8 *c0base = gx0->get_data(c); |
| 1525 | 1467 | const UINT8 *c1base = gx1->get_data(c); |
| 1526 | 1468 | |
| 1527 | / | |
| 1469 | // loop over height | |
| 1528 | 1470 | for (y = 0; y < gx0->height(); y++) |
| 1529 | 1471 | { |
| 1530 | 1472 | const UINT8 *c0 = c0base; |
| r18571 | r18572 | |
| 1542 | 1484 | gx0->set_raw_layout(srcdata, gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height()); |
| 1543 | 1485 | gx0->set_granularity(granularity); |
| 1544 | 1486 | |
| 1545 | / | |
| 1487 | // free the second graphics element | |
| 1546 | 1488 | machine.gfx[gfx1] = NULL; |
| 1547 | 1489 | auto_free(machine, gx1); |
| 1548 | 1490 | } |
| r18571 | r18572 | |
| 1553 | 1495 | // VECTOR AND EARLY RASTER EAROM INTERFACE |
| 1554 | 1496 | //************************************************************************** |
| 1555 | 1497 | |
| 1556 | void atarigen_state::machine_start() | |
| 1557 | { | |
| 1558 | // until everyone is converted to modern devices, call our parent | |
| 1559 | driver_device::machine_start(); | |
| 1560 | ||
| 1561 | save_item(NAME(m_earom_data)); | |
| 1562 | save_item(NAME(m_earom_control)); | |
| 1563 | } | |
| 1564 | ||
| 1565 | ||
| 1566 | void atarigen_state::machine_reset() | |
| 1567 | { | |
| 1568 | // until everyone is converted to modern devices, call our parent | |
| 1569 | driver_device::machine_reset(); | |
| 1570 | ||
| 1571 | // reset the control latch on the EAROM, if present | |
| 1572 | if (m_earom != NULL) | |
| 1573 | m_earom->set_control(0, 1, 1, 0, 0); | |
| 1574 | } | |
| 1575 | ||
| 1576 | ||
| 1577 | ||
| 1578 | //************************************************************************** | |
| 1579 | // VECTOR AND EARLY RASTER EAROM INTERFACE | |
| 1580 | //************************************************************************** | |
| 1581 | ||
| 1582 | 1498 | READ8_MEMBER( atarigen_state::earom_r ) |
| 1583 | 1499 | { |
| 1584 | 1500 | // return data latched from previous clock |
| r18571 | r18572 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | #include "machine/nvram.h" |
| 44 | 44 | #include "machine/er2055.h" |
| 45 | #include "cpu/m6502/m6502.h" | |
| 45 | 46 | |
| 46 | 47 | |
| 47 | 48 | /*************************************************************************** |
| r18571 | r18572 | |
| 59 | 60 | TYPES & STRUCTURES |
| 60 | 61 | ***************************************************************************/ |
| 61 | 62 | |
| 62 | typedef void (*atarigen_int_func)(running_machine &machine); | |
| 63 | ||
| 64 | typedef void (*atarigen_scanline_func)(screen_device &screen, int scanline); | |
| 65 | ||
| 66 | 63 | struct atarivc_state_desc |
| 67 | 64 | { |
| 68 | 65 | UINT32 latch1; /* latch #1 value (-1 means disabled) */ |
| r18571 | r18572 | |
| 92 | 89 | class atarigen_state : public driver_device |
| 93 | 90 | { |
| 94 | 91 | public: |
| 95 | atarigen_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 96 | : driver_device(mconfig, type, tag), | |
| 97 | m_earom(*this, "earom"), | |
| 98 | m_eeprom(*this, "eeprom"), | |
| 99 | m_eeprom32(*this, "eeprom"), | |
| 100 | m_playfield(*this, "playfield"), | |
| 101 | m_playfield2(*this, "playfield2"), | |
| 102 | m_playfield_upper(*this, "playfield_up"), | |
| 103 | m_alpha(*this, "alpha"), | |
| 104 | m_alpha2(*this, "alpha2"), | |
| 105 | m_xscroll(*this, "xscroll"), | |
| 106 | m_yscroll(*this, "yscroll"), | |
| 107 | m_playfield32(*this, "playfield32"), | |
| 108 | m_alpha32(*this, "alpha32"), | |
| 109 | m_atarivc_data(*this, "atarivc_data"), | |
| 110 | m_atarivc_eof_data(*this, "atarivc_eof") | |
| 111 | { } | |
| 92 | // construction/destruction | |
| 93 | atarigen_state(const machine_config &mconfig, device_type type, const char *tag); | |
| 112 | 94 | |
| 113 | 95 | // users must call through to these |
| 114 | 96 | virtual void machine_start(); |
| 115 | 97 | virtual void machine_reset(); |
| 98 | virtual void device_post_load(); | |
| 99 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 116 | 100 | |
| 101 | // callbacks provided by the derived class | |
| 102 | virtual void update_interrupts() = 0; | |
| 103 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 104 | ||
| 105 | // interrupt handling | |
| 106 | void scanline_int_set(screen_device &screen, int scanline); | |
| 107 | INTERRUPT_GEN_MEMBER(scanline_int_gen); | |
| 108 | DECLARE_WRITE16_MEMBER(scanline_int_ack_w); | |
| 109 | ||
| 110 | // slapstic helpers | |
| 111 | void slapstic_configure(cpu_device &device, offs_t base, offs_t mirror, int chipnum); | |
| 112 | void slapstic_update_bank(int bank); | |
| 113 | DECLARE_DIRECT_UPDATE_MEMBER(slapstic_setdirect); | |
| 114 | DECLARE_WRITE16_MEMBER(slapstic_w); | |
| 115 | DECLARE_READ16_MEMBER(slapstic_r); | |
| 116 | ||
| 117 | // sound I/O helpers | |
| 118 | void sound_io_reset(); | |
| 119 | INTERRUPT_GEN_MEMBER(m6502_irq_gen); | |
| 120 | DECLARE_READ8_MEMBER(m6502_irq_ack_r); | |
| 121 | DECLARE_WRITE8_MEMBER(m6502_irq_ack_w); | |
| 122 | DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen); | |
| 123 | DECLARE_WRITE16_MEMBER(sound_reset_w); | |
| 124 | void sound_cpu_reset(); | |
| 125 | DECLARE_WRITE8_MEMBER(sound_w); | |
| 126 | DECLARE_READ8_MEMBER(sound_r); | |
| 127 | DECLARE_WRITE8_MEMBER(m6502_sound_w); | |
| 128 | DECLARE_READ8_MEMBER(m6502_sound_r); | |
| 129 | void update_m6502_irq(); | |
| 130 | void delayed_sound_reset(int param); | |
| 131 | void delayed_sound_write(int data); | |
| 132 | void delayed_6502_write(int data); | |
| 133 | ||
| 134 | // sound helpers | |
| 135 | void set_volume_by_type(int volume, device_type type); | |
| 136 | void set_ym2151_volume(int volume); | |
| 137 | void set_ym2413_volume(int volume); | |
| 138 | void set_pokey_volume(int volume); | |
| 139 | void set_tms5220_volume(int volume); | |
| 140 | void set_oki6295_volume(int volume); | |
| 141 | ||
| 142 | // scanline timing | |
| 143 | void scanline_timer_reset(screen_device &screen, int frequency); | |
| 144 | void scanline_timer(emu_timer &timer, screen_device &screen, int scanline); | |
| 145 | ||
| 146 | // video controller | |
| 147 | void atarivc_eof_update(emu_timer &timer, screen_device &screen); | |
| 148 | ||
| 149 | // video helpers | |
| 150 | void halt_until_hblank_0(device_t &device, screen_device &screen); | |
| 151 | ||
| 117 | 152 | // vector and early raster EAROM interface |
| 118 | 153 | DECLARE_READ8_MEMBER( earom_r ); |
| 119 | 154 | DECLARE_WRITE8_MEMBER( earom_w ); |
| 120 | 155 | DECLARE_WRITE8_MEMBER( earom_control_w ); |
| 156 | ||
| 157 | // timer IDs | |
| 158 | enum | |
| 159 | { | |
| 160 | TID_SCANLINE_INTERRUPT, | |
| 161 | TID_SOUND_RESET, | |
| 162 | TID_SOUND_WRITE, | |
| 163 | TID_6502_WRITE, | |
| 164 | TID_SCANLINE_TIMER, | |
| 165 | TID_ATARIVC_EOF, | |
| 166 | TID_UNHALT_CPU | |
| 167 | }; | |
| 121 | 168 | |
| 122 | DECLARE_WRITE_LINE_MEMBER( ym2151_irq_gen ); | |
| 123 | ||
| 124 | 169 | // vector and early raster EAROM interface |
| 125 | 170 | optional_device<er2055_device> m_earom; |
| 126 | 171 | UINT8 m_earom_data; |
| r18571 | r18572 | |
| 149 | 194 | optional_shared_ptr<UINT32> m_playfield32; |
| 150 | 195 | optional_shared_ptr<UINT32> m_alpha32; |
| 151 | 196 | |
| 152 | tilemap_t * m_playfield_tilemap; | |
| 153 | tilemap_t * m_playfield2_tilemap; | |
| 154 | tilemap_t * m_alpha_tilemap; | |
| 155 | tilemap_t * m_alpha2_tilemap; | |
| 197 | tilemap_t * m_playfield_tilemap; | |
| 198 | tilemap_t * m_playfield2_tilemap; | |
| 199 | tilemap_t * m_alpha_tilemap; | |
| 200 | tilemap_t * m_alpha2_tilemap; | |
| 156 | 201 | |
| 157 | 202 | optional_shared_ptr<UINT16> m_atarivc_data; |
| 158 | 203 | optional_shared_ptr<UINT16> m_atarivc_eof_data; |
| 159 | atarivc_state_desc m_atarivc_state; | |
| 204 | atarivc_state_desc m_atarivc_state; | |
| 160 | 205 | |
| 161 | 206 | /* internal state */ |
| 162 | | |
| 207 | bool m_eeprom_unlocked; | |
| 163 | 208 | |
| 164 | UINT8 m_eeprom_unlocked; | |
| 165 | ||
| 166 | 209 | UINT8 m_slapstic_num; |
| 167 | 210 | UINT16 * m_slapstic; |
| 168 | 211 | UINT8 m_slapstic_bank; |
| 169 | | |
| 212 | dynamic_buffer m_slapstic_bank0; | |
| 170 | 213 | offs_t m_slapstic_last_pc; |
| 171 | 214 | offs_t m_slapstic_last_address; |
| 172 | 215 | offs_t m_slapstic_base; |
| 173 | 216 | offs_t m_slapstic_mirror; |
| 174 | 217 | |
| 175 | device_ | |
| 218 | optional_device<m6502_device> m_sound_cpu; | |
| 176 | 219 | UINT8 m_cpu_to_sound; |
| 177 | 220 | UINT8 m_sound_to_cpu; |
| 178 | 221 | UINT8 m_timed_int; |
| 179 | 222 | UINT8 m_ym2151_int; |
| 180 | 223 | |
| 181 | atarigen_scanline_func m_scanline_callback; | |
| 182 | 224 | UINT32 m_scanlines_per_callback; |
| 183 | 225 | |
| 184 | 226 | UINT32 m_actual_vc_latch0; |
| r18571 | r18572 | |
| 189 | 231 | UINT32 m_playfield2_latch; |
| 190 | 232 | |
| 191 | 233 | atarigen_screen_timer m_screen_timer[2]; |
| 192 | ||
| 193 | DECLARE_DIRECT_UPDATE_MEMBER(atarigen_slapstic_setdirect); | |
| 194 | 234 | }; |
| 195 | 235 | |
| 196 | 236 | |
| r18571 | r18572 | |
| 200 | 240 | ***************************************************************************/ |
| 201 | 241 | |
| 202 | 242 | /*--------------------------------------------------------------- |
| 203 | OVERALL INIT | |
| 204 | ---------------------------------------------------------------*/ | |
| 205 | ||
| 206 | void atarigen_init(running_machine &machine); | |
| 207 | ||
| 208 | ||
| 209 | /*--------------------------------------------------------------- | |
| 210 | 243 | INTERRUPT HANDLING |
| 211 | 244 | ---------------------------------------------------------------*/ |
| 212 | 245 | |
| 213 | void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int); | |
| 214 | void atarigen_update_interrupts(running_machine &machine); | |
| 215 | ||
| 216 | void atarigen_scanline_int_set(screen_device &screen, int scanline); | |
| 217 | INTERRUPT_GEN( atarigen_scanline_int_gen ); | |
| 218 | DECLARE_WRITE16_HANDLER( atarigen_scanline_int_ack_w ); | |
| 219 | DECLARE_WRITE32_HANDLER( atarigen_scanline_int_ack32_w ); | |
| 220 | ||
| 221 | 246 | INTERRUPT_GEN( atarigen_sound_int_gen ); |
| 222 | 247 | DECLARE_WRITE16_HANDLER( atarigen_sound_int_ack_w ); |
| 223 | 248 | DECLARE_WRITE32_HANDLER( atarigen_sound_int_ack32_w ); |
| r18571 | r18572 | |
| 231 | 256 | EEPROM HANDLING |
| 232 | 257 | ---------------------------------------------------------------*/ |
| 233 | 258 | |
| 234 | void atarigen_eeprom_reset(atarigen_state *state); | |
| 235 | ||
| 236 | 259 | DECLARE_WRITE16_HANDLER( atarigen_eeprom_enable_w ); |
| 237 | 260 | DECLARE_WRITE16_HANDLER( atarigen_eeprom_w ); |
| 238 | 261 | DECLARE_READ16_HANDLER( atarigen_eeprom_r ); |
| r18571 | r18572 | |
| 244 | 267 | |
| 245 | 268 | |
| 246 | 269 | /*--------------------------------------------------------------- |
| 247 | SLAPSTIC HANDLING | |
| 248 | ---------------------------------------------------------------*/ | |
| 249 | ||
| 250 | void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int chipnum); | |
| 251 | void atarigen_slapstic_reset(atarigen_state *state); | |
| 252 | ||
| 253 | DECLARE_WRITE16_HANDLER( atarigen_slapstic_w ); | |
| 254 | DECLARE_READ16_HANDLER( atarigen_slapstic_r ); | |
| 255 | ||
| 256 | ||
| 257 | /*--------------------------------------------------------------- | |
| 258 | SOUND I/O | |
| 259 | ---------------------------------------------------------------*/ | |
| 260 | ||
| 261 | void atarigen_sound_io_reset(device_t *device); | |
| 262 | ||
| 263 | INTERRUPT_GEN( atarigen_6502_irq_gen ); | |
| 264 | DECLARE_READ8_HANDLER( atarigen_6502_irq_ack_r ); | |
| 265 | DECLARE_WRITE8_HANDLER( atarigen_6502_irq_ack_w ); | |
| 266 | ||
| 267 | DECLARE_WRITE16_HANDLER( atarigen_sound_w ); | |
| 268 | DECLARE_READ16_HANDLER( atarigen_sound_r ); | |
| 269 | DECLARE_WRITE16_HANDLER( atarigen_sound_upper_w ); | |
| 270 | DECLARE_READ16_HANDLER( atarigen_sound_upper_r ); | |
| 271 | ||
| 272 | DECLARE_WRITE32_HANDLER( atarigen_sound_upper32_w ); | |
| 273 | DECLARE_READ32_HANDLER( atarigen_sound_upper32_r ); | |
| 274 | ||
| 275 | void atarigen_sound_reset(running_machine &machine); | |
| 276 | DECLARE_WRITE16_HANDLER( atarigen_sound_reset_w ); | |
| 277 | DECLARE_WRITE8_HANDLER( atarigen_6502_sound_w ); | |
| 278 | DECLARE_READ8_HANDLER( atarigen_6502_sound_r ); | |
| 279 | ||
| 280 | ||
| 281 | /*--------------------------------------------------------------- | |
| 282 | SOUND HELPERS | |
| 283 | ---------------------------------------------------------------*/ | |
| 284 | ||
| 285 | void atarigen_set_ym2151_vol(running_machine &machine, int volume); | |
| 286 | void atarigen_set_ym2413_vol(running_machine &machine, int volume); | |
| 287 | void atarigen_set_pokey_vol(running_machine &machine, int volume); | |
| 288 | void atarigen_set_tms5220_vol(running_machine &machine, int volume); | |
| 289 | void atarigen_set_oki6295_vol(running_machine &machine, int volume); | |
| 290 | ||
| 291 | ||
| 292 | /*--------------------------------------------------------------- | |
| 293 | 270 | VIDEO CONTROLLER |
| 294 | 271 | ---------------------------------------------------------------*/ |
| 295 | 272 | |
| r18571 | r18572 | |
| 329 | 306 | VIDEO HELPERS |
| 330 | 307 | ---------------------------------------------------------------*/ |
| 331 | 308 | |
| 332 | void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func update_graphics, int frequency); | |
| 333 | 309 | int atarigen_get_hblank(screen_device &screen); |
| 334 | void atarigen_halt_until_hblank_0(screen_device &screen); | |
| 335 | 310 | DECLARE_WRITE16_HANDLER( atarigen_666_paletteram_w ); |
| 336 | 311 | DECLARE_WRITE16_HANDLER( atarigen_expanded_666_paletteram_w ); |
| 337 | 312 | DECLARE_WRITE32_HANDLER( atarigen_666_paletteram32_w ); |
| r18571 | r18572 | |
|---|---|---|
| 36 | 36 | *************************************/ |
| 37 | 37 | |
| 38 | 38 | |
| 39 | static void hd68k_update_interrupts(running_machine &machine); | |
| 40 | ||
| 41 | ||
| 42 | ||
| 43 | 39 | #if 0 |
| 44 | 40 | #pragma mark * DRIVER/MULTISYNC BOARD |
| 45 | 41 | #endif |
| r18571 | r18572 | |
| 53 | 49 | |
| 54 | 50 | MACHINE_START_MEMBER(harddriv_state,harddriv) |
| 55 | 51 | { |
| 52 | atarigen_state::machine_start(); | |
| 56 | 53 | |
| 57 | atarigen_init(machine()); | |
| 58 | ||
| 59 | 54 | /* predetermine memory regions */ |
| 60 | 55 | m_sim_memory = (UINT16 *)memregion("user1")->base(); |
| 61 | 56 | m_sim_memory_size = memregion("user1")->bytes() / 2; |
| r18571 | r18572 | |
| 65 | 60 | |
| 66 | 61 | MACHINE_RESET_MEMBER(harddriv_state,harddriv) |
| 67 | 62 | { |
| 68 | ||
| 69 | 63 | /* generic reset */ |
| 70 | atarigen_e | |
| 64 | atarigen_state::machine_reset(); | |
| 71 | 65 | slapstic_reset(); |
| 72 | atarigen_interrupt_reset(this, hd68k_update_interrupts); | |
| 73 | 66 | |
| 74 | 67 | /* halt several of the DSPs to start */ |
| 75 | 68 | if (m_adsp != NULL) m_adsp->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| r18571 | r18572 | |
| 78 | 71 | |
| 79 | 72 | /* if we found a 6502, reset the JSA board */ |
| 80 | 73 | if (m_jsacpu != NULL) |
| 81 | atarijsa_reset(); | |
| 74 | atarijsa_reset(machine()); | |
| 82 | 75 | |
| 83 | 76 | m_last_gsp_shiftreg = 0; |
| 84 | 77 | |
| r18571 | r18572 | |
| 101 | 94 | * |
| 102 | 95 | *************************************/ |
| 103 | 96 | |
| 104 | ||
| 97 | void harddriv_state::update_interrupts() | |
| 105 | 98 | { |
| 106 | harddriv_state *state = machine.driver_data<harddriv_state>(); | |
| 107 | state->m_maincpu->set_input_line(1, state->m_msp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 108 | state->m_maincpu->set_input_line(2, state->m_adsp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 109 | state->m_maincpu->set_input_line(3, state->m_gsp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 110 | state->m_maincpu->set_input_line(4, state->m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); /* /LINKIRQ on STUN Runner */ | |
| 111 | state->m_maincpu->set_input_line(5, state->m_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 112 | state->m_maincpu->set_input_line(6, state->m_duart_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 99 | m_maincpu->set_input_line(1, m_msp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 100 | m_maincpu->set_input_line(2, m_adsp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 101 | m_maincpu->set_input_line(3, m_gsp_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 102 | m_maincpu->set_input_line(4, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE); /* /LINKIRQ on STUN Runner */ | |
| 103 | m_maincpu->set_input_line(5, m_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 104 | m_maincpu->set_input_line(6, m_duart_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 113 | 105 | } |
| 114 | 106 | |
| 115 | 107 | |
| 116 | 108 | INTERRUPT_GEN_MEMBER(harddriv_state::hd68k_irq_gen) |
| 117 | 109 | { |
| 118 | 110 | m_irq_state = 1; |
| 119 | | |
| 111 | update_interrupts(); | |
| 120 | 112 | } |
| 121 | 113 | |
| 122 | 114 | |
| r18571 | r18572 | |
| 124 | 116 | { |
| 125 | 117 | harddriv_state *state = space.machine().driver_data<harddriv_state>(); |
| 126 | 118 | state->m_irq_state = 0; |
| 127 | | |
| 119 | state->update_interrupts(); | |
| 128 | 120 | } |
| 129 | 121 | |
| 130 | 122 | |
| r18571 | r18572 | |
| 132 | 124 | { |
| 133 | 125 | harddriv_state *state = device->machine().driver_data<harddriv_state>(); |
| 134 | 126 | state->m_gsp_irq_state = irqstate; |
| 135 | | |
| 127 | state->update_interrupts(); | |
| 136 | 128 | } |
| 137 | 129 | |
| 138 | 130 | |
| r18571 | r18572 | |
| 140 | 132 | { |
| 141 | 133 | harddriv_state *state = device->machine().driver_data<harddriv_state>(); |
| 142 | 134 | state->m_msp_irq_state = irqstate; |
| 143 | | |
| 135 | state->update_interrupts(); | |
| 144 | 136 | } |
| 145 | 137 | |
| 146 | 138 | |
| r18571 | r18572 | |
| 317 | 309 | { |
| 318 | 310 | harddriv_state *state = space.machine().driver_data<harddriv_state>(); |
| 319 | 311 | if (state->m_jsacpu != NULL) |
| 320 | atarijsa_reset(); | |
| 312 | atarijsa_reset(space.machine()); | |
| 321 | 313 | return ~0; |
| 322 | 314 | } |
| 323 | 315 | |
| r18571 | r18572 | |
| 477 | 469 | { |
| 478 | 470 | harddriv_state *hd_state = device->machine().driver_data<harddriv_state>(); |
| 479 | 471 | hd_state->m_duart_irq_state = state; |
| 480 | | |
| 472 | hd_state->update_interrupts(); | |
| 481 | 473 | } |
| 482 | 474 | |
| 483 | 475 | |
| r18571 | r18572 | |
| 756 | 748 | harddriv_state *state = space.machine().driver_data<harddriv_state>(); |
| 757 | 749 | logerror("%06X:68k clears ADSP interrupt\n", space.device().safe_pcbase()); |
| 758 | 750 | state->m_adsp_irq_state = 0; |
| 759 | | |
| 751 | state->update_interrupts(); | |
| 760 | 752 | } |
| 761 | 753 | |
| 762 | 754 | |
| r18571 | r18572 | |
| 830 | 822 | case 6: /* /GINT */ |
| 831 | 823 | logerror("%04X:ADSP signals interrupt\n", space.device().safe_pcbase()); |
| 832 | 824 | state->m_adsp_irq_state = 1; |
| 833 | | |
| 825 | state->update_interrupts(); | |
| 834 | 826 | break; |
| 835 | 827 | |
| 836 | 828 | case 7: /* /MP */ |
| r18571 | r18572 | |
| 1087 | 1079 | case 1: |
| 1088 | 1080 | logerror("%04X:ADSP sets interrupt = %d\n", space.device().safe_pcbase(), (data >> 1) & 1); |
| 1089 | 1081 | state->m_adsp_irq_state = (data >> 1) & 1; |
| 1090 | | |
| 1082 | state->update_interrupts(); | |
| 1091 | 1083 | break; |
| 1092 | 1084 | |
| 1093 | 1085 | case 2: |
| r18571 | r18572 | |
| 1180 | 1172 | { |
| 1181 | 1173 | atarigen_state *atarigen = device.machine().driver_data<atarigen_state>(); |
| 1182 | 1174 | atarigen->m_sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0); |
| 1183 | | |
| 1175 | atarigen->update_interrupts(); | |
| 1184 | 1176 | } |
| 1185 | 1177 | |
| 1186 | 1178 |
| r18571 | r18572 | |
|---|---|---|
| 256 | 256 | * |
| 257 | 257 | *************************************/ |
| 258 | 258 | |
| 259 | void cyberbal_scanline_update(screen_device &screen, int scanline) | |
| 259 | void cyberbal_state::scanline_update(screen_device &screen, int scanline) | |
| 260 | 260 | { |
| 261 | cyberbal_state *state = screen.machine().driver_data<cyberbal_state>(); | |
| 262 | 261 | int i; |
| 263 | 262 | screen_device *update_screen; |
| 264 | 263 | |
| 265 | 264 | /* loop over screens */ |
| 266 | screen_device_iterator iter( | |
| 265 | screen_device_iterator iter(*this); | |
| 267 | 266 | for (i = 0, update_screen = iter.first(); update_screen != NULL; i++, update_screen = iter.next()) |
| 268 | 267 | { |
| 269 | UINT16 *vram = i ? | |
| 268 | UINT16 *vram = i ? m_alpha2 : m_alpha; | |
| 270 | 269 | UINT16 *base = &vram[((scanline - 8) / 8) * 64 + 47]; |
| 271 | 270 | |
| 272 | 271 | /* keep in range */ |
| r18571 | r18572 | |
| 278 | 277 | /* update the current parameters */ |
| 279 | 278 | if (!(base[3] & 1)) |
| 280 | 279 | { |
| 281 | if (((base[3] >> 1) & 7) != | |
| 280 | if (((base[3] >> 1) & 7) != m_playfield_palette_bank[i]) | |
| 282 | 281 | { |
| 283 | 282 | if (scanline > 0) |
| 284 | 283 | update_screen->update_partial(scanline - 1); |
| 285 | state->m_playfield_palette_bank[i] = (base[3] >> 1) & 7; | |
| 286 | (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_palette_offset(state->m_playfield_palette_bank[i] << 8); | |
| 284 | m_playfield_palette_bank[i] = (base[3] >> 1) & 7; | |
| 285 | (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_palette_offset(m_playfield_palette_bank[i] << 8); | |
| 287 | 286 | } |
| 288 | 287 | } |
| 289 | 288 | if (!(base[4] & 1)) |
| 290 | 289 | { |
| 291 | 290 | int newscroll = 2 * (((base[4] >> 7) + 4) & 0x1ff); |
| 292 | if (newscroll != | |
| 291 | if (newscroll != m_playfield_xscroll[i]) | |
| 293 | 292 | { |
| 294 | 293 | if (scanline > 0) |
| 295 | 294 | update_screen->update_partial(scanline - 1); |
| 296 | (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_scrollx(0, newscroll); | |
| 297 | state->m_playfield_xscroll[i] = newscroll; | |
| 295 | (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_scrollx(0, newscroll); | |
| 296 | m_playfield_xscroll[i] = newscroll; | |
| 298 | 297 | } |
| 299 | 298 | } |
| 300 | 299 | if (!(base[5] & 1)) |
| 301 | 300 | { |
| 302 | 301 | /* a new vscroll latches the offset into a counter; we must adjust for this */ |
| 303 | 302 | int newscroll = ((base[5] >> 7) - (scanline)) & 0x1ff; |
| 304 | if (newscroll != | |
| 303 | if (newscroll != m_playfield_yscroll[i]) | |
| 305 | 304 | { |
| 306 | 305 | if (scanline > 0) |
| 307 | 306 | update_screen->update_partial(scanline - 1); |
| 308 | (i ? state->m_playfield2_tilemap : state->m_playfield_tilemap)->set_scrolly(0, newscroll); | |
| 309 | state->m_playfield_yscroll[i] = newscroll; | |
| 307 | (i ? m_playfield2_tilemap : m_playfield_tilemap)->set_scrolly(0, newscroll); | |
| 308 | m_playfield_yscroll[i] = newscroll; | |
| 310 | 309 | } |
| 311 | 310 | } |
| 312 | 311 | if (!(base[7] & 1)) |
| 313 | 312 | { |
| 314 | if ( | |
| 313 | if (m_current_slip[i] != base[7]) | |
| 315 | 314 | { |
| 316 | 315 | if (scanline > 0) |
| 317 | 316 | update_screen->update_partial(scanline - 1); |
| 318 | | |
| 317 | m_current_slip[i] = base[7]; | |
| 319 | 318 | } |
| 320 | 319 | } |
| 321 | 320 | } |
| r18571 | r18572 | |
|---|---|---|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| 111 | void atarigx2_scanline_update(screen_device &screen, int scanline) | |
| 111 | void atarigx2_state::scanline_update(screen_device &screen, int scanline) | |
| 112 | 112 | { |
| 113 | atarigx2_state *state = screen.machine().driver_data<atarigx2_state>(); | |
| 114 | UINT32 *base = &state->m_alpha32[(scanline / 8) * 32 + 24]; | |
| 113 | UINT32 *base = &m_alpha32[(scanline / 8) * 32 + 24]; | |
| 115 | 114 | int i; |
| 116 | 115 | |
| 117 | 116 | if (scanline == 0) logerror("-------\n"); |
| 118 | 117 | |
| 119 | 118 | /* keep in range */ |
| 120 | if (base >= & | |
| 119 | if (base >= &m_alpha32[0x400]) | |
| 121 | 120 | return; |
| 122 | 121 | |
| 123 | 122 | /* update the playfield scrolls */ |
| r18571 | r18572 | |
| 129 | 128 | { |
| 130 | 129 | int newscroll = (word >> 21) & 0x3ff; |
| 131 | 130 | int newbank = (word >> 16) & 0x1f; |
| 132 | if (newscroll != | |
| 131 | if (newscroll != m_playfield_xscroll) | |
| 133 | 132 | { |
| 134 | 133 | if (scanline + i > 0) |
| 135 | 134 | screen.update_partial(scanline + i - 1); |
| 136 | state->m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 137 | state->m_playfield_xscroll = newscroll; | |
| 135 | m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 136 | m_playfield_xscroll = newscroll; | |
| 138 | 137 | } |
| 139 | if (newbank != | |
| 138 | if (newbank != m_playfield_color_bank) | |
| 140 | 139 | { |
| 141 | 140 | if (scanline + i > 0) |
| 142 | 141 | screen.update_partial(scanline + i - 1); |
| 143 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 144 | state->m_playfield_color_bank = newbank; | |
| 142 | m_playfield_tilemap->mark_all_dirty(); | |
| 143 | m_playfield_color_bank = newbank; | |
| 145 | 144 | } |
| 146 | 145 | } |
| 147 | 146 | |
| r18571 | r18572 | |
| 149 | 148 | { |
| 150 | 149 | int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; |
| 151 | 150 | int newbank = word & 15; |
| 152 | if (newscroll != | |
| 151 | if (newscroll != m_playfield_yscroll) | |
| 153 | 152 | { |
| 154 | 153 | if (scanline + i > 0) |
| 155 | 154 | screen.update_partial(scanline + i - 1); |
| 156 | state->m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 157 | state->m_playfield_yscroll = newscroll; | |
| 155 | m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 156 | m_playfield_yscroll = newscroll; | |
| 158 | 157 | } |
| 159 | if (newbank != | |
| 158 | if (newbank != m_playfield_tile_bank) | |
| 160 | 159 | { |
| 161 | 160 | if (scanline + i > 0) |
| 162 | 161 | screen.update_partial(scanline + i - 1); |
| 163 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 164 | state->m_playfield_tile_bank = newbank; | |
| 162 | m_playfield_tilemap->mark_all_dirty(); | |
| 163 | m_playfield_tile_bank = newbank; | |
| 165 | 164 | } |
| 166 | 165 | } |
| 167 | 166 | } |
| r18571 | r18572 | |
|---|---|---|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | void atarig1_scanline_update(screen_device &screen, int scanline) | |
| 90 | void atarig1_state::scanline_update(screen_device &screen, int scanline) | |
| 91 | 91 | { |
| 92 | atarig1_state *state = screen.machine().driver_data<atarig1_state>(); | |
| 93 | UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 48]; | |
| 92 | UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48]; | |
| 94 | 93 | int i; |
| 95 | 94 | |
| 96 | 95 | //if (scanline == 0) logerror("-------\n"); |
| 97 | 96 | |
| 98 | 97 | /* keep in range */ |
| 99 | if (base >= & | |
| 98 | if (base >= &m_alpha[0x800]) | |
| 100 | 99 | return; |
| 101 | 100 | screen.update_partial(MAX(scanline - 1, 0)); |
| 102 | 101 | |
| r18571 | r18572 | |
| 109 | 108 | word = *base++; |
| 110 | 109 | if (word & 0x8000) |
| 111 | 110 | { |
| 112 | int newscroll = ((word >> 6) + state->m_pfscroll_xoffset) & 0x1ff; | |
| 113 | if (newscroll != state->m_playfield_xscroll) | |
| 111 | int newscroll = ((word >> 6) + m_pfscroll_xoffset) & 0x1ff; | |
| 112 | if (newscroll != m_playfield_xscroll) | |
| 114 | 113 | { |
| 115 | 114 | screen.update_partial(MAX(scanline + i - 1, 0)); |
| 116 | state->m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 117 | state->m_playfield_xscroll = newscroll; | |
| 115 | m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 116 | m_playfield_xscroll = newscroll; | |
| 118 | 117 | } |
| 119 | 118 | } |
| 120 | 119 | |
| r18571 | r18572 | |
| 124 | 123 | { |
| 125 | 124 | int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; |
| 126 | 125 | int newbank = word & 7; |
| 127 | if (newscroll != | |
| 126 | if (newscroll != m_playfield_yscroll) | |
| 128 | 127 | { |
| 129 | 128 | screen.update_partial(MAX(scanline + i - 1, 0)); |
| 130 | state->m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 131 | state->m_playfield_yscroll = newscroll; | |
| 129 | m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 130 | m_playfield_yscroll = newscroll; | |
| 132 | 131 | } |
| 133 | if (newbank != | |
| 132 | if (newbank != m_playfield_tile_bank) | |
| 134 | 133 | { |
| 135 | 134 | screen.update_partial(MAX(scanline + i - 1, 0)); |
| 136 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 137 | state->m_playfield_tile_bank = newbank; | |
| 135 | m_playfield_tilemap->mark_all_dirty(); | |
| 136 | m_playfield_tile_bank = newbank; | |
| 138 | 137 | } |
| 139 | 138 | } |
| 140 | 139 | } |
| r18571 | r18572 | |
|---|---|---|
| 224 | 224 | if (diff & 0x0080) |
| 225 | 225 | { |
| 226 | 226 | space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE); |
| 227 | if (!(newselect & 0x0080)) | |
| 227 | if (!(newselect & 0x0080)) state->sound_cpu_reset(); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /* if MO or playfield banks change, force a partial update */ |
| r18571 | r18572 | |
| 386 | 386 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 387 | 387 | |
| 388 | 388 | /* clear the state */ |
| 389 | | |
| 389 | scanline_int_ack_w(space, 0, 0); | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
| r18571 | r18572 | |
| 395 | 395 | int scanline = param; |
| 396 | 396 | |
| 397 | 397 | /* update the state */ |
| 398 | | |
| 398 | scanline_int_gen(*subdevice("maincpu")); | |
| 399 | 399 | |
| 400 | 400 | /* set a timer to turn it off */ |
| 401 | 401 | m_int3off_timer->adjust(machine().primary_screen->scan_period()); |
| r18571 | r18572 | |
|---|---|---|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| 111 | void atarig42_scanline_update(screen_device &screen, int scanline) | |
| 111 | void atarig42_state::scanline_update(screen_device &screen, int scanline) | |
| 112 | 112 | { |
| 113 | atarig42_state *state = screen.machine().driver_data<atarig42_state>(); | |
| 114 | UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 48]; | |
| 113 | UINT16 *base = &m_alpha[(scanline / 8) * 64 + 48]; | |
| 115 | 114 | int i; |
| 116 | 115 | |
| 117 | 116 | if (scanline == 0) logerror("-------\n"); |
| 118 | 117 | |
| 119 | 118 | /* keep in range */ |
| 120 | if (base >= & | |
| 119 | if (base >= &m_alpha[0x800]) | |
| 121 | 120 | return; |
| 122 | 121 | |
| 123 | 122 | /* update the playfield scrolls */ |
| r18571 | r18572 | |
| 130 | 129 | { |
| 131 | 130 | int newscroll = (word >> 5) & 0x3ff; |
| 132 | 131 | int newbank = word & 0x1f; |
| 133 | if (newscroll != | |
| 132 | if (newscroll != m_playfield_xscroll) | |
| 134 | 133 | { |
| 135 | 134 | if (scanline + i > 0) |
| 136 | 135 | screen.update_partial(scanline + i - 1); |
| 137 | state->m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 138 | state->m_playfield_xscroll = newscroll; | |
| 136 | m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 137 | m_playfield_xscroll = newscroll; | |
| 139 | 138 | } |
| 140 | if (newbank != | |
| 139 | if (newbank != m_playfield_color_bank) | |
| 141 | 140 | { |
| 142 | 141 | if (scanline + i > 0) |
| 143 | 142 | screen.update_partial(scanline + i - 1); |
| 144 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 145 | state->m_playfield_color_bank = newbank; | |
| 143 | m_playfield_tilemap->mark_all_dirty(); | |
| 144 | m_playfield_color_bank = newbank; | |
| 146 | 145 | } |
| 147 | 146 | } |
| 148 | 147 | |
| r18571 | r18572 | |
| 151 | 150 | { |
| 152 | 151 | int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; |
| 153 | 152 | int newbank = word & 7; |
| 154 | if (newscroll != | |
| 153 | if (newscroll != m_playfield_yscroll) | |
| 155 | 154 | { |
| 156 | 155 | if (scanline + i > 0) |
| 157 | 156 | screen.update_partial(scanline + i - 1); |
| 158 | state->m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 159 | state->m_playfield_yscroll = newscroll; | |
| 157 | m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 158 | m_playfield_yscroll = newscroll; | |
| 160 | 159 | } |
| 161 | if (newbank != | |
| 160 | if (newbank != m_playfield_tile_bank) | |
| 162 | 161 | { |
| 163 | 162 | if (scanline + i > 0) |
| 164 | 163 | screen.update_partial(scanline + i - 1); |
| 165 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 166 | state->m_playfield_tile_bank = newbank; | |
| 164 | m_playfield_tilemap->mark_all_dirty(); | |
| 165 | m_playfield_tile_bank = newbank; | |
| 167 | 166 | } |
| 168 | 167 | } |
| 169 | 168 | } |
| r18571 | r18572 | |
|---|---|---|
| 136 | 136 | * |
| 137 | 137 | *************************************/ |
| 138 | 138 | |
| 139 | void vindictr_scanline_update(screen_device &screen, int scanline) | |
| 139 | void vindictr_state::scanline_update(screen_device &screen, int scanline) | |
| 140 | 140 | { |
| 141 | vindictr_state *state = screen.machine().driver_data<vindictr_state>(); | |
| 142 | UINT16 *base = &state->m_alpha[((scanline - 8) / 8) * 64 + 42]; | |
| 141 | UINT16 *base = &m_alpha[((scanline - 8) / 8) * 64 + 42]; | |
| 143 | 142 | int x; |
| 144 | 143 | |
| 145 | 144 | /* keep in range */ |
| 146 | if (base < | |
| 145 | if (base < m_alpha) | |
| 147 | 146 | base += 0x7c0; |
| 148 | else if (base >= & | |
| 147 | else if (base >= &m_alpha[0x7c0]) | |
| 149 | 148 | return; |
| 150 | 149 | |
| 151 | 150 | /* update the current parameters */ |
| r18571 | r18572 | |
| 156 | 155 | switch ((data >> 9) & 7) |
| 157 | 156 | { |
| 158 | 157 | case 2: /* /PFB */ |
| 159 | if ( | |
| 158 | if (m_playfield_tile_bank != (data & 7)) | |
| 160 | 159 | { |
| 161 | 160 | screen.update_partial(scanline - 1); |
| 162 | state->m_playfield_tile_bank = data & 7; | |
| 163 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 161 | m_playfield_tile_bank = data & 7; | |
| 162 | m_playfield_tilemap->mark_all_dirty(); | |
| 164 | 163 | } |
| 165 | 164 | break; |
| 166 | 165 | |
| 167 | 166 | case 3: /* /PFHSLD */ |
| 168 | if ( | |
| 167 | if (m_playfield_xscroll != (data & 0x1ff)) | |
| 169 | 168 | { |
| 170 | 169 | screen.update_partial(scanline - 1); |
| 171 | state->m_playfield_tilemap->set_scrollx(0, data); | |
| 172 | state->m_playfield_xscroll = data & 0x1ff; | |
| 170 | m_playfield_tilemap->set_scrollx(0, data); | |
| 171 | m_playfield_xscroll = data & 0x1ff; | |
| 173 | 172 | } |
| 174 | 173 | break; |
| 175 | 174 | |
| r18571 | r18572 | |
| 185 | 184 | break; |
| 186 | 185 | |
| 187 | 186 | case 6: /* /VIRQ */ |
| 188 | | |
| 187 | scanline_int_gen(*subdevice("maincpu")); | |
| 189 | 188 | break; |
| 190 | 189 | |
| 191 | 190 | case 7: /* /PFVS */ |
| r18571 | r18572 | |
| 196 | 195 | if (offset > visible_area.max_y) |
| 197 | 196 | offset -= visible_area.max_y + 1; |
| 198 | 197 | |
| 199 | if ( | |
| 198 | if (m_playfield_yscroll != ((data - offset) & 0x1ff)) | |
| 200 | 199 | { |
| 201 | 200 | screen.update_partial(scanline - 1); |
| 202 | | |
| 201 | m_playfield_tilemap->set_scrolly(0, data - offset); | |
| 203 | 202 | atarimo_set_yscroll(0, (data - offset) & 0x1ff); |
| 204 | 203 | } |
| 205 | 204 | break; |
| r18571 | r18572 | |
|---|---|---|
| 162 | 162 | * |
| 163 | 163 | *************************************/ |
| 164 | 164 | |
| 165 | void atarigt_scanline_update(screen_device &screen, int scanline) | |
| 165 | void atarigt_state::scanline_update(screen_device &screen, int scanline) | |
| 166 | 166 | { |
| 167 | atarigt_state *state = screen.machine().driver_data<atarigt_state>(); | |
| 168 | UINT32 *base = &state->m_alpha32[(scanline / 8) * 32 + 24]; | |
| 167 | UINT32 *base = &m_alpha32[(scanline / 8) * 32 + 24]; | |
| 169 | 168 | int i; |
| 170 | 169 | |
| 171 | 170 | /* keep in range */ |
| 172 | if (base >= & | |
| 171 | if (base >= &m_alpha32[0x400]) | |
| 173 | 172 | return; |
| 174 | 173 | |
| 175 | 174 | /* update the playfield scrolls */ |
| r18571 | r18572 | |
| 181 | 180 | { |
| 182 | 181 | int newscroll = (word >> 21) & 0x3ff; |
| 183 | 182 | int newbank = (word >> 16) & 0x1f; |
| 184 | if (newscroll != | |
| 183 | if (newscroll != m_playfield_xscroll) | |
| 185 | 184 | { |
| 186 | 185 | if (scanline + i > 0) |
| 187 | 186 | screen.update_partial(scanline + i - 1); |
| 188 | state->m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 189 | state->m_playfield_xscroll = newscroll; | |
| 187 | m_playfield_tilemap->set_scrollx(0, newscroll); | |
| 188 | m_playfield_xscroll = newscroll; | |
| 190 | 189 | } |
| 191 | if (newbank != | |
| 190 | if (newbank != m_playfield_color_bank) | |
| 192 | 191 | { |
| 193 | 192 | if (scanline + i > 0) |
| 194 | 193 | screen.update_partial(scanline + i - 1); |
| 195 | state->m_playfield_tilemap->set_palette_offset((newbank & 0x1f) << 8); | |
| 196 | state->m_playfield_color_bank = newbank; | |
| 194 | m_playfield_tilemap->set_palette_offset((newbank & 0x1f) << 8); | |
| 195 | m_playfield_color_bank = newbank; | |
| 197 | 196 | } |
| 198 | 197 | } |
| 199 | 198 | |
| r18571 | r18572 | |
| 201 | 200 | { |
| 202 | 201 | int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; |
| 203 | 202 | int newbank = word & 15; |
| 204 | if (newscroll != | |
| 203 | if (newscroll != m_playfield_yscroll) | |
| 205 | 204 | { |
| 206 | 205 | if (scanline + i > 0) |
| 207 | 206 | screen.update_partial(scanline + i - 1); |
| 208 | state->m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 209 | state->m_playfield_yscroll = newscroll; | |
| 207 | m_playfield_tilemap->set_scrolly(0, newscroll); | |
| 208 | m_playfield_yscroll = newscroll; | |
| 210 | 209 | } |
| 211 | if (newbank != | |
| 210 | if (newbank != m_playfield_tile_bank) | |
| 212 | 211 | { |
| 213 | 212 | if (scanline + i > 0) |
| 214 | 213 | screen.update_partial(scanline + i - 1); |
| 215 | state->m_playfield_tilemap->mark_all_dirty(); | |
| 216 | state->m_playfield_tile_bank = newbank; | |
| 214 | m_playfield_tilemap->mark_all_dirty(); | |
| 215 | m_playfield_tile_bank = newbank; | |
| 217 | 216 | } |
| 218 | 217 | } |
| 219 | 218 | } |
| r18571 | r18572 | |
|---|---|---|
| 117 | 117 | * |
| 118 | 118 | *************************************/ |
| 119 | 119 | |
| 120 | void batman_scanline_update(screen_device &screen, int scanline) | |
| 120 | void batman_state::scanline_update(screen_device &screen, int scanline) | |
| 121 | 121 | { |
| 122 | batman_state *state = screen.machine().driver_data<batman_state>(); | |
| 123 | ||
| 124 | 122 | /* update the scanline parameters */ |
| 125 | if (scanline <= screen.visible_area().max_y && | |
| 123 | if (scanline <= screen.visible_area().max_y && m_atarivc_state.rowscroll_enable) | |
| 126 | 124 | { |
| 127 | UINT16 *base = & | |
| 125 | UINT16 *base = &m_alpha[scanline / 8 * 64 + 48]; | |
| 128 | 126 | int scan, i; |
| 129 | 127 | |
| 130 | 128 | for (scan = 0; scan < 8; scan++, scanline++) |
| r18571 | r18572 | |
| 136 | 134 | case 9: |
| 137 | 135 | if (scanline > 0) |
| 138 | 136 | screen.update_partial(scanline - 1); |
| 139 | state->m_atarivc_state.mo_xscroll = (data >> 7) & 0x1ff; | |
| 140 | atarimo_set_xscroll(0, state->m_atarivc_state.mo_xscroll); | |
| 137 | m_atarivc_state.mo_xscroll = (data >> 7) & 0x1ff; | |
| 138 | atarimo_set_xscroll(0, m_atarivc_state.mo_xscroll); | |
| 141 | 139 | break; |
| 142 | 140 | |
| 143 | 141 | case 10: |
| 144 | 142 | if (scanline > 0) |
| 145 | 143 | screen.update_partial(scanline - 1); |
| 146 | state->m_atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff; | |
| 147 | atarivc_update_pf_xscrolls(state); | |
| 148 | state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll); | |
| 149 | state->m_playfield2_tilemap->set_scrollx(0, state->m_atarivc_state.pf1_xscroll); | |
| 144 | m_atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff; | |
| 145 | atarivc_update_pf_xscrolls(this); | |
| 146 | m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll); | |
| 147 | m_playfield2_tilemap->set_scrollx(0, m_atarivc_state.pf1_xscroll); | |
| 150 | 148 | break; |
| 151 | 149 | |
| 152 | 150 | case 11: |
| 153 | 151 | if (scanline > 0) |
| 154 | 152 | screen.update_partial(scanline - 1); |
| 155 | state->m_atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff; | |
| 156 | atarivc_update_pf_xscrolls(state); | |
| 157 | state->m_playfield_tilemap->set_scrollx(0, state->m_atarivc_state.pf0_xscroll); | |
| 153 | m_atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff; | |
| 154 | atarivc_update_pf_xscrolls(this); | |
| 155 | m_playfield_tilemap->set_scrollx(0, m_atarivc_state.pf0_xscroll); | |
| 158 | 156 | break; |
| 159 | 157 | |
| 160 | 158 | case 13: |
| 161 | 159 | if (scanline > 0) |
| 162 | 160 | screen.update_partial(scanline - 1); |
| 163 | state->m_atarivc_state.mo_yscroll = (data >> 7) & 0x1ff; | |
| 164 | atarimo_set_yscroll(0, state->m_atarivc_state.mo_yscroll); | |
| 161 | m_atarivc_state.mo_yscroll = (data >> 7) & 0x1ff; | |
| 162 | atarimo_set_yscroll(0, m_atarivc_state.mo_yscroll); | |
| 165 | 163 | break; |
| 166 | 164 | |
| 167 | 165 | case 14: |
| 168 | 166 | if (scanline > 0) |
| 169 | 167 | screen.update_partial(scanline - 1); |
| 170 | state->m_atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff; | |
| 171 | state->m_playfield2_tilemap->set_scrolly(0, state->m_atarivc_state.pf1_yscroll); | |
| 168 | m_atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff; | |
| 169 | m_playfield2_tilemap->set_scrolly(0, m_atarivc_state.pf1_yscroll); | |
| 172 | 170 | break; |
| 173 | 171 | |
| 174 | 172 | case 15: |
| 175 | 173 | if (scanline > 0) |
| 176 | 174 | screen.update_partial(scanline - 1); |
| 177 | state->m_atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff; | |
| 178 | state->m_playfield_tilemap->set_scrolly(0, state->m_atarivc_state.pf0_yscroll); | |
| 175 | m_atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff; | |
| 176 | m_playfield_tilemap->set_scrolly(0, m_atarivc_state.pf0_yscroll); | |
| 179 | 177 | break; |
| 180 | 178 | } |
| 181 | 179 | } |
| r18571 | r18572 | |
|---|---|---|
| 205 | 205 | * |
| 206 | 206 | *************************************/ |
| 207 | 207 | |
| 208 | void eprom_scanline_update(screen_device &screen, int scanline) | |
| 208 | void eprom_state::scanline_update(screen_device &screen, int scanline) | |
| 209 | 209 | { |
| 210 | eprom_state *state = screen.machine().driver_data<eprom_state>(); | |
| 211 | ||
| 212 | 210 | /* update the playfield */ |
| 213 | 211 | if (scanline == 0) |
| 214 | 212 | { |
| 215 | int xscroll = (state->m_alpha[0x780] >> 7) & 0x1ff; | |
| 216 | int yscroll = (state->m_alpha[0x781] >> 7) & 0x1ff; | |
| 217 | state->m_playfield_tilemap->set_scrollx(0, xscroll); | |
| 218 | state->m_playfield_tilemap->set_scrolly(0, yscroll); | |
| 213 | int xscroll = (m_alpha[0x780] >> 7) & 0x1ff; | |
| 214 | int yscroll = (m_alpha[0x781] >> 7) & 0x1ff; | |
| 215 | m_playfield_tilemap->set_scrollx(0, xscroll); | |
| 216 | m_playfield_tilemap->set_scrolly(0, yscroll); | |
| 219 | 217 | atarimo_set_xscroll(0, xscroll); |
| 220 | 218 | atarimo_set_yscroll(0, yscroll); |
| 221 | 219 | } |
| r18571 | r18572 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | TIMER_CALLBACK_MEMBER(blstroid_state::irq_off) |
| 91 | 91 | { |
| 92 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
| 93 | ||
| 94 | 92 | /* clear the interrupt */ |
| 95 | atarigen_scanline_int_ack_w(space, 0, 0, 0xffff); | |
| 93 | address_space &space = subdevice("maincpu")->memory().space(AS_PROGRAM); | |
| 94 | scanline_int_ack_w(space, 0, 0); | |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | 97 | |
| 99 | 98 | TIMER_CALLBACK_MEMBER(blstroid_state::irq_on) |
| 100 | 99 | { |
| 101 | 100 | /* generate the interrupt */ |
| 102 | atarigen_scanline_int_gen(machine().device("maincpu")); | |
| 103 | atarigen_update_interrupts(machine()); | |
| 101 | scanline_int_gen(*subdevice("maincpu")); | |
| 102 | update_interrupts(); | |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | |
| 107 | void blstroid_scanline_update(screen_device &screen, int scanline) | |
| 106 | void blstroid_state::scanline_update(screen_device &screen, int scanline) | |
| 108 | 107 | { |
| 109 | blstroid_state *state = screen.machine().driver_data<blstroid_state>(); | |
| 110 | 108 | int offset = (scanline / 8) * 64 + 40; |
| 111 | 109 | |
| 112 | 110 | /* check for interrupts */ |
| 113 | 111 | if (offset < 0x1000) |
| 114 | if ( | |
| 112 | if (m_playfield[offset] & 0x8000) | |
| 115 | 113 | { |
| 116 | 114 | int width, vpos; |
| 117 | 115 | attotime period_on; |
| r18571 | r18572 | |
| 129 | 127 | period_on = screen.time_until_pos(vpos + 7, width * 0.9); |
| 130 | 128 | period_off = screen.time_until_pos(vpos + 8, width * 0.9); |
| 131 | 129 | |
| 132 | screen.machine().scheduler().timer_set(period_on, timer_expired_delegate(FUNC(blstroid_state::irq_on),state)); | |
| 133 | screen.machine().scheduler().timer_set(period_off, timer_expired_delegate(FUNC(blstroid_state::irq_off),state)); | |
| 130 | screen.machine().scheduler().timer_set(period_on, timer_expired_delegate(FUNC(blstroid_state::irq_on), this)); | |
| 131 | screen.machine().scheduler().timer_set(period_off, timer_expired_delegate(FUNC(blstroid_state::irq_off), this)); | |
| 134 | 132 | } |
| 135 | 133 | } |
| 136 | 134 |
| r18571 | r18572 | |
|---|---|---|
| 29 | 29 | UINT16 m_last_write_offset; |
| 30 | 30 | |
| 31 | 31 | device_t * m_rle; |
| 32 | virtual void update_interrupts(); | |
| 33 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 32 | 34 | DECLARE_READ32_MEMBER(special_port2_r); |
| 33 | 35 | DECLARE_READ32_MEMBER(special_port3_r); |
| 34 | 36 | DECLARE_READ32_MEMBER(a2d_data_r); |
| r18571 | r18572 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | double m_brightness; |
| 19 | 19 | bitmap_ind16 m_pfbitmap; |
| 20 | virtual void update_interrupts(); | |
| 20 | 21 | DECLARE_WRITE16_MEMBER(interrupt_scan_w); |
| 21 | 22 | DECLARE_READ16_MEMBER(special_port1_r); |
| 22 | 23 | DECLARE_DRIVER_INIT(toobin); |
| r18571 | r18572 | |
|---|---|---|
| 48 | 48 | UINT8 m_protdata[0x800]; |
| 49 | 49 | |
| 50 | 50 | device_t * m_rle; |
| 51 | virtual void update_interrupts(); | |
| 52 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 51 | 53 | DECLARE_READ32_MEMBER(special_port2_r); |
| 52 | 54 | DECLARE_READ32_MEMBER(special_port3_r); |
| 53 | 55 | DECLARE_READ32_MEMBER(analog_port0_r); |
| r18571 | r18572 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | required_shared_ptr<UINT16> m_bitmap; |
| 17 | 17 | UINT8 m_has_mo; |
| 18 | virtual void update_interrupts(); | |
| 19 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 18 | 20 | DECLARE_WRITE16_MEMBER(latch_w); |
| 19 | 21 | DECLARE_DRIVER_INIT(rampart); |
| 20 | 22 | DECLARE_MACHINE_START(rampart); |
| r18571 | r18572 | |
|---|---|---|
| 15 | 15 | UINT8 m_ym2413_volume; |
| 16 | 16 | UINT8 m_overall_volume; |
| 17 | 17 | UINT32 m_adpcm_bank_base; |
| 18 | virtual void update_interrupts(); | |
| 18 | 19 | DECLARE_READ16_MEMBER(relief_atarivc_r); |
| 19 | 20 | DECLARE_WRITE16_MEMBER(relief_atarivc_w); |
| 20 | 21 | DECLARE_READ16_MEMBER(special_port2_r); |
| r18571 | r18572 | |
|---|---|---|
| 16 | 16 | UINT8 m_vindctr2_screen_refresh; |
| 17 | 17 | UINT8 m_playfield_tile_bank; |
| 18 | 18 | UINT8 m_playfield_color_bank; |
| 19 | virtual void update_interrupts(); | |
| 20 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 19 | 21 | DECLARE_READ16_MEMBER(port4_r); |
| 20 | 22 | DECLARE_WRITE16_MEMBER(sound_reset_w); |
| 21 | 23 | DECLARE_READ8_MEMBER(switch_6502_r); |
| r18571 | r18572 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | required_shared_ptr<UINT16> m_bitmap; |
| 18 | 18 | UINT8 m_has_mo; |
| 19 | virtual void update_interrupts(); | |
| 20 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 19 | 21 | DECLARE_WRITE16_MEMBER(latch_w); |
| 20 | 22 | DECLARE_DRIVER_INIT(sparkz); |
| 21 | 23 | DECLARE_MACHINE_START(arcadecl); |
| r18571 | r18572 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | klax_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | virtual void update_interrupts(); | |
| 15 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 14 | 16 | DECLARE_WRITE16_MEMBER(interrupt_ack_w); |
| 15 | 17 | TILE_GET_INFO_MEMBER(get_playfield_tile_info); |
| 16 | 18 | DECLARE_MACHINE_START(klax); |
| r18571 | r18572 | |
|---|---|---|
| 36 | 36 | protected: |
| 37 | 37 | virtual void machine_start(); |
| 38 | 38 | virtual void video_start(); |
| 39 | ||
| 40 | virtual void update_interrupts() { } | |
| 39 | 41 | |
| 40 | 42 | struct planet; |
| 41 | 43 |
| r18571 | r18572 | |
|---|---|---|
| 53 | 53 | m_ram_base(*this, "ram_base"), |
| 54 | 54 | m_rom_base(*this, "rom_base") { } |
| 55 | 55 | |
| 56 | virtual void machine_start(); | |
| 57 | 56 | virtual void machine_reset(); |
| 58 | 57 | |
| 59 | 58 | virtual void video_start(); |
| r18571 | r18572 | |
| 92 | 91 | UINT32 * m_movie_speedup_data; |
| 93 | 92 | |
| 94 | 93 | // in drivers/beathead.c |
| 95 | void update_interrupts(); | |
| 94 | virtual void update_interrupts(); | |
| 96 | 95 | DECLARE_WRITE32_MEMBER( interrupt_control_w ); |
| 97 | 96 | DECLARE_READ32_MEMBER( interrupt_control_r ); |
| 98 | 97 | DECLARE_WRITE32_MEMBER( eeprom_data_w ); |
| r18571 | r18572 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | skullxbo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | virtual void update_interrupts(); | |
| 15 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 14 | 16 | DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w); |
| 15 | 17 | DECLARE_READ16_MEMBER(special_port1_r); |
| 16 | 18 | DECLARE_WRITE16_MEMBER(skullxbo_mobwr_w); |
| r18571 | r18572 | |
|---|---|---|
| 16 | 16 | int m_video_disable; |
| 17 | 17 | UINT16 * m_sync_data; |
| 18 | 18 | int m_last_offset; |
| 19 | virtual void update_interrupts(); | |
| 20 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 19 | 21 | DECLARE_READ16_MEMBER(special_port1_r); |
| 20 | 22 | DECLARE_READ16_MEMBER(adc_r); |
| 21 | 23 | DECLARE_WRITE16_MEMBER(eprom_latch_w); |
| r18571 | r18572 | |
|---|---|---|
| 43 | 43 | UINT8 m_bank_color_shift[MAX_GFX_ELEMENTS]; |
| 44 | 44 | |
| 45 | 45 | UINT8 m_cur[2][2]; |
| 46 | virtual void update_interrupts(); | |
| 46 | 47 | DECLARE_READ16_MEMBER(joystick_r); |
| 47 | 48 | DECLARE_WRITE16_MEMBER(joystick_w); |
| 48 | 49 | DECLARE_READ16_MEMBER(trakball_r); |
| r18571 | r18572 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | device_t * m_rle; |
| 34 | 34 | UINT32 m_last_accesses[8]; |
| 35 | virtual void update_interrupts(); | |
| 36 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 35 | 37 | DECLARE_READ16_MEMBER(special_port2_r); |
| 36 | 38 | DECLARE_WRITE16_MEMBER(a2d_select_w); |
| 37 | 39 | DECLARE_READ16_MEMBER(a2d_data_r); |
| r18571 | r18572 | |
|---|---|---|
| 15 | 15 | UINT8 m_playfield_tile_bank; |
| 16 | 16 | UINT16 m_playfield_xscroll; |
| 17 | 17 | UINT16 m_playfield_yscroll; |
| 18 | virtual void update_interrupts(); | |
| 19 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 18 | 20 | DECLARE_READ16_MEMBER(port1_r); |
| 19 | 21 | DECLARE_DRIVER_INIT(vindictr); |
| 20 | 22 | TILE_GET_INFO_MEMBER(get_alpha_tile_info); |
| r18571 | r18572 | |
|---|---|---|
| 49 | 49 | UINT32 m_spin_center_count; |
| 50 | 50 | |
| 51 | 51 | UINT16 m_vram[0x8000/2]; |
| 52 | virtual void update_interrupts(); | |
| 53 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 52 | 54 | DECLARE_WRITE16_MEMBER(int0_ack_w); |
| 53 | 55 | DECLARE_WRITE16_MEMBER(int1_ack_w); |
| 54 | 56 | DECLARE_WRITE16_MEMBER(int_enable_w); |
| r18571 | r18572 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | int m_cur[2]; |
| 16 | virtual void update_interrupts(); | |
| 16 | 17 | DECLARE_READ16_MEMBER(shuuz_atarivc_r); |
| 17 | 18 | DECLARE_WRITE16_MEMBER(shuuz_atarivc_w); |
| 18 | 19 | DECLARE_WRITE16_MEMBER(latch_w); |
| r18571 | r18572 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | UINT8 m_whichport; |
| 26 | 26 | required_shared_ptr<UINT16> m_spriteram; |
| 27 | virtual void update_interrupts(); | |
| 27 | 28 | DECLARE_WRITE16_MEMBER(nvram_recall_w); |
| 28 | 29 | DECLARE_WRITE8_MEMBER(digital_w); |
| 29 | 30 | DECLARE_READ16_MEMBER(analog_r); |
| r18571 | r18572 | |
| 36 | 37 | DECLARE_MACHINE_RESET(foodf); |
| 37 | 38 | DECLARE_VIDEO_START(foodf); |
| 38 | 39 | UINT32 screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 39 | TIMER_DEVICE_CALLBACK_MEMBER(scanline_update); | |
| 40 | TIMER_DEVICE_CALLBACK_MEMBER(scanline_update_timer); | |
| 40 | 41 | }; |
| r18571 | r18572 | |
|---|---|---|
| 14 | 14 | m_priorityram(*this, "priorityram") { } |
| 15 | 15 | |
| 16 | 16 | required_shared_ptr<UINT16> m_priorityram; |
| 17 | virtual void update_interrupts(); | |
| 18 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 17 | 19 | DECLARE_WRITE16_MEMBER(blstroid_halt_until_hblank_0_w); |
| 18 | 20 | DECLARE_READ16_MEMBER(inputs_r); |
| 19 | 21 | DECLARE_DRIVER_INIT(blstroid); |
| r18571 | r18572 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | UINT16 m_h256; |
| 16 | virtual void update_interrupts(); | |
| 16 | 17 | DECLARE_READ16_MEMBER(special_port1_r); |
| 17 | 18 | DECLARE_DRIVER_INIT(xybots); |
| 18 | 19 | TILE_GET_INFO_MEMBER(get_alpha_tile_info); |
| r18571 | r18572 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | INT8 m_gfx_finescroll; |
| 175 | 175 | UINT8 m_gfx_palettebank; |
| 176 | virtual void update_interrupts(); | |
| 176 | 177 | DECLARE_READ16_MEMBER(steeltal_dummy_r); |
| 177 | 178 | DECLARE_READ32_MEMBER(rddsp_unmap_r); |
| 178 | 179 | DECLARE_READ16_MEMBER(hd68k_snd_data_r); |
| r18571 | r18572 | |
|---|---|---|
| 28 | 28 | UINT8 m_sound_data_from_6502; |
| 29 | 29 | UINT8 m_sound_data_from_68k_ready; |
| 30 | 30 | UINT8 m_sound_data_from_6502_ready; |
| 31 | virtual void update_interrupts(); | |
| 32 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 31 | 33 | DECLARE_READ16_MEMBER(special_port0_r); |
| 32 | 34 | DECLARE_READ16_MEMBER(special_port2_r); |
| 33 | 35 | DECLARE_READ16_MEMBER(sound_state_r); |
| r18571 | r18572 | |
|---|---|---|
| 15 | 15 | UINT16 m_latch_data; |
| 16 | 16 | |
| 17 | 17 | UINT8 m_alpha_tile_bank; |
| 18 | virtual void update_interrupts(); | |
| 19 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 18 | 20 | DECLARE_READ16_MEMBER(batman_atarivc_r); |
| 19 | 21 | DECLARE_WRITE16_MEMBER(batman_atarivc_w); |
| 20 | 22 | DECLARE_READ16_MEMBER(special_port2_r); |
| r18571 | r18572 | |
|---|---|---|
| 18 | 18 | UINT8 * m_bank_source_data; |
| 19 | 19 | |
| 20 | 20 | UINT8 m_playfield_tile_bank; |
| 21 | virtual void update_interrupts(); | |
| 22 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 21 | 23 | DECLARE_READ16_MEMBER(sound_busy_r); |
| 22 | 24 | DECLARE_READ16_MEMBER(pedal_0_r); |
| 23 | 25 | DECLARE_READ16_MEMBER(pedal_1_r); |
| r18571 | r18572 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | UINT16 *m_spritecache_count; |
| 21 | 21 | UINT16 *m_unknown_verify_base; |
| 22 | virtual void update_interrupts(); | |
| 22 | 23 | DECLARE_READ16_MEMBER(offtwall_atarivc_r); |
| 23 | 24 | DECLARE_WRITE16_MEMBER(offtwall_atarivc_w); |
| 24 | 25 | DECLARE_READ16_MEMBER(special_port3_r); |
| r18571 | r18572 | |
|---|---|---|
| 13 | 13 | : atarigen_state(mconfig, type, tag) { } |
| 14 | 14 | |
| 15 | 15 | UINT8 m_alpha_tile_bank; |
| 16 | virtual void update_interrupts(); | |
| 16 | 17 | DECLARE_READ16_MEMBER(special_port2_r); |
| 17 | 18 | DECLARE_WRITE16_MEMBER(latch_w); |
| 18 | 19 | DECLARE_READ16_MEMBER(thunderj_atarivc_r); |
| r18571 | r18572 | |
|---|---|---|
| 30 | 30 | UINT16 m_playfield_yscroll; |
| 31 | 31 | |
| 32 | 32 | device_t * m_rle; |
| 33 | virtual void update_interrupts(); | |
| 34 | virtual void scanline_update(screen_device &screen, int scanline); | |
| 33 | 35 | DECLARE_WRITE16_MEMBER(mo_control_w); |
| 34 | 36 | DECLARE_WRITE16_MEMBER(mo_command_w); |
| 35 | 37 | DECLARE_READ16_MEMBER(special_port0_r); |
| Previous | 199869 Revisions | Next |