Skip to content

Commit

Permalink
Fixed save states a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
FluBBaOfWard committed Oct 18, 2022
1 parent 3d43389 commit 6dec3fe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion NGPDS_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NGPDS V0.5.2
# NGPDS V0.5.3

<img align="right" width="220" src="./logo.png" />

Expand Down
2 changes: 1 addition & 1 deletion source/Gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
11 changes: 9 additions & 2 deletions source/io.s
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,33 @@ 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.
.type ioLoadState STT_FUNC
;@----------------------------------------------------------------------------
stmfd sp!,{lr}

ldr r1,[r0],#4
str r1,ioExtraState

bl initSysMem

ldmfd sp!,{lr}
;@----------------------------------------------------------------------------
ioGetStateSize: ;@ Out r0=state size.
.type ioGetStateSize STT_FUNC
;@----------------------------------------------------------------------------
mov r0,#0x100
ldr r0,=0x104
bx lr
;@----------------------------------------------------------------------------
transferTime:
Expand Down Expand Up @@ -463,6 +469,7 @@ batteryLevel:
;@ Bad < 0x7880 (0x1E2)
;@ Shutdown <= 0x74C0 (0x1D3)
;@ Alarm minimum = 0x5B80 (0x16E)
ioExtraState:
rtcTimer:
.byte 0
sc0Buf:
Expand Down

0 comments on commit 6dec3fe

Please sign in to comment.