mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 07:02:27 +01:00
byuu says: Changelog: - Master System: merged Bus into CPU - Mega Drive: merged BusCPU into CPU; BusAPU into AU - Mega Drive: added TMSS emulation; disabled by default [hex\_usr] - VDP lockout not yet emulated - processor/arm7tdmi: renamed interrupt() to exception() - processor/arm7tdmi: CPSR.F (FIQ disable) flag is set on reset - processor/arm7tdmi: pipeline decode stage caches CPSR.T (THUMB mode) [MerryMage] - fixes `msr_tests.gba` test F - processor/arm7tdmi/disassembler: add PC address to left of currently executing instruction - processor/arm7tdmi: stop forcing CPSR.M (mode flags) bit 4 high (I don't know what really happens here) - processor/arm7tdmi: undefined instructions now generate Undefined 0x4 exception - processor/arm7tdmi: thumbInstructionAddRegister masks PC by &~3 instead of &~2 - hopefully this is correct; &~2 felt very wrong - processor/arm7tdmi: thumbInstructionStackMultiple can use sequential timing for PC/LR PUSH/POP [Cydrak] - systems/Mega Drive.sys: added tmss.rom; enable with cpu version=1 - tomoko: detect when a ruby video/audio/input driver crashes higan; disable it on next program startup v104 blockers: - Mega Drive: support 8-bit SRAM (even if we don't support 16-bit; don't force 8-bit to 16-bit) - Mega Drive: add region detection support to icarus - ruby: add default audio device information so certain drivers won't default to silence out of the box
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
auto APU::read(uint16 addr) -> uint8 {
|
|
if((addr & 0xe000) == 0x0000) {
|
|
return ram[addr];
|
|
}
|
|
|
|
if(addr == 0x4000) return ym2612.readStatus();
|
|
if(addr == 0x4001) return ym2612.readStatus();
|
|
if(addr == 0x4002) return ym2612.readStatus();
|
|
if(addr == 0x4003) return ym2612.readStatus();
|
|
|
|
if((addr & 0x8000) == 0x8000) {
|
|
return cartridge.read(io.bank << 15 | (addr & 0x7ffe)).byte(!addr.bit(0));
|
|
}
|
|
}
|
|
|
|
auto APU::write(uint16 addr, uint8 data) -> void {
|
|
if((addr & 0xe000) == 0x0000) {
|
|
ram[addr] = data;
|
|
return;
|
|
}
|
|
|
|
if(addr == 0x4000) return ym2612.writeAddress(0 << 8 | data);
|
|
if(addr == 0x4001) return ym2612.writeData(data);
|
|
if(addr == 0x4002) return ym2612.writeAddress(1 << 8 | data);
|
|
if(addr == 0x4003) return ym2612.writeData(data);
|
|
|
|
if(addr == 0x6000) {
|
|
//1-bit shift register
|
|
io.bank = data.bit(0) << 8 | io.bank >> 1;
|
|
return;
|
|
}
|
|
|
|
if(addr == 0x7f11) return psg.write(data);
|
|
if(addr == 0x7f13) return psg.write(data);
|
|
if(addr == 0x7f15) return psg.write(data);
|
|
if(addr == 0x7f17) return psg.write(data);
|
|
|
|
if((addr & 0x8000) == 0x8000) {
|
|
//todo: do 8-bit writes mirror to 16-bits?
|
|
return cartridge.write(io.bank << 15 | (addr & 0x7ffe), data << 8 | data << 0);
|
|
}
|
|
}
|
|
|
|
//unused on Mega Drive
|
|
auto APU::in(uint8 addr) -> uint8 {
|
|
return 0x00;
|
|
}
|
|
|
|
//unused on Mega Drive
|
|
auto APU::out(uint8 addr, uint8 data) -> void {
|
|
}
|