mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: Changelog: - processor/arm7tdmi: completed implemented - gba/cpu, sfc/coprocessor/armdsp: use arm7tdmi instead of arm - sfc/cpu: experimental fix for newly discovered HDMA emulation issue Notes: The ARM7TDMI core crashes pretty quickly when trying to run GBA games, and I'm certain the same will be the case with the ST018. It was never all that likely I could rewrite 70KiB of code in 20 hours and have it work perfectly on the first try. So, now it's time for lots and lots of debugging. Any help would *really* be appreciated, if anyone were up for comparing the two implementations for regressions =^-^= I often have a really hard time spotting simple typos that I make. Also, the SNES HDMA fix is temporary. I would like it if testers could run through a bunch of games that are known for being tricky with HDMA (or if these aren't known to said tester, any games are fine then.) If we can confirm regressions, then we'll know the fix is either incorrect or incomplete. But if we don't find any, then it's a good sign that we're on the right path.
28 lines
761 B
C++
28 lines
761 B
C++
BIOS bios;
|
|
|
|
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.processor.r15 >= 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 {
|
|
}
|