mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-08-13 04:29:22 -04:00
Finish doc
This commit is contained in:
+1
-1
@@ -5339,7 +5339,7 @@ void func_80014DE4(s32 cameraIndex) {
|
||||
D_801646D0[cameraIndex].unk0 = 0;
|
||||
D_801646D0[cameraIndex].unk2 = 0;
|
||||
D_801646D0[cameraIndex].unk4 = 0;
|
||||
if ((gModeSelection == 1) && (D_8018EDFC == 0)) {
|
||||
if ((gModeSelection == 1) && (gCourseMapInit == 0)) {
|
||||
D_80164678[cameraIndex] = 0;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -384,8 +384,8 @@ void func_8006F824(s32 arg0) {
|
||||
}
|
||||
|
||||
void func_8006F8CC(void) {
|
||||
if (D_8018EDFC == 0) {
|
||||
D_8018EDFC = 1;
|
||||
if (gCourseMapInit == 0) {
|
||||
gCourseMapInit = 1;
|
||||
gHUDModes = 0;
|
||||
D_801657E6 = 0;
|
||||
D_801657F0 = 0;
|
||||
|
||||
+1466
-1466
File diff suppressed because it is too large
Load Diff
@@ -60,8 +60,8 @@ u32 World::GetCupIndex() {
|
||||
u32 World::NextCup() {
|
||||
s32 hack = 1;
|
||||
|
||||
// Prevent battle mode
|
||||
if (gModeSelection == GRAND_PRIX) {
|
||||
// Do not display battle mode on GP, TT, or VS
|
||||
if (gModeSelection != BATTLE) {
|
||||
hack = 2;
|
||||
}
|
||||
|
||||
|
||||
+502
-492
File diff suppressed because it is too large
Load Diff
+14
-7
@@ -67,12 +67,12 @@ typedef struct {
|
||||
/* 0x00 */ u64* textureData; // This should be interpreted as a segmented address
|
||||
/**
|
||||
* Its hard to tell what exactly what this is meant to be,
|
||||
* but it appears to be used as some sort of offset/index from the address stored in gMenuTextureBuffer.
|
||||
* but it appears to be used as some sort of offset/index from the address stored in sMenuTextureList.
|
||||
* This value is (roughly) the sum of (width * height) of the
|
||||
* textures in all the previous entries in sMenuTextureMap
|
||||
*/
|
||||
/* 0x04 */ s32 offset;
|
||||
} struct_8018E118_entry; // size = 0x08
|
||||
} TextureMap; // size = 0x08
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ MenuTexture* textures;
|
||||
@@ -133,7 +133,7 @@ enum MENU_ITEM_TYPE {
|
||||
MAIN_MENU_50CC,
|
||||
MAIN_MENU_100CC,
|
||||
MAIN_MENU_150CC,
|
||||
MENU_ITEM_TYPE_015,
|
||||
MAIN_MENU_EXTRA_CC,
|
||||
MENU_ITEM_TYPE_016,
|
||||
MENU_ITEM_TYPE_017,
|
||||
MAIN_MENU_TIME_TRIALS_BEGIN,
|
||||
@@ -416,7 +416,7 @@ Gfx* draw_box_wide(Gfx*, s32, s32, s32, s32, u32, u32, u32, u32);
|
||||
Gfx* func_80098FC8(Gfx*, s32, s32, s32, s32);
|
||||
void dma_compressed_mio0_texture_segA(u64*, size_t, void*);
|
||||
void dma_tkmk00_textures(u64*, size_t, void*);
|
||||
void func_80099110(void);
|
||||
void clear_menu_textures(void);
|
||||
void load_menu_img(MenuTexture*);
|
||||
void* segmented_to_virtual_dupe(const void*);
|
||||
void* segmented_to_virtual_dupe_2(const void*);
|
||||
@@ -655,13 +655,20 @@ void tkmk00decode(u8*, u8*, u8*, s32);
|
||||
#define D_8018E768_SIZE 0x08
|
||||
#define D_8018E7E8_SIZE 0x05
|
||||
#define D_8018E810_SIZE 0x05
|
||||
#define MENU_TEXTURE_BUFFER_MAX 500
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
extern s32 D_800DDB24;
|
||||
extern s16 D_80164478[];
|
||||
|
||||
extern u16* gMenuTextureBuffer;
|
||||
/**
|
||||
* Old name: sMenuTextureBuffer
|
||||
* This array has been modified. Instead of holding a buffer of texture data
|
||||
* It now holds a list of pointers to asset strings.
|
||||
* use `load_texture()` and `replace_texture()` to add textures to the list for rendering.
|
||||
*/
|
||||
extern const char* sMenuTextureList[MENU_TEXTURE_BUFFER_MAX];
|
||||
extern u8* gMenuCompressedBuffer;
|
||||
extern u8* sTKMK00_LowResBuffer;
|
||||
extern u8* sGPPointsCopy;
|
||||
@@ -674,8 +681,8 @@ extern MenuItem gMenuItems[MENU_ITEMS_MAX];
|
||||
extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE];
|
||||
extern struct_8018E060_entry D_8018E060[];
|
||||
extern struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE];
|
||||
extern s32 sMenuTextureBufferIndex;
|
||||
extern struct_8018E118_entry sMenuTextureMap[TEXTURE_MAP_MAX];
|
||||
extern s32 sMenuTextureListIndex; // Old name: sMenuTextureBufferIndex, index into sMenuTextureList
|
||||
extern TextureMap sMenuTextureMap[TEXTURE_MAP_MAX];
|
||||
extern s32 sMenuTextureEntries;
|
||||
extern Gfx* sGfxPtr;
|
||||
extern s32 gNumD_8018E768Entries;
|
||||
|
||||
+517
-479
File diff suppressed because it is too large
Load Diff
+23
-24
@@ -204,15 +204,15 @@ void course_data_menu_act(struct Controller*, u16);
|
||||
void logo_intro_menu_act(struct Controller*, u16);
|
||||
void controller_pak_menu_act(struct Controller*, u16);
|
||||
void splash_menu_act(struct Controller*, u16);
|
||||
void func_800B28C8(void);
|
||||
void setup_game_mode_selected(void);
|
||||
void main_menu_act(struct Controller*, u16);
|
||||
bool is_character_spot_free(s32);
|
||||
void player_select_menu_act(struct Controller* controller, u16 arg1);
|
||||
void course_select_menu_act(struct Controller*, u16);
|
||||
void load_menu_states(s32);
|
||||
void func_800B44AC(void);
|
||||
void func_800B44BC(void);
|
||||
bool func_800B4520(void);
|
||||
void reset_cycle_flash_menu(void);
|
||||
void set_sound_mode(void);
|
||||
bool is_screen_being_faded(void);
|
||||
|
||||
/* data */
|
||||
extern s32 gIntroModelZEye;
|
||||
@@ -223,16 +223,16 @@ extern f32 gIntroModelRotZ;
|
||||
extern f32 gIntroModelPosX;
|
||||
extern f32 gIntroModelPosY;
|
||||
extern f32 gIntroModelPosZ;
|
||||
extern s32 D_8018EDE0;
|
||||
extern s32 gMenuFadeType;
|
||||
|
||||
extern s8 gCharacterGridSelections[];
|
||||
extern s8 D_8018EDE8[];
|
||||
extern s8 gCharacterGridIsSelected[];
|
||||
extern s8 gSubMenuSelection;
|
||||
extern s8 gMainMenuSelectionDepth;
|
||||
extern s8 D_8018EDEE;
|
||||
extern s8 gMainMenuSelection;
|
||||
extern s8 gPlayerSelectMenuSelection;
|
||||
extern s8 gDebugMenuSelection;
|
||||
extern s8 gControllerPakMenuSelection;
|
||||
extern s8 D_8018EDF1;
|
||||
extern s8 gScreenModeListIndex;
|
||||
extern u8 gSoundMode;
|
||||
extern s8 gPlayerCount;
|
||||
extern s8 gVersusResultCursorSelection;
|
||||
@@ -240,18 +240,17 @@ extern s8 gTimeTrialsResultCursorSelection;
|
||||
extern s8 gBattleResultCursorSelection;
|
||||
extern s8 gTimeTrialDataCourseIndex;
|
||||
extern s8 gCourseRecordsMenuSelection;
|
||||
extern s8 D_8018EDF9;
|
||||
extern s8 gCourseRecordsSubMenuSelection;
|
||||
extern s8 gDebugGotoScene;
|
||||
extern s8 D_8018EDFB;
|
||||
extern s8 D_8018EDFC;
|
||||
extern s8 gGhostPlayerInit;
|
||||
extern s8 gCourseMapInit;
|
||||
extern s32 gMenuTimingCounter;
|
||||
extern s32 gMenuDelayTimer;
|
||||
extern s8 gDemoUseController;
|
||||
extern s8 gCupSelection;
|
||||
extern s8 D_8018EE0A;
|
||||
extern s8 sTempCupSelection;
|
||||
extern s8 gCourseIndexInCup;
|
||||
extern s8 D_8018EE0C;
|
||||
extern struct_8018EE10_entry D_8018EE10[];
|
||||
extern s8 unref_D_8018EE0C;
|
||||
|
||||
extern s32 gMenuSelection; // D_800E86A0
|
||||
extern s32 gFadeModeSelection;
|
||||
@@ -261,21 +260,21 @@ extern s8 gGameModeMenuColumn[];
|
||||
extern s8 gGameModeSubMenuColumn[4][3];
|
||||
extern s8 gNextDemoId;
|
||||
extern s8 gControllerPakSelectedTableRow;
|
||||
extern s8 D_800E86C4[];
|
||||
extern s8 gControllerPakScrollDirection[];
|
||||
extern s8 unref_800E86E0[];
|
||||
extern s8 gControllerPakVisibleTableRows[];
|
||||
extern s8 gControllerPakScrollDirection;
|
||||
extern s8 unref_D_800E86D4[];
|
||||
extern u32 sVIGammaOffDitherOn;
|
||||
|
||||
extern const s8 D_800F2B50[5];
|
||||
extern const s8 D_800F2B58[5];
|
||||
extern const s8 sScreenModePlayerTable[5];
|
||||
extern const s8 sScreenModePlayerCount[5];
|
||||
extern const s8 gPlayerModeSelection[];
|
||||
extern const s8 gGameModePlayerColumnDefault[][3];
|
||||
extern const s8 gGameModePlayerColumnExtra[][3];
|
||||
extern const s8 sGameModePlayerColumnDefault[][3];
|
||||
extern const s8 sGameModePlayerColumnExtra[][3];
|
||||
extern const s32 gGameModePlayerSelection[][3];
|
||||
extern const s8 D_800F2BAC[8];
|
||||
extern const s8 sCharacterGridOrder[8];
|
||||
extern const s16 gCupCourseOrder[NUM_CUPS][NUM_COURSES_PER_CUP];
|
||||
|
||||
extern const union GameModePack gSoundMenuPack;
|
||||
extern const union GameModePack sSoundMenuPack;
|
||||
|
||||
// end of menus.c variables
|
||||
|
||||
|
||||
+33
-37
@@ -1882,56 +1882,52 @@ void func_8004C628(s32 arg0, s32 arg1, u32 arg2, u32 arg3, u8* texture) {
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// https://decomp.me/scratch/TqXqn
|
||||
// There's a weird fakematch concerning `xPos`, don't know that to make of. Can't quite get it over the finish line
|
||||
// though
|
||||
// non-matching
|
||||
void render_texture_tile_rgba32_block(s16 x, s16 y, u8* texture, u32 width, u32 height) {
|
||||
s32 texSizeLess;
|
||||
s32 i;
|
||||
s32 yPos;
|
||||
s32 xPos;
|
||||
s32 texBlockCount;
|
||||
u32 texSize;
|
||||
s32 heightDiv;
|
||||
s32 realCount;
|
||||
u8* textureCopy;
|
||||
s32 remainingSize;
|
||||
s32 currX;
|
||||
s32 currY;
|
||||
u32 size;
|
||||
s32 tileHeight;
|
||||
s32 numTiles;
|
||||
s32 numTilesDup;
|
||||
|
||||
currX = x - (width / 2);
|
||||
currY = y - (height / 2);
|
||||
|
||||
xPos = x - (width / 2);
|
||||
yPos = y - (height / 2);
|
||||
textureCopy = texture;
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
texSize = width * height * 4;
|
||||
texBlockCount = texSize / 4096;
|
||||
if (texSize % 4096) {
|
||||
texBlockCount++;
|
||||
|
||||
size = width * height * 4;
|
||||
numTiles = size / 4096;
|
||||
if (size % 4096) {
|
||||
numTiles++;
|
||||
}
|
||||
heightDiv = height / texBlockCount;
|
||||
realCount = texBlockCount;
|
||||
for (i = 0; i < realCount; i++) {
|
||||
load_texture_tile_rgba32_nomirror(textureCopy, width, heightDiv);
|
||||
render_texture_rectangle_wrap(xPos, yPos, width, heightDiv, 1);
|
||||
texSizeLess = texSize - (width * heightDiv * 4);
|
||||
textureCopy += (width * heightDiv * 4);
|
||||
if (texSizeLess < 0) {
|
||||
heightDiv = texSize / width;
|
||||
|
||||
tileHeight = height / numTiles;
|
||||
|
||||
numTilesDup = numTiles;
|
||||
for (size_t i = 0; i < numTilesDup; i++) {
|
||||
load_texture_tile_rgba32_nomirror(texture, width, tileHeight);
|
||||
render_texture_rectangle_wrap(currX, currY, width, tileHeight, 1);
|
||||
|
||||
texture += (width * tileHeight * 4);
|
||||
remainingSize = size - (width * tileHeight * 4);
|
||||
if (remainingSize < 0) {
|
||||
tileHeight = size / width;
|
||||
} else {
|
||||
texSize = texSizeLess;
|
||||
size -= (width * tileHeight * 4);
|
||||
}
|
||||
// Weird fakematch that is a HUGE improvement
|
||||
xPos += yPos * 0;
|
||||
yPos += heightDiv;
|
||||
currX += currY * 0;
|
||||
currY += tileHeight;
|
||||
}
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/render_objects/render_texture_tile_rgba32_block.s")
|
||||
#endif
|
||||
|
||||
void render_game_logo(s16 arg0, s16 arg1) {
|
||||
render_texture_tile_rgba32_block(arg0, arg1, gTextureLogoMarioKart64, 0x100, 0x80);
|
||||
void render_game_logo(s16 x, s16 y) {
|
||||
render_texture_tile_rgba32_block(x, y, LOAD_ASSET(gTextureLogoMarioKart64), ResourceGetTexWidthByName(gTextureLogoMarioKart64), ResourceGetTexHeightByName(gTextureLogoMarioKart64));
|
||||
}
|
||||
|
||||
UNUSED void func_8004C91C(s32 arg0, s32 arg1, u8* texture, s32 arg3, s32 arg4, s32 arg5) {
|
||||
|
||||
+4
-1
@@ -19,6 +19,9 @@
|
||||
// very fragile!
|
||||
#define EEPROM_ADDR(ptr) (((uintptr_t) (ptr) - (uintptr_t) (&gSaveData)) / 8)
|
||||
|
||||
/** BSS **/
|
||||
struct_8018EE10_entry D_8018EE10[2];
|
||||
|
||||
/*** data ***/
|
||||
u16 gCompanyCode = PFS_COMPANY_CODE('0', '1');
|
||||
u32 gGameCode = PFS_GAME_CODE('N', 'K', 'T', 'J');
|
||||
@@ -93,7 +96,7 @@ void reset_save_data_grand_prix_points_and_sound_mode(void) {
|
||||
}
|
||||
main->saveInfo.soundMode = SOUND_STEREO;
|
||||
gSoundMode = SOUND_STEREO;
|
||||
func_800B44BC();
|
||||
set_sound_mode();
|
||||
write_save_data_grand_prix_points_and_sound_mode();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#define PFS_NO_ERROR 0 // controller pak no error return
|
||||
#define PFS_NO_PAK_INSERTED 1 // no pak pressent or wrong device inserted into the controller
|
||||
#define PFS_PAK_BAD_READ 2 // controller pak error while data transfer
|
||||
#define PFS_PAK_CORRUPTED 3 // controller pak has courrupted or has weird data
|
||||
#define PFS_FILE_OVERFLOW 4 // too many files written to in the controller pak
|
||||
#define PFS_INVALID_DATA -1 // bad arguments, game note does not exist, osPfsInit was not called.
|
||||
// controller pak test functions
|
||||
@@ -87,6 +88,7 @@ s32 func_800B6A68(void);
|
||||
// these might not be in this file, but for now...
|
||||
|
||||
extern u32* D_800DC714;
|
||||
extern struct_8018EE10_entry D_8018EE10[];
|
||||
|
||||
extern u16 gCompanyCode;
|
||||
extern u32 gGameCode; // osPfs gamecode
|
||||
|
||||
+3
-5
@@ -13,15 +13,13 @@
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 type;
|
||||
/* 0x02 */ s16 unused1;
|
||||
/* 0x00 */ s32 type;
|
||||
/* 0x04 */ u64* textureData; // This should be interpreted as a segmented address
|
||||
/* 0x08 */ u16 width;
|
||||
/* 0x0A */ u16 height;
|
||||
/* 0x0C */ u16 dX;
|
||||
/* 0x0E */ u16 dY;
|
||||
/* 0x10 */ u16 size; // This size is NOT equal to width*height. Its likely the size of the compressed texture
|
||||
/* 0x12 */ s16 unused2;
|
||||
} MenuTexture; // size = 0x14
|
||||
|
||||
/**
|
||||
@@ -493,8 +491,8 @@ extern MenuTexture D_0200450C[2];
|
||||
extern MenuTexture D_02004534[2];
|
||||
extern MenuTexture D_0200455C[2];
|
||||
extern MenuTexture D_02004584[1];
|
||||
extern MenuTexture D_02004598[2];
|
||||
extern MenuTexture D_020045C0[2];
|
||||
extern MenuTexture seg2_blue_sky_background_texture[2];
|
||||
extern MenuTexture seg2_sunset_background_texture[2];
|
||||
extern MenuTexture seg2_copyright_1996_texture[2];
|
||||
extern MenuTexture seg2_push_start_button_texture[2];
|
||||
extern MenuTexture D_02004638[2];
|
||||
|
||||
Reference in New Issue
Block a user