Merge pull request #4045 from HarbourMasters/develop

develop -> develop-rando
This commit is contained in:
Garrett Cox 2024-04-08 16:02:22 +00:00 committed by GitHub
commit 67ee5f8d0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 82 additions and 87 deletions

View File

@ -96,11 +96,6 @@ jobs:
sudo installer -pkg ./MacPorts-2.9.1-12-Monterey.pkg -target / sudo installer -pkg ./MacPorts-2.9.1-12-Monterey.pkg -target /
fi fi
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
- name: Update MacPorts
if: ${{ !vars.MAC_RUNNER }}
run: |
sudo port selfupdate
sudo port upgrade outdated
- name: Install dependencies - name: Install dependencies
if: ${{ !vars.MAC_RUNNER }} if: ${{ !vars.MAC_RUNNER }}
run: | run: |

2
ZAPDTR

@ -1 +1 @@
Subproject commit eff29036118349e142ee8efca80fd975a2a2b6ff Subproject commit 9f9d0be3c914354ecabab3695581f1123c13ac20

@ -1 +1 @@
Subproject commit c3a699403793c9ac97733179fe078d2e2f271ee1 Subproject commit b135db823aaabf6e848fcbd2796933b0771f9968

View File

@ -1230,8 +1230,8 @@ Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a);
void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b); void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
void func_80095974(GraphicsContext* gfxCtx); void func_80095974(GraphicsContext* gfxCtx);
void func_80095AA0(PlayState* play, Room* room, Input* arg2, UNK_TYPE arg3); void func_80095AA0(PlayState* play, Room* room, Input* arg2, UNK_TYPE arg3);
void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 frameX, f32 frameY); u16 tlutCount, f32 offsetX, f32 offsetY);
void func_80096FD4(PlayState* play, Room* room); void func_80096FD4(PlayState* play, Room* room);
u32 func_80096FE8(PlayState* play, RoomContext* roomCtx); u32 func_80096FE8(PlayState* play, RoomContext* roomCtx);
s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum); s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum);
@ -1828,8 +1828,8 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line);
void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY,
f32 translateZ); f32 translateZ);
uintptr_t SysUcode_GetUCodeBoot(void); uintptr_t SysUcode_GetUCodeBoot(void);
uintptr_t SysUcode_GetUCodeBootSize(void); size_t SysUcode_GetUCodeBootSize(void);
uintptr_t SysUcode_GetUCode(void); uint32_t SysUcode_GetUCode(void);
uintptr_t SysUcode_GetUCodeData(void); uintptr_t SysUcode_GetUCodeData(void);
void func_800D2E30(UnkRumbleStruct* arg0); void func_800D2E30(UnkRumbleStruct* arg0);
void func_800D3140(UnkRumbleStruct* arg0); void func_800D3140(UnkRumbleStruct* arg0);

View File

@ -3,9 +3,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "Resource.h" #include "Resource.h"
#include "Vec2f.h"
#include "Vec3f.h"
#include "Color3b.h"
namespace SOH { namespace SOH {

View File

@ -3,9 +3,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "Resource.h" #include "Resource.h"
#include "Vec2f.h"
#include "Vec3f.h"
#include "Color3b.h"
namespace SOH { namespace SOH {
class PlayerAnimation : public LUS::Resource<int16_t> { class PlayerAnimation : public LUS::Resource<int16_t> {

View File

@ -1,20 +1,25 @@
#include "global.h" #include "global.h"
//uintptr_t D_8012DBA0 = (uintptr_t)&D_80155F50; #include "public/bridge/gfxbridge.h"
//uintptr_t D_8012DBA4 = (uintptr_t)&D_80157580;
UcodeHandlers sDefaultGSPUCodeText = ucode_f3dex2;
// u64* sDefaultGSPUCodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
uintptr_t SysUcode_GetUCodeBoot(void) { uintptr_t SysUcode_GetUCodeBoot(void) {
//return &D_80009320; // return rspbootTextStart;
return (uintptr_t)NULL;
} }
uintptr_t SysUcode_GetUCodeBootSize(void) { size_t SysUcode_GetUCodeBootSize(void) {
//return (uintptr_t)&D_800093F0 - (uintptr_t)&D_80009320; // return (ptrdiff_t)((uintptr_t)rspbootTextEnd - (uintptr_t)rspbootTextStart);
return 0;
} }
uintptr_t SysUcode_GetUCode(void) { uint32_t SysUcode_GetUCode(void) {
//return D_8012DBA0; return sDefaultGSPUCodeText;
} }
uintptr_t SysUcode_GetUCodeData(void) { uintptr_t SysUcode_GetUCodeData(void) {
//return D_8012DBA4; // return sDefaultGSPUCodeData;
return (uintptr_t)NULL;
} }

View File

@ -8,6 +8,8 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "public/bridge/gfxbridge.h"
void func_80095AB4(PlayState* play, Room* room, u32 flags); void func_80095AB4(PlayState* play, Room* room, u32 flags);
void func_80095D04(PlayState* play, Room* room, u32 flags); void func_80095D04(PlayState* play, Room* room, u32 flags);
void func_80096F6C(PlayState* play, Room* room, u32 flags); void func_80096F6C(PlayState* play, Room* room, u32 flags);
@ -254,23 +256,21 @@ s32 swapAndConvertJPEG(void* data) {
} }
void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 frameX, f32 frameY) { u16 tlutCount, f32 offsetX, f32 offsetY) {
Gfx* displayListHead; Gfx* gfx = *gfxP;
uObjBg* bg; uObjBg* bg;
s32 temp;
displayListHead = *displayList; bg = (uObjBg*)(gfx + 1);
gSPBranchList(gfx, (Gfx*)(bg + 1));
bg = (uObjBg*)(displayListHead + 1);
gSPBranchList(displayListHead, (u8*)bg + sizeof(uObjBg));
bg->b.imageX = 0; bg->b.imageX = 0;
bg->b.imageW = width * 4; bg->b.imageW = width * (1 << 2);
bg->b.frameX = frameX * 4; bg->b.frameX = offsetX * (1 << 2);
bg->b.imageY = 0; bg->b.imageY = 0;
bg->b.imageH = height * 4; bg->b.imageH = height * (1 << 2);
bg->b.frameY = frameY * 4; bg->b.frameY = offsetY * (1 << 2);
bg->b.imagePtr = source; bg->b.imagePtr = tex;
bg->b.imageLoad = G_BGLT_LOADTILE; bg->b.imageLoad = G_BGLT_LOADTILE;
bg->b.imageFmt = fmt; bg->b.imageFmt = fmt;
bg->b.imageSiz = siz; bg->b.imageSiz = siz;
@ -280,62 +280,68 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h
// When an alt resource exists for the background, we need to unload the original asset // When an alt resource exists for the background, we need to unload the original asset
// to clear the cache so the alt asset will be loaded instead // to clear the cache so the alt asset will be loaded instead
// OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed
ResourceMgr_UnloadOriginalWhenAltExists((char*) source); ResourceMgr_UnloadOriginalWhenAltExists((char*)tex);
if (ResourceMgr_ResourceIsBackground((char*) source)) { if (ResourceMgr_ResourceIsBackground((char*)tex)) {
char* blob = (char*) ResourceGetDataByName((char *) source); char* blob = (char*)ResourceGetDataByName((char *)tex);
swapAndConvertJPEG(blob); swapAndConvertJPEG(blob);
bg->b.imagePtr = (uintptr_t) blob; bg->b.imagePtr = (uintptr_t)blob;
} }
displayListHead = (void*)(bg + 1); gfx = (Gfx*)(bg + 1);
if (fmt == G_IM_FMT_CI) { if (fmt == G_IM_FMT_CI) {
gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut); gDPLoadTLUT(gfx++, tlutCount, 256, tlut);
} else { } else {
gDPPipeSync(displayListHead++); gDPPipeSync(gfx++);
} }
if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) { if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) {
bg->b.frameW = width * 4; bg->b.frameW = width * (1 << 2);
bg->b.frameH = height * 4; bg->b.frameH = height * (1 << 2);
guS2DInitBg(bg); guS2DInitBg(bg);
gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE, // #region SOH [Port][Widescreen]
// When larger than 4:3 we want to render an additional black rectangle behind the 2d image
// to simulate black bars on the side that cover up the world
s16 newX = OTRGetRectDimensionFromLeftEdge(0);
if (newX < 0) {
gDPSetOtherMode(gfx++, tlutMode | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
gDPSetFillColor(gfx++, GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1));
gDPFillWideRectangle(gfx++, newX, 0, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH), SCREEN_HEIGHT);
}
// #endregion
gDPSetOtherMode(gfx++, tlutMode | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
gDPSetFillColor(displayListHead++, GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1)); gDPLoadMultiTile(gfx++, bg->b.imagePtr, 0,
gDPFillWideRectangle(displayListHead++, OTRGetRectDimensionFromLeftEdge(0), 0,
OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH), SCREEN_HEIGHT);
gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
gDPLoadMultiTile(displayListHead++, bg->b.imagePtr, 0,
G_TX_RENDERTILE, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, 0, 0, 0, 0 + 31, G_TX_RENDERTILE, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, 0, 0, 0, 0 + 31,
0 + 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, 0 + 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gSPBgRectCopy(displayListHead++, bg); gSPBgRectCopy(gfx++, bg);
} else { } else {
bg->s.frameW = width * 4; bg->s.frameW = width * (1 << 2);
bg->s.frameH = height * 4; bg->s.frameH = height * (1 << 2);
bg->s.scaleW = 1024; bg->s.scaleW = 1 << 10;
bg->s.scaleH = 1024; bg->s.scaleH = 1 << 10;
bg->s.imageYorig = bg->b.imageY; bg->s.imageYorig = bg->b.imageY;
gDPSetOtherMode(displayListHead++, gDPSetOtherMode(gfx++,
mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | tlutMode | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE |
G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL | G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA)); GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
gDPSetCombineLERP(displayListHead++, 0, 0, 0, TEXEL0, 0, 0, 0, 1, 0, 0, 0, TEXEL0, 0, 0, 0, 1); gDPSetCombineLERP(gfx++, 0, 0, 0, TEXEL0, 0, 0, 0, 1, 0, 0, 0, TEXEL0, 0, 0, 0, 1);
gSPObjRenderMode(displayListHead++, G_OBJRM_ANTIALIAS | G_OBJRM_BILERP); gSPObjRenderMode(gfx++, G_OBJRM_ANTIALIAS | G_OBJRM_BILERP);
gSPBgRect1Cyc(displayListHead++, bg); gSPBgRect1Cyc(gfx++, bg);
} }
gDPPipeSync(displayListHead++); gDPPipeSync(gfx++);
*displayList = displayListHead;
*gfxP = gfx;
} }
// Room Draw Polygon Type 1 - Single Format // Room Draw Polygon Type 1 - Single Format
@ -369,22 +375,20 @@ void func_80096680(PlayState* play, Room* room, u32 flags) {
} }
if (sp98) { if (sp98) {
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)? gSPLoadUcodeL(POLY_OPA_DISP++, ucode_s2dex);
//gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
{ {
Vec3f sp60; Vec3f sp60;
spA8 = POLY_OPA_DISP; spA8 = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&sp60, camera); Camera_GetSkyboxOffset(&sp60, camera);
func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut, polygon1->single.width, Room_DrawBackground2D(&spA8, polygon1->single.source, polygon1->single.tlut, polygon1->single.width,
polygon1->single.height, polygon1->single.fmt, polygon1->single.siz, polygon1->single.height, polygon1->single.fmt, polygon1->single.siz,
polygon1->single.mode0, polygon1->single.tlutCount, polygon1->single.mode0, polygon1->single.tlutCount,
(sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f); (sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f);
POLY_OPA_DISP = spA8; POLY_OPA_DISP = spA8;
} }
// gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData())? gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode());
gSPLoadUcodeEx(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData(), 0x800);
} }
} }
@ -472,21 +476,19 @@ void func_80096B6C(PlayState* play, Room* room, u32 flags) {
} }
if (sp94) { if (sp94) {
// gSPLoadUcodeL(POLY_OPA_DISP++, rspS2DEX)? gSPLoadUcodeL(POLY_OPA_DISP++, ucode_s2dex);
//gSPLoadUcodeEx(POLY_OPA_DISP++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
{ {
Vec3f sp5C; Vec3f sp5C;
spA8 = POLY_OPA_DISP; spA8 = POLY_OPA_DISP;
Camera_GetSkyboxOffset(&sp5C, camera); Camera_GetSkyboxOffset(&sp5C, camera);
func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt, Room_DrawBackground2D(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
bgImage->siz, bgImage->mode0, bgImage->tlutCount, bgImage->siz, bgImage->mode0, bgImage->tlutCount,
(sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f); (sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
POLY_OPA_DISP = spA8; POLY_OPA_DISP = spA8;
} }
// gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData())? gSPLoadUcode(POLY_OPA_DISP++, SysUcode_GetUCode());
gSPLoadUcodeEx(POLY_OPA_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData(), 0x800);
} }
} }

View File

@ -7,6 +7,8 @@
#include "textures/icon_item_dungeon_static/icon_item_dungeon_static.h" #include "textures/icon_item_dungeon_static/icon_item_dungeon_static.h"
#include "textures/icon_item_nes_static/icon_item_nes_static.h" #include "textures/icon_item_nes_static/icon_item_nes_static.h"
#include "public/bridge/gfxbridge.h"
void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
static void* dungeonItemTexs[] = { static void* dungeonItemTexs[] = {
gQuestIconDungeonBossKeyTex, gQuestIconDungeonBossKeyTex,
@ -592,19 +594,16 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
gSP1Quadrangle(POLY_KAL_DISP++, j, j + 2, j + 3, j + 1, 0); gSP1Quadrangle(POLY_KAL_DISP++, j, j + 2, j + 3, j + 1, 0);
} else if (HREG(15) == 1) { } else if (HREG(15) == 1) {
Gfx* sp1CC = POLY_KAL_DISP; Gfx* gfx = POLY_KAL_DISP;
void* mapImage = gWorldMapImageTex;
// gSPLoadUcodeL(sp1CC++, rspS2DEX)? gSPLoadUcodeL(gfx++, ucode_s2dex);
//gSPLoadUcodeEx(sp1CC++, OS_K0_TO_PHYSICAL(D_80113070), OS_K0_TO_PHYSICAL(D_801579A0), 0x800);
func_8009638C(&sp1CC, mapImage, gWorldMapImageTLUT, 216, 128, G_IM_FMT_CI, G_IM_SIZ_8b, 0x8000, 256, Room_DrawBackground2D(&gfx, gWorldMapImageTex, gWorldMapImageTLUT, 216, 128, G_IM_FMT_CI, G_IM_SIZ_8b,
HREG(13) / 100.0f, HREG(14) / 100.0f); G_TT_RGBA16, 256, HREG(13) / 100.0f, HREG(14) / 100.0f);
// gSPLoadUcode(sp1CC++, SysUcode_GetUCode(), SysUcode_GetUCodeData())? gSPLoadUcode(gfx++, SysUcode_GetUCode());
gSPLoadUcodeEx(sp1CC++, SysUcode_GetUCode(), SysUcode_GetUCodeData(), 0x800);
POLY_KAL_DISP = sp1CC; POLY_KAL_DISP = gfx;
} }
if (HREG(15) == 2) { if (HREG(15) == 2) {