mirror of https://github.com/mgba-emu/mgba.git
GBA BIOS: Implement Diff8bitUnFilterVram
This commit is contained in:
parent
fb35a8b3f7
commit
600080ba0c
2
CHANGES
2
CHANGES
|
@ -14,7 +14,7 @@ Features:
|
||||||
- Support for games using the tilt sensor
|
- Support for games using the tilt sensor
|
||||||
- Remappable shortcuts for keyboard and gamepad
|
- Remappable shortcuts for keyboard and gamepad
|
||||||
- Rewinding of emulation
|
- Rewinding of emulation
|
||||||
- Implemented BIOS routines Diff8bitUnFilterWram, and Diff16bitUnFilter
|
- Implemented BIOS routines Diff8bitUnFilterWram, Diff8bitUnFilterVram, and Diff16bitUnFilter
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Qt: Fix issue with set frame sizes being the wrong height
|
- Qt: Fix issue with set frame sizes being the wrong height
|
||||||
- Qt: Fix emulator crashing when full screen if a game is not running
|
- Qt: Fix emulator crashing when full screen if a game is not running
|
||||||
|
|
|
@ -477,26 +477,32 @@ static void _unFilter(struct GBA* gba, int inwidth, int outwidth) {
|
||||||
uint16_t old = 0;
|
uint16_t old = 0;
|
||||||
source += 4;
|
source += 4;
|
||||||
while (remaining > 0) {
|
while (remaining > 0) {
|
||||||
|
uint16_t new;
|
||||||
if (inwidth == 1) {
|
if (inwidth == 1) {
|
||||||
halfword = cpu->memory.loadU8(cpu, source, 0);
|
new = cpu->memory.loadU8(cpu, source, 0);
|
||||||
} else {
|
} else {
|
||||||
halfword = cpu->memory.loadU16(cpu, source, 0);
|
new = cpu->memory.loadU16(cpu, source, 0);
|
||||||
}
|
}
|
||||||
halfword += old;
|
new += old;
|
||||||
if (outwidth > inwidth) {
|
if (outwidth > inwidth) {
|
||||||
GBALog(gba, GBA_LOG_STUB, "Unimplemented Diff8bitUnFilterVram");
|
halfword >>= 8;
|
||||||
} else {
|
halfword |= (new << 8);
|
||||||
if (outwidth == 1) {
|
if (source & 1) {
|
||||||
halfword &= 0xFF;
|
|
||||||
cpu->memory.store8(cpu, dest, halfword, 0);
|
|
||||||
} else {
|
|
||||||
cpu->memory.store16(cpu, dest, halfword, 0);
|
cpu->memory.store16(cpu, dest, halfword, 0);
|
||||||
|
dest += outwidth;
|
||||||
|
remaining -= outwidth;
|
||||||
}
|
}
|
||||||
old = halfword;
|
} else if (outwidth == 1) {
|
||||||
|
cpu->memory.store8(cpu, dest, new, 0);
|
||||||
dest += outwidth;
|
dest += outwidth;
|
||||||
|
remaining -= outwidth;
|
||||||
|
} else {
|
||||||
|
cpu->memory.store16(cpu, dest, new, 0);
|
||||||
|
dest += outwidth;
|
||||||
|
remaining -= outwidth;
|
||||||
}
|
}
|
||||||
|
old = new;
|
||||||
source += inwidth;
|
source += inwidth;
|
||||||
remaining -= outwidth;
|
|
||||||
}
|
}
|
||||||
cpu->gprs[0] = source;
|
cpu->gprs[0] = source;
|
||||||
cpu->gprs[1] = dest;
|
cpu->gprs[1] = dest;
|
||||||
|
|
Loading…
Reference in New Issue