Skip to content

Commit c1b3da6

Browse files
committed
Added a custom error handler
1 parent d183cff commit c1b3da6

21 files changed

+2147
-40
lines changed

ttyd-tools/rel/include/assembly.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace mod {
77
extern "C" {
88

99
// Assembly overwrite functions
10+
// mod.cpp
11+
void StartErrorHandlerEnableFPU();
12+
1013
// main.cpp
1114
void StartReplaceJumpFallAnim();
1215
void StartAllowRunningFromBattles();
@@ -40,6 +43,7 @@ void *fallThroughMostObjects(void *ptr);
4043

4144
// draw.cpp
4245
bool disableDPadOptionsDisplay(uint16_t unkVar);
46+
void StartErrorHandlerInterrupts();
4347

4448
}
4549

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace gc::DEMOInit {
6+
7+
extern "C" {
8+
9+
// __DEMODiagnoseHang
10+
// __NoHangDoneRender
11+
// __NoHangRetraceCallback
12+
// DEMOEnableGPHangWorkaround
13+
void *DEMOGetCurrentBuffer();
14+
// DEMOGetRenderModeObj
15+
// DEMODoneRender
16+
// DEMOBeforeRender
17+
// DEMOInit
18+
19+
extern void *DemoCurrentBuffer;
20+
extern void *DemoFrameBuffer2;
21+
extern void *DemoFrameBuffer1;
22+
23+
}
24+
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace gc::DEMOPad {
6+
7+
extern "C" {
8+
9+
void DEMOPadInit();
10+
// DEMOPadRead
11+
// DEMOPadCopy
12+
13+
}
14+
15+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace gc::OSContext {
6+
7+
struct OSContext
8+
{
9+
uint32_t gpr[32];
10+
uint32_t cr;
11+
uint32_t lr;
12+
uint32_t ctr;
13+
uint32_t xer;
14+
double fpr[32];
15+
uint32_t fpscrPad;
16+
uint32_t fpscr;
17+
uint32_t srr0;
18+
uint32_t srr1;
19+
uint16_t mode;
20+
uint16_t state;
21+
uint32_t gqr[8];
22+
uint32_t psfPad;
23+
double psf[32];
24+
} __attribute__((__packed__));
25+
26+
static_assert(sizeof(OSContext) == 0x2C8);
27+
28+
extern "C" {
29+
30+
// __OSLoadFPUContext
31+
// __OSSaveFPUContext
32+
// OSSaveFPUContext
33+
// OSSetCurrentContext
34+
// OSGetCurrentContext
35+
// OSSaveContext
36+
// OSLoadContext
37+
// OSGetStackPointer
38+
// OSClearContext
39+
// OSInitContext
40+
// OSDumpContext
41+
// OSSwitchFPUContext
42+
// __OSContextInit
43+
void OSFillFPUContext(OSContext *context);
44+
45+
}
46+
47+
}

ttyd-tools/rel/include/gc/OSFont.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace gc::OSFont {
6+
7+
struct OSFontHeader
8+
{
9+
uint16_t fontType;
10+
uint16_t firstChar;
11+
uint16_t lastChar;
12+
uint16_t invalChar;
13+
uint16_t ascent;
14+
uint16_t descent;
15+
uint16_t width;
16+
uint16_t leading;
17+
uint16_t cellWidth;
18+
uint16_t cellHeight;
19+
uint32_t sheetSize;
20+
uint16_t sheetFormat;
21+
uint16_t sheetColumn;
22+
uint16_t sheetRow;
23+
uint16_t sheetWidth;
24+
uint16_t sheetHeight;
25+
uint16_t widthTable;
26+
uint32_t sheetImage;
27+
uint32_t sheetFullSize;
28+
uint8_t c0;
29+
uint8_t c1;
30+
uint8_t c2;
31+
uint8_t c3;
32+
} __attribute__((__packed__));
33+
34+
static_assert(sizeof(OSFontHeader) == 0x30);
35+
36+
extern "C" {
37+
38+
// GetFontCode
39+
// Decode
40+
uint16_t OSGetFontEncode();
41+
// ReadFont
42+
// OSLoadFont
43+
// ParseStringS
44+
// OSGetFontTexel
45+
// ExpandFontSheet
46+
bool OSInitFont(OSFontHeader *fontData);
47+
char *OSGetFontTexture(const char *string, void **image, int32_t *posX, int32_t *posY, int32_t *width);
48+
49+
}
50+
51+
}

0 commit comments

Comments
 (0)