Start using display size defines

This commit is contained in:
gamemasterplc 2024-09-09 23:39:00 -05:00
parent 18038b2870
commit 5650eb9905
18 changed files with 210 additions and 159 deletions

View file

@ -19,6 +19,7 @@
#include "game/board/tutorial.h"
#include "game/board/ui.h"
#include "game/pad.h"
#include "game/disp.h"
#include "game/msm.h"
typedef struct camera_view {
@ -1135,7 +1136,7 @@ void BoardCameraInit(void)
camera->fov = 25;
camera->near = 100;
camera->far = 13000;
camera->aspect = 1.2;
camera->aspect = HU_DISP_ASPECT;
camera->viewport_x = 0;
camera->viewport_y = 0;
camera->viewport_h = 480;
@ -1638,9 +1639,9 @@ static void DrawFilter(ModelData *model, Mtx matrix)
}
work = OM_GET_WORK_PTR(filterObj, FilterWork);
x1 = 0.0f;
x2 = 640.0f;
x2 = HU_FB_WIDTH;
y1 = 0.0f;
y2 = 480.0f;
y2 = HU_FB_HEIGHT;
MTXOrtho(proj, y1, y2, x1, x2, 0, 10);
GXSetProjection(proj, GX_ORTHOGRAPHIC);
MTXIdentity(modelview);
@ -2003,7 +2004,7 @@ void BoardLast5GfxInit(void)
HuSprAttrSet(work->group, 1, HUSPR_ATTR_NOANIM);
object->trans.x = 0.0f;
HuSprGrpTPLvlSet(work->group, object->trans.x);
HuSprGrpPosSet(work->group, 288, 72);
HuSprGrpPosSet(work->group, HU_DISP_CENTERX, 72);
HuAudFXPlay(838);
work->time = 0;
}

View file

@ -16,6 +16,8 @@
#include "game/hsfman.h"
#include "game/objsub.h"
#include "game/pad.h"
#include "game/disp.h"
#include "math.h"
#include "stdlib.h"
@ -2084,7 +2086,7 @@ void BoardRollCreate(s32 arg0, s32 arg1)
for (var_r30 = 0; var_r30 < 2; var_r30++) {
BoardSpriteCreate(DATA_MAKE_NUM(DATADIR_BOARD, 0x2B), 0x4B0, 0, &temp_r31->unk_06[var_r30]);
HuSprGrpMemberSet(temp_r31->unk_04, var_r30, temp_r31->unk_06[var_r30]);
HuSprPosSet(temp_r31->unk_04, var_r30, 288.0f, 240.0f);
HuSprPosSet(temp_r31->unk_04, var_r30, HU_DISP_CENTERX, HU_DISP_CENTERY);
HuSprAttrSet(temp_r31->unk_04, var_r30, 4);
}
rollObj = temp_r3;
@ -2131,7 +2133,7 @@ static void UpdateRollSprite(omObjData *arg0)
{
Vec sp1C;
s32 sp14[2];
f32 spC[2] = { 320.0f, 256.0f };
f32 spC[2] = { HU_DISP_CENTERX+32, HU_DISP_CENTERX-32 };
s32 var_r30;
s32 temp_r29;
bitcopy3 *temp_r31;
@ -2152,12 +2154,11 @@ static void UpdateRollSprite(omObjData *arg0)
}
else {
if ((sp14[1] == 0) && (var_r30 == 0)) {
sp1C.x = 288.0f;
}
else {
sp1C.x = HU_DISP_CENTERX;
} else {
sp1C.x = spC[var_r30];
}
sp1C.y = 176.0f;
sp1C.y = (HU_DISP_HEIGHTF*176)/480;
HuSprAttrReset(temp_r31->unk_04, var_r30, 4);
HuSprBankSet(temp_r31->unk_04, var_r30, sp14[var_r30]);
HuSprPosSet(temp_r31->unk_04, var_r30, sp1C.x, sp1C.y);

View file

@ -4,6 +4,7 @@
#include "game/hsfanim.h"
#include "game/object.h"
#include "game/pad.h"
#include "game/disp.h"
#include "game/process.h"
#include "game/window.h"
#include "game/board/main.h"
@ -239,10 +240,10 @@ static void RollMain(void) {
var_f31 = -10000.0f;
break;
case 1:
var_f31 = 288.0f - (sp8[0] / 2 - 16.0f);
var_f31 = HU_DISP_CENTERX- (sp8[0] / 2 - 16.0f);
break;
}
var_f30 = 304.0f;
var_f30 = HU_DISP_HEIGHT-176;
rollWin = HuWinCreate(var_f31, var_f30, sp8[0], sp8[1], 0);
HuWinBGTPLvlSet(rollWin, 0.0f);
HuWinMesSpeedSet(rollWin, 0);
@ -735,17 +736,17 @@ static void DiceDigitMove(DiceDigitWork *arg0, s32 arg1) {
Vec sp30;
Vec sp24;
Vec sp54[2];
Vec sp18 = { 288.0f, 155.0f, 240.0f };
Vec sp18 = { (HU_DISP_WIDTH/2), (HU_DISP_HEIGHT*155)/480, 240.0f };
Vec sp3C[2] = {
{ 144.0f, 155.0f, 240.0f },
{ 432.0f, 155.0f, 240.0f }
{ (HU_DISP_WIDTH*1)/4, (HU_DISP_HEIGHT*155)/480, 240.0f },
{ (HU_DISP_WIDTH*3)/4, (HU_DISP_HEIGHT*155)/480, 240.0f }
};
Vec sp6C[3] = {
{ 144.0f, 155.0f, 240.0f },
{ 432.0f, 155.0f, 240.0f },
{ 288.0f, 155.0f, 240.0f }
{ (HU_DISP_WIDTH*1)/4, (HU_DISP_HEIGHT*155)/480, 240.0f },
{ (HU_DISP_WIDTH*3)/4, (HU_DISP_HEIGHT*155)/480, 240.0f },
{ (HU_DISP_WIDTH/2), (HU_DISP_HEIGHT*155)/480, 240.0f }
};
Vec spC = { 288.0f, 176.0f, 240.0f };
Vec spC = { (HU_DISP_WIDTH/2), (HU_DISP_HEIGHT*176)/480, 240.0f };
Vec *var_r29;
float var_f31;
s16 var_r27;

View file

@ -4,6 +4,7 @@
#include "game/gamework_data.h"
#include "game/object.h"
#include "game/objsub.h"
#include "game/disp.h"
#include "game/pad.h"
#include "game/process.h"
#include "game/sprite.h"
@ -472,12 +473,12 @@ static void CreateShopWin(void) {
var_r30->unk01 = 0xC;
var_r30->unk04 = 0;
shopWinObj = var_r31;
var_r30->unk06 = HuWinCreate(36.0f, 344.0f, 0x1F8, 0x60, 0);
var_r30->unk06 = HuWinCreate(36.0f, HU_DISP_HEIGHT-136, 0x1F8, 0x60, 0);
HuWinMesSpeedSet(var_r30->unk06, 0);
HuWinDrawNoSet(var_r30->unk06, 0x40);
HuWinExAnimIn(var_r30->unk06);
sp8.x = 84.0f;
sp8.y = 392.0f;
sp8.y = HU_DISP_HEIGHT-88;
sp8.z = 400.0f;
var_r31->scale.x = var_r31->scale.y = var_r31->scale.z = 0.25f;
Hu3D2Dto3D(&sp8, 1, &sp8);

View file

@ -1,6 +1,8 @@
#include "game/board/star.h"
#include "game/audio.h"
#include "game/data.h"
#include "game/disp.h"
#include "game/flag.h"
#include "game/gamework.h"
#include "game/gamework_data.h"
@ -708,7 +710,7 @@ void BoardStarShowNext(s32 arg0) {
}
BoardViewMoveStart(&sp38, &sp50, var_r27);
showNextObj->trans.x = 68.0f;
showNextObj->trans.y = 430.0f;
showNextObj->trans.y = HU_DISP_HEIGHT-50;
showNextObj->trans.z = 100.0f;
sp44.x = showNextObj->trans.x;
sp44.y = showNextObj->trans.y;

View file

@ -17,6 +17,7 @@
#include "game/board/model.h"
#include "game/board/player.h"
#include "game/board/tutorial.h"
#include "game/disp.h"
#include "ext_math.h"
@ -189,9 +190,9 @@ static float statusHideOfsTbl[4] = {
static float statusPosTbl[4][2] = {
{ 114.0f, 84.0f },
{ 462.0f, 84.0f },
{ 114.0f, 396.0f },
{ 462.0f, 396.0f }
{ HU_DISP_WIDTH-114, 84.0f },
{ 114.0f, HU_DISP_HEIGHT-84 },
{ HU_DISP_WIDTH-114, HU_DISP_HEIGHT-84 }
};
static u8 statusColTbl[4][4] = {
@ -248,8 +249,8 @@ static s32 itemMdlTbl[14] = {
};
static Vec teamItemStatusPosTbl[2] = {
{ 190.0f, 116.0f, 0.0f },
{ 386.0f, 116.0f, 0.0f }
{ HU_DISP_CENTERX-98, 116.0f, 0.0f },
{ HU_DISP_CENTERX+98, 116.0f, 0.0f }
};
s32 BoardItemModelGet(s32 arg0) {
@ -923,7 +924,7 @@ void BoardYourTurnExec(s32 arg0) {
HuSprAttrSet(yourTurnSprGrp, 0, 1);
HuSprScaleSet(yourTurnSprGrp, 0, 0.001f, 0.001f);
HuSprAttrSet(yourTurnSprGrp, 0, 8);
HuSprGrpPosSet(yourTurnSprGrp, 288.0f, 240.0f);
HuSprGrpPosSet(yourTurnSprGrp, HU_DISP_CENTERX, HU_DISP_CENTERY);
HuAudFXPlay(0x307);
while (yourTurnObj) {
HuPrcVSleep();
@ -1476,9 +1477,9 @@ static void SetItemUIStatus(s32 arg0) {
var_f31 = statusPosTbl[i][0];
var_f30 = statusPosTbl[i][1];
for (j = 0; j < 6; j++) {
(temp_r28 + 4)[i][j].x = statusSprPosTbl[j + 0xB][0];
(temp_r28 + 4)[i][j].y = statusSprPosTbl[j + 0xB][1];
if (j + 0xB >= 0xD && j + 0xB <= 0xF) {
(temp_r28 + 4)[i][j].x = statusSprPosTbl[j + 11][0];
(temp_r28 + 4)[i][j].y = statusSprPosTbl[j + 11][1];
if (j + 11 >= 13 && j + 11 <= 15) {
(temp_r28 + 4)[i][j].x += var_f31;
(temp_r28 + 4)[i][j].y += var_f30;
}
@ -1815,8 +1816,8 @@ static void CreateItemWindow(s32 arg0, s32 arg1) {
= temp_r31->unk06[i] = temp_r31->unk00[i] = -1;
} else {
temp_r31->unk00[i] = temp_r28;
temp_r31->unk74[i].x = i * 576.0f + 36.0f;
temp_r31->unk74[i].y = var_f30 + 240.0f;
temp_r31->unk74[i].x = i * HU_DISP_WIDTHF + 36.0f;
temp_r31->unk74[i].y = var_f30 + HU_DISP_CENTERY;
temp_r31->unk74[i].z = 0.0f;
temp_r31->unk2C[i] = temp_r31->unk74[i];
temp_r31->unk12[i] = HuWinCreate(temp_r31->unk2C[i].x, temp_r31->unk2C[i].y, 0x1F8, 0x60, 0);
@ -1970,7 +1971,7 @@ static void CreatePickerWindow(UnkUiWork01 *arg0, s32 arg1) {
}
HuWinMesMaxSizeGet(1, spC, var_r30);
var_f30 = -10000.0f;
var_f29 = var_f31 + 352.0f;
var_f29 = var_f31 + (HU_DISP_HEIGHT-128);
arg0->unk06 = HuWinCreate(var_f30, var_f29, spC[0], spC[1], 0);
HuWinBGTPLvlSet(arg0->unk06, 0.0f);
HuWinMesSpeedSet(arg0->unk06, 0);

View file

@ -7,6 +7,8 @@
#include "game/pad.h"
#include "game/sprite.h"
#include "game/wipe.h"
#include "game/disp.h"
#include "game/board/main.h"
#include "game/board/model.h"
#include "game/board/player.h"
@ -52,10 +54,10 @@ static s16 focusMdl = -1;
static float overhead2DPos[][2] = {
{ 48.0f, 72.0f },
{ 528.0f, 72.0f },
{ 48.0f, 408.0f },
{ 528.0f, 408.0f },
{ 288.0f, 72.0f }
{ HU_DISP_WIDTH-48, 72.0f },
{ 48.0f, HU_DISP_HEIGHT-72 },
{ HU_DISP_WIDTH-48, HU_DISP_HEIGHT-72 },
{ HU_DISP_CENTERX, 72.0f }
};
static float mapViewMinZ[] = {
@ -534,7 +536,7 @@ static void UpdateOverheadView(omObjData *arg0) {
}
for (i = 0; i < 5; i++) {
var_r29 = overhead2DPos[i];
sp20.x = var_r29[0] - 288.0f;
sp20.x = var_r29[0] - HU_DISP_CENTERX;
sp20.y = var_r29[1] - 240.0f;
sp20.z = 1000.0f;
if (i != 4) {
@ -545,7 +547,7 @@ static void UpdateOverheadView(omObjData *arg0) {
BoardSpacePosGet(0, BoardSpaceStarGetCurr(), &sp14);
}
Hu3D3Dto2D(&sp14, 1, &sp14);
sp14.x -= 288.0f;
sp14.x -= HU_DISP_CENTERX;
sp14.y -= 240.0f;
VECSubtract(&sp20, &sp14, &sp8);
sp8.z = 0.0f;

View file

@ -10,6 +10,8 @@
#include "game/hsfdraw.h"
#include "game/hsfex.h"
#include "game/objsub.h"
#include "game/disp.h"
#include "math.h"
static void WarpInit(s32);
@ -212,8 +214,8 @@ static void WarpImpact(s32 player) {
f32 angle;
s16 i;
pos.x = 288.0f;
pos.y = 240.0f;
pos.x = HU_DISP_CENTERX;
pos.y = HU_DISP_CENTERY;
pos.z = 700.0f;
Hu3D2Dto3D(&pos, 1, &pos);
BoardModelPosSetV(warpImpactMdl, &pos);

View file

@ -1,6 +1,8 @@
#include "game/board/window.h"
#include "game/board/main.h"
#include "game/board/player.h"
#include "game/disp.h"
#include "game/gamework_data.h"
static s8 winChoice;
@ -82,9 +84,9 @@ static void ExecBoardWindow(void) {
{432.0f, 96.0f},
};
f32 pos_all[7][2] = {
{96.0f, 328.0f}, {72.0f, 128.0f},
{36.0f, 344.0f}, {128.0f, 312.0f},
{144.0f, 144.0f}, {128.0f, 264.0f},
{96.0f, HU_DISP_HEIGHT-152}, {72.0f, 128.0f},
{36.0f, HU_DISP_HEIGHT-136}, {128.0f, HU_DISP_HEIGHT-168},
{144.0f, HU_DISP_CENTERY-96 }, {128.0f, HU_DISP_HEIGHT-216},
{128.0f, 75.0f},
};