ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static void crimfght_banking( int lines ) { unsigned char *RAM = memory_region(REGION_CPU1); int offs = 0; /* bit 5 = select work RAM or palette */ if (lines & 0x20){ cpu_setbankhandler_r (1, paletteram_r); /* palette */ cpu_setbankhandler_w (1, paletteram_xBBBBBGGGGGRRRRR_swap_w); /* palette */ } else{ cpu_setbankhandler_r (1, MRA_RAM); /* RAM */ cpu_setbankhandler_w (1, MWA_RAM); /* RAM */ } /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); offs = 0x10000 + ( ( lines & 0x0f ) * 0x2000 ); cpu_setbank( 2, &RAM[offs] ); }
ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static void crimfght_banking( int lines ) { unsigned char *RAM = memory_region(REGION_CPU1); int offs = 0; /* bit 5 = select work RAM or palette */ if (lines & 0x20){ memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, paletteram_r); /* palette */ memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_swap_w); /* palette */ } else{ memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_RAM); /* RAM */ memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MWA8_RAM); /* RAM */ } /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); offs = 0x10000 + ( ( lines & 0x0f ) * 0x2000 ); cpu_setbank( 2, &RAM[offs] ); }
/*************************************************************************** Game ROMs ***************************************************************************/ ROM_START( blockhl ) ROM_REGION( 0x18800, REGION_CPU1 ) /* code + banked roms + space for banked RAM */ ROM_LOAD( "973l02.e21", 0x10000, 0x08000, 0xe14f849a ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */ ROM_LOAD( "973d01.g6", 0x0000, 0x8000, 0xeeee9d92 ) ROM_REGION( 0x20000, REGION_GFX1 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973f07.k15", 0x00000, 0x08000, 0x1a8cd9b4 ) /* tiles */ ROM_LOAD_GFX_ODD ( "973f08.k18", 0x00000, 0x08000, 0x952b51a6 ) ROM_LOAD_GFX_EVEN( "973f09.k20", 0x10000, 0x08000, 0x77841594 ) ROM_LOAD_GFX_ODD ( "973f10.k23", 0x10000, 0x08000, 0x09039fab ) ROM_REGION( 0x20000, REGION_GFX2 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973f06.k12", 0x00000, 0x08000, 0x51acfdb6 ) /* sprites */ ROM_LOAD_GFX_ODD ( "973f05.k9", 0x00000, 0x08000, 0x4cfea298 ) ROM_LOAD_GFX_EVEN( "973f04.k7", 0x10000, 0x08000, 0x69ca41bd ) ROM_LOAD_GFX_ODD ( "973f03.k4", 0x10000, 0x08000, 0x21e98472 ) ROM_REGION( 0x0100, REGION_PROMS ) /* PROMs */ ROM_LOAD( "973a11.h10", 0x0000, 0x0100, 0x46d28fe9 ) /* priority encoder (not used) */ ROM_END ROM_START( quarth ) ROM_REGION( 0x18800, REGION_CPU1 ) /* code + banked roms + space for banked RAM */ ROM_LOAD( "973j02.e21", 0x10000, 0x08000, 0x27a90118 ) ROM_CONTINUE( 0x08000, 0x08000 ) ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the sound CPU */ ROM_LOAD( "973d01.g6", 0x0000, 0x8000, 0xeeee9d92 ) ROM_REGION( 0x20000, REGION_GFX1 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973e07.k15", 0x00000, 0x08000, 0x0bd6b0f8 ) /* tiles */ ROM_LOAD_GFX_ODD ( "973e08.k18", 0x00000, 0x08000, 0x104d0d5f ) ROM_LOAD_GFX_EVEN( "973e09.k20", 0x10000, 0x08000, 0xbd3a6f24 ) ROM_LOAD_GFX_ODD ( "973e10.k23", 0x10000, 0x08000, 0xcf5e4b86 ) ROM_REGION( 0x20000, REGION_GFX2 ) /* graphics (addressable by the main CPU) */ ROM_LOAD_GFX_EVEN( "973e06.k12", 0x00000, 0x08000, 0x0d58af85 ) /* sprites */ ROM_LOAD_GFX_ODD ( "973e05.k9", 0x00000, 0x08000, 0x15d822cb ) ROM_LOAD_GFX_EVEN( "973e04.k7", 0x10000, 0x08000, 0xd70f4a2c ) ROM_LOAD_GFX_ODD ( "973e03.k4", 0x10000, 0x08000, 0x2c5a4b4b ) ROM_REGION( 0x0100, REGION_PROMS ) /* PROMs */ ROM_LOAD( "973a11.h10", 0x0000, 0x0100, 0x46d28fe9 ) /* priority encoder (not used) */ ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static void blockhl_banking( int lines ) { unsigned char *RAM = memory_region(REGION_CPU1); int offs; /* bits 0-1 = ROM bank */ rombank = lines & 0x03; offs = 0x10000 + (lines & 0x03) * 0x2000; cpu_setbank(1,&RAM[offs]); /* bits 3/4 = coin counters */ coin_counter_w(0,lines & 0x08); coin_counter_w(1,lines & 0x10); /* bit 5 = select palette RAM or work RAM at 5800-5fff */ palette_selected = ~lines & 0x20; /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line( ( lines & 0x40 ) ? ASSERT_LINE : CLEAR_LINE ); /* bit 7 used but unknown */ /* other bits unknown */ //if ((lines & 0x84) != 0x80) logerror("%04x: setlines %02x\n",cpu_get_pc(),lines); }
ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static KONAMI_SETLINES_CALLBACK( crimfght_banking ) { UINT8 *RAM = memory_region(device->machine, "maincpu"); int offs = 0; /* bit 5 = select work RAM or palette */ if (lines & 0x20) { memory_install_readwrite8_handler(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, (read8_space_func)SMH_BANK(3), paletteram_xBBBBBGGGGGRRRRR_be_w); memory_set_bankptr(device->machine, 3, paletteram); } else memory_install_readwrite8_handler(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1)); /* RAM */ /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); offs = 0x10000 + ((lines & 0x0f) * 0x2000); memory_set_bankptr(device->machine, 2, &RAM[offs]); }
static WRITE_HANDLER( thunderx_1f98_w ) { //logerror("%04x: write %02x to 1f98\n",cpu_get_pc(),data); /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); /* bit 1 unknown - used by Thunder Cross during test of RAM C8 (5800-5fff) */ if ( data & 2 ) calculate_collisions(); }
void simpsons_coin_counter_w( int offset, int data ) { /* bit 0,1 coin counters */ coin_counter_w(0,data & 0x01); coin_counter_w(1,data & 0x02); /* bit 2 selects mono or stereo sound */ /* bit 3 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); /* bit 4 = INIT (unknown) */ /* bit 5 = enable sprite ROM reading */ K053246_set_OBJCHA_line((~data & 0x20) ? ASSERT_LINE : CLEAR_LINE); }
static WRITE_HANDLER( surpratk_5fc0_w ) { if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",activecpu_get_pc(),data); /* bit 0/1 = coin counters */ coin_counter_w(0,data & 0x01); coin_counter_w(1,data & 0x02); /* bit 3 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line( ( data & 0x08 ) ? ASSERT_LINE : CLEAR_LINE ); /* other bits unknown */ }
static WRITE_HANDLER( gbusters_1f98_w ) { /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); /* bit 7 used (during gfx rom tests), but unknown */ /* other bits unused/unknown */ //if (data & 0xfe){ //logerror("%04x: (1f98) write %02x\n",cpu_get_pc(), data); //usrintf_showmessage("$1f98 = %02x", data); //} }
static WRITE_HANDLER( thunderx_1f98_w ) { //logerror("%04x: write %02x to 1f98\n",cpu_get_pc(),data); /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); /* bit 1 = reset for collision MCU??? */ /* we don't need it, anyway */ /* bit 2 = do collision detection when 0->1 */ if ((data & 4) && !(unknown_enable & 4)) { calculate_collisions(); } unknown_enable = data; }
ROM_END static void k88games_banking( int lines ) { unsigned char *RAM = memory_region(REGION_CPU1); int offs; logerror("%04x: bank select %02x\n",activecpu_get_pc(),lines); /* bits 0-2 select ROM bank for 0000-1fff */ /* bit 3: when 1, palette RAM at 1000-1fff */ /* bit 4: when 0, 051316 RAM at 3800-3fff; when 1, work RAM at 2000-3fff (NVRAM 3370-37ff) */ offs = 0x10000 + (lines & 0x07) * 0x2000; memcpy(RAM,&RAM[offs],0x1000); if (lines & 0x08) { if (paletteram != &RAM[0x1000]) { memcpy(&RAM[0x1000],paletteram,0x1000); paletteram = &RAM[0x1000]; } } else { if (paletteram != &RAM[0x20000]) { memcpy(&RAM[0x20000],paletteram,0x1000); paletteram = &RAM[0x20000]; } memcpy(&RAM[0x1000],&RAM[offs+0x1000],0x1000); } videobank = lines & 0x10; /* bit 5 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((lines & 0x20) ? ASSERT_LINE : CLEAR_LINE); /* bit 6 is unknown, 1 most of the time */ /* bit 7 controls layer priority */ k88games_priority = lines & 0x80; }
void mainevt_bankswitch_w(int offset, int data) { unsigned char *RAM = memory_region(REGION_CPU1); int bankaddress; /* bit 0-1 ROM bank select */ bankaddress = 0x10000 + (data & 0x03) * 0x2000; cpu_setbank(1,&RAM[bankaddress]); /* TODO: bit 5 = select work RAM or palette? */ // palette_selected = data & 0x20; /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); /* bit 7 = NINITSET (unknown) */ /* other bits unused */ }
static WRITE_HANDLER( aliens_coin_counter_w ) { /* bits 0-1 = coin counters */ coin_counter_w(0,data & 0x01); coin_counter_w(1,data & 0x02); /* bit 5 = select work RAM or palette */ palette_selected = data & 0x20; /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); /* other bits unknown */ #if 0 { char baf[40]; sprintf(baf,"%02x",data); usrintf_showmessage(baf); } #endif }
static WRITE_HANDLER( thunderx_1f98_w ) { // logerror("%04x: 1f98_w %02x\n",activecpu_get_pc(),data); /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); /* bit 1 = PMC-BK */ pmcbank = (data & 0x02) >> 1; /* bit 2 = do collision detection when 0->1 */ if ((data & 4) && !(unknown_enable & 4)) { calculate_collisions(); /* 100 cycle delay is arbitrary */ timer_set(TIME_IN_CYCLES(100,0),0, thunderx_firq_callback); } unknown_enable = data; }
static WRITE8_HANDLER( thunderx_1f98_w ) { // logerror("%04x: 1f98_w %02x\n",cpu_get_pc(space->cpu),data); /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); /* bit 1 = PMC-BK */ pmcbank = (data & 0x02) >> 1; /* bit 2 = do collision detection when 0->1 */ if ((data & 4) && !(thunderx_1f98_data & 4)) { calculate_collisions(); /* 100 cycle delay is arbitrary */ timer_set(space->machine, cpu_clocks_to_attotime(space->cpu,100), NULL, 0, thunderx_firq_callback); } thunderx_1f98_data = data; }
static WRITE16_HANDLER( eeprom_w ) { logerror("%06x: write %04x to 108000\n",activecpu_get_pc(),data); if (ACCESSING_LSB) { /* bit 0 = coin counter */ coin_counter_w(0,data & 0x01); /* bit 2 is data */ /* bit 3 is clock (active high) */ /* bit 4 is cs (active low) */ EEPROM_write_bit(data & 0x04); EEPROM_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE); EEPROM_set_clock_line((data & 0x08) ? ASSERT_LINE : CLEAR_LINE); } if (ACCESSING_MSB) { /* bit 8 = enable sprite ROM reading */ K053246_set_OBJCHA_line((data & 0x0100) ? ASSERT_LINE : CLEAR_LINE); /* bit 9 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x0200) ? ASSERT_LINE : CLEAR_LINE); } }