Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/RSBE01_02/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ sora/gf/gf_camera_controller.cpp:
sora/gf/gf_callback.cpp:
.text start:0x8001A3AC end:0x8001A48C

sora/gf/gf_error_check.cpp:
.text start:0x8001B574 end:0x8001B784
.ctors start:0x804064EC end:0x804064F0
.data start:0x80420BA0 end:0x80420C28
.bss start:0x804948E8 end:0x80494900
.sdata start:0x8059C508 end:0x8059C520

sora/gf/gf_gameframe_counter.cpp:
.text start:0x800241B4 end:0x800242DC

Expand Down
54 changes: 27 additions & 27 deletions config/RSBE01_02/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2312,23 +2312,23 @@ fn_8001ABE4 = .text:0x8001ABE4; // type:function size:0xB4
fn_8001AC98 = .text:0x8001AC98; // type:function size:0x2C
fn_8001ACC4 = .text:0x8001ACC4; // type:function size:0x158
fn_8001AE1C = .text:0x8001AE1C; // type:function size:0xEC
fn_8001AF08 = .text:0x8001AF08; // type:function size:0x48
getInstance__14gfErrorManagerFv = .text:0x8001AF08; // type:function size:0x48
fn_8001AF50 = .text:0x8001AF50; // type:function size:0x38
fn_8001AF88 = .text:0x8001AF88; // type:function size:0xF4
fn_8001B07C = .text:0x8001B07C; // type:function size:0x64
fn_8001B0E0 = .text:0x8001B0E0; // type:function size:0x164
fn_8001B244 = .text:0x8001B244; // type:function size:0x12C
fn_8001B370 = .text:0x8001B370; // type:function size:0x13C
fn_8001B4AC = .text:0x8001B4AC; // type:function size:0xC8
fn_8001B574 = .text:0x8001B574; // type:function size:0xC
fn_8001B580 = .text:0x8001B580; // type:function size:0xD4
fn_8001B654 = .text:0x8001B654; // type:function size:0x40
fn_8001B694 = .text:0x8001B694; // type:function size:0x3C
fn_8001B6D0 = .text:0x8001B6D0; // type:function size:0x40
fn_8001B710 = .text:0x8001B710; // type:function size:0x74
notifyError__14gfErrorManagerFUlUl = .text:0x8001B370; // type:function size:0x13C
notifyErrorRecovery__14gfErrorManagerFb = .text:0x8001B4AC; // type:function size:0xC8
init__12gfErrorCheckFv = .text:0x8001B574; // type:function size:0xC
check__12gfErrorCheckFv = .text:0x8001B580; // type:function size:0xD4
__dt__10gfCallBackFv = .text:0x8001B654; // type:function size:0x40
__sinit_\gf_error_check_cpp = .text:0x8001B694; // type:function size:0x3C scope:local
__dt__20gfErrorCheckCallbackFv = .text:0x8001B6D0; // type:function size:0x40
userProc__20gfErrorCheckCallbackFv = .text:0x8001B710; // type:function size:0x74
fn_8001B784 = .text:0x8001B784; // type:function size:0x8
fn_8001B78C = .text:0x8001B78C; // type:function size:0xC
fn_8001B798 = .text:0x8001B798; // type:function size:0xC
getDVDDiskId__8gfFileIOFv = .text:0x8001B78C; // type:function size:0xC
setFatalErrorCallback__8gfFileIOFPQ28gfFileIO13ErrorCallback = .text:0x8001B798; // type:function size:0xC
fn_8001B7A4 = .text:0x8001B7A4; // type:function size:0x54
fn_8001B7F8 = .text:0x8001B7F8; // type:function size:0xE8
fn_8001B8E0 = .text:0x8001B8E0; // type:function size:0x108
Expand Down Expand Up @@ -8833,9 +8833,9 @@ fn_801DC8BC = .text:0x801DC8BC; // type:function size:0x1BC
fn_801DCA78 = .text:0x801DCA78; // type:function size:0x290
fn_801DCD08 = .text:0x801DCD08; // type:function size:0x150
fn_801DCE58 = .text:0x801DCE58; // type:function size:0xB8
fn_801DCF10 = .text:0x801DCF10; // type:function size:0x14
OSDisableInterrupts = .text:0x801DCF10; // type:function size:0x14 scope:global
fn_801DCF24 = .text:0x801DCF24; // type:function size:0x14
fn_801DCF38 = .text:0x801DCF38; // type:function size:0x24
OSRestoreInterrupts = .text:0x801DCF38; // type:function size:0x24 scope:global
fn_801DCF5C = .text:0x801DCF5C; // type:function size:0x14
fn_801DCF70 = .text:0x801DCF70; // type:function size:0x10
fn_801DCF80 = .text:0x801DCF80; // type:function size:0xC4
Expand Down Expand Up @@ -9358,16 +9358,16 @@ fn_801F9F60 = .text:0x801F9F60; // type:function size:0x9E0
fn_801FA940 = .text:0x801FA940; // type:function size:0xE4
fn_801FAA24 = .text:0x801FAA24; // type:function size:0xD4
fn_801FAAF8 = .text:0x801FAAF8; // type:function size:0xD8
fn_801FABD0 = .text:0x801FABD0; // type:function size:0xC8
fn_801FAC98 = .text:0x801FAC98; // type:function size:0x9C
DVDGetCommandBlockStatus = .text:0x801FABD0; // type:function size:0xC8 scope:global
DVDGetDriveStatus = .text:0x801FAC98; // type:function size:0x9C
fn_801FAD34 = .text:0x801FAD34; // type:function size:0x10
fn_801FAD44 = .text:0x801FAD44; // type:function size:0x50
fn_801FAD94 = .text:0x801FAD94; // type:function size:0x364
fn_801FB0F8 = .text:0x801FB0F8; // type:function size:0xDC
fn_801FB1D4 = .text:0x801FB1D4; // type:function size:0x8
fn_801FB1DC = .text:0x801FB1DC; // type:function size:0x13C
fn_801FB318 = .text:0x801FB318; // type:function size:0x10
fn_801FB328 = .text:0x801FB328; // type:function size:0x8
DVDGetCurrentDiskID = .text:0x801FB328; // type:function size:0x8
fn_801FB330 = .text:0x801FB330; // type:function size:0x8
fn_801FB338 = .text:0x801FB338; // type:function size:0xC8
fn_801FB400 = .text:0x801FB400; // type:function size:0x44
Expand Down Expand Up @@ -9396,7 +9396,7 @@ fn_801FBFF4 = .text:0x801FBFF4; // type:function size:0xA8
fn_801FC09C = .text:0x801FC09C; // type:function size:0x94
fn_801FC130 = .text:0x801FC130; // type:function size:0x90
fn_801FC1C0 = .text:0x801FC1C0; // type:function size:0x68
fn_801FC228 = .text:0x801FC228; // type:function size:0xF0
DVDCompareDiskID = .text:0x801FC228; // type:function size:0xF0
fn_801FC318 = .text:0x801FC318; // type:function size:0x88
fn_801FC3A0 = .text:0x801FC3A0; // type:function size:0xB4
fn_801FC454 = .text:0x801FC454; // type:function size:0x5C
Expand Down Expand Up @@ -17614,9 +17614,9 @@ lbl_80420B08 = .data:0x80420B08; // type:object size:0x64
lbl_80420B6C = .data:0x80420B6C; // type:object size:0xC
lbl_80420B78 = .data:0x80420B78; // type:object size:0x10
@243 = .data:0x80420B88; // type:object size:0x13 scope:local data:string
lbl_80420BA0 = .data:0x80420BA0; // type:object size:0x10
__vt__10gfCallBack = .data:0x80420BA0; // type:object size:0x10
lbl_80420BB0 = .data:0x80420BB0; // type:object size:0x10
lbl_80420BC0 = .data:0x80420BC0; // type:object size:0x10
__vt__20gfErrorCheckCallback = .data:0x80420BC0; // type:object size:0x10
lbl_80420BD0 = .data:0x80420BD0; // type:object size:0x18
lbl_80420BE8 = .data:0x80420BE8; // type:object size:0x18
lbl_80420C00 = .data:0x80420C00; // type:object size:0x18 data:string
Expand Down Expand Up @@ -27831,7 +27831,7 @@ lbl_804948B0 = .bss:0x804948B0; // type:object size:0x10 data:4byte
lbl_804948C0 = .bss:0x804948C0; // type:object size:0x18 data:4byte
lbl_804948D8 = .bss:0x804948D8; // type:object size:0x10 data:4byte
lbl_804948E8 = .bss:0x804948E8; // type:object size:0xC
lbl_804948F4 = .bss:0x804948F4; // type:object size:0xC data:4byte
g_errorCheckCb = .bss:0x804948F4; // type:object size:0xC data:4byte
lbl_80494900 = .bss:0x80494900; // type:object size:0x10
lbl_80494910 = .bss:0x80494910; // type:object size:0x18
lbl_80494928 = .bss:0x80494928; // type:object size:0x10 data:4byte
Expand Down Expand Up @@ -28055,7 +28055,7 @@ lbl_804DF030 = .bss:0x804DF030; // type:object size:0x710 data:4byte
lbl_804DF740 = .bss:0x804DF740; // type:object size:0x100
lbl_804DF840 = .bss:0x804DF840; // type:object size:0x4A00
lbl_804E4240 = .bss:0x804E4240; // type:object size:0x20
lbl_804E4260 = .bss:0x804E4260; // type:object size:0x30
DummyCommandBlock = .bss:0x804E4260; // type:object size:0x30 scope:local
lbl_804E4290 = .bss:0x804E4290; // type:object size:0x30
lbl_804E42C0 = .bss:0x804E42C0; // type:object size:0x40
lbl_804E4300 = .bss:0x804E4300; // type:object size:0x20
Expand Down Expand Up @@ -28422,9 +28422,9 @@ lbl_8059C4E8 = .sdata:0x8059C4E8; // type:object size:0x8
__RTTI__6gfTask = .sdata:0x8059C4F0; // type:object size:0x8
__RTTI__18gfCameraController = .sdata:0x8059C4F8; // type:object size:0x8 scope:weak
lbl_8059C500 = .sdata:0x8059C500; // type:object size:0x8
lbl_8059C508 = .sdata:0x8059C508; // type:object size:0x8
lbl_8059C510 = .sdata:0x8059C510; // type:object size:0x8
lbl_8059C518 = .sdata:0x8059C518; // type:object size:0x8
__RTTI__10gfCallBack = .sdata:0x8059C508; // type:object size:0x8
__RTTI__20gfErrorCheckCallback = .sdata:0x8059C510; // type:object size:0x8
__RTTI__Q28gfFileIO13ErrorCallback = .sdata:0x8059C518; // type:object size:0x8
lbl_8059C520 = .sdata:0x8059C520; // type:object size:0x8
lbl_8059C528 = .sdata:0x8059C528; // type:object size:0x4 data:4byte
lbl_8059C52C = .sdata:0x8059C52C; // type:object size:0x4 data:4byte
Expand Down Expand Up @@ -31093,8 +31093,8 @@ lbl_805A08E8 = .sbss:0x805A08E8; // type:object size:0x4 data:4byte
lbl_805A08EC = .sbss:0x805A08EC; // type:object size:0x14 data:4byte
lbl_805A0900 = .sbss:0x805A0900; // type:object size:0x4 data:4byte
lbl_805A0904 = .sbss:0x805A0904; // type:object size:0x4 data:4byte
lbl_805A0908 = .sbss:0x805A0908; // type:object size:0x4 data:4byte
lbl_805A090C = .sbss:0x805A090C; // type:object size:0x4 data:4byte
PausingFlag = .sbss:0x805A0908; // type:object size:0x4 scope:local data:4byte
FatalErrorFlag = .sbss:0x805A090C; // type:object size:0x4 scope:local data:4byte
lbl_805A0910 = .sbss:0x805A0910; // type:object size:0x4 data:4byte
lbl_805A0914 = .sbss:0x805A0914; // type:object size:0x4 data:4byte
lbl_805A0918 = .sbss:0x805A0918; // type:object size:0x4 data:4byte
Expand Down Expand Up @@ -31124,7 +31124,7 @@ lbl_805A0980 = .sbss:0x805A0980; // type:object size:0x4 data:4byte
lbl_805A0984 = .sbss:0x805A0984; // type:object size:0x4 data:4byte
lbl_805A0988 = .sbss:0x805A0988; // type:object size:0x4 data:4byte
lbl_805A098C = .sbss:0x805A098C; // type:object size:0x4 data:4byte
lbl_805A0990 = .sbss:0x805A0990; // type:object size:0x4 data:4byte
executing = .sbss:0x805A0990; // type:object size:0x4 scope:local data:4byte
lbl_805A0994 = .sbss:0x805A0994; // type:object size:0x4 data:4byte
lbl_805A0998 = .sbss:0x805A0998; // type:object size:0x4 data:4byte
lbl_805A099C = .sbss:0x805A099C; // type:object size:0x4 data:4byte
Expand Down
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def MatchingFor(*versions):
Object(Matching, "sora/gf/gf_archive_file.cpp"),
Object(Matching, "sora/gf/gf_camera_controller.cpp"),
Object(Matching, "sora/gf/gf_callback.cpp"),
Object(Matching, "sora/gf/gf_error_check.cpp"),
Object(Matching, "sora/gf/gf_gameframe_counter.cpp"),
Object(Matching, "sora/gf/gf_keep_fb.cpp"),
Object(Matching, "sora/gf/gf_memory_util.cpp"),
Expand Down
45 changes: 45 additions & 0 deletions src/sora/gf/gf_error_check.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <gf/gf_callback.h>
#include <gf/gf_error_check.h>
#include <gf/gf_error_manager.h>
#include <gf/gf_file_io.h>
#include <revolution/DVD/dvd.h>
#include <revolution/DVD/dvdidutils.h>
#include <types.h>

static gfErrorCheckCallback g_errorCheckCb;

void gfErrorCheck::init() {
gfFileIO::setFatalErrorCallback(&g_errorCheckCb);
}

void gfErrorCheck::check() {
s32 status = DVDGetDriveStatus();
u32 r31;
bool r30 = false;
if (status == -1) {
r30 = true;
r31 = 4;
} else if (status == 4) {
r30 = true;
r31 = 1;
} else if (status == 11) {
r30 = true;
r31 = 3;
} else if (status == 6) {
r30 = true;
r31 = 2;
} else {
const DVDDiskID* id1 = DVDGetCurrentDiskID();
const DVDDiskID* id2 = gfFileIO::getDVDDiskId();
if (true != DVDCompareDiskID(id1, id2)) {
r30 = true;
r31 = 2;
}
}

if (r30) {
gfErrorManager::getInstance()->notifyError(r31, 0);
} else {
gfErrorManager::getInstance()->notifyErrorRecovery(false);
}
}