mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Changes the dynamic installation of MRA8_RAM to banks
This commit is contained in:
parent
ebbb610f72
commit
fcf7dd71a9
5 changed files with 40 additions and 52 deletions
|
@ -48,23 +48,20 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
|
|||
memory_set_bankptr(4,&RAM[bankaddress]);
|
||||
|
||||
/* bit 5 = memory bank select */
|
||||
if (data & 0x20){
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_RAM); /* palette */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w); /* palette */
|
||||
if (K051316_readroms){
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r); /* 051316 #1 (ROM test) */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_w); /* 051316 #1 */
|
||||
}
|
||||
else{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r); /* 051316 #1 */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_w); /* 051316 #1 */
|
||||
}
|
||||
if (data & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(5, paletteram);
|
||||
|
||||
if (K051316_readroms)
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
|
||||
else
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
|
||||
}
|
||||
else{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MRA8_BANK1); /* RAM */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MWA8_BANK1); /* RAM */
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK2); /* RAM */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MWA8_BANK2); /* RAM */
|
||||
else
|
||||
{
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, MRA8_BANK1, MWA8_BANK1); /* RAM */
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, MRA8_BANK2, MWA8_BANK2); /* RAM */
|
||||
}
|
||||
|
||||
/* other bits unknown/unused */
|
||||
|
|
|
@ -490,20 +490,19 @@ static void crimfght_banking( int lines )
|
|||
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, MRA8_RAM); /* palette */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w); /* palette */
|
||||
}
|
||||
else{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK1); /* RAM */
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MWA8_BANK1); /* RAM */
|
||||
if (lines & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(3, paletteram);
|
||||
}
|
||||
else
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, MRA8_BANK1, MWA8_BANK1); /* 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( 2, &RAM[offs] );
|
||||
offs = 0x10000 + ((lines & 0x0f) * 0x2000);
|
||||
memory_set_bankptr(2, &RAM[offs]);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( crimfght )
|
||||
|
|
|
@ -204,17 +204,14 @@ static void vendetta_video_banking( int select )
|
|||
{
|
||||
if ( select & 1 )
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, MRA8_RAM );
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w );
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r );
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_w );
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, MRA8_BANK4, paletteram_xBBBBBGGGGGRRRRR_be_w );
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K053247_r, K053247_w );
|
||||
memory_set_bankptr(4, paletteram);
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r );
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_w );
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r );
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_w );
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x2000, video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w );
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, video_banking_base + 0x0000, video_banking_base + 0x0fff, 0, 0, K052109_r, K052109_w );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,9 +142,11 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
|
|||
|
||||
wardner_membank = data;
|
||||
|
||||
if (data) {
|
||||
if (data)
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xffff, 0, 0, MRA8_BANK1);
|
||||
switch (data) {
|
||||
switch (data)
|
||||
{
|
||||
case 2: bankaddress = 0x10000; break;
|
||||
case 3: bankaddress = 0x18000; break;
|
||||
case 4: bankaddress = 0x20000; break;
|
||||
|
@ -156,14 +158,16 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
|
|||
}
|
||||
memory_set_bankptr(1,&RAM[bankaddress]);
|
||||
}
|
||||
else {
|
||||
memory_set_bankptr(1,&RAM[0x0000]);
|
||||
else
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x8fff, 0, 0, wardner_sprite_r);
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, MRA8_RAM);
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xadff, 0, 0, MRA8_BANK4);
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xae00, 0xafff, 0, 0, MRA8_BANK2);
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc7ff, 0, 0, MRA8_BANK3);
|
||||
memory_set_bankptr(1, &RAM[0x0000]);
|
||||
memory_set_bankptr(2, rambase_ae00);
|
||||
memory_set_bankptr(3, rambase_c000);
|
||||
memory_set_bankptr(4, paletteram);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,25 +103,16 @@ void simpsons_video_banking(int bank)
|
|||
{
|
||||
if (bank & 1)
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, MRA8_RAM);
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, MRA8_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(5, paletteram);
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r);
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_w);
|
||||
}
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0, K052109_r, K052109_w);
|
||||
|
||||
if (bank & 2)
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r);
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_w);
|
||||
}
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K053247_r, simpsons_K053247_w);
|
||||
else
|
||||
{
|
||||
memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r);
|
||||
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_w);
|
||||
}
|
||||
memory_install_readwrite8_handler(0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, simpsons_K052109_r, simpsons_K052109_w);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue