From 1bf3016c6c687ecb8f7bdd2125ac073a2ea173da Mon Sep 17 00:00:00 2001 From: Arignir Date: Wed, 20 Dec 2023 00:07:47 +0100 Subject: [PATCH] Add a bunch of ROMS to check the accuracy against. --- .github/workflows/accuracy.yml | 18 ++- ...rt_delay.png => hades_dma_start_delay.png} | Bin ...penbus_bios.png => hades_openbus_bios.png} | Bin ...{timer_basic.png => hades_timer_basic.png} | Bin .../expected/{arm.png => jsmolka_arm.png} | Bin .../expected/{thumb.png => jsmolka_bios.png} | Bin accuracy/expected/jsmolka_flash128.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_flash64.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_memory.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_nes.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_none.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_sram.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_thumb.png | Bin 0 -> 1974 bytes accuracy/expected/jsmolka_unsafe.png | Bin 0 -> 1974 bytes accuracy/suite.py | 112 +++++++++++++++--- include/gba/memory.h | 4 +- source/gba/gba.c | 4 +- source/gba/memory/storage/storage.c | 2 +- 18 files changed, 113 insertions(+), 27 deletions(-) rename accuracy/expected/{dma_start_delay.png => hades_dma_start_delay.png} (100%) rename accuracy/expected/{openbus_bios.png => hades_openbus_bios.png} (100%) rename accuracy/expected/{timer_basic.png => hades_timer_basic.png} (100%) rename accuracy/expected/{arm.png => jsmolka_arm.png} (100%) rename accuracy/expected/{thumb.png => jsmolka_bios.png} (100%) create mode 100644 accuracy/expected/jsmolka_flash128.png create mode 100644 accuracy/expected/jsmolka_flash64.png create mode 100644 accuracy/expected/jsmolka_memory.png create mode 100644 accuracy/expected/jsmolka_nes.png create mode 100644 accuracy/expected/jsmolka_none.png create mode 100644 accuracy/expected/jsmolka_sram.png create mode 100644 accuracy/expected/jsmolka_thumb.png create mode 100644 accuracy/expected/jsmolka_unsafe.png diff --git a/.github/workflows/accuracy.yml b/.github/workflows/accuracy.yml index 27f37bce..2ad9e706 100644 --- a/.github/workflows/accuracy.yml +++ b/.github/workflows/accuracy.yml @@ -36,11 +36,19 @@ jobs: mv AGB_*.gba ags.gba # Download the remaining testing ROMs - wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/arm/arm.gba - wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/thumb/thumb.gba - wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/dma-start-delay.gba - wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/openbus-bios.gba - wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/timer-basic.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/arm/arm.gba -O jsmolka-arm.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/bios/bios.gba -O jsmolka-bios.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/memory/memory.gba -O jsmolka-memory.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/nes/nes.gba -O jsmolka-nes.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/thumb/thumb.gba -O jsmolka-thumb.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/unsafe/unsafe.gba -O jsmolka-unsafe.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/save/flash64.gba -O jsmolka-flash64.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/save/flash128.gba -O jsmolka-flash128.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/save/none.gba -O jsmolka-none.gba + wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/save/sram.gba -O jsmolka-sram.gba + wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/dma-start-delay.gba -O hades-dma-start-delay.gba + wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/openbus-bios.gba -O hades-openbus-bios.gba + wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/timer-basic.gba -O hades-timer-basic.gba env: BIOS_DATA: ${{ secrets.BIOS_DATA }} BIOS_KEY: ${{ secrets.BIOS_KEY }} diff --git a/accuracy/expected/dma_start_delay.png b/accuracy/expected/hades_dma_start_delay.png similarity index 100% rename from accuracy/expected/dma_start_delay.png rename to accuracy/expected/hades_dma_start_delay.png diff --git a/accuracy/expected/openbus_bios.png b/accuracy/expected/hades_openbus_bios.png similarity index 100% rename from accuracy/expected/openbus_bios.png rename to accuracy/expected/hades_openbus_bios.png diff --git a/accuracy/expected/timer_basic.png b/accuracy/expected/hades_timer_basic.png similarity index 100% rename from accuracy/expected/timer_basic.png rename to accuracy/expected/hades_timer_basic.png diff --git a/accuracy/expected/arm.png b/accuracy/expected/jsmolka_arm.png similarity index 100% rename from accuracy/expected/arm.png rename to accuracy/expected/jsmolka_arm.png diff --git a/accuracy/expected/thumb.png b/accuracy/expected/jsmolka_bios.png similarity index 100% rename from accuracy/expected/thumb.png rename to accuracy/expected/jsmolka_bios.png diff --git a/accuracy/expected/jsmolka_flash128.png b/accuracy/expected/jsmolka_flash128.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_flash64.png b/accuracy/expected/jsmolka_flash64.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_memory.png b/accuracy/expected/jsmolka_memory.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_nes.png b/accuracy/expected/jsmolka_nes.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_none.png b/accuracy/expected/jsmolka_none.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_sram.png b/accuracy/expected/jsmolka_sram.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_thumb.png b/accuracy/expected/jsmolka_thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/expected/jsmolka_unsafe.png b/accuracy/expected/jsmolka_unsafe.png new file mode 100644 index 0000000000000000000000000000000000000000..512904da1a99b3877d1815abce2dee6ea653dee1 GIT binary patch literal 1974 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2OE$yy8SSffq}i&)5S5QA};w4KMT*|1QQlF z=LC;7hRYdydfN_UaPZs}kT`o_@yc=&76~`w4;e}lyp0zHBpL)H);79NzMH|(bM3(5 zOt7|w#4T)czATFs4WyWsv>eC~t}@x%12h9j^MYs&gC4Vm?!pIwdJv)F!|XBlm!~Z3^s^akZG~$hm2j)Kx?Hcpavn?xkNxB*QsA^2GC7FdKt)V zK$U7=GNd35g$ZgZ8r))+^L-68w8c5Wgt=esK2RypXArk1C^#j6Twe~9k79NS>5o+u)wyoj?`X5of2o%0sDzwQSni!Q|jMpC(3_!*xZVhVrju%flWf1cDc z;mcJHVa@lv79RO~Vy*NH*(tN^gD!pTICX$I^mUVv^1d|LT{0c~hhD5@jq$AxI;(D8 zsJxr~X05{K33uIA{r=d>TlDN$s{OVP(q|7GHeg|^{wx{J$b5RiiBCI>jJIVh4zV}% zWSo9Gai;XNl^d^aII@d>zATTj2r&1t2OfERddiP1i=;gcE9<_b>FuiA(9^Y!FS^Zj z{lbY~4}DpD{lkka2{%Ry7K#6pgQoCbbU1wV$S->b<%>6jl$GZN7Uh`o+ig!iE$|}H z-D}I@cKK~74d;7X?)dlom*703Bp~f}SoeN^2aiouM6ejsk(37)4diA(vZhUwq5+ds zrn8x7kKR%lV9p!OiKAr*u#g@s*_{66Hn75DP?zJ B{xARl literal 0 HcmV?d00001 diff --git a/accuracy/suite.py b/accuracy/suite.py index 6413ae0d..8116b1dc 100644 --- a/accuracy/suite.py +++ b/accuracy/suite.py @@ -3,56 +3,132 @@ TESTS_SUITE: List[Test] = [ - # Jsmolka's arm.gba & thumg.gba + # Jsmolka's test roms # https://github.com/jsmolka/gba-tests Test( - name="Jsmolka - Arm.gba", - rom='arm.gba', + name="Jsmolka - arm.gba", + rom='jsmolka-arm.gba', code=''' frame 10 - screenshot ./.tests_screenshots/arm.png + screenshot ./.tests_screenshots/jsmolka_arm.png ''', - screenshot='arm.png', + screenshot='jsmolka_arm.png', ), Test( - name="Jsmolka - Thumb.gba", - rom='thumb.gba', + name="Jsmolka - bios.gba", + rom='jsmolka-bios.gba', code=''' frame 10 - screenshot ./.tests_screenshots/thumb.png + screenshot ./.tests_screenshots/jsmolka_bios.png ''', - screenshot='thumb.png', + screenshot='jsmolka_bios.png', + skip=True, + ), + Test( + name="Jsmolka - memory.gba", + rom='jsmolka-memory.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_memory.png + ''', + screenshot='jsmolka_memory.png', + ), + Test( + name="Jsmolka - nes.gba", + rom='jsmolka-nes.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_nes.png + ''', + screenshot='jsmolka_nes.png', + ), + Test( + name="Jsmolka - thumb.gba", + rom='jsmolka-thumb.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_thumb.png + ''', + screenshot='jsmolka_thumb.png', + ), + Test( + name="Jsmolka - unsafe.gba", + rom='jsmolka-unsafe.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_unsafe.png + ''', + screenshot='jsmolka_unsafe.png', + ), + Test( + name="Jsmolka - save/sram.gba", + rom='jsmolka-sram.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_sram.png + ''', + screenshot='jsmolka_sram.png', + skip=True, + ), + Test( + name="Jsmolka - save/none.gba", + rom='jsmolka-none.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_none.png + ''', + screenshot='jsmolka_none.png', + ), + Test( + name="Jsmolka - save/flash64.gba", + rom='jsmolka-flash64.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_flash64.png + ''', + screenshot='jsmolka_flash64.png', + skip=True, + ), + Test( + name="Jsmolka - save/flash128.gba", + rom='jsmolka-flash128.gba', + code=''' + frame 10 + screenshot ./.tests_screenshots/jsmolka_flash128.png + ''', + screenshot='jsmolka_flash128.png', + skip=True, ), # Hades Tests # https://github.com/Arignir/Hades-Tests Test( name="Hades Tests - DMA Start Delay", - rom='dma-start-delay.gba', + rom='hades-dma-start-delay.gba', code=''' frame 20 - screenshot ./.tests_screenshots/dma_start_delay.png + screenshot ./.tests_screenshots/hades_dma_start_delay.png ''', - screenshot='dma_start_delay.png', + screenshot='hades_dma_start_delay.png', skip=True, ), Test( name="Hades Tests - Openbus BIOS", - rom='openbus-bios.gba', + rom='hades-openbus-bios.gba', code=''' frame 20 - screenshot ./.tests_screenshots/openbus_bios.png + screenshot ./.tests_screenshots/hades_openbus_bios.png ''', - screenshot='openbus_bios.png', + screenshot='hades_openbus_bios.png', ), Test( name="Hades Tests - Timer Basic", - rom='timer-basic.gba', + rom='hades-timer-basic.gba', code=''' frame 20 - screenshot ./.tests_screenshots/timer_basic.png + screenshot ./.tests_screenshots/hades_timer_basic.png ''', - screenshot='timer_basic.png', + screenshot='hades_timer_basic.png', ), # AGS diff --git a/include/gba/memory.h b/include/gba/memory.h index 84ecdf18..986bf748 100644 --- a/include/gba/memory.h +++ b/include/gba/memory.h @@ -91,13 +91,13 @@ enum access_types { #define CART_REGION_END (CART_2_END >> 24) #define SRAM_START (0x0E000000) -#define SRAM_END (0x0E00FFFF) +#define SRAM_END (0x0E007FFF) #define SRAM_SIZE (SRAM_END - SRAM_START + 1) #define SRAM_MASK (SRAM_END - SRAM_START) #define SRAM_REGION (SRAM_START >> 24) #define SRAM_MIRROR_START (0x0F000000) -#define SRAM_MIRROR_END (0x0F00FFFF) +#define SRAM_MIRROR_END (0x0F007FFF) #define SRAM_MIRROR_REGION (SRAM_MIRROR_START >> 24) #define FLASH_START (0x0E000000) diff --git a/source/gba/gba.c b/source/gba/gba.c index 48f5b763..7eb13927 100644 --- a/source/gba/gba.c +++ b/source/gba/gba.c @@ -314,9 +314,11 @@ gba_state_reset( } if (gba->shared_data.backup_storage.size) { - gba->shared_data.backup_storage.data = calloc(1, gba->shared_data.backup_storage.size); + gba->shared_data.backup_storage.data = malloc(gba->shared_data.backup_storage.size); hs_assert(gba->shared_data.backup_storage.data); + memset(gba->shared_data.backup_storage.data, 0xFF, gba->shared_data.backup_storage.size); + if (config->backup_storage.data && config->backup_storage.size) { memcpy(gba->shared_data.backup_storage.data, config->backup_storage.data, min(gba->shared_data.backup_storage.size, config->backup_storage.size)); } diff --git a/source/gba/memory/storage/storage.c b/source/gba/memory/storage/storage.c index 1e4c37bb..e0be2062 100644 --- a/source/gba/memory/storage/storage.c +++ b/source/gba/memory/storage/storage.c @@ -32,7 +32,7 @@ mem_backup_storage_read8( return (gba->shared_data.backup_storage.data[addr & SRAM_MASK]); break; default: - return (0); + return (0xFF); } }