diff options
Diffstat (limited to 'src/mame/drivers/pirates.c')
-rw-r--r-- | src/mame/drivers/pirates.c | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c index 3f0a62e5ca9..b105b8b51ae 100644 --- a/src/mame/drivers/pirates.c +++ b/src/mame/drivers/pirates.c @@ -96,13 +96,13 @@ Notes: static const eeprom_interface eeprom_intf = { - 6, /* address bits */ - 16, /* data bits */ - "*110", /* read command */ - "*101", /* write command */ - 0, /* erase command */ - "*10000xxxx", /* lock command */ - "*10011xxxx" /* unlock command */ + 6, /* address bits */ + 16, /* data bits */ + "*110", /* read command */ + "*101", /* write command */ + 0, /* erase command */ + "*10000xxxx", /* lock command */ + "*10011xxxx" /* unlock command */ }; WRITE16_MEMBER(pirates_state::pirates_out_w) @@ -136,7 +136,7 @@ CUSTOM_INPUT_MEMBER(pirates_state::prot_r) #if 0 /* Pirates protection workaround. It more complicated than this... see code at - 602e and 62a6 */ + 602e and 62a6 */ /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */ pc = machine().device("main")->safe_pc(); @@ -171,7 +171,7 @@ static ADDRESS_MAP_START( pirates_map, AS_PROGRAM, 16, pirates_state ) AM_RANGE(0x500000, 0x5007ff) AM_WRITEONLY AM_SHARE("spriteram") // AM_RANGE(0x500800, 0x50080f) AM_WRITENOP AM_RANGE(0x600000, 0x600001) AM_WRITE(pirates_out_w) - AM_RANGE(0x700000, 0x700001) AM_WRITEONLY AM_SHARE("scroll") // scroll reg + AM_RANGE(0x700000, 0x700001) AM_WRITEONLY AM_SHARE("scroll") // scroll reg AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") AM_RANGE(0x900000, 0x90017f) AM_RAM // more of tilemaps ? AM_RANGE(0x900180, 0x90137f) AM_RAM_WRITE(pirates_tx_tileram_w) AM_SHARE("tx_tileram") @@ -186,7 +186,7 @@ ADDRESS_MAP_END /* Input Ports */ static INPUT_PORTS_START( pirates ) - PORT_START("INPUTS") /* 0x300000.w */ + PORT_START("INPUTS") /* 0x300000.w */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) @@ -204,15 +204,15 @@ static INPUT_PORTS_START( pirates ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("SYSTEM") /* 0x400000.w */ + PORT_START("SYSTEM") /* 0x400000.w */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // EEPROM data - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" - PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pirates_state,prot_r, NULL) // protection + PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) // EEPROM data + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // seems checked in "test mode" + PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pirates_state,prot_r, NULL) // protection /* What do these bits do ? */ PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) @@ -244,9 +244,9 @@ static const gfx_layout spritelayout = 4, { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) }, { 7, 6, 5, 4, 3, 2, 1, 0, - 15,14,13,12,11,10, 9, 8 }, + 15,14,13,12,11,10, 9, 8 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16 }, + 8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16 }, 16*16 }; @@ -337,101 +337,101 @@ ROM_END static void pirates_decrypt_68k(running_machine &machine) { - int rom_size; - UINT16 *buf, *rom; - int i; + int rom_size; + UINT16 *buf, *rom; + int i; - rom_size = machine.root_device().memregion("maincpu")->bytes(); + rom_size = machine.root_device().memregion("maincpu")->bytes(); - buf = auto_alloc_array(machine, UINT16, rom_size/2); + buf = auto_alloc_array(machine, UINT16, rom_size/2); - rom = (UINT16 *)machine.root_device().memregion("maincpu")->base(); - memcpy (buf, rom, rom_size); + rom = (UINT16 *)machine.root_device().memregion("maincpu")->base(); + memcpy (buf, rom, rom_size); - for (i=0; i<rom_size/2; i++) - { - int adrl, adrr; - UINT8 vl, vr; + for (i=0; i<rom_size/2; i++) + { + int adrl, adrr; + UINT8 vl, vr; - adrl = BITSWAP24(i,23,22,21,20,19,18,4,8,3,14,2,15,17,0,9,13,10,5,16,7,12,6,1,11); - vl = BITSWAP8(buf[adrl], 4,2,7,1,6,5,0,3); + adrl = BITSWAP24(i,23,22,21,20,19,18,4,8,3,14,2,15,17,0,9,13,10,5,16,7,12,6,1,11); + vl = BITSWAP8(buf[adrl], 4,2,7,1,6,5,0,3); - adrr = BITSWAP24(i,23,22,21,20,19,18,4,10,1,11,12,5,9,17,14,0,13,6,15,8,3,16,7,2); - vr = BITSWAP8(buf[adrr]>>8, 1,4,7,0,3,5,6,2); + adrr = BITSWAP24(i,23,22,21,20,19,18,4,10,1,11,12,5,9,17,14,0,13,6,15,8,3,16,7,2); + vr = BITSWAP8(buf[adrr]>>8, 1,4,7,0,3,5,6,2); - rom[i] = (vr<<8) | vl; - } - auto_free (machine, buf); + rom[i] = (vr<<8) | vl; + } + auto_free (machine, buf); } static void pirates_decrypt_p(running_machine &machine) { - int rom_size; - UINT8 *buf, *rom; - int i; + int rom_size; + UINT8 *buf, *rom; + int i; - rom_size = machine.root_device().memregion("gfx1")->bytes(); + rom_size = machine.root_device().memregion("gfx1")->bytes(); - buf = auto_alloc_array(machine, UINT8, rom_size); + buf = auto_alloc_array(machine, UINT8, rom_size); - rom = machine.root_device().memregion("gfx1")->base(); - memcpy (buf, rom, rom_size); + rom = machine.root_device().memregion("gfx1")->base(); + memcpy (buf, rom, rom_size); - for (i=0; i<rom_size/4; i++) - { + for (i=0; i<rom_size/4; i++) + { int adr = BITSWAP24(i,23,22,21,20,19,18,10,2,5,9,7,13,16,14,11,4,1,6,12,17,3,0,15,8); rom[adr+0*(rom_size/4)] = BITSWAP8(buf[i+0*(rom_size/4)], 2,3,4,0,7,5,1,6); rom[adr+1*(rom_size/4)] = BITSWAP8(buf[i+1*(rom_size/4)], 4,2,7,1,6,5,0,3); rom[adr+2*(rom_size/4)] = BITSWAP8(buf[i+2*(rom_size/4)], 1,4,7,0,3,5,6,2); rom[adr+3*(rom_size/4)] = BITSWAP8(buf[i+3*(rom_size/4)], 2,3,4,0,7,5,1,6); - } - auto_free (machine, buf); + } + auto_free (machine, buf); } static void pirates_decrypt_s(running_machine &machine) { - int rom_size; - UINT8 *buf, *rom; - int i; + int rom_size; + UINT8 *buf, *rom; + int i; - rom_size = machine.root_device().memregion("gfx2")->bytes(); + rom_size = machine.root_device().memregion("gfx2")->bytes(); - buf = auto_alloc_array(machine, UINT8, rom_size); + buf = auto_alloc_array(machine, UINT8, rom_size); - rom = machine.root_device().memregion("gfx2")->base(); - memcpy (buf, rom, rom_size); + rom = machine.root_device().memregion("gfx2")->base(); + memcpy (buf, rom, rom_size); - for (i=0; i<rom_size/4; i++) - { + for (i=0; i<rom_size/4; i++) + { int adr = BITSWAP24(i,23,22,21,20,19,18,17,5,12,14,8,3,0,7,9,16,4,2,6,11,13,1,10,15); rom[adr+0*(rom_size/4)] = BITSWAP8(buf[i+0*(rom_size/4)], 4,2,7,1,6,5,0,3); rom[adr+1*(rom_size/4)] = BITSWAP8(buf[i+1*(rom_size/4)], 1,4,7,0,3,5,6,2); rom[adr+2*(rom_size/4)] = BITSWAP8(buf[i+2*(rom_size/4)], 2,3,4,0,7,5,1,6); rom[adr+3*(rom_size/4)] = BITSWAP8(buf[i+3*(rom_size/4)], 4,2,7,1,6,5,0,3); - } - auto_free (machine, buf); + } + auto_free (machine, buf); } static void pirates_decrypt_oki(running_machine &machine) { - int rom_size; - UINT8 *buf, *rom; - int i; + int rom_size; + UINT8 *buf, *rom; + int i; - rom_size = machine.root_device().memregion("oki")->bytes(); + rom_size = machine.root_device().memregion("oki")->bytes(); - buf = auto_alloc_array(machine, UINT8, rom_size); + buf = auto_alloc_array(machine, UINT8, rom_size); - rom = machine.root_device().memregion("oki")->base(); - memcpy (buf, rom, rom_size); + rom = machine.root_device().memregion("oki")->base(); + memcpy (buf, rom, rom_size); - for (i=0; i<rom_size; i++) - { + for (i=0; i<rom_size; i++) + { int adr = BITSWAP24(i,23,22,21,20,19,10,16,13,8,4,7,11,14,17,12,6,2,0,5,18,15,3,1,9); rom[adr] = BITSWAP8(buf[i], 2,3,4,0,7,5,1,6); - } - auto_free (machine, buf); + } + auto_free (machine, buf); } @@ -448,7 +448,7 @@ DRIVER_INIT_MEMBER(pirates_state,pirates) rom[0x62c0/2] = 0x6006; // beq -> bra } -READ16_MEMBER(pirates_state::genix_prot_r){ if(!offset) return 0x0004; else return 0x0000; } +READ16_MEMBER(pirates_state::genix_prot_r){ if(!offset) return 0x0004; else return 0x0000; } DRIVER_INIT_MEMBER(pirates_state,genix) { |