Previous 15994 Revisions Next

r9847 Thursday 30th December, 2010 at 11:55:54 UTC by Tim Schuerewegen
[GBA] Fixed protected BIOS reads. This fixes the black screen in "Banjo Pilot".
[docs]messnew.txt
[src/mess/drivers]gba.c
[src/mess/includes]gba.h

src/mess/includes/gba.h
r9846r9847
204204   int fifo_a_ptr, fifo_b_ptr, fifo_a_in, fifo_b_in;
205205   UINT8 fifo_a[20], fifo_b[20];
206206   UINT32 xferscan[7][240+2048];
207   
208   UINT32 bios_last_address;
209   int bios_protected;
207210};
208211
209212/*----------- defined in video/gba.c -----------*/
src/mess/drivers/gba.c
r9846r9847
18911891   state->gba_oam[offset] = COMBINE_DATA32_16(state->gba_oam[offset], data, mem_mask);
18921892}
18931893
1894static READ32_HANDLER(gba_bios_r)
1895{
1896   running_machine *machine = space->machine;
1897   gba_state *state = machine->driver_data<gba_state>();
1898   UINT32 *rom = (UINT32 *)memory_region(space->machine, "maincpu");
1899   if (state->bios_protected != 0)
1900   {
1901      offset = (state->bios_last_address + 8) / 4;
1902   }
1903   return rom[offset&0x3fff];
1904}
1905
18941906static ADDRESS_MAP_START( gbadvance_map, ADDRESS_SPACE_PROGRAM, 32 )
1895   AM_RANGE(0x00000000, 0x00003fff) AM_ROMBANK("bank1")
1907   AM_RANGE(0x00000000, 0x00003fff) AM_ROM AM_READ(gba_bios_r)
18961908   AM_RANGE(0x02000000, 0x0203ffff) AM_RAM AM_MIRROR(0xfc0000)
18971909   AM_RANGE(0x03000000, 0x03007fff) AM_RAM AM_MIRROR(0xff8000)
18981910   AM_RANGE(0x04000000, 0x040003ff) AM_READWRITE( gba_io_r, gba_io_w )
r9846r9847
20912103}
20922104
20932105ROM_START( gba )
2094   ROM_REGION( 0x8000, "bios", ROMREGION_ERASE00 )
2106   ROM_REGION( 0x4000, "maincpu", 0 )
20952107   ROM_LOAD( "gba.bin", 0x000000, 0x004000, CRC(81977335) )
20962108
20972109   /* cartridge region - 32 MBytes (128 Mbit) */
r9846r9847
24712483   and some games verify that as a protection check (notably Metroid Fusion) */
24722484DIRECT_UPDATE_HANDLER( gba_direct )
24732485{
2486   gba_state *state = machine->driver_data<gba_state>();
24742487   if (address > 0x4000)
24752488   {
2476      memory_set_bankptr(machine, "bank1", memory_region(machine, "bios")+0x4000);
2489      state->bios_protected = 1;
24772490   }
24782491   else
24792492   {
2480      memory_set_bankptr(machine, "bank1", memory_region(machine, "bios"));
2493      state->bios_protected = 0;
2494      state->bios_last_address = address;
24812495   }
2482
24832496   return address;
24842497}
24852498
docs/messnew.txt
r9846r9847
8787  problems with "Golden Sun", "All-Star Baseball 2003" and maybe others
8888  too. [Tim Schuerewegen]
8989
90- [GBA] Fixed protected BIOS reads. This fixes the black screen in
91  "Banjo Pilot". [Tim Schuerewegen]
92
9093- [GENESIS] Added support for several genesis PCB carts [El Barto]
9194  Updated softlist to use PCB's
9295  Added J-Cart player 3 and 4 support

Previous 15994 Revisions Next


© 1998-2018 The MESS Team