bsnes/gba/system/bios.cpp
Tim Allen 41c478ac4a Update to v095r07 release.
byuu says:

Changelog:
- entire GBA core ported to auto function() -> return; syntax
- fixed GBA BLDY bug that was causing flickering in a few games
- replaced nall/config usage with nall/string/markup/node
  - this merges all configuration files to a unified settings.bml file
- added "Ignore Manifests" option to the advanced setting tab
  - this lets you keep a manifest.bml for an older version of higan; if
    you want to do regression testing

Be sure to remap your controller/hotkey inputs, and for SNES, choose
"Gamepad" from "Controller Port 1" in the system menu. Otherwise you
won't get any input. No need to blow away your old config files, unless
you want to.
2015-11-16 19:38:05 +11:00

26 lines
741 B
C++

BIOS::BIOS() {
size = 16384;
data = new uint8[size]();
}
BIOS::~BIOS() {
delete[] data;
}
auto BIOS::read(uint mode, uint32 addr) -> uint32 {
//unmapped memory
if(addr >= 0x0000'4000) return cpu.pipeline.fetch.instruction; //0000'4000-01ff'ffff
//GBA BIOS is read-protected; only the BIOS itself can read its own memory
//when accessed elsewhere; this should return the last value read by the BIOS program
if(cpu.r(15) >= 0x0000'4000) return mdr;
if(mode & Word) return mdr = read(Half, addr &~ 2) << 0 | read(Half, addr | 2) << 16;
if(mode & Half) return mdr = read(Byte, addr &~ 1) << 0 | read(Byte, addr | 1) << 8;
return mdr = data[addr];
}
auto BIOS::write(uint mode, uint32 addr, uint32 word) -> void {
}