From d95bd02a18814ad629cf5fc7fb60449f2ba7a418 Mon Sep 17 00:00:00 2001 From: Treeki Date: Mon, 8 Oct 2012 05:37:19 +0200 Subject: skawo can go fuck himself with a rake --- src/fileselect.S | 18 +++++++-------- src/koopatlas/hud.cpp | 6 ++--- src/koopatlas/mapdata.h | 4 +++- src/koopatlas/pathmanager.cpp | 6 ++++- src/randomcrap.S | 51 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/fileselect.S b/src/fileselect.S index a10a474..38874cc 100644 --- a/src/fileselect.S +++ b/src/fileselect.S @@ -77,7 +77,7 @@ DFNiceWorldName: ori r4, r4, ConvertedWorldName@l mr r3, r4 mr r5, r31 - li r6, 36 + li r6, 32 mtctr r6 convWNameLoop: lbz r6, 0x6FC(r5) @@ -94,20 +94,20 @@ convWNameLoop: bctrl # now set the colours - # Text colours: 0x720, hint colours: 0x728 - lwz r3, 0x720(r31) + # Text colours: 0x71C, hint colours: 0x724 + lwz r3, 0x71C(r31) stw r3, 0xDC(r20) - lwz r3, 0x724(r31) + lwz r3, 0x720(r31) stw r3, 0xE0(r20) addi r3, r30, 0x74 lis r4, Picture_00@h ori r4, r4, Picture_00@l bl findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc - lwz r4, 0x728(r31) + lwz r4, 0x724(r31) stw r4, 0xD8(r3) stw r4, 0xDC(r3) - lwz r4, 0x72C(r31) + lwz r4, 0x728(r31) stw r4, 0xE0(r3) stw r4, 0xE4(r3) @@ -342,20 +342,20 @@ DFTitle: ConvertedWorldName: .short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 .short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 -.short 0,0,0,0,0,0,0,0,0,0,0,0 # 12 +.short 0,0,0,0,0,0,0,0 # 8 .align 4 DefaultSavefileInfoData: .string "Yoshi's Island" #15 .byte 0,0,0,0,0,0,0,0,0,0,0 # 11 -.byte 0,0,0,0,0,0,0,0,0,0 # 10 +.byte 0,0,0,0,0,0 # 6 .long 0xFFFF99FF,0x1FB423FF .long 0x173714FF,0x3C9135FF .long 0xFFFF99FF,0x1FB423FF .short 0x75 .byte 0x2E,0xB .byte 0,1 -.byte 0,0 +.byte 0,10 DefaultSavefileInfoDataEnd: .long 0 diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index 7ed1b5d..117773f 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -475,14 +475,14 @@ void dWMHud_c::loadHeaderInfo() { void dWMHud_c::loadFooterInfo() { SaveBlock *save = GetSaveFile()->GetBlock(-1); - wchar_t convertedWorldName[36]; + wchar_t convertedWorldName[32]; int i; - for (i = 0; i < 36; i++) { + for (i = 0; i < 32; i++) { convertedWorldName[i] = save->newerWorldName[i]; if (convertedWorldName[i] == 0) break; } - convertedWorldName[35] = 0; + convertedWorldName[31] = 0; WorldName->SetString(convertedWorldName); WorldNameS->SetString(convertedWorldName); diff --git a/src/koopatlas/mapdata.h b/src/koopatlas/mapdata.h index 8c133b4..9c1cd50 100644 --- a/src/koopatlas/mapdata.h +++ b/src/koopatlas/mapdata.h @@ -197,7 +197,9 @@ struct dKPWorldDef_s { s8 hudHintS, hudHintL; u8 key, trackID; u8 worldID; - u8 padding; + u8 titleScreenWorld; + u8 titleScreenLevel; + u8 padding[3]; }; struct dKPMapFile_s { diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 49ba3cd..acaee42 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -135,7 +135,8 @@ dWMPathManager_c::~dWMPathManager_c() { if (isEnteringLevel) { SaveBlock *save = GetSaveFile()->GetBlock(-1); - if (enteredLevel->displayLevel >= 21 && enteredLevel->displayLevel <= 28 && enteredLevel->displayLevel != 26) { + if ((enteredLevel->displayLevel >= 21 && enteredLevel->displayLevel <= 27 && enteredLevel->displayLevel != 26) + || (enteredLevel->displayLevel >= 29 && enteredLevel->displayLevel <= 42)) { if (!save->CheckLevelCondition(enteredLevel->worldSlot, enteredLevel->levelSlot, COND_NORMAL)) { MaybeFinishingLevel[0] = enteredLevel->worldSlot; MaybeFinishingLevel[1] = enteredLevel->levelSlot; @@ -666,6 +667,9 @@ void dWMPathManager_c::moveThroughPath() { save->hudHintS = world->hudHintS; save->hudHintL = world->hudHintL; + save->titleScreenWorld = world->titleScreenWorld; + save->titleScreenLevel = world->titleScreenLevel; + if (dWMHud_c::instance) dWMHud_c::instance->showFooter(); } diff --git a/src/randomcrap.S b/src/randomcrap.S index 1653ce7..b4e8f02 100644 --- a/src/randomcrap.S +++ b/src/randomcrap.S @@ -1,4 +1,55 @@ .text + +.global TitleScreenFucker +.extern RESTART_CRSIN_LevelStartStruct +.extern SaveFileInstance +TitleScreenFucker: + lis r3, RESTART_CRSIN_LevelStartStruct@h + ori r3, r3, RESTART_CRSIN_LevelStartStruct@l + li r4, 0 + stb r4, 7(r3) + + # now get the FUCKING WORLD and FUCKING LEVEL + lis r4, SaveFileInstance@h + ori r4, r4, SaveFileInstance@l + lwz r4, 0(r4) + lbz r5, 0x26(r4) + extsb r5, r5 + mulli r5, r5, 0x980 + addi r4, r4, 0x6C0 + add r4, r4, r5 + + # do we need to use Quick Save? get the QS block + addi r4, r4, 0x1C80 + lbz r6, 2(r4) + clrlwi. r6, r6, 31 + beq quickSaveExists + subi r4, r4, 0x1C80 +quickSaveExists: + + # now we have the save block in r4 + lbz r6, 2(r4) + clrlwi. r6, r6, 31 + bne saveIsNotNew + li r5, 0 + li r6, 9 + b chosenTitle +saveIsNotNew: + lbz r5, 0x73A(r4) + lbz r6, 0x73B(r4) +chosenTitle: + cmpwi r5, 0 + bne isntWorld1_1 + cmpwi r6, 0 + bne isntWorld1_1 + li r5, 0 + li r6, 9 +isntWorld1_1: + stb r5, 0xC(r3) + stb r6, 0xD(r3) + blr + + .global mpPauseFix1 .global mpPauseFix2 .extern continueFromMpPauseFix1 -- cgit v1.2.3