branches/kale/src/mame/drivers/retofinv.c
| r244595 | r244596 | |
| 35 | 35 | #include "includes/retofinv.h" |
| 36 | 36 | |
| 37 | 37 | |
| 38 | void retofinv_state::machine_start() |
| 39 | { |
| 40 | save_item(NAME(m_main_irq_mask)); |
| 41 | save_item(NAME(m_sub_irq_mask)); |
| 42 | save_item(NAME(m_cpu2_m6000)); |
| 43 | |
| 44 | if (m_68705 != NULL) // only for the parent (with MCU) |
| 45 | { |
| 46 | save_item(NAME(m_from_main)); |
| 47 | save_item(NAME(m_from_mcu)); |
| 48 | save_item(NAME(m_mcu_sent)); |
| 49 | save_item(NAME(m_main_sent)); |
| 50 | save_item(NAME(m_portA_in)); |
| 51 | save_item(NAME(m_portA_out)); |
| 52 | save_item(NAME(m_ddrA)); |
| 53 | save_item(NAME(m_portB_in)); |
| 54 | save_item(NAME(m_portB_out)); |
| 55 | save_item(NAME(m_ddrB)); |
| 56 | save_item(NAME(m_portC_in)); |
| 57 | save_item(NAME(m_portC_out)); |
| 58 | save_item(NAME(m_ddrC)); |
| 59 | } |
| 60 | } |
| 38 | 61 | |
| 39 | 62 | WRITE8_MEMBER(retofinv_state::cpu1_reset_w) |
| 40 | 63 | { |
| r244595 | r244596 | |
| 99 | 122 | AM_RANGE(0x7fff, 0x7fff) AM_WRITE(coincounter_w) |
| 100 | 123 | AM_RANGE(0x7b00, 0x7bff) AM_ROM /* space for diagnostic ROM? The code looks */ |
| 101 | 124 | /* for a string here, and jumps if it's present */ |
| 102 | | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(retofinv_fg_videoram_w) AM_SHARE("fg_videoram") |
| 125 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") |
| 103 | 126 | AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE("sharedram") |
| 104 | | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(retofinv_bg_videoram_w) AM_SHARE("bg_videoram") |
| 105 | | AM_RANGE(0xb800, 0xb802) AM_WRITE(retofinv_gfx_ctrl_w) |
| 127 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") |
| 128 | AM_RANGE(0xb800, 0xb802) AM_WRITE(gfx_ctrl_w) |
| 106 | 129 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("P1") |
| 107 | 130 | AM_RANGE(0xc001, 0xc001) AM_READ_PORT("P2") |
| 108 | 131 | AM_RANGE(0xc002, 0xc002) AM_READNOP /* bit 7 must be 0, otherwise game resets */ |
| 109 | | AM_RANGE(0xc003, 0xc003) AM_READ(retofinv_mcu_status_r) |
| 132 | AM_RANGE(0xc003, 0xc003) AM_READ(mcu_status_r) |
| 110 | 133 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM") |
| 111 | 134 | AM_RANGE(0xc005, 0xc005) AM_READ_PORT("DSW1") |
| 112 | 135 | AM_RANGE(0xc006, 0xc006) AM_READ_PORT("DSW2") |
| r244595 | r244596 | |
| 119 | 142 | AM_RANGE(0xc805, 0xc805) AM_WRITE(cpu1_reset_w) |
| 120 | 143 | AM_RANGE(0xd000, 0xd000) AM_WRITE(watchdog_reset_w) |
| 121 | 144 | AM_RANGE(0xd800, 0xd800) AM_WRITE(soundcommand_w) |
| 122 | | AM_RANGE(0xe000, 0xe000) AM_READ(retofinv_mcu_r) |
| 123 | | AM_RANGE(0xe800, 0xe800) AM_WRITE(retofinv_mcu_w) |
| 145 | AM_RANGE(0xe000, 0xe000) AM_READ(mcu_r) |
| 146 | AM_RANGE(0xe800, 0xe800) AM_WRITE(mcu_w) |
| 124 | 147 | AM_RANGE(0xf800, 0xf800) AM_READ(cpu0_mf800_r) |
| 125 | 148 | ADDRESS_MAP_END |
| 126 | 149 | |
| 127 | 150 | static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, retofinv_state ) |
| 128 | 151 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 129 | | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(retofinv_fg_videoram_w) AM_SHARE("fg_videoram") |
| 152 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram") |
| 130 | 153 | AM_RANGE(0x8800, 0x9fff) AM_RAM AM_SHARE("sharedram") |
| 131 | | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(retofinv_bg_videoram_w) AM_SHARE("bg_videoram") |
| 154 | AM_RANGE(0xa000, 0xa7ff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram") |
| 132 | 155 | AM_RANGE(0xc804, 0xc804) AM_WRITE(irq1_ack_w) |
| 133 | 156 | ADDRESS_MAP_END |
| 134 | 157 | |
| r244595 | r244596 | |
| 144 | 167 | |
| 145 | 168 | static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, retofinv_state ) |
| 146 | 169 | ADDRESS_MAP_GLOBAL_MASK(0x7ff) |
| 147 | | AM_RANGE(0x0000, 0x0000) AM_READWRITE(retofinv_68705_portA_r, retofinv_68705_portA_w) |
| 148 | | AM_RANGE(0x0001, 0x0001) AM_READWRITE(retofinv_68705_portB_r, retofinv_68705_portB_w) |
| 149 | | AM_RANGE(0x0002, 0x0002) AM_READWRITE(retofinv_68705_portC_r, retofinv_68705_portC_w) |
| 150 | | AM_RANGE(0x0004, 0x0004) AM_WRITE(retofinv_68705_ddrA_w) |
| 151 | | AM_RANGE(0x0005, 0x0005) AM_WRITE(retofinv_68705_ddrB_w) |
| 152 | | AM_RANGE(0x0006, 0x0006) AM_WRITE(retofinv_68705_ddrC_w) |
| 170 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(mcu_portA_r, mcu_portA_w) |
| 171 | AM_RANGE(0x0001, 0x0001) AM_READWRITE(mcu_portB_r, mcu_portB_w) |
| 172 | AM_RANGE(0x0002, 0x0002) AM_READWRITE(mcu_portC_r, mcu_portC_w) |
| 173 | AM_RANGE(0x0004, 0x0004) AM_WRITE(mcu_ddrA_w) |
| 174 | AM_RANGE(0x0005, 0x0005) AM_WRITE(mcu_ddrB_w) |
| 175 | AM_RANGE(0x0006, 0x0006) AM_WRITE(mcu_ddrC_w) |
| 153 | 176 | AM_RANGE(0x0010, 0x007f) AM_RAM |
| 154 | 177 | AM_RANGE(0x0080, 0x07ff) AM_ROM |
| 155 | 178 | ADDRESS_MAP_END |
| r244595 | r244596 | |
| 367 | 390 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 368 | 391 | MCFG_SCREEN_SIZE(36*8, 28*8) |
| 369 | 392 | MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1) |
| 370 | | MCFG_SCREEN_UPDATE_DRIVER(retofinv_state, screen_update_retofinv) |
| 393 | MCFG_SCREEN_UPDATE_DRIVER(retofinv_state, screen_update) |
| 371 | 394 | MCFG_SCREEN_PALETTE("palette") |
| 372 | 395 | |
| 373 | 396 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", retofinv) |
| r244595 | r244596 | |
| 501 | 524 | |
| 502 | 525 | |
| 503 | 526 | |
| 504 | | GAME( 1985, retofinv, 0, retofinv, retofinv, driver_device, 0, ROT90, "Taito Corporation", "Return of the Invaders", 0 ) |
| 505 | | GAME( 1985, retofinv1,retofinv, retofinb, retofinv, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 1)", 0 ) |
| 506 | | GAME( 1985, retofinv2,retofinv, retofinb, retofin2, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 2)", 0 ) |
| 527 | GAME( 1985, retofinv, 0, retofinv, retofinv, driver_device, 0, ROT90, "Taito Corporation", "Return of the Invaders", GAME_SUPPORTS_SAVE ) |
| 528 | GAME( 1985, retofinv1,retofinv, retofinb, retofinv, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 1)", GAME_SUPPORTS_SAVE ) |
| 529 | GAME( 1985, retofinv2,retofinv, retofinb, retofin2, driver_device, 0, ROT90, "bootleg", "Return of the Invaders (bootleg set 2)", GAME_SUPPORTS_SAVE ) |
branches/kale/src/mame/drivers/thedeep.c
| r244595 | r244596 | |
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | 40 | |
| 41 | | WRITE8_MEMBER(thedeep_state::thedeep_nmi_w) |
| 41 | WRITE8_MEMBER(thedeep_state::nmi_w) |
| 42 | 42 | { |
| 43 | 43 | m_nmi_enable = data; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | | WRITE8_MEMBER(thedeep_state::thedeep_sound_w) |
| 46 | WRITE8_MEMBER(thedeep_state::sound_w) |
| 47 | 47 | { |
| 48 | 48 | soundlatch_byte_w(space, 0, data); |
| 49 | 49 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | void thedeep_state::machine_start() |
| 53 | { |
| 54 | save_item(NAME(m_nmi_enable)); |
| 55 | save_item(NAME(m_protection_command)); |
| 56 | save_item(NAME(m_protection_data)); |
| 57 | save_item(NAME(m_protection_index)); |
| 58 | save_item(NAME(m_protection_irq)); |
| 59 | save_item(NAME(m_rombank)); |
| 60 | save_item(NAME(m_mcu_p3_reg)); |
| 61 | } |
| 52 | 62 | |
| 53 | 63 | void thedeep_state::machine_reset() |
| 54 | 64 | { |
| r244595 | r244596 | |
| 63 | 73 | m_rombank = -1; |
| 64 | 74 | } |
| 65 | 75 | |
| 66 | | WRITE8_MEMBER(thedeep_state::thedeep_protection_w) |
| 76 | WRITE8_MEMBER(thedeep_state::protection_w) |
| 67 | 77 | { |
| 68 | 78 | m_protection_command = data; |
| 69 | 79 | switch (m_protection_command) |
| r244595 | r244596 | |
| 126 | 136 | } |
| 127 | 137 | } |
| 128 | 138 | |
| 129 | | READ8_MEMBER(thedeep_state::thedeep_e004_r) |
| 139 | READ8_MEMBER(thedeep_state::e004_r) |
| 130 | 140 | { |
| 131 | 141 | return m_protection_irq ? 1 : 0; |
| 132 | 142 | } |
| 133 | 143 | |
| 134 | | READ8_MEMBER(thedeep_state::thedeep_protection_r) |
| 144 | READ8_MEMBER(thedeep_state::protection_r) |
| 135 | 145 | { |
| 136 | 146 | m_protection_irq = 0; |
| 137 | 147 | return m_protection_data; |
| 138 | 148 | } |
| 139 | 149 | |
| 140 | | WRITE8_MEMBER(thedeep_state::thedeep_e100_w) |
| 150 | WRITE8_MEMBER(thedeep_state::e100_w) |
| 141 | 151 | { |
| 142 | 152 | if (data != 1) |
| 143 | 153 | logerror("pc %04x: e100 = %02x\n", space.device().safe_pc(),data); |
| r244595 | r244596 | |
| 148 | 158 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // ROM (banked) |
| 149 | 159 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 150 | 160 | AM_RANGE(0xd000, 0xdfff) AM_RAM // RAM (MCU data copied here) |
| 151 | | AM_RANGE(0xe000, 0xe000) AM_READWRITE(thedeep_protection_r, thedeep_protection_w) // To MCU |
| 152 | | AM_RANGE(0xe004, 0xe004) AM_READWRITE(thedeep_e004_r, thedeep_nmi_w) // |
| 161 | AM_RANGE(0xe000, 0xe000) AM_READWRITE(protection_r, protection_w) // To MCU |
| 162 | AM_RANGE(0xe004, 0xe004) AM_READWRITE(e004_r, nmi_w) // |
| 153 | 163 | AM_RANGE(0xe008, 0xe008) AM_READ_PORT("e008") // P1 (Inputs) |
| 154 | 164 | AM_RANGE(0xe009, 0xe009) AM_READ_PORT("e009") // P2 |
| 155 | 165 | AM_RANGE(0xe00a, 0xe00a) AM_READ_PORT("e00a") // DSW1 |
| 156 | 166 | AM_RANGE(0xe00b, 0xe00b) AM_READ_PORT("e00b") // DSW2 |
| 157 | | AM_RANGE(0xe00c, 0xe00c) AM_WRITE(thedeep_sound_w) // To Sound CPU |
| 158 | | AM_RANGE(0xe100, 0xe100) AM_WRITE(thedeep_e100_w) // ? |
| 167 | AM_RANGE(0xe00c, 0xe00c) AM_WRITE(sound_w) // To Sound CPU |
| 168 | AM_RANGE(0xe100, 0xe100) AM_WRITE(e100_w) // ? |
| 159 | 169 | AM_RANGE(0xe210, 0xe213) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 160 | 170 | AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 161 | | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(thedeep_vram_1_w) AM_SHARE("vram_1") // Text Layer |
| 162 | | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(thedeep_vram_0_w) AM_SHARE("vram_0") // Background Layer |
| 171 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Text Layer |
| 172 | AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Background Layer |
| 163 | 173 | AM_RANGE(0xf800, 0xf83f) AM_RAM AM_SHARE("scroll2") // Column Scroll |
| 164 | 174 | AM_RANGE(0xf840, 0xffff) AM_RAM |
| 165 | 175 | ADDRESS_MAP_END |
| r244595 | r244596 | |
| 185 | 195 | |
| 186 | 196 | ***************************************************************************/ |
| 187 | 197 | |
| 188 | | void thedeep_state::thedeep_maincpu_bankswitch(UINT8 bank_trig) |
| 198 | void thedeep_state::maincpu_bankswitch(UINT8 bank_trig) |
| 189 | 199 | { |
| 190 | 200 | UINT8 *rom; |
| 191 | 201 | int new_rombank = bank_trig & 3; |
| r244595 | r244596 | |
| 198 | 208 | |
| 199 | 209 | } |
| 200 | 210 | |
| 201 | | WRITE8_MEMBER(thedeep_state::thedeep_p1_w) |
| 211 | WRITE8_MEMBER(thedeep_state::p1_w) |
| 202 | 212 | { |
| 203 | 213 | flip_screen_set((data & 1) ^ 1); |
| 204 | | thedeep_maincpu_bankswitch((data & 6) >> 1); |
| 214 | maincpu_bankswitch((data & 6) >> 1); |
| 205 | 215 | logerror("P1 %02x\n",data); |
| 206 | 216 | } |
| 207 | 217 | |
| 208 | | READ8_MEMBER(thedeep_state::thedeep_from_main_r) |
| 218 | READ8_MEMBER(thedeep_state::from_main_r) |
| 209 | 219 | { |
| 210 | 220 | static UINT8 res; |
| 211 | 221 | |
| r244595 | r244596 | |
| 215 | 225 | return 0x20; |
| 216 | 226 | } |
| 217 | 227 | |
| 218 | | WRITE8_MEMBER(thedeep_state::thedeep_to_main_w) |
| 228 | WRITE8_MEMBER(thedeep_state::to_main_w) |
| 219 | 229 | { |
| 220 | 230 | // ... |
| 221 | 231 | } |
| 222 | 232 | |
| 223 | | WRITE8_MEMBER(thedeep_state::thedeep_p3_w) |
| 233 | WRITE8_MEMBER(thedeep_state::p3_w) |
| 224 | 234 | { |
| 225 | 235 | /* bit 0 0->1 transition IRQ0 to main */ |
| 226 | 236 | if((!(m_mcu_p3_reg & 0x01)) && data & 0x01) |
| r244595 | r244596 | |
| 238 | 248 | logerror("P3 %02x\n",data); |
| 239 | 249 | } |
| 240 | 250 | |
| 241 | | READ8_MEMBER(thedeep_state::thedeep_p0_r) |
| 251 | READ8_MEMBER(thedeep_state::p0_r) |
| 242 | 252 | { |
| 243 | 253 | UINT8 coin_mux; |
| 244 | 254 | |
| r244595 | r244596 | |
| 249 | 259 | |
| 250 | 260 | static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, thedeep_state ) |
| 251 | 261 | ADDRESS_MAP_UNMAP_HIGH |
| 252 | | AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READ(thedeep_p0_r) |
| 253 | | AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P1) AM_WRITE(thedeep_p1_w) |
| 254 | | AM_RANGE(MCS51_PORT_P2,MCS51_PORT_P2) AM_READWRITE(thedeep_from_main_r,thedeep_to_main_w) |
| 255 | | AM_RANGE(MCS51_PORT_P3,MCS51_PORT_P3) AM_WRITE(thedeep_p3_w) |
| 262 | AM_RANGE(MCS51_PORT_P0,MCS51_PORT_P0) AM_READ(p0_r) |
| 263 | AM_RANGE(MCS51_PORT_P1,MCS51_PORT_P1) AM_WRITE(p1_w) |
| 264 | AM_RANGE(MCS51_PORT_P2,MCS51_PORT_P2) AM_READWRITE(from_main_r,to_main_w) |
| 265 | AM_RANGE(MCS51_PORT_P3,MCS51_PORT_P3) AM_WRITE(p3_w) |
| 256 | 266 | ADDRESS_MAP_END |
| 257 | 267 | |
| 258 | 268 | |
| r244595 | r244596 | |
| 382 | 392 | |
| 383 | 393 | ***************************************************************************/ |
| 384 | 394 | |
| 385 | | WRITE_LINE_MEMBER(thedeep_state::irqhandler) |
| 395 | TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::interrupt) |
| 386 | 396 | { |
| 387 | | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); |
| 388 | | } |
| 389 | | |
| 390 | | TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::thedeep_interrupt) |
| 391 | | { |
| 392 | 397 | int scanline = param; |
| 393 | 398 | |
| 394 | 399 | if (scanline == 124) // TODO: clean this |
| r244595 | r244596 | |
| 417 | 422 | } |
| 418 | 423 | } |
| 419 | 424 | |
| 420 | | INTERRUPT_GEN_MEMBER(thedeep_state::thedeep_mcu_irq) |
| 425 | INTERRUPT_GEN_MEMBER(thedeep_state::mcu_irq) |
| 421 | 426 | { |
| 422 | 427 | m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE); |
| 423 | 428 | } |
| r244595 | r244596 | |
| 427 | 432 | /* basic machine hardware */ |
| 428 | 433 | MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */ |
| 429 | 434 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 430 | | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, thedeep_interrupt, "screen", 0, 1) |
| 435 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, interrupt, "screen", 0, 1) |
| 431 | 436 | |
| 432 | 437 | MCFG_CPU_ADD("audiocpu", M65C02, XTAL_12MHz/8) /* verified on pcb */ |
| 433 | 438 | MCFG_CPU_PROGRAM_MAP(audio_map) |
| r244595 | r244596 | |
| 436 | 441 | /* MCU is a i8751 running at 8Mhz (8mhz xtal)*/ |
| 437 | 442 | MCFG_CPU_ADD("mcu", I8751, XTAL_8MHz) |
| 438 | 443 | MCFG_CPU_IO_MAP(mcu_io_map) |
| 439 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", thedeep_state, thedeep_mcu_irq) // unknown source, but presumably vblank |
| 444 | MCFG_CPU_VBLANK_INT_DRIVER("screen", thedeep_state, mcu_irq) // unknown source, but presumably vblank |
| 440 | 445 | MCFG_DEVICE_DISABLE() |
| 441 | 446 | |
| 442 | 447 | |
| r244595 | r244596 | |
| 446 | 451 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 447 | 452 | MCFG_SCREEN_SIZE(0x100, 0xf8) |
| 448 | 453 | MCFG_SCREEN_VISIBLE_AREA(0, 0x100-1, 0, 0xf8-1) |
| 449 | | MCFG_SCREEN_UPDATE_DRIVER(thedeep_state, screen_update_thedeep) |
| 454 | MCFG_SCREEN_UPDATE_DRIVER(thedeep_state, screen_update) |
| 450 | 455 | MCFG_SCREEN_PALETTE("palette") |
| 451 | 456 | |
| 452 | 457 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", thedeep) |
| r244595 | r244596 | |
| 458 | 463 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 459 | 464 | |
| 460 | 465 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */ |
| 461 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(thedeep_state, irqhandler)) |
| 466 | MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) |
| 462 | 467 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 463 | 468 | MACHINE_CONFIG_END |
| 464 | 469 | |
| r244595 | r244596 | |
| 474 | 479 | |
| 475 | 480 | Here are the proms for The Deep! |
| 476 | 481 | NOTE: This game is Vertical. |
| 477 | | I couldn't test this board so I don't know the manufakturer, sorry. |
| 482 | I couldn't test this board so I don't know the manufacturer, sorry. |
| 478 | 483 | 1 Z80 |
| 479 | 484 | 1 R6502 |
| 480 | 485 | 1 YM 2203 |
| r244595 | r244596 | |
| 553 | 558 | ROM_LOAD( "fi-3", 0x400, 0x200, CRC(f61a9686) SHA1(24082f60b72268d240ceca6999bdf18872625cd2) ) |
| 554 | 559 | ROM_END |
| 555 | 560 | |
| 556 | | GAME( 1987, thedeep, 0, thedeep, thedeep, driver_device, 0, ROT270, "Wood Place Inc.", "The Deep (Japan)", 0 ) |
| 557 | | GAME( 1988, rundeep, thedeep,thedeep, thedeep, driver_device, 0, ROT270, "bootleg (Cream)", "Run Deep", 0 ) |
| 561 | GAME( 1987, thedeep, 0, thedeep, thedeep, driver_device, 0, ROT270, "Wood Place Inc.", "The Deep (Japan)", GAME_SUPPORTS_SAVE ) |
| 562 | GAME( 1988, rundeep, thedeep,thedeep, thedeep, driver_device, 0, ROT270, "bootleg (Cream)", "Run Deep", GAME_SUPPORTS_SAVE ) |
branches/kale/src/mame/includes/retofinv.h
| r244595 | r244596 | |
| 3 | 3 | public: |
| 4 | 4 | retofinv_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | | m_fg_videoram(*this, "fg_videoram"), |
| 7 | | m_sharedram(*this, "sharedram"), |
| 8 | | m_bg_videoram(*this, "bg_videoram"), |
| 9 | 6 | m_maincpu(*this, "maincpu"), |
| 10 | 7 | m_audiocpu(*this, "audiocpu"), |
| 11 | 8 | m_subcpu(*this, "sub"), |
| 12 | 9 | m_68705(*this, "68705"), |
| 13 | 10 | m_gfxdecode(*this, "gfxdecode"), |
| 14 | | m_palette(*this, "palette") { } |
| 11 | m_palette(*this, "palette"), |
| 12 | m_fg_videoram(*this, "fg_videoram"), |
| 13 | m_sharedram(*this, "sharedram"), |
| 14 | m_bg_videoram(*this, "bg_videoram") { } |
| 15 | 15 | |
| 16 | | UINT8 m_cpu2_m6000; |
| 16 | required_device<cpu_device> m_maincpu; |
| 17 | required_device<cpu_device> m_audiocpu; |
| 18 | required_device<cpu_device> m_subcpu; |
| 19 | optional_device<cpu_device> m_68705; |
| 20 | required_device<gfxdecode_device> m_gfxdecode; |
| 21 | required_device<palette_device> m_palette; |
| 22 | |
| 17 | 23 | required_shared_ptr<UINT8> m_fg_videoram; |
| 18 | 24 | required_shared_ptr<UINT8> m_sharedram; |
| 19 | 25 | required_shared_ptr<UINT8> m_bg_videoram; |
| 26 | |
| 27 | UINT8 m_main_irq_mask; |
| 28 | UINT8 m_sub_irq_mask; |
| 29 | UINT8 m_cpu2_m6000; |
| 20 | 30 | UINT8 m_from_main; |
| 21 | 31 | UINT8 m_from_mcu; |
| 22 | 32 | int m_mcu_sent; |
| r244595 | r244596 | |
| 35 | 45 | tilemap_t *m_bg_tilemap; |
| 36 | 46 | tilemap_t *m_fg_tilemap; |
| 37 | 47 | |
| 38 | | UINT8 m_main_irq_mask; |
| 39 | | UINT8 m_sub_irq_mask; |
| 40 | 48 | DECLARE_WRITE8_MEMBER(cpu1_reset_w); |
| 41 | 49 | DECLARE_WRITE8_MEMBER(cpu2_reset_w); |
| 42 | 50 | DECLARE_WRITE8_MEMBER(mcu_reset_w); |
| r244595 | r244596 | |
| 47 | 55 | DECLARE_WRITE8_MEMBER(irq1_ack_w); |
| 48 | 56 | DECLARE_WRITE8_MEMBER(coincounter_w); |
| 49 | 57 | DECLARE_WRITE8_MEMBER(coinlockout_w); |
| 50 | | DECLARE_READ8_MEMBER(retofinv_68705_portA_r); |
| 51 | | DECLARE_WRITE8_MEMBER(retofinv_68705_portA_w); |
| 52 | | DECLARE_WRITE8_MEMBER(retofinv_68705_ddrA_w); |
| 53 | | DECLARE_READ8_MEMBER(retofinv_68705_portB_r); |
| 54 | | DECLARE_WRITE8_MEMBER(retofinv_68705_portB_w); |
| 55 | | DECLARE_WRITE8_MEMBER(retofinv_68705_ddrB_w); |
| 56 | | DECLARE_READ8_MEMBER(retofinv_68705_portC_r); |
| 57 | | DECLARE_WRITE8_MEMBER(retofinv_68705_portC_w); |
| 58 | | DECLARE_WRITE8_MEMBER(retofinv_68705_ddrC_w); |
| 59 | | DECLARE_WRITE8_MEMBER(retofinv_mcu_w); |
| 60 | | DECLARE_READ8_MEMBER(retofinv_mcu_r); |
| 61 | | DECLARE_READ8_MEMBER(retofinv_mcu_status_r); |
| 62 | | DECLARE_WRITE8_MEMBER(retofinv_bg_videoram_w); |
| 63 | | DECLARE_WRITE8_MEMBER(retofinv_fg_videoram_w); |
| 64 | | DECLARE_WRITE8_MEMBER(retofinv_gfx_ctrl_w); |
| 58 | DECLARE_READ8_MEMBER(mcu_portA_r); |
| 59 | DECLARE_WRITE8_MEMBER(mcu_portA_w); |
| 60 | DECLARE_WRITE8_MEMBER(mcu_ddrA_w); |
| 61 | DECLARE_READ8_MEMBER(mcu_portB_r); |
| 62 | DECLARE_WRITE8_MEMBER(mcu_portB_w); |
| 63 | DECLARE_WRITE8_MEMBER(mcu_ddrB_w); |
| 64 | DECLARE_READ8_MEMBER(mcu_portC_r); |
| 65 | DECLARE_WRITE8_MEMBER(mcu_portC_w); |
| 66 | DECLARE_WRITE8_MEMBER(mcu_ddrC_w); |
| 67 | DECLARE_WRITE8_MEMBER(mcu_w); |
| 68 | DECLARE_READ8_MEMBER(mcu_r); |
| 69 | DECLARE_READ8_MEMBER(mcu_status_r); |
| 70 | DECLARE_WRITE8_MEMBER(bg_videoram_w); |
| 71 | DECLARE_WRITE8_MEMBER(fg_videoram_w); |
| 72 | DECLARE_WRITE8_MEMBER(gfx_ctrl_w); |
| 73 | |
| 65 | 74 | TILEMAP_MAPPER_MEMBER(tilemap_scan); |
| 66 | 75 | TILE_GET_INFO_MEMBER(bg_get_tile_info); |
| 67 | 76 | TILE_GET_INFO_MEMBER(fg_get_tile_info); |
| 77 | |
| 78 | virtual void machine_start(); |
| 68 | 79 | virtual void video_start(); |
| 69 | 80 | DECLARE_PALETTE_INIT(retofinv); |
| 70 | | UINT32 screen_update_retofinv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 81 | |
| 82 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 83 | void draw_sprites(bitmap_ind16 &bitmap); |
| 84 | |
| 71 | 85 | INTERRUPT_GEN_MEMBER(main_vblank_irq); |
| 72 | 86 | INTERRUPT_GEN_MEMBER(sub_vblank_irq); |
| 73 | | void draw_sprites(bitmap_ind16 &bitmap); |
| 74 | | required_device<cpu_device> m_maincpu; |
| 75 | | required_device<cpu_device> m_audiocpu; |
| 76 | | required_device<cpu_device> m_subcpu; |
| 77 | | optional_device<cpu_device> m_68705; |
| 78 | | required_device<gfxdecode_device> m_gfxdecode; |
| 79 | | required_device<palette_device> m_palette; |
| 80 | 87 | }; |
branches/kale/src/mame/includes/thedeep.h
| r244595 | r244596 | |
| 3 | 3 | public: |
| 4 | 4 | thedeep_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | m_maincpu(*this,"maincpu"), |
| 7 | m_audiocpu(*this, "audiocpu"), |
| 8 | m_mcu(*this, "mcu"), |
| 9 | m_gfxdecode(*this, "gfxdecode"), |
| 10 | m_palette(*this, "palette"), |
| 6 | 11 | m_spriteram(*this, "spriteram"), |
| 7 | 12 | m_vram_0(*this, "vram_0"), |
| 8 | 13 | m_vram_1(*this, "vram_1"), |
| 9 | 14 | m_scroll(*this, "scroll"), |
| 10 | | m_scroll2(*this, "scroll2"), |
| 11 | | m_maincpu(*this,"maincpu"), |
| 12 | | m_audiocpu(*this, "audiocpu"), |
| 13 | | m_mcu(*this, "mcu"), |
| 14 | | m_gfxdecode(*this, "gfxdecode"), |
| 15 | | m_palette(*this, "palette") { } |
| 15 | m_scroll2(*this, "scroll2") { } |
| 16 | 16 | |
| 17 | required_device<cpu_device> m_maincpu; |
| 18 | required_device<cpu_device> m_audiocpu; |
| 19 | required_device<cpu_device> m_mcu; |
| 20 | required_device<gfxdecode_device> m_gfxdecode; |
| 21 | required_device<palette_device> m_palette; |
| 22 | |
| 17 | 23 | required_shared_ptr<UINT8> m_spriteram; |
| 24 | required_shared_ptr<UINT8> m_vram_0; |
| 25 | required_shared_ptr<UINT8> m_vram_1; |
| 26 | required_shared_ptr<UINT8> m_scroll; |
| 27 | required_shared_ptr<UINT8> m_scroll2; |
| 28 | |
| 18 | 29 | int m_nmi_enable; |
| 19 | 30 | UINT8 m_protection_command; |
| 20 | 31 | UINT8 m_protection_data; |
| 21 | 32 | int m_protection_index; |
| 22 | 33 | int m_protection_irq; |
| 23 | 34 | int m_rombank; |
| 24 | | required_shared_ptr<UINT8> m_vram_0; |
| 25 | | required_shared_ptr<UINT8> m_vram_1; |
| 26 | | required_shared_ptr<UINT8> m_scroll; |
| 27 | | required_shared_ptr<UINT8> m_scroll2; |
| 28 | 35 | tilemap_t *m_tilemap_0; |
| 29 | 36 | tilemap_t *m_tilemap_1; |
| 30 | 37 | UINT8 m_mcu_p3_reg; |
| 31 | 38 | |
| 32 | | required_device<cpu_device> m_maincpu; |
| 33 | | required_device<cpu_device> m_audiocpu; |
| 34 | | required_device<cpu_device> m_mcu; |
| 35 | | required_device<gfxdecode_device> m_gfxdecode; |
| 36 | | required_device<palette_device> m_palette; |
| 37 | | |
| 38 | | DECLARE_WRITE8_MEMBER(thedeep_nmi_w); |
| 39 | | DECLARE_WRITE8_MEMBER(thedeep_sound_w); |
| 40 | | DECLARE_WRITE8_MEMBER(thedeep_protection_w); |
| 41 | | DECLARE_READ8_MEMBER(thedeep_e004_r); |
| 42 | | DECLARE_READ8_MEMBER(thedeep_protection_r); |
| 43 | | DECLARE_WRITE8_MEMBER(thedeep_e100_w); |
| 44 | | DECLARE_WRITE8_MEMBER(thedeep_p1_w); |
| 45 | | DECLARE_READ8_MEMBER(thedeep_from_main_r); |
| 46 | | DECLARE_WRITE8_MEMBER(thedeep_to_main_w); |
| 47 | | DECLARE_WRITE8_MEMBER(thedeep_p3_w); |
| 48 | | DECLARE_READ8_MEMBER(thedeep_p0_r); |
| 49 | | DECLARE_WRITE8_MEMBER(thedeep_vram_0_w); |
| 50 | | DECLARE_WRITE8_MEMBER(thedeep_vram_1_w); |
| 39 | DECLARE_WRITE8_MEMBER(nmi_w); |
| 40 | DECLARE_WRITE8_MEMBER(sound_w); |
| 41 | DECLARE_WRITE8_MEMBER(protection_w); |
| 42 | DECLARE_READ8_MEMBER(e004_r); |
| 43 | DECLARE_READ8_MEMBER(protection_r); |
| 44 | DECLARE_WRITE8_MEMBER(e100_w); |
| 45 | DECLARE_WRITE8_MEMBER(p1_w); |
| 46 | DECLARE_READ8_MEMBER(from_main_r); |
| 47 | DECLARE_WRITE8_MEMBER(to_main_w); |
| 48 | DECLARE_WRITE8_MEMBER(p3_w); |
| 49 | DECLARE_READ8_MEMBER(p0_r); |
| 50 | DECLARE_WRITE8_MEMBER(vram_0_w); |
| 51 | DECLARE_WRITE8_MEMBER(vram_1_w); |
| 52 | |
| 51 | 53 | TILEMAP_MAPPER_MEMBER(tilemap_scan_rows_back); |
| 52 | 54 | TILE_GET_INFO_MEMBER(get_tile_info_0); |
| 53 | 55 | TILE_GET_INFO_MEMBER(get_tile_info_1); |
| 56 | |
| 57 | virtual void machine_start(); |
| 54 | 58 | virtual void machine_reset(); |
| 55 | 59 | virtual void video_start(); |
| 56 | 60 | DECLARE_PALETTE_INIT(thedeep); |
| 57 | | UINT32 screen_update_thedeep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 58 | | INTERRUPT_GEN_MEMBER(thedeep_mcu_irq); |
| 59 | | TIMER_DEVICE_CALLBACK_MEMBER(thedeep_interrupt); |
| 61 | |
| 62 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 60 | 63 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 61 | | void thedeep_maincpu_bankswitch(UINT8 bank_trig); |
| 62 | | DECLARE_WRITE_LINE_MEMBER(irqhandler); |
| 64 | |
| 65 | void maincpu_bankswitch(UINT8 bank_trig); |
| 66 | INTERRUPT_GEN_MEMBER(mcu_irq); |
| 67 | TIMER_DEVICE_CALLBACK_MEMBER(interrupt); |
| 63 | 68 | }; |
branches/kale/src/mame/machine/retofinv.c
| r244595 | r244596 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | | READ8_MEMBER(retofinv_state::retofinv_68705_portA_r) |
| 13 | READ8_MEMBER(retofinv_state::mcu_portA_r) |
| 14 | 14 | { |
| 15 | 15 | //logerror("%04x: 68705 port A read %02x\n",space.device().safe_pc(),m_portA_in); |
| 16 | 16 | return (m_portA_out & m_ddrA) | (m_portA_in & ~m_ddrA); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_portA_w) |
| 19 | WRITE8_MEMBER(retofinv_state::mcu_portA_w) |
| 20 | 20 | { |
| 21 | 21 | //logerror("%04x: 68705 port A write %02x\n",space.device().safe_pc(),data); |
| 22 | 22 | m_portA_out = data; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrA_w) |
| 25 | WRITE8_MEMBER(retofinv_state::mcu_ddrA_w) |
| 26 | 26 | { |
| 27 | 27 | m_ddrA = data; |
| 28 | 28 | } |
| r244595 | r244596 | |
| 39 | 39 | */ |
| 40 | 40 | |
| 41 | 41 | |
| 42 | | READ8_MEMBER(retofinv_state::retofinv_68705_portB_r) |
| 42 | READ8_MEMBER(retofinv_state::mcu_portB_r) |
| 43 | 43 | { |
| 44 | 44 | return (m_portB_out & m_ddrB) | (m_portB_in & ~m_ddrB); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_portB_w) |
| 47 | WRITE8_MEMBER(retofinv_state::mcu_portB_w) |
| 48 | 48 | { |
| 49 | 49 | //logerror("%04x: 68705 port B write %02x\n",space.device().safe_pc(),data); |
| 50 | 50 | |
| r244595 | r244596 | |
| 65 | 65 | m_portB_out = data; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrB_w) |
| 68 | WRITE8_MEMBER(retofinv_state::mcu_ddrB_w) |
| 69 | 69 | { |
| 70 | 70 | m_ddrB = data; |
| 71 | 71 | } |
| r244595 | r244596 | |
| 81 | 81 | */ |
| 82 | 82 | |
| 83 | 83 | |
| 84 | | READ8_MEMBER(retofinv_state::retofinv_68705_portC_r) |
| 84 | READ8_MEMBER(retofinv_state::mcu_portC_r) |
| 85 | 85 | { |
| 86 | 86 | m_portC_in = 0; |
| 87 | 87 | if (m_main_sent) m_portC_in |= 0x01; |
| r244595 | r244596 | |
| 90 | 90 | return (m_portC_out & m_ddrC) | (m_portC_in & ~m_ddrC); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_portC_w) |
| 93 | WRITE8_MEMBER(retofinv_state::mcu_portC_w) |
| 94 | 94 | { |
| 95 | 95 | logerror("%04x: 68705 port C write %02x\n",space.device().safe_pc(),data); |
| 96 | 96 | m_portC_out = data; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | | WRITE8_MEMBER(retofinv_state::retofinv_68705_ddrC_w) |
| 99 | WRITE8_MEMBER(retofinv_state::mcu_ddrC_w) |
| 100 | 100 | { |
| 101 | 101 | m_ddrC = data; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | | WRITE8_MEMBER(retofinv_state::retofinv_mcu_w) |
| 105 | WRITE8_MEMBER(retofinv_state::mcu_w) |
| 106 | 106 | { |
| 107 | 107 | logerror("%04x: mcu_w %02x\n",space.device().safe_pc(),data); |
| 108 | 108 | m_from_main = data; |
| r244595 | r244596 | |
| 110 | 110 | m_68705->set_input_line(0, ASSERT_LINE); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | | READ8_MEMBER(retofinv_state::retofinv_mcu_r) |
| 113 | READ8_MEMBER(retofinv_state::mcu_r) |
| 114 | 114 | { |
| 115 | 115 | logerror("%04x: mcu_r %02x\n",space.device().safe_pc(),m_from_mcu); |
| 116 | 116 | m_mcu_sent = 0; |
| 117 | 117 | return m_from_mcu; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | | READ8_MEMBER(retofinv_state::retofinv_mcu_status_r) |
| 120 | READ8_MEMBER(retofinv_state::mcu_status_r) |
| 121 | 121 | { |
| 122 | 122 | int res = 0; |
| 123 | 123 | |