mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-07 11:01:40 -04:00
demo work (#1172)
* Some d_message demo matches * More demo matches * fix jpn
This commit is contained in:
+77
-42
@@ -24,6 +24,7 @@
|
||||
#endif
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "m_Do/m_Do_dvd_thread.h"
|
||||
#include "DynamicLink.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramBlock.h"
|
||||
@@ -66,7 +67,7 @@ mDoDvdThd_toMainRam_c * l_itemTableCommand;
|
||||
mDoDvdThd_toMainRam_c * l_ActorDataCommand;
|
||||
mDoDvdThd_toMainRam_c * l_FmapDataCommand;
|
||||
#if VERSION == VERSION_DEMO
|
||||
mDoDvdThd_mountXArchive_c * l_DmcMountCommand;
|
||||
mDoDvdThd_callback_c * l_DmcMountCommand;
|
||||
#else
|
||||
mDoDvdThd_mountXArchive_c * l_lodCommand;
|
||||
#endif
|
||||
@@ -87,18 +88,23 @@ enum {
|
||||
|
||||
/* 8022C0B4-8022C130 .text checkProgSelect__FP10dScnLogo_c */
|
||||
void checkProgSelect(dScnLogo_c* i_this) {
|
||||
#if VERSION == VERSION_PAL
|
||||
if (OSGetResetCode() == 0 || OSGetResetCode() == 1) {
|
||||
if (OSGetEuRgb60Mode() == 1 || CPad_CHECK_HOLD_B(0)) {
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) {
|
||||
i_this->field_0x1ea = 1;
|
||||
i_this->mInterFlag = 0;
|
||||
}
|
||||
#elif VERSION <= VERSION_USA
|
||||
if (OSGetResetCode() == 0) {
|
||||
if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) {
|
||||
i_this->field_0x1ea = 1;
|
||||
i_this->mInterFlag = 0;
|
||||
}
|
||||
} else {
|
||||
i_this->field_0x1ea = 0;
|
||||
}
|
||||
#else
|
||||
if (OSGetResetCode() == 0) {
|
||||
if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) {
|
||||
#else // VERSION_PAL
|
||||
if (OSGetResetCode() == 0 || OSGetResetCode() == 1) {
|
||||
if (OSGetEuRgb60Mode() == 1 || CPad_CHECK_HOLD_B(0)) {
|
||||
i_this->field_0x1ea = 1;
|
||||
i_this->mInterFlag = 0;
|
||||
}
|
||||
@@ -167,7 +173,8 @@ BOOL progInDraw(dScnLogo_c* i_this) {
|
||||
dComIfGd_set2DOpa(i_this->progyesImg);
|
||||
dComIfGd_set2DOpa(i_this->prognoImg);
|
||||
|
||||
u8 alpha = (1.0f - (i_this->mTimer / 30.0f)) * 0xFF;
|
||||
f32 temp = 1.0f - (i_this->mTimer / 30.0f);
|
||||
u8 alpha = temp * 0xFF;
|
||||
i_this->progchoiceImg->setAlpha(alpha);
|
||||
i_this->progyesImg->setAlpha(alpha);
|
||||
i_this->prognoImg->setAlpha(alpha);
|
||||
@@ -274,7 +281,8 @@ BOOL progSelDraw(dScnLogo_c* i_this) {
|
||||
|
||||
/* 8022CAA8-8022CC54 .text progOutDraw__FP10dScnLogo_c */
|
||||
BOOL progOutDraw(dScnLogo_c* i_this) {
|
||||
u8 alpha = (i_this->mTimer / 30.0f) * 0xFF;
|
||||
f32 temp = i_this->mTimer / 30.0f;
|
||||
u8 alpha = temp * 0xFF;
|
||||
i_this->progchoiceImg->setAlpha(alpha);
|
||||
i_this->progyesImg->setAlpha(alpha);
|
||||
i_this->prognoImg->setAlpha(alpha);
|
||||
@@ -286,18 +294,21 @@ BOOL progOutDraw(dScnLogo_c* i_this) {
|
||||
|
||||
if (i_this->mTimer == 0) {
|
||||
#if VERSION == VERSION_PAL
|
||||
if (OSGetEuRgb60Mode() == 1 && !i_this->mInterFlag) {
|
||||
if (OSGetEuRgb60Mode() == 1 && !i_this->mInterFlag)
|
||||
#else
|
||||
if (OSGetProgressiveMode() && !i_this->mInterFlag) {
|
||||
if (OSGetProgressiveMode() && !i_this->mInterFlag)
|
||||
#endif
|
||||
{
|
||||
i_this->mAction = ACT_nintendoOut2Draw;
|
||||
i_this->mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
}
|
||||
#if VERSION == VERSION_PAL
|
||||
} else if (OSGetEuRgb60Mode() == 0 && i_this->mInterFlag) {
|
||||
else if (OSGetEuRgb60Mode() == 0 && i_this->mInterFlag)
|
||||
#else
|
||||
} else if (!OSGetProgressiveMode() && i_this->mInterFlag) {
|
||||
else if (!OSGetProgressiveMode() && i_this->mInterFlag)
|
||||
#endif
|
||||
{
|
||||
i_this->mAction = ACT_nintendoOutDraw;
|
||||
i_this->mTimer = 30;
|
||||
mDoGph_gInf_c::startFadeOut(30);
|
||||
@@ -319,7 +330,8 @@ BOOL progOutDraw(dScnLogo_c* i_this) {
|
||||
BOOL progSetDraw(dScnLogo_c* i_this) {
|
||||
u8 alpha;
|
||||
if (i_this->field_0x1f0 != 0) {
|
||||
alpha = (1.0f - (i_this->field_0x1f0 / 30.0f)) * 0xFF;
|
||||
f32 temp = 1.0f - (i_this->field_0x1f0 / 30.0f);
|
||||
alpha = temp * 0xFF;
|
||||
i_this->field_0x1f0--;
|
||||
} else {
|
||||
alpha = 0xFF;
|
||||
@@ -438,7 +450,9 @@ BOOL dvdWaitDraw(dScnLogo_c* i_this) {
|
||||
&& l_itemTableCommand->sync()
|
||||
&& l_ActorDataCommand->sync()
|
||||
&& l_FmapDataCommand->sync()
|
||||
#if VERSION > VERSION_DEMO
|
||||
#if VERSION == VERSION_DEMO
|
||||
&& l_DmcMountCommand->sync()
|
||||
#else
|
||||
&& l_lodCommand->sync() && !mDoRst::isReset()
|
||||
#endif
|
||||
) {
|
||||
@@ -486,7 +500,7 @@ static BOOL dScnLogo_IsDelete(dScnLogo_c* i_this) {
|
||||
/* 8022D224-8022D984 .text dScnLogo_Delete__FP10dScnLogo_c */
|
||||
static BOOL dScnLogo_Delete(dScnLogo_c* i_this) {
|
||||
if (mDoRst::isReset())
|
||||
mDoRst_reset(0, 0x80000000, 0);
|
||||
mDoRst_reset(0, DEMO_SELECT(0, 0x80000000), 0);
|
||||
|
||||
delete i_this->nintendoImg;
|
||||
delete i_this->dolbyImg;
|
||||
@@ -617,7 +631,10 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) {
|
||||
|
||||
/* 8022D984-8022DB20 .text phase_0__FP10dScnLogo_c */
|
||||
cPhs_State phase_0(dScnLogo_c* i_this) {
|
||||
#if VERSION != VERSION_PAL
|
||||
#if VERSION == VERSION_DEMO
|
||||
if (!VIGetDTVStatus())
|
||||
OSSetProgressiveMode(0);
|
||||
#elif VERSION <= VERSION_USA
|
||||
if (!OSGetResetCode()) {
|
||||
if (!VIGetDTVStatus())
|
||||
OSSetProgressiveMode(0);
|
||||
@@ -642,17 +659,24 @@ cPhs_State phase_0(dScnLogo_c* i_this) {
|
||||
|
||||
rt = dComIfG_setObjectRes("System", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
|
||||
JUT_ASSERT(VERSION_SELECT(1169, 1169, 1350, 1378), rt == 1);
|
||||
JUT_ASSERT(VERSION_SELECT(1128, 1169, 1350, 1378), rt == 1);
|
||||
|
||||
#if VERSION <= VERSION_DEMO
|
||||
rt = dComIfG_setObjectRes("Logo", JKRArchive::MOUNT_DIRECTION_HEAD, NULL);
|
||||
#else
|
||||
rt = dComIfG_setObjectRes("Logo", JKRArchive::MOUNT_DIRECTION_TAIL, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1173, 1173, 1354, 1382), rt == 1);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1131, 1173, 1354, 1382), rt == 1);
|
||||
|
||||
#if VERSION == VERSION_PAL
|
||||
g_mDoMemCd_control.load2();
|
||||
#endif
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
i_this->field_0x1ea = 0;
|
||||
archiveHeap->dump_sort();
|
||||
#endif
|
||||
|
||||
return cPhs_NEXT_e;
|
||||
}
|
||||
|
||||
@@ -684,14 +708,18 @@ cPhs_State phase_1(dScnLogo_c* i_this) {
|
||||
|
||||
toonImage = (ResTIMG *)dComIfG_getObjectRes("System", dRes_INDEX_SYSTEM_BTI_TOON_e);
|
||||
|
||||
JUT_ASSERT(VERSION_SELECT(1208, 1208, 1426, 1466), toonImage != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1161, 1208, 1426, 1466), toonImage != NULL);
|
||||
dDlst_list_c::setToonImage(toonImage);
|
||||
|
||||
toonImage = (ResTIMG *)dComIfG_getObjectRes("System", dRes_INDEX_SYSTEM_BTI_TOONEX_e);
|
||||
JUT_ASSERT(VERSION_SELECT(1213, 1213, 1431, 1471), toonImage != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1166, 1213, 1431, 1471), toonImage != NULL);
|
||||
dDlst_list_c::setToonExImage(toonImage);
|
||||
|
||||
i_this->field_0x1f8 = mDoExt_getGameHeap()->alloc(0x3c8a0, 4);
|
||||
#if VERSION == VERSION_DEMO
|
||||
i_this->field_0x1fc = mDoExt_getArchiveHeap()->alloc(0xf24e0, 4);
|
||||
#endif
|
||||
|
||||
return cPhs_NEXT_e;
|
||||
}
|
||||
|
||||
@@ -710,7 +738,7 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
s32 rt;
|
||||
|
||||
rt = dComIfG_syncObjectRes("Logo");
|
||||
JUT_ASSERT(VERSION_SELECT(1251, 1251, 1469, 1509), rt >= 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1202, 1251, 1469, 1509), rt >= 0);
|
||||
|
||||
if (rt != 0)
|
||||
return cPhs_INIT_e;
|
||||
@@ -720,9 +748,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
ResTIMG * timg;
|
||||
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_NINTENDO_376X104_e);
|
||||
JUT_ASSERT(VERSION_SELECT(1264, 1264, 1482, 1522), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1214, 1264, 1482, 1522), timg != NULL);
|
||||
i_this->nintendoImg = new dDlst_2D_c(timg, 133, 170, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1267, 1267, 1485, 1525), i_this->nintendoImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1216, 1267, 1485, 1525), i_this->nintendoImg != NULL);
|
||||
i_this->nintendoImg->setAlpha(0xFF);
|
||||
#if VERSION <= VERSION_JPN
|
||||
// Blue Nintendo logo for JPN.
|
||||
@@ -733,9 +761,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#endif
|
||||
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_TITLE_DOLBY_MARK_e);
|
||||
JUT_ASSERT(VERSION_SELECT(1276, 1276, 1498, 1538), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1224, 1276, 1498, 1538), timg != NULL);
|
||||
i_this->dolbyImg = new dDlst_2D_c(timg, 218, 166, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1280, 1280, 1502, 1542), i_this->dolbyImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1226, 1280, 1502, 1542), i_this->dolbyImg != NULL);
|
||||
i_this->dolbyImg->setAlpha(0xFF);
|
||||
|
||||
#if VERSION == VERSION_PAL
|
||||
@@ -781,9 +809,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#else
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_CHOICE_e);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1286, 1286, 1565, 1605), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1232, 1286, 1565, 1605), timg != NULL);
|
||||
i_this->progchoiceImg = new dDlst_2D_c(timg, 113, 281, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1288, 1288, 1567, 1607), i_this->progchoiceImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1234, 1288, 1567, 1607), i_this->progchoiceImg != NULL);
|
||||
i_this->progchoiceImg->setAlpha(0x00);
|
||||
|
||||
#if VERSION == VERSION_PAL
|
||||
@@ -791,9 +819,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#else
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_YES_e);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1295, 1295, 1579, 1619), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1240, 1295, 1579, 1619), timg != NULL);
|
||||
i_this->progyesImg = new dDlst_2D_c(timg, 211, 372, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1297, 1297, 1581, 1621), i_this->progyesImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1242, 1297, 1581, 1621), i_this->progyesImg != NULL);
|
||||
i_this->progyesImg->getPicture()->setWhite((GXColor){0xFF, 0xC8, 0x00, 0xFF});
|
||||
i_this->progyesImg->setAlpha(0x00);
|
||||
|
||||
@@ -802,9 +830,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#else
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_NO_e);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1305, 1305, 1594, 1634), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1249, 1305, 1594, 1634), timg != NULL);
|
||||
i_this->prognoImg = new dDlst_2D_c(timg, 350, 372, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1307, 1307, 1596, 1636), i_this->prognoImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1251, 1307, 1596, 1636), i_this->prognoImg != NULL);
|
||||
i_this->prognoImg->getPicture()->setWhite((GXColor){0xA0, 0xA0, 0xA0, 0xFF});
|
||||
i_this->prognoImg->setAlpha(0x00);
|
||||
|
||||
@@ -813,9 +841,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#else
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_PRO_e);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1315, 1315, 1609, 1649), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1258, 1315, 1609, 1649), timg != NULL);
|
||||
i_this->progImg = new dDlst_2D_c(timg, 153, 309, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1317, 1317, 1611, 1651), i_this->progImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1260, 1317, 1611, 1651), i_this->progImg != NULL);
|
||||
i_this->progImg->setAlpha(0x00);
|
||||
|
||||
#if VERSION == VERSION_PAL
|
||||
@@ -823,12 +851,15 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#else
|
||||
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_INTER_e);
|
||||
#endif
|
||||
JUT_ASSERT(VERSION_SELECT(1324, 1324, 1623, 1663), timg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1266, 1324, 1623, 1663), timg != NULL);
|
||||
i_this->interImg = new dDlst_2D_c(timg, 153, 309, 0);
|
||||
JUT_ASSERT(VERSION_SELECT(1326, 1326, 1625, 1665), i_this->interImg != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1268, 1326, 1625, 1665), i_this->interImg != NULL);
|
||||
i_this->interImg->setAlpha(0x00);
|
||||
|
||||
JKRHeap::free(i_this->field_0x1f8, NULL);
|
||||
#if VERSION == VERSION_DEMO
|
||||
JKRHeap::free(i_this->field_0x1fc, NULL);
|
||||
#endif
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
l_lodCommand = aramMount("/res/Stage/sea/LODALL.arc");
|
||||
@@ -836,17 +867,17 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
#endif
|
||||
|
||||
rt = dComIfG_setObjectRes("Always", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1351, 1351, 1650, 1690), rt == 1);
|
||||
JUT_ASSERT(VERSION_SELECT(1280, 1351, 1650, 1690), rt == 1);
|
||||
|
||||
#if VERSION > VERSION_DEMO
|
||||
archiveHeap->dump_sort();
|
||||
#endif
|
||||
|
||||
rt = dComIfG_setObjectRes("Link", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1356, 1356, 1655, 1695), rt == 1);
|
||||
JUT_ASSERT(VERSION_SELECT(1283, 1356, 1655, 1695), rt == 1);
|
||||
|
||||
rt = dComIfG_setObjectRes("Agb", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1360, 1360, 1659, 1699), rt == 1);
|
||||
JUT_ASSERT(VERSION_SELECT(1286, 1360, 1659, 1699), rt == 1);
|
||||
|
||||
l_anmCommand = aramMount("/res/Object/LkAnm.arc");
|
||||
l_fmapCommand = aramMount("/res/Fmap/Fmap.arc");
|
||||
@@ -899,11 +930,15 @@ cPhs_State phase_2(dScnLogo_c* i_this) {
|
||||
l_rubyCommand = onMemMount("/res/Msg/rubyres.arc");
|
||||
l_particleCommand = mDoDvdThd_toMainRam_c::create("/res/Particle/common.jpc", JKRArchive::DEFAULT_MOUNT_DIRECTION, dComIfGp_particle_getCommonHeap());
|
||||
l_itemTableCommand = mDoDvdThd_toMainRam_c::create("/res/ItemTable/item_table.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1418, 1418, 1743, 1783), l_itemTableCommand != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1342, 1418, 1743, 1783), l_itemTableCommand != NULL);
|
||||
l_ActorDataCommand = mDoDvdThd_toMainRam_c::create("/res/ActorDat/ActorDat.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1422, 1422, 1747, 1787), l_ActorDataCommand != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1346, 1422, 1747, 1787), l_ActorDataCommand != NULL);
|
||||
l_FmapDataCommand = mDoDvdThd_toMainRam_c::create("/res/FmapDat/FmapDat.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1426, 1426, 1751, 1791), l_FmapDataCommand != NULL);
|
||||
JUT_ASSERT(VERSION_SELECT(1350, 1426, 1751, 1791), l_FmapDataCommand != NULL);
|
||||
#if VERSION == VERSION_DEMO
|
||||
l_DmcMountCommand = DynamicModuleControl::mountCreate();
|
||||
JUT_ASSERT(VERSION_SELECT(1354, 1426, 1751, 1791), l_DmcMountCommand != NULL);
|
||||
#endif
|
||||
|
||||
mDoAud_loadStaticWaves();
|
||||
mDoGph_gInf_c::setTickRate((OS_BUS_CLOCK / 4) / 60);
|
||||
|
||||
Reference in New Issue
Block a user