trunk/src/emu/cpu/m6809/konami.h
| r31112 | r31113 | |
| 18 | 18 | // TYPE DEFINITIONS |
| 19 | 19 | //************************************************************************** |
| 20 | 20 | |
| 21 | | // callbacks |
| 22 | | typedef void (*konami_set_lines_func)(device_t *device, int lines); |
| 23 | | #define KONAMI_SETLINES_CALLBACK(name) void name(device_t *device, int lines) |
| 21 | typedef device_delegate<void (int lines)> konami_line_cb_delegate; |
| 22 | #define KONAMICPU_LINE_CB_MEMBER(_name) void _name(int lines) |
| 24 | 23 | |
| 24 | #define MCFG_KONAMICPU_LINE_CB(_class, _method) \ |
| 25 | konami_cpu_device::set_line_callback(*device, konami_line_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); |
| 26 | |
| 27 | |
| 25 | 28 | // device type definition |
| 26 | 29 | extern const device_type KONAMI; |
| 27 | 30 | |
| r31112 | r31113 | |
| 34 | 37 | konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 35 | 38 | |
| 36 | 39 | // configuration |
| 37 | | void configure_set_lines(konami_set_lines_func func) { m_set_lines = func; } |
| 40 | static void set_line_callback(device_t &device, konami_line_cb_delegate callback) { downcast<konami_cpu_device &>(device).m_set_lines = callback; } |
| 38 | 41 | |
| 39 | 42 | protected: |
| 40 | 43 | // device-level overrides |
| r31112 | r31113 | |
| 50 | 53 | typedef m6809_base_device super; |
| 51 | 54 | |
| 52 | 55 | // incidentals |
| 53 | | konami_set_lines_func m_set_lines; |
| 56 | konami_line_cb_delegate m_set_lines; |
| 54 | 57 | |
| 55 | 58 | // konami-specific addressing modes |
| 56 | 59 | UINT16 &ireg(); |
| r31112 | r31113 | |
| 76 | 79 | #define KONAMI_IRQ_LINE 0 /* IRQ line number */ |
| 77 | 80 | #define KONAMI_FIRQ_LINE 1 /* FIRQ line number */ |
| 78 | 81 | |
| 79 | | |
| 80 | | //************************************************************************** |
| 81 | | // FUNCTIONS |
| 82 | | //************************************************************************** |
| 83 | | |
| 84 | | void konami_configure_set_lines(device_t *device, konami_set_lines_func func); |
| 85 | | |
| 86 | 82 | #endif /* __KONAMI_CPU_H__ */ |
trunk/src/mame/drivers/crimfght.c
| r31112 | r31113 | |
| 19 | 19 | #include "includes/konamipt.h" |
| 20 | 20 | #include "includes/crimfght.h" |
| 21 | 21 | |
| 22 | | /* prototypes */ |
| 23 | | static KONAMI_SETLINES_CALLBACK( crimfght_banking ); |
| 24 | | |
| 25 | 22 | INTERRUPT_GEN_MEMBER(crimfght_state::crimfght_interrupt) |
| 26 | 23 | { |
| 27 | 24 | if (m_k051960->k051960_is_irq_enabled()) |
| r31112 | r31113 | |
| 233 | 230 | membank("bank2")->set_entry(0); |
| 234 | 231 | } |
| 235 | 232 | |
| 236 | | void crimfght_state::machine_reset() |
| 233 | KONAMICPU_LINE_CB_MEMBER( crimfght_state::banking_callback ) |
| 237 | 234 | { |
| 238 | | konami_configure_set_lines(m_maincpu, crimfght_banking); |
| 235 | /* bit 5 = select work RAM or palette */ |
| 236 | if (lines & 0x20) |
| 237 | { |
| 238 | m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3"); |
| 239 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(palette_device::write), m_palette.target())); |
| 240 | membank("bank3")->set_base(m_paletteram); |
| 241 | } |
| 242 | else |
| 243 | m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */ |
| 244 | |
| 245 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 246 | m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 247 | |
| 248 | membank("bank2")->set_entry(lines & 0x0f); |
| 239 | 249 | } |
| 240 | 250 | |
| 241 | 251 | static MACHINE_CONFIG_START( crimfght, crimfght_state ) |
| r31112 | r31113 | |
| 244 | 254 | MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */ |
| 245 | 255 | MCFG_CPU_PROGRAM_MAP(crimfght_map) |
| 246 | 256 | MCFG_CPU_VBLANK_INT_DRIVER("screen", crimfght_state, crimfght_interrupt) |
| 257 | MCFG_KONAMICPU_LINE_CB(crimfght_state, banking_callback) |
| 247 | 258 | |
| 248 | 259 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 249 | 260 | MCFG_CPU_PROGRAM_MAP(crimfght_sound_map) |
| r31112 | r31113 | |
| 366 | 377 | |
| 367 | 378 | ***************************************************************************/ |
| 368 | 379 | |
| 369 | | static KONAMI_SETLINES_CALLBACK( crimfght_banking ) |
| 370 | | { |
| 371 | | crimfght_state *state = device->machine().driver_data<crimfght_state>(); |
| 372 | | |
| 373 | | /* bit 5 = select work RAM or palette */ |
| 374 | | if (lines & 0x20) |
| 375 | | { |
| 376 | | device->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3"); |
| 377 | | device->memory().space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(palette_device::write), state->m_palette.target())); |
| 378 | | state->membank("bank3")->set_base(state->m_paletteram); |
| 379 | | } |
| 380 | | else |
| 381 | | device->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */ |
| 382 | | |
| 383 | | /* bit 6 = enable char ROM reading through the video RAM */ |
| 384 | | state->m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 385 | | |
| 386 | | state->membank("bank2")->set_entry(lines & 0x0f); |
| 387 | | } |
| 388 | | |
| 389 | 380 | GAME( 1989, crimfght, 0, crimfght, crimfght, driver_device, 0, ROT0, "Konami", "Crime Fighters (US 4 players)", GAME_SUPPORTS_SAVE ) |
| 390 | 381 | GAME( 1989, crimfght2, crimfght, crimfght, crimfghtj, driver_device,0, ROT0, "Konami", "Crime Fighters (World 2 Players)", GAME_SUPPORTS_SAVE ) |
| 391 | 382 | GAME( 1989, crimfghtj, crimfght, crimfght, crimfghtj, driver_device,0, ROT0, "Konami", "Crime Fighters (Japan 2 Players)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/rollerg.c
| r31112 | r31113 | |
| 17 | 17 | #include "sound/k053260.h" |
| 18 | 18 | #include "includes/rollerg.h" |
| 19 | 19 | |
| 20 | | /* prototypes */ |
| 21 | | static KONAMI_SETLINES_CALLBACK( rollerg_banking ); |
| 22 | | |
| 23 | 20 | WRITE8_MEMBER(rollerg_state::rollerg_0010_w) |
| 24 | 21 | { |
| 25 | 22 | logerror("%04x: write %02x to 0010\n",space.device().safe_pc(), data); |
| r31112 | r31113 | |
| 235 | 232 | |
| 236 | 233 | void rollerg_state::machine_reset() |
| 237 | 234 | { |
| 238 | | konami_configure_set_lines(m_maincpu, rollerg_banking); |
| 239 | | |
| 240 | 235 | m_readzoomroms = 0; |
| 241 | 236 | } |
| 242 | 237 | |
| 238 | KONAMICPU_LINE_CB_MEMBER( rollerg_state::banking_callback ) |
| 239 | { |
| 240 | membank("bank1")->set_entry(lines & 0x07); |
| 241 | } |
| 242 | |
| 243 | |
| 243 | 244 | static MACHINE_CONFIG_START( rollerg, rollerg_state ) |
| 244 | 245 | |
| 245 | 246 | /* basic machine hardware */ |
| 246 | 247 | MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* ? */ |
| 247 | 248 | MCFG_CPU_PROGRAM_MAP(rollerg_map) |
| 248 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", rollerg_state, irq0_line_assert) |
| 249 | MCFG_CPU_VBLANK_INT_DRIVER("screen", rollerg_state, irq0_line_assert) |
| 250 | MCFG_KONAMICPU_LINE_CB(rollerg_state, banking_callback) |
| 249 | 251 | |
| 250 | 252 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 251 | 253 | MCFG_CPU_PROGRAM_MAP(rollerg_sound_map) |
| r31112 | r31113 | |
| 344 | 346 | |
| 345 | 347 | ***************************************************************************/ |
| 346 | 348 | |
| 347 | | static KONAMI_SETLINES_CALLBACK( rollerg_banking ) |
| 348 | | { |
| 349 | | device->machine().root_device().membank("bank1")->set_entry(lines & 0x07); |
| 350 | | } |
| 351 | | |
| 352 | | |
| 353 | 349 | GAME( 1991, rollerg, 0, rollerg, rollerg, driver_device, 0, ROT0, "Konami", "Rollergames (US)", GAME_SUPPORTS_SAVE ) |
| 354 | 350 | GAME( 1991, rollergj, rollerg, rollerg, rollerg, driver_device, 0, ROT0, "Konami", "Rollergames (Japan)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/88games.c
| r31112 | r31113 | |
| 12 | 12 | #include "includes/88games.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | | |
| 16 | | |
| 17 | 15 | /************************************* |
| 18 | 16 | * |
| 19 | 17 | * Memory handlers |
| r31112 | r31113 | |
| 253 | 251 | * |
| 254 | 252 | *************************************/ |
| 255 | 253 | |
| 256 | | static KONAMI_SETLINES_CALLBACK( k88games_banking ) |
| 254 | KONAMICPU_LINE_CB_MEMBER( _88games_state::banking_callback ) |
| 257 | 255 | { |
| 258 | | _88games_state *state = device->machine().driver_data<_88games_state>(); |
| 256 | logerror("%04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 259 | 257 | |
| 260 | | logerror("%04x: bank select %02x\n", device->safe_pc(), lines); |
| 261 | | |
| 262 | 258 | /* bits 0-2 select ROM bank for 0000-1fff */ |
| 263 | 259 | /* bit 3: when 1, palette RAM at 1000-1fff */ |
| 264 | 260 | /* bit 4: when 0, 051316 RAM at 3800-3fff; when 1, work RAM at 2000-3fff (NVRAM 3700-37ff) */ |
| 265 | 261 | int rombank = lines & 0x07; |
| 266 | | state->m_bank0000->set_entry(rombank); |
| 267 | | state->m_bank1000->set_entry((lines & 0x08) ? 8 : rombank); |
| 268 | | state->m_videobank = lines & 0x10; |
| 262 | m_bank0000->set_entry(rombank); |
| 263 | m_bank1000->set_entry((lines & 0x08) ? 8 : rombank); |
| 264 | m_videobank = lines & 0x10; |
| 269 | 265 | |
| 270 | 266 | /* bit 5 = enable char ROM reading through the video RAM */ |
| 271 | | state->m_k052109->set_rmrd_line((lines & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
| 267 | m_k052109->set_rmrd_line((lines & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
| 272 | 268 | |
| 273 | 269 | /* bit 6 is unknown, 1 most of the time */ |
| 274 | 270 | |
| 275 | 271 | /* bit 7 controls layer priority */ |
| 276 | | state->m_k88games_priority = lines & 0x80; |
| 272 | m_k88games_priority = lines & 0x80; |
| 277 | 273 | } |
| 278 | 274 | |
| 279 | 275 | void _88games_state::machine_start() |
| r31112 | r31113 | |
| 295 | 291 | |
| 296 | 292 | void _88games_state::machine_reset() |
| 297 | 293 | { |
| 298 | | konami_configure_set_lines(m_maincpu, k88games_banking); |
| 299 | | |
| 300 | 294 | m_videobank = 0; |
| 301 | 295 | m_zoomreadroms = 0; |
| 302 | 296 | m_speech_chip = 0; |
| r31112 | r31113 | |
| 314 | 308 | MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* ? */ |
| 315 | 309 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 316 | 310 | MCFG_CPU_VBLANK_INT_DRIVER("screen", _88games_state, k88games_interrupt) |
| 311 | MCFG_KONAMICPU_LINE_CB(_88games_state, banking_callback) |
| 317 | 312 | |
| 318 | 313 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 319 | 314 | MCFG_CPU_PROGRAM_MAP(sound_map) |
trunk/src/mame/drivers/surpratk.c
| r31112 | r31113 | |
| 14 | 14 | #include "includes/konamipt.h" |
| 15 | 15 | #include "includes/surpratk.h" |
| 16 | 16 | |
| 17 | | /* prototypes */ |
| 18 | | static KONAMI_SETLINES_CALLBACK( surpratk_banking ); |
| 19 | | |
| 20 | 17 | INTERRUPT_GEN_MEMBER(surpratk_state::surpratk_interrupt) |
| 21 | 18 | { |
| 22 | 19 | if (m_k052109->is_irq_enabled()) |
| r31112 | r31113 | |
| 146 | 143 | |
| 147 | 144 | void surpratk_state::machine_reset() |
| 148 | 145 | { |
| 149 | | int i; |
| 150 | | |
| 151 | | konami_configure_set_lines(m_maincpu, surpratk_banking); |
| 152 | 146 | m_bank0000->set_bank(0); |
| 153 | 147 | |
| 154 | | for (i = 0; i < 3; i++) |
| 148 | for (int i = 0; i < 3; i++) |
| 155 | 149 | { |
| 156 | 150 | m_layerpri[i] = 0; |
| 157 | 151 | m_layer_colorbase[i] = 0; |
| r31112 | r31113 | |
| 160 | 154 | m_sprite_colorbase = 0; |
| 161 | 155 | } |
| 162 | 156 | |
| 157 | KONAMICPU_LINE_CB_MEMBER( surpratk_state::banking_callback ) |
| 158 | { |
| 159 | // logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 160 | membank("bank1")->set_entry(lines & 0x1f); |
| 161 | } |
| 162 | |
| 163 | 163 | static MACHINE_CONFIG_START( surpratk, surpratk_state ) |
| 164 | 164 | |
| 165 | 165 | /* basic machine hardware */ |
| 166 | 166 | MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 053248, the clock input is 12MHz, and internal CPU divider of 4 */ |
| 167 | 167 | MCFG_CPU_PROGRAM_MAP(surpratk_map) |
| 168 | 168 | MCFG_CPU_VBLANK_INT_DRIVER("screen", surpratk_state, surpratk_interrupt) |
| 169 | MCFG_KONAMICPU_LINE_CB(surpratk_state, banking_callback) |
| 169 | 170 | |
| 170 | 171 | MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0) |
| 171 | 172 | MCFG_DEVICE_PROGRAM_MAP(bank0000_map) |
| r31112 | r31113 | |
| 262 | 263 | |
| 263 | 264 | ***************************************************************************/ |
| 264 | 265 | |
| 265 | | static KONAMI_SETLINES_CALLBACK( surpratk_banking ) |
| 266 | | { |
| 267 | | logerror("%04x: setlines %02x\n",device->safe_pc(), lines); |
| 268 | | device->machine().root_device().membank("bank1")->set_entry(lines & 0x1f); |
| 269 | | } |
| 270 | | |
| 271 | | |
| 272 | 266 | GAME( 1990, suratk, 0, surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (World ver. K)", GAME_SUPPORTS_SAVE ) |
| 273 | 267 | GAME( 1990, suratka, suratk, surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (Asia ver. L)", GAME_SUPPORTS_SAVE ) |
| 274 | 268 | GAME( 1990, suratkj, suratk, surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (Japan ver. M)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/gbusters.c
| r31112 | r31113 | |
| 15 | 15 | #include "includes/konamipt.h" |
| 16 | 16 | #include "includes/gbusters.h" |
| 17 | 17 | |
| 18 | | /* prototypes */ |
| 19 | | static KONAMI_SETLINES_CALLBACK( gbusters_banking ); |
| 20 | | |
| 21 | 18 | INTERRUPT_GEN_MEMBER(gbusters_state::gbusters_interrupt) |
| 22 | 19 | { |
| 23 | 20 | if (m_k052109->is_irq_enabled()) |
| r31112 | r31113 | |
| 254 | 251 | { |
| 255 | 252 | UINT8 *RAM = memregion("maincpu")->base(); |
| 256 | 253 | |
| 257 | | konami_configure_set_lines(m_maincpu, gbusters_banking); |
| 258 | | |
| 259 | 254 | /* mirror address for banked ROM */ |
| 260 | 255 | memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000); |
| 261 | 256 | |
| r31112 | r31113 | |
| 263 | 258 | m_priority = 0; |
| 264 | 259 | } |
| 265 | 260 | |
| 261 | KONAMICPU_LINE_CB_MEMBER( gbusters_state::banking_callback ) |
| 262 | { |
| 263 | /* bits 0-3 ROM bank */ |
| 264 | membank("bank1")->set_entry(lines & 0x0f); |
| 265 | |
| 266 | if (lines & 0xf0) |
| 267 | { |
| 268 | //logerror("%04x: (lines) write %02x\n",device->safe_pc(), lines); |
| 269 | //popmessage("lines = %02x", lines); |
| 270 | } |
| 271 | |
| 272 | /* other bits unknown */ |
| 273 | } |
| 274 | |
| 266 | 275 | static MACHINE_CONFIG_START( gbusters, gbusters_state ) |
| 267 | 276 | |
| 268 | 277 | /* basic machine hardware */ |
| 269 | 278 | MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* Konami custom 052526 */ |
| 270 | 279 | MCFG_CPU_PROGRAM_MAP(gbusters_map) |
| 271 | 280 | MCFG_CPU_VBLANK_INT_DRIVER("screen", gbusters_state, gbusters_interrupt) |
| 281 | MCFG_KONAMICPU_LINE_CB(gbusters_state, banking_callback) |
| 272 | 282 | |
| 273 | 283 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* ? */ |
| 274 | 284 | MCFG_CPU_PROGRAM_MAP(gbusters_sound_map) |
| r31112 | r31113 | |
| 387 | 397 | ROM_END |
| 388 | 398 | |
| 389 | 399 | |
| 390 | | static KONAMI_SETLINES_CALLBACK( gbusters_banking ) |
| 391 | | { |
| 392 | | /* bits 0-3 ROM bank */ |
| 393 | | device->machine().root_device().membank("bank1")->set_entry(lines & 0x0f); |
| 394 | 400 | |
| 395 | | if (lines & 0xf0) |
| 396 | | { |
| 397 | | //logerror("%04x: (lines) write %02x\n",device->safe_pc(), lines); |
| 398 | | //popmessage("lines = %02x", lines); |
| 399 | | } |
| 400 | | |
| 401 | | /* other bits unknown */ |
| 402 | | } |
| 403 | | |
| 404 | | |
| 405 | 401 | GAME( 1988, gbusters, 0, gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Gang Busters (set 1)", GAME_SUPPORTS_SAVE ) /* N02 & J03 program roms */ |
| 406 | 402 | GAME( 1988, gbustersa, gbusters, gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Gang Busters (set 2)", GAME_SUPPORTS_SAVE ) /* unknown region program roms */ |
| 407 | 403 | GAME( 1988, crazycop, gbusters, gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Crazy Cop (Japan)", GAME_SUPPORTS_SAVE ) /* M02 & J03 program roms */ |
trunk/src/mame/drivers/thunderx.c
| r31112 | r31113 | |
| 20 | 20 | #include "includes/konamipt.h" |
| 21 | 21 | #include "includes/thunderx.h" |
| 22 | 22 | |
| 23 | | static KONAMI_SETLINES_CALLBACK( thunderx_banking ); |
| 24 | 23 | |
| 25 | | /***************************************************************************/ |
| 26 | | |
| 27 | 24 | INTERRUPT_GEN_MEMBER(thunderx_state::scontra_interrupt) |
| 28 | 25 | { |
| 29 | 26 | if (m_k052109->is_irq_enabled()) |
| r31112 | r31113 | |
| 605 | 602 | save_item(NAME(m_pmcram)); |
| 606 | 603 | } |
| 607 | 604 | |
| 608 | | MACHINE_RESET_MEMBER(thunderx_state,scontra) |
| 605 | MACHINE_RESET_MEMBER(thunderx_state, scontra) |
| 609 | 606 | { |
| 610 | 607 | m_priority = 0; |
| 611 | 608 | m_1f98_data = 0; |
| r31112 | r31113 | |
| 614 | 611 | m_pmcbank = 0; |
| 615 | 612 | } |
| 616 | 613 | |
| 617 | | MACHINE_RESET_MEMBER(thunderx_state,thunderx) |
| 618 | | { |
| 619 | | konami_configure_set_lines(m_maincpu, thunderx_banking); |
| 620 | | |
| 621 | | MACHINE_RESET_CALL_MEMBER(scontra); |
| 622 | | } |
| 623 | | |
| 624 | 614 | static MACHINE_CONFIG_START( scontra, thunderx_state ) |
| 625 | 615 | |
| 626 | 616 | /* basic machine hardware */ |
| r31112 | r31113 | |
| 631 | 621 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 632 | 622 | MCFG_CPU_PROGRAM_MAP(scontra_sound_map) |
| 633 | 623 | |
| 634 | | MCFG_MACHINE_START_OVERRIDE(thunderx_state,scontra) |
| 635 | | MCFG_MACHINE_RESET_OVERRIDE(thunderx_state,scontra) |
| 624 | MCFG_MACHINE_START_OVERRIDE(thunderx_state, scontra) |
| 625 | MCFG_MACHINE_RESET_OVERRIDE(thunderx_state, scontra) |
| 636 | 626 | |
| 637 | 627 | /* video hardware */ |
| 638 | 628 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31112 | r31113 | |
| 669 | 659 | MACHINE_CONFIG_END |
| 670 | 660 | |
| 671 | 661 | |
| 662 | KONAMICPU_LINE_CB_MEMBER( thunderx_state::thunderx_banking_callback ) |
| 663 | { |
| 664 | //logerror("thunderx %04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 665 | membank("bank1")->set_entry(((lines & 0x0f) ^ 0x08)); |
| 666 | } |
| 667 | |
| 672 | 668 | static MACHINE_CONFIG_START( thunderx, thunderx_state ) |
| 673 | 669 | |
| 674 | 670 | /* basic machine hardware */ |
| 675 | 671 | MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 052001 (verified on pcb) */ |
| 676 | 672 | MCFG_CPU_PROGRAM_MAP(thunderx_map) |
| 677 | 673 | MCFG_CPU_VBLANK_INT_DRIVER("screen", thunderx_state, scontra_interrupt) |
| 674 | MCFG_KONAMICPU_LINE_CB(thunderx_state, thunderx_banking_callback) |
| 678 | 675 | |
| 679 | 676 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 680 | 677 | MCFG_CPU_PROGRAM_MAP(thunderx_sound_map) |
| 681 | 678 | |
| 682 | | MCFG_MACHINE_START_OVERRIDE(thunderx_state,thunderx) |
| 683 | | MCFG_MACHINE_RESET_OVERRIDE(thunderx_state,thunderx) |
| 679 | MCFG_MACHINE_START_OVERRIDE(thunderx_state, thunderx) |
| 680 | MCFG_MACHINE_RESET_OVERRIDE(thunderx_state, scontra) |
| 684 | 681 | |
| 685 | 682 | /* video hardware */ |
| 686 | 683 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31112 | r31113 | |
| 962 | 959 | |
| 963 | 960 | /***************************************************************************/ |
| 964 | 961 | |
| 965 | | static KONAMI_SETLINES_CALLBACK( thunderx_banking ) |
| 966 | | { |
| 967 | | //logerror("thunderx %04x: bank select %02x\n", device->cpu->safe_pc(), lines); |
| 968 | | device->machine().root_device().membank("bank1")->set_entry(((lines & 0x0f) ^ 0x08)); |
| 969 | | } |
| 970 | | |
| 971 | 962 | GAME( 1988, scontra, 0, scontra, scontra, driver_device, 0, ROT90, "Konami", "Super Contra", GAME_SUPPORTS_SAVE ) |
| 972 | 963 | GAME( 1988, scontraj, scontra, scontra, scontra, driver_device, 0, ROT90, "Konami", "Super Contra (Japan)", GAME_SUPPORTS_SAVE ) |
| 973 | 964 | GAME( 1988, thunderx, 0, thunderx, thunderx, driver_device, 0, ROT0, "Konami", "Thunder Cross (set 1)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/aliens.c
| r31112 | r31113 | |
| 14 | 14 | #include "includes/konamipt.h" |
| 15 | 15 | #include "includes/aliens.h" |
| 16 | 16 | |
| 17 | | /* prototypes */ |
| 18 | | static KONAMI_SETLINES_CALLBACK( aliens_banking ); |
| 19 | | |
| 20 | 17 | INTERRUPT_GEN_MEMBER(aliens_state::aliens_interrupt) |
| 21 | 18 | { |
| 22 | 19 | if (m_k051960->k051960_is_irq_enabled()) |
| r31112 | r31113 | |
| 186 | 183 | |
| 187 | 184 | void aliens_state::machine_reset() |
| 188 | 185 | { |
| 189 | | konami_configure_set_lines(m_maincpu, aliens_banking); |
| 190 | | |
| 191 | 186 | m_bank0000->set_bank(0); |
| 192 | 187 | } |
| 193 | 188 | |
| 189 | KONAMICPU_LINE_CB_MEMBER( aliens_state::banking_callback ) |
| 190 | { |
| 191 | membank("bank1")->set_entry(lines & 0x1f); |
| 192 | } |
| 193 | |
| 194 | 194 | static MACHINE_CONFIG_START( aliens, aliens_state ) |
| 195 | 195 | |
| 196 | 196 | /* basic machine hardware */ |
| 197 | | |
| 198 | 197 | MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */ |
| 199 | 198 | MCFG_CPU_PROGRAM_MAP(aliens_map) |
| 200 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", aliens_state, aliens_interrupt) |
| 199 | MCFG_CPU_VBLANK_INT_DRIVER("screen", aliens_state, aliens_interrupt) |
| 200 | MCFG_KONAMICPU_LINE_CB(aliens_state, banking_callback) |
| 201 | 201 | |
| 202 | 202 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 203 | 203 | MCFG_CPU_PROGRAM_MAP(aliens_sound_map) |
| r31112 | r31113 | |
| 475 | 475 | |
| 476 | 476 | ***************************************************************************/ |
| 477 | 477 | |
| 478 | | static KONAMI_SETLINES_CALLBACK( aliens_banking ) |
| 479 | | { |
| 480 | | device->machine().root_device().membank("bank1")->set_entry(lines & 0x1f); |
| 481 | | } |
| 482 | | |
| 483 | 478 | GAME( 1990, aliens, 0, aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 1)", GAME_SUPPORTS_SAVE ) |
| 484 | 479 | GAME( 1990, aliens2, aliens, aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 2)", GAME_SUPPORTS_SAVE ) |
| 485 | 480 | GAME( 1990, aliens3, aliens, aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 3)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/blockhl.c
| r31112 | r31113 | |
| 26 | 26 | #include "includes/konamipt.h" |
| 27 | 27 | #include "includes/blockhl.h" |
| 28 | 28 | |
| 29 | | /* prototypes */ |
| 30 | | static KONAMI_SETLINES_CALLBACK( blockhl_banking ); |
| 31 | 29 | |
| 32 | 30 | INTERRUPT_GEN_MEMBER(blockhl_state::blockhl_interrupt) |
| 33 | 31 | { |
| r31112 | r31113 | |
| 179 | 177 | |
| 180 | 178 | void blockhl_state::machine_reset() |
| 181 | 179 | { |
| 182 | | konami_configure_set_lines(m_maincpu, blockhl_banking); |
| 183 | | |
| 184 | 180 | m_palette_selected = 0; |
| 185 | 181 | m_rombank = 0; |
| 186 | 182 | } |
| 187 | 183 | |
| 184 | KONAMICPU_LINE_CB_MEMBER( blockhl_state::banking_callback ) |
| 185 | { |
| 186 | /* bits 0-1 = ROM bank */ |
| 187 | m_rombank = lines & 0x03; |
| 188 | membank("bank1")->set_entry(m_rombank); |
| 189 | |
| 190 | /* bits 3/4 = coin counters */ |
| 191 | coin_counter_w(machine(), 0, lines & 0x08); |
| 192 | coin_counter_w(machine(), 1, lines & 0x10); |
| 193 | |
| 194 | /* bit 5 = select palette RAM or work RAM at 5800-5fff */ |
| 195 | m_palette_selected = ~lines & 0x20; |
| 196 | |
| 197 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 198 | m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 199 | |
| 200 | /* bit 7 used but unknown */ |
| 201 | |
| 202 | /* other bits unknown */ |
| 203 | |
| 204 | if ((lines & 0x84) != 0x80) |
| 205 | logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 206 | } |
| 207 | |
| 188 | 208 | static MACHINE_CONFIG_START( blockhl, blockhl_state ) |
| 189 | 209 | |
| 190 | 210 | /* basic machine hardware */ |
| 191 | 211 | MCFG_CPU_ADD("maincpu", KONAMI,3000000) /* Konami custom 052526 */ |
| 192 | 212 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 193 | 213 | MCFG_CPU_VBLANK_INT_DRIVER("screen", blockhl_state, blockhl_interrupt) |
| 214 | MCFG_KONAMICPU_LINE_CB(blockhl_state, banking_callback) |
| 194 | 215 | |
| 195 | 216 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 196 | 217 | MCFG_CPU_PROGRAM_MAP(audio_map) |
| r31112 | r31113 | |
| 286 | 307 | |
| 287 | 308 | ***************************************************************************/ |
| 288 | 309 | |
| 289 | | static KONAMI_SETLINES_CALLBACK( blockhl_banking ) |
| 290 | | { |
| 291 | | blockhl_state *state = device->machine().driver_data<blockhl_state>(); |
| 292 | | |
| 293 | | /* bits 0-1 = ROM bank */ |
| 294 | | state->m_rombank = lines & 0x03; |
| 295 | | state->membank("bank1")->set_entry(state->m_rombank); |
| 296 | | |
| 297 | | /* bits 3/4 = coin counters */ |
| 298 | | coin_counter_w(device->machine(), 0, lines & 0x08); |
| 299 | | coin_counter_w(device->machine(), 1, lines & 0x10); |
| 300 | | |
| 301 | | /* bit 5 = select palette RAM or work RAM at 5800-5fff */ |
| 302 | | state->m_palette_selected = ~lines & 0x20; |
| 303 | | |
| 304 | | /* bit 6 = enable char ROM reading through the video RAM */ |
| 305 | | state->m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 306 | | |
| 307 | | /* bit 7 used but unknown */ |
| 308 | | |
| 309 | | /* other bits unknown */ |
| 310 | | |
| 311 | | if ((lines & 0x84) != 0x80) |
| 312 | | logerror("%04x: setlines %02x\n", device->safe_pc(), lines); |
| 313 | | } |
| 314 | | |
| 315 | | |
| 316 | 310 | GAME( 1989, blockhl, 0, blockhl, blockhl, driver_device, 0, ROT0, "Konami", "Block Hole", GAME_SUPPORTS_SAVE ) |
| 317 | 311 | GAME( 1989, quarth, blockhl, blockhl, blockhl, driver_device, 0, ROT0, "Konami", "Quarth (Japan)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/parodius.c
| r31112 | r31113 | |
| 15 | 15 | #include "includes/konamipt.h" |
| 16 | 16 | #include "includes/parodius.h" |
| 17 | 17 | |
| 18 | | /* prototypes */ |
| 19 | | static KONAMI_SETLINES_CALLBACK( parodius_banking ); |
| 20 | | |
| 21 | | |
| 22 | 18 | INTERRUPT_GEN_MEMBER(parodius_state::parodius_interrupt) |
| 23 | 19 | { |
| 24 | 20 | if (m_k052109->is_irq_enabled()) |
| r31112 | r31113 | |
| 210 | 206 | |
| 211 | 207 | void parodius_state::machine_reset() |
| 212 | 208 | { |
| 213 | | int i; |
| 214 | | |
| 215 | | konami_configure_set_lines(m_maincpu, parodius_banking); |
| 216 | | |
| 217 | | for (i = 0; i < 3; i++) |
| 209 | for (int i = 0; i < 3; i++) |
| 218 | 210 | { |
| 219 | 211 | m_layerpri[i] = 0; |
| 220 | 212 | m_layer_colorbase[i] = 0; |
| r31112 | r31113 | |
| 225 | 217 | m_bank2000->set_bank(0); |
| 226 | 218 | } |
| 227 | 219 | |
| 220 | KONAMICPU_LINE_CB_MEMBER( parodius_state::banking_callback ) |
| 221 | { |
| 222 | if (lines & 0xf0) |
| 223 | logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 224 | |
| 225 | membank("bank1")->set_entry((lines & 0x0f) ^ 0x0f); |
| 226 | } |
| 227 | |
| 228 | 228 | static MACHINE_CONFIG_START( parodius, parodius_state ) |
| 229 | 229 | |
| 230 | 230 | /* basic machine hardware */ |
| 231 | 231 | MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* 053248 */ |
| 232 | 232 | MCFG_CPU_PROGRAM_MAP(parodius_map) |
| 233 | 233 | MCFG_CPU_VBLANK_INT_DRIVER("screen", parodius_state, parodius_interrupt) |
| 234 | MCFG_KONAMICPU_LINE_CB(parodius_state, banking_callback) |
| 234 | 235 | |
| 235 | 236 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 236 | 237 | MCFG_CPU_PROGRAM_MAP(parodius_sound_map) |
| r31112 | r31113 | |
| 378 | 379 | |
| 379 | 380 | ***************************************************************************/ |
| 380 | 381 | |
| 381 | | static KONAMI_SETLINES_CALLBACK( parodius_banking ) |
| 382 | | { |
| 383 | | if (lines & 0xf0) |
| 384 | | logerror("%04x: setlines %02x\n", device->safe_pc(), lines); |
| 385 | | |
| 386 | | device->machine().root_device().membank("bank1")->set_entry((lines & 0x0f) ^ 0x0f); |
| 387 | | } |
| 388 | | |
| 389 | 382 | GAME( 1990, parodius, 0, parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (World, set 1)", GAME_SUPPORTS_SAVE ) |
| 390 | 383 | GAME( 1990, parodiuse, parodius, parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (World, set 2)", GAME_SUPPORTS_SAVE ) |
| 391 | 384 | GAME( 1990, parodiusj, parodius, parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (Japan)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/vendetta.c
| r31112 | r31113 | |
| 96 | 96 | #include "includes/konamipt.h" |
| 97 | 97 | #include "includes/vendetta.h" |
| 98 | 98 | |
| 99 | | /* prototypes */ |
| 100 | | static KONAMI_SETLINES_CALLBACK( vendetta_banking ); |
| 101 | | |
| 102 | 99 | /*************************************************************************** |
| 103 | 100 | |
| 104 | 101 | EEPROM |
| r31112 | r31113 | |
| 435 | 432 | |
| 436 | 433 | void vendetta_state::machine_reset() |
| 437 | 434 | { |
| 438 | | int i; |
| 439 | | |
| 440 | | konami_configure_set_lines(m_maincpu, vendetta_banking); |
| 441 | | |
| 442 | | for (i = 0; i < 3; i++) |
| 435 | for (int i = 0; i < 3; i++) |
| 443 | 436 | { |
| 444 | 437 | m_layerpri[i] = 0; |
| 445 | 438 | m_layer_colorbase[i] = 0; |
| r31112 | r31113 | |
| 452 | 445 | vendetta_video_banking(0); |
| 453 | 446 | } |
| 454 | 447 | |
| 448 | KONAMICPU_LINE_CB_MEMBER( vendetta_state::banking_callback ) |
| 449 | { |
| 450 | if (lines >= 0x1c) |
| 451 | logerror("PC = %04x : Unknown bank selected %02x\n", machine().device("maincpu")->safe_pc(), lines); |
| 452 | else |
| 453 | membank("bank1")->set_entry(lines); |
| 454 | } |
| 455 | |
| 455 | 456 | static MACHINE_CONFIG_START( vendetta, vendetta_state ) |
| 456 | 457 | |
| 457 | 458 | /* basic machine hardware */ |
| 458 | 459 | MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */ |
| 459 | 460 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 460 | 461 | MCFG_CPU_VBLANK_INT_DRIVER("screen", vendetta_state, vendetta_irq) |
| 462 | MCFG_KONAMICPU_LINE_CB(vendetta_state, banking_callback) |
| 461 | 463 | |
| 462 | 464 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified with PCB */ |
| 463 | 465 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| r31112 | r31113 | |
| 744 | 746 | |
| 745 | 747 | ***************************************************************************/ |
| 746 | 748 | |
| 747 | | static KONAMI_SETLINES_CALLBACK( vendetta_banking ) |
| 748 | | { |
| 749 | | if (lines >= 0x1c) |
| 750 | | logerror("PC = %04x : Unknown bank selected %02x\n", device->safe_pc(), lines); |
| 751 | | else |
| 752 | | device->machine().root_device().membank("bank1")->set_entry(lines); |
| 753 | | } |
| 754 | | |
| 755 | 749 | DRIVER_INIT_MEMBER(vendetta_state,vendetta) |
| 756 | 750 | { |
| 757 | 751 | m_video_banking_base = 0x4000; |
trunk/src/mame/includes/thunderx.h
| r31112 | r31113 | |
| 3 | 3 | Super Contra / Thunder Cross |
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | #include "cpu/m6809/konami.h" |
| 6 | 7 | #include "sound/k007232.h" |
| 7 | 8 | #include "video/k052109.h" |
| 8 | 9 | #include "video/k051960.h" |
| r31112 | r31113 | |
| 66 | 67 | DECLARE_MACHINE_START(scontra); |
| 67 | 68 | DECLARE_MACHINE_RESET(scontra); |
| 68 | 69 | DECLARE_MACHINE_START(thunderx); |
| 69 | | DECLARE_MACHINE_RESET(thunderx); |
| 70 | 70 | UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 71 | 71 | INTERRUPT_GEN_MEMBER(scontra_interrupt); |
| 72 | 72 | void run_collisions( int s0, int e0, int s1, int e1, int cm, int hm ); |
| r31112 | r31113 | |
| 74 | 74 | DECLARE_WRITE8_MEMBER(volume_callback); |
| 75 | 75 | K052109_CB_MEMBER(tile_callback); |
| 76 | 76 | K051960_CB_MEMBER(sprite_callback); |
| 77 | KONAMICPU_LINE_CB_MEMBER(thunderx_banking_callback); |
| 77 | 78 | |
| 78 | 79 | protected: |
| 79 | 80 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
trunk/src/mame/includes/crimfght.h
| r31112 | r31113 | |
| 3 | 3 | Crime Fighters |
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | #include "cpu/m6809/konami.h" |
| 6 | 7 | #include "sound/k007232.h" |
| 7 | 8 | #include "video/k052109.h" |
| 8 | 9 | #include "video/k051960.h" |
| r31112 | r31113 | |
| 41 | 42 | DECLARE_WRITE8_MEMBER(k052109_051960_w); |
| 42 | 43 | DECLARE_WRITE8_MEMBER(crimfght_snd_bankswitch_w); |
| 43 | 44 | virtual void machine_start(); |
| 44 | | virtual void machine_reset(); |
| 45 | 45 | virtual void video_start(); |
| 46 | 46 | UINT32 screen_update_crimfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 47 | 47 | INTERRUPT_GEN_MEMBER(crimfght_interrupt); |
| 48 | 48 | DECLARE_WRITE8_MEMBER(volume_callback); |
| 49 | 49 | K052109_CB_MEMBER(tile_callback); |
| 50 | 50 | K051960_CB_MEMBER(sprite_callback); |
| 51 | KONAMICPU_LINE_CB_MEMBER(banking_callback); |
| 51 | 52 | }; |