Merge pull request #138 from nanaian/worldpartners

match world partner table
This commit is contained in:
alex 2020-12-26 12:42:49 +00:00 committed by GitHub
commit 40ca6c9563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
144 changed files with 1392 additions and 874 deletions

2
.gitignore vendored
View File

@ -19,7 +19,9 @@ settings.mk
/build/
/docs/doxygen/
/include/ld_addrs.h
/include/message_ids.h
/include/sprite/
/include/map
# Assets
/bin

View File

@ -24,4 +24,7 @@
"python.analysis.extraPaths": [
"./tools"
],
"[c]": {
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?", // no $, for scripts
},
}

View File

@ -35,7 +35,7 @@ LD_MAP := $(BUILD_DIR)/$(TARGET).map
ASSETS_BIN := $(BUILD_DIR)/bin/assets/assets.bin
MSG_BIN := $(BUILD_DIR)/msg.bin
NPC_BIN := $(BUILD_DIR)/sprite/npc.bin
GENERATED_HEADERS := include/ld_addrs.h include/sprite
### Tools ###
@ -111,11 +111,15 @@ ifeq ($(WATCH_INCLUDES),1)
-include $(foreach obj, $(OBJECTS), $(obj).mk)
endif
NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc))
GENERATED_HEADERS := include/ld_addrs.h $(foreach dir, $(NPC_DIRS), include/$(dir).h)
### Targets ###
clean:
rm -rf $(BUILD_DIR) bin msg img sprite .splat_cache
rm -rf $(BUILD_DIR) bin msg img sprite .splat_cache $(LD_SCRIPT)
clean-code:
rm -rf $(BUILD_DIR)/src
@ -123,7 +127,7 @@ clean-code:
tools:
make -C tools
setup: clean submodules tools split $(LD_SCRIPT)
setup: clean submodules tools $(LD_SCRIPT)
# tools/star-rod submodule intentionally omitted
submodules:
@ -131,7 +135,7 @@ submodules:
git submodule update --recursive
split:
$(SPLAT) --modes ld bin Yay0 PaperMarioMapFS PaperMarioMessages img PaperMarioNpcSprites --new
make $(LD_SCRIPT) -W $(SPLAT_YAML)
split-%:
$(SPLAT) --modes ld $* --verbose
@ -242,7 +246,6 @@ $(MSG_BIN:.bin=.o): $(MSG_BIN)
# Sprites
$(foreach npc, $(NPC_SPRITES), $(eval $(BUILD_DIR)/sprite/npc/$(npc):: $(shell find sprite/npc/$(npc) -type f 2> /dev/null))) # dependencies
NPC_DIRS := $(foreach npc, $(NPC_SPRITES), sprite/npc/$(npc))
NPC_YAY0 := $(foreach npc, $(NPC_SPRITES), $(BUILD_DIR)/sprite/npc/$(npc).Yay0)
$(BUILD_DIR)/sprite/npc/%:: sprite/npc/% tools/compile_npc_sprite.py
@mkdir -p $(shell dirname $@)
@ -257,10 +260,13 @@ include/sprite/npc/%.h: sprite/npc/%/SpriteSheet.xml tools/gen_sprite_animations
@mkdir -p $(shell dirname $@)
@echo "building $@"
@$(PYTHON) tools/gen_sprite_animations_h.py $@ sprite/npc/$* $(NPC_DIRS)
include/sprite: $(foreach dir, $(NPC_DIRS), include/$(dir).h)
### Linker ###
$(LD_SCRIPT): $(SPLAT_YAML)
$(SPLAT) --modes ld
$(SPLAT) --modes ld bin Yay0 PaperMarioMapFS PaperMarioMessages img PaperMarioNpcSprites --new
make $(GENERATED_HEADERS)
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT)
@mkdir -p $(shell dirname $@)
@ -299,7 +305,7 @@ editor: tools/star-rod sprite/SpriteTable.xml
### Make Settings ###
.PHONY: clean tools test setup submodules split editor $(ROM) include/sprite
.PHONY: clean tools test setup submodules split editor $(ROM)
.DELETE_ON_ERROR:
.SECONDARY:
.PRECIOUS: $(ROM) %.Yay0

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800EA514
/* 839C4 800EA514 3C028011 */ lui $v0, %hi(D_8010EBB0)
/* 839C8 800EA518 8042EBB0 */ lb $v0, %lo(D_8010EBB0)($v0)
/* 839CC 800EA51C 03E00008 */ jr $ra
/* 839D0 800EA520 2C420001 */ sltiu $v0, $v0, 1

View File

@ -1,7 +1,7 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802BDBBC
glabel world_goombario_pre_battle
/* 317ADC 802BDBBC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 317AE0 802BDBC0 AFB10014 */ sw $s1, 0x14($sp)
/* 317AE4 802BDBC4 0080882D */ daddu $s1, $a0, $zero
@ -16,9 +16,9 @@ glabel func_802BDBBC
/* 317B08 802BDBE8 0C009C22 */ jal func_80027088
/* 317B0C 802BDBEC 0000202D */ daddu $a0, $zero, $zero
/* 317B10 802BDBF0 0C038069 */ jal enable_player_input
/* 317B14 802BDBF4 00000000 */ nop
/* 317B14 802BDBF4 00000000 */ nop
/* 317B18 802BDBF8 0C0B4312 */ jal CancelMessageAndBlock
/* 317B1C 802BDBFC 00000000 */ nop
/* 317B1C 802BDBFC 00000000 */ nop
/* 317B20 802BDC00 0C03BD17 */ jal clear_partner_move_history
/* 317B24 802BDC04 0220202D */ daddu $a0, $s1, $zero
/* 317B28 802BDC08 0220202D */ daddu $a0, $s1, $zero
@ -34,5 +34,5 @@ glabel func_802BDBBC
/* 317B4C 802BDC2C 8FB00010 */ lw $s0, 0x10($sp)
/* 317B50 802BDC30 03E00008 */ jr $ra
/* 317B54 802BDC34 27BD0020 */ addiu $sp, $sp, 0x20
/* 317B58 802BDC38 00000000 */ nop
/* 317B5C 802BDC3C 00000000 */ nop
/* 317B58 802BDC38 00000000 */ nop
/* 317B5C 802BDC3C 00000000 */ nop

View File

@ -11,20 +11,6 @@ typedef UNK_TYPE EncounterTriggerFlags;
#define EncounterTriggerFlags_HAMMER 0x00000004
#define EncounterTriggerFlags_PARTNER 0x00000006
typedef s8 PartnerId;
#define PartnerId_NONE 0x00
#define PartnerId_GOOMBARIO 0x01
#define PartnerId_KOOPER 0x02
#define PartnerId_BOMBETTE 0x03
#define PartnerId_PARAKARRY 0x04
#define PartnerId_GOOMPA 0x05
#define PartnerId_WATT 0x06
#define PartnerId_SUSHIE 0x07
#define PartnerId_LAKILESTER 0x08
#define PartnerId_BOW 0x09
#define PartnerId_GOOMBARIA 0x0A
#define PartnerId_TWINK 0x0B
typedef s32 SongID;
#define Song_TOAD_TOWN 0x00000000
#define Song_NORMAL_BATTLE 0x00000002

View File

@ -5,7 +5,7 @@
typedef s32 MessageID;
#define MESSAGE_ID(section, index) ((section << 0x10) + index)
#define MESSAGE_ID(section, index) (((section << 0x10) + index))
#define MessageID_TATTLE_KMR_03 MESSAGE_ID(0x19, 0x3B)
#define MessageID_TATTLE_KMR_12 MESSAGE_ID(0x19, 0x40)

View File

@ -99,17 +99,17 @@ typedef enum ScriptOpcode {
ScriptOpcode_DEBUG_PRINT = 0x5B, ///< Args: expression
} ScriptOpcode;
#define SI_VAR(v) (v - 30000000)
#define SI_MAP_VAR(v) (v - 50000000)
#define SI_FLAG(v) (v - 70000000)
#define SI_MAP_FLAG(v) (v - 90000000)
#define SI_AREA_FLAG(v) (v - 110000000)
#define SI_SAVE_FLAG(v) (v - 130000000)
#define SI_AREA_VAR(v) (v - 150000000)
#define SI_SAVE_VAR(v) (v - 170000000)
#define SI_ARRAY(v) (v - 190000000)
#define SI_ARRAY_FLAG(v) (v - 210000000)
#define SI_FIXED(v) ((v * 1024.0f) + -230000000) // See float_to_fixed_var
#define SI_VAR(v) ((v - 30000000))
#define SI_MAP_VAR(v) ((v - 50000000))
#define SI_FLAG(v) ((v - 70000000))
#define SI_MAP_FLAG(v) ((v - 90000000))
#define SI_AREA_FLAG(v) ((v - 110000000))
#define SI_SAVE_FLAG(v) ((v - 130000000))
#define SI_AREA_VAR(v) ((v - 150000000))
#define SI_SAVE_VAR(v) ((v - 170000000))
#define SI_ARRAY(v) ((v - 190000000))
#define SI_ARRAY_FLAG(v) ((v - 210000000))
#define SI_FIXED(v) (((v * 1024.0f) + -230000000)) // See float_to_fixed_var
/* Return type of si_execute_next_command */
#define SI_CONTINUE 0 /* Continue to next command */

View File

@ -11,9 +11,9 @@
#define UNK_ARGS
typedef s32 FormationID;
#define FORMATION_ID(section, stage, index) ((section << 16) + (stage << 8) + index)
#define FORMATION_ID(section, stage, index) (((section << 16) + (stage << 8) + index))
typedef s32 NpcAnimID;
#define NPC_ANIM(sprite, palette, anim) ((_NPC_SPRITE_##sprite << 16) + (_NPC_PALETTE_##sprite##_##palette << 8) + _NPC_ANIM_##sprite##_##anim)
#define NPC_ANIM(sprite, palette, anim) (((_NPC_SPRITE_##sprite << 16) + (_NPC_PALETTE_##sprite##_##palette << 8) + _NPC_ANIM_##sprite##_##anim))
#endif

View File

@ -1,4 +1,4 @@
OBJECTS := $(subst BUILD_DIR, $(BUILD_DIR), $(shell grep -E 'BUILD_DIR.+\.o' papermario.ld -o))
OBJECTS = $(subst BUILD_DIR, $(BUILD_DIR), $(shell grep -E 'BUILD_DIR.+\.o' papermario.ld -o))
DSL_C_FILES := $(shell grep -lrF "SCRIPT" src)
@ -58,7 +58,7 @@ ASSETS := \
MESSAGES := $(shell find msg -type f -name "*.msg" 2> /dev/null)
NPC_SPRITES := world_goombario world_kooper world_bombette world_parakarry world_bow world_watt world_sushi world_lakilester battle_goombario battle_kooper battle_bombette battle_parakarry battle_bow battle_watt battle_sushi battle_lakilester kooper_without_shell world_eldstar world_mamar world_skolar world_muskular world_misstar world_klevar world_kalmar battle_eldstar battle_mamar battle_skolar battle_muskular battle_misstar battle_klevar battle_kalmar twink jr_troopa spiked_jr_troopa spiked_para_jr_troopa mage_jr_troopa para_jr_troopa goomba spiked_goomba paragoomba koopa_troopa para_troopa fuzzy bob_omb bullet_bill bill_blaster monty_mole cleft pokey battle_bandit buzzy_beetle swooper stone_chomp putrid_piranha piranha_plant sentinel world_clubba battle_clubba shy_guy groove_guy sky_guy pyro_guy spy_guy medi_guy fuzzipede jungle_guy heart_plant hurt_plant m_bush bubble kent_c_koopa dayzee lakitu spiny bzzap ruff_puff spike_top duplighost albino_dino blooper baby_blooper gulpit dry_bones thrown_bone bony_beetle magikoopa flying_magikoopa world_koopatrol koopatrol hammer_bros bush_basic bush_blocky bush_dry bush_leafy bush_matted world_kammy battle_kammy goomba_bros goomba_king spiky_goomnut dark_toad koopa_bros buzzar tutankoopa chain_chomp world_tubba battle_tubba tubbas_heart big_lantern_ghost shy_squad_guy marshal_guy stilt_guy stilt_guy_unfold shy_stack_guy shy_stack_unfold shy_stack_damage shy_stack_rock general_guy general_guy_bomb tank_guy lava_piranha_head petit_piranha lava_bud huff_n_puff tuff_puff monstar crystal_king world_bowser battle_bowser luigi toad three_sisters vanna_t toad_kid toad_guard harry_t toad_minister postmaster conductor_toad train_station_toad fishmael artist_toad koopa koopa_without_shell world_bob_omb whacka dryite mouser boo yoshi yoshi_kid raven bubulb penguin shiver_toad world_bandit goompapa goombaria goomama goompa goomma the_master chan lee merlon chet_rippo rowf minh_t russ_t tayce_t fice_t bartender chanterelle rip_cheato chuck_quizmo merluvlee merlar merlow star_kid kolorado_wife koopa_koot kolorado battle_kolorado archeologist nomadimouse world_merlee battle_merlee disguised_moustafa moustafa oaklie bootler yakkey gourmet_guy village_leader leaders_friend rafael_raven tolielup gate_flower petunia posie lily rosie sun lakilulu ninji mayor_penguin mayor_penguin_wife penguin_patrol herringway merle star_rod fire coin parade_peach parade_koopas parade_burnt_bowser parade_luigi parade_partners parade_yoshis parade_kolorados parade_chicks parade_ice_show parade_toads parade_batons parade_drums parade_flags parade_horns parade_tubba_balloon parade_wizards parade_mario parade_shy_guys parade_twink leaf
NPC_SPRITES := world_goombario world_kooper world_bombette world_parakarry world_bow world_watt world_sushie world_lakilester battle_goombario battle_kooper battle_bombette battle_parakarry battle_bow battle_watt battle_sushie battle_lakilester kooper_without_shell world_eldstar world_mamar world_skolar world_muskular world_misstar world_klevar world_kalmar battle_eldstar battle_mamar battle_skolar battle_muskular battle_misstar battle_klevar battle_kalmar twink jr_troopa spiked_jr_troopa spiked_para_jr_troopa mage_jr_troopa para_jr_troopa goomba spiked_goomba paragoomba koopa_troopa para_troopa fuzzy bob_omb bullet_bill bill_blaster monty_mole cleft pokey battle_bandit buzzy_beetle swooper stone_chomp putrid_piranha piranha_plant sentinel world_clubba battle_clubba shy_guy groove_guy sky_guy pyro_guy spy_guy medi_guy fuzzipede jungle_guy heart_plant hurt_plant m_bush bubble kent_c_koopa dayzee lakitu spiny bzzap ruff_puff spike_top duplighost albino_dino blooper baby_blooper gulpit dry_bones thrown_bone bony_beetle magikoopa flying_magikoopa world_koopatrol koopatrol hammer_bros bush_basic bush_blocky bush_dry bush_leafy bush_matted world_kammy battle_kammy goomba_bros goomba_king spiky_goomnut dark_toad koopa_bros buzzar tutankoopa chain_chomp world_tubba battle_tubba tubbas_heart big_lantern_ghost shy_squad_guy marshal_guy stilt_guy stilt_guy_unfold shy_stack_guy shy_stack_unfold shy_stack_damage shy_stack_rock general_guy general_guy_bomb tank_guy lava_piranha_head petit_piranha lava_bud huff_n_puff tuff_puff monstar crystal_king world_bowser battle_bowser luigi toad three_sisters vanna_t toad_kid toad_guard harry_t toad_minister postmaster conductor_toad train_station_toad fishmael artist_toad koopa koopa_without_shell world_bob_omb whacka dryite mouser boo yoshi yoshi_kid raven bubulb penguin shiver_toad world_bandit goompa goombaria gooma goompapa goomama the_master chan lee merlon chet_rippo rowf minh_t russ_t tayce_t fice_t bartender chanterelle rip_cheato chuck_quizmo merluvlee merlar merlow star_kid kolorado_wife koopa_koot kolorado battle_kolorado archeologist nomadimouse world_merlee battle_merlee disguised_moustafa moustafa oaklie bootler yakkey gourmet_guy village_leader leaders_friend rafael_raven tolielup gate_flower petunia posie lily rosie sun lakilulu ninji mayor_penguin mayor_penguin_wife penguin_patrol herringway merle star_rod fire coin parade_peach parade_koopas parade_burnt_bowser parade_luigi parade_partners parade_yoshis parade_kolorados parade_chicks parade_ice_show parade_toads parade_batons parade_drums parade_flags parade_horns parade_tubba_balloon parade_wizards parade_mario parade_shy_guys parade_twink leaf
# Image settings
$(BUILD_DIR)/img/battle/text_action_command_ratings.ia4.png: IMG_FLAGS = --flip-y

View File

@ -1,59 +0,0 @@
#include "common.h"
s32 func_802BD100(s32 arg0) {
s32 i;
for (i = 0; i < 0x40; i++) {
Trigger* trigger = get_trigger_by_id(i);
if (trigger != NULL && trigger->flags.flags & 0x100 && trigger->params2 == arg0) {
return trigger->unk_2C;
}
}
return 0;
}
void func_802BD174(Npc* npc) {
npc->collisionHeight = 24;
npc->collisionRadius = 20;
}
INCLUDE_ASM(s32, "code_317020", func_802BD188);
INCLUDE_ASM(s32, "code_317020", func_802BD1D0);
INCLUDE_ASM(s32, "code_317020", func_802BD564);
INCLUDE_ASM(s32, "code_317020", func_802BD5A8);
INCLUDE_ASM(s32, "code_317020", func_802BD5D8);
INCLUDE_ASM(s32, "code_317020", func_802BDB30);
ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall) {
s32 unk = script->owner2.npc; // todo what is this?
if (isInitialCall) {
func_800EE994(unk);
}
return func_800EE9B8(unk) != 0;
}
// Something is up with D_8010EBB0 I think. It might be a struct or something
#ifdef NON_MATCHING
void func_802BDBBC(s32 arg0) {
if (D_8010EBB0[0] != 0) {
func_80027088(0);
enable_player_input();
CancelMessageAndBlock();
clear_partner_move_history(arg0);
D_8010EBB0[0] = 0;
D_8010EBB0[3] = 0;
disable_npc_blur(arg0);
}
D_8010EBB0[3] = 1;
}
#else
INCLUDE_ASM(s32, "code_317020", func_802BDBBC);
#endif

View File

@ -1,25 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "code_31B120", func_802BD100_31B120);
INCLUDE_ASM(s32, "code_31B120", func_802BD144);
INCLUDE_ASM(s32, "code_31B120", func_802BD17C);
INCLUDE_ASM(s32, "code_31B120", func_802BD200);
INCLUDE_ASM(s32, "code_31B120", func_802BD228);
INCLUDE_ASM(s32, "code_31B120", func_802BD260);
INCLUDE_ASM(s32, "code_31B120", func_802BD5F4);
INCLUDE_ASM(s32, "code_31B120", func_802BD638);
INCLUDE_ASM(s32, "code_31B120", func_802BE7E0);
INCLUDE_ASM(s32, "code_31B120", func_802BE818);
INCLUDE_ASM(s32, "code_31B120", func_802BEA24);
INCLUDE_ASM(s32, "code_31B120", func_802BEB10);

View File

@ -1,29 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "code_31CC70", func_802BD100_31CC70);
INCLUDE_ASM(s32, "code_31CC70", func_802BD180_31CC70);
INCLUDE_ASM(s32, "code_31CC70", func_802BD1AC);
INCLUDE_ASM(s32, "code_31CC70", func_802BD23C);
INCLUDE_ASM(s32, "code_31CC70", func_802BD27C);
INCLUDE_ASM(s32, "code_31CC70", func_802BD2B4);
INCLUDE_ASM(s32, "code_31CC70", func_802BD710);
INCLUDE_ASM(s32, "code_31CC70", func_802BD754);
INCLUDE_ASM(s32, "code_31CC70", func_802BDD0C);
INCLUDE_ASM(s32, "code_31CC70", func_802BDD9C);
INCLUDE_ASM(s32, "code_31CC70", func_802BDE10);
INCLUDE_ASM(s32, "code_31CC70", func_802BDE88);
INCLUDE_ASM(s32, "code_31CC70", func_802BE014);
INCLUDE_ASM(s32, "code_31CC70", func_802BE070);

Some files were not shown because too many files have changed in this diff Show More