mirror of https://github.com/mgba-emu/mgba.git
GBA Hardware: Fix crash if a savestate lies about game hardware
This commit is contained in:
parent
fbb8b2431b
commit
2a8ae75561
1
CHANGES
1
CHANGES
|
@ -24,6 +24,7 @@ Bugfixes:
|
||||||
- GBA Video: Don't update background scanline params in mode 0 (fixes mgba.io/i/377)
|
- GBA Video: Don't update background scanline params in mode 0 (fixes mgba.io/i/377)
|
||||||
- Core: Fix crash with rewind if savestates shrink
|
- Core: Fix crash with rewind if savestates shrink
|
||||||
- Test: Fix crash when loading invalid file
|
- Test: Fix crash when loading invalid file
|
||||||
|
- GBA Hardware: Fix crash if a savestate lies about game hardware
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Improved HiDPI support
|
- Qt: Improved HiDPI support
|
||||||
- Feature: Support ImageMagick 7
|
- Feature: Support ImageMagick 7
|
||||||
|
|
|
@ -82,6 +82,8 @@ static void GBAInit(void* cpu, struct mCPUComponent* component) {
|
||||||
gba->timersEnabled = 0;
|
gba->timersEnabled = 0;
|
||||||
memset(gba->timers, 0, sizeof(gba->timers));
|
memset(gba->timers, 0, sizeof(gba->timers));
|
||||||
|
|
||||||
|
GBAHardwareInit(&gba->memory.hw, NULL);
|
||||||
|
|
||||||
gba->springIRQ = 0;
|
gba->springIRQ = 0;
|
||||||
gba->keySource = 0;
|
gba->keySource = 0;
|
||||||
gba->rotationSource = 0;
|
gba->rotationSource = 0;
|
||||||
|
|
|
@ -73,6 +73,9 @@ void GBAHardwareClear(struct GBACartridgeHardware* hw) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GBAHardwareGPIOWrite(struct GBACartridgeHardware* hw, uint32_t address, uint16_t value) {
|
void GBAHardwareGPIOWrite(struct GBACartridgeHardware* hw, uint32_t address, uint16_t value) {
|
||||||
|
if (!hw->gpioBase) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (address) {
|
switch (address) {
|
||||||
case GPIO_REG_DATA:
|
case GPIO_REG_DATA:
|
||||||
hw->pinState &= ~hw->direction;
|
hw->pinState &= ~hw->direction;
|
||||||
|
|
Loading…
Reference in New Issue