Script fixes, Type 1 cylinders fixed, rename `main` (#256)

* Fix actor_symbols.py

* Temporary fix to rename_sym.sh

* Fix the few Type1 cylinders

* Rename main -> Main

* chmod rename_global_asm, fix asm in rename_syms

* Format
This commit is contained in:
EllipticEllipsis 2021-08-09 04:01:51 +01:00 committed by GitHub
parent 36e6f8cb3d
commit 823281291b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 31 additions and 31 deletions

View File

@ -3329,7 +3329,7 @@ void func_80174AA0(ListAlloc* alloc);
// void func_80174AB4(void);
// void func_80174B20(void);
void func_80174BA0(ListAlloc* alloc);
void main(void* arg);
void Main(void* arg);
// u32 Padmgr_GetControllerBitmask(void);
// void func_80174F24(void);
// void func_80174F44(void);

View File

@ -70,7 +70,7 @@ void Main_ThreadEntry(void* arg) {
IrqMgr_Init(&gIrqMgr, &sIrqMgrStackInfo, Z_PRIORITY_IRQMGR, 1);
DmaMgr_Start();
Idle_InitCodeAndMemory();
main(arg);
Main(arg);
DmaMgr_Stop();
}

View File

@ -1,3 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/main/main.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/main/Main.s")

View File

@ -22,9 +22,9 @@ const ActorInit En_Akindonuts_InitVars = {
(ActorFunc)EnAkindonuts_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80BF02F0 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80BF02F0 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
{ 27, 32, 0, { 0, 0, 0 } },
};

View File

@ -22,23 +22,23 @@ const ActorInit En_Fz_InitVars = {
(ActorFunc)EnFz_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_809346F8 = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_809346F8 = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0xF7CFEFDD, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
{ 30, 80, 0, { 0, 0, 0 } },
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80934724 = {
{ COLTYPE_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80934724 = {
{ COLTYPE_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0x00001022, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
{ 35, 80, 0, { 0, 0, 0 } },
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80934750 = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80934750 = {
{ COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_NONE, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x20000000, 0x02, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, },
{ 20, 30, -15, { 0, 0, 0 } },
};

View File

@ -40,9 +40,9 @@ const ActorInit En_Gb2_InitVars = {
(ActorFunc)EnGb2_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80B11A40 = {
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80B11A40 = {
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
{ 40, 75, 0, { 0, 0, 0 } },
};

View File

@ -22,9 +22,9 @@ const ActorInit En_Ms_InitVars = {
(ActorFunc)EnMs_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80952BA0 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80952BA0 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
{ 22, 37, 0, { 0, 0, 0 } },
};

View File

@ -22,9 +22,9 @@ const ActorInit En_Scopenuts_InitVars = {
(ActorFunc)EnScopenuts_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80BCCB40 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80BCCB40 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
{ 27, 32, 0, { 0, 0, 0 } },
};

View File

@ -22,9 +22,9 @@ const ActorInit En_Sellnuts_InitVars = {
(ActorFunc)EnSellnuts_Draw,
};
// static ColliderCylinderInit sCylinderInit = {
static ColliderCylinderInit D_80ADD964 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_HIT_PLAYER, COLSHAPE_JNTSPH, },
// static ColliderCylinderInitType1 sCylinderInit = {
static ColliderCylinderInitType1 D_80ADD964 = {
{ COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
{ 27, 32, 0, { 0, 0, 0 } },
};

View File

@ -3163,7 +3163,7 @@
0x80174AB4:("func_80174AB4",),
0x80174B20:("func_80174B20",),
0x80174BA0:("func_80174BA0",),
0x80174BF0:("main",),
0x80174BF0:("Main",),
0x80174F10:("Padmgr_GetControllerBitmask",),
0x80174F24:("func_80174F24",),
0x80174F44:("func_80174F44",),

View File

@ -731,10 +731,10 @@ def resolve_symbol(address):
for entry in actor_tbl:
if address >= 0x80000000:
if entry[3] <= address < entry[4]:
return repo + "baserom/overlays" + os.sep + entry[0], address - entry[3]
return repo + "baserom" + os.sep + entry[0], address - entry[3]
else:
if entry[1] <= address < entry[2]:
return repo + "baserom/overlays" + os.sep + entry[0], address - entry[1]
return repo + "baserom" + os.sep + entry[0], address - entry[1]
else:
raise RuntimeError('Symbol not found in actor overlay table file ranges. Are you sure the file is an actor overlay?')

0
tools/rename_global_asm.py Normal file → Executable file
View File

View File

@ -10,4 +10,4 @@ fi
#echo "Replace $1 with $2?"
#read
grep -rl "$1" asm/**/*.asm src/**/*.{c,h} include/**/*.h tables/*.txt undef.txt | xargs sed -i "s/\b$1\b/$2/g"
grep -rl "$1" asm/**/*.s src/**/*.{c,h} include/**/*.h tools/disasm/functions.txt tools/disasm/variables.txt | xargs sed -i "s/\b$1\b/$2/g"