From 6dec3fe8d1b4a0204bb4e63d07860fb6c85b5e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Ahlstro=CC=88m?= Date: Tue, 18 Oct 2022 20:12:29 +0200 Subject: [PATCH] Fixed save states a bit. --- History.txt | 3 +++ NGPDS_todo.txt | 1 - README.md | 2 +- source/Gui.c | 2 +- source/io.s | 11 +++++++++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/History.txt b/History.txt index 843afb4..1ae444e 100644 --- a/History.txt +++ b/History.txt @@ -2,6 +2,9 @@ NGPDS revision history -=-=-=-=-=-=-=-=-=-=-=- +V0.5.3 - 2022-10-18 (FluBBa) + Fixed savestates. + V0.5.2 - 2022-10-15 (FluBBa) Added new debug menu. Added Z80 CPU slow down menu item. diff --git a/NGPDS_todo.txt b/NGPDS_todo.txt index b80dc02..e5627a5 100644 --- a/NGPDS_todo.txt +++ b/NGPDS_todo.txt @@ -13,7 +13,6 @@ NGPDS Todo Add SWI & Interrupt to BiosHLE. Rewrite BiosHLE to asm? - Rewrite bios FLASHWRITE function to use GBA SRAM directly? Game reads directly from flash... Keep disassemblying Bios from 0xFF476C. Convert bios font to png. Done. diff --git a/README.md b/README.md index e10a0b9..85d858c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NGPDS V0.5.2 +# NGPDS V0.5.3 diff --git a/source/Gui.c b/source/Gui.c index d2ab192..b99779b 100644 --- a/source/Gui.c +++ b/source/Gui.c @@ -15,7 +15,7 @@ #include "K2GE/Version.h" #include "K2Audio/Version.h" -#define EMUVERSION "V0.5.2 2022-10-15" +#define EMUVERSION "V0.5.3 2022-10-18" #define ALLOW_SPEED_HACKS (1<<17) diff --git a/source/io.s b/source/io.s index 6de6a95..3e4e319 100644 --- a/source/io.s +++ b/source/io.s @@ -67,12 +67,15 @@ ioSaveState: ;@ In r0=destination. Out r0=size. ;@---------------------------------------------------------------------------- stmfd sp!,{lr} + ldr r1,ioExtraState + str r1,[r0],#4 + ldr r1,=systemMemory mov r2,#0x100 bl memcpy ldmfd sp!,{lr} - mov r0,#0x100 + ldr r0,=0x104 bx lr ;@---------------------------------------------------------------------------- ioLoadState: ;@ In r0=source. Out r0=size. @@ -80,6 +83,9 @@ ioLoadState: ;@ In r0=source. Out r0=size. ;@---------------------------------------------------------------------------- stmfd sp!,{lr} + ldr r1,[r0],#4 + str r1,ioExtraState + bl initSysMem ldmfd sp!,{lr} @@ -87,7 +93,7 @@ ioLoadState: ;@ In r0=source. Out r0=size. ioGetStateSize: ;@ Out r0=state size. .type ioGetStateSize STT_FUNC ;@---------------------------------------------------------------------------- - mov r0,#0x100 + ldr r0,=0x104 bx lr ;@---------------------------------------------------------------------------- transferTime: @@ -463,6 +469,7 @@ batteryLevel: ;@ Bad < 0x7880 (0x1E2) ;@ Shutdown <= 0x74C0 (0x1D3) ;@ Alarm minimum = 0x5B80 (0x16E) +ioExtraState: rtcTimer: .byte 0 sc0Buf: