Import data + bss (#1676)

* extract gfxprint font data as blobs

* Remove font from fault_drawer out name

* audio heap bss

* audio sequence bss

* audio session config bss

* Move code_801D1E80 down in the spec

* Gfxprint don't just include generated c file
This commit is contained in:
Derek Hensley 2024-09-07 16:03:00 -06:00 committed by GitHub
parent 3add37c3a0
commit e982c44721
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 52 additions and 24 deletions

View File

@ -1,5 +1,5 @@
<Root> <Root>
<File Name="boot" OutName="fault_drawer_font" BaseAddress="0x80080060" RangeStart="0x18BF0" RangeEnd="0x18FF0" > <File Name="boot" OutName="fault_drawer" BaseAddress="0x80080060" RangeStart="0x18BF0" RangeEnd="0x18FF0" >
<!-- The real version is const and found in fault_drawer.c, though shares the same name --> <!-- The real version is const and found in fault_drawer.c, though shares the same name -->
<Blob Name="sFaultDrawerFont" Size="0x400" Offset="0x18BF0"/> <Blob Name="sFaultDrawerFont" Size="0x400" Offset="0x18BF0"/>
</File> </File>

View File

@ -0,0 +1,9 @@
<Root>
<File Name="boot" OutName="gfxprint" BaseAddress="0x80080060" RangeStart="0x16BF0" RangeEnd="0x174A0" >
<Texture Name="sGfxPrintFontTLUT" OutName="gfx_print_font_tlut" Format="rgba16" Width="8" Height="8" Offset="0x16BF0"/>
<Texture Name="sGfxPrintRainbowTLUT" OutName="gfx_print_rainbow_tlut" Format="rgba16" Width="8" Height="2" Offset="0x16C70"/>
<!-- TODO: Properly extract fonts not as blobs -->
<Blob Name="sGfxPrintRainbowFont" Size="0x8" Offset="0x16C90"/>
<Blob Name="sGfxPrintFont" Size="0x808" Offset="0x16C98"/>
</File>
</Root>

View File

@ -407,9 +407,9 @@ u8 func_801A3950(u8 seqPlayerIndex, u8 resetChannelIO);
u8 func_801A39F8(void); u8 func_801A39F8(void);
s32 func_801A46F8(void); s32 func_801A46F8(void);
extern SeqRequest sSeqRequests[][5]; extern SeqRequest sSeqRequests[5][5];
extern u8 sNumSeqRequests[5]; extern u8 sNumSeqRequests[5];
extern u32 sAudioSeqCmds[0x100]; extern u32 sAudioSeqCmds[0x100];
extern ActiveSequence gActiveSeqs[]; extern ActiveSequence gActiveSeqs[5];
#endif #endif

View File

@ -48,11 +48,6 @@ extern AudioTable gSampleBankTable;
extern u64* gAudioSPDataPtr; extern u64* gAudioSPDataPtr;
extern u32 gAudioSPDataSize; extern u32 gAudioSPDataSize;
extern s32 D_801FD120;
extern u8 sResetAudioHeapTimer;
extern u16 sResetAudioHeapFadeReverbVolume;
extern u16 sResetAudioHeapFadeReverbVolumeStep;
extern AudioContext gAudioCtx; // at 0x80200C70 extern AudioContext gAudioCtx; // at 0x80200C70
// other segments // other segments

View File

@ -132,7 +132,7 @@ typedef struct {
/* 0x48 */ char unk_48[0x8]; /* 0x48 */ char unk_48[0x8];
} AudioTask; // size = 0x50 } AudioTask; // size = 0x50
typedef struct { typedef struct AudioContext {
/* 0x0000 */ char unk_0000; /* 0x0000 */ char unk_0000;
/* 0x0001 */ s8 numSynthesisReverbs; /* 0x0001 */ s8 numSynthesisReverbs;
/* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF /* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF

5
spec
View File

@ -38,7 +38,6 @@ beginseg
include "$(BUILD_DIR)/src/boot/O2/padutils.o" include "$(BUILD_DIR)/src/boot/O2/padutils.o"
include "$(BUILD_DIR)/src/boot/O2/stackcheck.o" include "$(BUILD_DIR)/src/boot/O2/stackcheck.o"
include "$(BUILD_DIR)/src/boot/O2/gfxprint.o" include "$(BUILD_DIR)/src/boot/O2/gfxprint.o"
include "$(BUILD_DIR)/data/boot/gfxprint.data.o"
include "$(BUILD_DIR)/src/boot/O2/mtxuty-cvt.o" include "$(BUILD_DIR)/src/boot/O2/mtxuty-cvt.o"
include "$(BUILD_DIR)/src/boot/O2/debug.o" include "$(BUILD_DIR)/src/boot/O2/debug.o"
include "$(BUILD_DIR)/src/boot/O2/system_heap.o" include "$(BUILD_DIR)/src/boot/O2/system_heap.o"
@ -617,20 +616,19 @@ beginseg
include "$(BUILD_DIR)/src/code/sys_matrix.o" include "$(BUILD_DIR)/src/code/sys_matrix.o"
include "$(BUILD_DIR)/src/code/sys_ucode.o" include "$(BUILD_DIR)/src/code/sys_ucode.o"
include "$(BUILD_DIR)/src/code/sys_rumble.o" include "$(BUILD_DIR)/src/code/sys_rumble.o"
include "$(BUILD_DIR)/data/code/code_801D1E80.data.o"
include "$(BUILD_DIR)/src/code/code_80183070.o" include "$(BUILD_DIR)/src/code/code_80183070.o"
include "$(BUILD_DIR)/src/code/c_keyframe.o" include "$(BUILD_DIR)/src/code/c_keyframe.o"
include "$(BUILD_DIR)/src/code/sys_slowly.o" include "$(BUILD_DIR)/src/code/sys_slowly.o"
include "$(BUILD_DIR)/src/code/sys_flashrom.o" include "$(BUILD_DIR)/src/code/sys_flashrom.o"
include "$(BUILD_DIR)/asm/code/kanread.text.o" // handwritten include "$(BUILD_DIR)/asm/code/kanread.text.o" // handwritten
include "$(BUILD_DIR)/src/code/osFlash.o" include "$(BUILD_DIR)/src/code/osFlash.o"
include "$(BUILD_DIR)/data/code/code_801D1E80.data.o"
pad_text pad_text
pad_text pad_text
pad_text pad_text
include "$(BUILD_DIR)/src/audio/lib/data.o" include "$(BUILD_DIR)/src/audio/lib/data.o"
include "$(BUILD_DIR)/src/audio/lib/synthesis.o" include "$(BUILD_DIR)/src/audio/lib/synthesis.o"
include "$(BUILD_DIR)/src/audio/lib/heap.o" include "$(BUILD_DIR)/src/audio/lib/heap.o"
include "$(BUILD_DIR)/data/code/audio_heap.bss.o"
include "$(BUILD_DIR)/src/audio/lib/load.o" include "$(BUILD_DIR)/src/audio/lib/load.o"
include "$(BUILD_DIR)/src/audio/lib/thread.o" include "$(BUILD_DIR)/src/audio/lib/thread.o"
include "$(BUILD_DIR)/src/audio/lib/dcache.o" include "$(BUILD_DIR)/src/audio/lib/dcache.o"
@ -649,7 +647,6 @@ beginseg
include "$(BUILD_DIR)/src/audio/sfx_params.o" include "$(BUILD_DIR)/src/audio/sfx_params.o"
include "$(BUILD_DIR)/src/audio/sfx.o" include "$(BUILD_DIR)/src/audio/sfx.o"
include "$(BUILD_DIR)/src/audio/sequence.o" include "$(BUILD_DIR)/src/audio/sequence.o"
include "$(BUILD_DIR)/data/code/sequence.bss.o"
include "$(BUILD_DIR)/src/audio/session_config.o" include "$(BUILD_DIR)/src/audio/session_config.o"
include "$(BUILD_DIR)/src/code/jpegutils.o" include "$(BUILD_DIR)/src/code/jpegutils.o"
include "$(BUILD_DIR)/src/code/jpegdecoder.o" include "$(BUILD_DIR)/src/code/jpegdecoder.o"

View File

@ -1396,6 +1396,9 @@ typedef struct {
/* 0xC */ u8 newMedium; /* 0xC */ u8 newMedium;
} StorageChange; // size = 0x10 } StorageChange; // size = 0x10
s32 D_801FD120;
static s32 sBssPad[3];
void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) { void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
if ((sample != NULL) && ((sample->medium == change->newMedium) || (D_801FD120 != 1)) && if ((sample != NULL) && ((sample->medium == change->newMedium) || (D_801FD120 != 1)) &&
((sample->medium == MEDIUM_RAM) || (D_801FD120 != 0))) { ((sample->medium == MEDIUM_RAM) || (D_801FD120 != 0))) {

View File

@ -24,6 +24,14 @@
AudioSeq_ProcessSeqCmd((SEQCMD_OP_SET_SEQPLAYER_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | \ AudioSeq_ProcessSeqCmd((SEQCMD_OP_SET_SEQPLAYER_VOLUME << 28) | ((u8)(seqPlayerIndex) << 24) | \
((u8)(duration) << 16) | ((u8)((volume)*127.0f))); ((u8)(duration) << 16) | ((u8)((volume)*127.0f)));
SeqRequest sSeqRequests[5][5];
u8 sNumSeqRequests[5];
u32 sAudioSeqCmds[0x100];
ActiveSequence gActiveSeqs[5];
u8 sResetAudioHeapTimer;
u16 sResetAudioHeapFadeReverbVolume;
u16 sResetAudioHeapFadeReverbVolumeStep;
u8 sSeqCmdWritePos = 0; u8 sSeqCmdWritePos = 0;
u8 sSeqCmdReadPos = 0; u8 sSeqCmdReadPos = 0;
u8 sStartSeqDisabled = 0; u8 sStartSeqDisabled = 0;

View File

@ -1,6 +1,14 @@
#include "global.h" #include "global.h"
#include "buffers.h" #include "buffers.h"
static s32 sBssPad[36];
AudioContext gAudioCtx;
AudioCustomUpdateFunction gAudioCustomUpdateFunction;
AudioCustomSeqFunction gAudioCustomSeqFunction;
AudioCustomReverbFunction gAudioCustomReverbFunction;
AudioCustomSynthFunction gAudioCustomSynthFunction;
static s32 sBssPad2[3];
const s16 gAudioTatumInit[] = { const s16 gAudioTatumInit[] = {
0x1C00, // unused 0x1C00, // unused
TATUMS_PER_BEAT, // gTatumsPerBeat TATUMS_PER_BEAT, // gTatumsPerBeat

View File

@ -7,11 +7,21 @@
#define GFXP_FLAG_ENLARGE (1 << 6) #define GFXP_FLAG_ENLARGE (1 << 6)
#define GFXP_FLAG_OPEN (1 << 7) #define GFXP_FLAG_OPEN (1 << 7)
//! TODO: Need to extract u64 sGfxPrintFontTLUT[] = {
extern u16 sGfxPrintFontTLUT[64]; #include "assets/boot/gfxprint/gfx_print_font_tlut.rgba16.inc.c"
extern u16 sGfxPrintRainbowTLUT[16]; };
extern u8 sGfxPrintRainbowData[8];
extern u8 sGfxPrintFontData[2048]; u64 sGfxPrintRainbowTLUT[] = {
#include "assets/boot/gfxprint/gfx_print_rainbow_tlut.rgba16.inc.c"
};
u8 sGfxPrintRainbowFont[] = {
#include "assets/boot/gfxprint/sGfxPrintRainbowFont.bin.inc.c"
};
u8 sGfxPrintFont[] = {
#include "assets/boot/gfxprint/sGfxPrintFont.bin.inc.c"
};
void GfxPrint_Setup(GfxPrint* this) { void GfxPrint_Setup(GfxPrint* this) {
s32 width = 16; s32 width = 16;
@ -24,7 +34,7 @@ void GfxPrint_Setup(GfxPrint* this) {
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
gDPSetCombineMode(this->dList++, G_CC_DECALRGBA, G_CC_DECALRGBA); gDPSetCombineMode(this->dList++, G_CC_DECALRGBA, G_CC_DECALRGBA);
gDPLoadTextureBlock_4b(this->dList++, sGfxPrintFontData, G_IM_FMT_CI, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, gDPLoadTextureBlock_4b(this->dList++, sGfxPrintFont, G_IM_FMT_CI, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTLUT(this->dList++, 64, 256, sGfxPrintFontTLUT); gDPLoadTLUT(this->dList++, 64, 256, sGfxPrintFontTLUT);
@ -36,7 +46,7 @@ void GfxPrint_Setup(GfxPrint* this) {
gDPSetColor(this->dList++, G_SETPRIMCOLOR, this->color.rgba); gDPSetColor(this->dList++, G_SETPRIMCOLOR, this->color.rgba);
gDPLoadMultiTile_4b(this->dList++, sGfxPrintRainbowData, 0, 1, G_IM_FMT_CI, 2, 8, 0, 0, 1, 7, 4, gDPLoadMultiTile_4b(this->dList++, sGfxPrintRainbowFont, 0, 1, G_IM_FMT_CI, 2, 8, 0, 0, 1, 7, 4,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 1, 3, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTLUT(this->dList++, 16, 320, sGfxPrintRainbowTLUT); gDPLoadTLUT(this->dList++, 16, 320, sGfxPrintRainbowTLUT);

View File

@ -751,6 +751,7 @@
0x801FD5A0 : "voice_internal", 0x801FD5A0 : "voice_internal",
0x801FD710 : "code_801A5BD0", 0x801FD710 : "code_801A5BD0",
0x801FFD00 : "sequence", 0x801FFD00 : "sequence",
0x80200BE0 : "session_config",
0x80208E90 : "jpegdecoder", 0x80208E90 : "jpegdecoder",
0x80208EA0 : "gfxbuffers", 0x80208EA0 : "gfxbuffers",
0x8024A4C0 : "buffer_audio_heap", 0x8024A4C0 : "buffer_audio_heap",

View File

@ -4186,10 +4186,7 @@
0x801FFD00:("sSeqRequests","UNK_TYPE1","",0x1), 0x801FFD00:("sSeqRequests","UNK_TYPE1","",0x1),
0x801FFD34:("sNumSeqRequests","UNK_TYPE1","",0x1), 0x801FFD34:("sNumSeqRequests","UNK_TYPE1","",0x1),
0x801FFD40:("sAudioSeqCmds","u32","[0x100]",0x400), 0x801FFD40:("sAudioSeqCmds","u32","[0x100]",0x400),
0x80200140:("gActiveSeqs","UNK_TYPE1","",0x1), 0x80200140:("gActiveSeqs","UNK_TYPE1","",0xA8C),
0x8020034A:("D_8020034A","UNK_TYPE1","",0x1),
0x80200B88:("D_80200B88","UNK_TYPE1","",0x1),
0x80200BBA:("D_80200BBA","UNK_TYPE1","",0x1),
0x80200BCC:("sResetAudioHeapTimer","UNK_TYPE1","",0x1), 0x80200BCC:("sResetAudioHeapTimer","UNK_TYPE1","",0x1),
0x80200BCE:("sResetAudioHeapFadeReverbVolume","UNK_TYPE1","",0x1), 0x80200BCE:("sResetAudioHeapFadeReverbVolume","UNK_TYPE1","",0x1),
0x80200BD0:("sResetAudioHeapFadeReverbVolumeStep","UNK_TYPE1","",0x1), 0x80200BD0:("sResetAudioHeapFadeReverbVolumeStep","UNK_TYPE1","",0x1),