[game] rewrite memcard and game-save code (#1222)

* rewrite memcard and game-save code

* fix memcard status and bank check

* more robustness

* fix bank pick on card update

* fix load file bugs

* bug fixes and final touches

* add timers and turn off prints

* optimization?

* update pics

* make money starburst slightly easier to see

* fix first time save bug

* reduce filesystem load a bit

* too bright

* Optimize `file_is_present`
This commit is contained in:
ManDude
2022-03-06 23:58:22 +00:00
committed by GitHub
parent d3d198c363
commit 968531ee51
10 changed files with 1781 additions and 1562 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ So far, we've decompiled around 400,000 lines of GOAL code, out of an estimated
Here are some screenshots of the renderer:
![](./docs/img/screenshot_hut_new_small.png)
![](./docs/img/screenshot_jungle1_small.png)
![](./docs/img/screenshot_junglenew_custommood_small.png)
YouTube playlist:
https://www.youtube.com/playlist?list=PLWx9T30aAT50cLnCTY1SAbt2TtWQzKfXX
Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 KiB

+1149 -779
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -10,7 +10,7 @@
void kmemcard_init_globals();
constexpr s32 SAVE_SIZE = 0x2b3; // likely different by versions!
constexpr s32 SAVE_SIZE = 691; // likely different by versions! 692 on PAL/JPN
constexpr s32 BANK_SIZE = 0x10000;
// each card can be in one of these states:
@@ -144,4 +144,4 @@ u64 MC_save(s32 card_idx, s32 file_idx, Ptr<u8> save_data, Ptr<u8> save_summary_
u64 MC_load(s32 card_idx, s32 file_idx, Ptr<u8> data);
void MC_makefile(s32 port, s32 size);
void MC_get_status(s32 slot, Ptr<mc_slot_info> info);
u32 MC_check_result();
u32 MC_check_result();
+2 -2
View File
@@ -133,7 +133,7 @@ s32 sceMcOpen(s32 port, s32 slot, const char* name, s32 mode) {
g_mc_state.handles[fd] = handle;
g_mc_state.current_function_result = fd;
return 0;
return sceMcResSucceed;
}
s32 sceMcWrite(s32 fd, const void* buff, s32 size) {
@@ -303,4 +303,4 @@ void read_memory_card_from_file() {
}
}
} // namespace ee
} // namespace ee
+1 -2
View File
@@ -2179,7 +2179,7 @@
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2))
(sp-flt spt-num 1.0)
(sp-flt spt-scale-x (meters 1.2))
(sp-flt spt-scale-x (meters 1.22))
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
@@ -2191,7 +2191,6 @@
)
)
;; customized
(defpartgroup group-money-starburst :id 64 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 238)))
(defpartgroup group-buzzer-effect
File diff suppressed because it is too large Load Diff