Merge remote-tracking branch 'base/port' into port

This commit is contained in:
Raf committed 2023-09-05 04:40:45 +08:00
commit c08d8b6bcb
20 files changed
+175 -51

No files matched your search

+14 -2
View File
@@ -27,6 +27,8 @@ TARGET_PLATFORM ?=
#
# Supported values:
# * ntsc-final
# * pal-final
# * jpn-final
ROMID ?= ntsc-final
@@ -98,7 +100,17 @@ TARGET_BIG_ENDIAN = 0 # TODO
# The VERSION constant is used in the source to handle version-specific code.
ifeq ($(ROMID),ntsc-final)
BIN_NAME = pd.exe
VERSION = 2
IS_PAL = 0
else ifeq ($(ROMID),pal-final)
BIN_NAME = pd.pal.exe
VERSION = 4
IS_PAL = 1
else ifeq ($(ROMID),jpn-final)
BIN_NAME = pd.jpn.exe
VERSION = 5
IS_PAL = 0
else
$(error ROM version $(VERSION) is not supported)
endif
@@ -113,7 +125,7 @@ DEFINES := \
VERSION_TARGET=\"$(VERSION_TARGET)\" \
VERSION_ROMID=\"$(VERSION_ROMID)\" \
MATCHING=0 \
PAL=0 \
PAL=$(IS_PAL) \
PIRACYCHECKS=0 \
ROM_SIZE=$(ROM_SIZE) \
_LANGUAGE_C=1
@@ -248,7 +260,7 @@ LDFLAGS := $(TARGET_LDFLAGS)
# (We use this a lot)
export ROMID
BIN := $(B_DIR)/pd.exe
BIN := $(B_DIR)/$(BIN_NAME)
default: $(JSON_HEADERS) $(BIN)
+3
View File
@@ -19,6 +19,9 @@ s32 videoGetNativeHeight(void);
s32 videoGetWidth(void);
s32 videoGetHeight(void);
f32 videoGetAspect(void);
u32 videoGetTextureFilter2D(void);
void videoSetWindowOffset(s32 x, s32 y);
s32 videoCreateFramebuffer(u32 w, u32 h);
void videoSetFramebuffer(s32 target);
+1 -1
View File
@@ -156,7 +156,7 @@ void inputSetDefaultKeyBinds(void)
};
static const u32 joybinds[][2] = {
{ CK_B, SDL_CONTROLLER_BUTTON_A },
{ CK_A, SDL_CONTROLLER_BUTTON_A },
{ CK_X, SDL_CONTROLLER_BUTTON_X },
{ CK_Y, SDL_CONTROLLER_BUTTON_Y },
{ CK_DPAD_L, SDL_CONTROLLER_BUTTON_B, },
+1
View File
@@ -72,6 +72,7 @@ static void gameLoadConfig(void)
g_PlayerMouseAimMode = configGetIntClamped("Game.MouseAimMode", g_PlayerMouseAimMode, 0, 1);
g_PlayerMouseAimSpeedX = configGetFloatClamped("Game.MouseAimSpeedX", g_PlayerMouseAimSpeedX, 0.f, 10.f);
g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f);
g_ViShakeIntensityMult = configGetFloatClamped("Game.ScreenShakeIntensity", 1.f, 0.f, 100.f);
}
int main(int argc, const char **argv)
+1
View File
@@ -94,6 +94,7 @@ bool g_SchedViModesPending[NUM_GFXTASKS] = {false, false};
s32 g_ViUnblackTimer = NUM_FRAMEBUFFERS + 1;
s32 g_ViShakeDirection = 1;
s32 g_ViShakeIntensity = 0;
f32 g_ViShakeIntensityMult = 1.f;
s32 g_ViShakeTimer = 0;
u32 var8005cea0 = 0;
u32 var8005cea4 = 0;
+66 -34
View File
@@ -20,16 +20,31 @@
* at load time, which is fucking terrible
*/
#define ROMDATA_ROM_NAME "pd.ntsc-final.z64"
#define ROMDATA_ROM_SIZE 33554432
#define ROMDATA_ROM_HASH // TODO
#define ROMDATA_FILEDIR "files"
#define ROMDATA_SEGDIR "segs"
// for ntsc-final
#define ROMDATA_ROM_NAME "pd." VERSION_ROMID ".z64"
#define ROMDATA_ROM_SIZE 33554432
#define ROMDATA_ROM_HASH // TODO
#if VERSION == VERSION_NTSC_FINAL
#define ROMDATA_ROM_TITLE "Perfect Dark"
#define ROMDATA_ROM_ID "NPDE"
#define ROMDATA_FILES_OFS 0x28080
#define ROMDATA_DATA_OFS 0x39850
#elif VERSION == VERSION_PAL_FINAL
#define ROMDATA_ROM_TITLE "Perfect Dark"
#define ROMDATA_ROM_ID "NPDP"
#define ROMDATA_FILES_OFS 0x28910
#define ROMDATA_DATA_OFS 0x39850
#elif VERSION == VERSION_JPN_FINAL
#define ROMDATA_ROM_TITLE "PERFECT DARK"
#define ROMDATA_ROM_ID "NPDJ"
#define ROMDATA_FILES_OFS 0x28800
#define ROMDATA_DATA_OFS 0x39850
#else
#error "This ROM version is unsupported."
#endif
#define ROMDATA_MAX_FILES 2048
@@ -59,37 +74,40 @@ static struct romfile fileSlots[ROMDATA_MAX_FILES];
/* segment table for ntsc-final */
/* size will get calculated automatically if it is 0 */
/* if there are replacement files in the data dir, they will be loaded instead */
/* offsets are specified for ntsc-final, pal-final and jpn-final in that order */
#define ROMSEG_LIST() \
ROMSEG_DECL_SEG(fontjpnsingle, 0x194b20, 0x0, preprocessJpnFont ) \
ROMSEG_DECL_SEG(fontjpnmulti, 0x19fb40, 0x0, preprocessJpnFont ) \
ROMSEG_DECL_SEG(animations, 0x1a15c0, 0x0, preprocessAnimations ) \
ROMSEG_DECL_SEG(mpconfigs, 0x7d0a40, 0x11E0, preprocessMpConfigs ) \
ROMSEG_DECL_SEG(mpstringsE, 0x7d1c20, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsJ, 0x7d5320, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsP, 0x7d8a20, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsG, 0x7dc120, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsF, 0x7df820, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsS, 0x7e2f20, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsI, 0x7e6620, 0x3700, NULL ) \
ROMSEG_DECL_SEG(firingrange, 0x7e9d20, 0x1550, NULL ) \
ROMSEG_DECL_SEG(fonttahoma, 0x7f7860, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fontnumeric, 0x7f8b20, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicsm, 0x7f9d30, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicxs, 0x7fbfb0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicmd, 0x7fdd80, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothiclg, 0x8008e0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(sfxctl, 0x80a250, 0x2fb80, preprocessALBankFile ) \
ROMSEG_DECL_SEG(sfxtbl, 0x839dd0, 0x4c2160, NULL ) \
ROMSEG_DECL_SEG(seqctl, 0xcfbf30, 0xa060, preprocessALBankFile ) \
ROMSEG_DECL_SEG(seqtbl, 0xd05f90, 0x17c070, NULL ) \
ROMSEG_DECL_SEG(sequences, 0xe82000, 0x563a0, preprocessSequences ) \
ROMSEG_DECL_SEG(texturesdata, 0x1d65f40, 0x291d60, NULL ) \
ROMSEG_DECL_SEG(textureslist, 0x1ff7ca0, 0x6d80, preprocessTexturesList )
ROMSEG_DECL_SEG(fontjpnsingle, 0x194b20, 0x180330, 0x0, 0x0, preprocessJpnFont ) \
ROMSEG_DECL_SEG(fontjpnmulti, 0x19fb40, 0x18b340, 0x0, 0x0, preprocessJpnFont ) \
ROMSEG_DECL_SEG(animations, 0x1a15c0, 0x18cdc0, 0x190c50, 0x0, preprocessAnimations ) \
ROMSEG_DECL_SEG(mpconfigs, 0x7d0a40, 0x7bc240, 0x7c00d0, 0x11e0, preprocessMpConfigs ) \
ROMSEG_DECL_SEG(mpstringsE, 0x7d1c20, 0x7bd420, 0x7c12b0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsJ, 0x7d5320, 0x7c0b20, 0x7c49b0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsP, 0x7d8a20, 0x7c4220, 0x7c80b0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsG, 0x7dc120, 0x7c7920, 0x7cb7b0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsF, 0x7df820, 0x7cb020, 0x7ceeb0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsS, 0x7e2f20, 0x7ce720, 0x7d25b0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(mpstringsI, 0x7e6620, 0x7d1e20, 0x7d5cb0, 0x3700, NULL ) \
ROMSEG_DECL_SEG(firingrange, 0x7e9d20, 0x7d5520, 0x7d93b0, 0x1550, NULL ) \
ROMSEG_DECL_SEG(fonttahoma, 0x7f7860, 0x7e3060, 0x7e6ef0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fontnumeric, 0x7f8b20, 0x7e4320, 0x7e81b0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicsm, 0x7f9d30, 0x7e5530, 0x7e93c0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicxs, 0x7fbfb0, 0x7e87b0, 0x7ec640, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothicmd, 0x7fdd80, 0x7eae20, 0x7eecb0, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(fonthandelgothiclg, 0x8008e0, 0x7eee70, 0x7f2d00, 0x0, preprocessFont ) \
ROMSEG_DECL_SEG(sfxctl, 0x80a250, 0x7f87e0, 0x7fc670, 0x2fb80, preprocessALBankFile ) \
ROMSEG_DECL_SEG(sfxtbl, 0x839dd0, 0x828360, 0x82c1f0, 0x4c2160, NULL ) \
ROMSEG_DECL_SEG(seqctl, 0xcfbf30, 0xcea4c0, 0xcee350, 0xa060, preprocessALBankFile ) \
ROMSEG_DECL_SEG(seqtbl, 0xd05f90, 0xcf4520, 0xcf83b0, 0x17c070, NULL ) \
ROMSEG_DECL_SEG(sequences, 0xe82000, 0xe70590, 0xe74420, 0x563a0, preprocessSequences ) \
ROMSEG_DECL_SEG(texturesdata, 0x1d65f40, 0x1d5ca20, 0x1d61f90, 0x0, NULL ) \
ROMSEG_DECL_SEG(textureslist, 0x1ff7ca0, 0x1fee780, 0x1ff68f0, 0x0, preprocessTexturesList ) \
ROMSEG_DECL_SEG(copyright, 0x1ffea20, 0x1ff5500, 0x1ffd6b0, 0xb30, NULL ) \
ROMSEG_DECL_SEG(fontjpn, 0x0, 0x0, 0x178c40, 0x17920, preprocessJpnFont )
// declare the vars first
#undef ROMSEG_DECL_SEG
#define ROMSEG_DECL_SEG(name, ofs, size, preproc) u8 *ROMSEG_START(name), *ROMSEG_END(name);
#define ROMSEG_DECL_SEG(name, ofs_ntsc, ofs_pal, ofs_jpn, size, preproc) u8 *ROMSEG_START(name), *ROMSEG_END(name);
ROMSEG_LIST()
// this is part of the animations seg and as such does not follow the naming convention
@@ -100,13 +118,21 @@ u8 *_animationsTableRomEnd;
// then build the table
#undef ROMSEG_DECL_SEG
#define ROMSEG_DECL_SEG(name, ofs, size, preproc) { &ROMSEG_START(name), &ROMSEG_END(name), #name, (u8 *)ofs, size, preproc },
#if VERSION == VERSION_NTSC_FINAL
#define ROMSEG_DECL_SEG(name, ofs_ntsc, ofs_pal, ofs_jpn, size, preproc) { &ROMSEG_START(name), &ROMSEG_END(name), #name, (u8 *)ofs_ntsc, size, preproc },
#elif VERSION == VERSION_PAL_FINAL
#define ROMSEG_DECL_SEG(name, ofs_ntsc, ofs_pal, ofs_jpn, size, preproc) { &ROMSEG_START(name), &ROMSEG_END(name), #name, (u8 *)ofs_pal, size, preproc },
#elif VERSION == VERSION_JPN_FINAL
#define ROMSEG_DECL_SEG(name, ofs_ntsc, ofs_pal, ofs_jpn, size, preproc) { &ROMSEG_START(name), &ROMSEG_END(name), #name, (u8 *)ofs_jpn, size, preproc },
#endif
static struct romfile romSegs[] = {
ROMSEG_LIST()
{ NULL, NULL, NULL, NULL, 0, NULL },
};
/* the game sets g_LoadType to the type of file it expects, */
/* the game sets g_LoadType to the type of file it expects, */
/* so we can hijack that in fileLoad and automatically byteswap the file */
static preprocessfunc filePreprocFuncs[] = {
/* LOADTYPE_NONE */ NULL,
@@ -133,7 +159,7 @@ static inline void romdataLoadRom(void)
sysFatalError("Wrong ROM file size.\nExpected: %u\nGot: %u", ROMDATA_ROM_SIZE, g_RomFileSize);
}
if (memcmp(g_RomFile + 0x3b, "NPDE", 4) || memcmp(g_RomFile + 0x20, "Perfect Dark", 12)) {
if (memcmp(g_RomFile + 0x3b, ROMDATA_ROM_ID, 4) || memcmp(g_RomFile + 0x20, ROMDATA_ROM_TITLE, sizeof(ROMDATA_ROM_TITLE) - 1)) {
sysFatalError("Wrong ROM file.\nEnsure that it is the correct NTSC v1.1 ROM in z64 format.");
}
@@ -169,6 +195,12 @@ static inline void romdataLoadRom(void)
static inline void romdataInitSegment(struct romfile *seg)
{
if (!seg->data) {
// unused in this ROM, skip it
sysLogPrintf(LOG_NOTE, "skipping segment %s", seg->name);
return;
}
if (!seg->size) {
// size unknown
if (seg[1].name) {
+14
View File
@@ -20,6 +20,7 @@ static u32 dlcount = 0;
static u32 frames = 0;
static u32 framesPerSec = 0;
static f64 startTime, endTime, fpsTime;
static u32 texFilter2D = 1;
s32 videoInit(void)
{
@@ -46,6 +47,8 @@ s32 videoInit(void)
if (filter > FILTER_THREE_POINT) filter = FILTER_THREE_POINT;
renderingAPI->set_texture_filter((enum FilteringMode)filter);
texFilter2D = configGetIntClamped("Video.TextureFilter2D", 1, 0, 1);
initDone = true;
return 0;
}
@@ -134,6 +137,17 @@ f32 videoGetAspect(void)
return gfx_current_dimensions.aspect_ratio;
}
u32 videoGetTextureFilter2D(void)
{
return texFilter2D;
}
void videoSetWindowOffset(s32 x, s32 y)
{
gfx_current_game_window_viewport.x = x;
gfx_current_game_window_viewport.y = y;
}
s32 videoCreateFramebuffer(u32 w, u32 h)
{
return gfx_create_framebuffer(w, h);
+4
View File
@@ -6579,7 +6579,11 @@ bool chrHasLosToPosWasteful(struct chrdata *chr, struct coord *pos, RoomNum *roo
return chrHasLosToPos(chr, pos, rooms);
}
#ifdef PLATFORM_N64
return chrHasLosToPos(chr, pos, rooms);
#else
return false;
#endif
}
bool chrHasLosToProp(struct chrdata *chr, struct prop *prop)
+9 -3
View File
@@ -28,6 +28,12 @@
#include "data.h"
#include "types.h"
#ifdef PLATFORM_N64
#define SHAKE_TIME 6
#else
#define SHAKE_TIME 12
#endif
struct explosion *g_Explosions;
s32 g_MaxExplosions;
@@ -296,7 +302,7 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
struct prop *expprop = propAllocate();
if (type != EXPLOSIONTYPE_16 && type != EXPLOSIONTYPE_BULLETHOLE) {
g_ExplosionShakeTotalTimer = 6;
g_ExplosionShakeTotalTimer = SHAKE_TIME;
}
if (expprop) {
@@ -554,8 +560,8 @@ bool explosionCreate(struct prop *sourceprop, struct coord *exppos, RoomNum *exp
*/
void explosionShake(void)
{
g_ExplosionShakeTotalTimer = 6;
g_ExplosionShakeIntensityTimer = 6;
g_ExplosionShakeTotalTimer = SHAKE_TIME;
g_ExplosionShakeIntensityTimer = SHAKE_TIME;
}
void explosionsUpdateShake(struct coord *arg0, struct coord *arg1, struct coord *arg2)
+10
View File
@@ -585,6 +585,16 @@ struct menuitem g_MainMenu4MbMenuItems[] = {
0,
(void *)&g_ChangeAgentMenuDialog,
},
#ifndef PLATFORM_N64
{
MENUITEMTYPE_SELECTABLE,
0,
MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT,
L_OPTIONS_110, // "Exit Game"
0x00000007,
(void *)&g_ExitGameMenuDialog,
},
#endif
{ MENUITEMTYPE_END },
};
+3 -3
View File
@@ -341,7 +341,7 @@ void textReset(void)
textLoadFont(REF_SEG _fonthandelgothiclgSegmentRomStart, REF_SEG _fonthandelgothiclgSegmentRomEnd, &g_FontHandelGothicLg, &g_CharsHandelGothicLg, false);
}
textLoadFont(&_fonthandelgothicxsSegmentRomStart, &_fonthandelgothicxsSegmentRomEnd, &g_FontHandelGothicXs, &g_CharsHandelGothicXs, false);
textLoadFont(REF_SEG _fonthandelgothicxsSegmentRomStart, REF_SEG _fonthandelgothicxsSegmentRomEnd, &g_FontHandelGothicXs, &g_CharsHandelGothicXs, false);
#elif VERSION >= VERSION_PAL_BETA
textLoadFont(REF_SEG _fontnumericSegmentRomStart, REF_SEG _fontnumericSegmentRomEnd, &g_FontNumeric, &g_CharsNumeric, false);
textLoadFont(REF_SEG _fonthandelgothicxsSegmentRomStart, REF_SEG _fonthandelgothicxsSegmentRomEnd, &g_FontHandelGothicXs, &g_CharsHandelGothicXs, false);
@@ -394,7 +394,7 @@ Gfx *text0f153628(Gfx *gdl)
}
#endif
else {
gDPSetTextureFilter(gdl++, G_TF_BILERP);
gDPSetTextureFilter(gdl++, TEX_FILTER_2D);
}
return gdl;
@@ -1790,7 +1790,7 @@ Gfx *text0f15568c(Gfx *gdl, s32 *x, s32 *y, struct fontchar *curchar, struct fon
(*x + curchar->width) * 4 + var8007fadc,
G_TX_RENDERTILE,
var8007fae8 + 32,
((curchar->height - 1) << 5) + var8007fae4 + 32,
((curchar->height) << 5) + var8007fae4 + 32,
1024,
65536 - 1024 / var8007fad0);
} else {
+3 -3
View File
@@ -290,7 +290,7 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
g_JpnCacheCacheItems[freeindexsingle].codepoint = codepoint;
dmaExec((u8 *) (freeindexsingle * (TMUL * 0x0c) + (romptr_t) &g_JpnCharCachePixels[0]),
(romptr_t) &_fontjpnSegmentRomStart + ((codepoint * TMUL) * 0xc + TMUL * (24 * 0xc)),
(romptr_t) REF_SEG _fontjpnSegmentRomStart + ((codepoint * TMUL) * 0xc + TMUL * (24 * 0xc)),
TMUL * 0x0c);
return &g_JpnCharCachePixels[TMUL * freeindexsingle];
@@ -311,7 +311,7 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
g_JpnCacheCacheItems[freeindexsingle].ttl = 2;
g_JpnCacheCacheItems[freeindexsingle].codepoint = codepoint >> 1;
dmaExec(&g_JpnCharCachePixels[freeindexsingle * 8], (romptr_t) &_fontjpnsingleSegmentRomStart + (codepoint >> SHIFTAMOUNT) * 0x60, 0x60);
dmaExec(&g_JpnCharCachePixels[freeindexsingle * 8], (romptr_t) REF_SEG _fontjpnsingleSegmentRomStart + (codepoint >> SHIFTAMOUNT) * 0x60, 0x60);
return &g_JpnCharCachePixels[freeindexsingle * 8];
}
@@ -322,7 +322,7 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
g_JpnCacheCacheItems[freeindexmulti + 0].codepoint = codepoint >> 1;
g_JpnCacheCacheItems[freeindexmulti + 1].codepoint = codepoint >> 1;
dmaExec(&g_JpnCharCachePixels[freeindexmulti * 8], (romptr_t) &_fontjpnmultiSegmentRomStart + ((codepoint & 0x1fff) >> SHIFTAMOUNT) * 0x80, 0x80);
dmaExec(&g_JpnCharCachePixels[freeindexmulti * 8], (romptr_t) REF_SEG _fontjpnmultiSegmentRomStart + ((codepoint & 0x1fff) >> SHIFTAMOUNT) * 0x80, 0x80);
return &g_JpnCharCachePixels[freeindexmulti * 8];
}
+9
View File
@@ -7,6 +7,15 @@
u16 *g_FrameBuffers[NUM_FRAMEBUFFERS];
#ifndef PLATFORM_N64
#if VERSION >= VERSION_JPN_FINAL
u32 var8009d010pf[4];
s32 g_JpnMaxCacheItems;
#elif VERSION >= VERSION_PAL_BETA
u32 var8009d010pf[4];
#endif
#endif
void langInit(void)
{
s32 i;
+4 -4
View File
@@ -3011,7 +3011,7 @@ Gfx *dialogRender(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool l
textMeasure(&textheight, &textwidth, title, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0);
x = dialogleft - 1;
x = dialogleft - 2;
y = (dialogtop + dialogbottom) / 2 - textwidth - 3;
if (y < dialogtop) {
@@ -4624,11 +4624,11 @@ void menuProcessInput(void)
if (buttonsnow & BUTTON_RADIAL) {
inputs.select = 1;
}
// this will naturally feel nice w/ a switch layout
// with the default mapping for weapon-back
if (buttonsnow & BUTTON_WPNBACK) {
inputs.select = 1;
inputs.back = 1;
}
#endif
if (buttonsnow & B_BUTTON) {
inputs.back = 1;
+3
View File
@@ -39,6 +39,9 @@ s32 g_TexLutMode;
u32 var800ab5b4;
struct tilestate g_TexTileStates[8];
struct tilesize g_TexTileSizes[8];
#ifndef PLATFORM_N64
u32 g_TexFilter2D = G_TF_BILERP;
#endif
// Default
u16 g_SurfaceTypeDefaultSounds[] = { SFX_HIT_STONE_8087, SFX_HIT_STONE_8088 };
+3
View File
@@ -136,6 +136,9 @@ void texReset(void)
// reset backend texture cache
videoResetTextureCache();
// get backend texture settings
g_TexFilter2D = videoGetTextureFilter2D() ? G_TF_BILERP : G_TF_POINT;
#endif
g_TexWords = mempAlloc(ALIGN16(g_TexNumConfigs * 4), MEMPOOL_STAGE);
+11
View File
@@ -528,12 +528,23 @@ extern struct menudialogdef g_HtDetailsMenuDialog;
extern struct menudialogdef g_HtFailedMenuDialog;
extern struct menudialogdef g_HtCompletedMenuDialog;
extern struct menudialogdef g_HangarListMenuDialog;
#ifndef PLATFORM_N64
extern f32 g_PlayerCrosshairSway;
extern f32 g_PlayerDefaultFovY;
extern s32 g_PlayerMouseAimMode;
extern f32 g_PlayerMouseAimSpeedX;
extern f32 g_PlayerMouseAimSpeedY;
extern f32 g_ViShakeIntensityMult;
extern u32 g_TexFilter2D;
#define TEX_FILTER_2D g_TexFilter2D
#else
#define TEX_FILTER_2D G_TF_BILERP
#endif
#endif
+3
View File
@@ -10,6 +10,9 @@ extern struct menudialogdef g_AcceptMissionMenuDialog;
extern struct menudialogdef g_PreAndPostMissionBriefingMenuDialog;
extern struct menudialogdef g_RetryMissionMenuDialog;
extern struct menudialogdef g_NextMissionMenuDialog;
#ifndef PLATFORM_N64
extern struct menudialogdef g_ExitGameMenuDialog;
#endif
char *menuTextCurrentStageName(struct menuitem *item);
char *soloMenuTextDifficulty(struct menuitem *item);
+12
View File
@@ -14,6 +14,9 @@
#include "lib/mtx.h"
#include "data.h"
#include "types.h"
#ifndef PLATFORM_N64
#include "video.h"
#endif
#define TO_U16_A(x) ((u16)(x))
#define TO_U16_B(x) ((x) & 0xffff)
@@ -280,6 +283,10 @@ void viHandleRetrace(void)
osSetIntMask(prevmask);
#endif
#ifndef PLATFORM_N64
videoSetWindowOffset(0, offset);
#endif
osViSetMode(var8008dd60[1 - var8005ce74]);
osViBlack(g_ViUnblackTimer);
osViSetXScale(g_ViXScalesBySlot[1 - var8005ce74]);
@@ -460,8 +467,13 @@ void viShake(f32 intensity)
intensity = 0;
}
#ifdef PLATFORM_N64
g_ViShakeIntensity = intensity;
g_ViShakeTimer = 10;
#else
g_ViShakeIntensity = intensity * g_ViShakeIntensityMult;
g_ViShakeTimer = 20;
#endif
}
void viSetMode(s32 mode)
+1 -1
View File
@@ -7,7 +7,7 @@ import re
import sys
def main():
fd = open(sys.argv[1], 'r')
fd = open(sys.argv[1], 'r', encoding='UTF-8')
data = fd.read()
fd.close()