From ea6c7d60e1dd40af58f7ae1cbeeaccb741b4f809 Mon Sep 17 00:00:00 2001 From: CrashOveride95 Date: Sun, 28 Mar 2021 20:54:54 -0400 Subject: [PATCH] Add goddard as togglable and stop linking segments seperately --- Makefile | 48 +- Makefile.split | 1 + asm/entry.s | 38 +- include/level_commands.h | 5 + include/segment_symbols.h | 4 +- include/segments.h | 2 +- levels/intro/geo.c | 10 + levels/intro/script.c | 6 + sm64.ld | 136 +- src/engine/level_script.c | 13 + src/game/mario_misc.c | 24 + src/game/mario_misc.h | 3 + src/goddard/bad_declarations.h | 40 + src/goddard/debug_utils.c | 954 ++++ src/goddard/debug_utils.h | 93 + src/goddard/draw_objects.c | 1542 +++++++ src/goddard/draw_objects.h | 52 + src/goddard/dynlist_proc.c | 3140 +++++++++++++ src/goddard/dynlist_proc.h | 99 + src/goddard/dynlists/anim_group_1.c | 2328 ++++++++++ src/goddard/dynlists/anim_group_2.c | 2914 ++++++++++++ src/goddard/dynlists/anim_mario_eyebrows_1.c | 215 + src/goddard/dynlists/anim_mario_lips_1.c | 256 ++ src/goddard/dynlists/anim_mario_lips_2.c | 264 ++ .../dynlists/anim_mario_mustache_left.c | 264 ++ .../dynlists/anim_mario_mustache_right.c | 215 + src/goddard/dynlists/animdata.h | 33 + src/goddard/dynlists/dynlist_macros.h | 402 ++ src/goddard/dynlists/dynlist_mario_face.c | 406 ++ src/goddard/dynlists/dynlist_mario_master.c | 1123 +++++ src/goddard/dynlists/dynlist_test_cube.c | 82 + src/goddard/dynlists/dynlist_unused.c | 75 + src/goddard/dynlists/dynlists.h | 148 + .../dynlists_mario_eyebrows_mustache.c | 170 + src/goddard/dynlists/dynlists_mario_eyes.c | 160 + src/goddard/gd_macros.h | 17 + src/goddard/gd_main.c | 61 + src/goddard/gd_main.h | 88 + src/goddard/gd_math.c | 966 ++++ src/goddard/gd_math.h | 56 + src/goddard/gd_memory.c | 314 ++ src/goddard/gd_memory.h | 35 + src/goddard/gd_types.h | 656 +++ src/goddard/joints.c | 1172 +++++ src/goddard/joints.h | 31 + src/goddard/objects.c | 2098 +++++++++ src/goddard/objects.h | 105 + src/goddard/old_menu.c | 254 ++ src/goddard/old_menu.h | 19 + src/goddard/particles.c | 526 +++ src/goddard/particles.h | 13 + src/goddard/renderer.c | 3933 +++++++++++++++++ src/goddard/renderer.h | 126 + src/goddard/sfx.c | 38 + src/goddard/sfx.h | 25 + src/goddard/shape_helper.c | 1538 +++++++ src/goddard/shape_helper.h | 33 + src/goddard/skin.c | 528 +++ src/goddard/skin.h | 20 + src/goddard/skin_movement.c | 158 + src/goddard/skin_movement.h | 11 + 61 files changed, 28019 insertions(+), 67 deletions(-) create mode 100644 src/goddard/bad_declarations.h create mode 100644 src/goddard/debug_utils.c create mode 100644 src/goddard/debug_utils.h create mode 100644 src/goddard/draw_objects.c create mode 100644 src/goddard/draw_objects.h create mode 100644 src/goddard/dynlist_proc.c create mode 100644 src/goddard/dynlist_proc.h create mode 100644 src/goddard/dynlists/anim_group_1.c create mode 100644 src/goddard/dynlists/anim_group_2.c create mode 100644 src/goddard/dynlists/anim_mario_eyebrows_1.c create mode 100644 src/goddard/dynlists/anim_mario_lips_1.c create mode 100644 src/goddard/dynlists/anim_mario_lips_2.c create mode 100644 src/goddard/dynlists/anim_mario_mustache_left.c create mode 100644 src/goddard/dynlists/anim_mario_mustache_right.c create mode 100644 src/goddard/dynlists/animdata.h create mode 100644 src/goddard/dynlists/dynlist_macros.h create mode 100644 src/goddard/dynlists/dynlist_mario_face.c create mode 100644 src/goddard/dynlists/dynlist_mario_master.c create mode 100644 src/goddard/dynlists/dynlist_test_cube.c create mode 100644 src/goddard/dynlists/dynlist_unused.c create mode 100644 src/goddard/dynlists/dynlists.h create mode 100644 src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c create mode 100644 src/goddard/dynlists/dynlists_mario_eyes.c create mode 100644 src/goddard/gd_macros.h create mode 100644 src/goddard/gd_main.c create mode 100644 src/goddard/gd_main.h create mode 100644 src/goddard/gd_math.c create mode 100644 src/goddard/gd_math.h create mode 100644 src/goddard/gd_memory.c create mode 100644 src/goddard/gd_memory.h create mode 100644 src/goddard/gd_types.h create mode 100644 src/goddard/joints.c create mode 100644 src/goddard/joints.h create mode 100644 src/goddard/objects.c create mode 100644 src/goddard/objects.h create mode 100644 src/goddard/old_menu.c create mode 100644 src/goddard/old_menu.h create mode 100644 src/goddard/particles.c create mode 100644 src/goddard/particles.h create mode 100644 src/goddard/renderer.c create mode 100644 src/goddard/renderer.h create mode 100644 src/goddard/sfx.c create mode 100644 src/goddard/sfx.h create mode 100644 src/goddard/shape_helper.c create mode 100644 src/goddard/shape_helper.h create mode 100644 src/goddard/skin.c create mode 100644 src/goddard/skin.h create mode 100644 src/goddard/skin_movement.c create mode 100644 src/goddard/skin_movement.h diff --git a/Makefile b/Makefile index 3cd4a984..4c4a4d82 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,6 @@ default: all DEFINES := SRC_DIRS := -MAINSEG_SRC_DIRS := #==============================================================================# # Build Options # @@ -173,10 +172,9 @@ endif # 0 - does not UNF ?= 0 $(eval $(call validate-option,UNF,0 1)) - ifeq ($(UNF),1) DEFINES += UNF=1 - MAINSEG_SRC_DIRS += src/usb + SRC_DIRS += src/usb endif # HVQM - whether to use HVQM fmv library @@ -186,7 +184,16 @@ HVQM ?= 0 $(eval $(call validate-option,HVQM,0 1)) ifeq ($(HVQM),1) DEFINES += HVQM=1 - MAINSEG_SRC_DIRS += src/hvqm + SRC_DIRS += src/hvqm +endif + +# GODDARD - whether to use libgoddard (Mario Head) +# 1 - includes code in ROM +# 0 - does not +GODDARD ?= 0 +$(eval $(call validate-option,GODDARD,0 1)) +ifeq ($(GODDARD),1) + DEFINES += GODDARD=1 endif # Whether to hide commands or not @@ -272,10 +279,9 @@ ACTOR_DIR := actors LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h))) # Directories containing source files -SRC_DIRS += src src/audio src/menu src/buffers actors levels bin data assets asm lib sound -MAINSEG_SRC_DIRS += src/game -ENGINE_SRC_DIRS := src/engine +SRC_DIRS += src src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound LIBZ_SRC_DIRS := src/libz +GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists BIN_DIRS := bin bin/$(VERSION) # File dependencies and variables for specific files @@ -284,10 +290,8 @@ include Makefile.split # Source code files LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c) C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES) -MAINSEG_C_FILES := $(foreach dir,$(MAINSEG_SRC_DIRS),$(wildcard $(dir)/*.c)) -MAINSEG_S_FILES := $(foreach dir,$(MAINSEG_SRC_DIRS),$(wildcard $(dir)/*.s)) -ENGINE_C_FILES := $(foreach dir,$(ENGINE_SRC_DIRS),$(wildcard $(dir)/*.c)) LIBZ_C_FILES := $(foreach dir,$(LIBZ_SRC_DIRS),$(wildcard $(dir)/*.c)) +GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c)) S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s)) GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c @@ -311,12 +315,11 @@ O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \ $(foreach file,$(GENERATED_C_FILES),$(file:.c=.o)) \ lib/PR/hvqm/hvqm2sp1.o lib/PR/hvqm/hvqm2sp2.o -MAINSEG_O_FILES := $(foreach file,$(MAINSEG_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) $(foreach file,$(MAINSEG_S_FILES),$(BUILD_DIR)/$(file:.s=.o)) -ENGINE_O_FILES := $(foreach file,$(ENGINE_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) LIBZ_O_FILES := $(foreach file,$(LIBZ_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) +GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o)) # Automatic dependency files -DEP_FILES := $(O_FILES:.o=.d) $(MAINSEG_O_FILES:.o=.d) $(ENGINE_O_FILES:.o=.d) $(LIBZ_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d +DEP_FILES := $(O_FILES:.o=.d) $(LIBZ_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d #==============================================================================# # Compiler Options # @@ -510,7 +513,7 @@ $(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wn $(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0 $(BUILD_DIR)/src/usb/debug.o: CFLAGS += -Wno-unused-parameter -Wno-maybe-uninitialized -ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(MAINSEG_SRC_DIRS) $(GODDARD_SRC_DIRS) $(ENGINE_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION) +ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(GODDARD_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION) # Make sure build directory exists before compiling anything DUMMY != mkdir -p $(ALL_DIRS) @@ -704,15 +707,10 @@ $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(call print,Preprocessing linker script:,$<,$@) $(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $< -# Link mainseg -$(BUILD_DIR)/mainseg.o: $(MAINSEG_O_FILES) $(BUILD_DIR)/libz.a - @$(PRINT) "$(GREEN)Linking main segment: $(BLUE)$@ $(NO_COL)\n" - $(V)$(LD) -o $@ -r $(MAINSEG_O_FILES) -L $(BUILD_DIR) -L$(LIBS_DIR) -Llib -lgcc -lnustd -lhvqm2 -lz - -# Link engine -$(BUILD_DIR)/engineseg.o: $(ENGINE_O_FILES) - @$(PRINT) "$(GREEN)Linking engine segment: $(BLUE)$@ $(NO_COL)\n" - $(V)$(LD) -o $@ -r $(ENGINE_O_FILES) +# Link libgoddard +$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES) + @$(PRINT) "$(GREEN)Linking libgoddard: $(BLUE)$@ $(NO_COL)\n" + $(V)$(AR) rcs -o $@ $(GODDARD_O_FILES) # Link libz $(BUILD_DIR)/libz.a: $(LIBZ_O_FILES) @@ -720,9 +718,9 @@ $(BUILD_DIR)/libz.a: $(LIBZ_O_FILES) $(V)$(AR) rcs -o $@ $(LIBZ_O_FILES) # Link SM64 ELF file -$(ELF): $(BUILD_DIR)/mainseg.o $(BUILD_DIR)/engineseg.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt +$(ELF): $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a @$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n" - $(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(BUILD_DIR)/src/audio -L$(LIBS_DIR) -lultra_rom + $(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -lultra_rom -Llib -lgcc -lnustd -lhvqm2 -lz -lgoddard -u sprintf -u osMapTLB # Build ROM $(ROM): $(ELF) diff --git a/Makefile.split b/Makefile.split index 3b5aaf49..230cd3dc 100644 --- a/Makefile.split +++ b/Makefile.split @@ -261,6 +261,7 @@ $(BUILD_DIR)/bin/%_skybox.elf: SEGMENT_ADDRESS := 0x0A000000 # intro and ipl3 textures are not compressed INTRO_RAW_FILES := $(wildcard $(TEXTURE_DIR)/intro_raw/*.png) +$(BUILD_DIR)/src/goddard/renderer.o: $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(INTRO_RAW_FILES))) IPL3_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/ipl3_raw/*.png) IPL3_RAW_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%,$(IPL3_TEXTURE_FILES))) diff --git a/asm/entry.s b/asm/entry.s index 755e1b4b..1f407aaf 100644 --- a/asm/entry.s +++ b/asm/entry.s @@ -9,24 +9,20 @@ .section .text, "ax" glabel entry_point - lui $t0, %hi(_mainSegmentNoloadStart) # $t0, 0x8034 - lui $t1, %lo(_mainSegmentNoloadSizeHi) # lui $t1, 2 - addiu $t0, %lo(_mainSegmentNoloadStart) # addiu $t0, $t0, -0x6df0 - ori $t1, %lo(_mainSegmentNoloadSizeLo) # ori $t1, $t1, 0xcee0 -.L80246010: - addi $t1, $t1, -8 - sw $zero, ($t0) - sw $zero, 4($t0) - bnez $t1, .L80246010 - addi $t0, $t0, 8 - lui $t2, %hi(main_func) # $t2, 0x8024 - lui $sp, %hi(gIdleThreadStack) # $sp, 0x8020 - addiu $t2, %lo(main_func) # addiu $t2, $t2, 0x6dc4 - jr $t2 - addiu $sp, %lo(gIdleThreadStack) # addiu $sp, $sp, 0xa00 - nop - nop - nop - nop - nop - nop + +entry_point: + lui $t0, %hi(_mainSegmentBssStart) + lui $t1, %hi(_mainSegmentBssSize) + addiu $t0, %lo(_mainSegmentBssStart) + addiu $t1, %lo(_mainSegmentBssSize) +.clear_bytes: + addi $t1, $t1, -8 # Subtract 8 bytes from the amount remaining + sw $zero, ($t0) # Clear 4 bytes + sw $zero, 4($t0) # Clear the next 4 bytes + bnez $t1, .clear_bytes # Continue clearing until clear_bytes is 0 + addi $t0, $t0, 8 # Increment the address of bytes to clear + lui $t2, %hi(main_func) # Get the high half of the init function address + lui $sp, %hi(gIdleThreadStack) # Set the high half of the stack pointer to that of the idle thread stack + addiu $t2, %lo(main_func) # Get the low half of the init function address + jr $t2 # Jump to the init function + addiu $sp, %lo(gIdleThreadStack) # Set the low half of the stack pointer to that of the idle thread stack \ No newline at end of file diff --git a/include/level_commands.h b/include/level_commands.h index 032419d1..a010644c 100644 --- a/include/level_commands.h +++ b/include/level_commands.h @@ -169,8 +169,13 @@ CMD_PTR(romEnd) #endif +#ifdef GODDARD +#define LOAD_MARIO_HEAD(sethead) \ + CMD_BBH(0x19, 0x04, sethead) +#else #define LOAD_MARIO_HEAD() \ CMD_BBH(0x32, 0x04, 0x0000) +#endif #ifdef NO_SEGMENTED_MEMORY #define LOAD_YAY0_TEXTURE(seg, romStart, romEnd) \ diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 42cf2c41..af217a75 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -43,9 +43,9 @@ DECLARE_SEGMENT(goddard) DECLARE_SEGMENT(framebuffers) extern u8 _goddardSegmentStart[]; extern u8 _engineSegmentStart[]; -extern u8 _engineSegmentNoloadEnd[]; +extern u8 _engineSegmentBssEnd[]; extern u8 _engineSegmentEnd[]; -extern u8 _framebuffersSegmentNoloadEnd[]; +extern u8 _framebuffersSegmentBssEnd[]; DECLARE_LEVEL_SEGMENT(menu) DECLARE_LEVEL_SEGMENT(intro) diff --git a/include/segments.h b/include/segments.h index f4436675..d354f203 100644 --- a/include/segments.h +++ b/include/segments.h @@ -25,7 +25,7 @@ * importing large custom content. */ -#define SEG_POOL_START _framebuffersSegmentNoloadEnd // 0x0165000 in size +#define SEG_POOL_START _framebuffersSegmentBssEnd // 0x0165000 in size #define SEG_GODDARD SEG_POOL_START + 0x113000 #define POOL_SIZE RAM_END - SEG_POOL_START diff --git a/levels/intro/geo.c b/levels/intro/geo.c index 033f2b58..a04ac3f5 100644 --- a/levels/intro/geo.c +++ b/levels/intro/geo.c @@ -61,6 +61,11 @@ const GeoLayout intro_geo_mario_head_regular[] = { GEO_ZBUFFER(1), GEO_OPEN_NODE(), GEO_CAMERA_FRUSTUM(45, 128, 16384), +#ifdef GODDARD + GEO_OPEN_NODE(), + GEO_ASM(2, geo_draw_mario_head_goddard), + GEO_CLOSE_NODE(), +#endif GEO_CLOSE_NODE(), #ifdef VERSION_SH GEO_ZBUFFER(0), @@ -89,6 +94,11 @@ const GeoLayout intro_geo_mario_head_dizzy[] = { GEO_ZBUFFER(1), GEO_OPEN_NODE(), GEO_CAMERA_FRUSTUM(45, 128, 16384), +#ifdef GODDARD + GEO_OPEN_NODE(), + GEO_ASM(3, geo_draw_mario_head_goddard), + GEO_CLOSE_NODE(), +#endif GEO_CLOSE_NODE(), #ifdef VERSION_SH GEO_ZBUFFER(0), diff --git a/levels/intro/script.c b/levels/intro/script.c index 1dcf1575..59978a0c 100644 --- a/levels/intro/script.c +++ b/levels/intro/script.c @@ -47,6 +47,9 @@ const LevelScript level_intro_mario_head_regular[] = { INIT_LEVEL(), BLACKOUT(/*active*/ TRUE), FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), +#ifdef GODDARD + LOAD_MARIO_HEAD(/*loadHeadID*/ REGULAR_FACE), +#endif LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd), LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd), @@ -71,6 +74,9 @@ const LevelScript level_intro_mario_head_dizzy[] = { INIT_LEVEL(), BLACKOUT(/*active*/ TRUE), FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd), +#ifdef GODDARD + LOAD_MARIO_HEAD(/*loadHeadID*/ DIZZY_FACE), +#endif LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd), LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd), ALLOC_LEVEL_POOL(), diff --git a/sm64.ld b/sm64.ld index 41ec1a3b..e65c7c49 100755 --- a/sm64.ld +++ b/sm64.ld @@ -15,11 +15,12 @@ OUTPUT_ARCH (mips) __romPos += SIZEOF(.name); #define BEGIN_NOLOAD(name) \ - _##name##SegmentNoloadStart = ADDR(.name.noload); \ + _##name##SegmentBssStart = ADDR(.name.noload); \ .name.noload (NOLOAD) : #define END_NOLOAD(name) \ - _##name##SegmentNoloadEnd = ADDR(.name.noload) + SIZEOF(.name.noload); + _##name##SegmentBssEnd = ADDR(.name.noload) + SIZEOF(.name.noload); \ + _##name##SegmentBssSize = SIZEOF(.name.noload); #define YAY0_SEG(name, segAddr) \ BEGIN_SEG(name##_yay0, segAddr) \ @@ -82,7 +83,7 @@ SECTIONS } END_NOLOAD(zbuffer) - . = _zbufferSegmentNoloadEnd; + . = _zbufferSegmentBssEnd; BEGIN_NOLOAD(buffers) { BUILD_DIR/src/buffers/buffers.o(.bss*); @@ -97,7 +98,7 @@ SECTIONS } END_NOLOAD(buffers) - . = _buffersSegmentNoloadEnd; + . = _buffersSegmentBssEnd; #ifdef HVQM BEGIN_NOLOAD(hvqmwork) @@ -116,24 +117,47 @@ SECTIONS } END_NOLOAD(hvqbuf) - . = _hvqbufSegmentNoloadEnd; + . = _hvqbufSegmentBssEnd; #endif BEGIN_SEG(main, .) SUBALIGN(16) { BUILD_DIR/asm/entry.o(.text); - BUILD_DIR/mainseg.o(.text); + BUILD_DIR/src/game*.o(.text); +#ifdef HVQM + BUILD_DIR/src/hvqm*.o(.text); +#endif +#ifdef UNF + BUILD_DIR/src/usb*.o(.text); +#endif BUILD_DIR/src/audio*.o(.text); */libultra_rom.a:*.o(.text); + */libnustd.a:*.o(.text); + */libgcc.a:*.o(.text); +#ifdef GZIP + */libz.a:*.o(.text); +#endif +#ifdef HVQM + */libhvqm2.a:*.o(.text); +#endif BUILD_DIR/lib/rsp.o(.text); lib/PR/hvqm/hvqm2sp1.o(.text); /* data */ - BUILD_DIR/mainseg.o(.*data*); + BUILD_DIR/src/game*.o(.*data*); +#ifdef UNF + BUILD_DIR/src/usb*.o(.*data*); +#endif BUILD_DIR/src/audio*.o(.*data*); +#ifdef GZIP + */libz.a:*.o(.*data*); +#endif */libultra_rom.a:*.o(.*data*); +#ifdef HVQM + */libhvqm2.a:*.o(.*data*); +#endif BUILD_DIR/lib/rsp.o(.data*); #ifdef HVQM @@ -141,9 +165,16 @@ SECTIONS #endif /* rodata */ - BUILD_DIR/mainseg.o(.rodata*); + BUILD_DIR/src/game*.o(.rodata*); +#ifdef UNF + BUILD_DIR/src/usb*.o(.rodata*); +#endif BUILD_DIR/src/audio*.o(.rodata*); */libultra_rom.a:*.o(.rodata*); + */libgcc.a:*.o(.rodata*); +#ifdef GZIP + */libz.a:*.o(.rodata*); +#endif BUILD_DIR/lib/rsp.o(.rodata*); #ifdef HVQM @@ -153,41 +184,55 @@ SECTIONS END_SEG(main) BEGIN_NOLOAD(main) { - BUILD_DIR/mainseg.o(.*bss*); + BUILD_DIR/src/game*.o(.*bss*); +#ifdef HVQM + BUILD_DIR/src/hvqm*.o(.*bss*); +#endif +#ifdef UNF + BUILD_DIR/src/usb*.o(.*bss*); +#endif + BUILD_DIR/src/audio*.o(.*bss*); +#ifdef GZIP + BUILD_DIR/src/gzip*.o(.bss*); +#endif BUILD_DIR/src/audio*.o(.*bss*); */libultra_rom.a:*.o(COMMON); */libultra_rom.a:*.o(.scommon); */libultra_rom.a:*.o(.*bss*); +#ifdef HVQM + */libhvqm2.a:*.o(.bss*); +#endif +#ifdef GZIP + */libz.a:*.o(.bss*); +#endif . = ALIGN(0x8); } END_NOLOAD(main) - _mainSegmentNoloadSizeLo = SIZEOF (.main.noload) & 0xffff; - _mainSegmentNoloadSizeHi = SIZEOF (.main.noload) >> 16; /*ASSERT((. <= SEG_ENGINE), "Error: main segment extended into engine.")*/ - . = _mainSegmentNoloadEnd; + . = _mainSegmentBssEnd; BEGIN_SEG(engine, .) { - BUILD_DIR/engineseg.o(.text); + BUILD_DIR/src/engine*.o(.text); /* data */ - BUILD_DIR/engineseg.o(.data*); - BUILD_DIR/engineseg.o(.sdata*); + BUILD_DIR/src/engine*.o(.data*); + BUILD_DIR/src/engine*.o(.sdata*); /* rodata */ - BUILD_DIR/engineseg.o(.rodata*); + BUILD_DIR/src/engine*.o(.rodata*); } END_SEG(engine) BEGIN_NOLOAD(engine) { - BUILD_DIR/engineseg.o(.bss*); + BUILD_DIR/src/engine*.o(.bss*); . = ALIGN(0x100); } END_NOLOAD(engine) /*ASSERT((. <= SEG_FRAMEBUFFERS), "Error: engine segment extended into framebuffers.")*/ - . = _engineSegmentNoloadEnd; + . = _engineSegmentBssEnd; BEGIN_NOLOAD(framebuffers) { BUILD_DIR/src/buffers/framebuffers.o(.bss*); @@ -254,11 +299,42 @@ SECTIONS BUILD_DIR/src/menu*.o(.text); BUILD_DIR/src/menu*.o(.data*); BUILD_DIR/src/menu*.o(.rodata*); +#ifdef GODDARD + BUILD_DIR/libgoddard.a:*.o(.text); + /* goddard subsystem data */ + BUILD_DIR/libgoddard.a:gd_main.o(.data*); + BUILD_DIR/libgoddard.a:draw_objects.o(.data*); + BUILD_DIR/libgoddard.a:objects.o(.data*); + BUILD_DIR/libgoddard.a:particles.o(.data*); + BUILD_DIR/libgoddard.a:dynlist_proc.o(.data*); + BUILD_DIR/libgoddard.a:debug_utils.o(.data*); + BUILD_DIR/libgoddard.a:joints.o(.data*); + BUILD_DIR/libgoddard.a:shape_helper.o(.data*); + BUILD_DIR/libgoddard.a:renderer.o(.data*); + /* goddard subsystem rodata */ + BUILD_DIR/libgoddard.a:gd_main.o(.rodata*); + BUILD_DIR/libgoddard.a:gd_memory.o(.rodata*); + BUILD_DIR/libgoddard.a:draw_objects.o(.rodata*); + BUILD_DIR/libgoddard.a:objects.o(.rodata*); + BUILD_DIR/libgoddard.a:skin_movement.o(.rodata*); + BUILD_DIR/libgoddard.a:particles.o(.rodata*); + BUILD_DIR/libgoddard.a:dynlist_proc.o(.rodata*); + BUILD_DIR/libgoddard.a:old_menu.o(.rodata*); + BUILD_DIR/libgoddard.a:debug_utils.o(.rodata*); + BUILD_DIR/libgoddard.a:joints.o(.rodata*); + BUILD_DIR/libgoddard.a:skin.o(.rodata*); + BUILD_DIR/libgoddard.a:gd_math.o(.rodata*); + BUILD_DIR/libgoddard.a:shape_helper.o(.rodata*); + BUILD_DIR/libgoddard.a:renderer.o(.rodata*); +#endif } END_SEG(goddard) BEGIN_NOLOAD(goddard) { BUILD_DIR/src/menu*.o(.bss*); +#ifdef GODDARD + BUILD_DIR/libgoddard.a:*.o(.bss*); +#endif } END_NOLOAD(goddard) @@ -282,6 +358,30 @@ SECTIONS YAY0_SEG(debug_level_select, 0x07000000) YAY0_SEG(title_screen_bg, 0x0A000000) +#ifdef GODDARD + BEGIN_SEG(gd_dynlists, 0x04000000) + { + BUILD_DIR/libgoddard.a:dynlist_test_cube.o(.data); + BUILD_DIR/libgoddard.a:dynlist_unused.o(.data); + BUILD_DIR/libgoddard.a:dynlist_mario_face.o(.data); + BUILD_DIR/libgoddard.a:dynlists_mario_eyes.o(.data); + BUILD_DIR/libgoddard.a:dynlists_mario_eyebrows_mustache.o(.data); + BUILD_DIR/libgoddard.a:dynlist_mario_master.o(.data); + BUILD_DIR/libgoddard.a:anim_mario_mustache_right.o(.data); + BUILD_DIR/libgoddard.a:anim_mario_mustache_left.o(.data); + BUILD_DIR/libgoddard.a:anim_mario_lips_1.o(.data); + BUILD_DIR/libgoddard.a:anim_mario_lips_2.o(.data); + BUILD_DIR/libgoddard.a:anim_mario_eyebrows_1.o(.data); + BUILD_DIR/libgoddard.a:anim_group_1.o(.data); + BUILD_DIR/libgoddard.a:anim_group_2.o(.data); + BUILD_DIR/libgoddard.a:dynlist_test_cube.o(.rodata*); + BUILD_DIR/libgoddard.a:dynlist_unused.o(.rodata*); + BUILD_DIR/libgoddard.a:*.o(.data); + BUILD_DIR/libgoddard.a:*.o(.rodata); + } + END_SEG(gd_dynlists) +#endif + gMainLevels = __romPos; BEGIN_SEG(menu, 0x14000000) diff --git a/src/engine/level_script.c b/src/engine/level_script.c index bc55fda6..5971781b 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -16,6 +16,7 @@ #include "game/profiler.h" #include "game/save_file.h" #include "game/sound_init.h" +#include "goddard/renderer.h" #include "geo_layout.h" #include "graph_node.h" #include "level_script.h" @@ -280,6 +281,18 @@ static void level_cmd_load_yay0(void) { } static void level_cmd_load_mario_head(void) { +#ifdef GODDARD + // TODO: Fix these hardcoded sizes + void *addr = main_pool_alloc(DOUBLE_SIZE_ON_64_BIT(0xE1000), MEMORY_POOL_LEFT); + if (addr != NULL) { + gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000)); + gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800 + gd_add_to_heap(gFrameBuffer0, 3 * sizeof(gFrameBuffer0)); // 0x70800 + gdm_setup(); + gdm_maketestdl(CMD_GET(s16, 2)); + } else { + } +#endif sCurrentCmd = CMD_NEXT; } diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index e48056b3..d7ed03ac 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -12,6 +12,7 @@ #include "engine/math_util.h" #include "envfx_snow.h" #include "game_init.h" +#include "goddard/renderer.h" #include "interaction.h" #include "level_update.h" #include "mario_misc.h" @@ -77,6 +78,29 @@ struct GraphNodeObject gMirrorMario; // copy of Mario's geo node for drawing mi // (message NPC related things, the Mario head geo, and Mario geo // functions) +#ifdef GODDARD +/** + * Geo node script that draws Mario's head on the title screen. + */ +Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c) { + Gfx *gfx = NULL; + s16 sfx = 0; + struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node; + UNUSED Mat4 *transform = c; + + if (callContext == GEO_CONTEXT_RENDER) { + if (gPlayer1Controller->controllerData != NULL && !gWarpTransition.isActive) { + gd_copy_p1_contpad(gPlayer1Controller->controllerData); + } + gfx = (Gfx *) PHYSICAL_TO_VIRTUAL(gdm_gettestdl(asGenerated->parameter)); + gGoddardVblankCallback = gd_vblank; + sfx = gd_sfx_to_play(); + play_menu_sounds(sfx); + } + return gfx; +} +#endif + static void toad_message_faded(void) { if (gCurrentObject->oDistanceToMario > 700.0f) { gCurrentObject->oToadMessageRecentlyTalked = FALSE; diff --git a/src/game/mario_misc.h b/src/game/mario_misc.h index 3dd42f81..a65a7517 100644 --- a/src/game/mario_misc.h +++ b/src/game/mario_misc.h @@ -9,6 +9,9 @@ extern struct GraphNodeObject gMirrorMario; extern struct MarioBodyState gBodyStates[2]; +#ifdef GODDARD +Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c); +#endif void bhv_toad_message_loop(void); void bhv_toad_message_init(void); void bhv_unlock_door_star_init(void); diff --git a/src/goddard/bad_declarations.h b/src/goddard/bad_declarations.h new file mode 100644 index 00000000..e1b0539d --- /dev/null +++ b/src/goddard/bad_declarations.h @@ -0,0 +1,40 @@ +#ifndef GD_BAD_DECLARATIONS_H +#define GD_BAD_DECLARATIONS_H + +#include "gd_types.h" + +/** + * @file bad_declarations.h + * + * Match incorrect type promotion for two declared functions. + * + * There is an issue with the compiled code for these function calls in files + * outside of the files in which they were defined: instead of passing f32's, + * the caller passes f64's. + * + * The only possible reason I can come up with for this behavior is that + * goddard only declared (not prototyped) his functions in the headers, + * and didn't include the header in the function's defining .c file. + * (Even IDO 5.3 cares about illegal promotion of types!) This results in + * default argument promotion, which is incorrect in this case. + * + * Since that's an awful practice to emulate, include this file (first!) to prevent + * the proper prototypes of these functions from being seen by files with the + * the incorrectly compiled calls. +*/ + +#ifndef AVOID_UB + +#define GD_USE_BAD_DECLARATIONS + +/* shape_helper.h */ +extern struct ObjFace *make_face_with_colour(); +/* should be: make_face_with_colour(f32, f32, f32) */ + +/* old_menu.h */ +extern struct ObjLabel *make_label(); +/* should be: make_label(struct ObjValPtr *, char *, s32, f32, f32, f32) */ + +#endif /* !AVOID_UB */ + +#endif // GD_BAD_DECLARATIONS_H diff --git a/src/goddard/debug_utils.c b/src/goddard/debug_utils.c new file mode 100644 index 00000000..3bd2d2fd --- /dev/null +++ b/src/goddard/debug_utils.c @@ -0,0 +1,954 @@ +#include +#include + +#include "debug_utils.h" +#include "gd_types.h" +#include "macros.h" +#include "renderer.h" +#include "draw_objects.h" + +// types +struct UnkBufThing { + /* 0x00 */ s32 size; + /* 0x04 */ char name[0x40]; +}; /* sizeof = 0x44 */ + +// data +static s32 sNumRoutinesInStack = 0; // @ 801A8280 +static s32 sTimerGadgetColours[7] = { + COLOUR_RED, + COLOUR_WHITE, + COLOUR_GREEN, + COLOUR_BLUE, + COLOUR_GRAY, + COLOUR_YELLOW, + COLOUR_PINK +}; +static s32 sNumActiveMemTrackers = 0; // @ 801A82A0 +static u32 sPrimarySeed = 0x12345678; // @ 801A82A4 +static u32 sSecondarySeed = 0x58374895; // @ 801A82A8 + +// bss +u8 *gGdStreamBuffer; // @ 801BA190 +static const char *sRoutineNames[64]; // @ 801BA198 +static s32 sTimingActive; // @ 801BA298 +static struct GdTimer sTimers[GD_NUM_TIMERS]; // @ 801BA2A0 +static struct MemTracker sMemTrackers[GD_NUM_MEM_TRACKERS]; // @ 801BA720 +static struct MemTracker *sActiveMemTrackers[16]; // @ 801BA920 + +/* + * Memtrackers + * + * These are used to monitor how much heap memory is being used by certain + * operations. + * To create a memtracker, call new_memtracker with a unique name. + * To record the amount of memory used by a certain allocation, call + * start_memtracker before allocating memory, and call stop_memtracker after + * allocating memory. + * The memtracker keeps track of the memory allocated between a single + * start_memtracker/stop_memtracker pair as well as the total memory allocated + * of all start_memtracker/stop_memtracker pairs. + */ + +/** + * Creates a new memtracker with the specified name + */ +struct MemTracker *new_memtracker(const char *name) { + s32 i; + struct MemTracker *tracker = NULL; + + for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { + if (sMemTrackers[i].name == NULL) { + sMemTrackers[i].name = name; + tracker = &sMemTrackers[i]; + break; + } + } + + if (tracker != NULL) { + tracker->total = 0.0f; + } + + return tracker; +} + +/** + * Returns the memtracker with the specified name, or NULL if it + * does not exist + */ +struct MemTracker *get_memtracker(const char *name) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { + if (sMemTrackers[i].name != NULL) { + if (gd_str_not_equal(sMemTrackers[i].name, name) == FALSE) { + return &sMemTrackers[i]; + } + } + } + + return NULL; +} + +/** + * Records the amount of heap usage before allocating memory. + */ +struct MemTracker *start_memtracker(const char *name) { + struct MemTracker *tracker = get_memtracker(name); + + // Create one if it doesn't exist + if (tracker == NULL) { + tracker = new_memtracker(name); + if (tracker == NULL) { + fatal_printf("Unable to make memtracker '%s'", name); + } + } + + tracker->begin = (f32) get_alloc_mem_amt(); + if (sNumActiveMemTrackers >= ARRAY_COUNT(sActiveMemTrackers)) { + fatal_printf("too many memtracker calls"); + } + + sActiveMemTrackers[sNumActiveMemTrackers++] = tracker; + + return tracker; +} + +/* @ 23ABE0 -> 23AC28; not called; orig name: Unknown8018C410 */ +void print_most_recent_memtracker_name(void) { + gd_printf("%s\n", sActiveMemTrackers[sNumActiveMemTrackers - 1]->name); +} + +/** + * Records the amount of heap usage after allocating memory. + */ +u32 stop_memtracker(const char *name) { + struct MemTracker *tracker; + + if (sNumActiveMemTrackers-- < 0) { + fatal_printf("bad mem tracker count"); + } + + tracker = get_memtracker(name); + if (tracker == NULL) { + fatal_printf("memtracker '%s' not found", name); + } + + tracker->end = get_alloc_mem_amt(); + tracker->total += (tracker->end - tracker->begin); + + return (u32) tracker->total; +} + +/** + * Destroys all memtrackers + */ +void remove_all_memtrackers(void) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { + sMemTrackers[i].name = NULL; + sMemTrackers[i].begin = 0.0f; + sMemTrackers[i].end = 0.0f; + sMemTrackers[i].total = 0.0f; + } + +#ifdef AVOID_UB + sNumActiveMemTrackers = 0; +#endif +} + +/** + * Returns a memtracker by index rather than name + */ +struct MemTracker *get_memtracker_by_index(s32 index) { + return &sMemTrackers[index]; +} + +/** + * Prints the total memory allocated for each memtracker + */ +void print_all_memtrackers(void) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { + if (sMemTrackers[i].name != NULL) { + gd_printf("'%s' = %dk\n", sMemTrackers[i].name, (s32)(sMemTrackers[i].total / 1024.0f)); + } + } +} + +/* + * Timers + * + * These are used to profile the code by measuring the time it takes to perform + * operations. + * To record elapsed time, call start_timer, perform some operations, then call stop_timer. + * You can also use restart_timer/split_timer instead of start_timer/stop_timer + * to keep a running total. + */ + +/* 23AEFC -> 23AFB0; orig name: func_8018C72C */ +void print_all_timers(void) { + s32 i; + + gd_printf("\nTimers:\n"); + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + if (sTimers[i].name != NULL) { + gd_printf("'%s' = %f (%d)\n", sTimers[i].name, sTimers[i].scaledTotal, + sTimers[i].resetCount); + } + } +} + +/* 23AFB0 -> 23AFC8; orig name: func_8018C7E0 */ +void deactivate_timing(void) { + sTimingActive = FALSE; +} + +/* 23AFC8 -> 23AFE4; orig name: func_8018C7F8 */ +void activate_timing(void) { + sTimingActive = TRUE; +} + +/** + * Destroys all timers + */ +void remove_all_timers(void) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + sTimers[i].name = NULL; + sTimers[i].total = 0; + sTimers[i].unused0C = 0.0f; + sTimers[i].scaledTotal = 0.0f; + sTimers[i].prevScaledTotal = 0.0f; + sTimers[i].gadgetColourNum = sTimerGadgetColours[(u32) i % 7]; + sTimers[i].resetCount = 0; + } + activate_timing(); +} + +/** + * Creates a new timer with the specified name + */ +static struct GdTimer *new_timer(const char *name) { + s32 i; + struct GdTimer *timer = NULL; + + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + if (sTimers[i].name == NULL) { + sTimers[i].name = name; + timer = &sTimers[i]; + break; + } + } + + return timer; +} + +/** + * Returns the timer with the specified name, or NULL if it does not exist. + */ +struct GdTimer *get_timer(const char *timerName) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + if (sTimers[i].name != NULL) { + if (gd_str_not_equal(sTimers[i].name, timerName) == FALSE) { + return &sTimers[i]; + } + } + } + + return NULL; +} + +/** + * Returns the timer with the specified name, or aborts the program if it does + * not exist. + */ +static struct GdTimer *get_timer_checked(const char *timerName) { + struct GdTimer *timer; + + timer = get_timer(timerName); + if (timer == NULL) { + fatal_printf("Timer '%s' not found", timerName); + } + + return timer; +} + +/** + * Returns a timer by index rather than name + */ +struct GdTimer *get_timernum(s32 index) { + if (index >= ARRAY_COUNT(sTimers)) { + fatal_printf("get_timernum(): Timer number %d out of range (MAX %d)", index, ARRAY_COUNT(sTimers)); + } + + return &sTimers[index]; +} + +/* 23B350 -> 23B42C; orig name: func_8018CB80 */ +void split_timer_ptr(struct GdTimer *timer) { + if (!sTimingActive) { + return; + } + + timer->end = gd_get_ostime(); + timer->total += timer->end - timer->start; + + if (timer->total < 0) { + timer->total = 0; + } + + timer->scaledTotal = ((f32) timer->total) / get_time_scale(); + timer->start = timer->end; +} + +/* 23B42C -> 23B49C; not called; orig name: Unknown8018CC5C */ +void split_all_timers(void) { + s32 i; + struct GdTimer *timer; + + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + timer = get_timernum(i); + if (timer->name != NULL) { + split_timer_ptr(timer); + } + } +} + +/** + * Unused - records the start time for all timers + */ +void start_all_timers(void) { + s32 i; + struct GdTimer *timer; + + if (!sTimingActive) { + return; + } + + for (i = 0; i < ARRAY_COUNT(sTimers); i++) { + timer = get_timernum(i); + + if (timer->name != NULL) { + timer->start = gd_get_ostime(); + } + } +} + +/** + * Records the current time before performing an operation + */ +void start_timer(const char *name) { + struct GdTimer *timer; + + if (!sTimingActive) { + return; + } + + // Create timer if it does not exist. + timer = get_timer(name); + if (timer == NULL) { + timer = new_timer(name); + if (timer == NULL) { + fatal_printf("start_timer(): Unable to make timer '%s'", name); + } + } + + timer->prevScaledTotal = timer->scaledTotal; + timer->start = gd_get_ostime(); + timer->total = 0; + timer->resetCount = 1; +} + +/** + * Records the current time before performing an operation + */ +void restart_timer(const char *name) { + struct GdTimer *timer; + + if (!sTimingActive) { + return; + } + + // Create timer if it does not exist. + timer = get_timer(name); + if (timer == NULL) { + timer = new_timer(name); + if (timer == NULL) { + fatal_printf("restart_timer(): Unable to make timer '%s'", name); + } + } + + timer->start = gd_get_ostime(); + timer->resetCount++; +} + +/** + * Records the current time after performing an operation, adds the elapsed time + * to the total, then restarts the timer + */ +void split_timer(const char *name) { + struct GdTimer *timer; + + if (!sTimingActive) { + return; + } + + timer = get_timer_checked(name); + split_timer_ptr(timer); +} + +/** + * Records the current time after performing an operation + */ +void stop_timer(const char *name) { + struct GdTimer *timer; + + if (!sTimingActive) { + return; + } + + timer = get_timer_checked(name); + timer->end = gd_get_ostime(); + timer->total += timer->end - timer->start; + if (timer->total < 0) { + timer->total = 0; + } + + timer->scaledTotal = ((f32) timer->total) / get_time_scale(); +} + +/** + * Returns the scaled total for the specified timer + */ +f32 get_scaled_timer_total(const char *name) { + struct GdTimer *timer = get_timer_checked(name); + + return timer->scaledTotal; +} + +/** + * Unused - returns the raw total for the specified timer + */ +f32 get_timer_total(const char *name) { + struct GdTimer *timer = get_timer_checked(name); + + return (f32) timer->total; +} + + +/* + * Miscellaneous debug functions + */ + + +/** + * Prints the given string, prints the stack trace, and exits the program + */ +void fatal_print(const char *str) { + fatal_printf(str); +} + +/** + * Prints the stack trace registered by callng imin()/imout() + */ +void print_stack_trace(void) { + s32 i; + + for (i = 0; i < sNumRoutinesInStack; i++) { + gd_printf("\tIn: '%s'\n", sRoutineNames[i]); + } +} + +/** + * Prints the formatted string, prints the stack trace, and exits the program + */ +void fatal_printf(const char *fmt, ...) { + char cur; + UNUSED u8 pad[4]; + va_list vl; + + va_start(vl, fmt); + while ((cur = *fmt++)) { + switch (cur) { + case '%': + switch (cur = *fmt++) { + case 'd': + gd_printf("%d", va_arg(vl, s32)); + break; + case 'f': + gd_printf("%f", va_arg(vl, double)); + break; + case 's': + gd_printf("%s", va_arg(vl, char *)); + break; + case 'c': + gd_printf("%c", va_arg(vl, char)); + break; + case 'x': + gd_printf("%x", va_arg(vl, s32)); + break; + default: + gd_printf("%c", cur); + } + break; + case '\\': + gd_printf("\\"); + break; + case '\n': + gd_printf("\n"); + break; + default: + gd_printf("%c", cur); + } + } + va_end(vl); + + gd_printf("\n"); + print_stack_trace(); + gd_printf("\n"); + gd_exit(-1); +} + +/** + * "I'm in" + * Adds the function name to the stack trace + */ +void imin(const char *routine) { + sRoutineNames[sNumRoutinesInStack++] = routine; + sRoutineNames[sNumRoutinesInStack] = NULL; //! array bounds is checked after writing this. + + if (sNumRoutinesInStack >= ARRAY_COUNT(sRoutineNames)) { + fatal_printf("You're in too many routines"); + } +} + +/** + * "I'm out" + * Removes the function name from the stack trace + */ +void imout(void) { + s32 i; + + if (--sNumRoutinesInStack < 0) { + for (i = 0; i < ARRAY_COUNT(sRoutineNames); i++) { + if (sRoutineNames[i] != NULL) { + gd_printf(" - %s\n", sRoutineNames[i]); + } else { + break; + } + } + + fatal_printf("imout() - imout() called too many times"); + } +} + +/** + * Returns a random floating point number between 0 and 1 (inclusive) + * TODO: figure out type of rng generator? + */ +f32 gd_rand_float(void) { + u32 temp; + u32 i; + f32 val; + + for (i = 0; i < 4; i++) { + if (sPrimarySeed & 0x80000000) { + sPrimarySeed = sPrimarySeed << 1 | 1; + } else { + sPrimarySeed <<= 1; + } + } + sPrimarySeed += 4; + + /* Seed Switch */ + if ((sPrimarySeed ^= gd_get_ostime()) & 1) { + temp = sPrimarySeed; + sPrimarySeed = sSecondarySeed; + sSecondarySeed = temp; + } + + val = (sPrimarySeed & 0xFFFF) / 65535.0; // 65535.0f + + return val; +} + +/** + * Reimplementation of the standard "atoi" function + */ +s32 gd_atoi(const char *str) { + char cur; + const char *origstr = str; + s32 curval; + s32 out = 0; + s32 isNegative = FALSE; + + while (TRUE) { + cur = *str++; + + // Each character must be either a digit or a minus sign + if ((cur < '0' || cur > '9') && (cur != '-')) + fatal_printf("gd_atoi() bad number '%s'", origstr); + + if (cur == '-') { + isNegative = TRUE; + } else { + curval = cur - '0'; + out += curval & 0xFF; + + if (*str == '\0' || *str == '.' || *str < '0' || *str > '9') { + break; + } + + out *= 10; + } + } + + if (isNegative) { + out = -out; + } + + return out; +} + +/** + * Like the standard "atof" function, but only supports integer values + */ +f64 gd_lazy_atof(const char *str, UNUSED u32 *unk) { + return gd_atoi(str); +} + +static char sHexNumerals[] = {"0123456789ABCDEF"}; + +/* 23C018 -> 23C078; orig name: func_8018D848 */ +char *format_number_hex(char *str, s32 val) { + s32 shift; + + for (shift = 28; shift > -4; shift -= 4) { + *str++ = sHexNumerals[(val >> shift) & 0xF]; + } + + *str = '\0'; + + return str; +} + +static s32 sPadNumPrint = 0; // @ 801A82C0 + +/* 23C078 -> 23C174; orig name: func_8018D8A8 */ +/* padnum = a decimal number with the max desired output width */ +char *format_number_decimal(char *str, s32 val, s32 padnum) { + s32 i; + + if (val == 0) { + *str++ = '0'; + *str = '\0'; + return str; + } + + if (val < 0) { + val = -val; + *str++ = '-'; + } + + while (padnum > 0) { + if (padnum <= val) { + sPadNumPrint = TRUE; + + for (i = 0; i < 9; i++) { + val -= padnum; + if (val < 0) { + val += padnum; + break; + } + } + + *str++ = i + '0'; + } else { + if (sPadNumPrint) { + *str++ = '0'; + } + } + + padnum /= 10; + } + + *str = '\0'; + + return str; +} + +/* 23C174 -> 23C1C8; orig name: func_8018D9A4 */ +static s32 int_sci_notation(s32 base, s32 significand) { + s32 i; + + for (i = 1; i < significand; i++) { + base *= 10; + } + + return base; +} + +/* 23C1C8 -> 23C468; orig name: func_8018D9F8 */ +char *sprint_val_withspecifiers(char *str, union PrintVal val, char *specifiers) { + s32 fracPart; // sp3C + s32 intPart; // sp38 + s32 intPrec; // sp34 + s32 fracPrec; // sp30 + UNUSED u8 pad[4]; + char cur; // sp2B + + fracPrec = 6; + intPrec = 6; + + while ((cur = *specifiers++)) { + if (cur == 'd') { + sPadNumPrint = FALSE; + str = format_number_decimal(str, val.i, 1000000000); + } else if (cur == 'x') { + sPadNumPrint = TRUE; /* doesn't affect hex printing, though... */ + str = format_number_hex(str, val.i); + } else if (cur == 'f') { + intPart = (s32) val.f; + fracPart = (s32)((val.f - (f32) intPart) * (f32) int_sci_notation(10, fracPrec)); + sPadNumPrint = FALSE; + str = format_number_decimal(str, intPart, int_sci_notation(10, intPrec)); + *str++ = '.'; + sPadNumPrint = TRUE; + str = format_number_decimal(str, fracPart, int_sci_notation(10, fracPrec - 1)); + } else if (cur >= '0' && cur <= '9') { + cur = cur - '0'; + intPrec = cur; + if (*specifiers++) { + fracPrec = (*specifiers++) - '0'; + } + } else { + gd_strcpy(str, ""); + str += 10; + } + } + + return str; +} + +/* 23C468 -> 23C4AC; orig name: func_8018DC98 */ +void gd_strcpy(char *dst, const char *src) { + while ((*dst++ = *src++)) { + ; + } +} + +/* 23C4AC -> 23C52C; not called; orig name: Unknown8018DCDC */ +void ascii_to_uppercase(char *str) { + char c; + + while ((c = *str)) { + if (c >= 'a' && c <= 'z') { + *str = c & 0xDF; + } + str++; + } +} + +/* 23C52C -> 23C5A8; orig name: func_8018DD5C */ +char *gd_strdup(const char *src) { + char *dst; // sp24 + + dst = gd_malloc_perm((gd_strlen(src) + 1) * sizeof(char)); + + if (dst == NULL) { + fatal_printf("gd_strdup(): out of memory"); + } + gd_strcpy(dst, src); + + return dst; +} + +/* 23C5A8 -> 23C5FC; orig name: func_8018DDD8 */ +u32 gd_strlen(const char *str) { + u32 len = 0; + + while (*str++) { + len++; + } + + return len; +} + +/* 23C5FC -> 23C680; orig name: func_8018DE2C */ +char *gd_strcat(char *dst, const char *src) { + while (*dst++) { + ; + } + + if (*src) { + dst--; + while ((*dst++ = *src++)) { + ; + } + } + + return --dst; +} + +/* 23C67C -> 23C728; orig name: func_8018DEB0 */ +/* Returns a bool, not the position of the mismatch */ +s32 gd_str_not_equal(const char *str1, const char *str2) { + while (*str1 && *str2) { + if (*str1++ != *str2++) { + return TRUE; + } + } + + return *str1 != '\0' || *str2 != '\0'; +} + +/* 23C728 -> 23C7B8; orig name; func_8018DF58 */ +s32 gd_str_contains(const char *str1, const char *str2) { + const char *startsub = str2; + + while (*str1 && *str2) { + if (*str1++ != *str2++) { + str2 = startsub; + } + } + + return !*str2; +} + +/* 23C7B8 -> 23C7DC; orig name: func_8018DFE8 */ +s32 gd_feof(struct GdFile *f) { + return f->flags & 0x4; +} + +/* 23C7DC -> 23C7FC; orig name: func_8018E00C */ +void gd_set_feof(struct GdFile *f) { + f->flags |= 0x4; +} + +/* 23C7FC -> 23CA0C */ +struct GdFile *gd_fopen(const char *filename, const char *mode) { + struct GdFile *f; // sp74 + char *loadedname; // sp70 + u32 i; // sp6C + UNUSED u32 pad68; + struct UnkBufThing buf; // sp24 + u8 *bufbytes; // sp20 + u8 *fileposptr; // sp1C + s32 filecsr; // sp18 + + filecsr = 0; + + while (TRUE) { + bufbytes = (u8 *) &buf; + for (i = 0; i < sizeof(struct UnkBufThing); i++) { + *bufbytes++ = gGdStreamBuffer[filecsr++]; + } + stub_renderer_13(&buf); + fileposptr = &gGdStreamBuffer[filecsr]; + filecsr += buf.size; + + loadedname = buf.name; + + if (buf.size == 0) { + break; + } + if (!gd_str_not_equal(filename, loadedname)) { + break; + } + } + + if (buf.size == 0) { + fatal_printf("gd_fopen() File not found '%s'", filename); + return NULL; + } + + f = gd_malloc_perm(sizeof(struct GdFile)); + if (f == NULL) { + fatal_printf("gd_fopen() Out of memory loading '%s'", filename); + return NULL; + } + + f->stream = (s8 *) fileposptr; + f->size = buf.size; + f->pos = f->flags = 0; + if (gd_str_contains(mode, "w")) { + f->flags |= 0x1; + } + if (gd_str_contains(mode, "b")) { + f->flags |= 0x2; + } + + return f; +} + +/* 23CA0C -> 23CB38; orig name: func_8018E23C */ +s32 gd_fread(s8 *buf, s32 bytes, UNUSED s32 count, struct GdFile *f) { + s32 bytesToRead = bytes; + s32 bytesread; + + if (f->pos + bytesToRead > f->size) { + bytesToRead = f->size - f->pos; + } + + if (bytesToRead == 0) { + gd_set_feof(f); + return -1; + } + + bytesread = bytesToRead; + while (bytesread--) { + *buf++ = f->stream[f->pos++]; + } + + return bytesToRead; +} + +/* 23CB38 -> 23CB54; orig name: func_8018E368 */ +void gd_fclose(UNUSED struct GdFile *f) { + return; +} + +/* 23CB54 -> 23CB70; orig name: func_8018E384 */ +u32 gd_get_file_size(struct GdFile *f) { + return f->size; +} + +/* 23CB70 -> 23CBA8; orig name: func_8018E3A0 */ +s32 is_newline(char c) { + return c == '\r' || c == '\n'; +} + +/* 23CBA8 -> 23CCF0; orig name: func_8018E3D8 */ +s32 gd_fread_line(char *buf, u32 size, struct GdFile *f) { + signed char c; + u32 pos = 0; + UNUSED u32 pad1c; + + do { + if (gd_fread(&c, 1, 1, f) == -1) { + break; + } + } while (is_newline(c)); + + while (!is_newline(c)) { + if (c == -1) { + break; + } + if (pos > size) { + break; + } + buf[pos++] = c; + if (gd_fread(&c, 1, 1, f) == -1) { + break; + } + } + buf[pos++] = '\0'; + + return pos; +} diff --git a/src/goddard/debug_utils.h b/src/goddard/debug_utils.h new file mode 100644 index 00000000..4c2bcafb --- /dev/null +++ b/src/goddard/debug_utils.h @@ -0,0 +1,93 @@ +#ifndef GD_DEBUGGING_UTILS_H +#define GD_DEBUGGING_UTILS_H + +#include + +#include "gd_types.h" +#include "macros.h" + +#define GD_NUM_MEM_TRACKERS 32 +#define GD_NUM_TIMERS 32 + +// structs +struct MemTracker { + /* 0x00 */ const char *name; // name (used as an identifier) + /* 0x04 */ f32 begin; // used heap space (in bytes) before allocating memory + /* 0x08 */ f32 end; // used heap space (in bytes) after allocating memory + /* 0x0C */ f32 total; // total memory (in bytes) allocated between all start_memtracker/stop_memtracker calls +}; + +struct GdTimer { + /* 0x00 */ s32 start; // in cycles + /* 0x04 */ s32 end; // in cycles + /* 0x08 */ s32 total; // in cycles + /* 0x0C */ f32 unused0C; + /* 0x10 */ f32 scaledTotal; // total / sTimeScaleFactor (1.0f) Unused function modified value + /* 0x14 */ f32 prevScaledTotal; + /* 0x18 */ const char *name; + /* 0x1C */ s32 gadgetColourNum; // color of gadget that represents timer? + /* 0x20 */ s32 resetCount; +}; // sizeof = 0x24 + +union PrintVal { + f32 f; + s32 i; + s64 pad; +}; + +/* based on fields set in gd_fopen; gd_malloc_perm(84) for size */ +struct GdFile { + /* 0x00 */ u8 pad00[4]; + /* 0x04 */ u32 pos; + /* 0x08 */ s8 *stream; + /* Known Flags for +0xC field: + ** 1 : write mode + ** 2 : binary mode + ** 4 : eof */ + /* 0x0C */ u32 flags; + /* 0x10 */ u8 pad10[0x50-0x10]; + /* 0x50 */ u32 size; +}; /* sizeof() = 0x54 */ + +// bss +extern u8 *gGdStreamBuffer; + +// functions +extern struct MemTracker *start_memtracker(const char *); +extern u32 stop_memtracker(const char *); +extern void remove_all_memtrackers(void); +extern struct MemTracker *get_memtracker_by_index(s32); +extern void print_all_memtrackers(void); +extern void print_all_timers(void); +extern void deactivate_timing(void); +extern void activate_timing(void); +extern void remove_all_timers(void); +extern struct GdTimer *get_timer(const char *); +extern struct GdTimer *get_timernum(s32); +extern void start_timer(const char *); +extern void restart_timer(const char *); +extern void split_timer(const char *); +extern void stop_timer(const char *); +extern f32 get_scaled_timer_total(const char *); +extern void fatal_print(const char *) NORETURN; +extern void fatal_printf(const char *, ...) NORETURN; +extern void imin(const char *); +extern void imout(void); +extern f32 gd_rand_float(void); +extern s32 gd_atoi(const char *); +extern f64 gd_lazy_atof(const char *, u32 *); +extern char *sprint_val_withspecifiers(char *, union PrintVal, char *); +extern void gd_strcpy(char *, const char *); +extern char *gd_strdup(const char *); +extern u32 gd_strlen(const char *); +extern char *gd_strcat(char *, const char *); +extern s32 gd_str_not_equal(const char *, const char *); +extern s32 gd_str_contains(const char *, const char *); +extern s32 gd_feof(struct GdFile *); +extern struct GdFile *gd_fopen(const char *, const char *); +extern s32 gd_fread(s8 *, s32, s32, struct GdFile *); +extern void gd_fclose(struct GdFile *); +extern u32 gd_get_file_size(struct GdFile *); +extern s32 gd_fread_line(char *, u32, struct GdFile *); + +#endif // GD_DEBUGGING_UTILS_H diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c new file mode 100644 index 00000000..095f1e1e --- /dev/null +++ b/src/goddard/draw_objects.c @@ -0,0 +1,1542 @@ +#include +#include + +#include "debug_utils.h" +#include "dynlist_proc.h" +#include "gd_macros.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "macros.h" +#include "objects.h" +#include "old_menu.h" +#include "renderer.h" +#include "shape_helper.h" +#include "draw_objects.h" + +/** + * @file draw_objects.c + * This file contains the functions and helpers for rendering the various + * GdObj primitives to the screen. + */ + +// forward declarations +void func_80179B64(struct ObjGroup *); +void update_shaders(struct ObjShape *, struct GdVec3f *); +void draw_shape_faces(struct ObjShape *); +void register_light(struct ObjLight *); + +// types +/** + * Modes for drawscene() + */ +enum SceneType { + RENDER_SCENE = 26, ///< render the primitives to screen + FIND_PICKS = 27 ///< only check position of primitives relative to cursor click +}; + +/** + * A possible remnant of an early `ObjVertex` structure that contained + * texture S,T coordinates. + */ +struct BetaVtx { + /* 0x00 */ u8 pad[0x44 - 0]; + /* 0x44 */ f32 s; + /* 0x48 */ f32 t; +}; + +// data +static struct GdColour sClrWhite = { 1.0, 1.0, 1.0 }; // @ 801A8070 +static struct GdColour sClrRed = { 1.0, 0.0, 0.0 }; // @ 801A807C +static struct GdColour sClrGreen = { 0.0, 1.0, 0.0 }; // @ 801A8088 +static struct GdColour sClrBlue = { 0.0, 0.0, 1.0 }; // @ 801A8094 +static struct GdColour sClrErrDarkBlue = { 0.0, 0.0, 6.0 }; // @ 801A80A0 +static struct GdColour sClrPink = { 1.0, 0.0, 1.0 }; // @ 801A80AC +static struct GdColour sClrBlack = { 0.0, 0.0, 0.0 }; // @ 801A80B8 +static struct GdColour sClrGrey = { 0.6, 0.6, 0.6 }; // @ 801A80C4 +static struct GdColour sClrDarkGrey = { 0.4, 0.4, 0.4 }; // @ 801A80D0 +static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC +static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8 +static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4 +struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8 +static void *sUnref801A80FC = NULL; +static s32 sUnreadShapeFlag = 0; // @ 801A8100 +struct GdColour *sColourPalette[5] = { // @ 801A8104 + &sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack +}; +struct GdColour *sWhiteBlack[2] = { + //@ 801A8118 + &sClrWhite, + &sClrBlack, +}; +static Mat4f sUnref801A8120 = { + { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } +}; +static Mat4f sUnrefIden801A8160 = { + { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 } +}; +static s32 sLightDlCounter = 1; // @ 801A81A0 +static s32 sUnref801A81A4[4] = { 0 }; + +// bss +u8 gUnref_801B9B30[0x88]; +struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group? + +static u8 sUnref_801B9BBC[0x40]; +static enum SceneType sSceneProcessType; // @ 801B9C00 +static s32 sUseSelectedColor; // @ 801B9C04 +static s16 sPickBuffer[100]; ///< buffer of objects near click +static s32 sPickDataTemp; ///< now, only data is the object number of a selected joint +static f32 sPickObjDistance; ///< distance between object position and cursor click location +static struct GdObj *sPickedObject; ///< object selected with cursor +/// Various counters and pointers set in update_view() and used in various `draw_XXX` functions +static struct { + u32 pad00; // @ 801B9CE0 + struct ObjView *view; // @ 801B9CE4 + s32 unreadCounter; // @ 801B9CE8 + s32 mtlDlNum; // @ 801B9CEC; name is a big guess + s32 shapesDrawn; // @ 801B9CF0 + s32 unused18; // @ 801B9CF4 +} sUpdateViewState; +static struct ObjLight *sPhongLight; // material light? phong light? +static struct GdVec3f sPhongLightPosition; //@ 801B9D00; guess; light source unit position for light + // flagged 0x20 (sPhongLight) +static struct GdVec3f sLightPositionOffset; // @ 801B9D10 +static struct GdVec3f sLightPositionCache[8]; // @ 801B9D20; unit positions +static s32 sNumActiveLights; // @ 801B9D80; maybe? +static struct GdVec3f sGrabCords; ///< x, y grabbable point near cursor + +/** + * Set the ambient light color and turn on G_CULL_BACK. + */ +void setup_lights(void) { + set_light_num(NUMLIGHTS_2); + gd_setproperty(GD_PROP_AMB_COLOUR, 0.5f, 0.5f, 0.5f); + gd_setproperty(GD_PROP_CULLING, 1.0f, 0.0f, 0.0f); // set G_CULL_BACK + return; + + // dead code + gd_setproperty(GD_PROP_STUB17, 2.0f, 0.0f, 0.0f); + gd_setproperty(GD_PROP_ZBUF_FN, 24.0f, 0.0f, 0.0f); + gd_setproperty(GD_PROP_CULLING, 1.0f, 0.0f, 0.0f); + return; +} + +/** + * @note Not called + */ +void Unknown801781DC(struct ObjZone *zone) { + struct GdVec3f lightPos; // 3c + struct ObjUnk200000 *unk; + f32 sp34; + f32 sp30; + f32 sp2C; + struct ObjLight *light; + register struct ListNode *link = zone->unk30->firstMember; // s0 (24) + struct GdObj *obj; // 20 + + while (link != NULL) { + obj = link->obj; + light = (struct ObjLight *) gGdLightGroup->firstMember->obj; + lightPos.x = light->position.x; + lightPos.y = light->position.y; + lightPos.z = light->position.z; + unk = (struct ObjUnk200000 *) obj; + sp34 = gd_dot_vec3f(&unk->unk34->normal, &unk->unk30->pos); + sp30 = gd_dot_vec3f(&unk->unk34->normal, &lightPos); + lightPos.x -= unk->unk34->normal.x * (sp30 - sp34); + lightPos.y -= unk->unk34->normal.y * (sp30 - sp34); + lightPos.z -= unk->unk34->normal.z * (sp30 - sp34); + unk->unk30->pos.x = lightPos.x; + unk->unk30->pos.y = lightPos.y; + unk->unk30->pos.z = lightPos.z; + sp2C = ABS((sp30 - sp34)); + if (sp2C > 600.0f) { + sp2C = 600.0f; + } + sp2C = 1.0 - sp2C / 600.0; + unk->unk30->normal.x = sp2C * light->colour.r; + unk->unk30->normal.y = sp2C * light->colour.g; + unk->unk30->normal.z = sp2C * light->colour.b; + link = link->next; + } +} + +/* 226C6C -> 226FDC */ +void draw_shape(struct ObjShape *shape, s32 flag, f32 c, f32 d, f32 e, // "sweep" indices 0-2 x, y, z + f32 f, f32 g, f32 h, // translate shape + store offset (unused) + f32 i, f32 j, f32 k, // translate shape + f32 l, f32 m, f32 n, // rotate x, y, z + s32 colorIdx, Mat4f *rotMtx) { + UNUSED u8 unused[8]; + struct GdVec3f sp1C; + + restart_timer("drawshape"); + sUpdateViewState.shapesDrawn++; + + if (shape == NULL) { + return; + } + + sp1C.x = sp1C.y = sp1C.z = 0.0f; + if (flag & 2) { + gd_dl_load_trans_matrix(f, g, h); + sp1C.x += f; + sp1C.y += g; + sp1C.z += h; + } + + if ((flag & 0x10) && rotMtx != NULL) { + gd_dl_load_matrix(rotMtx); + sp1C.x += (*rotMtx)[3][0]; + sp1C.y += (*rotMtx)[3][1]; + sp1C.z += (*rotMtx)[3][2]; + } + + if (flag & 8) { + if (m != 0.0f) { + func_8019F2C4(m, 121); + } + if (l != 0.0f) { + func_8019F2C4(l, 120); + } + if (n != 0.0f) { + func_8019F2C4(n, 122); + } + } + + if (colorIdx != 0) { + sUseSelectedColor = TRUE; + sSelectedColour = gd_get_colour(colorIdx); + if (sSelectedColour != NULL) { + gd_dl_material_lighting(-1, sSelectedColour, GD_MTL_LIGHTS); + } else { + fatal_print("Draw_shape(): Bad colour"); + } + } else { + sUseSelectedColor = FALSE; + sSelectedColour = NULL; + } + + if (sNumActiveLights != 0 && shape->mtlGroup != NULL) { + if (rotMtx != NULL) { + sp1C.x = (*rotMtx)[3][0]; + sp1C.y = (*rotMtx)[3][1]; + sp1C.z = (*rotMtx)[3][2]; + } else { + sp1C.x = sp1C.y = sp1C.z = 0.0f; + } + update_shaders(shape, &sp1C); + } + + if (flag & 4) { + gd_dl_mul_trans_matrix(i, j, k); + } + + if (flag & 1) { + gd_dl_scale(c, d, e); + } + + draw_shape_faces(shape); + sUseSelectedColor = FALSE; + split_timer("drawshape"); +} + +void draw_shape_2d(struct ObjShape *shape, s32 flag, UNUSED f32 c, UNUSED f32 d, UNUSED f32 e, f32 f, + f32 g, f32 h, UNUSED f32 i, UNUSED f32 j, UNUSED f32 k, UNUSED f32 l, UNUSED f32 m, + UNUSED f32 n, UNUSED s32 color, UNUSED s32 p) { + UNUSED u8 unused[8]; + struct GdVec3f sp1C; + + restart_timer("drawshape2d"); + sUpdateViewState.shapesDrawn++; + + if (shape == NULL) { + return; + } + + if (flag & 2) { + sp1C.x = f; + sp1C.y = g; + sp1C.z = h; + if (gViewUpdateCamera != NULL) { + gd_rotate_and_translate_vec3f(&sp1C, &gViewUpdateCamera->unkE8); + } + gd_dl_load_trans_matrix(sp1C.x, sp1C.y, sp1C.z); + } + draw_shape_faces(shape); + split_timer("drawshape2d"); +} + +void draw_light(struct ObjLight *light) { + struct GdVec3f sp94; + Mat4f sp54; + UNUSED Mat4f *uMatPtr; + UNUSED f32 uMultiplier; + struct ObjShape *shape; + + if (sSceneProcessType == FIND_PICKS) { + return; + } + + sLightColours[0].r = light->colour.r; + sLightColours[0].g = light->colour.g; + sLightColours[0].b = light->colour.b; + + if (light->flags & LIGHT_UNK02) { + gd_set_identity_mat4(&sp54); + sp94.x = -light->unk80.x; + sp94.y = -light->unk80.y; + sp94.z = -light->unk80.z; + gd_create_origin_lookat(&sp54, &sp94, 0.0f); + uMultiplier = light->unk38 / 45.0; + shape = gSpotShape; + uMatPtr = &sp54; + } else { + uMultiplier = 1.0f; + shape = light->unk9C; + uMatPtr = NULL; + if (++sLightDlCounter >= 17) { + sLightDlCounter = 1; + } + shape->unk50 = sLightDlCounter; + } + + draw_shape_2d(shape, 2, 1.0f, 1.0f, 1.0f, light->position.x, light->position.y, light->position.z, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1, 0); +} + +void draw_material(struct ObjMaterial *mtl) { + s32 mtlType = mtl->type; // 24 + + if (mtlType == GD_MTL_SHINE_DL) { + if (sPhongLight != NULL && sPhongLight->unk30 > 0.0f) { + if (gViewUpdateCamera != NULL) { + gd_dl_hilite(mtl->gddlNumber, gViewUpdateCamera, &sPhongLight->position, + &sLightPositionOffset, &sPhongLightPosition, &sPhongLight->colour); + } else { + fatal_printf("draw_material() no active camera for phong"); + } + } else { + mtlType = GD_MTL_BREAK; + } + } + if (sUseSelectedColor == FALSE) { + gd_dl_material_lighting(mtl->gddlNumber, &mtl->Kd, mtlType); + } else { + gd_dl_material_lighting(mtl->gddlNumber, sSelectedColour, GD_MTL_LIGHTS); + } +} + +/** + * Create a `GdDisplayList` and store its number in the input `ObjMaterial` + * if this material doesn't have one + */ +void create_mtl_gddl_if_empty(struct ObjMaterial *mtl) { + if (mtl->gddlNumber == 0) { + mtl->gddlNumber = create_mtl_gddl(mtl->type); + } +} + +/** + * A function for checking if an `ObjFace` has bad vertices. These could be either + * unconverted vertex data, or old vertex structures (like `BetaVtx`) + * @note Not called + */ +void check_face_bad_vtx(struct ObjFace *face) { + s32 i; + struct ObjVertex *vtx; + + for (i = 0; i < face->vtxCount; i++) { + vtx = face->vertices[i]; + // These seem to be checks against bad conversions, or an outdated vertex structure..? + if ((uintptr_t) vtx == 39) { + gd_printf("bad1\n"); + return; + } + if ((uintptr_t) vtx->gbiVerts == 0x3F800000) { + fatal_printf("bad2 %x,%d,%d,%d\n", (u32) (uintptr_t) vtx, vtx->scaleFactor, vtx->id, vtx->header.type); + } + } +} + +/** + * @brief Convert a numeric index into pointer to a struct GdColour + * + * A simple switch case to convert from index @p idx to a pointer to the + * three f32 GdColour structure. Goddard stored the index in a structure, + * and uses this function to get the colour RGB values if needed. + * -1 uses the environment colour. + * A possible enhancement for this is to ennumerate all colours, and then + * use those enumerations and/or enum type where ever a colour is requested + * + * @param idx Index of colour + * @return Pointer to a GdColour struct + */ +struct GdColour *gd_get_colour(s32 idx) { + switch (idx) { + case COLOUR_BLACK: + return &sClrBlack; + break; + case COLOUR_WHITE: + return &sClrWhite; + break; + case COLOUR_RED: + return &sClrRed; + break; + case COLOUR_GREEN: + return &sClrGreen; + break; + case COLOUR_BLUE: + return &sClrBlue; + break; + case COLOUR_GRAY: + return &sClrGrey; + break; + case COLOUR_DARK_GRAY: + return &sClrDarkGrey; + break; + case COLOUR_DARK_BLUE: + return &sClrErrDarkBlue; + break; + case COLOUR_BLACK2: + return &sClrBlack; + break; + case COLOUR_YELLOW: + return &sClrYellow; + break; + case COLOUR_PINK: + return &sClrPink; + break; + case -1: + return &sLightColours[0]; + break; + default: + return NULL; + } +} + +/** + * Uncalled function that would render a triangle + * @note Not called + */ +void Unknown80178ECC(f32 v0X, f32 v0Y, f32 v0Z, f32 v1X, f32 v1Y, f32 v1Z) { + f32 difY = v1Y - v0Y; + f32 difX = v1X - v0X; + f32 difZ = v1Z - v0Z; + + gd_dl_make_triangle(v0X, v0Y, v0Z, v1X, v1Y, v1Z, v0X + difY * 0.1, v0Y + difX * 0.1, v0Z + difZ * 0.1); +} + +/** + * Rendering function for `ObjFace` structures. It has a fair amount + * of stub code + */ +void draw_face(struct ObjFace *face) { + struct ObjVertex *vtx; // 3c + f32 z; // 38 + f32 y; // 34 + f32 x; // 30 + UNUSED u8 pad[12]; + s32 i; // 20; also used to store mtl's gddl number + s32 hasTextCoords; // 1c + Vtx *gbiVtx; // 18 + + imin("draw_face"); + hasTextCoords = FALSE; + if (sUseSelectedColor == FALSE && face->mtlId >= 0) // -1 == colored face + { + if (face->mtl != NULL) { + if ((i = face->mtl->gddlNumber) != 0) { + if (i != sUpdateViewState.mtlDlNum) { + gd_dl_flush_vertices(); + branch_to_gddl(i); + sUpdateViewState.mtlDlNum = i; + } + } + } + + if (FALSE) { + } + } + + check_tri_display(face->vtxCount); + + if (!gGdUseVtxNormal) { + set_Vtx_norm_buf_1(&face->normal); + } + + for (i = 0; i < face->vtxCount; i++) { + vtx = face->vertices[i]; + x = vtx->pos.x; + y = vtx->pos.y; + z = vtx->pos.z; + if (gGdUseVtxNormal) { + set_Vtx_norm_buf_2(&vtx->normal); + } + //! @bug This function seems to have some parts based on older versions of ObjVertex + //! as the struct requests fields passed the end of an ObjVertex. + //! The bad code is statically unreachable, so... + if (hasTextCoords) { + set_vtx_tc_buf(((struct BetaVtx *) vtx)->s, ((struct BetaVtx *) vtx)->t); + } + + gbiVtx = gd_dl_make_vertex(x, y, z, vtx->alpha); + + if (gbiVtx != NULL) { + vtx->gbiVerts = make_vtx_link(vtx->gbiVerts, gbiVtx); + } + } + func_8019FEF0(); + imout(); +} + +/** + * Render a filled rectangle from (`ulx`, `uly`) to (`lrx`, `lry`). + * + * @param color `GdColour` index + * @param ulx,uly upper left point + * @param lrx,lry lower right point + */ +void draw_rect_fill(s32 color, f32 ulx, f32 uly, f32 lrx, f32 lry) { + gd_dl_set_fill(gd_get_colour(color)); + gd_draw_rect(ulx, uly, lrx, lry); +} + +/** + * Render a stroked rectangle (aka border box) from (`ulx`, `uly`) to (`lrx`, `lry`). + * + * @param color `GdColour` index + * @param ulx,uly upper left point + * @param lrx,lry lower right point + */ +void draw_rect_stroke(s32 color, f32 ulx, f32 uly, f32 lrx, f32 lry) { + gd_dl_set_fill(gd_get_colour(color)); + gd_draw_border_rect(ulx, uly, lrx, lry); +} + +/** + * Uncalled function that calls other orphan stub functions. + * @note Not called + */ +void Unknown801792F0(struct GdObj *obj) { + char objId[32]; + struct GdVec3f objPos; + + format_object_id(objId, obj); + set_cur_dynobj(obj); + d_get_world_pos(&objPos); + func_801A4438(objPos.x, objPos.y, objPos.z); + stub_draw_label_text(objId); +} + +/** + * Draws a label + */ +void draw_label(struct ObjLabel *label) { + struct GdVec3f position; + char strbuf[0x100]; + UNUSED u8 unused[16]; + struct ObjValPtr *valptr; + union ObjVarVal varval; + valptrproc_t valfn = label->valfn; + + if ((valptr = label->valptr) != NULL) { + if (valptr->flag == 0x40000) { + // position is offset from object + set_cur_dynobj(valptr->obj); + d_get_world_pos(&position); + } else { + // position is absolute + position.x = position.y = position.z = 0.0f; + } + + switch (valptr->datatype) { + case OBJ_VALUE_FLOAT: + get_objvalue(&varval, OBJ_VALUE_FLOAT, valptr->obj, valptr->offset); + if (valfn != NULL) { + valfn(&varval, varval); + } + sprintf(strbuf, label->fmtstr, varval.f); + break; + case OBJ_VALUE_INT: + get_objvalue(&varval, OBJ_VALUE_INT, valptr->obj, valptr->offset); + if (valfn != NULL) { + valfn(&varval, varval); + } + sprintf(strbuf, label->fmtstr, varval.i); + break; + default: + if (label->fmtstr != NULL) { + gd_strcpy(strbuf, label->fmtstr); + } else { + gd_strcpy(strbuf, "NONAME"); + } + break; + } + } else { + position.x = position.y = position.z = 0.0f; + if (label->fmtstr != NULL) { + gd_strcpy(strbuf, label->fmtstr); + } else { + gd_strcpy(strbuf, "NONAME"); + } + } + position.x += label->position.x; + position.y += label->position.y; + position.z += label->position.z; + func_801A4438(position.x, position.y, position.z); + stub_renderer_10(label->unk30); + stub_draw_label_text(strbuf); +} + +/* 227DF8 -> 227F3C; orig name: Proc80179628 */ +void draw_net(struct ObjNet *self) { + struct ObjNet *net = self; + s32 netColor; + UNUSED u8 unused[80]; + + if (sSceneProcessType == FIND_PICKS) { + return; + } + + if (net->header.drawFlags & OBJ_HIGHLIGHTED) { + netColor = COLOUR_YELLOW; + } else { + netColor = net->colourNum; + } + + if (net->shapePtr != NULL) { + draw_shape(net->shapePtr, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, netColor, &net->mat168); + } + + if (net->unk1C8 != NULL) { + draw_group(net->unk1C8); + } +} + +/** + * Draws a gadget + */ +void draw_gadget(struct ObjGadget *gdgt) { + s32 colour = 0; + + if (gdgt->colourNum != 0) { + colour = gdgt->colourNum; + } + + draw_rect_fill(colour, + gdgt->worldPos.x, + gdgt->worldPos.y, + gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, + gdgt->worldPos.y + gdgt->size.y); + + if (gdgt->header.drawFlags & OBJ_HIGHLIGHTED) { + draw_rect_stroke(COLOUR_YELLOW, + gdgt->worldPos.x, + gdgt->worldPos.y, + gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, + gdgt->worldPos.y + gdgt->size.y); + } + gdgt->header.drawFlags &= ~OBJ_HIGHLIGHTED; +} + +/* 22803C -> 22829C */ +void draw_camera(struct ObjCamera *cam) { + struct GdVec3f sp44; + UNUSED f32 sp40 = 0.0f; + + sp44.x = 0.0f; + sp44.y = 0.0f; + sp44.z = 0.0f; + if (cam->unk30 != NULL) { + set_cur_dynobj(cam->unk30); + d_get_world_pos(&sp44); + sp44.x += cam->lookAt.x; + sp44.y += cam->lookAt.y; + sp44.z += cam->lookAt.z; + ; // needed to match + } else { + sp44.x = cam->lookAt.x; + sp44.y = cam->lookAt.y; + sp44.z = cam->lookAt.z; + } + + if (0) { + // dead code + gd_printf("%f,%f,%f\n", cam->worldPos.x, cam->worldPos.y, cam->worldPos.z); + } + + if (ABS(cam->worldPos.x - sp44.x) + ABS(cam->worldPos.z - sp44.z) == 0.0f) { + gd_printf("Draw_Camera(): Zero view distance\n"); + return; + } + gd_dl_lookat(cam, cam->worldPos.x, cam->worldPos.y, cam->worldPos.z, sp44.x, sp44.y, sp44.z, cam->unkA4); +} + +/** + * Forms uncalled recursive loop with func_80179B64(). + * This function seems to turn off the otherwise unused `OBJ_DRAW_UNK01` flag + * for the GdObj.drawFlags + * @note Not called + */ +void Unknown80179ACC(struct GdObj *obj) { + switch (obj->type) { + case OBJ_TYPE_NETS: + if (((struct ObjNet *) obj)->unk1C8 != NULL) { + func_80179B64(((struct ObjNet *) obj)->unk1C8); + } + break; + default: + break; + } + obj->drawFlags &= ~OBJ_DRAW_UNK01; +} + +/** + * Forms uncalled recursive loop with Unknown80179ACC() + * @note Not called + */ +void func_80179B64(struct ObjGroup *group) { + apply_to_obj_types_in_group(OBJ_TYPE_LABELS | OBJ_TYPE_GADGETS | OBJ_TYPE_CAMERAS | OBJ_TYPE_NETS + | OBJ_TYPE_JOINTS | OBJ_TYPE_BONES, + (applyproc_t) Unknown80179ACC, group); +} + +/* 22836C -> 228498 */ +void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, struct ObjView *view) { + gd_rotate_and_translate_vec3f(pos, &cam->unkE8); + if (pos->z > -256.0f) { + return; + } + + pos->x *= 256.0 / -pos->z; + pos->y *= 256.0 / pos->z; + pos->x += view->lowerRight.x / 2.0f; + pos->y += view->lowerRight.y / 2.0f; +} + +/** + * Check if the current cursor position is near enough to @p input to + * grab that `GdObj`. The range is +/- 20 units for being close to a + * grab point. + * + * If the object can be grabbed, its information is stored in a buffer by + * `store_in_pickbuf()`. + * + * @param input `GdObj` to check position of + * @return void + */ +void check_grabable_click(struct GdObj *input) { + struct GdVec3f objPos; + UNUSED u8 unused[12]; + struct GdObj *obj; + Mat4f *mtx; + + if (gViewUpdateCamera == NULL) { + return; + } + obj = input; + if (!(obj->drawFlags & OBJ_IS_GRABBALE)) { + return; + } + + set_cur_dynobj(obj); + mtx = d_get_rot_mtx_ptr(); + objPos.x = (*mtx)[3][0]; + objPos.y = (*mtx)[3][1]; + objPos.z = (*mtx)[3][2]; + world_pos_to_screen_coords(&objPos, gViewUpdateCamera, sUpdateViewState.view); + if (ABS(gGdCtrl.csrX - objPos.x) < 20.0f) { + if (ABS(gGdCtrl.csrY - objPos.y) < 20.0f) { + // store (size, Obj Type, Obj Index) in s16 pick buffer array + store_in_pickbuf(2); + store_in_pickbuf(obj->type); + store_in_pickbuf(obj->index); + sGrabCords.x = objPos.x; + sGrabCords.y = objPos.y; + } + } +} + +/** + * The main function for rendering the components of an `ObjView`. It called + * both for drawing the various `GdObj` primatives as well as when checking + * the location of a cursor click. + * @note This has to be called from update_view() due to that function setting + * state variables on which this function relies + * + * @param process determines if this is rendering the scene + * or just checking click location + * @param interactables components of `ObjView` + * @param lightgrp lights of `ObjView + */ +void drawscene(enum SceneType process, struct ObjGroup *interactables, struct ObjGroup *lightgrp) { + UNUSED u8 unused[16]; + + restart_timer("drawscene"); + imin("draw_scene()"); + sUnreadShapeFlag = 0; + sUpdateViewState.unreadCounter = 0; + restart_timer("draw1"); + set_gd_mtx_parameters(G_MTX_PROJECTION | G_MTX_MUL | G_MTX_PUSH); + if (sUpdateViewState.view->projectionType == 1) { + gd_create_perspective_matrix(sUpdateViewState.view->clipping.z, + sUpdateViewState.view->lowerRight.x / sUpdateViewState.view->lowerRight.y, + sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); + } else { + gd_create_ortho_matrix( + -sUpdateViewState.view->lowerRight.x / 2.0, sUpdateViewState.view->lowerRight.x / 2.0, + -sUpdateViewState.view->lowerRight.y / 2.0, sUpdateViewState.view->lowerRight.y / 2.0, + sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); + } + + if (lightgrp != NULL) { + set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_PARTICLES, + (applyproc_t) apply_obj_draw_fn, lightgrp); + set_gd_mtx_parameters(G_MTX_PROJECTION | G_MTX_MUL | G_MTX_PUSH); + } + + if (gViewUpdateCamera != NULL) { + draw_camera(gViewUpdateCamera); + } else { + gd_dl_mul_trans_matrix(0.0f, 0.0f, -1000.0f); + } + + setup_lights(); + set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + gd_dl_push_matrix(); + sSceneProcessType = process; + + if ((sNumActiveLights = sUpdateViewState.view->flags & VIEW_LIGHT)) { + sUpdateViewState.view->flags &= ~VIEW_LIGHT; + } + + sNumActiveLights = 1; + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) register_light, gGdLightGroup); + split_timer("draw1"); + restart_timer("drawobj"); + imin("process_group"); + if (sSceneProcessType == FIND_PICKS) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) check_grabable_click, interactables); + } else { + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_GADGETS | OBJ_TYPE_NETS + | OBJ_TYPE_PARTICLES, + (applyproc_t) apply_obj_draw_fn, interactables); + } + imout(); + split_timer("drawobj"); + gd_setproperty(GD_PROP_LIGHTING, 0.0f, 0.0f, 0.0f); + apply_to_obj_types_in_group(OBJ_TYPE_LABELS, (applyproc_t) apply_obj_draw_fn, interactables); + gd_setproperty(GD_PROP_LIGHTING, 1.0f, 0.0f, 0.0f); + gd_dl_pop_matrix(); + imout(); + split_timer("drawscene"); + return; +} + +/** + * A drawing function that does nothing. This function is used for + * `GdObj`s that don't need to be rendered + */ +void draw_nothing(UNUSED struct GdObj *nop) { +} + +/** + * Render the `faceGroup` of an `ObjShape`. This is called from + * draw_shape() and draw_shape_2d(), or when creating the shape + * `GdDisplayList` when calling create_shape_gddl() + */ +void draw_shape_faces(struct ObjShape *shape) { + sUpdateViewState.mtlDlNum = 0; + sUpdateViewState.unreadCounter = 0; + gddl_is_loading_stub_dl(FALSE); + sUnreadShapeFlag = (s32) shape->flag & 1; + set_render_alpha(shape->alpha); + if (shape->dlNums[gGdFrameBufNum] != 0) { + draw_indexed_dl(shape->dlNums[gGdFrameBufNum], shape->unk50); + } else if (shape->faceGroup != NULL) { + func_801A0038(); + draw_group(shape->faceGroup); + gd_dl_flush_vertices(); + } +} + +/** + * Rendering function for `ObjParticle`. + */ +void draw_particle(struct GdObj *obj) { + struct ObjParticle *ptc = (struct ObjParticle *) obj; + UNUSED u8 unused1[16]; + struct GdColour *white; + struct GdColour *black; + f32 brightness; + UNUSED u8 unused2[16]; + + if (ptc->timeout > 0) { + white = sColourPalette[0]; + black = sWhiteBlack[1]; + brightness = ptc->timeout / 10.0; + sLightColours[0].r = (white->r - black->r) * brightness + black->r; + sLightColours[0].g = (white->g - black->g) * brightness + black->g; + sLightColours[0].b = (white->b - black->b) * brightness + black->b; + ; // needed to match + } else { + sLightColours[0].r = 0.0f; + sLightColours[0].g = 0.0f; + sLightColours[0].b = 0.0f; + } + + if (ptc->timeout > 0) { + ptc->shapePtr->unk50 = ptc->timeout; + draw_shape_2d(ptc->shapePtr, 2, 1.0f, 1.0f, 1.0f, ptc->pos.x, ptc->pos.y, ptc->pos.z, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1, 0); + } + if (ptc->unk60 == 3) { + if (ptc->subParticlesGrp != NULL) { + draw_group(ptc->subParticlesGrp); + } + } +} + +/** + * Rendering fucntion for `ObjBone`. + * + * @note This function returns before doing any work. It seems + * that Goddard moved away from using bones in the final code + */ +void draw_bone(struct GdObj *obj) { + struct ObjBone *bone = (struct ObjBone *) obj; + UNUSED u8 unused1[4]; + s32 colour; + UNUSED u8 unused2[4]; + struct GdVec3f scale; // guess + + return; + + // dead code + scale.x = 1.0f; + scale.y = 1.0f; + scale.z = bone->unkF8 / 50.0f; + + if (bone->header.drawFlags & OBJ_HIGHLIGHTED) { + colour = COLOUR_YELLOW; + } else { + colour = bone->colourNum; + } + bone->header.drawFlags &= ~OBJ_HIGHLIGHTED; + + if (sSceneProcessType != FIND_PICKS) { + draw_shape(bone->shapePtr, 0x1B, scale.x, scale.y, scale.z, bone->worldPos.x, bone->worldPos.y, + bone->worldPos.z, 0.0f, 0.0f, 0.0f, bone->unk28.x, bone->unk28.y, bone->unk28.z, colour, + &bone->mat70); + } +} + +/** + * Rendering function for `ObjJoint`. + */ +void draw_joint(struct GdObj *obj) { + struct ObjJoint *joint = (struct ObjJoint *) obj; + UNUSED u8 unused1[4]; + UNUSED f32 sp7C = 70.0f; + UNUSED u8 unused2[4]; + UNUSED s32 sp74 = 1; + s32 colour; + UNUSED u8 unused[8]; + struct ObjShape *boneShape; + UNUSED u8 unused3[28]; + + if ((boneShape = joint->shapePtr) == NULL) { + return; + } + + if (joint->header.drawFlags & OBJ_HIGHLIGHTED) { + colour = COLOUR_YELLOW; + } else { + colour = joint->colourNum; + } + + draw_shape(boneShape, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + colour, &joint->mat128); +} + +/** + * Call `apply_obj_draw_fn()` to all `GdObj` in input `ObjGroup` + * + * @param grp `ObjGroup` of objects to draw + * @return void + */ +void draw_group(struct ObjGroup *grp) { + if (grp == NULL) { + fatal_print("Draw_Group: Bad group definition!"); + } + + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) apply_obj_draw_fn, grp); +} + +/** + * Rendering function for `ObjPlane`. + */ +void draw_plane(struct GdObj *obj) { + struct ObjPlane *plane = (struct ObjPlane *) obj; + + if (obj->drawFlags & OBJ_HIGHLIGHTED) { + obj->drawFlags &= ~OBJ_HIGHLIGHTED; + ; // needed to match; presumably setting up the color to draw the plane with + } else { + sUseSelectedColor = FALSE; + } + draw_face(plane->unk40); +} + +/** + * Apply `GdObj.objDrawFn` to the input `GdObj` if that object is draw-able. + * + * @param obj `GdObj` to draw + * @return void + */ +void apply_obj_draw_fn(struct GdObj *obj) { + if (obj == NULL) { + fatal_print("Bad object!"); + } + if (obj->drawFlags & OBJ_INVISIBLE) { + return; + } + + obj->objDrawFn(obj); +} + +/** + * Count input `ObjLight` as an active light, if it wasn't already counted. + */ +void register_light(struct ObjLight *light) { + set_light_id(light->id); + gd_setproperty(GD_PROP_LIGHTING, 2.0f, 0.0f, 0.0f); + if (light->flags & LIGHT_NEW_UNCOUNTED) { + sNumActiveLights++; + } + light->flags &= ~LIGHT_NEW_UNCOUNTED; +} + +/* 229180 -> 229564 */ +void Proc8017A980(struct ObjLight *light) { + f32 sp24; // diffuse factor? + f32 sp20; + f32 sp1C; + + light->colour.r = light->diffuse.r * light->unk30; + light->colour.g = light->diffuse.g * light->unk30; + light->colour.b = light->diffuse.b * light->unk30; + sLightPositionCache[light->id].x = light->position.x - sLightPositionOffset.x; + sLightPositionCache[light->id].y = light->position.y - sLightPositionOffset.y; + sLightPositionCache[light->id].z = light->position.z - sLightPositionOffset.z; + gd_normalize_vec3f(&sLightPositionCache[light->id]); + if (light->flags & LIGHT_UNK20) { + sPhongLightPosition.x = sLightPositionCache[light->id].x; + sPhongLightPosition.y = sLightPositionCache[light->id].y; + sPhongLightPosition.z = sLightPositionCache[light->id].z; + sPhongLight = light; + } + sp24 = light->unk30; + if (light->flags & LIGHT_UNK02) { + sp20 = -gd_dot_vec3f(&sLightPositionCache[light->id], &light->unk80); + sp1C = 1.0 - light->unk38 / 90.0; + if (sp20 > sp1C) { + sp20 = (sp20 - sp1C) * (1.0 / (1.0 - sp1C)); + if (sp20 > 1.0) { + sp20 = 1.0; + } else if (sp20 < 0.0f) { + sp20 = 0.0f; + } + } else { + sp20 = 0.0f; + } + sp24 *= sp20; + } + set_light_id(light->id); + gd_setproperty(GD_PROP_DIFUSE_COLOUR, light->diffuse.r * sp24, light->diffuse.g * sp24, + light->diffuse.b * sp24); + gd_setproperty(GD_PROP_LIGHT_DIR, sLightPositionCache[light->id].x, + sLightPositionCache[light->id].y, sLightPositionCache[light->id].z); + gd_setproperty(GD_PROP_LIGHTING, 2.0f, 0.0f, 0.0f); +} + +/* 229568 -> 229658; orig name: func_8017AD98 */ +void update_shaders(struct ObjShape *shape, struct GdVec3f *offset) { + restart_timer("updateshaders"); + stash_current_gddl(); + sLightPositionOffset.x = offset->x; + sLightPositionOffset.y = offset->y; + sLightPositionOffset.z = offset->z; + sPhongLight = NULL; + if (gGdLightGroup != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) Proc8017A980, gGdLightGroup); + } + if (shape->mtlGroup != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t) apply_obj_draw_fn, + shape->mtlGroup); + } + pop_gddl_stash(); + split_timer("updateshaders"); +} + +/** + * Create `GdDisplayList`s for any `ObjMaterial`s in `shape` that don't already + * have a GdDL. Doesn't do anything if `shape`'s `mtlGroup` is NULL + * + * @param shape Input `ObjShape` to create material GdDLs for + * @return void + */ +void create_shape_mtl_gddls(struct ObjShape *shape) { + if (shape->mtlGroup != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t) create_mtl_gddl_if_empty, + shape->mtlGroup); + } +} + +/** + * Uncalled function that calls a stubbed function (`stub_objects_1()`) for all + * `GdObj`s in @p grp + * + * @param grp Unknown group of objects + * @return void + * @note Not called + */ +void unref_8017AEDC(struct ObjGroup *grp) { + register struct ListNode *link = grp->firstMember; + + while (link != NULL) { + struct GdObj *obj = link->obj; + + stub_objects_1(grp, obj); + link = link->next; + } +} + +/** + * Start a new `GdDisplayList` struct and store its reference index + * in the input `ObjShape`. + * + * @param s `ObjShape` to create GdDL for + * @return Either `-1` if the DL couldn't be created, + * or the created DL's reference index + * @bug Nothing is returned if the DL is created + * @note Contains string literals that suggest a removed `printf` call + */ +#ifdef AVOID_UB +void +#else +s32 +#endif +create_shape_gddl(struct ObjShape *s) { + struct ObjShape *shape = s; // 24 + s32 shapedl; // 20 + UNUSED s32 enddl; // 1C + + create_shape_mtl_gddls(shape); + shapedl = gd_startdisplist(7); + if (shapedl == 0) { +#ifdef AVOID_UB + return; +#else + return -1; +#endif + } + + setup_lights(); + sUseSelectedColor = FALSE; + if (shape->unk3C == 0) { + draw_shape_faces(shape); + } + enddl = gd_enddlsplist_parent(); + shape->dlNums[0] = shapedl; + shape->dlNums[1] = shapedl; + + if (shape->name[0] != '\0') { + printf("Generated '%s' (%d) display list ok.(%d)\n", shape->name, shapedl, enddl); + } else { + printf("Generated 'UNKNOWN' (%d) display list ok.(%d)\n", shapedl, enddl); + } +} + +/** + * Create `GdDisplayList` structs for all `ObjShapes` in `grp` by calling + * `create_shape_gddl()`. + * + * @param grp `ObjGroup` containing `ObjShape` to create GdDLs for + * @return void + * @note Contains string literals that suggest a removed `printf` call + */ +void create_gddl_for_shapes(struct ObjGroup *grp) { + UNUSED s32 shapedls = + apply_to_obj_types_in_group(OBJ_TYPE_SHAPES, (applyproc_t) create_shape_gddl, grp); + printf("made %d display lists\n", shapedls); +} + +/** + * Map material id's to `ObjMaterial` pointers for an `ObjGroup` of `ObjFace` structs. + * This is the final function used in dynlist processing (see `chk_shapegen()`) + * + * @param[in,out] faces `ObjGroup` of `ObjFace` structs to map over + * @param[in] mtls `ObjGroup` of `ObjMaterial` structs to map ids to pointers + * @return void + */ +void map_face_materials(struct ObjGroup *faces, struct ObjGroup *mtls) { + struct ObjFace *face; + register struct ListNode *linkFaces; + struct GdObj *temp; + register struct ListNode *linkMtls; + struct ObjMaterial *mtl; + + linkFaces = faces->firstMember; + while (linkFaces != NULL) { + temp = linkFaces->obj; + face = (struct ObjFace *) temp; + linkMtls = mtls->firstMember; + while (linkMtls != NULL) { + mtl = (struct ObjMaterial *) linkMtls->obj; + if (mtl->id == face->mtlId) { + break; + } + linkMtls = linkMtls->next; + } + + if (linkMtls != NULL) { + face->mtl = mtl; + } + + linkFaces = linkFaces->next; + } +} + +/** + * @brief Calculate the normal for @p vtx by averaging the normals of all + * `ObjFaces` in @p facegrp + * + * Calculate the normal for the input `ObjVetex` @p vtx based on the + * `ObjFace` structures in @p facegrp of which that vertex is a part. + * + * @param vtx `ObjVertex` to update normal + * @param facegrp `ObjGroup` of `ObjFace` structures that use @p vtx + * @return void + */ +static void calc_vtx_normal(struct ObjVertex *vtx, struct ObjGroup *facegrp) { + s32 i; + s32 faceCount; + register struct ListNode *node; + struct ObjFace *curFace; + + vtx->normal.x = vtx->normal.y = vtx->normal.z = 0.0f; + + faceCount = 0; + node = facegrp->firstMember; + while (node != NULL) { + curFace = (struct ObjFace *) node->obj; + for (i = 0; i < curFace->vtxCount; i++) { + if (curFace->vertices[i] == vtx) { + vtx->normal.x += curFace->normal.x; + vtx->normal.y += curFace->normal.y; + vtx->normal.z += curFace->normal.z; + faceCount++; + } + } + node = node->next; + } + if (faceCount != 0) { + vtx->normal.x /= faceCount; + vtx->normal.y /= faceCount; + vtx->normal.z /= faceCount; + } +} + +/** + * @brief Convert vertex indices in an `ObjFace` into pointers and computes the + * face's normal + * + * Using the group of `ObjVertex` or `ObjParticle` structures in @p verts, + * convert indices in @p face into pointers. The indices are indices + * into the list contained in @p vertexGrp group + * + * @param face `ObjFace` to find vertices for + * @param vertexGrp `ObjGroup` to index in for `ObjVertex` or `ObjPaticle` structures + * @return void + */ +static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp) { + s32 i; + u32 currIndex; + struct ListNode *node; + + for (i = 0; i < face->vtxCount; i++) { + // find the vertex or particle whose index in vertexGrp equals face->vertices[i] + node = vertexGrp->firstMember; + currIndex = 0; + while (node != NULL) { + if (node->obj->type == OBJ_TYPE_VERTICES || node->obj->type == OBJ_TYPE_PARTICLES) { + if (currIndex++ == (u32) (uintptr_t) face->vertices[i]) { + break; + } + } + node = node->next; + } + if (node == NULL) { + fatal_printf("find_thisface_verts(): Vertex not found"); + } + + // set the vertex to point to the resolved `ObjVertex` + face->vertices[i] = (struct ObjVertex *) node->obj; + } + calc_face_normal(face); +} + +/** + * @brief Convert vertex ID numbers for an `ObjGroup` of `ObjFace`s into pointers + * to `ObjVertex` structures + * + * This function takes an `ObjGroup` of `ObjFace` structures whose `vertices` field + * has indices and not pointers. These indices are transformed into pointers of + * `ObjVertex` or `ObjParticle` structures from the @p vtxgrp `ObjGroup`. + * + * @param facegrp `ObjGroup` of `ObjFaces` to map vertex indices to pointers + * @param vtxgrp `ObjGroup` of `ObjVertices`/`ObjParticles` to be mapped against + * @return void + * @note It seems that this function was replaced by `chk_shapegen()`, which performs + * a very similar task... + */ +void map_vertices(struct ObjGroup *facegrp, struct ObjGroup *vtxgrp) { + register struct ListNode *faceNode; + struct ObjFace *curFace; + register struct ListNode *vtxNode; + struct ObjVertex *vtx; + + imin("map_vertices"); + + // resolve vertex indices to actual vertices + faceNode = facegrp->firstMember; + while (faceNode != NULL) { + curFace = (struct ObjFace *) faceNode->obj; + find_thisface_verts(curFace, vtxgrp); + faceNode = faceNode->next; + } + + // compute normals of vertices in vtxgrp + vtxNode = vtxgrp->firstMember; + while (vtxNode != NULL) { + vtx = (struct ObjVertex *) vtxNode->obj; + calc_vtx_normal(vtx, facegrp); + vtxNode = vtxNode->next; + } + + imout(); +} + +/** + * Unselect a grabbable objects + * + * @param obj `GdObj` to unselect + * @return void + * @note Not Called + */ +void unpick_obj(struct GdObj *obj) { + struct GdObj *why = obj; + if (why->drawFlags & OBJ_IS_GRABBALE) { + why->drawFlags &= ~(OBJ_PICKED | OBJ_HIGHLIGHTED); + } +} + +/** + * @brief Find the closest object to the cursor on an A-button press + * + * This function is applied to all objects in an `ObjView.components` group + * to find the object closest to the cursor when there's an A press + * + * @param input `GdObj` to check + * @return void + */ +void find_closest_pickable_obj(struct GdObj *input) { + struct GdObj *obj = input; + UNUSED u8 unused[12]; + f32 distance; + + if (obj->drawFlags & OBJ_IS_GRABBALE) { + if (obj->index == sPickDataTemp) { + if (gViewUpdateCamera != NULL) { + distance = d_calc_world_dist_btwn(&gViewUpdateCamera->header, obj); + } else { + distance = 0.0f; + } + + if (distance < sPickObjDistance) { + sPickObjDistance = distance; + sPickedObject = obj; + } + } + } +} + +/** + * @brief Set the global view camera if not already set. + * + * This function is used to find the first `ObjCamera` when running `update_view()`. + * + * @param cam `ObjCamera` to set to the update camera, if possible + * @return void + */ +void set_view_update_camera(struct ObjCamera *cam) { + if (gViewUpdateCamera != NULL) { + return; + } + + gViewUpdateCamera = cam; +} + +/** + * @brief The main per-frame function for handling a view + * + * This function handles updating and rendering a given `ObjView` structure. + * It also handles the A button input for grabbing an area of an `ObjShape` + * that is contained in the `ObjView.components` group + * + * @param view The `ObjView` to update + * @return void + */ +void update_view(struct ObjView *view) { + s32 i; + s32 pickOffset; + s32 pickDataSize; + s32 j; + s32 pickDataIdx; + s32 pickedObjType; + char objTypeAbbr[0x100]; + + sUpdateViewState.shapesDrawn = 0; + sUpdateViewState.unused18 = 0; + + if (!(view->flags & VIEW_UPDATE)) { + view->flags &= ~VIEW_WAS_UPDATED; + return; + } + + imin("UpdateView()"); + if (view->proc != NULL) { + view->proc(view); + } + + if (!(view->flags & VIEW_WAS_UPDATED)) { + view->flags |= VIEW_WAS_UPDATED; + } + + gViewUpdateCamera = NULL; + if (view->components != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t) set_view_update_camera, + view->components); + view->activeCam = gViewUpdateCamera; + + if (view->activeCam != NULL) { + gViewUpdateCamera->unk18C = view; + } + } + + if (view->flags & VIEW_MOVEMENT) { + split_timer("dlgen"); + restart_timer("dynamics"); + proc_view_movement(view); + split_timer("dynamics"); + restart_timer("dlgen"); + gViewUpdateCamera = view->activeCam; + } + + if (!(view->flags & VIEW_DRAW)) { + imout(); + return; + } + + sUpdateViewState.view = view; + set_active_view(view); + view->gdDlNum = gd_startdisplist(8); + start_view_dl(sUpdateViewState.view); + gd_shading(9); + + if (view->flags & (VIEW_UNK_2000 | VIEW_UNK_4000)) { + gd_set_one_cycle(); + } + + if (view->components != NULL) { + if (gGdCtrl.dragging) { + if (gd_getproperty(3, 0) != FALSE && gGdCtrl.startedDragging != FALSE) { + init_pick_buf(sPickBuffer, ARRAY_COUNT(sPickBuffer)); + drawscene(FIND_PICKS, sUpdateViewState.view->components, NULL); + pickOffset = get_cur_pickbuf_offset(sPickBuffer); + sPickDataTemp = 0; + sPickedObject = NULL; + sPickObjDistance = 10000000.0f; + + if (pickOffset < 0) { + fatal_printf("UpdateView(): Pick buffer too small"); + } else if (pickOffset > 0) { + pickDataIdx = 0; + for (i = 0; i < pickOffset; i++) { + pickDataSize = sPickBuffer[pickDataIdx++]; + if (pickDataSize != 0) { + switch ((pickedObjType = sPickBuffer[pickDataIdx++])) { + case OBJ_TYPE_JOINTS: + gd_strcpy(objTypeAbbr, "J"); + break; + case OBJ_TYPE_NETS: + gd_strcpy(objTypeAbbr, "N"); + break; + case OBJ_TYPE_PARTICLES: + gd_strcpy(objTypeAbbr, "P"); + break; + default: + gd_strcpy(objTypeAbbr, "?"); + break; + } + } + + if (pickDataSize >= 2) { + for (j = 0; j < pickDataSize - 1; j++) { + sPickDataTemp = sPickBuffer[pickDataIdx++]; + apply_to_obj_types_in_group(pickedObjType, + (applyproc_t) find_closest_pickable_obj, + sUpdateViewState.view->components); + } + } + } + } + + if (sPickedObject != NULL) { + sPickedObject->drawFlags |= OBJ_PICKED; + sPickedObject->drawFlags |= OBJ_HIGHLIGHTED; + sUpdateViewState.view->pickedObj = sPickedObject; + gGdCtrl.dragStartX = gGdCtrl.csrX = sGrabCords.x; + gGdCtrl.dragStartY = gGdCtrl.csrY = sGrabCords.y; + } + } + + find_and_drag_picked_object(sUpdateViewState.view->components); + } else // check for any previously picked objects, and turn off? + { + if (sUpdateViewState.view->pickedObj != NULL) { + sUpdateViewState.view->pickedObj->drawFlags &= ~OBJ_PICKED; + sUpdateViewState.view->pickedObj->drawFlags &= ~OBJ_HIGHLIGHTED; + sUpdateViewState.view->pickedObj = NULL; + } + } + + drawscene(RENDER_SCENE, sUpdateViewState.view->components, sUpdateViewState.view->lights); + } + + border_active_view(); + gd_enddlsplist_parent(); + imout(); + return; +} +/** + * Stub function. + * @note Not Called + */ +void stub_draw_objects_1(void) { +} diff --git a/src/goddard/draw_objects.h b/src/goddard/draw_objects.h new file mode 100644 index 00000000..10051de7 --- /dev/null +++ b/src/goddard/draw_objects.h @@ -0,0 +1,52 @@ +#ifndef GD_DRAW_OBJECTS_H +#define GD_DRAW_OBJECTS_H + +#include + +#include "gd_types.h" +#include "macros.h" + +// TODO: make this an enum without causing bss reordering +#define COLOUR_BLACK 0 +#define COLOUR_WHITE 1 +#define COLOUR_RED 2 +#define COLOUR_GREEN 3 +#define COLOUR_BLUE 4 +#define COLOUR_GRAY 5 +#define COLOUR_DARK_GRAY 6 +#define COLOUR_DARK_BLUE 7 +#define COLOUR_YELLOW 8 +#define COLOUR_PINK 9 +#define COLOUR_BLACK2 10 // same as COLOUR_BLACK + +// data +extern struct ObjCamera *gViewUpdateCamera; + +// bss +// this is unused, but it needs to be declared before gGdLightGroup +extern u8 gUnref_801B9B30[0x88]; +extern struct ObjGroup *gGdLightGroup; // ObjGroup* of ObjLights + +// functions +void draw_light(struct ObjLight *light); +void draw_material(struct ObjMaterial *mtl); +struct GdColour *gd_get_colour(s32 idx); +void draw_face(struct ObjFace *face); +void draw_label(struct ObjLabel *label); +void draw_net(struct ObjNet *self); +void draw_gadget(struct ObjGadget *gdgt); +void draw_camera(struct ObjCamera *cam); +void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, struct ObjView *view); +void draw_nothing(UNUSED struct GdObj *nop); +void draw_particle(struct GdObj *obj); +void draw_bone(struct GdObj *obj); +void draw_joint(struct GdObj *obj); +void draw_group(struct ObjGroup *grp); +void draw_plane(struct GdObj *obj); +void apply_obj_draw_fn(struct GdObj *obj); +void create_gddl_for_shapes(struct ObjGroup *grp); +void map_face_materials(struct ObjGroup *faces, struct ObjGroup *mtls); +void map_vertices(struct ObjGroup *facegrp, struct ObjGroup *vtxgrp); +void update_view(struct ObjView *view); + +#endif // GD_DRAW_OBJECTS_H diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c new file mode 100644 index 00000000..4b9f21c4 --- /dev/null +++ b/src/goddard/dynlist_proc.c @@ -0,0 +1,3140 @@ +#include +#include + +#include "bad_declarations.h" +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "objects.h" +#include "old_menu.h" +#include "particles.h" +#include "renderer.h" +#include "shape_helper.h" +#include "skin.h" + +/** + * @file dynlist_proc.c + * + * Functions for parsing and processing Goddard's DynList object format. + * It also has utility functions for abstracting at runtime over the various + * flavors of `GdObj`s. + */ + +// constants +/// Size of the dynamic object name buffer +#define DYNOBJ_NAME_SIZE 8 +/// Total number of dynamic `GdObj`s that can be created +#define DYNOBJ_LIST_SIZE 3000 +/// Maximum number of verticies supported when adding vertices node to an `ObjShape` +#define VTX_BUF_SIZE 3000 + +// types +/// Information about a dynamically created `GdObj` +struct DynObjInfo { + char name[DYNOBJ_NAME_SIZE]; + struct GdObj *obj; + s32 num; + s32 unk; +}; +/// @name DynList Accessors +/// Accessor marcos for easy interpretation of data in a `DynList` packet +///@{ +#define Dyn1AsInt(dyn) ((dyn)->w1.word) +#define Dyn1AsPtr(dyn) ((dyn)->w1.ptr) +#define Dyn1AsStr(dyn) ((dyn)->w1.str) +#define Dyn1AsName(dyn) ((DynObjName)((dyn)->w1.ptr)) + +#define Dyn2AsInt(dyn) ((dyn)->w2.word) +#define Dyn2AsPtr(dyn) ((dyn)->w2.ptr) +#define Dyn2AsStr(dyn) ((dyn)->w2.str) +#define Dyn2AsName(dyn) ((DynObjName)((dyn)->w2.ptr)) + +#define DynVec(dyn) (&(dyn)->vec) +#define DynVecX(dyn) ((dyn)->vec.x) +#define DynVecY(dyn) ((dyn)->vec.y) +#define DynVecZ(dyn) ((dyn)->vec.z) +///@} + +// data +static struct DynObjInfo *sGdDynObjList = NULL; // @ 801A8250; info for all loaded/made dynobjs +static struct GdObj *sDynListCurObj = NULL; // @ 801A8254 +static struct GdBoundingBox sNullBoundingBox = { // @ 801A8258 + 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0 +}; +static s32 sUseIntegerNames = FALSE; // if TRUE, then all DynNames are specified as integers + +// bss +static char sIntToStringBuf[DYNOBJ_NAME_SIZE]; ///< buffer for returning formated string from + ///< `integer_name_to_string()` +static struct DynObjInfo sNullDynObjInfo; // @ 801B9F08 +static char sDynNameSuffix[DYNOBJ_NAME_SIZE]; // @ 801B9F20; small buf for printing dynid to? +static s32 + sUnnamedObjCount; // @ 801B9F28; used to print empty string ids (not NULL char *) to sDynNameSuffix +static s32 sLoadedDynObjs; // @ 801B9F2C; total loaded dynobjs +static struct DynObjInfo *sDynListCurInfo; // @ 801B9F30; info for most recently added object +static struct DynObjInfo *sParentObjInfo; ///< Information for `ObjNet` made by `d_add_net_with_subgroup()` or `ObjJoint` made by `d_attach_joint_to_net()` +static struct DynObjInfo *sStashedDynObjInfo; // @ 801B9F38 +static struct GdObj *sStashedDynObj; // @ 801B9F3C +static s32 sDynNetCount; // @ 801B9F40 +static char sDynNetNameSuffix[0x20]; // @ 801B9F48 +static char sStashedDynNameSuffix[0x100]; // @ 801B9F68 + +// necessary foreward declarations +void d_add_net_with_subgroup(s32, DynObjName); +void d_end_net_with_subgroup(DynObjName); +void d_attach_joint_to_net(s32, DynObjName); +void d_addto_group(DynObjName); +void d_link_with(DynObjName); +void d_link_with_ptr(void *); +void d_set_normal(f32, f32, f32); +void d_make_vertex(struct GdVec3f *); +void d_set_rotation(f32, f32, f32); +void d_center_of_gravity(f32, f32, f32); +void d_set_shape_offset(f32, f32, f32); +void d_clear_flags(s32); +void d_attach(DynObjName); +void d_attach_to(s32, struct GdObj *); +void d_attachto_dynid(s32, DynObjName); +void d_set_att_offset(const struct GdVec3f *); +void d_set_nodegroup(DynObjName); +void d_set_matgroup(DynObjName); +void d_set_skinshape(DynObjName); +void d_set_planegroup(DynObjName); +void d_set_shapeptr(DynObjName); +void d_friction(f32, f32, f32); +void d_set_spring(f32); +void d_set_ambient(f32, f32, f32); +void d_set_control_type(s32); +void d_set_skin_weight(s32, f32); +void d_set_id(s32); +void d_set_material(void *, s32); +void d_map_materials(DynObjName); +void d_map_vertices(DynObjName); +void d_set_texture_st(f32, f32); +void d_use_texture(void *); +void d_make_netfromshapeid(DynObjName); +void d_make_netfromshape_ptrptr(struct ObjShape **); +void add_to_dynobj_list(struct GdObj *, DynObjName); + +/** + * Store the active dynamic `GdObj` into a one object stash. + */ +void d_stash_dynobj(void) { + sStashedDynObjInfo = sDynListCurInfo; + sStashedDynObj = sDynListCurObj; +} + +/** + * Set the stashed `GdObj` as the active dynamic `GdObj`. + */ +void d_unstash_dynobj(void) { + sDynListCurObj = sStashedDynObj; + sDynListCurInfo = sStashedDynObjInfo; +} + +/** + * Reset dynlist related variables to a starting state + */ +void reset_dynlist(void) { + sUnnamedObjCount = 0; + sLoadedDynObjs = 0; + sDynNameSuffix[0] = '\0'; + sGdDynObjList = NULL; + sDynListCurObj = NULL; + sDynNetCount = 0; + sUseIntegerNames = FALSE; + gd_strcpy(sNullDynObjInfo.name, "NullObj"); +} + +/** + * Parse a `DynList` array into active `GdObj`s. + * + * @returns Pointer to current dynamically created dynamic `GdObj`. + * Normally the dynlist specifically sets an object for return. + */ +struct GdObj *proc_dynlist(struct DynList *dylist) { + UNUSED u32 pad[2]; + + if (dylist++->cmd != 0xD1D4) { + fatal_printf("proc_dynlist() not a valid dyn list"); + } + + while (dylist->cmd != 58) { + switch (dylist->cmd) { + case 43: + d_set_name_suffix(Dyn1AsStr(dylist)); + break; + case 15: + d_makeobj(Dyn2AsInt(dylist), Dyn1AsName(dylist)); + break; + case 46: + d_add_net_with_subgroup(Dyn2AsInt(dylist), Dyn1AsName(dylist)); + break; + case 48: + d_end_net_with_subgroup(Dyn1AsName(dylist)); + break; + case 47: + d_attach_joint_to_net(Dyn2AsInt(dylist), Dyn1AsName(dylist)); + break; + case 16: + d_start_group(Dyn1AsName(dylist)); + break; + case 17: + d_end_group(Dyn1AsName(dylist)); + break; + case 18: + d_addto_group(Dyn1AsName(dylist)); + break; + case 30: + d_use_obj(Dyn1AsName(dylist)); + break; + case 28: + d_link_with(Dyn1AsName(dylist)); + break; + case 50: + d_add_valptr(Dyn1AsName(dylist), (u32) DynVecY(dylist), Dyn2AsInt(dylist), + (size_t) DynVecX(dylist)); + break; + case 29: + d_link_with_ptr(Dyn1AsPtr(dylist)); + break; + case 12: + proc_dynlist(Dyn1AsPtr(dylist)); + break; + case 0: + d_use_integer_names(Dyn2AsInt(dylist)); + break; + case 1: + d_set_init_pos(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 2: + d_set_rel_pos(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 3: + d_set_world_pos(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 4: + d_set_normal(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 5: + d_set_scale(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 49: + d_make_vertex(DynVec(dylist)); + break; + case 6: + d_set_rotation(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 27: + d_center_of_gravity(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 26: + d_set_shape_offset(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 44: + d_set_parm_f(Dyn2AsInt(dylist), DynVecX(dylist)); + break; + case 45: + d_set_parm_ptr(Dyn2AsInt(dylist), Dyn1AsPtr(dylist)); + break; + case 8: + d_set_flags(Dyn2AsInt(dylist)); + break; + case 9: + d_clear_flags(Dyn2AsInt(dylist)); + break; + case 7: + d_set_obj_draw_flag(Dyn2AsInt(dylist)); + break; + case 39: + d_attach(Dyn1AsName(dylist)); + break; + case 40: + d_attachto_dynid(Dyn2AsInt(dylist), Dyn1AsName(dylist)); + break; + case 41: + d_set_att_offset(DynVec(dylist)); + break; + case 21: + d_set_nodegroup(Dyn1AsName(dylist)); + break; + case 20: + d_set_matgroup(Dyn1AsName(dylist)); + break; + case 22: + d_set_skinshape(Dyn1AsName(dylist)); + break; + case 23: + d_set_planegroup(Dyn1AsName(dylist)); + break; + case 24: + d_set_shapeptrptr(Dyn1AsPtr(dylist)); + break; + case 25: + d_set_shapeptr(Dyn1AsName(dylist)); + break; + case 19: + d_set_type(Dyn2AsInt(dylist)); + break; + case 13: + d_set_colour_num(Dyn2AsInt(dylist)); + break; + case 10: + d_friction(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 11: + d_set_spring(DynVecX(dylist)); + break; + case 33: + d_set_ambient(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 34: + d_set_diffuse(DynVecX(dylist), DynVecY(dylist), DynVecZ(dylist)); + break; + case 31: + d_set_control_type(Dyn2AsInt(dylist)); + break; + case 32: + d_set_skin_weight(Dyn2AsInt(dylist), DynVecX(dylist)); + break; + case 35: + d_set_id(Dyn2AsInt(dylist)); + break; + case 36: + d_set_material(Dyn1AsPtr(dylist), Dyn2AsInt(dylist)); + break; + case 37: + d_map_materials(Dyn1AsName(dylist)); + break; + case 38: + d_map_vertices(Dyn1AsName(dylist)); + break; + case 53: + d_set_texture_st(DynVecX(dylist), DynVecY(dylist)); + break; + case 52: + d_use_texture(Dyn2AsPtr(dylist)); + break; + case 54: + d_make_netfromshapeid(Dyn1AsName(dylist)); + break; + case 55: + d_make_netfromshape_ptrptr(Dyn1AsPtr(dylist)); + break; + default: + fatal_printf("proc_dynlist(): unkown command"); + } + dylist++; + } + + return sDynListCurObj; +} + +/** + * Copy input `str` into a buffer that will be concatenated to a dynamic + * `GdObj`'s name string when creating a new dynamic object. If input + * is `NULL`, then a generic string is created based on the number of + * unnamed objects. + */ +void d_set_name_suffix(char *str) { + if (str != NULL) { + if (str[0] == '\0') { + sprintf(sDynNameSuffix, "__%d", ++sUnnamedObjCount); + } else { + gd_strcpy(sDynNameSuffix, str); + } + } else { + sDynNameSuffix[0] = '\0'; + } +} + +/** + * Concatenate input `str` into a buffer that will be concatenated to a dynamic + * `GdObj`'s name string when creating a new dynamic object. If input + * is `NULL`, then a generic string is created based on the number of + * unnamed objects. + * + * @note Not called + */ +void d_append_to_name_suffix(char *str) { + char buf[0xff + 1]; + + if (str != NULL) { + if (str[0] == '\0') { + sprintf(buf, "__%d", ++sUnnamedObjCount); + } else { + gd_strcpy(buf, str); + } + } else { + buf[0] = '\0'; + } + + gd_strcat(sDynNameSuffix, buf); +} + +/** + * Stash the current string that is appended to a created dynamic `GdObj` name. + */ +static void stash_name_suffix(void) { + gd_strcpy(sStashedDynNameSuffix, sDynNameSuffix); +} + +/** + * Pop the stash for the string that is appended to a created dynamic `GdObj` name. + */ +static void unstash_name_suffix(void) { + gd_strcpy(sDynNameSuffix, sStashedDynNameSuffix); +} + +/** + * Get the `DynObjInfo` struct for object `name` + * + * @param name Either a string or integer id for a dynamic `GdObj` + * @returns pointer to that object's information + */ +static struct DynObjInfo *get_dynobj_info(DynObjName name) { + struct DynObjInfo *foundDynobj; + char buf[0x100]; + s32 i; + + if (sLoadedDynObjs == 0) { + return NULL; + } + + if (sUseIntegerNames) { + sprintf(buf, "N%d", DynNameAsInt(name)); + } else { + gd_strcpy(buf, DynNameAsStr(name)); + } + + gd_strcat(buf, sDynNameSuffix); + foundDynobj = NULL; + for (i = 0; i < sLoadedDynObjs; i++) { + if (gd_str_not_equal(sGdDynObjList[i].name, buf) == 0) + { + foundDynobj = &sGdDynObjList[i]; + break; + } + } + + return foundDynobj; +} + +/** + * Reset the number of created dynamic objects and + * free the dynamic object information list (`sGdDynObjList`). + * The objects themselves still exist, though. + * + * @note Not called + */ +void reset_dynamic_objs(void) { + UNUSED s32 pad; + + if (sLoadedDynObjs == 0) { + return; + } + + gd_free(sGdDynObjList); + sLoadedDynObjs = 0; + sGdDynObjList = NULL; +} + +/** + * Create an `ObjNet` and an associated node `ObjGroup`. This function creates + * its own naming string to append to later created dynamic objects. + */ +void d_add_net_with_subgroup(UNUSED s32 a0, DynObjName name) { + d_makeobj(D_NET, name); + d_set_obj_draw_flag(OBJ_INVISIBLE); + // this creates a string to append to the names of the objs created after this + sprintf(sDynNetNameSuffix, "c%d", ++sDynNetCount); + d_set_type(4); + stash_name_suffix(); + d_set_name_suffix(sDynNetNameSuffix); + d_start_group(name); + unstash_name_suffix(); + d_use_obj(name); + sParentObjInfo = sDynListCurInfo; +} + +/** + * End the `ObjNet`+`ObjGroup` set created by `d_add_net_with_subgroup()`. + */ +void d_end_net_with_subgroup(DynObjName name) { + d_use_obj(name); + stash_name_suffix(); + d_set_name_suffix(sDynNetNameSuffix); + d_end_group(name); + d_set_nodegroup(name); + unstash_name_suffix(); + sParentObjInfo = NULL; +} + +/** + * Create an `ObjJoint` and attach that to the `ObjNet` created by + * `d_add_net_with_subgroup()` or the most recent `ObjJoint` created + * by `d_attach_joint_to_net()`. + * + * @param arg0 Not used + * @param name Name for created `ObjJoint` + */ +void d_attach_joint_to_net(UNUSED s32 arg0, DynObjName name) { + UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; + UNUSED u32 pad[2]; + + d_makeobj(D_JOINT, name); + d_set_type(3); + d_set_shapeptrptr(NULL); + d_attach_to(0xD, sParentObjInfo->obj); + sParentObjInfo = sDynListCurInfo; +} + +/** + * Create a new `ObjNet` linked with the dynamic `ObjShape` `name`. + * The newly made net is added to the dynamic object list. + */ +void d_make_netfromshapeid(DynObjName name) { + struct DynObjInfo *dyninfo = get_dynobj_info(name); + struct ObjNet *net; + + if (dyninfo == NULL) { + fatal_printf("dMakeNetFromShape(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + net = make_netfromshape((struct ObjShape *) dyninfo->obj); + add_to_dynobj_list(&net->header, NULL); +} + +/** + * Create a new `ObjNet` linked with the doubly indirected `ObjShape`. + * The newly made net is added to the dynamic object list, but + * the shape is not moved into the dynamic list. + */ +void d_make_netfromshape_ptrptr(struct ObjShape **shapePtr) { + UNUSED u32 pad; + struct ObjNet *net = make_netfromshape(*shapePtr); + + printf("dMakeNetFromShapePtrPtr\n"); + + add_to_dynobj_list(&net->header, NULL); +} + +/** + * Add `newobj` identified by `name` to the dynamic `GdObj` list. Once a `GdObj` + * is in the dynamic list, it can referred to by its `name` when that object is + * needed later. + */ +void add_to_dynobj_list(struct GdObj *newobj, DynObjName name) { + UNUSED u32 pad; + char idbuf[0x100]; + + start_memtracker("dynlist"); + + if (sGdDynObjList == NULL) { + sGdDynObjList = gd_malloc_temp(DYNOBJ_LIST_SIZE * sizeof(struct DynObjInfo)); + if (sGdDynObjList == NULL) { + fatal_printf("dMakeObj(): Cant allocate dynlist memory"); + } + } + + stop_memtracker("dynlist"); + + if (sUseIntegerNames) { + sprintf(idbuf, "N%d", DynNameAsInt(name)); + name = NULL; + } else { + sprintf(idbuf, "U%d", ((u32) sLoadedDynObjs) + 1); + } + + if (DynNameAsStr(name) != NULL) { + if (get_dynobj_info(name) != NULL) { + fatal_printf("dMakeObj(\"%s\"): Object with same name already exists", DynNameAsStr(name)); + } + gd_strcpy(sGdDynObjList[sLoadedDynObjs].name, DynNameAsStr(name)); + } else { + gd_strcpy(sGdDynObjList[sLoadedDynObjs].name, idbuf); + } + + gd_strcat(sGdDynObjList[sLoadedDynObjs].name, sDynNameSuffix); + + if (gd_strlen(sGdDynObjList[sLoadedDynObjs].name) > (DYNOBJ_NAME_SIZE - 1)) { + fatal_printf("dyn list obj name too long '%s'", sGdDynObjList[sLoadedDynObjs].name); + } + + sGdDynObjList[sLoadedDynObjs].num = sLoadedDynObjs; + sDynListCurInfo = &sGdDynObjList[sLoadedDynObjs]; + sGdDynObjList[sLoadedDynObjs++].obj = newobj; + + // A good place to bounds-check your array is + // after you finish writing a new member to it. + if (sLoadedDynObjs >= DYNOBJ_LIST_SIZE) { + fatal_printf("dMakeObj(): Too many dynlist objects"); + } + + sDynListCurObj = newobj; +} + +/** + * Format `name` into string, if `DynObjName`s are currently being interpreted + * as numbers. + * + * @returns pointer to global buffer for id + * @retval NULL if `name` is `NULL` or if `DynObjName`s are interpreted as strings + */ +static char *integer_name_to_string(DynObjName name) { + if (DynNameAsInt(name) != 0 && sUseIntegerNames) { + sprintf(sIntToStringBuf, "N%d", DynNameAsInt(name)); + return sIntToStringBuf; + } + + return NULL; +} + +/** + * Create a new `GdObj` of `type` and add that object to the + * dynamic object list with `name`. Created objects have default + * parameters, which are usually 0 or NULL. + * + * @returns pointer to created object + */ +struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name) { + struct GdObj *dobj; + UNUSED struct ObjGroup *dgroup; + + switch (type) { + case D_CAR_DYNAMICS: + fatal_printf("dmakeobj() Car dynamics are missing!"); + break; + case D_JOINT: + dobj = &make_joint(0, 0.0f, 0.0f, 0.0f)->header; + break; + case D_ANOTHER_JOINT: + dobj = &make_joint(0, 0.0f, 0.0f, 0.0f)->header; + break; + case D_NET: + dobj = &make_net(0, NULL, NULL, NULL, NULL)->header; + break; + case D_GROUP: + dobj = &make_group(0)->header; + dgroup = (struct ObjGroup *) dobj; + break; + case D_DATA_GRP: + d_makeobj(D_GROUP, name); + ((struct ObjGroup *) sDynListCurObj)->linkType = 1; +//! @bug Returns garbage when making `D_DATA_GRP` object +#ifdef AVOID_UB + return NULL; +#else + return; +#endif + case D_CAMERA: + dobj = &make_camera(0, NULL)->header; + break; + case D_BONE: + dobj = &make_bone(0, NULL, NULL, 0)->header; + break; + case D_PARTICLE: + dobj = &make_particle(0, 0, 0.0f, 0.0f, 0.0f)->header; + break; + case D_VERTEX: + dobj = &gd_make_vertex(0.0f, 0.0f, 0.0f)->header; + break; + case D_FACE: + dobj = &make_face_with_colour(1.0, 1.0, 1.0)->header; + break; + case D_PLANE: + dobj = &make_plane(FALSE, NULL)->header; + break; + case D_MATERIAL: + dobj = &make_material(0, NULL, 0)->header; + break; + case D_SHAPE: + dobj = &make_shape(0, integer_name_to_string(name))->header; + break; + case D_GADGET: + dobj = &make_gadget(0, 0)->header; + break; + case D_LABEL: + //! @bug When making a `D_LABEL`, the call to `make_label()` + //! compiles incorrectly due to Goddard only declaring + //! the functions, not prototyping the functions + dobj = &make_label(NULL, NULL, 8, 0, 0, 0)->header; + break; + case D_VIEW: + dobj = &make_view(NULL, + (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 + | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), + 2, 0, 0, 0, 0, NULL) + ->header; + break; + case D_ANIMATOR: + dobj = &make_animator()->header; + break; + case D_LIGHT: + dobj = &make_light(0, NULL, 0)->header; + addto_group(gGdLightGroup, dobj); + break; + default: + fatal_printf("dMakeObj(): Unkown object type"); + } + + add_to_dynobj_list(dobj, name); + return dobj; +} + +/** + * Attach dynamic object `name` to the current active `ObjJoint` object. + * + * @note This function doesn't actually do anything. + */ +void d_attach(DynObjName name) { + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dAttach(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttach()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Attach the current dynamic `GdObj` into the proper subgroup of `obj` and set + * the "attach flags" of the current dynamic object to `flag` + */ +void d_attach_to(s32 flag, struct GdObj *obj) { + UNUSED u32 pad4C; + struct ObjGroup *attgrp; + UNUSED u32 pad[2]; + UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; + struct GdVec3f currObjPos; // transformed into attach offset + struct GdVec3f objPos; + + d_stash_dynobj(); + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + // find or generate attachment groups + switch (obj->type) { + case OBJ_TYPE_JOINTS: + if ((attgrp = ((struct ObjJoint *) obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjJoint *) obj)->attachedObjsGrp = make_group(0); + } + break; + case OBJ_TYPE_NETS: + if ((attgrp = ((struct ObjNet *) obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjNet *) obj)->attachedObjsGrp = make_group(0); + } + break; + case OBJ_TYPE_PARTICLES: + if ((attgrp = ((struct ObjParticle *) obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjParticle *) obj)->attachedObjsGrp = make_group(0); + } + break; + case OBJ_TYPE_ANIMATORS: + if ((attgrp = ((struct ObjAnimator *) obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjAnimator *) obj)->attachedObjsGrp = make_group(0); + } + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", + sDynListCurInfo->name, sDynListCurObj->type); + } + + if (group_contains_obj(attgrp, sDynListCurObj)) { + return; + } + + addto_group(attgrp, sDynListCurObj); + + if (flag & 9) { + d_get_world_pos(&currObjPos); + set_cur_dynobj(obj); + d_get_world_pos(&objPos); + + currObjPos.x -= objPos.x; + currObjPos.y -= objPos.y; + currObjPos.z -= objPos.z; + } + + d_unstash_dynobj(); + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->attachFlags = flag; + ((struct ObjJoint *) sDynListCurObj)->attachedToObj = obj; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->attachFlags = flag; + ((struct ObjNet *) sDynListCurObj)->attachedToObj = obj; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) sDynListCurObj)->attachFlags = flag; + ((struct ObjParticle *) sDynListCurObj)->attachedToObj = obj; + break; + case OBJ_TYPE_ANIMATORS: + ((struct ObjAnimator *) sDynListCurObj)->attachFlags = flag; + ((struct ObjAnimator *) sDynListCurObj)->attachedToObj = obj; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", + sDynListCurInfo->name, sDynListCurObj->type); + } + + if (flag & 9) { + d_set_att_offset(&currObjPos); + } +} + +/** + * Attach the current dynamic object to dynamic object `name`. This function + * is a wrapper around `d_attach_to()` + */ +void d_attachto_dynid(s32 flag, DynObjName name) { + struct DynObjInfo *info; + + if (name == NULL) { + return; + } + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dAttachTo(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + d_attach_to(flag, info->obj); +} + +/** + * Helper function to copy bytes. Where's memcpy when you need it? + */ +void copy_bytes(u8 *src, u8 *dst, s32 num) { + if (num == 0) { + return; + } + while (num--) { + *dst++ = *src++; + } +} + +/** + * Allocate the animation data for `animator` onto the goddard heap. + * Animation data of type `::GD_ANIM_SCALE3S_POS3S_ROT3S` is converted to a `AnimMtxVec` struct, + * rather than solely byted copied like the other types. + */ +void alloc_animdata(struct ObjAnimator *animator) { + UNUSED u32 pad5C; + // probably should be three GdVec3fs, not triangle... + // vec0 = position; vec1 = scale? rotation?; vec2 = translation + struct GdTriangleF tri; //+58; temp float for converting half to f32? + s16(*halfarr)[9]; //+54; data to convert into a AnimMtxVec + struct AnimDataInfo *curAnimSrc; //+50; source animation data... + struct AnimDataInfo *animDst; //+4c; destination anim data II + struct AnimDataInfo *animDataArr; //+48; start of allocated anim data memory + struct ObjGroup *animgrp; //+44 + s32 datasize; //+40; anim data allocation size? + s32 dataIdx; //+3C; byte count? + s32 animCnt; //+38; count of animdata "info" structs + s32 i; //+34 + void *allocSpace; //+30; allocated animdata space + f32 allocMtxScale = 0.1f; //+2C; scale postion/rotation of GD_ANIM_SCALE3S_POS3S_ROT3S data + struct AnimMtxVec *curMtxVec; //+28 + UNUSED u32 pad20; + + start_memtracker("animdata"); + + if ((animgrp = animator->animdataGrp) == NULL) { + fatal_printf("no anim group"); + } + + if ((curAnimSrc = (struct AnimDataInfo *) animgrp->firstMember->obj) == NULL) { + fatal_printf("no animation data"); + } + + // count number of array-ed animation data structs + animDst = curAnimSrc; + animCnt = 0; + while (animDst++->count >= 0) { + animCnt++; + } + + animDst = gd_malloc_perm(animCnt * sizeof(struct AnimDataInfo)); // gd_alloc_perm + if ((animDataArr = animDst) == NULL) { + fatal_printf("cant allocate animation data"); + } + + for (i = 0; i < animCnt; i++) { + allocSpace = NULL; + if (curAnimSrc->type != 0) { + switch (curAnimSrc->type) { + case GD_ANIM_CAMERA_EYE3S_LOOKAT3S: + datasize = sizeof(s16[6]); + break; + case GD_ANIM_ROT3S: + datasize = sizeof(s16[3]); + break; + case GD_ANIM_POS3S: + datasize = sizeof(s16[3]); + break; + case GD_ANIM_ROT3S_POS3S: + datasize = sizeof(s16[6]); + break; + case GD_ANIM_SCALE3F_ROT3F_POS3F: + datasize = sizeof(f32[3][3]); + break; + /* This function will convert the s16[9] array into a struct AnimMtxVec */ + case GD_ANIM_SCALE3S_POS3S_ROT3S: + datasize = sizeof(struct AnimMtxVec); + break; + case GD_ANIM_MTX4x4: + datasize = sizeof(Mat4f); + break; + default: + fatal_printf("unknown anim type for allocation"); + break; + } + + allocSpace = gd_malloc_perm(curAnimSrc->count * datasize); // gd_alloc_perm + if (allocSpace == NULL) { + fatal_printf("cant allocate animation data"); + } + + if (curAnimSrc->type == GD_ANIM_SCALE3S_POS3S_ROT3S) { + for (dataIdx = 0; dataIdx < curAnimSrc->count; dataIdx++) { + halfarr = &((s16(*)[9]) curAnimSrc->data)[dataIdx]; + curMtxVec = &((struct AnimMtxVec *) allocSpace)[dataIdx]; + + tri.p0.x = (f32)(*halfarr)[0] * allocMtxScale; + tri.p0.y = (f32)(*halfarr)[1] * allocMtxScale; + tri.p0.z = (f32)(*halfarr)[2] * allocMtxScale; + tri.p1.x = (f32)(*halfarr)[3] * allocMtxScale; + tri.p1.y = (f32)(*halfarr)[4] * allocMtxScale; + tri.p1.z = (f32)(*halfarr)[5] * allocMtxScale; + tri.p2.x = (f32)(*halfarr)[6]; + tri.p2.y = (f32)(*halfarr)[7]; + tri.p2.z = (f32)(*halfarr)[8]; + + gd_set_identity_mat4(&curMtxVec->matrix); + gd_rot_mat_about_vec(&curMtxVec->matrix, &tri.p1); + gd_add_vec3f_to_mat4f_offset(&curMtxVec->matrix, &tri.p2); + + ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.x = tri.p0.x; + ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.y = tri.p0.y; + ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.z = tri.p0.z; + } + curAnimSrc->type = GD_ANIM_MTX4x4F_SCALE3F; + } else { + copy_bytes(curAnimSrc->data, allocSpace, curAnimSrc->count * datasize); + } + } + + animDst[i].type = curAnimSrc->type; + animDst[i].count = curAnimSrc->count; + animDst[i].data = allocSpace; + + curAnimSrc++; // next anim data struct + } + + animgrp->firstMember->obj = (void *) animDataArr; + stop_memtracker("animdata"); +} + +/** + * Generate or create the various `ObjVertex`, `ObjFace`, and/or + * `ObjMaterial` when groups of those structures are attached to + * `shape`. This function is called when `d_set_nodegroup()`, + * `d_set_planegroup()`, or `d_set_matgroup()` are called + * when an `ObjShape` is the active dynamic object. + * + * @note Face/vertices need to be set before materials + */ +void chk_shapegen(struct ObjShape *shape) { + struct ObjFace *face; // sp5C; made face + struct ObjVertex *vtx; // sp58; made gdvtx + struct ObjVertex **vtxbuf; // sp54; heap storage for made gd vtx + struct ObjGroup *shapeMtls; // sp50 + struct ObjGroup *shapeFaces; // sp4C + struct ObjGroup *shapeVtx; // sp48 + UNUSED u32 pad44; + struct ObjGroup *madeFaces; // sp40 + struct ObjGroup *madeVtx; // sp3C + u32 i; // sp38 + struct GdVtxData *vtxdata; // sp34 + struct GdFaceData *facedata; // sp30 + struct GdObj *oldObjHead; // sp2C + + start_memtracker("chk_shapegen"); + imin("chk_shapegen"); + shapeMtls = shape->mtlGroup; + shapeFaces = shape->faceGroup; + shapeVtx = shape->vtxGroup; + + if (shapeVtx != NULL && shapeFaces != NULL) { + if ((shapeVtx->linkType & 1) && (shapeFaces->linkType & 1)) //? needs the double if + { + // These ListNodes point to special, compressed data structures + vtxdata = (struct GdVtxData *) shapeVtx->firstMember->obj; + facedata = (struct GdFaceData *) shapeFaces->firstMember->obj; + if (facedata->type != 1) { + fatal_printf("unsupported poly type"); + } + + if (vtxdata->type != 1) { + fatal_printf("unsupported vertex type"); + } + + if (vtxdata->count >= VTX_BUF_SIZE) { + fatal_printf("shapegen() too many vertices"); + } + + vtxbuf = gd_malloc_temp(VTX_BUF_SIZE * sizeof(struct ObjVertex *)); + oldObjHead = gGdObjectList; + + for (i = 0; i < vtxdata->count; i++) { + vtx = gd_make_vertex(vtxdata->data[i][0], vtxdata->data[i][1], vtxdata->data[i][2]); + vtx->normal.x = vtx->normal.y = vtx->normal.z = 0.0f; + vtxbuf[i] = vtx; + } + + madeVtx = make_group_of_type(OBJ_TYPE_VERTICES, oldObjHead, NULL); + + oldObjHead = gGdObjectList; + for (i = 0; i < facedata->count; i++) { + //! @bug Call to `make_face_with_colour()` compiles incorrectly + //! due to Goddard only declaring the functions, + //! not prototyping the functions + face = make_face_with_colour(1.0, 1.0, 1.0); + face->mtlId = (s32) facedata->data[i][0]; + add_3_vtx_to_face(face, vtxbuf[facedata->data[i][1]], vtxbuf[facedata->data[i][2]], + vtxbuf[facedata->data[i][3]]); + vtxbuf[facedata->data[i][1]]->normal.x += face->normal.x; + vtxbuf[facedata->data[i][1]]->normal.y += face->normal.y; + vtxbuf[facedata->data[i][1]]->normal.z += face->normal.z; + + vtxbuf[facedata->data[i][2]]->normal.x += face->normal.x; + vtxbuf[facedata->data[i][2]]->normal.y += face->normal.y; + vtxbuf[facedata->data[i][2]]->normal.z += face->normal.z; + + vtxbuf[facedata->data[i][3]]->normal.x += face->normal.x; + vtxbuf[facedata->data[i][3]]->normal.y += face->normal.y; + vtxbuf[facedata->data[i][3]]->normal.z += face->normal.z; + } + + if (shape->flag & 0x10) { + for (i = 0; i < vtxdata->count; i++) { + vtxbuf[i]->normal.x = vtxbuf[i]->pos.x; + vtxbuf[i]->normal.y = vtxbuf[i]->pos.y; + vtxbuf[i]->normal.z = vtxbuf[i]->pos.z; + gd_normalize_vec3f(&vtxbuf[i]->normal); + } + } else { + for (i = 0; i < vtxdata->count; i++) { + gd_normalize_vec3f(&vtxbuf[i]->normal); + } + } + + gd_free(vtxbuf); + madeFaces = make_group_of_type(OBJ_TYPE_FACES, oldObjHead, NULL); + shape->faceGroup = madeFaces; + shape->vtxGroup = madeVtx; + } + } + + if (shapeMtls != NULL) { + if (shape->faceGroup) { + map_face_materials(shape->faceGroup, shapeMtls); + } else { + fatal_printf("chk_shapegen() please set face group before mats"); + } + } + + imout(); + stop_memtracker("chk_shapegen"); +} + +/** + * Set the "node group" of the current dynamic object to dynamic object `name`. + * The node group depends on the type of the current dynamic object: + * * the vertex group is set for `ObjShape` + * * the joints/weight group is set for `ObjNet` + * * data is set for `ObjAnimator` + * * something is set for `ObjGadget` + */ +void d_set_nodegroup(DynObjName name) { + struct DynObjInfo *info; // sp2C + UNUSED u32 pad[2]; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dSetNodeGroup(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->unk1C8 = (struct ObjGroup *) info->obj; + ((struct ObjNet *) sDynListCurObj)->unk1D0 = (struct ObjGroup *) info->obj; + break; + case OBJ_TYPE_SHAPES: + ((struct ObjShape *) sDynListCurObj)->vtxGroup = (struct ObjGroup *) info->obj; + chk_shapegen((struct ObjShape *) sDynListCurObj); + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) sDynListCurObj)->unk54 = (struct ObjGroup *) info->obj; + break; + case OBJ_TYPE_ANIMATORS: + ((struct ObjAnimator *) sDynListCurObj)->animdataGrp = (struct ObjGroup *) info->obj; + alloc_animdata((struct ObjAnimator *) sDynListCurObj); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetNodeGroup()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the material group of the current dynamic `ObjShape` to `name`. + */ +void d_set_matgroup(DynObjName name) { + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dSetMatGroup(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_SHAPES: + ((struct ObjShape *) sDynListCurObj)->mtlGroup = (struct ObjGroup *) info->obj; + chk_shapegen((struct ObjShape *) sDynListCurObj); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatGroup()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * At one time in the past, this set the s and t value of the current + * dynamic `ObjVertex`. However, this function does nothing now. + * See `BetaVtx` for a possible remnant of vertex code that had + * ST coordinates. + */ +void d_set_texture_st(UNUSED f32 s, UNUSED f32 t) { + UNUSED u32 pad[2]; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + break; // ifdef-ed out? + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetTextureST()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the texture pointer of the current dynamic `ObjMaterial`. + */ +void d_use_texture(void *texture) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_MATERIALS: + ((struct ObjMaterial *) sDynListCurObj)->texture = texture; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dUseTexture()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the current dynamic `ObjNet`'s skin group with the vertex group from + * the dynamic `ObjShape` with `name`. + */ +void d_set_skinshape(DynObjName name) { + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dSetSkinShape(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->skinGrp = ((struct ObjShape *) info->obj)->vtxGroup; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSkinShape()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Map the material ids for the `ObjFace`s in the current dynamic `ObjGroup` + * to pointer to `ObjMaterial`s in the `ObjGroup` `name`. + * + * See `map_face_materials()` for more info. + */ +void d_map_materials(DynObjName name) { + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dMapMaterials(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + map_face_materials((struct ObjGroup *) sDynListCurObj, (struct ObjGroup *) info->obj); +} + +/** + * For all faces in the current `ObjGroup`, resolve their vertex indices to + * `ObjVertex` pointers that point to vertices in the specified vertex group. + * Also compute normals for all faces in the current `ObjGroup` and all vertices + * in the specified vertex group. + * See `map_vertices()` for more info. + * @param name name of a vertex group dynobj + */ +void d_map_vertices(DynObjName name) { + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dMapVertices(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + map_vertices((struct ObjGroup *) sDynListCurObj, (struct ObjGroup *) info->obj); +} + +/** + * In practice, this is used to set the faces of the current + * active dynamic `ObjShape` to the dynamic group `name` of `ObjFace`s. + * It also has interactions with `ObjNet`s, but there are no examples + * of that usage in existing code. + */ +void d_set_planegroup(DynObjName name) { + struct DynObjInfo *info; + UNUSED u32 pad[2]; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dSetPlaneGroup(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->unk1CC = (struct ObjGroup *) info->obj; + break; + case OBJ_TYPE_SHAPES: + ((struct ObjShape *) sDynListCurObj)->faceGroup = (struct ObjGroup *) info->obj; + chk_shapegen((struct ObjShape *) sDynListCurObj); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetPlaneGroup()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the shape pointer of the current active dynamic object to the + * pointer pointed to by `shpPtrptr`. + */ +void d_set_shapeptrptr(struct ObjShape **shpPtrptr) { + struct ObjShape *defaultptr = NULL; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + if (shpPtrptr == NULL) { + shpPtrptr = &defaultptr; + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjJoint *) sDynListCurObj)->colourNum = 0; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->shapePtr = *shpPtrptr; + break; + case OBJ_TYPE_BONES: + ((struct ObjBone *) sDynListCurObj)->shapePtr = *shpPtrptr; + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) sDynListCurObj)->shapePtr = *shpPtrptr; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) sDynListCurObj)->shapePtr = *shpPtrptr; + break; + case OBJ_TYPE_LIGHTS: + ((struct ObjLight *) sDynListCurObj)->unk9C = *shpPtrptr; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetShapePtrPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the shape pointer of the current active dynamic object to dynamic + * `ObjShape` `name`. + */ +void d_set_shapeptr(DynObjName name) { + struct DynObjInfo *info; + if (name == NULL) { + return; + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dSetShapePtr(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + ((struct ObjJoint *) sDynListCurObj)->colourNum = 0; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + break; + case OBJ_TYPE_BONES: + ((struct ObjBone *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetShapePtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the current active dynamic object to object `name`. + */ +struct GdObj *d_use_obj(DynObjName name) { + struct DynObjInfo *info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dUseObj(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + sDynListCurObj = info->obj; + sDynListCurInfo = info; + + return info->obj; +} + +/** + * Set the current active dynamic object to `obj`. This object can + * any type of `GdObj`, not just an object created through the + * dynmaic object system. + */ +void set_cur_dynobj(struct GdObj *obj) { + sDynListCurObj = obj; + sDynListCurInfo = &sNullDynObjInfo; +} + +/** + * Start a dynamic `ObjGroup` identified with `name`. + */ +void d_start_group(DynObjName name) { + d_makeobj(D_GROUP, name); +} + +/** + * Add all dynamic objects created between the start of dynamic `ObjGroup` `name` + * and this call. + */ +void d_end_group(DynObjName name) { + UNUSED u32 pad; + struct DynObjInfo *info = get_dynobj_info(name); + struct ObjGroup *dynGrp; + s32 i; + + if (info == NULL) { + fatal_printf("dEndGroup(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + dynGrp = (struct ObjGroup *) info->obj; + for (i = info->num + 1; i < sLoadedDynObjs; i++) { + if (sGdDynObjList[i].obj->type != OBJ_TYPE_GROUPS) { + addto_group(dynGrp, sGdDynObjList[i].obj); + } + } +} + +/** + * Add the current dynamic object to the dynamic `ObjGroup` `name`. + */ +void d_addto_group(DynObjName name) { + UNUSED u32 pad; + struct DynObjInfo *info = get_dynobj_info(name); + struct ObjGroup *targetGrp; + + if (info == NULL) { + fatal_printf("dAddToGroup(\"%s\"): Undefined group", DynNameAsStr(name)); + } + + targetGrp = (struct ObjGroup *) info->obj; + addto_group(targetGrp, sDynListCurObj); +} + +/** + * Set if `DynObjName` should be treated as integer values, + * or as `char *` string pointers. + * + * @param isIntBool `TRUE` to interpret ids as integers + */ +void d_use_integer_names(s32 isIntBool) { + sUseIntegerNames = isIntBool; +} + +/** + * Set the initial position of the current dynamic object + * to `(x, y, z)`. + */ +void d_set_init_pos(f32 x, f32 y, f32 z) { + UNUSED u32 pad2c[3]; + struct GdObj *dynobj = sDynListCurObj; // sp28 + UNUSED u32 pad[1]; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->worldPos.x = x; + ((struct ObjJoint *) dynobj)->worldPos.y = y; + ((struct ObjJoint *) dynobj)->worldPos.z = z; + + ((struct ObjJoint *) dynobj)->unk3C.x = x; + ((struct ObjJoint *) dynobj)->unk3C.y = y; + ((struct ObjJoint *) dynobj)->unk3C.z = z; + + ((struct ObjJoint *) dynobj)->initPos.x = x; + ((struct ObjJoint *) dynobj)->initPos.y = y; + ((struct ObjJoint *) dynobj)->initPos.z = z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->worldPos.x = x; + ((struct ObjNet *) dynobj)->worldPos.y = y; + ((struct ObjNet *) dynobj)->worldPos.z = z; + + ((struct ObjNet *) dynobj)->initPos.x = x; + ((struct ObjNet *) dynobj)->initPos.y = y; + ((struct ObjNet *) dynobj)->initPos.z = z; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) dynobj)->pos.x = x; + ((struct ObjParticle *) dynobj)->pos.y = y; + ((struct ObjParticle *) dynobj)->pos.z = z; + break; + case OBJ_TYPE_CAMERAS: + ((struct ObjCamera *) dynobj)->worldPos.x = x; + ((struct ObjCamera *) dynobj)->worldPos.y = y; + ((struct ObjCamera *) dynobj)->worldPos.z = z; + break; + case OBJ_TYPE_VERTICES: + d_set_rel_pos(x, y, z); + + ((struct ObjVertex *) dynobj)->initPos.x = x; + ((struct ObjVertex *) dynobj)->initPos.y = y; + ((struct ObjVertex *) dynobj)->initPos.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetInitPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the velocity of the current active dynamic object. The + * values of the input `GdVec3f` are copied into the object. + */ +void d_set_velocity(const struct GdVec3f *vel) { + struct GdObj *dynobj = sDynListCurObj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->velocity.x = vel->x; + ((struct ObjJoint *) dynobj)->velocity.y = vel->y; + ((struct ObjJoint *) dynobj)->velocity.z = vel->z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->velocity.x = vel->x; + ((struct ObjNet *) dynobj)->velocity.y = vel->y; + ((struct ObjNet *) dynobj)->velocity.z = vel->z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetVelocity()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Read the velocity value of the current dynamic object into `dst` + * + * @param[out] dst values are copied to this `GdVec3f` + */ +void d_get_velocity(struct GdVec3f *dst) { + struct GdObj *dynobj = sDynListCurObj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) dynobj)->velocity.x; + dst->y = ((struct ObjJoint *) dynobj)->velocity.y; + dst->z = ((struct ObjJoint *) dynobj)->velocity.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) dynobj)->velocity.x; + dst->y = ((struct ObjNet *) dynobj)->velocity.y; + dst->z = ((struct ObjNet *) dynobj)->velocity.z; + break; + default: + dst->x = dst->y = dst->z = 0.0f; + break; + } +} + +/** + * Set the torque vectore for the current dynamic object. + * Values from input `GdVec3f` are copied into the object. + * + * @note Not called + */ +void d_set_torque(const struct GdVec3f *src) { + struct GdObj *dynobj = sDynListCurObj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->torque.x = src->x; + ((struct ObjNet *) dynobj)->torque.y = src->y; + ((struct ObjNet *) dynobj)->torque.z = src->z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetTorque()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get the initial position of the current dynamic object and + * store in `dst`. + */ +void d_get_init_pos(struct GdVec3f *dst) { + struct GdObj *dynobj = sDynListCurObj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) dynobj)->initPos.x; + dst->y = ((struct ObjJoint *) dynobj)->initPos.y; + dst->z = ((struct ObjJoint *) dynobj)->initPos.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) dynobj)->initPos.x; + dst->y = ((struct ObjNet *) dynobj)->initPos.y; + dst->z = ((struct ObjNet *) dynobj)->initPos.z; + break; + case OBJ_TYPE_VERTICES: + dst->x = ((struct ObjVertex *) dynobj)->initPos.x; + dst->y = ((struct ObjVertex *) dynobj)->initPos.y; + dst->z = ((struct ObjVertex *) dynobj)->initPos.z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get the initial rotation of the current dynamic object and + * store in `dst`. + */ +void d_get_init_rot(struct GdVec3f *dst) { + struct GdObj *dynobj = sDynListCurObj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) dynobj)->unk6C.x; + dst->y = ((struct ObjJoint *) dynobj)->unk6C.y; + dst->z = ((struct ObjJoint *) dynobj)->unk6C.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) dynobj)->unk68.x; + dst->y = ((struct ObjNet *) dynobj)->unk68.y; + dst->z = ((struct ObjNet *) dynobj)->unk68.z; + break; + case OBJ_TYPE_LIGHTS: + dst->x = dst->y = dst->z = 0.0f; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitRot()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the position of the current dynamic object. + * + * @note This function automatically adjusts the three zoom levels + * for an `ObjCamera`. + */ +void d_set_rel_pos(f32 x, f32 y, f32 z) { + struct GdObj *dynobj = sDynListCurObj; // sp34 + UNUSED struct GdVec3f unusedVec; // sp28 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->unk3C.x = x; + ((struct ObjJoint *) dynobj)->unk3C.y = y; + ((struct ObjJoint *) dynobj)->unk3C.z = z; + break; + case OBJ_TYPE_CAMERAS: + unusedVec.x = x; + unusedVec.y = y; + unusedVec.z = z; + + ((struct ObjCamera *) dynobj)->unk40.x = x; + ((struct ObjCamera *) dynobj)->unk40.y = y; + ((struct ObjCamera *) dynobj)->unk40.z = z; + + ((struct ObjCamera *) dynobj)->zoomPositions[0].x = x; + ((struct ObjCamera *) dynobj)->zoomPositions[0].y = y; + ((struct ObjCamera *) dynobj)->zoomPositions[0].z = z; + + ((struct ObjCamera *) dynobj)->zoomPositions[1].x = x * 1.5; //? 1.5f + ((struct ObjCamera *) dynobj)->zoomPositions[1].y = y * 1.5; //? 1.5f + ((struct ObjCamera *) dynobj)->zoomPositions[1].z = z * 1.5; //? 1.5f + + ((struct ObjCamera *) dynobj)->zoomPositions[2].x = x * 2.0f; + ((struct ObjCamera *) dynobj)->zoomPositions[2].y = y * 2.0f; + ((struct ObjCamera *) dynobj)->zoomPositions[2].z = z * 2.0f; + + ((struct ObjCamera *) dynobj)->maxZoomLevel = 2; + break; + case OBJ_TYPE_VERTICES: + ((struct ObjVertex *) dynobj)->pos.x = x; + ((struct ObjVertex *) dynobj)->pos.y = y; + ((struct ObjVertex *) dynobj)->pos.z = z; + break; + case OBJ_TYPE_LABELS: + ((struct ObjLabel *) dynobj)->position.x = x; + ((struct ObjLabel *) dynobj)->position.y = y; + ((struct ObjLabel *) dynobj)->position.z = z; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) dynobj)->pos.x = x; + ((struct ObjParticle *) dynobj)->pos.y = y; + ((struct ObjParticle *) dynobj)->pos.z = z; + break; + case OBJ_TYPE_NETS: + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRelPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Offset the current position of the current dynamic object. + */ +void d_addto_rel_pos(struct GdVec3f *src) { + struct GdObj *dynobj = sDynListCurObj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + ((struct ObjVertex *) dynobj)->pos.x += src->x; + ((struct ObjVertex *) dynobj)->pos.y += src->y; + ((struct ObjVertex *) dynobj)->pos.z += src->z; + break; + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->unk3C.x += src->x; + ((struct ObjJoint *) dynobj)->unk3C.y += src->y; + ((struct ObjJoint *) dynobj)->unk3C.z += src->z; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) dynobj)->pos.x += src->x; + ((struct ObjParticle *) dynobj)->pos.y += src->y; + ((struct ObjParticle *) dynobj)->pos.z += src->z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddToRelPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Store the current dynamic object's position into `dst`. + */ +void d_get_rel_pos(struct GdVec3f *dst) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + dst->x = ((struct ObjVertex *) sDynListCurObj)->pos.x; + dst->y = ((struct ObjVertex *) sDynListCurObj)->pos.y; + dst->z = ((struct ObjVertex *) sDynListCurObj)->pos.z; + break; + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) sDynListCurObj)->unk3C.x; + dst->y = ((struct ObjJoint *) sDynListCurObj)->unk3C.y; + dst->z = ((struct ObjJoint *) sDynListCurObj)->unk3C.z; + break; + case OBJ_TYPE_CAMERAS: + dst->x = ((struct ObjCamera *) sDynListCurObj)->unk40.x; + dst->y = ((struct ObjCamera *) sDynListCurObj)->unk40.y; + dst->z = ((struct ObjCamera *) sDynListCurObj)->unk40.z; + break; + case OBJ_TYPE_PARTICLES: + dst->x = ((struct ObjParticle *) sDynListCurObj)->pos.x; + dst->y = ((struct ObjParticle *) sDynListCurObj)->pos.y; + dst->z = ((struct ObjParticle *) sDynListCurObj)->pos.z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRelPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Return a pointer to the attached object group of the current + * dynamic object. + */ +struct ObjGroup *d_get_att_objgroup(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + return ((struct ObjJoint *) sDynListCurObj)->attachedObjsGrp; + break; // lol + case OBJ_TYPE_NETS: + return ((struct ObjNet *) sDynListCurObj)->attachedObjsGrp; + break; // lol + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttObjGroup()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Return a pointer to the object that the current dynamic object is attached to. + */ +struct GdObj *d_get_att_to_obj(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + return ((struct ObjJoint *) sDynListCurObj)->attachedToObj; + break; // lol + case OBJ_TYPE_NETS: + return ((struct ObjNet *) sDynListCurObj)->attachedToObj; + break; // lol + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttToObj()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Store the current dynamic object's scale into `dst`. + */ +void d_get_scale(struct GdVec3f *dst) { + struct GdObj *dynobj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) dynobj)->scale.x; + dst->y = ((struct ObjJoint *) dynobj)->scale.y; + dst->z = ((struct ObjJoint *) dynobj)->scale.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) dynobj)->scale.x; + dst->y = ((struct ObjNet *) dynobj)->scale.y; + dst->z = ((struct ObjNet *) dynobj)->scale.z; + break; + case OBJ_TYPE_LIGHTS: + dst->x = 1.0f; + dst->y = 1.0f; + dst->z = 1.0f; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetScale()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the offset of the attached object on the current dynamic object. + */ +void d_set_att_offset(const struct GdVec3f *off) { + struct GdObj *dynobj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->attachOffset.x = off->x; + ((struct ObjJoint *) dynobj)->attachOffset.y = off->y; + ((struct ObjJoint *) dynobj)->attachOffset.z = off->z; + + ((struct ObjJoint *) dynobj)->initPos.x = off->x; + ((struct ObjJoint *) dynobj)->initPos.y = off->y; + ((struct ObjJoint *) dynobj)->initPos.z = off->z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->attachOffset.x = off->x; + ((struct ObjNet *) dynobj)->attachOffset.y = off->y; + ((struct ObjNet *) dynobj)->attachOffset.z = off->z; + + ((struct ObjNet *) dynobj)->initPos.x = off->x; + ((struct ObjNet *) dynobj)->initPos.y = off->y; + ((struct ObjNet *) dynobj)->initPos.z = off->z; + break; + case OBJ_TYPE_PARTICLES: + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAttOffset()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * An incorrectly-coded recursive function that was presumably supposed to + * set the offset of an attached object. Now, it will only call itself + * until it encounters a NULL pointer, which will trigger a `fatal_printf()` + * call. + * + * @note Not called + */ +void d_set_att_to_offset(UNUSED u32 a) { + struct GdObj *dynobj; // sp3c + UNUSED u8 pad[24]; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + d_stash_dynobj(); + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + set_cur_dynobj(((struct ObjJoint *) dynobj)->attachedToObj); + break; + case OBJ_TYPE_NETS: + set_cur_dynobj(((struct ObjNet *) dynobj)->attachedToObj); + break; + case OBJ_TYPE_PARTICLES: + set_cur_dynobj(((struct ObjParticle *) dynobj)->attachedToObj); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAttToOffset()", + sDynListCurInfo->name, sDynListCurObj->type); + } + + if (sDynListCurObj == NULL) { + fatal_printf("dSetAttOffset(): Object '%s' isnt attached to anything", + sStashedDynObjInfo->name); + } + d_set_att_to_offset(a); + d_unstash_dynobj(); +} + +/** + * Store the offset of the attached object into `dst`. + * + * @note Not called + */ +void d_get_att_offset(struct GdVec3f *dst) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) sDynListCurObj)->attachOffset.x; + dst->y = ((struct ObjJoint *) sDynListCurObj)->attachOffset.y; + dst->z = ((struct ObjJoint *) sDynListCurObj)->attachOffset.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) sDynListCurObj)->attachOffset.x; + dst->y = ((struct ObjNet *) sDynListCurObj)->attachOffset.y; + dst->z = ((struct ObjNet *) sDynListCurObj)->attachOffset.z; + break; + case OBJ_TYPE_PARTICLES: + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttOffset()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get the attached object flags for the current dynamic object. + */ +s32 d_get_att_flags(void) { + s32 attflag; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + attflag = ((struct ObjJoint *) sDynListCurObj)->attachFlags; + break; + case OBJ_TYPE_NETS: + attflag = ((struct ObjNet *) sDynListCurObj)->attachFlags; + break; + case OBJ_TYPE_PARTICLES: + attflag = ((struct ObjParticle *) sDynListCurObj)->attachFlags; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttFlags()", + sDynListCurInfo->name, sDynListCurObj->type); + } + + return attflag; +} + +/** + * Set the world position of the current dynamic object. + * + * @note Sets the upper left coordinates of an `ObjView` + */ +void d_set_world_pos(f32 x, f32 y, f32 z) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_CAMERAS: + ((struct ObjCamera *) sDynListCurObj)->worldPos.x = x; + ((struct ObjCamera *) sDynListCurObj)->worldPos.y = y; + ((struct ObjCamera *) sDynListCurObj)->worldPos.z = z; + break; + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->worldPos.x = x; + ((struct ObjJoint *) sDynListCurObj)->worldPos.y = y; + ((struct ObjJoint *) sDynListCurObj)->worldPos.z = z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->worldPos.x = x; + ((struct ObjNet *) sDynListCurObj)->worldPos.y = y; + ((struct ObjNet *) sDynListCurObj)->worldPos.z = z; + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) sDynListCurObj)->worldPos.x = x; + ((struct ObjGadget *) sDynListCurObj)->worldPos.y = y; + ((struct ObjGadget *) sDynListCurObj)->worldPos.z = z; + break; + case OBJ_TYPE_VIEWS: + ((struct ObjView *) sDynListCurObj)->upperLeft.x = x; + ((struct ObjView *) sDynListCurObj)->upperLeft.y = y; + ((struct ObjView *) sDynListCurObj)->upperLeft.z = z; + break; + case OBJ_TYPE_VERTICES: + ((struct ObjVertex *) sDynListCurObj)->pos.x = x; + ((struct ObjVertex *) sDynListCurObj)->pos.y = y; + ((struct ObjVertex *) sDynListCurObj)->pos.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetWorldPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the normal of the current dynamic `ObjVertex`. The input `x, y, z` values + * are normalized into a unit vector before setting the vertex normal. + */ +void d_set_normal(f32 x, f32 y, f32 z) { + struct GdVec3f normal; // sp1C + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + normal.x = x; + normal.y = y; + normal.z = z; + gd_normalize_vec3f(&normal); + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + ((struct ObjVertex *) sDynListCurObj)->normal.x = normal.x; + ((struct ObjVertex *) sDynListCurObj)->normal.y = normal.y; + ((struct ObjVertex *) sDynListCurObj)->normal.z = normal.z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetNormal()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get a pointer to the world position vector of the active + * dynamic object. This is a pointer inside the actual object. + * + * @note Not called. + */ +struct GdVec3f *d_get_world_pos_ptr(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + return &((struct ObjVertex *) sDynListCurObj)->pos; + break; + case OBJ_TYPE_PARTICLES: + return &((struct ObjParticle *) sDynListCurObj)->pos; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPosPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Copy the world position of the current dynamic object into `dst`. + */ +void d_get_world_pos(struct GdVec3f *dst) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_VERTICES: + dst->x = ((struct ObjVertex *) sDynListCurObj)->pos.x; + dst->y = ((struct ObjVertex *) sDynListCurObj)->pos.y; + dst->z = ((struct ObjVertex *) sDynListCurObj)->pos.z; + break; + case OBJ_TYPE_JOINTS: + dst->x = ((struct ObjJoint *) sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjJoint *) sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjJoint *) sDynListCurObj)->worldPos.z; + break; + case OBJ_TYPE_NETS: + dst->x = ((struct ObjNet *) sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjNet *) sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjNet *) sDynListCurObj)->worldPos.z; + break; + case OBJ_TYPE_PARTICLES: + dst->x = ((struct ObjParticle *) sDynListCurObj)->pos.x; + dst->y = ((struct ObjParticle *) sDynListCurObj)->pos.y; + dst->z = ((struct ObjParticle *) sDynListCurObj)->pos.z; + break; + case OBJ_TYPE_CAMERAS: + dst->x = ((struct ObjCamera *) sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjCamera *) sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjCamera *) sDynListCurObj)->worldPos.z; + break; + case OBJ_TYPE_BONES: + dst->x = ((struct ObjBone *) sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjBone *) sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjBone *) sDynListCurObj)->worldPos.z; + break; + case OBJ_TYPE_SHAPES: + dst->x = dst->y = dst->z = 0.0f; + break; + case OBJ_TYPE_LABELS: + dst->x = dst->y = dst->z = 0.0f; + break; + case OBJ_TYPE_GADGETS: + dst->x = ((struct ObjGadget *) sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjGadget *) sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjGadget *) sDynListCurObj)->worldPos.z; + break; + case OBJ_TYPE_PLANES: + dst->x = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minX; + dst->y = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minY; + dst->z = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minZ; + + dst->x += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxX; + dst->y += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxY; + dst->z += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxZ; + + dst->x *= 0.5; //? 0.5f + dst->y *= 0.5; //? 0.5f + dst->z *= 0.5; //? 0.5f + break; + case OBJ_TYPE_ZONES: + dst->x = ((struct ObjZone *) sDynListCurObj)->boundingBox.minX; + dst->y = ((struct ObjZone *) sDynListCurObj)->boundingBox.minY; + dst->z = ((struct ObjZone *) sDynListCurObj)->boundingBox.minZ; + + dst->x += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxX; + dst->y += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxY; + dst->z += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxZ; + + dst->x *= 0.5; //? 0.5f + dst->y *= 0.5; //? 0.5f + dst->z *= 0.5; //? 0.5f + break; + case OBJ_TYPE_LIGHTS: + dst->x = ((struct ObjLight *) sDynListCurObj)->position.x; + dst->y = ((struct ObjLight *) sDynListCurObj)->position.y; + dst->z = ((struct ObjLight *) sDynListCurObj)->position.z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPos()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Create a new dynamic `ObjVertex` at point `pos`. + * + * @param[in] pos values are copied to set vertex position + */ +void d_make_vertex(struct GdVec3f *pos) { + d_makeobj(D_VERTEX, AsDynName(NULL)); + d_set_init_pos(pos->x, pos->y, pos->z); +} + +/** + * Scale the current dynamic object by factor `(x, y, z)`. + * + * @note Sets the lower right coordinates of an `ObjView` + */ +void d_set_scale(f32 x, f32 y, f32 z) { + struct GdObj *initDynobj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + initDynobj = sDynListCurObj; + d_stash_dynobj(); + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) initDynobj)->scale.x = x; + ((struct ObjJoint *) initDynobj)->scale.y = y; + ((struct ObjJoint *) initDynobj)->scale.z = z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) initDynobj)->scale.x = x; + ((struct ObjNet *) initDynobj)->scale.y = y; + ((struct ObjNet *) initDynobj)->scale.z = z; + break; + case OBJ_TYPE_VIEWS: + ((struct ObjView *) initDynobj)->lowerRight.x = x; + ((struct ObjView *) initDynobj)->lowerRight.y = y; + ((struct ObjView *) initDynobj)->lowerRight.z = z; + break; + case OBJ_TYPE_PARTICLES: + break; + case OBJ_TYPE_GADGETS: + if (((struct ObjGadget *) initDynobj)->shapePtr != NULL) { + scale_verts_in_shape(((struct ObjGadget *) initDynobj)->shapePtr, x, y, z); + } + ((struct ObjGadget *) initDynobj)->size.x = x; + ((struct ObjGadget *) initDynobj)->size.y = y; + ((struct ObjGadget *) initDynobj)->size.z = z; + break; + case OBJ_TYPE_LIGHTS: + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetScale()", + sDynListCurInfo->name, sDynListCurObj->type); + } + d_unstash_dynobj(); +} + +/** + * Set the rotation value of the current active dynamic object. + */ +void d_set_rotation(f32 x, f32 y, f32 z) { + struct GdObj *dynobj; // sp2C + UNUSED u32 pad; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->unk6C.x = x; + ((struct ObjJoint *) dynobj)->unk6C.y = y; + ((struct ObjJoint *) dynobj)->unk6C.z = z; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->unk68.x = x; + ((struct ObjNet *) dynobj)->unk68.y = y; + ((struct ObjNet *) dynobj)->unk68.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRotation()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the center of gravity of the current dynamic `ObjNet`. + */ +void d_center_of_gravity(f32 x, f32 y, f32 z) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->centerOfGravity.x = x; + ((struct ObjNet *) sDynListCurObj)->centerOfGravity.y = y; + ((struct ObjNet *) sDynListCurObj)->centerOfGravity.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dCofG()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the shape offset of the current dynamic `ObjJoint`. + */ +void d_set_shape_offset(f32 x, f32 y, f32 z) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->shapeOffset.x = x; + ((struct ObjJoint *) sDynListCurObj)->shapeOffset.y = y; + ((struct ObjJoint *) sDynListCurObj)->shapeOffset.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dShapeOffset()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Creates a new `ObjValPtr`. + * If `vflags` is 0x40000, then `name` is the name of an object, and `offset` + * is an offset to a field in that object. Otherwise, `offset` specifies a + * the address of a standalone variable. + */ +void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offset) { + struct GdObj *dynobj; + struct ObjValPtr *valptr; + struct DynObjInfo *info; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + + if (vflags == 0x40000) { + // value is an object field, and objId is the name of the object + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dAddValPtr(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + valptr = make_valptr(info->obj, vflags, type, offset); + } else { + // value is a standalone variable + valptr = make_valptr(name, vflags, type, offset); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_GADGETS: + if (((struct ObjGadget *) dynobj)->valueGrp == NULL) { + ((struct ObjGadget *) dynobj)->valueGrp = make_group(0); + } + addto_group(((struct ObjGadget *) dynobj)->valueGrp, &valptr->header); + break; + case OBJ_TYPE_LABELS: + ((struct ObjLabel *) dynobj)->valptr = valptr; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Add a value processing function (`valptrproc_t`) to the current + * dynamic `ObjLabel`. + */ +void d_add_valproc(valptrproc_t proc) { + struct GdObj *dynobj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_LABELS: + ((struct ObjLabel *) dynobj)->valfn = proc; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValProc()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Link a variable pointer to the current active dynamic object. + * In the final game, this is used to link arrays of raw vertex, face, + * or animation data to `ObjGroup`s, or to link joints to `ObjAnimator`s. + */ +void d_link_with_ptr(void *ptr) { + struct GdObj *dynobj; // sp34 + struct ObjValPtr *valptr; // sp30 + struct ListNode *link; // sp2C + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + imin("dLinkWithPtr"); + switch (sDynListCurObj->type) { + case OBJ_TYPE_CAMERAS: + ((struct ObjCamera *) dynobj)->unk30 = ptr; + break; + case OBJ_TYPE_GROUPS: + link = make_link_to_obj(NULL, ptr); + ((struct ObjGroup *) dynobj)->firstMember = link; + break; + case OBJ_TYPE_BONES: + add_joint2bone((struct ObjBone *) dynobj, ptr); + break; + case OBJ_TYPE_VIEWS: + ((struct ObjView *) dynobj)->components = ptr; + ((struct ObjView *) dynobj)->unk1C = + setup_view_buffers(((struct ObjView *) dynobj)->namePtr, ((struct ObjView *) dynobj), + (s32)((struct ObjView *) dynobj)->upperLeft.x, + (s32)((struct ObjView *) dynobj)->upperLeft.y, + (s32)((struct ObjView *) dynobj)->lowerRight.x, + (s32)((struct ObjView *) dynobj)->lowerRight.y); + reset_nets_and_gadgets(((struct ObjView *) dynobj)->components); + break; + case OBJ_TYPE_FACES: + if (((struct ObjFace *) dynobj)->vtxCount >= 4) { + fatal_printf("too many points"); + } + + ((struct ObjFace *) dynobj)->vertices[((struct ObjFace *) dynobj)->vtxCount] = ptr; + ((struct ObjFace *) dynobj)->vtxCount++; + + if (((struct ObjFace *) dynobj)->vtxCount >= 3) { + calc_face_normal((struct ObjFace *) dynobj); + } + + break; + case OBJ_TYPE_ANIMATORS: + if (((struct ObjAnimator *) dynobj)->animatedPartsGrp == NULL) { + ((struct ObjAnimator *) dynobj)->animatedPartsGrp = make_group(0); + } + + addto_group(((struct ObjAnimator *) dynobj)->animatedPartsGrp, ptr); + break; + case OBJ_TYPE_LABELS: + valptr = make_valptr(ptr, OBJ_TYPE_ALL, 0, 0); + ((struct ObjLabel *) dynobj)->valptr = valptr; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dLinkWithPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } + imout(); +} + +/** + * Link the dynamic object `name` to the current dynamic object by wrapping + * `d_link_with_ptr()`. + */ +void d_link_with(DynObjName name) { + struct DynObjInfo *info; // sp1C + struct DynObjInfo *origInfo = sDynListCurInfo; // sp18 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + if (name == NULL) { + return; + } + + info = get_dynobj_info(name); + if (info == NULL) { + fatal_printf("dLinkWith(\"%s\"): Undefined object", DynNameAsStr(name)); + } + + d_link_with_ptr(info->obj); + set_cur_dynobj(origInfo->obj); + sDynListCurInfo = origInfo; +} + +/** + * Set the object specific flags of the current dynamic object. + */ +void d_set_flags(s32 flags) { + struct GdObj *dynobj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->flags |= flags; + break; + case OBJ_TYPE_BONES: + ((struct ObjBone *) dynobj)->unk104 |= flags; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->flags |= flags; + break; + case OBJ_TYPE_CAMERAS: + ((struct ObjCamera *) dynobj)->flags |= flags; + break; + case OBJ_TYPE_VIEWS: + ((struct ObjView *) dynobj)->flags |= flags; + break; + case OBJ_TYPE_SHAPES: + ((struct ObjShape *) dynobj)->flag |= flags; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) dynobj)->flags |= flags; + break; + case OBJ_TYPE_LIGHTS: + ((struct ObjLight *) dynobj)->flags |= flags; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetFlags()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Clear object specific flags from the current dynamic object. + */ +void d_clear_flags(s32 flags) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->flags &= ~flags; + break; + case OBJ_TYPE_BONES: + ((struct ObjBone *) sDynListCurObj)->unk104 &= ~flags; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->flags &= ~flags; + break; + case OBJ_TYPE_CAMERAS: + ((struct ObjCamera *) sDynListCurObj)->flags &= ~flags; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) sDynListCurObj)->flags &= ~flags; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dClrFlags()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set variable float parameters on the current dynamic object. + * These are mainly used for `ObjGadget`s to set the drawing size + * range. + */ +void d_set_parm_f(enum DParmF param, f32 val) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_SHAPES: + switch (param) { + case PARM_F_ALPHA: + ((struct ObjShape *) sDynListCurObj)->alpha = val; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, + sDynListCurObj->type); + } + break; + case OBJ_TYPE_GADGETS: + switch (param) { + case PARM_F_RANGE_MIN: + ((struct ObjGadget *) sDynListCurObj)->rangeMin = val; + break; + case PARM_F_RANGE_MAX: + ((struct ObjGadget *) sDynListCurObj)->rangeMax = val; + break; + case PARM_F_VARVAL: + ((struct ObjGadget *) sDynListCurObj)->varval.f = val; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, + sDynListCurObj->type); + } + break; + case OBJ_TYPE_VERTICES: + switch (param) { + case PARM_F_ALPHA: + ((struct ObjVertex *) sDynListCurObj)->alpha = val; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, + sDynListCurObj->type); + } + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmf()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set various pointer parameters for the current dynamic object. + * Normally, this is used to set `char *` pointer for various objects, + * but it can also set the vertices for an `ObjFace`. + */ +void d_set_parm_ptr(enum DParmPtr param, void *ptr) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_LABELS: + switch (param) { + case PARM_PTR_CHAR: + ((struct ObjLabel *) sDynListCurObj)->fmtstr = ptr; + break; + default: + fatal_printf("Bad parm"); + } + break; + case OBJ_TYPE_VIEWS: + switch (param) { + case PARM_PTR_CHAR: + ((struct ObjView *) sDynListCurObj)->namePtr = ptr; + break; + default: + fatal_printf("Bad parm"); + } + break; + case OBJ_TYPE_FACES: + switch (param) { + case PARM_PTR_OBJ_VTX: + // Don't allow more than 4 vertices in a face + if (((struct ObjFace *) sDynListCurObj)->vtxCount >= 4) { + fatal_printf("dsetparmp() too many points"); + } + // `ptr` here is a vertex index, not an actual pointer. + // These vertex indices later get converted to `ObjVertex` pointers when `find_thisface_verts` is called. + ((struct ObjFace *) sDynListCurObj)->vertices[((struct ObjFace *) sDynListCurObj)->vtxCount++] = ptr; + break; + default: + fatal_printf("Bad parm"); + } + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmp()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the generic drawing flags for the current dynamic object. + */ +void d_set_obj_draw_flag(enum ObjDrawingFlags flag) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + sDynListCurObj->drawFlags |= flag; +} + +/** + * Set an object specific type field for the current dynamic object. + */ +void d_set_type(s32 type) { + struct GdObj *dynobj = sDynListCurObj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) dynobj)->netType = type; + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) dynobj)->type = type; + break; + case OBJ_TYPE_GROUPS: + ((struct ObjGroup *) dynobj)->debugPrint = type; + break; + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->type = type; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) dynobj)->unk60 = type; + break; + case OBJ_TYPE_MATERIALS: + ((struct ObjMaterial *) dynobj)->type = type; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetType()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the specific object ID field for the current dynamic object. + */ +void d_set_id(s32 id) { + struct GdObj *dynobj = sDynListCurObj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_MATERIALS: + ((struct ObjMaterial *) dynobj)->id = id; + break; + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) dynobj)->id = id; + break; + case OBJ_TYPE_VERTICES: + ((struct ObjVertex *) dynobj)->id = id; + break; + case OBJ_TYPE_LIGHTS: + ((struct ObjLight *) dynobj)->id = id; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetID()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +// TODO: enumerate colors? +/** + * Set the colour of the current dynamic object. The input color is an index + * for `gd_get_colour()` + */ +void d_set_colour_num(s32 colornum) { + struct GdColour *rgbcolor; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->colourNum = colornum; + break; + case OBJ_TYPE_PARTICLES: + ((struct ObjParticle *) sDynListCurObj)->colourNum = colornum; + break; + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->colourNum = colornum; + break; + case OBJ_TYPE_GADGETS: + ((struct ObjGadget *) sDynListCurObj)->colourNum = colornum; + break; + case OBJ_TYPE_FACES: + rgbcolor = gd_get_colour(colornum); + if (rgbcolor != NULL) { + ((struct ObjFace *) sDynListCurObj)->colour.r = rgbcolor->r; + ((struct ObjFace *) sDynListCurObj)->colour.g = rgbcolor->g; + ((struct ObjFace *) sDynListCurObj)->colour.b = rgbcolor->b; + ((struct ObjFace *) sDynListCurObj)->colourNum = colornum; + } else { + fatal_printf("dSetColNum: Unkown colour number"); + } + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dColourNum()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the material ID of the current dynamic `ObjFace`. + */ +void d_set_material(UNUSED void *a0, s32 mtlId) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_FACES: + ((struct ObjFace *) sDynListCurObj)->mtlId = mtlId; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMaterial()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the friction vec of the current dynamic `ObjJoint`. + */ +void d_friction(f32 x, f32 y, f32 z) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) sDynListCurObj)->friction.x = x; + ((struct ObjJoint *) sDynListCurObj)->friction.y = y; + ((struct ObjJoint *) sDynListCurObj)->friction.z = z; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dFriction()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the spring constant of the current dynamic `ObjBone`. + */ +void d_set_spring(f32 spring) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_BONES: + ((struct ObjBone *) sDynListCurObj)->spring = spring; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSpring()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the ambient color of the current dynamic `ObjMaterial`. + */ +void d_set_ambient(f32 r, f32 g, f32 b) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_MATERIALS: + ((struct ObjMaterial *) sDynListCurObj)->Ka.r = r; + ((struct ObjMaterial *) sDynListCurObj)->Ka.g = g; + ((struct ObjMaterial *) sDynListCurObj)->Ka.b = b; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAmbient()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the diffuse color of the current dynamic `ObjMaterial` or `ObjLight`. + */ +void d_set_diffuse(f32 r, f32 g, f32 b) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_MATERIALS: + ((struct ObjMaterial *) sDynListCurObj)->Kd.r = r; + ((struct ObjMaterial *) sDynListCurObj)->Kd.g = g; + ((struct ObjMaterial *) sDynListCurObj)->Kd.b = b; + break; + case OBJ_TYPE_LIGHTS: + ((struct ObjLight *) sDynListCurObj)->diffuse.r = r; + ((struct ObjLight *) sDynListCurObj)->diffuse.g = g; + ((struct ObjLight *) sDynListCurObj)->diffuse.b = b; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetDiffuse()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the control type of the current dynamic `ObjNet`. + */ +void d_set_control_type(s32 ctrltype) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + ((struct ObjNet *) sDynListCurObj)->ctrlType = ctrltype; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dControlType()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get a pointer to a `GdBoundingBox` in the current dynamic object. + * If the current object does not have a bounding box, a pointer to + * a global bounding box at (0,0) is returned. + */ +struct GdBoundingBox *d_get_bounding_box(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + return &((struct ObjNet *) sDynListCurObj)->boundingBox; + break; + case OBJ_TYPE_PLANES: + return &((struct ObjPlane *) sDynListCurObj)->boundingBox; + break; + case OBJ_TYPE_ZONES: + return &((struct ObjZone *) sDynListCurObj)->boundingBox; + break; + default: + return &sNullBoundingBox; + } +} + +/** + * Copy the matrix from the current dynamic object into `dst`. + */ +void d_get_matrix(Mat4f *dst) { + struct GdObj *dynobj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + gd_copy_mat4f(&((struct ObjNet *) dynobj)->mat128, dst); + break; + break; // lol + case OBJ_TYPE_JOINTS: + gd_copy_mat4f(&((struct ObjJoint *) dynobj)->matE8, dst); + break; + case OBJ_TYPE_CAMERAS: + gd_copy_mat4f(&((struct ObjCamera *) dynobj)->unkE8, dst); + break; + case OBJ_TYPE_PARTICLES: + gd_set_identity_mat4(dst); + break; + case OBJ_TYPE_SHAPES: + gd_set_identity_mat4(dst); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrix()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the matrix of the current dynamic object by copying `src` into the object. + */ +void d_set_matrix(Mat4f *src) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat128); + //! @bug When setting an `ObjNet` matrix, the source is copied twice + //! due to a probable copy-paste line repeat error + gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat128); + break; + case OBJ_TYPE_JOINTS: + gd_copy_mat4f(src, &((struct ObjJoint *) sDynListCurObj)->matE8); + break; + case OBJ_TYPE_CAMERAS: + gd_copy_mat4f(src, &((struct ObjCamera *) sDynListCurObj)->unk64); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatrix()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Set the rotation matrix of the current dynamic object by copying + * the input matrix `src`. + */ +void d_set_rot_mtx(Mat4f *src) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + gd_copy_mat4f(src, &((struct ObjJoint *) sDynListCurObj)->mat128); + break; + case OBJ_TYPE_NETS: + gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat168); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRMatrix()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get a pointer to the current dynamic object's rotation matrix. + */ +Mat4f *d_get_rot_mtx_ptr(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + return &((struct ObjJoint *) sDynListCurObj)->mat128; + case OBJ_TYPE_NETS: + return &((struct ObjNet *) sDynListCurObj)->mat168; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRMatrixPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Copy `src` into the matrix of the current dynamic object. + * TODO: What is an IMatrix? + */ +void d_set_i_matrix(Mat4f *src) { + struct GdObj *dynobj; + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + gd_copy_mat4f(src, &((struct ObjNet *) dynobj)->matE8); + break; + case OBJ_TYPE_JOINTS: + gd_copy_mat4f(src, &((struct ObjJoint *) dynobj)->mat168); + break; + case OBJ_TYPE_LIGHTS: + ((struct ObjLight *) dynobj)->position.x = (*src)[3][0]; + ((struct ObjLight *) dynobj)->position.y = (*src)[3][1]; + ((struct ObjLight *) dynobj)->position.z = (*src)[3][2]; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetIMatrix()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} + +/** + * Get a pointer to the current dynamic object's matrix. + */ +Mat4f *d_get_matrix_ptr(void) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + return &((struct ObjNet *) sDynListCurObj)->mat128; + break; + case OBJ_TYPE_CAMERAS: + return &((struct ObjCamera *) sDynListCurObj)->unk64; + break; + case OBJ_TYPE_BONES: + return &((struct ObjBone *) sDynListCurObj)->mat70; + break; + case OBJ_TYPE_JOINTS: + return &((struct ObjJoint *) sDynListCurObj)->matE8; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrixPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Get a pointer to the current dynamic object's matrix. + * TODO: What is an IMatrix? + */ +Mat4f *d_get_i_mtx_ptr(void) { + struct GdObj *dynobj; // sp24 + + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + dynobj = sDynListCurObj; + switch (sDynListCurObj->type) { + case OBJ_TYPE_NETS: + return &((struct ObjNet *) dynobj)->matE8; + break; + case OBJ_TYPE_JOINTS: + return &((struct ObjJoint *) dynobj)->mat168; + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetIMatrixPtr()", + sDynListCurInfo->name, sDynListCurObj->type); + } + // No null return due to `fatal_printf()` being a non-returning function? +} + +/** + * Use the dynamic object system to calculate the distance between + * two `GdObj`s. The objects don't have to be dynamic objects. + */ +f32 d_calc_world_dist_btwn(struct GdObj *obj1, struct GdObj *obj2) { + struct GdVec3f obj1pos; // sp34 + struct GdVec3f obj2pos; // sp28 + struct GdVec3f posdiff; // sp1C + + set_cur_dynobj(obj1); + d_get_world_pos(&obj1pos); + set_cur_dynobj(obj2); + d_get_world_pos(&obj2pos); + + posdiff.x = obj2pos.x - obj1pos.x; + posdiff.y = obj2pos.y - obj1pos.y; + posdiff.z = obj2pos.z - obj1pos.z; + + return gd_vec3f_magnitude(&posdiff); +} + +/** + * Create a new weight for the vertex `vtxId` in the current dynamic `ObjJoint`. + * The input weight value is out of 100. + */ +void d_set_skin_weight(s32 vtxId, f32 percentWeight) { + if (sDynListCurObj == NULL) { + fatal_printf("proc_dynlist(): No current object"); + } + + switch (sDynListCurObj->type) { + case OBJ_TYPE_JOINTS: + set_skin_weight((struct ObjJoint *) sDynListCurObj, vtxId, NULL, + percentWeight / 100.0); + break; + default: + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSkinWeight()", + sDynListCurInfo->name, sDynListCurObj->type); + } +} diff --git a/src/goddard/dynlist_proc.h b/src/goddard/dynlist_proc.h new file mode 100644 index 00000000..f4641baf --- /dev/null +++ b/src/goddard/dynlist_proc.h @@ -0,0 +1,99 @@ +#ifndef GD_DYNLIST_PROCESSOR_H +#define GD_DYNLIST_PROCESSOR_H + +#include + +#include "gd_types.h" + +// types +/// @name DynObjName Type +/// @{ +/// A new type for identification of `GdObj`s in the dynamic object list. +typedef void *DynObjName; +/// Macros for casting between types of names, +/// as the name can be either a number or a string. +/// @{ +#define DynNameAsStr(name) ((char *)(name)) +#define DynNameAsInt(name) ((u32)(uintptr_t)(name)) +#define AsDynName(unk) ((DynObjName)(unk)) +/// @} +/// @} + +/// parameters types for `d_set_parm_ptr()` +enum DParmPtr { + PARM_PTR_OBJ_VTX = 1, ///< parameter is the index of a vertex to add to an `ObjFace` + PARM_PTR_CHAR = 5 ///< parameter is a `char *` +}; + +/// parameters for `d_set_parm_f()` +enum DParmF { + PARM_F_ALPHA = 1, ///< Set the alpha value for an `ObjShape` or `ObjVertex` + PARM_F_RANGE_MIN = 2, ///< Set the left range for an `ObjGadget` + PARM_F_RANGE_MAX = 3, ///< Set the right range for an `ObjGadget` + PARM_F_VARVAL = 6 ///< Set the float variable value union in an `ObjGadget` +}; + +/// `d_makeobj()` object types +enum DObjTypes { + D_CAR_DYNAMICS = 0, + D_NET = 1, + D_JOINT = 2, + D_ANOTHER_JOINT = 3, + D_CAMERA = 4, + D_VERTEX = 5, + D_FACE = 6, + D_PLANE = 7, + D_BONE = 8, + D_MATERIAL = 9, + D_SHAPE = 10, + D_GADGET = 11, + D_LABEL = 12, + D_VIEW = 13, + D_ANIMATOR = 14, + D_DATA_GRP = 15, ///< An `ObjGroup` that links to raw vertex or face data + D_PARTICLE = 16, + D_LIGHT = 17, + D_GROUP = 18 +}; + +// functions +void d_stash_dynobj(void); +void d_unstash_dynobj(void); +void reset_dynlist(void); +struct GdObj *proc_dynlist(struct DynList *dylist); +void d_set_name_suffix(char *str); +struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name); +void d_set_shapeptrptr(struct ObjShape **shpPtrptr); +struct GdObj *d_use_obj(DynObjName name); +void set_cur_dynobj(struct GdObj *obj); +void d_start_group(DynObjName name); +void d_end_group(DynObjName name); +void d_use_integer_names(s32 isIntBool); +void d_set_init_pos(f32 x, f32 y, f32 z); +void d_get_init_pos(struct GdVec3f *dst); +void d_get_init_rot(struct GdVec3f *dst); +void d_set_rel_pos(f32 x, f32 y, f32 z); +void d_get_rel_pos(struct GdVec3f *dst); +struct ObjGroup *d_get_att_objgroup(void); +void d_get_scale(struct GdVec3f *dst); +void d_set_world_pos(f32 x, f32 y, f32 z); +void d_get_world_pos(struct GdVec3f *dst); +void d_set_scale(f32 x, f32 y, f32 z); +void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offset); +void d_add_valproc(union ObjVarVal * (*)(union ObjVarVal *, union ObjVarVal)); +void d_set_flags(s32 flags); +void d_set_parm_f(enum DParmF param, f32 val); +void d_set_parm_ptr(enum DParmPtr param, void *ptr); +void d_set_obj_draw_flag(enum ObjDrawingFlags flag); +void d_set_type(s32 type); +void d_set_colour_num(s32 colornum); +void d_set_diffuse(f32 r, f32 g, f32 b); +struct GdBoundingBox* d_get_bounding_box(void); +void d_get_matrix(Mat4f *dst); +Mat4f *d_get_rot_mtx_ptr(void); +void d_set_i_matrix(Mat4f *src); +Mat4f *d_get_matrix_ptr(void); +Mat4f *d_get_i_mtx_ptr(void); +f32 d_calc_world_dist_btwn(struct GdObj *obj1, struct GdObj *obj2); + +#endif // GD_DYNLIST_PROCESSOR_H diff --git a/src/goddard/dynlists/anim_group_1.c b/src/goddard/dynlists/anim_group_1.c new file mode 100644 index 00000000..bd2b61f8 --- /dev/null +++ b/src/goddard/dynlists/anim_group_1.c @@ -0,0 +1,2328 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_eyebrows_equalizer_1[][3] = { + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, -1 }, + { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -4 }, + { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, { 0, 0, -6 }, + { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, + { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, + { 0, 0, -12 }, { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, + { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, + { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, + { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -25 }, + { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, + { 0, 0, -30 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, + { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, + { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, + { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -40 }, + { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, { 0, 0, -43 }, + { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, + { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, + { 0, 0, -49 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, + { 0, 0, -52 }, { 0, 0, -52 }, { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, + { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, + { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -60 }, + { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -63 }, + { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, + { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, + { 0, 0, -69 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, + { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, + { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, + { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, + { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, { 0, 0, -85 }, + { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, + { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, + { 0, 0, -93 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, + { 0, 0, -97 }, { 0, 0, -97 }, { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, + { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, + { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, { 0, 0, -107 }, { 0, 0, -108 }, + { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -138 }, + { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, + { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, + { 0, 0, -151 }, { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, + { 0, 0, -147 }, { 0, 0, -147 }, { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, + { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, + { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, { 0, 0, -137 }, { 0, 0, -136 }, + { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, { 0, 0, -132 }, + { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, + { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, + { 0, 0, -124 }, { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, + { 0, 0, -120 }, { 0, 0, -119 }, { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, + { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, + { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, { 0, 0, -109 }, { 0, 0, -108 }, + { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, { 0, 0, -104 }, + { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, + { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, + { 0, 0, -96 }, { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, + { 0, 0, -92 }, { 0, 0, -91 }, { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, + { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, + { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, + { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -76 }, + { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, + { 0, 0, -68 }, { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, + { 0, 0, -64 }, { 0, 0, -63 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, + { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, + { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, { 0, 0, -53 }, { 0, 0, -53 }, + { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, { 0, 0, -49 }, + { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, + { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, + { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, + { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, + { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, + { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -26 }, { 0, 0, -25 }, + { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, + { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, + { 0, 0, -14 }, { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, + { 0, 0, -10 }, { 0, 0, -9 }, { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, + { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, + { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_equalizer[] = { + { ARRAY_COUNT(animdata_mario_eyebrows_equalizer_1), GD_ANIM_ROT3S, animdata_mario_eyebrows_equalizer_1 }, + { 0, GD_ANIM_EMPTY, NULL }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eyebrows_2_1[][3] = { + { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 27, 0, 1822 }, { 26, 0, 1821 }, + { 26, 0, 1819 }, { 25, 0, 1818 }, { 24, 0, 1816 }, { 23, 0, 1815 }, { 22, 0, 1814 }, + { 21, 0, 1812 }, { 21, 0, 1811 }, { 20, 0, 1810 }, { 20, 0, 1810 }, { 20, 0, 1810 }, + { 20, 0, 1810 }, { 20, 0, 1811 }, { 21, 0, 1812 }, { 22, 0, 1814 }, { 24, 0, 1816 }, + { 26, 0, 1819 }, { 28, 0, 1823 }, { 40, 0, 1843 }, { 64, 0, 1880 }, { 86, -1, 1916 }, + { 96, -1, 1932 }, { 95, -1, 1931 }, { 93, -1, 1926 }, { 88, -1, 1919 }, { 83, -1, 1911 }, + { 76, -1, 1900 }, { 69, 0, 1889 }, { 62, 0, 1877 }, { 55, 0, 1866 }, { 48, 0, 1854 }, + { 41, 0, 1844 }, { 36, 0, 1835 }, { 31, 0, 1828 }, { 28, 0, 1823 }, { 26, 0, 1820 }, + { 25, 0, 1817 }, { 24, 0, 1815 }, { 23, 0, 1813 }, { 22, 0, 1812 }, { 22, 0, 1811 }, + { 22, 0, 1811 }, { 22, 0, 1810 }, { 23, 0, 1810 }, { 23, 0, 1811 }, { 24, 0, 1811 }, + { 25, 0, 1812 }, { 25, 0, 1813 }, { 26, 0, 1815 }, { 27, 0, 1816 }, { 27, 0, 1818 }, + { 28, 0, 1819 }, { 28, 0, 1821 }, { 28, 0, 1823 }, { 28, 0, 1832 }, { 28, 0, 1847 }, + { 28, -1, 1862 }, { 28, -2, 1869 }, { 28, -1, 1865 }, { 28, -1, 1856 }, { 28, 0, 1844 }, + { 28, 0, 1832 }, { 28, 0, 1823 }, { 28, 0, 1822 }, { 28, 0, 1823 }, { 28, 0, 1823 }, + { 28, 0, 1823 }, { 28, 0, 1824 }, { 28, 0, 1824 }, { 28, 0, 1824 }, { 28, 0, 1825 }, + { 28, 0, 1825 }, { 28, 0, 1825 }, { 28, 0, 1826 }, { 28, 0, 1826 }, { 28, 0, 1826 }, + { 28, 0, 1827 }, { 28, 0, 1827 }, { 28, 0, 1827 }, { 28, 0, 1826 }, { 28, 0, 1826 }, + { 28, 0, 1826 }, { 28, 0, 1825 }, { 28, 0, 1824 }, { 28, 0, 1823 }, { 28, 0, 1820 }, + { 28, 0, 1813 }, { 28, 1, 1805 }, { 28, 1, 1798 }, { 28, 1, 1795 }, { 28, 1, 1794 }, + { 28, 1, 1792 }, { 28, 1, 1792 }, { 28, 1, 1791 }, { 28, 1, 1790 }, { 28, 1, 1790 }, + { 28, 1, 1789 }, { 28, 1, 1789 }, { 28, 1, 1789 }, { 28, 1, 1789 }, { 28, 1, 1790 }, + { 28, 1, 1790 }, { 28, 1, 1790 }, { 28, 1, 1791 }, { 28, 1, 1792 }, { 28, 1, 1793 }, + { 28, 1, 1794 }, { 28, 1, 1795 }, { 28, 1, 1797 }, { 28, 1, 1803 }, { 28, 0, 1809 }, + { 28, 0, 1815 }, { 28, 0, 1821 }, { 28, 0, 1823 }, { 28, 0, 1824 }, { 28, 0, 1824 }, + { 28, 0, 1824 }, { 28, 0, 1823 }, { 28, 0, 1822 }, { 28, 0, 1820 }, { 28, 0, 1818 }, + { 28, 0, 1817 }, { 28, 0, 1815 }, { 28, 0, 1813 }, { 28, 0, 1812 }, { 28, 0, 1810 }, + { 28, 1, 1808 }, { 28, 1, 1806 }, { 28, 1, 1804 }, { 28, 1, 1802 }, { 28, 1, 1799 }, + { 28, 1, 1798 }, { 28, 1, 1796 }, { 28, 1, 1795 }, { 28, 1, 1795 }, { 28, 1, 1795 }, + { 28, 1, 1795 }, { 28, 1, 1795 }, { 28, 1, 1796 }, { 28, 1, 1797 }, { 28, 1, 1797 }, + { 28, 1, 1798 }, { 28, 1, 1799 }, { 28, 1, 1800 }, { 28, 1, 1801 }, { 28, 1, 1802 }, + { 28, 1, 1803 }, { 28, 1, 1804 }, { 28, 1, 1805 }, { 28, 1, 1807 }, { 28, 1, 1808 }, + { 28, 1, 1808 }, { 28, 0, 1809 }, { 28, 0, 1810 }, { 28, 0, 1811 }, { 28, 0, 1811 }, + { 28, 0, 1812 }, { 28, 0, 1812 }, { 28, 0, 1812 }, { 28, 0, 1811 }, { 28, 1, 1807 }, + { 28, 1, 1802 }, { 28, 1, 1798 }, { 28, 1, 1795 }, { 28, 1, 1795 }, { 28, 1, 1800 }, + { 28, 0, 1810 }, { 28, 0, 1821 }, { 28, 0, 1828 }, { 28, 0, 1829 }, { 28, 0, 1826 }, + { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, + { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, + { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, + { 28, 0, 1822 }, { 28, 0, 1820 }, { 28, 1, 1817 }, { 27, 1, 1814 }, { 27, 2, 1810 }, + { 26, 2, 1807 }, { 26, 3, 1803 }, { 26, 3, 1799 }, { 25, 4, 1795 }, { 25, 4, 1791 }, + { 25, 5, 1788 }, { 24, 5, 1785 }, { 24, 5, 1783 }, { 24, 6, 1781 }, { 24, 6, 1780 }, + { 24, 6, 1780 }, { 24, 6, 1781 }, { 24, 5, 1783 }, { 24, 5, 1786 }, { 25, 4, 1790 }, + { 25, 4, 1796 }, { 26, 2, 1803 }, { 27, 1, 1812 }, { 28, 0, 1823 }, { 33, -5, 1867 }, + { 42, -17, 1956 }, { 52, -31, 2057 }, { 60, -43, 2141 }, { 64, -47, 2176 }, { 64, -46, 2163 }, + { 63, -41, 2130 }, { 60, -34, 2082 }, { 57, -27, 2024 }, { 53, -18, 1964 }, { 46, -10, 1906 }, + { 38, -4, 1857 }, { 28, 0, 1823 }, { 13, 2, 1804 }, { -7, 3, 1795 }, { -32, 3, 1793 }, + { -56, 3, 1795 }, { -78, 2, 1800 }, { -95, 1, 1804 }, { -103, 1, 1806 }, { -105, 1, 1806 }, + { -107, 1, 1805 }, { -109, 1, 1805 }, { -111, 1, 1805 }, { -113, 1, 1805 }, { -114, 1, 1805 }, + { -115, 1, 1804 }, { -116, 1, 1804 }, { -117, 1, 1804 }, { -118, 1, 1804 }, { -119, 1, 1804 }, + { -119, 1, 1804 }, { -119, 1, 1804 }, { -119, 1, 1804 }, { -120, 1, 1804 }, { -119, 1, 1804 }, + { -119, 1, 1804 }, { -119, 1, 1804 }, { -119, 1, 1804 }, { -118, 1, 1804 }, { -118, 1, 1804 }, + { -117, 1, 1804 }, { -117, 1, 1804 }, { -116, 1, 1804 }, { -115, 1, 1804 }, { -114, 1, 1805 }, + { -114, 1, 1805 }, { -113, 1, 1805 }, { -112, 1, 1805 }, { -111, 1, 1805 }, { -110, 1, 1805 }, + { -109, 1, 1805 }, { -109, 1, 1805 }, { -108, 1, 1805 }, { -107, 1, 1806 }, { -106, 1, 1806 }, + { -106, 1, 1806 }, { -105, 1, 1806 }, { -104, 1, 1806 }, { -104, 1, 1806 }, { -103, 1, 1806 }, + { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, + { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1805 }, { -103, 0, 1805 }, + { -103, 0, 1805 }, { -103, 0, 1805 }, { -103, 0, 1804 }, { -103, 0, 1804 }, { -103, 0, 1804 }, + { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, + { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1804 }, + { -103, 0, 1804 }, { -103, 0, 1805 }, { -103, 0, 1805 }, { -103, 1, 1806 }, { -103, 1, 1807 }, + { -103, 1, 1809 }, { -103, 2, 1812 }, { -103, 2, 1815 }, { -103, 3, 1818 }, { -103, 3, 1822 }, + { -102, 4, 1825 }, { -102, 5, 1829 }, { -102, 5, 1832 }, { -102, 6, 1835 }, { -102, 6, 1838 }, + { -102, 7, 1840 }, { -102, 7, 1842 }, { -102, 7, 1843 }, { -102, 8, 1845 }, { -102, 8, 1845 }, + { -102, 8, 1845 }, { -102, 7, 1843 }, { -102, 7, 1840 }, { -102, 6, 1834 }, { -102, 4, 1825 }, + { -103, 2, 1814 }, { -103, 0, 1803 }, { -103, 0, 1794 }, { -103, -1, 1789 }, { -103, -2, 1787 }, + { -103, -2, 1784 }, { -103, -3, 1782 }, { -103, -3, 1780 }, { -103, -3, 1778 }, { -103, -4, 1777 }, + { -103, -4, 1775 }, { -103, -4, 1774 }, { -103, -4, 1773 }, { -103, -5, 1772 }, { -103, -5, 1771 }, + { -103, -5, 1770 }, { -103, -5, 1770 }, { -103, -5, 1769 }, { -102, -5, 1769 }, { -102, -5, 1768 }, + { -102, -5, 1768 }, { -102, -5, 1767 }, { -102, -5, 1767 }, { -102, -6, 1767 }, { -102, -6, 1766 }, + { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1765 }, { -102, -6, 1765 }, + { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, + { -102, -6, 1764 }, { -102, -6, 1764 }, { -102, -6, 1764 }, { -102, -6, 1764 }, { -102, -6, 1764 }, + { -102, -6, 1764 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, + { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1765 }, + { -102, -6, 1765 }, { -102, -6, 1765 }, { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1766 }, + { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1766 }, { -102, -6, 1766 }, + { -102, -6, 1766 }, { -102, -6, 1767 }, { -102, -6, 1767 }, { -102, -6, 1767 }, { -102, -6, 1767 }, + { -102, -6, 1767 }, { -102, -6, 1767 }, { -102, -6, 1766 }, { -103, -6, 1763 }, { -103, -7, 1759 }, + { -103, -8, 1755 }, { -103, -8, 1751 }, { -103, -9, 1747 }, { -103, -9, 1744 }, { -103, -10, 1743 }, + { -103, -9, 1745 }, { -103, -9, 1749 }, { -103, -7, 1756 }, { -102, -6, 1767 }, { -101, 0, 1805 }, + { -99, 12, 1873 }, { -97, 24, 1941 }, { -96, 30, 1976 }, { -96, 31, 1981 }, { -97, 31, 1980 }, + { -97, 30, 1973 }, { -98, 28, 1961 }, { -99, 26, 1947 }, { -99, 23, 1931 }, { -100, 20, 1914 }, + { -101, 17, 1899 }, { -101, 15, 1885 }, { -102, 12, 1869 }, { -102, 8, 1849 }, { -102, 5, 1829 }, + { -103, 2, 1813 }, { -103, 1, 1806 }, { -103, 1, 1805 }, { -103, 0, 1805 }, { -103, 0, 1804 }, + { -103, 0, 1803 }, { -103, 0, 1802 }, { -103, 0, 1802 }, { -103, 0, 1801 }, { -103, 0, 1801 }, + { -103, 0, 1800 }, { -103, 0, 1800 }, { -103, 0, 1799 }, { -103, 0, 1799 }, { -103, 0, 1798 }, + { -103, 0, 1798 }, { -103, 0, 1798 }, { -103, 0, 1797 }, { -103, 0, 1797 }, { -103, 0, 1797 }, + { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1796 }, + { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, + { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, + { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, { -103, 0, 1795 }, + { -103, 0, 1795 }, { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1796 }, + { -103, 0, 1796 }, { -103, 0, 1796 }, { -103, 0, 1797 }, { -103, 0, 1797 }, { -103, 0, 1797 }, + { -103, 0, 1797 }, { -103, 0, 1797 }, { -103, 0, 1798 }, { -103, 0, 1798 }, { -103, 0, 1798 }, + { -103, 0, 1798 }, { -103, 0, 1799 }, { -103, 0, 1799 }, { -103, 0, 1799 }, { -103, 0, 1799 }, + { -103, 0, 1800 }, { -103, 0, 1800 }, { -103, 0, 1800 }, { -103, 0, 1801 }, { -103, 0, 1801 }, + { -103, 0, 1801 }, { -103, 0, 1801 }, { -103, 0, 1802 }, { -103, 0, 1802 }, { -103, 0, 1802 }, + { -103, 0, 1802 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, { -103, 0, 1803 }, + { -103, 0, 1804 }, { -103, 0, 1804 }, { -103, 0, 1804 }, { -103, 0, 1804 }, { -103, 0, 1804 }, + { -103, 0, 1805 }, { -103, 0, 1805 }, { -103, 0, 1805 }, { -103, 0, 1805 }, { -103, 1, 1805 }, + { -103, 1, 1805 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, + { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, { -103, 1, 1806 }, + { -103, 1, 1806 }, { -104, 1, 1806 }, { -105, 1, 1806 }, { -107, 1, 1806 }, { -109, 1, 1805 }, + { -111, 0, 1805 }, { -112, 0, 1805 }, { -113, 0, 1805 }, { -114, 0, 1805 }, { -114, 0, 1805 }, + { -113, 0, 1805 }, { -111, 0, 1805 }, { -107, 1, 1806 }, { -103, 1, 1806 }, { -96, 1, 1807 }, + { -87, 1, 1808 }, { -75, 1, 1809 }, { -63, 1, 1810 }, { -49, 2, 1812 }, { -34, 2, 1813 }, + { -19, 2, 1815 }, { -5, 3, 1816 }, { 8, 3, 1818 }, { 21, 3, 1819 }, { 33, 3, 1820 }, + { 43, 3, 1822 }, { 50, 4, 1822 }, { 55, 4, 1823 }, { 57, 4, 1823 }, { 55, 4, 1823 }, + { 48, 4, 1822 }, { 38, 3, 1821 }, { 25, 3, 1820 }, { 10, 3, 1818 }, { -5, 3, 1816 }, + { -22, 2, 1815 }, { -39, 2, 1813 }, { -56, 2, 1811 }, { -71, 1, 1809 }, { -84, 1, 1808 }, + { -94, 1, 1807 }, { -100, 1, 1806 }, { -103, 1, 1806 }, { -101, 1, 1806 }, { -95, 1, 1807 }, + { -86, 1, 1808 }, { -74, 1, 1809 }, { -61, 1, 1810 }, { -46, 2, 1812 }, { -30, 2, 1814 }, + { -14, 2, 1815 }, { 0, 3, 1817 }, { 15, 3, 1819 }, { 29, 3, 1820 }, { 40, 3, 1821 }, + { 49, 4, 1822 }, { 55, 4, 1823 }, { 57, 4, 1823 }, { 55, 4, 1823 }, { 48, 4, 1822 }, + { 38, 3, 1821 }, { 25, 3, 1820 }, { 10, 3, 1818 }, { -5, 3, 1816 }, { -22, 2, 1815 }, + { -39, 2, 1813 }, { -56, 2, 1811 }, { -71, 1, 1809 }, { -84, 1, 1808 }, { -94, 1, 1807 }, + { -100, 1, 1806 }, { -103, 1, 1806 }, { -100, 1, 1806 }, { -92, 1, 1807 }, { -81, 1, 1808 }, + { -66, 1, 1810 }, { -50, 2, 1812 }, { -32, 2, 1814 }, { -13, 2, 1816 }, { 4, 3, 1817 }, + { 21, 3, 1819 }, { 35, 3, 1821 }, { 47, 4, 1822 }, { 54, 4, 1823 }, { 57, 4, 1823 }, + { 55, 4, 1823 }, { 49, 4, 1822 }, { 41, 3, 1822 }, { 30, 3, 1821 }, { 17, 3, 1820 }, + { 3, 3, 1819 }, { -11, 3, 1817 }, { -27, 2, 1816 }, { -42, 2, 1815 }, { -57, 2, 1813 }, + { -71, 1, 1812 }, { -83, 1, 1810 }, { -92, 1, 1809 }, { -99, 1, 1807 }, { -103, 1, 1806 }, + { -103, 1, 1805 }, { -102, 0, 1803 }, { -99, 0, 1802 }, { -94, 0, 1800 }, { -88, 0, 1798 }, + { -82, 0, 1797 }, { -74, 0, 1795 }, { -65, 0, 1793 }, { -56, 0, 1792 }, { -47, 0, 1790 }, + { -38, 0, 1789 }, { -30, 0, 1788 }, { -22, 0, 1787 }, { -14, 0, 1786 }, { -8, 0, 1785 }, + { -3, 0, 1785 }, { 0, 0, 1785 }, { 3, 0, 1786 }, { 5, 0, 1786 }, { 8, 0, 1787 }, + { 10, 0, 1788 }, { 12, 0, 1789 }, { 14, 0, 1790 }, { 15, 0, 1792 }, { 17, 0, 1793 }, + { 18, 0, 1795 }, { 19, 0, 1796 }, { 20, 0, 1798 }, { 21, 0, 1799 }, { 22, 0, 1801 }, + { 22, 0, 1803 }, { 23, 0, 1805 }, { 23, 0, 1806 }, { 24, 0, 1808 }, { 24, 0, 1810 }, + { 25, 0, 1812 }, { 25, 0, 1813 }, { 25, 0, 1815 }, { 26, 0, 1816 }, { 26, 0, 1818 }, + { 26, 0, 1819 }, { 27, 0, 1820 }, { 27, 0, 1821 }, { 28, 0, 1822 }, { 28, 0, 1823 }, + { 29, 0, 1824 }, { 30, 0, 1825 }, { 31, 0, 1825 }, { 33, 0, 1825 }, { 34, 0, 1825 }, + { 36, 0, 1825 }, { 38, 0, 1825 }, { 39, 0, 1825 }, { 41, 0, 1825 }, { 42, 0, 1825 }, + { 43, 0, 1825 }, { 43, 0, 1824 }, { 43, 0, 1824 }, { 43, 0, 1824 }, { 42, 0, 1824 }, + { 41, 0, 1823 }, { 39, 0, 1823 }, { 36, 0, 1823 }, { 33, 0, 1823 }, { 28, 0, 1823 }, + { 21, 0, 1824 }, { 12, 0, 1824 }, { 0, 1, 1825 }, { -15, 1, 1826 }, { -30, 2, 1827 }, + { -47, 3, 1828 }, { -64, 3, 1829 }, { -80, 4, 1829 }, { -94, 5, 1830 }, { -108, 5, 1829 }, + { -118, 6, 1829 }, { -125, 6, 1828 }, { -131, 7, 1826 }, { -135, 7, 1823 }, { -138, 7, 1821 }, + { -141, 8, 1817 }, { -143, 8, 1814 }, { -145, 9, 1810 }, { -145, 9, 1806 }, { -146, 9, 1802 }, + { -146, 10, 1798 }, { -146, 10, 1795 }, { -145, 11, 1791 }, { -144, 11, 1788 }, { -144, 11, 1784 }, + { -143, 11, 1782 }, { -142, 11, 1780 }, { -141, 12, 1778 }, { -141, 12, 1777 }, { -141, 12, 1776 }, + { -141, 12, 1777 }, { -141, 12, 1777 }, { -140, 12, 1778 }, { -140, 11, 1780 }, { -139, 11, 1782 }, + { -139, 11, 1784 }, { -138, 11, 1786 }, { -138, 11, 1789 }, { -137, 11, 1791 }, { -136, 10, 1794 }, + { -135, 10, 1797 }, { -134, 10, 1800 }, { -133, 10, 1804 }, { -133, 9, 1807 }, { -132, 9, 1810 }, + { -131, 9, 1813 }, { -130, 8, 1815 }, { -129, 8, 1818 }, { -128, 8, 1821 }, { -127, 7, 1823 }, + { -127, 7, 1825 }, { -126, 7, 1826 }, { -125, 6, 1828 }, { -125, 5, 1825 }, { -125, 3, 1817 }, + { -126, 2, 1809 }, { -126, 1, 1805 }, { -126, 2, 1811 }, { -126, 5, 1822 }, { -125, 6, 1828 }, + { -126, 5, 1822 }, { -126, 3, 1812 }, { -126, 1, 1805 }, { -126, 2, 1807 }, { -126, 3, 1812 }, + { -126, 4, 1816 }, { -126, 4, 1817 }, { -126, 4, 1817 }, { -126, 4, 1817 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, + { -126, 4, 1816 }, { -126, 4, 1816 }, { -126, 4, 1816 }, { -129, 4, 1816 }, { -126, 4, 1816 }, + { -111, 3, 1817 }, { -93, 3, 1818 }, { -73, 2, 1819 }, { -53, 2, 1820 }, { -32, 1, 1821 }, + { -13, 1, 1821 }, { 3, 0, 1822 }, { 16, 0, 1823 }, { 25, 0, 1823 }, { 28, 0, 1823 }, +}; + +static s16 animdata_mario_eyebrows_2_2[][3] = { + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1942 }, { 28, -5, 1941 }, { 29, -5, 1939 }, { 29, -5, 1937 }, + { 30, -5, 1934 }, { 30, -5, 1932 }, { 31, -5, 1929 }, { 31, -5, 1926 }, { 32, -5, 1922 }, + { 32, -5, 1919 }, { 32, -4, 1916 }, { 32, -4, 1913 }, { 32, -4, 1910 }, { 31, -4, 1907 }, + { 30, -4, 1905 }, { 29, -3, 1903 }, { 28, -3, 1901 }, { 26, -3, 1900 }, { 24, -2, 1898 }, + { 22, -2, 1897 }, { 19, -2, 1896 }, { 16, -1, 1894 }, { 13, -1, 1893 }, { 10, -1, 1892 }, + { 6, 0, 1891 }, { 3, 0, 1890 }, { 0, 0, 1889 }, { -3, 0, 1888 }, { -7, 1, 1887 }, + { -10, 1, 1886 }, { -14, 2, 1885 }, { -18, 2, 1884 }, { -21, 2, 1883 }, { -24, 3, 1883 }, + { -28, 3, 1882 }, { -31, 4, 1881 }, { -33, 4, 1880 }, { -36, 5, 1880 }, { -38, 5, 1879 }, + { -40, 6, 1878 }, { -42, 7, 1877 }, { -44, 7, 1877 }, { -45, 8, 1876 }, { -45, 8, 1875 }, + { -46, 9, 1874 }, { -45, 9, 1874 }, { -45, 10, 1873 }, { -45, 11, 1872 }, { -44, 11, 1872 }, + { -43, 12, 1871 }, { -42, 13, 1870 }, { -40, 13, 1870 }, { -39, 14, 1869 }, { -37, 15, 1868 }, + { -35, 16, 1868 }, { -33, 17, 1867 }, { -31, 18, 1867 }, { -29, 18, 1866 }, { -27, 19, 1866 }, + { -24, 20, 1865 }, { -22, 21, 1864 }, { -20, 22, 1864 }, { -17, 23, 1863 }, { -14, 24, 1863 }, + { -12, 24, 1862 }, { -9, 25, 1862 }, { -7, 26, 1861 }, { -4, 27, 1861 }, { -1, 27, 1860 }, + { 0, 28, 1860 }, { 3, 29, 1859 }, { 5, 29, 1859 }, { 8, 30, 1858 }, { 10, 31, 1857 }, + { 13, 31, 1857 }, { 15, 31, 1856 }, { 17, 32, 1856 }, { 19, 32, 1855 }, { 21, 32, 1855 }, + { 23, 33, 1854 }, { 24, 33, 1853 }, { 26, 33, 1853 }, { 27, 33, 1852 }, { 28, 33, 1851 }, + { 29, 33, 1851 }, { 30, 32, 1850 }, { 31, 32, 1849 }, { 31, 31, 1848 }, { 32, 31, 1847 }, + { 32, 30, 1846 }, { 33, 29, 1845 }, { 33, 28, 1844 }, { 33, 27, 1844 }, { 33, 26, 1842 }, + { 33, 25, 1841 }, { 33, 24, 1840 }, { 33, 22, 1839 }, { 33, 21, 1838 }, { 33, 20, 1837 }, + { 33, 18, 1836 }, { 33, 17, 1835 }, { 33, 16, 1834 }, { 32, 14, 1833 }, { 32, 13, 1832 }, + { 32, 12, 1831 }, { 31, 10, 1830 }, { 31, 9, 1830 }, { 31, 8, 1829 }, { 30, 7, 1828 }, + { 30, 6, 1827 }, { 30, 5, 1827 }, { 30, 4, 1826 }, { 29, 3, 1825 }, { 29, 2, 1825 }, + { 29, 1, 1824 }, { 29, 1, 1824 }, { 28, 0, 1824 }, { 28, 0, 1823 }, { 28, 0, 1823 }, + { 28, 0, 1823 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_2[] = { + { ARRAY_COUNT(animdata_mario_eyebrows_2_1), GD_ANIM_ROT3S, animdata_mario_eyebrows_2_1 }, + { ARRAY_COUNT(animdata_mario_eyebrows_2_2), GD_ANIM_ROT3S, animdata_mario_eyebrows_2_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 anim_mario_eyebrows_3_1[][3] = { + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, -1 }, + { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -4 }, + { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, { 0, 0, -6 }, + { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, + { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, + { 0, 0, -12 }, { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, + { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, + { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, + { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -25 }, + { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, + { 0, 0, -30 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, + { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, + { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, + { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -40 }, + { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, { 0, 0, -43 }, + { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, + { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, + { 0, 0, -49 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, + { 0, 0, -52 }, { 0, 0, -52 }, { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, + { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, + { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -60 }, + { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -63 }, + { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, + { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, + { 0, 0, -69 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, + { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, + { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, + { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, + { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, { 0, 0, -85 }, + { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, + { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, + { 0, 0, -93 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, + { 0, 0, -97 }, { 0, 0, -97 }, { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, + { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, + { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, { 0, 0, -107 }, { 0, 0, -108 }, + { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -138 }, + { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, + { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, + { 0, 0, -151 }, { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, + { 0, 0, -147 }, { 0, 0, -147 }, { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, + { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, + { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, { 0, 0, -137 }, { 0, 0, -136 }, + { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, { 0, 0, -132 }, + { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, + { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, + { 0, 0, -124 }, { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, + { 0, 0, -120 }, { 0, 0, -119 }, { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, + { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, + { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, { 0, 0, -109 }, { 0, 0, -108 }, + { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, { 0, 0, -104 }, + { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, + { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, + { 0, 0, -96 }, { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, + { 0, 0, -92 }, { 0, 0, -91 }, { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, + { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, + { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, + { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -76 }, + { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, + { 0, 0, -68 }, { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, + { 0, 0, -64 }, { 0, 0, -63 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, + { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, + { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, { 0, 0, -53 }, { 0, 0, -53 }, + { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, { 0, 0, -49 }, + { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, + { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, + { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, + { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, + { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, + { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -26 }, { 0, 0, -25 }, + { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, + { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, + { 0, 0, -14 }, { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, + { 0, 0, -10 }, { 0, 0, -9 }, { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, + { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, + { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_3[] = { + { ARRAY_COUNT(anim_mario_eyebrows_3_1), GD_ANIM_ROT3S, anim_mario_eyebrows_3_1 }, + { 0, GD_ANIM_EMPTY, NULL }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eyebrows_4_1[][3] = { + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1778 }, { -35, 0, -1780 }, { -36, 0, -1781 }, + { -36, 0, -1784 }, { -37, 0, -1786 }, { -38, -1, -1788 }, { -39, -1, -1790 }, { -40, -1, -1793 }, + { -41, -1, -1795 }, { -42, -1, -1797 }, { -42, -1, -1798 }, { -42, -1, -1799 }, { -43, -1, -1799 }, + { -42, -1, -1799 }, { -42, -1, -1798 }, { -41, -1, -1796 }, { -40, -1, -1793 }, { -38, -1, -1789 }, + { -36, 0, -1784 }, { -34, 0, -1777 }, { -21, 0, -1745 }, { 2, 2, -1685 }, { 25, 4, -1626 }, + { 35, 5, -1600 }, { 34, 4, -1602 }, { 31, 4, -1610 }, { 27, 4, -1621 }, { 21, 3, -1635 }, + { 15, 3, -1652 }, { 7, 2, -1670 }, { 0, 2, -1689 }, { -7, 1, -1708 }, { -14, 0, -1726 }, + { -21, 0, -1743 }, { -26, 0, -1758 }, { -31, 0, -1769 }, { -34, 0, -1777 }, { -36, 0, -1782 }, + { -37, 0, -1786 }, { -39, -1, -1789 }, { -39, -1, -1791 }, { -40, -1, -1792 }, { -40, -1, -1793 }, + { -40, -1, -1793 }, { -40, -1, -1792 }, { -39, -1, -1791 }, { -39, -1, -1790 }, { -38, -1, -1788 }, + { -37, 0, -1786 }, { -37, 0, -1784 }, { -36, 0, -1782 }, { -35, 0, -1781 }, { -35, 0, -1779 }, + { -34, 0, -1778 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1776 }, { -34, 0, -1776 }, + { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, + { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, + { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1778 }, { -34, 0, -1778 }, + { -34, 0, -1780 }, { -34, 0, -1781 }, { -34, -1, -1782 }, { -34, -1, -1784 }, { -34, -1, -1785 }, + { -34, -1, -1787 }, { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1789 }, { -34, -1, -1789 }, + { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1788 }, + { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1788 }, { -34, -1, -1787 }, + { -34, -1, -1787 }, { -34, -1, -1787 }, { -34, -1, -1787 }, { -34, -1, -1786 }, { -34, -1, -1786 }, + { -34, -1, -1786 }, { -34, -1, -1786 }, { -34, -1, -1785 }, { -34, -1, -1785 }, { -34, -1, -1785 }, + { -34, -1, -1784 }, { -34, -1, -1784 }, { -34, -1, -1784 }, { -34, -1, -1783 }, { -34, -1, -1783 }, + { -34, -1, -1783 }, { -34, -1, -1782 }, { -34, 0, -1782 }, { -34, 0, -1782 }, { -34, 0, -1781 }, + { -34, 0, -1781 }, { -34, 0, -1781 }, { -34, 0, -1781 }, { -34, 0, -1780 }, { -34, 0, -1780 }, + { -34, 0, -1780 }, { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1778 }, + { -34, 0, -1778 }, { -34, 0, -1778 }, { -34, 0, -1778 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1778 }, + { -34, 0, -1779 }, { -34, 0, -1781 }, { -34, -1, -1783 }, { -34, -1, -1786 }, { -34, -1, -1790 }, + { -34, -1, -1794 }, { -34, -1, -1797 }, { -34, -2, -1801 }, { -34, -2, -1805 }, { -34, -2, -1809 }, + { -34, -2, -1812 }, { -35, -2, -1815 }, { -35, -2, -1817 }, { -35, -3, -1819 }, { -35, -3, -1820 }, + { -35, -3, -1820 }, { -35, -3, -1819 }, { -35, -2, -1817 }, { -34, -2, -1814 }, { -34, -2, -1810 }, + { -34, -2, -1804 }, { -34, -1, -1797 }, { -34, -1, -1788 }, { -34, 0, -1777 }, { -33, 1, -1733 }, + { -32, 6, -1646 }, { -30, 12, -1545 }, { -29, 17, -1463 }, { -28, 19, -1428 }, { -28, 18, -1440 }, + { -29, 16, -1473 }, { -30, 13, -1521 }, { -31, 10, -1577 }, { -32, 7, -1637 }, { -32, 4, -1694 }, + { -33, 1, -1743 }, { -34, 0, -1777 }, { -34, -1, -1797 }, { -34, -2, -1809 }, { -34, -2, -1814 }, + { -34, -2, -1814 }, { -34, -2, -1812 }, { -34, -2, -1809 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1807 }, { -34, -2, -1807 }, { -34, -2, -1807 }, { -34, -2, -1807 }, { -34, -2, -1806 }, + { -34, -2, -1806 }, { -34, -2, -1806 }, { -34, -2, -1805 }, { -34, -2, -1804 }, { -34, -2, -1804 }, + { -34, -2, -1803 }, { -34, -2, -1803 }, { -34, -2, -1802 }, { -34, -2, -1801 }, { -34, -2, -1800 }, + { -34, -1, -1800 }, { -34, -1, -1799 }, { -34, -1, -1798 }, { -34, -1, -1797 }, { -34, -1, -1796 }, + { -34, -1, -1795 }, { -34, -1, -1794 }, { -34, -1, -1793 }, { -34, -1, -1792 }, { -34, -1, -1792 }, + { -34, -1, -1791 }, { -34, -1, -1790 }, { -34, -1, -1789 }, { -34, -1, -1788 }, { -34, -1, -1787 }, + { -34, -1, -1786 }, { -34, -1, -1785 }, { -34, -1, -1784 }, { -34, -1, -1784 }, { -34, -1, -1783 }, + { -34, 0, -1782 }, { -34, 0, -1781 }, { -34, 0, -1781 }, { -34, 0, -1780 }, { -34, 0, -1779 }, + { -34, 0, -1779 }, { -34, 0, -1778 }, { -34, 0, -1778 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1778 }, { -34, 0, -1778 }, + { -34, 0, -1778 }, { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1780 }, + { -34, 0, -1780 }, { -34, 0, -1780 }, { -34, 0, -1780 }, { -34, 0, -1780 }, { -34, 0, -1779 }, + { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1778 }, { -34, 0, -1777 }, { -34, 0, -1776 }, + { -34, 0, -1774 }, { -34, 0, -1771 }, { -34, 0, -1768 }, { -34, 0, -1765 }, { -34, 0, -1761 }, + { -34, 0, -1758 }, { -34, 0, -1754 }, { -34, 0, -1751 }, { -34, 1, -1748 }, { -34, 1, -1745 }, + { -34, 1, -1743 }, { -34, 1, -1741 }, { -34, 1, -1740 }, { -34, 1, -1739 }, { -34, 1, -1739 }, + { -34, 1, -1739 }, { -34, 1, -1741 }, { -34, 1, -1743 }, { -34, 1, -1747 }, { -34, 0, -1753 }, + { -34, 0, -1761 }, { -34, 0, -1768 }, { -34, 0, -1774 }, { -34, 0, -1777 }, { -34, 0, -1778 }, + { -34, 0, -1779 }, { -34, 0, -1780 }, { -34, 0, -1780 }, { -34, 0, -1781 }, { -34, 0, -1781 }, + { -34, 0, -1781 }, { -34, 0, -1781 }, { -34, 0, -1781 }, { -34, 0, -1780 }, { -34, 0, -1780 }, + { -34, 0, -1780 }, { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1778 }, { -34, 0, -1778 }, + { -34, 0, -1778 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1778 }, { -34, 0, -1781 }, { -34, -1, -1785 }, + { -34, -1, -1789 }, { -34, -1, -1793 }, { -34, -1, -1797 }, { -34, -1, -1800 }, { -34, -2, -1801 }, + { -34, -1, -1799 }, { -34, -1, -1796 }, { -34, -1, -1788 }, { -34, 0, -1777 }, { -33, 1, -1738 }, + { -32, 5, -1667 }, { -32, 9, -1599 }, { -31, 11, -1565 }, { -31, 11, -1563 }, { -31, 11, -1569 }, + { -32, 10, -1581 }, { -32, 9, -1598 }, { -32, 8, -1618 }, { -33, 7, -1640 }, { -33, 6, -1662 }, + { -33, 4, -1684 }, { -34, 3, -1703 }, { -34, 2, -1725 }, { -34, 0, -1752 }, { -34, 0, -1778 }, + { -34, -1, -1799 }, { -34, -2, -1808 }, { -34, -2, -1809 }, { -34, -2, -1810 }, { -34, -2, -1811 }, + { -34, -2, -1811 }, { -34, -2, -1812 }, { -34, -2, -1813 }, { -34, -2, -1814 }, { -34, -2, -1815 }, + { -34, -2, -1815 }, { -34, -2, -1816 }, { -34, -2, -1817 }, { -34, -2, -1817 }, { -34, -3, -1818 }, + { -34, -3, -1818 }, { -34, -3, -1819 }, { -34, -3, -1819 }, { -34, -3, -1820 }, { -34, -3, -1820 }, + { -34, -3, -1820 }, { -34, -3, -1821 }, { -34, -3, -1821 }, { -34, -3, -1821 }, { -34, -3, -1822 }, + { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, + { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, + { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, { -34, -3, -1822 }, + { -34, -3, -1822 }, { -34, -3, -1821 }, { -34, -3, -1821 }, { -34, -3, -1821 }, { -34, -3, -1821 }, + { -34, -3, -1821 }, { -34, -3, -1820 }, { -34, -3, -1820 }, { -34, -3, -1820 }, { -34, -3, -1820 }, + { -34, -3, -1819 }, { -34, -3, -1819 }, { -34, -3, -1819 }, { -34, -3, -1818 }, { -34, -3, -1818 }, + { -34, -3, -1818 }, { -34, -2, -1817 }, { -34, -2, -1817 }, { -34, -2, -1817 }, { -34, -2, -1816 }, + { -34, -2, -1816 }, { -34, -2, -1816 }, { -34, -2, -1815 }, { -34, -2, -1815 }, { -34, -2, -1815 }, + { -34, -2, -1814 }, { -34, -2, -1814 }, { -34, -2, -1814 }, { -34, -2, -1813 }, { -34, -2, -1813 }, + { -34, -2, -1812 }, { -34, -2, -1812 }, { -34, -2, -1812 }, { -34, -2, -1812 }, { -34, -2, -1811 }, + { -34, -2, -1811 }, { -34, -2, -1811 }, { -34, -2, -1810 }, { -34, -2, -1810 }, { -34, -2, -1810 }, + { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1808 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, + { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, + { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1809 }, + { -34, -2, -1809 }, { -34, -2, -1809 }, { -34, -2, -1808 }, { -34, -2, -1808 }, { -34, -2, -1808 }, + { -34, -2, -1807 }, { -34, -2, -1807 }, { -34, -2, -1806 }, { -34, -2, -1806 }, { -34, -2, -1805 }, + { -34, -2, -1805 }, { -34, -2, -1804 }, { -34, -2, -1803 }, { -34, -2, -1803 }, { -34, -2, -1802 }, + { -34, -2, -1801 }, { -34, -2, -1801 }, { -34, -1, -1800 }, { -34, -1, -1799 }, { -34, -1, -1798 }, + { -34, -1, -1798 }, { -34, -1, -1797 }, { -34, -1, -1796 }, { -34, -1, -1795 }, { -34, -1, -1795 }, + { -34, -1, -1794 }, { -34, -1, -1793 }, { -34, -1, -1792 }, { -34, -1, -1791 }, { -34, -1, -1791 }, + { -34, -1, -1790 }, { -34, -1, -1789 }, { -34, -1, -1788 }, { -34, -1, -1787 }, { -34, -1, -1787 }, + { -34, -1, -1786 }, { -34, -1, -1785 }, { -34, -1, -1784 }, { -34, -1, -1784 }, { -34, -1, -1783 }, + { -34, 0, -1782 }, { -34, 0, -1782 }, { -34, 0, -1781 }, { -34, 0, -1780 }, { -34, 0, -1780 }, + { -34, 0, -1779 }, { -34, 0, -1779 }, { -34, 0, -1778 }, { -34, 0, -1778 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1776 }, { -35, 0, -1776 }, { -36, 0, -1776 }, { -37, 0, -1776 }, + { -38, 0, -1776 }, { -39, 0, -1776 }, { -40, 0, -1776 }, { -41, 0, -1776 }, { -41, 0, -1776 }, + { -42, 0, -1776 }, { -43, 0, -1776 }, { -43, 0, -1776 }, { -43, 0, -1776 }, { -42, 0, -1777 }, + { -42, 0, -1777 }, { -40, 0, -1777 }, { -39, 0, -1777 }, { -37, 0, -1777 }, { -34, 0, -1777 }, + { -30, 0, -1777 }, { -23, 0, -1777 }, { -14, 0, -1777 }, { -4, 0, -1777 }, { 5, 0, -1777 }, + { 16, 0, -1777 }, { 27, 0, -1777 }, { 38, 0, -1777 }, { 47, 0, -1777 }, { 54, 0, -1777 }, + { 60, 0, -1777 }, { 63, 0, -1777 }, { 64, 0, -1777 }, { 65, 0, -1777 }, { 66, 0, -1777 }, + { 67, 0, -1777 }, { 68, 0, -1777 }, { 69, 0, -1777 }, { 70, 0, -1777 }, { 71, 0, -1777 }, + { 71, 0, -1777 }, { 72, 0, -1777 }, { 73, 0, -1777 }, { 73, 0, -1777 }, { 73, 0, -1777 }, + { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, + { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, + { 74, 0, -1777 }, { 74, 0, -1777 }, { 74, 0, -1777 }, { 73, 0, -1777 }, { 73, 0, -1777 }, + { 73, 0, -1777 }, { 72, 0, -1777 }, { 72, 0, -1777 }, { 71, 0, -1777 }, { 71, 0, -1777 }, + { 71, 0, -1777 }, { 70, 0, -1777 }, { 70, 0, -1777 }, { 69, 0, -1777 }, { 69, 0, -1777 }, + { 68, 0, -1777 }, { 68, 0, -1777 }, { 67, 0, -1777 }, { 67, 0, -1777 }, { 67, 0, -1777 }, + { 66, 0, -1777 }, { 66, 0, -1777 }, { 65, 0, -1777 }, { 65, 0, -1777 }, { 65, 0, -1777 }, + { 64, 0, -1777 }, { 64, 0, -1777 }, { 64, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, + { 63, 0, -1777 }, { 63, 0, -1777 }, { 63, 0, -1777 }, { 65, 0, -1777 }, { 63, 0, -1777 }, + { 53, 0, -1777 }, { 42, 0, -1777 }, { 30, 0, -1777 }, { 17, 0, -1777 }, { 4, 0, -1777 }, + { -7, 0, -1777 }, { -18, 0, -1777 }, { -26, 0, -1777 }, { -32, 0, -1777 }, { -34, 0, -1777 }, +}; + +static s16 animdata_mario_eyebrows_4_2[][3] = { + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1755 }, { -34, 0, -1755 }, { -34, 0, -1756 }, + { -34, 0, -1756 }, { -34, 0, -1757 }, { -34, 0, -1757 }, { -34, 0, -1758 }, { -34, 0, -1759 }, + { -34, 0, -1759 }, { -34, 0, -1760 }, { -34, 0, -1760 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1764 }, + { -34, 0, -1764 }, { -34, 0, -1764 }, { -34, 0, -1765 }, { -34, 0, -1765 }, { -34, 0, -1766 }, + { -34, 0, -1766 }, { -34, 0, -1767 }, { -34, 0, -1767 }, { -34, 0, -1768 }, { -34, 0, -1769 }, + { -34, 0, -1769 }, { -34, 0, -1770 }, { -34, 0, -1770 }, { -34, 0, -1771 }, { -34, 0, -1771 }, + { -34, 0, -1772 }, { -34, 0, -1773 }, { -34, 0, -1773 }, { -34, 0, -1774 }, { -34, 0, -1774 }, + { -34, 0, -1775 }, { -34, 0, -1775 }, { -34, 0, -1775 }, { -34, 0, -1776 }, { -34, 0, -1776 }, + { -34, 0, -1776 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_4[] = { + { ARRAY_COUNT(animdata_mario_eyebrows_4_1), GD_ANIM_ROT3S, animdata_mario_eyebrows_4_1 }, + { ARRAY_COUNT(animdata_mario_eyebrows_4_2), GD_ANIM_ROT3S, animdata_mario_eyebrows_4_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eyebrows_5_1[][3] = { + { 108, 0, 1775 }, { 108, 0, 1774 }, { 108, 0, 1774 }, { 107, 0, 1773 }, { 107, 0, 1771 }, + { 106, 0, 1770 }, { 105, 1, 1768 }, { 104, 1, 1766 }, { 103, 1, 1764 }, { 103, 2, 1763 }, + { 102, 2, 1761 }, { 101, 2, 1760 }, { 101, 3, 1759 }, { 100, 3, 1758 }, { 100, 3, 1758 }, + { 100, 3, 1758 }, { 101, 2, 1759 }, { 101, 2, 1760 }, { 103, 2, 1763 }, { 104, 1, 1766 }, + { 106, 0, 1770 }, { 108, 0, 1775 }, { 120, -4, 1799 }, { 143, -13, 1845 }, { 164, -21, 1890 }, + { 174, -25, 1910 }, { 173, -25, 1908 }, { 170, -24, 1902 }, { 166, -22, 1894 }, { 161, -20, 1883 }, + { 155, -18, 1870 }, { 148, -15, 1856 }, { 141, -12, 1842 }, { 134, -10, 1827 }, { 127, -7, 1813 }, + { 121, -4, 1800 }, { 115, -2, 1789 }, { 111, -1, 1780 }, { 108, 0, 1775 }, { 107, 0, 1771 }, + { 105, 1, 1767 }, { 104, 1, 1765 }, { 103, 2, 1763 }, { 103, 2, 1761 }, { 103, 2, 1760 }, + { 103, 2, 1759 }, { 103, 2, 1759 }, { 103, 2, 1759 }, { 104, 2, 1760 }, { 104, 2, 1760 }, + { 105, 2, 1762 }, { 106, 2, 1763 }, { 106, 1, 1765 }, { 107, 1, 1766 }, { 108, 1, 1768 }, + { 108, 0, 1770 }, { 108, 0, 1772 }, { 108, 0, 1775 }, { 108, -1, 1784 }, { 108, -5, 1801 }, + { 108, -8, 1818 }, { 108, -9, 1825 }, { 108, -8, 1821 }, { 108, -6, 1811 }, { 108, -4, 1798 }, + { 108, -1, 1785 }, { 108, 0, 1775 }, { 108, 0, 1773 }, { 108, 0, 1775 }, { 108, 0, 1775 }, + { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1773 }, + { 108, 0, 1773 }, { 108, 0, 1773 }, { 108, 0, 1773 }, { 108, 0, 1772 }, { 108, 0, 1772 }, + { 108, 0, 1772 }, { 108, 0, 1772 }, { 108, 0, 1772 }, { 108, 0, 1772 }, { 108, 0, 1772 }, + { 108, 0, 1773 }, { 108, 0, 1773 }, { 108, 0, 1774 }, { 108, 0, 1775 }, { 108, 0, 1777 }, + { 108, -1, 1783 }, { 108, -2, 1789 }, { 108, -3, 1794 }, { 108, -4, 1797 }, { 108, -4, 1798 }, + { 108, -4, 1799 }, { 108, -4, 1800 }, { 108, -4, 1800 }, { 108, -4, 1801 }, { 108, -5, 1801 }, + { 108, -5, 1801 }, { 108, -5, 1801 }, { 108, -5, 1801 }, { 108, -5, 1801 }, { 108, -5, 1801 }, + { 108, -5, 1801 }, { 108, -4, 1801 }, { 108, -4, 1800 }, { 108, -4, 1799 }, { 108, -4, 1799 }, + { 108, -4, 1798 }, { 108, -4, 1797 }, { 108, -3, 1795 }, { 108, -3, 1791 }, { 108, -2, 1787 }, + { 108, -1, 1782 }, { 108, 0, 1778 }, { 108, 0, 1775 }, { 108, 0, 1773 }, { 108, 0, 1771 }, + { 108, 1, 1769 }, { 108, 1, 1768 }, { 108, 1, 1767 }, { 108, 1, 1766 }, { 108, 1, 1765 }, + { 108, 1, 1764 }, { 108, 2, 1764 }, { 108, 2, 1763 }, { 108, 2, 1763 }, { 108, 2, 1763 }, + { 108, 2, 1763 }, { 108, 2, 1763 }, { 108, 2, 1764 }, { 108, 2, 1764 }, { 108, 2, 1764 }, + { 108, 2, 1764 }, { 108, 2, 1764 }, { 108, 2, 1764 }, { 108, 1, 1764 }, { 108, 1, 1765 }, + { 108, 1, 1765 }, { 108, 1, 1765 }, { 108, 1, 1765 }, { 108, 1, 1765 }, { 108, 1, 1766 }, + { 108, 1, 1766 }, { 108, 1, 1766 }, { 108, 1, 1767 }, { 108, 1, 1767 }, { 108, 1, 1767 }, + { 108, 1, 1767 }, { 108, 1, 1768 }, { 108, 1, 1768 }, { 108, 1, 1768 }, { 108, 1, 1769 }, + { 108, 1, 1769 }, { 108, 1, 1769 }, { 108, 0, 1770 }, { 108, 0, 1770 }, { 108, 0, 1770 }, + { 108, 0, 1771 }, { 108, 0, 1771 }, { 108, 0, 1771 }, { 108, 0, 1772 }, { 108, 0, 1772 }, + { 108, 0, 1772 }, { 108, 0, 1772 }, { 108, 0, 1773 }, { 108, 0, 1773 }, { 108, 0, 1773 }, + { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1774 }, { 108, 0, 1774 }, + { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, + { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, + { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1775 }, { 108, 0, 1774 }, + { 108, 0, 1773 }, { 109, 0, 1771 }, { 109, 1, 1768 }, { 109, 1, 1765 }, { 109, 2, 1762 }, + { 109, 2, 1758 }, { 109, 3, 1755 }, { 110, 4, 1751 }, { 110, 4, 1747 }, { 110, 5, 1743 }, + { 110, 6, 1740 }, { 110, 6, 1737 }, { 111, 7, 1735 }, { 111, 7, 1733 }, { 111, 7, 1732 }, + { 111, 7, 1732 }, { 111, 7, 1733 }, { 111, 7, 1735 }, { 110, 6, 1738 }, { 110, 5, 1742 }, + { 110, 4, 1748 }, { 109, 3, 1755 }, { 109, 1, 1764 }, { 108, 0, 1775 }, { 106, -7, 1818 }, + { 101, -23, 1904 }, { 96, -41, 2003 }, { 91, -55, 2085 }, { 89, -62, 2119 }, { 90, -59, 2107 }, + { 92, -53, 2073 }, { 94, -45, 2025 }, { 97, -34, 1968 }, { 101, -23, 1908 }, { 104, -13, 1852 }, + { 107, -5, 1805 }, { 108, 0, 1775 }, { 109, 2, 1761 }, { 110, 2, 1760 }, { 110, 1, 1767 }, + { 109, -1, 1779 }, { 109, -3, 1793 }, { 108, -5, 1803 }, { 108, -6, 1808 }, { 108, -6, 1809 }, + { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1811 }, { 108, -6, 1811 }, { 108, -7, 1811 }, + { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, + { 108, -7, 1813 }, { 108, -7, 1813 }, { 108, -7, 1813 }, { 108, -7, 1813 }, { 108, -7, 1813 }, + { 108, -7, 1813 }, { 108, -7, 1813 }, { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, + { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1812 }, { 108, -7, 1811 }, + { 108, -7, 1811 }, { 108, -6, 1811 }, { 108, -6, 1811 }, { 108, -6, 1811 }, { 108, -6, 1810 }, + { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1809 }, { 108, -6, 1809 }, + { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1807 }, + { 108, -6, 1807 }, { 108, -6, 1807 }, { 108, -6, 1806 }, { 108, -6, 1806 }, { 108, -6, 1806 }, + { 108, -5, 1806 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, + { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1806 }, + { 108, -6, 1806 }, { 108, -6, 1807 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1810 }, + { 108, -7, 1812 }, { 108, -7, 1814 }, { 108, -8, 1817 }, { 108, -8, 1820 }, { 108, -9, 1824 }, + { 108, -10, 1828 }, { 108, -10, 1831 }, { 108, -11, 1834 }, { 108, -12, 1837 }, { 108, -12, 1840 }, + { 108, -12, 1842 }, { 108, -13, 1844 }, { 108, -13, 1845 }, { 108, -13, 1846 }, { 108, -13, 1846 }, + { 108, -13, 1846 }, { 108, -13, 1844 }, { 108, -12, 1842 }, { 108, -12, 1838 }, { 108, -10, 1832 }, + { 108, -9, 1824 }, { 108, -8, 1817 }, { 108, -7, 1811 }, { 108, -6, 1808 }, { 108, -6, 1807 }, + { 108, -6, 1806 }, { 108, -5, 1806 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, + { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, + { 108, -6, 1806 }, { 108, -6, 1806 }, { 108, -6, 1807 }, { 108, -6, 1807 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1807 }, { 108, -5, 1805 }, { 109, -5, 1801 }, + { 109, -4, 1797 }, { 109, -3, 1792 }, { 109, -2, 1789 }, { 109, -2, 1786 }, { 109, -2, 1785 }, + { 109, -2, 1786 }, { 109, -3, 1790 }, { 109, -4, 1797 }, { 108, -6, 1808 }, { 106, -13, 1847 }, + { 102, -26, 1917 }, { 99, -38, 1984 }, { 97, -44, 2018 }, { 97, -44, 2019 }, { 98, -43, 2013 }, + { 99, -41, 2000 }, { 100, -38, 1983 }, { 101, -34, 1962 }, { 103, -30, 1941 }, { 104, -27, 1919 }, + { 105, -23, 1899 }, { 106, -20, 1882 }, { 107, -17, 1864 }, { 108, -13, 1845 }, { 108, -10, 1827 }, + { 108, -7, 1814 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1807 }, { 108, -6, 1806 }, + { 108, -5, 1806 }, { 108, -5, 1805 }, { 108, -5, 1804 }, { 108, -5, 1804 }, { 108, -5, 1803 }, + { 108, -5, 1803 }, { 108, -5, 1802 }, { 108, -5, 1802 }, { 108, -5, 1802 }, { 108, -5, 1801 }, + { 108, -5, 1801 }, { 108, -4, 1800 }, { 108, -4, 1800 }, { 108, -4, 1800 }, { 108, -4, 1800 }, + { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, + { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, + { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, + { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, { 108, -4, 1798 }, + { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1799 }, + { 108, -4, 1799 }, { 108, -4, 1799 }, { 108, -4, 1800 }, { 108, -4, 1800 }, { 108, -4, 1800 }, + { 108, -4, 1800 }, { 108, -4, 1800 }, { 108, -5, 1801 }, { 108, -5, 1801 }, { 108, -5, 1801 }, + { 108, -5, 1801 }, { 108, -5, 1802 }, { 108, -5, 1802 }, { 108, -5, 1802 }, { 108, -5, 1802 }, + { 108, -5, 1802 }, { 108, -5, 1803 }, { 108, -5, 1803 }, { 108, -5, 1803 }, { 108, -5, 1803 }, + { 108, -5, 1804 }, { 108, -5, 1804 }, { 108, -5, 1804 }, { 108, -5, 1804 }, { 108, -5, 1805 }, + { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1805 }, { 108, -5, 1806 }, { 108, -6, 1806 }, + { 108, -6, 1806 }, { 108, -6, 1806 }, { 108, -6, 1806 }, { 108, -6, 1807 }, { 108, -6, 1807 }, + { 108, -6, 1807 }, { 108, -6, 1807 }, { 108, -6, 1807 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, { 108, -6, 1808 }, + { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, + { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, + { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, + { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, { 108, -6, 1810 }, + { 108, -6, 1810 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1809 }, { 108, -6, 1808 }, + { 108, -6, 1808 }, { 108, -6, 1807 }, { 108, -6, 1807 }, { 108, -6, 1806 }, { 108, -5, 1806 }, + { 108, -5, 1805 }, { 108, -5, 1804 }, { 108, -5, 1804 }, { 108, -5, 1803 }, { 108, -5, 1802 }, + { 108, -5, 1801 }, { 108, -5, 1801 }, { 108, -4, 1800 }, { 108, -4, 1799 }, { 108, -4, 1798 }, + { 108, -4, 1797 }, { 108, -4, 1797 }, { 108, -4, 1796 }, { 108, -3, 1795 }, { 108, -3, 1794 }, + { 108, -3, 1793 }, { 108, -3, 1792 }, { 108, -3, 1791 }, { 108, -3, 1790 }, { 108, -2, 1790 }, + { 108, -2, 1789 }, { 108, -2, 1788 }, { 108, -2, 1787 }, { 108, -2, 1786 }, { 108, -2, 1785 }, + { 108, -1, 1784 }, { 108, -1, 1784 }, { 108, -1, 1783 }, { 108, -1, 1782 }, { 108, -1, 1781 }, + { 108, -1, 1780 }, { 108, 0, 1780 }, { 108, 0, 1779 }, { 108, 0, 1778 }, { 108, 0, 1778 }, + { 108, 0, 1777 }, { 108, 0, 1776 }, { 108, 0, 1776 }, { 108, 0, 1775 }, { 108, 0, 1775 }, + { 109, 0, 1774 }, { 109, 0, 1774 }, { 110, 0, 1773 }, { 111, 0, 1773 }, { 112, 0, 1772 }, + { 113, 0, 1772 }, { 114, -1, 1772 }, { 115, -1, 1771 }, { 117, -1, 1771 }, { 118, -2, 1771 }, + { 118, -2, 1771 }, { 119, -2, 1771 }, { 119, -2, 1771 }, { 119, -2, 1771 }, { 119, -2, 1772 }, + { 118, -2, 1772 }, { 116, -2, 1773 }, { 114, -1, 1773 }, { 112, 0, 1774 }, { 108, 0, 1775 }, + { 103, 1, 1776 }, { 95, 3, 1778 }, { 85, 6, 1780 }, { 73, 9, 1783 }, { 60, 12, 1786 }, + { 47, 16, 1789 }, { 33, 19, 1792 }, { 21, 23, 1795 }, { 10, 25, 1797 }, { 1, 28, 1799 }, + { -5, 30, 1801 }, { -8, 31, 1802 }, { -10, 31, 1802 }, { -11, 31, 1802 }, { -13, 32, 1803 }, + { -14, 32, 1803 }, { -15, 32, 1803 }, { -16, 33, 1803 }, { -17, 33, 1804 }, { -18, 33, 1804 }, + { -19, 33, 1804 }, { -20, 34, 1804 }, { -21, 34, 1804 }, { -21, 34, 1804 }, { -22, 34, 1805 }, + { -22, 34, 1805 }, { -22, 34, 1805 }, { -22, 34, 1805 }, { -23, 34, 1805 }, { -23, 34, 1805 }, + { -23, 34, 1805 }, { -23, 34, 1805 }, { -23, 34, 1805 }, { -23, 34, 1805 }, { -22, 34, 1805 }, + { -22, 34, 1805 }, { -22, 34, 1805 }, { -22, 34, 1805 }, { -21, 34, 1804 }, { -21, 34, 1804 }, + { -21, 34, 1804 }, { -20, 34, 1804 }, { -20, 33, 1804 }, { -19, 33, 1804 }, { -19, 33, 1804 }, + { -18, 33, 1804 }, { -18, 33, 1804 }, { -17, 33, 1804 }, { -17, 33, 1803 }, { -16, 33, 1803 }, + { -15, 32, 1803 }, { -15, 32, 1803 }, { -14, 32, 1803 }, { -14, 32, 1803 }, { -13, 32, 1803 }, + { -13, 32, 1803 }, { -12, 32, 1802 }, { -12, 31, 1802 }, { -11, 31, 1802 }, { -11, 31, 1802 }, + { -10, 31, 1802 }, { -10, 31, 1802 }, { -10, 31, 1802 }, { -9, 31, 1802 }, { -9, 31, 1802 }, + { -9, 31, 1802 }, { -9, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, + { -8, 31, 1802 }, { -8, 31, 1802 }, { -8, 31, 1802 }, { -11, 31, 1802 }, { -8, 31, 1802 }, + { 2, 28, 1799 }, { 15, 24, 1796 }, { 30, 20, 1792 }, { 46, 16, 1789 }, { 62, 12, 1785 }, + { 76, 8, 1782 }, { 89, 5, 1779 }, { 99, 2, 1777 }, { 106, 0, 1775 }, { 108, 0, 1775 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_5[] = { + { ARRAY_COUNT(animdata_mario_eyebrows_5_1), GD_ANIM_ROT3S, animdata_mario_eyebrows_5_1 }, + { 0, GD_ANIM_EMPTY, NULL }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eye_left_1[][3] = { + { -68, 2, -974 }, { -68, 1, -974 }, { -68, 0, -974 }, { -68, -2, -974 }, + { -68, -6, -973 }, { -68, -10, -973 }, { -68, -15, -972 }, { -68, -20, -972 }, + { -68, -26, -971 }, { -69, -32, -970 }, { -69, -38, -970 }, { -69, -44, -969 }, + { -69, -50, -968 }, { -69, -56, -968 }, { -69, -61, -967 }, { -69, -66, -966 }, + { -69, -70, -966 }, { -69, -74, -966 }, { -69, -76, -965 }, { -69, -78, -965 }, + { -69, -78, -965 }, { -69, -72, -966 }, { -69, -56, -968 }, { -69, -36, -970 }, + { -69, -16, -973 }, { -68, 0, -975 }, { -68, 7, -976 }, { -68, 9, -976 }, + { -68, 10, -976 }, { -68, 11, -976 }, { -68, 12, -976 }, { -68, 13, -976 }, + { -68, 14, -977 }, { -68, 15, -977 }, { -68, 15, -977 }, { -68, 16, -977 }, + { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, + { -68, 16, -977 }, { -68, 16, -976 }, { -68, 15, -976 }, { -68, 15, -976 }, + { -68, 15, -976 }, { -68, 14, -976 }, { -68, 14, -976 }, { -68, 13, -976 }, + { -68, 12, -976 }, { -68, 12, -976 }, { -68, 11, -976 }, { -68, 10, -975 }, + { -68, 10, -975 }, { -68, 9, -975 }, { -68, 8, -975 }, { -68, 7, -975 }, + { -68, 7, -975 }, { -68, 6, -975 }, { -68, 5, -975 }, { -68, 5, -975 }, + { -68, 4, -974 }, { -68, 4, -974 }, { -68, 3, -974 }, { -68, 3, -974 }, + { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 3, -975 }, + { -68, 4, -975 }, { -68, 5, -975 }, { -68, 6, -976 }, { -68, 7, -976 }, + { -68, 8, -976 }, { -68, 9, -977 }, { -68, 10, -977 }, { -68, 11, -977 }, + { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, + { -68, 11, -977 }, { -68, 9, -977 }, { -68, 7, -976 }, { -68, 5, -975 }, + { -68, 2, -974 }, { -68, -8, -971 }, { -67, -29, -964 }, { -67, -54, -956 }, + { -66, -75, -950 }, { -66, -86, -946 }, { -66, -90, -945 }, { -66, -93, -944 }, + { -66, -96, -943 }, { -66, -98, -942 }, { -66, -100, -942 }, { -66, -102, -941 }, + { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, + { -66, -103, -941 }, { -66, -101, -942 }, { -66, -100, -942 }, { -66, -98, -943 }, + { -66, -96, -943 }, { -66, -93, -944 }, { -66, -90, -945 }, { -66, -86, -946 }, + { -66, -78, -949 }, { -67, -62, -954 }, { -67, -43, -960 }, { -68, -24, -966 }, + { -68, -7, -971 }, { -68, 2, -974 }, { -68, 6, -975 }, { -67, 10, -975 }, + { -66, 13, -974 }, { -64, 15, -972 }, { -63, 16, -970 }, { -62, 16, -968 }, + { -61, 15, -967 }, { -62, 13, -967 }, { -63, 10, -968 }, { -65, 6, -970 }, + { -68, 2, -974 }, { -78, -9, -986 }, { -95, -30, -1006 }, { -113, -54, -1029 }, + { -129, -73, -1048 }, { -136, -82, -1057 }, { -137, -84, -1058 }, { -138, -85, -1059 }, + { -138, -85, -1059 }, { -138, -86, -1058 }, { -138, -85, -1057 }, { -137, -85, -1055 }, + { -136, -84, -1054 }, { -134, -83, -1051 }, { -133, -81, -1049 }, { -131, -80, -1046 }, + { -129, -78, -1043 }, { -127, -75, -1040 }, { -125, -73, -1037 }, { -123, -70, -1034 }, + { -120, -67, -1032 }, { -118, -64, -1029 }, { -116, -61, -1027 }, { -113, -58, -1024 }, + { -111, -55, -1023 }, { -109, -51, -1021 }, { -107, -48, -1020 }, { -106, -44, -1020 }, + { -104, -40, -1020 }, { -102, -33, -1023 }, { -100, -26, -1027 }, { -98, -17, -1031 }, + { -96, -8, -1036 }, { -94, 0, -1041 }, { -91, 8, -1045 }, { -89, 16, -1049 }, + { -87, 23, -1052 }, { -85, 29, -1053 }, { -83, 32, -1051 }, { -81, 33, -1047 }, + { -79, 32, -1040 }, { -77, 28, -1031 }, { -75, 24, -1020 }, { -73, 18, -1008 }, + { -72, 13, -997 }, { -70, 8, -987 }, { -69, 4, -979 }, { -68, 2, -974 }, + { -68, 0, -971 }, { -67, 0, -969 }, { -67, 0, -968 }, { -67, 0, -967 }, + { -67, 0, -967 }, { -67, 0, -968 }, { -67, 0, -969 }, { -67, 0, -970 }, + { -68, 0, -971 }, { -68, 1, -972 }, { -68, 1, -973 }, { -68, 1, -974 }, + { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 1, -975 }, { -68, 1, -975 }, { -68, 1, -975 }, + { -68, 1, -975 }, { -68, 1, -976 }, { -68, 1, -976 }, { -68, 1, -976 }, + { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -978 }, + { -68, 1, -978 }, { -68, 1, -978 }, { -68, 1, -979 }, { -68, 1, -979 }, + { -68, 1, -979 }, { -68, 1, -979 }, { -68, 1, -980 }, { -68, 1, -980 }, + { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, + { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -979 }, { -68, 1, -979 }, + { -68, 1, -979 }, { -68, 1, -978 }, { -68, 1, -978 }, { -68, 1, -977 }, + { -68, 1, -977 }, { -68, 1, -976 }, { -68, 1, -975 }, { -68, 2, -974 }, + { -68, 2, -970 }, { -68, 3, -963 }, { -68, 4, -953 }, { -68, 5, -943 }, + { -68, 6, -934 }, { -68, 7, -929 }, { -68, 7, -926 }, { -68, 6, -925 }, + { -68, 5, -924 }, { -68, 4, -925 }, { -68, 3, -925 }, { -68, 2, -926 }, + { -68, 3, -927 }, { -68, 4, -928 }, { -68, 7, -929 }, { -68, 12, -929 }, + { -68, 19, -929 }, { -68, 27, -929 }, { -68, 36, -930 }, { -68, 45, -930 }, + { -68, 54, -931 }, { -68, 62, -932 }, { -68, 69, -933 }, { -68, 74, -934 }, + { -69, 77, -935 }, { -69, 78, -938 }, { -69, 78, -941 }, { -69, 77, -943 }, + { -69, 75, -946 }, { -69, 72, -947 }, { -69, 68, -948 }, { -69, 64, -947 }, + { -69, 60, -946 }, { -69, 55, -946 }, { -69, 50, -944 }, { -69, 45, -943 }, + { -69, 40, -942 }, { -69, 35, -941 }, { -69, 30, -939 }, { -68, 24, -938 }, + { -68, 19, -936 }, { -68, 13, -935 }, { -68, 7, -933 }, { -68, 2, -931 }, + { -68, -3, -930 }, { -68, -9, -929 }, { -68, -14, -927 }, { -68, -20, -926 }, + { -68, -26, -925 }, { -68, -32, -924 }, { -68, -37, -923 }, { -68, -43, -923 }, + { -68, -50, -922 }, { -68, -57, -922 }, { -68, -64, -922 }, { -68, -72, -922 }, + { -68, -79, -922 }, { -68, -87, -922 }, { -68, -94, -922 }, { -68, -101, -922 }, + { -68, -108, -923 }, { -68, -114, -923 }, { -68, -119, -923 }, { -68, -124, -923 }, + { -68, -127, -924 }, { -68, -130, -924 }, { -68, -131, -923 }, { -69, -129, -921 }, + { -69, -126, -918 }, { -69, -122, -915 }, { -69, -117, -912 }, { -69, -111, -911 }, + { -69, -105, -910 }, { -69, -99, -912 }, { -69, -94, -916 }, { -69, -89, -923 }, + { -69, -86, -933 }, { -69, -82, -946 }, { -68, -78, -961 }, { -68, -74, -978 }, + { -68, -70, -996 }, { -68, -67, -1015 }, { -68, -63, -1034 }, { -67, -60, -1053 }, + { -67, -57, -1071 }, { -67, -54, -1087 }, { -67, -51, -1101 }, { -67, -49, -1112 }, + { -67, -48, -1121 }, { -67, -48, -1128 }, { -67, -50, -1132 }, { -67, -51, -1133 }, + { -67, -52, -1131 }, { -67, -52, -1124 }, { -67, -49, -1112 }, { -67, -41, -1090 }, + { -67, -28, -1055 }, { -68, -14, -1015 }, { -68, -1, -976 }, { -68, 7, -945 }, + { -68, 7, -929 }, { -68, 2, -923 }, { -67, -4, -919 }, { -67, -12, -917 }, + { -67, -21, -916 }, { -66, -30, -916 }, { -66, -40, -917 }, { -65, -51, -920 }, + { -65, -62, -923 }, { -65, -74, -926 }, { -64, -85, -930 }, { -64, -96, -934 }, + { -63, -108, -938 }, { -63, -118, -942 }, { -63, -128, -946 }, { -63, -138, -949 }, + { -62, -146, -952 }, { -62, -154, -954 }, { -62, -160, -954 }, { -63, -161, -953 }, + { -64, -153, -949 }, { -66, -141, -943 }, { -67, -130, -938 }, { -68, -124, -935 }, + { -68, -121, -933 }, { -69, -120, -931 }, { -69, -119, -929 }, { -69, -119, -927 }, + { -69, -119, -925 }, { -69, -119, -923 }, { -69, -119, -921 }, { -69, -119, -920 }, + { -69, -119, -919 }, { -69, -119, -917 }, { -69, -118, -916 }, { -69, -116, -916 }, + { -69, -114, -915 }, { -69, -110, -915 }, { -69, -106, -915 }, { -69, -99, -915 }, + { -69, -90, -917 }, { -68, -80, -919 }, { -68, -68, -922 }, { -67, -55, -924 }, + { -67, -41, -928 }, { -66, -28, -931 }, { -66, -16, -934 }, { -65, -5, -936 }, + { -65, 4, -939 }, { -64, 11, -940 }, { -64, 17, -940 }, { -64, 20, -938 }, + { -64, 21, -934 }, { -64, 21, -931 }, { -64, 20, -928 }, { -64, 17, -929 }, + { -64, 15, -932 }, { -64, 11, -940 }, { -64, 6, -958 }, { -64, -1, -986 }, + { -64, -11, -1018 }, { -63, -21, -1050 }, { -63, -29, -1077 }, { -63, -34, -1092 }, + { -63, -36, -1099 }, { -63, -37, -1103 }, { -63, -38, -1105 }, { -63, -38, -1105 }, + { -63, -37, -1103 }, { -63, -36, -1101 }, { -63, -35, -1098 }, { -63, -34, -1095 }, + { -63, -34, -1092 }, { -63, -33, -1091 }, { -63, -33, -1091 }, { -63, -34, -1092 }, + { -62, -43, -1121 }, { -62, -50, -1135 }, { -62, -43, -1092 }, { -62, -31, -1030 }, + { -62, -19, -971 }, { -62, -11, -938 }, { -62, -8, -926 }, { -63, -4, -917 }, + { -64, -1, -911 }, { -65, 1, -906 }, { -65, 4, -904 }, { -66, 7, -903 }, + { -67, 8, -905 }, { -68, 10, -907 }, { -68, 10, -911 }, { -68, 10, -916 }, + { -68, 9, -922 }, { -68, 7, -929 }, { -67, 4, -937 }, { -66, 0, -948 }, + { -64, -6, -962 }, { -63, -13, -977 }, { -61, -20, -993 }, { -59, -28, -1011 }, + { -57, -36, -1028 }, { -54, -44, -1045 }, { -52, -51, -1062 }, { -51, -58, -1077 }, + { -49, -65, -1091 }, { -48, -70, -1102 }, { -47, -74, -1110 }, { -46, -77, -1117 }, + { -45, -78, -1122 }, { -45, -80, -1127 }, { -44, -80, -1130 }, { -44, -81, -1132 }, + { -44, -80, -1133 }, { -44, -80, -1133 }, { -44, -79, -1132 }, { -44, -78, -1130 }, + { -45, -77, -1127 }, { -45, -76, -1122 }, { -46, -75, -1117 }, { -47, -74, -1110 }, + { -48, -73, -1101 }, { -49, -71, -1086 }, { -51, -70, -1069 }, { -54, -68, -1049 }, + { -56, -66, -1028 }, { -59, -63, -1007 }, { -61, -61, -987 }, { -63, -60, -969 }, + { -65, -58, -954 }, { -66, -57, -943 }, { -66, -57, -938 }, { -66, -57, -938 }, + { -66, -57, -941 }, { -65, -58, -946 }, { -64, -59, -954 }, { -63, -60, -964 }, + { -62, -61, -975 }, { -60, -63, -987 }, { -59, -64, -999 }, { -57, -66, -1011 }, + { -56, -67, -1023 }, { -55, -68, -1033 }, { -54, -69, -1042 }, { -53, -69, -1049 }, + { -53, -69, -1054 }, { -53, -68, -1055 }, { -56, -65, -1043 }, { -61, -58, -1015 }, + { -68, -50, -981 }, { -74, -44, -951 }, { -77, -40, -935 }, { -77, -39, -931 }, + { -78, -38, -927 }, { -79, -38, -923 }, { -79, -37, -920 }, { -80, -36, -917 }, + { -80, -36, -915 }, { -80, -35, -913 }, { -80, -35, -911 }, { -81, -35, -910 }, + { -81, -35, -908 }, { -81, -35, -907 }, { -81, -34, -907 }, { -81, -34, -906 }, + { -81, -34, -906 }, { -81, -35, -905 }, { -80, -35, -905 }, { -80, -35, -905 }, + { -80, -35, -905 }, { -80, -35, -906 }, { -80, -35, -906 }, { -80, -35, -906 }, + { -80, -35, -907 }, { -79, -35, -907 }, { -79, -36, -907 }, { -79, -36, -907 }, + { -79, -36, -907 }, { -79, -36, -907 }, { -79, -36, -908 }, { -79, -36, -911 }, + { -79, -37, -914 }, { -78, -37, -918 }, { -78, -38, -922 }, { -77, -39, -926 }, + { -77, -39, -930 }, { -77, -40, -933 }, { -77, -40, -935 }, { -77, -40, -936 }, + { -77, -40, -937 }, { -76, -40, -937 }, { -76, -40, -938 }, { -76, -40, -938 }, + { -76, -40, -938 }, { -77, -40, -937 }, { -77, -40, -937 }, { -77, -40, -937 }, + { -77, -40, -936 }, { -77, -40, -936 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -41, -935 }, { -77, -41, -934 }, { -77, -41, -934 }, { -77, -41, -934 }, + { -77, -41, -934 }, { -77, -42, -934 }, { -77, -42, -934 }, { -77, -42, -933 }, + { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, + { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, + { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -934 }, { -77, -41, -934 }, + { -77, -41, -934 }, { -77, -41, -935 }, { -77, -40, -935 }, { -77, -39, -936 }, + { -76, -39, -936 }, { -76, -38, -937 }, { -76, -37, -938 }, { -76, -37, -938 }, + { -76, -36, -939 }, { -76, -35, -940 }, { -76, -34, -941 }, { -75, -33, -941 }, + { -75, -32, -942 }, { -75, -31, -943 }, { -75, -30, -944 }, { -75, -29, -945 }, + { -74, -28, -946 }, { -74, -27, -947 }, { -74, -26, -948 }, { -74, -25, -949 }, + { -74, -24, -950 }, { -73, -23, -951 }, { -73, -22, -952 }, { -73, -21, -953 }, + { -73, -20, -954 }, { -72, -19, -955 }, { -72, -17, -956 }, { -72, -16, -957 }, + { -72, -15, -958 }, { -72, -14, -959 }, { -71, -13, -960 }, { -71, -12, -961 }, + { -71, -11, -962 }, { -71, -10, -963 }, { -70, -9, -964 }, { -70, -8, -965 }, + { -70, -7, -966 }, { -70, -6, -966 }, { -70, -5, -967 }, { -70, -4, -968 }, + { -69, -3, -969 }, { -69, -2, -970 }, { -69, -1, -971 }, { -69, 0, -971 }, + { -69, 0, -972 }, { -69, 0, -973 }, { -68, 1, -973 }, { -68, 2, -974 }, + { -68, 2, -975 }, { -68, 3, -975 }, { -68, 3, -976 }, { -68, 4, -977 }, + { -68, 4, -977 }, { -68, 5, -978 }, { -68, 5, -978 }, { -68, 6, -979 }, + { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, + { -68, 6, -979 }, { -68, 6, -979 }, { -68, 5, -979 }, { -68, 5, -978 }, + { -68, 4, -977 }, { -68, 3, -976 }, { -68, 3, -975 }, { -68, 2, -974 }, + { -68, 0, -972 }, { -68, -1, -969 }, { -68, -4, -965 }, { -68, -8, -961 }, + { -68, -12, -956 }, { -68, -16, -951 }, { -68, -20, -946 }, { -68, -23, -941 }, + { -68, -27, -937 }, { -68, -29, -933 }, { -68, -31, -931 }, { -68, -32, -930 }, + { -68, -33, -929 }, { -68, -33, -928 }, { -68, -34, -928 }, { -68, -34, -927 }, + { -68, -35, -927 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, + { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, + { -68, -36, -925 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, + { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, + { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, + { -68, -37, -924 }, { -68, -36, -924 }, { -68, -36, -925 }, { -68, -36, -925 }, + { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, + { -68, -36, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, + { -68, -35, -926 }, { -68, -35, -927 }, { -68, -35, -927 }, { -68, -34, -927 }, + { -68, -34, -927 }, { -68, -34, -927 }, { -68, -34, -928 }, { -68, -34, -928 }, + { -68, -34, -928 }, { -68, -33, -928 }, { -68, -33, -928 }, { -68, -33, -929 }, + { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, + { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, + { -68, -32, -929 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -33, -929 }, { -68, -32, -930 }, { -68, -29, -934 }, { -68, -25, -939 }, + { -68, -21, -945 }, { -68, -16, -951 }, { -68, -11, -956 }, { -68, -7, -962 }, + { -68, -3, -967 }, { -68, 0, -971 }, { -68, 1, -973 }, { -68, 2, -974 }, +}; + +static s16 animdata_mario_eye_left_2[][3] = { + { -69, -86, -946 }, { -69, -86, -946 }, { -69, -83, -946 }, { -69, -79, -947 }, { -69, -73, -948 }, + { -69, -67, -949 }, { -69, -59, -950 }, { -69, -50, -951 }, { -69, -41, -952 }, { -69, -31, -953 }, + { -69, -20, -955 }, { -69, -9, -956 }, { -69, 1, -958 }, { -69, 12, -959 }, { -69, 24, -961 }, + { -69, 34, -962 }, { -69, 45, -963 }, { -69, 55, -965 }, { -69, 65, -966 }, { -69, 73, -967 }, + { -69, 81, -968 }, { -69, 88, -969 }, { -69, 93, -970 }, { -69, 97, -970 }, { -69, 100, -971 }, + { -69, 101, -971 }, { -70, 81, -968 }, { -70, 35, -963 }, { -70, -19, -956 }, { -69, -66, -950 }, + { -69, -86, -946 }, { -68, -75, -945 }, { -67, -43, -945 }, { -65, -1, -946 }, { -64, 40, -947 }, + { -63, 72, -948 }, { -63, 85, -949 }, { -63, 78, -949 }, { -64, 58, -948 }, { -65, 31, -948 }, + { -66, 0, -947 }, { -67, -32, -947 }, { -68, -59, -946 }, { -69, -79, -946 }, { -69, -86, -946 }, + { -69, -68, -946 }, { -68, -26, -945 }, { -67, 25, -945 }, { -66, 69, -945 }, { -65, 89, -945 }, + { -65, 80, -945 }, { -65, 54, -946 }, { -64, 19, -947 }, { -64, -16, -948 }, { -64, -44, -949 }, + { -63, -57, -949 }, { -63, -51, -950 }, { -63, -33, -950 }, { -63, -7, -951 }, { -62, 21, -951 }, + { -62, 48, -951 }, { -62, 71, -952 }, { -62, 73, -953 }, { -62, 73, -953 }, { -62, 73, -953 }, + { -62, 73, -953 }, { -62, 73, -953 }, { -62, 73, -953 }, { -62, 73, -953 }, { -62, 73, -953 }, + { -62, 73, -953 }, { -62, 73, -953 }, { -62, 74, -952 }, { -62, 74, -952 }, { -62, 74, -952 }, + { -62, 74, -952 }, { -62, 74, -952 }, { -62, 75, -952 }, { -62, 75, -952 }, { -62, 75, -952 }, + { -62, 75, -952 }, { -62, 75, -952 }, { -62, 76, -952 }, { -62, 76, -952 }, { -62, 76, -952 }, + { -62, 76, -952 }, { -62, 77, -952 }, { -62, 77, -952 }, { -62, 77, -951 }, { -62, 77, -951 }, + { -62, 77, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, + { -62, 78, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, + { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, + { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, + { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, { -62, 79, -951 }, + { -62, 79, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, { -62, 78, -951 }, + { -62, 77, -951 }, { -62, 77, -951 }, { -62, 76, -951 }, { -62, 76, -952 }, { -62, 75, -952 }, + { -62, 75, -952 }, { -62, 74, -952 }, { -62, 74, -952 }, { -62, 73, -952 }, { -62, 73, -953 }, + { -62, 72, -953 }, { -62, 71, -953 }, { -62, 69, -954 }, { -63, 68, -954 }, { -63, 66, -955 }, + { -63, 64, -955 }, { -63, 62, -956 }, { -63, 60, -956 }, { -63, 58, -957 }, { -64, 56, -958 }, + { -64, 53, -959 }, { -64, 50, -959 }, { -64, 48, -960 }, { -64, 45, -961 }, { -65, 42, -962 }, + { -65, 40, -963 }, { -65, 37, -963 }, { -65, 34, -964 }, { -66, 31, -965 }, { -66, 28, -966 }, + { -66, 26, -967 }, { -66, 23, -968 }, { -67, 21, -968 }, { -67, 18, -969 }, { -67, 16, -970 }, + { -67, 14, -970 }, { -67, 11, -971 }, { -68, 10, -972 }, { -68, 8, -972 }, { -68, 6, -973 }, + { -68, 5, -973 }, { -68, 4, -973 }, { -68, 3, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, +}; + +struct AnimDataInfo anim_mario_eye_left[] = { + { ARRAY_COUNT(animdata_mario_eye_left_1), GD_ANIM_ROT3S, animdata_mario_eye_left_1 }, + { ARRAY_COUNT(animdata_mario_eye_left_2), GD_ANIM_ROT3S, animdata_mario_eye_left_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eye_right_1[][3] = { + { 1844, -1788, 824 }, { 1844, -1789, 824 }, { 1844, -1791, 825 }, { 1844, -1794, 825 }, + { 1844, -1797, 826 }, { 1844, -1802, 826 }, { 1844, -1807, 827 }, { 1844, -1813, 828 }, + { 1844, -1819, 829 }, { 1845, -1826, 829 }, { 1845, -1832, 830 }, { 1845, -1839, 831 }, + { 1845, -1845, 832 }, { 1845, -1851, 833 }, { 1845, -1857, 834 }, { 1845, -1862, 835 }, + { 1845, -1866, 836 }, { 1845, -1870, 836 }, { 1845, -1873, 837 }, { 1845, -1874, 838 }, + { 1845, -1875, 838 }, { 1845, -1868, 838 }, { 1845, -1851, 837 }, { 1845, -1830, 835 }, + { 1844, -1808, 834 }, { 1844, -1791, 832 }, { 1844, -1783, 832 }, { 1844, -1781, 831 }, + { 1844, -1779, 831 }, { 1844, -1778, 831 }, { 1844, -1777, 830 }, { 1844, -1776, 830 }, + { 1844, -1775, 830 }, { 1844, -1774, 830 }, { 1844, -1774, 829 }, { 1844, -1773, 829 }, + { 1844, -1773, 829 }, { 1844, -1773, 829 }, { 1844, -1773, 828 }, { 1844, -1773, 828 }, + { 1844, -1773, 828 }, { 1844, -1773, 828 }, { 1844, -1773, 827 }, { 1844, -1774, 827 }, + { 1844, -1774, 827 }, { 1844, -1775, 827 }, { 1844, -1775, 827 }, { 1844, -1776, 826 }, + { 1844, -1777, 826 }, { 1844, -1777, 826 }, { 1844, -1778, 826 }, { 1844, -1779, 826 }, + { 1844, -1780, 826 }, { 1844, -1780, 825 }, { 1844, -1781, 825 }, { 1844, -1782, 825 }, + { 1844, -1783, 825 }, { 1844, -1784, 825 }, { 1844, -1784, 825 }, { 1844, -1785, 825 }, + { 1844, -1786, 825 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1787, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 825 }, { 1844, -1788, 825 }, { 1844, -1787, 826 }, + { 1844, -1786, 827 }, { 1844, -1785, 829 }, { 1844, -1784, 830 }, { 1844, -1782, 832 }, + { 1844, -1781, 833 }, { 1844, -1780, 835 }, { 1844, -1779, 836 }, { 1844, -1778, 837 }, + { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1778, 838 }, + { 1844, -1779, 837 }, { 1844, -1780, 835 }, { 1844, -1782, 832 }, { 1844, -1785, 829 }, + { 1844, -1788, 824 }, { 1844, -1800, 810 }, { 1844, -1823, 782 }, { 1844, -1849, 749 }, + { 1844, -1872, 720 }, { 1843, -1884, 705 }, { 1843, -1888, 701 }, { 1843, -1891, 696 }, + { 1843, -1894, 693 }, { 1843, -1897, 689 }, { 1843, -1899, 687 }, { 1843, -1900, 685 }, + { 1843, -1902, 684 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, + { 1843, -1901, 684 }, { 1843, -1900, 685 }, { 1843, -1899, 687 }, { 1843, -1897, 690 }, + { 1843, -1894, 693 }, { 1843, -1891, 697 }, { 1843, -1888, 701 }, { 1843, -1884, 705 }, + { 1844, -1875, 717 }, { 1844, -1858, 738 }, { 1844, -1837, 763 }, { 1844, -1816, 789 }, + { 1844, -1799, 811 }, { 1844, -1788, 824 }, { 1844, -1783, 830 }, { 1844, -1779, 834 }, + { 1844, -1776, 835 }, { 1844, -1774, 835 }, { 1844, -1773, 834 }, { 1844, -1773, 832 }, + { 1844, -1774, 830 }, { 1844, -1776, 828 }, { 1844, -1779, 826 }, { 1844, -1783, 825 }, + { 1844, -1788, 824 }, { 1844, -1801, 825 }, { 1844, -1824, 827 }, { 1845, -1849, 829 }, + { 1845, -1870, 831 }, { 1845, -1880, 832 }, { 1845, -1881, 832 }, { 1845, -1882, 832 }, + { 1845, -1883, 832 }, { 1845, -1883, 831 }, { 1845, -1883, 831 }, { 1845, -1882, 831 }, + { 1845, -1881, 830 }, { 1845, -1880, 830 }, { 1845, -1878, 830 }, { 1845, -1876, 829 }, + { 1845, -1874, 829 }, { 1845, -1871, 828 }, { 1845, -1869, 828 }, { 1845, -1866, 828 }, + { 1845, -1863, 827 }, { 1845, -1859, 827 }, { 1845, -1856, 827 }, { 1845, -1853, 827 }, + { 1845, -1849, 827 }, { 1845, -1846, 827 }, { 1845, -1842, 828 }, { 1845, -1839, 828 }, + { 1844, -1834, 829 }, { 1844, -1829, 831 }, { 1844, -1822, 834 }, { 1844, -1814, 836 }, + { 1844, -1805, 839 }, { 1843, -1797, 842 }, { 1843, -1789, 845 }, { 1843, -1781, 848 }, + { 1843, -1775, 850 }, { 1842, -1770, 851 }, { 1842, -1766, 851 }, { 1842, -1765, 850 }, + { 1843, -1766, 848 }, { 1843, -1768, 845 }, { 1843, -1771, 841 }, { 1843, -1775, 837 }, + { 1844, -1780, 833 }, { 1844, -1783, 829 }, { 1844, -1787, 826 }, { 1844, -1788, 824 }, + { 1844, -1789, 823 }, { 1844, -1790, 823 }, { 1844, -1790, 822 }, { 1845, -1790, 822 }, + { 1844, -1790, 822 }, { 1844, -1790, 822 }, { 1844, -1790, 823 }, { 1844, -1790, 823 }, + { 1844, -1789, 823 }, { 1844, -1789, 824 }, { 1844, -1789, 824 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 823 }, { 1844, -1788, 823 }, + { 1844, -1788, 823 }, { 1844, -1788, 823 }, { 1844, -1789, 822 }, { 1844, -1789, 822 }, + { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 820 }, + { 1844, -1789, 820 }, { 1844, -1789, 820 }, { 1844, -1789, 819 }, { 1844, -1789, 819 }, + { 1844, -1789, 819 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, + { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, + { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 819 }, + { 1844, -1789, 819 }, { 1844, -1789, 819 }, { 1844, -1789, 820 }, { 1844, -1789, 821 }, + { 1844, -1789, 821 }, { 1844, -1789, 822 }, { 1844, -1788, 823 }, { 1844, -1788, 824 }, + { 1844, -1788, 828 }, { 1844, -1787, 837 }, { 1844, -1786, 848 }, { 1844, -1786, 860 }, + { 1843, -1785, 870 }, { 1843, -1784, 876 }, { 1843, -1785, 878 }, { 1843, -1785, 880 }, + { 1843, -1786, 880 }, { 1843, -1788, 880 }, { 1843, -1789, 879 }, { 1843, -1789, 878 }, + { 1843, -1789, 877 }, { 1843, -1787, 876 }, { 1843, -1784, 876 }, { 1843, -1780, 876 }, + { 1843, -1773, 878 }, { 1843, -1765, 879 }, { 1843, -1756, 881 }, { 1843, -1746, 883 }, + { 1843, -1738, 883 }, { 1844, -1729, 883 }, { 1844, -1723, 882 }, { 1844, -1718, 878 }, + { 1844, -1715, 872 }, { 1845, -1714, 863 }, { 1845, -1715, 851 }, { 1846, -1716, 839 }, + { 1846, -1719, 827 }, { 1846, -1722, 816 }, { 1846, -1726, 808 }, { 1846, -1731, 801 }, + { 1846, -1735, 794 }, { 1846, -1740, 788 }, { 1846, -1745, 781 }, { 1846, -1750, 774 }, + { 1846, -1755, 768 }, { 1845, -1760, 761 }, { 1845, -1765, 755 }, { 1845, -1771, 748 }, + { 1845, -1776, 742 }, { 1844, -1782, 737 }, { 1844, -1787, 731 }, { 1844, -1793, 725 }, + { 1844, -1799, 720 }, { 1844, -1804, 715 }, { 1843, -1810, 711 }, { 1843, -1816, 706 }, + { 1843, -1822, 703 }, { 1843, -1827, 699 }, { 1843, -1833, 696 }, { 1843, -1839, 693 }, + { 1843, -1845, 690 }, { 1843, -1852, 687 }, { 1843, -1859, 685 }, { 1843, -1866, 683 }, + { 1843, -1873, 682 }, { 1843, -1880, 681 }, { 1843, -1887, 681 }, { 1843, -1894, 681 }, + { 1844, -1901, 682 }, { 1844, -1907, 684 }, { 1844, -1912, 687 }, { 1844, -1917, 691 }, + { 1844, -1921, 697 }, { 1844, -1924, 703 }, { 1844, -1927, 712 }, { 1843, -1927, 726 }, + { 1843, -1927, 744 }, { 1843, -1926, 763 }, { 1842, -1923, 784 }, { 1842, -1920, 805 }, + { 1842, -1917, 825 }, { 1842, -1913, 843 }, { 1841, -1909, 857 }, { 1841, -1906, 868 }, + { 1841, -1902, 874 }, { 1841, -1897, 878 }, { 1841, -1891, 880 }, { 1841, -1886, 881 }, + { 1842, -1880, 881 }, { 1842, -1873, 879 }, { 1842, -1867, 877 }, { 1842, -1861, 875 }, + { 1842, -1856, 873 }, { 1842, -1851, 871 }, { 1843, -1846, 869 }, { 1843, -1842, 869 }, + { 1843, -1840, 869 }, { 1843, -1841, 869 }, { 1843, -1842, 869 }, { 1843, -1844, 869 }, + { 1843, -1846, 869 }, { 1843, -1845, 869 }, { 1843, -1842, 869 }, { 1843, -1834, 869 }, + { 1843, -1822, 870 }, { 1843, -1807, 870 }, { 1843, -1794, 871 }, { 1843, -1785, 871 }, + { 1843, -1785, 870 }, { 1843, -1790, 869 }, { 1843, -1796, 868 }, { 1843, -1804, 867 }, + { 1842, -1813, 867 }, { 1842, -1822, 866 }, { 1842, -1832, 866 }, { 1842, -1843, 866 }, + { 1841, -1854, 865 }, { 1841, -1865, 864 }, { 1841, -1877, 863 }, { 1841, -1888, 862 }, + { 1840, -1899, 860 }, { 1840, -1909, 858 }, { 1839, -1919, 855 }, { 1838, -1928, 852 }, + { 1838, -1936, 849 }, { 1837, -1943, 844 }, { 1836, -1949, 839 }, { 1834, -1950, 829 }, + { 1831, -1943, 811 }, { 1827, -1933, 789 }, { 1823, -1922, 767 }, { 1820, -1912, 749 }, + { 1818, -1907, 739 }, { 1818, -1905, 735 }, { 1817, -1905, 731 }, { 1817, -1905, 728 }, + { 1816, -1906, 725 }, { 1816, -1908, 724 }, { 1816, -1910, 723 }, { 1816, -1912, 722 }, + { 1816, -1913, 723 }, { 1816, -1915, 724 }, { 1817, -1915, 726 }, { 1817, -1915, 728 }, + { 1817, -1914, 731 }, { 1818, -1911, 735 }, { 1818, -1907, 739 }, { 1819, -1900, 745 }, + { 1820, -1891, 754 }, { 1821, -1880, 764 }, { 1822, -1867, 776 }, { 1823, -1853, 788 }, + { 1825, -1839, 801 }, { 1826, -1825, 814 }, { 1827, -1811, 826 }, { 1829, -1799, 837 }, + { 1830, -1789, 847 }, { 1830, -1781, 854 }, { 1831, -1775, 860 }, { 1831, -1772, 865 }, + { 1831, -1770, 869 }, { 1832, -1770, 871 }, { 1831, -1772, 871 }, { 1831, -1774, 869 }, + { 1831, -1777, 863 }, { 1830, -1781, 854 }, { 1829, -1786, 836 }, { 1828, -1796, 808 }, + { 1826, -1806, 775 }, { 1825, -1817, 742 }, { 1823, -1826, 716 }, { 1822, -1831, 700 }, + { 1822, -1833, 693 }, { 1822, -1834, 689 }, { 1822, -1835, 687 }, { 1822, -1835, 687 }, + { 1822, -1834, 689 }, { 1822, -1833, 692 }, { 1822, -1832, 695 }, { 1822, -1831, 698 }, + { 1822, -1830, 700 }, { 1822, -1830, 702 }, { 1822, -1830, 702 }, { 1822, -1831, 700 }, + { 1821, -1841, 671 }, { 1821, -1848, 656 }, { 1824, -1839, 699 }, { 1829, -1825, 762 }, + { 1833, -1812, 821 }, { 1836, -1803, 855 }, { 1837, -1799, 867 }, { 1838, -1796, 875 }, + { 1839, -1792, 881 }, { 1840, -1789, 884 }, { 1841, -1787, 885 }, { 1841, -1785, 884 }, + { 1842, -1783, 883 }, { 1842, -1782, 881 }, { 1842, -1781, 878 }, { 1843, -1782, 877 }, + { 1843, -1783, 876 }, { 1843, -1784, 876 }, { 1843, -1787, 877 }, { 1844, -1792, 878 }, + { 1844, -1797, 878 }, { 1844, -1803, 879 }, { 1844, -1810, 879 }, { 1844, -1817, 880 }, + { 1844, -1824, 880 }, { 1844, -1831, 880 }, { 1844, -1838, 881 }, { 1843, -1845, 881 }, + { 1843, -1850, 881 }, { 1843, -1855, 881 }, { 1843, -1859, 881 }, { 1843, -1861, 882 }, + { 1844, -1863, 884 }, { 1844, -1863, 886 }, { 1844, -1864, 889 }, { 1844, -1864, 891 }, + { 1845, -1863, 894 }, { 1845, -1862, 896 }, { 1845, -1861, 897 }, { 1845, -1860, 897 }, + { 1845, -1859, 896 }, { 1845, -1859, 893 }, { 1844, -1858, 888 }, { 1843, -1859, 881 }, + { 1842, -1859, 871 }, { 1840, -1860, 854 }, { 1838, -1862, 835 }, { 1835, -1863, 812 }, + { 1833, -1865, 788 }, { 1830, -1866, 765 }, { 1828, -1868, 742 }, { 1825, -1869, 722 }, + { 1823, -1870, 706 }, { 1822, -1870, 696 }, { 1822, -1870, 691 }, { 1822, -1869, 692 }, + { 1822, -1868, 695 }, { 1823, -1867, 699 }, { 1823, -1866, 705 }, { 1824, -1865, 713 }, + { 1825, -1863, 722 }, { 1826, -1862, 732 }, { 1828, -1860, 742 }, { 1829, -1858, 754 }, + { 1830, -1856, 766 }, { 1832, -1855, 778 }, { 1833, -1853, 790 }, { 1834, -1851, 802 }, + { 1836, -1850, 813 }, { 1837, -1848, 824 }, { 1838, -1847, 834 }, { 1839, -1846, 844 }, + { 1840, -1844, 852 }, { 1841, -1843, 858 }, { 1841, -1843, 863 }, { 1842, -1842, 867 }, + { 1842, -1842, 870 }, { 1843, -1841, 873 }, { 1843, -1841, 876 }, { 1843, -1841, 878 }, + { 1843, -1840, 880 }, { 1843, -1840, 881 }, { 1844, -1840, 882 }, { 1844, -1840, 883 }, + { 1844, -1840, 884 }, { 1844, -1840, 884 }, { 1844, -1840, 885 }, { 1844, -1840, 885 }, + { 1844, -1840, 885 }, { 1844, -1840, 885 }, { 1844, -1840, 884 }, { 1843, -1840, 884 }, + { 1843, -1840, 883 }, { 1843, -1840, 883 }, { 1843, -1841, 882 }, { 1843, -1841, 882 }, + { 1843, -1841, 881 }, { 1843, -1841, 881 }, { 1843, -1841, 880 }, { 1843, -1841, 880 }, + { 1843, -1841, 880 }, { 1843, -1841, 880 }, { 1843, -1841, 879 }, { 1843, -1841, 878 }, + { 1843, -1841, 876 }, { 1842, -1842, 873 }, { 1842, -1842, 871 }, { 1842, -1842, 868 }, + { 1842, -1842, 866 }, { 1842, -1843, 864 }, { 1841, -1843, 863 }, { 1841, -1843, 862 }, + { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 861 }, { 1841, -1843, 861 }, + { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, + { 1841, -1843, 862 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1844, 863 }, { 1841, -1844, 864 }, { 1841, -1844, 864 }, { 1841, -1844, 864 }, + { 1841, -1844, 864 }, { 1841, -1845, 864 }, { 1841, -1845, 865 }, { 1841, -1845, 865 }, + { 1841, -1845, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, + { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, + { 1841, -1846, 865 }, { 1841, -1845, 865 }, { 1841, -1845, 865 }, { 1841, -1845, 864 }, + { 1841, -1844, 864 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1842, 862 }, + { 1842, -1841, 862 }, { 1842, -1840, 861 }, { 1842, -1839, 861 }, { 1842, -1838, 860 }, + { 1842, -1837, 859 }, { 1842, -1836, 858 }, { 1842, -1835, 858 }, { 1842, -1834, 857 }, + { 1842, -1833, 856 }, { 1842, -1832, 855 }, { 1842, -1830, 854 }, { 1842, -1829, 853 }, + { 1842, -1828, 852 }, { 1842, -1826, 851 }, { 1842, -1825, 850 }, { 1842, -1824, 849 }, + { 1843, -1822, 849 }, { 1843, -1821, 848 }, { 1843, -1820, 847 }, { 1843, -1818, 846 }, + { 1843, -1817, 845 }, { 1843, -1815, 844 }, { 1843, -1814, 843 }, { 1843, -1813, 842 }, + { 1843, -1811, 841 }, { 1843, -1810, 840 }, { 1843, -1808, 839 }, { 1843, -1807, 838 }, + { 1843, -1806, 837 }, { 1843, -1804, 836 }, { 1844, -1803, 835 }, { 1844, -1802, 834 }, + { 1844, -1800, 833 }, { 1844, -1799, 832 }, { 1844, -1798, 831 }, { 1844, -1797, 830 }, + { 1844, -1795, 829 }, { 1844, -1794, 829 }, { 1844, -1793, 828 }, { 1844, -1792, 827 }, + { 1844, -1791, 826 }, { 1844, -1790, 826 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1787, 823 }, { 1844, -1786, 823 }, { 1844, -1786, 822 }, + { 1844, -1785, 822 }, { 1844, -1785, 821 }, { 1844, -1784, 821 }, { 1844, -1784, 821 }, + { 1844, -1784, 821 }, { 1844, -1784, 820 }, { 1844, -1784, 820 }, { 1844, -1784, 820 }, + { 1844, -1784, 821 }, { 1844, -1784, 821 }, { 1844, -1785, 821 }, { 1844, -1785, 821 }, + { 1844, -1786, 822 }, { 1844, -1787, 823 }, { 1844, -1787, 823 }, { 1844, -1788, 824 }, + { 1844, -1790, 826 }, { 1845, -1792, 828 }, { 1845, -1795, 831 }, { 1845, -1798, 834 }, + { 1845, -1802, 837 }, { 1845, -1805, 841 }, { 1845, -1809, 844 }, { 1846, -1812, 848 }, + { 1846, -1815, 851 }, { 1846, -1818, 853 }, { 1846, -1819, 855 }, { 1846, -1820, 856 }, + { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, + { 1846, -1822, 857 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, + { 1846, -1823, 858 }, { 1846, -1823, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1823, 859 }, { 1846, -1823, 858 }, + { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, + { 1846, -1823, 858 }, { 1846, -1822, 858 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, + { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, + { 1846, -1821, 857 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, + { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, + { 1846, -1821, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1821, 856 }, { 1846, -1820, 856 }, { 1846, -1817, 853 }, { 1846, -1814, 849 }, + { 1845, -1810, 845 }, { 1845, -1805, 841 }, { 1845, -1801, 837 }, { 1845, -1797, 833 }, + { 1845, -1794, 829 }, { 1844, -1791, 827 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, +}; + +static s16 animdata_mario_eye_right_2[][3] = { + { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, + { 1841, -1710, 853 }, { 1841, -1710, 853 }, { 1841, -1709, 853 }, { 1841, -1708, 853 }, + { 1841, -1707, 853 }, { 1841, -1706, 853 }, { 1841, -1705, 853 }, { 1841, -1705, 853 }, + { 1841, -1704, 853 }, { 1841, -1703, 853 }, { 1841, -1702, 852 }, { 1841, -1701, 852 }, + { 1841, -1701, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, + { 1841, -1699, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, + { 1841, -1701, 852 }, { 1841, -1702, 852 }, { 1841, -1703, 853 }, { 1841, -1705, 853 }, + { 1841, -1707, 853 }, { 1841, -1709, 853 }, { 1841, -1711, 853 }, { 1841, -1721, 854 }, + { 1841, -1739, 855 }, { 1841, -1762, 857 }, { 1841, -1785, 858 }, { 1841, -1802, 860 }, + { 1840, -1809, 860 }, { 1841, -1804, 860 }, { 1841, -1793, 859 }, { 1841, -1778, 858 }, + { 1841, -1760, 857 }, { 1841, -1742, 855 }, { 1841, -1727, 854 }, { 1841, -1716, 853 }, + { 1841, -1711, 853 }, { 1841, -1726, 852 }, { 1840, -1762, 848 }, { 1839, -1804, 843 }, + { 1839, -1839, 837 }, { 1838, -1853, 833 }, { 1838, -1842, 830 }, { 1838, -1814, 827 }, + { 1838, -1778, 824 }, { 1839, -1743, 822 }, { 1839, -1715, 820 }, { 1839, -1702, 819 }, + { 1839, -1708, 820 }, { 1839, -1727, 821 }, { 1840, -1753, 823 }, { 1840, -1782, 825 }, + { 1840, -1811, 827 }, { 1840, -1834, 828 }, { 1840, -1837, 828 }, { 1840, -1818, 833 }, + { 1841, -1795, 838 }, { 1841, -1771, 844 }, { 1842, -1749, 849 }, { 1842, -1733, 853 }, + { 1842, -1726, 855 }, { 1842, -1724, 855 }, { 1842, -1723, 855 }, { 1842, -1721, 856 }, + { 1842, -1720, 856 }, { 1843, -1719, 856 }, { 1843, -1717, 857 }, { 1843, -1716, 857 }, + { 1843, -1715, 857 }, { 1843, -1714, 858 }, { 1843, -1713, 858 }, { 1843, -1713, 858 }, + { 1843, -1712, 858 }, { 1843, -1711, 858 }, { 1843, -1711, 859 }, { 1843, -1710, 859 }, + { 1843, -1710, 859 }, { 1843, -1709, 859 }, { 1843, -1709, 859 }, { 1843, -1708, 859 }, + { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, + { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, + { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1842, -1708, 860 }, { 1842, -1709, 860 }, + { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1710, 860 }, + { 1842, -1710, 860 }, { 1842, -1711, 860 }, { 1842, -1711, 860 }, { 1842, -1712, 859 }, + { 1842, -1712, 859 }, { 1842, -1713, 859 }, { 1842, -1713, 859 }, { 1842, -1714, 859 }, + { 1842, -1715, 859 }, { 1842, -1715, 859 }, { 1842, -1716, 858 }, { 1842, -1716, 858 }, + { 1842, -1717, 858 }, { 1842, -1718, 858 }, { 1842, -1718, 858 }, { 1842, -1719, 857 }, + { 1842, -1720, 857 }, { 1842, -1721, 857 }, { 1842, -1721, 857 }, { 1842, -1722, 856 }, + { 1842, -1723, 856 }, { 1842, -1723, 856 }, { 1842, -1724, 856 }, { 1842, -1725, 855 }, + { 1842, -1725, 855 }, { 1842, -1726, 855 }, { 1842, -1727, 854 }, { 1842, -1728, 854 }, + { 1842, -1729, 853 }, { 1842, -1730, 853 }, { 1843, -1732, 852 }, { 1843, -1733, 851 }, + { 1843, -1735, 850 }, { 1843, -1737, 849 }, { 1843, -1739, 848 }, { 1843, -1741, 847 }, + { 1843, -1743, 846 }, { 1843, -1746, 845 }, { 1843, -1748, 844 }, { 1843, -1750, 843 }, + { 1843, -1753, 842 }, { 1843, -1755, 840 }, { 1843, -1758, 839 }, { 1843, -1760, 838 }, + { 1844, -1762, 837 }, { 1844, -1765, 836 }, { 1844, -1767, 835 }, { 1844, -1770, 833 }, + { 1844, -1772, 832 }, { 1844, -1774, 831 }, { 1844, -1776, 830 }, { 1844, -1778, 829 }, + { 1844, -1780, 829 }, { 1844, -1781, 828 }, { 1844, -1783, 827 }, { 1844, -1784, 826 }, + { 1844, -1785, 826 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1788, 825 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, +}; + +struct AnimDataInfo anim_mario_eye_right[] = { + { ARRAY_COUNT(animdata_mario_eye_right_1), GD_ANIM_ROT3S, animdata_mario_eye_right_1 }, + { ARRAY_COUNT(animdata_mario_eye_right_2), GD_ANIM_ROT3S, animdata_mario_eye_right_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_cap_1[][3] = { + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1538 }, { 0, 0, 1538 }, + { 0, 0, 1537 }, { 0, 0, 1537 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1535 }, + { 0, 0, 1535 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, + { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1535 }, { 0, 0, 1536 }, + { 0, 0, 1537 }, { 0, 0, 1539 }, { 0, 0, 1550 }, { 0, 0, 1569 }, { 0, 0, 1579 }, + { 0, 0, 1576 }, { 0, 0, 1568 }, { 0, 0, 1557 }, { 0, 0, 1548 }, { 0, 0, 1540 }, + { 0, 0, 1539 }, { 0, 0, 1553 }, { 0, 0, 1580 }, { 0, 0, 1596 }, { 0, 0, 1592 }, + { 0, 0, 1579 }, { 0, 0, 1567 }, { 0, 0, 1564 }, { 0, 0, 1562 }, { 0, 0, 1556 }, + { 0, 0, 1540 }, { 0, 0, 1520 }, { 0, 0, 1510 }, { 0, 0, 1510 }, { 0, 0, 1509 }, + { 0, 0, 1509 }, { 0, 0, 1510 }, { 0, 0, 1510 }, { 0, 0, 1511 }, { 0, 0, 1512 }, + { 0, 0, 1513 }, { 0, 0, 1514 }, { 0, 0, 1515 }, { 0, 0, 1517 }, { 0, 0, 1518 }, + { 0, 0, 1520 }, { 0, 0, 1521 }, { 0, 0, 1523 }, { 0, 0, 1525 }, { 0, 0, 1526 }, + { 0, 0, 1528 }, { 0, 0, 1530 }, { 0, 0, 1531 }, { 0, 0, 1533 }, { 0, 0, 1534 }, + { 0, 0, 1536 }, { 0, 0, 1537 }, { 0, 0, 1538 }, { 0, 0, 1539 }, { 0, 0, 1535 }, + { 0, 0, 1526 }, { 0, 0, 1515 }, { 0, 0, 1506 }, { 0, 0, 1502 }, { 0, 0, 1503 }, + { 0, 0, 1504 }, { 0, 0, 1506 }, { 0, 0, 1509 }, { 0, 0, 1512 }, { 0, 0, 1516 }, + { 0, 0, 1520 }, { 0, 0, 1524 }, { 0, 0, 1527 }, { 0, 0, 1530 }, { 0, 0, 1533 }, + { 0, 0, 1535 }, { 0, 0, 1536 }, { 0, 0, 1537 }, { 0, 0, 1536 }, { 0, 0, 1535 }, + { 0, 0, 1533 }, { 0, 0, 1531 }, { 0, 0, 1528 }, { 0, 0, 1526 }, { 0, 0, 1522 }, + { 0, 0, 1519 }, { 0, 0, 1516 }, { 0, 0, 1512 }, { 0, 0, 1509 }, { 0, 0, 1506 }, + { 0, 0, 1503 }, { 0, 0, 1501 }, { 0, 0, 1498 }, { 0, 0, 1497 }, { 0, 0, 1496 }, + { 0, 0, 1495 }, { 0, 0, 1496 }, { 0, 0, 1497 }, { 0, 0, 1499 }, { 0, 0, 1502 }, + { 0, 0, 1505 }, { 0, 0, 1509 }, { 0, 0, 1513 }, { 0, 0, 1517 }, { 0, 0, 1521 }, + { 0, 0, 1524 }, { 0, 0, 1528 }, { 0, 0, 1531 }, { 0, 0, 1533 }, { 0, 0, 1534 }, + { 0, 0, 1536 }, { 0, 0, 1537 }, { 0, 0, 1539 }, { 0, 0, 1540 }, { 0, 0, 1541 }, + { 0, 0, 1541 }, { 0, 0, 1542 }, { 0, 0, 1541 }, { 0, 0, 1541 }, { 0, 0, 1540 }, + { 0, 0, 1538 }, { 0, 0, 1534 }, { 0, 0, 1529 }, { 0, 0, 1522 }, { 0, 0, 1514 }, + { 0, 0, 1506 }, { 0, 0, 1500 }, { 0, 0, 1495 }, { 0, 0, 1493 }, { 0, 0, 1492 }, + { 0, 0, 1492 }, { 0, 0, 1493 }, { 0, 0, 1493 }, { 0, 0, 1494 }, { 0, 0, 1495 }, + { 0, 0, 1497 }, { 0, 0, 1498 }, { 0, 0, 1500 }, { 0, 0, 1502 }, { 0, 0, 1503 }, + { 0, 0, 1505 }, { 0, 0, 1507 }, { 0, 0, 1509 }, { 0, 0, 1511 }, { 0, 0, 1513 }, + { 0, 0, 1515 }, { 0, 0, 1516 }, { 0, 0, 1517 }, { 0, 0, 1519 }, { 0, 0, 1520 }, + { 0, 0, 1520 }, { 0, 0, 1521 }, { 0, 0, 1521 }, { 0, 0, 1518 }, { 0, 0, 1512 }, + { 0, 0, 1504 }, { 0, 0, 1497 }, { 0, 0, 1491 }, { 0, 0, 1490 }, { 0, 0, 1493 }, + { 0, 0, 1500 }, { 0, 0, 1509 }, { 0, 0, 1518 }, { 0, 0, 1527 }, { 0, 0, 1534 }, + { 0, 0, 1539 }, { 0, 0, 1541 }, { 0, 0, 1542 }, { 0, 0, 1543 }, { 0, 0, 1544 }, + { 0, 0, 1544 }, { 0, 0, 1544 }, { 0, 0, 1544 }, { 0, 0, 1543 }, { 0, 0, 1542 }, + { 0, 0, 1541 }, { 0, 0, 1540 }, { 0, 0, 1540 }, { 0, 0, 1539 }, { 0, 0, 1538 }, + { 0, 0, 1536 }, { 0, 0, 1534 }, { 0, 0, 1532 }, { 0, 0, 1529 }, { 0, 0, 1525 }, + { 0, 0, 1522 }, { 0, 0, 1518 }, { 0, 0, 1514 }, { 0, 0, 1511 }, { 0, 0, 1507 }, + { 0, 0, 1504 }, { 0, 0, 1501 }, { 0, 0, 1498 }, { 0, 0, 1496 }, { 0, 0, 1494 }, + { 0, 0, 1493 }, { 0, 0, 1492 }, { 0, 0, 1493 }, { 0, 0, 1494 }, { 0, 0, 1496 }, + { 0, 0, 1499 }, { 0, 0, 1504 }, { 0, 0, 1509 }, { 0, 0, 1516 }, { 0, 0, 1546 }, + { 0, 0, 1608 }, { 0, 0, 1679 }, { 0, 0, 1738 }, { 0, 0, 1762 }, { 0, 0, 1754 }, + { 0, 0, 1731 }, { 0, 0, 1697 }, { 0, 0, 1657 }, { 0, 0, 1615 }, { 0, 0, 1575 }, + { 0, 0, 1541 }, { 0, 0, 1516 }, { 0, 0, 1501 }, { 0, 0, 1492 }, { 0, 0, 1487 }, + { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1486 }, + { 0, 0, 1486 }, { 0, 0, 1485 }, { 0, 0, 1485 }, { 0, 0, 1484 }, { 0, 0, 1484 }, + { 0, 0, 1484 }, { 0, 0, 1484 }, { 0, 0, 1484 }, { 0, 0, 1484 }, { 0, 0, 1484 }, + { 0, 0, 1484 }, { 0, 0, 1485 }, { 0, 0, 1485 }, { 0, 0, 1485 }, { 0, 0, 1485 }, + { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1487 }, { 0, 0, 1487 }, + { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1487 }, + { 0, 0, 1487 }, { 1, 0, 1488 }, { 1, 0, 1488 }, { 2, 0, 1488 }, { 2, 0, 1488 }, + { 3, 0, 1489 }, { 4, 0, 1489 }, { 4, 0, 1489 }, { 5, 0, 1489 }, { 6, 0, 1489 }, + { 6, 0, 1490 }, { 7, 0, 1490 }, { 8, 0, 1490 }, { 8, 0, 1490 }, { 9, 0, 1489 }, + { 10, 0, 1489 }, { 10, 0, 1489 }, { 11, 0, 1488 }, { 11, 0, 1487 }, { 11, 0, 1486 }, + { 12, 0, 1485 }, { 12, 0, 1483 }, { 12, 0, 1480 }, { 12, 0, 1478 }, { 12, 0, 1475 }, + { 12, 0, 1473 }, { 12, 0, 1470 }, { 12, 0, 1468 }, { 12, 0, 1465 }, { 12, 0, 1463 }, + { 12, 0, 1461 }, { 12, 0, 1460 }, { 11, 0, 1459 }, { 11, 0, 1459 }, { 10, 0, 1459 }, + { 10, 0, 1462 }, { 9, 0, 1465 }, { 9, 0, 1468 }, { 8, 0, 1473 }, { 6, 0, 1477 }, + { 5, 0, 1481 }, { 4, 0, 1484 }, { 2, 0, 1486 }, { 0, 0, 1487 }, { -2, 0, 1487 }, + { -5, 0, 1486 }, { -8, 0, 1485 }, { -11, 0, 1483 }, { -15, 0, 1481 }, { -19, 0, 1479 }, + { -22, 0, 1476 }, { -26, 0, 1474 }, { -30, 0, 1471 }, { -33, 0, 1469 }, { -36, 0, 1466 }, + { -40, 0, 1464 }, { -43, 0, 1462 }, { -47, 0, 1460 }, { -52, 0, 1457 }, { -55, 0, 1454 }, + { -58, 0, 1453 }, { -58, 0, 1452 }, { -57, 0, 1453 }, { -51, 0, 1457 }, { -40, 0, 1463 }, + { -27, 0, 1471 }, { -15, 0, 1479 }, { -5, 0, 1484 }, { 0, 0, 1487 }, { 1, 0, 1488 }, + { 3, 0, 1488 }, { 4, 0, 1488 }, { 5, 0, 1487 }, { 6, 0, 1487 }, { 6, 0, 1486 }, + { 6, 0, 1485 }, { 6, 0, 1484 }, { 5, 0, 1482 }, { 5, 0, 1481 }, { 4, 0, 1480 }, + { 4, 0, 1478 }, { 3, 0, 1477 }, { 2, 0, 1475 }, { 2, 0, 1474 }, { 1, 0, 1473 }, + { 0, 0, 1472 }, { 0, 0, 1471 }, { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, + { 0, 0, 1470 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, + { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1468 }, { 0, 0, 1468 }, + { 0, 0, 1468 }, { 0, 0, 1468 }, { 0, 0, 1468 }, { 0, 0, 1468 }, { 0, 0, 1468 }, + { 0, 0, 1468 }, { 0, 0, 1468 }, { 0, 0, 1468 }, { 0, 0, 1469 }, { 0, 0, 1469 }, + { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, + { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, { 0, 0, 1469 }, + { 0, 0, 1469 }, { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, + { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1470 }, + { 0, 0, 1470 }, { 0, 0, 1470 }, { 0, 0, 1469 }, { 0, 0, 1467 }, { 0, 0, 1464 }, + { 0, 0, 1460 }, { 0, 0, 1456 }, { 0, 0, 1453 }, { 0, 0, 1451 }, { 0, 0, 1450 }, + { 0, 0, 1451 }, { 0, 0, 1454 }, { 0, 0, 1460 }, { 0, 0, 1470 }, { 0, 0, 1493 }, + { 0, 0, 1533 }, { 0, 0, 1581 }, { 0, 0, 1627 }, { 0, 0, 1662 }, { 0, 0, 1676 }, + { 0, 0, 1674 }, { 0, 0, 1664 }, { 0, 0, 1650 }, { 0, 0, 1632 }, { 0, 0, 1610 }, + { 0, 0, 1588 }, { 0, 0, 1564 }, { 0, 0, 1542 }, { 0, 0, 1522 }, { 0, 0, 1506 }, + { 0, 0, 1493 }, { 0, 0, 1487 }, { 0, 0, 1484 }, { 0, 0, 1482 }, { 0, 0, 1480 }, + { 0, 0, 1477 }, { 0, 0, 1475 }, { 0, 0, 1474 }, { 0, -1, 1472 }, { -1, -1, 1471 }, + { -1, -1, 1470 }, { -1, -1, 1469 }, { -1, -2, 1468 }, { -2, -2, 1467 }, { -2, -3, 1467 }, + { -2, -3, 1466 }, { -3, -3, 1466 }, { -3, -4, 1466 }, { -3, -4, 1466 }, { -4, -5, 1466 }, + { -4, -5, 1466 }, { -4, -6, 1466 }, { -5, -6, 1467 }, { -5, -6, 1467 }, { -5, -7, 1468 }, + { -6, -7, 1469 }, { -6, -8, 1469 }, { -6, -8, 1470 }, { -6, -8, 1471 }, { -7, -9, 1472 }, + { -7, -9, 1473 }, { -7, -9, 1474 }, { -7, -9, 1475 }, { -7, -9, 1475 }, { -7, -10, 1476 }, + { -7, -10, 1477 }, { -7, -10, 1478 }, { -7, -10, 1479 }, { -7, -10, 1480 }, { -7, -10, 1481 }, + { -7, -9, 1482 }, { -7, -9, 1483 }, { -7, -9, 1484 }, { -7, -8, 1485 }, { -6, -8, 1485 }, + { -6, -8, 1486 }, { -5, -7, 1486 }, { -5, -6, 1487 }, { -4, -6, 1487 }, { -4, -5, 1488 }, + { -3, -4, 1488 }, { -2, -3, 1488 }, { -1, -2, 1488 }, { 0, -1, 1488 }, { 0, 0, 1487 }, + { 8, 11, 1484 }, { 27, 35, 1477 }, { 47, 60, 1470 }, { 57, 74, 1466 }, { 60, 78, 1465 }, + { 63, 81, 1464 }, { 65, 83, 1463 }, { 66, 85, 1463 }, { 67, 86, 1462 }, { 68, 87, 1462 }, + { 67, 87, 1462 }, { 67, 86, 1463 }, { 66, 84, 1463 }, { 64, 83, 1464 }, { 62, 80, 1464 }, + { 60, 77, 1465 }, { 57, 74, 1466 }, { 53, 68, 1468 }, { 48, 60, 1471 }, { 40, 49, 1475 }, + { 31, 36, 1479 }, { 21, 24, 1483 }, { 11, 11, 1486 }, { 0, 0, 1487 }, { -21, -14, 1485 }, + { -47, -29, 1479 }, { -56, -33, 1476 }, { -27, -13, 1476 }, { 19, 17, 1478 }, { 47, 34, 1480 }, + { 32, 21, 1483 }, { -2, -5, 1487 }, { -26, -22, 1489 }, { -24, -20, 1489 }, { -10, -8, 1488 }, + { 0, 0, 1487 }, { 2, 1, 1487 }, { 1, 1, 1487 }, { 0, 0, 1487 }, { 0, 0, 1487 }, + { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1485 }, + { 0, 0, 1485 }, { 0, 0, 1484 }, { 0, 0, 1484 }, { 0, 0, 1484 }, { 0, 0, 1484 }, + { 0, 0, 1484 }, { 0, 0, 1485 }, { 0, 0, 1486 }, { 0, 0, 1487 }, { 0, 0, 1489 }, + { 0, 0, 1492 }, { 0, 0, 1495 }, { 0, 0, 1499 }, { 0, 0, 1503 }, { 0, 0, 1507 }, + { 0, 0, 1511 }, { 0, 0, 1515 }, { 0, 0, 1519 }, { 0, 0, 1523 }, { 0, 0, 1526 }, + { 0, 0, 1529 }, { 0, 0, 1531 }, { 0, 0, 1533 }, { 0, 0, 1533 }, { 0, 0, 1532 }, + { 0, 0, 1531 }, { 0, 0, 1528 }, { 0, 0, 1524 }, { 0, 0, 1520 }, { 0, 0, 1515 }, + { 0, 0, 1510 }, { 0, 0, 1505 }, { 0, 0, 1501 }, { 0, 0, 1496 }, { 0, 0, 1493 }, + { 0, 0, 1490 }, { 0, 0, 1488 }, { 0, 0, 1487 }, { 0, 0, 1488 }, { 0, 0, 1489 }, + { 0, 0, 1492 }, { 0, 0, 1495 }, { 0, 0, 1499 }, { 0, 0, 1503 }, { 0, 0, 1508 }, + { 0, 0, 1512 }, { 0, 0, 1517 }, { 0, 0, 1521 }, { 0, 0, 1525 }, { 0, 0, 1528 }, + { 0, 0, 1531 }, { 0, 0, 1533 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1531 }, + { 0, 0, 1528 }, { 0, 0, 1524 }, { 0, 0, 1520 }, { 0, 0, 1515 }, { 0, 0, 1510 }, + { 0, 0, 1505 }, { 0, 0, 1501 }, { 0, 0, 1496 }, { 0, 0, 1493 }, { 0, 0, 1490 }, + { 0, 0, 1488 }, { 0, 0, 1487 }, { 0, 0, 1488 }, { 0, 0, 1490 }, { 0, 0, 1493 }, + { 0, 0, 1498 }, { 0, 0, 1502 }, { 0, 0, 1508 }, { 0, 0, 1513 }, { 0, 0, 1518 }, + { 0, 0, 1523 }, { 0, 0, 1527 }, { 0, 0, 1530 }, { 0, 0, 1532 }, { 0, 0, 1533 }, + { 0, 0, 1533 }, { 0, 0, 1531 }, { 0, 0, 1529 }, { 0, 0, 1526 }, { 0, 0, 1522 }, + { 0, 0, 1518 }, { 0, 0, 1514 }, { 0, 0, 1510 }, { 0, 0, 1506 }, { 0, 0, 1501 }, + { 0, 0, 1498 }, { 0, 0, 1494 }, { 0, 0, 1491 }, { 0, 0, 1489 }, { 0, 0, 1487 }, + { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1486 }, { 0, 0, 1486 }, + { 0, 0, 1487 }, { 0, 0, 1487 }, { 0, 0, 1488 }, { 0, 0, 1489 }, { 0, 0, 1491 }, + { 0, 0, 1492 }, { 0, 0, 1493 }, { 0, 0, 1495 }, { 0, 0, 1496 }, { 0, 0, 1497 }, + { 0, 0, 1499 }, { 0, 0, 1500 }, { 0, 0, 1501 }, { 0, 0, 1502 }, { 0, 0, 1504 }, + { 0, 0, 1505 }, { 0, 0, 1507 }, { 0, 0, 1508 }, { 0, 0, 1510 }, { 0, 0, 1511 }, + { 0, 0, 1513 }, { 0, 0, 1515 }, { 0, 0, 1517 }, { 0, 0, 1518 }, { 0, 0, 1520 }, + { 0, 0, 1522 }, { 0, 0, 1523 }, { 0, 0, 1525 }, { 0, 0, 1527 }, { 0, 0, 1528 }, + { 0, 0, 1530 }, { 0, 0, 1531 }, { 0, 0, 1532 }, { 0, 0, 1534 }, { 0, 0, 1535 }, + { 0, 0, 1536 }, { 0, 0, 1537 }, { 0, 0, 1538 }, { 0, 0, 1538 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1537 }, { 0, 0, 1535 }, { 0, 0, 1532 }, { 0, 0, 1529 }, + { 0, 0, 1526 }, { 0, 0, 1523 }, { 0, 0, 1520 }, { 0, 0, 1519 }, { 0, 0, 1518 }, + { 0, 0, 1518 }, { 0, 0, 1520 }, { 0, 0, 1522 }, { 0, 0, 1524 }, { 0, 0, 1527 }, + { 0, 0, 1530 }, { 0, 0, 1533 }, { 0, 0, 1535 }, { 0, 0, 1537 }, { 0, 0, 1539 }, + { 0, 0, 1540 }, { 0, 0, 1540 }, { 0, 0, 1540 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1540 }, { 0, 0, 1541 }, { 0, 0, 1542 }, + { 0, 0, 1544 }, { 0, 0, 1546 }, { 0, 0, 1548 }, { 0, 0, 1549 }, { 0, 0, 1550 }, + { 0, 0, 1551 }, { 0, 0, 1551 }, { 0, 0, 1550 }, { 0, 0, 1549 }, { 0, 0, 1547 }, + { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1537 }, { 0, 0, 1533 }, { 0, 0, 1529 }, + { 0, 0, 1526 }, { 0, 0, 1523 }, { 0, 0, 1520 }, { 0, 0, 1518 }, { 0, 0, 1516 }, + { 0, 0, 1516 }, { 0, 0, 1516 }, { 0, 0, 1517 }, { 0, 0, 1518 }, { 0, 0, 1520 }, + { 0, 0, 1521 }, { 0, 0, 1523 }, { 0, 0, 1525 }, { 0, 0, 1528 }, { 0, 0, 1530 }, + { 0, 0, 1532 }, { 0, 0, 1535 }, { 0, 0, 1538 }, { 0, 0, 1540 }, { 0, 0, 1543 }, + { 0, 0, 1545 }, { 0, 0, 1547 }, { 0, 0, 1550 }, { 0, 0, 1552 }, { 0, 0, 1553 }, + { 0, 0, 1555 }, { 0, 0, 1556 }, { 0, 0, 1557 }, { 0, 0, 1558 }, { 0, 0, 1558 }, + { 0, 0, 1559 }, { 0, 0, 1559 }, { 0, 0, 1559 }, { 0, 0, 1559 }, { 0, 0, 1559 }, + { 0, 0, 1559 }, { 0, 0, 1559 }, { 0, 0, 1558 }, { 0, 0, 1558 }, { 0, 0, 1558 }, + { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1556 }, { 0, 0, 1556 }, + { 0, 0, 1556 }, { 0, 0, 1555 }, { 0, 0, 1555 }, { 0, 0, 1554 }, { 0, 0, 1554 }, + { 0, 0, 1553 }, { 0, 0, 1552 }, { 0, 0, 1551 }, { 0, 0, 1551 }, { 0, 0, 1550 }, + { 0, 0, 1549 }, { 0, 0, 1548 }, { 0, 0, 1548 }, { 0, 0, 1547 }, { 0, 0, 1546 }, + { 0, 0, 1546 }, { 0, 0, 1545 }, { 0, 0, 1545 }, { 0, 0, 1545 }, { 0, 0, 1545 }, + { 0, 0, 1545 }, { 0, 0, 1545 }, { 0, 0, 1546 }, { 0, 0, 1547 }, { 0, 0, 1549 }, + { 0, 0, 1551 }, { 0, 0, 1553 }, { 0, 0, 1554 }, { 0, 0, 1555 }, { 0, 0, 1556 }, + { 0, 0, 1556 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, + { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, + { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1557 }, + { 0, 0, 1557 }, { 0, 0, 1557 }, { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, + { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, + { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, { 0, 0, 1556 }, + { 0, 0, 1554 }, { 0, 0, 1552 }, { 0, 0, 1550 }, { 0, 0, 1548 }, { 0, 0, 1546 }, + { 0, 0, 1543 }, { 0, 0, 1542 }, { 0, 0, 1540 }, { 0, 0, 1539 }, { 0, 0, 1539 }, +}; + +static s16 animdata_mario_cap_2[][3] = { + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1538 }, { 0, 0, 1538 }, { 0, 0, 1538 }, + { 0, 0, 1537 }, { 0, 0, 1537 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1535 }, { 0, 0, 1535 }, + { 0, 0, 1535 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, + { 0, 0, 1534 }, { 0, 0, 1535 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1539 }, + { 0, 0, 1544 }, { 0, 0, 1554 }, { 0, 0, 1566 }, { 0, 0, 1575 }, { 0, 0, 1579 }, { 0, 0, 1579 }, + { 0, 0, 1577 }, { 0, 0, 1575 }, { 0, 0, 1573 }, { 0, 0, 1570 }, { 0, 0, 1566 }, { 0, 0, 1563 }, + { 0, 0, 1559 }, { 0, 0, 1555 }, { 0, 0, 1552 }, { 0, 0, 1548 }, { 0, 0, 1545 }, { 0, 0, 1543 }, + { 0, 0, 1541 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, +}; + +struct AnimDataInfo anim_mario_cap[] = { + { ARRAY_COUNT(animdata_mario_cap_1), GD_ANIM_ROT3S, animdata_mario_cap_1 }, + { ARRAY_COUNT(animdata_mario_cap_2), GD_ANIM_ROT3S, animdata_mario_cap_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_lips_3_1[][3] = { + { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -662 }, { 0, 0, -660 }, + { -1, 0, -656 }, { -1, 0, -652 }, { -2, 0, -648 }, { -3, 1, -643 }, + { -3, 1, -638 }, { -4, 1, -634 }, { -5, 2, -629 }, { -5, 2, -625 }, + { -6, 2, -622 }, { -6, 2, -620 }, { -7, 2, -618 }, { -7, 2, -618 }, + { -6, 2, -619 }, { -6, 2, -622 }, { -5, 2, -626 }, { -4, 1, -633 }, + { -3, 1, -641 }, { -1, 0, -652 }, { 0, 0, -665 }, { 6, -1, -704 }, + { 17, -5, -781 }, { 32, -10, -874 }, { 46, -14, -966 }, { 57, -19, -1036 }, + { 63, -22, -1064 }, { 64, -25, -1061 }, { 64, -27, -1052 }, { 64, -30, -1038 }, + { 64, -33, -1019 }, { 62, -36, -996 }, { 61, -39, -970 }, { 59, -42, -941 }, + { 57, -44, -911 }, { 54, -47, -879 }, { 52, -49, -847 }, { 49, -51, -816 }, + { 46, -53, -786 }, { 44, -55, -758 }, { 41, -56, -733 }, { 39, -57, -711 }, + { 37, -57, -693 }, { 35, -56, -681 }, { 33, -56, -671 }, { 32, -54, -664 }, + { 30, -53, -657 }, { 28, -50, -652 }, { 26, -48, -648 }, { 24, -45, -645 }, + { 22, -42, -643 }, { 20, -39, -642 }, { 18, -35, -642 }, { 16, -32, -642 }, + { 14, -28, -643 }, { 12, -25, -645 }, { 10, -21, -647 }, { 8, -18, -649 }, + { 7, -14, -651 }, { 5, -11, -653 }, { 4, -8, -656 }, { 3, -6, -658 }, + { 2, -4, -660 }, { 1, -2, -662 }, { 0, -1, -663 }, { 0, 0, -664 }, + { 0, 0, -665 }, { 0, -1, -664 }, { 0, -6, -662 }, { 1, -12, -660 }, + { 1, -21, -656 }, { 2, -31, -652 }, { 3, -42, -648 }, { 3, -54, -643 }, + { 4, -65, -639 }, { 5, -76, -635 }, { 6, -85, -631 }, { 6, -94, -628 }, + { 6, -100, -625 }, { 8, -104, -623 }, { 12, -107, -621 }, { 17, -108, -619 }, + { 21, -108, -618 }, { 23, -107, -617 }, { 22, -106, -618 }, { 17, -103, -621 }, + { 6, -100, -625 }, { -19, -93, -636 }, { -63, -83, -654 }, { -111, -71, -673 }, + { -153, -61, -690 }, { -174, -55, -699 }, { -182, -54, -701 }, { -188, -53, -704 }, + { -194, -52, -706 }, { -199, -52, -707 }, { -202, -53, -708 }, { -205, -53, -709 }, + { -207, -54, -709 }, { -208, -55, -709 }, { -209, -56, -709 }, { -208, -57, -708 }, + { -207, -58, -708 }, { -204, -59, -707 }, { -201, -60, -705 }, { -198, -60, -704 }, + { -193, -59, -703 }, { -188, -59, -701 }, { -181, -57, -700 }, { -174, -55, -699 }, + { -156, -50, -695 }, { -123, -39, -688 }, { -81, -26, -680 }, { -41, -13, -673 }, + { -11, -3, -667 }, { 0, 0, -665 }, { 0, 0, -665 }, { 10, 9, -656 }, + { 23, 20, -647 }, { 36, 32, -636 }, { 49, 44, -626 }, { 63, 57, -614 }, + { 78, 69, -603 }, { 92, 82, -592 }, { 105, 94, -582 }, { 118, 105, -572 }, + { 130, 116, -562 }, { 140, 125, -554 }, { 148, 132, -548 }, { 154, 138, -543 }, + { 159, 141, -540 }, { 160, 143, -539 }, { 160, 143, -539 }, { 159, 142, -539 }, + { 158, 141, -540 }, { 157, 140, -542 }, { 156, 139, -543 }, { 154, 137, -545 }, + { 151, 135, -548 }, { 149, 133, -550 }, { 146, 130, -553 }, { 143, 128, -556 }, + { 140, 125, -559 }, { 137, 122, -563 }, { 133, 118, -566 }, { 129, 115, -570 }, + { 125, 111, -574 }, { 121, 108, -578 }, { 117, 104, -582 }, { 112, 100, -587 }, + { 108, 95, -591 }, { 103, 91, -595 }, { 98, 87, -600 }, { 93, 82, -604 }, + { 88, 78, -609 }, { 83, 74, -613 }, { 78, 69, -617 }, { 73, 64, -622 }, + { 68, 60, -626 }, { 63, 55, -630 }, { 58, 51, -634 }, { 53, 46, -638 }, + { 48, 42, -641 }, { 43, 37, -645 }, { 38, 33, -648 }, { 33, 29, -651 }, + { 29, 25, -654 }, { 24, 21, -656 }, { 20, 17, -658 }, { 15, 13, -660 }, + { 11, 9, -662 }, { 7, 6, -663 }, { 3, 3, -664 }, { 0, 0, -665 }, + { -2, -1, -652 }, { -4, 0, -621 }, { -4, 0, -586 }, { -5, 2, -559 }, + { -4, 1, -555 }, { -4, 0, -574 }, { -4, -2, -607 }, { -3, -5, -648 }, + { -2, -8, -693 }, { -1, -11, -736 }, { 0, -14, -772 }, { 0, -16, -796 }, + { 1, -17, -802 }, { 1, -16, -797 }, { 1, -15, -788 }, { 0, -14, -777 }, + { 0, -12, -763 }, { 0, -10, -747 }, { 0, -7, -729 }, { -1, -4, -709 }, + { -1, -1, -689 }, { -2, 1, -667 }, { -2, 4, -644 }, { -3, 7, -621 }, + { -4, 10, -598 }, { -4, 13, -576 }, { -5, 15, -553 }, { -5, 17, -532 }, + { -5, 19, -512 }, { -5, 20, -493 }, { -5, 20, -476 }, { -5, 20, -461 }, + { -5, 19, -448 }, { -4, 17, -438 }, { -3, 14, -430 }, { -2, 10, -427 }, + { -1, 5, -426 }, { 0, 0, -430 }, { 7, -25, -482 }, { 22, -76, -602 }, + { 39, -136, -749 }, { 51, -188, -884 }, { 53, -217, -967 }, { 46, -222, -1002 }, + { 33, -219, -1021 }, { 18, -208, -1028 }, { 0, -194, -1026 }, { -17, -177, -1019 }, + { -34, -161, -1010 }, { -49, -147, -1004 }, { -60, -138, -1002 }, { -66, -133, -1005 }, + { -70, -130, -1007 }, { -72, -129, -1008 }, { -73, -128, -1008 }, { -72, -128, -1009 }, + { -72, -128, -1009 }, { -71, -129, -1009 }, { -71, -129, -1009 }, { -71, -129, -1009 }, + { -71, -129, -1009 }, { -70, -129, -1010 }, { -70, -129, -1010 }, { -69, -128, -1011 }, + { -69, -128, -1011 }, { -68, -128, -1012 }, { -67, -129, -1013 }, { -67, -129, -1013 }, + { -66, -129, -1014 }, { -65, -129, -1014 }, { -64, -129, -1014 }, { -64, -129, -1014 }, + { -63, -130, -1014 }, { -62, -130, -1014 }, { -62, -131, -1014 }, { -61, -131, -1013 }, + { -61, -132, -1013 }, { -60, -133, -1012 }, { -60, -134, -1010 }, { -60, -135, -1009 }, + { -59, -136, -1007 }, { -59, -137, -1005 }, { -60, -138, -1002 }, { -60, -140, -999 }, + { -60, -142, -995 }, { -61, -144, -991 }, { -62, -147, -986 }, { -63, -149, -980 }, + { -64, -152, -974 }, { -65, -155, -967 }, { -66, -159, -960 }, { -67, -162, -953 }, + { -68, -165, -946 }, { -70, -169, -939 }, { -71, -172, -932 }, { -72, -175, -925 }, + { -73, -178, -918 }, { -74, -181, -912 }, { -76, -184, -906 }, { -77, -187, -900 }, + { -77, -189, -895 }, { -78, -191, -891 }, { -79, -193, -887 }, { -79, -194, -884 }, + { -80, -196, -881 }, { -80, -197, -879 }, { -81, -198, -877 }, { -81, -199, -875 }, + { -81, -199, -873 }, { -81, -200, -873 }, { -81, -200, -872 }, { -81, -200, -872 }, + { -81, -200, -873 }, { -81, -199, -875 }, { -81, -198, -877 }, { -80, -197, -880 }, + { -80, -195, -883 }, { -79, -193, -887 }, { -78, -190, -894 }, { -76, -185, -903 }, + { -74, -179, -916 }, { -72, -173, -929 }, { -69, -166, -944 }, { -67, -159, -959 }, + { -65, -152, -973 }, { -62, -146, -985 }, { -61, -142, -995 }, { -60, -138, -1002 }, + { -59, -136, -1007 }, { -58, -135, -1010 }, { -58, -134, -1011 }, { -58, -134, -1012 }, + { -58, -134, -1011 }, { -58, -135, -1010 }, { -58, -135, -1009 }, { -59, -136, -1007 }, + { -59, -137, -1005 }, { -59, -138, -1004 }, { -59, -138, -1003 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1003 }, + { -59, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, + { -59, -138, -1004 }, { -59, -139, -1004 }, { -59, -139, -1004 }, { -59, -139, -1005 }, + { -59, -139, -1005 }, { -59, -139, -1005 }, { -59, -139, -1006 }, { -59, -139, -1006 }, + { -59, -139, -1007 }, { -59, -139, -1007 }, { -58, -139, -1008 }, { -58, -139, -1008 }, + { -58, -139, -1008 }, { -58, -139, -1009 }, { -58, -139, -1009 }, { -58, -139, -1010 }, + { -58, -139, -1010 }, { -58, -140, -1011 }, { -58, -140, -1011 }, { -58, -140, -1011 }, + { -58, -140, -1012 }, { -58, -140, -1012 }, { -57, -140, -1012 }, { -57, -140, -1013 }, + { -57, -140, -1013 }, { -57, -140, -1013 }, { -57, -140, -1014 }, { -57, -140, -1014 }, + { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, + { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, + { -57, -140, -1014 }, { -57, -140, -1013 }, { -57, -140, -1013 }, { -57, -140, -1013 }, + { -58, -140, -1012 }, { -58, -140, -1012 }, { -58, -140, -1011 }, { -58, -139, -1010 }, + { -58, -139, -1010 }, { -58, -139, -1009 }, { -58, -139, -1008 }, { -59, -139, -1007 }, + { -59, -139, -1006 }, { -59, -139, -1005 }, { -59, -138, -1004 }, { -60, -138, -1002 }, + { -62, -136, -989 }, { -68, -132, -962 }, { -74, -128, -934 }, { -77, -125, -918 }, + { -78, -125, -915 }, { -78, -125, -914 }, { -78, -125, -915 }, { -77, -125, -918 }, + { -77, -126, -921 }, { -76, -126, -925 }, { -75, -127, -928 }, { -75, -127, -931 }, + { -74, -127, -932 }, { -75, -127, -930 }, { -76, -127, -926 }, { -77, -125, -918 }, + { -81, -122, -898 }, { -89, -117, -862 }, { -97, -111, -819 }, { -106, -105, -779 }, + { -112, -100, -750 }, { -114, -98, -742 }, { -113, -99, -751 }, { -110, -100, -768 }, + { -107, -102, -791 }, { -102, -105, -818 }, { -97, -108, -848 }, { -92, -111, -880 }, + { -86, -114, -911 }, { -81, -117, -940 }, { -77, -121, -966 }, { -74, -124, -987 }, + { -72, -126, -1002 }, { -71, -129, -1009 }, { -72, -131, -1011 }, { -72, -132, -1011 }, + { -73, -134, -1011 }, { -74, -136, -1011 }, { -76, -138, -1009 }, { -77, -140, -1007 }, + { -79, -142, -1004 }, { -80, -143, -1000 }, { -82, -145, -996 }, { -84, -147, -991 }, + { -86, -148, -986 }, { -88, -150, -980 }, { -90, -152, -974 }, { -93, -154, -968 }, + { -95, -155, -961 }, { -97, -157, -954 }, { -100, -158, -947 }, { -102, -160, -940 }, + { -104, -162, -933 }, { -107, -163, -925 }, { -109, -165, -918 }, { -111, -167, -911 }, + { -113, -169, -904 }, { -115, -170, -897 }, { -117, -172, -891 }, { -119, -174, -884 }, + { -121, -175, -878 }, { -123, -177, -873 }, { -124, -179, -868 }, { -126, -181, -863 }, + { -127, -183, -859 }, { -128, -185, -855 }, { -129, -187, -852 }, { -129, -189, -850 }, + { -130, -191, -849 }, { -130, -193, -848 }, { -130, -195, -847 }, { -130, -197, -847 }, + { -130, -200, -846 }, { -130, -203, -846 }, { -130, -205, -847 }, { -129, -208, -847 }, + { -129, -211, -848 }, { -128, -214, -849 }, { -128, -217, -850 }, { -127, -221, -851 }, + { -126, -224, -852 }, { -126, -227, -854 }, { -125, -230, -856 }, { -124, -234, -857 }, + { -123, -237, -859 }, { -122, -240, -861 }, { -121, -243, -864 }, { -120, -247, -866 }, + { -119, -250, -868 }, { -118, -253, -871 }, { -116, -256, -873 }, { -115, -259, -876 }, + { -114, -262, -878 }, { -113, -265, -881 }, { -111, -267, -884 }, { -110, -270, -887 }, + { -109, -272, -889 }, { -108, -274, -892 }, { -106, -277, -895 }, { -105, -278, -898 }, + { -104, -280, -900 }, { -103, -282, -903 }, { -102, -283, -905 }, { -100, -284, -908 }, + { -99, -285, -910 }, { -98, -286, -913 }, { -97, -286, -915 }, { -96, -286, -917 }, + { -95, -286, -919 }, { -94, -286, -921 }, { -93, -285, -923 }, { -93, -282, -925 }, + { -92, -276, -928 }, { -90, -266, -932 }, { -89, -254, -935 }, { -88, -240, -939 }, + { -87, -225, -942 }, { -86, -210, -945 }, { -85, -194, -948 }, { -85, -180, -950 }, + { -84, -167, -951 }, { -84, -156, -951 }, { -84, -148, -950 }, { -85, -144, -947 }, + { -90, -166, -926 }, { -100, -213, -890 }, { -105, -241, -868 }, { -107, -246, -864 }, + { -110, -250, -862 }, { -113, -252, -860 }, { -116, -253, -859 }, { -120, -253, -859 }, + { -123, -253, -859 }, { -125, -252, -860 }, { -127, -250, -862 }, { -128, -248, -863 }, + { -127, -246, -865 }, { -125, -244, -866 }, { -121, -243, -867 }, { -114, -242, -868 }, + { -105, -241, -868 }, { -93, -241, -868 }, { -75, -241, -868 }, { -55, -241, -868 }, + { -31, -241, -868 }, { -5, -241, -868 }, { 21, -241, -868 }, { 48, -241, -868 }, + { 75, -241, -868 }, { 102, -241, -868 }, { 126, -241, -868 }, { 147, -241, -868 }, + { 166, -241, -868 }, { 179, -241, -868 }, { 188, -241, -868 }, { 192, -241, -868 }, + { 187, -241, -868 }, { 175, -241, -868 }, { 156, -241, -868 }, { 133, -241, -868 }, + { 105, -241, -868 }, { 74, -241, -868 }, { 43, -241, -868 }, { 11, -241, -868 }, + { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, { -89, -241, -868 }, + { -101, -241, -868 }, { -105, -241, -868 }, { -102, -241, -868 }, { -91, -241, -868 }, + { -74, -241, -868 }, { -53, -241, -868 }, { -28, -241, -868 }, { 0, -241, -868 }, + { 28, -241, -868 }, { 57, -241, -868 }, { 87, -241, -868 }, { 114, -241, -868 }, + { 139, -241, -868 }, { 161, -241, -868 }, { 177, -241, -868 }, { 188, -241, -868 }, + { 192, -241, -868 }, { 187, -241, -868 }, { 175, -241, -868 }, { 156, -241, -868 }, + { 133, -241, -868 }, { 105, -241, -868 }, { 74, -241, -868 }, { 43, -241, -868 }, + { 11, -241, -868 }, { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, + { -89, -241, -868 }, { -101, -241, -868 }, { -105, -241, -868 }, { -100, -241, -868 }, + { -86, -241, -868 }, { -65, -241, -868 }, { -38, -241, -868 }, { -7, -241, -868 }, + { 25, -241, -868 }, { 60, -241, -868 }, { 93, -241, -868 }, { 124, -241, -868 }, + { 151, -241, -868 }, { 173, -241, -868 }, { 187, -241, -868 }, { 192, -241, -868 }, + { 188, -242, -869 }, { 178, -242, -869 }, { 162, -243, -870 }, { 142, -245, -871 }, + { 118, -246, -872 }, { 91, -247, -873 }, { 63, -248, -874 }, { 34, -250, -875 }, + { 5, -250, -876 }, { -21, -250, -876 }, { -46, -250, -876 }, { -68, -249, -875 }, + { -86, -248, -874 }, { -99, -245, -871 }, { -105, -241, -868 }, { -108, -237, -865 }, + { -111, -233, -861 }, { -113, -229, -858 }, { -114, -224, -854 }, { -115, -219, -850 }, + { -116, -214, -845 }, { -116, -209, -841 }, { -116, -204, -837 }, { -115, -198, -832 }, + { -114, -193, -828 }, { -113, -187, -823 }, { -111, -182, -818 }, { -109, -176, -813 }, + { -107, -170, -808 }, { -105, -164, -803 }, { -102, -158, -798 }, { -99, -152, -793 }, + { -96, -146, -788 }, { -92, -140, -783 }, { -89, -134, -778 }, { -85, -128, -773 }, + { -81, -122, -768 }, { -78, -116, -762 }, { -73, -110, -757 }, { -69, -103, -752 }, + { -65, -97, -747 }, { -61, -91, -742 }, { -57, -85, -737 }, { -53, -79, -732 }, + { -48, -74, -727 }, { -44, -68, -722 }, { -40, -62, -717 }, { -36, -57, -713 }, + { -32, -51, -708 }, { -28, -46, -703 }, { -24, -40, -699 }, { -21, -35, -695 }, + { -17, -30, -690 }, { -14, -25, -686 }, { -11, -21, -682 }, { -8, -16, -678 }, + { -6, -12, -675 }, { -3, -7, -671 }, { -1, -3, -668 }, { 0, 0, -665 }, + { 1, 3, -662 }, { 2, 7, -659 }, { 3, 10, -656 }, { 4, 13, -654 }, + { 4, 15, -653 }, { 4, 18, -651 }, { 4, 20, -650 }, { 3, 21, -649 }, + { 3, 22, -648 }, { 2, 23, -648 }, { 2, 23, -648 }, { 1, 23, -649 }, + { 1, 22, -649 }, { 0, 21, -650 }, { 0, 19, -652 }, { 0, 16, -654 }, + { 0, 13, -656 }, { 0, 9, -658 }, { 0, 5, -661 }, { 0, 0, -665 }, + { 0, -7, -669 }, { 2, -16, -677 }, { 3, -29, -686 }, { 5, -43, -697 }, + { 6, -59, -709 }, { 8, -76, -721 }, { 10, -95, -733 }, { 12, -114, -745 }, + { 14, -134, -756 }, { 15, -155, -765 }, { 17, -175, -772 }, { 18, -198, -778 }, + { 19, -227, -782 }, { 20, -259, -786 }, { 22, -292, -788 }, { 22, -324, -790 }, + { 23, -353, -790 }, { 24, -376, -790 }, { 24, -392, -789 }, { 23, -398, -788 }, + { 22, -398, -785 }, { 21, -396, -782 }, { 20, -394, -779 }, { 19, -390, -775 }, + { 18, -385, -771 }, { 16, -379, -766 }, { 14, -373, -762 }, { 13, -365, -757 }, + { 11, -357, -752 }, { 9, -348, -747 }, { 7, -339, -741 }, { 6, -330, -736 }, + { 4, -319, -731 }, { 2, -309, -726 }, { 1, -299, -722 }, { 0, -288, -717 }, + { -1, -277, -713 }, { -3, -266, -709 }, { -4, -256, -706 }, { -5, -246, -703 }, + { -6, -235, -701 }, { -6, -226, -699 }, { -7, -217, -698 }, { -7, -208, -698 }, + { -7, -200, -698 }, { -6, -192, -700 }, { -4, -185, -705 }, { 0, -179, -718 }, + { 7, -172, -735 }, { 15, -166, -756 }, { 23, -161, -778 }, { 31, -157, -800 }, + { 37, -154, -820 }, { 41, -153, -837 }, { 42, -154, -849 }, { 32, -164, -848 }, + { 11, -184, -836 }, { -9, -204, -820 }, { -23, -215, -809 }, { -24, -210, -806 }, + { -19, -196, -807 }, { -11, -181, -807 }, { -6, -171, -803 }, { -5, -169, -790 }, + { -4, -173, -770 }, { -5, -177, -753 }, { -5, -181, -736 }, { -6, -186, -719 }, + { -6, -191, -706 }, { -6, -192, -700 }, { -6, -193, -699 }, { -6, -193, -698 }, + { -6, -193, -697 }, { -6, -193, -697 }, { -6, -194, -696 }, { -6, -194, -696 }, + { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -694 }, { -7, -194, -694 }, + { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, + { -7, -194, -693 }, { -7, -195, -693 }, { -7, -195, -693 }, { -7, -195, -692 }, + { -7, -195, -693 }, { -7, -195, -693 }, { -7, -195, -693 }, { -7, -194, -693 }, + { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, + { -7, -194, -694 }, { -7, -194, -694 }, { -7, -194, -694 }, { -6, -194, -694 }, + { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, + { -6, -194, -696 }, { -6, -194, -696 }, { -6, -193, -696 }, { -6, -193, -697 }, + { -6, -193, -697 }, { -6, -193, -697 }, { -6, -193, -697 }, { -6, -193, -698 }, + { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -699 }, + { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, + { -6, -193, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, + { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, + { -6, -196, -701 }, { -6, -192, -700 }, { -6, -174, -696 }, { -5, -152, -692 }, + { -4, -127, -688 }, { -3, -101, -683 }, { -2, -76, -679 }, { -1, -52, -674 }, + { 0, -31, -670 }, { 0, -14, -667 }, { 0, -3, -665 }, { 0, 0, -665 }, +}; + +static s16 animdata_mario_lips_3_2[][3] = { + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -129, -669 }, { -267, -131, -668 }, { -265, -134, -666 }, + { -262, -139, -664 }, { -259, -144, -661 }, { -254, -150, -658 }, { -250, -156, -655 }, + { -245, -163, -651 }, { -239, -171, -647 }, { -234, -178, -643 }, { -228, -186, -639 }, + { -223, -194, -635 }, { -217, -202, -631 }, { -211, -209, -627 }, { -206, -216, -624 }, + { -201, -222, -620 }, { -197, -228, -617 }, { -190, -225, -617 }, { -190, -224, -617 }, + { -190, -224, -617 }, { -190, -224, -617 }, { -190, -225, -617 }, { -190, -225, -617 }, + { -191, -225, -617 }, { -191, -225, -616 }, { -191, -225, -616 }, { -191, -225, -616 }, + { -192, -225, -615 }, { -192, -225, -615 }, { -192, -225, -615 }, { -193, -226, -614 }, + { -193, -226, -614 }, { -193, -226, -613 }, { -194, -226, -613 }, { -194, -227, -612 }, + { -195, -227, -612 }, { -195, -227, -611 }, { -196, -227, -611 }, { -196, -227, -610 }, + { -197, -228, -610 }, { -197, -228, -609 }, { -198, -228, -609 }, { -198, -229, -608 }, + { -199, -229, -608 }, { -199, -229, -607 }, { -200, -229, -607 }, { -200, -230, -606 }, + { -201, -230, -606 }, { -201, -230, -605 }, { -202, -230, -605 }, { -202, -230, -604 }, + { -203, -231, -604 }, { -203, -231, -603 }, { -203, -231, -603 }, { -204, -231, -603 }, + { -204, -231, -603 }, { -204, -231, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, + { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, + { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, + { -205, -232, -602 }, { -204, -232, -603 }, { -204, -231, -603 }, { -204, -231, -603 }, + { -203, -231, -604 }, { -203, -231, -604 }, { -202, -230, -605 }, { -201, -230, -606 }, + { -201, -230, -607 }, { -200, -229, -608 }, { -199, -229, -608 }, { -198, -228, -609 }, + { -197, -228, -611 }, { -196, -227, -612 }, { -194, -227, -613 }, { -193, -226, -614 }, + { -192, -225, -616 }, { -190, -225, -617 }, { -186, -223, -622 }, { -177, -219, -632 }, + { -165, -215, -646 }, { -151, -209, -662 }, { -135, -202, -679 }, { -119, -194, -697 }, + { -103, -187, -713 }, { -89, -179, -727 }, { -78, -172, -736 }, { -70, -165, -741 }, + { -65, -159, -742 }, { -60, -152, -742 }, { -55, -145, -741 }, { -50, -137, -740 }, + { -46, -129, -738 }, { -42, -121, -735 }, { -38, -112, -732 }, { -34, -104, -729 }, + { -30, -95, -725 }, { -27, -87, -721 }, { -23, -79, -716 }, { -20, -70, -712 }, + { -18, -62, -707 }, { -15, -54, -702 }, { -12, -47, -697 }, { -10, -39, -693 }, + { -8, -33, -688 }, { -6, -26, -684 }, { -5, -20, -680 }, { -3, -15, -676 }, + { -2, -11, -673 }, { -1, -7, -670 }, { 0, -4, -668 }, { 0, -1, -666 }, + { 0, 0, -665 }, { 0, 0, -665 }, +}; + +struct AnimDataInfo anim_mario_lips_3[] = { + { ARRAY_COUNT(animdata_mario_lips_3_1), GD_ANIM_ROT3S, animdata_mario_lips_3_1 }, + { ARRAY_COUNT(animdata_mario_lips_3_2), GD_ANIM_ROT3S, animdata_mario_lips_3_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_lips_4_1[][3] = { + { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -663 }, { 0, 0, -661 }, + { 0, 0, -659 }, { 0, 0, -656 }, { 0, 0, -653 }, { 0, 0, -650 }, + { 0, 0, -647 }, { 0, 0, -644 }, { 0, 0, -641 }, { 0, 0, -638 }, + { 0, 0, -636 }, { 0, 0, -634 }, { 0, 0, -633 }, { 0, 0, -633 }, + { 0, 0, -634 }, { 0, 0, -636 }, { 0, 0, -639 }, { 0, 0, -643 }, + { 0, 0, -649 }, { 0, 0, -656 }, { 0, 0, -665 }, { 0, 0, -692 }, + { 0, 2, -744 }, { 0, 3, -808 }, { 1, 5, -871 }, { 1, 6, -917 }, + { 2, 7, -934 }, { 2, 7, -929 }, { 2, 7, -919 }, { 3, 7, -906 }, + { 3, 7, -889 }, { 3, 7, -869 }, { 3, 7, -847 }, { 4, 7, -823 }, + { 4, 7, -798 }, { 4, 6, -772 }, { 4, 6, -746 }, { 5, 6, -721 }, + { 5, 6, -696 }, { 5, 5, -672 }, { 5, 5, -650 }, { 5, 5, -631 }, + { 5, 5, -614 }, { 6, 5, -602 }, { 6, 5, -593 }, { 6, 5, -587 }, + { 6, 6, -585 }, { 6, 7, -586 }, { 6, 8, -588 }, { 6, 9, -592 }, + { 6, 9, -596 }, { 6, 10, -601 }, { 6, 10, -605 }, { 6, 10, -607 }, + { 6, 9, -608 }, { 6, 7, -606 }, { 6, 5, -602 }, { 6, 0, -590 }, + { 6, -7, -570 }, { 6, -16, -546 }, { 7, -26, -520 }, { 7, -36, -496 }, + { 7, -45, -477 }, { 7, -51, -465 }, { 7, -53, -465 }, { 3, -27, -566 }, + { 0, 0, -665 }, { 0, 0, -649 }, { 2, 1, -620 }, { 6, 5, -602 }, + { 10, 10, -597 }, { 15, 17, -595 }, { 20, 24, -594 }, { 25, 32, -595 }, + { 30, 39, -596 }, { 35, 46, -598 }, { 39, 52, -599 }, { 43, 58, -600 }, + { 46, 62, -601 }, { 48, 65, -601 }, { 48, 67, -602 }, { 48, 68, -602 }, + { 48, 69, -603 }, { 47, 69, -603 }, { 46, 67, -603 }, { 46, 65, -602 }, + { 46, 62, -601 }, { 46, 55, -597 }, { 47, 43, -591 }, { 48, 30, -585 }, + { 48, 20, -579 }, { 49, 14, -576 }, { 49, 12, -575 }, { 49, 11, -574 }, + { 50, 10, -572 }, { 50, 9, -571 }, { 51, 9, -570 }, { 52, 9, -568 }, + { 52, 9, -567 }, { 53, 10, -566 }, { 53, 10, -565 }, { 54, 11, -565 }, + { 54, 12, -565 }, { 54, 13, -565 }, { 54, 13, -565 }, { 54, 14, -566 }, + { 53, 14, -568 }, { 52, 14, -570 }, { 50, 14, -573 }, { 49, 14, -576 }, + { 43, 12, -585 }, { 34, 10, -602 }, { 22, 6, -623 }, { 11, 3, -643 }, + { 3, 0, -659 }, { 0, 0, -665 }, { 0, 0, -665 }, { -14, 0, -665 }, + { -29, 0, -665 }, { -46, 0, -665 }, { -64, 0, -665 }, { -82, 0, -665 }, + { -100, 0, -665 }, { -118, 0, -665 }, { -136, 0, -665 }, { -152, 0, -665 }, + { -167, 0, -665 }, { -180, 0, -665 }, { -191, 0, -665 }, { -199, 0, -665 }, + { -204, 0, -665 }, { -206, 0, -665 }, { -206, 0, -665 }, { -205, 0, -665 }, + { -204, 0, -665 }, { -202, 0, -666 }, { -200, 0, -666 }, { -198, 0, -667 }, + { -195, 0, -668 }, { -192, 0, -668 }, { -188, 0, -669 }, { -185, 0, -670 }, + { -181, 0, -671 }, { -176, 0, -672 }, { -172, 0, -673 }, { -167, 0, -674 }, + { -161, 0, -675 }, { -156, 0, -676 }, { -151, 0, -677 }, { -145, 0, -678 }, + { -139, 0, -679 }, { -133, 0, -680 }, { -127, 0, -681 }, { -120, 0, -681 }, + { -114, 0, -682 }, { -108, 0, -682 }, { -101, 0, -683 }, { -95, 0, -683 }, + { -88, 0, -683 }, { -81, 0, -683 }, { -75, 0, -683 }, { -68, 0, -683 }, + { -62, 0, -683 }, { -56, 0, -682 }, { -49, 0, -681 }, { -43, 0, -680 }, + { -37, 0, -679 }, { -31, 0, -678 }, { -25, 0, -676 }, { -20, 0, -675 }, + { -14, 0, -672 }, { -9, 0, -670 }, { -4, 0, -667 }, { 0, 0, -665 }, + { 3, -1, -647 }, { 5, -3, -609 }, { 7, -4, -566 }, { 7, -4, -532 }, + { 7, 0, -522 }, { 6, 6, -537 }, { 4, 17, -565 }, { 2, 30, -602 }, + { 0, 42, -643 }, { -1, 55, -682 }, { -3, 65, -716 }, { -5, 72, -739 }, + { -5, 74, -745 }, { -6, 73, -741 }, { -5, 71, -733 }, { -5, 67, -724 }, + { -4, 64, -711 }, { -3, 59, -697 }, { -2, 54, -681 }, { -1, 48, -664 }, + { 0, 42, -645 }, { 1, 35, -626 }, { 3, 28, -606 }, { 4, 22, -586 }, + { 5, 15, -565 }, { 6, 8, -545 }, { 7, 2, -526 }, { 8, -3, -507 }, + { 9, -8, -489 }, { 9, -13, -473 }, { 9, -17, -458 }, { 9, -20, -445 }, + { 8, -23, -435 }, { 7, -24, -426 }, { 5, -24, -421 }, { 3, -23, -419 }, + { 0, -20, -419 }, { -2, -16, -424 }, { -17, 8, -474 }, { -45, 64, -587 }, + { -78, 130, -727 }, { -106, 187, -856 }, { -117, 218, -937 }, { -113, 222, -973 }, + { -102, 216, -996 }, { -86, 203, -1007 }, { -68, 185, -1010 }, { -48, 165, -1008 }, + { -29, 145, -1005 }, { -13, 128, -1003 }, { -2, 117, -1005 }, { 4, 111, -1009 }, + { 8, 107, -1012 }, { 10, 104, -1014 }, { 10, 103, -1015 }, { 9, 103, -1016 }, + { 9, 103, -1016 }, { 8, 104, -1016 }, { 8, 104, -1016 }, { 8, 104, -1016 }, + { 7, 103, -1017 }, { 7, 103, -1017 }, { 6, 103, -1018 }, { 6, 103, -1018 }, + { 5, 102, -1019 }, { 4, 102, -1020 }, { 3, 102, -1020 }, { 2, 102, -1021 }, + { 1, 102, -1022 }, { 0, 102, -1022 }, { 0, 102, -1022 }, { 0, 102, -1022 }, + { -1, 102, -1022 }, { -2, 103, -1022 }, { -2, 104, -1022 }, { -3, 105, -1021 }, + { -3, 106, -1020 }, { -4, 107, -1018 }, { -4, 108, -1016 }, { -4, 110, -1014 }, + { -3, 112, -1011 }, { -3, 114, -1008 }, { -2, 117, -1005 }, { -1, 120, -1000 }, + { 0, 124, -995 }, { 1, 128, -989 }, { 3, 133, -981 }, { 6, 139, -973 }, + { 8, 144, -965 }, { 11, 151, -956 }, { 14, 157, -946 }, { 17, 164, -936 }, + { 20, 170, -927 }, { 23, 177, -917 }, { 27, 184, -907 }, { 30, 190, -897 }, + { 33, 197, -888 }, { 36, 203, -879 }, { 38, 208, -870 }, { 41, 213, -863 }, + { 43, 218, -856 }, { 45, 222, -849 }, { 46, 226, -844 }, { 48, 229, -840 }, + { 49, 231, -836 }, { 50, 234, -832 }, { 51, 236, -829 }, { 52, 237, -827 }, + { 52, 239, -825 }, { 53, 240, -824 }, { 53, 240, -824 }, { 53, 240, -824 }, + { 52, 239, -825 }, { 52, 238, -827 }, { 51, 236, -830 }, { 50, 233, -834 }, + { 48, 230, -838 }, { 46, 226, -844 }, { 44, 220, -853 }, { 39, 210, -867 }, + { 34, 199, -884 }, { 28, 186, -903 }, { 22, 172, -923 }, { 16, 158, -944 }, + { 10, 145, -963 }, { 4, 133, -981 }, { 0, 124, -995 }, { -2, 117, -1005 }, + { -4, 113, -1011 }, { -5, 110, -1015 }, { -6, 109, -1017 }, { -6, 108, -1018 }, + { -6, 109, -1017 }, { -5, 110, -1016 }, { -5, 111, -1014 }, { -4, 113, -1011 }, + { -3, 114, -1009 }, { -3, 116, -1007 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1006 }, { -2, 117, -1006 }, + { -2, 117, -1006 }, { -2, 117, -1007 }, { -2, 117, -1007 }, { -3, 117, -1007 }, + { -3, 117, -1008 }, { -3, 117, -1008 }, { -3, 117, -1009 }, { -3, 117, -1009 }, + { -3, 117, -1010 }, { -3, 117, -1010 }, { -3, 117, -1011 }, { -3, 117, -1011 }, + { -3, 117, -1012 }, { -3, 117, -1012 }, { -4, 117, -1013 }, { -4, 117, -1013 }, + { -4, 117, -1014 }, { -4, 117, -1014 }, { -4, 117, -1015 }, { -4, 117, -1015 }, + { -4, 117, -1015 }, { -4, 117, -1016 }, { -4, 117, -1016 }, { -4, 117, -1017 }, + { -4, 117, -1017 }, { -4, 118, -1017 }, { -4, 118, -1017 }, { -5, 118, -1018 }, + { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, + { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, + { -4, 118, -1018 }, { -4, 118, -1017 }, { -4, 117, -1017 }, { -4, 117, -1016 }, + { -4, 117, -1016 }, { -4, 117, -1015 }, { -4, 117, -1015 }, { -4, 117, -1014 }, + { -4, 117, -1013 }, { -3, 117, -1012 }, { -3, 117, -1011 }, { -3, 117, -1010 }, + { -3, 117, -1009 }, { -3, 117, -1008 }, { -2, 117, -1006 }, { -2, 117, -1005 }, + { 0, 116, -990 }, { 6, 115, -959 }, { 12, 113, -927 }, { 16, 112, -909 }, + { 17, 112, -904 }, { 17, 112, -903 }, { 17, 112, -905 }, { 16, 112, -908 }, + { 15, 113, -912 }, { 14, 113, -916 }, { 14, 113, -920 }, { 13, 113, -923 }, + { 13, 113, -924 }, { 13, 113, -922 }, { 14, 113, -918 }, { 16, 112, -909 }, + { 20, 111, -885 }, { 28, 110, -844 }, { 38, 108, -795 }, { 46, 106, -749 }, + { 53, 104, -717 }, { 55, 103, -707 }, { 54, 102, -718 }, { 51, 102, -737 }, + { 47, 101, -763 }, { 43, 101, -793 }, { 37, 100, -827 }, { 32, 100, -863 }, + { 26, 100, -898 }, { 21, 100, -932 }, { 16, 100, -962 }, { 12, 101, -988 }, + { 9, 102, -1006 }, { 8, 104, -1016 }, { 8, 106, -1020 }, { 8, 108, -1024 }, + { 8, 110, -1027 }, { 8, 112, -1029 }, { 8, 114, -1031 }, { 9, 116, -1031 }, + { 9, 118, -1032 }, { 10, 121, -1031 }, { 11, 123, -1030 }, { 12, 125, -1028 }, + { 13, 128, -1026 }, { 14, 130, -1024 }, { 15, 133, -1021 }, { 17, 135, -1017 }, + { 18, 138, -1014 }, { 19, 141, -1010 }, { 20, 143, -1006 }, { 22, 146, -1002 }, + { 23, 148, -998 }, { 24, 151, -993 }, { 26, 154, -989 }, { 27, 157, -984 }, + { 28, 159, -980 }, { 30, 162, -976 }, { 31, 165, -971 }, { 32, 167, -967 }, + { 33, 170, -964 }, { 34, 173, -960 }, { 35, 176, -957 }, { 36, 178, -954 }, + { 36, 181, -952 }, { 37, 184, -950 }, { 37, 186, -948 }, { 37, 189, -947 }, + { 38, 192, -947 }, { 37, 194, -947 }, { 37, 197, -947 }, { 37, 200, -948 }, + { 37, 202, -948 }, { 37, 205, -949 }, { 36, 208, -950 }, { 36, 211, -951 }, + { 36, 214, -952 }, { 35, 216, -953 }, { 34, 219, -954 }, { 34, 222, -956 }, + { 33, 225, -957 }, { 33, 228, -959 }, { 32, 231, -960 }, { 31, 234, -962 }, + { 30, 237, -964 }, { 29, 240, -966 }, { 29, 243, -968 }, { 28, 246, -970 }, + { 27, 248, -972 }, { 26, 251, -974 }, { 25, 254, -976 }, { 24, 257, -978 }, + { 23, 260, -980 }, { 22, 263, -982 }, { 22, 266, -984 }, { 21, 268, -986 }, + { 20, 271, -988 }, { 19, 274, -990 }, { 18, 276, -992 }, { 17, 279, -994 }, + { 16, 282, -996 }, { 15, 284, -998 }, { 15, 287, -1000 }, { 14, 289, -1002 }, + { 13, 291, -1004 }, { 12, 294, -1005 }, { 12, 296, -1007 }, { 11, 298, -1008 }, + { 10, 300, -1010 }, { 10, 302, -1011 }, { 9, 304, -1012 }, { 9, 306, -1013 }, + { 9, 307, -1014 }, { 8, 308, -1015 }, { 8, 309, -1015 }, { 8, 309, -1015 }, + { 8, 309, -1015 }, { 8, 308, -1015 }, { 8, 308, -1015 }, { 9, 308, -1014 }, + { 9, 307, -1014 }, { 9, 306, -1014 }, { 9, 306, -1013 }, { 9, 305, -1013 }, + { 9, 305, -1013 }, { 9, 304, -1012 }, { 9, 304, -1012 }, { 10, 304, -1012 }, + { 12, 304, -1013 }, { 14, 304, -1013 }, { 17, 305, -1013 }, { 20, 305, -1013 }, + { 23, 305, -1013 }, { 26, 305, -1013 }, { 28, 305, -1014 }, { 29, 305, -1014 }, + { 28, 305, -1014 }, { 27, 305, -1014 }, { 23, 305, -1013 }, { 17, 305, -1013 }, + { 9, 304, -1012 }, { -1, 304, -1012 }, { -17, 303, -1011 }, { -36, 302, -1009 }, + { -57, 300, -1008 }, { -80, 299, -1006 }, { -105, 298, -1005 }, { -130, 296, -1003 }, + { -154, 295, -1001 }, { -178, 294, -1000 }, { -200, 293, -998 }, { -220, 292, -997 }, + { -236, 291, -996 }, { -249, 290, -995 }, { -257, 290, -994 }, { -260, 289, -994 }, + { -256, 290, -994 }, { -245, 290, -995 }, { -228, 291, -996 }, { -206, 292, -998 }, + { -181, 294, -999 }, { -153, 295, -1001 }, { -125, 297, -1003 }, { -96, 298, -1005 }, + { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, { -5, 303, -1011 }, + { 5, 304, -1012 }, { 9, 304, -1012 }, { 6, 304, -1012 }, { -3, 303, -1011 }, + { -18, 303, -1010 }, { -37, 302, -1009 }, { -60, 300, -1008 }, { -85, 299, -1006 }, + { -111, 298, -1004 }, { -138, 296, -1002 }, { -165, 295, -1001 }, { -190, 293, -999 }, + { -212, 292, -997 }, { -232, 291, -996 }, { -246, 290, -995 }, { -256, 290, -994 }, + { -260, 289, -994 }, { -256, 290, -994 }, { -245, 290, -995 }, { -228, 291, -996 }, + { -206, 292, -998 }, { -181, 294, -999 }, { -153, 295, -1001 }, { -125, 297, -1003 }, + { -96, 298, -1005 }, { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, + { -5, 303, -1011 }, { 5, 304, -1012 }, { 9, 304, -1012 }, { 5, 304, -1012 }, + { -7, 303, -1011 }, { -26, 302, -1010 }, { -51, 301, -1008 }, { -79, 299, -1006 }, + { -109, 298, -1004 }, { -140, 296, -1002 }, { -171, 294, -1000 }, { -199, 293, -998 }, + { -223, 291, -997 }, { -242, 290, -995 }, { -255, 290, -994 }, { -260, 289, -994 }, + { -256, 290, -995 }, { -247, 291, -996 }, { -234, 293, -999 }, { -216, 296, -1002 }, + { -194, 299, -1005 }, { -171, 302, -1008 }, { -146, 304, -1012 }, { -120, 307, -1015 }, + { -94, 309, -1018 }, { -69, 311, -1020 }, { -46, 312, -1021 }, { -26, 312, -1021 }, + { -9, 311, -1020 }, { 2, 308, -1017 }, { 9, 304, -1012 }, { 13, 299, -1007 }, + { 17, 294, -1001 }, { 21, 289, -995 }, { 24, 283, -988 }, { 26, 277, -981 }, + { 29, 271, -974 }, { 30, 265, -967 }, { 32, 258, -960 }, { 33, 251, -952 }, + { 35, 245, -944 }, { 35, 238, -937 }, { 36, 231, -928 }, { 36, 223, -920 }, + { 36, 216, -912 }, { 36, 209, -903 }, { 36, 201, -895 }, { 35, 194, -886 }, + { 35, 186, -877 }, { 34, 178, -869 }, { 33, 170, -860 }, { 32, 163, -851 }, + { 30, 155, -842 }, { 29, 147, -833 }, { 27, 139, -824 }, { 26, 132, -816 }, + { 24, 124, -807 }, { 23, 116, -798 }, { 21, 109, -789 }, { 19, 101, -781 }, + { 17, 94, -772 }, { 16, 86, -764 }, { 14, 79, -755 }, { 12, 72, -747 }, + { 11, 65, -739 }, { 9, 58, -731 }, { 7, 51, -724 }, { 6, 45, -716 }, + { 5, 38, -709 }, { 3, 32, -702 }, { 2, 26, -695 }, { 1, 20, -688 }, + { 1, 15, -682 }, { 0, 9, -676 }, { 0, 4, -670 }, { 0, 0, -665 }, + { 0, -4, -660 }, { 0, -8, -655 }, { 0, -11, -652 }, { 0, -14, -649 }, + { 0, -16, -647 }, { 0, -17, -646 }, { 0, -19, -645 }, { 0, -19, -644 }, + { 0, -20, -644 }, { 0, -19, -645 }, { 0, -19, -646 }, { 0, -18, -647 }, + { 0, -17, -648 }, { 0, -15, -650 }, { 0, -13, -652 }, { 0, -11, -654 }, + { 0, -8, -657 }, { 0, -6, -659 }, { 0, -3, -662 }, { 0, 0, -665 }, + { 0, 3, -668 }, { -1, 8, -673 }, { -1, 13, -679 }, { -2, 20, -685 }, + { -3, 27, -693 }, { -4, 36, -701 }, { -6, 46, -710 }, { -7, 58, -719 }, + { -9, 71, -728 }, { -11, 85, -737 }, { -14, 102, -746 }, { -18, 123, -756 }, + { -23, 152, -770 }, { -30, 186, -784 }, { -37, 221, -799 }, { -44, 256, -813 }, + { -50, 289, -825 }, { -54, 316, -834 }, { -56, 335, -838 }, { -54, 344, -836 }, + { -51, 346, -830 }, { -47, 347, -823 }, { -42, 346, -815 }, { -37, 345, -806 }, + { -31, 342, -796 }, { -25, 339, -785 }, { -19, 334, -773 }, { -12, 329, -761 }, + { -6, 324, -748 }, { 0, 317, -735 }, { 7, 310, -722 }, { 15, 303, -709 }, + { 22, 295, -695 }, { 29, 287, -682 }, { 36, 279, -669 }, { 43, 271, -656 }, + { 50, 262, -644 }, { 57, 254, -632 }, { 63, 245, -621 }, { 69, 237, -611 }, + { 75, 229, -601 }, { 80, 222, -593 }, { 85, 215, -586 }, { 90, 208, -580 }, + { 93, 202, -576 }, { 97, 197, -573 }, { 97, 192, -577 }, { 94, 188, -591 }, + { 89, 184, -613 }, { 81, 181, -641 }, { 72, 178, -671 }, { 63, 175, -701 }, + { 55, 173, -728 }, { 48, 170, -750 }, { 44, 167, -765 }, { 46, 165, -759 }, + { 53, 163, -734 }, { 60, 162, -709 }, { 61, 162, -706 }, { 52, 164, -736 }, + { 37, 167, -787 }, { 22, 170, -839 }, { 12, 173, -873 }, { 12, 173, -875 }, + { 17, 172, -857 }, { 23, 171, -836 }, { 29, 170, -817 }, { 36, 169, -794 }, + { 41, 168, -774 }, { 44, 167, -765 }, { 44, 167, -764 }, { 45, 167, -763 }, + { 45, 167, -762 }, { 45, 167, -761 }, { 45, 167, -760 }, { 46, 167, -760 }, + { 46, 167, -759 }, { 46, 167, -758 }, { 46, 167, -758 }, { 46, 167, -757 }, + { 46, 167, -757 }, { 47, 167, -757 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -757 }, + { 46, 167, -757 }, { 46, 167, -757 }, { 46, 167, -758 }, { 46, 167, -758 }, + { 46, 167, -758 }, { 46, 167, -759 }, { 46, 167, -759 }, { 46, 167, -759 }, + { 46, 167, -760 }, { 45, 167, -760 }, { 45, 167, -761 }, { 45, 167, -761 }, + { 45, 167, -761 }, { 45, 167, -762 }, { 45, 167, -762 }, { 45, 167, -763 }, + { 45, 167, -763 }, { 45, 167, -763 }, { 44, 167, -764 }, { 44, 167, -764 }, + { 44, 167, -764 }, { 44, 167, -764 }, { 44, 167, -765 }, { 44, 167, -765 }, + { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, + { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, + { 45, 171, -767 }, { 44, 167, -765 }, { 40, 151, -756 }, { 35, 132, -744 }, + { 29, 111, -731 }, { 23, 88, -718 }, { 17, 66, -704 }, { 11, 45, -692 }, + { 7, 27, -681 }, { 3, 12, -672 }, { 0, 3, -667 }, { 0, 0, -665 }, +}; + +static s16 animdata_mario_lips_4_2[][3] = { + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 6, -623 }, { 51, 9, -623 }, { 50, 15, -624 }, { 49, 22, -624 }, { 48, 30, -624 }, + { 47, 39, -625 }, { 46, 50, -625 }, { 45, 61, -626 }, { 43, 72, -626 }, { 42, 83, -627 }, + { 40, 94, -627 }, { 39, 105, -627 }, { 38, 115, -628 }, { 37, 124, -628 }, { 36, 132, -629 }, + { 35, 139, -629 }, { 35, 143, -629 }, { 34, 146, -629 }, { 34, 148, -629 }, { 34, 149, -629 }, + { 34, 151, -629 }, { 34, 152, -629 }, { 33, 153, -629 }, { 33, 154, -629 }, { 33, 156, -628 }, + { 33, 157, -628 }, { 33, 157, -627 }, { 33, 158, -627 }, { 33, 159, -627 }, { 33, 160, -626 }, + { 33, 161, -626 }, { 34, 161, -625 }, { 34, 162, -624 }, { 34, 162, -624 }, { 34, 163, -623 }, + { 34, 163, -622 }, { 34, 163, -622 }, { 34, 163, -621 }, { 34, 164, -620 }, { 35, 164, -620 }, + { 35, 164, -619 }, { 35, 164, -618 }, { 35, 164, -618 }, { 35, 164, -617 }, { 36, 164, -616 }, + { 36, 163, -615 }, { 36, 163, -615 }, { 36, 163, -614 }, { 36, 163, -614 }, { 36, 162, -613 }, + { 37, 162, -612 }, { 37, 162, -612 }, { 37, 161, -611 }, { 37, 161, -611 }, { 37, 161, -610 }, + { 37, 160, -610 }, { 38, 160, -610 }, { 38, 159, -609 }, { 38, 159, -609 }, { 38, 158, -609 }, + { 38, 158, -609 }, { 38, 157, -609 }, { 38, 157, -609 }, { 38, 156, -609 }, { 38, 155, -609 }, + { 38, 155, -609 }, { 38, 154, -609 }, { 38, 154, -609 }, { 38, 153, -610 }, { 38, 153, -610 }, + { 38, 152, -611 }, { 38, 151, -611 }, { 38, 151, -612 }, { 38, 150, -613 }, { 38, 150, -614 }, + { 37, 149, -615 }, { 37, 149, -616 }, { 37, 149, -617 }, { 37, 148, -619 }, { 36, 148, -620 }, + { 36, 147, -622 }, { 36, 147, -623 }, { 35, 147, -625 }, { 35, 146, -627 }, { 34, 146, -629 }, + { 33, 146, -635 }, { 30, 145, -649 }, { 26, 144, -667 }, { 21, 143, -689 }, { 15, 141, -712 }, + { 10, 139, -736 }, { 5, 137, -757 }, { 0, 134, -775 }, { -2, 131, -788 }, { -4, 127, -793 }, + { -5, 123, -793 }, { -5, 118, -792 }, { -6, 113, -790 }, { -6, 107, -787 }, { -6, 102, -784 }, + { -7, 95, -779 }, { -7, 89, -774 }, { -7, 83, -768 }, { -6, 76, -761 }, { -6, 70, -754 }, + { -6, 63, -747 }, { -5, 57, -739 }, { -5, 50, -732 }, { -4, 44, -724 }, { -4, 38, -717 }, + { -3, 32, -709 }, { -3, 27, -702 }, { -2, 21, -695 }, { -2, 17, -689 }, { -1, 12, -683 }, + { -1, 9, -678 }, { 0, 6, -673 }, { 0, 3, -670 }, { 0, 1, -667 }, { 0, 0, -665 }, + { 0, 0, -665 }, +}; + +struct AnimDataInfo anim_mario_lips_4[] = { + { ARRAY_COUNT(animdata_mario_lips_4_1), GD_ANIM_ROT3S, animdata_mario_lips_4_1 }, + { ARRAY_COUNT(animdata_mario_lips_4_2), GD_ANIM_ROT3S, animdata_mario_lips_4_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_ear_left_1[][3] = { + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, + { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, + { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, + { 1800, 1800, -1538 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, + { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1540 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1538 }, + { 1800, 1800, -1538 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1536 }, + { 1800, 1800, -1536 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1510 }, { 1800, 1800, -1469 }, { 1800, 1800, -1459 }, { 1800, 1800, -1497 }, + { 1800, 1800, -1557 }, { 1800, 1800, -1622 }, { 1800, 1800, -1676 }, { 1800, 1800, -1703 }, + { 1800, 1800, -1691 }, { 1800, 1800, -1651 }, { 1800, 1800, -1601 }, { 1800, 1800, -1556 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1529 }, { 1800, 1800, -1525 }, { 1800, 1800, -1522 }, + { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, + { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, + { 1800, 1800, -1528 }, { 1800, 1800, -1530 }, { 1800, 1800, -1532 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1534 }, { 1800, 1800, -1519 }, { 1800, 1800, -1489 }, + { 1800, 1800, -1454 }, { 1800, 1800, -1425 }, { 1800, 1800, -1414 }, { 1800, 1800, -1415 }, + { 1800, 1800, -1419 }, { 1800, 1800, -1425 }, { 1800, 1800, -1432 }, { 1800, 1800, -1441 }, + { 1800, 1800, -1452 }, { 1800, 1800, -1462 }, { 1800, 1800, -1474 }, { 1800, 1800, -1485 }, + { 1800, 1800, -1496 }, { 1800, 1800, -1506 }, { 1800, 1800, -1516 }, { 1800, 1800, -1523 }, + { 1800, 1800, -1530 }, { 1800, 1800, -1534 }, { 1800, 1800, -1537 }, { 1800, 1800, -1539 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1543 }, { 1800, 1800, -1545 }, { 1800, 1800, -1546 }, + { 1800, 1800, -1547 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, + { 1800, 1800, -1549 }, { 1800, 1800, -1549 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, + { 1800, 1800, -1547 }, { 1800, 1800, -1546 }, { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1540 }, { 1800, 1800, -1539 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1535 }, { 1800, 1800, -1534 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1529 }, { 1800, 1800, -1527 }, { 1800, 1800, -1523 }, { 1800, 1800, -1520 }, + { 1800, 1800, -1516 }, { 1800, 1800, -1511 }, { 1800, 1800, -1507 }, { 1800, 1800, -1502 }, + { 1800, 1800, -1498 }, { 1800, 1800, -1493 }, { 1800, 1800, -1489 }, { 1800, 1800, -1484 }, + { 1800, 1800, -1480 }, { 1800, 1800, -1475 }, { 1800, 1800, -1472 }, { 1800, 1800, -1468 }, + { 1800, 1800, -1465 }, { 1800, 1800, -1462 }, { 1800, 1800, -1459 }, { 1800, 1800, -1457 }, + { 1800, 1800, -1455 }, { 1800, 1800, -1454 }, { 1800, 1800, -1452 }, { 1800, 1800, -1451 }, + { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, + { 1800, 1800, -1450 }, { 1800, 1800, -1451 }, { 1800, 1800, -1453 }, { 1800, 1800, -1454 }, + { 1800, 1800, -1457 }, { 1800, 1800, -1459 }, { 1800, 1800, -1463 }, { 1800, 1800, -1468 }, + { 1800, 1800, -1474 }, { 1800, 1800, -1480 }, { 1800, 1800, -1488 }, { 1800, 1800, -1496 }, + { 1800, 1800, -1505 }, { 1800, 1800, -1514 }, { 1800, 1800, -1524 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1555 }, { 1800, 1800, -1567 }, { 1800, 1800, -1579 }, + { 1800, 1800, -1592 }, { 1800, 1800, -1604 }, { 1800, 1800, -1617 }, { 1800, 1800, -1630 }, + { 1800, 1800, -1642 }, { 1800, 1800, -1655 }, { 1800, 1800, -1666 }, { 1800, 1800, -1677 }, + { 1800, 1800, -1689 }, { 1800, 1800, -1704 }, { 1800, 1800, -1718 }, { 1800, 1800, -1730 }, + { 1800, 1800, -1739 }, { 1800, 1800, -1741 }, { 1800, 1800, -1734 }, { 1800, 1800, -1713 }, + { 1800, 1800, -1676 }, { 1800, 1800, -1632 }, { 1800, 1800, -1588 }, { 1800, 1800, -1553 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1527 }, { 1800, 1800, -1521 }, { 1800, 1800, -1517 }, + { 1800, 1800, -1514 }, { 1800, 1800, -1512 }, { 1800, 1800, -1511 }, { 1800, 1800, -1511 }, + { 1800, 1800, -1512 }, { 1800, 1800, -1513 }, { 1800, 1800, -1515 }, { 1800, 1800, -1517 }, + { 1800, 1800, -1519 }, { 1800, 1800, -1522 }, { 1800, 1800, -1524 }, { 1800, 1800, -1527 }, + { 1800, 1800, -1529 }, { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1538 }, { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1542 }, { 1800, 1800, -1544 }, { 1800, 1800, -1545 }, + { 1800, 1800, -1546 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, { 1800, 1800, -1550 }, + { 1800, 1800, -1552 }, { 1800, 1800, -1553 }, { 1800, 1800, -1554 }, { 1800, 1800, -1555 }, + { 1800, 1800, -1557 }, { 1800, 1800, -1558 }, { 1800, 1800, -1559 }, { 1800, 1800, -1560 }, + { 1800, 1800, -1561 }, { 1800, 1800, -1562 }, { 1800, 1800, -1563 }, { 1800, 1800, -1564 }, + { 1800, 1800, -1564 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, { 1800, 1800, -1566 }, + { 1800, 1800, -1566 }, { 1800, 1800, -1566 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, + { 1800, 1800, -1565 }, { 1800, 1800, -1564 }, { 1800, 1800, -1563 }, { 1800, 1800, -1562 }, + { 1800, 1800, -1561 }, { 1800, 1800, -1559 }, { 1800, 1800, -1557 }, { 1800, 1800, -1555 }, + { 1800, 1800, -1553 }, { 1800, 1800, -1550 }, { 1800, 1800, -1548 }, { 1800, 1800, -1545 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1538 }, { 1800, 1800, -1534 }, { 1800, 1800, -1507 }, + { 1800, 1800, -1448 }, { 1800, 1800, -1380 }, { 1800, 1800, -1323 }, { 1800, 1800, -1299 }, + { 1800, 1800, -1300 }, { 1800, 1800, -1304 }, { 1800, 1800, -1309 }, { 1800, 1800, -1317 }, + { 1800, 1800, -1326 }, { 1800, 1800, -1337 }, { 1800, 1800, -1349 }, { 1800, 1800, -1362 }, + { 1800, 1800, -1376 }, { 1800, 1800, -1392 }, { 1800, 1800, -1407 }, { 1800, 1800, -1423 }, + { 1800, 1800, -1440 }, { 1800, 1800, -1456 }, { 1800, 1800, -1473 }, { 1800, 1800, -1489 }, + { 1800, 1800, -1505 }, { 1800, 1800, -1520 }, { 1800, 1800, -1534 }, { 1800, 1800, -1555 }, + { 1800, 1800, -1583 }, { 1800, 1800, -1607 }, { 1800, 1800, -1614 }, { 1800, 1800, -1595 }, + { 1800, 1800, -1557 }, { 1800, 1800, -1520 }, { 1800, 1800, -1499 }, { 1800, 1800, -1514 }, + { 1800, 1800, -1549 }, { 1800, 1800, -1574 }, { 1800, 1800, -1580 }, { 1800, 1800, -1581 }, + { 1800, 1800, -1578 }, { 1800, 1800, -1575 }, { 1800, 1800, -1574 }, { 1800, 1799, -1574 }, + { 1800, 1799, -1574 }, { 1800, 1798, -1574 }, { 1800, 1797, -1574 }, { 1800, 1797, -1574 }, + { 1800, 1796, -1574 }, { 1800, 1795, -1574 }, { 1800, 1794, -1574 }, { 1800, 1794, -1574 }, + { 1800, 1794, -1574 }, { 1800, 1795, -1574 }, { 1800, 1796, -1574 }, { 1800, 1797, -1574 }, + { 1800, 1800, -1574 }, { 1799, 1803, -1574 }, { 1799, 1807, -1574 }, { 1799, 1812, -1574 }, + { 1799, 1818, -1574 }, { 1799, 1825, -1574 }, { 1799, 1831, -1574 }, { 1799, 1838, -1574 }, + { 1799, 1845, -1574 }, { 1799, 1851, -1574 }, { 1799, 1858, -1574 }, { 1799, 1863, -1574 }, + { 1799, 1867, -1574 }, { 1799, 1871, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, + { 1799, 1873, -1574 }, { 1799, 1870, -1574 }, { 1799, 1865, -1574 }, { 1799, 1859, -1574 }, + { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, { 1799, 1837, -1574 }, { 1799, 1829, -1574 }, + { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, { 1799, 1804, -1574 }, + { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1800, -1574 }, { 1799, 1803, -1574 }, + { 1799, 1807, -1574 }, { 1799, 1813, -1574 }, { 1799, 1819, -1574 }, { 1799, 1826, -1574 }, + { 1799, 1833, -1574 }, { 1799, 1840, -1574 }, { 1799, 1848, -1574 }, { 1799, 1855, -1574 }, + { 1799, 1861, -1574 }, { 1799, 1866, -1574 }, { 1799, 1870, -1574 }, { 1799, 1873, -1574 }, + { 1799, 1874, -1574 }, { 1799, 1873, -1574 }, { 1799, 1870, -1574 }, { 1799, 1865, -1574 }, + { 1799, 1859, -1574 }, { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, { 1799, 1837, -1574 }, + { 1799, 1829, -1574 }, { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, + { 1799, 1804, -1574 }, { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1801, -1574 }, + { 1799, 1804, -1574 }, { 1799, 1810, -1574 }, { 1799, 1816, -1574 }, { 1799, 1824, -1574 }, + { 1799, 1832, -1574 }, { 1799, 1841, -1574 }, { 1799, 1849, -1574 }, { 1799, 1857, -1574 }, + { 1799, 1864, -1574 }, { 1799, 1869, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, + { 1799, 1873, -1574 }, { 1799, 1871, -1574 }, { 1799, 1867, -1574 }, { 1799, 1862, -1574 }, + { 1799, 1856, -1575 }, { 1799, 1850, -1575 }, { 1799, 1843, -1575 }, { 1799, 1835, -1575 }, + { 1799, 1828, -1575 }, { 1799, 1822, -1575 }, { 1799, 1815, -1575 }, { 1799, 1810, -1575 }, + { 1799, 1805, -1575 }, { 1799, 1802, -1575 }, { 1800, 1800, -1574 }, { 1800, 1798, -1573 }, + { 1800, 1797, -1573 }, { 1800, 1796, -1572 }, { 1800, 1795, -1571 }, { 1800, 1795, -1570 }, + { 1800, 1794, -1569 }, { 1800, 1793, -1569 }, { 1800, 1793, -1568 }, { 1800, 1792, -1567 }, + { 1800, 1792, -1566 }, { 1800, 1792, -1565 }, { 1800, 1791, -1564 }, { 1800, 1791, -1563 }, + { 1800, 1791, -1562 }, { 1800, 1791, -1561 }, { 1800, 1791, -1560 }, { 1800, 1791, -1559 }, + { 1800, 1791, -1558 }, { 1800, 1792, -1557 }, { 1800, 1792, -1556 }, { 1800, 1792, -1555 }, + { 1800, 1792, -1554 }, { 1800, 1793, -1553 }, { 1800, 1793, -1552 }, { 1800, 1793, -1551 }, + { 1800, 1794, -1550 }, { 1800, 1794, -1549 }, { 1800, 1795, -1548 }, { 1800, 1795, -1547 }, + { 1800, 1795, -1546 }, { 1800, 1796, -1545 }, { 1800, 1796, -1544 }, { 1800, 1797, -1543 }, + { 1800, 1797, -1542 }, { 1800, 1797, -1541 }, { 1800, 1798, -1541 }, { 1800, 1798, -1540 }, + { 1800, 1798, -1539 }, { 1800, 1799, -1538 }, { 1800, 1799, -1537 }, { 1800, 1799, -1537 }, + { 1800, 1799, -1536 }, { 1800, 1799, -1535 }, { 1800, 1799, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, { 1800, 1800, -1531 }, { 1800, 1800, -1529 }, + { 1800, 1800, -1527 }, { 1800, 1800, -1525 }, { 1800, 1800, -1523 }, { 1800, 1800, -1522 }, + { 1800, 1800, -1522 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, { 1800, 1800, -1529 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1541 }, { 1800, 1800, -1549 }, { 1800, 1800, -1559 }, + { 1800, 1800, -1569 }, { 1800, 1800, -1581 }, { 1800, 1800, -1593 }, { 1800, 1800, -1605 }, + { 1800, 1800, -1618 }, { 1800, 1800, -1631 }, { 1800, 1800, -1644 }, { 1800, 1800, -1657 }, + { 1800, 1800, -1669 }, { 1800, 1800, -1681 }, { 1800, 1800, -1691 }, { 1800, 1800, -1701 }, + { 1800, 1800, -1710 }, { 1800, 1800, -1717 }, { 1800, 1800, -1723 }, { 1800, 1800, -1728 }, + { 1800, 1800, -1732 }, { 1800, 1800, -1735 }, { 1800, 1800, -1736 }, { 1800, 1800, -1737 }, + { 1800, 1800, -1736 }, { 1800, 1800, -1733 }, { 1800, 1800, -1729 }, { 1800, 1800, -1724 }, + { 1800, 1800, -1717 }, { 1800, 1800, -1708 }, { 1800, 1800, -1696 }, { 1800, 1800, -1682 }, + { 1800, 1800, -1667 }, { 1800, 1800, -1650 }, { 1800, 1800, -1632 }, { 1800, 1800, -1615 }, + { 1800, 1800, -1597 }, { 1800, 1800, -1581 }, { 1800, 1800, -1566 }, { 1800, 1800, -1553 }, + { 1800, 1800, -1542 }, { 1800, 1800, -1534 }, { 1800, 1800, -1528 }, { 1800, 1800, -1524 }, + { 1800, 1800, -1521 }, { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, + { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, + { 1800, 1800, -1527 }, { 1800, 1800, -1529 }, { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, +}; + +struct AnimDataInfo anim_mario_ear_left[] = { + { ARRAY_COUNT(animdata_mario_ear_left_1), GD_ANIM_ROT3S, animdata_mario_ear_left_1 }, + { 0, GD_ANIM_EMPTY, NULL }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_group_2.c b/src/goddard/dynlists/anim_group_2.c new file mode 100644 index 00000000..51d6fe07 --- /dev/null +++ b/src/goddard/dynlists/anim_group_2.c @@ -0,0 +1,2914 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_ear_right_1[][3] = { + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 263 }, { 0, 0, 263 }, { 0, 0, 263 }, { 0, 0, 263 }, + { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 261 }, { 0, 0, 261 }, + { 0, 0, 261 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 259 }, + { 0, 0, 259 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 257 }, + { 0, 0, 257 }, { 0, 0, 256 }, { 0, 0, 256 }, { 0, 0, 256 }, { 0, 0, 255 }, + { 0, 0, 255 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 253 }, + { 0, 0, 253 }, { 0, 0, 252 }, { 0, 0, 252 }, { 0, 0, 252 }, { 0, 0, 251 }, + { 0, 0, 251 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 249 }, + { 0, 0, 249 }, { 0, 0, 249 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, + { 0, 0, 248 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 247 }, + { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, + { 0, 0, 249 }, { 0, 0, 249 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 251 }, + { 0, 0, 251 }, { 0, 0, 252 }, { 0, 0, 253 }, { 0, 0, 253 }, { 0, 0, 254 }, + { 0, 0, 255 }, { 0, 0, 256 }, { 0, 0, 257 }, { 0, 0, 258 }, { 0, 0, 259 }, + { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, { 0, 0, 263 }, { 0, 0, 264 }, + { 0, 0, 265 }, { 0, 0, 289 }, { 0, 0, 338 }, { 0, 0, 385 }, { 0, 0, 403 }, + { 0, 0, 381 }, { 0, 0, 337 }, { 0, 0, 284 }, { 0, 0, 237 }, { 0, 0, 208 }, + { 0, 0, 208 }, { 0, 0, 228 }, { 0, 0, 252 }, { 0, 0, 265 }, { 0, 0, 267 }, + { 0, 0, 268 }, { 0, 0, 269 }, { 0, 0, 269 }, { 0, 0, 268 }, { 0, 0, 268 }, + { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 265 }, { 0, 0, 263 }, { 0, 0, 262 }, + { 0, 0, 260 }, { 0, 0, 259 }, { 0, 0, 257 }, { 0, 0, 256 }, { 0, 0, 255 }, + { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 255 }, { 0, 0, 255 }, + { 0, 0, 257 }, { 0, 0, 259 }, { 0, 0, 262 }, { 0, 0, 265 }, { 0, 0, 280 }, + { 0, 0, 308 }, { 0, 0, 341 }, { 0, 0, 368 }, { 0, 0, 380 }, { 0, 0, 378 }, + { 0, 0, 375 }, { 0, 0, 369 }, { 0, 0, 362 }, { 0, 0, 353 }, { 0, 0, 344 }, + { 0, 0, 333 }, { 0, 0, 322 }, { 0, 0, 312 }, { 0, 0, 301 }, { 0, 0, 291 }, + { 0, 0, 283 }, { 0, 0, 275 }, { 0, 0, 269 }, { 0, 0, 265 }, { 0, 0, 263 }, + { 0, 0, 261 }, { 0, 0, 259 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, + { 0, 0, 258 }, { 0, 0, 259 }, { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, + { 0, 0, 263 }, { 0, 0, 265 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 269 }, + { 0, 0, 270 }, { 0, 0, 270 }, { 0, 0, 271 }, { 0, 0, 271 }, { 0, 0, 271 }, + { 0, 0, 270 }, { 0, 0, 269 }, { 0, 0, 267 }, { 0, 0, 265 }, { 0, 0, 262 }, + { 0, 0, 258 }, { 0, 0, 254 }, { 0, 0, 249 }, { 0, 0, 243 }, { 0, 0, 237 }, + { 0, 0, 231 }, { 0, 0, 224 }, { 0, 0, 217 }, { 0, 0, 210 }, { 0, 0, 203 }, + { 0, 0, 195 }, { 0, 0, 188 }, { 0, 0, 182 }, { 0, 0, 175 }, { 0, 0, 169 }, + { 0, 0, 164 }, { 0, 0, 159 }, { 0, 0, 154 }, { 0, 0, 151 }, { 0, 0, 147 }, + { 0, 0, 145 }, { 0, 0, 142 }, { 0, 0, 140 }, { 0, 0, 138 }, { 0, 0, 137 }, + { 0, 0, 136 }, { 0, 0, 136 }, { 0, 0, 136 }, { 0, 0, 137 }, { 0, 0, 138 }, + { 0, 0, 140 }, { 0, 0, 143 }, { 0, 0, 146 }, { 0, 0, 151 }, { 0, 0, 157 }, + { 0, 0, 166 }, { 0, 0, 177 }, { 0, 0, 189 }, { 0, 0, 203 }, { 0, 0, 217 }, + { 0, 0, 231 }, { 0, 0, 244 }, { 0, 0, 255 }, { 0, 0, 265 }, { 0, 0, 274 }, + { 0, 0, 283 }, { 0, 0, 291 }, { 0, 0, 300 }, { 0, 0, 308 }, { 0, 0, 315 }, + { 0, 0, 322 }, { 0, 0, 328 }, { 0, 0, 333 }, { 0, 0, 337 }, { 0, 0, 339 }, + { 0, 0, 340 }, { 0, 0, 336 }, { 0, 0, 327 }, { 0, 0, 315 }, { 0, 0, 300 }, + { 0, 0, 286 }, { 0, 0, 273 }, { 0, 0, 265 }, { 0, 0, 261 }, { 0, 0, 260 }, + { 0, 0, 261 }, { 0, 0, 263 }, { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 266 }, + { 0, 0, 266 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 268 }, + { 0, 0, 269 }, { 0, 0, 269 }, { 0, 0, 270 }, { 0, 0, 271 }, { 0, 0, 272 }, + { 0, 0, 273 }, { 0, 0, 274 }, { 0, 0, 274 }, { 0, 0, 275 }, { 0, 0, 276 }, + { 0, 0, 277 }, { 0, 0, 278 }, { 0, 0, 279 }, { 0, 0, 280 }, { 0, 0, 281 }, + { 0, 0, 282 }, { 0, 0, 282 }, { 0, 0, 283 }, { 0, 0, 284 }, { 0, 0, 284 }, + { 0, 0, 285 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 287 }, + { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 286 }, + { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 285 }, { 0, 0, 284 }, { 0, 0, 283 }, + { 0, 0, 282 }, { 0, 0, 281 }, { 0, 0, 280 }, { 0, 0, 278 }, { 0, 0, 276 }, + { 0, 0, 275 }, { 0, 0, 273 }, { 0, 0, 270 }, { 0, 0, 268 }, { 0, 0, 265 }, + { 0, 0, 246 }, { 0, 0, 205 }, { 0, 0, 158 }, { 0, 0, 119 }, { 0, 0, 105 }, + { 0, 0, 109 }, { 0, 0, 116 }, { 0, 0, 125 }, { 0, 0, 136 }, { 0, 0, 148 }, + { 0, 0, 162 }, { 0, 0, 177 }, { 0, 0, 193 }, { 0, 0, 209 }, { 0, 0, 225 }, + { 0, 0, 242 }, { 0, 0, 258 }, { 0, 0, 273 }, { 0, 0, 288 }, { 0, 0, 302 }, + { 0, 0, 314 }, { 0, 0, 325 }, { 0, 0, 333 }, { 0, 0, 340 }, { 0, 0, 325 }, + { 0, 0, 287 }, { 0, 0, 246 }, { 0, 0, 225 }, { 0, 0, 243 }, { 0, 0, 283 }, + { 0, 0, 311 }, { 0, 0, 312 }, { 0, 0, 302 }, { 0, 0, 294 }, { 0, 0, 292 }, + { 0, 0, 292 }, { 0, 0, 292 }, { 0, 0, 293 }, { 0, 0, 294 }, { 0, 0, 294 }, + { 0, 0, 294 }, { 0, -1, 294 }, { 0, -2, 294 }, { 0, -3, 294 }, { 0, -4, 294 }, + { 0, -6, 294 }, { 0, -7, 294 }, { 0, -8, 294 }, { 0, -8, 294 }, { 0, -8, 294 }, + { 0, -7, 294 }, { 0, -6, 294 }, { 0, -3, 294 }, { 0, 0, 294 }, { 0, 5, 294 }, + { 0, 12, 294 }, { 0, 20, 294 }, { 0, 30, 294 }, { 0, 40, 294 }, { 0, 51, 294 }, + { 0, 62, 294 }, { 0, 73, 294 }, { 0, 83, 294 }, { 0, 93, 294 }, { 0, 102, 294 }, + { 0, 109, 294 }, { 0, 115, 294 }, { 0, 119, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, + { 0, 113, 294 }, { 0, 106, 294 }, { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, + { 0, 60, 294 }, { 0, 47, 294 }, { 0, 35, 294 }, { 0, 23, 294 }, { 0, 14, 294 }, + { 0, 6, 294 }, { 0, 1, 294 }, { 0, 0, 294 }, { 0, 1, 294 }, { 0, 5, 294 }, + { 0, 12, 294 }, { 0, 21, 294 }, { 0, 31, 294 }, { 0, 42, 294 }, { 0, 54, 294 }, + { 0, 66, 294 }, { 0, 77, 294 }, { 0, 89, 294 }, { 0, 99, 294 }, { 0, 107, 294 }, + { 0, 114, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, { 0, 113, 294 }, + { 0, 106, 294 }, { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, { 0, 60, 294 }, + { 0, 47, 294 }, { 0, 35, 294 }, { 0, 23, 294 }, { 0, 14, 294 }, { 0, 6, 294 }, + { 0, 1, 294 }, { 0, 0, 294 }, { 0, 2, 294 }, { 0, 7, 294 }, { 0, 16, 294 }, + { 0, 27, 294 }, { 0, 39, 294 }, { 0, 53, 294 }, { 0, 67, 294 }, { 0, 80, 294 }, + { 0, 93, 294 }, { 0, 104, 294 }, { 0, 112, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, + { 0, 118, 294 }, { 0, 114, 294 }, { 0, 108, 294 }, { 0, 100, 294 }, { 0, 91, 294 }, + { 0, 80, 294 }, { 0, 69, 295 }, { 0, 58, 295 }, { 0, 46, 295 }, { 0, 35, 295 }, + { 0, 25, 295 }, { 0, 16, 295 }, { 0, 8, 295 }, { 0, 3, 294 }, { 0, 0, 294 }, + { 0, -1, 293 }, { 0, -3, 293 }, { 0, -5, 292 }, { 0, -6, 292 }, { 0, -7, 291 }, + { 0, -9, 291 }, { 0, -10, 290 }, { 0, -10, 289 }, { 0, -11, 289 }, { 0, -12, 288 }, + { 0, -12, 287 }, { 0, -12, 287 }, { 0, -13, 286 }, { 0, -13, 285 }, { 0, -13, 285 }, + { 0, -13, 284 }, { 0, -13, 283 }, { 0, -12, 283 }, { 0, -12, 282 }, { 0, -12, 281 }, + { 0, -11, 280 }, { 0, -11, 280 }, { 0, -11, 279 }, { 0, -10, 278 }, { 0, -9, 277 }, + { 0, -9, 277 }, { 0, -8, 276 }, { 0, -8, 275 }, { 0, -7, 275 }, { 0, -6, 274 }, + { 0, -6, 273 }, { 0, -5, 273 }, { 0, -4, 272 }, { 0, -4, 271 }, { 0, -3, 271 }, + { 0, -2, 270 }, { 0, -2, 269 }, { 0, -1, 269 }, { 0, -1, 268 }, { 0, 0, 268 }, + { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 266 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 268 }, { 0, 0, 270 }, { 0, 0, 272 }, + { 0, 0, 274 }, { 0, 0, 276 }, { 0, 0, 277 }, { 0, 0, 277 }, { 0, 0, 276 }, + { 0, 0, 274 }, { 0, 0, 270 }, { 0, 0, 265 }, { 0, 0, 258 }, { 0, 0, 250 }, + { 0, 0, 240 }, { 0, 0, 230 }, { 0, 0, 218 }, { 0, 0, 206 }, { 0, 0, 194 }, + { 0, 0, 181 }, { 0, 0, 168 }, { 0, 0, 155 }, { 0, 0, 142 }, { 0, 0, 130 }, + { 0, 0, 118 }, { 0, 0, 108 }, { 0, 0, 98 }, { 0, 0, 89 }, { 0, 0, 82 }, + { 0, 0, 76 }, { 0, 0, 71 }, { 0, 0, 67 }, { 0, 0, 64 }, { 0, 0, 63 }, + { 0, 0, 62 }, { 0, 0, 63 }, { 0, 0, 66 }, { 0, 0, 70 }, { 0, 0, 75 }, + { 0, 0, 82 }, { 0, 0, 91 }, { 0, 0, 103 }, { 0, 0, 116 }, { 0, 0, 132 }, + { 0, 0, 148 }, { 0, 0, 165 }, { 0, 0, 183 }, { 0, 0, 200 }, { 0, 0, 216 }, + { 0, 0, 231 }, { 0, 0, 245 }, { 0, 0, 256 }, { 0, 0, 265 }, { 0, 0, 271 }, + { 0, 0, 275 }, { 0, 0, 278 }, { 0, 0, 278 }, { 0, 0, 278 }, { 0, 0, 276 }, + { 0, 0, 274 }, { 0, 0, 272 }, { 0, 0, 269 }, { 0, 0, 267 }, { 0, 0, 266 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, +}; + +struct AnimDataInfo anim_mario_ear_right[] = { + { ARRAY_COUNT(animdata_mario_ear_right_1), GD_ANIM_ROT3S, animdata_mario_ear_right_1 }, + { 0, GD_ANIM_EMPTY, NULL }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_nose_1[][3] = { + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1786 }, { 0, 0, -1786 }, { 0, 0, -1787 }, + { 0, 0, -1788 }, { 0, 0, -1789 }, { 0, 0, -1790 }, { 0, 0, -1791 }, { 0, 0, -1792 }, + { 0, 0, -1793 }, { 0, 0, -1793 }, { 0, 0, -1794 }, { 0, 0, -1794 }, { 0, 0, -1794 }, + { 0, 0, -1794 }, { 0, 0, -1794 }, { 0, 0, -1793 }, { 0, 0, -1792 }, { 0, 0, -1790 }, + { 0, 0, -1788 }, { 0, 0, -1785 }, { 0, 0, -1775 }, { 0, 0, -1755 }, { 0, 0, -1733 }, + { 0, 0, -1715 }, { 0, 0, -1711 }, { 0, 0, -1722 }, { 0, 0, -1743 }, { 0, 0, -1770 }, + { 0, 0, -1797 }, { 0, 0, -1819 }, { 0, 0, -1831 }, { 0, 0, -1833 }, { 0, 0, -1830 }, + { 0, 0, -1823 }, { 0, 0, -1814 }, { 0, 0, -1804 }, { 0, 0, -1795 }, { 0, 0, -1788 }, + { 0, 0, -1785 }, { 0, 0, -1789 }, { 0, 0, -1799 }, { 0, 0, -1811 }, { 0, 0, -1821 }, + { 0, 0, -1825 }, { 0, 0, -1820 }, { 0, 0, -1806 }, { 0, 0, -1793 }, { 0, 0, -1785 }, + { 0, 0, -1784 }, { 0, 0, -1783 }, { 0, 0, -1782 }, { 0, 0, -1781 }, { 0, 0, -1781 }, + { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, + { 0, 0, -1782 }, { 0, 0, -1783 }, { 0, 0, -1783 }, { 0, 0, -1784 }, { 0, 0, -1784 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1786 }, { 0, 0, -1786 }, { 0, 0, -1786 }, { 0, -1, -1786 }, + { 0, -1, -1787 }, { 0, -2, -1787 }, { 0, -2, -1787 }, { 0, -3, -1788 }, { 0, -4, -1789 }, + { 0, -4, -1789 }, { 0, -5, -1790 }, { 0, -6, -1790 }, { 0, -7, -1791 }, { 0, -8, -1792 }, + { 0, -9, -1793 }, { 0, -10, -1793 }, { 0, -11, -1794 }, { 0, -12, -1795 }, { 1, -13, -1796 }, + { 1, -15, -1797 }, { 1, -16, -1798 }, { 1, -17, -1799 }, { 1, -19, -1800 }, { 1, -20, -1801 }, + { 1, -21, -1802 }, { 1, -23, -1804 }, { 1, -24, -1805 }, { 1, -26, -1806 }, { 2, -28, -1807 }, + { 2, -29, -1808 }, { 2, -31, -1810 }, { 2, -32, -1811 }, { 2, -34, -1812 }, { 2, -36, -1814 }, + { 2, -38, -1815 }, { 2, -39, -1816 }, { 3, -41, -1818 }, { 3, -43, -1819 }, { 3, -45, -1821 }, + { 3, -47, -1822 }, { 3, -49, -1823 }, { 3, -51, -1825 }, { 3, -53, -1826 }, { 4, -55, -1828 }, + { 4, -56, -1829 }, { 4, -58, -1831 }, { 4, -60, -1832 }, { 4, -62, -1834 }, { 4, -64, -1835 }, + { 4, -66, -1837 }, { 4, -68, -1839 }, { 5, -70, -1840 }, { 5, -72, -1842 }, { 5, -74, -1843 }, + { 5, -76, -1845 }, { 5, -78, -1846 }, { 5, -81, -1848 }, { 5, -83, -1849 }, { 6, -85, -1851 }, + { 6, -87, -1852 }, { 6, -89, -1854 }, { 6, -91, -1855 }, { 6, -93, -1857 }, { 6, -94, -1858 }, + { 6, -96, -1860 }, { 6, -98, -1861 }, { 7, -100, -1863 }, { 7, -102, -1864 }, { 7, -104, -1865 }, + { 7, -106, -1867 }, { 7, -108, -1868 }, { 7, -110, -1870 }, { 7, -112, -1871 }, { 7, -113, -1872 }, + { 7, -115, -1873 }, { 8, -117, -1875 }, { 8, -119, -1876 }, { 8, -120, -1877 }, { 8, -122, -1878 }, + { 8, -124, -1880 }, { 8, -125, -1881 }, { 8, -127, -1882 }, { 8, -128, -1883 }, { 8, -130, -1884 }, + { 8, -131, -1885 }, { 8, -133, -1886 }, { 8, -134, -1887 }, { 8, -135, -1888 }, { 8, -137, -1889 }, + { 8, -138, -1890 }, { 9, -139, -1890 }, { 9, -140, -1891 }, { 9, -141, -1892 }, { 9, -142, -1893 }, + { 9, -143, -1893 }, { 9, -144, -1894 }, { 9, -145, -1895 }, { 9, -146, -1895 }, { 7, -140, -1885 }, + { 3, -121, -1862 }, { 0, -85, -1837 }, { 1, -1, -1807 }, { 3, 71, -1782 }, { 1, 42, -1781 }, + { 0, 0, -1785 }, { 0, -4, -1785 }, { 0, -6, -1785 }, { 0, -8, -1785 }, { 0, -9, -1785 }, + { 0, -9, -1784 }, { 0, -8, -1784 }, { 0, -7, -1783 }, { 0, -5, -1783 }, { 0, -4, -1783 }, + { 0, -2, -1783 }, { 0, -1, -1784 }, { 0, 0, -1784 }, { 0, 0, -1785 }, { 0, 0, -1789 }, + { 0, 0, -1794 }, { 0, 0, -1801 }, { 0, 0, -1806 }, { 0, 0, -1808 }, { 0, 0, -1807 }, + { 0, 0, -1803 }, { 0, 0, -1798 }, { 0, 0, -1793 }, { 0, 0, -1789 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1788 }, { 0, 0, -1794 }, { 0, 0, -1801 }, { 0, 0, -1809 }, + { 0, 0, -1815 }, { 0, 0, -1817 }, { 0, 0, -1816 }, { 0, 0, -1812 }, { 0, 0, -1806 }, + { 0, 0, -1799 }, { 0, 0, -1793 }, { 0, 0, -1788 }, { 0, 0, -1785 }, { 0, 0, -1784 }, + { 0, 0, -1783 }, { 0, 0, -1782 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1780 }, + { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, + { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, + { 0, 0, -1780 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, + { 0, 0, -1782 }, { 0, 0, -1782 }, { 0, 0, -1782 }, { 0, 0, -1783 }, { 0, 0, -1783 }, + { 0, 0, -1784 }, { 0, 0, -1784 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1786 }, + { 0, 0, -1788 }, { 0, 0, -1789 }, { 0, 0, -1792 }, { 0, 0, -1794 }, { 0, 0, -1797 }, + { 0, 0, -1799 }, { 0, 0, -1802 }, { 0, 0, -1805 }, { 0, 0, -1807 }, { 0, 0, -1809 }, + { 0, 0, -1811 }, { 0, 0, -1813 }, { 0, 0, -1814 }, { 0, 0, -1814 }, { 0, 0, -1813 }, + { 0, 0, -1811 }, { 0, 0, -1808 }, { 0, 0, -1804 }, { 0, 0, -1800 }, { 0, 0, -1795 }, + { 0, 0, -1792 }, { 0, 0, -1788 }, { 0, 0, -1786 }, { 0, 0, -1785 }, { 0, 0, -1786 }, + { 0, 0, -1787 }, { 0, 0, -1789 }, { 0, 0, -1791 }, { 0, 0, -1794 }, { 0, 0, -1797 }, + { 0, 0, -1800 }, { 0, 0, -1803 }, { 0, 0, -1806 }, { 0, 0, -1809 }, { 0, 0, -1812 }, + { 0, 0, -1814 }, { 0, 0, -1816 }, { 0, 0, -1819 }, { 0, 0, -1822 }, { 0, 0, -1825 }, + { 0, 0, -1826 }, { 0, 0, -1827 }, { 0, 0, -1825 }, { 0, 0, -1821 }, { 0, 0, -1814 }, + { 0, 0, -1805 }, { 0, 0, -1796 }, { 0, 0, -1789 }, { 0, 0, -1785 }, { 0, 0, -1784 }, + { 0, 0, -1783 }, { 0, 0, -1782 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, + { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1781 }, { 0, 0, -1782 }, + { 0, 0, -1782 }, { 0, 0, -1783 }, { 0, 0, -1783 }, { 0, 0, -1784 }, { 0, 0, -1784 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1784 }, + { 0, 0, -1784 }, { 0, 0, -1784 }, { 0, 0, -1783 }, { 0, 0, -1783 }, { 0, 0, -1783 }, + { 0, 0, -1782 }, { 0, 0, -1782 }, { 0, 0, -1782 }, { 0, 0, -1781 }, { 0, 0, -1781 }, + { 0, 0, -1781 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1780 }, { 0, 0, -1780 }, + { 0, 0, -1780 }, { 0, 0, -1781 }, { 0, 0, -1782 }, { 0, 0, -1782 }, { 0, 0, -1783 }, + { 0, 0, -1784 }, { 0, 0, -1785 }, { 0, 0, -1791 }, { 0, 0, -1802 }, { 0, 0, -1816 }, + { 0, 0, -1828 }, { 0, 0, -1835 }, { 0, 0, -1837 }, { 0, 0, -1838 }, { 0, 0, -1837 }, + { 0, 0, -1836 }, { 0, 0, -1835 }, { 0, 0, -1833 }, { 0, 0, -1831 }, { 0, 0, -1830 }, + { 0, 0, -1830 }, { 0, 0, -1830 }, { 0, 0, -1832 }, { 0, 0, -1835 }, { 0, 0, -1843 }, + { 0, 0, -1858 }, { 0, 0, -1875 }, { 0, 0, -1892 }, { 0, 0, -1903 }, { 0, 0, -1906 }, + { 0, 0, -1901 }, { 0, 0, -1893 }, { 0, 0, -1882 }, { 0, 0, -1869 }, { 0, 0, -1855 }, + { 0, 0, -1841 }, { 0, 0, -1827 }, { 0, 0, -1813 }, { 0, 0, -1801 }, { 0, 0, -1791 }, + { 0, 0, -1783 }, { 0, 0, -1780 }, { 0, 0, -1778 }, { 0, 0, -1776 }, { 0, 0, -1774 }, + { 0, -1, -1773 }, { 0, -1, -1772 }, { 0, -2, -1771 }, { 0, -3, -1769 }, { 0, -4, -1768 }, + { 0, -5, -1768 }, { 0, -6, -1767 }, { 0, -7, -1766 }, { 0, -8, -1766 }, { 0, -9, -1765 }, + { 0, -11, -1765 }, { 0, -12, -1765 }, { 0, -13, -1764 }, { 0, -15, -1764 }, { 0, -16, -1764 }, + { 0, -17, -1764 }, { 0, -19, -1764 }, { 0, -20, -1765 }, { 0, -21, -1765 }, { 0, -23, -1765 }, + { 0, -24, -1765 }, { 0, -25, -1766 }, { 0, -26, -1766 }, { 0, -27, -1767 }, { 0, -28, -1767 }, + { 0, -29, -1768 }, { 0, -30, -1768 }, { 0, -31, -1769 }, { 0, -31, -1769 }, { 0, -32, -1770 }, + { 0, -32, -1771 }, { 0, -32, -1771 }, { 0, -32, -1772 }, { 0, -32, -1773 }, { 0, -32, -1773 }, + { 0, -32, -1774 }, { 0, -31, -1774 }, { 0, -30, -1775 }, { 0, -29, -1776 }, { 0, -28, -1776 }, + { 0, -27, -1777 }, { 0, -25, -1777 }, { 0, -23, -1778 }, { 0, -21, -1778 }, { 0, -19, -1778 }, + { 0, -16, -1779 }, { 0, -14, -1779 }, { 0, -10, -1779 }, { 0, -7, -1779 }, { 0, -3, -1780 }, + { 0, 0, -1780 }, { 0, 10, -1780 }, { 0, 33, -1780 }, { 0, 64, -1780 }, { 0, 101, -1780 }, + { 0, 140, -1780 }, { 0, 178, -1779 }, { 0, 213, -1779 }, { 0, 240, -1779 }, { 0, 257, -1779 }, + { 0, 269, -1779 }, { 0, 280, -1779 }, { 0, 291, -1779 }, { 0, 302, -1779 }, { 0, 310, -1779 }, + { 0, 318, -1779 }, { 0, 323, -1779 }, { 0, 325, -1779 }, { 0, 324, -1779 }, { 0, 320, -1779 }, + { 0, 311, -1779 }, { 0, 298, -1779 }, { 0, 281, -1779 }, { 0, 257, -1779 }, { 0, 174, -1779 }, + { 0, 21, -1780 }, { 0, -130, -1780 }, { 0, -211, -1780 }, { 0, -150, -1780 }, { 0, -5, -1780 }, + { 0, 91, -1779 }, { 0, 73, -1779 }, { 0, 7, -1780 }, { 0, -40, -1780 }, { 0, -37, -1780 }, + { 0, -16, -1780 }, { 0, 0, -1780 }, { 0, 2, -1780 }, { 0, 1, -1780 }, { 0, 0, -1780 }, + { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1779 }, { 0, 0, -1778 }, { 0, 0, -1778 }, + { 0, 0, -1778 }, { 0, 0, -1777 }, { 0, 0, -1777 }, { 0, 0, -1777 }, { 0, 0, -1777 }, + { 0, 0, -1777 }, { 0, 0, -1778 }, { 0, 0, -1778 }, { 0, 0, -1780 }, { 0, 0, -1781 }, + { 0, 0, -1784 }, { 0, 0, -1786 }, { 0, 0, -1790 }, { 0, 0, -1793 }, { 0, 0, -1797 }, + { 0, 0, -1800 }, { 0, 0, -1804 }, { 0, 0, -1808 }, { 0, 0, -1811 }, { 0, 0, -1814 }, + { 0, 0, -1816 }, { 0, 0, -1818 }, { 0, 0, -1819 }, { 0, 0, -1820 }, { 0, 0, -1819 }, + { 0, 0, -1817 }, { 0, 0, -1815 }, { 0, 0, -1812 }, { 0, 0, -1808 }, { 0, 0, -1804 }, + { 0, 0, -1800 }, { 0, 0, -1795 }, { 0, 0, -1791 }, { 0, 0, -1788 }, { 0, 0, -1784 }, + { 0, 0, -1782 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1782 }, + { 0, 0, -1784 }, { 0, 0, -1787 }, { 0, 0, -1790 }, { 0, 0, -1794 }, { 0, 0, -1798 }, + { 0, 0, -1802 }, { 0, 0, -1806 }, { 0, 0, -1809 }, { 0, 0, -1813 }, { 0, 0, -1816 }, + { 0, 0, -1818 }, { 0, 0, -1819 }, { 0, 0, -1820 }, { 0, 0, -1819 }, { 0, 0, -1817 }, + { 0, 0, -1815 }, { 0, 0, -1812 }, { 0, 0, -1808 }, { 0, 0, -1804 }, { 0, 0, -1800 }, + { 0, 0, -1795 }, { 0, 0, -1791 }, { 0, 0, -1788 }, { 0, 0, -1784 }, { 0, 0, -1782 }, + { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1780 }, { 0, 0, -1782 }, { 0, 0, -1785 }, + { 0, 0, -1789 }, { 0, 0, -1793 }, { 0, 0, -1797 }, { 0, 0, -1802 }, { 0, 0, -1806 }, + { 0, 0, -1811 }, { 0, 0, -1814 }, { 0, 0, -1817 }, { 0, 0, -1819 }, { 0, 0, -1820 }, + { 0, 0, -1819 }, { 0, 0, -1818 }, { 0, 0, -1815 }, { 0, 0, -1813 }, { 0, 0, -1809 }, + { 0, 0, -1805 }, { 0, 0, -1801 }, { 0, 0, -1797 }, { 0, 0, -1793 }, { 0, 0, -1790 }, + { 0, 0, -1786 }, { 0, 0, -1784 }, { 0, 0, -1781 }, { 0, 0, -1780 }, { 0, 0, -1780 }, + { 0, 0, -1780 }, { 0, 0, -1781 }, { 0, 0, -1783 }, { 0, 0, -1786 }, { 0, 0, -1789 }, + { 0, 0, -1792 }, { 0, 0, -1796 }, { 0, 0, -1799 }, { 0, 0, -1803 }, { 0, 0, -1807 }, + { 0, 0, -1810 }, { 0, 0, -1814 }, { 0, 0, -1817 }, { 0, 0, -1819 }, { 0, 0, -1821 }, + { 0, 0, -1822 }, { 0, 0, -1823 }, { 0, 0, -1823 }, { 0, 0, -1823 }, { 0, 0, -1822 }, + { 0, 0, -1822 }, { 0, 0, -1821 }, { 0, 0, -1820 }, { 0, 0, -1819 }, { 0, 0, -1817 }, + { 0, 0, -1816 }, { 0, 0, -1814 }, { 0, 0, -1813 }, { 0, 0, -1811 }, { 0, 0, -1809 }, + { 0, 0, -1807 }, { 0, 0, -1806 }, { 0, 0, -1804 }, { 0, 0, -1802 }, { 0, 0, -1800 }, + { 0, 0, -1798 }, { 0, 0, -1796 }, { 0, 0, -1794 }, { 0, 0, -1793 }, { 0, 0, -1791 }, + { 0, 0, -1790 }, { 0, 0, -1788 }, { 0, 0, -1787 }, { 0, 0, -1786 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1784 }, { 0, 0, -1783 }, { 0, 0, -1782 }, { 0, 0, -1781 }, + { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1778 }, { 0, 0, -1778 }, { 0, 0, -1777 }, + { 0, 0, -1777 }, { 0, 0, -1777 }, { 0, 0, -1777 }, { 0, 0, -1777 }, { 0, 0, -1778 }, + { 0, 0, -1779 }, { 0, 0, -1780 }, { 0, 0, -1781 }, { 0, 0, -1783 }, { 0, 0, -1785 }, + { 0, 0, -1788 }, { 0, 0, -1792 }, { 0, 0, -1796 }, { 0, 0, -1801 }, { 0, 0, -1806 }, + { 0, 0, -1812 }, { 0, 0, -1818 }, { 0, 0, -1824 }, { 0, 0, -1830 }, { 0, 0, -1837 }, + { 0, 0, -1843 }, { 0, 0, -1849 }, { 0, 0, -1855 }, { 0, 0, -1861 }, { 0, 0, -1866 }, + { 0, 0, -1871 }, { 0, 0, -1875 }, { 0, 0, -1878 }, { 0, 0, -1881 }, { 0, 0, -1883 }, + { 0, 0, -1884 }, { 0, 0, -1885 }, { 0, 0, -1886 }, { 0, 0, -1887 }, { 0, 0, -1888 }, + { 0, 0, -1889 }, { 0, 0, -1890 }, { 0, 0, -1891 }, { 0, 0, -1891 }, { 0, 0, -1892 }, + { 0, 0, -1892 }, { 0, 0, -1892 }, { 0, 0, -1893 }, { 0, 0, -1893 }, { 0, 0, -1893 }, + { 0, 0, -1893 }, { 0, 0, -1893 }, { 0, 0, -1893 }, { 0, 0, -1893 }, { 0, 0, -1893 }, + { 0, 0, -1893 }, { 0, 0, -1892 }, { 0, 0, -1892 }, { 0, 0, -1892 }, { 0, 0, -1891 }, + { 0, 0, -1891 }, { 0, 0, -1891 }, { 0, 0, -1890 }, { 0, 0, -1890 }, { 0, 0, -1889 }, + { 0, 0, -1889 }, { 0, 0, -1889 }, { 0, 0, -1888 }, { 0, 0, -1888 }, { 0, 0, -1887 }, + { 0, 0, -1887 }, { 0, 0, -1886 }, { 0, 0, -1886 }, { 0, 0, -1885 }, { 0, 0, -1885 }, + { 0, 0, -1885 }, { 0, 0, -1884 }, { 0, 0, -1884 }, { 0, 0, -1884 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, + { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1883 }, { 0, 0, -1885 }, { 0, 0, -1883 }, + { 0, 0, -1873 }, { 0, 0, -1862 }, { 0, 0, -1850 }, { 0, 0, -1837 }, { 0, 0, -1824 }, + { 0, 0, -1812 }, { 0, 0, -1801 }, { 0, 0, -1793 }, { 0, 0, -1787 }, { 0, 0, -1785 }, +}; + +static s16 animdata_mario_nose_2[][3] = { + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1784 }, { 0, 0, -1783 }, + { 0, 0, -1782 }, { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1777 }, { 0, 0, -1776 }, + { 0, 0, -1775 }, { 0, 0, -1774 }, { 0, 0, -1773 }, { 0, 0, -1772 }, { 0, 0, -1772 }, + { 0, 0, -1772 }, { 0, 0, -1773 }, { 0, 0, -1774 }, { 0, 0, -1776 }, { 0, 0, -1778 }, + { 0, 0, -1782 }, { 0, 0, -1785 }, { 0, 0, -1839 }, { 0, 0, -1883 }, { 0, 0, -1835 }, + { 0, 0, -1760 }, { 0, 0, -1717 }, { 0, 0, -1745 }, { 0, 0, -1807 }, { 0, 0, -1844 }, + { 0, 0, -1827 }, { 0, 0, -1786 }, { 0, 0, -1759 }, { 0, 0, -1766 }, { 0, 0, -1787 }, + { 0, 0, -1797 }, { 0, 0, -1783 }, { 0, 0, -1759 }, { 0, 0, -1745 }, { 0, 0, -1765 }, + { 0, 0, -1789 }, { 0, 0, -1792 }, { 0, 0, -1790 }, { 0, 0, -1787 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, +}; + +struct AnimDataInfo anim_mario_nose[] = { + { ARRAY_COUNT(animdata_mario_nose_1), GD_ANIM_ROT3S, animdata_mario_nose_1 }, + { ARRAY_COUNT(animdata_mario_nose_2), GD_ANIM_ROT3S, animdata_mario_nose_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_lips_5_1[][3] = { + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -307 }, + { 0, 0, -306 }, { 0, 0, -304 }, { 0, 0, -302 }, { 0, 0, -300 }, { 0, 0, -297 }, { 0, 0, -295 }, + { 0, 0, -292 }, { 0, 0, -289 }, { 0, 0, -286 }, { 0, 0, -283 }, { 0, 0, -280 }, { 0, 0, -276 }, + { 0, 0, -273 }, { 0, 0, -269 }, { 0, 0, -266 }, { 0, 0, -262 }, { 0, 0, -258 }, { 0, 0, -255 }, + { 0, 0, -251 }, { 0, 0, -248 }, { 0, 0, -244 }, { 0, 0, -240 }, { 0, 0, -237 }, { 0, 0, -234 }, + { 0, 0, -230 }, { 0, 0, -227 }, { 0, 0, -224 }, { 0, 0, -221 }, { 0, 0, -218 }, { 0, 0, -216 }, + { 0, 0, -213 }, { 0, 0, -211 }, { 0, 0, -209 }, { 0, 0, -207 }, { 0, 0, -206 }, { 0, 0, -205 }, + { 0, 0, -204 }, { 0, 0, -203 }, { 0, 0, -202 }, { 0, 0, -202 }, { 0, 0, -203 }, { 0, 0, -204 }, + { 0, 0, -207 }, { 0, 0, -211 }, { 0, 0, -215 }, { 0, 0, -221 }, { 0, 0, -226 }, { 0, 0, -233 }, + { 0, 0, -239 }, { 0, 0, -246 }, { 0, 0, -253 }, { 0, 0, -260 }, { 0, 0, -267 }, { 0, 0, -274 }, + { 0, 0, -281 }, { 0, 0, -287 }, { 0, 0, -293 }, { 0, 0, -298 }, { 0, 0, -302 }, { 0, 0, -306 }, + { 0, 0, -309 }, { 0, 0, -310 }, { 0, 0, -311 }, { 0, 0, -302 }, { 0, 0, -277 }, { 0, 0, -242 }, + { 0, 0, -202 }, { 0, 0, -163 }, { 0, 0, -131 }, { 0, 0, -101 }, { 0, 0, -70 }, { 0, 0, -40 }, + { 0, 0, -12 }, { 0, 0, 10 }, { 0, 0, 26 }, { 0, 0, 37 }, { 0, 0, 44 }, { 0, 0, 49 }, + { 0, 0, 49 }, { 0, 0, 46 }, { 0, 0, 38 }, { 0, 0, 26 }, { 0, 0, 3 }, { 0, 0, -31 }, + { 0, 0, -73 }, { 0, 0, -113 }, { 0, 0, -145 }, { 0, 0, -162 }, { 0, 0, -169 }, { 0, 0, -173 }, + { 0, 0, -176 }, { 0, 0, -177 }, { 0, 0, -176 }, { 0, 0, -175 }, { 0, 0, -172 }, { 0, 0, -169 }, + { 0, 0, -166 }, { 0, 0, -162 }, { 0, 0, -159 }, { 0, 0, -156 }, { 0, 0, -154 }, { 0, 0, -152 }, + { 0, 0, -152 }, { 0, 0, -154 }, { 0, 0, -157 }, { 0, 0, -162 }, { 0, 0, -176 }, { 0, 0, -201 }, + { 0, 0, -233 }, { 0, 0, -265 }, { 0, 0, -293 }, { 0, 0, -311 }, { 0, 0, -322 }, { 0, 0, -333 }, + { 0, 0, -343 }, { 0, 0, -353 }, { 0, 0, -362 }, { 0, 0, -371 }, { 0, 0, -378 }, { 0, 0, -386 }, + { 0, 0, -392 }, { 0, 0, -398 }, { 0, 0, -403 }, { 0, 0, -407 }, { 0, 0, -410 }, { 0, 0, -412 }, + { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -413 }, { 0, 0, -412 }, + { 0, 0, -411 }, { 0, 0, -409 }, { 0, 0, -408 }, { 0, 0, -406 }, { 0, 0, -404 }, { 0, 0, -401 }, + { 0, 0, -399 }, { 0, 0, -396 }, { 0, 0, -394 }, { 0, 0, -391 }, { 0, 0, -388 }, { 0, 0, -385 }, + { 0, 0, -381 }, { 0, 0, -378 }, { 0, 0, -375 }, { 0, 0, -371 }, { 0, 0, -368 }, { 0, 0, -365 }, + { 0, 0, -361 }, { 0, 0, -358 }, { 0, 0, -354 }, { 0, 0, -351 }, { 0, 0, -348 }, { 0, 0, -344 }, + { 0, 0, -341 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, { 0, 0, -329 }, { 0, 0, -326 }, + { 0, 0, -324 }, { 0, 0, -321 }, { 0, 0, -319 }, { 0, 0, -317 }, { 0, 0, -315 }, { 0, 0, -314 }, + { 0, 0, -312 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -313 }, { 0, 0, -316 }, { 0, 0, -320 }, + { 0, 0, -325 }, { 0, 0, -331 }, { 0, 0, -336 }, { 0, 0, -342 }, { 0, 0, -347 }, { 0, 0, -351 }, + { 0, 0, -355 }, { 0, 0, -357 }, { 0, 0, -357 }, { 0, 0, -356 }, { 0, 0, -355 }, { 0, 0, -354 }, + { 0, 0, -353 }, { 0, 0, -352 }, { 0, 0, -350 }, { 0, 0, -349 }, { 0, 0, -347 }, { 0, 0, -345 }, + { 0, 0, -343 }, { 0, 0, -340 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, { 0, 0, -329 }, + { 0, 0, -325 }, { 0, 0, -322 }, { 0, 0, -318 }, { 0, 0, -314 }, { 0, 0, -309 }, { 0, 0, -304 }, + { 0, 0, -299 }, { 0, 0, -294 }, { 0, 0, -288 }, { 0, 0, -282 }, { 0, 0, -268 }, { 0, 0, -243 }, + { 0, 0, -213 }, { 0, 0, -188 }, { 0, 0, -174 }, { 0, 0, -168 }, { 0, 0, -164 }, { 0, 0, -160 }, + { 0, 0, -158 }, { 0, 0, -156 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, + { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -158 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, + { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -161 }, + { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -165 }, + { 0, 0, -166 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -170 }, + { 0, 0, -171 }, { 0, 0, -171 }, { 0, 0, -172 }, { 0, 0, -172 }, { 0, 0, -173 }, { 0, 0, -173 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, + { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, + { 0, 0, -175 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -175 }, { 0, 0, -176 }, { 0, 0, -178 }, { 0, 0, -179 }, { 0, 0, -180 }, { 0, 0, -182 }, + { 0, 0, -183 }, { 0, 0, -184 }, { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -185 }, + { 0, 0, -184 }, { 0, 0, -182 }, { 0, 0, -180 }, { 0, 0, -177 }, { 0, 0, -174 }, { 0, 0, -148 }, + { 0, 0, -105 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -77 }, + { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, + { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, + { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -70 }, + { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -71 }, + { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, + { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, { 0, 0, -76 }, { 0, 0, -76 }, + { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -79 }, + { 0, 0, -79 }, { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, + { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, + { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, { 0, 0, -80 }, + { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, + { 0, 0, -80 }, { 0, 0, -82 }, { 0, 0, -85 }, { 0, 0, -88 }, { 0, 0, -93 }, { 0, 0, -97 }, + { 0, 0, -102 }, { 0, 0, -107 }, { 0, 0, -113 }, { 0, 0, -118 }, { 0, 0, -124 }, { 0, 0, -129 }, + { 0, 0, -135 }, { 0, 0, -140 }, { 0, 0, -145 }, { 0, 0, -149 }, { 0, 0, -152 }, { 0, 0, -155 }, + { 0, 0, -158 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -163 }, + { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -166 }, + { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, + { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, + { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -166 }, + { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -164 }, + { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -162 }, + { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -160 }, + { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -159 }, + { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, + { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, + { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -167 }, + { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -169 }, { 0, 0, -170 }, + { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, + { 0, 0, -170 }, { 0, 0, -169 }, { 0, 0, -169 }, { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, + { 0, 0, -165 }, { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -161 }, { 0, 0, -159 }, { 0, 0, -157 }, + { 0, 0, -152 }, { 0, 0, -146 }, { 0, 0, -139 }, { 0, 0, -132 }, { 0, 0, -123 }, { 0, 0, -114 }, + { 0, 0, -105 }, { 0, 0, -96 }, { 0, 0, -87 }, { 0, 0, -79 }, { 0, 0, -71 }, { 0, 0, -64 }, + { 0, 0, -59 }, { 0, 0, -54 }, { 0, 0, -50 }, { 0, 0, -46 }, { 0, 0, -42 }, { 0, 0, -39 }, + { 0, 0, -36 }, { 0, 0, -33 }, { 0, 0, -30 }, { 0, 0, -28 }, { 0, 0, -26 }, { 0, 0, -25 }, + { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -24 }, + { 0, 0, -26 }, { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, + { 0, 0, -48 }, { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, + { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -55 }, { 0, 0, -52 }, { 0, 0, -49 }, { 0, 0, -46 }, + { 0, 0, -42 }, { 0, 0, -39 }, { 0, 0, -35 }, { 0, 0, -31 }, { 0, 0, -28 }, { 0, 0, -26 }, + { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -24 }, { 0, 0, -26 }, + { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, { 0, 0, -48 }, + { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -58 }, + { 0, 0, -57 }, { 0, 0, -54 }, { 0, 0, -51 }, { 0, 0, -47 }, { 0, 0, -43 }, { 0, 0, -38 }, + { 0, 0, -34 }, { 0, 0, -30 }, { 0, 0, -27 }, { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -22 }, { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -28 }, + { 0, 0, -30 }, { 0, 0, -33 }, { 0, 0, -35 }, { 0, 0, -39 }, { 0, 0, -42 }, { 0, 0, -46 }, + { 0, 0, -50 }, { 0, 0, -54 }, { 0, 0, -59 }, { 0, 0, -64 }, { 0, 0, -69 }, { 0, 0, -74 }, + { 0, 0, -79 }, { 0, 0, -85 }, { 0, 0, -90 }, { 0, 0, -96 }, { 0, 0, -102 }, { 0, 0, -107 }, + { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -137 }, { 0, 0, -144 }, + { 0, 0, -150 }, { 0, 0, -156 }, { 0, 0, -162 }, { 0, 0, -168 }, { 0, 0, -175 }, { 0, 0, -181 }, + { 0, 0, -187 }, { 0, 0, -193 }, { 0, 0, -200 }, { 0, 0, -206 }, { 0, 0, -212 }, { 0, 0, -218 }, + { 0, 0, -224 }, { 0, 0, -230 }, { 0, 0, -236 }, { 0, 0, -242 }, { 0, 0, -247 }, { 0, 0, -253 }, + { 0, 0, -259 }, { 0, 0, -264 }, { 0, 0, -269 }, { 0, 0, -275 }, { 0, 0, -280 }, { 0, 0, -285 }, + { 0, 0, -289 }, { 0, 0, -294 }, { 0, 0, -299 }, { 0, 0, -303 }, { 0, 0, -307 }, { 0, 0, -311 }, + { 0, 0, -315 }, { 0, 0, -318 }, { 0, 0, -321 }, { 0, 0, -324 }, { 0, 0, -326 }, { 0, 0, -329 }, + { 0, 0, -330 }, { 0, 0, -331 }, { 0, 0, -332 }, { 0, 0, -333 }, { 0, 0, -333 }, { 0, 0, -332 }, + { 0, 0, -331 }, { 0, 0, -330 }, { 0, 0, -328 }, { 0, 0, -326 }, { 0, 0, -323 }, { 0, 0, -320 }, + { 0, 0, -316 }, { 0, 0, -311 }, { 0, 0, -305 }, { 0, 0, -296 }, { 0, 0, -285 }, { 0, 0, -272 }, + { 0, 0, -258 }, { 0, 0, -243 }, { 0, 0, -228 }, { 0, 0, -212 }, { 0, 0, -197 }, { 0, 0, -182 }, + { 0, 0, -168 }, { 0, 0, -156 }, { 0, 0, -144 }, { 0, 0, -130 }, { 0, 0, -116 }, { 0, 0, -104 }, + { 0, 0, -93 }, { 0, 0, -86 }, { 0, 0, -84 }, { 0, 0, -88 }, { 0, 0, -100 }, { 0, 0, -123 }, + { 0, 0, -151 }, { 0, 0, -182 }, { 0, 0, -213 }, { 0, 0, -240 }, { 0, 0, -261 }, { 0, 0, -271 }, + { 0, 0, -275 }, { 0, 0, -278 }, { 0, 0, -281 }, { 0, 0, -284 }, { 0, 0, -286 }, { 0, 0, -288 }, + { 0, 0, -289 }, { 0, 0, -291 }, { 0, 0, -292 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, + { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -292 }, { 0, 0, -292 }, { 0, 0, -291 }, + { 0, 0, -290 }, { 0, 0, -289 }, { 0, 0, -288 }, { 0, 0, -286 }, { 0, 0, -285 }, { 0, 0, -284 }, + { 0, 0, -283 }, { 0, 0, -281 }, { 0, 0, -280 }, { 0, 0, -279 }, { 0, 0, -277 }, { 0, 0, -276 }, + { 0, 0, -275 }, { 0, 0, -274 }, { 0, 0, -273 }, { 0, 0, -272 }, { 0, 0, -272 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -270 }, { 0, 0, -271 }, + { 0, 0, -275 }, { 0, 0, -279 }, { 0, 0, -284 }, { 0, 0, -290 }, { 0, 0, -295 }, { 0, 0, -300 }, + { 0, 0, -304 }, { 0, 0, -308 }, { 0, 0, -310 }, { 0, 0, -311 }, +}; + +static s16 animdata_mario_lips_5_2[][3] = { + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -308 }, + { 0, 0, -307 }, { 0, 0, -306 }, { 0, 0, -305 }, { 0, 0, -303 }, { 0, 0, -302 }, { 0, 0, -300 }, + { 0, 0, -299 }, { 0, 0, -297 }, { 0, 0, -296 }, { 0, 0, -294 }, { 0, 0, -293 }, { 0, 0, -292 }, + { 0, 0, -290 }, { 0, 0, -289 }, { 0, 0, -289 }, { 0, 0, -288 }, { 0, 0, -287 }, { 0, 0, -287 }, + { 0, 0, -287 }, { 0, 0, -288 }, { 0, 0, -288 }, { 0, 0, -289 }, { 0, 0, -290 }, { 0, 0, -292 }, + { 0, 0, -294 }, { 0, 0, -297 }, { 0, 0, -300 }, { 0, 0, -303 }, { 0, 0, -307 }, { 0, 0, -311 }, + { 0, 0, -333 }, { 0, 0, -379 }, { 0, 0, -432 }, { 0, 0, -476 }, { 0, 0, -494 }, { 0, 0, -466 }, + { 0, 0, -403 }, { 0, 0, -340 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, +}; + +struct AnimDataInfo anim_mario_lips_5[] = { + { ARRAY_COUNT(animdata_mario_lips_5_1), GD_ANIM_ROT3S, animdata_mario_lips_5_1 }, + { ARRAY_COUNT(animdata_mario_lips_5_2), GD_ANIM_ROT3S, animdata_mario_lips_5_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_lip_6_1[][3] = { + { 0, 0, -1115 }, { 0, 0, -1116 }, { 0, 0, -1117 }, { 0, 0, -1119 }, + { 0, 0, -1122 }, { 0, 0, -1125 }, { 0, 0, -1129 }, { 0, 0, -1133 }, + { 0, 0, -1137 }, { 0, 0, -1142 }, { 0, 0, -1146 }, { 0, 0, -1151 }, + { 0, 0, -1155 }, { 0, 0, -1159 }, { 0, 0, -1163 }, { 0, 0, -1166 }, + { 0, 0, -1169 }, { 0, 0, -1171 }, { 0, 0, -1172 }, { 0, 0, -1171 }, + { 0, 0, -1167 }, { 0, 0, -1160 }, { 0, 0, -1152 }, { 0, 0, -1143 }, + { 0, 0, -1136 }, { 0, 0, -1131 }, { 0, 0, -1129 }, { 0, 0, -1131 }, + { 0, 0, -1138 }, { 0, 0, -1150 }, { 0, 0, -1167 }, { 0, 0, -1187 }, + { 0, 0, -1209 }, { 0, 0, -1233 }, { 0, 0, -1259 }, { 0, 0, -1285 }, + { 0, 0, -1310 }, { 0, 0, -1335 }, { 0, 0, -1358 }, { 0, 0, -1378 }, + { 0, 0, -1395 }, { 0, 0, -1408 }, { 0, 0, -1417 }, { 0, 0, -1374 }, + { 0, 0, -1287 }, { 0, 0, -1241 }, { 1, 1, -1247 }, { 3, 3, -1257 }, + { 4, 4, -1272 }, { 6, 6, -1290 }, { 8, 8, -1310 }, { 10, 10, -1332 }, + { 13, 12, -1355 }, { 15, 14, -1378 }, { 16, 16, -1400 }, { 18, 18, -1420 }, + { 20, 19, -1438 }, { 21, 21, -1451 }, { 22, 22, -1461 }, { 23, 22, -1465 }, + { 23, 22, -1463 }, { 22, 21, -1444 }, { 19, 19, -1402 }, { 15, 15, -1346 }, + { 11, 11, -1283 }, { 7, 7, -1221 }, { 3, 3, -1167 }, { 0, 0, -1129 }, + { 0, 0, -1115 }, { 0, 0, -1106 }, { 0, 0, -1115 }, { 0, 0, -1154 }, + { 0, 0, -1199 }, { 0, 0, -1246 }, { 0, 0, -1296 }, { 0, 0, -1346 }, + { 0, 0, -1395 }, { 0, 0, -1442 }, { 0, 0, -1484 }, { 0, 0, -1521 }, + { 0, 0, -1551 }, { 0, 0, -1572 }, { 2, 2, -1586 }, { 3, 4, -1592 }, + { 4, 5, -1591 }, { 5, 5, -1584 }, { 3, 4, -1570 }, { 0, 0, -1551 }, + { -7, -9, -1515 }, { -19, -23, -1461 }, { -33, -40, -1397 }, { -47, -56, -1336 }, + { -58, -69, -1286 }, { -64, -76, -1260 }, { -66, -79, -1249 }, { -68, -82, -1242 }, + { -70, -84, -1237 }, { -72, -86, -1234 }, { -73, -87, -1234 }, { -74, -89, -1235 }, + { -75, -89, -1238 }, { -75, -90, -1242 }, { -76, -90, -1246 }, { -75, -90, -1251 }, + { -75, -89, -1255 }, { -74, -89, -1260 }, { -73, -87, -1263 }, { -72, -86, -1266 }, + { -70, -84, -1267 }, { -68, -82, -1267 }, { -66, -79, -1264 }, { -64, -76, -1260 }, + { -57, -68, -1244 }, { -46, -55, -1215 }, { -32, -38, -1180 }, { -18, -21, -1146 }, + { -6, -7, -1122 }, { 0, 0, -1115 }, { 2, 3, -1121 }, { 4, 5, -1131 }, + { 5, 6, -1143 }, { 6, 7, -1159 }, { 6, 8, -1176 }, { 6, 8, -1195 }, + { 6, 7, -1214 }, { 5, 6, -1235 }, { 5, 5, -1255 }, { 4, 4, -1274 }, + { 3, 3, -1293 }, { 2, 2, -1309 }, { 1, 1, -1324 }, { 0, 0, -1336 }, + { 0, 0, -1345 }, { 0, 0, -1350 }, { 0, 0, -1353 }, { 0, 0, -1355 }, + { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1355 }, + { 0, 0, -1354 }, { 0, 0, -1352 }, { 0, 0, -1349 }, { 0, 0, -1346 }, + { 0, 0, -1342 }, { 0, 0, -1338 }, { 0, 0, -1334 }, { 0, 0, -1329 }, + { 0, 0, -1324 }, { 0, 0, -1319 }, { 0, 0, -1313 }, { 0, 0, -1307 }, + { 0, 0, -1301 }, { 0, 0, -1295 }, { 0, 0, -1288 }, { 0, 0, -1282 }, + { 0, 0, -1275 }, { 0, 0, -1269 }, { 0, 0, -1262 }, { 0, 0, -1255 }, + { 0, 0, -1249 }, { 0, 0, -1217 }, { 0, 0, -1169 }, { 0, 0, -1157 }, + { 0, 0, -1231 }, { 0, 0, -1341 }, { 0, 0, -1396 }, { 0, 0, -1387 }, + { 0, 0, -1367 }, { 0, 0, -1339 }, { 0, 0, -1306 }, { 0, 0, -1268 }, + { 0, 0, -1228 }, { 0, 0, -1188 }, { 0, 0, -1149 }, { 0, 0, -1115 }, + { 0, 0, -1078 }, { 0, 0, -1035 }, { 0, 0, -995 }, { 0, 0, -965 }, + { 0, 0, -953 }, { 0, 0, -960 }, { 0, 0, -977 }, { 0, 0, -1001 }, + { 0, 0, -1029 }, { 0, 0, -1058 }, { 0, 0, -1084 }, { 0, 0, -1104 }, + { 0, 0, -1115 }, { 0, 0, -1120 }, { 0, 0, -1123 }, { 0, 0, -1126 }, + { 0, 0, -1128 }, { 0, 0, -1129 }, { 0, 0, -1130 }, { 0, 0, -1130 }, + { 0, 0, -1130 }, { 0, 0, -1130 }, { 0, 0, -1129 }, { 0, 0, -1127 }, + { 0, 0, -1126 }, { 0, 0, -1124 }, { 0, 0, -1122 }, { 0, 0, -1121 }, + { 0, 0, -1119 }, { 0, 0, -1117 }, { 0, 0, -1116 }, { 0, 0, -1114 }, + { 0, 0, -1114 }, { 0, 0, -1113 }, { 0, 0, -1113 }, { 0, 0, -1113 }, + { 0, 0, -1114 }, { 0, 0, -1115 }, { 0, 0, -1123 }, { 0, 0, -1137 }, + { 0, 0, -1154 }, { 0, 0, -1166 }, { 0, 0, -1167 }, { 0, 0, -1157 }, + { 0, 0, -1143 }, { 0, 0, -1125 }, { 0, 0, -1105 }, { 0, 0, -1084 }, + { 0, 0, -1064 }, { 0, 0, -1048 }, { 0, 0, -1035 }, { 0, 0, -1026 }, + { 0, 0, -1021 }, { 0, -1, -1018 }, { 1, -1, -1016 }, { 1, -2, -1016 }, + { 1, -2, -1016 }, { 1, -3, -1016 }, { 2, -3, -1016 }, { 2, -3, -1016 }, + { 2, -3, -1015 }, { 2, -4, -1015 }, { 3, -5, -1014 }, { 3, -5, -1013 }, + { 4, -6, -1013 }, { 4, -7, -1012 }, { 5, -8, -1011 }, { 5, -9, -1011 }, + { 6, -9, -1010 }, { 6, -10, -1010 }, { 7, -11, -1010 }, { 7, -11, -1010 }, + { 7, -11, -1010 }, { 7, -11, -1011 }, { 7, -11, -1012 }, { 7, -11, -1013 }, + { 7, -10, -1015 }, { 6, -9, -1017 }, { 5, -8, -1019 }, { 4, -7, -1022 }, + { 3, -5, -1026 }, { 1, -2, -1030 }, { 0, 0, -1035 }, { -2, 3, -1041 }, + { -5, 7, -1048 }, { -8, 12, -1058 }, { -12, 18, -1068 }, { -17, 24, -1080 }, + { -22, 31, -1092 }, { -27, 38, -1105 }, { -33, 46, -1119 }, { -38, 54, -1133 }, + { -44, 62, -1147 }, { -49, 70, -1161 }, { -55, 78, -1174 }, { -60, 86, -1187 }, + { -65, 93, -1199 }, { -70, 101, -1210 }, { -74, 108, -1219 }, { -78, 114, -1228 }, + { -81, 120, -1234 }, { -83, 126, -1239 }, { -85, 130, -1242 }, { -86, 135, -1241 }, + { -86, 139, -1235 }, { -86, 143, -1226 }, { -84, 147, -1213 }, { -82, 150, -1199 }, + { -80, 153, -1182 }, { -77, 156, -1165 }, { -74, 158, -1148 }, { -71, 159, -1132 }, + { -67, 160, -1117 }, { -63, 159, -1104 }, { -59, 158, -1094 }, { -55, 156, -1088 }, + { -52, 152, -1086 }, { -48, 148, -1089 }, { -44, 140, -1102 }, { -38, 128, -1127 }, + { -32, 113, -1161 }, { -25, 95, -1201 }, { -18, 76, -1243 }, { -11, 57, -1286 }, + { -6, 39, -1326 }, { -2, 22, -1359 }, { 0, 9, -1383 }, { 0, 0, -1396 }, + { -2, -6, -1397 }, { -6, -10, -1392 }, { -12, -12, -1381 }, { -19, -13, -1365 }, + { -27, -13, -1346 }, { -35, -13, -1324 }, { -44, -11, -1301 }, { -53, -10, -1278 }, + { -61, -8, -1256 }, { -68, -7, -1236 }, { -74, -6, -1219 }, { -79, -6, -1206 }, + { -83, -6, -1200 }, { -86, -6, -1198 }, { -88, -7, -1200 }, { -89, -7, -1203 }, + { -87, -7, -1207 }, { -84, -6, -1208 }, { -79, -6, -1206 }, { -70, -5, -1200 }, + { -55, -4, -1190 }, { -37, -2, -1179 }, { -20, -1, -1167 }, { -7, 0, -1157 }, + { 0, 0, -1149 }, { 2, 0, -1144 }, { 4, 0, -1137 }, { 6, 0, -1131 }, + { 7, 0, -1124 }, { 8, 0, -1117 }, { 9, 0, -1110 }, { 9, 0, -1103 }, + { 9, 0, -1096 }, { 8, 0, -1089 }, { 8, 0, -1082 }, { 7, 0, -1076 }, + { 7, 0, -1070 }, { 6, 0, -1064 }, { 5, 0, -1059 }, { 4, 0, -1055 }, + { 3, 0, -1051 }, { 2, 0, -1048 }, { 1, 0, -1046 }, { 1, 0, -1044 }, + { 0, 0, -1044 }, { 0, 0, -1045 }, { 0, 0, -1046 }, { 0, 0, -1049 }, + { 0, 0, -1053 }, { 0, 0, -1058 }, { 0, 0, -1063 }, { 0, 0, -1069 }, + { 0, 0, -1076 }, { 0, 0, -1084 }, { 0, 0, -1092 }, { 0, 0, -1100 }, + { 0, 0, -1109 }, { 0, 0, -1119 }, { 0, 0, -1128 }, { 0, 0, -1138 }, + { 0, 0, -1148 }, { 0, 0, -1158 }, { 0, 0, -1169 }, { 0, 0, -1179 }, + { 0, 0, -1189 }, { 0, 0, -1199 }, { 0, 0, -1208 }, { 0, 0, -1218 }, + { 0, 0, -1227 }, { 0, 0, -1235 }, { 0, 0, -1243 }, { 0, 0, -1251 }, + { 0, 0, -1258 }, { 0, 0, -1264 }, { 0, 0, -1270 }, { 0, 0, -1276 }, + { 0, 0, -1281 }, { 0, 0, -1285 }, { 0, 0, -1288 }, { 0, 0, -1288 }, + { 0, 0, -1287 }, { 0, 0, -1282 }, { 0, 0, -1275 }, { 0, 0, -1264 }, + { 0, 0, -1231 }, { 0, 0, -1173 }, { 0, 0, -1116 }, { 0, 0, -1084 }, + { 0, 0, -1073 }, { 0, 0, -1062 }, { 0, 0, -1052 }, { 0, 0, -1043 }, + { 0, 0, -1036 }, { 0, 0, -1032 }, { 0, 0, -1030 }, { 0, 0, -1032 }, + { 0, 0, -1038 }, { 0, 0, -1048 }, { 0, 0, -1063 }, { 0, 0, -1084 }, + { 0, 0, -1132 }, { 0, 0, -1215 }, { 0, 0, -1315 }, { 0, 0, -1409 }, + { 0, 0, -1479 }, { 0, 0, -1505 }, { 0, 0, -1493 }, { 0, 0, -1468 }, + { 0, 0, -1432 }, { 0, 0, -1387 }, { 0, -1, -1336 }, { 1, -1, -1281 }, + { 1, -1, -1225 }, { 1, -2, -1170 }, { 1, -2, -1120 }, { 1, -2, -1075 }, + { 1, -2, -1040 }, { 1, -3, -1016 }, { 2, -3, -1001 }, { 2, -3, -989 }, + { 2, -3, -980 }, { 2, -3, -974 }, { 2, -3, -971 }, { 2, -3, -971 }, + { 2, -3, -972 }, { 2, -3, -975 }, { 2, -3, -979 }, { 2, -3, -984 }, + { 2, -3, -990 }, { 1, -3, -996 }, { 1, -3, -1002 }, { 1, -3, -1007 }, + { 1, -3, -1012 }, { 1, -3, -1016 }, { 1, -3, -1019 }, { 2, -2, -1021 }, + { 2, -2, -1024 }, { 2, -2, -1027 }, { 2, -2, -1030 }, { 2, -2, -1035 }, + { 2, -2, -1041 }, { 2, -2, -1049 }, { 2, -2, -1059 }, { 2, -2, -1072 }, + { 2, -2, -1088 }, { 2, -2, -1108 }, { 2, -2, -1139 }, { 2, -2, -1185 }, + { 2, -1, -1241 }, { 3, -1, -1300 }, { 3, -1, -1356 }, { 3, -1, -1403 }, + { 3, 0, -1434 }, { 3, 0, -1443 }, { 3, -1, -1416 }, { 3, -1, -1351 }, + { 2, -1, -1266 }, { 2, -2, -1178 }, { 2, -2, -1104 }, { 2, -2, -1062 }, + { 2, -2, -1045 }, { 2, -2, -1036 }, { 2, -3, -1033 }, { 2, -3, -1036 }, + { 2, -2, -1042 }, { 2, -2, -1050 }, { 2, -2, -1058 }, { 2, -2, -1066 }, + { 2, -2, -1072 }, { 2, -2, -1074 }, { 2, -2, -1071 }, { 2, -2, -1062 }, + { 1, -3, -1005 }, { 1, -3, -914 }, { 1, -3, -867 }, { 1, -3, -870 }, + { 1, -3, -875 }, { 1, -3, -883 }, { 1, -3, -894 }, { 1, -3, -906 }, + { 1, -3, -920 }, { 1, -3, -935 }, { 1, -3, -951 }, { 1, -3, -968 }, + { 1, -3, -986 }, { 1, -2, -1003 }, { 1, -2, -1021 }, { 2, -2, -1038 }, + { 2, -2, -1055 }, { 2, -2, -1071 }, { 2, -2, -1086 }, { 2, -2, -1102 }, + { 2, -2, -1119 }, { 2, -2, -1135 }, { 2, -2, -1148 }, { 2, -2, -1158 }, + { 2, -2, -1167 }, { 2, -2, -1177 }, { 2, -2, -1186 }, { 2, -2, -1195 }, + { 2, -2, -1203 }, { 2, -2, -1212 }, { 2, -2, -1220 }, { 2, -2, -1228 }, + { 2, -2, -1235 }, { 2, -2, -1243 }, { 2, -1, -1250 }, { 3, -1, -1257 }, + { 3, -1, -1263 }, { 3, -1, -1265 }, { 3, -1, -1257 }, { 2, -2, -1240 }, + { 2, -2, -1220 }, { 2, -2, -1198 }, { 2, -2, -1174 }, { 2, -2, -1149 }, + { 2, -2, -1123 }, { 2, -2, -1099 }, { 2, -2, -1076 }, { 2, -2, -1054 }, + { 2, -2, -1036 }, { 2, -2, -1022 }, { 1, -3, -1013 }, { 1, -3, -1008 }, + { 1, -3, -1010 }, { 1, -2, -1020 }, { 2, -2, -1038 }, { 2, -2, -1062 }, + { 2, -2, -1092 }, { 2, -2, -1126 }, { 2, -2, -1163 }, { 2, -2, -1201 }, + { 2, -1, -1240 }, { 2, -1, -1278 }, { 3, -1, -1313 }, { 3, -1, -1345 }, + { 3, -1, -1372 }, { 3, -1, -1393 }, { 3, -1, -1407 }, { 3, -1, -1411 }, + { 3, -1, -1406 }, { 3, -1, -1389 }, { 3, -1, -1364 }, { 3, -1, -1332 }, + { 3, -1, -1294 }, { 2, -1, -1254 }, { 2, -2, -1211 }, { 2, -2, -1168 }, + { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, { 2, -2, -1033 }, + { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -3, -1015 }, { 2, -2, -1030 }, + { 2, -2, -1052 }, { 2, -2, -1081 }, { 2, -2, -1114 }, { 2, -2, -1151 }, + { 2, -2, -1191 }, { 2, -1, -1231 }, { 2, -1, -1270 }, { 3, -1, -1307 }, + { 3, -1, -1341 }, { 3, -1, -1370 }, { 3, -1, -1392 }, { 3, -1, -1406 }, + { 3, -1, -1411 }, { 3, -1, -1406 }, { 3, -1, -1389 }, { 3, -1, -1364 }, + { 3, -1, -1332 }, { 3, -1, -1294 }, { 2, -1, -1254 }, { 2, -2, -1211 }, + { 2, -2, -1168 }, { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, + { 2, -2, -1033 }, { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -2, -1017 }, + { 2, -2, -1036 }, { 2, -2, -1065 }, { 2, -2, -1101 }, { 2, -2, -1143 }, + { 2, -2, -1188 }, { 2, -1, -1234 }, { 2, -1, -1279 }, { 3, -1, -1321 }, + { 3, -1, -1357 }, { 3, -1, -1386 }, { 3, -1, -1405 }, { 3, -1, -1411 }, + { 3, -1, -1407 }, { 3, -1, -1393 }, { 3, -1, -1372 }, { 3, -1, -1345 }, + { 3, -1, -1313 }, { 2, -1, -1277 }, { 2, -1, -1239 }, { 2, -2, -1201 }, + { 2, -2, -1162 }, { 2, -2, -1125 }, { 2, -2, -1091 }, { 2, -2, -1062 }, + { 2, -2, -1037 }, { 2, -3, -1020 }, { 1, -3, -1010 }, { 1, -3, -1006 }, + { 1, -2, -1002 }, { 1, -2, -998 }, { 1, -2, -996 }, { 1, -2, -994 }, + { 1, -2, -992 }, { 1, -2, -991 }, { 1, -2, -990 }, { 1, -2, -990 }, + { 1, -2, -991 }, { 1, -2, -992 }, { 1, -2, -993 }, { 1, -2, -995 }, + { 1, -2, -997 }, { 1, -2, -999 }, { 1, -2, -1002 }, { 1, -2, -1005 }, + { 1, -2, -1008 }, { 0, -1, -1012 }, { 0, -1, -1016 }, { 0, -1, -1020 }, + { 0, -1, -1024 }, { 0, -1, -1028 }, { 0, -1, -1032 }, { 0, -1, -1037 }, + { 0, -1, -1042 }, { 0, -1, -1046 }, { 0, -1, -1051 }, { 0, -1, -1056 }, + { 0, -1, -1061 }, { 0, 0, -1065 }, { 0, 0, -1070 }, { 0, 0, -1075 }, + { 0, 0, -1079 }, { 0, 0, -1084 }, { 0, 0, -1088 }, { 0, 0, -1092 }, + { 0, 0, -1096 }, { 0, 0, -1099 }, { 0, 0, -1103 }, { 0, 0, -1106 }, + { 0, 0, -1109 }, { 0, 0, -1111 }, { 0, 0, -1113 }, { 0, 0, -1115 }, + { 0, 0, -1116 }, { 0, 0, -1116 }, { 0, 0, -1115 }, { 0, 0, -1114 }, + { 0, 0, -1112 }, { 0, 0, -1109 }, { 0, 0, -1107 }, { 0, 0, -1104 }, + { 0, 0, -1101 }, { 0, 0, -1098 }, { 0, 0, -1096 }, { 0, 0, -1094 }, + { 0, 0, -1093 }, { 0, 0, -1092 }, { 0, 0, -1093 }, { 0, 0, -1095 }, + { 0, 0, -1098 }, { 0, 0, -1102 }, { 0, 0, -1108 }, { 0, 0, -1115 }, + { 0, 0, -1128 }, { 0, 0, -1148 }, { 0, 0, -1174 }, { 0, 0, -1205 }, + { 0, 0, -1237 }, { 0, 0, -1270 }, { 0, 0, -1301 }, { 0, 0, -1329 }, + { 0, 0, -1352 }, { 0, 0, -1368 }, { 0, 0, -1375 }, { 0, 0, -1372 }, + { 0, 0, -1361 }, { 0, 0, -1342 }, { 0, 0, -1318 }, { 0, 0, -1290 }, + { 0, 0, -1258 }, { 0, 0, -1225 }, { 0, 0, -1192 }, { 0, 0, -1161 }, + { 0, 0, -1127 }, { 0, 0, -1086 }, { 0, 0, -1041 }, { 0, 0, -996 }, + { 0, 0, -953 }, { 0, 0, -914 }, { 0, 0, -883 }, { 0, 0, -863 }, + { 0, 0, -849 }, { 0, 0, -836 }, { 0, 0, -823 }, { 0, 0, -813 }, + { 0, 0, -804 }, { 0, 0, -798 }, { 0, 0, -795 }, { 0, 0, -795 }, + { 0, 0, -799 }, { 0, 0, -807 }, { 0, 0, -821 }, { 0, 0, -839 }, + { 0, 0, -863 }, { 0, 0, -928 }, { 0, 0, -1045 }, { 0, 0, -1178 }, + { 0, 0, -1291 }, { 0, 0, -1350 }, { 0, 0, -1368 }, { 0, 0, -1382 }, + { 0, 0, -1392 }, { 0, 0, -1400 }, { 0, 0, -1405 }, { 0, 0, -1407 }, + { 0, 0, -1408 }, { 0, 0, -1406 }, { 0, 0, -1403 }, { 0, 0, -1399 }, + { 0, 0, -1393 }, { 0, 0, -1387 }, { 0, 0, -1381 }, { 0, 0, -1375 }, + { 0, 0, -1368 }, { 0, 0, -1362 }, { 0, 0, -1357 }, { 0, 0, -1354 }, + { 0, 0, -1351 }, { 0, 0, -1350 }, { 0, 0, -1350 }, { 0, 0, -1350 }, + { 0, 0, -1350 }, { 0, 0, -1351 }, { 0, 0, -1351 }, { 0, 0, -1352 }, + { 0, 0, -1352 }, { 0, 0, -1353 }, { 0, 0, -1353 }, { 0, 0, -1354 }, + { 0, 0, -1355 }, { 0, 0, -1356 }, { 0, 0, -1357 }, { 0, 0, -1358 }, + { 0, 0, -1359 }, { 0, 0, -1360 }, { 0, 0, -1361 }, { 0, 0, -1362 }, + { 0, 0, -1363 }, { 0, 0, -1364 }, { 0, 0, -1365 }, { 0, 0, -1366 }, + { 0, 0, -1367 }, { 0, 0, -1368 }, { 0, 0, -1369 }, { 0, 0, -1370 }, + { 0, 0, -1371 }, { 0, 0, -1372 }, { 0, 0, -1373 }, { 0, 0, -1374 }, + { 0, 0, -1375 }, { 0, 0, -1375 }, { 0, 0, -1376 }, { 0, 0, -1377 }, + { 0, 0, -1378 }, { 0, 0, -1378 }, { 0, 0, -1379 }, { 0, 0, -1379 }, + { 0, 0, -1379 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, + { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, + { 0, 0, -1379 }, { 0, 0, -1379 }, { 0, 0, -1378 }, { 0, 0, -1377 }, + { 0, 0, -1376 }, { 0, 0, -1375 }, { 0, 0, -1374 }, { 0, 0, -1373 }, + { 0, 0, -1371 }, { 0, 0, -1369 }, { 0, 0, -1368 }, { 0, 0, -1366 }, + { 0, 0, -1363 }, { 0, 0, -1361 }, { 0, 0, -1359 }, { 0, 0, -1356 }, + { 0, 0, -1353 }, { 0, 0, -1350 }, { 0, 0, -1341 }, { 0, 0, -1322 }, + { 0, 0, -1295 }, { 0, 0, -1263 }, { 0, 0, -1229 }, { 0, 0, -1195 }, + { 0, 0, -1164 }, { 0, 0, -1139 }, { 0, 0, -1121 }, { 0, 0, -1115 }, +}; + +static s16 animdata_mario_lip_6_2[][3] = { + { 60, -96, -1085 }, { 59, -96, -1084 }, { 59, -97, -1081 }, { 58, -97, -1076 }, + { 57, -98, -1070 }, { 56, -99, -1062 }, { 55, -99, -1054 }, { 53, -100, -1045 }, + { 52, -101, -1036 }, { 50, -102, -1027 }, { 49, -103, -1018 }, { 47, -104, -1009 }, + { 46, -105, -1002 }, { 45, -105, -995 }, { 44, -105, -990 }, { 43, -106, -987 }, + { 43, -106, -985 }, { 43, -105, -986 }, { 43, -105, -989 }, { 44, -104, -995 }, + { 45, -102, -1004 }, { 51, -97, -1047 }, { 64, -86, -1133 }, { 79, -74, -1232 }, + { 91, -63, -1316 }, { 97, -59, -1354 }, { 96, -59, -1352 }, { 94, -61, -1336 }, + { 90, -65, -1309 }, { 85, -69, -1275 }, { 80, -74, -1236 }, { 74, -79, -1196 }, + { 68, -84, -1158 }, { 64, -89, -1125 }, { 60, -92, -1099 }, { 58, -94, -1084 }, + { 57, -95, -1081 }, { 58, -95, -1088 }, { 59, -94, -1101 }, { 61, -93, -1120 }, + { 64, -91, -1140 }, { 67, -89, -1160 }, { 70, -87, -1177 }, { 73, -85, -1190 }, + { 77, -83, -1194 }, { 80, -82, -1193 }, { 84, -80, -1191 }, { 88, -78, -1187 }, + { 92, -76, -1181 }, { 97, -74, -1175 }, { 102, -72, -1168 }, { 106, -70, -1160 }, + { 111, -68, -1151 }, { 116, -66, -1142 }, { 120, -64, -1134 }, { 125, -62, -1125 }, + { 129, -61, -1117 }, { 133, -59, -1109 }, { 136, -58, -1102 }, { 139, -56, -1096 }, + { 141, -55, -1091 }, { 143, -55, -1087 }, { 144, -54, -1085 }, { 145, -54, -1083 }, + { 146, -54, -1082 }, { 146, -53, -1081 }, { 147, -53, -1080 }, { 148, -53, -1079 }, + { 149, -53, -1078 }, { 149, -53, -1077 }, { 150, -53, -1076 }, { 151, -52, -1076 }, + { 152, -52, -1075 }, { 152, -52, -1074 }, { 153, -52, -1074 }, { 154, -52, -1073 }, + { 154, -52, -1073 }, { 155, -53, -1072 }, { 156, -53, -1072 }, { 156, -53, -1072 }, + { 157, -53, -1071 }, { 157, -53, -1071 }, { 158, -53, -1071 }, { 158, -53, -1071 }, + { 159, -53, -1070 }, { 159, -54, -1070 }, { 160, -54, -1070 }, { 160, -54, -1070 }, + { 160, -54, -1070 }, { 161, -54, -1070 }, { 161, -55, -1070 }, { 161, -55, -1071 }, + { 162, -55, -1071 }, { 162, -55, -1071 }, { 162, -56, -1071 }, { 162, -56, -1071 }, + { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -57, -1072 }, + { 163, -57, -1073 }, { 163, -57, -1073 }, { 163, -57, -1074 }, { 163, -57, -1074 }, + { 163, -57, -1074 }, { 162, -58, -1075 }, { 162, -58, -1075 }, { 162, -58, -1076 }, + { 162, -58, -1076 }, { 161, -58, -1076 }, { 161, -58, -1077 }, { 160, -58, -1077 }, + { 160, -58, -1078 }, { 159, -58, -1078 }, { 159, -58, -1079 }, { 158, -58, -1079 }, + { 158, -58, -1080 }, { 157, -58, -1080 }, { 156, -58, -1081 }, { 155, -58, -1081 }, + { 154, -57, -1081 }, { 153, -57, -1082 }, { 152, -57, -1082 }, { 151, -57, -1083 }, + { 150, -56, -1083 }, { 149, -56, -1083 }, { 148, -56, -1084 }, { 147, -55, -1084 }, + { 145, -55, -1084 }, { 144, -54, -1085 }, { 142, -54, -1085 }, { 140, -53, -1086 }, + { 138, -52, -1086 }, { 135, -51, -1087 }, { 131, -49, -1087 }, { 128, -48, -1088 }, + { 123, -46, -1089 }, { 119, -45, -1090 }, { 114, -43, -1091 }, { 109, -41, -1092 }, + { 104, -39, -1093 }, { 99, -37, -1094 }, { 94, -35, -1095 }, { 88, -33, -1096 }, + { 83, -31, -1098 }, { 77, -29, -1099 }, { 71, -27, -1100 }, { 65, -24, -1101 }, + { 60, -22, -1102 }, { 54, -20, -1104 }, { 49, -18, -1105 }, { 43, -16, -1106 }, + { 38, -14, -1107 }, { 33, -12, -1108 }, { 28, -10, -1109 }, { 24, -9, -1110 }, + { 20, -7, -1111 }, { 16, -6, -1112 }, { 12, -4, -1112 }, { 9, -3, -1113 }, + { 6, -2, -1114 }, { 4, -1, -1114 }, { 2, 0, -1115 }, { 1, 0, -1115 }, + { 0, 0, -1115 }, { 0, 0, -1115 }, +}; + +struct AnimDataInfo anim_mario_lips_6[] = { + { ARRAY_COUNT(animdata_mario_lip_6_1), GD_ANIM_ROT3S, animdata_mario_lip_6_1 }, + { ARRAY_COUNT(animdata_mario_lip_6_2), GD_ANIM_ROT3S, animdata_mario_lip_6_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eyelid_left_1[][3] = { + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, + { 0, 0, 1607 }, { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, + { 0, 0, 1585 }, { 0, 0, 1581 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, + { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, { 0, 0, 1589 }, { 0, 0, 1597 }, + { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, { 0, 0, 1936 }, + { 0, 0, 1924 }, { 0, 0, 1906 }, { 0, 0, 1883 }, { 0, 0, 1855 }, { 0, 0, 1825 }, + { 0, 0, 1792 }, { 0, 0, 1760 }, { 0, 0, 1728 }, { 0, 0, 1698 }, { 0, 0, 1671 }, + { 0, 0, 1648 }, { 0, 0, 1630 }, { 0, 0, 1620 }, { 0, 0, 1613 }, { 0, 0, 1607 }, + { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1592 }, { 0, 0, 1590 }, + { 0, 0, 1588 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, + { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1595 }, + { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1602 }, { 0, 0, 1604 }, { 0, 0, 1606 }, + { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1616 }, + { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, { 0, 0, 1746 }, + { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, + { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, + { 0, 0, 1598 }, { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, + { 0, 0, 1583 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, + { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, { 0, 0, 1614 }, { 0, 0, 1617 }, + { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, { 0, 0, 1606 }, + { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, + { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, + { 0, 0, 1888 }, { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, + { 0, 0, 1828 }, { 0, 0, 1736 }, { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, + { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, { 0, 0, 1583 }, { 0, 0, 1577 }, + { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, { 0, 0, 1551 }, + { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, + { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, + { 0, 0, 1533 }, { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, + { 0, 0, 1544 }, { 0, 0, 1548 }, { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, + { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, { 0, 0, 1592 }, { 0, 0, 1600 }, + { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, { 0, 0, 1666 }, + { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, + { 0, 0, 1610 }, { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, + { 0, 0, 1617 }, { 0, 0, 1615 }, { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, + { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, { 0, 0, 1588 }, { 0, 0, 1584 }, + { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, { 0, 0, 1571 }, + { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, + { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, + { 0, 0, 1729 }, { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, + { 0, 0, 1932 }, { 0, 0, 1905 }, { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, + { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, { 0, 0, 1866 }, { 0, 0, 1926 }, + { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, { 0, 0, 1662 }, + { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, + { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, + { 0, 0, 1580 }, { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, + { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, { 0, 0, 1608 }, { 0, 0, 1630 }, + { 0, 0, 1663 }, { 0, 1, 1702 }, { 0, 1, 1746 }, { 0, 2, 1790 }, { 0, 2, 1831 }, + { 0, 2, 1867 }, { 0, 1, 1893 }, { 0, 0, 1906 }, { 0, -2, 1908 }, { 0, -4, 1901 }, + { 0, -8, 1889 }, { 0, -11, 1871 }, { 0, -15, 1850 }, { 1, -19, 1827 }, { 1, -23, 1803 }, + { 1, -26, 1779 }, { 1, -30, 1758 }, { 2, -32, 1741 }, { 2, -34, 1728 }, { 2, -35, 1719 }, + { 2, -36, 1712 }, { 3, -37, 1705 }, { 3, -38, 1699 }, { 4, -38, 1693 }, { 4, -38, 1689 }, + { 4, -39, 1685 }, { 5, -38, 1681 }, { 5, -38, 1678 }, { 5, -38, 1675 }, { 6, -37, 1672 }, + { 6, -37, 1669 }, { 6, -36, 1666 }, { 6, -35, 1663 }, { 6, -33, 1659 }, { 6, -31, 1656 }, + { 5, -28, 1653 }, { 5, -25, 1650 }, { 4, -21, 1648 }, { 3, -17, 1646 }, { 2, -12, 1644 }, + { 1, -8, 1642 }, { 1, -5, 1640 }, { 0, -2, 1639 }, { 0, 0, 1637 }, { 0, 1, 1635 }, + { 0, 2, 1633 }, { 0, 2, 1632 }, { 0, 2, 1630 }, { 0, 2, 1629 }, { 0, 2, 1628 }, + { 0, 1, 1626 }, { 0, 1, 1625 }, { 0, 0, 1624 }, { 0, 0, 1622 }, { 0, 0, 1621 }, + { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1610 }, { 0, 0, 1607 }, + { 0, 0, 1605 }, { 0, 0, 1605 }, { 0, 0, 1608 }, { 0, 0, 1624 }, { 0, 0, 1649 }, + { 0, 0, 1662 }, { 0, 0, 1647 }, { 0, 0, 1619 }, { 0, 0, 1602 }, { 0, 0, 1599 }, + { 0, 0, 1595 }, { 0, 0, 1592 }, { 0, 0, 1589 }, { 0, 0, 1587 }, { 0, 0, 1584 }, + { 0, 0, 1582 }, { 0, 0, 1580 }, { 0, 0, 1578 }, { 0, 0, 1577 }, { 0, 0, 1576 }, + { 0, 0, 1575 }, { 0, 0, 1574 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, + { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1574 }, { 0, 0, 1576 }, + { 0, 0, 1581 }, { 0, 0, 1589 }, { 0, 0, 1597 }, { 0, 0, 1605 }, { 0, 0, 1612 }, + { 0, 0, 1617 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1619 }, + { 0, 0, 1618 }, { 0, 0, 1617 }, { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1615 }, + { 0, 0, 1614 }, { 0, 0, 1612 }, { 0, 0, 1611 }, { 0, 0, 1610 }, { 0, 0, 1609 }, + { 0, 0, 1608 }, { 0, 0, 1607 }, { 0, 0, 1605 }, { 0, 0, 1604 }, { 0, 0, 1603 }, + { 0, 0, 1602 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1598 }, { 0, 0, 1597 }, + { 0, 0, 1596 }, { 0, 0, 1595 }, { 0, 0, 1594 }, { 0, 0, 1593 }, { 0, 0, 1592 }, + { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1585 }, { 0, 0, 1580 }, + { 0, 0, 1573 }, { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1559 }, { 0, 0, 1558 }, + { 0, 0, 1559 }, { 0, 0, 1565 }, { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, + { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, { 0, 0, 1901 }, { 0, 0, 1923 }, + { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, { 0, 0, 1812 }, + { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, + { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1595 }, + { 0, 0, 1592 }, { 0, 0, 1589 }, { 0, 0, 1586 }, { 0, 0, 1584 }, { 0, 0, 1581 }, + { 0, 0, 1580 }, { 0, 0, 1578 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1575 }, + { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, + { 0, 0, 1574 }, { 0, 0, 1575 }, { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1578 }, + { 0, 0, 1579 }, { 0, 0, 1580 }, { 0, 0, 1581 }, { 0, 0, 1583 }, { 0, 0, 1584 }, + { 0, 0, 1586 }, { 0, 0, 1587 }, { 0, 0, 1589 }, { 0, 0, 1591 }, { 0, 0, 1592 }, + { 0, 0, 1594 }, { 0, 0, 1595 }, { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1600 }, + { 0, 0, 1602 }, { 0, 0, 1603 }, { 0, 0, 1604 }, { 0, 0, 1606 }, { 0, 0, 1607 }, + { 0, 0, 1608 }, { 0, 0, 1608 }, { 0, 0, 1609 }, { 0, 0, 1610 }, { 0, 0, 1610 }, + { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1609 }, + { 0, 0, 1608 }, { 0, 0, 1593 }, { 0, 0, 1566 }, { 0, 0, 1551 }, { 0, 0, 1549 }, + { 0, 0, 1546 }, { 0, 0, 1544 }, { 0, 0, 1542 }, { 0, 0, 1540 }, { 0, 0, 1538 }, + { 0, 0, 1536 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1536 }, + { 0, 0, 1539 }, { 0, 0, 1542 }, { 0, 0, 1547 }, { 0, 0, 1553 }, { 0, 0, 1560 }, + { 0, 0, 1570 }, { 0, 0, 1618 }, { 0, 0, 1700 }, { 0, 0, 1751 }, { 0, 0, 1765 }, + { 0, 0, 1774 }, { 0, 0, 1779 }, { 0, 0, 1782 }, { 0, 0, 1783 }, { 0, 0, 1783 }, + { 0, 0, 1783 }, { 0, 0, 1783 }, { 0, 0, 1784 }, { 0, 0, 1788 }, { 0, 0, 1794 }, + { 0, 0, 1805 }, { 0, 0, 1834 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, + { 0, 0, 1941 }, { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, + { 0, 0, 1815 }, { 0, 0, 1779 }, { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, + { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, { 0, 0, 1591 }, { 0, 0, 1588 }, + { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, { 0, 0, 1635 }, + { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, + { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, + { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, + { 0, 0, 1772 }, { 0, 0, 1768 }, { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, + { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1752 }, + { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, { 0, 0, 1762 }, + { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, + { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, + { 0, 0, 1772 }, { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, + { 0, 0, 1760 }, { 0, 0, 1758 }, { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, + { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, + { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1754 }, + { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, + { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, + { 0, 0, 1857 }, { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, + { 0, 0, 1932 }, { 0, 0, 1941 }, { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, + { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, { 0, 0, 1898 }, { 0, 0, 1878 }, + { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, { 0, 0, 1761 }, + { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, + { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, + { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, + { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, + { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, { 0, 0, 1598 }, { 0, 0, 1601 }, + { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, + { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, + { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, { 0, 0, 1613 }, + { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1611 }, { 0, 0, 1611 }, { 0, 0, 1612 }, + { 0, 0, 1612 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1620 }, + { 0, 0, 1622 }, { 0, 0, 1626 }, { 0, 0, 1629 }, { 0, 0, 1633 }, { 0, 0, 1638 }, + { 0, 0, 1644 }, { 0, 0, 1651 }, { 0, 0, 1659 }, { 0, 0, 1670 }, { 0, 0, 1681 }, + { 0, 0, 1695 }, { 0, 0, 1711 }, { 0, 0, 1735 }, { 0, 0, 1768 }, { 0, 0, 1808 }, + { 0, 0, 1851 }, { 0, 0, 1891 }, { 0, 0, 1926 }, { 0, 0, 1951 }, { 0, 0, 1963 }, + { 0, 0, 1960 }, { 0, 0, 1943 }, { 0, 0, 1916 }, { 0, 0, 1884 }, { 0, 0, 1850 }, + { 0, 0, 1818 }, { 0, 0, 1792 }, { 0, 0, 1774 }, { 0, 0, 1764 }, { 0, 0, 1757 }, + { 0, 0, 1753 }, { 0, 0, 1750 }, { 0, 0, 1750 }, { 0, 0, 1750 }, { 0, 0, 1751 }, + { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1753 }, + { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1759 }, { 0, 0, 1765 }, + { 0, 0, 1774 }, { 0, 0, 1787 }, { 0, 0, 1805 }, { 0, 0, 1826 }, { 0, 0, 1848 }, + { 0, 0, 1870 }, { 0, 0, 1891 }, { 0, 0, 1910 }, { 0, 0, 1925 }, { 0, 0, 1935 }, + { 0, 0, 1941 }, { 0, 0, 1945 }, { 0, 0, 1948 }, { 0, 0, 1949 }, { 0, 0, 1950 }, + { 0, 0, 1949 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1944 }, { 0, 0, 1942 }, + { 0, 0, 1940 }, { 0, 0, 1938 }, { 0, 0, 1936 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1941 }, { 0, 0, 1935 }, + { 0, 0, 1897 }, { 0, 0, 1848 }, { 0, 0, 1798 }, { 0, 0, 1760 }, { 0, 0, 1744 }, + { 0, 0, 1846 }, { 0, 0, 1936 }, { 0, 0, 1843 }, { 0, 0, 1696 }, { 0, 0, 1620 }, +}; + +static s16 animdata_mario_eyelid_left_2[][3] = { + { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1715 }, { 0, 0, 1714 }, { 0, 0, 1711 }, { 0, 0, 1708 }, + { 0, 0, 1705 }, { 0, 0, 1702 }, { 0, 0, 1699 }, { 0, 0, 1696 }, { 0, 0, 1694 }, { 0, 0, 1691 }, + { 0, 0, 1689 }, { 0, 0, 1688 }, { 0, 0, 1688 }, { 0, 0, 1688 }, { 0, 0, 1690 }, { 0, 0, 1692 }, + { 0, 0, 1696 }, { 0, 0, 1702 }, { 0, 0, 1708 }, { 0, 0, 1717 }, { 0, 0, 1759 }, { 0, 0, 1839 }, + { 0, 0, 1917 }, { 0, 0, 1952 }, { 0, 0, 1927 }, { 0, 0, 1869 }, { 0, 0, 1800 }, { 0, 0, 1741 }, + { 0, 0, 1717 }, { 0, 0, 1713 }, { 0, 0, 1703 }, { 0, 0, 1691 }, { 0, 0, 1681 }, { 0, 0, 1677 }, + { 0, 0, 1678 }, { 0, 0, 1682 }, { 0, 0, 1687 }, { 0, 0, 1694 }, { 0, 0, 1700 }, { 0, 0, 1707 }, + { 0, 0, 1712 }, { 0, 0, 1716 }, { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1718 }, { 0, 0, 1720 }, + { 0, 0, 1722 }, { 0, 0, 1725 }, { 0, 0, 1728 }, { 0, 0, 1731 }, { 0, 0, 1735 }, { 0, 0, 1739 }, + { 0, 0, 1744 }, { 0, 0, 1748 }, { 0, 0, 1754 }, { 0, 0, 1759 }, { 0, 0, 1764 }, { 0, 0, 1769 }, + { 0, 0, 1775 }, { 0, 0, 1780 }, { 0, 0, 1786 }, { 0, 0, 1794 }, { 0, 0, 1806 }, { 0, 0, 1820 }, + { 0, 0, 1833 }, { 0, 0, 1843 }, { 0, 0, 1847 }, { 0, 0, 1848 }, { 0, 0, 1849 }, { 0, 0, 1849 }, + { 0, 0, 1850 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1852 }, + { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1851 }, { 0, 0, 1851 }, + { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, { 0, 0, 1849 }, { 0, 0, 1849 }, + { 0, 0, 1848 }, { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1846 }, { 0, 0, 1846 }, + { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1844 }, { 0, 0, 1843 }, { 0, 0, 1843 }, { 0, 0, 1842 }, + { 0, 0, 1842 }, { 0, 0, 1841 }, { 0, 0, 1841 }, { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1839 }, + { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, + { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1839 }, + { 0, 0, 1839 }, { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1841 }, { 0, 0, 1842 }, { 0, 0, 1843 }, + { 0, 0, 1844 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1853 }, { 0, 0, 1866 }, + { 0, 0, 1883 }, { 0, 0, 1902 }, { 0, 0, 1921 }, { 0, 0, 1935 }, { 0, 0, 1943 }, { 0, 0, 1942 }, + { 0, 0, 1935 }, { 0, 0, 1927 }, { 0, 0, 1917 }, { 0, 0, 1906 }, { 0, 0, 1894 }, { 0, 0, 1881 }, + { 0, 0, 1867 }, { 0, 0, 1853 }, { 0, 0, 1837 }, { 0, 0, 1822 }, { 0, 0, 1806 }, { 0, 0, 1790 }, + { 0, 0, 1775 }, { 0, 0, 1759 }, { 0, 0, 1743 }, { 0, 0, 1728 }, { 0, 0, 1713 }, { 0, 0, 1699 }, + { 0, 0, 1686 }, { 0, 0, 1673 }, { 0, 0, 1662 }, { 0, 0, 1651 }, { 0, 0, 1642 }, { 0, 0, 1634 }, + { 0, 0, 1628 }, { 0, 0, 1623 }, { 0, 0, 1621 }, { 0, 0, 1620 }, +}; + +struct AnimDataInfo anim_mario_eyelid_left[] = { + { ARRAY_COUNT(animdata_mario_eyelid_left_1), GD_ANIM_ROT3S, animdata_mario_eyelid_left_1 }, + { ARRAY_COUNT(animdata_mario_eyelid_left_2), GD_ANIM_ROT3S, animdata_mario_eyelid_left_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_eyelid_right_1[][3] = { + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, + { 0, 0, 1607 }, { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, + { 0, 0, 1585 }, { 0, 0, 1581 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, + { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, { 0, 0, 1589 }, { 0, 0, 1597 }, + { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, { 0, 0, 1936 }, + { 0, 0, 1925 }, { 0, 0, 1907 }, { 0, 0, 1885 }, { 0, 0, 1858 }, { 0, 0, 1828 }, + { 0, 0, 1797 }, { 0, 0, 1764 }, { 0, 0, 1733 }, { 0, 0, 1702 }, { 0, 0, 1675 }, + { 0, 0, 1651 }, { 0, 0, 1632 }, { 0, 0, 1620 }, { 0, 0, 1610 }, { 0, 0, 1602 }, + { 0, 0, 1594 }, { 0, 0, 1587 }, { 0, 0, 1580 }, { 0, 0, 1574 }, { 0, 0, 1570 }, + { 0, 0, 1566 }, { 0, 0, 1563 }, { 0, 0, 1561 }, { 0, 0, 1561 }, { 0, 0, 1562 }, + { 0, 0, 1564 }, { 0, 0, 1567 }, { 0, 0, 1572 }, { 0, 0, 1578 }, { 0, 0, 1586 }, + { 0, 0, 1595 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1679 }, { 0, 0, 1793 }, + { 0, 0, 1903 }, { 0, 0, 1952 }, { 0, 0, 1925 }, { 0, 0, 1858 }, { 0, 0, 1771 }, + { 0, 0, 1685 }, { 0, 0, 1620 }, { 0, 0, 1608 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, { 0, 0, 1746 }, + { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, + { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, + { 0, 0, 1598 }, { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, + { 0, 0, 1583 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, + { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, { 0, 0, 1614 }, { 0, 0, 1617 }, + { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, { 0, 0, 1606 }, + { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, + { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, + { 0, 0, 1888 }, { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, + { 0, 0, 1828 }, { 0, 0, 1736 }, { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, + { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, { 0, 0, 1583 }, { 0, 0, 1577 }, + { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, { 0, 0, 1551 }, + { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, + { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, + { 0, 0, 1533 }, { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, + { 0, 0, 1544 }, { 0, 0, 1548 }, { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, + { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, { 0, 0, 1592 }, { 0, 0, 1600 }, + { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, { 0, 0, 1666 }, + { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, + { 0, 0, 1610 }, { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, + { 0, 0, 1617 }, { 0, 0, 1615 }, { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, + { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, { 0, 0, 1588 }, { 0, 0, 1584 }, + { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, { 0, 0, 1571 }, + { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, + { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, + { 0, 0, 1729 }, { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, + { 0, 0, 1932 }, { 0, 0, 1905 }, { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, + { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, { 0, 0, 1866 }, { 0, 0, 1926 }, + { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, { 0, 0, 1662 }, + { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, + { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, + { 0, 0, 1580 }, { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, + { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, { 0, 0, 1608 }, { 0, 0, 1631 }, + { 0, 0, 1665 }, { 0, 0, 1706 }, { 0, 0, 1752 }, { 0, 0, 1797 }, { 0, 0, 1839 }, + { 0, 0, 1874 }, { 0, 0, 1897 }, { 0, 0, 1906 }, { 0, 0, 1900 }, { 0, 0, 1884 }, + { 0, 0, 1859 }, { 0, 0, 1828 }, { 0, 0, 1792 }, { 0, 0, 1755 }, { 0, 0, 1717 }, + { 0, 0, 1681 }, { 0, 0, 1650 }, { 0, 0, 1625 }, { 0, 0, 1608 }, { 0, 0, 1597 }, + { 0, 0, 1589 }, { 0, 0, 1583 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, + { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1580 }, { 0, 0, 1582 }, { 0, 0, 1585 }, + { 0, 0, 1589 }, { 0, 0, 1592 }, { 0, 0, 1594 }, { 0, 0, 1597 }, { 0, 0, 1599 }, + { 1, 0, 1602 }, { 2, 0, 1607 }, { 3, 0, 1612 }, { 4, 0, 1618 }, { 5, 0, 1624 }, + { 5, 0, 1631 }, { 4, 0, 1639 }, { 3, 0, 1646 }, { 0, 0, 1654 }, { -4, 0, 1662 }, + { -9, 0, 1671 }, { -15, 0, 1680 }, { -22, 0, 1690 }, { -30, 0, 1700 }, { -37, 0, 1710 }, + { -45, 0, 1720 }, { -53, 0, 1731 }, { -61, 0, 1740 }, { -68, 0, 1750 }, { -74, 0, 1759 }, + { -80, 0, 1767 }, { -85, 0, 1774 }, { -90, 0, 1782 }, { -93, 0, 1790 }, { -94, 0, 1796 }, + { -94, 1, 1798 }, { -91, 1, 1796 }, { -85, 1, 1786 }, { -75, 1, 1763 }, { -58, 1, 1729 }, + { -40, 0, 1689 }, { -22, 0, 1651 }, { -7, 0, 1620 }, { 0, 0, 1602 }, { 2, 0, 1595 }, + { 5, 0, 1589 }, { 7, 0, 1583 }, { 8, 0, 1579 }, { 9, 0, 1576 }, { 9, 0, 1574 }, + { 9, 0, 1572 }, { 9, 0, 1571 }, { 8, 0, 1570 }, { 8, 0, 1570 }, { 7, 0, 1571 }, + { 6, 0, 1571 }, { 5, 0, 1572 }, { 4, 0, 1573 }, { 3, 0, 1573 }, { 2, 0, 1574 }, + { 1, 0, 1575 }, { 0, 0, 1575 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1573 }, + { 0, 0, 1572 }, { 0, 0, 1571 }, { 0, 0, 1571 }, { 0, 0, 1571 }, { 0, 0, 1572 }, + { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1576 }, { 0, 0, 1578 }, { 0, 0, 1580 }, + { 0, 0, 1582 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1591 }, { 0, 0, 1594 }, + { 0, 0, 1597 }, { 0, 0, 1600 }, { 0, 0, 1602 }, { 0, 0, 1605 }, { 0, 0, 1608 }, + { 0, 0, 1610 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1616 }, { 0, 0, 1618 }, + { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1618 }, + { 0, 0, 1616 }, { 0, 0, 1614 }, { 0, 0, 1612 }, { 0, 0, 1610 }, { 0, 0, 1607 }, + { 0, 0, 1604 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1596 }, { 0, 0, 1594 }, + { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1584 }, { 0, 0, 1579 }, + { 0, 0, 1573 }, { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1558 }, { 0, 0, 1557 }, + { 0, 0, 1559 }, { 0, 0, 1565 }, { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, + { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, { 0, 0, 1901 }, { 0, 0, 1923 }, + { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, { 0, 0, 1812 }, + { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, + { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1603 }, { 0, 0, 1599 }, { 0, 0, 1595 }, + { 0, 0, 1591 }, { 0, 0, 1588 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1578 }, + { 0, 0, 1576 }, { 0, 0, 1573 }, { 0, 0, 1571 }, { 0, 0, 1569 }, { 0, 0, 1567 }, + { 0, 0, 1565 }, { 0, 0, 1564 }, { 0, 0, 1563 }, { 0, 0, 1562 }, { 0, 0, 1561 }, + { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1559 }, { 0, 0, 1559 }, + { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1561 }, { 0, 0, 1562 }, + { 0, 0, 1562 }, { 0, 0, 1563 }, { 0, 0, 1564 }, { 0, 0, 1566 }, { 0, 0, 1567 }, + { 0, 0, 1568 }, { 0, 0, 1570 }, { 0, 0, 1571 }, { 0, 0, 1573 }, { 0, 0, 1575 }, + { 0, 0, 1576 }, { 0, 0, 1578 }, { 0, 0, 1580 }, { 0, 0, 1582 }, { 0, 0, 1584 }, + { 0, 0, 1586 }, { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1593 }, { 0, 0, 1595 }, + { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1601 }, { 0, 0, 1604 }, { 0, 0, 1606 }, + { 0, 0, 1608 }, { 0, 0, 1642 }, { 0, 0, 1703 }, { 0, 0, 1734 }, { 0, 0, 1731 }, + { 0, 0, 1726 }, { 0, 0, 1718 }, { 0, 0, 1709 }, { 0, 0, 1698 }, { 0, 0, 1686 }, + { 0, 0, 1673 }, { 0, 0, 1659 }, { 0, 0, 1646 }, { 0, 0, 1633 }, { 0, 0, 1621 }, + { 0, 0, 1609 }, { 0, 0, 1599 }, { 0, 0, 1591 }, { 0, 0, 1585 }, { 0, 0, 1581 }, + { 0, 0, 1581 }, { 0, 0, 1622 }, { 0, 0, 1701 }, { 0, 0, 1751 }, { 0, 0, 1764 }, + { 0, 0, 1773 }, { 0, 0, 1778 }, { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1782 }, + { 0, 0, 1782 }, { 0, 0, 1782 }, { 0, 0, 1784 }, { 0, 0, 1787 }, { 0, 0, 1794 }, + { 0, 0, 1804 }, { 0, 0, 1833 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, + { 0, 0, 1941 }, { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, + { 0, 0, 1815 }, { 0, 0, 1779 }, { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, + { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, { 0, 0, 1591 }, { 0, 0, 1588 }, + { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, { 0, 0, 1635 }, + { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, + { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, + { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, + { 0, 0, 1772 }, { 0, 0, 1768 }, { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, + { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1752 }, + { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, { 0, 0, 1762 }, + { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, + { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, + { 0, 0, 1772 }, { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, + { 0, 0, 1760 }, { 0, 0, 1758 }, { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, + { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, + { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1754 }, + { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, + { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, + { 0, 0, 1857 }, { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, + { 0, 0, 1932 }, { 0, 0, 1941 }, { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, + { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, { 0, 0, 1898 }, { 0, 0, 1878 }, + { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, { 0, 0, 1761 }, + { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, + { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, + { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, + { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, + { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, { 0, 0, 1598 }, { 0, 0, 1601 }, + { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, + { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, + { 0, 0, 1616 }, { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, + { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, + { 0, 0, 1613 }, { 0, 0, 1614 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1620 }, + { 0, 0, 1622 }, { 0, 0, 1625 }, { 0, 0, 1628 }, { 0, 0, 1632 }, { 0, 0, 1637 }, + { 0, 0, 1642 }, { 0, 0, 1649 }, { 0, 0, 1657 }, { 0, 0, 1666 }, { 0, 0, 1677 }, + { 0, 0, 1690 }, { 0, 0, 1706 }, { 0, 0, 1728 }, { 0, 0, 1760 }, { 0, 0, 1798 }, + { 0, 0, 1838 }, { 0, 0, 1877 }, { 0, 0, 1910 }, { 0, 0, 1935 }, { 0, 0, 1946 }, + { 0, 0, 1943 }, { 0, 0, 1927 }, { 0, 0, 1902 }, { 0, 0, 1873 }, { 0, 0, 1841 }, + { 0, 0, 1810 }, { 0, 0, 1785 }, { 0, 0, 1769 }, { 0, 0, 1759 }, { 0, 0, 1752 }, + { 0, 0, 1747 }, { 0, 0, 1744 }, { 0, 0, 1742 }, { 0, 0, 1742 }, { 0, 0, 1742 }, + { 0, 0, 1743 }, { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1743 }, { 0, 0, 1743 }, + { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1747 }, { 0, 0, 1752 }, { 0, 0, 1759 }, + { 0, 0, 1769 }, { 0, 0, 1783 }, { 0, 0, 1801 }, { 0, 0, 1823 }, { 0, 0, 1846 }, + { 0, 0, 1870 }, { 0, 0, 1892 }, { 0, 0, 1912 }, { 0, 0, 1929 }, { 0, 0, 1940 }, + { 0, 0, 1948 }, { 0, 0, 1952 }, { 0, 0, 1954 }, { 0, 0, 1954 }, { 0, 0, 1953 }, + { 0, 0, 1951 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1943 }, { 0, 0, 1941 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1947 }, { 0, 0, 1940 }, + { 0, 0, 1902 }, { 0, 0, 1852 }, { 0, 0, 1801 }, { 0, 0, 1762 }, { 0, 0, 1747 }, + { 0, 0, 1851 }, { 0, 0, 1942 }, { 0, 0, 1847 }, { 0, 0, 1698 }, { 0, 0, 1620 }, +}; + +static s16 animdata_mario_eyelid_right_2[][3] = { + { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1761 }, { 0, 0, 1760 }, { 0, 0, 1757 }, { 0, 0, 1755 }, + { 0, 0, 1752 }, { 0, 0, 1749 }, { 0, 0, 1746 }, { 0, 0, 1744 }, { 0, 0, 1741 }, { 0, 0, 1739 }, + { 0, 0, 1737 }, { 0, 0, 1736 }, { 0, 0, 1736 }, { 0, 0, 1736 }, { 0, 0, 1738 }, { 0, 0, 1740 }, + { 0, 0, 1744 }, { 0, 0, 1749 }, { 0, 0, 1755 }, { 0, 0, 1763 }, { 0, 0, 1802 }, { 0, 0, 1876 }, + { 0, 0, 1948 }, { 0, 0, 1981 }, { 0, 0, 1958 }, { 0, 0, 1904 }, { 0, 0, 1839 }, { 0, 0, 1785 }, + { 0, 0, 1763 }, { 0, 0, 1757 }, { 0, 0, 1743 }, { 0, 0, 1726 }, { 0, 0, 1711 }, { 0, 0, 1706 }, + { 0, 0, 1707 }, { 0, 0, 1713 }, { 0, 0, 1720 }, { 0, 0, 1729 }, { 0, 0, 1739 }, { 0, 0, 1748 }, + { 0, 0, 1756 }, { 0, 0, 1761 }, { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1760 }, { 0, 0, 1758 }, + { 0, 0, 1754 }, { 0, 0, 1750 }, { 0, 0, 1745 }, { 0, 0, 1740 }, { 0, 0, 1734 }, { 0, 0, 1729 }, + { 0, 0, 1724 }, { 0, 0, 1719 }, { 0, 0, 1715 }, { 0, 0, 1712 }, { 0, 0, 1710 }, { 0, 0, 1708 }, + { 0, 0, 1708 }, { 0, 0, 1709 }, { 0, 0, 1712 }, { 0, 0, 1725 }, { 0, 0, 1751 }, { 0, 0, 1784 }, + { 0, 0, 1816 }, { 0, 0, 1842 }, { 0, 0, 1853 }, { 0, 0, 1855 }, { 0, 0, 1857 }, { 0, 0, 1859 }, + { 0, 0, 1860 }, { 0, 0, 1861 }, { 0, 0, 1863 }, { 0, 0, 1864 }, { 0, 0, 1864 }, { 0, 0, 1865 }, + { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1867 }, { 0, 0, 1867 }, { 0, 0, 1867 }, + { 0, 0, 1867 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1865 }, { 0, 0, 1865 }, + { 0, 0, 1864 }, { 0, 0, 1863 }, { 0, 0, 1863 }, { 0, 0, 1862 }, { 0, 0, 1861 }, { 0, 0, 1860 }, + { 0, 0, 1859 }, { 0, 0, 1858 }, { 0, 0, 1858 }, { 0, 0, 1857 }, { 0, 0, 1856 }, { 0, 0, 1855 }, + { 0, 0, 1854 }, { 0, 0, 1853 }, { 0, 0, 1852 }, { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, + { 0, 0, 1849 }, { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1846 }, { 0, 0, 1846 }, + { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, + { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1848 }, + { 0, 0, 1849 }, { 0, 0, 1850 }, { 0, 0, 1852 }, { 0, 0, 1853 }, { 0, 0, 1860 }, { 0, 0, 1875 }, + { 0, 0, 1894 }, { 0, 0, 1916 }, { 0, 0, 1937 }, { 0, 0, 1954 }, { 0, 0, 1964 }, { 0, 0, 1963 }, + { 0, 0, 1956 }, { 0, 0, 1947 }, { 0, 0, 1937 }, { 0, 0, 1925 }, { 0, 0, 1912 }, { 0, 0, 1899 }, + { 0, 0, 1884 }, { 0, 0, 1869 }, { 0, 0, 1853 }, { 0, 0, 1836 }, { 0, 0, 1819 }, { 0, 0, 1803 }, + { 0, 0, 1786 }, { 0, 0, 1769 }, { 0, 0, 1752 }, { 0, 0, 1736 }, { 0, 0, 1720 }, { 0, 0, 1705 }, + { 0, 0, 1691 }, { 0, 0, 1677 }, { 0, 0, 1665 }, { 0, 0, 1654 }, { 0, 0, 1644 }, { 0, 0, 1635 }, + { 0, 0, 1629 }, { 0, 0, 1624 }, { 0, 0, 1621 }, { 0, 0, 1620 }, +}; + +struct AnimDataInfo anim_mario_eyelid_right[] = { + { ARRAY_COUNT(animdata_mario_eyelid_right_1), GD_ANIM_ROT3S, animdata_mario_eyelid_right_1 }, + { ARRAY_COUNT(animdata_mario_eyelid_right_2), GD_ANIM_ROT3S, animdata_mario_eyelid_right_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_mario_intro_1[][6] = { + { 1128, 0, 0, 0, 0, -20010 }, + { 1123, 0, 0, 0, -2, -19891 }, + { 1108, 0, 0, 0, -7, -19548 }, + { 1085, 0, 0, 0, -16, -19000 }, + { 1053, 0, 0, 0, -27, -18268 }, + { 1015, 0, 0, 0, -39, -17371 }, + { 970, 0, 0, 0, -53, -16328 }, + { 920, 0, 0, 0, -67, -15161 }, + { 866, 0, 0, 0, -80, -13888 }, + { 807, 0, 0, 0, -92, -12529 }, + { 746, 0, 0, 0, -103, -11105 }, + { 683, 0, 0, 0, -112, -9635 }, + { 619, 0, 0, 0, -117, -8138 }, + { 555, 0, 0, 0, -119, -6635 }, + { 491, 0, 0, 0, -114, -5146 }, + { 429, 0, 0, 0, -103, -3690 }, + { 369, 0, 0, 0, -87, -2286 }, + { 312, 0, 0, 0, -68, -956 }, + { 259, 0, 0, 0, -48, 281 }, + { 212, 0, 0, 0, -28, 535 }, + { 169, 0, 0, 0, -12, 371 }, + { 134, 0, 0, 0, 0, 146 }, + { 132, 0, 0, 0, 5, -99 }, + { 172, 0, 0, 0, 5, -327 }, + { 231, 0, 0, 1, 3, -498 }, + { 281, 0, 0, 1, 0, -572 }, + { 297, 0, 0, 0, 0, -581 }, + { 285, 0, 0, -3, 3, -563 }, + { 267, 0, 0, -8, 9, -522 }, + { 243, 0, 1, -14, 14, -462 }, + { 215, 0, 2, -18, 18, -390 }, + { 184, 0, 2, -19, 17, -309 }, + { 151, 1, 3, -17, 12, -225 }, + { 117, 1, 3, -15, 6, -142 }, + { 84, 1, 3, -12, 0, -65 }, + { 53, 0, 3, -8, -9, 1 }, + { 24, 0, 1, -4, -18, 52 }, + { 0, 0, 0, 0, -27, 81 }, + { -23, 0, -3, 3, -36, 84 }, + { -47, -1, -9, 7, -44, 67 }, + { -71, -3, -15, 11, -51, 37 }, + { -95, -4, -23, 14, -57, 3 }, + { -117, -6, -31, 17, -61, -24 }, + { -136, -7, -38, 18, -62, -40 }, + { -152, -9, -44, 20, -62, -40 }, + { -164, -11, -48, 20, -58, -36 }, + { -170, -13, -50, 21, -53, -29 }, + { -171, -15, -49, 21, -46, -19 }, + { -164, -17, -44, 20, -38, -7 }, + { -151, -19, -37, 19, -29, 4 }, + { -132, -22, -28, 19, -20, 16 }, + { -110, -26, -17, 18, -12, 27 }, + { -85, -29, -5, 17, -5, 36 }, + { -58, -32, 7, 16, 0, 43 }, + { -31, -35, 19, 15, 3, 46 }, + { -5, -37, 31, 14, 5, 46 }, + { 19, -39, 42, 13, 7, 45 }, + { 40, -41, 51, 12, 7, 43 }, + { 57, -41, 58, 11, 8, 39 }, + { 68, -41, 62, 9, 8, 34 }, + { 72, -39, 62, 8, 7, 29 }, + { 72, -35, 57, 7, 7, 24 }, + { 67, -29, 49, 5, 6, 18 }, + { 59, -23, 39, 4, 5, 12 }, + { 48, -16, 28, 3, 4, 6 }, + { 37, -10, 17, 2, 2, 1 }, + { 25, -4, 8, 1, 1, -2 }, + { 14, -1, 2, 0, 1, -6 }, + { 5, 0, 0, 0, 0, -8 }, + { 0, 0, 0, 0, 0, -10 }, + { -3, -3, -8, 0, 0, -10 }, + { -7, -8, -18, 0, 0, -10 }, + { -11, -12, -27, 0, -1, -10 }, + { -15, -16, -37, 0, -1, -11 }, + { -18, -21, -47, 0, -2, -11 }, + { -22, -25, -57, 0, -2, -11 }, + { -25, -30, -68, 0, -3, -11 }, + { -29, -34, -78, 0, -4, -11 }, + { -32, -39, -89, 0, -4, -11 }, + { -35, -44, -99, -1, -5, -11 }, + { -38, -48, -109, -1, -6, -12 }, + { -41, -53, -120, -1, -7, -12 }, + { -44, -57, -130, -1, -7, -12 }, + { -46, -62, -140, -1, -8, -12 }, + { -49, -66, -149, -1, -8, -12 }, + { -51, -70, -159, -1, -9, -12 }, + { -54, -74, -168, -1, -9, -12 }, + { -56, -78, -177, -1, -9, -12 }, + { -58, -82, -185, -1, -10, -11 }, + { -60, -85, -193, -1, -10, -11 }, + { -62, -88, -200, -1, -9, -11 }, + { -64, -91, -207, -1, -9, -11 }, + { -66, -94, -213, -1, -9, -11 }, + { -68, -97, -219, -1, -8, -11 }, + { -69, -99, -224, -2, -7, -11 }, + { -71, -101, -229, -2, -6, -10 }, + { -72, -103, -233, -2, -5, -10 }, + { -73, -105, -238, -2, -3, -10 }, + { -74, -107, -241, -2, -1, -10 }, + { -74, -108, -245, -2, 2, -10 }, + { -75, -109, -247, -2, 6, -9 }, + { -75, -110, -249, -2, 10, -9 }, + { -75, -110, -251, -2, 15, -9 }, + { -75, -111, -251, -2, 21, -9 }, + { -75, -110, -251, -2, 26, -8 }, + { -74, -110, -250, -2, 32, -8 }, + { -74, -109, -247, -2, 37, -8 }, + { -73, -107, -244, -2, 43, -7 }, + { -72, -106, -240, -2, 48, -7 }, + { -71, -103, -234, -2, 52, -7 }, + { -69, -100, -227, -2, 56, -6 }, + { -68, -97, -219, -2, 60, -6 }, + { -64, -89, -199, -2, 62, -6 }, + { -56, -75, -162, -2, 64, -5 }, + { -47, -57, -116, -2, 65, -5 }, + { -38, -38, -69, -2, 64, -5 }, + { -30, -20, -28, -2, 63, -4 }, + { -26, -6, -2, -2, 60, -4 }, + { -24, 4, 14, -2, 57, -3 }, + { -22, 15, 30, -2, 54, -3 }, + { -21, 26, 47, -2, 49, -3 }, + { -19, 37, 63, -2, 44, -2 }, + { -17, 48, 79, -2, 39, -2 }, + { -15, 58, 94, -2, 33, -2 }, + { -14, 69, 109, -2, 27, -1 }, + { -12, 80, 123, -2, 20, -1 }, + { -11, 90, 137, -2, 13, 0 }, + { -10, 100, 150, -2, 6, 0 }, + { -9, 110, 161, -2, 0, 0 }, + { -9, 120, 172, -2, -7, 0 }, + { -9, 129, 182, -2, -14, 0 }, + { -9, 139, 191, -2, -21, 1 }, + { -10, 148, 198, -2, -28, 1 }, + { -12, 156, 204, -2, -34, 1 }, + { -14, 164, 208, -2, -41, 2 }, + { -16, 172, 211, -2, -47, 2 }, + { -19, 180, 213, -2, -52, 3 }, + { -23, 187, 212, -2, -57, 3 }, + { -27, 193, 210, -2, -62, 3 }, + { -32, 199, 206, -2, -66, 4 }, + { -38, 205, 201, -2, -70, 4 }, + { -44, 211, 195, -2, -72, 4 }, + { -50, 216, 187, -2, -74, 5 }, + { -57, 221, 178, -2, -76, 5 }, + { -64, 225, 168, -2, -76, 5 }, + { -72, 230, 157, -2, -75, 6 }, + { -80, 234, 146, -2, -73, 6 }, + { -88, 238, 134, -2, -70, 6 }, + { -96, 242, 121, -2, -67, 7 }, + { -104, 246, 107, -2, -63, 7 }, + { -113, 249, 94, -2, -59, 7 }, + { -122, 253, 79, -2, -54, 8 }, + { -130, 257, 65, -2, -50, 8 }, + { -139, 260, 51, -2, -45, 8 }, + { -148, 264, 37, -2, -39, 8 }, + { -156, 268, 22, -2, -34, 9 }, + { -165, 272, 8, -2, -29, 9 }, + { -173, 276, -4, -2, -24, 9 }, + { -181, 280, -18, -2, -20, 9 }, + { -189, 285, -30, -2, -16, 9 }, + { -196, 289, -42, -2, -12, 10 }, + { -203, 294, -54, -2, -9, 10 }, + { -210, 299, -64, -2, -7, 10 }, + { -218, 311, -74, -2, -5, 10 }, + { -227, 331, -82, -2, -4, 10 }, + { -233, 350, -87, -2, -3, 10 }, + { -233, 358, -89, -2, -2, 10 }, + { -222, 347, -87, -2, -1, 10 }, + { -202, 316, -79, -2, 0, 10 }, + { -173, 273, -69, -2, 0, 10 }, + { -140, 222, -56, -2, 1, 22 }, + { -105, 167, -42, -2, 2, 81 }, + { -71, 113, -28, -2, 3, 161 }, + { -40, 64, -16, -2, 3, 232 }, + { -15, 25, -6, -2, 4, 263 }, + { 0, 0, 0, -2, 5, 230 }, + { 9, -14, 3, -2, 5, 149 }, + { 15, -23, 5, -2, 6, 60 }, + { 18, -29, 7, -1, 6, 0 }, + { 20, -31, 7, -1, 6, -6 }, + { 20, -31, 7, -1, 7, -4 }, + { 18, -28, 7, -1, 7, -2 }, + { 15, -24, 6, -1, 7, 0 }, + { 12, -19, 4, -1, 8, 0 }, + { 9, -14, 3, -1, 8, 1 }, + { 5, -8, 2, -1, 8, 1 }, + { 2, -4, 1, -1, 8, 2 }, + { 0, -1, 0, -1, 8, 2 }, + { 0, 0, 0, -1, 8, 2 }, + { 0, 0, 0, -1, 8, 2 }, + { -1, 0, 0, -1, 8, 1 }, + { -2, 0, 0, -1, 8, 1 }, + { -4, 0, 0, -1, 8, 0 }, + { -6, 0, 0, -1, 7, 0 }, + { -8, 0, 0, -1, 7, 0 }, + { -10, 0, 0, -1, 7, -1 }, + { -12, 0, 0, -1, 6, -2 }, + { -14, 0, 0, -1, 6, -3 }, + { -16, 0, 0, -1, 5, -4 }, + { -16, 0, 0, -1, 5, -5 }, + { -17, 0, 0, -1, 4, -6 }, + { -16, 0, 0, -1, 4, -7 }, + { -15, 0, 0, -1, 3, -7 }, + { -13, 0, 0, -1, 2, -8 }, + { -10, 0, 0, -1, 2, -9 }, + { -5, 0, 0, -1, 1, -9 }, + { 0, 0, 0, -1, 0, -9 }, + { 9, 0, 0, -1, 0, -10 }, + { 24, 0, 0, -1, -2, -10 }, + { 42, 0, 0, -1, -7, -10 }, + { 63, 0, 0, -1, -13, -10 }, + { 86, 0, 0, -1, -21, -10 }, + { 110, 0, 0, -1, -29, -10 }, + { 132, 0, 0, -1, -38, -10 }, + { 153, 0, 0, -1, -45, -10 }, + { 171, 0, 0, -1, -52, -10 }, + { 185, 0, 0, -1, -57, -10 }, + { 193, 0, 0, -1, -59, -10 }, + { 194, 0, 0, -1, -59, -10 }, + { 190, 0, 0, -1, -55, -10 }, + { 182, 0, 0, -1, -39, -10 }, + { 170, 0, 0, -1, -13, -10 }, + { 155, 0, 0, -1, 18, -10 }, + { 138, 0, 0, -1, 49, -10 }, + { 119, 0, 0, -1, 75, -10 }, + { 98, 0, 0, -1, 90, -10 }, + { 77, 0, 0, -1, 89, -10 }, + { 55, 0, 0, -1, 76, -10 }, + { 34, 0, 0, -1, 54, -10 }, + { 13, 0, 0, -1, 28, -10 }, + { -5, 0, 0, -1, 0, -10 }, + { -22, 0, 0, -1, -25, -10 }, + { -37, 0, 0, -1, -45, -10 }, + { -49, 0, 0, -1, -56, -10 }, + { -57, 0, 0, -1, -58, -10 }, + { -62, 0, 0, -1, -53, -10 }, + { -64, 0, 0, -1, -42, -10 }, + { -65, 0, 1, -1, -30, -10 }, + { -64, 0, 1, -1, -17, -10 }, + { -61, 0, 2, -1, -6, -10 }, + { -57, 0, 3, -1, 0, -10 }, + { -51, 0, 4, -1, 0, -10 }, + { -46, 0, 4, -2, -5, -10 }, + { -39, -1, 5, -2, -14, -10 }, + { -33, -1, 5, -2, -26, -10 }, + { -26, -1, 5, -1, -38, -10 }, + { -20, -1, 5, -1, -49, -10 }, + { -15, 0, 4, -2, -57, -10 }, + { -10, 0, 3, -3, -60, -10 }, + { -7, 0, 2, -5, -56, -10 }, + { -5, 0, 0, -7, -47, -10 }, + { -4, 0, -2, -9, -37, -10 }, + { -4, 1, -5, -10, -28, -10 }, + { -3, 1, -8, -12, -16, -10 }, + { -2, 2, -11, -12, -5, -10 }, + { -2, 2, -14, -12, 0, -10 }, + { -2, 3, -18, -12, 0, -10 }, + { -2, 4, -21, -10, 0, -10 }, + { -2, 5, -25, -7, -1, -10 }, + { -2, 5, -29, -2, -2, -10 }, + { -2, 6, -33, 3, -4, -10 }, + { -2, 7, -37, 11, -6, -10 }, + { -3, 8, -41, 18, -8, -10 }, + { -3, 9, -45, 26, -11, -10 }, + { -3, 10, -50, 33, -13, -10 }, + { -4, 10, -54, 41, -15, -10 }, + { -4, 11, -58, 48, -16, -10 }, + { -5, 12, -62, 54, -17, -10 }, + { -5, 13, -67, 59, -18, -10 }, + { -6, 14, -71, 64, -17, -10 }, + { -7, 15, -75, 68, -16, -10 }, + { -7, 15, -79, 71, -14, -10 }, + { -8, 16, -83, 73, -12, -10 }, + { -8, 17, -87, 74, -10, -10 }, + { -9, 18, -90, 74, -8, -10 }, + { -9, 18, -94, 74, -5, -10 }, + { -10, 19, -97, 73, -3, -10 }, + { -10, 20, -100, 72, 0, -10 }, + { -10, 20, -103, 70, 2, -10 }, + { -11, 21, -106, 68, 5, -10 }, + { -11, 21, -108, 66, 9, -10 }, + { -11, 22, -111, 64, 12, -10 }, + { -11, 22, -113, 61, 15, -10 }, + { -11, 23, -115, 58, 19, -10 }, + { -11, 23, -117, 55, 22, -10 }, + { -11, 24, -119, 52, 26, -10 }, + { -12, 24, -121, 50, 30, -10 }, + { -12, 24, -122, 47, 33, -10 }, + { -12, 25, -123, 44, 37, -10 }, + { -12, 25, -123, 42, 40, -10 }, + { -12, 25, -123, 39, 44, -10 }, + { -12, 25, -122, 36, 47, -10 }, + { -12, 24, -121, 32, 51, -10 }, + { -11, 24, -119, 29, 54, -10 }, + { -11, 23, -116, 25, 58, -10 }, + { -11, 22, -113, 20, 61, -10 }, + { -11, 21, -108, 16, 64, -10 }, + { -10, 20, -100, 11, 67, -10 }, + { -9, 17, -86, 6, 70, -10 }, + { -8, 13, -68, 1, 72, -10 }, + { -7, 9, -48, -3, 75, -10 }, + { -6, 5, -29, -8, 77, -10 }, + { -5, 0, -12, -13, 79, -10 }, + { -4, -5, 0, -18, 81, -10 }, + { -4, -10, 9, -22, 83, -10 }, + { -4, -16, 17, -27, 84, -10 }, + { -4, -22, 25, -32, 86, -10 }, + { -4, -28, 32, -36, 87, -10 }, + { -4, -34, 39, -40, 87, -10 }, + { -5, -41, 46, -43, 88, -10 }, + { -5, -47, 52, -47, 87, -10 }, + { -5, -53, 58, -49, 86, -10 }, + { -6, -60, 64, -52, 83, -10 }, + { -6, -66, 70, -54, 79, -10 }, + { -7, -72, 75, -55, 75, -10 }, + { -7, -78, 80, -56, 70, -10 }, + { -8, -83, 85, -55, 65, -10 }, + { -8, -89, 90, -53, 59, -10 }, + { -8, -93, 96, -50, 53, -10 }, + { -9, -98, 100, -46, 46, -10 }, + { -9, -100, 102, -42, 40, -10 }, + { -9, -99, 101, -37, 34, -10 }, + { -8, -93, 96, -32, 27, -10 }, + { -7, -82, 84, -26, 22, -10 }, + { -6, -67, 68, -21, 16, -10 }, + { -4, -49, 50, -15, 11, -10 }, + { -2, -31, 32, -10, 7, -10 }, + { -1, -16, 16, -6, 4, -10 }, + { 0, -5, 5, -2, 1, -10 }, + { 0, 0, 0, 0, 0, -10 }, + { 0, 1, -1, 2, 0, -9 }, + { 0, 2, -2, 4, -1, -9 }, + { 0, 3, -3, 6, -2, -9 }, + { 0, 4, -4, 9, -2, -9 }, + { 0, 5, -5, 11, -2, -9 }, + { 0, 5, -6, 13, -2, -9 }, + { -1, 6, -6, 15, -2, -9 }, + { -1, 7, -7, 17, -1, -9 }, + { -2, 8, -8, 18, -1, -9 }, + { -3, 8, -8, 20, 0, -9 }, + { -3, 9, -9, 22, 0, -9 }, + { -4, 9, -9, 23, 1, -9 }, + { -5, 10, -10, 25, 2, -9 }, + { -6, 10, -10, 26, 3, -8 }, + { -7, 11, -11, 27, 4, -8 }, + { -8, 11, -11, 29, 5, -8 }, + { -9, 11, -11, 30, 6, -8 }, + { -10, 11, -12, 30, 8, -8 }, + { -11, 12, -12, 31, 9, -8 }, + { -12, 12, -12, 32, 10, -8 }, + { -13, 12, -12, 32, 12, -8 }, + { -14, 12, -12, 33, 13, -7 }, + { -15, 12, -12, 33, 15, -7 }, + { -16, 12, -12, 33, 16, -7 }, + { -18, 12, -12, 32, 17, -7 }, + { -19, 12, -12, 32, 19, -7 }, + { -20, 12, -12, 31, 20, -7 }, + { -21, 12, -12, 30, 21, -7 }, + { -22, 12, -12, 29, 22, -7 }, + { -23, 12, -12, 28, 23, -6 }, + { -24, 12, -12, 27, 24, -6 }, + { -25, 11, -12, 25, 25, -6 }, + { -26, 11, -12, 23, 26, -6 }, + { -27, 11, -11, 22, 27, -6 }, + { -28, 11, -11, 20, 27, -6 }, + { -29, 11, -11, 18, 27, -6 }, + { -30, 10, -10, 17, 28, -6 }, + { -31, 10, -10, 15, 28, -5 }, + { -32, 10, -10, 13, 27, -5 }, + { -33, 9, -10, 12, 27, -5 }, + { -33, 9, -9, 10, 27, -5 }, + { -34, 9, -9, 9, 26, -5 }, + { -35, 8, -8, 7, 25, -5 }, + { -35, 8, -8, 6, 23, -5 }, + { -36, 8, -8, 5, 20, -5 }, + { -36, 7, -7, 5, 17, -5 }, + { -36, 7, -7, 4, 13, -5 }, + { -36, 6, -7, 4, 10, -4 }, + { -37, 6, -6, 3, 5, -4 }, + { -37, 6, -6, 3, 1, -4 }, + { -37, 5, -5, 3, -3, -4 }, + { -36, 5, -5, 3, -7, -4 }, + { -36, 4, -5, 2, -12, -4 }, + { -36, 4, -4, 2, -17, -4 }, + { -35, 4, -4, 2, -22, -4 }, + { -35, 3, -3, 2, -26, -4 }, + { -34, 3, -3, 2, -30, -4 }, + { -33, 3, -3, 1, -34, -4 }, + { -32, 2, -2, 1, -38, -4 }, + { -31, 2, -2, 1, -41, -6 }, + { -30, 2, -2, 1, -44, -55 }, + { -28, 1, -1, 1, -46, -149 }, + { -27, 1, -1, 1, -48, -268 }, + { -25, 1, -1, 0, -49, -391 }, + { -23, 1, -1, 0, -49, -498 }, + { -21, 0, 0, 0, -49, -567 }, + { -19, 0, 0, 0, -48, -593 }, + { -17, 0, 0, 0, -48, -609 }, + { -14, 0, 0, 0, -46, -618 }, + { -12, 0, 0, 0, -45, -620 }, + { -9, 0, 0, 0, -43, -613 }, + { -6, 0, 0, 0, -41, -598 }, + { -3, 0, 0, 0, -38, -570 }, + { 0, 0, 0, 0, -36, -525 }, + { 22, 0, 0, 0, -33, -467 }, + { 74, 0, 0, 0, -31, -399 }, + { 140, 0, 0, 0, -28, -326 }, + { 205, 0, 0, 0, -25, -251 }, + { 255, 0, 0, 0, -23, -180 }, + { 275, 0, 0, 0, -20, -115 }, + { 271, 0, 0, -1, -18, -62 }, + { 260, 0, 0, -1, -16, -24 }, + { 244, -1, 0, -1, -14, -5 }, + { 222, -1, 0, -1, -12, -4 }, + { 198, -1, 0, -1, -11, -4 }, + { 170, -1, 0, -1, -10, -4 }, + { 142, -1, 0, -1, -9, -4 }, + { 112, -1, 0, -1, -9, -4 }, + { 84, -2, 0, -1, -8, -4 }, + { 58, -3, 0, -1, -8, -4 }, + { 34, -4, 0, -1, -8, -4 }, + { 14, -6, 0, -1, -7, -4 }, + { 0, -8, 0, -1, -7, -4 }, + { -11, -10, 0, -1, -7, -4 }, + { -22, -14, 0, -1, -7, -4 }, + { -32, -25, -1, -2, -6, -4 }, + { -42, -51, -2, -2, -6, -4 }, + { -52, -87, -3, -2, -6, -4 }, + { -61, -131, -3, -2, -6, -4 }, + { -69, -180, -4, -2, -5, -4 }, + { -78, -229, -3, -2, -5, -4 }, + { -86, -276, -3, -2, -5, -4 }, + { -93, -318, -2, -2, -5, -4 }, + { -100, -352, 0, -2, -5, -5 }, + { -107, -374, 2, -2, -4, -5 }, + { -114, -389, 6, -2, -4, -5 }, + { -120, -403, 11, -2, -4, -5 }, + { -126, -417, 16, -2, -4, -5 }, + { -132, -430, 22, -2, -4, -5 }, + { -137, -441, 28, -2, -4, -5 }, + { -143, -450, 34, -2, -3, -5 }, + { -148, -456, 40, -2, -3, -5 }, + { -153, -458, 45, -2, -3, -5 }, + { -158, -457, 50, -2, -3, -5 }, + { -163, -451, 55, -2, -3, -5 }, + { -168, -440, 59, -2, -3, -5 }, + { -173, -424, 62, -2, -3, -5 }, + { -178, -402, 63, -2, -2, -5 }, + { -182, -374, 64, -2, -2, -5 }, + { -186, -330, 62, -2, -2, -5 }, + { -187, -266, 58, -2, -2, -6 }, + { -187, -187, 51, -2, -2, -6 }, + { -185, -97, 43, -2, -2, -6 }, + { -183, -1, 33, -2, -2, -6 }, + { -180, 94, 24, -2, -2, -6 }, + { -177, 187, 15, -2, -2, -6 }, + { -174, 270, 6, -2, -2, -6 }, + { -171, 340, 0, -1, -2, -6 }, + { -170, 391, -5, -1, -2, -6 }, + { -170, 425, -8, -1, -2, -6 }, + { -172, 447, -9, -1, -2, -6 }, + { -175, 458, -10, -1, -2, -6 }, + { -178, 460, -9, -1, -2, -6 }, + { -180, 455, -9, -1, -2, -6 }, + { -181, 444, -7, -1, -2, -7 }, + { -180, 429, -6, -1, -2, -7 }, + { -177, 411, -5, -1, -2, -7 }, + { -170, 391, -5, -1, -2, -7 }, + { -159, 338, -4, -1, -2, -7 }, + { -145, 231, -4, -1, -2, -7 }, + { -129, 90, -3, -1, -2, -7 }, + { -110, -66, -3, -1, -2, -7 }, + { -91, -220, -2, -1, -2, -7 }, + { -71, -351, -2, -1, -2, -7 }, + { -52, -441, -1, -1, -2, -7 }, + { -34, -469, -1, -1, -2, -7 }, + { -19, -418, 0, -1, -2, -7 }, + { -7, -268, 0, -1, -3, -8 }, + { 0, 0, 0, -1, -3, -8 }, + { 4, 374, 0, -1, -3, -8 }, + { 8, 823, 0, 0, -3, -8 }, + { 11, 1337, 0, 0, -3, -8 }, + { 14, 1907, 0, 0, -3, -8 }, + { 15, 2522, 0, 0, -3, -8 }, + { 16, 3174, 0, 0, -4, -8 }, + { 16, 262, 0, 0, -4, -8 }, + { 15, 958, 0, 0, -4, -8 }, + { 14, 1661, 0, 0, -4, -8 }, + { 13, 2362, 0, 0, -4, -8 }, + { 12, 3052, 0, 0, -4, -8 }, + { 10, 130, 0, 0, -5, -8 }, + { 8, 767, 0, 0, -5, -8 }, + { 6, 1364, 0, 0, -5, -9 }, + { 5, 1911, 0, 0, -5, -9 }, + { 3, 2399, 0, 0, -6, -9 }, + { 2, 2817, 0, 0, -6, -9 }, + { 0, 3157, 0, 0, -6, -9 }, + { 0, 3408, 0, 4, -6, -9 }, + { 0, 3561, 0, 8, -7, -9 }, + { 0, 3575, 0, 10, -7, -9 }, + { -1, 3547, 0, 8, -7, -9 }, + { -2, 29, 0, 3, -7, -9 }, + { -4, 7, 0, -2, -8, -9 }, + { -5, 3573, 0, -7, -8, -9 }, + { -7, 3583, 0, -8, -8, -9 }, + { -9, 11, 0, -5, -9, -9 }, + { -10, 32, 0, 0, -9, -9 }, + { -12, 49, 0, 5, -9, -9 }, + { -12, 59, 0, 6, -10, -9 }, + { -12, 60, 0, 2, -10, -9 }, + { -12, 56, 0, -2, -10, -9 }, + { -10, 49, 0, -5, -11, -9 }, + { -8, 41, 0, -4, -11, -9 }, + { -4, 34, 0, -3, -11, -9 }, + { 0, 30, 0, -1, -12, -10 }, + { 11, 28, 0, 0, -13, -10 }, + { 30, 27, 0, 0, -15, -10 }, + { 54, 27, 0, 0, -18, -10 }, + { 80, 28, 0, 0, -21, -10 }, + { 103, 29, 0, 0, -25, -10 }, + { 119, 29, 0, 0, -29, -10 }, + { 126, 30, 0, 0, -33, -10 }, + { 123, 30, 0, 0, -38, -10 }, + { 116, 30, 0, 0, -42, -10 }, + { 106, 30, 0, 0, -45, -10 }, + { 93, 30, 0, 0, -48, -10 }, + { 78, 30, 0, 0, -51, -10 }, + { 62, 30, 0, 0, -52, -10 }, + { 46, 30, 0, 0, -52, -10 }, + { 31, 30, 0, 0, -52, -10 }, + { 18, 30, 0, 0, -51, -10 }, + { 7, 30, 0, 0, -49, -10 }, + { 0, 30, 0, 0, -46, -10 }, + { -4, 30, 0, 0, -44, -10 }, + { -8, 30, 0, 0, -41, -10 }, + { -10, 30, 0, 0, -37, -10 }, + { -11, 30, 0, 0, -34, -10 }, + { -12, 30, 0, 0, -31, -10 }, + { -11, 30, 0, 0, -27, -10 }, + { -11, 30, 0, 0, -24, -10 }, + { -9, 30, 0, 0, -21, -10 }, + { -8, 30, 0, 0, -19, -10 }, + { -6, 30, 0, 0, -17, -10 }, + { -4, 30, 0, 0, -16, -10 }, + { -2, 30, 0, 0, -15, -10 }, + { 0, 30, 0, 0, -15, -10 }, + { 2, 30, 0, 0, -17, -10 }, + { 5, 30, 0, 0, -19, -10 }, + { 9, 30, 0, 0, -21, -10 }, + { 14, 30, 0, 0, -25, -10 }, + { 18, 30, 0, 0, -28, -10 }, + { 24, 30, 0, 0, -32, -10 }, + { 29, 30, 0, 0, -36, -10 }, + { 34, 30, 0, 0, -40, -10 }, + { 38, 30, 0, 0, -44, -10 }, + { 42, 30, 0, 0, -47, -10 }, + { 46, 30, 0, 0, -50, -10 }, + { 49, 30, 0, 0, -53, -10 }, + { 50, 30, 0, 0, -54, -10 }, + { 51, 30, 0, 0, -55, -10 }, + { 50, 30, 0, 0, -54, -10 }, + { 49, 30, 0, 0, -53, -10 }, + { 46, 30, 0, 0, -51, -10 }, + { 42, 30, 0, 0, -48, -10 }, + { 38, 30, 0, 0, -44, -10 }, + { 33, 30, 0, 0, -41, -10 }, + { 28, 30, 0, 0, -37, -10 }, + { 23, 30, 0, 0, -33, -10 }, + { 18, 30, 0, 0, -29, -10 }, + { 13, 30, 0, 0, -25, -10 }, + { 9, 30, 0, 0, -22, -10 }, + { 5, 30, 0, 0, -20, -10 }, + { 2, 30, 0, 0, -18, -10 }, + { 0, 30, 0, 0, -17, -10 }, + { 0, 30, 0, 0, -18, -10 }, + { 0, 30, 0, 0, -19, -10 }, + { 2, 30, 0, 0, -22, -10 }, + { 6, 30, 0, 0, -25, -10 }, + { 10, 30, 0, 0, -29, -10 }, + { 15, 30, 0, 0, -33, -10 }, + { 20, 30, 0, 0, -38, -10 }, + { 25, 30, 0, 0, -43, -10 }, + { 31, 30, 0, 0, -47, -10 }, + { 36, 30, 0, 0, -52, -10 }, + { 41, 30, 0, 0, -56, -10 }, + { 45, 30, 0, 0, -59, -10 }, + { 48, 30, 0, 0, -61, -10 }, + { 50, 30, 0, 0, -63, -10 }, + { 51, 30, 0, 0, -63, -10 }, + { 50, 30, 0, 0, -62, -10 }, + { 48, 30, 0, 0, -60, -10 }, + { 44, 30, 0, 0, -57, -10 }, + { 39, 30, 0, 0, -52, -10 }, + { 34, 30, 0, 0, -47, -10 }, + { 28, 30, 0, 0, -42, -10 }, + { 22, 30, 0, 0, -36, -10 }, + { 17, 30, 0, 0, -31, -10 }, + { 11, 30, 0, 0, -26, -10 }, + { 6, 30, 0, 0, -22, -10 }, + { 3, 30, 0, 0, -18, -10 }, + { 0, 30, 0, 0, -16, -10 }, + { 0, 30, 0, 0, -15, -10 }, + { 0, 30, 0, 0, -16, -10 }, + { 2, 30, 0, 0, -18, -10 }, + { 5, 30, 0, 0, -21, -10 }, + { 9, 30, 0, 0, -25, -10 }, + { 13, 30, 0, 0, -30, -10 }, + { 18, 30, 0, 0, -35, -10 }, + { 23, 30, 0, 0, -41, -10 }, + { 28, 30, 0, 0, -46, -10 }, + { 33, 30, 0, 0, -51, -10 }, + { 38, 30, 0, 0, -56, -10 }, + { 42, 30, 0, 0, -60, -10 }, + { 46, 30, 0, 0, -63, -10 }, + { 49, 30, 0, 0, -65, -10 }, + { 50, 30, 0, 0, -66, -10 }, + { 51, 30, 0, 0, -65, -10 }, + { 50, 30, 0, 0, -65, -10 }, + { 49, 30, 0, 0, -64, -10 }, + { 46, 30, 0, 0, -63, -10 }, + { 43, 30, 0, 0, -62, -10 }, + { 39, 30, 0, 0, -61, -10 }, + { 35, 30, 0, 0, -60, -10 }, + { 30, 30, 0, 0, -59, -10 }, + { 25, 30, 0, 0, -58, -10 }, + { 20, 30, 0, 0, -56, -10 }, + { 16, 30, 0, 0, -54, -10 }, + { 11, 30, 0, 0, -53, -10 }, + { 7, 30, 0, 0, -51, -10 }, + { 4, 30, 0, 0, -49, -10 }, + { 1, 30, 0, 0, -47, -10 }, + { 0, 30, 0, 0, -45, -10 }, + { -1, 30, 0, 0, -43, -10 }, + { -2, 30, 0, 0, -41, -10 }, + { -2, 30, 0, 0, -39, -10 }, + { -3, 30, 0, 0, -37, -10 }, + { -4, 30, 0, 0, -35, -10 }, + { -4, 30, 0, 0, -33, -10 }, + { -4, 30, 0, 0, -31, -10 }, + { -4, 30, 0, 0, -29, -10 }, + { -4, 30, 0, 0, -27, -10 }, + { -4, 30, 0, 0, -25, -10 }, + { -4, 30, 0, 0, -23, -10 }, + { -4, 30, 0, 0, -21, -10 }, + { -4, 30, 0, 0, -19, -10 }, + { -4, 30, 0, 0, -17, -10 }, + { -3, 30, 0, 0, -15, -10 }, + { -3, 30, 0, 0, -13, -10 }, + { -3, 30, 0, 0, -11, -10 }, + { -2, 30, 0, 0, -10, -10 }, + { -2, 30, 0, 0, -8, -10 }, + { -1, 30, 0, 0, -7, -10 }, + { -1, 30, 0, 0, -5, -10 }, + { -1, 30, 0, 0, -4, -10 }, + { 0, 30, 0, 0, -3, -10 }, + { 0, 30, 0, 0, -2, -10 }, + { 0, 30, 0, 0, -1, -10 }, + { 0, 30, 0, 0, -1, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { -1, 30, 0, 0, 1, -10 }, + { -1, 30, 0, 0, 1, -10 }, + { -2, 30, 0, 0, 1, -10 }, + { -3, 30, 0, 0, 2, -10 }, + { -3, 30, 0, 0, 2, -10 }, + { -4, 30, 0, 0, 2, -10 }, + { -4, 30, 0, 0, 2, -10 }, + { -5, 30, 0, 0, 3, -10 }, + { -5, 30, 0, 0, 3, -10 }, + { -5, 30, 0, 0, 3, -10 }, + { -5, 30, 0, 0, 3, -10 }, + { -5, 30, 0, 0, 4, -10 }, + { -5, 30, 0, 0, 4, -10 }, + { -4, 30, 0, 0, 4, -10 }, + { -3, 30, 0, 0, 4, -10 }, + { -1, 30, 0, 0, 4, -10 }, + { 0, 30, 0, 0, 5, -10 }, + { 2, 30, 0, 0, 5, -10 }, + { 5, 30, 0, 0, 5, -10 }, + { 9, 30, 0, 0, 5, -10 }, + { 13, 30, 0, 0, 5, -10 }, + { 17, 30, 0, 0, 5, -10 }, + { 22, 30, 0, 0, 6, -10 }, + { 28, 30, 0, 0, 6, -10 }, + { 33, 30, 0, 0, 6, -10 }, + { 38, 30, 0, 0, 6, -10 }, + { 44, 30, 0, 0, 6, -10 }, + { 49, 30, 0, 0, 6, -10 }, + { 55, 30, 0, 0, 6, -10 }, + { 60, 30, 0, 0, 6, -10 }, + { 64, 30, 0, 0, 6, -10 }, + { 69, 30, 0, 0, 7, -10 }, + { 73, 30, 0, 0, 7, -10 }, + { 76, 30, 0, 0, 7, -10 }, + { 78, 30, 0, 0, 7, -10 }, + { 80, 30, 0, 0, 7, -10 }, + { 81, 30, 0, 0, 7, -10 }, + { 81, 30, 0, 0, 7, -10 }, + { 79, 30, 0, 0, 7, -10 }, + { 72, 30, 0, 0, 7, -10 }, + { 62, 30, 0, 0, 7, -10 }, + { 50, 30, 0, 0, 7, -10 }, + { 36, 30, 0, 0, 7, -10 }, + { 23, 30, 0, 0, 7, -10 }, + { 10, 30, 0, 0, 7, -10 }, + { 0, 30, 0, 0, 7, -10 }, + { -7, 30, 0, 0, 7, -10 }, + { -12, 30, 0, 0, 7, -10 }, + { -14, 30, 0, 0, 7, -10 }, + { -15, 30, 0, 0, 7, -10 }, + { -16, 30, 0, 0, 7, -10 }, + { -17, 30, 0, 0, 7, -10 }, + { -17, 30, 0, 0, 7, -10 }, + { -17, 30, 0, 0, 7, -10 }, + { -17, 30, 0, 0, 7, -10 }, + { -16, 30, 0, 0, 7, -10 }, + { -15, 30, 0, 0, 7, -10 }, + { -14, 30, 0, 0, 7, -10 }, + { -13, 30, 0, 0, 7, -10 }, + { -12, 30, 0, 0, 7, -10 }, + { -10, 30, 0, 0, 7, -10 }, + { -8, 30, 0, 0, 7, -10 }, + { -6, 30, 0, 0, 7, -10 }, + { -5, 30, 0, 0, 7, -10 }, + { -3, 30, 0, 0, 6, -10 }, + { -1, 30, 0, 0, 6, -10 }, + { 0, 30, 0, 0, 6, -10 }, + { 2, 30, 0, 0, 6, -10 }, + { 4, 30, 0, 0, 6, -10 }, + { 6, 30, 0, 0, 6, -10 }, + { 8, 30, 0, 0, 6, -10 }, + { 10, 30, 0, 0, 6, -10 }, + { 11, 30, 0, 0, 6, -10 }, + { 13, 30, 0, 0, 6, -10 }, + { 15, 30, 0, 0, 6, -10 }, + { 17, 30, 0, 0, 6, -10 }, + { 20, 30, 0, 0, 5, -10 }, + { 22, 30, 0, 0, 5, -10 }, + { 25, 30, 0, 0, 5, -10 }, + { 28, 30, 0, 0, 5, -10 }, + { 31, 30, 0, 0, 5, -10 }, + { 34, 30, 0, 0, 5, -10 }, + { 37, 30, 0, 0, 5, -10 }, + { 40, 30, 0, 0, 5, -10 }, + { 43, 30, 0, 0, 5, -10 }, + { 46, 30, 0, 0, 5, -10 }, + { 50, 30, 0, 0, 4, -10 }, + { 53, 30, 0, 0, 4, -10 }, + { 57, 30, 0, 0, 4, -10 }, + { 61, 30, 0, 0, 4, -10 }, + { 65, 30, 0, 0, 4, -10 }, + { 70, 30, 0, 0, 4, -10 }, + { 75, 30, 0, 0, 4, -10 }, + { 80, 30, 0, 0, 4, -10 }, + { 85, 30, 0, 0, 4, -10 }, + { 90, 30, 0, 0, 3, -10 }, + { 95, 30, 0, 0, 3, -10 }, + { 100, 30, 0, 0, 3, -10 }, + { 105, 30, 0, 0, 3, -10 }, + { 111, 30, 0, 0, 3, -10 }, + { 116, 30, 0, 0, 3, -10 }, + { 121, 30, 0, 0, 3, -10 }, + { 125, 30, 0, 0, 3, -10 }, + { 130, 30, 0, 0, 3, -10 }, + { 135, 30, 0, 0, 2, -10 }, + { 139, 30, 0, 0, 2, -10 }, + { 143, 30, 0, 0, 2, -10 }, + { 146, 30, 0, 0, 2, -10 }, + { 150, 30, 0, 0, 2, -10 }, + { 153, 30, 0, 0, 2, -10 }, + { 155, 30, 0, 0, 2, -10 }, + { 157, 30, 0, 0, 2, -10 }, + { 159, 30, 0, 0, 2, -10 }, + { 160, 30, 0, 0, 1, -10 }, + { 161, 30, 0, 0, 1, -10 }, + { 161, 30, 0, 0, 1, -10 }, + { 160, 30, 0, 0, 1, -10 }, + { 159, 30, 0, 0, 1, -10 }, + { 156, 30, 0, 0, 1, -10 }, + { 153, 30, 0, 0, 1, -10 }, + { 149, 30, 0, 0, 1, -10 }, + { 145, 30, 0, 0, 1, -10 }, + { 140, 30, 0, 0, 1, -10 }, + { 134, 30, 0, 0, 1, -10 }, + { 128, 30, 0, 0, 0, -10 }, + { 121, 30, 0, 0, 0, -10 }, + { 114, 30, 0, 0, 0, -10 }, + { 106, 30, 0, 0, 0, -10 }, + { 99, 30, 0, 0, 0, -10 }, + { 91, 30, 0, 0, 0, -10 }, + { 83, 30, 0, 0, 0, -10 }, + { 74, 30, 0, 0, 0, -10 }, + { 66, 30, 0, 0, 0, -10 }, + { 58, 30, 0, 0, 0, -10 }, + { 50, 30, 0, 0, 0, -10 }, + { 42, 30, 0, 0, 0, -10 }, + { 34, 30, 0, 0, 0, -10 }, + { 26, 30, 0, 0, 0, -10 }, + { 19, 30, 0, 0, 0, -10 }, + { 12, 30, 0, 0, 0, -10 }, + { 5, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { -4, 30, 0, 0, 0, -10 }, + { -5, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, + { 27, 30, 0, 0, 0, -10 }, + { 50, 30, 0, 0, 0, -10 }, + { 48, 30, 0, 0, 0, -10 }, + { 44, 30, 0, 0, 0, -10 }, + { 39, 30, 0, 0, 0, -10 }, + { 32, 30, 0, 0, 0, -10 }, + { 25, 30, 0, 0, 0, -10 }, + { 17, 30, 0, 0, 0, -10 }, + { 10, 30, 0, 0, 0, -10 }, + { 5, 30, 0, 0, 0, -10 }, + { 1, 30, 0, 0, 0, -10 }, + { 0, 30, 0, 0, 0, -10 }, +}; + +static s16 animdata_mario_intro_2[][6] = { + { 0, 0, 10, 0, 0, -20000 }, + { 0, 0, 3584, 19, -3, -19864 }, + { 0, 0, 3541, 71, -14, -19484 }, + { 0, 0, 3471, 147, -32, -18903 }, + { 0, 0, 3377, 236, -54, -18164 }, + { 0, 0, 3261, 331, -80, -17307 }, + { 0, 0, 3126, 421, -108, -16377 }, + { 0, 0, 2974, 497, -139, -15414 }, + { 0, 0, 2807, 549, -170, -14462 }, + { 0, 0, 2627, 570, -202, -13563 }, + { 0, 0, 2438, 497, -253, -12576 }, + { 0, 0, 2240, 328, -325, -11395 }, + { 0, 0, 2037, 140, -384, -10116 }, + { 0, 0, 1830, 10, -396, -8835 }, + { 0, 0, 1623, -52, -350, -7546 }, + { 0, 0, 1417, -90, -271, -6206 }, + { 0, 0, 1214, -109, -174, -4859 }, + { 0, 0, 1017, -117, -77, -3545 }, + { 0, 0, 829, -119, 2, -2306 }, + { 0, 0, 651, -93, 64, -1110 }, + { 0, 0, 486, -40, 111, -47 }, + { 0, 0, 336, 0, 136, 661 }, + { 0, 0, 203, 11, 127, 833 }, + { 0, 0, 90, 9, 96, 650 }, + { 0, 0, 0, 7, 63, 430 }, + { 0, 0, -70, 3, 30, 203 }, + { 0, 0, -125, 0, 0, 0 }, + { 0, 0, -166, 0, -21, -38 }, + { 0, 0, -193, 0, -37, -19 }, + { 0, 0, -208, 0, -44, 0 }, + { 0, 0, -213, 0, -40, 0 }, + { 0, 0, -208, 0, -32, 0 }, + { 0, 0, -196, 0, -21, 0 }, + { 0, 0, -177, 0, -10, 0 }, + { 0, 0, -152, 0, 0, 0 }, + { 0, 0, -124, 0, 0, 0 }, + { 0, 0, -92, 0, 0, 0 }, + { 0, 0, -59, 0, 0, 0 }, + { 0, 0, -26, 0, 0, 0 }, + { 0, 0, 4, 0, 0, 0 }, + { 0, 0, 34, 0, 0, 0 }, + { 0, 0, 59, 0, 0, 0 }, + { 0, 0, 80, 0, 0, 0 }, + { 0, 0, 94, 0, 0, 0 }, + { 0, 0, 100, 0, 0, 0 }, + { 0, 0, 100, 0, 0, 0 }, + { 0, 0, 97, 0, 0, 0 }, + { 0, 0, 93, 0, 0, 0 }, + { 1, 0, 86, 0, 0, 0 }, + { 1, 0, 79, 0, 0, 0 }, + { 1, 0, 69, 0, 0, 0 }, + { 1, 0, 59, 0, 0, 0 }, + { 2, 1, 48, 0, 0, 0 }, + { 2, 1, 37, 0, 0, 0 }, + { 2, 1, 24, 0, 0, 0 }, + { 3, 1, 12, 0, 0, 0 }, + { 3, 1, 0, 0, 0, 0 }, + { 4, 2, -12, 0, 0, 0 }, + { 4, 2, -24, 0, 0, 0 }, + { 5, 2, -35, 0, 0, 0 }, + { 5, 2, -45, 0, 0, 0 }, + { 6, 2, -55, 0, 0, 0 }, + { 7, 3, -63, 0, 0, 0 }, + { 8, 3, -70, 0, 0, 0 }, + { 8, 3, -75, 0, 0, 0 }, + { 9, 3, -78, 0, 0, 0 }, + { 10, 3, -80, 0, 0, 0 }, + { 11, 3, -81, 0, 0, 0 }, + { 12, 3, -80, 0, 0, 0 }, + { 14, 3, -79, 0, 0, 0 }, + { 15, 2, -77, 0, 0, 0 }, + { 17, 2, -74, 0, 0, 0 }, + { 18, 2, -70, 0, 0, 0 }, + { 20, 2, -66, 0, 0, 0 }, + { 22, 2, -61, 0, 0, 0 }, + { 23, 2, -56, 0, 0, 0 }, + { 25, 1, -51, 0, 0, 0 }, + { 27, 1, -45, 0, 0, 0 }, + { 28, 1, -39, 0, 0, 0 }, + { 30, 1, -34, 0, 0, 0 }, + { 31, 1, -28, 0, 0, 0 }, + { 33, 0, -23, 0, 0, 0 }, + { 34, 0, -18, 0, 0, 0 }, + { 35, 0, -13, 0, 0, 0 }, + { 36, 0, -9, 0, 0, 0 }, + { 37, 0, -6, 0, 0, 0 }, + { 37, 0, -3, 0, 0, 0 }, + { 37, 0, -1, 0, 0, 0 }, + { 37, 0, 0, 0, 0, 0 }, + { 37, 0, 0, 0, 0, 0 }, + { 37, 0, 1, 0, 0, 0 }, + { 37, 0, 2, 0, 0, 0 }, + { 37, 0, 2, 0, 0, 0 }, + { 36, 0, 3, 0, 0, 0 }, + { 36, 0, 4, 0, 0, 0 }, + { 36, 0, 4, 0, 0, 0 }, + { 36, 0, 5, 0, 0, 0 }, + { 35, 0, 5, 0, 0, 0 }, + { 35, 0, 5, 0, 0, 0 }, + { 34, 0, 6, 0, 0, 0 }, + { 34, 0, 6, 0, 0, 0 }, + { 34, 0, 7, 0, 0, 0 }, + { 33, 0, 7, 0, 0, 0 }, + { 33, 0, 7, 0, 0, 0 }, + { 32, 0, 7, 0, 0, 0 }, + { 32, 0, 8, 0, 0, 0 }, + { 31, 0, 8, 0, 0, 0 }, + { 31, 0, 8, 0, 0, 0 }, + { 30, 0, 8, 0, 0, 0 }, + { 29, 0, 8, 0, 0, 0 }, + { 29, 0, 8, 0, 0, 0 }, + { 28, 0, 8, 0, 0, 0 }, + { 27, 0, 8, 0, 0, 0 }, + { 27, 0, 8, 0, 0, 0 }, + { 26, 0, 8, 0, 0, 0 }, + { 26, 0, 8, 0, 0, 0 }, + { 25, 0, 8, 0, 0, 0 }, + { 24, 0, 8, 0, 0, 0 }, + { 23, 0, 8, 0, 0, 0 }, + { 23, 0, 8, 0, 0, 0 }, + { 22, 0, 8, 0, 0, 0 }, + { 21, 0, 8, 0, 0, 0 }, + { 21, 0, 8, 0, 0, 0 }, + { 20, 0, 8, 0, 0, 0 }, + { 19, 0, 8, 0, 0, 0 }, + { 19, 0, 7, 0, 0, 0 }, + { 18, 0, 7, 0, 0, 0 }, + { 17, 0, 7, 0, 0, 0 }, + { 16, 0, 7, 0, 0, 0 }, + { 16, 0, 7, 0, 0, 0 }, + { 15, 0, 6, 0, 0, 0 }, + { 14, 0, 6, 0, 0, 0 }, + { 14, 0, 6, 0, 0, 0 }, + { 13, 0, 6, 0, 0, 0 }, + { 12, 0, 5, 0, 0, 0 }, + { 12, 0, 5, 0, 0, 0 }, + { 11, 0, 5, 0, 0, 0 }, + { 10, 0, 5, 0, 0, 0 }, + { 10, 0, 4, 0, 0, 0 }, + { 9, 0, 4, 0, 0, 0 }, + { 8, 0, 4, 0, 0, 0 }, + { 8, 0, 4, 0, 0, 0 }, + { 7, 0, 3, 0, 0, 0 }, + { 7, 0, 3, 0, 0, 0 }, + { 6, 0, 3, 0, 0, 0 }, + { 5, 0, 3, 0, 0, 0 }, + { 5, 0, 2, 0, 0, 0 }, + { 4, 0, 2, 0, 0, 0 }, + { 4, 0, 2, 0, 0, 0 }, + { 3, 0, 2, 0, 0, 0 }, + { 3, 0, 1, 0, 0, 0 }, + { 3, 0, 1, 0, 0, 0 }, + { 2, 0, 1, 0, 0, 0 }, + { 2, 0, 1, 0, 0, 0 }, + { 1, 0, 1, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0 }, + { 1, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, +}; + +struct AnimDataInfo anim_mario_intro[] = { + { ARRAY_COUNT(animdata_mario_intro_1), GD_ANIM_ROT3S_POS3S, animdata_mario_intro_1 }, + { ARRAY_COUNT(animdata_mario_intro_2), GD_ANIM_ROT3S_POS3S, animdata_mario_intro_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_silver_star_1[][6] = { + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1300, 1500, 2600 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1253, 1459, 2536 }, { 0, 0, 0, -1141, 1363, 2382 }, + { 0, 0, 0, -977, 1224, 2157 }, { 0, 0, 0, -774, 1054, 1880 }, { 0, 0, 0, -548, 866, 1569 }, + { 0, 0, 0, -312, 672, 1246 }, { 0, 0, 0, -80, 487, 928 }, { 0, 0, 0, 116, 389, 665 }, + { 0, 0, 0, -62, 484, 790 }, { 0, 0, 0, -89, 400, 735 }, { 0, 0, 0, -90, 407, 739 }, + { 0, 0, 0, -80, 462, 770 }, { 0, 0, 0, -38, 498, 798 }, { 0, 0, 0, -29, 499, 796 }, + { 0, 0, 0, -42, 497, 798 }, { 0, 0, 0, -44, 496, 798 }, { 0, 0, 0, -38, 498, 798 }, + { 0, 0, 0, -28, 500, 796 }, { 0, 0, 0, -18, 500, 791 }, { 0, 0, 0, -11, 499, 787 }, + { 0, 0, 0, -11, 499, 787 }, { 0, 0, 0, -19, 500, 792 }, { 0, 0, 0, -41, 497, 798 }, + { 0, 0, 0, -71, 475, 781 }, { 0, 0, 0, -89, 428, 749 }, { 0, 0, 0, -87, 392, 731 }, + { 0, 0, 0, -82, 380, 723 }, { 0, 0, 0, -82, 380, 724 }, { 0, 0, 0, -86, 387, 728 }, + { 0, 0, 0, -88, 395, 732 }, { 0, 0, 0, -88, 395, 733 }, { 0, 0, 0, -83, 382, 725 }, + { 0, 0, 0, -70, 368, 713 }, { 0, 0, 0, -59, 368, 705 }, { 0, 0, 0, -55, 369, 702 }, + { 0, 0, 0, -54, 370, 702 }, { 0, 0, 0, -56, 369, 703 }, { 0, 0, 0, -59, 368, 705 }, + { 0, 0, 0, -59, 368, 705 }, { 0, 0, 0, -57, 369, 703 }, { 0, 0, 0, -49, 371, 698 }, + { 0, 0, 0, -35, 378, 689 }, { 0, 0, 0, -11, 389, 675 }, { 0, 0, 0, 25, 396, 655 }, + { 0, 0, 0, 58, 360, 644 }, { 0, 0, 0, 65, 303, 647 }, { 0, 0, 0, 62, 240, 653 }, + { 0, 0, 0, 56, 174, 660 }, { 0, 0, 0, 48, 104, 668 }, { 0, 0, 0, 40, 31, 678 }, + { 0, 0, 0, 32, -44, 689 }, { 0, 0, 0, 27, -122, 701 }, { 0, 0, 0, 25, -201, 715 }, + { 0, 0, 0, 34, -281, 732 }, { 0, 0, 0, 72, -350, 756 }, { 0, 0, 0, 123, -378, 780 }, + { 0, 0, 0, 154, -386, 793 }, { 0, 0, 0, 175, -388, 802 }, { 0, 0, 0, 200, -389, 811 }, + { 0, 0, 0, 244, -388, 827 }, { 0, 0, 0, 322, -376, 854 }, { 0, 0, 0, 451, -343, 889 }, + { 0, 0, 0, 709, -240, 937 }, { 0, 0, 0, 997, -15, 896 }, { 0, 0, 0, 1106, 176, 726 }, + { 0, 0, 0, 1146, 282, 615 }, { 0, 0, 0, 1170, 377, 508 }, { 0, 0, 0, 1182, 461, 408 }, + { 0, 0, 0, 1183, 537, 315 }, { 0, 0, 0, 1173, 605, 228 }, { 0, 0, 0, 1155, 665, 148 }, + { 0, 0, 0, 1134, 718, 72 }, { 0, 0, 0, 1110, 766, 2 }, { 0, 0, 0, 1084, 810, -64 }, + { 0, 0, 0, 1056, 852, -128 }, { 0, 0, 0, 1026, 891, -191 }, { 0, 0, 0, 994, 930, -252 }, + { 0, 0, 0, 958, 967, -314 }, { 0, 0, 0, 918, 1004, -377 }, { 0, 0, 0, 872, 1041, -440 }, + { 0, 0, 0, 817, 1077, -505 }, { 0, 0, 0, 750, 1111, -569 }, { 0, 0, 0, 679, 1136, -624 }, + { 0, 0, 0, 615, 1153, -666 }, { 0, 0, 0, 560, 1164, -697 }, { 0, 0, 0, 513, 1172, -721 }, + { 0, 0, 0, 472, 1177, -740 }, { 0, 0, 0, 437, 1180, -755 }, { 0, 0, 0, 404, 1183, -769 }, + { 0, 0, 0, 372, 1185, -781 }, { 0, 0, 0, 339, 1187, -792 }, { 0, 0, 0, 302, 1188, -804 }, + { 0, 0, 0, 261, 1189, -816 }, { 0, 0, 0, 229, 1189, -825 }, { 0, 0, 0, 207, 1188, -830 }, + { 0, 0, 0, 193, 1188, -833 }, { 0, 0, 0, 185, 1188, -835 }, { 0, 0, 0, 179, 1188, -836 }, + { 0, 0, 0, 175, 1188, -837 }, { 0, 0, 0, 168, 1187, -839 }, { 0, 0, 0, 157, 1187, -841 }, + { 0, 0, 0, 140, 1186, -844 }, { 0, 0, 0, 114, 1185, -849 }, { 0, 0, 0, 76, 1183, -855 }, + { 0, 0, 0, 23, 1179, -860 }, { 0, 0, 0, -44, 1173, -864 }, { 0, 0, 0, -129, 1162, -864 }, + { 0, 0, 0, -225, 1147, -857 }, { 0, 0, 0, -333, 1125, -843 }, { 0, 0, 0, -450, 1097, -817 }, + { 0, 0, 0, -571, 1059, -776 }, { 0, 0, 0, -691, 1008, -714 }, { 0, 0, 0, -795, 941, -623 }, + { 0, 0, 0, -874, 860, -505 }, { 0, 0, 0, -931, 779, -381 }, { 0, 0, 0, -971, 703, -263 }, + { 0, 0, 0, -996, 631, -150 }, { 0, 0, 0, -1006, 562, -39 }, { 0, 0, 0, -997, 494, 70 }, + { 0, 0, 0, -956, 429, 179 }, { 0, 0, 0, -861, 376, 269 }, { 0, 0, 0, -731, 334, 340 }, + { 0, 0, 0, -588, 301, 398 }, { 0, 0, 0, -450, 276, 446 }, { 0, 0, 0, -319, 257, 486 }, + { 0, 0, 0, -199, 243, 522 }, { 0, 0, 0, -91, 235, 556 }, { 0, 0, 0, 1, 236, 591 }, + { 0, 0, 0, 52, 277, 629 }, { 0, 0, 0, 27, 339, 638 }, { 0, 0, 0, 1, 386, 638 }, + { 0, 0, 0, -17, 425, 637 }, { 0, 0, 0, -26, 459, 636 }, { 0, 0, 0, -22, 485, 636 }, + { 0, 0, 0, -10, 501, 638 }, { 0, 0, 0, 1, 509, 639 }, { 0, 0, 0, 9, 513, 640 }, + { 0, 0, 0, 14, 516, 641 }, { 0, 0, 0, 17, 517, 641 }, { 0, 0, 0, 19, 518, 642 }, + { 0, 0, 0, 20, 518, 642 }, { 0, 0, 0, 22, 519, 642 }, { 0, 0, 0, 26, 521, 642 }, + { 0, 0, 0, 32, 523, 643 }, { 0, 0, 0, 42, 527, 644 }, { 0, 0, 0, 57, 531, 645 }, + { 0, 0, 0, 78, 538, 646 }, { 0, 0, 0, 106, 545, 648 }, { 0, 0, 0, 142, 554, 651 }, + { 0, 0, 0, 185, 563, 653 }, { 0, 0, 0, 234, 572, 656 }, { 0, 0, 0, 287, 582, 658 }, + { 0, 0, 0, 344, 591, 661 }, { 0, 0, 0, 404, 599, 664 }, { 0, 0, 0, 465, 607, 667 }, + { 0, 0, 0, 528, 613, 671 }, { 0, 0, 0, 591, 617, 675 }, { 0, 0, 0, 653, 617, 679 }, + { 0, 0, 0, 681, 587, 691 }, { 0, 0, 0, 640, 546, 703 }, { 0, 0, 0, 598, 512, 712 }, + { 0, 0, 0, 557, 482, 719 }, { 0, 0, 0, 520, 458, 724 }, { 0, 0, 0, 486, 436, 728 }, + { 0, 0, 0, 456, 418, 731 }, { 0, 0, 0, 428, 402, 734 }, { 0, 0, 0, 402, 387, 736 }, + { 0, 0, 0, 379, 375, 737 }, { 0, 0, 0, 356, 363, 739 }, { 0, 0, 0, 335, 353, 739 }, + { 0, 0, 0, 314, 343, 740 }, { 0, 0, 0, 293, 333, 740 }, { 0, 0, 0, 271, 324, 740 }, + { 0, 0, 0, 248, 314, 740 }, { 0, 0, 0, 223, 305, 739 }, { 0, 0, 0, 196, 295, 738 }, + { 0, 0, 0, 166, 285, 735 }, { 0, 0, 0, 131, 275, 732 }, { 0, 0, 0, 93, 266, 726 }, + { 0, 0, 0, 50, 259, 718 }, { 0, 0, 0, 1, 252, 709 }, { 0, 0, 0, -53, 247, 699 }, + { 0, 0, 0, -109, 243, 689 }, { 0, 0, 0, -161, 241, 679 }, { 0, 0, 0, -209, 239, 669 }, + { 0, 0, 0, -255, 239, 660 }, { 0, 0, 0, -300, 238, 650 }, { 0, 0, 0, -345, 239, 640 }, + { 0, 0, 0, -390, 240, 629 }, { 0, 0, 0, -437, 242, 617 }, { 0, 0, 0, -486, 244, 604 }, + { 0, 0, 0, -540, 248, 589 }, { 0, 0, 0, -597, 253, 571 }, { 0, 0, 0, -660, 260, 549 }, + { 0, 0, 0, -727, 270, 522 }, { 0, 0, 0, -800, 285, 487 }, { 0, 0, 0, -875, 306, 441 }, + { 0, 0, 0, -943, 339, 374 }, { 0, 0, 0, -987, 389, 284 }, { 0, 0, 0, -1007, 458, 171 }, + { 0, 0, 0, -1004, 544, 35 }, { 0, 0, 0, -977, 643, -115 }, { 0, 0, 0, -929, 748, -276 }, + { 0, 0, 0, -856, 852, -440 }, { 0, 0, 0, -749, 943, -597 }, { 0, 0, 0, -605, 1002, -724 }, + { 0, 0, 0, -454, 1040, -819 }, { 0, 0, 0, -308, 1066, -888 }, { 0, 0, 0, -172, 1086, -939 }, + { 0, 0, 0, -49, 1102, -973 }, { 0, 0, 0, 61, 1116, -993 }, { 0, 0, 0, 160, 1124, -1003 }, + { 0, 0, 0, 247, 1129, -1005 }, { 0, 0, 0, 323, 1132, -1002 }, { 0, 0, 0, 389, 1133, -996 }, + { 0, 0, 0, 447, 1134, -989 }, { 0, 0, 0, 498, 1134, -980 }, { 0, 0, 0, 544, 1134, -970 }, + { 0, 0, 0, 585, 1134, -959 }, { 0, 0, 0, 624, 1134, -947 }, { 0, 0, 0, 662, 1133, -934 }, + { 0, 0, 0, 699, 1133, -918 }, { 0, 0, 0, 738, 1133, -901 }, { 0, 0, 0, 778, 1132, -879 }, + { 0, 0, 0, 821, 1132, -851 }, { 0, 0, 0, 866, 1133, -816 }, { 0, 0, 0, 908, 1134, -775 }, + { 0, 0, 0, 945, 1135, -735 }, { 0, 0, 0, 977, 1137, -695 }, { 0, 0, 0, 1006, 1138, -657 }, + { 0, 0, 0, 1031, 1139, -619 }, { 0, 0, 0, 1053, 1140, -584 }, { 0, 0, 0, 1074, 1141, -549 }, + { 0, 0, 0, 1092, 1141, -515 }, { 0, 0, 0, 1110, 1141, -481 }, { 0, 0, 0, 1125, 1141, -448 }, + { 0, 0, 0, 1140, 1140, -416 }, { 0, 0, 0, 1154, 1139, -382 }, { 0, 0, 0, 1168, 1138, -349 }, + { 0, 0, 0, 1180, 1136, -314 }, { 0, 0, 0, 1193, 1133, -277 }, { 0, 0, 0, 1204, 1129, -239 }, + { 0, 0, 0, 1214, 1125, -199 }, { 0, 0, 0, 1224, 1118, -156 }, { 0, 0, 0, 1231, 1109, -111 }, + { 0, 0, 0, 1236, 1096, -63 }, { 0, 0, 0, 1239, 1082, -17 }, { 0, 0, 0, 1241, 1068, 21 }, + { 0, 0, 0, 1240, 1055, 54 }, { 0, 0, 0, 1240, 1043, 83 }, { 0, 0, 0, 1238, 1032, 108 }, + { 0, 0, 0, 1236, 1022, 129 }, { 0, 0, 0, 1234, 1013, 149 }, { 0, 0, 0, 1232, 1004, 168 }, + { 0, 0, 0, 1229, 995, 186 }, { 0, 0, 0, 1226, 986, 205 }, { 0, 0, 0, 1222, 976, 226 }, + { 0, 0, 0, 1218, 965, 248 }, { 0, 0, 0, 1211, 952, 274 }, { 0, 0, 0, 1203, 937, 302 }, + { 0, 0, 0, 1192, 920, 335 }, { 0, 0, 0, 1178, 900, 373 }, { 0, 0, 0, 1158, 879, 416 }, + { 0, 0, 0, 1131, 855, 465 }, { 0, 0, 0, 1095, 830, 518 }, { 0, 0, 0, 1046, 806, 575 }, + { 0, 0, 0, 980, 786, 634 }, { 0, 0, 0, 867, 768, 713 }, { 0, 0, 0, 682, 754, 812 }, + { 0, 0, 0, 446, 749, 910 }, { 0, 0, 0, 182, 750, 989 }, { 0, 0, 0, -87, 752, 1023 }, + { 0, 0, 0, -323, 758, 988 }, { 0, 0, 0, -511, 767, 919 }, { 0, 0, 0, -664, 776, 834 }, + { 0, 0, 0, -792, 785, 734 }, { 0, 0, 0, -899, 791, 611 }, { 0, 0, 0, -966, 793, 474 }, + { 0, 0, 0, -999, 791, 354 }, { 0, 0, 0, -1016, 789, 252 }, { 0, 0, 0, -1024, 788, 164 }, + { 0, 0, 0, -1027, 787, 82 }, { 0, 0, 0, -1026, 786, 0 }, { 0, 0, 0, -1019, 787, -87 }, + { 0, 0, 0, -1005, 788, -188 }, { 0, 0, 0, -978, 795, -307 }, { 0, 0, 0, -935, 807, -423 }, + { 0, 0, 0, -887, 823, -520 }, { 0, 0, 0, -836, 839, -603 }, { 0, 0, 0, -781, 856, -679 }, + { 0, 0, 0, -719, 873, -751 }, { 0, 0, 0, -644, 892, -822 }, { 0, 0, 0, -551, 911, -892 }, + { 0, 0, 0, -429, 928, -955 }, { 0, 0, 0, -289, 941, -997 }, { 0, 0, 0, -151, 951, -1021 }, + { 0, 0, 0, -17, 960, -1034 }, { 0, 0, 0, 112, 967, -1038 }, { 0, 0, 0, 238, 971, -1033 }, + { 0, 0, 0, 360, 973, -1019 }, { 0, 0, 0, 476, 971, -994 }, { 0, 0, 0, 587, 964, -958 }, + { 0, 0, 0, 688, 950, -904 }, { 0, 0, 0, 770, 929, -837 }, { 0, 0, 0, 832, 905, -767 }, + { 0, 0, 0, 882, 882, -701 }, { 0, 0, 0, 923, 859, -640 }, { 0, 0, 0, 957, 838, -583 }, + { 0, 0, 0, 986, 818, -530 }, { 0, 0, 0, 1012, 800, -480 }, { 0, 0, 0, 1034, 782, -431 }, + { 0, 0, 0, 1055, 764, -384 }, { 0, 0, 0, 1075, 747, -336 }, { 0, 0, 0, 1093, 729, -285 }, + { 0, 0, 0, 1111, 710, -232 }, { 0, 0, 0, 1128, 690, -174 }, { 0, 0, 0, 1143, 669, -110 }, + { 0, 0, 0, 1156, 646, -38 }, { 0, 0, 0, 1164, 622, 43 }, { 0, 0, 0, 1163, 599, 130 }, + { 0, 0, 0, 1147, 580, 215 }, { 0, 0, 0, 1110, 570, 292 }, { 0, 0, 0, 1054, 567, 356 }, + { 0, 0, 0, 988, 568, 409 }, { 0, 0, 0, 918, 572, 453 }, { 0, 0, 0, 847, 578, 492 }, + { 0, 0, 0, 774, 585, 526 }, { 0, 0, 0, 702, 593, 558 }, { 0, 0, 0, 630, 602, 588 }, + { 0, 0, 0, 559, 611, 616 }, { 0, 0, 0, 489, 620, 644 }, { 0, 0, 0, 420, 630, 671 }, + { 0, 0, 0, 352, 640, 699 }, { 0, 0, 0, 285, 649, 726 }, { 0, 0, 0, 220, 659, 755 }, + { 0, 0, 0, 156, 669, 786 }, { 0, 0, 0, 95, 679, 820 }, { 0, 0, 0, 37, 688, 857 }, + { 0, 0, 0, -16, 697, 898 }, { 0, 0, 0, -70, 704, 940 }, { 0, 0, 0, -121, 711, 984 }, + { 0, 0, 0, -171, 718, 1028 }, { 0, 0, 0, -218, 725, 1074 }, { 0, 0, 0, -263, 733, 1121 }, + { 0, 0, 0, -306, 742, 1170 }, { 0, 0, 0, -347, 753, 1219 }, { 0, 0, 0, -387, 766, 1268 }, + { 0, 0, 0, -425, 781, 1317 }, { 0, 0, 0, -463, 798, 1366 }, { 0, 0, 0, -499, 817, 1414 }, + { 0, 0, 0, -535, 837, 1462 }, { 0, 0, 0, -571, 859, 1509 }, { 0, 0, 0, -602, 880, 1559 }, + { 0, 0, 0, -629, 901, 1610 }, { 0, 0, 0, -654, 921, 1662 }, { 0, 0, 0, -676, 940, 1713 }, + { 0, 0, 0, -698, 959, 1764 }, { 0, 0, 0, -718, 978, 1815 }, { 0, 0, 0, -737, 997, 1864 }, + { 0, 0, 0, -756, 1015, 1913 }, { 0, 0, 0, -774, 1034, 1961 }, { 0, 0, 0, -792, 1051, 2009 }, + { 0, 0, 0, -809, 1069, 2055 }, { 0, 0, 0, -826, 1087, 2100 }, { 0, 0, 0, -843, 1104, 2144 }, + { 0, 0, 0, -859, 1121, 2187 }, { 0, 0, 0, -875, 1138, 2229 }, { 0, 0, 0, -891, 1155, 2270 }, + { 0, 0, 0, -907, 1171, 2309 }, { 0, 0, 0, -923, 1188, 2347 }, { 0, 0, 0, -939, 1204, 2384 }, + { 0, 0, 0, -954, 1220, 2420 }, { 0, 0, 0, -970, 1236, 2454 }, { 0, 0, 0, -986, 1252, 2487 }, + { 0, 0, 0, -1002, 1268, 2519 }, { 0, 0, 0, -1018, 1284, 2548 }, { 0, 0, 0, -1034, 1300, 2576 }, + { 0, 0, 0, -1050, 1316, 2603 }, { 0, 0, 0, -1067, 1331, 2627 }, { 0, 0, 0, -1084, 1347, 2649 }, + { 0, 0, 0, -1102, 1363, 2669 }, { 0, 0, 0, -1121, 1379, 2686 }, { 0, 0, 0, -1140, 1395, 2699 }, + { 0, 0, 0, -1160, 1411, 2708 }, { 0, 0, 0, -1180, 1427, 2711 }, { 0, 0, 0, -1199, 1441, 2709 }, + { 0, 0, 0, -1217, 1453, 2702 }, { 0, 0, 0, -1233, 1464, 2692 }, { 0, 0, 0, -1246, 1472, 2680 }, + { 0, 0, 0, -1258, 1479, 2667 }, { 0, 0, 0, -1268, 1484, 2654 }, { 0, 0, 0, -1276, 1488, 2641 }, + { 0, 0, 0, -1284, 1492, 2629 }, { 0, 0, 0, -1290, 1495, 2618 }, { 0, 0, 0, -1295, 1498, 2608 }, + { 0, 0, 0, -1300, 1500, 2600 }, { 0, 0, 0, -1303, 1501, 2591 }, { 0, 0, 0, -1308, 1503, 2582 }, + { 0, 0, 0, -1312, 1505, 2573 }, { 0, 0, 0, -1316, 1506, 2563 }, { 0, 0, 0, -1320, 1508, 2552 }, + { 0, 0, 0, -1324, 1510, 2541 }, { 0, 0, 0, -1329, 1511, 2529 }, { 0, 0, 0, -1333, 1513, 2517 }, + { 0, 0, 0, -1338, 1514, 2504 }, { 0, 0, 0, -1342, 1516, 2491 }, { 0, 0, 0, -1346, 1517, 2478 }, + { 0, 0, 0, -1351, 1518, 2464 }, { 0, 0, 0, -1355, 1520, 2449 }, { 0, 0, 0, -1360, 1521, 2434 }, + { 0, 0, 0, -1365, 1522, 2418 }, { 0, 0, 0, -1369, 1524, 2402 }, { 0, 0, 0, -1374, 1525, 2386 }, + { 0, 0, 0, -1379, 1526, 2369 }, { 0, 0, 0, -1383, 1527, 2351 }, { 0, 0, 0, -1388, 1528, 2334 }, + { 0, 0, 0, -1393, 1529, 2315 }, { 0, 0, 0, -1398, 1530, 2297 }, { 0, 0, 0, -1402, 1531, 2278 }, + { 0, 0, 0, -1407, 1532, 2258 }, { 0, 0, 0, -1412, 1533, 2238 }, { 0, 0, 0, -1417, 1534, 2218 }, + { 0, 0, 0, -1422, 1535, 2197 }, { 0, 0, 0, -1427, 1536, 2176 }, { 0, 0, 0, -1432, 1536, 2155 }, + { 0, 0, 0, -1437, 1537, 2133 }, { 0, 0, 0, -1442, 1538, 2111 }, { 0, 0, 0, -1447, 1538, 2089 }, + { 0, 0, 0, -1452, 1539, 2066 }, { 0, 0, 0, -1457, 1540, 2043 }, { 0, 0, 0, -1462, 1540, 2019 }, + { 0, 0, 0, -1467, 1541, 1995 }, { 0, 0, 0, -1472, 1541, 1971 }, { 0, 0, 0, -1477, 1542, 1947 }, + { 0, 0, 0, -1482, 1542, 1922 }, { 0, 0, 0, -1487, 1543, 1897 }, { 0, 0, 0, -1492, 1543, 1871 }, + { 0, 0, 0, -1497, 1544, 1846 }, { 0, 0, 0, -1503, 1544, 1819 }, { 0, 0, 0, -1508, 1544, 1793 }, + { 0, 0, 0, -1513, 1545, 1767 }, { 0, 0, 0, -1518, 1545, 1740 }, { 0, 0, 0, -1523, 1545, 1713 }, + { 0, 0, 0, -1529, 1546, 1685 }, { 0, 0, 0, -1534, 1546, 1658 }, { 0, 0, 0, -1539, 1546, 1630 }, + { 0, 0, 0, -1544, 1546, 1602 }, { 0, 0, 0, -1550, 1546, 1573 }, { 0, 0, 0, -1555, 1546, 1545 }, + { 0, 0, 0, -1560, 1546, 1516 }, { 0, 0, 0, -1565, 1547, 1487 }, { 0, 0, 0, -1571, 1547, 1458 }, + { 0, 0, 0, -1576, 1547, 1428 }, { 0, 0, 0, -1581, 1547, 1399 }, { 0, 0, 0, -1586, 1547, 1369 }, + { 0, 0, 0, -1592, 1547, 1339 }, { 0, 0, 0, -1597, 1547, 1309 }, { 0, 0, 0, -1602, 1546, 1278 }, + { 0, 0, 0, -1608, 1546, 1248 }, { 0, 0, 0, -1613, 1546, 1217 }, { 0, 0, 0, -1618, 1546, 1186 }, + { 0, 0, 0, -1623, 1546, 1155 }, { 0, 0, 0, -1629, 1546, 1124 }, { 0, 0, 0, -1634, 1546, 1093 }, + { 0, 0, 0, -1639, 1545, 1062 }, { 0, 0, 0, -1645, 1545, 1030 }, { 0, 0, 0, -1650, 1545, 998 }, + { 0, 0, 0, -1655, 1545, 967 }, { 0, 0, 0, -1660, 1544, 935 }, { 0, 0, 0, -1666, 1544, 903 }, + { 0, 0, 0, -1671, 1544, 871 }, { 0, 0, 0, -1676, 1543, 838 }, { 0, 0, 0, -1681, 1543, 806 }, + { 0, 0, 0, -1687, 1543, 774 }, { 0, 0, 0, -1692, 1542, 741 }, { 0, 0, 0, -1697, 1542, 709 }, + { 0, 0, 0, -1702, 1542, 676 }, { 0, 0, 0, -1708, 1541, 643 }, { 0, 0, 0, -1713, 1541, 611 }, + { 0, 0, 0, -1718, 1540, 578 }, { 0, 0, 0, -1723, 1540, 545 }, { 0, 0, 0, -1728, 1539, 512 }, + { 0, 0, 0, -1734, 1539, 480 }, { 0, 0, 0, -1739, 1539, 447 }, { 0, 0, 0, -1744, 1538, 414 }, + { 0, 0, 0, -1749, 1538, 381 }, { 0, 0, 0, -1754, 1537, 348 }, { 0, 0, 0, -1759, 1536, 315 }, + { 0, 0, 0, -1764, 1536, 282 }, { 0, 0, 0, -1769, 1535, 249 }, { 0, 0, 0, -1774, 1535, 217 }, + { 0, 0, 0, -1779, 1534, 184 }, { 0, 0, 0, -1784, 1534, 151 }, { 0, 0, 0, -1789, 1533, 118 }, + { 0, 0, 0, -1794, 1533, 85 }, { 0, 0, 0, -1799, 1532, 53 }, { 0, 0, 0, -1804, 1531, 20 }, + { 0, 0, 0, -1809, 1531, -11 }, { 0, 0, 0, -1814, 1530, -44 }, { 0, 0, 0, -1819, 1530, -76 }, + { 0, 0, 0, -1824, 1529, -109 }, { 0, 0, 0, -1829, 1528, -141 }, { 0, 0, 0, -1834, 1528, -173 }, + { 0, 0, 0, -1839, 1527, -205 }, { 0, 0, 0, -1843, 1527, -237 }, { 0, 0, 0, -1848, 1526, -269 }, + { 0, 0, 0, -1853, 1525, -301 }, { 0, 0, 0, -1858, 1525, -332 }, { 0, 0, 0, -1862, 1524, -364 }, + { 0, 0, 0, -1867, 1524, -395 }, { 0, 0, 0, -1872, 1523, -427 }, { 0, 0, 0, -1876, 1522, -458 }, + { 0, 0, 0, -1881, 1522, -489 }, { 0, 0, 0, -1885, 1521, -520 }, { 0, 0, 0, -1890, 1520, -550 }, + { 0, 0, 0, -1895, 1520, -581 }, { 0, 0, 0, -1899, 1519, -611 }, { 0, 0, 0, -1903, 1519, -641 }, + { 0, 0, 0, -1908, 1518, -671 }, { 0, 0, 0, -1912, 1517, -701 }, { 0, 0, 0, -1917, 1517, -730 }, + { 0, 0, 0, -1921, 1516, -760 }, { 0, 0, 0, -1925, 1516, -789 }, { 0, 0, 0, -1930, 1515, -818 }, + { 0, 0, 0, -1934, 1514, -847 }, { 0, 0, 0, -1938, 1514, -875 }, { 0, 0, 0, -1942, 1513, -903 }, + { 0, 0, 0, -1947, 1513, -931 }, { 0, 0, 0, -1951, 1512, -959 }, { 0, 0, 0, -1955, 1512, -987 }, + { 0, 0, 0, -1959, 1511, -1014 }, { 0, 0, 0, -1963, 1511, -1041 }, { 0, 0, 0, -1967, 1510, -1068 }, + { 0, 0, 0, -1971, 1510, -1094 }, { 0, 0, 0, -1975, 1509, -1121 }, { 0, 0, 0, -1979, 1509, -1147 }, + { 0, 0, 0, -1983, 1508, -1172 }, { 0, 0, 0, -1987, 1508, -1198 }, { 0, 0, 0, -1991, 1507, -1223 }, + { 0, 0, 0, -1994, 1507, -1247 }, { 0, 0, 0, -1998, 1507, -1272 }, { 0, 0, 0, -2002, 1506, -1296 }, + { 0, 0, 0, -2006, 1506, -1320 }, { 0, 0, 0, -2010, 1506, -1343 }, { 0, 0, 0, -2013, 1505, -1366 }, + { 0, 0, 0, -2017, 1505, -1389 }, { 0, 0, 0, -2021, 1505, -1411 }, { 0, 0, 0, -2025, 1505, -1433 }, + { 0, 0, 0, -2029, 1505, -1455 }, { 0, 0, 0, -2033, 1506, -1476 }, { 0, 0, 0, -2038, 1506, -1497 }, + { 0, 0, 0, -2044, 1508, -1516 }, { 0, 0, 0, -2050, 1512, -1515 }, { 0, 0, 0, -2050, 1514, -1497 }, + { 0, 0, 0, -2049, 1516, -1481 }, { 0, 0, 0, -2047, 1517, -1466 }, { 0, 0, 0, -2046, 1518, -1452 }, + { 0, 0, 0, -2045, 1518, -1439 }, { 0, 0, 0, -2044, 1519, -1428 }, { 0, 0, 0, -2043, 1520, -1418 }, + { 0, 0, 0, -2042, 1520, -1408 }, { 0, 0, 0, -2041, 1520, -1400 }, { 0, 0, 0, -2040, 1521, -1393 }, + { 0, 0, 0, -2040, 1521, -1387 }, { 0, 0, 0, -2039, 1521, -1382 }, { 0, 0, 0, -2039, 1522, -1377 }, + { 0, 0, 0, -2038, 1522, -1374 }, { 0, 0, 0, -2038, 1522, -1371 }, { 0, 0, 0, -2038, 1522, -1369 }, + { 0, 0, 0, -2038, 1522, -1368 }, { 0, 0, 0, -2038, 1522, -1368 }, { 0, 0, 0, -2038, 1522, -1368 }, + { 0, 0, 0, -2038, 1522, -1369 }, { 0, 0, 0, -2038, 1522, -1371 }, { 0, 0, 0, -2038, 1522, -1373 }, + { 0, 0, 0, -2039, 1522, -1376 }, { 0, 0, 0, -2039, 1521, -1379 }, { 0, 0, 0, -2039, 1521, -1383 }, + { 0, 0, 0, -2040, 1521, -1387 }, { 0, 0, 0, -2040, 1521, -1392 }, { 0, 0, 0, -2041, 1521, -1397 }, + { 0, 0, 0, -2041, 1520, -1402 }, { 0, 0, 0, -2042, 1520, -1408 }, { 0, 0, 0, -2043, 1520, -1414 }, + { 0, 0, 0, -2043, 1519, -1420 }, { 0, 0, 0, -2044, 1519, -1427 }, { 0, 0, 0, -2045, 1519, -1433 }, + { 0, 0, 0, -2045, 1518, -1440 }, { 0, 0, 0, -2046, 1518, -1447 }, { 0, 0, 0, -2046, 1517, -1454 }, + { 0, 0, 0, -2047, 1517, -1461 }, { 0, 0, 0, -2048, 1517, -1468 }, { 0, 0, 0, -2048, 1516, -1475 }, + { 0, 0, 0, -2049, 1516, -1482 }, { 0, 0, 0, -2049, 1515, -1488 }, { 0, 0, 0, -2049, 1515, -1495 }, + { 0, 0, 0, -2050, 1514, -1501 }, { 0, 0, 0, -2050, 1513, -1508 }, { 0, 0, 0, -2050, 1512, -1514 }, + { 0, 0, 0, -2050, 1512, -1519 }, { 0, 0, 0, -2048, 1510, -1524 }, { 0, 0, 0, -2045, 1508, -1520 }, + { 0, 0, 0, -2043, 1508, -1516 }, { 0, 0, 0, -2042, 1507, -1511 }, { 0, 0, 0, -2041, 1507, -1508 }, + { 0, 0, 0, -2040, 1507, -1505 }, { 0, 0, 0, -2039, 1507, -1502 }, { 0, 0, 0, -2039, 1506, -1500 }, + { 0, 0, 0, -2038, 1506, -1498 }, { 0, 0, 0, -2038, 1506, -1497 }, { 0, 0, 0, -2038, 1506, -1497 }, + { 0, 0, 0, -2048, 1516, -1477 }, { 0, 0, 0, -2026, 1526, -1268 }, { 0, 0, 0, -1986, 1537, -960 }, + { 0, 0, 0, -1935, 1547, -587 }, { 0, 0, 0, -1877, 1557, -181 }, { 0, 0, 0, -1817, 1565, 223 }, + { 0, 0, 0, -1761, 1572, 596 }, { 0, 0, 0, -1714, 1577, 902 }, { 0, 0, 0, -1682, 1581, 1110 }, + { 0, 0, 0, -1670, 1582, 1187 }, +}; + +static s16 animdata_silver_star_2[][6] = { + { 0, 0, 0, -25, -1862, -21178 }, { 0, 0, 0, -23, -1860, -21094 }, { 0, 0, 0, -16, -1854, -20848 }, + { 0, 0, 0, -5, -1845, -20453 }, { 0, 0, 0, 7, -1833, -19921 }, { 0, 0, 0, 21, -1817, -19267 }, + { 0, 0, 0, 35, -1797, -18501 }, { 0, 0, 0, 48, -1774, -17638 }, { 0, 0, 0, 60, -1748, -16688 }, + { 0, 0, 0, 69, -1719, -15666 }, { 0, 0, 0, 76, -1687, -14583 }, { 0, 0, 0, 80, -1653, -13453 }, + { 0, 0, 0, 80, -1616, -12288 }, { 0, 0, 0, 77, -1578, -11100 }, { 0, 0, 0, 69, -1538, -9902 }, + { 0, 0, 0, 57, -1496, -8707 }, { 0, 0, 0, 40, -1453, -7528 }, { 0, 0, 0, 17, -1410, -6377 }, + { 0, 0, 0, -15, -1364, -5268 }, { 0, 0, 0, -61, -1317, -4212 }, { 0, 0, 0, -146, -1281, -3225 }, + { 0, 0, 0, -304, -1258, -2326 }, { 0, 0, 0, -617, -1212, -1572 }, { 0, 0, 0, -918, -1009, -958 }, + { 0, 0, 0, -1023, -781, -411 }, { 0, 0, 0, -1086, -572, 3 }, { 0, 0, 0, -1126, -407, 297 }, + { 0, 0, 0, -1150, -293, 488 }, { 0, 0, 0, -1163, -228, 592 }, { 0, 0, 0, -1167, -209, 622 }, + { 0, 0, 0, -1163, -227, 593 }, { 0, 0, 0, -1154, -276, 514 }, { 0, 0, 0, -1139, -346, 399 }, + { 0, 0, 0, -1121, -429, 259 }, { 0, 0, 0, -1100, -516, 106 }, { 0, 0, 0, -1078, -600, -48 }, + { 0, 0, 0, -1057, -674, -190 }, { 0, 0, 0, -1039, -732, -307 }, { 0, 0, 0, -1027, -769, -385 }, + { 0, 0, 0, -1023, -781, -411 }, { 0, 0, 0, -1024, -779, -407 }, { 0, 0, 0, -1024, -777, -403 }, + { 0, 0, 0, -1025, -776, -399 }, { 0, 0, 0, -1025, -774, -397 }, { 0, 0, 0, -1026, -773, -394 }, + { 0, 0, 0, -1026, -772, -392 }, { 0, 0, 0, -1026, -772, -391 }, { 0, 0, 0, -1026, -771, -390 }, + { 0, 0, 0, -1027, -771, -389 }, { 0, 0, 0, -1027, -771, -389 }, { 0, 0, 0, -1027, -771, -389 }, + { 0, 0, 0, -1027, -771, -389 }, { 0, 0, 0, -1026, -771, -390 }, { 0, 0, 0, -1026, -771, -390 }, + { 0, 0, 0, -1026, -772, -391 }, { 0, 0, 0, -1026, -772, -392 }, { 0, 0, 0, -1026, -773, -393 }, + { 0, 0, 0, -1026, -773, -393 }, { 0, 0, 0, -1026, -773, -394 }, { 0, 0, 0, -1026, -774, -395 }, + { 0, 0, 0, -1025, -774, -396 }, { 0, 0, 0, -1025, -774, -397 }, { 0, 0, 0, -1025, -775, -397 }, + { 0, 0, 0, -1025, -775, -397 }, { 0, 0, 0, -1025, -775, -397 }, { 0, 0, 0, -1025, -775, -397 }, + { 0, 0, 0, -1025, -775, -397 }, { 0, 0, 0, -1025, -774, -396 }, { 0, 0, 0, -1026, -774, -395 }, + { 0, 0, 0, -1026, -773, -393 }, { 0, 0, 0, -1026, -772, -391 }, { 0, 0, 0, -1027, -771, -388 }, + { 0, 0, 0, -1027, -769, -385 }, { 0, 0, 0, -1028, -767, -381 }, { 0, 0, 0, -1028, -765, -377 }, + { 0, 0, 0, -1029, -763, -372 }, { 0, 0, 0, -1030, -760, -366 }, { 0, 0, 0, -1031, -757, -360 }, + { 0, 0, 0, -1032, -754, -353 }, { 0, 0, 0, -1033, -750, -345 }, { 0, 0, 0, -1035, -746, -337 }, + { 0, 0, 0, -1036, -742, -327 }, { 0, 0, 0, -1038, -737, -317 }, { 0, 0, 0, -1040, -731, -305 }, + { 0, 0, 0, -1042, -725, -293 }, { 0, 0, 0, -1044, -719, -280 }, { 0, 0, 0, -1046, -712, -265 }, + { 0, 0, 0, -1048, -704, -250 }, { 0, 0, 0, -1051, -696, -234 }, { 0, 0, 0, -1053, -687, -216 }, + { 0, 0, 0, -1056, -678, -197 }, { 0, 0, 0, -1059, -668, -177 }, { 0, 0, 0, -1062, -657, -156 }, + { 0, 0, 0, -1066, -645, -134 }, { 0, 0, 0, -1069, -633, -110 }, { 0, 0, 0, -1073, -620, -85 }, + { 0, 0, 0, -1077, -606, -59 }, { 0, 0, 0, -1081, -591, -31 }, { 0, 0, 0, -1085, -575, 0 }, + { 0, 0, 0, -1090, -557, 31 }, { 0, 0, 0, -1094, -539, 65 }, { 0, 0, 0, -1099, -519, 101 }, + { 0, 0, 0, -1105, -498, 139 }, { 0, 0, 0, -1110, -475, 179 }, { 0, 0, 0, -1116, -452, 220 }, + { 0, 0, 0, -1121, -427, 262 }, { 0, 0, 0, -1127, -402, 306 }, { 0, 0, 0, -1133, -375, 351 }, + { 0, 0, 0, -1139, -347, 398 }, { 0, 0, 0, -1145, -319, 445 }, { 0, 0, 0, -1151, -289, 494 }, + { 0, 0, 0, -1157, -258, 543 }, { 0, 0, 0, -1163, -227, 594 }, { 0, 0, 0, -1169, -194, 645 }, + { 0, 0, 0, -1176, -161, 697 }, { 0, 0, 0, -1182, -127, 749 }, { 0, 0, 0, -1188, -92, 802 }, + { 0, 0, 0, -1194, -56, 856 }, { 0, 0, 0, -1200, -20, 910 }, { 0, 0, 0, -1206, 16, 964 }, + { 0, 0, 0, -1212, 54, 1019 }, { 0, 0, 0, -1217, 92, 1073 }, { 0, 0, 0, -1223, 131, 1128 }, + { 0, 0, 0, -1229, 170, 1183 }, { 0, 0, 0, -1234, 210, 1238 }, { 0, 0, 0, -1239, 250, 1292 }, + { 0, 0, 0, -1244, 291, 1346 }, { 0, 0, 0, -1249, 331, 1400 }, { 0, 0, 0, -1254, 372, 1454 }, + { 0, 0, 0, -1259, 414, 1507 }, { 0, 0, 0, -1263, 455, 1560 }, { 0, 0, 0, -1268, 497, 1612 }, + { 0, 0, 0, -1272, 539, 1664 }, { 0, 0, 0, -1276, 580, 1714 }, { 0, 0, 0, -1279, 622, 1764 }, + { 0, 0, 0, -1283, 663, 1813 }, { 0, 0, 0, -1286, 705, 1861 }, { 0, 0, 0, -1289, 746, 1908 }, + { 0, 0, 0, -1292, 787, 1954 }, { 0, 0, 0, -1294, 827, 1999 }, { 0, 0, 0, -1297, 867, 2042 }, + { 0, 0, 0, -1299, 907, 2084 }, { 0, 0, 0, -1301, 946, 2125 }, { 0, 0, 0, -1302, 985, 2165 }, + { 0, 0, 0, -1304, 1023, 2203 }, { 0, 0, 0, -1305, 1060, 2239 }, { 0, 0, 0, -1306, 1096, 2274 }, + { 0, 0, 0, -1307, 1131, 2307 }, { 0, 0, 0, -1307, 1166, 2339 }, { 0, 0, 0, -1307, 1199, 2369 }, + { 0, 0, 0, -1307, 1231, 2397 }, { 0, 0, 0, -1307, 1262, 2423 }, { 0, 0, 0, -1307, 1292, 2448 }, + { 0, 0, 0, -1307, 1320, 2470 }, { 0, 0, 0, -1306, 1346, 2491 }, { 0, 0, 0, -1305, 1371, 2510 }, + { 0, 0, 0, -1305, 1394, 2527 }, { 0, 0, 0, -1304, 1415, 2543 }, { 0, 0, 0, -1303, 1434, 2556 }, + { 0, 0, 0, -1302, 1451, 2568 }, { 0, 0, 0, -1302, 1465, 2577 }, { 0, 0, 0, -1301, 1477, 2585 }, + { 0, 0, 0, -1300, 1487, 2591 }, { 0, 0, 0, -1300, 1494, 2596 }, { 0, 0, 0, -1300, 1498, 2599 }, + { 0, 0, 0, -1300, 1500, 2600 }, +}; + +struct AnimDataInfo anim_silver_star[] = { + { ARRAY_COUNT(animdata_silver_star_1), GD_ANIM_ROT3S_POS3S, animdata_silver_star_1 }, + { ARRAY_COUNT(animdata_silver_star_2), GD_ANIM_ROT3S_POS3S, animdata_silver_star_2 }, + END_ANIMDATA_INFO_ARR, +}; + +static s16 animdata_red_star_1[][6] = { + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, { 0, 0, 0, 0, 0, -20000 }, + { 0, 0, 0, 0, 0, -19999 }, { 0, 0, 0, 0, 0, -19998 }, { 0, 0, 0, 1, 0, -19996 }, + { 0, 0, 0, 1, 0, -19994 }, { 0, 0, 0, 2, 0, -19991 }, { 0, 0, 0, 2, 0, -19989 }, + { 0, 0, 0, 2, 0, -19986 }, { 0, 0, 0, 2, 0, -19984 }, { 0, 0, 0, 3, 0, -19981 }, + { 0, 0, 0, 3, 0, -19977 }, { 0, 0, 0, 3, 0, -19974 }, { 0, 0, 0, 3, 0, -19971 }, + { 0, 0, 0, 4, 0, -19967 }, { 0, 0, 0, 4, 0, -19963 }, { 0, 0, 0, 4, 0, -19959 }, + { 0, 0, 0, 4, 0, -19955 }, { 0, 0, 0, 4, 0, -19951 }, { 0, 0, 0, 5, 0, -19946 }, + { 0, 0, 0, 5, 0, -19941 }, { 0, 0, 0, 5, 0, -19936 }, { 0, 0, 0, 5, 0, -19931 }, + { 0, 0, 0, 6, 0, -19925 }, { 0, 0, 0, 6, 0, -19920 }, { 0, 0, 0, 6, 0, -19914 }, + { 0, 0, 0, 6, 0, -19908 }, { 0, 0, 0, 6, 0, -19901 }, { 0, 0, 0, 7, 0, -19894 }, + { 0, 0, 0, 7, 0, -19888 }, { 0, 0, 0, 7, 0, -19881 }, { 0, 0, 0, 7, 0, -19873 }, + { 0, 0, 0, 7, 0, -19865 }, { 0, 0, 0, 8, 0, -19858 }, { 0, 0, 0, 8, 0, -19849 }, + { 0, 0, 0, 8, 0, -19841 }, { 0, 0, 0, 8, 0, -19832 }, { 0, 0, 0, 8, 0, -19823 }, + { 0, 0, 0, 9, 0, -19814 }, { 0, 0, 0, 9, 0, -19804 }, { 0, 0, 0, 9, 0, -19794 }, + { 0, 0, 0, 9, 0, -19784 }, { 0, 0, 0, 9, 0, -19774 }, { 0, 0, 0, 10, 0, -19763 }, + { 0, 0, 0, 10, 0, -19752 }, { 0, 0, 0, 10, 0, -19741 }, { 0, 0, 0, 10, 0, -19729 }, + { 0, 0, 0, 10, 0, -19717 }, { 0, 0, 0, 10, 0, -19705 }, { 0, 0, 0, 11, 0, -19692 }, + { 0, 0, 0, 11, 0, -19679 }, { 0, 0, 0, 11, 0, -19666 }, { 0, 0, 0, 11, 0, -19652 }, + { 0, 0, 0, 11, 0, -19638 }, { 0, 0, 0, 12, 0, -19624 }, { 0, 0, 0, 12, 0, -19609 }, + { 0, 0, 0, 12, 0, -19594 }, { 0, 0, 0, 12, 0, -19579 }, { 0, 0, 0, 12, 0, -19563 }, + { 0, 0, 0, 12, 1, -19547 }, { 0, 0, 0, 13, 1, -19530 }, { 0, 0, 0, 13, 1, -19513 }, + { 0, 0, 0, 13, 1, -19496 }, { 0, 0, 0, 13, 1, -19478 }, { 0, 0, 0, 13, 1, -19460 }, + { 0, 0, 0, 13, 1, -19442 }, { 0, 0, 0, 13, 1, -19423 }, { 0, 0, 0, 14, 1, -19404 }, + { 0, 0, 0, 14, 1, -19384 }, { 0, 0, 0, 14, 1, -19364 }, { 0, 0, 0, 14, 1, -19343 }, + { 0, 0, 0, 14, 1, -19323 }, { 0, 0, 0, 14, 1, -19301 }, { 0, 0, 0, 14, 1, -19279 }, + { 0, 0, 0, 15, 1, -19257 }, { 0, 0, 0, 15, 1, -19235 }, { 0, 0, 0, 15, 1, -19212 }, + { 0, 0, 0, 15, 1, -19188 }, { 0, 0, 0, 15, 1, -19164 }, { 0, 0, 0, 15, 1, -19140 }, + { 0, 0, 0, 15, 1, -19115 }, { 0, 0, 0, 15, 2, -19090 }, { 0, 0, 0, 16, 2, -19064 }, + { 0, 0, 0, 16, 2, -19038 }, { 0, 0, 0, 16, 2, -19011 }, { 0, 0, 0, 16, 2, -18984 }, + { 0, 0, 0, 16, 2, -18957 }, { 0, 0, 0, 16, 2, -18929 }, { 0, 0, 0, 16, 2, -18900 }, + { 0, 0, 0, 16, 2, -18871 }, { 0, 0, 0, 16, 2, -18841 }, { 0, 0, 0, 16, 2, -18811 }, + { 0, 0, 0, 17, 2, -18781 }, { 0, 0, 0, 17, 2, -18750 }, { 0, 0, 0, 17, 2, -18718 }, + { 0, 0, 0, 17, 2, -18686 }, { 0, 0, 0, 17, 3, -18653 }, { 0, 0, 0, 17, 3, -18620 }, + { 0, 0, 0, 17, 3, -18587 }, { 0, 0, 0, 17, 3, -18552 }, { 0, 0, 0, 17, 3, -18518 }, + { 0, 0, 0, 17, 3, -18482 }, { 0, 0, 0, 17, 3, -18447 }, { 0, 0, 0, 17, 3, -18410 }, + { 0, 0, 0, 17, 3, -18373 }, { 0, 0, 0, 17, 3, -18336 }, { 0, 0, 0, 17, 3, -18298 }, + { 0, 0, 0, 17, 3, -18259 }, { 0, 0, 0, 17, 3, -18220 }, { 0, 0, 0, 18, 4, -18180 }, + { 0, 0, 0, 18, 4, -18140 }, { 0, 0, 0, 18, 4, -18099 }, { 0, 0, 0, 18, 4, -18058 }, + { 0, 0, 0, 18, 4, -18016 }, { 0, 0, 0, 18, 4, -17973 }, { 0, 0, 0, 18, 4, -17930 }, + { 0, 0, 0, 18, 4, -17886 }, { 0, 0, 0, 18, 4, -17842 }, { 0, 0, 0, 18, 4, -17797 }, + { 0, 0, 0, 18, 5, -17751 }, { 0, 0, 0, 18, 5, -17705 }, { 0, 0, 0, 17, 5, -17658 }, + { 0, 0, 0, 17, 5, -17610 }, { 0, 0, 0, 17, 5, -17562 }, { 0, 0, 0, 17, 5, -17513 }, + { 0, 0, 0, 17, 5, -17464 }, { 0, 0, 0, 17, 5, -17414 }, { 0, 0, 0, 17, 5, -17363 }, + { 0, 0, 0, 17, 6, -17312 }, { 0, 0, 0, 17, 6, -17260 }, { 0, 0, 0, 17, 6, -17207 }, + { 0, 0, 0, 17, 6, -17154 }, { 0, 0, 0, 17, 6, -17100 }, { 0, 0, 0, 17, 6, -17045 }, + { 0, 0, 0, 17, 6, -16990 }, { 0, 0, 0, 17, 6, -16934 }, { 0, 0, 0, 17, 7, -16877 }, + { 0, 0, 0, 16, 7, -16820 }, { 0, 0, 0, 16, 7, -16762 }, { 0, 0, 0, 16, 7, -16703 }, + { 0, 0, 0, 16, 7, -16643 }, { 0, 0, 0, 16, 7, -16583 }, { 0, 0, 0, 16, 7, -16522 }, + { 0, 0, 0, 16, 7, -16461 }, { 0, 0, 0, 15, 8, -16398 }, { 0, 0, 0, 15, 8, -16335 }, + { 0, 0, 0, 15, 8, -16272 }, { 0, 0, 0, 15, 8, -16207 }, { 0, 0, 0, 15, 8, -16142 }, + { 0, 0, 0, 15, 8, -16076 }, { 0, 0, 0, 14, 8, -16009 }, { 0, 0, 0, 14, 9, -15942 }, + { 0, 0, 0, 14, 9, -15874 }, { 0, 0, 0, 14, 9, -15805 }, { 0, 0, 0, 14, 9, -15735 }, + { 0, 0, 0, 13, 9, -15664 }, { 0, 0, 0, 13, 9, -15591 }, { 0, 0, 0, 13, 10, -15517 }, + { 0, 0, 0, 13, 10, -15441 }, { 0, 0, 0, 12, 10, -15366 }, { 0, 0, 0, 12, 10, -15288 }, + { 0, 0, 0, 12, 10, -15208 }, { 0, 0, 0, 12, 10, -15128 }, { 0, 0, 0, 12, 10, -15046 }, + { 0, 0, 0, 11, 10, -14963 }, { 0, 0, 0, 11, 10, -14878 }, { 0, 0, 0, 11, 10, -14793 }, + { 0, 0, 0, 11, 10, -14706 }, { 0, 0, 0, 11, 10, -14618 }, { 0, 0, 0, 10, 10, -14529 }, + { 0, 0, 0, 10, 10, -14438 }, { 0, 0, 0, 10, 10, -14347 }, { 0, 0, 0, 10, 10, -14254 }, + { 0, 0, 0, 9, 10, -14161 }, { 0, 0, 0, 9, 10, -14065 }, { 0, 0, 0, 9, 10, -13969 }, + { 0, 0, 0, 9, 10, -13872 }, { 0, 0, 0, 9, 10, -13774 }, { 0, 0, 0, 8, 10, -13674 }, + { 0, 0, 0, 8, 10, -13574 }, { 0, 0, 0, 8, 11, -13473 }, { 0, 0, 0, 8, 11, -13370 }, + { 0, 0, 0, 7, 11, -13267 }, { 0, 0, 0, 7, 11, -13162 }, { 0, 0, 0, 7, 11, -13056 }, + { 0, 0, 0, 7, 11, -12950 }, { 0, 0, 0, 6, 11, -12843 }, { 0, 0, 0, 6, 11, -12734 }, + { 0, 0, 0, 6, 11, -12625 }, { 0, 0, 0, 6, 11, -12515 }, { 0, 0, 0, 5, 11, -12403 }, + { 0, 0, 0, 5, 11, -12291 }, { 0, 0, 0, 5, 11, -12178 }, { 0, 0, 0, 5, 11, -12065 }, + { 0, 0, 0, 4, 11, -11950 }, { 0, 0, 0, 4, 11, -11834 }, { 0, 0, 0, 4, 11, -11718 }, + { 0, 0, 0, 4, 11, -11600 }, { 0, 0, 0, 3, 11, -11482 }, { 0, 0, 0, 3, 11, -11363 }, + { 0, 0, 0, 3, 11, -11243 }, { 0, 0, 0, 3, 11, -11123 }, { 0, 0, 0, 2, 11, -11002 }, + { 0, 0, 0, 2, 11, -10880 }, { 0, 0, 0, 2, 11, -10757 }, { 0, 0, 0, 2, 11, -10633 }, + { 0, 0, 0, 1, 11, -10509 }, { 0, 0, 0, 1, 11, -10384 }, { 0, 0, 0, 1, 11, -10259 }, + { 0, 0, 0, 1, 11, -10133 }, { 0, 0, 0, 0, 11, -10006 }, { 0, 0, 0, 0, 11, -9878 }, + { 0, 0, 0, 0, 11, -9750 }, { 0, 0, 0, 0, 11, -9621 }, { 0, 0, 0, 0, 11, -9492 }, + { 0, 0, 0, 0, 11, -9362 }, { 0, 0, 0, 0, 11, -9231 }, { 0, 0, 0, 0, 11, -9100 }, + { 0, 0, 0, -1, 11, -8968 }, { 0, 0, 0, -1, 11, -8836 }, { 0, 0, 0, -1, 11, -8703 }, + { 0, 0, 0, -1, 11, -8570 }, { 0, 0, 0, -2, 11, -8436 }, { 0, 0, 0, -2, 11, -8301 }, + { 0, 0, 0, -2, 11, -8167 }, { 0, 0, 0, -2, 11, -8031 }, { 0, 0, 0, -3, 11, -7895 }, + { 0, 0, 0, -3, 11, -7759 }, { 0, 0, 0, -3, 11, -7623 }, { 0, 0, 0, -3, 11, -7486 }, + { 0, 0, 0, -4, 11, -7348 }, { 0, 0, 0, -4, 11, -7210 }, { 0, 0, 0, -4, 11, -7072 }, + { 0, 0, 0, -4, 11, -6933 }, { 0, 0, 0, -4, 11, -6794 }, { 0, 0, 0, -5, 11, -6655 }, + { 0, 0, 0, -5, 11, -6516 }, { 0, 0, 0, -5, 11, -6376 }, { 0, 0, 0, -5, 11, -6236 }, + { 0, 0, 0, -5, 10, -6095 }, { 0, 0, 0, -6, 10, -5954 }, { 0, 0, 0, -6, 10, -5813 }, + { 0, 0, 0, -6, 10, -5672 }, { 0, 0, 0, -6, 10, -5530 }, { 0, 0, 0, -6, 10, -5388 }, + { 0, 0, 0, -7, 10, -5247 }, { 0, 0, 0, -7, 10, -5104 }, { 0, 0, 0, -7, 10, -4962 }, + { 0, 0, 0, -7, 10, -4819 }, { 0, 0, 0, -7, 10, -4677 }, { 0, 0, 0, -7, 9, -4534 }, + { 0, 0, 0, -7, 9, -4391 }, { 0, 0, 0, -7, 9, -4248 }, { 0, 0, 0, -8, 9, -4105 }, + { 0, 0, 0, -8, 9, -3961 }, { 0, 0, 0, -8, 9, -3818 }, { 0, 0, 0, -8, 9, -3675 }, + { 0, 0, 0, -8, 8, -3531 }, { 0, 0, 0, -8, 8, -3387 }, { 0, 0, 0, -8, 8, -3244 }, + { 0, 0, 0, -8, 8, -3100 }, { 0, 0, 0, -8, 8, -2957 }, { 0, 0, 0, -8, 7, -2813 }, + { 0, 0, 0, -8, 7, -2669 }, { 0, 0, 0, -8, 7, -2526 }, { 0, 0, 0, -7, 6, -2383 }, + { 0, 0, 0, -7, 6, -2239 }, { 0, 0, 0, -7, 6, -2095 }, { 0, 0, 0, -7, 5, -1953 }, + { 0, 0, 0, -6, 5, -1809 }, { 0, 0, 0, -6, 4, -1666 }, { 0, 0, 0, -5, 3, -1523 }, + { 0, 0, 0, -4, 2, -1380 }, { 0, 0, 0, 33, 45, -1298 }, { 0, 0, 0, 109, 165, -1294 }, + { 0, 0, 0, 186, 284, -1282 }, { 0, 0, 0, 265, 400, -1261 }, { 0, 0, 0, 348, 511, -1230 }, + { 0, 0, 0, 433, 616, -1187 }, { 0, 0, 0, 521, 711, -1132 }, { 0, 0, 0, 611, 795, -1062 }, + { 0, 0, 0, 702, 861, -976 }, { 0, 0, 0, 790, 907, -877 }, { 0, 0, 0, 873, 931, -766 }, + { 0, 0, 0, 948, 933, -649 }, { 0, 0, 0, 1014, 923, -526 }, { 0, 0, 0, 1067, 909, -398 }, + { 0, 0, 0, 1105, 893, -265 }, { 0, 0, 0, 1125, 875, -129 }, { 0, 0, 0, 1126, 854, 7 }, + { 0, 0, 0, 1108, 833, 142 }, { 0, 0, 0, 1070, 811, 273 }, { 0, 0, 0, 1014, 791, 396 }, + { 0, 0, 0, 941, 775, 511 }, { 0, 0, 0, 854, 764, 615 }, { 0, 0, 0, 751, 765, 705 }, + { 0, 0, 0, 634, 794, 763 }, { 0, 0, 0, 508, 836, 788 }, { 0, 0, 0, 381, 878, 800 }, + { 0, 0, 0, 252, 917, 806 }, { 0, 0, 0, 123, 951, 808 }, { 0, 0, 0, -6, 978, 808 }, + { 0, 0, 0, -138, 997, 806 }, { 0, 0, 0, -270, 1005, 802 }, { 0, 0, 0, -401, 996, 798 }, + { 0, 0, 0, -528, 965, 795 }, { 0, 0, 0, -642, 903, 794 }, { 0, 0, 0, -742, 820, 794 }, + { 0, 0, 0, -830, 725, 793 }, { 0, 0, 0, -904, 620, 796 }, { 0, 0, 0, -963, 507, 803 }, + { 0, 0, 0, -1007, 389, 819 }, { 0, 0, 0, -1037, 268, 844 }, { 0, 0, 0, -1052, 149, 882 }, + { 0, 0, 0, -1055, 35, 933 }, { 0, 0, 0, -1046, -70, 998 }, { 0, 0, 0, -1026, -168, 1071 }, + { 0, 0, 0, -986, -259, 1143 }, { 0, 0, 0, -924, -342, 1209 }, { 0, 0, 0, -843, -414, 1265 }, + { 0, 0, 0, -745, -470, 1306 }, { 0, 0, 0, -633, -508, 1328 }, { 0, 0, 0, -515, -523, 1324 }, + { 0, 0, 0, -403, -511, 1289 }, { 0, 0, 0, -311, -473, 1227 }, { 0, 0, 0, -240, -408, 1161 }, + { 0, 0, 0, -183, -330, 1096 }, { 0, 0, 0, -135, -246, 1033 }, { 0, 0, 0, -93, -159, 971 }, + { 0, 0, 0, -56, -70, 911 }, { 0, 0, 0, -23, 19, 852 }, { 0, 0, 0, 7, 109, 793 }, + { 0, 0, 0, 32, 191, 739 }, { 0, 0, 0, 84, 217, 707 }, { 0, 0, 0, 163, 230, 699 }, + { 0, 0, 0, 232, 244, 690 }, { 0, 0, 0, 292, 256, 683 }, { 0, 0, 0, 343, 267, 676 }, + { 0, 0, 0, 387, 276, 670 }, { 0, 0, 0, 425, 283, 664 }, { 0, 0, 0, 456, 288, 659 }, + { 0, 0, 0, 481, 293, 655 }, { 0, 0, 0, 502, 296, 651 }, { 0, 0, 0, 519, 299, 647 }, + { 0, 0, 0, 533, 300, 644 }, { 0, 0, 0, 544, 301, 642 }, { 0, 0, 0, 553, 302, 640 }, + { 0, 0, 0, 560, 303, 638 }, { 0, 0, 0, 568, 303, 636 }, { 0, 0, 0, 575, 303, 634 }, + { 0, 0, 0, 583, 303, 631 }, { 0, 0, 0, 593, 303, 629 }, { 0, 0, 0, 605, 303, 625 }, + { 0, 0, 0, 619, 304, 620 }, { 0, 0, 0, 637, 303, 614 }, { 0, 0, 0, 660, 303, 605 }, + { 0, 0, 0, 686, 303, 594 }, { 0, 0, 0, 717, 301, 578 }, { 0, 0, 0, 752, 299, 556 }, + { 0, 0, 0, 790, 294, 526 }, { 0, 0, 0, 829, 287, 486 }, { 0, 0, 0, 867, 276, 431 }, + { 0, 0, 0, 903, 258, 352 }, { 0, 0, 0, 929, 232, 250 }, { 0, 0, 0, 939, 199, 130 }, + { 0, 0, 0, 933, 161, -4 }, { 0, 0, 0, 912, 113, -147 }, { 0, 0, 0, 875, 43, -288 }, + { 0, 0, 0, 821, -46, -421 }, { 0, 0, 0, 745, -150, -540 }, { 0, 0, 0, 646, -258, -641 }, + { 0, 0, 0, 522, -359, -719 }, { 0, 0, 0, 375, -439, -772 }, { 0, 0, 0, 212, -487, -796 }, + { 0, 0, 0, 47, -497, -797 }, { 0, 0, 0, -106, -478, -781 }, { 0, 0, 0, -243, -439, -752 }, + { 0, 0, 0, -356, -390, -709 }, { 0, 0, 0, -446, -337, -659 }, { 0, 0, 0, -513, -288, -611 }, + { 0, 0, 0, -560, -246, -568 }, { 0, 0, 0, -597, -209, -530 }, { 0, 0, 0, -629, -174, -493 }, + { 0, 0, 0, -656, -139, -456 }, { 0, 0, 0, -679, -107, -421 }, { 0, 0, 0, -700, -75, -388 }, + { 0, 0, 0, -717, -46, -356 }, { 0, 0, 0, -732, -18, -326 }, { 0, 0, 0, -745, 7, -297 }, + { 0, 0, 0, -756, 31, -270 }, { 0, 0, 0, -766, 54, -245 }, { 0, 0, 0, -774, 75, -221 }, + { 0, 0, 0, -781, 96, -198 }, { 0, 0, 0, -788, 115, -177 }, { 0, 0, 0, -793, 132, -157 }, + { 0, 0, 0, -798, 149, -138 }, { 0, 0, 0, -802, 165, -120 }, { 0, 0, 0, -805, 180, -103 }, + { 0, 0, 0, -809, 194, -87 }, { 0, 0, 0, -811, 208, -71 }, { 0, 0, 0, -814, 221, -55 }, + { 0, 0, 0, -816, 234, -40 }, { 0, 0, 0, -817, 247, -26 }, { 0, 0, 0, -819, 260, -11 }, + { 0, 0, 0, -820, 273, 3 }, { 0, 0, 0, -821, 285, 18 }, { 0, 0, 0, -822, 299, 33 }, + { 0, 0, 0, -822, 312, 49 }, { 0, 0, 0, -822, 326, 65 }, { 0, 0, 0, -822, 340, 82 }, + { 0, 0, 0, -821, 355, 100 }, { 0, 0, 0, -819, 371, 119 }, { 0, 0, 0, -817, 388, 140 }, + { 0, 0, 0, -814, 406, 161 }, { 0, 0, 0, -809, 424, 184 }, { 0, 0, 0, -803, 444, 209 }, + { 0, 0, 0, -794, 464, 235 }, { 0, 0, 0, -780, 484, 262 }, { 0, 0, 0, -761, 503, 290 }, + { 0, 0, 0, -734, 518, 319 }, { 0, 0, 0, -702, 527, 348 }, { 0, 0, 0, -663, 532, 376 }, + { 0, 0, 0, -620, 531, 404 }, { 0, 0, 0, -572, 525, 430 }, { 0, 0, 0, -520, 515, 455 }, + { 0, 0, 0, -464, 502, 478 }, { 0, 0, 0, -404, 484, 501 }, { 0, 0, 0, -340, 463, 521 }, + { 0, 0, 0, -272, 440, 541 }, { 0, 0, 0, -198, 414, 558 }, { 0, 0, 0, -116, 386, 572 }, + { 0, 0, 0, -17, 356, 582 }, { 0, 0, 0, 98, 335, 584 }, { 0, 0, 0, 228, 319, 577 }, + { 0, 0, 0, 368, 305, 551 }, { 0, 0, 0, 510, 291, 495 }, { 0, 0, 0, 643, 278, 401 }, + { 0, 0, 0, 754, 267, 271 }, { 0, 0, 0, 837, 257, 112 }, { 0, 0, 0, 892, 249, -64 }, + { 0, 0, 0, 925, 242, -251 }, { 0, 0, 0, 938, 236, -446 }, { 0, 0, 0, 926, 234, -643 }, + { 0, 0, 0, 884, 235, -837 }, { 0, 0, 0, 805, 241, -1021 }, { 0, 0, 0, 693, 253, -1185 }, + { 0, 0, 0, 558, 268, -1328 }, { 0, 0, 0, 413, 284, -1456 }, { 0, 0, 0, 279, 299, -1591 }, + { 0, 0, 0, 214, 306, -1761 }, { 0, 0, 0, 199, 313, -1939 }, { 0, 0, 0, 187, 321, -2110 }, + { 0, 0, 0, 175, 330, -2273 }, { 0, 0, 0, 165, 338, -2426 }, { 0, 0, 0, 155, 347, -2568 }, + { 0, 0, 0, 147, 354, -2699 }, { 0, 0, 0, 139, 361, -2816 }, { 0, 0, 0, 132, 367, -2919 }, + { 0, 0, 0, 126, 373, -3006 }, { 0, 0, 0, 122, 377, -3078 }, { 0, 0, 0, 118, 380, -3131 }, + { 0, 0, 0, 116, 383, -3169 }, { 0, 0, 0, 113, 385, -3205 }, { 0, 0, 0, 111, 387, -3240 }, + { 0, 0, 0, 109, 389, -3275 }, { 0, 0, 0, 107, 391, -3310 }, { 0, 0, 0, 104, 394, -3344 }, + { 0, 0, 0, 102, 396, -3377 }, { 0, 0, 0, 100, 398, -3410 }, { 0, 0, 0, 98, 400, -3443 }, + { 0, 0, 0, 96, 402, -3475 }, { 0, 0, 0, 94, 404, -3507 }, { 0, 0, 0, 92, 406, -3538 }, + { 0, 0, 0, 90, 408, -3568 }, { 0, 0, 0, 88, 409, -3599 }, { 0, 0, 0, 86, 411, -3629 }, + { 0, 0, 0, 84, 413, -3658 }, { 0, 0, 0, 82, 415, -3687 }, { 0, 0, 0, 80, 417, -3716 }, + { 0, 0, 0, 79, 419, -3744 }, { 0, 0, 0, 77, 420, -3772 }, { 0, 0, 0, 75, 422, -3799 }, + { 0, 0, 0, 73, 424, -3826 }, { 0, 0, 0, 72, 425, -3852 }, { 0, 0, 0, 70, 427, -3878 }, + { 0, 0, 0, 68, 429, -3904 }, { 0, 0, 0, 67, 430, -3929 }, { 0, 0, 0, 65, 432, -3954 }, + { 0, 0, 0, 64, 433, -3979 }, { 0, 0, 0, 62, 435, -4003 }, { 0, 0, 0, 61, 437, -4026 }, + { 0, 0, 0, 59, 438, -4050 }, { 0, 0, 0, 58, 439, -4072 }, { 0, 0, 0, 56, 441, -4095 }, + { 0, 0, 0, 55, 442, -4117 }, { 0, 0, 0, 54, 444, -4139 }, { 0, 0, 0, 52, 445, -4160 }, + { 0, 0, 0, 51, 446, -4181 }, { 0, 0, 0, 50, 448, -4202 }, { 0, 0, 0, 48, 449, -4222 }, + { 0, 0, 0, 47, 450, -4242 }, { 0, 0, 0, 46, 452, -4262 }, { 0, 0, 0, 45, 453, -4281 }, + { 0, 0, 0, 43, 454, -4300 }, { 0, 0, 0, 42, 455, -4318 }, { 0, 0, 0, 41, 456, -4336 }, + { 0, 0, 0, 40, 458, -4354 }, { 0, 0, 0, 39, 459, -4372 }, { 0, 0, 0, 38, 460, -4389 }, + { 0, 0, 0, 37, 461, -4406 }, { 0, 0, 0, 36, 462, -4422 }, { 0, 0, 0, 35, 463, -4438 }, + { 0, 0, 0, 34, 464, -4454 }, { 0, 0, 0, 33, 465, -4470 }, { 0, 0, 0, 32, 466, -4485 }, + { 0, 0, 0, 31, 467, -4500 }, { 0, 0, 0, 30, 468, -4515 }, { 0, 0, 0, 29, 469, -4529 }, + { 0, 0, 0, 28, 470, -4543 }, { 0, 0, 0, 27, 471, -4557 }, { 0, 0, 0, 26, 471, -4570 }, + { 0, 0, 0, 26, 472, -4583 }, { 0, 0, 0, 25, 473, -4596 }, { 0, 0, 0, 24, 474, -4609 }, + { 0, 0, 0, 23, 475, -4621 }, { 0, 0, 0, 22, 476, -4633 }, { 0, 0, 0, 22, 476, -4645 }, + { 0, 0, 0, 21, 477, -4656 }, { 0, 0, 0, 20, 478, -4667 }, { 0, 0, 0, 20, 479, -4678 }, + { 0, 0, 0, 19, 479, -4689 }, { 0, 0, 0, 18, 480, -4699 }, { 0, 0, 0, 18, 481, -4709 }, + { 0, 0, 0, 17, 481, -4719 }, { 0, 0, 0, 16, 482, -4729 }, { 0, 0, 0, 16, 482, -4738 }, + { 0, 0, 0, 15, 483, -4747 }, { 0, 0, 0, 15, 484, -4756 }, { 0, 0, 0, 14, 484, -4765 }, + { 0, 0, 0, 14, 485, -4773 }, { 0, 0, 0, 13, 485, -4781 }, { 0, 0, 0, 13, 486, -4789 }, + { 0, 0, 0, 12, 486, -4797 }, { 0, 0, 0, 12, 487, -4805 }, { 0, 0, 0, 11, 487, -4812 }, + { 0, 0, 0, 11, 488, -4819 }, { 0, 0, 0, 10, 488, -4826 }, { 0, 0, 0, 10, 489, -4833 }, + { 0, 0, 0, 10, 489, -4839 }, { 0, 0, 0, 9, 489, -4845 }, { 0, 0, 0, 9, 490, -4851 }, + { 0, 0, 0, 8, 490, -4857 }, { 0, 0, 0, 8, 491, -4863 }, { 0, 0, 0, 8, 491, -4868 }, + { 0, 0, 0, 7, 491, -4874 }, { 0, 0, 0, 7, 492, -4879 }, { 0, 0, 0, 7, 492, -4883 }, + { 0, 0, 0, 6, 492, -4888 }, { 0, 0, 0, 6, 493, -4893 }, { 0, 0, 0, 6, 493, -4897 }, + { 0, 0, 0, 6, 493, -4901 }, { 0, 0, 0, 5, 493, -4906 }, { 0, 0, 0, 5, 494, -4910 }, + { 0, 0, 0, 5, 494, -4913 }, { 0, 0, 0, 5, 494, -4917 }, { 0, 0, 0, 4, 494, -4920 }, + { 0, 0, 0, 4, 495, -4924 }, { 0, 0, 0, 4, 495, -4927 }, { 0, 0, 0, 4, 495, -4930 }, + { 0, 0, 0, 4, 495, -4933 }, { 0, 0, 0, 3, 495, -4935 }, { 0, 0, 0, 3, 495, -4938 }, + { 0, 0, 0, 3, 496, -4941 }, { 0, 0, 0, 3, 496, -4943 }, { 0, 0, 0, 3, 496, -4945 }, + { 0, 0, 0, 3, 496, -4947 }, { 0, 0, 0, 3, 496, -4949 }, { 0, 0, 0, 3, 496, -4951 }, + { 0, 0, 0, 2, 496, -4953 }, { 0, 0, 0, 2, 497, -4955 }, { 0, 0, 0, 2, 497, -4956 }, + { 0, 0, 0, 2, 497, -4958 }, { 0, 0, 0, 2, 497, -4959 }, { 0, 0, 0, 2, 497, -4960 }, + { 0, 0, 0, 2, 497, -4962 }, { 0, 0, 0, 2, 497, -4963 }, { 0, 0, 0, 2, 497, -4964 }, + { 0, 0, 0, 2, 497, -4965 }, { 0, 0, 0, 2, 497, -4966 }, { 0, 0, 0, 2, 497, -4966 }, + { 0, 0, 0, 2, 497, -4967 }, { 0, 0, 0, 1, 497, -4968 }, { 0, 0, 0, 1, 497, -4968 }, + { 0, 0, 0, 1, 497, -4969 }, { 0, 0, 0, 1, 498, -4969 }, { 0, 0, 0, 1, 498, -4970 }, + { 0, 0, 0, 1, 498, -4970 }, { 0, 0, 0, 1, 498, -4971 }, { 0, 0, 0, 1, 498, -4971 }, + { 0, 0, 0, 1, 498, -4971 }, { 0, 0, 0, 1, 498, -4971 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, { 0, 0, 0, 1, 498, -4972 }, + { 0, 0, 0, 1, 498, -4972 }, +}; + +static s16 animdata_red_star_2[][6] = { + { 0, 0, 0, 4291, 2080, 2392 }, { 0, 0, 0, 4290, 2079, 2391 }, { 0, 0, 0, 4289, 2079, 2389 }, + { 0, 0, 0, 4287, 2078, 2385 }, { 0, 0, 0, 4283, 2077, 2379 }, { 0, 0, 0, 4279, 2075, 2372 }, + { 0, 0, 0, 4274, 2073, 2364 }, { 0, 0, 0, 4268, 2071, 2354 }, { 0, 0, 0, 4262, 2069, 2342 }, + { 0, 0, 0, 4254, 2066, 2329 }, { 0, 0, 0, 4245, 2063, 2314 }, { 0, 0, 0, 4236, 2059, 2298 }, + { 0, 0, 0, 4226, 2056, 2281 }, { 0, 0, 0, 4215, 2052, 2262 }, { 0, 0, 0, 4203, 2047, 2242 }, + { 0, 0, 0, 4191, 2043, 2221 }, { 0, 0, 0, 4178, 2038, 2198 }, { 0, 0, 0, 4164, 2033, 2174 }, + { 0, 0, 0, 4149, 2027, 2148 }, { 0, 0, 0, 4133, 2021, 2122 }, { 0, 0, 0, 4117, 2015, 2094 }, + { 0, 0, 0, 4100, 2009, 2065 }, { 0, 0, 0, 4082, 2003, 2034 }, { 0, 0, 0, 4064, 1996, 2003 }, + { 0, 0, 0, 4045, 1989, 1970 }, { 0, 0, 0, 4025, 1982, 1936 }, { 0, 0, 0, 4005, 1974, 1901 }, + { 0, 0, 0, 3984, 1966, 1865 }, { 0, 0, 0, 3962, 1958, 1828 }, { 0, 0, 0, 3940, 1950, 1790 }, + { 0, 0, 0, 3917, 1942, 1750 }, { 0, 0, 0, 3893, 1933, 1710 }, { 0, 0, 0, 3869, 1924, 1669 }, + { 0, 0, 0, 3845, 1915, 1626 }, { 0, 0, 0, 3819, 1906, 1583 }, { 0, 0, 0, 3794, 1896, 1539 }, + { 0, 0, 0, 3767, 1887, 1493 }, { 0, 0, 0, 3740, 1877, 1447 }, { 0, 0, 0, 3713, 1866, 1400 }, + { 0, 0, 0, 3685, 1856, 1352 }, { 0, 0, 0, 3657, 1846, 1303 }, { 0, 0, 0, 3628, 1835, 1254 }, + { 0, 0, 0, 3599, 1824, 1203 }, { 0, 0, 0, 3569, 1813, 1152 }, { 0, 0, 0, 3538, 1802, 1100 }, + { 0, 0, 0, 3508, 1791, 1047 }, { 0, 0, 0, 3477, 1779, 994 }, { 0, 0, 0, 3445, 1768, 940 }, + { 0, 0, 0, 3413, 1756, 885 }, { 0, 0, 0, 3381, 1744, 829 }, { 0, 0, 0, 3348, 1732, 773 }, + { 0, 0, 0, 3315, 1720, 716 }, { 0, 0, 0, 3281, 1707, 659 }, { 0, 0, 0, 3247, 1695, 601 }, + { 0, 0, 0, 3213, 1682, 542 }, { 0, 0, 0, 3179, 1669, 483 }, { 0, 0, 0, 3144, 1657, 423 }, + { 0, 0, 0, 3109, 1644, 363 }, { 0, 0, 0, 3073, 1631, 302 }, { 0, 0, 0, 3038, 1617, 240 }, + { 0, 0, 0, 3002, 1604, 179 }, { 0, 0, 0, 2965, 1591, 117 }, { 0, 0, 0, 2929, 1577, 54 }, + { 0, 0, 0, 2892, 1564, -8 }, { 0, 0, 0, 2855, 1550, -72 }, { 0, 0, 0, 2818, 1537, -135 }, + { 0, 0, 0, 2781, 1523, -199 }, { 0, 0, 0, 2743, 1509, -264 }, { 0, 0, 0, 2706, 1495, -329 }, + { 0, 0, 0, 2668, 1481, -394 }, { 0, 0, 0, 2630, 1467, -459 }, { 0, 0, 0, 2592, 1453, -524 }, + { 0, 0, 0, 2553, 1439, -590 }, { 0, 0, 0, 2515, 1425, -656 }, { 0, 0, 0, 2476, 1410, -722 }, + { 0, 0, 0, 2438, 1396, -789 }, { 0, 0, 0, 2399, 1382, -855 }, { 0, 0, 0, 2360, 1368, -922 }, + { 0, 0, 0, 2321, 1353, -988 }, { 0, 0, 0, 2282, 1339, -1055 }, { 0, 0, 0, 2243, 1325, -1122 }, + { 0, 0, 0, 2205, 1310, -1189 }, { 0, 0, 0, 2166, 1296, -1256 }, { 0, 0, 0, 2127, 1281, -1323 }, + { 0, 0, 0, 2088, 1267, -1390 }, { 0, 0, 0, 2049, 1253, -1457 }, { 0, 0, 0, 2010, 1238, -1524 }, + { 0, 0, 0, 1971, 1224, -1590 }, { 0, 0, 0, 1932, 1210, -1657 }, { 0, 0, 0, 1893, 1195, -1724 }, + { 0, 0, 0, 1854, 1181, -1790 }, { 0, 0, 0, 1816, 1167, -1857 }, { 0, 0, 0, 1777, 1153, -1923 }, + { 0, 0, 0, 1739, 1138, -1989 }, { 0, 0, 0, 1700, 1124, -2054 }, { 0, 0, 0, 1662, 1110, -2120 }, + { 0, 0, 0, 1624, 1096, -2185 }, { 0, 0, 0, 1586, 1082, -2250 }, { 0, 0, 0, 1549, 1068, -2315 }, + { 0, 0, 0, 1511, 1055, -2380 }, { 0, 0, 0, 1474, 1041, -2444 }, { 0, 0, 0, 1437, 1027, -2507 }, + { 0, 0, 0, 1400, 1013, -2571 }, { 0, 0, 0, 1363, 1000, -2634 }, { 0, 0, 0, 1327, 986, -2696 }, + { 0, 0, 0, 1290, 973, -2759 }, { 0, 0, 0, 1254, 960, -2820 }, { 0, 0, 0, 1219, 947, -2882 }, + { 0, 0, 0, 1183, 934, -2942 }, { 0, 0, 0, 1148, 921, -3003 }, { 0, 0, 0, 1113, 908, -3063 }, + { 0, 0, 0, 1079, 895, -3122 }, { 0, 0, 0, 1045, 882, -3181 }, { 0, 0, 0, 1011, 870, -3239 }, + { 0, 0, 0, 977, 858, -3296 }, { 0, 0, 0, 944, 845, -3353 }, { 0, 0, 0, 911, 833, -3409 }, + { 0, 0, 0, 879, 821, -3465 }, { 0, 0, 0, 847, 810, -3520 }, { 0, 0, 0, 816, 798, -3574 }, + { 0, 0, 0, 784, 787, -3627 }, { 0, 0, 0, 754, 775, -3680 }, { 0, 0, 0, 723, 764, -3732 }, + { 0, 0, 0, 694, 753, -3783 }, { 0, 0, 0, 664, 742, -3834 }, { 0, 0, 0, 635, 732, -3883 }, + { 0, 0, 0, 607, 721, -3932 }, { 0, 0, 0, 579, 711, -3980 }, { 0, 0, 0, 552, 701, -4027 }, + { 0, 0, 0, 525, 691, -4073 }, { 0, 0, 0, 498, 681, -4118 }, { 0, 0, 0, 473, 672, -4163 }, + { 0, 0, 0, 447, 662, -4206 }, { 0, 0, 0, 423, 653, -4248 }, { 0, 0, 0, 399, 644, -4290 }, + { 0, 0, 0, 375, 636, -4330 }, { 0, 0, 0, 352, 627, -4370 }, { 0, 0, 0, 330, 619, -4408 }, + { 0, 0, 0, 308, 611, -4445 }, { 0, 0, 0, 287, 603, -4481 }, { 0, 0, 0, 267, 596, -4516 }, + { 0, 0, 0, 247, 588, -4550 }, { 0, 0, 0, 228, 581, -4583 }, { 0, 0, 0, 210, 575, -4614 }, + { 0, 0, 0, 192, 568, -4645 }, { 0, 0, 0, 175, 562, -4674 }, { 0, 0, 0, 159, 556, -4702 }, + { 0, 0, 0, 143, 550, -4728 }, { 0, 0, 0, 128, 545, -4754 }, { 0, 0, 0, 114, 539, -4778 }, + { 0, 0, 0, 101, 535, -4801 }, { 0, 0, 0, 89, 530, -4822 }, { 0, 0, 0, 77, 526, -4842 }, + { 0, 0, 0, 66, 522, -4861 }, { 0, 0, 0, 56, 518, -4878 }, { 0, 0, 0, 47, 514, -4894 }, + { 0, 0, 0, 38, 511, -4909 }, { 0, 0, 0, 30, 508, -4922 }, { 0, 0, 0, 24, 506, -4933 }, + { 0, 0, 0, 18, 504, -4944 }, { 0, 0, 0, 13, 502, -4952 }, { 0, 0, 0, 9, 500, -4959 }, + { 0, 0, 0, 5, 499, -4965 }, { 0, 0, 0, 3, 498, -4969 }, { 0, 0, 0, 2, 498, -4971 }, + { 0, 0, 0, 1, 498, -4972 }, +}; + +struct AnimDataInfo anim_red_star[] = { + { ARRAY_COUNT(animdata_red_star_1), GD_ANIM_ROT3S_POS3S, animdata_red_star_1 }, + { ARRAY_COUNT(animdata_red_star_2), GD_ANIM_ROT3S_POS3S, animdata_red_star_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_mario_eyebrows_1.c b/src/goddard/dynlists/anim_mario_eyebrows_1.c new file mode 100644 index 00000000..10f3bd56 --- /dev/null +++ b/src/goddard/dynlists/anim_mario_eyebrows_1.c @@ -0,0 +1,215 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_eyebrows_1_1[][3] = { + { -68, 0, 1775 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1773 }, { -68, 0, 1773 }, + { -68, 0, 1772 }, { -68, 0, 1771 }, { -68, 0, 1770 }, { -68, 0, 1768 }, { -68, 0, 1767 }, + { -68, 0, 1766 }, { -68, -1, 1766 }, { -68, -1, 1765 }, { -68, -1, 1765 }, { -68, -1, 1764 }, + { -68, -1, 1765 }, { -68, -1, 1765 }, { -68, -1, 1766 }, { -68, 0, 1767 }, { -68, 0, 1769 }, + { -68, 0, 1772 }, { -68, 0, 1775 }, { -68, 0, 1782 }, { -68, 2, 1796 }, { -68, 4, 1814 }, + { -68, 6, 1832 }, { -68, 8, 1849 }, { -67, 10, 1861 }, { -67, 10, 1866 }, { -67, 10, 1863 }, + { -67, 9, 1857 }, { -68, 8, 1847 }, { -68, 7, 1836 }, { -68, 5, 1823 }, { -68, 4, 1810 }, + { -68, 2, 1798 }, { -68, 1, 1787 }, { -68, 0, 1779 }, { -68, 0, 1775 }, { -68, 0, 1772 }, + { -68, 0, 1771 }, { -68, 0, 1769 }, { -68, 0, 1768 }, { -68, 0, 1767 }, { -68, -1, 1766 }, + { -68, -1, 1765 }, { -68, -1, 1765 }, { -68, -1, 1765 }, { -68, -1, 1764 }, { -68, -1, 1765 }, + { -68, -1, 1765 }, { -68, -1, 1765 }, { -68, -1, 1766 }, { -68, -1, 1766 }, { -68, 0, 1767 }, + { -68, 0, 1767 }, { -68, 0, 1768 }, { -68, 0, 1769 }, { -68, 0, 1770 }, { -68, 0, 1770 }, + { -68, 0, 1771 }, { -68, 0, 1772 }, { -68, 0, 1772 }, { -68, 0, 1773 }, { -68, 0, 1774 }, + { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, + { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1773 }, { -68, 0, 1773 }, + { -68, 0, 1773 }, { -68, 0, 1773 }, { -68, 0, 1773 }, { -68, 0, 1773 }, { -68, 0, 1773 }, + { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1775 }, { -68, 0, 1776 }, + { -68, 0, 1779 }, { -68, 0, 1782 }, { -68, 1, 1785 }, { -68, 1, 1786 }, { -68, 1, 1786 }, + { -68, 1, 1787 }, { -68, 1, 1787 }, { -68, 1, 1787 }, { -68, 1, 1788 }, { -68, 1, 1788 }, + { -68, 1, 1788 }, { -68, 1, 1788 }, { -68, 1, 1788 }, { -68, 1, 1788 }, { -68, 1, 1788 }, + { -68, 1, 1788 }, { -68, 1, 1788 }, { -68, 1, 1787 }, { -68, 1, 1787 }, { -68, 1, 1787 }, + { -68, 1, 1786 }, { -68, 1, 1786 }, { -68, 1, 1785 }, { -68, 1, 1783 }, { -68, 0, 1780 }, + { -68, 0, 1778 }, { -68, 0, 1776 }, { -68, 0, 1775 }, { -68, 0, 1774 }, { -68, 0, 1774 }, + { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1774 }, + { -68, 0, 1774 }, { -68, 0, 1774 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1774 }, + { -68, 0, 1773 }, { -68, 0, 1771 }, { -68, 0, 1768 }, { -69, -1, 1765 }, { -69, -1, 1762 }, + { -69, -1, 1758 }, { -69, -2, 1754 }, { -69, -2, 1751 }, { -69, -3, 1747 }, { -69, -3, 1743 }, + { -69, -3, 1740 }, { -70, -4, 1737 }, { -70, -4, 1735 }, { -70, -4, 1733 }, { -70, -4, 1732 }, + { -70, -4, 1732 }, { -70, -4, 1733 }, { -70, -4, 1734 }, { -70, -4, 1738 }, { -69, -3, 1742 }, + { -69, -3, 1748 }, { -69, -2, 1755 }, { -69, -1, 1764 }, { -68, 0, 1775 }, { -67, 4, 1818 }, + { -64, 14, 1905 }, { -60, 26, 2005 }, { -57, 35, 2088 }, { -56, 39, 2122 }, { -56, 37, 2110 }, + { -57, 34, 2076 }, { -59, 28, 2027 }, { -61, 22, 1970 }, { -63, 15, 1910 }, { -65, 8, 1853 }, + { -67, 3, 1806 }, { -68, 0, 1775 }, { -69, -1, 1760 }, { -71, -1, 1758 }, { -72, -1, 1764 }, + { -72, 0, 1776 }, { -73, 1, 1788 }, { -74, 2, 1798 }, { -74, 3, 1803 }, { -74, 3, 1804 }, + { -74, 3, 1804 }, { -75, 3, 1804 }, { -75, 3, 1805 }, { -76, 3, 1805 }, { -77, 3, 1805 }, + { -78, 3, 1804 }, { -78, 3, 1804 }, { -79, 3, 1804 }, { -80, 3, 1803 }, { -81, 3, 1803 }, + { -82, 3, 1802 }, { -83, 3, 1802 }, { -84, 3, 1801 }, { -85, 3, 1801 }, { -85, 3, 1800 }, + { -86, 2, 1800 }, { -87, 2, 1799 }, { -87, 2, 1799 }, { -87, 2, 1798 }, { -88, 2, 1798 }, + { -88, 2, 1797 }, { -88, 2, 1797 }, { -88, 2, 1797 }, { -87, 2, 1797 }, { -87, 2, 1797 }, + { -86, 2, 1797 }, { -85, 2, 1797 }, { -84, 2, 1798 }, { -82, 2, 1799 }, { -81, 2, 1799 }, + { -79, 3, 1800 }, { -76, 3, 1802 }, { -74, 3, 1803 }, { -69, 3, 1806 }, { -61, 4, 1810 }, + { -50, 5, 1816 }, { -37, 6, 1823 }, { -23, 7, 1830 }, { -9, 8, 1838 }, { 5, 9, 1846 }, + { 18, 10, 1854 }, { 30, 11, 1861 }, { 40, 11, 1867 }, { 46, 12, 1871 }, { 51, 12, 1875 }, + { 55, 12, 1878 }, { 58, 12, 1882 }, { 60, 12, 1885 }, { 62, 12, 1888 }, { 64, 12, 1891 }, + { 64, 12, 1893 }, { 64, 12, 1895 }, { 64, 12, 1897 }, { 63, 11, 1898 }, { 61, 11, 1899 }, + { 58, 11, 1899 }, { 55, 11, 1898 }, { 51, 10, 1896 }, { 47, 10, 1894 }, { 40, 9, 1890 }, + { 29, 9, 1882 }, { 16, 8, 1872 }, { 1, 7, 1861 }, { -14, 6, 1849 }, { -30, 5, 1837 }, + { -44, 5, 1826 }, { -57, 4, 1816 }, { -68, 3, 1808 }, { -74, 3, 1803 }, { -78, 3, 1800 }, + { -81, 2, 1798 }, { -83, 2, 1796 }, { -85, 2, 1794 }, { -86, 2, 1793 }, { -86, 2, 1792 }, + { -86, 1, 1792 }, { -86, 1, 1792 }, { -85, 1, 1792 }, { -84, 1, 1793 }, { -83, 1, 1793 }, + { -81, 1, 1794 }, { -80, 1, 1795 }, { -79, 1, 1796 }, { -77, 2, 1798 }, { -76, 2, 1799 }, + { -75, 2, 1800 }, { -74, 2, 1802 }, { -74, 3, 1803 }, { -73, 4, 1806 }, { -72, 6, 1812 }, + { -71, 9, 1820 }, { -70, 11, 1828 }, { -69, 13, 1834 }, { -68, 15, 1837 }, { -68, 15, 1838 }, + { -68, 15, 1839 }, { -68, 16, 1840 }, { -67, 16, 1840 }, { -67, 16, 1841 }, { -67, 16, 1841 }, + { -67, 16, 1841 }, { -67, 16, 1841 }, { -67, 16, 1841 }, { -67, 16, 1840 }, { -68, 16, 1840 }, + { -68, 15, 1839 }, { -68, 15, 1839 }, { -68, 15, 1839 }, { -68, 15, 1838 }, { -68, 15, 1838 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 15, 1837 }, + { -68, 15, 1837 }, { -68, 15, 1837 }, { -68, 14, 1836 }, { -68, 14, 1833 }, { -68, 14, 1830 }, + { -69, 13, 1825 }, { -69, 13, 1821 }, { -69, 12, 1817 }, { -69, 12, 1814 }, { -69, 12, 1813 }, + { -69, 12, 1815 }, { -69, 13, 1819 }, { -69, 13, 1826 }, { -68, 15, 1837 }, { -66, 19, 1876 }, + { -62, 26, 1946 }, { -59, 34, 2015 }, { -57, 38, 2048 }, { -57, 38, 2050 }, { -57, 37, 2044 }, + { -58, 36, 2032 }, { -59, 35, 2015 }, { -60, 33, 1996 }, { -62, 31, 1974 }, { -63, 28, 1951 }, + { -64, 26, 1930 }, { -66, 23, 1911 }, { -67, 20, 1889 }, { -69, 14, 1861 }, { -71, 9, 1833 }, + { -73, 5, 1812 }, { -74, 3, 1803 }, { -74, 3, 1802 }, { -74, 3, 1801 }, { -74, 2, 1800 }, + { -74, 2, 1799 }, { -74, 2, 1798 }, { -74, 2, 1797 }, { -74, 2, 1796 }, { -74, 2, 1796 }, + { -75, 1, 1795 }, { -75, 1, 1794 }, { -75, 1, 1794 }, { -75, 1, 1793 }, { -75, 1, 1792 }, + { -75, 1, 1792 }, { -75, 1, 1791 }, { -75, 1, 1791 }, { -75, 1, 1791 }, { -75, 0, 1790 }, + { -75, 0, 1790 }, { -75, 0, 1789 }, { -75, 0, 1789 }, { -75, 0, 1789 }, { -75, 0, 1789 }, + { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, + { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, + { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, { -75, 0, 1788 }, + { -75, 0, 1789 }, { -75, 0, 1789 }, { -75, 0, 1789 }, { -75, 0, 1789 }, { -75, 0, 1789 }, + { -75, 0, 1790 }, { -75, 0, 1790 }, { -75, 0, 1790 }, { -75, 1, 1790 }, { -75, 1, 1791 }, + { -75, 1, 1791 }, { -75, 1, 1791 }, { -75, 1, 1792 }, { -75, 1, 1792 }, { -75, 1, 1792 }, + { -75, 1, 1793 }, { -75, 1, 1793 }, { -75, 1, 1793 }, { -75, 1, 1794 }, { -75, 1, 1794 }, + { -75, 1, 1794 }, { -75, 1, 1795 }, { -75, 1, 1795 }, { -74, 1, 1795 }, { -74, 2, 1796 }, + { -74, 2, 1796 }, { -74, 2, 1797 }, { -74, 2, 1797 }, { -74, 2, 1797 }, { -74, 2, 1798 }, + { -74, 2, 1798 }, { -74, 2, 1798 }, { -74, 2, 1799 }, { -74, 2, 1799 }, { -74, 2, 1799 }, + { -74, 2, 1800 }, { -74, 2, 1800 }, { -74, 2, 1800 }, { -74, 2, 1801 }, { -74, 3, 1801 }, + { -74, 3, 1801 }, { -74, 3, 1801 }, { -74, 3, 1802 }, { -74, 3, 1802 }, { -74, 3, 1802 }, + { -74, 3, 1802 }, { -74, 3, 1802 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1803 }, { -74, 3, 1804 }, { -74, 3, 1804 }, + { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1804 }, + { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1805 }, { -74, 3, 1805 }, { -74, 3, 1805 }, + { -74, 3, 1805 }, { -74, 3, 1805 }, { -74, 3, 1805 }, { -74, 3, 1804 }, { -74, 3, 1804 }, + { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1804 }, { -74, 3, 1803 }, { -74, 3, 1803 }, + { -74, 3, 1803 }, { -74, 3, 1802 }, { -74, 3, 1802 }, { -74, 3, 1801 }, { -73, 3, 1801 }, + { -73, 3, 1800 }, { -73, 3, 1800 }, { -73, 2, 1799 }, { -73, 2, 1798 }, { -73, 2, 1798 }, + { -73, 2, 1797 }, { -73, 2, 1797 }, { -72, 2, 1796 }, { -72, 2, 1795 }, { -72, 2, 1795 }, + { -72, 2, 1794 }, { -72, 2, 1793 }, { -72, 2, 1792 }, { -72, 2, 1792 }, { -71, 1, 1791 }, + { -71, 1, 1790 }, { -71, 1, 1789 }, { -71, 1, 1789 }, { -71, 1, 1788 }, { -71, 1, 1787 }, + { -71, 1, 1786 }, { -70, 1, 1786 }, { -70, 1, 1785 }, { -70, 1, 1784 }, { -70, 1, 1784 }, + { -70, 0, 1783 }, { -70, 0, 1782 }, { -70, 0, 1782 }, { -69, 0, 1781 }, { -69, 0, 1780 }, + { -69, 0, 1780 }, { -69, 0, 1779 }, { -69, 0, 1778 }, { -69, 0, 1778 }, { -69, 0, 1777 }, + { -69, 0, 1777 }, { -69, 0, 1776 }, { -68, 0, 1776 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1774 }, { -69, 0, 1774 }, { -70, 0, 1773 }, { -72, 0, 1773 }, { -73, 0, 1773 }, + { -75, 1, 1772 }, { -77, 1, 1772 }, { -79, 2, 1772 }, { -80, 2, 1772 }, { -82, 2, 1772 }, + { -83, 3, 1772 }, { -84, 3, 1772 }, { -84, 3, 1772 }, { -84, 3, 1772 }, { -84, 3, 1772 }, + { -82, 2, 1773 }, { -80, 2, 1773 }, { -77, 1, 1773 }, { -73, 1, 1774 }, { -68, 0, 1775 }, + { -60, -1, 1776 }, { -48, -4, 1777 }, { -33, -7, 1779 }, { -15, -11, 1781 }, { 4, -15, 1784 }, + { 24, -19, 1786 }, { 44, -24, 1789 }, { 62, -28, 1791 }, { 79, -31, 1793 }, { 93, -34, 1795 }, + { 103, -36, 1796 }, { 108, -37, 1796 }, { 110, -38, 1797 }, { 113, -38, 1797 }, { 115, -39, 1797 }, + { 117, -39, 1798 }, { 118, -40, 1798 }, { 120, -40, 1798 }, { 122, -40, 1798 }, { 123, -40, 1798 }, + { 124, -41, 1798 }, { 125, -41, 1799 }, { 126, -41, 1799 }, { 127, -41, 1799 }, { 128, -41, 1799 }, + { 128, -42, 1799 }, { 129, -42, 1799 }, { 129, -42, 1799 }, { 129, -42, 1799 }, { 130, -42, 1799 }, + { 130, -42, 1799 }, { 130, -42, 1799 }, { 130, -42, 1799 }, { 129, -42, 1799 }, { 129, -42, 1799 }, + { 129, -42, 1799 }, { 128, -42, 1799 }, { 128, -42, 1799 }, { 127, -41, 1799 }, { 127, -41, 1799 }, + { 126, -41, 1799 }, { 126, -41, 1799 }, { 125, -41, 1799 }, { 124, -41, 1798 }, { 123, -41, 1798 }, + { 123, -40, 1798 }, { 122, -40, 1798 }, { 121, -40, 1798 }, { 120, -40, 1798 }, { 119, -40, 1798 }, + { 119, -40, 1798 }, { 118, -39, 1798 }, { 117, -39, 1798 }, { 116, -39, 1797 }, { 115, -39, 1797 }, + { 114, -39, 1797 }, { 114, -38, 1797 }, { 113, -38, 1797 }, { 112, -38, 1797 }, { 112, -38, 1797 }, + { 111, -38, 1797 }, { 110, -38, 1797 }, { 110, -38, 1797 }, { 109, -38, 1797 }, { 109, -37, 1797 }, + { 109, -37, 1797 }, { 108, -37, 1797 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, + { 108, -37, 1796 }, { 108, -37, 1796 }, { 108, -37, 1796 }, { 112, -38, 1797 }, { 108, -37, 1796 }, + { 91, -34, 1794 }, { 71, -29, 1792 }, { 48, -24, 1789 }, { 24, -19, 1786 }, { 1, -14, 1783 }, + { -20, -10, 1781 }, { -39, -6, 1778 }, { -55, -2, 1776 }, { -65, 0, 1775 }, { -68, 0, 1775 }, +}; + +static s16 animdata_mario_eyebrows_1_2[][3] = { + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1819 }, { -68, 5, 1818 }, { -68, 5, 1817 }, + { -68, 5, 1816 }, { -68, 4, 1815 }, { -68, 4, 1814 }, { -68, 4, 1813 }, { -68, 4, 1811 }, + { -68, 4, 1810 }, { -68, 4, 1809 }, { -68, 3, 1808 }, { -68, 3, 1807 }, { -68, 3, 1806 }, + { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1805 }, { -68, 3, 1805 }, + { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, + { -68, 3, 1805 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1805 }, { -68, 3, 1805 }, + { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1802 }, { -68, 3, 1801 }, + { -68, 3, 1801 }, { -68, 3, 1800 }, { -68, 2, 1799 }, { -68, 2, 1798 }, { -68, 2, 1797 }, + { -68, 2, 1796 }, { -68, 2, 1795 }, { -68, 2, 1794 }, { -68, 2, 1793 }, { -68, 2, 1792 }, + { -68, 1, 1790 }, { -68, 1, 1789 }, { -68, 1, 1788 }, { -68, 1, 1787 }, { -68, 1, 1786 }, + { -68, 1, 1785 }, { -68, 1, 1784 }, { -68, 0, 1783 }, { -68, 0, 1781 }, { -68, 0, 1781 }, + { -68, 0, 1780 }, { -68, 0, 1779 }, { -68, 0, 1778 }, { -68, 0, 1777 }, { -68, 0, 1777 }, + { -68, 0, 1776 }, { -68, 0, 1776 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, + { -68, 0, 1775 }, +}; + +struct AnimDataInfo anim_mario_eyebrows_1[] = { + { ARRAY_COUNT(animdata_mario_eyebrows_1_1), GD_ANIM_ROT3S, animdata_mario_eyebrows_1_1 }, + { ARRAY_COUNT(animdata_mario_eyebrows_1_2), GD_ANIM_ROT3S, animdata_mario_eyebrows_1_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_mario_lips_1.c b/src/goddard/dynlists/anim_mario_lips_1.c new file mode 100644 index 00000000..e6188e2a --- /dev/null +++ b/src/goddard/dynlists/anim_mario_lips_1.c @@ -0,0 +1,256 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_lips_1_1[][3] = { + { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1817 }, + { -80, -6, 1817 }, { -80, -6, 1816 }, { -80, -6, 1815 }, { -80, -6, 1815 }, + { -80, -6, 1814 }, { -80, -6, 1813 }, { -80, -6, 1812 }, { -80, -6, 1812 }, + { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, + { -80, -7, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, { -80, -6, 1814 }, + { -80, -6, 1816 }, { -80, -6, 1818 }, { -80, -5, 1823 }, { -80, -4, 1833 }, + { -80, -2, 1845 }, { -80, 0, 1857 }, { -80, 1, 1869 }, { -80, 2, 1877 }, + { -80, 2, 1880 }, { -80, 2, 1879 }, { -80, 1, 1874 }, { -80, 0, 1868 }, + { -80, 0, 1860 }, { -80, -1, 1851 }, { -80, -2, 1842 }, { -80, -3, 1834 }, + { -80, -4, 1826 }, { -80, -5, 1821 }, { -80, -6, 1818 }, { -80, -6, 1817 }, + { -80, -6, 1815 }, { -80, -6, 1814 }, { -80, -6, 1813 }, { -80, -6, 1813 }, + { -80, -6, 1812 }, { -80, -7, 1812 }, { -80, -7, 1811 }, { -80, -7, 1811 }, + { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, + { -80, -6, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, { -80, -6, 1813 }, + { -80, -6, 1813 }, { -80, -6, 1814 }, { -80, -6, 1815 }, { -80, -6, 1815 }, + { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, + { -80, -6, 1817 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, + { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -81, -6, 1818 }, + { -82, -6, 1818 }, { -84, -6, 1818 }, { -85, -6, 1819 }, { -87, -6, 1819 }, + { -88, -6, 1819 }, { -90, -6, 1819 }, { -91, -6, 1819 }, { -92, -6, 1819 }, + { -93, -6, 1819 }, { -93, -6, 1819 }, { -93, -6, 1819 }, { -92, -6, 1819 }, + { -91, -6, 1819 }, { -89, -6, 1819 }, { -87, -6, 1819 }, { -84, -6, 1818 }, + { -80, -6, 1818 }, { -65, -5, 1817 }, { -38, -3, 1814 }, { -7, -2, 1811 }, + { 20, 0, 1808 }, { 34, 0, 1806 }, { 39, 0, 1806 }, { 43, 0, 1805 }, + { 46, 0, 1805 }, { 49, 1, 1805 }, { 52, 1, 1804 }, { 54, 1, 1804 }, + { 55, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, + { 55, 1, 1804 }, { 53, 1, 1804 }, { 51, 1, 1805 }, { 49, 1, 1805 }, + { 46, 0, 1805 }, { 42, 0, 1805 }, { 38, 0, 1806 }, { 34, 0, 1806 }, + { 23, 0, 1807 }, { 3, -1, 1809 }, { -21, -2, 1812 }, { -46, -4, 1815 }, + { -67, -5, 1817 }, { -80, -6, 1818 }, { -85, -6, 1819 }, { -89, -6, 1819 }, + { -90, -6, 1820 }, { -90, -6, 1820 }, { -90, -6, 1820 }, { -88, -6, 1820 }, + { -86, -6, 1820 }, { -84, -6, 1820 }, { -82, -6, 1820 }, { -80, -6, 1819 }, + { -80, -6, 1818 }, { -80, -6, 1816 }, { -79, -6, 1814 }, { -79, -6, 1812 }, + { -79, -7, 1809 }, { -79, -7, 1806 }, { -79, -8, 1803 }, { -79, -8, 1800 }, + { -79, -8, 1798 }, { -79, -9, 1796 }, { -79, -9, 1795 }, { -79, -9, 1795 }, + { -79, -9, 1795 }, { -79, -9, 1795 }, { -79, -9, 1796 }, { -79, -9, 1796 }, + { -79, -9, 1797 }, { -79, -8, 1797 }, { -79, -8, 1798 }, { -79, -8, 1799 }, + { -79, -8, 1800 }, { -79, -8, 1801 }, { -79, -8, 1802 }, { -79, -8, 1803 }, + { -79, -8, 1804 }, { -79, -7, 1805 }, { -79, -7, 1806 }, { -79, -7, 1806 }, + { -79, -7, 1807 }, { -79, -7, 1808 }, { -79, -7, 1808 }, { -79, -7, 1809 }, + { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1806 }, + { -79, -8, 1801 }, { -79, -9, 1794 }, { -79, -10, 1790 }, { -79, -10, 1790 }, + { -79, -8, 1799 }, { -79, -6, 1814 }, { -80, -4, 1829 }, { -80, -3, 1837 }, + { -80, -3, 1837 }, { -80, -4, 1830 }, { -80, -5, 1822 }, { -80, -6, 1818 }, + { -80, -6, 1817 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, + { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, + { -80, -6, 1817 }, { -80, -6, 1817 }, { -80, -6, 1818 }, { -80, -6, 1818 }, + { -80, -6, 1818 }, { -79, -6, 1818 }, { -79, -6, 1816 }, { -79, -7, 1814 }, + { -79, -7, 1812 }, { -78, -8, 1809 }, { -78, -9, 1805 }, { -77, -10, 1802 }, + { -77, -11, 1798 }, { -76, -12, 1794 }, { -75, -13, 1791 }, { -75, -14, 1787 }, + { -74, -15, 1784 }, { -74, -16, 1781 }, { -74, -17, 1778 }, { -73, -17, 1777 }, + { -73, -18, 1776 }, { -73, -18, 1776 }, { -73, -18, 1776 }, { -74, -17, 1778 }, + { -74, -16, 1781 }, { -75, -15, 1786 }, { -76, -13, 1791 }, { -77, -11, 1799 }, + { -78, -9, 1807 }, { -80, -6, 1818 }, { -86, 6, 1861 }, { -99, 30, 1947 }, + { -114, 59, 2046 }, { -126, 82, 2127 }, { -131, 92, 2161 }, { -130, 88, 2149 }, + { -127, 79, 2117 }, { -123, 65, 2070 }, { -117, 49, 2014 }, { -110, 32, 1955 }, + { -101, 16, 1899 }, { -91, 3, 1851 }, { -80, -6, 1818 }, { -64, -11, 1799 }, + { -42, -13, 1789 }, { -18, -13, 1786 }, { 5, -12, 1787 }, { 27, -11, 1790 }, + { 43, -9, 1794 }, { 52, -9, 1795 }, { 55, -9, 1795 }, { 57, -9, 1794 }, + { 59, -9, 1793 }, { 60, -9, 1793 }, { 62, -9, 1792 }, { 62, -9, 1792 }, + { 63, -9, 1791 }, { 63, -9, 1790 }, { 62, -9, 1790 }, { 62, -9, 1789 }, + { 61, -9, 1789 }, { 60, -9, 1788 }, { 59, -9, 1787 }, { 58, -9, 1787 }, + { 56, -9, 1787 }, { 55, -9, 1786 }, { 53, -8, 1786 }, { 52, -8, 1786 }, + { 51, -8, 1785 }, { 49, -8, 1785 }, { 48, -8, 1785 }, { 46, -8, 1785 }, + { 45, -8, 1786 }, { 44, -8, 1786 }, { 44, -8, 1786 }, { 43, -8, 1787 }, + { 43, -8, 1787 }, { 43, -8, 1788 }, { 44, -8, 1789 }, { 44, -8, 1790 }, + { 45, -8, 1791 }, { 47, -9, 1792 }, { 49, -9, 1794 }, { 52, -9, 1795 }, + { 57, -9, 1798 }, { 66, -9, 1803 }, { 79, -10, 1810 }, { 94, -10, 1818 }, + { 110, -11, 1827 }, { 126, -11, 1836 }, { 142, -12, 1845 }, { 156, -13, 1853 }, + { 167, -14, 1860 }, { 174, -14, 1866 }, { 176, -15, 1869 }, { 174, -17, 1871 }, + { 170, -18, 1873 }, { 163, -20, 1874 }, { 155, -21, 1874 }, { 145, -23, 1874 }, + { 134, -25, 1874 }, { 123, -27, 1873 }, { 110, -29, 1872 }, { 98, -31, 1870 }, + { 86, -32, 1868 }, { 74, -34, 1866 }, { 64, -35, 1864 }, { 54, -36, 1861 }, + { 46, -36, 1858 }, { 40, -36, 1855 }, { 36, -35, 1852 }, { 35, -33, 1847 }, + { 35, -31, 1841 }, { 36, -27, 1834 }, { 39, -24, 1828 }, { 42, -20, 1820 }, + { 45, -17, 1813 }, { 48, -13, 1807 }, { 50, -11, 1801 }, { 52, -9, 1795 }, + { 52, -8, 1791 }, { 52, -7, 1786 }, { 53, -6, 1782 }, { 53, -5, 1778 }, + { 53, -5, 1774 }, { 53, -5, 1770 }, { 53, -5, 1767 }, { 52, -5, 1763 }, + { 52, -5, 1760 }, { 52, -5, 1756 }, { 52, -5, 1753 }, { 52, -5, 1750 }, + { 54, -4, 1746 }, { 58, -3, 1742 }, { 63, -2, 1738 }, { 66, -1, 1734 }, + { 67, -1, 1732 }, { 63, -1, 1731 }, { 52, -3, 1733 }, { 30, -7, 1738 }, + { -4, -13, 1749 }, { -45, -20, 1761 }, { -84, -26, 1773 }, { -116, -32, 1782 }, + { -132, -35, 1787 }, { -139, -36, 1788 }, { -144, -37, 1788 }, { -148, -38, 1788 }, + { -150, -39, 1788 }, { -152, -39, 1787 }, { -153, -40, 1786 }, { -153, -40, 1785 }, + { -152, -41, 1783 }, { -151, -41, 1781 }, { -149, -41, 1779 }, { -147, -41, 1778 }, + { -145, -41, 1776 }, { -143, -41, 1774 }, { -140, -40, 1772 }, { -138, -40, 1770 }, + { -136, -40, 1768 }, { -134, -40, 1767 }, { -132, -40, 1766 }, { -131, -40, 1765 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1763 }, + { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, + { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, + { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, + { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1763 }, + { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1763 }, { -131, -41, 1761 }, { -131, -42, 1757 }, { -131, -43, 1753 }, + { -131, -44, 1749 }, { -131, -45, 1745 }, { -131, -45, 1742 }, { -131, -46, 1741 }, + { -131, -45, 1743 }, { -131, -44, 1746 }, { -131, -43, 1753 }, { -131, -40, 1764 }, + { -131, -31, 1802 }, { -132, -15, 1869 }, { -134, 0, 1935 }, { -134, 9, 1971 }, + { -136, 10, 1978 }, { -140, 10, 1980 }, { -144, 9, 1976 }, { -149, 6, 1969 }, + { -153, 3, 1958 }, { -154, 0, 1945 }, { -153, -2, 1931 }, { -147, -5, 1917 }, + { -137, -7, 1904 }, { -109, -8, 1885 }, { -61, -8, 1857 }, { -9, -9, 1828 }, + { 33, -9, 1805 }, { 52, -9, 1795 }, { 53, -9, 1794 }, { 55, -9, 1793 }, + { 57, -9, 1792 }, { 59, -9, 1791 }, { 60, -9, 1790 }, { 62, -9, 1789 }, + { 63, -9, 1789 }, { 64, -9, 1788 }, { 66, -9, 1787 }, { 67, -9, 1786 }, + { 68, -9, 1786 }, { 69, -9, 1785 }, { 70, -9, 1785 }, { 71, -9, 1784 }, + { 72, -9, 1784 }, { 73, -9, 1783 }, { 73, -9, 1783 }, { 74, -9, 1782 }, + { 75, -9, 1782 }, { 75, -9, 1782 }, { 76, -9, 1781 }, { 76, -9, 1781 }, + { 77, -9, 1781 }, { 77, -9, 1781 }, { 77, -9, 1780 }, { 78, -9, 1780 }, + { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, + { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, + { 78, -9, 1780 }, { 78, -9, 1780 }, { 77, -9, 1780 }, { 77, -9, 1781 }, + { 77, -9, 1781 }, { 77, -9, 1781 }, { 76, -9, 1781 }, { 76, -9, 1781 }, + { 76, -9, 1782 }, { 75, -9, 1782 }, { 75, -9, 1782 }, { 74, -9, 1782 }, + { 74, -9, 1783 }, { 73, -9, 1783 }, { 73, -9, 1783 }, { 72, -9, 1783 }, + { 72, -9, 1784 }, { 71, -9, 1784 }, { 70, -9, 1784 }, { 70, -9, 1785 }, + { 69, -9, 1785 }, { 69, -9, 1785 }, { 68, -9, 1786 }, { 67, -9, 1786 }, + { 67, -9, 1787 }, { 66, -9, 1787 }, { 65, -9, 1787 }, { 65, -9, 1788 }, + { 64, -9, 1788 }, { 64, -9, 1788 }, { 63, -9, 1789 }, { 62, -9, 1789 }, + { 62, -9, 1789 }, { 61, -9, 1790 }, { 60, -9, 1790 }, { 60, -9, 1791 }, + { 59, -9, 1791 }, { 59, -9, 1791 }, { 58, -9, 1792 }, { 58, -9, 1792 }, + { 57, -9, 1792 }, { 56, -9, 1792 }, { 56, -9, 1793 }, { 55, -9, 1793 }, + { 55, -9, 1793 }, { 55, -9, 1794 }, { 54, -9, 1794 }, { 54, -9, 1794 }, + { 53, -9, 1794 }, { 53, -9, 1794 }, { 53, -9, 1795 }, { 52, -9, 1795 }, + { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, + { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, + { 52, -9, 1795 }, { 53, -9, 1795 }, { 54, -9, 1794 }, { 55, -9, 1794 }, + { 56, -9, 1794 }, { 57, -9, 1794 }, { 57, -9, 1793 }, { 58, -9, 1793 }, + { 58, -9, 1793 }, { 57, -9, 1793 }, { 56, -9, 1794 }, { 54, -9, 1794 }, + { 52, -9, 1795 }, { 48, -9, 1796 }, { 43, -9, 1798 }, { 37, -9, 1800 }, + { 30, -9, 1802 }, { 23, -10, 1805 }, { 15, -10, 1807 }, { 7, -10, 1810 }, + { 0, -10, 1813 }, { -8, -11, 1815 }, { -15, -11, 1818 }, { -21, -11, 1820 }, + { -26, -11, 1821 }, { -30, -11, 1823 }, { -33, -11, 1824 }, { -34, -11, 1824 }, + { -33, -11, 1823 }, { -29, -11, 1822 }, { -24, -11, 1820 }, { -17, -11, 1818 }, + { -9, -11, 1815 }, { 0, -10, 1813 }, { 8, -10, 1810 }, { 18, -10, 1807 }, + { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, { 47, -9, 1797 }, + { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, { 47, -9, 1797 }, + { 43, -9, 1798 }, { 36, -9, 1800 }, { 29, -9, 1803 }, { 21, -10, 1805 }, + { 13, -10, 1808 }, { 4, -10, 1811 }, { -3, -10, 1814 }, { -11, -11, 1816 }, + { -19, -11, 1819 }, { -25, -11, 1821 }, { -30, -11, 1822 }, { -33, -11, 1823 }, + { -34, -11, 1824 }, { -33, -11, 1823 }, { -29, -11, 1822 }, { -24, -11, 1820 }, + { -17, -11, 1818 }, { -9, -11, 1815 }, { 0, -10, 1813 }, { 8, -10, 1810 }, + { 18, -10, 1807 }, { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, + { 47, -9, 1797 }, { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, + { 46, -9, 1797 }, { 40, -9, 1799 }, { 32, -9, 1802 }, { 23, -10, 1805 }, + { 13, -10, 1808 }, { 3, -10, 1811 }, { -5, -11, 1814 }, { -14, -11, 1817 }, + { -22, -11, 1820 }, { -28, -11, 1822 }, { -32, -11, 1823 }, { -34, -11, 1824 }, + { -33, -11, 1824 }, { -30, -11, 1823 }, { -25, -11, 1821 }, { -18, -11, 1820 }, + { -11, -11, 1818 }, { -3, -11, 1816 }, { 5, -10, 1813 }, { 14, -10, 1811 }, + { 22, -10, 1808 }, { 31, -10, 1805 }, { 38, -9, 1803 }, { 44, -9, 1801 }, + { 48, -9, 1798 }, { 51, -9, 1797 }, { 52, -9, 1795 }, { 50, -9, 1794 }, + { 47, -9, 1793 }, { 43, -9, 1792 }, { 37, -9, 1791 }, { 31, -9, 1789 }, + { 24, -9, 1788 }, { 16, -9, 1787 }, { 8, -9, 1787 }, { 0, -9, 1786 }, + { -8, -9, 1785 }, { -17, -9, 1785 }, { -25, -9, 1784 }, { -32, -9, 1784 }, + { -39, -9, 1784 }, { -45, -9, 1784 }, { -50, -9, 1784 }, { -54, -9, 1785 }, + { -56, -9, 1785 }, { -59, -9, 1786 }, { -61, -9, 1787 }, { -63, -8, 1788 }, + { -65, -8, 1789 }, { -67, -8, 1790 }, { -69, -8, 1791 }, { -70, -8, 1792 }, + { -71, -8, 1793 }, { -72, -8, 1795 }, { -73, -8, 1796 }, { -74, -7, 1798 }, + { -74, -7, 1799 }, { -75, -7, 1801 }, { -75, -7, 1802 }, { -76, -7, 1804 }, + { -76, -7, 1805 }, { -77, -7, 1807 }, { -77, -7, 1808 }, { -77, -6, 1809 }, + { -77, -6, 1811 }, { -77, -6, 1812 }, { -78, -6, 1813 }, { -78, -6, 1814 }, + { -78, -6, 1815 }, { -79, -6, 1816 }, { -79, -6, 1817 }, { -80, -6, 1818 }, + { -80, -6, 1819 }, { -82, -6, 1819 }, { -84, -6, 1819 }, { -86, -6, 1819 }, + { -89, -6, 1819 }, { -92, -6, 1819 }, { -94, -6, 1819 }, { -97, -6, 1819 }, + { -99, -6, 1818 }, { -102, -6, 1818 }, { -103, -6, 1818 }, { -104, -6, 1817 }, + { -105, -6, 1817 }, { -104, -6, 1817 }, { -103, -6, 1817 }, { -101, -6, 1817 }, + { -98, -6, 1817 }, { -93, -6, 1817 }, { -87, -6, 1817 }, { -80, -6, 1818 }, + { -68, -5, 1819 }, { -51, -5, 1821 }, { -30, -5, 1823 }, { -5, -4, 1826 }, + { 21, -4, 1829 }, { 50, -3, 1831 }, { 78, -3, 1834 }, { 105, -3, 1836 }, + { 131, -2, 1838 }, { 153, -2, 1839 }, { 171, -1, 1840 }, { 184, -1, 1839 }, + { 193, -1, 1837 }, { 200, -1, 1834 }, { 206, -1, 1831 }, { 210, 0, 1827 }, + { 214, 0, 1822 }, { 216, 0, 1818 }, { 217, 0, 1813 }, { 218, 0, 1808 }, + { 218, 0, 1803 }, { 217, 0, 1798 }, { 216, 0, 1793 }, { 215, 0, 1788 }, + { 214, 0, 1784 }, { 212, 0, 1781 }, { 211, 0, 1778 }, { 210, 0, 1775 }, + { 209, 0, 1774 }, { 209, 0, 1773 }, { 208, 0, 1774 }, { 208, 0, 1774 }, + { 208, 0, 1776 }, { 207, 0, 1778 }, { 206, 0, 1780 }, { 205, 0, 1783 }, + { 204, 0, 1786 }, { 203, 0, 1789 }, { 202, -1, 1792 }, { 201, -1, 1796 }, + { 199, -1, 1800 }, { 198, -1, 1804 }, { 197, -1, 1808 }, { 195, -2, 1812 }, + { 194, -2, 1816 }, { 192, -2, 1819 }, { 191, -2, 1823 }, { 190, -2, 1826 }, + { 188, -2, 1830 }, { 187, -2, 1832 }, { 186, -2, 1835 }, { 185, -1, 1837 }, + { 184, -1, 1839 }, { 183, 0, 1835 }, { 183, 2, 1826 }, { 183, 6, 1816 }, + { 184, 7, 1811 }, { 184, 5, 1818 }, { 184, 0, 1831 }, { 184, -1, 1839 }, + { 184, 0, 1834 }, { 184, 3, 1824 }, { 184, 5, 1817 }, { 184, 5, 1819 }, + { 184, 3, 1824 }, { 184, 1, 1828 }, { 184, 1, 1829 }, { 184, 1, 1829 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 189, 2, 1828 }, { 184, 1, 1828 }, { 158, 1, 1827 }, { 128, 0, 1826 }, + { 94, 0, 1824 }, { 59, -1, 1823 }, { 24, -2, 1822 }, { -8, -3, 1821 }, + { -36, -4, 1820 }, { -59, -5, 1819 }, { -74, -5, 1818 }, { -80, -6, 1818 }, +}; + +static s16 animdata_mario_lips_1_2[][3] = { + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, { -97, -93, 1924 }, + { -97, -93, 1924 }, { -97, -92, 1924 }, { -97, -91, 1922 }, { -97, -90, 1921 }, { -96, -88, 1919 }, + { -96, -86, 1917 }, { -95, -84, 1914 }, { -95, -82, 1912 }, { -95, -79, 1909 }, { -94, -77, 1906 }, + { -94, -74, 1904 }, { -93, -72, 1901 }, { -93, -70, 1898 }, { -92, -68, 1895 }, { -92, -66, 1893 }, + { -92, -64, 1891 }, { -91, -63, 1889 }, { -91, -63, 1887 }, { -91, -62, 1885 }, { -91, -62, 1884 }, + { -90, -62, 1882 }, { -90, -62, 1881 }, { -90, -62, 1880 }, { -90, -62, 1878 }, { -90, -62, 1877 }, + { -90, -62, 1875 }, { -89, -63, 1874 }, { -89, -63, 1873 }, { -89, -64, 1871 }, { -89, -65, 1870 }, + { -89, -65, 1869 }, { -89, -66, 1867 }, { -89, -66, 1866 }, { -88, -67, 1865 }, { -88, -68, 1864 }, + { -88, -68, 1863 }, { -88, -69, 1862 }, { -88, -69, 1861 }, { -88, -69, 1860 }, { -88, -70, 1859 }, + { -88, -70, 1858 }, { -88, -70, 1857 }, { -88, -70, 1856 }, { -87, -70, 1855 }, { -87, -69, 1855 }, + { -87, -69, 1854 }, { -87, -68, 1853 }, { -87, -68, 1853 }, { -87, -67, 1852 }, { -87, -66, 1851 }, + { -87, -66, 1851 }, { -86, -65, 1850 }, { -86, -64, 1849 }, { -86, -63, 1849 }, { -86, -63, 1848 }, + { -86, -62, 1847 }, { -86, -61, 1847 }, { -86, -60, 1846 }, { -86, -59, 1845 }, { -85, -58, 1845 }, + { -85, -57, 1844 }, { -85, -56, 1843 }, { -85, -55, 1842 }, { -85, -54, 1842 }, { -85, -53, 1841 }, + { -85, -52, 1840 }, { -85, -51, 1840 }, { -84, -50, 1839 }, { -84, -49, 1839 }, { -84, -47, 1838 }, + { -84, -46, 1837 }, { -84, -45, 1837 }, { -84, -44, 1836 }, { -84, -43, 1835 }, { -83, -42, 1835 }, + { -83, -41, 1834 }, { -83, -39, 1833 }, { -83, -38, 1833 }, { -83, -37, 1832 }, { -83, -36, 1832 }, + { -83, -35, 1831 }, { -83, -34, 1831 }, { -82, -33, 1830 }, { -82, -31, 1829 }, { -82, -30, 1829 }, + { -82, -29, 1828 }, { -82, -28, 1828 }, { -82, -27, 1827 }, { -82, -26, 1827 }, { -82, -25, 1826 }, + { -81, -24, 1826 }, { -81, -23, 1825 }, { -81, -22, 1825 }, { -81, -21, 1824 }, { -81, -20, 1824 }, + { -81, -19, 1824 }, { -81, -18, 1823 }, { -81, -17, 1823 }, { -81, -16, 1822 }, { -81, -15, 1822 }, + { -80, -15, 1822 }, { -80, -14, 1821 }, { -80, -13, 1821 }, { -80, -12, 1821 }, { -80, -12, 1820 }, + { -80, -11, 1820 }, { -80, -10, 1820 }, { -80, -10, 1820 }, { -80, -9, 1819 }, { -80, -9, 1819 }, + { -80, -8, 1819 }, { -80, -8, 1819 }, { -80, -7, 1819 }, { -80, -7, 1818 }, { -80, -7, 1818 }, + { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, + { -80, -6, 1818 }, +}; + +struct AnimDataInfo anim_mario_lips_1[] = { + { ARRAY_COUNT(animdata_mario_lips_1_1), GD_ANIM_ROT3S, animdata_mario_lips_1_1 }, + { ARRAY_COUNT(animdata_mario_lips_1_2), GD_ANIM_ROT3S, animdata_mario_lips_1_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_mario_lips_2.c b/src/goddard/dynlists/anim_mario_lips_2.c new file mode 100644 index 00000000..eecd78dc --- /dev/null +++ b/src/goddard/dynlists/anim_mario_lips_2.c @@ -0,0 +1,264 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_lips_2_1[][3] = { + { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -4, -1773 }, + { -97, -4, -1773 }, { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, + { -97, -4, -1777 }, { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1780 }, + { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, + { -97, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1778 }, { -97, -4, -1777 }, + { -97, -4, -1774 }, { -97, -3, -1771 }, { -97, -2, -1764 }, { -97, 0, -1750 }, + { -97, 2, -1733 }, { -96, 5, -1714 }, { -96, 8, -1698 }, { -96, 10, -1686 }, + { -96, 11, -1681 }, { -96, 11, -1683 }, { -96, 10, -1690 }, { -96, 8, -1699 }, + { -96, 6, -1711 }, { -97, 4, -1723 }, { -97, 2, -1736 }, { -97, 0, -1748 }, + { -97, -1, -1759 }, { -97, -3, -1767 }, { -97, -3, -1771 }, { -97, -4, -1773 }, + { -97, -4, -1775 }, { -97, -4, -1777 }, { -97, -5, -1778 }, { -97, -5, -1779 }, + { -97, -5, -1780 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, + { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, + { -97, -5, -1780 }, { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -5, -1779 }, + { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1776 }, + { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1774 }, { -97, -4, -1773 }, + { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1773 }, { -97, -4, -1775 }, + { -97, -4, -1776 }, { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1777 }, + { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -5, -1778 }, + { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, + { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, + { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1777 }, + { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1773 }, + { -97, -3, -1772 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1773 }, { -97, -4, -1775 }, + { -97, -4, -1778 }, { -97, -5, -1781 }, { -97, -5, -1784 }, { -98, -6, -1788 }, + { -98, -7, -1791 }, { -98, -7, -1795 }, { -98, -8, -1799 }, { -98, -8, -1803 }, + { -98, -9, -1806 }, { -98, -9, -1809 }, { -99, -10, -1811 }, { -99, -10, -1813 }, + { -99, -10, -1814 }, { -99, -10, -1814 }, { -99, -10, -1813 }, { -99, -10, -1811 }, + { -98, -9, -1808 }, { -98, -9, -1804 }, { -98, -8, -1798 }, { -98, -7, -1791 }, + { -97, -5, -1782 }, { -97, -3, -1771 }, { -95, 3, -1728 }, { -91, 17, -1641 }, + { -87, 33, -1542 }, { -83, 46, -1460 }, { -82, 52, -1426 }, { -82, 50, -1438 }, + { -84, 45, -1470 }, { -86, 37, -1517 }, { -88, 28, -1573 }, { -91, 18, -1632 }, + { -93, 9, -1689 }, { -95, 1, -1737 }, { -97, -3, -1771 }, { -98, -7, -1792 }, + { -98, -9, -1804 }, { -99, -10, -1810 }, { -99, -10, -1811 }, { -99, -10, -1809 }, + { -99, -9, -1807 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -100, -9, -1805 }, { -100, -9, -1804 }, { -100, -9, -1804 }, + { -100, -9, -1803 }, { -100, -9, -1802 }, { -101, -9, -1801 }, { -101, -9, -1800 }, + { -101, -9, -1799 }, { -101, -8, -1798 }, { -102, -8, -1797 }, { -102, -8, -1796 }, + { -102, -8, -1795 }, { -102, -8, -1794 }, { -103, -8, -1793 }, { -103, -8, -1791 }, + { -103, -7, -1790 }, { -103, -7, -1789 }, { -103, -7, -1787 }, { -103, -7, -1786 }, + { -103, -7, -1785 }, { -103, -6, -1783 }, { -102, -6, -1782 }, { -102, -6, -1781 }, + { -102, -6, -1779 }, { -101, -5, -1778 }, { -101, -5, -1777 }, { -100, -5, -1776 }, + { -100, -4, -1775 }, { -99, -4, -1773 }, { -98, -4, -1772 }, { -97, -3, -1771 }, + { -95, -3, -1770 }, { -92, -2, -1769 }, { -88, -1, -1769 }, { -83, 0, -1768 }, + { -78, 0, -1767 }, { -72, 1, -1766 }, { -67, 2, -1765 }, { -62, 3, -1764 }, + { -57, 4, -1763 }, { -54, 5, -1762 }, { -51, 6, -1761 }, { -50, 6, -1759 }, + { -48, 6, -1758 }, { -47, 7, -1756 }, { -46, 7, -1754 }, { -45, 8, -1752 }, + { -45, 8, -1749 }, { -45, 8, -1747 }, { -45, 8, -1745 }, { -45, 8, -1743 }, + { -45, 8, -1741 }, { -46, 8, -1740 }, { -47, 8, -1739 }, { -48, 8, -1738 }, + { -49, 8, -1738 }, { -51, 8, -1738 }, { -54, 7, -1739 }, { -58, 6, -1742 }, + { -63, 5, -1745 }, { -68, 3, -1749 }, { -74, 2, -1754 }, { -80, 0, -1758 }, + { -86, 0, -1763 }, { -91, -2, -1767 }, { -94, -3, -1770 }, { -97, -3, -1771 }, + { -98, -4, -1772 }, { -100, -4, -1773 }, { -101, -4, -1774 }, { -102, -5, -1774 }, + { -103, -5, -1774 }, { -104, -5, -1774 }, { -104, -5, -1774 }, { -105, -5, -1773 }, + { -105, -5, -1773 }, { -105, -5, -1773 }, { -105, -5, -1772 }, { -104, -5, -1772 }, + { -104, -5, -1771 }, { -103, -5, -1771 }, { -102, -4, -1771 }, { -101, -4, -1771 }, + { -100, -4, -1771 }, { -99, -4, -1771 }, { -97, -3, -1771 }, { -92, -3, -1773 }, + { -84, -1, -1775 }, { -74, 0, -1777 }, { -64, 1, -1780 }, { -56, 3, -1782 }, + { -52, 3, -1784 }, { -50, 4, -1784 }, { -49, 4, -1784 }, { -48, 4, -1785 }, + { -47, 4, -1785 }, { -47, 4, -1785 }, { -46, 4, -1785 }, { -46, 4, -1785 }, + { -47, 4, -1785 }, { -47, 4, -1785 }, { -47, 4, -1785 }, { -48, 4, -1785 }, + { -48, 4, -1784 }, { -49, 4, -1784 }, { -49, 4, -1784 }, { -50, 4, -1784 }, + { -50, 4, -1784 }, { -51, 4, -1784 }, { -51, 4, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1785 }, { -52, 3, -1787 }, { -52, 3, -1791 }, { -52, 2, -1795 }, + { -52, 2, -1800 }, { -52, 2, -1803 }, { -52, 2, -1806 }, { -52, 1, -1807 }, + { -52, 2, -1806 }, { -52, 2, -1802 }, { -52, 2, -1795 }, { -52, 3, -1784 }, + { -51, 7, -1744 }, { -49, 13, -1674 }, { -47, 19, -1606 }, { -46, 22, -1572 }, + { -46, 22, -1570 }, { -45, 22, -1576 }, { -44, 21, -1589 }, { -44, 20, -1606 }, + { -44, 18, -1626 }, { -44, 16, -1648 }, { -45, 15, -1670 }, { -47, 12, -1691 }, + { -51, 10, -1709 }, { -58, 7, -1730 }, { -70, 2, -1755 }, { -84, -3, -1779 }, + { -94, -7, -1798 }, { -99, -9, -1805 }, { -100, -9, -1806 }, { -100, -9, -1807 }, + { -101, -10, -1808 }, { -101, -10, -1809 }, { -101, -10, -1810 }, { -102, -10, -1811 }, + { -102, -10, -1811 }, { -102, -10, -1812 }, { -103, -11, -1813 }, { -103, -11, -1813 }, + { -103, -11, -1814 }, { -104, -11, -1814 }, { -104, -11, -1815 }, { -104, -11, -1815 }, + { -104, -11, -1816 }, { -105, -11, -1816 }, { -105, -11, -1817 }, { -105, -12, -1817 }, + { -105, -12, -1817 }, { -105, -12, -1818 }, { -105, -12, -1818 }, { -106, -12, -1818 }, + { -106, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1818 }, { -105, -12, -1818 }, + { -105, -12, -1818 }, { -105, -12, -1817 }, { -105, -12, -1817 }, { -105, -12, -1817 }, + { -105, -11, -1817 }, { -105, -11, -1817 }, { -105, -11, -1816 }, { -104, -11, -1816 }, + { -104, -11, -1816 }, { -104, -11, -1815 }, { -104, -11, -1815 }, { -104, -11, -1815 }, + { -104, -11, -1815 }, { -104, -11, -1814 }, { -103, -11, -1814 }, { -103, -11, -1814 }, + { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1812 }, + { -102, -10, -1812 }, { -102, -10, -1812 }, { -102, -10, -1811 }, { -102, -10, -1811 }, + { -102, -10, -1811 }, { -102, -10, -1810 }, { -101, -10, -1810 }, { -101, -10, -1810 }, + { -101, -10, -1809 }, { -101, -10, -1809 }, { -101, -10, -1809 }, { -101, -10, -1809 }, + { -101, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1807 }, + { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, + { -100, -9, -1806 }, { -100, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1804 }, { -99, -9, -1804 }, { -99, -9, -1803 }, { -99, -9, -1803 }, + { -99, -9, -1802 }, { -99, -8, -1801 }, { -99, -8, -1801 }, { -99, -8, -1800 }, + { -99, -8, -1799 }, { -99, -8, -1799 }, { -99, -8, -1798 }, { -99, -8, -1797 }, + { -99, -8, -1796 }, { -98, -7, -1795 }, { -98, -7, -1794 }, { -98, -7, -1794 }, + { -98, -7, -1793 }, { -98, -7, -1792 }, { -98, -7, -1791 }, { -98, -7, -1790 }, + { -98, -6, -1789 }, { -98, -6, -1788 }, { -98, -6, -1787 }, { -98, -6, -1787 }, + { -98, -6, -1786 }, { -98, -6, -1785 }, { -98, -5, -1784 }, { -98, -5, -1783 }, + { -98, -5, -1782 }, { -98, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1780 }, + { -97, -5, -1779 }, { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1777 }, + { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1774 }, + { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1770 }, { -97, -3, -1770 }, + { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, + { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, +}; + +static s16 animdata_mario_lips_2_2[][3] = { + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1838 }, + { -96, -15, -1837 }, { -96, -14, -1836 }, { -96, -14, -1835 }, { -96, -14, -1834 }, + { -96, -14, -1832 }, { -96, -13, -1831 }, { -96, -13, -1829 }, { -96, -13, -1827 }, + { -96, -13, -1825 }, { -96, -12, -1824 }, { -96, -12, -1822 }, { -96, -12, -1820 }, + { -96, -11, -1818 }, { -96, -11, -1817 }, { -96, -11, -1815 }, { -96, -11, -1814 }, + { -96, -10, -1812 }, { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, + { -96, -9, -1805 }, { -96, -9, -1803 }, { -96, -8, -1800 }, { -96, -8, -1798 }, + { -96, -8, -1796 }, { -96, -7, -1794 }, { -96, -7, -1792 }, { -96, -7, -1790 }, + { -96, -6, -1788 }, { -96, -6, -1786 }, { -97, -6, -1784 }, { -97, -5, -1782 }, + { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -4, -1777 }, { -97, -4, -1776 }, + { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -3, -1772 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1772 }, { -97, -4, -1773 }, + { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, { -97, -4, -1777 }, + { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1781 }, { -97, -5, -1782 }, + { -96, -6, -1784 }, { -96, -6, -1786 }, { -96, -6, -1787 }, { -96, -6, -1789 }, + { -96, -7, -1790 }, { -96, -7, -1792 }, { -96, -7, -1794 }, { -96, -8, -1796 }, + { -96, -8, -1797 }, { -96, -8, -1799 }, { -96, -8, -1801 }, { -96, -9, -1802 }, + { -96, -9, -1804 }, { -96, -9, -1805 }, { -96, -9, -1807 }, { -96, -10, -1808 }, + { -96, -10, -1809 }, { -96, -10, -1810 }, { -96, -10, -1811 }, { -96, -10, -1812 }, + { -96, -11, -1813 }, { -96, -11, -1814 }, { -96, -11, -1815 }, { -96, -11, -1815 }, + { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, + { -96, -11, -1814 }, { -96, -11, -1814 }, { -96, -10, -1813 }, { -96, -10, -1812 }, + { -96, -10, -1811 }, { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, + { -96, -9, -1806 }, { -96, -9, -1804 }, { -96, -9, -1802 }, { -96, -8, -1801 }, + { -96, -8, -1799 }, { -96, -8, -1797 }, { -96, -7, -1795 }, { -96, -7, -1793 }, + { -96, -7, -1792 }, { -97, -7, -1790 }, { -97, -6, -1788 }, { -97, -6, -1786 }, + { -97, -6, -1784 }, { -97, -5, -1783 }, { -97, -5, -1781 }, { -97, -5, -1780 }, + { -97, -5, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, + { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, +}; + +struct AnimDataInfo anim_mario_lips_2[] = { + { ARRAY_COUNT(animdata_mario_lips_2_1), GD_ANIM_ROT3S, animdata_mario_lips_2_1 }, + { ARRAY_COUNT(animdata_mario_lips_2_2), GD_ANIM_ROT3S, animdata_mario_lips_2_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_mario_mustache_left.c b/src/goddard/dynlists/anim_mario_mustache_left.c new file mode 100644 index 00000000..b983235c --- /dev/null +++ b/src/goddard/dynlists/anim_mario_mustache_left.c @@ -0,0 +1,264 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_mustache_left_1[][3] = { + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1800, -1645, -292 }, { -1800, -1645, -291 }, + { -1800, -1645, -290 }, { -1800, -1645, -289 }, { -1801, -1645, -287 }, { -1801, -1645, -286 }, + { -1802, -1645, -284 }, { -1802, -1645, -283 }, { -1802, -1644, -281 }, { -1803, -1644, -280 }, + { -1803, -1644, -280 }, { -1803, -1644, -279 }, { -1803, -1644, -279 }, { -1803, -1644, -280 }, + { -1802, -1644, -281 }, { -1802, -1645, -283 }, { -1801, -1645, -285 }, { -1800, -1645, -289 }, + { -1799, -1645, -293 }, { -1796, -1645, -305 }, { -1790, -1646, -329 }, { -1782, -1646, -357 }, + { -1775, -1647, -385 }, { -1770, -1648, -405 }, { -1768, -1648, -412 }, { -1771, -1648, -402 }, + { -1777, -1647, -379 }, { -1785, -1647, -349 }, { -1793, -1646, -317 }, { -1800, -1645, -289 }, + { -1806, -1645, -269 }, { -1806, -1645, -269 }, { -1802, -1645, -284 }, { -1799, -1645, -293 }, + { -1799, -1645, -294 }, { -1799, -1645, -294 }, { -1799, -1645, -295 }, { -1799, -1645, -295 }, + { -1799, -1645, -295 }, { -1799, -1645, -296 }, { -1799, -1645, -296 }, { -1798, -1645, -296 }, + { -1798, -1645, -296 }, { -1798, -1645, -296 }, { -1798, -1645, -296 }, { -1798, -1645, -296 }, + { -1798, -1645, -296 }, { -1798, -1645, -296 }, { -1799, -1645, -296 }, { -1799, -1645, -296 }, + { -1799, -1645, -296 }, { -1799, -1645, -295 }, { -1799, -1645, -295 }, { -1799, -1645, -295 }, + { -1799, -1645, -295 }, { -1799, -1645, -295 }, { -1799, -1645, -294 }, { -1799, -1645, -294 }, + { -1799, -1645, -294 }, { -1799, -1645, -294 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1800, -1645, -292 }, { -1800, -1645, -289 }, + { -1801, -1645, -286 }, { -1802, -1645, -283 }, { -1803, -1644, -281 }, { -1802, -1644, -281 }, + { -1801, -1645, -285 }, { -1799, -1645, -293 }, { -1793, -1645, -317 }, { -1782, -1647, -358 }, + { -1772, -1648, -397 }, { -1766, -1648, -418 }, { -1765, -1648, -423 }, { -1764, -1649, -428 }, + { -1763, -1649, -432 }, { -1762, -1649, -435 }, { -1761, -1649, -438 }, { -1760, -1649, -440 }, + { -1760, -1649, -441 }, { -1760, -1649, -442 }, { -1760, -1649, -442 }, { -1760, -1649, -442 }, + { -1760, -1649, -441 }, { -1761, -1649, -439 }, { -1761, -1649, -437 }, { -1762, -1649, -434 }, + { -1763, -1649, -431 }, { -1764, -1649, -427 }, { -1765, -1648, -423 }, { -1766, -1648, -418 }, + { -1770, -1648, -405 }, { -1776, -1647, -381 }, { -1784, -1646, -352 }, { -1791, -1646, -324 }, + { -1797, -1645, -302 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, { -1799, -1645, -293 }, + { -1799, -1645, -295 }, { -1798, -1645, -298 }, { -1797, -1645, -301 }, { -1796, -1645, -306 }, + { -1795, -1645, -310 }, { -1793, -1645, -316 }, { -1792, -1645, -322 }, { -1790, -1645, -328 }, + { -1788, -1646, -334 }, { -1787, -1646, -341 }, { -1785, -1646, -347 }, { -1783, -1646, -354 }, + { -1781, -1646, -360 }, { -1780, -1646, -366 }, { -1778, -1646, -372 }, { -1777, -1646, -378 }, + { -1775, -1647, -383 }, { -1774, -1647, -387 }, { -1773, -1647, -391 }, { -1772, -1647, -394 }, + { -1772, -1647, -397 }, { -1771, -1647, -399 }, { -1771, -1647, -401 }, { -1770, -1647, -403 }, + { -1770, -1647, -404 }, { -1770, -1647, -405 }, { -1769, -1647, -405 }, { -1769, -1647, -405 }, + { -1769, -1647, -405 }, { -1770, -1647, -405 }, { -1770, -1647, -404 }, { -1770, -1647, -403 }, + { -1770, -1647, -401 }, { -1771, -1647, -399 }, { -1772, -1647, -397 }, { -1772, -1647, -394 }, + { -1773, -1647, -391 }, { -1774, -1647, -388 }, { -1775, -1647, -383 }, { -1776, -1646, -379 }, + { -1778, -1646, -373 }, { -1779, -1646, -368 }, { -1781, -1646, -362 }, { -1782, -1646, -356 }, + { -1784, -1646, -350 }, { -1786, -1646, -344 }, { -1787, -1646, -338 }, { -1789, -1646, -332 }, + { -1790, -1645, -326 }, { -1792, -1645, -320 }, { -1793, -1645, -315 }, { -1795, -1645, -310 }, + { -1796, -1645, -305 }, { -1797, -1645, -300 }, { -1798, -1645, -296 }, { -1799, -1645, -293 }, + { -1800, -1645, -290 }, { -1801, -1645, -288 }, { -1801, -1645, -287 }, { -1801, -1645, -286 }, + { -1801, -1645, -286 }, { -1801, -1645, -286 }, { -1801, -1645, -286 }, { -1801, -1645, -287 }, + { -1801, -1645, -288 }, { -1800, -1645, -289 }, { -1800, -1645, -290 }, { -1800, -1645, -292 }, + { -1799, -1645, -293 }, { -1799, -1645, -294 }, { -1798, -1645, -296 }, { -1798, -1645, -299 }, + { -1797, -1645, -301 }, { -1796, -1645, -304 }, { -1796, -1645, -307 }, { -1795, -1645, -310 }, + { -1794, -1645, -314 }, { -1793, -1645, -317 }, { -1792, -1645, -320 }, { -1791, -1645, -324 }, + { -1790, -1645, -327 }, { -1789, -1645, -330 }, { -1789, -1645, -333 }, { -1788, -1645, -336 }, + { -1787, -1645, -338 }, { -1787, -1645, -341 }, { -1786, -1645, -342 }, { -1786, -1645, -344 }, + { -1785, -1645, -345 }, { -1785, -1645, -345 }, { -1785, -1645, -345 }, { -1786, -1645, -344 }, + { -1786, -1645, -343 }, { -1787, -1645, -340 }, { -1791, -1645, -326 }, { -1799, -1646, -295 }, + { -1808, -1646, -258 }, { -1816, -1646, -228 }, { -1820, -1646, -216 }, { -1819, -1646, -220 }, + { -1816, -1646, -232 }, { -1811, -1646, -249 }, { -1806, -1646, -269 }, { -1800, -1646, -290 }, + { -1795, -1646, -311 }, { -1790, -1645, -328 }, { -1787, -1645, -340 }, { -1785, -1645, -348 }, + { -1784, -1645, -352 }, { -1783, -1645, -353 }, { -1783, -1645, -353 }, { -1783, -1645, -352 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -350 }, + { -1784, -1645, -350 }, { -1784, -1645, -349 }, { -1784, -1645, -349 }, { -1784, -1645, -349 }, + { -1785, -1645, -348 }, { -1785, -1645, -348 }, { -1785, -1645, -347 }, { -1785, -1645, -347 }, + { -1785, -1645, -346 }, { -1785, -1645, -346 }, { -1785, -1645, -345 }, { -1785, -1645, -345 }, + { -1786, -1645, -344 }, { -1786, -1645, -344 }, { -1786, -1645, -343 }, { -1786, -1645, -343 }, + { -1786, -1645, -342 }, { -1786, -1645, -342 }, { -1786, -1645, -342 }, { -1786, -1645, -341 }, + { -1787, -1645, -341 }, { -1787, -1645, -340 }, { -1787, -1645, -340 }, { -1787, -1645, -340 }, + { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, + { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, + { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, + { -1787, -1645, -340 }, { -1787, -1645, -340 }, { -1787, -1645, -340 }, { -1786, -1645, -342 }, + { -1786, -1645, -344 }, { -1785, -1646, -346 }, { -1784, -1646, -350 }, { -1783, -1646, -354 }, + { -1782, -1646, -358 }, { -1781, -1646, -362 }, { -1780, -1646, -367 }, { -1779, -1646, -371 }, + { -1778, -1646, -374 }, { -1777, -1646, -378 }, { -1776, -1647, -380 }, { -1776, -1647, -382 }, + { -1775, -1647, -383 }, { -1776, -1647, -382 }, { -1776, -1647, -379 }, { -1778, -1646, -373 }, + { -1780, -1646, -365 }, { -1783, -1646, -355 }, { -1785, -1646, -345 }, { -1788, -1645, -335 }, + { -1791, -1645, -325 }, { -1793, -1645, -318 }, { -1794, -1645, -313 }, { -1795, -1645, -311 }, + { -1794, -1645, -312 }, { -1793, -1645, -315 }, { -1792, -1645, -320 }, { -1791, -1645, -326 }, + { -1789, -1645, -333 }, { -1787, -1646, -341 }, { -1784, -1646, -349 }, { -1782, -1646, -357 }, + { -1780, -1646, -365 }, { -1778, -1646, -372 }, { -1777, -1647, -377 }, { -1776, -1647, -382 }, + { -1775, -1647, -386 }, { -1773, -1647, -390 }, { -1772, -1647, -394 }, { -1772, -1647, -396 }, + { -1772, -1647, -395 }, { -1773, -1647, -391 }, { -1776, -1647, -382 }, { -1780, -1646, -364 }, + { -1788, -1646, -336 }, { -1796, -1646, -304 }, { -1805, -1646, -273 }, { -1811, -1646, -250 }, + { -1814, -1645, -239 }, { -1814, -1645, -238 }, { -1814, -1645, -239 }, { -1813, -1645, -241 }, + { -1812, -1645, -244 }, { -1811, -1645, -248 }, { -1810, -1645, -253 }, { -1808, -1645, -259 }, + { -1807, -1645, -265 }, { -1805, -1645, -272 }, { -1803, -1645, -279 }, { -1801, -1645, -287 }, + { -1799, -1645, -294 }, { -1797, -1645, -301 }, { -1795, -1645, -308 }, { -1794, -1645, -315 }, + { -1792, -1645, -320 }, { -1791, -1645, -325 }, { -1790, -1645, -330 }, { -1789, -1645, -333 }, + { -1788, -1645, -335 }, { -1788, -1645, -336 }, { -1788, -1645, -337 }, { -1787, -1645, -338 }, + { -1787, -1645, -339 }, { -1787, -1645, -340 }, { -1787, -1645, -341 }, { -1786, -1645, -342 }, + { -1786, -1645, -343 }, { -1786, -1645, -343 }, { -1786, -1645, -344 }, { -1785, -1645, -345 }, + { -1785, -1645, -346 }, { -1785, -1645, -346 }, { -1785, -1645, -347 }, { -1785, -1645, -347 }, + { -1785, -1645, -348 }, { -1785, -1645, -348 }, { -1784, -1645, -349 }, { -1784, -1645, -349 }, + { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -352 }, + { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -352 }, + { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, + { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, + { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, { -1783, -1645, -352 }, + { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -352 }, + { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -352 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -350 }, + { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -350 }, + { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, + { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -351 }, { -1784, -1645, -350 }, + { -1784, -1645, -350 }, { -1784, -1645, -350 }, { -1784, -1645, -349 }, { -1784, -1645, -349 }, + { -1784, -1645, -348 }, { -1785, -1645, -348 }, { -1785, -1645, -347 }, { -1785, -1645, -347 }, + { -1785, -1645, -346 }, { -1785, -1645, -346 }, { -1785, -1645, -345 }, { -1786, -1645, -344 }, + { -1786, -1645, -344 }, { -1786, -1645, -343 }, { -1786, -1645, -343 }, { -1786, -1645, -342 }, + { -1786, -1645, -341 }, { -1787, -1645, -341 }, { -1787, -1645, -340 }, { -1787, -1645, -340 }, + { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -338 }, { -1787, -1645, -338 }, + { -1787, -1645, -337 }, { -1787, -1645, -337 }, { -1788, -1645, -337 }, { -1788, -1644, -337 }, + { -1788, -1644, -336 }, { -1788, -1644, -336 }, { -1788, -1644, -336 }, { -1788, -1644, -336 }, + { -1788, -1645, -337 }, { -1788, -1645, -337 }, { -1787, -1645, -337 }, { -1787, -1645, -338 }, + { -1787, -1645, -338 }, { -1787, -1645, -339 }, { -1787, -1645, -339 }, { -1787, -1645, -340 }, + { -1786, -1645, -341 }, { -1786, -1645, -342 }, { -1786, -1645, -343 }, { -1786, -1645, -344 }, + { -1785, -1645, -346 }, { -1785, -1645, -347 }, { -1784, -1645, -349 }, { -1784, -1645, -351 }, + { -1776, -1647, -379 }, { -1763, -1649, -430 }, { -1756, -1651, -458 }, { -1756, -1651, -457 }, + { -1756, -1650, -455 }, { -1757, -1650, -452 }, { -1758, -1650, -449 }, { -1759, -1650, -444 }, + { -1761, -1650, -439 }, { -1762, -1649, -433 }, { -1764, -1649, -427 }, { -1766, -1649, -420 }, + { -1768, -1648, -413 }, { -1769, -1648, -406 }, { -1771, -1648, -399 }, { -1773, -1647, -392 }, + { -1775, -1647, -385 }, { -1777, -1647, -378 }, { -1779, -1646, -371 }, { -1780, -1646, -365 }, + { -1782, -1646, -360 }, { -1783, -1645, -355 }, { -1784, -1645, -351 }, { -1783, -1645, -356 }, + { -1779, -1646, -369 }, { -1778, -1646, -375 }, { -1780, -1646, -364 }, { -1785, -1645, -348 }, + { -1787, -1645, -339 }, { -1784, -1645, -350 }, { -1779, -1646, -368 }, { -1778, -1646, -375 }, + { -1780, -1646, -366 }, { -1783, -1646, -353 }, { -1788, -1645, -337 }, { -1792, -1645, -320 }, + { -1796, -1645, -304 }, { -1800, -1645, -290 }, { -1803, -1645, -280 }, { -1805, -1645, -272 }, + { -1807, -1645, -263 }, { -1809, -1645, -255 }, { -1812, -1645, -247 }, { -1814, -1645, -239 }, + { -1816, -1645, -232 }, { -1817, -1645, -225 }, { -1819, -1645, -219 }, { -1820, -1645, -214 }, + { -1821, -1645, -211 }, { -1822, -1645, -209 }, { -1822, -1646, -209 }, { -1821, -1646, -210 }, + { -1820, -1646, -214 }, { -1818, -1646, -221 }, { -1816, -1646, -232 }, { -1812, -1646, -246 }, + { -1807, -1646, -262 }, { -1803, -1647, -281 }, { -1797, -1647, -300 }, { -1792, -1647, -320 }, + { -1787, -1647, -340 }, { -1782, -1647, -359 }, { -1777, -1648, -377 }, { -1773, -1648, -393 }, + { -1769, -1648, -406 }, { -1767, -1648, -416 }, { -1765, -1648, -421 }, { -1765, -1648, -422 }, + { -1766, -1648, -417 }, { -1769, -1648, -406 }, { -1774, -1648, -389 }, { -1779, -1648, -368 }, + { -1786, -1648, -344 }, { -1793, -1648, -318 }, { -1800, -1648, -292 }, { -1807, -1648, -265 }, + { -1814, -1648, -239 }, { -1820, -1648, -216 }, { -1825, -1648, -196 }, { -1829, -1648, -180 }, + { -1832, -1648, -170 }, { -1833, -1648, -167 }, { -1832, -1648, -170 }, { -1830, -1648, -179 }, + { -1826, -1648, -193 }, { -1821, -1648, -211 }, { -1815, -1648, -233 }, { -1809, -1648, -257 }, + { -1802, -1648, -282 }, { -1796, -1648, -307 }, { -1789, -1648, -332 }, { -1783, -1648, -356 }, + { -1777, -1648, -377 }, { -1772, -1648, -395 }, { -1768, -1648, -410 }, { -1766, -1648, -419 }, + { -1765, -1648, -422 }, { -1766, -1648, -418 }, { -1769, -1648, -408 }, { -1773, -1648, -392 }, + { -1778, -1648, -371 }, { -1785, -1648, -348 }, { -1792, -1648, -322 }, { -1799, -1648, -294 }, + { -1806, -1648, -267 }, { -1813, -1648, -241 }, { -1819, -1648, -217 }, { -1825, -1648, -197 }, + { -1829, -1648, -181 }, { -1832, -1648, -170 }, { -1833, -1648, -167 }, { -1832, -1648, -171 }, + { -1828, -1648, -183 }, { -1824, -1648, -201 }, { -1818, -1648, -224 }, { -1810, -1648, -251 }, + { -1803, -1648, -280 }, { -1795, -1648, -309 }, { -1787, -1648, -338 }, { -1780, -1648, -364 }, + { -1774, -1648, -388 }, { -1769, -1648, -406 }, { -1766, -1648, -418 }, { -1765, -1648, -422 }, + { -1766, -1648, -419 }, { -1768, -1648, -410 }, { -1772, -1648, -397 }, { -1776, -1648, -379 }, + { -1782, -1648, -358 }, { -1788, -1648, -335 }, { -1795, -1648, -311 }, { -1801, -1648, -286 }, + { -1808, -1648, -261 }, { -1814, -1648, -238 }, { -1820, -1648, -216 }, { -1825, -1648, -198 }, + { -1829, -1648, -182 }, { -1831, -1648, -172 }, { -1833, -1648, -167 }, { -1833, -1648, -166 }, + { -1832, -1648, -170 }, { -1830, -1648, -176 }, { -1828, -1647, -185 }, { -1825, -1647, -197 }, + { -1821, -1647, -210 }, { -1817, -1647, -224 }, { -1813, -1647, -240 }, { -1809, -1647, -256 }, + { -1805, -1646, -272 }, { -1801, -1646, -288 }, { -1797, -1646, -303 }, { -1793, -1646, -317 }, + { -1790, -1646, -329 }, { -1787, -1646, -339 }, { -1785, -1645, -346 }, { -1784, -1645, -351 }, + { -1783, -1645, -353 }, { -1783, -1645, -355 }, { -1782, -1645, -356 }, { -1782, -1645, -356 }, + { -1782, -1645, -356 }, { -1783, -1645, -356 }, { -1783, -1645, -354 }, { -1783, -1645, -353 }, + { -1784, -1645, -351 }, { -1785, -1645, -348 }, { -1785, -1645, -346 }, { -1786, -1645, -343 }, + { -1787, -1645, -339 }, { -1788, -1645, -336 }, { -1789, -1645, -332 }, { -1790, -1645, -329 }, + { -1791, -1645, -325 }, { -1792, -1645, -321 }, { -1793, -1645, -317 }, { -1794, -1645, -314 }, + { -1795, -1645, -310 }, { -1796, -1645, -307 }, { -1796, -1645, -304 }, { -1797, -1645, -301 }, + { -1798, -1645, -298 }, { -1798, -1645, -296 }, { -1799, -1645, -294 }, { -1799, -1645, -293 }, + { -1800, -1645, -292 }, { -1800, -1645, -291 }, { -1800, -1645, -291 }, { -1800, -1645, -292 }, + { -1799, -1645, -292 }, { -1799, -1645, -293 }, { -1799, -1645, -294 }, { -1799, -1645, -295 }, + { -1798, -1645, -296 }, { -1798, -1645, -297 }, { -1798, -1645, -298 }, { -1798, -1645, -299 }, + { -1798, -1645, -299 }, { -1797, -1645, -300 }, { -1797, -1645, -300 }, { -1798, -1645, -299 }, + { -1798, -1645, -299 }, { -1798, -1645, -297 }, { -1799, -1645, -295 }, { -1799, -1645, -293 }, + { -1801, -1645, -288 }, { -1803, -1645, -281 }, { -1805, -1645, -271 }, { -1808, -1645, -260 }, + { -1811, -1646, -248 }, { -1814, -1646, -236 }, { -1817, -1646, -225 }, { -1820, -1646, -216 }, + { -1822, -1646, -208 }, { -1823, -1647, -204 }, { -1823, -1647, -204 }, { -1822, -1647, -207 }, + { -1821, -1647, -212 }, { -1819, -1647, -219 }, { -1817, -1646, -227 }, { -1814, -1646, -237 }, + { -1811, -1646, -247 }, { -1808, -1646, -258 }, { -1805, -1646, -270 }, { -1802, -1646, -282 }, + { -1799, -1646, -293 }, { -1796, -1646, -304 }, { -1794, -1646, -314 }, { -1791, -1646, -323 }, + { -1789, -1645, -331 }, { -1788, -1645, -337 }, { -1787, -1645, -340 }, { -1787, -1645, -339 }, + { -1789, -1645, -331 }, { -1793, -1645, -318 }, { -1797, -1645, -303 }, { -1801, -1645, -288 }, + { -1804, -1645, -276 }, { -1806, -1645, -269 }, { -1807, -1645, -265 }, { -1808, -1645, -262 }, + { -1808, -1645, -259 }, { -1809, -1645, -256 }, { -1810, -1645, -253 }, { -1811, -1645, -251 }, + { -1811, -1645, -248 }, { -1812, -1645, -246 }, { -1812, -1645, -244 }, { -1813, -1645, -242 }, + { -1813, -1645, -241 }, { -1814, -1645, -239 }, { -1814, -1645, -238 }, { -1814, -1645, -237 }, + { -1815, -1645, -235 }, { -1815, -1646, -234 }, { -1815, -1646, -233 }, { -1816, -1646, -232 }, + { -1816, -1646, -231 }, { -1816, -1646, -230 }, { -1816, -1646, -229 }, { -1817, -1646, -228 }, + { -1817, -1646, -227 }, { -1817, -1646, -226 }, { -1817, -1646, -226 }, { -1817, -1646, -226 }, + { -1817, -1646, -227 }, { -1817, -1646, -227 }, { -1817, -1646, -228 }, { -1816, -1646, -228 }, + { -1816, -1646, -229 }, { -1816, -1646, -229 }, { -1816, -1646, -229 }, { -1816, -1646, -229 }, + { -1816, -1646, -229 }, { -1817, -1646, -228 }, { -1817, -1646, -226 }, { -1818, -1646, -224 }, + { -1818, -1646, -223 }, { -1819, -1646, -221 }, { -1819, -1646, -218 }, { -1820, -1646, -216 }, + { -1820, -1646, -214 }, { -1821, -1646, -211 }, { -1822, -1647, -209 }, { -1822, -1647, -206 }, + { -1823, -1647, -203 }, { -1824, -1647, -201 }, { -1824, -1647, -198 }, { -1825, -1647, -195 }, + { -1826, -1647, -193 }, { -1827, -1647, -190 }, { -1827, -1647, -188 }, { -1828, -1648, -185 }, + { -1829, -1648, -183 }, { -1829, -1648, -181 }, { -1830, -1648, -178 }, { -1830, -1648, -176 }, + { -1831, -1648, -175 }, { -1831, -1648, -173 }, { -1831, -1648, -172 }, { -1832, -1648, -170 }, + { -1832, -1648, -169 }, { -1832, -1648, -169 }, { -1832, -1648, -168 }, { -1832, -1648, -168 }, + { -1832, -1648, -168 }, { -1832, -1648, -169 }, { -1832, -1648, -170 }, { -1832, -1648, -171 }, + { -1831, -1648, -173 }, { -1831, -1648, -174 }, { -1830, -1648, -177 }, { -1830, -1648, -179 }, + { -1829, -1648, -181 }, { -1828, -1648, -184 }, { -1827, -1647, -187 }, { -1827, -1647, -190 }, + { -1826, -1647, -193 }, { -1825, -1647, -196 }, { -1824, -1647, -199 }, { -1823, -1647, -202 }, + { -1823, -1647, -205 }, { -1822, -1647, -208 }, { -1821, -1646, -212 }, { -1820, -1646, -215 }, + { -1819, -1646, -217 }, { -1819, -1646, -220 }, { -1818, -1646, -223 }, { -1817, -1646, -225 }, + { -1817, -1646, -228 }, { -1816, -1646, -228 }, { -1817, -1646, -228 }, { -1817, -1646, -228 }, + { -1817, -1646, -226 }, { -1817, -1646, -228 }, { -1815, -1646, -234 }, { -1813, -1646, -241 }, + { -1811, -1645, -250 }, { -1809, -1645, -258 }, { -1806, -1645, -267 }, { -1804, -1645, -275 }, + { -1802, -1645, -282 }, { -1801, -1645, -288 }, { -1800, -1645, -292 }, { -1799, -1645, -293 }, +}; + +static s16 animdata_mario_mustache_left_2[][3] = { + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, + { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1756, -1651, -459 }, { -1754, -1651, -464 }, + { -1753, -1652, -469 }, { -1756, -1652, -459 }, { -1770, -1648, -404 }, { -1783, -1646, -352 }, + { -1787, -1645, -340 }, { -1789, -1645, -330 }, { -1792, -1645, -321 }, { -1793, -1645, -315 }, + { -1795, -1645, -310 }, { -1795, -1645, -308 }, { -1795, -1645, -308 }, { -1795, -1645, -310 }, + { -1793, -1646, -315 }, { -1790, -1646, -326 }, { -1786, -1647, -345 }, { -1779, -1648, -368 }, + { -1773, -1649, -393 }, { -1766, -1649, -418 }, { -1761, -1650, -439 }, { -1757, -1651, -454 }, + { -1756, -1651, -459 }, { -1756, -1651, -458 }, { -1756, -1651, -456 }, { -1757, -1651, -453 }, + { -1758, -1651, -449 }, { -1760, -1650, -444 }, { -1761, -1650, -438 }, { -1763, -1650, -432 }, + { -1765, -1650, -425 }, { -1767, -1649, -417 }, { -1769, -1649, -410 }, { -1771, -1649, -402 }, + { -1773, -1649, -394 }, { -1775, -1648, -386 }, { -1777, -1648, -378 }, { -1779, -1648, -371 }, + { -1780, -1647, -365 }, { -1782, -1647, -358 }, { -1783, -1647, -355 }, { -1787, -1647, -341 }, + { -1791, -1647, -325 }, { -1795, -1647, -308 }, { -1800, -1648, -291 }, { -1804, -1648, -273 }, + { -1809, -1648, -256 }, { -1813, -1648, -240 }, { -1817, -1648, -225 }, { -1821, -1648, -212 }, + { -1823, -1648, -201 }, { -1825, -1648, -194 }, { -1827, -1648, -189 }, { -1827, -1648, -187 }, + { -1828, -1649, -185 }, { -1828, -1649, -182 }, { -1829, -1649, -180 }, { -1829, -1649, -179 }, + { -1830, -1649, -177 }, { -1830, -1649, -175 }, { -1831, -1649, -174 }, { -1831, -1649, -172 }, + { -1831, -1649, -171 }, { -1832, -1649, -170 }, { -1832, -1649, -169 }, { -1832, -1649, -168 }, + { -1832, -1649, -167 }, { -1833, -1649, -166 }, { -1833, -1649, -166 }, { -1833, -1649, -165 }, + { -1833, -1649, -165 }, { -1833, -1649, -164 }, { -1833, -1649, -164 }, { -1833, -1649, -164 }, + { -1833, -1649, -164 }, { -1833, -1649, -164 }, { -1833, -1649, -164 }, { -1833, -1649, -164 }, + { -1833, -1649, -164 }, { -1833, -1649, -164 }, { -1833, -1649, -165 }, { -1833, -1649, -165 }, + { -1833, -1649, -165 }, { -1833, -1649, -166 }, { -1833, -1649, -167 }, { -1832, -1649, -167 }, + { -1832, -1649, -168 }, { -1832, -1649, -169 }, { -1832, -1649, -169 }, { -1832, -1649, -170 }, + { -1831, -1649, -171 }, { -1831, -1649, -172 }, { -1831, -1649, -173 }, { -1831, -1649, -174 }, + { -1830, -1649, -175 }, { -1830, -1649, -176 }, { -1830, -1649, -177 }, { -1830, -1649, -178 }, + { -1829, -1649, -179 }, { -1829, -1649, -180 }, { -1829, -1649, -181 }, { -1828, -1649, -182 }, + { -1828, -1649, -184 }, { -1828, -1649, -185 }, { -1827, -1649, -186 }, { -1827, -1649, -187 }, + { -1827, -1649, -188 }, { -1827, -1648, -189 }, { -1826, -1648, -191 }, { -1826, -1648, -192 }, + { -1825, -1648, -194 }, { -1825, -1648, -196 }, { -1824, -1648, -199 }, { -1823, -1648, -202 }, + { -1822, -1648, -205 }, { -1822, -1648, -208 }, { -1821, -1648, -211 }, { -1820, -1648, -215 }, + { -1819, -1647, -218 }, { -1818, -1647, -222 }, { -1817, -1647, -226 }, { -1816, -1647, -230 }, + { -1815, -1647, -234 }, { -1814, -1647, -238 }, { -1813, -1647, -242 }, { -1812, -1646, -246 }, + { -1811, -1646, -250 }, { -1809, -1646, -254 }, { -1808, -1646, -258 }, { -1807, -1646, -262 }, + { -1806, -1646, -266 }, { -1806, -1646, -269 }, { -1805, -1646, -272 }, { -1804, -1645, -276 }, + { -1803, -1645, -279 }, { -1802, -1645, -281 }, { -1802, -1645, -284 }, { -1801, -1645, -286 }, + { -1801, -1645, -288 }, { -1800, -1645, -290 }, { -1800, -1645, -291 }, { -1800, -1645, -292 }, + { -1799, -1645, -293 }, { -1799, -1645, -293 }, +}; + +struct AnimDataInfo anim_mario_mustache_left[] = { + { ARRAY_COUNT(animdata_mario_mustache_left_1), GD_ANIM_ROT3S, animdata_mario_mustache_left_1 }, + { ARRAY_COUNT(animdata_mario_mustache_left_2), GD_ANIM_ROT3S, animdata_mario_mustache_left_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/anim_mario_mustache_right.c b/src/goddard/dynlists/anim_mario_mustache_right.c new file mode 100644 index 00000000..e5ae9403 --- /dev/null +++ b/src/goddard/dynlists/anim_mario_mustache_right.c @@ -0,0 +1,215 @@ +#include + +#include "macros.h" +#include "animdata.h" +#include "../gd_types.h" + +static s16 animdata_mario_mustache_right_1[][3] = { + { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1507 }, { 0, 154, 1508 }, { 0, 154, 1510 }, + { 1, 154, 1511 }, { 1, 154, 1513 }, { 2, 154, 1515 }, { 2, 155, 1517 }, { 3, 155, 1518 }, + { 3, 155, 1520 }, { 3, 155, 1521 }, { 4, 155, 1522 }, { 4, 155, 1522 }, { 4, 155, 1522 }, + { 4, 155, 1522 }, { 3, 155, 1520 }, { 3, 155, 1518 }, { 2, 154, 1515 }, { 1, 154, 1511 }, + { 0, 154, 1506 }, { -3, 154, 1491 }, { -11, 153, 1463 }, { -20, 152, 1429 }, { -28, 151, 1396 }, + { -35, 150, 1372 }, { -37, 150, 1364 }, { -34, 150, 1375 }, { -27, 151, 1401 }, { -18, 151, 1436 }, + { -8, 152, 1474 }, { 0, 153, 1507 }, { 6, 154, 1530 }, { 6, 154, 1531 }, { 2, 154, 1516 }, + { 0, 154, 1506 }, { 0, 154, 1505 }, { 0, 154, 1505 }, { 0, 154, 1504 }, { 0, 154, 1504 }, + { 0, 154, 1504 }, { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, + { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, + { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1503 }, { 0, 154, 1504 }, { 0, 154, 1504 }, + { 0, 154, 1504 }, { 0, 154, 1504 }, { 0, 154, 1504 }, { 0, 154, 1505 }, { 0, 154, 1505 }, + { 0, 154, 1505 }, { 0, 154, 1505 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, + { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, + { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, + { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1506 }, + { 0, 154, 1506 }, { 0, 154, 1506 }, { 0, 154, 1507 }, { 0, 154, 1509 }, { 1, 154, 1511 }, + { 1, 154, 1513 }, { 2, 154, 1514 }, { 2, 154, 1514 }, { 1, 154, 1511 }, { 0, 154, 1506 }, + { -4, 154, 1490 }, { -11, 153, 1463 }, { -18, 153, 1437 }, { -22, 153, 1423 }, { -23, 153, 1419 }, + { -23, 153, 1416 }, { -24, 152, 1414 }, { -25, 152, 1411 }, { -25, 152, 1410 }, { -26, 152, 1408 }, + { -26, 152, 1407 }, { -26, 152, 1407 }, { -26, 152, 1407 }, { -26, 152, 1407 }, { -26, 152, 1408 }, + { -25, 152, 1409 }, { -25, 152, 1410 }, { -25, 152, 1412 }, { -24, 152, 1414 }, { -23, 153, 1417 }, + { -22, 153, 1420 }, { -22, 153, 1423 }, { -19, 153, 1432 }, { -15, 153, 1448 }, { -10, 153, 1468 }, + { -5, 154, 1487 }, { -1, 154, 1501 }, { 0, 154, 1506 }, { 0, 154, 1505 }, { 0, 154, 1503 }, + { -1, 154, 1501 }, { -2, 154, 1497 }, { -3, 154, 1494 }, { -4, 154, 1489 }, { -5, 154, 1484 }, + { -7, 154, 1479 }, { -8, 154, 1474 }, { -10, 153, 1468 }, { -11, 153, 1462 }, { -13, 153, 1456 }, + { -14, 153, 1450 }, { -16, 153, 1444 }, { -18, 153, 1438 }, { -19, 153, 1433 }, { -20, 153, 1427 }, + { -22, 152, 1422 }, { -23, 152, 1417 }, { -24, 152, 1413 }, { -25, 152, 1410 }, { -26, 152, 1407 }, + { -27, 152, 1404 }, { -27, 152, 1402 }, { -28, 152, 1400 }, { -28, 152, 1399 }, { -28, 152, 1398 }, + { -29, 152, 1397 }, { -29, 152, 1396 }, { -29, 152, 1396 }, { -29, 152, 1396 }, { -29, 152, 1397 }, + { -28, 152, 1397 }, { -28, 152, 1399 }, { -28, 152, 1400 }, { -27, 152, 1402 }, { -27, 152, 1404 }, + { -26, 152, 1407 }, { -25, 152, 1410 }, { -24, 152, 1413 }, { -23, 152, 1418 }, { -22, 152, 1422 }, + { -20, 153, 1427 }, { -19, 153, 1433 }, { -18, 153, 1438 }, { -16, 153, 1444 }, { -14, 153, 1450 }, + { -13, 153, 1456 }, { -11, 153, 1462 }, { -10, 153, 1468 }, { -8, 154, 1474 }, { -7, 154, 1479 }, + { -5, 154, 1485 }, { -4, 154, 1490 }, { -3, 154, 1495 }, { -1, 154, 1499 }, { 0, 154, 1503 }, + { 0, 154, 1506 }, { 0, 154, 1509 }, { 1, 154, 1511 }, { 1, 154, 1512 }, { 1, 154, 1513 }, + { 2, 154, 1514 }, { 2, 154, 1514 }, { 1, 154, 1513 }, { 1, 154, 1513 }, { 1, 154, 1512 }, + { 1, 154, 1510 }, { 0, 154, 1509 }, { 0, 154, 1508 }, { 0, 154, 1506 }, { 0, 154, 1504 }, + { -1, 154, 1502 }, { -1, 154, 1500 }, { -2, 154, 1497 }, { -3, 154, 1493 }, { -4, 154, 1490 }, + { -5, 154, 1487 }, { -6, 154, 1483 }, { -7, 154, 1479 }, { -8, 154, 1475 }, { -9, 154, 1471 }, + { -10, 154, 1468 }, { -11, 154, 1464 }, { -12, 154, 1461 }, { -12, 154, 1457 }, { -13, 154, 1454 }, + { -14, 154, 1452 }, { -15, 154, 1449 }, { -15, 154, 1447 }, { -16, 154, 1446 }, { -16, 154, 1445 }, + { -16, 153, 1444 }, { -16, 153, 1444 }, { -16, 153, 1445 }, { -15, 153, 1447 }, { -12, 153, 1460 }, + { -4, 153, 1488 }, { 3, 153, 1521 }, { 11, 154, 1548 }, { 14, 154, 1560 }, { 13, 154, 1556 }, + { 10, 154, 1545 }, { 6, 154, 1530 }, { 1, 153, 1511 }, { -3, 153, 1492 }, { -8, 153, 1473 }, + { -12, 153, 1458 }, { -15, 153, 1447 }, { -17, 153, 1440 }, { -18, 153, 1437 }, { -18, 153, 1435 }, + { -18, 153, 1435 }, { -18, 153, 1436 }, { -18, 153, 1437 }, { -18, 153, 1437 }, { -18, 153, 1437 }, + { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, + { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1440 }, { -17, 153, 1440 }, + { -17, 153, 1441 }, { -17, 154, 1441 }, { -17, 154, 1442 }, { -17, 154, 1442 }, { -16, 154, 1443 }, + { -16, 154, 1443 }, { -16, 154, 1444 }, { -16, 154, 1444 }, { -16, 154, 1445 }, { -16, 154, 1445 }, + { -16, 154, 1446 }, { -15, 154, 1446 }, { -15, 154, 1447 }, { -15, 154, 1447 }, { -15, 154, 1448 }, + { -15, 154, 1448 }, { -15, 154, 1449 }, { -15, 154, 1449 }, { -15, 154, 1449 }, { -15, 154, 1449 }, + { -15, 154, 1450 }, { -15, 154, 1450 }, { -14, 154, 1450 }, { -14, 154, 1450 }, { -14, 154, 1450 }, + { -14, 154, 1450 }, { -15, 154, 1450 }, { -15, 154, 1450 }, { -15, 154, 1449 }, { -15, 154, 1449 }, + { -15, 153, 1448 }, { -15, 153, 1448 }, { -15, 153, 1447 }, { -15, 153, 1447 }, { -16, 153, 1445 }, + { -16, 153, 1443 }, { -17, 153, 1439 }, { -19, 153, 1435 }, { -20, 153, 1430 }, { -21, 153, 1424 }, + { -23, 152, 1419 }, { -24, 152, 1413 }, { -26, 152, 1408 }, { -27, 152, 1403 }, { -28, 152, 1399 }, + { -29, 151, 1396 }, { -29, 151, 1394 }, { -30, 151, 1393 }, { -29, 151, 1393 }, { -28, 151, 1397 }, + { -27, 152, 1404 }, { -24, 152, 1414 }, { -21, 152, 1426 }, { -17, 153, 1439 }, { -14, 153, 1452 }, + { -11, 153, 1464 }, { -8, 154, 1473 }, { -7, 154, 1480 }, { -6, 154, 1482 }, { -6, 154, 1481 }, + { -7, 154, 1478 }, { -9, 154, 1472 }, { -10, 154, 1465 }, { -13, 153, 1457 }, { -15, 153, 1448 }, + { -18, 153, 1438 }, { -20, 153, 1429 }, { -22, 152, 1420 }, { -25, 152, 1411 }, { -26, 152, 1405 }, + { -28, 152, 1399 }, { -29, 152, 1395 }, { -30, 151, 1391 }, { -31, 151, 1388 }, { -31, 151, 1387 }, + { -31, 151, 1388 }, { -30, 151, 1392 }, { -28, 152, 1399 }, { -24, 152, 1414 }, { -18, 152, 1437 }, + { -11, 153, 1464 }, { -4, 154, 1489 }, { 0, 154, 1509 }, { 3, 154, 1518 }, { 3, 154, 1520 }, + { 3, 154, 1520 }, { 3, 154, 1520 }, { 3, 154, 1518 }, { 2, 154, 1516 }, { 1, 154, 1513 }, + { 0, 154, 1509 }, { 0, 154, 1505 }, { -1, 154, 1501 }, { -2, 154, 1496 }, { -3, 154, 1491 }, + { -5, 154, 1486 }, { -6, 154, 1481 }, { -7, 154, 1477 }, { -8, 154, 1472 }, { -10, 154, 1468 }, + { -10, 154, 1465 }, { -11, 154, 1462 }, { -12, 154, 1460 }, { -12, 154, 1459 }, { -12, 154, 1458 }, + { -13, 154, 1457 }, { -13, 154, 1456 }, { -13, 154, 1455 }, { -13, 154, 1455 }, { -13, 154, 1454 }, + { -14, 154, 1453 }, { -14, 154, 1452 }, { -14, 154, 1452 }, { -14, 154, 1451 }, { -14, 154, 1451 }, + { -14, 154, 1450 }, { -15, 154, 1449 }, { -15, 154, 1449 }, { -15, 154, 1448 }, { -15, 154, 1448 }, + { -15, 154, 1447 }, { -15, 154, 1447 }, { -15, 154, 1447 }, { -15, 154, 1446 }, { -16, 154, 1446 }, + { -16, 154, 1445 }, { -16, 154, 1445 }, { -16, 154, 1445 }, { -16, 154, 1444 }, { -16, 154, 1444 }, + { -16, 154, 1444 }, { -16, 154, 1444 }, { -16, 154, 1443 }, { -16, 154, 1443 }, { -16, 154, 1443 }, + { -16, 154, 1443 }, { -16, 154, 1442 }, { -17, 154, 1442 }, { -17, 154, 1442 }, { -17, 154, 1442 }, + { -17, 153, 1442 }, { -17, 153, 1441 }, { -17, 153, 1441 }, { -17, 153, 1441 }, { -17, 153, 1441 }, + { -17, 153, 1441 }, { -17, 153, 1441 }, { -17, 153, 1441 }, { -17, 153, 1440 }, { -17, 153, 1440 }, + { -17, 153, 1440 }, { -17, 153, 1440 }, { -17, 153, 1440 }, { -17, 153, 1440 }, { -17, 153, 1440 }, + { -17, 153, 1440 }, { -17, 153, 1440 }, { -17, 153, 1440 }, { -17, 153, 1439 }, { -17, 153, 1439 }, + { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1439 }, + { -17, 153, 1439 }, { -17, 153, 1439 }, { -17, 153, 1439 }, { -18, 153, 1439 }, { -18, 153, 1438 }, + { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, + { -18, 153, 1438 }, { -18, 153, 1437 }, { -18, 153, 1437 }, { -18, 153, 1437 }, { -18, 153, 1437 }, + { -18, 153, 1437 }, { -18, 153, 1437 }, { -18, 153, 1438 }, { -18, 153, 1438 }, { -18, 153, 1438 }, + { -18, 154, 1438 }, { -17, 154, 1439 }, { -17, 154, 1439 }, { -17, 154, 1440 }, { -17, 154, 1440 }, + { -17, 154, 1441 }, { -17, 154, 1441 }, { -17, 154, 1442 }, { -17, 154, 1442 }, { -16, 154, 1443 }, + { -16, 154, 1443 }, { -16, 154, 1444 }, { -16, 154, 1444 }, { -16, 154, 1445 }, { -16, 154, 1446 }, + { -16, 154, 1446 }, { -15, 154, 1447 }, { -15, 154, 1447 }, { -15, 154, 1448 }, { -15, 154, 1448 }, + { -15, 154, 1448 }, { -15, 154, 1449 }, { -15, 154, 1449 }, { -15, 154, 1449 }, { -15, 154, 1450 }, + { -15, 154, 1450 }, { -15, 154, 1450 }, { -14, 154, 1450 }, { -14, 154, 1450 }, { -14, 154, 1450 }, + { -15, 154, 1450 }, { -15, 154, 1450 }, { -15, 154, 1450 }, { -15, 154, 1449 }, { -15, 154, 1449 }, + { -15, 154, 1448 }, { -15, 154, 1448 }, { -15, 154, 1447 }, { -16, 154, 1446 }, { -16, 154, 1445 }, + { -16, 154, 1444 }, { -16, 154, 1443 }, { -17, 154, 1442 }, { -17, 154, 1441 }, { -17, 154, 1439 }, + { -18, 153, 1437 }, { -24, 152, 1412 }, { -36, 150, 1367 }, { -43, 148, 1343 }, { -42, 149, 1343 }, + { -42, 149, 1345 }, { -41, 149, 1348 }, { -40, 149, 1351 }, { -39, 149, 1355 }, { -38, 149, 1360 }, + { -36, 150, 1366 }, { -35, 150, 1372 }, { -33, 150, 1378 }, { -32, 151, 1385 }, { -30, 151, 1392 }, + { -28, 151, 1398 }, { -26, 152, 1405 }, { -25, 152, 1411 }, { -23, 152, 1417 }, { -22, 153, 1422 }, + { -20, 153, 1427 }, { -19, 153, 1431 }, { -18, 153, 1435 }, { -18, 153, 1437 }, { -21, 153, 1426 }, + { -27, 152, 1404 }, { -30, 151, 1390 }, { -28, 152, 1398 }, { -24, 153, 1415 }, { -21, 153, 1426 }, + { -23, 153, 1416 }, { -28, 152, 1400 }, { -29, 152, 1396 }, { -26, 152, 1407 }, { -22, 152, 1423 }, + { -17, 153, 1441 }, { -11, 153, 1461 }, { -6, 154, 1480 }, { -2, 154, 1496 }, { 0, 154, 1509 }, + { 3, 154, 1519 }, { 6, 154, 1529 }, { 9, 154, 1540 }, { 11, 154, 1551 }, { 14, 154, 1561 }, + { 17, 154, 1571 }, { 19, 154, 1580 }, { 21, 154, 1588 }, { 23, 154, 1595 }, { 24, 153, 1600 }, + { 25, 153, 1603 }, { 25, 153, 1604 }, { 25, 153, 1602 }, { 24, 153, 1598 }, { 22, 152, 1590 }, + { 18, 152, 1577 }, { 14, 152, 1560 }, { 9, 151, 1540 }, { 3, 151, 1518 }, { -3, 151, 1494 }, + { -9, 150, 1470 }, { -15, 150, 1445 }, { -22, 150, 1422 }, { -27, 149, 1400 }, { -33, 149, 1381 }, + { -37, 149, 1364 }, { -40, 149, 1352 }, { -42, 149, 1345 }, { -43, 148, 1343 }, { -41, 148, 1348 }, + { -38, 149, 1360 }, { -33, 149, 1378 }, { -27, 149, 1401 }, { -20, 149, 1428 }, { -12, 149, 1457 }, + { -4, 150, 1487 }, { 2, 150, 1517 }, { 10, 150, 1546 }, { 17, 151, 1572 }, { 23, 151, 1594 }, + { 28, 151, 1612 }, { 31, 151, 1623 }, { 32, 151, 1628 }, { 31, 151, 1624 }, { 28, 151, 1614 }, + { 24, 151, 1598 }, { 19, 151, 1578 }, { 12, 150, 1554 }, { 5, 150, 1527 }, { -1, 150, 1499 }, + { -9, 150, 1471 }, { -16, 149, 1443 }, { -23, 149, 1416 }, { -29, 149, 1393 }, { -35, 149, 1372 }, + { -39, 149, 1356 }, { -42, 149, 1346 }, { -43, 148, 1343 }, { -42, 149, 1347 }, { -38, 149, 1358 }, + { -34, 149, 1376 }, { -28, 149, 1399 }, { -21, 149, 1426 }, { -13, 150, 1455 }, { -5, 150, 1485 }, + { 2, 150, 1515 }, { 10, 150, 1544 }, { 17, 151, 1571 }, { 23, 151, 1594 }, { 28, 151, 1612 }, + { 31, 151, 1623 }, { 32, 151, 1628 }, { 30, 151, 1623 }, { 27, 151, 1609 }, { 22, 151, 1589 }, + { 15, 151, 1563 }, { 7, 150, 1534 }, { -1, 150, 1501 }, { -9, 150, 1469 }, { -18, 149, 1437 }, + { -26, 149, 1407 }, { -32, 149, 1381 }, { -38, 149, 1361 }, { -41, 149, 1347 }, { -43, 148, 1343 }, + { -42, 149, 1346 }, { -39, 149, 1356 }, { -35, 149, 1371 }, { -30, 149, 1390 }, { -24, 149, 1413 }, + { -17, 149, 1438 }, { -10, 149, 1465 }, { -3, 150, 1493 }, { 3, 150, 1521 }, { 10, 150, 1547 }, + { 17, 150, 1571 }, { 22, 151, 1592 }, { 27, 151, 1609 }, { 30, 151, 1621 }, { 32, 151, 1628 }, + { 32, 151, 1629 }, { 31, 151, 1626 }, { 30, 152, 1620 }, { 27, 152, 1611 }, { 24, 152, 1599 }, + { 21, 152, 1586 }, { 17, 152, 1571 }, { 12, 152, 1555 }, { 8, 153, 1538 }, { 3, 153, 1522 }, + { 0, 153, 1506 }, { -4, 153, 1490 }, { -8, 153, 1476 }, { -11, 153, 1464 }, { -14, 153, 1453 }, + { -16, 153, 1446 }, { -17, 154, 1441 }, { -18, 154, 1439 }, { -18, 154, 1437 }, { -18, 154, 1437 }, + { -18, 154, 1436 }, { -18, 154, 1437 }, { -18, 154, 1438 }, { -18, 154, 1439 }, { -17, 154, 1441 }, + { -16, 154, 1443 }, { -16, 154, 1446 }, { -15, 154, 1449 }, { -14, 154, 1452 }, { -13, 154, 1456 }, + { -12, 154, 1460 }, { -11, 154, 1463 }, { -10, 154, 1467 }, { -9, 154, 1471 }, { -8, 154, 1475 }, + { -7, 154, 1479 }, { -6, 154, 1483 }, { -5, 154, 1487 }, { -4, 154, 1491 }, { -3, 154, 1494 }, + { -2, 154, 1497 }, { -1, 154, 1500 }, { 0, 154, 1502 }, { 0, 154, 1505 }, { 0, 154, 1506 }, + { 0, 154, 1507 }, { 0, 154, 1508 }, { 0, 154, 1508 }, { 0, 154, 1508 }, { 0, 154, 1507 }, + { 0, 154, 1507 }, { 0, 154, 1506 }, { 0, 154, 1505 }, { 0, 154, 1504 }, { 0, 154, 1503 }, + { -1, 154, 1502 }, { -1, 154, 1501 }, { -1, 154, 1500 }, { -1, 154, 1500 }, { -1, 154, 1500 }, + { -1, 154, 1500 }, { -1, 154, 1501 }, { -1, 154, 1502 }, { 0, 154, 1504 }, { 0, 154, 1506 }, + { 1, 154, 1510 }, { 2, 154, 1517 }, { 5, 154, 1526 }, { 7, 154, 1535 }, { 10, 153, 1546 }, + { 13, 153, 1557 }, { 16, 153, 1567 }, { 18, 153, 1576 }, { 20, 153, 1583 }, { 21, 153, 1588 }, + { 22, 153, 1589 }, { 21, 153, 1588 }, { 21, 153, 1586 }, { 20, 153, 1582 }, { 18, 153, 1577 }, + { 17, 153, 1571 }, { 15, 153, 1564 }, { 13, 153, 1557 }, { 11, 153, 1549 }, { 9, 154, 1542 }, + { 7, 154, 1534 }, { 5, 154, 1527 }, { 4, 154, 1521 }, { 2, 154, 1515 }, { 1, 154, 1511 }, + { 0, 154, 1508 }, { 0, 154, 1506 }, { 0, 154, 1509 }, { 3, 154, 1517 }, { 6, 154, 1529 }, + { 9, 154, 1542 }, { 13, 153, 1555 }, { 16, 153, 1566 }, { 17, 153, 1571 }, { 18, 153, 1574 }, + { 19, 153, 1577 }, { 19, 153, 1579 }, { 20, 153, 1581 }, { 20, 153, 1583 }, { 21, 153, 1585 }, + { 21, 153, 1586 }, { 21, 153, 1587 }, { 22, 153, 1588 }, { 22, 153, 1589 }, { 22, 153, 1590 }, + { 22, 153, 1591 }, { 22, 153, 1591 }, { 22, 153, 1592 }, { 23, 153, 1592 }, { 23, 153, 1592 }, + { 23, 153, 1593 }, { 23, 152, 1593 }, { 23, 152, 1594 }, { 23, 152, 1594 }, { 23, 152, 1595 }, + { 23, 152, 1595 }, { 24, 152, 1596 }, { 24, 152, 1596 }, { 24, 152, 1596 }, { 24, 152, 1596 }, + { 23, 152, 1596 }, { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1594 }, { 23, 152, 1594 }, + { 23, 152, 1594 }, { 23, 152, 1594 }, { 23, 152, 1594 }, { 23, 152, 1594 }, { 23, 152, 1595 }, + { 24, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1599 }, { 25, 152, 1600 }, { 25, 152, 1602 }, + { 25, 152, 1603 }, { 26, 152, 1605 }, { 26, 152, 1607 }, { 27, 152, 1608 }, { 27, 152, 1610 }, + { 28, 152, 1612 }, { 28, 151, 1614 }, { 29, 151, 1616 }, { 29, 151, 1618 }, { 30, 151, 1620 }, + { 30, 151, 1621 }, { 31, 151, 1623 }, { 31, 151, 1625 }, { 32, 151, 1626 }, { 32, 151, 1628 }, + { 32, 151, 1630 }, { 33, 151, 1631 }, { 33, 151, 1632 }, { 33, 151, 1633 }, { 34, 150, 1634 }, + { 34, 150, 1635 }, { 34, 150, 1636 }, { 34, 150, 1636 }, { 34, 150, 1637 }, { 34, 150, 1637 }, + { 34, 150, 1637 }, { 34, 150, 1636 }, { 34, 150, 1636 }, { 34, 150, 1635 }, { 33, 150, 1634 }, + { 33, 151, 1632 }, { 33, 151, 1631 }, { 32, 151, 1629 }, { 32, 151, 1628 }, { 31, 151, 1626 }, + { 31, 151, 1624 }, { 30, 151, 1622 }, { 30, 151, 1620 }, { 29, 151, 1617 }, { 29, 151, 1615 }, + { 28, 152, 1613 }, { 27, 152, 1611 }, { 27, 152, 1609 }, { 26, 152, 1606 }, { 26, 152, 1604 }, + { 25, 152, 1602 }, { 25, 152, 1600 }, { 24, 152, 1598 }, { 24, 152, 1597 }, { 23, 152, 1595 }, + { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1595 }, { 24, 152, 1597 }, { 23, 152, 1595 }, + { 21, 153, 1587 }, { 18, 153, 1576 }, { 15, 153, 1565 }, { 12, 153, 1553 }, { 9, 153, 1541 }, + { 6, 154, 1530 }, { 3, 154, 1521 }, { 1, 154, 1513 }, { 0, 154, 1508 }, { 0, 154, 1506 }, +}; + +static s16 animdata_mario_mustache_right_2[][3] = { + { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1598 }, + { 24, 152, 1600 }, { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1605 }, { 26, 152, 1607 }, + { 27, 152, 1609 }, { 27, 152, 1610 }, { 28, 152, 1611 }, { 28, 152, 1612 }, { 28, 152, 1613 }, + { 28, 152, 1613 }, { 28, 152, 1613 }, { 28, 152, 1612 }, { 27, 152, 1610 }, { 26, 152, 1607 }, + { 26, 152, 1604 }, { 25, 152, 1600 }, { 23, 152, 1595 }, { 13, 153, 1557 }, { -3, 153, 1493 }, + { -12, 154, 1459 }, { -3, 153, 1493 }, { 13, 153, 1557 }, { 23, 152, 1595 }, { 23, 153, 1596 }, + { 22, 153, 1590 }, { 19, 153, 1578 }, { 15, 154, 1563 }, { 11, 154, 1548 }, { 7, 154, 1534 }, + { 4, 155, 1524 }, { 3, 155, 1520 }, { 4, 155, 1524 }, { 6, 154, 1532 }, { 10, 154, 1544 }, + { 13, 154, 1558 }, { 17, 153, 1572 }, { 20, 153, 1584 }, { 22, 153, 1592 }, { 23, 152, 1595 }, + { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1598 }, { 24, 152, 1599 }, + { 25, 152, 1601 }, { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1606 }, { 26, 152, 1608 }, + { 27, 152, 1610 }, { 27, 151, 1612 }, { 28, 151, 1614 }, { 28, 151, 1615 }, { 29, 151, 1617 }, + { 29, 151, 1619 }, { 30, 151, 1620 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, + { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, + { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, + { 30, 151, 1620 }, { 30, 151, 1620 }, { 30, 151, 1620 }, { 30, 151, 1621 }, { 30, 151, 1621 }, + { 30, 151, 1621 }, { 30, 151, 1622 }, { 30, 151, 1622 }, { 30, 151, 1622 }, { 30, 151, 1623 }, + { 30, 151, 1623 }, { 31, 151, 1623 }, { 31, 151, 1624 }, { 31, 151, 1624 }, { 31, 151, 1625 }, + { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1626 }, { 31, 151, 1626 }, { 31, 151, 1626 }, + { 31, 151, 1626 }, { 31, 151, 1627 }, { 31, 151, 1627 }, { 32, 151, 1627 }, { 32, 151, 1627 }, + { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1626 }, { 31, 151, 1626 }, + { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1624 }, { 30, 151, 1623 }, { 30, 151, 1622 }, + { 30, 151, 1622 }, { 30, 151, 1621 }, { 30, 151, 1620 }, { 29, 151, 1619 }, { 29, 151, 1618 }, + { 29, 151, 1617 }, { 28, 151, 1615 }, { 28, 151, 1613 }, { 27, 151, 1611 }, { 26, 151, 1608 }, + { 26, 151, 1605 }, { 25, 151, 1602 }, { 24, 152, 1598 }, { 23, 152, 1595 }, { 22, 152, 1591 }, + { 21, 152, 1587 }, { 20, 152, 1583 }, { 19, 152, 1579 }, { 18, 152, 1575 }, { 16, 152, 1570 }, + { 15, 152, 1566 }, { 14, 153, 1561 }, { 13, 153, 1557 }, { 12, 153, 1553 }, { 11, 153, 1548 }, + { 10, 153, 1544 }, { 8, 153, 1540 }, { 7, 153, 1536 }, { 6, 153, 1532 }, { 5, 154, 1528 }, + { 4, 154, 1525 }, { 4, 154, 1522 }, { 3, 154, 1519 }, { 2, 154, 1516 }, { 1, 154, 1513 }, + { 1, 154, 1511 }, { 0, 154, 1510 }, { 0, 154, 1508 }, { 0, 154, 1507 }, { 0, 154, 1506 }, + { 0, 154, 1506 }, +}; + +struct AnimDataInfo anim_mario_mustache_right[3] = { + { ARRAY_COUNT(animdata_mario_mustache_right_1), GD_ANIM_ROT3S, animdata_mario_mustache_right_1 }, + { ARRAY_COUNT(animdata_mario_mustache_right_2), GD_ANIM_ROT3S, animdata_mario_mustache_right_2 }, + END_ANIMDATA_INFO_ARR, +}; diff --git a/src/goddard/dynlists/animdata.h b/src/goddard/dynlists/animdata.h new file mode 100644 index 00000000..28e69269 --- /dev/null +++ b/src/goddard/dynlists/animdata.h @@ -0,0 +1,33 @@ +#ifndef GD_ANIMDATA_H +#define GD_ANIMDATA_H + +#include "../gd_types.h" +#define END_ANIMDATA_INFO_ARR { -1, GD_ANIM_EMPTY, NULL } + +extern struct AnimDataInfo anim_mario_mustache_right[]; +extern struct AnimDataInfo anim_mario_mustache_left[]; +extern struct AnimDataInfo anim_mario_lips_1[]; +extern struct AnimDataInfo anim_mario_lips_2[]; +extern struct AnimDataInfo anim_mario_eyebrows_1[]; +extern struct AnimDataInfo anim_mario_eyebrows_equalizer[]; +extern struct AnimDataInfo anim_mario_eyebrows_2[]; +extern struct AnimDataInfo anim_mario_eyebrows_3[]; +extern struct AnimDataInfo anim_mario_eyebrows_4[]; +extern struct AnimDataInfo anim_mario_eyebrows_5[]; +extern struct AnimDataInfo anim_mario_eye_left[]; +extern struct AnimDataInfo anim_mario_eye_right[]; +extern struct AnimDataInfo anim_mario_cap[]; +extern struct AnimDataInfo anim_mario_lips_3[]; +extern struct AnimDataInfo anim_mario_lips_4[]; +extern struct AnimDataInfo anim_mario_ear_left[]; +extern struct AnimDataInfo anim_mario_ear_right[]; +extern struct AnimDataInfo anim_mario_nose[]; +extern struct AnimDataInfo anim_mario_lips_5[]; +extern struct AnimDataInfo anim_mario_lips_6[]; +extern struct AnimDataInfo anim_mario_eyelid_left[]; +extern struct AnimDataInfo anim_mario_eyelid_right[]; +extern struct AnimDataInfo anim_mario_intro[]; +extern struct AnimDataInfo anim_silver_star[]; +extern struct AnimDataInfo anim_red_star[]; + +#endif // GD_ANIMDATA_H diff --git a/src/goddard/dynlists/dynlist_macros.h b/src/goddard/dynlists/dynlist_macros.h new file mode 100644 index 00000000..decb8fa9 --- /dev/null +++ b/src/goddard/dynlists/dynlist_macros.h @@ -0,0 +1,402 @@ +#ifndef GD_DYNLIST_MACROS_H +#define GD_DYNLIST_MACROS_H + +/* DynListCmd Macros */ + +/** + * Must be the first command in a dynlist. + */ +#define BeginList() \ + { 53716, {0}, {0}, {0.0, 0.0, 0.0} } + +/** + * Must be the last command in a dynlist. + */ +#define EndList() \ + { 58, {0}, {0}, {0.0, 0.0, 0.0} } + +/** + * If `enable` is TRUE, then subsequent object names are treated as integers + * rather than strings. + */ +#define UseIntegerNames(enable) \ + { 0, {0}, {(void *)(enable)}, {0.0, 0.0, 0.0} } + +/** + * Set the initial position of the current object + * Supported Objs: joints, particles, nets, vertices, cameras + */ +#define SetInitialPosition(x, y, z) \ + { 1, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the relative position of the current object + * Supported Objs: joints, particles, vertices, cameras, labels + */ +#define SetRelativePosition(x, y, z) \ + { 2, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the world position of the current object + * Supported Objs: joints, nets, vertices, cameras, gadgets, views + */ +#define SetWorldPosition(x, y, z) \ + { 3, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the normal of the current object + * Supported Objs: vertices + */ +#define SetNormal(x, y, z) \ + { 4, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the scale of the current object + * Supported Objs: joints, particles, nets, gadgets, views, lights + */ +#define SetScale(x, y, z) \ + { 5, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the rotation of the current object + * Supported Objs: joints, nets + */ +#define SetRotation(x, y, z) \ + { 6, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the specified bits in the object's `drawFlags` field + * Supported Objs: all + */ +#define SetDrawFlag(flags) \ + { 7, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} } + +/** + * Set the specified bits in the object specific flag + * Supported Objs: bones, joints, particles, shapes, nets, cameras, views, lights + */ +#define SetFlag(flags) \ + { 8, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} } + +/** + * Clear the specified bits in the object specific flag + * Supported Objs: bones, joints, particles, nets, cameras + */ +#define ClearFlag(flags) \ + { 9, {0}, {(void *)(flags)}, {0.0, 0.0, 0.0} } + +/** + * Set the friction vector of a Joint + * Supported Objs: joints + */ +#define SetFriction(x, y, z) \ + { 10, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the spring value of a Bone + * Supported Objs: bones + */ +#define SetSpring(spring) \ + { 11, {0}, {0}, {(spring), 0.0, 0.0} } + +/** + * Jump to pointed dynlist. Once that list has finished processing, flow returns + * to the current list. + */ +#define CallList(list) \ + { 12, {(void *)(list)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Sets the object's color to one of the predefined colors (see draw_objects.h + * for the list of colors. + * Supported Objs: joints, particles, nets, faces, gadgets + */ +#define SetColourNum(colourNum) \ + { 13, {0}, {(void *)(colourNum)}, {0.0, 0.0, 0.0} } + +/** + * Make an object of the specified type and name, and set it as the current + * object. + */ +#define MakeDynObj(type, name) \ + { 15, {(void *)(name)}, {(void *)(type)}, {0.0, 0.0, 0.0} } + +/** + * Make a group that will contain all subsequently created objects once the + * EndGroup command is called. + */ +#define StartGroup(grpName) \ + { 16, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * End a group. All objects created between StartGroup and EndGroup are added to + * the group. + */ +#define EndGroup(grpName) \ + { 17, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Add the current object to the specified group. + * Supported Objs: all + */ +#define AddToGroup(grpName) \ + { 18, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set an object specific type flag. + * Supported Objs: groups, joints, particles, nets, materials, gadgets + */ +#define SetType(type) \ + { 19, {0}, {(void *)(type)}, {0.0, 0.0, 0.0} } + +/** + * Set the current shape's material group to the specified group. + * Supported Objs: shapes + */ +#define SetMaterialGroup(mtlGrpName) \ + { 20, {(void *)(mtlGrpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Assign the specified group to the current object. The purpose of the group + * depends on the current object's type. For shapes, it sets the vertex data. + * For animators, it sets the animation data. For nets, it sets ???. For + * gadgets, it sets ???. + * Supported Objs: shapes, nets, gadgets, animators + */ +#define SetNodeGroup(grpName) \ + { 21, {(void *)(grpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the skin group of the current Net object with the vertices from the + * specified shape. + * Supported Objs: nets + */ +#define SetSkinShape(shapeName) \ + { 22, {(void *)(shapeName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the plane (face) group of the current object. + * Supported Objs: shapes, nets + */ +#define SetPlaneGroup(planeGrpName) \ + { 23, {(void *)(planeGrpName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the current object's shape, where `shapePtr` is a pointer to an + * `ObjShape`. + * Supported Objs: bones, joints, particles, nets, gadgets, lights + */ +#define SetShapePtrPtr(shapePtr) \ + { 24, {(void *)(shapePtr)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the current object's shape, where `shapeName` is the name of a shape + * object. + * Supported Objs: bones, joints, particles, nets, gadgets + */ +#define SetShapePtr(shapeName) \ + { 25, {(void *)(shapeName)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set offset of the connected shape + * Supported Objs: joints + */ +#define SetShapeOffset(x, y, z) \ + { 26, {0}, {0}, {(x), (y), (z)} } + +/** + * Set the center of gravity of the current Net object + * Supported Objs: nets + */ +#define SetCenterOfGravity(x, y, z) \ + { 27, {0}, {0}, {(x), (y), (z)} } + +// TODO: + +/* Link Object ID to the current dynobj */ +/* Supported Objs: groups, bones, faces, cameras, views, labels, animators */ +#define LinkWith(w1) \ + { 28, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} } + +/* Link Object pointer to the current dynobj */ +/* Supported Objs: groups, bones, faces, cameras, views, labels, animators */ +#define LinkWithPtr(w1) \ + { 29, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the specified object as the current object. + * Supported Objs: all + */ +#define UseObj(name) \ + { 30, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the current Net object's control type field. Control type is never used + * for anything, so this command effectively does nothing. + * Supported Objs: nets + */ +#define SetControlType(w2) \ + { 31, {0}, {(void *)(w2)}, {0.0, 0.0, 0.0} } + +/** + * Set the weight percentage of the specified vertex controlled by the current + * Joint object. + * Supported Objs: joints + */ +#define SetSkinWeight(vtxNum, weight) \ + { 32, {0}, {(void *)(vtxNum)}, {(weight), 0.0, 0.0} } + +/** + * Set the ambient color of the current Material object. + * Supported Objs: materials + */ +#define SetAmbient(r, g, b) \ + { 33, {0}, {0}, {(r), (g), (b)} } + +/** + * Set the diffuse color of the current Material or Light object. + * Supported Objs: materials, lights + */ +#define SetDiffuse(r, g, b) \ + { 34, {0}, {0}, {(r), (g), (b)} } + +/** + * Set the object specific ID field. + * Supported Objs: joints, vertices, materials, lights + */ +#define SetId(id) \ + { 35, {0}, {(void *)(id)}, {0.0, 0.0, 0.0} } + +/** + * Set the material id of the current Face + * Supported Objs: faces + */ +#define SetMaterial(id) \ + { 36, {0}, {(void *)(id)}, {0.0, 0.0, 0.0} } + +/** + * For all faces in the current Group, resolve their material IDs to actual + * `ObjMaterial`s. + * Supported Objs: groups + */ +#define MapMaterials(name) \ + { 37, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * For all faces in the current Group, resolve their vertex indices to pointers + * to actual `ObjVertex`es. Calculate normals for all vertices in the the group + * specified by `name` + * Supported Objs: groups + */ +#define MapVertices(name) \ + { 38, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Stub command (does nothing). + * Supported Objs: joints + */ +#define Attach(name) \ + { 39, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Attach the current object to the specified object, using the specified flags. + * Supported Objs: joints, particles, nets, animators + */ +#define AttachTo(flags, name) \ + { 40, {(void *)(name)}, {(void *)(flags)}, {0.0, 0.0, 0.0} } + +/** + * Set the point at which the current object is attached to its parent object + * Supported Objs: joints, particles, nets + */ +#define SetAttachOffset(x, y, z) \ + { 41, {0}, {0}, {(x), (y), (z)} } + +/** + * Set a "suffix" to use with dynobj names. All commands that take a name as a + * parameter will have this suffix appended to the name. + */ +#define SetNameSuffix(suffix) \ + { 43, {(void *)(suffix)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Set the float paramter `param` to `value`. + * For Shapes, the following parameters are supported: + * PARM_F_ALPHA - the alpha (opacity) of the shape + * For Gadgets, the following parameters are supported: + * PARM_F_RANGE_MIN - the minimum value of the gadget + * PARM_F_RANGE_MAX - the maximum value of the gadget + * PARM_F_VARVAL - the current value of the gadget + * For Vertices, the following parameters are supported: + * PARM_F_ALPHA - the alpha (opacity) of the vertex + * Supported Objs: shapes, vertices, gadgets + */ +#define SetParamF(param, value) \ + { 44, {0}, {(void *)(param)}, {(value), 0.0, 0.0} } + +/** + * Set pointer paramter `param` to `value` + * For Labels, the following parameters are supported: + * PARM_PTR_CHAR - the format string for the label text + * For Views, the following parameters are supported: + * PARM_PTR_CHAR - the name of the view + * For Faces, the following parameters are supported: + * PARM_PTR_OBJ_VTX - (not actually a pointer) index of a vertex created with `MakeVertex`. + * Supported Objs: faces, views, labels */ +#define SetParamPtr(param, value) \ + { 45, {(void *)(value)}, {(void *)(param)}, {0.0, 0.0, 0.0} } + +/** + * Create a Net with the specified name, and add a group to it. + */ +#define MakeNetWithSubGroup(name) \ + { 46, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Make a Joint and attach it to the Net created with "MakeNetWithSubGroup". + */ +#define MakeAttachedJoint(name) \ + { 47, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * End a Net that was created with "MakeNetWithSubGroup" + */ +#define EndNetWithSubGroup(name) \ + { 48, {(void *)(name)}, {0}, {0.0, 0.0, 0.0} } + +/** + * Add a Vertex dynobj + */ +#define MakeVertex(x, y, z) \ + { 49, {0}, {0}, {(x), (y), (z)} } + +/** + * Add a ValPtr dynobj + */ +#define MakeValPtr(id, flags, type, offset) \ + { 50, {(void *)(id)}, {(void *)(type)}, {(offset), (flags), 0.0} } + +/** + * Set the texture of the current Material dynobj. Note that textures are not + * actually supported. + * Supported Objs: materials + */ +#define UseTexture(texture) \ + { 52, {0}, {(void *)(texture)}, {0.0, 0.0, 0.0} } + +/** + * Stub command (does nothing). + * Supported Objs: vertices + */ +#define SetTextureST(s, t) \ + { 53, {0}, {0}, {(s), (t), 0.0} } + +/* Make a new Net from Shape ID */ +#define MakeNetFromShape(shape) \ + { 54, {(void *)(shape)}, {0}, {0.0, 0.0, 0.0} } + +/* Make a new Net from Shape double pointer PTR */ +#define MakeNetFromShapePtrPtr(w1) \ + { 55, {(void *)(w1)}, {0}, {0.0, 0.0, 0.0} } + +#endif // GD_DYNLIST_MACROS_H diff --git a/src/goddard/dynlists/dynlist_mario_face.c b/src/goddard/dynlists/dynlist_mario_face.c new file mode 100644 index 00000000..e742dd54 --- /dev/null +++ b/src/goddard/dynlists/dynlist_mario_face.c @@ -0,0 +1,406 @@ +#include + +#include "macros.h" +#include "dynlist_macros.h" +#include "dynlists.h" +#include "../dynlist_proc.h" + +static s16 mario_Face_VtxData[][3] = { + { 434, 326, -209 }, { 283, 371, -268 }, { 344, 531, -97 }, { 360, 187, -363 }, + { 162, -260, 265 }, { 172, -251, 175 }, { 218, -191, 287 }, { 173, 279, 296 }, + { 192, 226, 279 }, { 233, 346, 216 }, { 135, -283, 182 }, { 165, -299, 114 }, + { 283, -7, -283 }, { 252, -41, -396 }, { 339, 63, -209 }, { 128, 20, 390 }, + { 203, -50, 366 }, { 219, 24, 358 }, { 127, -74, 423 }, { 0, -125, 459 }, + { 125, -76, 401 }, { 83, 86, 359 }, { 124, 85, 409 }, { 144, 91, 567 }, + { 151, 5, 459 }, { 65, -67, 636 }, { 106, -104, 567 }, { 117, 1, 636 }, + { 0, 141, 459 }, { 0, 139, 567 }, { 66, 80, 636 }, { 99, -284, 284 }, + { 125, -295, 252 }, { 343, -31, 227 }, { 296, 35, 287 }, { 267, -115, 314 }, + { 374, -65, 73 }, { 366, -103, 153 }, { 369, -90, 62 }, { 77, -339, 122 }, + { 94, -363, 22 }, { 0, -123, 567 }, { 63, -198, 357 }, { 115, -178, 351 }, + { 53, -167, 398 }, { 311, 79, 200 }, { 265, 141, 195 }, { 242, 98, 288 }, + { 54, 306, 339 }, { 127, 314, 325 }, { 123, 383, 276 }, { 195, 158, 286 }, + { 490, 222, -179 }, { 410, 149, -123 }, { 281, 383, 493 }, { 349, 313, 311 }, + { 243, 407, 458 }, { 323, 286, 131 }, { 445, 241, -29 }, { 466, 126, -176 }, + { 432, 145, -125 }, { 465, 96, -107 }, { 327, -122, -180 }, { 348, -73, -156 }, + { 297, -152, -126 }, { 496, 52, -220 }, { 424, 90, -198 }, { 431, 480, -59 }, + { 356, 611, 78 }, { 119, 770, 199 }, { 243, 714, 165 }, { 183, 744, 77 }, + { 117, 190, -556 }, { 206, 36, -541 }, { 273, -85, -230 }, { 132, 423, 573 }, + { 263, 636, 246 }, { 236, 536, 288 }, { 318, 452, 218 }, { 114, 573, -114 }, + { 49, 394, -230 }, { 127, 365, -303 }, { 41, 126, 357 }, { 0, 127, 368 }, + { 342, -114, -82 }, { 144, -241, 291 }, { 128, -226, 276 }, { 0, -112, 421 }, + { 385, 17, -116 }, { 430, 29, -155 }, { 484, -69, -165 }, { 436, -20, -205 }, + { 504, 4, -195 }, { 308, -167, 222 }, { 288, -237, 119 }, { 341, -164, 56 }, + { 257, -234, -64 }, { 143, 91, 333 }, { 35, -227, 201 }, { 0, -293, 274 }, + { 66, -283, 272 }, { 91, -149, 273 }, { 50, -217, 325 }, { 74, -107, 155 }, + { 75, -227, 201 }, { 74, -321, 190 }, { 186, -226, -173 }, { 97, -313, -200 }, + { 159, -331, 5 }, { 157, -164, 336 }, { 162, -139, 369 }, { 164, -190, 319 }, + { 156, -150, 317 }, { 41, -314, 282 }, { 62, -329, 252 }, { 0, -342, 252 }, + { 0, -339, 190 }, { 0, -371, 136 }, { 379, 21, -58 }, { 345, -32, -2 }, + { 375, -21, -59 }, { 314, 331, 289 }, { 425, -38, -132 }, { 483, 49, -147 }, + { 177, 107, 315 }, { 311, 216, 143 }, { 56, 131, 305 }, { 82, 87, 283 }, + { 59, 268, 295 }, { 0, 383, 308 }, { 46, 224, 357 }, { 73, 297, 289 }, + { 124, 305, 270 }, { 161, 275, 258 }, { 181, 226, 248 }, { 167, 123, 248 }, + { 138, 92, 249 }, { 348, -76, -25 }, { 416, -115, -95 }, { 396, 155, -77 }, + { 345, 5, -6 }, { 407, 80, -78 }, { 399, 192, -5 }, { 351, 211, 49 }, + { 385, -16, 93 }, { 471, 410, 0 }, { 406, 344, 72 }, { 299, 642, -9 }, + { 99, 678, -16 }, { 61, 746, 77 }, { 0, 662, 326 }, { 144, 693, 290 }, + { 367, 553, 169 }, { 246, -69, -335 }, { 179, 521, 305 }, { 145, 447, 317 }, + { 67, 655, 314 }, { 148, 624, 303 }, { 237, 378, 229 }, { 127, -190, 213 }, + { 168, 2, 567 }, { 0, 1, 662 }, { 209, 314, -391 }, { 41, 354, -332 }, + { 406, 115, -313 }, { 260, -175, -198 }, { 90, -361, -92 }, { 401, -99, -132 }, + { 470, -19, -130 }, { 355, 55, 133 }, { 325, 107, 130 }, { 411, 73, 85 }, + { 362, 145, 57 }, { 83, 298, -450 }, { -41, 354, -332 }, { -83, 298, -450 }, + { -112, 190, -556 }, { -2, -382, 60 }, { -90, -361, -92 }, { -97, -313, -200 }, + { 108, -241, -280 }, { 0, -238, -280 }, { -67, 80, 636 }, { -66, -67, 636 }, + { -113, 529, 326 }, { -179, 521, 305 }, { -145, 447, 317 }, { -74, -107, 155 }, + { -50, -217, 325 }, { -35, -227, 201 }, { 0, 3, -569 }, { 0, -42, -443 }, + { -119, 770, 199 }, { -99, 678, -16 }, { -114, 573, -114 }, { -61, 746, 77 }, + { -54, 306, 339 }, { -46, 224, 357 }, { -63, -198, 357 }, { -53, -167, 398 }, + { 98, -67, -392 }, { 127, 441, 523 }, { 0, 423, 573 }, { 292, -219, -231 }, + { 78, -230, -456 }, { 56, -257, -404 }, { 32, -210, -431 }, { 124, -217, -428 }, + { 125, -185, -370 }, { 97, -166, -483 }, { 56, -159, -486 }, { -3, -72, -404 }, + { -3, -174, -377 }, { 303, -200, -423 }, { 243, -262, -358 }, { 204, -203, -428 }, + { 241, -139, -464 }, { 166, -110, -445 }, { 277, -93, -416 }, { 174, -205, -404 }, + { 294, -239, -381 }, { 258, -243, -302 }, { 345, -172, -370 }, { 342, -132, -280 }, + { 382, 54, -197 }, { 439, 41, -227 }, { 389, 29, -202 }, { 390, -13, -203 }, + { 412, -69, -184 }, { 422, -63, -95 }, { 0, 440, 529 }, { 364, 16, 148 }, + { 424, 39, 39 }, { 401, 29, 97 }, { 391, 132, 5 }, { 395, 101, -33 }, + { 172, -260, -335 }, { 103, -257, -404 }, { 295, -131, -457 }, { 403, 171, -41 }, + { -471, 410, 0 }, { -490, 222, -179 }, { -445, 241, -29 }, { -410, 149, -123 }, + { -396, 155, -77 }, { -403, 171, -41 }, { -323, 286, 131 }, { -406, 344, 72 }, + { -399, 192, -5 }, { -318, 452, 218 }, { -209, 314, -391 }, { -283, 371, -268 }, + { -127, 365, -303 }, { -98, -67, -392 }, { -125, -185, -370 }, { -166, -110, -445 }, + { -246, -69, -335 }, { -277, -93, -416 }, { -342, -132, -280 }, { -292, -219, -231 }, + { -258, -243, -302 }, { -113, -243, -280 }, { -172, -260, -335 }, { -358, 57, 132 }, + { -363, 17, 151 }, { -311, 79, 200 }, { -407, 29, 97 }, { -345, 5, -6 }, + { -395, 101, -33 }, { -391, 132, 5 }, { -351, 211, 49 }, { -362, 145, 57 }, + { -385, -16, 93 }, { -343, -31, 227 }, { -283, -7, -287 }, { -273, -85, -230 }, + { -360, 187, -363 }, { -206, 36, -541 }, { -406, 115, -313 }, { -303, -200, -423 }, + { -345, -172, -370 }, { -295, -131, -457 }, { -241, -139, -464 }, { -204, -203, -428 }, + { -294, -239, -381 }, { -243, -262, -358 }, { -78, -230, -456 }, { -56, -159, -486 }, + { -32, -210, -431 }, { -97, -166, -483 }, { -124, -217, -428 }, { -103, -257, -404 }, + { -56, -257, -404 }, { -174, -205, -404 }, { -311, 216, 143 }, { -418, 39, 39 }, + { -411, 73, 85 }, { -327, 106, 129 }, { -374, -65, 73 }, { -348, -76, -25 }, + { -345, -167, 56 }, { -369, -90, 62 }, { -345, -32, -2 }, { -237, 378, 229 }, + { -314, 331, 289 }, { -243, 407, 458 }, { -127, 441, 523 }, { -439, 41, -227 }, + { -436, -20, -205 }, { -504, 4, -195 }, { -416, -115, -95 }, { -422, -63, -95 }, + { -339, 63, -209 }, { -348, -73, -156 }, { -390, -13, -203 }, { -401, -99, -132 }, + { -342, -114, -82 }, { -484, -69, -165 }, { -412, -69, -184 }, { -470, -19, -130 }, + { -425, -38, -132 }, { -375, -21, -59 }, { -407, 80, -78 }, { -385, 17, -116 }, + { -379, 21, -58 }, { -424, 90, -198 }, { -382, 54, -197 }, { -389, 29, -202 }, + { -496, 52, -220 }, { -483, 49, -147 }, { -466, 126, -176 }, { -432, 145, -125 }, + { -465, 96, -107 }, { -186, -226, -173 }, { -260, -175, -198 }, { -132, 423, 573 }, + { -94, -363, 22 }, { -77, -339, 122 }, { -123, 383, 276 }, { -252, -20, -373 }, + { -430, 29, -155 }, { -254, -230, -63 }, { -159, -331, 5 }, { -297, -152, -126 }, + { -322, -122, -180 }, { -49, 394, -230 }, { -145, 91, 567 }, { -124, 85, 409 }, + { -169, 2, 567 }, { -151, 5, 459 }, { -119, -69, 429 }, { -106, -104, 567 }, + { -118, 1, 636 }, { -128, 20, 390 }, { -115, -178, 351 }, { -157, -164, 336 }, + { -155, -149, 317 }, { -127, -190, 214 }, { -75, -227, 201 }, { -367, 553, 169 }, + { -236, 536, 288 }, { -263, 636, 246 }, { -148, 624, 303 }, { -144, 693, 290 }, + { -67, 655, 314 }, { -434, 326, -209 }, { -243, 714, 165 }, { -356, 611, 78 }, + { -183, 744, 77 }, { -299, 642, -9 }, { -344, 531, -97 }, { -366, -103, 153 }, + { -267, -115, 314 }, { -296, 35, 287 }, { -242, 98, 288 }, { -192, 221, 279 }, + { -162, -139, 369 }, { -91, -147, 273 }, { -288, -237, 119 }, { -165, -299, 114 }, + { -172, -251, 176 }, { -219, 24, 358 }, { -143, 91, 333 }, { -203, -50, 366 }, + { -125, -76, 401 }, { -82, 87, 288 }, { -83, 86, 359 }, { -41, 126, 357 }, + { -138, 92, 254 }, { -177, 107, 311 }, { -167, 120, 250 }, { -198, 155, 286 }, + { -181, 221, 239 }, { -161, 268, 247 }, { -169, 277, 296 }, { -124, 298, 270 }, + { -127, 314, 325 }, { -73, 290, 291 }, { -56, 128, 309 }, { -59, 261, 299 }, + { -265, 141, 195 }, { -233, 346, 207 }, { -281, 383, 493 }, { -349, 313, 311 }, + { -308, -167, 222 }, { -135, -283, 182 }, { -74, -321, 190 }, { -218, -191, 287 }, + { -164, -187, 321 }, { -162, -260, 265 }, { -144, -241, 291 }, { -99, -284, 283 }, + { -62, -329, 252 }, { -41, -314, 282 }, { -66, -284, 272 }, { -125, -295, 252 }, + { -127, -226, 276 }, { -431, 480, -59 }, { 0, -320, 282 }, { -181, 161, 238 }, + { 0, 461, 348 }, { -72, 454, 336 }, { 72, 454, 336 }, { 181, 165, 241 }, + { 0, 529, 345 }, { 113, 529, 326 }, { -59, 524, 333 }, { 59, 524, 333 }, + { 0, 306, 339 }, { 0, 224, 357 }, { 162, 48, 567 }, { 156, -52, 567 }, + { -77, 126, 434 }, { -156, -52, 567 }, { -90, 127, 567 }, { 88, 127, 567 }, + { -67, -114, 567 }, { 66, -114, 567 }, { 76, 126, 434 }, { -157, 46, 567 }, +}; + +static struct GdVtxData mario_Face_VtxInfo = { ARRAY_COUNT(mario_Face_VtxData), 0x1, mario_Face_VtxData }; + +static u16 mario_Face_FaceData[][4] = { + { 0, 43, 102, 112 }, { 0, 102, 42, 188 }, { 0, 354, 356, 188 }, { 0, 188, 198, 354 }, + { 0, 198, 188, 42 }, { 0, 43, 42, 102 }, { 1, 4, 5, 6 }, { 1, 7, 8, 9 }, + { 1, 10, 11, 5 }, { 1, 15, 16, 17 }, { 1, 18, 19, 20 }, { 1, 21, 22, 15 }, + { 1, 23, 24, 22 }, { 1, 27, 25, 26 }, { 1, 27, 26, 431 }, { 1, 435, 23, 22 }, + { 1, 30, 23, 435 }, { 1, 4, 31, 32 }, { 1, 33, 34, 35 }, { 1, 36, 37, 38 }, + { 1, 11, 39, 40 }, { 1, 437, 26, 25 }, { 1, 18, 26, 19 }, { 1, 42, 43, 44 }, + { 1, 45, 46, 47 }, { 1, 48, 49, 50 }, { 1, 47, 46, 51 }, { 1, 59, 60, 61 }, + { 1, 62, 63, 64 }, { 1, 59, 65, 66 }, { 1, 34, 33, 45 }, { 1, 24, 15, 22 }, + { 1, 20, 15, 18 }, { 1, 82, 83, 28 }, { 1, 82, 28, 438 }, { 1, 84, 64, 63 }, + { 1, 85, 86, 31 }, { 1, 87, 20, 19 }, { 1, 35, 16, 20 }, { 1, 88, 89, 61 }, + { 1, 90, 91, 92 }, { 1, 6, 5, 93 }, { 1, 94, 95, 37 }, { 1, 96, 95, 94 }, + { 1, 21, 15, 97 }, { 1, 10, 32, 105 }, { 1, 87, 44, 20 }, { 1, 106, 96, 107 }, + { 1, 96, 64, 95 }, { 1, 94, 108, 96 }, { 1, 109, 35, 110 }, { 1, 35, 109, 6 }, + { 1, 111, 109, 112 }, { 1, 100, 99, 113 }, { 1, 114, 113, 115 }, { 1, 114, 32, 31 }, + { 1, 113, 31, 100 }, { 1, 5, 4, 10 }, { 1, 105, 114, 116 }, { 1, 4, 85, 31 }, + { 1, 109, 111, 6 }, { 1, 6, 85, 4 }, { 1, 37, 93, 94 }, { 1, 35, 6, 93 }, + { 1, 35, 93, 37 }, { 1, 20, 44, 110 }, { 1, 20, 110, 35 }, { 1, 38, 37, 95 }, + { 1, 84, 95, 64 }, { 1, 105, 117, 39 }, { 1, 10, 39, 11 }, { 1, 108, 94, 11 }, + { 1, 94, 93, 5 }, { 1, 118, 119, 120 }, { 1, 57, 9, 8 }, { 1, 88, 122, 89 }, + { 1, 123, 59, 61 }, { 1, 49, 7, 9 }, { 1, 47, 51, 124 }, { 1, 47, 124, 97 }, + { 1, 125, 8, 46 }, { 1, 50, 129, 48 }, { 1, 126, 130, 82 }, { 1, 128, 131, 48 }, + { 1, 131, 49, 48 }, { 1, 132, 7, 49 }, { 1, 133, 8, 7 }, { 1, 134, 51, 8 }, + { 1, 135, 124, 51 }, { 1, 136, 97, 124 }, { 1, 127, 21, 97 }, { 1, 127, 82, 21 }, + { 1, 34, 17, 35 }, { 1, 35, 17, 16 }, { 1, 15, 20, 16 }, { 1, 97, 15, 17 }, + { 1, 47, 97, 17 }, { 1, 34, 47, 17 }, { 1, 137, 84, 138 }, { 1, 88, 120, 122 }, + { 1, 84, 137, 95 }, { 1, 94, 5, 11 }, { 1, 110, 44, 43 }, { 1, 60, 53, 139 }, + { 1, 140, 141, 139 }, { 1, 57, 8, 125 }, { 1, 118, 140, 119 }, { 1, 34, 45, 47 }, + { 1, 37, 144, 33 }, { 1, 37, 33, 35 }, { 1, 18, 15, 24 }, { 1, 431, 26, 18 }, + { 1, 30, 27, 23 }, { 1, 161, 27, 30 }, { 1, 161, 25, 27 }, { 1, 430, 23, 27 }, + { 1, 431, 160, 27 }, { 1, 19, 26, 437 }, { 1, 19, 437, 41 }, { 1, 430, 160, 24 }, + { 1, 106, 64, 96 }, { 1, 40, 166, 108 }, { 1, 166, 107, 108 }, { 1, 96, 108, 107 }, + { 1, 84, 63, 167 }, { 1, 89, 168, 123 }, { 1, 123, 61, 89 }, { 1, 59, 123, 65 }, + { 1, 88, 118, 120 }, { 1, 59, 66, 53 }, { 1, 61, 139, 141 }, { 1, 61, 141, 88 }, + { 1, 169, 170, 45 }, { 1, 39, 177, 40 }, { 1, 178, 166, 177 }, { 1, 107, 166, 179 }, + { 1, 180, 107, 181 }, { 1, 161, 30, 182 }, { 1, 183, 25, 161 }, { 1, 129, 196, 428 }, + { 1, 428, 196, 197 }, { 1, 429, 197, 387 }, { 1, 198, 44, 199 }, { 1, 199, 44, 87 }, + { 1, 182, 30, 29 }, { 1, 41, 25, 183 }, { 1, 180, 165, 106 }, { 1, 180, 106, 107 }, + { 1, 139, 61, 60 }, { 1, 59, 53, 60 }, { 1, 65, 123, 92 }, { 1, 224, 66, 225 }, + { 1, 226, 225, 91 }, { 1, 227, 91, 228 }, { 1, 63, 227, 228 }, { 1, 63, 228, 167 }, + { 1, 91, 90, 228 }, { 1, 66, 224, 53 }, { 1, 118, 141, 140 }, { 1, 141, 118, 88 }, + { 1, 90, 92, 168 }, { 1, 120, 229, 122 }, { 1, 119, 137, 120 }, { 1, 90, 229, 138 }, + { 1, 168, 122, 229 }, { 1, 90, 167, 228 }, { 1, 90, 138, 167 }, { 1, 167, 138, 84 }, + { 1, 138, 229, 137 }, { 1, 225, 92, 91 }, { 1, 231, 45, 33 }, { 1, 140, 144, 119 }, + { 1, 137, 119, 38 }, { 1, 137, 38, 95 }, { 1, 125, 170, 172 }, { 1, 36, 119, 144 }, + { 1, 57, 125, 143 }, { 1, 144, 231, 33 }, { 1, 169, 45, 231 }, { 1, 263, 264, 265 }, + { 1, 272, 273, 264 }, { 1, 246, 270, 294 }, { 1, 298, 272, 267 }, { 1, 294, 271, 297 }, + { 1, 299, 300, 301 }, { 1, 299, 301, 302 }, { 1, 302, 298, 267 }, { 1, 264, 273, 265 }, + { 1, 307, 308, 309 }, { 1, 310, 299, 311 }, { 1, 315, 316, 310 }, { 1, 317, 315, 310 }, + { 1, 317, 318, 315 }, { 1, 319, 311, 320 }, { 1, 317, 310, 311 }, { 1, 302, 321, 299 }, + { 1, 321, 320, 311 }, { 1, 317, 319, 309 }, { 1, 322, 323, 324 }, { 1, 324, 267, 322 }, + { 1, 325, 243, 326 }, { 1, 308, 318, 317 }, { 1, 313, 315, 318 }, { 1, 313, 318, 314 }, + { 1, 314, 318, 308 }, { 1, 327, 308, 307 }, { 1, 326, 307, 325 }, { 1, 328, 309, 329 }, + { 1, 330, 331, 243 }, { 1, 244, 331, 332 }, { 1, 261, 179, 333 }, { 1, 261, 333, 334 }, + { 1, 336, 177, 337 }, { 1, 178, 177, 336 }, { 1, 263, 265, 297 }, { 1, 332, 323, 322 }, + { 1, 332, 322, 244 }, { 1, 330, 243, 325 }, { 1, 323, 321, 324 }, { 1, 330, 328, 329 }, + { 1, 329, 340, 332 }, { 1, 340, 329, 319 }, { 1, 316, 315, 313 }, { 1, 341, 179, 342 }, + { 1, 178, 342, 179 }, { 1, 336, 342, 178 }, { 1, 333, 341, 343 }, { 1, 434, 29, 28 }, + { 1, 349, 350, 433 }, { 1, 436, 351, 19 }, { 1, 436, 19, 41 }, { 1, 433, 351, 352 }, + { 1, 161, 352, 183 }, { 1, 161, 182, 352 }, { 1, 350, 349, 353 }, { 1, 354, 355, 356 }, + { 1, 371, 372, 273 }, { 1, 371, 273, 272 }, { 1, 373, 374, 265 }, { 1, 324, 302, 267 }, + { 1, 246, 294, 375 }, { 1, 267, 244, 322 }, { 1, 331, 244, 243 }, { 1, 376, 354, 199 }, + { 1, 378, 379, 380 }, { 1, 316, 300, 299 }, { 1, 323, 320, 321 }, { 1, 299, 310, 316 }, + { 1, 373, 381, 374 }, { 1, 374, 381, 382 }, { 1, 382, 381, 353 }, { 1, 353, 383, 384 }, + { 1, 372, 383, 381 }, { 1, 373, 372, 381 }, { 1, 385, 386, 387 }, { 1, 385, 382, 386 }, + { 1, 388, 389, 382 }, { 1, 390, 391, 389 }, { 1, 392, 375, 391 }, { 1, 393, 394, 375 }, + { 1, 395, 396, 394 }, { 1, 397, 196, 396 }, { 1, 399, 197, 196 }, { 1, 398, 387, 197 }, + { 1, 338, 196, 129 }, { 1, 401, 394, 396 }, { 1, 294, 400, 375 }, { 1, 374, 382, 389 }, + { 1, 374, 389, 391 }, { 1, 329, 332, 330 }, { 1, 323, 340, 320 }, { 1, 246, 375, 401 }, + { 1, 324, 321, 302 }, { 1, 378, 380, 404 }, { 1, 342, 379, 378 }, { 1, 405, 379, 337 }, + { 1, 406, 337, 117 }, { 1, 316, 343, 300 }, { 1, 301, 300, 371 }, { 1, 384, 372, 376 }, + { 1, 384, 376, 199 }, { 1, 372, 371, 404 }, { 1, 372, 404, 407 }, { 1, 371, 378, 404 }, + { 1, 356, 355, 408 }, { 1, 407, 409, 410 }, { 1, 355, 407, 408 }, { 1, 409, 411, 410 }, + { 1, 406, 116, 412 }, { 1, 380, 405, 409 }, { 1, 413, 414, 411 }, { 1, 412, 411, 415 }, + { 1, 412, 115, 413 }, { 1, 414, 413, 99 }, { 1, 372, 407, 355 }, { 1, 355, 376, 372 }, + { 1, 300, 341, 378 }, { 1, 341, 300, 343 }, { 1, 333, 179, 341 }, { 1, 87, 384, 199 }, + { 1, 405, 406, 415 }, { 1, 386, 382, 353 }, { 1, 342, 378, 341 }, { 1, 378, 371, 300 }, + { 1, 407, 404, 380 }, { 1, 317, 309, 308 }, { 1, 323, 332, 340 }, { 1, 372, 384, 383 }, + { 1, 87, 19, 384 }, { 1, 347, 432, 387 }, { 1, 410, 411, 416 }, { 1, 384, 350, 353 }, + { 1, 349, 347, 353 }, { 1, 373, 265, 273 }, { 1, 330, 325, 328 }, { 1, 343, 316, 313 }, + { 1, 330, 332, 331 }, { 1, 374, 391, 400 }, { 1, 196, 338, 396 }, { 1, 265, 374, 400 }, + { 1, 198, 199, 354 }, { 1, 350, 19, 351 }, { 1, 436, 41, 183 }, { 1, 379, 336, 337 }, + { 1, 298, 301, 371 }, { 1, 273, 372, 373 }, { 1, 409, 415, 411 }, { 1, 434, 346, 182 }, + { 1, 183, 352, 351 }, { 1, 346, 347, 349 }, { 1, 386, 353, 347 }, { 1, 350, 384, 19 }, + { 1, 353, 381, 383 }, { 1, 405, 380, 379 }, { 1, 394, 401, 375 }, { 1, 409, 407, 380 }, + { 1, 342, 336, 379 }, { 1, 307, 328, 325 }, { 1, 414, 416, 411 }, { 1, 412, 415, 406 }, + { 1, 418, 99, 413 }, { 1, 418, 413, 115 }, { 1, 413, 411, 412 }, { 1, 415, 409, 405 }, + { 1, 115, 412, 116 }, { 1, 116, 406, 117 }, { 1, 406, 405, 337 }, { 1, 391, 375, 400 }, + { 1, 399, 398, 197 }, { 1, 395, 397, 396 }, { 1, 393, 395, 394 }, { 1, 392, 393, 375 }, + { 1, 419, 392, 391 }, { 1, 419, 391, 390 }, { 1, 390, 389, 388 }, { 1, 388, 382, 385 }, + { 1, 398, 385, 387 }, { 1, 355, 354, 376 }, { 1, 298, 371, 272 }, { 1, 334, 333, 343 }, + { 1, 320, 340, 319 }, { 1, 400, 297, 265 }, { 1, 117, 337, 177 }, { 1, 327, 307, 326 }, + { 1, 314, 308, 327 }, { 1, 329, 309, 319 }, { 1, 319, 317, 311 }, { 1, 321, 311, 299 }, + { 1, 328, 307, 309 }, { 1, 298, 302, 301 }, { 1, 400, 294, 297 }, { 1, 271, 294, 270 }, + { 1, 172, 143, 125 }, { 1, 46, 170, 125 }, { 1, 36, 38, 119 }, { 1, 65, 92, 225 }, + { 1, 120, 137, 229 }, { 1, 168, 229, 90 }, { 1, 123, 168, 92 }, { 1, 227, 226, 91 }, + { 1, 226, 224, 225 }, { 1, 42, 44, 198 }, { 1, 117, 177, 39 }, { 1, 179, 181, 107 }, + { 1, 261, 181, 179 }, { 1, 178, 179, 166 }, { 1, 46, 45, 170 }, { 1, 122, 168, 89 }, + { 1, 165, 64, 106 }, { 1, 112, 109, 43 }, { 1, 36, 144, 37 }, { 1, 109, 110, 43 }, + { 1, 126, 82, 127 }, { 1, 136, 127, 97 }, { 1, 135, 136, 124 }, { 1, 423, 135, 51 }, + { 1, 423, 51, 134 }, { 1, 134, 8, 133 }, { 1, 133, 7, 132 }, { 1, 132, 49, 131 }, + { 1, 128, 130, 126 }, { 1, 51, 46, 8 }, { 1, 105, 39, 10 }, { 1, 116, 117, 105 }, + { 1, 115, 116, 114 }, { 1, 32, 10, 4 }, { 1, 113, 114, 31 }, { 1, 418, 115, 113 }, + { 1, 418, 113, 99 }, { 1, 114, 105, 32 }, { 1, 100, 31, 86 }, { 1, 225, 66, 65 }, + { 1, 108, 11, 40 }, { 1, 166, 40, 177 }, { 1, 64, 165, 62 }, { 1, 343, 313, 344 }, + { 1, 343, 344, 334 }, { 1, 111, 85, 6 }, { 1, 112, 86, 111 }, { 1, 408, 410, 416 }, + { 1, 407, 410, 408 }, { 1, 416, 356, 408 }, { 1, 86, 85, 111 }, { 1, 428, 48, 129 }, + { 1, 428, 429, 130 }, { 1, 130, 429, 83 }, { 1, 387, 83, 429 }, { 1, 83, 82, 130 }, + { 1, 130, 48, 428 }, { 1, 197, 429, 428 }, { 1, 438, 22, 21 }, { 1, 432, 28, 83 }, + { 1, 432, 83, 387 }, { 1, 387, 386, 347 }, { 1, 21, 82, 438 }, { 1, 347, 346, 434 }, + { 1, 28, 29, 435 }, { 1, 183, 351, 436 }, { 1, 25, 41, 437 }, { 1, 27, 160, 430 }, + { 1, 24, 23, 430 }, { 1, 431, 18, 24 }, { 1, 24, 160, 431 }, { 1, 350, 351, 433 }, + { 1, 433, 348, 349 }, { 1, 352, 348, 433 }, { 1, 435, 29, 30 }, { 1, 182, 29, 434 }, + { 1, 28, 432, 434 }, { 1, 435, 438, 28 }, { 1, 434, 432, 347 }, { 1, 22, 438, 435 }, + { 1, 396, 338, 401 }, { 1, 9, 50, 49 }, { 1, 196, 397, 399 }, { 1, 48, 130, 128 }, + { 1, 349, 348, 439 }, { 1, 439, 348, 352 }, { 1, 439, 346, 349 }, { 1, 439, 348, 352 }, + { 1, 439, 352, 182 }, { 1, 182, 346, 439 }, { 2, 12, 13, 14 }, { 2, 153, 13, 12 }, + { 2, 153, 191, 13 }, { 2, 153, 200, 191 }, { 2, 256, 191, 253 }, { 2, 256, 274, 339 }, + { 2, 274, 312, 339 }, { 2, 256, 339, 191 }, { 3, 184, 185, 186 }, { 3, 156, 150, 424 }, + { 3, 155, 154, 425 }, { 3, 426, 421, 420 }, { 3, 420, 422, 427 }, { 3, 184, 364, 362 }, + { 3, 157, 156, 425 }, { 3, 150, 364, 424 }, { 3, 362, 185, 184 }, { 3, 425, 154, 157 }, + { 4, 126, 127, 128 }, { 4, 398, 399, 385 }, { 4, 388, 385, 399 }, { 4, 390, 388, 399 }, + { 4, 419, 390, 399 }, { 4, 392, 419, 399 }, { 4, 393, 392, 399 }, { 4, 395, 393, 399 }, + { 4, 397, 395, 399 }, { 4, 136, 128, 127 }, { 4, 135, 128, 136 }, { 4, 423, 128, 135 }, + { 4, 134, 128, 423 }, { 4, 133, 128, 134 }, { 4, 132, 128, 133 }, { 4, 131, 128, 132 }, + { 5, 14, 63, 74 }, { 5, 14, 74, 12 }, { 5, 142, 57, 143 }, { 5, 74, 62, 165 }, + { 5, 170, 171, 172 }, { 5, 180, 203, 165 }, { 5, 204, 205, 206 }, { 5, 207, 200, 208 }, + { 5, 209, 210, 200 }, { 5, 211, 206, 212 }, { 5, 181, 212, 206 }, { 5, 213, 214, 215 }, + { 5, 216, 217, 218 }, { 5, 216, 219, 217 }, { 5, 220, 221, 214 }, { 5, 222, 223, 221 }, + { 5, 222, 218, 223 }, { 5, 14, 224, 226 }, { 5, 14, 226, 227 }, { 5, 14, 53, 224 }, + { 5, 14, 227, 63 }, { 5, 232, 171, 233 }, { 5, 232, 233, 144 }, { 5, 234, 172, 171 }, + { 5, 233, 231, 144 }, { 5, 171, 170, 169 }, { 5, 232, 234, 171 }, { 5, 140, 235, 232 }, + { 5, 140, 232, 144 }, { 5, 210, 206, 211 }, { 5, 180, 207, 208 }, { 5, 236, 219, 214 }, + { 5, 205, 181, 206 }, { 5, 209, 200, 207 }, { 5, 237, 207, 180 }, { 5, 205, 180, 181 }, + { 5, 237, 180, 205 }, { 5, 211, 200, 210 }, { 5, 204, 237, 205 }, { 5, 204, 207, 237 }, + { 5, 204, 209, 207 }, { 5, 204, 210, 209 }, { 5, 204, 206, 210 }, { 5, 213, 220, 214 }, + { 5, 213, 222, 220 }, { 5, 216, 238, 213 }, { 5, 213, 215, 216 }, { 5, 213, 238, 222 }, + { 5, 12, 74, 153 }, { 5, 143, 172, 234 }, { 5, 239, 234, 235 }, { 5, 239, 235, 139 }, + { 5, 139, 235, 140 }, { 5, 169, 231, 233 }, { 5, 180, 208, 236 }, { 5, 180, 236, 203 }, + { 5, 203, 221, 223 }, { 5, 153, 223, 218 }, { 5, 200, 153, 217 }, { 5, 200, 217, 208 }, + { 5, 253, 254, 255 }, { 5, 253, 255, 256 }, { 5, 256, 257, 258 }, { 5, 259, 258, 260 }, + { 5, 261, 259, 262 }, { 5, 261, 262, 254 }, { 5, 263, 266, 264 }, { 5, 244, 267, 268 }, + { 5, 245, 244, 268 }, { 5, 245, 268, 269 }, { 5, 270, 269, 271 }, { 5, 274, 256, 275 }, + { 5, 279, 280, 281 }, { 5, 279, 282, 283 }, { 5, 282, 279, 281 }, { 5, 279, 284, 280 }, + { 5, 279, 285, 284 }, { 5, 286, 287, 288 }, { 5, 286, 289, 287 }, { 5, 286, 290, 289 }, + { 5, 286, 291, 290 }, { 5, 286, 292, 291 }, { 5, 211, 287, 253 }, { 5, 291, 292, 261 }, + { 5, 292, 181, 261 }, { 5, 291, 261, 290 }, { 5, 289, 290, 253 }, { 5, 292, 288, 181 }, + { 5, 212, 288, 211 }, { 5, 262, 285, 293 }, { 5, 261, 254, 290 }, { 5, 287, 211, 288 }, + { 5, 267, 272, 295 }, { 5, 267, 295, 268 }, { 5, 295, 296, 269 }, { 5, 296, 263, 297 }, + { 5, 266, 272, 264 }, { 5, 269, 296, 271 }, { 5, 295, 272, 266 }, { 5, 295, 266, 296 }, + { 5, 312, 313, 314 }, { 5, 312, 326, 243 }, { 5, 312, 314, 327 }, { 5, 312, 327, 326 }, + { 5, 280, 258, 257 }, { 5, 280, 260, 258 }, { 5, 285, 262, 260 }, { 5, 282, 255, 293 }, + { 5, 282, 257, 255 }, { 5, 279, 283, 285 }, { 5, 181, 288, 212 }, { 5, 289, 253, 287 }, + { 5, 290, 254, 253 }, { 5, 286, 288, 292 }, { 5, 261, 334, 259 }, { 5, 297, 271, 296 }, + { 5, 275, 334, 344 }, { 5, 312, 275, 313 }, { 5, 248, 270, 246 }, { 5, 275, 344, 313 }, + { 5, 312, 274, 275 }, { 5, 284, 285, 260 }, { 5, 236, 214, 221 }, { 5, 259, 334, 275 }, + { 5, 211, 253, 191 }, { 5, 281, 257, 282 }, { 5, 283, 282, 293 }, { 5, 284, 260, 280 }, + { 5, 281, 280, 257 }, { 5, 266, 263, 296 }, { 5, 268, 295, 269 }, { 5, 283, 293, 285 }, + { 5, 248, 269, 270 }, { 5, 248, 245, 269 }, { 5, 293, 254, 262 }, { 5, 260, 262, 259 }, + { 5, 275, 258, 259 }, { 5, 275, 256, 258 }, { 5, 257, 256, 255 }, { 5, 293, 255, 254 }, + { 5, 219, 208, 217 }, { 5, 218, 217, 153 }, { 5, 74, 223, 153 }, { 5, 74, 203, 223 }, + { 5, 221, 203, 236 }, { 5, 219, 236, 208 }, { 5, 142, 234, 239 }, { 5, 142, 143, 234 }, + { 5, 191, 200, 211 }, { 5, 215, 214, 219 }, { 5, 235, 234, 232 }, { 5, 233, 171, 169 }, + { 5, 238, 218, 222 }, { 5, 220, 222, 221 }, { 5, 215, 219, 216 }, { 5, 238, 216, 218 }, + { 5, 203, 74, 165 }, { 5, 74, 63, 62 }, { 6, 98, 99, 100 }, { 6, 101, 102, 103 }, + { 6, 104, 100, 86 }, { 6, 112, 101, 103 }, { 6, 103, 98, 104 }, { 6, 103, 104, 159 }, + { 6, 103, 159, 112 }, { 6, 102, 101, 112 }, { 6, 103, 102, 187 }, { 6, 99, 98, 189 }, + { 6, 189, 98, 103 }, { 6, 189, 103, 187 }, { 6, 187, 356, 357 }, { 6, 187, 357, 358 }, + { 6, 187, 358, 189 }, { 6, 356, 187, 377 }, { 6, 358, 416, 414 }, { 6, 377, 187, 188 }, + { 6, 189, 414, 99 }, { 6, 358, 414, 189 }, { 6, 357, 416, 358 }, { 6, 357, 356, 416 }, + { 6, 356, 377, 188 }, { 6, 188, 187, 102 }, { 6, 159, 86, 112 }, { 6, 159, 104, 86 }, + { 6, 104, 98, 100 }, { 7, 0, 1, 2 }, { 7, 3, 1, 0 }, { 7, 52, 53, 14 }, + { 7, 54, 55, 56 }, { 7, 55, 9, 57 }, { 7, 53, 52, 58 }, { 7, 67, 2, 68 }, + { 7, 69, 70, 71 }, { 7, 72, 3, 73 }, { 7, 54, 56, 75 }, { 7, 76, 77, 78 }, + { 7, 2, 1, 79 }, { 7, 80, 1, 81 }, { 7, 75, 50, 54 }, { 7, 57, 121, 55 }, + { 7, 54, 50, 55 }, { 7, 145, 78, 146 }, { 7, 2, 79, 147 }, { 7, 71, 70, 147 }, + { 7, 147, 148, 71 }, { 7, 71, 149, 69 }, { 7, 150, 151, 69 }, { 7, 52, 0, 145 }, + { 7, 152, 145, 68 }, { 7, 76, 68, 70 }, { 7, 151, 70, 69 }, { 7, 52, 3, 0 }, + { 7, 80, 79, 1 }, { 7, 77, 154, 155 }, { 7, 151, 156, 157 }, { 7, 151, 157, 76 }, + { 7, 155, 158, 77 }, { 7, 158, 57, 78 }, { 7, 152, 78, 145 }, { 7, 72, 162, 3 }, + { 7, 80, 81, 163 }, { 7, 52, 14, 164 }, { 7, 52, 164, 3 }, { 7, 72, 173, 162 }, + { 7, 173, 174, 163 }, { 7, 175, 72, 176 }, { 7, 72, 73, 190 }, { 7, 150, 69, 192 }, + { 7, 69, 149, 192 }, { 7, 193, 79, 194 }, { 7, 195, 148, 193 }, { 7, 79, 80, 194 }, + { 7, 50, 75, 129 }, { 7, 75, 201, 202 }, { 7, 155, 230, 201 }, { 7, 155, 201, 56 }, + { 7, 155, 56, 121 }, { 7, 158, 121, 57 }, { 7, 3, 164, 73 }, { 7, 175, 174, 173 }, + { 7, 162, 173, 81 }, { 7, 162, 81, 1 }, { 7, 57, 146, 78 }, { 7, 239, 58, 142 }, + { 7, 57, 142, 146 }, { 7, 139, 58, 239 }, { 7, 53, 58, 139 }, { 7, 145, 58, 52 }, + { 7, 240, 241, 242 }, { 7, 243, 244, 242 }, { 7, 244, 245, 242 }, { 7, 246, 247, 248 }, + { 7, 245, 248, 242 }, { 7, 246, 249, 247 }, { 7, 250, 251, 252 }, { 7, 250, 252, 175 }, + { 7, 276, 277, 278 }, { 7, 303, 246, 304 }, { 7, 186, 304, 305 }, { 7, 186, 305, 306 }, + { 7, 186, 306, 230 }, { 7, 335, 202, 306 }, { 7, 338, 129, 335 }, { 7, 339, 277, 191 }, + { 7, 176, 250, 175 }, { 7, 241, 276, 278 }, { 7, 241, 278, 312 }, { 7, 345, 174, 252 }, + { 7, 176, 276, 250 }, { 7, 359, 240, 249 }, { 7, 303, 249, 246 }, { 7, 186, 360, 303 }, + { 7, 361, 185, 362 }, { 7, 363, 364, 150 }, { 7, 360, 186, 185 }, { 7, 345, 251, 194 }, + { 7, 241, 365, 276 }, { 7, 339, 278, 277 }, { 7, 363, 192, 366 }, { 7, 361, 366, 367 }, + { 7, 359, 367, 240 }, { 7, 241, 240, 365 }, { 7, 150, 192, 363 }, { 7, 368, 192, 195 }, + { 7, 369, 368, 193 }, { 7, 368, 369, 366 }, { 7, 370, 369, 194 }, { 7, 240, 247, 249 }, + { 7, 402, 403, 338 }, { 7, 246, 403, 304 }, { 7, 335, 402, 338 }, { 7, 345, 252, 251 }, + { 7, 370, 194, 251 }, { 7, 361, 249, 360 }, { 7, 402, 335, 305 }, { 7, 176, 277, 276 }, + { 7, 192, 368, 366 }, { 7, 417, 367, 370 }, { 7, 243, 242, 241 }, { 7, 403, 246, 401 }, + { 7, 402, 305, 403 }, { 7, 241, 312, 243 }, { 7, 276, 365, 251 }, { 7, 365, 370, 251 }, + { 7, 417, 370, 365 }, { 7, 250, 276, 251 }, { 7, 304, 403, 305 }, { 7, 369, 370, 367 }, + { 7, 306, 305, 335 }, { 7, 359, 249, 361 }, { 7, 401, 338, 403 }, { 7, 193, 194, 369 }, + { 7, 367, 366, 369 }, { 7, 195, 193, 368 }, { 7, 417, 365, 240 }, { 7, 417, 240, 367 }, + { 7, 359, 361, 367 }, { 7, 361, 363, 366 }, { 7, 360, 185, 361 }, { 7, 249, 303, 360 }, + { 7, 163, 174, 80 }, { 7, 190, 191, 277 }, { 7, 202, 335, 129 }, { 7, 230, 306, 202 }, + { 7, 421, 186, 230 }, { 7, 421, 230, 420 }, { 7, 303, 304, 186 }, { 7, 174, 175, 252 }, + { 7, 242, 248, 247 }, { 7, 247, 240, 242 }, { 7, 146, 58, 145 }, { 7, 58, 146, 142 }, + { 7, 163, 81, 173 }, { 7, 158, 155, 121 }, { 7, 230, 155, 422 }, { 7, 230, 422, 420 }, + { 7, 230, 202, 201 }, { 7, 202, 129, 75 }, { 7, 345, 194, 80 }, { 7, 149, 148, 195 }, + { 7, 148, 79, 193 }, { 7, 195, 192, 149 }, { 7, 190, 73, 191 }, { 7, 176, 72, 190 }, + { 7, 277, 176, 190 }, { 7, 173, 72, 175 }, { 7, 78, 77, 158 }, { 7, 77, 76, 154 }, + { 7, 76, 70, 151 }, { 7, 152, 68, 76 }, { 7, 67, 68, 145 }, { 7, 67, 145, 0 }, + { 7, 149, 71, 148 }, { 7, 68, 147, 70 }, { 7, 148, 147, 79 }, { 7, 9, 55, 50 }, + { 7, 152, 76, 78 }, { 7, 201, 75, 56 }, { 7, 147, 68, 2 }, { 7, 121, 56, 55 }, + { 7, 164, 14, 13 }, { 7, 162, 1, 3 }, { 7, 67, 0, 2 }, { 7, 345, 80, 174 }, + { 7, 73, 13, 191 }, { 7, 73, 164, 13 }, { 7, 312, 278, 339 }, { 7, 186, 421, 184 }, + { 7, 420, 424, 426 }, { 7, 422, 425, 427 }, { 7, 426, 424, 364 }, { 7, 425, 156, 427 }, + { 7, 363, 361, 362 }, { 7, 362, 364, 363 }, { 7, 157, 154, 76 }, { 7, 151, 150, 156 }, + { 7, 421, 426, 184 }, { 7, 422, 155, 425 }, { 7, 420, 427, 424 }, { 7, 364, 184, 426 }, + { 7, 156, 424, 427 }, +}; + +static struct GdFaceData mario_Face_FaceInfo = { ARRAY_COUNT(mario_Face_FaceData), 0x1, mario_Face_FaceData }; + +struct DynList dynlist_mario_face_shape[] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_FACE_VTX_GROUP), + LinkWithPtr(&mario_Face_VtxInfo), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_FACE_TRI_GROUP), + LinkWithPtr(&mario_Face_FaceInfo), + + StartGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), + // Teeth color + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Face color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.883, 0.602, 0.408), + SetDiffuse(0.883, 0.602, 0.408), + // Shadow on back of hat + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.362, 0.0, 0.0), + SetDiffuse(0.362, 0.0, 0.0), + // Cap emblem color + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Eye color + MakeDynObj(D_MATERIAL, 0), + SetId(4), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Hair color + MakeDynObj(D_MATERIAL, 0), + SetId(5), + SetAmbient(0.362, 0.0, 0.0), + SetDiffuse(0.362, 0.0, 0.0), + // Mouth color + MakeDynObj(D_MATERIAL, 0), + SetId(6), + SetAmbient(0.526, 0.0, 0.0), + SetDiffuse(0.526, 0.0, 0.0), + // Cap color + MakeDynObj(D_MATERIAL, 0), + SetId(7), + SetAmbient(1.0, 0.0, 0.0), + SetDiffuse(1.0, 0.0, 0.0), + EndGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_FACE_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_FACE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_FACE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), + + EndList(), +}; diff --git a/src/goddard/dynlists/dynlist_mario_master.c b/src/goddard/dynlists/dynlist_mario_master.c new file mode 100644 index 00000000..6a5b19ca --- /dev/null +++ b/src/goddard/dynlists/dynlist_mario_master.c @@ -0,0 +1,1123 @@ +#include + +#include "dynlist_macros.h" +#include "dynlists.h" +#include "animdata.h" +#include "../dynlist_proc.h" +#include "../shape_helper.h" + +struct DynList dynlist_mario_master[] = { + BeginList(), + UseIntegerNames(TRUE), // Specify all object names as integers + + StartGroup(DYNOBJ_MARIO_MAIN_SHAPES_GROUP), + CallList(dynlist_mario_face_shape), + CallList(dynlist_mario_eye_right_shape), + CallList(dynlist_mario_eye_left_shape), + CallList(dynlist_mario_eyebrow_right_shape), + CallList(dynlist_mario_eyebrow_left_shape), + CallList(dynlist_mario_mustache_shape), + EndGroup(DYNOBJ_MARIO_MAIN_SHAPES_GROUP), + + MakeDynObj(D_LIGHT, DYNOBJ_SILVER_STAR_LIGHT), + SetId(1), + SetDiffuse(1.0, 1.0, 1.0), + SetFlag(0x20), + SetShapePtrPtr(&gShapeSilverStar), + + MakeDynObj(D_LIGHT, DYNOBJ_RED_STAR_LIGHT), + SetId(0), + SetDiffuse(1.0, 0.0, 0.0), + SetShapePtrPtr(&gShapeRedStar), + + StartGroup(0x1), + + MakeDynObj(D_NET, DYNOBJ_MARIO_MAIN_NET), + SetType(2), + SetFlag(0x2), + SetShapePtr(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(112.873, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, -20010.0), + + // right eyelid skinning + MakeNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(116.3, 182.6, -70.2), + MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 162.007), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(7, 95.0), + SetSkinWeight(8, 70.0), + SetSkinWeight(48, 90.0), + SetSkinWeight(49, 100.0), + SetSkinWeight(128, 60.0), + SetSkinWeight(131, 90.0), + SetSkinWeight(132, 100.0), + SetSkinWeight(133, 95.0), + SetSkinWeight(134, 70.0), + SetSkinWeight(428, 50.0), + SetSkinWeight(429, 20.0), + SetSkinWeight(51, 35.0), + SetSkinWeight(124, 10.0), + SetSkinWeight(126, 10.0), + SetSkinWeight(127, 5.0), + SetSkinWeight(130, 50.0), + SetSkinWeight(135, 20.0), + SetSkinWeight(136, 10.0), + SetSkinWeight(423, 35.0), + SetSkinWeight(46, 40.0), + SetSkinWeight(47, 10.0), + SetSkinWeight(82, 10.0), + MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(382.3, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), + + // left eyelid skinning + MakeNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-116.3, 182.6, -70.2), + MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 162.007), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(196, 90.0), + SetSkinWeight(375, 70.0), + SetSkinWeight(392, 70.0), + SetSkinWeight(393, 95.0), + SetSkinWeight(394, 95.0), + SetSkinWeight(395, 100.0), + SetSkinWeight(396, 100.0), + SetSkinWeight(397, 90.0), + SetSkinWeight(399, 60.0), + SetSkinWeight(428, 50.0), + SetSkinWeight(429, 20.0), + SetSkinWeight(197, 50.0), + SetSkinWeight(385, 5.0), + SetSkinWeight(388, 10.0), + SetSkinWeight(389, 10.0), + SetSkinWeight(390, 20.0), + SetSkinWeight(391, 35.0), + SetSkinWeight(398, 10.0), + SetSkinWeight(419, 35.0), + SetSkinWeight(400, 40.0), + SetSkinWeight(374, 10.0), + SetSkinWeight(387, 10.0), + MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(420.0, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), + + // right jaw skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, -154.9, 118.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_JAW_JOINT), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -111.558), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(98, 100.0), + SetSkinWeight(104, 100.0), + SetSkinWeight(189, 100.0), + SetSkinWeight(358, 100.0), + SetSkinWeight(5, 40.0), + SetSkinWeight(10, 38.0), + SetSkinWeight(380, 40.0), + SetSkinWeight(405, 38.0), + SetSkinWeight(39, 50.0), + SetSkinWeight(117, 50.0), + SetSkinWeight(337, 50.0), + SetSkinWeight(11, 40.0), + SetSkinWeight(379, 40.0), + SetSkinWeight(105, 50.0), + SetSkinWeight(116, 50.0), + SetSkinWeight(406, 50.0), + SetSkinWeight(85, 70.0), + SetSkinWeight(86, 60.0), + SetSkinWeight(111, 30.0), + SetSkinWeight(159, 50.0), + SetSkinWeight(357, 50.0), + SetSkinWeight(416, 60.0), + SetSkinWeight(6, 25.0), + SetSkinWeight(407, 25.0), + SetSkinWeight(408, 30.0), + SetSkinWeight(4, 30.0), + SetSkinWeight(410, 70.0), + SetSkinWeight(409, 30.0), + SetSkinWeight(109, 15.0), + SetSkinWeight(355, 15.0), + SetSkinWeight(35, 5.0), + SetSkinWeight(372, 5.0), + SetSkinWeight(376, 5.0), + SetSkinWeight(110, 5.0), + SetSkinWeight(16, 3.0), + SetSkinWeight(17, 3.0), + SetSkinWeight(34, 3.0), + SetSkinWeight(373, 3.0), + SetSkinWeight(381, 3.0), + SetSkinWeight(383, 3.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_JAW_JOINT), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -31.153), + SetAttachOffset(141.0, 0.0, 0.0), + SetSkinWeight(31, 80.0), + SetSkinWeight(32, 80.0), + SetSkinWeight(39, 30.0), + SetSkinWeight(40, 10.0), + SetSkinWeight(99, 100.0), + SetSkinWeight(100, 100.0), + SetSkinWeight(105, 50.0), + SetSkinWeight(113, 100.0), + SetSkinWeight(114, 100.0), + SetSkinWeight(115, 100.0), + SetSkinWeight(116, 50.0), + SetSkinWeight(117, 20.0), + SetSkinWeight(177, 20.0), + SetSkinWeight(336, 10.0), + SetSkinWeight(337, 30.0), + SetSkinWeight(406, 50.0), + SetSkinWeight(411, 80.0), + SetSkinWeight(412, 100.0), + SetSkinWeight(413, 100.0), + SetSkinWeight(414, 100.0), + SetSkinWeight(415, 80.0), + SetSkinWeight(418, 100.0), + SetSkinWeight(409, 28.0), + SetSkinWeight(86, 8.0), + SetSkinWeight(416, 4.0), + SetSkinWeight(4, 28.0), + SetSkinWeight(5, 3.0), + SetSkinWeight(10, 5.0), + SetSkinWeight(380, 5.0), + SetSkinWeight(405, 5.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_191), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(80.1, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), + + // nose skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, 15.3, 295.1), + MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -178.586), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(15, 5.0), + SetSkinWeight(18, 30.0), + SetSkinWeight(23, 70.0), + SetSkinWeight(24, 40.0), + SetSkinWeight(25, 90.0), + SetSkinWeight(26, 70.0), + SetSkinWeight(27, 90.0), + SetSkinWeight(28, 40.0), + SetSkinWeight(29, 70.0), + SetSkinWeight(30, 90.0), + SetSkinWeight(41, 70.0), + SetSkinWeight(160, 70.0), + SetSkinWeight(161, 100.0), + SetSkinWeight(182, 90.0), + SetSkinWeight(183, 90.0), + SetSkinWeight(346, 70.0), + SetSkinWeight(347, 30.0), + SetSkinWeight(348, 70.0), + SetSkinWeight(349, 40.0), + SetSkinWeight(350, 30.0), + SetSkinWeight(351, 70.0), + SetSkinWeight(352, 90.0), + SetSkinWeight(353, 5.0), + SetSkinWeight(386, 5.0), + SetSkinWeight(430, 70.0), + SetSkinWeight(431, 70.0), + SetSkinWeight(433, 70.0), + SetSkinWeight(434, 70.0), + SetSkinWeight(435, 70.0), + SetSkinWeight(436, 70.0), + SetSkinWeight(437, 70.0), + SetSkinWeight(439, 70.0), + SetSkinWeight(19, 40.0), + SetSkinWeight(20, 5.0), + SetSkinWeight(21, 5.0), + SetSkinWeight(22, 30.0), + SetSkinWeight(82, 5.0), + SetSkinWeight(83, 5.0), + SetSkinWeight(87, 5.0), + SetSkinWeight(384, 5.0), + SetSkinWeight(387, 5.0), + SetSkinWeight(432, 40.0), + SetSkinWeight(438, 40.0), + MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(276.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), + + // right ear skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(294.7, 13.1, -82.1), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 26.565), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(59, 80.0), + SetSkinWeight(60, 50.0), + SetSkinWeight(61, 60.0), + SetSkinWeight(65, 100.0), + SetSkinWeight(66, 60.0), + SetSkinWeight(88, 10.0), + SetSkinWeight(89, 60.0), + SetSkinWeight(90, 80.0), + SetSkinWeight(91, 70.0), + SetSkinWeight(92, 100.0), + SetSkinWeight(118, 15.0), + SetSkinWeight(119, 5.0), + SetSkinWeight(120, 15.0), + SetSkinWeight(122, 60.0), + SetSkinWeight(123, 70.0), + SetSkinWeight(137, 10.0), + SetSkinWeight(138, 60.0), + SetSkinWeight(139, 10.0), + SetSkinWeight(140, 5.0), + SetSkinWeight(141, 10.0), + SetSkinWeight(167, 60.0), + SetSkinWeight(168, 70.0), + SetSkinWeight(224, 50.0), + SetSkinWeight(225, 70.0), + SetSkinWeight(226, 50.0), + SetSkinWeight(227, 50.0), + SetSkinWeight(228, 60.0), + SetSkinWeight(229, 60.0), + SetSkinWeight(235, 10.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(200.9, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), + + // left ear skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(-294.7, 13.1, -82.1), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(180.0, 180.0, -153.435), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(244, 5.0), + SetSkinWeight(267, 5.0), + SetSkinWeight(268, 5.0), + SetSkinWeight(299, 5.0), + SetSkinWeight(302, 5.0), + SetSkinWeight(307, 70.0), + SetSkinWeight(308, 70.0), + SetSkinWeight(309, 100.0), + SetSkinWeight(310, 70.0), + SetSkinWeight(311, 70.0), + SetSkinWeight(314, 100.0), + SetSkinWeight(315, 70.0), + SetSkinWeight(317, 80.0), + SetSkinWeight(318, 70.0), + SetSkinWeight(319, 80.0), + SetSkinWeight(320, 70.0), + SetSkinWeight(321, 10.0), + SetSkinWeight(322, 10.0), + SetSkinWeight(323, 10.0), + SetSkinWeight(324, 10.0), + SetSkinWeight(325, 60.0), + SetSkinWeight(326, 100.0), + SetSkinWeight(327, 100.0), + SetSkinWeight(328, 100.0), + SetSkinWeight(329, 80.0), + SetSkinWeight(330, 80.0), + SetSkinWeight(331, 60.0), + SetSkinWeight(332, 70.0), + SetSkinWeight(340, 70.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.02), + SetAttachOffset(200.9, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), + + // right lip corner skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(119.7, -161.4, 125.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.02, 0.0, -66.509), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(4, 42.0), + SetSkinWeight(5, 40.0), + SetSkinWeight(6, 75.0), + SetSkinWeight(10, 30.0), + SetSkinWeight(11, 40.0), + SetSkinWeight(16, 20.0), + SetSkinWeight(17, 15.0), + SetSkinWeight(33, 30.0), + SetSkinWeight(34, 20.0), + SetSkinWeight(35, 60.0), + SetSkinWeight(37, 10.0), + SetSkinWeight(43, 40.0), + SetSkinWeight(85, 30.0), + SetSkinWeight(86, 30.0), + SetSkinWeight(93, 30.0), + SetSkinWeight(94, 10.0), + SetSkinWeight(101, 100.0), + SetSkinWeight(103, 100.0), + SetSkinWeight(108, 10.0), + SetSkinWeight(109, 70.0), + SetSkinWeight(110, 80.0), + SetSkinWeight(111, 60.0), + SetSkinWeight(112, 70.0), + SetSkinWeight(159, 50.0), + SetSkinWeight(42, 30.0), + SetSkinWeight(102, 30.0), + SetSkinWeight(31, 20.0), + SetSkinWeight(32, 20.0), + SetSkinWeight(44, 15.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.028, 0.0, 0.0), + SetAttachOffset(184.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), + + // left lip corner skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(-119.7, -161.4, 125.5), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.02, 0.0, -66.509), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(187, 100.0), + SetSkinWeight(273, 30.0), + SetSkinWeight(342, 10.0), + SetSkinWeight(354, 40.0), + SetSkinWeight(355, 70.0), + SetSkinWeight(356, 70.0), + SetSkinWeight(357, 50.0), + SetSkinWeight(371, 10.0), + SetSkinWeight(372, 60.0), + SetSkinWeight(373, 20.0), + SetSkinWeight(376, 80.0), + SetSkinWeight(377, 100.0), + SetSkinWeight(378, 10.0), + SetSkinWeight(379, 40.0), + SetSkinWeight(380, 30.0), + SetSkinWeight(381, 15.0), + SetSkinWeight(383, 20.0), + SetSkinWeight(404, 30.0), + SetSkinWeight(405, 30.0), + SetSkinWeight(407, 75.0), + SetSkinWeight(408, 60.0), + SetSkinWeight(409, 42.0), + SetSkinWeight(410, 30.0), + SetSkinWeight(416, 36.0), + SetSkinWeight(199, 15.0), + SetSkinWeight(415, 20.0), + SetSkinWeight(411, 20.0), + SetSkinWeight(188, 20.0), + SetSkinWeight(198, 20.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.028, 0.0, 0.0), + SetAttachOffset(184.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), + + // ??? + MakeNetWithSubGroup(0x8F), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, -162.2, 121.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_140), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -176.775), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(42, 70.0), + SetSkinWeight(44, 85.0), + SetSkinWeight(102, 70.0), + SetSkinWeight(188, 80.0), + SetSkinWeight(198, 80.0), + SetSkinWeight(199, 85.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_137), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(242.8, 0.0, 0.0), + EndNetWithSubGroup(0x8F), + + // cap skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, 233.8, -148.8), + MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 153.932), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(68, 90.0), + SetSkinWeight(69, 100.0), + SetSkinWeight(70, 100.0), + SetSkinWeight(71, 100.0), + SetSkinWeight(75, 100.0), + SetSkinWeight(76, 100.0), + SetSkinWeight(77, 100.0), + SetSkinWeight(79, 80.0), + SetSkinWeight(129, 100.0), + SetSkinWeight(147, 90.0), + SetSkinWeight(148, 90.0), + SetSkinWeight(149, 100.0), + SetSkinWeight(150, 100.0), + SetSkinWeight(151, 100.0), + SetSkinWeight(154, 100.0), + SetSkinWeight(155, 100.0), + SetSkinWeight(156, 100.0), + SetSkinWeight(157, 100.0), + SetSkinWeight(184, 100.0), + SetSkinWeight(185, 100.0), + SetSkinWeight(192, 100.0), + SetSkinWeight(193, 90.0), + SetSkinWeight(194, 80.0), + SetSkinWeight(195, 100.0), + SetSkinWeight(201, 100.0), + SetSkinWeight(202, 100.0), + SetSkinWeight(230, 100.0), + SetSkinWeight(360, 100.0), + SetSkinWeight(361, 100.0), + SetSkinWeight(362, 100.0), + SetSkinWeight(363, 100.0), + SetSkinWeight(364, 100.0), + SetSkinWeight(366, 100.0), + SetSkinWeight(367, 90.0), + SetSkinWeight(368, 100.0), + SetSkinWeight(369, 90.0), + SetSkinWeight(420, 100.0), + SetSkinWeight(421, 100.0), + SetSkinWeight(422, 100.0), + SetSkinWeight(424, 100.0), + SetSkinWeight(425, 100.0), + SetSkinWeight(426, 100.0), + SetSkinWeight(427, 100.0), + SetSkinWeight(58, 100.0), + SetSkinWeight(242, 100.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 80.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(50, 100.0), + SetSkinWeight(54, 100.0), + SetSkinWeight(55, 100.0), + SetSkinWeight(56, 100.0), + SetSkinWeight(57, 100.0), + SetSkinWeight(67, 80.0), + SetSkinWeight(78, 90.0), + SetSkinWeight(80, 100.0), + SetSkinWeight(121, 100.0), + SetSkinWeight(142, 50.0), + SetSkinWeight(145, 80.0), + SetSkinWeight(146, 100.0), + SetSkinWeight(152, 90.0), + SetSkinWeight(158, 90.0), + SetSkinWeight(186, 100.0), + SetSkinWeight(240, 80.0), + SetSkinWeight(246, 100.0), + SetSkinWeight(247, 100.0), + SetSkinWeight(248, 50.0), + SetSkinWeight(249, 90.0), + SetSkinWeight(251, 100.0), + SetSkinWeight(303, 90.0), + SetSkinWeight(304, 100.0), + SetSkinWeight(305, 100.0), + SetSkinWeight(306, 100.0), + SetSkinWeight(335, 100.0), + SetSkinWeight(338, 100.0), + SetSkinWeight(345, 100.0), + SetSkinWeight(359, 90.0), + SetSkinWeight(365, 100.0), + SetSkinWeight(370, 80.0), + SetSkinWeight(401, 100.0), + SetSkinWeight(402, 100.0), + SetSkinWeight(403, 100.0), + SetSkinWeight(417, 80.0), + SetSkinWeight(125, 60.0), + SetSkinWeight(143, 50.0), + SetSkinWeight(270, 50.0), + SetSkinWeight(294, 60.0), + SetSkinWeight(239, 50.0), + SetSkinWeight(245, 50.0), + MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(528.3, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), + + // right eye skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(29.7, 192.4, -3.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(184.483, -178.885, 82.485), + SetAttachOffset(0.0, 0.0, 0.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(329.8, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), + MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET), + SetType(3), + SetShapePtr(DYNOBJ_MARIO_RIGHT_EYE_SHAPE), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, 0.0), + + // left eye skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(-29.0, 192.3, -2.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-6.873, 0.206, -97.461), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(429, 16.0), + MakeAttachedJoint(DYNOMJ_MARIO_LEFT_EYE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(329.8, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), + MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET), + SetType(3), + SetShapePtr(DYNOBJ_MARIO_LEFT_EYE_SHAPE), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, 0.0), + + // right eyebrow net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + // attach right eyebrow to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(20.8, 0.0, -8.5), + // right part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(231.3, 287.1, -51.4), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(10.886, 0.0, 177.51), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(5, 70.0), + SetSkinWeight(6, 80.0), + SetSkinWeight(7, 70.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(11, 70.0), + SetSkinWeight(12, 100.0), + SetSkinWeight(19, 50.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(23, 70.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(345.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), + // left part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(23.0, 305.5, -44.6), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-3.437, -0.069, -177.758), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(16, 80.0), + SetSkinWeight(17, 100.0), + SetSkinWeight(18, 80.0), + SetSkinWeight(22, 70.0), + SetSkinWeight(24, 50.0), + SetSkinWeight(25, 80.0), + SetSkinWeight(15, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(399.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), + // middle part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(123.1, 385.5, -46.4), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(2.865, 0.029, 182.377), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 100.0), + SetSkinWeight(3, 100.0), + SetSkinWeight(4, 100.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(10, 100.0), + SetSkinWeight(13, 100.0), + SetSkinWeight(14, 100.0), + SetSkinWeight(15, 70.0), + SetSkinWeight(21, 100.0), + SetSkinWeight(16, 20.0), + SetSkinWeight(18, 20.0), + SetSkinWeight(22, 30.0), + SetSkinWeight(25, 20.0), + SetSkinWeight(6, 20.0), + SetSkinWeight(11, 30.0), + SetSkinWeight(20, 20.0), + SetSkinWeight(23, 30.0), + SetSkinWeight(5, 30.0), + SetSkinWeight(7, 30.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(19, 50.0), + SetSkinWeight(24, 50.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(388.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), + + // left eyebrow net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + // attach left eyebrow to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(-18.5, 0.0, -1.0), + // left part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-233.6, 287.1, -51.4), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-6.876, 0.0, 177.51), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(10, 80.0), + SetSkinWeight(11, 80.0), + SetSkinWeight(13, 80.0), + SetSkinWeight(14, 80.0), + SetSkinWeight(18, 60.0), + SetSkinWeight(21, 60.0), + SetSkinWeight(25, 60.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(345.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), + // right part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-25.3, 305.5, -44.6), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-9.733, -0.388, -177.186), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 70.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 70.0), + SetSkinWeight(3, 70.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(12, 70.0), + SetSkinWeight(19, 30.0), + SetSkinWeight(15, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(399.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), + // middle part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-125.4, 385.5, -46.4), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-8.004, -0.61, 181.847), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(4, 70.0), + SetSkinWeight(6, 100.0), + SetSkinWeight(7, 100.0), + SetSkinWeight(8, 80.0), + SetSkinWeight(15, 70.0), + SetSkinWeight(16, 80.0), + SetSkinWeight(17, 100.0), + SetSkinWeight(19, 70.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(22, 80.0), + SetSkinWeight(23, 60.0), + SetSkinWeight(24, 100.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(0, 30.0), + SetSkinWeight(2, 30.0), + SetSkinWeight(10, 20.0), + SetSkinWeight(11, 20.0), + SetSkinWeight(13, 20.0), + SetSkinWeight(14, 20.0), + SetSkinWeight(18, 40.0), + SetSkinWeight(21, 40.0), + SetSkinWeight(25, 40.0), + SetSkinWeight(3, 30.0), + SetSkinWeight(12, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(388.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), + + // mustache net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_MUSTACHE_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_MUSTACHE_SHAPE), + // attach mustache to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.02, -0.002, 0.04), + SetAttachOffset(0.0, 0.0, 0.0), + // left mustache skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), + SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 180.0, 0.0), + SetAttachOffset(4.2, -86.5, 415.5), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-179.98, -164.53, -29.34), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(3, 50.0), + SetSkinWeight(4, 50.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(11, 70.0), + SetSkinWeight(12, 80.0), + SetSkinWeight(13, 70.0), + SetSkinWeight(18, 80.0), + SetSkinWeight(19, 80.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(21, 100.0), + SetSkinWeight(22, 100.0), + SetSkinWeight(23, 100.0), + SetSkinWeight(25, 100.0), + SetSkinWeight(27, 100.0), + SetSkinWeight(28, 50.0), + SetSkinWeight(29, 40.0), + SetSkinWeight(30, 40.0), + SetSkinWeight(31, 100.0), + SetSkinWeight(36, 50.0), + SetSkinWeight(37, 50.0), + SetSkinWeight(42, 40.0), + SetSkinWeight(45, 50.0), + SetSkinWeight(46, 50.0), + SetSkinWeight(47, 80.0), + SetSkinWeight(50, 40.0), + SetSkinWeight(51, 100.0), + SetSkinWeight(53, 40.0), + SetSkinWeight(54, 80.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.028, 0.0, 0.02), + SetAttachOffset(292.7, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), + // right mustache skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), + SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(-4.2, -86.5, 415.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 15.47, 150.66), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 80.0), + SetSkinWeight(2, 80.0), + SetSkinWeight(6, 100.0), + SetSkinWeight(7, 100.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(9, 50.0), + SetSkinWeight(10, 50.0), + SetSkinWeight(14, 50.0), + SetSkinWeight(15, 50.0), + SetSkinWeight(16, 50.0), + SetSkinWeight(17, 80.0), + SetSkinWeight(24, 100.0), + SetSkinWeight(26, 100.0), + SetSkinWeight(32, 80.0), + SetSkinWeight(33, 100.0), + SetSkinWeight(34, 70.0), + SetSkinWeight(35, 50.0), + SetSkinWeight(38, 40.0), + SetSkinWeight(39, 40.0), + SetSkinWeight(40, 40.0), + SetSkinWeight(41, 50.0), + SetSkinWeight(43, 50.0), + SetSkinWeight(44, 50.0), + SetSkinWeight(48, 80.0), + SetSkinWeight(49, 70.0), + SetSkinWeight(52, 40.0), + SetSkinWeight(55, 80.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(292.7, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), + + // right mustache animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_mustache_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), + + // left mustache animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_mustache_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), + + // left eyebrow animators + MakeDynObj(D_DATA_GRP, 32), + LinkWithPtr(&anim_mario_lips_1), + MakeDynObj(D_ANIMATOR, 33), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(32), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 41), + LinkWithPtr(&anim_mario_lips_2), + MakeDynObj(D_ANIMATOR, 42), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(41), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 50), + LinkWithPtr(&anim_mario_eyebrows_1), + MakeDynObj(D_ANIMATOR, 51), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(50), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), + + // right eyebrow animators + MakeDynObj(D_DATA_GRP, 63), + LinkWithPtr(&anim_mario_eyebrows_equalizer), + MakeDynObj(D_ANIMATOR, 64), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(63), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), + MakeDynObj(D_DATA_GRP, 66), + LinkWithPtr(&anim_mario_eyebrows_2), + MakeDynObj(D_ANIMATOR, 67), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(66), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 72), + LinkWithPtr(&anim_mario_eyebrows_3), + MakeDynObj(D_ANIMATOR, 73), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(72), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), + MakeDynObj(D_DATA_GRP, 75), + LinkWithPtr(&anim_mario_eyebrows_4), + MakeDynObj(D_ANIMATOR, 76), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(75), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 84), + LinkWithPtr(&anim_mario_eyebrows_5), + MakeDynObj(D_ANIMATOR, 85), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(84), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), + + // left eye animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eye_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EYE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + + // right eye animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eye_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EYE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + + // cap animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_cap), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_CAP_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_CAP_JOINT_1), + + // left lip corner animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_3), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), + + // right lip corner animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_4), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), + + // left ear animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_ear_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), + + // right ear animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), + LinkWithPtr(&anim_mario_ear_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), + + // nose animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_nose), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_NOSE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_NOSE_JOINT_1), + + // animator for left side of jaw + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_5), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_JAW_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_JAW_JOINT), + + // animator for right side of jaw + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_6), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_JAW_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_JAW_JOINT), + + // left eyelid animator + MakeDynObj(D_DATA_GRP, DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eyelid_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_LEFT_EYELID_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), + LinkWith(DYNOBJ_LEFT_EYELID_JOINT_1), + + // right eyelid animator + MakeDynObj(D_DATA_GRP, DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eyelid_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_RIGHT_EYELID_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), + LinkWith(DYNOBJ_RIGHT_EYELID_JOINT_1), + + // whole head animator? + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_intro), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_HEAD_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_MAIN_NET), + + // silver star animator + MakeDynObj(D_DATA_GRP, DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_silver_star), + MakeDynObj(D_ANIMATOR, DYNOBJ_SILVER_STAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_SILVER_STAR_LIGHT), + + // red star animator + MakeDynObj(D_DATA_GRP, DYNOBJ_RED_STAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_red_star), + MakeDynObj(D_ANIMATOR, DYNOBJ_RED_STAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_RED_STAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_RED_STAR_LIGHT), + + EndGroup(0x1), + + UseObj(0x1), + + UseIntegerNames(FALSE), + EndList(), +}; diff --git a/src/goddard/dynlists/dynlist_test_cube.c b/src/goddard/dynlists/dynlist_test_cube.c new file mode 100644 index 00000000..1ceb6426 --- /dev/null +++ b/src/goddard/dynlists/dynlist_test_cube.c @@ -0,0 +1,82 @@ +// early unused test dynlist +#include + +#include "dynlist_macros.h" +#include "dynlists.h" +#include "../dynlist_proc.h" +// maybe move types into the dynlists.h file? + +struct DynList dynlist_test_cube[] = { + BeginList(), + + StartGroup("ico1vg"), + MakeVertex(-2.0, 0.0, -2.0), + MakeVertex(-2.0, 0.0, 2.0), + MakeVertex(2.0, 0.0, 2.0), + MakeVertex(2.0, 0.0, -2.0), + MakeVertex(0.0, 3.0, 0.0), + MakeVertex(0.0, -3.0, 0.0), + EndGroup("ico1vg"), + + StartGroup("ico1pg"), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + EndGroup("ico1pg"), + + UseObj("ico1pg"), + MapVertices("ico1vg"), + + MakeDynObj(D_SHAPE, "ico1_sh"), + SetNodeGroup("ico1vg"), + SetPlaneGroup("ico1pg"), + + EndList(), +}; diff --git a/src/goddard/dynlists/dynlist_unused.c b/src/goddard/dynlists/dynlist_unused.c new file mode 100644 index 00000000..2ce4dd7d --- /dev/null +++ b/src/goddard/dynlists/dynlist_unused.c @@ -0,0 +1,75 @@ +#include + +#include "dynlist_macros.h" +#include "dynlists.h" +#include "../dynlist_proc.h" + +struct DynList dynlist_spot_shape[] = { + BeginList(), + + StartGroup("spotvg"), + MakeVertex(0.0, 0.0, 0.0), + MakeVertex(1.0, -1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(1.0, 1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(-1.0, 1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(-1.0, -1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(0.0, 0.0, 0.0), + EndGroup("spotvg"), + + StartGroup("spotpg"), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + EndGroup("spotpg"), + + UseObj("spotpg"), + MapVertices("spotvg"), + + MakeDynObj(D_SHAPE, "spot_sh"), + SetNodeGroup("spotvg"), + SetPlaneGroup("spotpg"), + SetParamF(PARM_F_ALPHA, 0.1), + + EndList(), +}; diff --git a/src/goddard/dynlists/dynlists.h b/src/goddard/dynlists/dynlists.h new file mode 100644 index 00000000..c134a21c --- /dev/null +++ b/src/goddard/dynlists/dynlists.h @@ -0,0 +1,148 @@ +#ifndef GD_DYNLISTS_H +#define GD_DYNLISTS_H + +#include "../gd_types.h" + +// Dynamic Object names +enum { + DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_2 = 3, + DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1 = 6, + DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP = 7, + DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMATOR = 8, + DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET = 9, + DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_2 = 12, + DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1 = 15, + DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP = 16, + DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMATOR = 17, + DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET = 18, + DYNOBJ_MARIO_MUSTACHE_NET = 21, // (left and right mustache skin nets are attached to this net) + DYNOBJ_MARIO_MUSTACHE_VTX_GROUP = 22, + DYNOBJ_MARIO_MUSTACHE_TRI_GROUP = 23, + DYNOBJ_MARIO_MUSTACHE_MTL_GROUP = 24, + DYNOBJ_MARIO_MUSTACHE_SHAPE = 25, + DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_2 = 28, + DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1 = 31, + DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET = 34, + DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_2 = 37, + DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1 = 40, + DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET = 43, + DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_2 = 46, + DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1 = 49, + DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET = 52, + DYNOBJ_MARIO_LEFT_EYEBROW_NET = 55, + DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP = 56, + DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP = 57, + DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP = 58, + DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE = 59, + DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2 = 62, + DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1 = 65, + DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET = 68, + DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2 = 71, + DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1 = 74, + DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET = 77, + DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_2 = 80, + DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1 = 83, + DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET = 86, + DYNOBJ_MARIO_RIGHT_EYEBROW_NET = 89, + DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP = 90, + DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP = 91, + DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP = 92, + DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE = 93, + DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET = 96, + DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP = 97, + DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP = 98, + DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP = 99, + DYNOBJ_MARIO_LEFT_EYE_SHAPE = 100, + DYNOMJ_MARIO_LEFT_EYE_JOINT_2 = 103, + DYNOBJ_MARIO_LEFT_EYE_JOINT_1 = 106, + DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP = 107, + DYNOBJ_MARIO_LEFT_EYE_ANIMATOR = 108, + DYNOBJ_MARIO_LEFT_EYE_SKIN_NET = 109, + DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET = 112, + DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP = 113, + DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP = 114, + DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP = 115, + DYNOBJ_MARIO_RIGHT_EYE_SHAPE = 116, + DYNOBJ_MARIO_RIGHT_EYE_JOINT_2 = 119, + DYNOBJ_MARIO_RIGHT_EYE_JOINT_1 = 122, + DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP = 123, + DYNOBJ_MARIO_RIGHT_EYE_ANIMATOR = 124, + DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET = 125, + DYNOBJ_MARIO_CAP_JOINT_2 = 128, + DYNOBJ_MARIO_CAP_JOINT_1 = 131, + DYNOBJ_MARIO_CAP_ANIMDATA_GROUP = 132, + DYNOBJ_MARIO_CAP_ANIMATOR = 133, + DYNOBJ_MARIO_CAP_SKIN_NET = 134, + DYNOBJ_MARIO_UNKNOWN_137 = 137, + DYNOBJ_MARIO_UNKNOWN_140 = 140, + DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_2 = 146, + DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1 = 149, + DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP = 150, + DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMATOR = 151, + DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET = 152, + DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_2 = 155, + DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1 = 158, + DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP = 159, + DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMATOR = 160, + DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET = 161, + DYNOBJ_MARIO_LEFT_EAR_JOINT_2 = 164, + DYNOBJ_MARIO_LEFT_EAR_JOINT_1 = 167, // 167 "N167l" + DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP = 168, + DYNOBJ_MARIO_LEFT_EAR_ANIMATOR = 169, + DYNOBJ_MARIO_LEFT_EAR_SKIN_NET = 170, + DYNOBJ_MARIO_RIGHT_EAR_JOINT_2 = 173, + DYNOBJ_MARIO_RIGHT_EAR_JOINT_1 = 176, + DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP = 177, + DYNOBJ_MARIO_RIGHT_EAR_ANIMATOR = 178, + DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET = 179, + DYNOBJ_MARIO_NOSE_JOINT_2 = 182, + DYNOBJ_MARIO_NOSE_JOINT_1 = 185, + DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP = 186, + DYNOBJ_MARIO_NOSE_ANIMATOR = 187, + DYNOBJ_MARIO_NOSE_SKIN_NET = 188, + DYNOBJ_MARIO_UNKNOWN_191 = 191, + DYNOBJ_MARIO_LEFT_JAW_JOINT = 194, + DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP = 195, + DYNOBJ_MARIO_LEFT_JAW_ANIMATOR = 196, + DYNOBJ_MARIO_RIGHT_JAW_JOINT = 197, + DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP = 198, + DYNOBJ_MARIO_RIGHT_JAW_ANIMATOR = 199, + DYNOBJ_MARIO_JAW_SKIN_NET = 200, + DYNOBJ_LEFT_EYELID_JOINT_2 = 203, + DYNOBJ_LEFT_EYELID_JOINT_1 = 206, + DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP = 207, + DYNOBJ_LEFT_EYELID_ANIMATOR = 208, + DYNOBJ_LEFT_EYELID_SKIN_NET = 209, + DYNOBJ_RIGHT_EYELID_JOINT_2 = 212, + DYNOBJ_RIGHT_EYELID_JOINT_1 = 215, + DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP = 216, + DYNOBJ_RIGHT_EYELID_ANIMATOR = 217, + DYNOBJ_RIGHT_EYELID_SKIN_NET = 218, + DYNOBJ_MARIO_MAIN_NET = 221, // rename to HEAD_NET? + DYNOBJ_MARIO_FACE_VTX_GROUP = 222, + DYNOBJ_MARIO_FACE_TRI_GROUP = 223, + DYNOBJ_MARIO_FACE_MTL_GROUP = 224, + DYNOBJ_MARIO_FACE_SHAPE = 225, + DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP = 226, + DYNOBJ_MARIO_HEAD_ANIMATOR = 227, + DYNOBJ_SILVER_STAR_LIGHT = 228, // "N228l" + DYNOBJ_SILVER_STAR_ANIMDATA_GROUP = 229, + DYNOBJ_SILVER_STAR_ANIMATOR = 230, + DYNOBJ_RED_STAR_LIGHT = 231, // "N231l" + DYNOBJ_RED_STAR_ANIMDATA_GROUP = 232, + DYNOBJ_RED_STAR_ANIMATOR = 233, + DYNOBJ_MARIO_MAIN_SHAPES_GROUP = 1000, // "N1000l" + DYNOBJ_MARIO_MAIN_ANIMATOR = 1001 // root animator +}; + +extern struct DynList dynlist_test_cube[]; +extern struct DynList dynlist_spot_shape[]; +extern struct DynList dynlist_mario_face_shape[]; +extern struct DynList dynlist_mario_eye_right_shape[]; +extern struct DynList dynlist_mario_eye_left_shape[]; +extern struct DynList dynlist_mario_eyebrow_right_shape[]; +extern struct DynList dynlist_mario_eyebrow_left_shape[]; +extern struct DynList dynlist_mario_mustache_shape[]; +extern struct DynList dynlist_mario_master[]; + +#endif // GD_DYNLISTS_H diff --git a/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c new file mode 100644 index 00000000..28569138 --- /dev/null +++ b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c @@ -0,0 +1,170 @@ +#include + +#include "macros.h" +#include "dynlist_macros.h" +#include "dynlists.h" +#include "../dynlist_proc.h" + +static s16 verts_mario_eyebrow_right[][3] = { + { 105, 391, 363 }, { 62, 370, 378 }, { 86, 366, 370 }, { 171, 380, 339 }, { 139, 377, 353 }, + { 193, 353, 331 }, { 204, 314, 297 }, { 175, 342, 305 }, { 209, 361, 291 }, { 124, 360, 323 }, + { 161, 393, 306 }, { 230, 323, 286 }, { 233, 276, 289 }, { 123, 402, 319 }, { 85, 399, 334 }, + { 73, 355, 342 }, { 45, 330, 354 }, { 17, 294, 356 }, { 29, 348, 361 }, { 212, 358, 323 }, + { 214, 324, 318 }, { 139, 394, 353 }, { 57, 339, 377 }, { 231, 330, 311 }, { 58, 384, 349 }, + { 41, 345, 382 }, +}; + +static struct GdVtxData vtx_mario_eyebrow_right = { ARRAY_COUNT(verts_mario_eyebrow_right), 0x1, verts_mario_eyebrow_right }; + +static u16 facedata_mario_eyebrow_right[][4] = { + { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 20, 23, 19 }, { 0, 1, 25, 22 }, { 0, 0, 21, 13 }, + { 0, 2, 15, 9 }, { 0, 7, 6, 20 }, { 0, 3, 19, 8 }, { 0, 25, 1, 24 }, { 0, 19, 5, 20 }, + { 0, 19, 3, 5 }, { 0, 3, 21, 4 }, { 0, 21, 0, 4 }, { 0, 0, 2, 4 }, { 0, 1, 22, 2 }, + { 0, 20, 12, 23 }, { 0, 13, 14, 0 }, { 0, 4, 2, 9 }, { 0, 20, 5, 7 }, { 0, 22, 17, 16 }, + { 0, 8, 10, 3 }, { 0, 24, 18, 25 }, { 0, 23, 11, 8 }, { 0, 14, 24, 1 }, { 0, 5, 4, 9 }, + { 0, 2, 22, 15 }, { 0, 11, 23, 12 }, { 0, 25, 18, 17 }, { 0, 20, 6, 12 }, { 0, 10, 13, 21 }, + { 0, 8, 19, 23 }, { 0, 25, 17, 22 }, { 0, 1, 0, 14 }, { 0, 21, 3, 10 }, { 0, 22, 16, 15 }, + { 0, 9, 7, 5 }, +}; + +static struct GdFaceData faces_mario_eyebrow_right = { ARRAY_COUNT(facedata_mario_eyebrow_right), 0x1, facedata_mario_eyebrow_right }; + +struct DynList dynlist_mario_eyebrow_right_shape[] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP), + LinkWithPtr(&vtx_mario_eyebrow_right), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP), + LinkWithPtr(&faces_mario_eyebrow_right), + + StartGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.005, 0.0), // Why is green 0.005 on the right eyebrow, but 0.0 on the left eyebrow? + SetDiffuse(0.0, 0.0, 0.0), + EndGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), + + EndList(), +}; + +static s16 verts_mario_eyebrow_left[][3] = { + { -57, 339, 377 }, { -17, 294, 356 }, { -45, 341, 383 }, { -45, 330, 354 }, { -73, 355, 342 }, + { -52, 377, 349 }, { -139, 394, 353 }, { -123, 402, 319 }, { -161, 393, 306 }, { -233, 276, 289 }, + { -204, 314, 297 }, { -214, 324, 318 }, { -29, 335, 363 }, { -231, 330, 311 }, { -230, 323, 286 }, + { -86, 366, 370 }, { -124, 360, 323 }, { -139, 377, 353 }, { -193, 353, 331 }, { -62, 370, 378 }, + { -85, 399, 334 }, { -209, 361, 291 }, { -171, 380, 339 }, { -175, 342, 305 }, { -105, 391, 363 }, + { -212, 358, 323 }, +}; + +static struct GdVtxData vtx_mario_eyebrow_left = { ARRAY_COUNT(verts_mario_eyebrow_left), 0x1, verts_mario_eyebrow_left }; + +static u16 facedata_mario_eyebrow_left[][4] = { + { 0, 0, 1, 2 }, { 0, 8, 22, 6 }, { 0, 6, 7, 8 }, { 0, 9, 10, 11 }, { 0, 1, 12, 2 }, + { 0, 9, 13, 14 }, { 0, 4, 0, 15 }, { 0, 16, 17, 18 }, { 0, 19, 5, 20 }, { 0, 21, 14, 13 }, + { 0, 2, 12, 5 }, { 0, 22, 8, 21 }, { 0, 3, 1, 0 }, { 0, 23, 18, 11 }, { 0, 16, 15, 17 }, + { 0, 24, 20, 7 }, { 0, 13, 9, 11 }, { 0, 15, 0, 19 }, { 0, 17, 15, 24 }, { 0, 17, 24, 6 }, + { 0, 17, 6, 22 }, { 0, 18, 22, 25 }, { 0, 11, 18, 25 }, { 0, 4, 3, 0 }, { 0, 18, 23, 16 }, + { 0, 20, 24, 19 }, { 0, 13, 25, 21 }, { 0, 5, 19, 2 }, { 0, 21, 25, 22 }, { 0, 11, 10, 23 }, + { 0, 18, 17, 22 }, { 0, 15, 19, 24 }, { 0, 16, 4, 15 }, { 0, 7, 6, 24 }, { 0, 0, 2, 19 }, + { 0, 25, 13, 11 }, +}; + +static struct GdFaceData faces_mario_eyebrow_left = { ARRAY_COUNT(facedata_mario_eyebrow_left), 0x1, facedata_mario_eyebrow_left }; + +struct DynList dynlist_mario_eyebrow_left_shape[] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP), + LinkWithPtr(&vtx_mario_eyebrow_left), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP), + LinkWithPtr(&faces_mario_eyebrow_left), + + StartGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + EndGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), + + EndList(), +}; + +static s16 verts_mario_mustache[][3] = { + { -202, 15, 400 }, { -295, -13, 358 }, { -287, -45, 362 }, { 229, -89, 385 }, + { 214, -126, 385 }, { 221, -131, 360 }, { -266, 73, 363 }, { -202, 15, 375 }, + { -154, -160, 372 }, { -154, -148, 397 }, { -191, -150, 387 }, { 276, -74, 345 }, + { 287, -45, 362 }, { 276, -74, 370 }, { -221, -131, 360 }, { -214, -126, 385 }, + { -229, -89, 385 }, { -298, -45, 337 }, { 293, 20, 357 }, { 295, -13, 358 }, + { 307, -13, 333 }, { 202, 15, 400 }, { 266, 73, 363 }, { 202, 15, 375 }, + { -95, -25, 457 }, { 95, -25, 457 }, { -95, -25, 406 }, { 95, -25, 406 }, + { 154, -148, 397 }, { 110, -178, 416 }, { 121, -188, 384 }, { 266, 88, 338 }, + { -293, 20, 357 }, { -266, 88, 338 }, { -276, -74, 370 }, { -239, -95, 359 }, + { 197, -155, 362 }, { 191, -150, 387 }, { -68, -181, 427 }, { -110, -178, 416 }, + { -75, -191, 396 }, { -4, -157, 406 }, { 4, -157, 406 }, { -4, -157, 444 }, + { -197, -155, 362 }, { 154, -160, 372 }, { 239, -95, 359 }, { 298, -45, 337 }, + { -307, -13, 333 }, { -276, -74, 345 }, { 68, -181, 427 }, { 4, -157, 444 }, + { -121, -188, 384 }, { 75, -191, 396 }, { 304, 20, 332 }, { -304, 20, 332 }, +}; + +static struct GdVtxData vtx_mario_mustache = { ARRAY_COUNT(verts_mario_mustache), 0x1, verts_mario_mustache }; + +static u16 facedata_mario_mustache[][4] = { + { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 3, 5, 46 }, { 0, 6, 0, 7 }, { 0, 6, 7, 33 }, + { 0, 8, 9, 10 }, { 0, 8, 10, 44 }, { 0, 11, 47, 12 }, { 0, 11, 12, 13 }, { 0, 14, 15, 16 }, + { 0, 14, 16, 35 }, { 0, 2, 1, 48 }, { 0, 2, 48, 17 }, { 0, 18, 19, 20 }, { 0, 18, 20, 54 }, + { 0, 21, 22, 31 }, { 0, 21, 31, 23 }, { 0, 24, 25, 27 }, { 0, 24, 27, 26 }, { 0, 27, 25, 21 }, + { 0, 27, 21, 23 }, { 0, 0, 24, 26 }, { 0, 0, 26, 7 }, { 0, 28, 29, 30 }, { 0, 28, 30, 45 }, + { 0, 31, 22, 18 }, { 0, 31, 18, 54 }, { 0, 32, 6, 33 }, { 0, 32, 33, 55 }, { 0, 16, 34, 49 }, + { 0, 16, 49, 35 }, { 0, 36, 5, 4 }, { 0, 36, 4, 37 }, { 0, 38, 39, 52 }, { 0, 38, 52, 40 }, + { 0, 41, 42, 51 }, { 0, 41, 51, 43 }, { 0, 10, 15, 14 }, { 0, 10, 14, 44 }, { 0, 37, 28, 45 }, + { 0, 37, 45, 36 }, { 0, 35, 7, 26 }, { 0, 13, 3, 46 }, { 0, 13, 46, 11 }, { 0, 19, 12, 47 }, + { 0, 19, 47, 20 }, { 0, 1, 32, 55 }, { 0, 1, 55, 48 }, { 0, 34, 2, 17 }, { 0, 34, 17, 49 }, + { 0, 43, 38, 40 }, { 0, 43, 40, 41 }, { 0, 42, 53, 50 }, { 0, 42, 50, 51 }, { 0, 39, 9, 8 }, + { 0, 39, 8, 52 }, { 0, 29, 50, 53 }, { 0, 29, 53, 30 }, { 0, 51, 50, 25 }, { 0, 43, 51, 25 }, + { 0, 43, 25, 24 }, { 0, 29, 28, 25 }, { 0, 3, 13, 12 }, { 0, 3, 12, 21 }, { 0, 3, 21, 25 }, + { 0, 50, 29, 25 }, { 0, 25, 37, 4 }, { 0, 25, 28, 37 }, { 0, 25, 4, 3 }, { 0, 9, 39, 24 }, + { 0, 16, 15, 24 }, { 0, 39, 38, 24 }, { 0, 38, 43, 24 }, { 0, 10, 9, 24 }, { 0, 24, 0, 16 }, + { 0, 15, 10, 24 }, { 0, 8, 44, 14 }, { 0, 18, 22, 21 }, { 0, 19, 18, 21 }, { 0, 12, 19, 21 }, + { 0, 0, 6, 32 }, { 0, 0, 32, 1 }, { 0, 2, 34, 16 }, { 0, 2, 16, 0 }, { 0, 23, 11, 46 }, + { 0, 8, 14, 35 }, { 0, 23, 31, 54 }, { 0, 46, 27, 23 }, { 0, 8, 35, 26 }, { 0, 27, 46, 45 }, + { 0, 54, 20, 47 }, { 0, 54, 47, 11 }, { 0, 55, 33, 7 }, { 0, 7, 49, 55 }, { 0, 49, 17, 55 }, + { 0, 17, 48, 55 }, { 0, 35, 49, 7 }, { 0, 54, 11, 23 }, { 0, 46, 5, 45 }, { 0, 5, 36, 45 }, +}; + +static struct GdFaceData faces_mario_mustache = { ARRAY_COUNT(facedata_mario_mustache), 0x1, facedata_mario_mustache }; + +struct DynList dynlist_mario_mustache_shape[] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_MUSTACHE_VTX_GROUP), + LinkWithPtr(&vtx_mario_mustache), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_MUSTACHE_TRI_GROUP), + LinkWithPtr(&faces_mario_mustache), + + StartGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + EndGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_MUSTACHE_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_MUSTACHE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_MUSTACHE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), + + EndList(), +}; diff --git a/src/goddard/dynlists/dynlists_mario_eyes.c b/src/goddard/dynlists/dynlists_mario_eyes.c new file mode 100644 index 00000000..f01e21ff --- /dev/null +++ b/src/goddard/dynlists/dynlists_mario_eyes.c @@ -0,0 +1,160 @@ +#include + +#include "macros.h" +#include "dynlist_macros.h" +#include "dynlists.h" +#include "../dynlist_proc.h" + +static s16 verts_mario_eye_right[][3] = { + { 306, 26, 83 }, { 318, 18, 81 }, { 312, -13, 94 }, { 308, 43, 53 }, { 320, 35, 50 }, + { 308, 47, 12 }, { 320, 39, 9 }, { 316, 31, -30 }, { 304, 39, -27 }, { 311, 11, -58 }, + { 299, 19, -55 }, { 304, -21, -66 }, { 287, -46, -51 }, { 299, -54, -53 }, { 285, -64, -20 }, + { 297, -72, -23 }, { 286, -69, 20 }, { 299, -76, 17 }, { 301, -68, 57 }, { 289, -60, 60 }, + { 305, -47, 85 }, { 294, -40, 88 }, { 315, -35, 13 }, { 316, -33, 21 }, { 317, -28, 25 }, + { 293, -14, -64 }, { 316, -17, 67 }, { 312, -37, 61 }, { 310, -50, 44 }, { 307, -53, -14 }, + { 308, -42, -33 }, { 311, -22, -41 }, { 315, -2, -36 }, { 319, 10, -18 }, { 322, 13, 39 }, + { 320, 2, 59 }, { 318, -20, 29 }, { 308, -57, 15 }, { 315, -34, 4 }, { 315, -30, 0 }, + { 316, -22, -4 }, { 318, -14, -1 }, { 319, -9, 2 }, { 322, 16, 10 }, { 320, -8, 20 }, + { 319, -13, 24 }, { 320, -7, 11 }, { 301, -6, 96 }, +}; + +static struct GdVtxData vtx_mario_eye_right = { ARRAY_COUNT(verts_mario_eye_right), 0x1, verts_mario_eye_right }; + +static u16 facedata_mario_eye_right[][4] = { + { 1, 2, 1, 0 }, { 1, 1, 4, 3 }, { 1, 4, 6, 5 }, { 1, 6, 7, 5 }, { 1, 7, 9, 8 }, + { 1, 9, 11, 10 }, { 1, 11, 13, 12 }, { 1, 13, 15, 14 }, { 1, 15, 17, 16 }, { 1, 17, 18, 16 }, + { 1, 18, 20, 19 }, { 1, 20, 2, 21 }, { 1, 0, 47, 2 }, { 1, 2, 26, 1 }, { 1, 20, 26, 2 }, + { 1, 18, 27, 20 }, { 1, 17, 28, 18 }, { 1, 15, 29, 17 }, { 1, 13, 30, 15 }, { 1, 11, 31, 13 }, + { 1, 9, 31, 11 }, { 1, 7, 32, 9 }, { 1, 6, 33, 7 }, { 1, 4, 34, 6 }, { 1, 1, 35, 4 }, + { 1, 35, 34, 4 }, { 1, 34, 43, 6 }, { 1, 6, 43, 33 }, { 1, 7, 33, 32 }, { 1, 9, 32, 31 }, + { 1, 31, 30, 13 }, { 1, 30, 29, 15 }, { 1, 29, 37, 17 }, { 1, 17, 37, 28 }, { 1, 18, 28, 27 }, + { 1, 20, 27, 26 }, { 1, 26, 35, 1 }, { 1, 3, 0, 1 }, { 1, 5, 3, 4 }, { 1, 7, 8, 5 }, + { 1, 9, 10, 8 }, { 1, 11, 25, 10 }, { 1, 12, 25, 11 }, { 1, 14, 12, 13 }, { 1, 16, 14, 15 }, + { 1, 18, 19, 16 }, { 1, 2, 47, 21 }, { 1, 20, 21, 19 }, { 2, 26, 36, 35 }, { 2, 27, 36, 26 }, + { 2, 28, 24, 27 }, { 2, 37, 23, 28 }, { 2, 29, 38, 37 }, { 2, 30, 39, 29 }, { 2, 31, 40, 30 }, + { 2, 32, 40, 31 }, { 2, 33, 41, 32 }, { 2, 43, 42, 33 }, { 2, 34, 44, 43 }, { 2, 35, 45, 34 }, + { 2, 45, 44, 34 }, { 2, 44, 46, 43 }, { 2, 43, 46, 42 }, { 2, 33, 42, 41 }, { 2, 32, 41, 40 }, + { 2, 40, 39, 30 }, { 2, 39, 38, 29 }, { 2, 38, 22, 37 }, { 2, 37, 22, 23 }, { 2, 28, 23, 24 }, + { 2, 27, 24, 36 }, { 2, 36, 45, 35 }, { 3, 24, 23, 22 }, { 3, 22, 36, 24 }, { 3, 22, 38, 36 }, + { 3, 38, 39, 36 }, { 3, 39, 40, 36 }, { 3, 40, 41, 36 }, { 3, 41, 45, 36 }, { 3, 41, 42, 45 }, + { 3, 42, 46, 45 }, { 3, 46, 44, 45 }, +}; + +static struct GdFaceData faces_mario_eye_right = { ARRAY_COUNT(facedata_mario_eye_right), 0x1, facedata_mario_eye_right }; + +struct DynList dynlist_mario_eye_right_shape[] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP), + LinkWithPtr(&vtx_mario_eye_right), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP), + LinkWithPtr(&faces_mario_eye_right), + + StartGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), + // ??? + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.291, 1.0), + SetDiffuse(0.0, 0.291, 1.0), + // Iris color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.0, 0.576, 1.0), + SetDiffuse(0.0, 0.576, 1.0), + // Pupil color + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + // Color of spot in the middle of pupil + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + EndGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_RIGHT_EYE_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), + + EndList(), +}; + +static s16 verts_mario_eye_left[][3] = { + { 302, 35, -81 }, { 316, 28, -79 }, { 311, -2, -97 }, { 304, 48, -48 }, { 318, 40, -46 }, + { 302, 46, -7 }, { 316, 38, -5 }, { 311, 24, 32 }, { 297, 32, 30 }, { 305, 0, 56 }, + { 291, 7, 55 }, { 298, -34, 60 }, { 280, -57, 40 }, { 294, -64, 42 }, { 279, -70, 7 }, + { 294, -78, 9 }, { 282, -68, -33 }, { 296, -76, -31 }, { 300, -62, -69 }, { 286, -54, -71 }, + { 305, -37, -94 }, { 291, -29, -96 }, { 314, -35, -20 }, { 315, -32, -28 }, { 316, -27, -32 }, + { 285, -26, 58 }, { 316, -9, -71 }, { 312, -30, -69 }, { 310, -46, -53 }, { 305, -58, 3 }, + { 305, -49, 24 }, { 307, -30, 35 }, { 311, -10, 33 }, { 316, 4, 17 }, { 321, 16, -39 }, + { 319, 8, -60 }, { 318, -18, -34 }, { 307, -56, -25 }, { 313, -35, -11 }, { 314, -32, -6 }, + { 315, -25, 0 }, { 316, -17, -3 }, { 318, -11, -6 }, { 320, 14, -9 }, { 319, -8, -23 }, + { 319, -11, -28 }, { 319, -8, -14 }, { 297, 5, -99 }, +}; + +static struct GdVtxData vtx_mario_eye_left = { ARRAY_COUNT(verts_mario_eye_left), 0x1, verts_mario_eye_left }; + +static u16 facedata_mario_eye_left[][4] = { + { 1, 0, 1, 2 }, { 1, 3, 4, 1 }, { 1, 5, 6, 4 }, { 1, 5, 7, 6 }, { 1, 8, 9, 7 }, + { 1, 10, 11, 9 }, { 1, 12, 13, 11 }, { 1, 14, 15, 13 }, { 1, 16, 17, 15 }, { 1, 16, 18, 17 }, + { 1, 19, 20, 18 }, { 1, 21, 2, 20 }, { 1, 2, 47, 0 }, { 1, 1, 26, 2 }, { 1, 2, 26, 20 }, + { 1, 20, 27, 18 }, { 1, 18, 28, 17 }, { 1, 17, 29, 15 }, { 1, 15, 30, 13 }, { 1, 13, 31, 11 }, + { 1, 11, 31, 9 }, { 1, 9, 32, 7 }, { 1, 7, 33, 6 }, { 1, 6, 34, 4 }, { 1, 4, 35, 1 }, + { 1, 4, 34, 35 }, { 1, 6, 43, 34 }, { 1, 33, 43, 6 }, { 1, 32, 33, 7 }, { 1, 31, 32, 9 }, + { 1, 13, 30, 31 }, { 1, 15, 29, 30 }, { 1, 17, 37, 29 }, { 1, 28, 37, 17 }, { 1, 27, 28, 18 }, + { 1, 26, 27, 20 }, { 1, 1, 35, 26 }, { 1, 1, 0, 3 }, { 1, 4, 3, 5 }, { 1, 5, 8, 7 }, + { 1, 8, 10, 9 }, { 1, 10, 25, 11 }, { 1, 11, 25, 12 }, { 1, 13, 12, 14 }, { 1, 15, 14, 16 }, + { 1, 16, 19, 18 }, { 1, 21, 47, 2 }, { 1, 19, 21, 20 }, { 2, 35, 36, 26 }, { 2, 26, 36, 27 }, + { 2, 27, 24, 28 }, { 2, 28, 23, 37 }, { 2, 37, 38, 29 }, { 2, 29, 39, 30 }, { 2, 30, 40, 31 }, + { 2, 31, 40, 32 }, { 2, 32, 41, 33 }, { 2, 33, 42, 43 }, { 2, 43, 44, 34 }, { 2, 34, 45, 35 }, + { 2, 34, 44, 45 }, { 2, 43, 46, 44 }, { 2, 42, 46, 43 }, { 2, 41, 42, 33 }, { 2, 40, 41, 32 }, + { 2, 30, 39, 40 }, { 2, 29, 38, 39 }, { 2, 37, 22, 38 }, { 2, 23, 22, 37 }, { 2, 24, 23, 28 }, + { 2, 36, 24, 27 }, { 2, 35, 45, 36 }, { 3, 22, 23, 24 }, { 3, 24, 36, 22 }, { 3, 36, 38, 22 }, + { 3, 36, 39, 38 }, { 3, 36, 40, 39 }, { 3, 36, 41, 40 }, { 3, 36, 45, 41 }, { 3, 45, 42, 41 }, + { 3, 45, 46, 42 }, { 3, 45, 44, 46 }, +}; + +static struct GdFaceData faces_mario_eye_left = { ARRAY_COUNT(facedata_mario_eye_left), 0x1, facedata_mario_eye_left }; + +struct DynList dynlist_mario_eye_left_shape[28] = { + BeginList(), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP), + LinkWithPtr(&vtx_mario_eye_left), + + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP), + LinkWithPtr(&faces_mario_eye_left), + + StartGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), + // ??? + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.291, 1.0), + SetDiffuse(0.0, 0.291, 1.0), + // Iris color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.0, 0.576, 1.0), + SetDiffuse(0.0, 0.576, 1.0), + // Pupil color + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + // Color of spot in the middle of pupil + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + EndGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), + + MakeDynObj(D_SHAPE, DYNOBJ_MARIO_LEFT_EYE_SHAPE), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), + + EndList(), +}; diff --git a/src/goddard/gd_macros.h b/src/goddard/gd_macros.h new file mode 100644 index 00000000..9b65978d --- /dev/null +++ b/src/goddard/gd_macros.h @@ -0,0 +1,17 @@ +#ifndef GD_MACROS_H +#define GD_MACROS_H + +/** + * @file gd_macros.h + * + * Common macros that Goddard used throughout the Mario Head subsytem code. + */ + +#define DEG_PER_RAD 57.29577950560105 +#define RAD_PER_DEG (1.0 / DEG_PER_RAD) + +#define ABS(val) (((val) < 0 ? (-(val)) : (val))) +#define SQ(val) ((val) * (val)) +#define ALIGN(VAL_, ALIGNMENT_) (((VAL_) + ((ALIGNMENT_) - 1)) & ~((ALIGNMENT_) - 1)) + +#endif // GD_MACROS_H diff --git a/src/goddard/gd_main.c b/src/goddard/gd_main.c new file mode 100644 index 00000000..e515b328 --- /dev/null +++ b/src/goddard/gd_main.c @@ -0,0 +1,61 @@ +#include + +#include "debug_utils.h" +#include "gd_main.h" +#include "gd_memory.h" +#include "macros.h" +#include "objects.h" +#include "renderer.h" + +/* This file was spilt out of debug_memory.asm based on rodata. + * The rodata for functions after this "__main__" function have string literals following + * f32 literal, which implies that this is its own file + */ + +// data +s32 gGdMoveScene = TRUE; // @ 801A8050 +static s32 sUnref801A8054 = TRUE; +f32 D_801A8058 = -600.0f; +s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals +static s32 sUnrefScnWidth = 320; +static s32 sUnrefScnHeight = 240; + +// bss +struct GdControl gGdCtrl; // @ 801B9920; processed controller info +struct GdControl gGdCtrlPrev; // @ 801B9A18; previous frame's controller info + +/** + * Unused main function possibly from when this was a standalone demo + */ +u32 __main__(void) { + UNUSED u32 pad1C; + + gd_printf("%x, %x\n", (u32) (uintptr_t) &D_801A8058, (u32) (uintptr_t) &gGdMoveScene); + imin("main"); + gd_init(); + + gGdCtrl.unk88 = 0.46799f; + gGdCtrl.unkA0 = -34.0f; + gGdCtrl.unkAC = 34.0f; + gGdCtrl.unk00 = 2; + gGdCtrl.newStartPress = FALSE; + gGdCtrl.prevFrame = &gGdCtrlPrev; + + imin("main - make_scene"); + make_scene(); // make_scene does nothing, though + imout(); + + gd_init_controllers(); + print_all_memtrackers(); + + start_timer("dlgen"); + stop_timer("dlgen"); + mem_stats(); + + while (TRUE) { + func_801A520C(); + } + + imout(); + return 0; +} diff --git a/src/goddard/gd_main.h b/src/goddard/gd_main.h new file mode 100644 index 00000000..2fa0c3ec --- /dev/null +++ b/src/goddard/gd_main.h @@ -0,0 +1,88 @@ +#ifndef GD_MAIN_H +#define GD_MAIN_H + +#include + +// In various files of the Goddard subsystem, there are miscellaneous +// unused rodata strings. These are likely byproducts of a printf macro +// that was stubbed out as "#define printf", letting printf calls expand +// to no-op comma expressions. (IDO doesn't support variadic macros, so +// "#define printf(...) /* nothing */" wasn't an option.) +// This macro is separate from the gd_printf function; one probably +// forwarded to the other, but it is hard to tell in which direction. +#ifdef __GNUC__ +#define printf(...) \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wunused-value\"") \ + (__VA_ARGS__); \ + _Pragma ("GCC diagnostic pop") +#else +#define printf +#endif + +// structs +struct GdControl { // gGdCtrl + /* 0x00 */ s32 unk00; // set but never used + /* 0x04 */ u8 pad04[4]; + /* 0x08 */ s32 dleft; // Dpad-left (mask) + /* 0x0C */ s32 dright; // Dpad-right (mask) + /* 0x10 */ s32 dup; // Dpad-up (mask) + /* 0x14 */ s32 ddown; // Dpad-down (mask) + /* 0x18 */ s32 cleft; // bool C-left + /* 0x1C */ s32 cright; // bool C-right + /* 0x20 */ s32 cup; // bool C-up + /* 0x24 */ s32 cdown; // bool C-down + /* 0x28 */ void * unk28; // null-checked ptr? symbol not deref-ed in extant code? + /* 0x2C */ void * unk2C; // some sort of old texture ptr? symbol not deref-ed in extant code? + /* 0x30 */ void * unk30; // null-checked ptr? symbol not deref-ed in extant code? + /* 0x34 */ s32 btnA; // bool A button + /* 0x38 */ s32 btnB; // bool B button + /* 0x3C */ u8 pad3C[0x44-0x3C]; + /* 0x44 */ s32 trgL; // bool L trigger pressed + /* 0x48 */ s32 trgR; // bool R trigger pressed + /* 0x4C */ s32 unk4C; + /* 0x50 */ s32 unk50; + /* 0x54 */ s32 newStartPress; // toggle bit? start pressed? + /* 0x58 */ u8 pad58[0x7C-0x58]; + /* 0x7C */ f32 stickXf; + /* 0x80 */ f32 stickYf; + /* 0x84 */ u8 pad84[4]; + /* 0x88 */ f32 unk88; // set but never used + /* 0x8C */ u8 pad8c[0xA0-0x8C]; + /* 0xA0 */ f32 unkA0; // set but never used + /* 0xA4 */ u8 padA4[0xAC-0xA4]; + /* 0xAC */ f32 unkAC; + /* 0xB0 */ u8 padB0[0xB8-0xB0]; + /* 0xB8 */ s32 dragStartX; // cursor x position when there was a new (A) press? + /* 0xBC */ s32 dragStartY; // cursor y position when there was a new (A) press? + /* 0xC0 */ s32 stickDeltaX; + /* 0xC4 */ s32 stickDeltaY; + /* 0xC8 */ s32 stickX; + /* 0xCC */ s32 stickY; + /* 0xD0 */ s32 csrX; // bounded by screen view + /* 0xD4 */ s32 csrY; // bounded by screen view + /* 0xD8 */ /* hand/cursor state bitfield? */ + /* b80 */ u8 dragging : 1; // bool (A) pressed + /* b40 */ u8 unkD8b40 : 1; // set to FALSE and unused + /* b20 */ u8 unkD8b20 : 1; // set to FALSE and unused + /* b10 */ u8 startedDragging : 1; // bool new (A) press + /* b08 */ u8 unkD8b08 : 1; + /* b04 */ u8 unkD8b04 : 1; + /* b02 */ u8 AbtnPressWait : 1; // bool 10 frames between (A) presses (cursor cool down?) + /* 0xDC */ u32 dragStartFrame; // first frame of new a press + /* 0xE0 */ u8 padE0[0xE8-0xE0]; + /* 0xE8 */ u32 currFrame; // frame count? + /* 0xEC */ u8 padEC[0xF0-0xEC]; + /* 0xF0 */ struct GdControl *prevFrame; // previous frame data +}; + +// data +extern s32 gGdMoveScene; +extern f32 D_801A8058; +extern s32 gGdUseVtxNormal; + +// bss +extern struct GdControl gGdCtrl; +extern struct GdControl gGdCtrlPrev; + +#endif // GD_MAIN_H diff --git a/src/goddard/gd_math.c b/src/goddard/gd_math.c new file mode 100644 index 00000000..bc155f6c --- /dev/null +++ b/src/goddard/gd_math.c @@ -0,0 +1,966 @@ +#include + +#include "debug_utils.h" +#include "gd_macros.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "macros.h" +#include "renderer.h" + +/** + * Finds the square root of a float by treating + * it as a double and finding the square root from there. + */ +f32 gd_sqrt_f(f32 val) { + return (f32) gd_sqrt_d(val); +} + +/** + * Set mtx to a look-at matrix for the camera. The resulting transformation + * transforms the world as if there exists a camera at position 'from' pointed + * at the position 'to'. + * An effective goddard copy of mtxf_lookat. + */ +void gd_mat4f_lookat(Mat4f *mtx, f32 xFrom, f32 yFrom, f32 zFrom, f32 xTo, f32 yTo, f32 zTo, + f32 zColY, f32 yColY, f32 xColY) { + f32 invLength; + + struct GdVec3f d; + struct GdVec3f colX; + struct GdVec3f norm; + + // No reason to do this? mtx is set lower. + gd_set_identity_mat4(mtx); + + d.z = xTo - xFrom; + d.y = yTo - yFrom; + d.x = zTo - zFrom; + + invLength = ABS(d.z) + ABS(d.y) + ABS(d.x); + + // Scales 'd' if smaller than 10 or larger than 10,000 to be + // of a magnitude of 10,000. + if (invLength > 10000.0f || invLength < 10.0f) { + norm.x = d.z; + norm.y = d.y; + norm.z = d.x; + gd_normalize_vec3f(&norm); + norm.x *= 10000.0f; + norm.y *= 10000.0f; + norm.z *= 10000.0f; + + d.z = norm.x; + d.y = norm.y; + d.x = norm.z; + } + + invLength = -1.0 / gd_sqrt_f(SQ(d.z) + SQ(d.y) + SQ(d.x)); + d.z *= invLength; + d.y *= invLength; + d.x *= invLength; + + colX.z = yColY * d.x - xColY * d.y; + colX.y = xColY * d.z - zColY * d.x; + colX.x = zColY * d.y - yColY * d.z; + + invLength = 1.0 / gd_sqrt_f(SQ(colX.z) + SQ(colX.y) + SQ(colX.x)); + + colX.z *= invLength; + colX.y *= invLength; + colX.x *= invLength; + + zColY = d.y * colX.x - d.x * colX.y; + yColY = d.x * colX.z - d.z * colX.x; + xColY = d.z * colX.y - d.y * colX.z; + + invLength = 1.0 / gd_sqrt_f(SQ(zColY) + SQ(yColY) + SQ(xColY)); + + zColY *= invLength; + yColY *= invLength; + xColY *= invLength; + + (*mtx)[0][0] = colX.z; + (*mtx)[1][0] = colX.y; + (*mtx)[2][0] = colX.x; + (*mtx)[3][0] = -(xFrom * colX.z + yFrom * colX.y + zFrom * colX.x); + + (*mtx)[0][1] = zColY; + (*mtx)[1][1] = yColY; + (*mtx)[2][1] = xColY; + (*mtx)[3][1] = -(xFrom * zColY + yFrom * yColY + zFrom * xColY); + + (*mtx)[0][2] = d.z; + (*mtx)[1][2] = d.y; + (*mtx)[2][2] = d.x; + (*mtx)[3][2] = -(xFrom * d.z + yFrom * d.y + zFrom * d.x); + + (*mtx)[0][3] = 0.0f; + (*mtx)[1][3] = 0.0f; + (*mtx)[2][3] = 0.0f; + (*mtx)[3][3] = 1.0f; +} + +/** + * Scales a mat4f in each dimension by a vector. + */ +void gd_scale_mat4f_by_vec3f(Mat4f *mtx, struct GdVec3f *vec) { + (*mtx)[0][0] *= vec->x; + (*mtx)[0][1] *= vec->x; + (*mtx)[0][2] *= vec->x; + (*mtx)[1][0] *= vec->y; + (*mtx)[1][1] *= vec->y; + (*mtx)[1][2] *= vec->y; + (*mtx)[2][0] *= vec->z; + (*mtx)[2][1] *= vec->z; + (*mtx)[2][2] *= vec->z; +} + +/** + * Rotates the matrix 'mtx' about the vector given. + */ +void gd_rot_mat_about_vec(Mat4f *mtx, struct GdVec3f *vec) { + if (vec->x != 0.0f) { + gd_absrot_mat4(mtx, GD_X_AXIS, vec->x); + } + if (vec->y != 0.0f) { + gd_absrot_mat4(mtx, GD_Y_AXIS, vec->y); + } + if (vec->z != 0.0f) { + gd_absrot_mat4(mtx, GD_Z_AXIS, vec->z); + } +} + +/** + * Adds each component of a vector to the + * translation column of a mat4f matrix. + */ +void gd_add_vec3f_to_mat4f_offset(Mat4f *mtx, struct GdVec3f *vec) { + UNUSED Mat4f temp; + f32 z, y, x; + + x = vec->x; + y = vec->y; + z = vec->z; + + (*mtx)[3][0] += x; + (*mtx)[3][1] += y; + (*mtx)[3][2] += z; +} + +/** + * Creates a lookat matrix, but specifically from the perspective of the origin. + * Rolls is only ever 0 in practice, and this is really only ever used once. + * + * Matrix has form- | -(cz+sxy)/h sh (cx-syz)/h 0 | + * | (sz-cxy)/h ch -(sx+cyz)/h 0 | + * | -x -y -z 0 | + * | 0 0 0 1 | + */ +void gd_create_origin_lookat(Mat4f *mtx, struct GdVec3f *vec, f32 roll) { + f32 invertedHMag; + f32 hMag; + f32 c; + f32 s; + f32 radPerDeg = RAD_PER_DEG; + struct GdVec3f unit; + + unit.x = vec->x; + unit.y = vec->y; + unit.z = vec->z; + + gd_normalize_vec3f(&unit); + hMag = gd_sqrt_f(SQ(unit.x) + SQ(unit.z)); + + roll *= radPerDeg; // convert roll from degrees to radians + s = gd_sin_d(roll); + c = gd_cos_d(roll); + + gd_set_identity_mat4(mtx); + if (hMag != 0.0f) { + invertedHMag = 1.0f / hMag; + (*mtx)[0][0] = ((-unit.z * c) - (s * unit.y * unit.x)) * invertedHMag; + (*mtx)[1][0] = ((unit.z * s) - (c * unit.y * unit.x)) * invertedHMag; + (*mtx)[2][0] = -unit.x; + (*mtx)[3][0] = 0.0f; + + (*mtx)[0][1] = s * hMag; + (*mtx)[1][1] = c * hMag; + (*mtx)[2][1] = -unit.y; + (*mtx)[3][1] = 0.0f; + + (*mtx)[0][2] = ((c * unit.x) - (s * unit.y * unit.z)) * invertedHMag; + (*mtx)[1][2] = ((-s * unit.x) - (c * unit.y * unit.z)) * invertedHMag; + (*mtx)[2][2] = -unit.z; + (*mtx)[3][2] = 0.0f; + + (*mtx)[0][3] = 0.0f; + (*mtx)[1][3] = 0.0f; + (*mtx)[2][3] = 0.0f; + (*mtx)[3][3] = 1.0f; + } else { + (*mtx)[0][0] = 0.0f; + (*mtx)[1][0] = 1.0f; + (*mtx)[2][0] = 0.0f; + (*mtx)[3][0] = 0.0f; + + (*mtx)[0][1] = 0.0f; + (*mtx)[1][1] = 0.0f; + (*mtx)[2][1] = 1.0f; + (*mtx)[3][1] = 0.0f; + + (*mtx)[0][2] = 1.0f; + (*mtx)[1][2] = 0.0f; + (*mtx)[2][2] = 0.0f; + (*mtx)[3][2] = 0.0f; + + (*mtx)[0][3] = 0.0f; + (*mtx)[1][3] = 0.0f; + (*mtx)[2][3] = 0.0f; + (*mtx)[3][3] = 1.0f; + } +} + +/** + * Clamps a float within a set range about zero. + */ +f32 gd_clamp_f32(f32 a, f32 b) { + if (b < a) { + a = b; + } else if (a < -b) { + a = -b; + } + + return a; +} + +/** + * Clamps a vector within a set range about zero. + */ +void gd_clamp_vec3f(struct GdVec3f *vec, f32 limit) { + if (vec->x > limit) { + vec->x = limit; + } else if (vec->x < -limit) { + vec->x = -limit; + } + + if (vec->y > limit) { + vec->y = limit; + } else if (vec->y < -limit) { + vec->y = -limit; + } + + if (vec->z > limit) { + vec->z = limit; + } else if (vec->z < -limit) { + vec->z = -limit; + } +} + +/** + * Rotates a 2D vector by some angle in degrees. + */ +void gd_rot_2d_vec(f32 deg, f32 *x, f32 *y) { + f32 xP; + f32 yP; + f32 rad; + + rad = deg / DEG_PER_RAD; + xP = (*x * gd_cos_d(rad)) - (*y * gd_sin_d(rad)); + yP = (*x * gd_sin_d(rad)) + (*y * gd_cos_d(rad)); + *x = xP; + *y = yP; +} + +/** + * Rotates a matrix about one of its rows. + */ +void UNUSED gd_rot_mat_about_row(Mat4f *mat, s32 row, f32 ang) { + Mat4f rot; + struct GdVec3f vec; + + vec.x = (*mat)[row][0]; + vec.y = (*mat)[row][1]; + vec.z = (*mat)[row][2]; + + gd_create_rot_mat_angular(&rot, &vec, ang / 2.0); + gd_mult_mat4f(mat, &rot, mat); +} + +/** + * Rotates a mat4f matrix about a given axis + * by a set angle in degrees. + */ +void gd_absrot_mat4(Mat4f *mtx, s32 axisnum, f32 ang) { + Mat4f rMat; + struct GdVec3f rot; + + switch (axisnum) { + case GD_X_AXIS: + rot.x = 1.0f; + rot.y = 0.0f; + rot.z = 0.0f; + break; + case GD_Y_AXIS: + rot.x = 0.0f; + rot.y = 1.0f; + rot.z = 0.0f; + break; + case GD_Z_AXIS: + rot.x = 0.0f; + rot.y = 0.0f; + rot.z = 1.0f; + break; + default: + fatal_printf("absrot_matrix4(): Bad axis num"); + } + + gd_create_rot_mat_angular(&rMat, &rot, ang / 2.0); //? 2.0f + gd_mult_mat4f(mtx, &rMat, mtx); +} + + +f32 gd_vec3f_magnitude(struct GdVec3f *vec) { + return gd_sqrt_f(SQ(vec->x) + SQ(vec->y) + SQ(vec->z)); +} + +/** + * Normalizes a vec3f to have a length of 1. + */ +s32 gd_normalize_vec3f(struct GdVec3f *vec) { + f32 mag; + if ((mag = SQ(vec->x) + SQ(vec->y) + SQ(vec->z)) == 0.0f) { + return FALSE; + } + + mag = gd_sqrt_f(mag); + // gd_sqrt_f rounds near 0 numbers to 0, so verify again. + if (mag == 0.0f) { + vec->x = 0.0f; + vec->y = 0.0f; + vec->z = 0.0f; + return FALSE; + } + + vec->x /= mag; + vec->y /= mag; + vec->z /= mag; + + return TRUE; +} + +/** + * Stores the cross product of 'a' x 'b' in 'dst'. + */ +void gd_cross_vec3f(struct GdVec3f *a, struct GdVec3f *b, struct GdVec3f *dst) { + struct GdVec3f result; + + result.x = (a->y * b->z) - (a->z * b->y); + result.y = (a->z * b->x) - (a->x * b->z); + result.z = (a->x * b->y) - (a->y * b->x); + + dst->x = result.x; + dst->y = result.y; + dst->z = result.z; +} + +/** + * Returns the dot product of 'a' and 'b'. + */ +f32 gd_dot_vec3f(struct GdVec3f *a, struct GdVec3f *b) { + return (a->x * b->x) + (a->y * b->y) + (a->z * b->z); +} + +/** + * Inverts each element of src into dst. + */ +void UNUSED gd_invert_elements_mat4f(Mat4f *src, Mat4f *dst) { + s32 i; + s32 j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + (*dst)[i][j] = 1.0f / (*src)[i][j]; + } + } +} + +/** + * Inverts a matrix from src and stores it into dst. + * Reaches a fatal_print if the determinant is 0. + */ +void gd_inverse_mat4f(Mat4f *src, Mat4f *dst) { + s32 i; + s32 j; + f32 determinant; + + gd_adjunct_mat4f(src, dst); + determinant = gd_mat4f_det(dst); + + if (ABS(determinant) < 1e-5) //? 1e-5f + { + fatal_print("Non-singular matrix, no inverse!\n"); + } + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + (*dst)[i][j] /= determinant; + } + } +} + +/** + * Takes a matrix from src and converts it into its adjunct in dst. + */ +void gd_adjunct_mat4f(Mat4f *src, Mat4f *dst) { + struct InvMat4 inv; + + inv.r3.c3 = (*src)[0][0]; + inv.r2.c3 = (*src)[0][1]; + inv.r1.c3 = (*src)[0][2]; + inv.r0.c3 = (*src)[0][3]; + inv.r3.c2 = (*src)[1][0]; + inv.r2.c2 = (*src)[1][1]; + inv.r1.c2 = (*src)[1][2]; + inv.r0.c2 = (*src)[1][3]; + inv.r3.c1 = (*src)[2][0]; + inv.r2.c1 = (*src)[2][1]; + inv.r1.c1 = (*src)[2][2]; + inv.r0.c1 = (*src)[2][3]; + inv.r3.c0 = (*src)[3][0]; + inv.r2.c0 = (*src)[3][1]; + inv.r1.c0 = (*src)[3][2]; + inv.r0.c0 = (*src)[3][3]; + + (*dst)[0][0] = gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[1][0] = -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[2][0] = gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[3][0] = -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, + inv.r1.c2, inv.r1.c1, inv.r1.c0); + (*dst)[0][1] = -gd_3x3_det(inv.r2.c3, inv.r2.c1, inv.r2.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, + inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[1][1] = gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, + inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[2][1] = -gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, + inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[3][1] = gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, + inv.r1.c3, inv.r1.c1, inv.r1.c0); + (*dst)[0][2] = gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, + inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[1][2] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, + inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[2][2] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, + inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[3][2] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, + inv.r1.c3, inv.r1.c2, inv.r1.c0); + (*dst)[0][3] = -gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, + inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[1][3] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, + inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[2][3] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, + inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[3][3] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, + inv.r1.c3, inv.r1.c2, inv.r1.c1); +} + +/** + * Returns the determinant of a mat4f matrix. + */ +f32 gd_mat4f_det(Mat4f *mtx) { + f32 det; + struct InvMat4 inv; + + inv.r3.c3 = (*mtx)[0][0]; + inv.r2.c3 = (*mtx)[0][1]; + inv.r1.c3 = (*mtx)[0][2]; + inv.r0.c3 = (*mtx)[0][3]; + inv.r3.c2 = (*mtx)[1][0]; + inv.r2.c2 = (*mtx)[1][1]; + inv.r1.c2 = (*mtx)[1][2]; + inv.r0.c2 = (*mtx)[1][3]; + inv.r3.c1 = (*mtx)[2][0]; + inv.r2.c1 = (*mtx)[2][1]; + inv.r1.c1 = (*mtx)[2][2]; + inv.r0.c1 = (*mtx)[2][3]; + inv.r3.c0 = (*mtx)[3][0]; + inv.r2.c0 = (*mtx)[3][1]; + inv.r1.c0 = (*mtx)[3][2]; + inv.r0.c0 = (*mtx)[3][3]; + + det = (inv.r3.c3 + * gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, + inv.r1.c2, inv.r1.c1, inv.r1.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0) + - inv.r2.c3 + * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, + inv.r1.c2, inv.r1.c1, inv.r1.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0)) + + inv.r1.c3 + * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, + inv.r2.c2, inv.r2.c1, inv.r2.c0, + inv.r0.c2, inv.r0.c1, inv.r0.c0) + - inv.r0.c3 + * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, + inv.r2.c2, inv.r2.c1, inv.r2.c0, + inv.r1.c2, inv.r1.c1, inv.r1.c0); + + return det; +} + +/** + * Takes the individual values of a 3 by 3 matrix and + * returns the determinant. + */ +f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2, + f32 r1c0, f32 r1c1, f32 r1c2, + f32 r2c0, f32 r2c1, f32 r2c2) { + f32 det; + + det = r0c0 * gd_2x2_det(r1c1, r1c2, r2c1, r2c2) - r1c0 * gd_2x2_det(r0c1, r0c2, r2c1, r2c2) + + r2c0 * gd_2x2_det(r0c1, r0c2, r1c1, r1c2); + + return det; +} + +/** + * Takes the individual values of a 2 by 2 matrix and + * returns the determinant. + */ +f32 gd_2x2_det(f32 a, f32 b, f32 c, f32 d) { + f32 det = a * d - b * c; + + return det; +} + +/** + * Creates a vector negative to what was passed in. Also sets the first row of a mat4f + * to 1 0 0 0. Perhaps meant to be used at the end of gd_create_quat_rot_mat? Not + * sure of the purpose of the vector portion, though. + */ +void UNUSED gd_create_neg_vec_zero_first_mat_row(Mat4f *mtx, struct GdVec3f *vec, f32 x, f32 y, f32 z) { + s32 i; + + vec->x = -x; + vec->y = -y; + vec->z = -z; + + (*mtx)[0][0] = 1.0f; + + for (i = 1; i < 4; i++) { + (*mtx)[0][i] = 0.0f; + } +} + +/** + * This function quite literally does nothing. + * Seems to have been meant to create a vector from a quaternion? + */ +void UNUSED gd_broken_quat_to_vec3f(f32 quat[4], struct GdVec3f *vec, f32 zHalf, s32 i, s32 run) { + s32 j; + s32 k; + UNUSED f32 jVal; + UNUSED f32 kVal; + UNUSED struct GdVec3f uVec; + struct GdVec3f tVec; + + tVec.x = vec->x; + tVec.y = vec->y; + tVec.z = vec->z; + + if (run < 0) { + goto end; + } + + if ((j = i + 1) >= 4) { + j = 1; + } + + if ((k = j + 1) >= 4) { + k = 1; + } + + jVal = quat[j]; + kVal = quat[k]; + uVec.x = quat[0]; + uVec.y = quat[i]; + uVec.z = zHalf + zHalf; + +end: + vec->x = tVec.x; + vec->y = tVec.y; + vec->z = tVec.z; +} + +/** + * This function is a pitch rotation of a quaternion, with the sign allowing both regular + * and inverse multiplication. + */ +void UNUSED gd_quat_rotation(f32 quat[4], UNUSED s32 unused, f32 c, f32 s, s32 i, s32 sign) { + s32 j; + s32 k; + f32 quatVal; + UNUSED u32 pad[2]; + + if ((j = i + 1) >= 4) { + j = 1; + } + if ((k = j + 1) >= 4) { + k = 1; + } + + quatVal = quat[i]; + quat[i] = sign * s * quat[0] + quatVal * c; + quat[0] = quat[0] * c - sign * s * quatVal; + + quatVal = quat[j]; + quat[j] = quat[k] * s + quatVal * c; + quat[k] = quat[k] * c - s * quatVal; +} + +/** + * Shifts a matrix up by one row, putting the top row on bottom. + */ +void gd_shift_mat_up(Mat4f *mtx) { + s32 i; + s32 j; + f32 temp[3]; + + for (i = 0; i < 3; i++) { + temp[i] = (*mtx)[0][i + 1]; + } + for (i = 1; i < 4; i++) { + for (j = 1; j < 4; j++) { + (*mtx)[i - 1][j - 1] = (*mtx)[i][j]; + } + } + + (*mtx)[0][3] = 0.0f; + (*mtx)[1][3] = 0.0f; + (*mtx)[2][3] = 0.0f; + (*mtx)[3][3] = 1.0f; + + for (i = 0; i < 3; i++) { + (*mtx)[3][i] = temp[i]; + } +} + +/** + * Creates a rotation matrix from a quaternion. + * + * Has form- + * | 1 - - - | + * | 0 w^2+i^2-j^2-k^2 2ij+2wk 2ik+2wj | + * | 0 2ij-2wk w^2+j^2-i^2-k^2 2jk+2wi | + * | 0 2ik+2wj 2jk-2wi w^2+k^2-i^2-j^2 | + * + * Potentially broken if 'mtx' is not an identity matrix/zero'ed. + */ +void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f *mtx) { + f32 twoIJ; + f32 two0K; + f32 sqQuat[4]; + s32 i; + s32 j; + s32 k; + + for (i = 0; i < 4; i++) { + sqQuat[i] = SQ(quat[i]); + } + + for (i = 1; i < 4; i++) { + if ((j = i + 1) >= 4) { + j = 1; + } + + if ((k = j + 1) >= 4) { + k = 1; + } + + twoIJ = 2.0 * quat[i] * quat[j]; + two0K = 2.0 * quat[k] * quat[0]; + + (*mtx)[j][i] = twoIJ - two0K; + (*mtx)[i][j] = twoIJ + two0K; + (*mtx)[i][i] = sqQuat[i] + sqQuat[0] - sqQuat[j] - sqQuat[k]; + (*mtx)[i][0] = 0.0f; + } + + //! The first row only ever has the first value set to 1, but the + //! latter portions remain what they were originally. Perhaps this was meant + //! to call gd_create_neg_vec_zero_first_mat_row? + (*mtx)[0][0] = 1.0f; + gd_shift_mat_up(mtx); +} + +/** + * Creates a rotation matrix to multiply the primary matrix by. + * s/c are sin(angle)/cos(angle). That angular rotation is about vector + * 'vec'. + * + * Matrix has form- + * + * | (1-c)z^2+c (1-c)zy-sx (1-c)xz-sy 0 | + * | (1-c)zy-sx (1-c)y^2+c (1-c)xy-sz 0 | + * | (1-c)xz-sy (1-c)xy-sz (1-c)x^2+c 0 | + * | 0 0 0 1 | + */ +void gd_create_rot_matrix(Mat4f *mtx, struct GdVec3f *vec, f32 s, f32 c) { + f32 oneMinusCos; + struct GdVec3f rev; + + rev.z = vec->x; + rev.y = vec->y; + rev.x = vec->z; + + oneMinusCos = 1.0 - c; + + (*mtx)[0][0] = oneMinusCos * rev.z * rev.z + c; + (*mtx)[0][1] = oneMinusCos * rev.z * rev.y + s * rev.x; + (*mtx)[0][2] = oneMinusCos * rev.z * rev.x - s * rev.y; + (*mtx)[0][3] = 0.0f; + + (*mtx)[1][0] = oneMinusCos * rev.z * rev.y - s * rev.x; + (*mtx)[1][1] = oneMinusCos * rev.y * rev.y + c; + (*mtx)[1][2] = oneMinusCos * rev.y * rev.x + s * rev.z; + (*mtx)[1][3] = 0.0f; + + (*mtx)[2][0] = oneMinusCos * rev.z * rev.x + s * rev.y; + (*mtx)[2][1] = oneMinusCos * rev.y * rev.x - s * rev.z; + (*mtx)[2][2] = oneMinusCos * rev.x * rev.x + c; + (*mtx)[2][3] = 0.0f; + + (*mtx)[3][0] = 0.0f; + (*mtx)[3][1] = 0.0f; + (*mtx)[3][2] = 0.0f; + (*mtx)[3][3] = 1.0f; +} + +/** + * Creates a rotation matrix about vector 'vec' with ang in degrees. + */ +void gd_create_rot_mat_angular(Mat4f *mtx, struct GdVec3f *vec, f32 ang) { + f32 s; + f32 c; + + s = gd_sin_d(ang / (DEG_PER_RAD / 2.0)); + c = gd_cos_d(ang / (DEG_PER_RAD / 2.0)); + + gd_create_rot_matrix(mtx, vec, s, c); +} + +/** + * Sets a mat4f matrix to an identity matrix. + */ +void gd_set_identity_mat4(Mat4f *mtx) { + (*mtx)[0][0] = 1.0f; + (*mtx)[0][1] = 0.0f; + (*mtx)[0][2] = 0.0f; + (*mtx)[0][3] = 0.0f; + (*mtx)[1][0] = 0.0f; + (*mtx)[1][1] = 1.0f; + (*mtx)[1][2] = 0.0f; + (*mtx)[1][3] = 0.0f; + (*mtx)[2][0] = 0.0f; + (*mtx)[2][1] = 0.0f; + (*mtx)[2][2] = 1.0f; + (*mtx)[2][3] = 0.0f; + (*mtx)[3][0] = 0.0f; + (*mtx)[3][1] = 0.0f; + (*mtx)[3][2] = 0.0f; + (*mtx)[3][3] = 1.0f; +} + +/** + * Copies a mat4f from src to dst. + */ +void gd_copy_mat4f(const Mat4f *src, Mat4f *dst) { + (*dst)[0][0] = (*src)[0][0]; + (*dst)[0][1] = (*src)[0][1]; + (*dst)[0][2] = (*src)[0][2]; + (*dst)[0][3] = (*src)[0][3]; + (*dst)[1][0] = (*src)[1][0]; + (*dst)[1][1] = (*src)[1][1]; + (*dst)[1][2] = (*src)[1][2]; + (*dst)[1][3] = (*src)[1][3]; + (*dst)[2][0] = (*src)[2][0]; + (*dst)[2][1] = (*src)[2][1]; + (*dst)[2][2] = (*src)[2][2]; + (*dst)[2][3] = (*src)[2][3]; + (*dst)[3][0] = (*src)[3][0]; + (*dst)[3][1] = (*src)[3][1]; + (*dst)[3][2] = (*src)[3][2]; + (*dst)[3][3] = (*src)[3][3]; +} + +/** + * Transforms a vec3f, rotating with the main 3x3 portion of the mat4f + * and translating with the 4th column. + */ +void gd_rotate_and_translate_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { + struct GdVec3f out; + + out.x = (*mtx)[0][0] * vec->x + (*mtx)[1][0] * vec->y + (*mtx)[2][0] * vec->z; + out.y = (*mtx)[0][1] * vec->x + (*mtx)[1][1] * vec->y + (*mtx)[2][1] * vec->z; + out.z = (*mtx)[0][2] * vec->x + (*mtx)[1][2] * vec->y + (*mtx)[2][2] * vec->z; + out.x += (*mtx)[3][0]; + out.y += (*mtx)[3][1]; + out.z += (*mtx)[3][2]; + + vec->x = out.x; + vec->y = out.y; + vec->z = out.z; +} + +/** + * Multiples a vec3f by the main 3x3 portion of a mat4f matrix. + */ +void gd_mat4f_mult_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { + struct GdVec3f out; + + out.x = (*mtx)[0][0] * vec->x + (*mtx)[1][0] * vec->y + (*mtx)[2][0] * vec->z; + out.y = (*mtx)[0][1] * vec->x + (*mtx)[1][1] * vec->y + (*mtx)[2][1] * vec->z; + out.z = (*mtx)[0][2] * vec->x + (*mtx)[1][2] * vec->y + (*mtx)[2][2] * vec->z; + + vec->x = out.x; + vec->y = out.y; + vec->z = out.z; +} + +#define MAT4_DOT_PROD(A, B, R, row, col) \ + { \ + (R)[(row)][(col)] = (A)[(row)][0] * (B)[0][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][1] * (B)[1][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][2] * (B)[2][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][3] * (B)[3][(col)]; \ + } + +#define MAT4_MULTIPLY(A, B, R) \ + { \ + MAT4_DOT_PROD((A), (B), (R), 0, 0); \ + MAT4_DOT_PROD((A), (B), (R), 0, 1); \ + MAT4_DOT_PROD((A), (B), (R), 0, 2); \ + MAT4_DOT_PROD((A), (B), (R), 0, 3); \ + MAT4_DOT_PROD((A), (B), (R), 1, 0); \ + MAT4_DOT_PROD((A), (B), (R), 1, 1); \ + MAT4_DOT_PROD((A), (B), (R), 1, 2); \ + MAT4_DOT_PROD((A), (B), (R), 1, 3); \ + MAT4_DOT_PROD((A), (B), (R), 2, 0); \ + MAT4_DOT_PROD((A), (B), (R), 2, 1); \ + MAT4_DOT_PROD((A), (B), (R), 2, 2); \ + MAT4_DOT_PROD((A), (B), (R), 2, 3); \ + MAT4_DOT_PROD((A), (B), (R), 3, 0); \ + MAT4_DOT_PROD((A), (B), (R), 3, 1); \ + MAT4_DOT_PROD((A), (B), (R), 3, 2); \ + MAT4_DOT_PROD((A), (B), (R), 3, 3); \ + } + +/** + * Multiplies two Mat4f matrices and puts it in dst. + */ +void gd_mult_mat4f(const Mat4f *mA, const Mat4f *mB, Mat4f *dst) { + Mat4f res; + + MAT4_MULTIPLY((*mA), (*mB), res); + gd_copy_mat4f(&res, dst); +} + +#undef MAT4_MULTIPLY +#undef MAT4_DOT_PROD + +/** + * Prints a vec3f vector. + * + * Printed the prefix at some point, as shown by how the function is used. + */ +void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec) { + UNUSED u8 pad[8]; + + printf("%f,%f,%f\n", vec->x, vec->y, vec->z); + printf("\n"); +} + +/** + * Prints a plane's boundaries. + * + * Printed a prefix at some point, as shone by how the function is used. + */ +void gd_print_bounding_box(UNUSED const char *prefix, UNUSED const struct GdBoundingBox *p) { + UNUSED u8 pad[8]; + + printf("Min X = %f, Max X = %f \n", p->minX, p->maxX); + printf("Min Y = %f, Max Y = %f \n", p->minY, p->maxY); + printf("Min Z = %f, Max Z = %f \n", p->minZ, p->maxZ); + printf("\n"); +} + +/** + * Prints a Mat4f. + * + * Although the prefix input is unused, the one usage of this function + * does have a "Matrix:" prefix, so it was definitely used at one point. + */ +void gd_print_mtx(UNUSED const char *prefix, const Mat4f *mtx) { + s32 i; + s32 j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + gd_printf("%f ", (*mtx)[i][j]); + } + gd_printf("\n"); + } +} + +/** + * Prints a quaternion along with a prefix. + */ +void UNUSED gd_print_quat(const char *prefix, const f32 f[4]) { + s32 i; + + gd_printf(prefix); + for (i = 0; i < 4; i++) { + gd_printf("%f ", f[i]); + } + gd_printf("\n"); +} + +/** + * Rotates a matrix or creates a rotation matrix about a vector made from an offset + * of 100 and the passed in x, y, and z values. + */ +void UNUSED gd_rot_mat_offset(Mat4f *dst, f32 x, f32 y, f32 z, s32 copy) { + f32 adj = 100.0f; + Mat4f rot; + f32 c; + f32 s; + f32 opp; + f32 mag; + struct GdVec3f vec; + + opp = gd_sqrt_f(SQ(x) + SQ(y) + SQ(z)); + + if (opp == 0.0f) { + if (copy) { + gd_set_identity_mat4(dst); + } + return; + } + + mag = gd_sqrt_f(SQ(adj) + SQ(opp)); + c = adj / mag; + s = opp / mag; + + vec.x = -y / opp; + vec.y = -x / opp; + vec.z = -z / opp; + + gd_create_rot_matrix(&rot, &vec, s, c); + if (!copy) { + gd_mult_mat4f(dst, &rot, dst); + } else { + gd_copy_mat4f(&rot, dst); + } +} diff --git a/src/goddard/gd_math.h b/src/goddard/gd_math.h new file mode 100644 index 00000000..53c35397 --- /dev/null +++ b/src/goddard/gd_math.h @@ -0,0 +1,56 @@ +#ifndef GD_MATH_H +#define GD_MATH_H + +#include + +#include "gd_types.h" +#include "macros.h" + +struct Row4 { + f32 c0, c1, c2, c3; +}; + +struct InvMat4 { + struct Row4 r0, r1, r2, r3; +}; + +enum GdRotAxis { + GD_X_AXIS, + GD_Y_AXIS, + GD_Z_AXIS +}; + +// Needed for gd_math.c itself. +void gd_adjunct_mat4f(Mat4f *src, Mat4f *dst); +f32 gd_mat4f_det(Mat4f *mtx); +f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2, + f32 r1c0, f32 r1c1, f32 r1c2, + f32 r2c0, f32 r2c1, f32 r2c2); +f32 gd_2x2_det(f32 a, f32 b, f32 c, f32 d); + +void gd_mat4f_lookat(Mat4f *mtx, f32 xFrom, f32 yFrom, f32 zFrom, f32 xTo, f32 yTo, f32 zTo, + f32 zColY, f32 yColY, f32 xColY); +void gd_scale_mat4f_by_vec3f(Mat4f *mtx, struct GdVec3f *vec); +void gd_rot_mat_about_vec(Mat4f *mtx, struct GdVec3f *vec); +void gd_add_vec3f_to_mat4f_offset(Mat4f *mtx, struct GdVec3f *vec); +void gd_create_origin_lookat(Mat4f *mtx, struct GdVec3f *vec, f32 roll); +f32 gd_clamp_f32(f32 a, f32 b); +void gd_clamp_vec3f(struct GdVec3f *vec, f32 limit); +void gd_rot_2d_vec(f32 deg, f32 *x, f32 *y); +void gd_absrot_mat4(Mat4f *mtx, s32 axisnum, f32 ang); +f32 gd_vec3f_magnitude(struct GdVec3f *vec); +s32 gd_normalize_vec3f(struct GdVec3f *vec); +void gd_cross_vec3f(struct GdVec3f *a, struct GdVec3f *b, struct GdVec3f *dst); +f32 gd_dot_vec3f(struct GdVec3f *a, struct GdVec3f *b); +void gd_inverse_mat4f(Mat4f *src, Mat4f *dst); +void gd_create_rot_mat_angular(Mat4f *mtx, struct GdVec3f *vec, f32 ang); +void gd_set_identity_mat4(Mat4f *mtx); +void gd_copy_mat4f(const Mat4f *src, Mat4f *dst); +void gd_rotate_and_translate_vec3f(struct GdVec3f *vec, const Mat4f *mtx); +void gd_mat4f_mult_vec3f(struct GdVec3f *vec, const Mat4f *mtx); +void gd_mult_mat4f(const Mat4f *mA, const Mat4f *mB, Mat4f *dst); +void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec); +void gd_print_bounding_box(UNUSED const char *prefix, const struct GdBoundingBox *p); +void gd_print_mtx(UNUSED const char *prefix, const Mat4f *mtx); + +#endif // GD_MATH_H diff --git a/src/goddard/gd_memory.c b/src/goddard/gd_memory.c new file mode 100644 index 00000000..74fa0a2c --- /dev/null +++ b/src/goddard/gd_memory.c @@ -0,0 +1,314 @@ +#include + +#include "debug_utils.h" +#include "gd_memory.h" +#include "renderer.h" + +/** + * @file gd_memory.c + * + * This file contains the functions need to manage allocation in + * goddard's heap. However, the actual, useable allocation functions + * are `gd_malloc()`, `gd_malloc_perm()`, and `gd_malloc_temp()`, as + * well as `gd_free()`. This file is for managing the underlying memory + * block lists. + */ + +/* bss */ +static struct GMemBlock *sFreeBlockListHead; +static struct GMemBlock *sUsedBlockListHead; +static struct GMemBlock *sEmptyBlockListHead; + +/* Forward Declarations */ +void empty_mem_block(struct GMemBlock *); +struct GMemBlock *into_free_memblock(struct GMemBlock *); +struct GMemBlock *make_mem_block(u32, u8); +u32 print_list_stats(struct GMemBlock *, s32, s32); + +/** + * Empty a `GMemBlock` into a default state. This empty block + * doesn't point to any data, nor does it have any size. The + * block is removed from whatever list is was in, and is added + * to the empty block list. + */ +void empty_mem_block(struct GMemBlock *block) { + if (block->next != NULL) { + block->next->prev = block->prev; + } + + if (block->prev != NULL) { + block->prev->next = block->next; + } + + switch (block->blockType) { + case G_MEM_BLOCK_FREE: + if (block->prev == NULL) { + sFreeBlockListHead = block->next; + } + break; + case G_MEM_BLOCK_USED: + if (block->prev == NULL) { + sUsedBlockListHead = block->next; + } + break; + } + + block->next = sEmptyBlockListHead; + if (block->next != NULL) { + sEmptyBlockListHead->prev = block; + } + + sEmptyBlockListHead = block; + block->prev = NULL; + block->ptr = NULL; + block->size = 0; +} + +/** + * Transform a `GMemBlock` into a free block that points to memory available + * for allocation. + * + * @returns pointer to the free `GMemBlock` */ +struct GMemBlock *into_free_memblock(struct GMemBlock *block) { + struct GMemBlock *freeBlock; + void *ptr; + u8 permanence; + u32 space; + + ptr = block->ptr; + space = block->size; + permanence = block->permFlag; + + empty_mem_block(block); + freeBlock = make_mem_block(G_MEM_BLOCK_FREE, permanence); + freeBlock->ptr = ptr; + freeBlock->size = space; + freeBlock->permFlag = permanence; + + return freeBlock; +} + +/** + * Allocate a new `GMemBlock` structure of the given type and permanence. + * It does not assign any heap space to the new block. + * + * @param blockType either `G_MEM_BLOCK_FREE` or `G_MEM_BLOCK_USED` + * @param permFlag some sort of permanence value, where setting one the upper + * four bits imply a permanent block, while setting one the lower + * four bits imply a temporary block + * @returns a pointer to the new `GMemBlock` + */ +struct GMemBlock *make_mem_block(u32 blockType, u8 permFlag) { + struct GMemBlock *newMemBlock; + + if (sEmptyBlockListHead == NULL) { + sEmptyBlockListHead = (struct GMemBlock *) gd_allocblock(sizeof(struct GMemBlock)); + + if (sEmptyBlockListHead == NULL) { + fatal_printf("MakeMemBlock() unable to allocate"); + } + + sEmptyBlockListHead->next = NULL; + sEmptyBlockListHead->prev = NULL; + } + + newMemBlock = sEmptyBlockListHead; + if ((sEmptyBlockListHead = newMemBlock->next) != NULL) { + newMemBlock->next->prev = NULL; + } + + switch (blockType) { + case G_MEM_BLOCK_FREE: + newMemBlock->next = sFreeBlockListHead; + if (newMemBlock->next != NULL) { + sFreeBlockListHead->prev = newMemBlock; + } + sFreeBlockListHead = newMemBlock; + break; + case G_MEM_BLOCK_USED: + newMemBlock->next = sUsedBlockListHead; + if (newMemBlock->next != NULL) { + sUsedBlockListHead->prev = newMemBlock; + } + sUsedBlockListHead = newMemBlock; + break; + default: + fatal_printf("unkown memblock type"); + } + newMemBlock->prev = NULL; + newMemBlock->blockType = (u8) blockType; + newMemBlock->permFlag = permFlag; + + return newMemBlock; +} + +/** + * Free memory allocated on the goddard heap. + * + * @param ptr pointer to heap allocated memory + * @returns size of memory freed + * @retval 0 `ptr` did not point to a valid memory block + */ +u32 gd_free_mem(void *ptr) { + register struct GMemBlock *curBlock; + u32 bytesFreed; + register u8 *targetBlock = ptr; + + for (curBlock = sUsedBlockListHead; curBlock != NULL; curBlock = curBlock->next) { + if (targetBlock == curBlock->ptr) { + bytesFreed = curBlock->size; + into_free_memblock(curBlock); + return bytesFreed; + } + } + + fatal_printf("Free() Not a valid memory block"); + return 0; +} + +/** + * Request a pointer to goddard heap memory of at least `size` and + * of the same `permanence`. + * + * @return pointer to heap + * @retval NULL could not fulfill the request + */ +void *gd_request_mem(u32 size, u8 permanence) { + struct GMemBlock *foundBlock = NULL; + struct GMemBlock *curBlock; + struct GMemBlock *newBlock; + + newBlock = make_mem_block(G_MEM_BLOCK_USED, permanence); + curBlock = sFreeBlockListHead; + + while (curBlock != NULL) { + if (curBlock->permFlag & permanence) { + if (curBlock->size == size) { + foundBlock = curBlock; + break; + } else { + if (curBlock->size > size) { + if (foundBlock != NULL) { /* find closest sized block */ + if (curBlock->size < foundBlock->size) { + foundBlock = curBlock; + } + } else { + foundBlock = curBlock; + } + } + } + } + curBlock = curBlock->next; + } + + if (foundBlock == NULL) { + return NULL; + } + + if (foundBlock->size > size) { /* split free block */ + newBlock->ptr = foundBlock->ptr; + newBlock->size = size; + + foundBlock->size -= size; + foundBlock->ptr += size; + } else if (foundBlock->size == size) { /* recycle whole free block */ + newBlock->ptr = foundBlock->ptr; + newBlock->size = size; + empty_mem_block(foundBlock); + } + + return newBlock->ptr; +} + +/** + * Add memory of `size` at `addr` to the goddard heap for later allocation. + * + * @returns `GMemBlock` that contains info about the new heap memory + */ +struct GMemBlock *gd_add_mem_to_heap(u32 size, void *addr, u8 permanence) { + struct GMemBlock *newBlock; + /* eight-byte align the new block's data stats */ + size = (size - 8) & ~7; + addr = (void *)(((uintptr_t) addr + 8) & ~7); + + newBlock = make_mem_block(G_MEM_BLOCK_FREE, permanence); + newBlock->ptr = addr; + newBlock->size = size; + + return newBlock; +} + +/** + * NULL the various `GMemBlock` list heads + */ +void init_mem_block_lists(void) { + sFreeBlockListHead = NULL; + sUsedBlockListHead = NULL; + sEmptyBlockListHead = NULL; +} + +/** + * Print information (size, entries) about the `GMemBlock` list. It can print + * information for individual blocks as well as summary info for the entry list. + * + * @param block `GMemBlock` to start reading the list + * @param printBlockInfo If `TRUE`, print information about every block + * in the list + * @param permanence Limit info printed to blocks with this permanence + * @returns number of entries + */ +u32 print_list_stats(struct GMemBlock *block, s32 printBlockInfo, s32 permanence) { + u32 entries = 0; + u32 totalSize = 0; + + while (block != NULL) { + if (block->permFlag & permanence) { + entries++; + if (printBlockInfo) { + gd_printf(" %6.2fk (%d bytes)\n", + (f32) block->size / 1024.0, //? 1024.0f + block->size); + } + totalSize += block->size; + } + block = block->next; + } + + gd_printf("Total %6.2fk (%d bytes) in %d entries\n", + (f32) totalSize / 1024.0, //? 1024.0f + totalSize, entries); + + return entries; +} + +/** + * Print summary information about all used, free, and empty + * `GMemBlock`s. + */ +void mem_stats(void) { + struct GMemBlock *list; + + gd_printf("Perm Used blocks:\n"); + list = sUsedBlockListHead; + print_list_stats(list, FALSE, PERM_G_MEM_BLOCK); + gd_printf("\n"); + + gd_printf("Perm Free blocks:\n"); + list = sFreeBlockListHead; + print_list_stats(list, FALSE, PERM_G_MEM_BLOCK); + gd_printf("\n"); + + gd_printf("Temp Used blocks:\n"); + list = sUsedBlockListHead; + print_list_stats(list, FALSE, TEMP_G_MEM_BLOCK); + gd_printf("\n"); + + gd_printf("Temp Free blocks:\n"); + list = sFreeBlockListHead; + print_list_stats(list, FALSE, TEMP_G_MEM_BLOCK); + gd_printf("\n"); + + gd_printf("Empty blocks:\n"); + list = sEmptyBlockListHead; + print_list_stats(list, FALSE, PERM_G_MEM_BLOCK | TEMP_G_MEM_BLOCK); +} diff --git a/src/goddard/gd_memory.h b/src/goddard/gd_memory.h new file mode 100644 index 00000000..ea6e6ff7 --- /dev/null +++ b/src/goddard/gd_memory.h @@ -0,0 +1,35 @@ +#ifndef GD_MEMORY_H +#define GD_MEMORY_H + +#include + +/// A structure that holds information about memory allocation on goddard's heap. +struct GMemBlock { + /* 0x00 */ u8 *ptr; + /* 0x04 */ u32 size; + /* 0x08 */ u8 blockType; + /* 0x09 */ u8 permFlag; ///< Permanent (upper four bits) or Temporary (lower four bits) + /* 0x0C */ struct GMemBlock *next; + /* 0x10 */ struct GMemBlock *prev; +}; + +/// Block list types for `GMemBlock.blockType`. Note that Empty Blocks don't have +/// a specific value. +enum GMemBlockTypes { + G_MEM_BLOCK_FREE = 1, + G_MEM_BLOCK_USED = 2 +}; +/* Block Permanence Defines */ +/* This may be collections of certain allocation types + * eg. 0x10 = Object; 0x20 = Color Buffer; 0x40 = Z Buf; 0x01 = basic; etc. */ +#define PERM_G_MEM_BLOCK 0xF0 +#define TEMP_G_MEM_BLOCK 0x0F + +// functions +extern u32 gd_free_mem(void *ptr); +extern void *gd_request_mem(u32 size, u8 permanence); +extern struct GMemBlock *gd_add_mem_to_heap(u32 size, void *addr, u8 permanence); +extern void init_mem_block_lists(void); +extern void mem_stats(void); + +#endif // GD_MEMORY_H diff --git a/src/goddard/gd_types.h b/src/goddard/gd_types.h new file mode 100644 index 00000000..a0213d44 --- /dev/null +++ b/src/goddard/gd_types.h @@ -0,0 +1,656 @@ +#ifndef GD_TYPES_H +#define GD_TYPES_H + +#include + +/* Vector Types */ +struct GdVec3f +{ + f32 x, y, z; +}; + +struct GdBoundingBox { + f32 minX, minY, minZ; + f32 maxX, maxY, maxZ; +}; + +struct GdTriangleF { + struct GdVec3f p0, p1, p2; +}; + +struct GdAnimTransform { + struct GdVec3f scale; + struct GdVec3f rotate; // each component specifies the degrees to rotate about that axis + struct GdVec3f pos; +}; + +typedef f32 Mat4f[4][4]; + +struct GdColour { + f32 r, g, b; +}; + +/* dynlist entries and types */ +union DynUnion { + void *ptr; + char *str; + s32 word; +}; + +struct DynList { + s32 cmd; + union DynUnion w1; + union DynUnion w2; + struct GdVec3f vec; +}; + +/* Goddard Code Object Structs */ +/* Object Type Flags */ +enum ObjTypeFlag { + OBJ_TYPE_GROUPS = 0x00000001, + OBJ_TYPE_BONES = 0x00000002, + OBJ_TYPE_JOINTS = 0x00000004, + OBJ_TYPE_PARTICLES = 0x00000008, + OBJ_TYPE_SHAPES = 0x00000010, + OBJ_TYPE_NETS = 0x00000020, + OBJ_TYPE_PLANES = 0x00000040, + OBJ_TYPE_FACES = 0x00000080, + OBJ_TYPE_VERTICES = 0x00000100, + OBJ_TYPE_CAMERAS = 0x00000200, + // 0x400 was not used + OBJ_TYPE_MATERIALS = 0x00000800, + OBJ_TYPE_WEIGHTS = 0x00001000, + OBJ_TYPE_GADGETS = 0x00002000, + OBJ_TYPE_VIEWS = 0x00004000, + OBJ_TYPE_LABELS = 0x00008000, + OBJ_TYPE_ANIMATORS = 0x00010000, + OBJ_TYPE_VALPTRS = 0x00020000, + // 0x40000 was not used + OBJ_TYPE_LIGHTS = 0x00080000, + OBJ_TYPE_ZONES = 0x00100000, + OBJ_TYPE_UNK200000 = 0x00200000 +}; +/* This constant seems to be used to indicate the type of any or all objects */ +#define OBJ_TYPE_ALL 0x00FFFFFF + + +/// Function pointer for a `GdObj`'s drawing routine +typedef void (*drawmethod_t)(void *); +/// Flags for the drawFlags field of an GdObj +enum ObjDrawingFlags { + OBJ_DRAW_UNK01 = 0x01, + OBJ_INVISIBLE = 0x02, ///< This `GdObj` shouldn't be drawn when updating a scene + OBJ_PICKED = 0x04, ///< This `GdObj` is held by the cursor + OBJ_IS_GRABBALE = 0x08, ///< This `GdObj` can be grabbed/picked by the cursor + OBJ_HIGHLIGHTED = 0x10 +}; + +/** + * The base of structure of all of Goddard's objects. It is present as a "header" + * at the beginning of all `ObjX` structures, and as such, this type is used + * when we need to generalize code to take different `ObjX`es. + * Every GdObj created is connected together in a linked list with `prev` and `next` pointers. + */ +struct GdObj { + /* 0x00 */ struct GdObj *prev; // previous node in gGdObjectList linked list + /* 0x04 */ struct GdObj *next; // next node in gGdObjectList linked list + /* 0x08 */ drawmethod_t objDrawFn; + /* 0x0C */ enum ObjTypeFlag type; + /* 0x10 */ s16 index; ///< the index of this `GdObj` in the linked list + /* 0x12 */ u16 drawFlags; ///< enumerated in `::ObjDrawingFlags` + /* 0x14 Specific object data starts here */ +}; + +/* Used to create a linked list of objects (or data) +** within an ObjGroup */ +struct ListNode { + /* 0x00 */ struct ListNode *prev; + /* 0x04 */ struct ListNode *next; + /* 0x08 */ struct GdObj *obj; +}; + +// I think this is actually the same type as ListNode, and data is just a generic "void *" pointer. +struct VtxLink { + struct VtxLink *prev; + struct VtxLink *next; + Vtx *data; +}; + +/* These are the compressed versions of ObjFace or ObjVertex that are +** pointed to by ListNode in the faceGroup and vtxGroup, if Group.linkType +** is set to 0x01. See `chk_shapegen` */ +struct GdFaceData { + u32 count; + s32 type; + u16 (*data)[4]; ///< (mtl id, vtx ids[3]) +}; + +struct GdVtxData { + u32 count; + s32 type; + s16 (*data)[3]; ///< [x, y, z] +}; + + +/** + * Used to group related objects together. Seems to mainly be used for `apply_to_obj_types_in_group`. + */ +struct ObjGroup { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct ObjGroup *prev; + /* 0x18 */ struct ObjGroup *next; + /* 0x1C */ struct ListNode *firstMember; ///< Head of a linked list for objects contained in this group + /* 0x20 */ struct ListNode *lastMember; ///< Tail of a linked list for objects contained in this group + /* 0x24 */ s32 memberTypes; ///< OR'd collection of type flags for all objects in this group + /* 0x28 */ s32 memberCount; // number of objects in this group + /* 0x2C */ s32 debugPrint; // might also be a type? + /* 0x30 */ s32 linkType; + /* 0x34 */ char name[0x40]; ///< possibly, only referenced in old code + /* 0x74 */ s32 id; +}; /* sizeof = 0x78 */ + +/* Known linkTypes + * 0x00 : Normal (link to GdObj) + * 0x01 : Compressed (vtx or face data) + */ + +struct ObjBone { + /* 0x000 */ struct GdObj header; + /* 0x014 */ struct GdVec3f worldPos; // "position"?? from dead code in draw_bone + /* 0x020 */ struct ObjBone *prev; // maybe, based on make_bone + /* 0x024 */ struct ObjBone *next; // maybe, based on make_bone + /* 0x028 */ struct GdVec3f unk28; // "rotation"?? from dead code in draw_bone + /* 0x034 */ u8 pad34[0x40-0x34]; + /* 0x040 */ struct GdVec3f unk40; + /* 0x04C */ u8 pad4C[0x58-0x4C]; + /* 0x058 */ struct GdVec3f unk58; // orientation? + /* 0x064 */ struct GdVec3f unk64; + /* 0x070 */ Mat4f mat70; + /* 0x0B0 */ Mat4f matB0; + /* 0x0F0 */ struct ObjShape *shapePtr; // from dead code in draw_bone + /* 0x0F4 */ f32 unkF4; // also length? + /* 0x0F8 */ f32 unkF8; // length? + /* 0x0FC */ f32 unkFC; // also length? + /* 0x100 */ s32 colourNum; // "colour" + /* 0x104 */ s32 unk104; // "flags" + /* 0x108 */ s32 id; + /* 0x10C */ struct ObjGroup *unk10C; // group of joints? + /* 0x110 */ f32 spring; + /* 0x114 */ f32 unk114; + /* 0x118 */ f32 unk118; + /* 0x11C */ u8 pad11C[0x124-0x11C]; +}; /* sizeof = 0x124 */ + +struct ObjJoint { + /* 0x000 */ struct GdObj header; + /* 0x014 */ struct GdVec3f worldPos; // position in world space + /* 0x020 */ struct ObjShape *shapePtr; + /* 0x024 */ struct ObjJoint *prevjoint; // prev joint? linked joint? + /* 0x028 */ struct ObjJoint *nextjoint; + /* 0x02C */ void (*updateFunc)(struct ObjJoint*); // seems to update attached objects? see grabbable_joint_update_func + /* 0x030 */ struct GdVec3f unk30; // huge array of vecs? another matrix? + /* 0x03C */ struct GdVec3f unk3C; // relative position? + /* 0x048 */ struct GdVec3f unk48; + /* 0x054 */ struct GdVec3f initPos; // attached offset? (with +200 as well) + /* 0x060 */ u8 pad60[0x6C-0x60]; + /* 0x06C */ struct GdVec3f unk6C; // initial rotation vec + /* 0x078 */ struct GdVec3f velocity; + /* 0x084 */ struct GdVec3f unk84; + /* 0x090 */ struct GdVec3f unk90; + /* 0x09C */ struct GdVec3f scale; + /* 0x0A8 */ struct GdVec3f unkA8; + /* 0x0B4 */ struct GdVec3f unkB4; + /* 0x0C0 */ struct GdVec3f shapeOffset; + /* 0x0CC */ struct GdVec3f unkCC; + /* 0x0D8 */ u8 padD8[4]; + /* 0x0DC */ struct GdVec3f friction; + /* 0x0E8 */ Mat4f matE8; //matrix4x4 + /* 0x128 */ Mat4f mat128; // "rot matrix" + /* 0x168 */ Mat4f mat168; // "id matrix" + /* 0x1A8 */ struct GdVec3f unk1A8; + /* 0x1B4 */ s32 id; + /* 0x1B8 */ u8 pad1B8[4]; + /* 0x1BC */ s32 flags; // "flags" - 0x2000 = grabbed + /* 0x1C0 */ s32 unk1C0; + /* 0x1C4 */ struct ObjGroup *unk1C4; // bone group? + /* 0x1C8 */ s32 colourNum; + /* 0x1CC */ s32 type; // 0 = normal joint, 5 = grabbable joint. seems to be set, but never used + /* 0x1D0 */ struct ObjAnimator *rootAnimator; // root animator? used by eye_joint_update_func + /* 0x1D4 */ u8 pad1D4[0x1f4-0x1d4]; + /* 0x1F4 */ struct ObjGroup *weightGrp; //Group of ObjWeights, only? skin weights? + /* 0x1F8 */ struct ObjGroup *attachedObjsGrp; //attach object group + /* 0x1FC */ s32 attachFlags; //d_attach_to arg 0; "AttFlag" + /* 0x200 */ struct GdVec3f attachOffset; + /* 0x20C */ struct GdObj *attachedToObj; // object that this object is attached to + /* 0x210 */ u8 pad210[0x228-0x210]; + /* 0x228 */ f32 unk228; +}; /* sizeof = 0x22C */ + +/* Particle Types (+60) + 3 = Has groups of other particles in 6C? +*/ + +struct ObjParticle { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad14[0x1C-0x14]; + /* 0x1C */ struct ObjShape *shapePtr; // looks like a shape... + /* 0x20 */ struct GdVec3f pos; // some kind of position - relative? world? + /* 0x2C */ u8 pad2C[0x30-0x2C]; + /* 0x30 */ f32 unk30; + /* 0x34 */ u8 pad34[0x38-0x34]; + /* 0x38 */ struct GdVec3f unk38; + /* 0x44 */ f32 unk44; //not vec? + /* 0x48 */ f32 unk48; //not vec? + /* 0x4C */ u8 pad4C[0x50-0x4C]; + /* 0x50 */ s32 id; + /* 0x54 */ u32 flags; // "dflags"? + /* 0x58 */ s32 colourNum; + /* 0x5C */ s32 timeout; // when this reaches zero, the particle disappears + /* 0x60 */ s32 unk60; //type? + /* 0x64 */ s32 unk64; //type? (1 = has 50 sub-particles, 2,3 = has 30 sub-particles + /* 0x68 */ u8 pad68[0x6C-0x68]; + /* 0x6C */ struct ObjGroup *subParticlesGrp; // group of other Particles ? + /* 0x70 */ u8 pad70[4]; + /* 0x74 */ s32 unk74; + /* 0x78 */ u8 unk78[4]; + /* 0x7C */ struct ObjAnimator *unk7C; // guessing on type; doesn't seem to be used in final code + /* 0x80 */ struct ObjLight *unk80; // could be a Net or Light; not seen as non-null in running code + /* 0x84 */ u8 pad84[0xB0-0x84]; + /* 0xB0 */ s32 unkB0; //state? + /* 0xB4 */ struct ObjGroup *attachedObjsGrp; // attach group? unused group of particles + /* 0xB8 */ s32 attachFlags; //attached arg0; "AttFlag" + /* 0xBC */ struct GdObj *attachedToObj; // object that this object is attached to. looks like can be a Light or Camera +}; /* sizeof = 0xC0 */ + +/** + * An object that represents the visual portion of a 3D model. + */ +struct ObjShape { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct ObjShape *prevShape; + /* 0x18 */ struct ObjShape *nextShape; + /* 0x1C */ struct ObjGroup *faceGroup; /* face group; based on get_3DG1_shape */ + /* 0x20 */ struct ObjGroup *vtxGroup; /* vtx group; based on get_3DG1_shape */ + /* 0x24 */ struct ObjGroup *scaledVtxGroup; /* group for type 2 shapenets only ? vertices whose scaleFactor is not 1 get put into this group. */ + /* 0x28 */ u8 pad28[4]; + /* 0x2C */ struct ObjGroup *mtlGroup; /* what does this group do? materials? */ + /* 0x30 */ s32 unk30; + /* 0x34 */ s32 faceCount; /* face count? based on get_3DG1_shape */ + /* 0x38 */ s32 vtxCount; /* vtx count? based on get_3DG1_shape */ + /* 0x3C */ s32 unk3C; // bool? if FALSE, then draw_shape_faces(shape) + /* 0x40 */ u32 id; + /* 0x44 */ s32 flag; // what are the flag values? only from dynlists? + /* 0x48 */ s32 dlNums[2]; // gd dl number for each frame buffer (??) [0, 1] + s32 unk50; // frame number (index into dlNums)? + /* 0x54 */ u8 pad54[0x58-0x54]; // part of above array?? + /* 0x58 */ f32 alpha; // paramF? opacitiy? something with rendertype + /* 0x5C */ char name[0x40]; +}; /* sizeof = 0x9C */ + +/* 0x44 Flag Values + * 0x01 - + * 0x10 - Use vtx position as vtx normal? (`chk_shapegen`) + */ + +/* netTypes + * 0 - default? + * 1 - shape net + * 2 - something about the shape unk24 group having vertices too? + * 3 - joints? + * 4 - dynamic net? bone net? + * 5 - particle net? + * 6 - stub + * 7 - + */ + +struct ObjNet { + /* 0x000 */ struct GdObj header; + /* 0x014 */ struct GdVec3f worldPos; // position? d_set_initpos + d_set_world_pos; print_net says world + /* 0x020 */ struct GdVec3f initPos; // position? d_set_initpos? attached offset? dynamic? scratch? + /* 0x02C */ u8 pad2c[0x34-0x2C]; + /* 0x034 */ s32 flags; // "dflags"? + /* 0x038 */ u32 id; // some sort of id? from move_net + /* 0x03C */ s32 unk3C; // state flags? vertex info flags? + /* 0x040 */ s32 colourNum; + /* 0x044 */ struct GdVec3f unusedForce; // "force" (unused) + /* 0x050 */ struct GdVec3f velocity; + /* 0x05C */ struct GdVec3f rotation; + /* 0x068 */ struct GdVec3f unk68; //initial rotation? + /* 0x074 */ struct GdVec3f collDisp; // what is this? + /* 0x080 */ struct GdVec3f collTorque; // what is this? + /* 0x08C */ struct GdVec3f unusedCollTorqueL; // unused + /* 0x098 */ struct GdVec3f unusedCollTorqueD; // unused + /* 0x0A4 */ struct GdVec3f torque; // torque + /* 0x0B0 */ struct GdVec3f centerOfGravity; // "CofG" center of gravity? + /* 0x0BC */ struct GdBoundingBox boundingBox; + /* 0x0D4 */ struct GdVec3f unusedCollDispOff; // unused + /* 0x0E0 */ f32 unusedCollMaxD; // unused + /* 0x0E4 */ f32 maxRadius; + /* 0x0E8 */ Mat4f matE8; + /* 0x128 */ Mat4f mat128; + /* 0x168 */ Mat4f mat168; // "rotation matrix" + /* 0x1A8 */ struct ObjShape *shapePtr; + /* 0x1AC */ struct GdVec3f scale; + /* 0x1B8 */ f32 unusedMass; // unused + /* 0x1BC */ s32 numModes; // unused + /* 0x1C0 */ struct ObjGroup *unk1C0; // group of `ObjVertex` or `ObjParticle` + /* 0x1C4 */ struct ObjGroup *skinGrp; // SkinGroup (from reset_weight) (joints and bones) + /* 0x1C8 */ struct ObjGroup *unk1C8; // "node group" (joints, weights?) + /* 0x1CC */ struct ObjGroup *unk1CC; // plane group (only type 1?) + /* 0x1D0 */ struct ObjGroup *unk1D0; // vertex group + /* 0x1D4 */ struct ObjGroup *attachedObjsGrp; + /* 0x1D8 */ struct GdVec3f attachOffset; + /* 0x1E4 */ s32 attachFlags; // d_attach_to arg 0; "AttFlag" + /* 0x1E8 */ struct GdObj *attachedToObj; // object that this object is attached to + /* 0x1EC */ s32 netType; // from move_net + /* 0x1F0 */ struct ObjNet *unk1F0; // or joint. guess from Unknown80192AD0 + /* 0x1F4 */ struct GdVec3f unk1F4; + /* 0x200 */ struct GdVec3f unk200; + /* 0x20C */ struct ObjGroup *unk20C; + /* 0x210 */ s32 ctrlType; // has no purpose + /* 0x214 */ u8 pad214[0x21C-0x214]; + /* 0x21C */ struct ObjGroup *unk21C; +}; /* sizeof = 0x220 */ + +struct ObjPlane { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u32 id; + /* 0x18 */ s32 unk18; //bool; contained within zone? (from its parent Net?) + /* 0x1C */ f32 unk1C; + /* 0x20 */ s32 unk20; + /* 0x24 */ s32 unk24; + /* 0x28 */ struct GdBoundingBox boundingBox; + /* 0x40 */ struct ObjFace* unk40; +}; /* sizeof = 0x44*/ + +struct ObjVertex { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdVec3f initPos; + /* 0x20 */ struct GdVec3f pos; // new position after being moved by joints? + /* 0x2C */ struct GdVec3f normal; // normal? also color (like gbi?) + /* 0x38 */ s16 id; + /* 0x3C */ f32 scaleFactor; + /* 0x40 */ f32 alpha; + /* 0x44 */ struct VtxLink *gbiVerts; +}; /* sizeof = 0x48 */ + +/** + * An object that represents a face in an `ObjShape`. It connects 3 or 4 vertices. + */ +struct ObjFace { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdColour colour; + /* 0x20 */ s32 colourNum; // "colour" index + /* 0x24 */ struct GdVec3f normal; + /* 0x30 */ s32 vtxCount; + /* 0x34 */ struct ObjVertex *vertices[4]; // these can also be s32 indices? which are then replaced by `find_thisface_verts` + /* 0x44 */ s32 mtlId; // from compressed GdFaceData; -1 == coloured face? + /* 0x48 */ struct ObjMaterial *mtl; // initialize to NULL; set by `map_face_materials` from mtlId +}; /* sizeof = 0x4C */ + +#define CAMERA_FLAG_CONTROLLABLE 0x4 + +struct ObjCamera { + /* 0x000 */ struct GdObj header; + /* 0x014 */ struct GdVec3f worldPos; // position vec? from d_set_initpos + /* 0x020 */ struct ObjCamera* prev; + /* 0x024 */ struct ObjCamera* next; + /* 0x028 */ s32 id; + /* 0x02C */ s32 flags; // flag of some sort + /* 0x030 */ struct GdObj* unk30; // pointer to some type of object + /* 0x034 */ struct GdVec3f lookAt; // point that the camera faces + /* 0x040 */ struct GdVec3f unk40; // relative position related? + /* 0x04C */ struct GdVec3f unk4C; + /* 0x058 */ f32 unk58; // GdVec3f ? + /* 0x05C */ u8 pad5C[0x4]; + /* 0x060 */ f32 unk60; + /* 0x064 */ Mat4f unk64; //matrix4x4 + /* 0x0A4 */ f32 unkA4; + /* 0x0A8 */ Mat4f unkA8; //matrix4x4 + /* 0x0E8 */ Mat4f unkE8; + /* 0x128 */ struct GdVec3f unk128; //possibly + /* 0x134 */ struct GdVec3f unk134; + /* 0x140 */ struct GdVec3f zoomPositions[4]; // zoom positions (*1, *1.5, *2, empty fourth) + /* 0x170 */ s32 maxZoomLevel; // max number of zoom positions + /* 0x174 */ s32 zoomLevel; // index into zoomPositions array + /* 0x178 */ f32 unk178; + /* 0x17C */ f32 unk17C; + /* 0x180 */ struct GdVec3f unk180; + /* 0x18C */ struct ObjView *unk18C; // view that has/is using this camera? +}; /* sizeof = 0x190 */ + +enum GdMtlTypes { + GD_MTL_STUB_DL = 0x01, + GD_MTL_BREAK = 0x04, + GD_MTL_SHINE_DL = 0x10, + GD_MTL_TEX_OFF = 0x20, + GD_MTL_LIGHTS = 0x40 // uses default case +}; + +struct ObjMaterial { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad14[0x1c-0x14]; + /* 0x1C */ s32 id; + /* 0x20 */ char name[8]; + /* 0x28 */ s32 type; + /* 0x2C */ u8 pad2C[4]; + /* 0x30 */ struct GdColour Ka; // ambient color + /* 0x3C */ struct GdColour Kd; // diffuse color + /* 0x48 */ u8 pad48[0x58-0x48]; + /* 0x58 */ void *texture; //set by d_usetexture; never seems to be non-null though. + /* 0x5C */ s32 gddlNumber; +}; /* sizeof = 0x60 */ + +struct ObjWeight { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad14[0x8]; + /* 0x1C */ s32 vtxId; // ID of vertex that this weight applies to + /* 0x20 */ struct GdVec3f vec20; // based on func_80181894? maybe a GdBoundingBox? + /* 0x2C */ u8 pad2C[0x38-0x2c]; + /* 0x38 */ f32 weightVal; // weight (unit?) + /* 0x3C */ struct ObjVertex* vtx; +}; /* sizeof = 0x40 */ + +/* This union is used in ObjGadget for a variable typed field. +** The type can be found by checking group unk4C */ +union ObjVarVal { + s32 i; + f32 f; + u64 l; +}; + +/* + * A slider control used to adjust the value of a variable + */ +struct ObjGadget { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdVec3f worldPos; // "world" position vec? + /* 0x20 */ s32 unk20; // unused; only ever set to 0 + /* 0x24 */ s32 type; + /* 0x28 */ f32 sliderPos; // position of the slider (from 0 to 1) + /* 0x2C */ u8 pad2C[4]; + /* 0x30 */ union ObjVarVal varval; //retype and rename varval30 + /* 0x38 */ f32 rangeMin; + /* 0x3C */ f32 rangeMax; + /* 0x40 */ struct GdVec3f size; // size (x = width, y = height) + /* 0x4C */ struct ObjGroup *valueGrp; // group containing `ObjValPtr`s controlled by this gadget + /* 0x50 */ struct ObjShape *shapePtr; + /* 0x54 */ struct ObjGroup *unk54; //node group? + /* 0x58 */ u8 pad58[4]; + /* 0x5C */ s32 colourNum; +}; /* sizeof = 0x60 */ + +enum GdViewFlags { + VIEW_2_COL_BUF = 0x000008, + VIEW_ALLOC_ZBUF = 0x000010, + VIEW_SAVE_TO_GLOBAL = 0x000040, + VIEW_DEFAULT_PARENT = 0x000100, + VIEW_BORDERED = 0x000400, + VIEW_UPDATE = 0x000800, + VIEW_UNK_1000 = 0x001000, // used in setup_view_buffers + VIEW_UNK_2000 = 0x002000, // only see together with 0x4000 + VIEW_UNK_4000 = 0x004000, + VIEW_COLOUR_BUF = 0x008000, + VIEW_Z_BUF = 0x010000, + VIEW_1_CYCLE = 0x020000, + VIEW_MOVEMENT = 0x040000, + VIEW_DRAW = 0x080000, + VIEW_WAS_UPDATED = 0x100000, + VIEW_LIGHT = 0x200000 +}; + +struct ObjView { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad14[0x8]; + /* 0x1C */ s32 unk1C; // set as nonexistent return of `setup_view_buffers` + /* 0x20 */ s32 id; + /* 0x24 */ struct ObjCamera *activeCam; // is this really active? + /* 0x28 */ struct ObjGroup *components; // camera + joints + nets, etc..? + /* 0x2C */ struct ObjGroup *lights; // only lights? + /* 0x30 */ struct GdObj *pickedObj; // selected with cursor (`update_view`) + /* 0x34 */ enum GdViewFlags flags; + /* 0x38 */ s32 projectionType; // enum? if 1 use guPerspective, if 0 (or 2?) use guOrtho (see `drawscene`) + /* 0x3C */ struct GdVec3f upperLeft; // position vec? + /* 0x48 */ f32 unk48; // what are these? are they another vec? + /* 0x4C */ f32 unk4C; + /* 0x50 */ u8 pad50[0x4]; + /* 0x54 */ struct GdVec3f lowerRight; + /* 0x60 */ struct GdVec3f clipping; // z-coordinate of (x: near, y: far) clipping plane? + /* 0x6C */ const char *namePtr; + /* 0x70 */ s32 gdDlNum; + /* 0x74 */ s32 unk74; + /* 0x78 */ s32 unk78; + /* 0x7C */ struct GdColour colour; + /* 0x88 */ struct ObjView *parent; // maybe not a true parent, but link to buffers in parent? + /* 0x8C */ void *zbuf; + /* 0x90 */ void *colourBufs[2]; // frame buffers? + /* 0x98 */ void (*proc)(struct ObjView *); // Never non-null in game...? + /* 0x9C */ s32 unk9C; +}; /* sizeof = 0xA0 */ + + +typedef union ObjVarVal * (*valptrproc_t)(union ObjVarVal *, union ObjVarVal); + +struct ObjLabel { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdVec3f position; + /* 0x20 */ char *fmtstr; // format string for displaying the value contained in `valptr` + /* 0x24 */ s32 unk24; // always 8 + /* 0x28 */ struct ObjValPtr *valptr; + /* 0x2C */ valptrproc_t valfn; + /* 0x30 */ s32 unk30; // set to 3 or 4 in the code, but never actually used. could possibly be colourNum? +}; /* sizeof = 0x34 */ + +/* unk30 types: + * 3 = f32? f32 pointer? +**/ + +struct ObjAnimator { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct ObjGroup* animatedPartsGrp; // group containing objects animated by this animator. I think all of them are joints. + /* 0x18 */ struct ObjGroup* animdataGrp; //animation data? a group, but the link points to something weird.. + /* 0x1C */ u8 pad1C[0x4]; + /* 0x20 */ s32 animSeqNum; // which entry in the AnimDataInfo array to use + /* 0x24 */ f32 unk24; + /* 0x28 */ f32 frame; // key frame number. This is a float so that it can interpolate between key frames, though I think in practice, it's always a whole number. + /* 0x2C */ u8 pad2C[4]; + /* 0x30 */ struct ObjGroup *attachedObjsGrp; + /* 0x34 */ s32 attachFlags; //attach arg0, not used + /* 0x38 */ u8 pad38[0x44-0x38]; + /* 0x44 */ struct GdObj* attachedToObj; // object that this object is attached to. Normally another Objanimator? + /* 0x48 */ void (*controlFunc) (struct ObjAnimator *); // function that "controls" the animation sequence by choosing the frame number + /* 0x4C */ s32 state; //state enum? + /* 0x50 */ s32 nods; // Counts the number of nods when Mario is dozing off. When this reaches zero, he wakes up again + /* 0x54 */ s32 stillTimer; // number of frames to remain in the part where Mario's head stays still with his eyes following the cursor +}; /* sizeof = 0x58 */ + +/* Animation Data Types */ +enum GdAnimations { + GD_ANIM_EMPTY = 0, // Listed types are how the data are arranged in memory; maybe not be exact type + GD_ANIM_MTX4x4 = 1, // f32[4][4] + GD_ANIM_SCALE3F_ROT3F_POS3F = 2, // f32[3][3] + GD_ANIM_SCALE3S_POS3S_ROT3S = 3, // s16[9] + GD_ANIM_SCALE3F_ROT3F_POS3F_2 = 4, // f32[3][3] + GD_ANIM_STUB = 5, + GD_ANIM_ROT3S = 6, // s16[3] + GD_ANIM_POS3S = 7, // s16[3] + GD_ANIM_ROT3S_POS3S = 8, // s16[6] + GD_ANIM_MTX4x4F_SCALE3F = 9, // {f32 mtx[4][4]; f32 vec[3];} + GD_ANIM_CAMERA_EYE3S_LOOKAT3S = 11 // s16[6] +}; +/* This struct is pointed to by the `obj` field in ListNode struct in the `animdata` ObjGroup */ +struct AnimDataInfo { + s32 count; // count or -1 for end of array of AnimDataInfo structures + enum GdAnimations type; // types are used in "move_animator" + void* data; // points to an array of `type` data +}; +/* GD_ANIM_MTX4x4F_SCALE3F (9) type */ +struct AnimMtxVec { + /* 0x00 */ Mat4f matrix; + /* 0x40 */ struct GdVec3f vec; // seems to be a scale vec +}; + +enum ValPtrType { + OBJ_VALUE_INT = 1, + OBJ_VALUE_FLOAT = 2 +}; + +/** + * An object that points to a value in memory (either a field of another object, + * or a standalone variable). Used by `ObjLabel` and `ObjGadget` to manage their + * values. + */ +struct ObjValPtr { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdObj *obj; // maybe just a void *? + /* 0x18 */ uintptr_t offset; // value pointed to is `obj` + `offset` + /* 0x1C */ enum ValPtrType datatype; + /* 0x20 */ s32 flag; // TODO: better name for this? If 0x40000, then `offset` is an offset to a field in `obj`. Otherwise, `obj` is NULL, and `offset` is the address of a variable. +}; /* sizeof = 0x24 */ + +enum GdLightFlags { + LIGHT_UNK02 = 0x02, // old type of light? + LIGHT_NEW_UNCOUNTED = 0x10, + LIGHT_UNK20 = 0x20 // new, actually used type of light? used for phong shading? +}; + +struct ObjLight { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad0[0x8]; + /* 0x1C */ s32 id; + /* 0x20 */ char name[8]; + /* 0x28 */ u8 pad28[4]; + /* 0x2C */ s32 flags; + /* 0x30 */ f32 unk30; // color (5C) = Kd (50) * 30 + /* 0x34 */ u8 pad34[4]; + /* 0x38 */ f32 unk38; // calculated diffuse theta (in degrees?) + /* 0x3C */ s32 unk3C; + /* 0x40 */ s32 unk40; + /* 0x44 */ u8 pad3[0x8]; + /* 0x4C */ s32 unk4C; + /* 0x50 */ struct GdColour diffuse; + /* 0x5C */ struct GdColour colour; + /* 0x68 */ struct GdVec3f unk68; + /* 0x74 */ struct GdVec3f position; + /* 0x80 */ struct GdVec3f unk80; + /* 0x8C */ struct GdVec3f unk8C; + /* 0x98 */ s32 unk98; + /* 0x9C */ struct ObjShape *unk9C; +}; /* sizeof = 0xA0 */ + +struct ObjZone { + /* 0x00 */ struct GdObj header; + /* 0x14 */ struct GdBoundingBox boundingBox; + /* 0x2C */ struct ObjGroup *unk2C; // plane group? + /* 0x30 */ struct ObjGroup *unk30; // guess based on Unknown801781DC; might have to change later + /* 0x34 */ u8 pad[4]; +}; /* sizeof = 0x38*/ + +struct ObjUnk200000 { + /* 0x00 */ struct GdObj header; + /* 0x14 */ u8 pad14[0x30-0x14]; + /* 0x30 */ struct ObjVertex *unk30; //not sure; guessing for Unknown801781DC; 30 and 34 could switch with ObjZone + /* 0x34 */ struct ObjFace *unk34; //not sure; guessing for Unknown801781DC +}; /* sizeof = 0x38*/ + +#endif // GD_TYPES_H diff --git a/src/goddard/joints.c b/src/goddard/joints.c new file mode 100644 index 00000000..e48eea27 --- /dev/null +++ b/src/goddard/joints.c @@ -0,0 +1,1172 @@ +#include + +#if defined(VERSION_EU) || defined(VERSION_SH) +#include "prevent_bss_reordering.h" +#endif + +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "gd_macros.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "objects.h" +#include "renderer.h" +#include "sfx.h" +#include "skin.h" +#include "skin_movement.h" + +// data +static s32 D_801A82D0 = 0; +static struct ObjBone *gGdTempBone = NULL; // @ 801A82D4 + +// bss +s32 sResetWeightVtxNum; // WTF? why is this not in skin_movement.c? + +static Mat4f *D_801BA964; +static struct GdVec3f D_801BA968; +static s32 sJointCount; // @ 801BA974 +static s32 sJointNotF1Count; // @ 801BA978 +static s32 sBoneCount; // @ 801BA97C +static s32 sJointArrLen; // @ 801BA980 +static struct ObjJoint *sJointArr[10]; // @ 801BA988 +static struct GdVec3f sJointArrVecs[10]; // @ 801BA9B0 +static s32 sJointArr2Len; // @ 801BAA28 +static struct ObjJoint *sJointArr2[10]; // @ 801BAA30 +static struct GdVec3f sJointArr2Vecs[10]; // @ 801BAA58 +static struct GdVec3f D_801BAAD0; +static struct GdVec3f D_801BAAE0; + +// forward declarations +void set_joint_vecs(struct ObjJoint *, f32, f32, f32); + +/** + * Controls movement of grabbable joints + */ +void grabbable_joint_update_func(struct ObjJoint *self) { + UNUSED u8 pad78[0xC8 - 0x78]; + Mat4f *attObjMtx; + UNUSED u8 pad70[4]; + struct GdVec3f offset; // difference between current position and initial position + UNUSED u8 pad50[0x10]; + register struct ListNode *att; + UNUSED u8 pad48[0x8]; + struct GdObj *attobj; + + // The joint acts somewhat like a spring in that the further it is moved + // from its original position, the more resistance it has to moving further + + offset.x = self->mat128[3][0] - self->initPos.x; + offset.y = self->mat128[3][1] - self->initPos.y; + offset.z = self->mat128[3][2] - self->initPos.z; + + if (self->header.drawFlags & OBJ_PICKED) { + self->velocity.x = offset.x * -0.25; + self->velocity.y = offset.y * -0.25; + self->velocity.z = offset.z * -0.25; + + self->flags |= 0x2000; + ; // needed to match + } else { + if (gGdCtrl.trgR == FALSE) // R trigger is released + { + // Set velocity so that the joint approaches its initial position + self->velocity.x -= offset.x * 0.5; //? 0.5f + self->velocity.y -= offset.y * 0.5; //? 0.5f + self->velocity.z -= offset.z * 0.5; //? 0.5f + + // Decay the velocity + self->velocity.x *= 0.8; //? 0.8f + self->velocity.y *= 0.8; //? 0.8f + self->velocity.z *= 0.8; //? 0.8f + + // If the joint's velocity has decayed enough and it is very close + // to its original position, stop its movement altogether + if (ABS(self->velocity.x) + ABS(self->velocity.y) + ABS(self->velocity.z) < 1.0) + { + if (ABS(offset.x) + ABS(offset.y) + ABS(offset.z) < 1.0) + { + self->velocity.x = self->velocity.y = self->velocity.z = 0.0f; + self->mat128[3][0] -= offset.x; + self->mat128[3][1] -= offset.y; + self->mat128[3][2] -= offset.z; + } + } + + if (self->flags & 0x2000) { + gd_play_sfx(GD_SFX_LET_GO_FACE); + } + + self->flags &= ~0x2000; + ; // necessary? + } else { + // freeze position of joint + self->velocity.x = self->velocity.y = self->velocity.z = 0.0f; + } + } + + // update position + self->mat128[3][0] += self->velocity.x; + self->mat128[3][1] += self->velocity.y; + self->mat128[3][2] += self->velocity.z; + + if (self->header.drawFlags & OBJ_PICKED) { + gGdCtrl.csrX -= (gGdCtrl.csrX - gGdCtrl.dragStartX) * 0.2; + gGdCtrl.csrY -= (gGdCtrl.csrY - gGdCtrl.dragStartY) * 0.2; + } + + // update position of attached objects + offset.x = self->mat128[3][0] - self->initPos.x; + offset.y = self->mat128[3][1] - self->initPos.y; + offset.z = self->mat128[3][2] - self->initPos.z; + for (att = self->attachedObjsGrp->firstMember; att != NULL; att = att->next) { + attobj = att->obj; + set_cur_dynobj(attobj); + attObjMtx = d_get_matrix_ptr(); + gd_add_vec3f_to_mat4f_offset(attObjMtx, &offset); + } +} + +/** + * Update function for Mario's eye joints, which makes them follow the cursor + */ +void eye_joint_update_func(struct ObjJoint *self) { + Mat4f *sp5C; + struct GdVec3f sp50; + struct GdVec3f sp44; + UNUSED u8 pad2c[0x18]; + register struct ListNode *att; + struct GdObj *attobj; + + if (sCurrentMoveCamera == NULL) { + return; + } + + if (self->rootAnimator != NULL) { + if (self->rootAnimator->state != 7) { + return; + } + } + + set_cur_dynobj((struct GdObj *)self); + sp5C = d_get_rot_mtx_ptr(); + sp44.x = (*sp5C)[3][0]; + sp44.y = (*sp5C)[3][1]; + sp44.z = (*sp5C)[3][2]; + world_pos_to_screen_coords(&sp44, sCurrentMoveCamera, sCurrentMoveView); + + sp50.x = gGdCtrl.csrX - sp44.x; + sp50.y = -(gGdCtrl.csrY - sp44.y); + sp50.z = 0.0f; + + sp50.x *= 2.0; //?2.0f + sp50.y *= 2.0; //?2.0f + sp50.z *= 2.0; //?2.0f + if (gd_vec3f_magnitude(&sp50) > 30.0f) { + gd_normalize_vec3f(&sp50); + sp50.x *= 30.0f; + sp50.y *= 30.0f; + sp50.z *= 30.0f; + } + + for (att = self->attachedObjsGrp->firstMember; att != NULL; att = att->next) { + attobj = att->obj; + set_cur_dynobj(attobj); + sp5C = d_get_rot_mtx_ptr(); + gd_add_vec3f_to_mat4f_offset(sp5C, &sp50); + } +} + +/* 23D62C -> 23D748; not called */ +void func_8018EE5C(struct ObjJoint *j1, struct ObjJoint *j2, struct ObjJoint *j3) { + struct GdVec3f vec; + struct ObjJoint *curj; + + if (j3 == NULL) { + return; + } + + vec.z = j3->worldPos.x; + vec.y = j3->worldPos.y; + vec.x = j3->worldPos.z; + + curj = j1; + while (curj != NULL) { + set_joint_vecs(curj, curj->worldPos.x + vec.z, curj->worldPos.y + vec.y, curj->worldPos.z + vec.x); + if (curj == j2) { + break; + } + curj = curj->prevjoint; + } +} + +/* 23D748 -> 23D818; orig name: func_8018EF78 */ +void set_joint_vecs(struct ObjJoint *j, f32 x, f32 y, f32 z) { + j->worldPos.x = x; + j->worldPos.y = y; + j->worldPos.z = z; + + j->unk30.x = x; + j->unk30.y = y; + j->unk30.z = z; + + j->unk3C.x = x; + j->unk3C.y = y; + j->unk3C.z = z; + + j->initPos.x = x; + j->initPos.y = y; + j->initPos.z = z; + + j->mat128[3][0] = x; + j->mat128[3][1] = y; + j->mat128[3][2] = z; +} + +/* 23D818 -> 23DA18 */ +struct ObjJoint *make_joint(s32 flags, f32 x, f32 y, f32 z) { + struct ObjJoint *j; // sp24 + struct ObjJoint *oldhead; + UNUSED u32 pad1C; + + j = (struct ObjJoint *) make_object(OBJ_TYPE_JOINTS); + sJointCount++; + oldhead = gGdJointList; + gGdJointList = j; + + if (oldhead != NULL) { + j->nextjoint = oldhead; + oldhead->prevjoint = j; + } + gd_set_identity_mat4(&j->matE8); + gd_set_identity_mat4(&j->mat128); + set_joint_vecs(j, x, y, z); + j->type = 0; + j->id = sJointCount; + j->flags = flags; + + if (!(j->flags & 0x1)) { + sJointNotF1Count++; + } + + if (j->flags & 0x1) { + j->colourNum = COLOUR_RED; + } else { + j->colourNum = COLOUR_PINK; + } + + j->unk1C4 = NULL; + j->shapePtr = NULL; + j->scale.x = 1.0f; + j->scale.y = 1.0f; + j->scale.z = 1.0f; + j->friction.x = 0.0f; + j->friction.y = 0.0f; + j->friction.z = 0.0f; + j->updateFunc = NULL; + + return j; +} + +/** + * Creates a joint that can be grabbed by the cursor. When moved, this joint + * drags the joints in its unk1F8 group along with it. The `shape` does not + * actually get rendered due to the joint's OBJ_INVISIBLE flag being set. + */ +struct ObjJoint *make_grabber_joint(struct ObjShape *shape, s32 flags, f32 x, f32 y, f32 z) { + struct ObjJoint *j; + + j = make_joint(0, x, y, z); + j->shapePtr = shape; + j->type = 5; + j->flags |= flags; + j->colourNum = COLOUR_PINK; + j->header.drawFlags |= OBJ_IS_GRABBALE; + j->header.drawFlags |= OBJ_INVISIBLE; + j->updateFunc = grabbable_joint_update_func; + j->rootAnimator = NULL; + + return j; +} + +/* 23DAF8 -> 23DC9C */ +void func_8018F328(struct ObjBone *b) { + struct ObjJoint *joint1; + struct ObjJoint *joint2; + struct ObjGroup *grp; // sp1C + struct ListNode *link; // sp18 + + grp = b->unk10C; + link = grp->firstMember; + joint1 = (struct ObjJoint *) link->obj; + link = link->next; + joint2 = (struct ObjJoint *) link->obj; + + // bone position is average of two connecting joints + b->worldPos.x = (joint1->worldPos.x + joint2->worldPos.x) / 2.0; //?2.0f + b->worldPos.y = (joint1->worldPos.y + joint2->worldPos.y) / 2.0; //?2.0f + b->worldPos.z = (joint1->worldPos.z + joint2->worldPos.z) / 2.0; //?2.0f + + b->unk58.x = joint2->worldPos.x - joint1->worldPos.x; + b->unk58.y = joint2->worldPos.y - joint1->worldPos.y; + b->unk58.z = joint2->worldPos.z - joint1->worldPos.z; + + gd_normalize_vec3f(&b->unk58); + gd_create_origin_lookat(&b->matB0, &b->unk58, 0); //? 0.0f +} + +/* 23DC9C -> 23DCF0 */ +void func_8018F4CC(struct ObjJoint *j) { + if (j->flags & 0x1000) { + j->unkB4.x = D_801BA968.x; + j->unkB4.y = D_801BA968.y; + j->unkB4.z = D_801BA968.z; + } +} + +/* 23DCF0 -> 23E06C */ +void func_8018F520(struct ObjBone *b) { + struct ObjJoint *joint1; + struct ObjJoint *joint2; + UNUSED u32 pad[3]; + struct GdVec3f sp90; + struct GdVec3f sp84; + struct GdVec3f sp78; + struct GdVec3f sp6C; + f32 sp68; + f32 sp64; + struct ObjGroup *grp; // sp60 + struct ListNode *link; + Mat4f mtx; // sp1C + + grp = b->unk10C; + link = grp->firstMember; + joint1 = (struct ObjJoint *) link->obj; + link = link->next; + joint2 = (struct ObjJoint *) link->obj; + + // bone position is average of two connecting joints + b->worldPos.x = (joint1->worldPos.x + joint2->worldPos.x) / 2.0; //? 2.0f; + b->worldPos.y = (joint1->worldPos.y + joint2->worldPos.y) / 2.0; //? 2.0f; + b->worldPos.z = (joint1->worldPos.z + joint2->worldPos.z) / 2.0; //? 2.0f; + + sp90.x = b->unk58.x; + sp90.y = b->unk58.y; + sp90.z = b->unk58.z; + + sp6C.x = sp90.x; + sp6C.y = sp90.y; + sp6C.z = sp90.z; + + sp6C.x -= b->unk64.x; + sp6C.y -= b->unk64.y; + sp6C.z -= b->unk64.z; + b->unk64.x = sp90.x; + b->unk64.y = sp90.y; + b->unk64.z = sp90.z; + + sp68 = 5.4 / b->unkF8; //? 5.4f + sp6C.x *= sp68; + sp6C.y *= sp68; + sp6C.z *= sp68; + sp90.x *= sp68; + sp90.y *= sp68; + sp90.z *= sp68; + + gd_cross_vec3f(&sp90, &sp6C, &sp78); + sp84.x = sp78.x; + sp84.y = sp78.y; + sp84.z = sp78.z; + + gd_normalize_vec3f(&sp84); + sp64 = gd_vec3f_magnitude(&sp78); + gd_create_rot_mat_angular(&mtx, &sp84, sp64); + gd_mult_mat4f(&b->mat70, &mtx, &b->mat70); + D_801BA968.x = b->mat70[2][0]; + D_801BA968.y = b->mat70[2][1]; + D_801BA968.z = b->mat70[2][2]; + D_801BA964 = &b->mat70; + + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_8018F4CC, b->unk10C); +} + +/* 23E06C -> 23E238 */ +void func_8018F89C(struct ObjBone *b) { + struct ObjJoint *spAC; + struct ObjJoint *spA8; + UNUSED u8 pad64[0x44]; + struct ObjGroup *grp; // sp60 + struct ListNode *link; // sp5c + Mat4f mtx; // sp1c + + grp = b->unk10C; + link = grp->firstMember; + spAC = (struct ObjJoint *) link->obj; + link = link->next; + spA8 = (struct ObjJoint *) link->obj; + + b->worldPos.x = (spAC->worldPos.x + spA8->worldPos.x) / 2.0; //? 2.0f; + b->worldPos.y = (spAC->worldPos.y + spA8->worldPos.y) / 2.0; //? 2.0f; + b->worldPos.z = (spAC->worldPos.z + spA8->worldPos.z) / 2.0; //? 2.0f; + + gd_mult_mat4f(&b->matB0, &gGdSkinNet->mat128, &mtx); + gd_copy_mat4f(&mtx, &b->mat70); + + D_801BA968.x = -b->mat70[2][0]; + D_801BA968.y = -b->mat70[2][1]; + D_801BA968.z = -b->mat70[2][2]; + D_801BA964 = &b->mat70; + + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_8018F4CC, b->unk10C); +} + +/* 23E238 -> 23E298 */ +void func_8018FA68(struct ObjBone *b) { + if (b->unk104 & (0x8 | 0x2)) { + func_8018F89C(b); + } else { + func_8018F520(b); + } +} + +/* 23E298 -> 23E328; orig name: func_8018FAC8 */ +s32 set_skin_weight(struct ObjJoint *j, s32 id, struct ObjVertex *vtx /* always NULL */, f32 weight) { + struct ObjWeight *w; + + if (j->weightGrp == NULL) { + j->weightGrp = make_group(0); + } + w = make_weight(0, id, vtx, weight); + addto_group(j->weightGrp, &w->header); + + return TRUE; +} + +/* 23E328 -> 23E474 */ +void func_8018FB58(struct ObjBone *b) { + struct GdVec3f vec; // sp2c + struct ObjJoint *j1; // sp28 + struct ObjJoint *j2; + struct ListNode *link; + struct ObjGroup *grp; + + grp = b->unk10C; + link = grp->firstMember; + j1 = (struct ObjJoint *) link->obj; + link = link->next; + j2 = (struct ObjJoint *) link->obj; + + vec.x = j1->worldPos.x - j2->worldPos.x; + vec.y = j1->worldPos.y - j2->worldPos.y; + vec.z = j1->worldPos.z - j2->worldPos.z; + + b->unkF8 = gd_sqrt_d((vec.x * vec.x) + (vec.y * vec.y) + (vec.z * vec.z)); + b->unkF4 = b->unkF8; + b->unkFC = b->unkF8; + func_8018F328(b); +} + +/* 23E474 -> 23E56C */ +void add_joint2bone(struct ObjBone *b, struct ObjJoint *j) { + if (j->header.type != OBJ_TYPE_JOINTS) { + fatal_printf("add_joint2bone(): Can only add Joints to Bones"); + } + + if (b->unk10C == NULL) { + b->unk10C = make_group(0); + } + addto_group(b->unk10C, &j->header); + + if (j->unk1C4 == NULL) { + j->unk1C4 = make_group(0); + } + addto_group(j->unk1C4, &b->header); + + if (b->unk10C->memberCount == 2) { + func_8018FB58(b); + } +} + +/* 23E56C -> 23E6E4 */ +struct ObjBone *make_bone(s32 a0, struct ObjJoint *j1, struct ObjJoint *j2, UNUSED s32 a3) { + struct ObjBone *b; // sp34 + struct ObjBone *oldhead; + UNUSED u32 pad1C[5]; + + b = (struct ObjBone *) make_object(OBJ_TYPE_BONES); + sBoneCount++; + b->id = sBoneCount; + oldhead = gGdBoneList; + gGdBoneList = b; + + if (oldhead != NULL) { + b->next = oldhead; + oldhead->prev = b; + } + b->unk10C = NULL; + b->colourNum = 0; + b->unk104 = a0; + b->shapePtr = NULL; + gd_set_identity_mat4(&b->mat70); + b->spring = 0.8f; + b->unk114 = 0.9f; + b->unkF8 = 100.0f; + + if (j1 != NULL && j2 != NULL) { + add_joint2bone(b, j1); + add_joint2bone(b, j2); + } + + printf("Made bone %d\n", b->id); + return b; +} + +/* 23E6E4 -> 23E6F8; not called */ +void stub_joints_1(UNUSED u32 a0) { +} + +/* 23E6F8 -> 23E758; not called */ +void func_8018FF28(struct ObjJoint *a0, struct ObjJoint *a1) { + if (a1->flags & 0x1) { + a0->unk84.x -= a1->unk84.x; + a0->unk84.y -= a1->unk84.y; + a0->unk84.z -= a1->unk84.z; + } +} + +/** + * Unused (not called) - possibly was used to print indent levels inside + * recursive functions + */ +void print_some_spaces(s32 size) { + s32 i; + + for (i = 0; i < size - 1; i++) { + gd_printf(" "); + } +} + +/* 23E7B8 -> 23E938 */ +s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2, struct ObjJoint *a3) { + struct ObjBone *b; // 1C + struct ObjJoint *sp18; + s32 sp14 = 0; + struct ObjGroup *bonegrp; // 10 + struct ObjGroup *grp; // 0c + struct ListNode *bonelink; // 08 + struct ListNode *link; // 04 + + grp = a3->unk1C4; + + if (grp == NULL) { + return 0; + } + link = grp->firstMember; + if (link == NULL) { + return 0; + } + + while (link != NULL) { + if ((b = (struct ObjBone *) link->obj) != NULL) { + bonegrp = b->unk10C; + bonelink = bonegrp->firstMember; + + while (bonelink != NULL) { + sp18 = (struct ObjJoint *) bonelink->obj; + + if (sp18 != a3 && sp18 != a2) { + a1[sp14] = sp18; + a0[sp14] = b; + sp14++; + } + + bonelink = bonelink->next; + } + } + link = link->next; + } + + return sp14; +} + +/* 23E938 -> 23EBB8 */ +void func_80190168(struct ObjBone *b, UNUSED struct ObjJoint *a1, UNUSED struct ObjJoint *a2, + struct GdVec3f *a3) { + struct GdVec3f sp7C; + UNUSED u8 pad64[0x7c - 0x64]; + f32 sp60; + f32 sp5C; + f32 sp58; + UNUSED u8 pad1C[0x58 - 0x1C]; + + return; + + b->unk58.x = sp7C.x; + b->unk58.y = sp7C.y; + b->unk58.z = sp7C.z; + + if (b->unk104 & 0x8) { + sp58 = gd_vec3f_magnitude(&sp7C); + if (sp58 == 0.0f) { + sp58 = 1.0f; + } + sp60 = (b->unkF8 / sp58) * b->spring; + } + + if (b->unk104 & 0x4) { + if (sp60 > (sp58 = gd_vec3f_magnitude(&sp7C))) { + sp5C = b->spring; + a3->x *= sp5C; + a3->y *= sp5C; + a3->z *= sp5C; + } else { + a3->x = 0.0f; + a3->y = 0.0f; + a3->z = 0.0f; + } + } + + if (b->unk104 & 0x2) { + if (sp60 < (sp58 = gd_vec3f_magnitude(&sp7C))) { + sp5C = b->spring; + a3->x *= sp5C; + a3->y *= sp5C; + a3->z *= sp5C; + } else { + a3->x = 0.0f; + a3->y = 0.0f; + a3->z = 0.0f; + } + } +} + +/* 23EBB8 -> 23ED44 */ +void func_801903E8(struct ObjJoint *j, struct GdVec3f *a1, f32 x, f32 y, f32 z) { + f32 sp14; + struct GdVec3f sp8; + + if (j->flags & 0x1 || (j->flags & 0x1000) == 0) { + j->unk3C.x += x; + j->unk3C.y += y; + j->unk3C.z += z; + a1->x = a1->y = a1->z = 0.0f; + ; + + } else { + sp14 = (j->unkB4.x * x) + (j->unkB4.y * y) + (j->unkB4.z * z); + sp8.x = j->unkB4.x * sp14; + sp8.y = j->unkB4.y * sp14; + sp8.z = j->unkB4.z * sp14; + + j->unk3C.x += sp8.x; + j->unk3C.y += sp8.y; + j->unk3C.z += sp8.z; + + a1->x = x - sp8.x; + a1->y = y - sp8.y; + a1->z = z - sp8.z; + } +} + +/* 23EBB8 -> 23F184 */ +void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32 y, f32 z) // sp278 +{ + struct ObjJoint *sp274; // = a2? + struct ObjJoint *sp270; // mid-point of stack array? + struct ObjJoint *sp26C; // jointstackarr[i]? curjoint? + UNUSED u32 pad268; + UNUSED u32 sp264 = 0; + UNUSED u32 sp258[3]; // unused vec? + struct GdVec3f sp24C; + struct GdVec3f sp240; + UNUSED u32 pad238[2]; + s32 sp234; // i? + s32 sp230; + s32 sp22C = 1; + UNUSED u32 pad228; + s32 sp224; + s32 sp220; + struct ObjJoint *sp120[0x40]; + struct ObjBone *sp20[0x40]; + + for (sp230 = 1; sp230 < a0; sp230 *= 2) { + sp22C = sp22C * 2 + 1; + } + + if (a0 & 0x8000) { + fatal_print("Too many nestings!\n"); + } + + printf("\n"); + printf("NIDmask: %d / ", a0); + + a2->unk1C0 |= a0; + sp224 = func_8018FFE8(sp20, sp120, a1, a2); + func_801903E8(a2, &sp240, x, y, z); + for (sp234 = 0; sp234 < sp224; sp234++) { + if (a1 != NULL) { + printf("branch %d from j%d-j%d(%d): ", sp234, a2->id, a1->id, sp224); + } else { + printf("branch %d from j%d(%d): ", sp234, a2->id, sp224); + } + + sp274 = a2; + sp26C = sp120[sp234]; + func_80190168(sp20[sp234], sp274, sp26C, &sp24C); + do { + sp220 = func_8018FFE8(&sp20[0x20], &sp120[0x20], sp274, sp26C); + sp270 = sp120[0x20]; + if (sp26C->unk1C0 & sp22C) { + break; + } + + if (sp220 < 2) { + if (sp26C->flags & 0x1) { + sJointArrLen++; + sJointArr[sJointArrLen] = sp274; + sJointArrVecs[sJointArrLen].x = -sp24C.x; + sJointArrVecs[sJointArrLen].y = -sp24C.y; + sJointArrVecs[sJointArrLen].z = -sp24C.z; + + sp26C->unk90.x += sp24C.x; + sp26C->unk90.y += sp24C.y; + sp26C->unk90.z += sp24C.z; + + sp26C->unk90.x += sp240.x; + sp26C->unk90.y += sp240.y; + sp26C->unk90.z += sp240.z; + + sp240.x = sp240.y = sp240.z = 0.0f; + break; + } else { + sp24C.x += sp240.x; + sp24C.y += sp240.y; + sp24C.z += sp240.z; + + func_801903E8(sp26C, &sp240, sp24C.x, sp24C.y, sp24C.z); + } + + if (sp220 == 1) { + func_80190168(sp20[0x20], sp26C, sp270, &sp24C); + } + } + + if (sp220 > 1) { + func_80190574(a0 * 2, sp274, sp26C, sp24C.x, sp24C.y, sp24C.z); + break; + } + + sp274 = sp26C; + sp26C = sp270; + } while (sp220); + printf("Exit"); + // probably sp274(sp26C) because it would make sense to print + // the iterations of both of these loops. + printf(" %d(%d)", sp274->id, sp26C->id); + printf("R "); + printf("\n"); + } + + printf("\n\n"); +} + +/* 23F184 -> 23F1F0 */ +void func_801909B4(void) { + struct ObjJoint *node; + + D_801A82D0 = 0; + node = gGdJointList; + while (node != NULL) { + node->unk1C0 = 0; + node = node->nextjoint; + } +} + +/* 23F1F0 -> 23F324; not called */ +void func_80190A20(void) { + struct ObjJoint *j; // sp3c + UNUSED u32 pad38; + struct GdVec3f vec; // sp2C + struct ObjGroup *grp; + struct ListNode *link; + struct ObjBone *b; + + j = gGdJointList; + while (j != NULL) { + if (j->flags & 0x40) { + grp = j->unk1C4; + link = grp->firstMember; + b = (struct ObjBone *) link->obj; + + vec.z = b->unk40.x * 100.0f; + vec.y = b->unk40.y * 100.0f; + vec.x = b->unk40.z * 100.0f; + func_80190574(1, NULL, j, vec.z, vec.y, vec.x); + } + + j = j->nextjoint; + } +} + +/* 23F324 -> 23F638 */ +void func_80190B54(struct ObjJoint *a0, struct ObjJoint *a1, struct GdVec3f *a2) // b0 +{ + struct GdVec3f spA4; + UNUSED struct GdVec3f pad98; + struct GdVec3f sp8C; + struct GdVec3f sp80; + f32 sp7C; + f32 sp78; + Mat4f sp38; + UNUSED u8 pad1C[0x1C]; + + if (a1 != NULL) { + spA4.x = a1->unk3C.x; + spA4.y = a1->unk3C.y; + spA4.z = a1->unk3C.z; + + spA4.x -= a0->unk3C.x; + spA4.y -= a0->unk3C.y; + spA4.z -= a0->unk3C.z; + + sp8C.x = spA4.x; + sp8C.y = spA4.y; + sp8C.z = spA4.z; + gd_normalize_vec3f(&sp8C); + + sp7C = a1->unk228; + + D_801BAAE0.x = spA4.x - (sp8C.x * sp7C); + D_801BAAE0.y = spA4.y - (sp8C.y * sp7C); + D_801BAAE0.z = spA4.z - (sp8C.z * sp7C); + + sp78 = 5.4 / sp7C; //? 5.4f + D_801BAAD0.x *= sp78; + D_801BAAD0.y *= sp78; + D_801BAAD0.z *= sp78; + + spA4.x *= sp78; + spA4.y *= sp78; + spA4.z *= sp78; + + gd_cross_vec3f(&spA4, &D_801BAAD0, &sp80); + sp78 = gd_vec3f_magnitude(&sp80); + gd_normalize_vec3f(&sp80); + gd_create_rot_mat_angular(&sp38, &sp80, sp78); + gd_mult_mat4f(&a0->matE8, &sp38, &a0->matE8); + + } else { + D_801BAAE0.x = a2->x; + D_801BAAE0.y = a2->y; + D_801BAAE0.z = a2->z; + } + + a0->unk3C.x += D_801BAAE0.x; + a0->unk3C.y += D_801BAAE0.y; + a0->unk3C.z += D_801BAAE0.z; + + D_801BAAD0.x = D_801BAAE0.x; + D_801BAAD0.y = D_801BAAE0.y; + D_801BAAD0.z = D_801BAAE0.z; +} + +/* 23F638 -> 23F70C; not called */ +void func_80190E68(struct GdObj *obj, f32 x, f32 y, f32 z) { + struct ObjJoint *sp44; + struct GdObj *sp40; + struct GdVec3f vec; + UNUSED u32 pad1C[6]; + + vec.x = x; + vec.y = y; + vec.z = z; + + sp44 = NULL; + sp40 = obj; + while (sp40 != NULL) { + if (sp40->type != OBJ_TYPE_JOINTS) { + break; + } + + func_80190B54(((struct ObjJoint *) sp40), sp44, &vec); + sp44 = ((struct ObjJoint *) sp40); + sp40 = ((struct ObjJoint *) sp40)->attachedToObj; + } +} + +/* 23F70C -> 23F978 */ +f32 func_80190F3C(struct ObjJoint *a0, f32 a1, f32 a2, f32 a3) { + struct ObjJoint *curj; + s32 i; + struct GdVec3f sp24; + + sp24.x = a0->unk3C.x; + sp24.y = a0->unk3C.y; + sp24.z = a0->unk3C.z; + + func_801909B4(); + sJointArrLen = 0; + func_80190574(1, NULL, a0, a1, a2, a3); + + for (i = 1; i <= sJointArrLen; i++) { + sJointArr2[i] = sJointArr[i]; + sJointArr2Vecs[i].x = sJointArrVecs[i].x; + sJointArr2Vecs[i].y = sJointArrVecs[i].y; + sJointArr2Vecs[i].z = sJointArrVecs[i].z; + } + printf("Num return joints (pass 1): %d\n", i); + + sJointArr2Len = sJointArrLen; + sJointArrLen = 0; + + for (i = 1; i <= sJointArr2Len; i++) { + func_801909B4(); + curj = sJointArr2[i]; + func_80190574(1, NULL, curj, sJointArr2Vecs[i].x, sJointArr2Vecs[i].y, sJointArr2Vecs[i].z); + } + printf("Num return joints (pass 2): %d\n", i); + + sp24.x -= a0->unk3C.x; + sp24.y -= a0->unk3C.y; + sp24.z -= a0->unk3C.z; + + return gd_vec3f_magnitude(&sp24); +} + +/* 23F978 -> 23F9F0 */ +void func_801911A8(struct ObjJoint *j) { + j->unkCC.x = j->shapeOffset.x; + j->unkCC.y = j->shapeOffset.y; + j->unkCC.z = j->shapeOffset.z; + + gd_rotate_and_translate_vec3f(&j->unkCC, &gGdSkinNet->mat128); +} + +/* 23F9F0 -> 23FB90 */ +void func_80191220(struct ObjJoint *j) { + j->unk48.x = j->initPos.x; // storing "attached offset"? + j->unk48.y = j->initPos.y; + j->unk48.z = j->initPos.z; + + gd_mat4f_mult_vec3f(&j->unk48, &gGdSkinNet->mat128); + j->unk3C.x = j->unk48.x; + j->unk3C.y = j->unk48.y; + j->unk3C.z = j->unk48.z; + j->worldPos.x = gGdSkinNet->worldPos.x; + j->worldPos.y = gGdSkinNet->worldPos.y; + j->worldPos.z = gGdSkinNet->worldPos.z; + + j->worldPos.x += j->unk3C.x; + j->worldPos.y += j->unk3C.y; + j->worldPos.z += j->unk3C.z; + j->unk1A8.x = j->unk1A8.y = j->unk1A8.z = 0.0f; + gGdCounter.ctr0++; +} + +/* 23FB90 -> 23FBC0 */ +void func_801913C0(struct ObjJoint *j) { + UNUSED u32 pad[4]; + func_80181894(j); +} + +/* 23FBC0 -> 23FCC8 */ +void func_801913F0(struct ObjJoint *j) { + // hmm... + j->velocity.x = j->worldPos.x; + j->velocity.y = j->worldPos.y; + j->velocity.z = j->worldPos.z; + + j->velocity.x -= j->unk30.x; + j->velocity.y -= j->unk30.y; + j->velocity.z -= j->unk30.z; + + j->unk30.x = j->worldPos.x; + j->unk30.y = j->worldPos.y; + j->unk30.z = j->worldPos.z; + + gd_copy_mat4f(&gGdSkinNet->mat128, &j->matE8); +} + +/* 23FCC8 -> 23FCDC */ +void stub_joints_2(UNUSED struct ObjJoint *j) { +} + +/* 23FCDC -> 23FDD4; not called */ +void func_8019150C(Mat4f *a0, struct GdVec3f *a1) { + struct GdVec3f sp1C; + + sp1C.x = (*a0)[3][0] / 10.0; //? 10.0f + sp1C.y = (*a0)[3][1] / 10.0; //? 10.0f + sp1C.z = (*a0)[3][2] / 10.0; //? 10.0f + + a1->x += sp1C.x; + a1->y += sp1C.y; + a1->z += sp1C.z; + gd_mat4f_mult_vec3f(a1, a0); +} + +/* 23FDD4 -> 23FFF4 */ +void reset_joint(struct ObjJoint *j) { + j->worldPos.x = j->initPos.x; + j->worldPos.y = j->initPos.y; + j->worldPos.z = j->initPos.z; + + j->unk30.x = j->initPos.x; + j->unk30.y = j->initPos.y; + j->unk30.z = j->initPos.z; + + j->unk3C.x = j->initPos.x; + j->unk3C.y = j->initPos.y; + j->unk3C.z = j->initPos.z; + + j->velocity.x = j->velocity.y = j->velocity.z = 0.0f; + j->unk84.x = j->unk84.y = j->unk84.z = 0.0f; + j->unk90.x = j->unk90.y = j->unk90.z = 0.0f; + j->unk1A8.x = j->unk1A8.y = j->unk1A8.z = 0.0f; + + gd_set_identity_mat4(&j->mat168); + gd_scale_mat4f_by_vec3f(&j->mat168, (struct GdVec3f *) &j->scale); + gd_rot_mat_about_vec(&j->mat168, (struct GdVec3f *) &j->unk6C); + gd_add_vec3f_to_mat4f_offset(&j->mat168, &j->attachOffset); + gd_copy_mat4f(&j->mat168, &j->matE8); + + gd_set_identity_mat4(&j->mat128); + gd_add_vec3f_to_mat4f_offset(&j->mat128, &j->initPos); +} + +/* 23FFF4 -> 2400C4 */ +void func_80191824(struct ObjJoint *j) { + UNUSED struct ObjNet *sp14; + UNUSED u32 pad00[4]; + + sp14 = gGdSkinNet->unk1F0; + if (j->flags & 0x1) { + j->worldPos.x = gGdSkinNet->worldPos.x; + j->worldPos.y = gGdSkinNet->worldPos.y; + j->worldPos.z = gGdSkinNet->worldPos.z; + + j->unk3C.x = gGdSkinNet->worldPos.x; + j->unk3C.y = gGdSkinNet->worldPos.y; + j->unk3C.z = gGdSkinNet->worldPos.z; + } +} + +/* 2400C4 -> 2401EC; not called */ +void func_801918F4(struct ObjJoint *j) { + f32 sp4; + + j->velocity.x = j->unk3C.x; + j->velocity.y = j->unk3C.y; + j->velocity.z = j->unk3C.z; + + j->velocity.x -= j->unk30.x; + j->velocity.y -= j->unk30.y; + j->velocity.z -= j->unk30.z; + + j->unk30.x = j->unk3C.x; + j->unk30.y = j->unk3C.y; + j->unk30.z = j->unk3C.z; + + sp4 = -4.0f; + + if (!(j->flags & 0x41)) { + j->velocity.y += sp4 * 0.2; //? 0.2f + + j->unk3C.x += j->velocity.x; + j->unk3C.y += j->velocity.y; + j->unk3C.z += j->velocity.z; + } +} + +/* 2401EC -> 2403C8; not called */ +void func_80191A1C(struct ObjBone *a0) { + f32 sp3C; + f32 sp38 = 0.0f; + struct GdObj *argjoint; + struct GdObj *tempjoint; + struct GdVec3f sp24; + struct GdVec3f sp18; + + if (gGdTempBone == NULL) { + gGdTempBone = a0; + } + sp3C = gd_dot_vec3f(&gGdTempBone->unk40, &a0->unk40); + a0->unk118 = sp3C; + + if ((sp3C -= sp38) < 0.0f) { + tempjoint = gGdTempBone->unk10C->firstMember->obj; + argjoint = a0->unk10C->firstMember->next->obj; + set_cur_dynobj(argjoint); + d_get_rel_pos(&sp24); + set_cur_dynobj(tempjoint); + d_get_rel_pos(&sp18); + + sp24.x -= sp18.x; + sp24.y -= sp18.y; + sp24.z -= sp18.z; + gd_normalize_vec3f(&sp24); + + sp3C = -sp3C * 50.0; //? 50.0f + if (!(((struct ObjJoint *) argjoint)->flags & 0x1)) { + func_80190F3C((struct ObjJoint *) argjoint, sp24.x * sp3C, sp24.y * sp3C, sp24.z * sp3C); + } + } + gGdTempBone = a0; +} + +/* 2403C8 -> 240530 */ +void func_80191BF8(struct ObjJoint *j) { + f32 sp1C; + f32 sp18 = -2.0f; + + if (!(j->flags & 0x1)) { + j->unk3C.y += sp18; + } + + if ((sp1C = j->unk3C.y - (D_801A8058 + 30.0f)) < 0.0f && j->velocity.y < 0.0f) { + sp1C += j->velocity.y; + sp1C *= 0.8; //? 0.8f + func_80190F3C(j, -j->velocity.x * 0.7, -sp1C, -j->velocity.z * 0.7); + } + + func_80190F3C(j, 0.0f, 0.0f, 0.0f); +} + +/* 240530 -> 240624 */ +void func_80191D60(struct ObjJoint *j) { + j->velocity.x += j->unk3C.x - j->worldPos.x; + j->velocity.y += j->unk3C.y - j->worldPos.y; + j->velocity.z += j->unk3C.z - j->worldPos.z; + + j->velocity.x *= 0.9; //? 0.9f + j->velocity.y *= 0.9; //? 0.9f + j->velocity.z *= 0.9; //? 0.9f + + j->worldPos.x += j->velocity.x; + j->worldPos.y += j->velocity.y; + j->worldPos.z += j->velocity.z; +} + +/* 240624 -> 240658 */ +void func_80191E54(struct ObjJoint *j) { + j->unk3C.x = j->worldPos.x; + j->unk3C.y = j->worldPos.y; + j->unk3C.z = j->worldPos.z; +} + +/* 240658 -> 2406B8 */ +void func_80191E88(struct ObjGroup *grp) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191BF8, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191D60, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191E54, grp); +} + +/* 2406B8 -> 2406E0; orig name: func_80191EE8 */ +void reset_joint_counts(void) { + sJointCount = 0; + sJointNotF1Count = 0; + sBoneCount = 0; +} diff --git a/src/goddard/joints.h b/src/goddard/joints.h new file mode 100644 index 00000000..a78c7a7a --- /dev/null +++ b/src/goddard/joints.h @@ -0,0 +1,31 @@ +#ifndef GD_JOINTS_H +#define GD_JOINTS_H + +#include + +#include "gd_types.h" + +// bss +extern s32 sResetWeightVtxNum; + +// functions +void eye_joint_update_func(struct ObjJoint *self); +struct ObjJoint *make_joint(s32 flags, f32 x, f32 y, f32 z); +struct ObjJoint *make_grabber_joint(struct ObjShape *shape, s32 flags, f32 x, f32 y, f32 z); +void func_8018F328(struct ObjBone *b); +void func_8018FA68(struct ObjBone *b); +s32 set_skin_weight(struct ObjJoint *j, s32 id, struct ObjVertex *vtx, f32 weight); +void func_8018FB58(struct ObjBone *b); +void add_joint2bone(struct ObjBone *b, struct ObjJoint *j); +struct ObjBone *make_bone(s32 a0, struct ObjJoint *j1, struct ObjJoint *j2, s32 a3); +void func_801911A8(struct ObjJoint *j); +void func_80191220(struct ObjJoint *j); +void func_801913C0(struct ObjJoint *j); +void func_801913F0(struct ObjJoint *j); +void stub_joints_2(struct ObjJoint *j); +void reset_joint(struct ObjJoint *j); +void func_80191824(struct ObjJoint *j); +void func_80191E88(struct ObjGroup *grp); +void reset_joint_counts(void); + +#endif // GD_JOINTS_H diff --git a/src/goddard/objects.c b/src/goddard/objects.c new file mode 100644 index 00000000..fab64f2e --- /dev/null +++ b/src/goddard/objects.c @@ -0,0 +1,2098 @@ +#include +#include +#include + +#include "objects.h" + +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "gd_macros.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "old_menu.h" +#include "particles.h" +#include "renderer.h" +#include "sfx.h" +#include "shape_helper.h" +#include "skin.h" + +// structs +struct Unk801B9E68 { + /* 0x00 */ s32 count; + /* 0x04 */ u8 pad[0x14]; +}; /* sizeof() = 0x18 */ + +struct Unk8017F3CC { + /*0x00*/ u8 pad[0x20]; + /*0x20*/ struct GdVec3f unk20; +}; + +// data +f32 D_801A81C0 = 0.0f; +f32 D_801A81C4 = 0.0f; + +// bss +struct GdBoundingBox gSomeBoundingBox; +struct ObjCamera *sCurrentMoveCamera; // @ 801B9DB8 +struct ObjView *sCurrentMoveView; // @ 801B9DBC +struct DebugCounters gGdCounter; // @ 801B9DC0 +Mat4f D_801B9DC8; +struct GdVec3f D_801B9E08; +struct ObjGroup *sCurrentMoveGrp; // @ 801B9E14 +struct GdVec3f D_801B9E18; +struct GdVec3f D_801B9E28; +f32 D_801B9E34; +Mat4f *D_801B9E38; +struct ObjParticle *D_801B9E3C; +s32 D_801B9E40; +s32 D_801B9E44; +Mat4f *D_801B9E48; +struct ObjCamera *gGdCameraList; // @ 801B9E4C +void *D_801B9E50; +struct ObjGroup *gGdGroupList; // @ 801B9E54 +s32 gGdObjCount; // @ 801B9E58 +s32 gGdGroupCount; // @ 801B9E5C +s32 gGdPlaneCount; // @ 801B9E60 +s32 gGdCameraCount; // @ 801B9E64 +struct Unk801B9E68 sGdViewInfo; // @ 801B9E68 +void *D_801B9E80; +struct ObjJoint *gGdJointList; // @ 801B9E84 +struct ObjBone *gGdBoneList; // @ 801B9E88 +struct GdObj *gGdObjectList; // head of linked list containing every single GdObj that was created +struct ObjGroup *gGdViewsGroup; // @ 801B9E90 + +/* @ 22A480 for 0x70 */ +void reset_bounding_box(void) { /* Initialize Plane? */ + gSomeBoundingBox.minX = 10000000.0f; + gSomeBoundingBox.minY = 10000000.0f; + gSomeBoundingBox.minZ = 10000000.0f; + + gSomeBoundingBox.maxX = -10000000.0f; + gSomeBoundingBox.maxY = -10000000.0f; + gSomeBoundingBox.maxZ = -10000000.0f; +} + +void add_obj_pos_to_bounding_box(struct GdObj *obj) { + struct GdVec3f pos; + + set_cur_dynobj(obj); + d_get_world_pos(&pos); + + if (pos.x < gSomeBoundingBox.minX) { + gSomeBoundingBox.minX = pos.x; + } + + if (pos.y < gSomeBoundingBox.minY) { + gSomeBoundingBox.minY = pos.y; + } + + if (pos.z < gSomeBoundingBox.minZ) { + gSomeBoundingBox.minZ = pos.z; + } + + if (pos.x > gSomeBoundingBox.maxX) { + gSomeBoundingBox.maxX = pos.x; + } + + if (pos.y > gSomeBoundingBox.maxY) { + gSomeBoundingBox.maxY = pos.y; + } + + if (pos.z > gSomeBoundingBox.maxZ) { + gSomeBoundingBox.maxZ = pos.z; + } +} + +/* @ 22A630 for 0x70 */ +void get_some_bounding_box(struct GdBoundingBox *a0) { + a0->minX = gSomeBoundingBox.minX; + a0->minY = gSomeBoundingBox.minY; + a0->minZ = gSomeBoundingBox.minZ; + + a0->maxX = gSomeBoundingBox.maxX; + a0->maxY = gSomeBoundingBox.maxY; + a0->maxZ = gSomeBoundingBox.maxZ; +} + +/* @ 22A6A0 for 0x24 */ +void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1) { + UNUSED u8 sp00[8]; + /* Debug stub? */ + return; +} + +/** + * Returns a string containing the name of the the object type + */ +static const char *get_obj_name_str(enum ObjTypeFlag objFlag) { + const char *objName; + switch (objFlag) { + case OBJ_TYPE_JOINTS: + objName = "joints"; + break; + case OBJ_TYPE_BONES: + objName = "bones"; + break; + case OBJ_TYPE_GROUPS: + objName = "groups"; + break; + case OBJ_TYPE_PARTICLES: + objName = "particles"; + break; + case OBJ_TYPE_SHAPES: + objName = "shapes"; + break; + case OBJ_TYPE_NETS: + objName = "nets"; + break; + case OBJ_TYPE_PLANES: + objName = "planes"; + break; + case OBJ_TYPE_VERTICES: + objName = "vertices"; + break; + case OBJ_TYPE_CAMERAS: + objName = "cameras"; + break; + case OBJ_TYPE_FACES: + objName = "faces"; + break; + case OBJ_TYPE_MATERIALS: + objName = "materials"; + break; + case OBJ_TYPE_LIGHTS: + objName = "lights"; + break; + case OBJ_TYPE_WEIGHTS: + objName = "weights"; + break; + case OBJ_TYPE_GADGETS: + objName = "gadgets"; + break; + case OBJ_TYPE_VIEWS: + objName = "views"; + break; + case OBJ_TYPE_LABELS: + objName = "labels"; + break; + case OBJ_TYPE_ANIMATORS: + objName = "animators"; + break; + case OBJ_TYPE_VALPTRS: + objName = "valptrs"; + break; + case OBJ_TYPE_ZONES: + objName = "zones"; + break; + default: + objName = "unkown"; + break; + } + return objName; +} + +/** + * Creates an object of the specified type + */ +struct GdObj *make_object(enum ObjTypeFlag objType) { + struct GdObj *newObj; + struct GdObj *objListOldHead; + s32 objSize; + s32 i; + drawmethod_t objDrawFn; + const char *typeName; + u8 *newObjBytes; + s32 objPermanence = 0x10; + + imin("make_object"); + + switch (objType) { + case OBJ_TYPE_JOINTS: + objSize = sizeof(struct ObjJoint); + objDrawFn = (drawmethod_t) draw_joint; + break; + case OBJ_TYPE_BONES: + objSize = sizeof(struct ObjBone); + objDrawFn = (drawmethod_t) draw_bone; + break; + case OBJ_TYPE_GROUPS: + objSize = sizeof(struct ObjGroup); + objDrawFn = (drawmethod_t) draw_group; + break; + case OBJ_TYPE_PARTICLES: + objSize = sizeof(struct ObjParticle); + objDrawFn = (drawmethod_t) draw_particle; + break; + case OBJ_TYPE_SHAPES: + objSize = sizeof(struct ObjShape); + // Shapes get drawn by their parent object instead of automatically. + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_UNK200000: + objSize = sizeof(struct ObjUnk200000); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_NETS: + objSize = sizeof(struct ObjNet); + objDrawFn = (drawmethod_t) draw_net; + break; + case OBJ_TYPE_PLANES: + objSize = sizeof(struct ObjPlane); + objDrawFn = (drawmethod_t) draw_plane; + break; + case OBJ_TYPE_VERTICES: + objSize = sizeof(struct ObjVertex); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_CAMERAS: + objSize = sizeof(struct ObjCamera); + objDrawFn = (drawmethod_t) draw_camera; + break; + case OBJ_TYPE_FACES: + objSize = sizeof(struct ObjFace); + objDrawFn = (drawmethod_t) draw_face; + objPermanence = 1; + break; + case OBJ_TYPE_MATERIALS: + objSize = sizeof(struct ObjMaterial); + objDrawFn = (drawmethod_t) draw_material; + break; + case OBJ_TYPE_LIGHTS: + objSize = sizeof(struct ObjLight); + objDrawFn = (drawmethod_t) draw_light; + break; + case OBJ_TYPE_WEIGHTS: + objSize = sizeof(struct ObjWeight); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_GADGETS: + objSize = sizeof(struct ObjGadget); + objDrawFn = (drawmethod_t) draw_gadget; + break; + case OBJ_TYPE_VIEWS: + objSize = sizeof(struct ObjView); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_LABELS: + objSize = sizeof(struct ObjLabel); + objDrawFn = (drawmethod_t) draw_label; + break; + case OBJ_TYPE_ANIMATORS: + objSize = sizeof(struct ObjAnimator); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_VALPTRS: + objSize = sizeof(struct ObjValPtr); + objDrawFn = (drawmethod_t) draw_nothing; + break; + case OBJ_TYPE_ZONES: + objSize = sizeof(struct ObjZone); + objDrawFn = (drawmethod_t) draw_nothing; + break; + default: + fatal_print("make_object() : Unkown object!"); + } + + typeName = get_obj_name_str(objType); + + // Allocate memory for the object + start_memtracker(typeName); + newObj = gd_malloc(objSize, objPermanence); + if (newObj == NULL) { + fatal_printf("Cant allocate object '%s' memory!", typeName); + } + stop_memtracker(typeName); + + // Zero out the object + newObjBytes = (u8 *) newObj; + for (i = 0; i < objSize; i++) { + newObjBytes[i] = 0; + } + + // Add the new object to the beginning of gGdObjectList + gGdObjCount++; + objListOldHead = gGdObjectList; + gGdObjectList = newObj; + newObj->prev = NULL; + if (objListOldHead != NULL) { + newObj->next = objListOldHead; + objListOldHead->prev = newObj; + } + + // Fill in required fields + newObj->index = gGdObjCount; + newObj->type = objType; + newObj->objDrawFn = objDrawFn; + newObj->drawFlags = 0; + + imout(); + return newObj; +} + +/* @ 22AEA0 for 0xD0; orig name: func_8017C6D0 */ +struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *bbox, struct ObjGroup *a2) { + struct ObjZone *newZone = (struct ObjZone *) make_object(OBJ_TYPE_ZONES); + + newZone->boundingBox.minX = bbox->minX; + newZone->boundingBox.minY = bbox->minY; + newZone->boundingBox.minZ = bbox->minZ; + newZone->boundingBox.maxX = bbox->maxX; + newZone->boundingBox.maxY = bbox->maxY; + newZone->boundingBox.maxZ = bbox->maxZ; + // pointers? prev, next? + newZone->unk2C = a2; + newZone->unk30 = a0; + +//! @bug Created `ObjZone` is not returned +#ifdef AVOID_UB + return newZone; +#endif +} + +/* @ 22AF70 for 0x60 */ +struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1) { + struct ObjUnk200000 *unk = (struct ObjUnk200000 *) make_object(OBJ_TYPE_UNK200000); + + unk->unk30 = a0; + unk->unk34 = a1; + + return unk; +} + +/** + * Creates a ListNode for the object. Adds the new node after `prevNode` if `prevNode` is not NULL. + */ +struct ListNode *make_link_to_obj(struct ListNode *prevNode, struct GdObj *obj) { + struct ListNode *newNode; + + // Allocate link node + start_memtracker("links"); + newNode = gd_malloc_perm(sizeof(struct ListNode)); + if (newNode == NULL) { + fatal_print("Cant allocate link memory!"); + } + stop_memtracker("links"); + + // Append to `prevNode` if not NULL + if (prevNode != NULL) { + prevNode->next = newNode; + } + + newNode->prev = prevNode; + newNode->next = NULL; + newNode->obj = obj; + + return newNode; +} + +/* + * Creates a VtxLink for the vertex. Adds the new node after `prevNode` if `prevNode` is not NULL. + */ +struct VtxLink *make_vtx_link(struct VtxLink *prevNode, Vtx *data) { + struct VtxLink *newNode; + + newNode = gd_malloc_perm(sizeof(struct VtxLink)); + if (newNode == NULL) { + fatal_print("Cant allocate link memory!"); + } + + // Append to `prevNode` if not NULL + if (prevNode != NULL) { + prevNode->next = newNode; + } + + newNode->prev = prevNode; + newNode->next = NULL; + newNode->data = data; + + // WTF? Not sure what this is supposed to check + if (((uintptr_t)(newNode)) == 0x3F800000) { + fatal_printf("bad3\n"); + } + + return newNode; +} + +/* @ 22B154 for 0x88; orig name: func8017C984 */ +struct ObjValPtr *make_valptr(struct GdObj *obj, s32 flag, enum ValPtrType type, size_t offset) { + struct ObjValPtr *sp1C = (struct ObjValPtr *) make_object(OBJ_TYPE_VALPTRS); + + sp1C->obj = obj; + sp1C->flag = flag; + sp1C->offset = offset; + sp1C->datatype = type; + + return sp1C; +} + +/* @ 22B1DC for 0x430 */ +void reset_plane(struct ObjPlane *plane) { + struct ObjFace *sp4C; + f32 sp48; + f32 sp44; + UNUSED u32 sp40; + UNUSED u32 sp3C; + UNUSED u32 sp38; + s32 i; + s32 sp30; + register f32 sp28; + + imin("reset_plane"); + + sp4C = plane->unk40; + calc_face_normal(sp4C); + plane->unk1C = gd_dot_vec3f(&sp4C->vertices[0]->pos, &sp4C->normal); + sp48 = 0.0f; + + sp28 = sp4C->normal.x < 0.0f ? -sp4C->normal.x : sp4C->normal.x; + sp44 = sp28; + if (sp44 > sp48) { + sp30 = 0; + sp48 = sp44; + } + + sp28 = sp4C->normal.y < 0.0f ? -sp4C->normal.y : sp4C->normal.y; + sp44 = sp28; + if (sp44 > sp48) { + sp30 = 1; + sp48 = sp44; + } + + sp28 = sp4C->normal.z < 0.0f ? -sp4C->normal.z : sp4C->normal.z; + sp44 = sp28; + if (sp44 > sp48) { + sp30 = 2; + } + + switch (sp30) { + case 0: + plane->unk20 = 1; + plane->unk24 = 2; + break; + case 1: + plane->unk20 = 0; + plane->unk24 = 2; + break; + case 2: + plane->unk20 = 0; + plane->unk24 = 1; + break; + } + + reset_bounding_box(); + + for (i = 0; i < sp4C->vtxCount; i++) { + add_obj_pos_to_bounding_box(&sp4C->vertices[i]->header); + } + + plane->boundingBox.minX = gSomeBoundingBox.minX; + plane->boundingBox.minY = gSomeBoundingBox.minY; + plane->boundingBox.minZ = gSomeBoundingBox.minZ; + plane->boundingBox.maxX = gSomeBoundingBox.maxX; + plane->boundingBox.maxY = gSomeBoundingBox.maxY; + plane->boundingBox.maxZ = gSomeBoundingBox.maxZ; + + if (plane->boundingBox.maxX - plane->boundingBox.minX < 100.0f) { + plane->boundingBox.maxX += 50.0f; + plane->boundingBox.minX -= 50.0f; + } + + plane->boundingBox.maxY += 200.0f; + plane->boundingBox.minY -= 200.0f; + + if (plane->boundingBox.maxZ - plane->boundingBox.minZ < 100.0f) { + plane->boundingBox.maxZ += 50.0f; + plane->boundingBox.minZ -= 50.0f; + } + imout(); +} + +/* @ 22B60C for 0x94; orig name: func_8017CE3C */ +struct ObjPlane *make_plane(s32 inZone, struct ObjFace *a1) { + UNUSED u32 pad1C; + struct ObjPlane *newPlane = (struct ObjPlane *) make_object(OBJ_TYPE_PLANES); + + gGdPlaneCount++; + newPlane->id = gGdPlaneCount; + newPlane->unk18 = inZone; + newPlane->unk40 = a1; + reset_plane(newPlane); + + return newPlane; +} + +/* @ 22B6A0 for 0x21C; orig name: func_8017CED0 */ +struct ObjCamera *make_camera(s32 flags, struct GdObj *a1) { + struct ObjCamera *newCam; + struct ObjCamera *oldCameraHead; + + newCam = (struct ObjCamera *) make_object(OBJ_TYPE_CAMERAS); + + gGdCameraCount++; + newCam->id = gGdCameraCount; + + oldCameraHead = gGdCameraList; + gGdCameraList = newCam; + + if (oldCameraHead != NULL) { + newCam->next = oldCameraHead; + oldCameraHead->prev = newCam; + } + + newCam->flags = flags | 0x10; + newCam->unk30 = a1; + gd_set_identity_mat4(&newCam->unk64); + gd_set_identity_mat4(&newCam->unkA8); + + newCam->unk180.x = 1.0f; + newCam->unk180.y = 0.1f; + newCam->unk180.z = 1.0f; + + newCam->unk134.x = 4.0f; + newCam->unk134.y = 4.0f; + newCam->unk134.z = 4.0f; + + newCam->unk178 = 0.0f; + newCam->unk17C = 0.25f; + + newCam->zoomLevel = 0; + newCam->maxZoomLevel = -1; + + newCam->unkA4 = 0.0f; + + newCam->lookAt.x = newCam->lookAt.y = newCam->lookAt.z = 0.0f; + newCam->worldPos.x = newCam->worldPos.y = newCam->worldPos.z = 0.0f; + + return newCam; +} + +/* @ 22B8BC for 0xA8; orig. name: func_8017D0EC */ +struct ObjMaterial *make_material(UNUSED s32 a0, char *name, s32 id) { + struct ObjMaterial *newMtl; + + newMtl = (struct ObjMaterial *) make_object(OBJ_TYPE_MATERIALS); + + if (name != NULL) { + gd_strcpy(newMtl->name, name); + } else { + gd_strcpy(newMtl->name, "NoName"); + } + + newMtl->id = id; + newMtl->gddlNumber = 0; + newMtl->type = 16; + + return newMtl; +} + +/* @ 22B964 for 0x114; orig name: func_8017D194 */ +struct ObjLight *make_light(s32 flags, char *name, s32 id) { + struct ObjLight *newLight; + + newLight = (struct ObjLight *) make_object(OBJ_TYPE_LIGHTS); + + if (name != NULL) { + gd_strcpy(newLight->name, name); + } else { + gd_strcpy(newLight->name, "NoName"); + } + + newLight->id = id; + newLight->unk30 = 1.0f; + newLight->unk4C = 0; + newLight->flags = flags | LIGHT_NEW_UNCOUNTED; + newLight->unk98 = 0; + newLight->unk40 = 0; + + newLight->unk68.x = newLight->unk68.y = newLight->unk68.z = 0; + + return newLight; +} + +/* @ 22BA78 for 0x294; orig name: func_8017D2A8*/ +struct ObjView *make_view(const char *name, s32 flags, s32 projectionType, s32 ulx, s32 uly, s32 lrx, s32 lry, + struct ObjGroup *parts) { + struct ObjView *newView = (struct ObjView *) make_object(OBJ_TYPE_VIEWS); + + if (gGdViewsGroup == NULL) { + gGdViewsGroup = make_group(0); + } + + addto_group(gGdViewsGroup, &newView->header); + + newView->flags = flags | VIEW_UPDATE | VIEW_LIGHT; + newView->id = sGdViewInfo.count++; + + if ((newView->components = parts) != NULL) { + reset_nets_and_gadgets(parts); + } + + newView->unk78 = 0; + newView->projectionType = projectionType; + + newView->clipping.x = 30.0f; + newView->clipping.y = 5000.0f; + newView->clipping.z = 45.0f; + + newView->upperLeft.x = (f32) ulx; + newView->upperLeft.y = (f32) uly; + + newView->lowerRight.x = (f32) lrx; + newView->lowerRight.y = (f32) lry; + + newView->unk48 = 1.0f; + newView->unk4C = 1.0f; + + newView->colour.r = newView->id * 0.1; //? 0.1f, unless the extra precision was wanted for the tenth + newView->colour.g = 0.06f; + newView->colour.b = 1.0f; + + newView->proc = NULL; + newView->unk9C = 0; + + if (name != NULL) { + newView->unk1C = setup_view_buffers(name, newView, ulx, uly, lrx, lry); + } + + newView->namePtr = name; + newView->lights = NULL; + + return newView; +} + +/* @ 22BD0C for 0x78; orig name: func_8017D53C */ +struct ObjAnimator *make_animator(void) { + struct ObjAnimator *newAnim = (struct ObjAnimator *) make_object(OBJ_TYPE_ANIMATORS); + newAnim->unk24 = 1.0f; + newAnim->frame = 1.0f; + + newAnim->controlFunc = NULL; + newAnim->state = 0; + + return newAnim; +} + +/* @ 22BD84 for 0x78; orig name: func_8017D5B4 */ +struct ObjWeight *make_weight(UNUSED s32 a0, s32 vtxId, struct ObjVertex *vtx /* always NULL */, f32 weight) { + struct ObjWeight *newWeight = (struct ObjWeight *) make_object(OBJ_TYPE_WEIGHTS); + + newWeight->vtxId = vtxId; + newWeight->weightVal = weight; + newWeight->vtx = vtx; // is always NULL here. This vtx field actually gets set in reset_weight_vtx. + + return newWeight; +} + +/** + * Makes a group, adding all objects from `fromObj` to `toObj` with type `type` + * as members. + */ +struct ObjGroup *make_group_of_type(enum ObjTypeFlag type, struct GdObj *fromObj, struct GdObj *toObj) { + struct ObjGroup *newGroup; + struct GdObj *curObj; + + newGroup = make_group(0); + curObj = fromObj; + + while (curObj != NULL) { + if (curObj->type & type) { + addto_group(newGroup, curObj); + } + + if (curObj == toObj) { + break; + } + + curObj = curObj->prev; + } + + return newGroup; +} + +/** + * Converts the object's ID to a string and places it in the buffer pointed to by `str`. + */ +void format_object_id(char *str, struct GdObj *obj) { + enum ObjTypeFlag type = obj->type; + + switch (type) { + case OBJ_TYPE_BONES: + sprintf(str, "b%d ", ((struct ObjBone *) obj)->id); + break; + case OBJ_TYPE_JOINTS: + sprintf(str, "j%d ", ((struct ObjJoint *) obj)->id); + break; + case OBJ_TYPE_GROUPS: + sprintf(str, "g%d ", ((struct ObjGroup *) obj)->id); + break; + case OBJ_TYPE_PARTICLES: + sprintf(str, "p%d ", ((struct ObjParticle *) obj)->id); + break; + case OBJ_TYPE_NETS: + sprintf(str, "net(no id) "); + break; + case OBJ_TYPE_CAMERAS: + sprintf(str, "c%d ", ((struct ObjCamera *) obj)->id); + break; + case OBJ_TYPE_VERTICES: + sprintf(str, "v(no id) "); + break; + case OBJ_TYPE_PLANES: + sprintf(str, "pl%d ", ((struct ObjPlane *) obj)->id); + break; + default: + sprintf(str, "?%x ", type); + break; + } +} + +/* @ 22C094 for 0x210 */ +struct ObjGroup *make_group(s32 count, ...) { + va_list args; + s32 i; + UNUSED u32 sp5C; + struct GdObj *curObj; + UNUSED u32 sp54; + UNUSED u32 sp50; + UNUSED u32 sp4C; + struct ObjGroup *newGroup; + struct ObjGroup *oldGroupListHead; + struct GdObj *vargObj; + char idStrBuf[0x20]; + struct ListNode *curLink; + + newGroup = (struct ObjGroup *) make_object(OBJ_TYPE_GROUPS); + newGroup->id = ++gGdGroupCount; + newGroup->memberCount = 0; + newGroup->firstMember = newGroup->lastMember = NULL; + + printf("Made group no.%d\n", newGroup->id); + + oldGroupListHead = gGdGroupList; + gGdGroupList = newGroup; + if (oldGroupListHead != NULL) { + newGroup->next = oldGroupListHead; + oldGroupListHead->prev = newGroup; + } + + if (count == 0) { + return newGroup; + } + + va_start(args, count); + curLink = NULL; + + for (i = 0; i < count; i++) { + // get the next pointer in the struct. + vargObj = va_arg(args, struct GdObj *); + + if (vargObj == NULL) { // one of our pointers was NULL. raise an error. + fatal_printf("make_group() NULL group ptr"); + } + + curObj = vargObj; + newGroup->memberTypes |= curObj->type; + addto_group(newGroup, vargObj); + } + va_end(args); + + curLink = newGroup->firstMember; + printf("Made group no.%d from: ", newGroup->id); + while (curLink != NULL) { + curObj = curLink->obj; + format_object_id(idStrBuf, curObj); + printf("%s", idStrBuf); + printf("\n"); + curLink = curLink->next; + } + + return newGroup; +} + +/** + * Adds the object as a member of the group, placing it at the end of the group's list. + */ +void addto_group(struct ObjGroup *group, struct GdObj *obj) { + char strbuf[0x20]; + UNUSED u8 pad[0x8]; + + imin("addto_group"); + + // Add object to the end of group's member list + if (group->firstMember == NULL) { + group->firstMember = make_link_to_obj(NULL, obj); + group->lastMember = group->firstMember; + } else { + group->lastMember = make_link_to_obj(group->lastMember, obj); + } + + group->memberTypes |= obj->type; + group->memberCount++; + + printf("Added "); + format_object_id(strbuf, obj); + printf("%s", strbuf); + printf(" to "); + format_object_id(strbuf, &group->header); + printf("%s", strbuf); + printf("\n"); + + imout(); +} + +/** + * Adds the object as a member of the group, placing it at the beginning of the group's list. + */ +void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj) { + imin("addto_groupfirst"); + + // Add object to the beginning of group's member list + if (group->firstMember == NULL) { + group->firstMember = make_link_to_obj(NULL, obj); + group->lastMember = group->firstMember; + } else { + struct ListNode *newNode = make_link_to_obj(NULL, obj); + group->firstMember->prev = newNode; + newNode->next = group->firstMember; + group->firstMember = newNode; + } + + group->memberTypes |= obj->type; + group->memberCount++; + + imout(); +} + +/** + * Returns TRUE if `obj` is a member of `group`, or FALSE otherwise + */ +s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) { + struct ListNode *node = group->firstMember; + + while (node != NULL) { + if (node->obj->index == obj->index) + return TRUE; + node = node->next; + } + + return FALSE; +} + +/** + * Unused (not called) - this shows details about all objects in the main object linked list + */ +void show_details(enum ObjTypeFlag type) { + enum ObjTypeFlag curObjType; + struct ListNode *curGroupLink; + struct ObjGroup *curSubGroup; + struct GdObj *curObj; + char idStrBuf[0x24]; + s32 curGroupTypes; + + gd_printf("\nDetails about: "); + switch (type) { + case OBJ_TYPE_GROUPS: + gd_printf("Groups\n"); + break; + case OBJ_TYPE_BONES: + gd_printf("Bones\n"); + break; + case OBJ_TYPE_JOINTS: + gd_printf("Joints\n"); + break; + case OBJ_TYPE_PARTICLES: + gd_printf("Particles\n"); + break; + default: + gd_printf("Everything?\n"); + break; + } + + curObj = gGdObjectList; + while (curObj != NULL) { + curObjType = curObj->type; + if (curObjType == type) { + format_object_id(idStrBuf, curObj); + switch (curObjType) { + case OBJ_TYPE_GROUPS: + gd_printf("Group %s: ", idStrBuf); + curGroupTypes = ((struct ObjGroup *) curObj)->memberTypes; + + if (curGroupTypes & OBJ_TYPE_GROUPS) { + gd_printf("groups "); + } + if (curGroupTypes & OBJ_TYPE_BONES) { + gd_printf("bones "); + } + if (curGroupTypes & OBJ_TYPE_JOINTS) { + gd_printf("joints "); + } + if (curGroupTypes & OBJ_TYPE_PARTICLES) { + gd_printf("particles "); + } + if (curGroupTypes & OBJ_TYPE_CAMERAS) { + gd_printf("cameras "); + } + if (curGroupTypes & OBJ_TYPE_NETS) { + gd_printf("nets "); + } + if (curGroupTypes & OBJ_TYPE_GADGETS) { + gd_printf("gadgets "); + } + if (curGroupTypes & OBJ_TYPE_LABELS) { + gd_printf("labels "); + } + if (curGroupTypes & OBJ_TYPE_FACES) { + gd_printf("face "); + } + if (curGroupTypes & OBJ_TYPE_VERTICES) { + gd_printf("vertex "); + } + + curGroupLink = ((struct ObjGroup *) curObj)->firstMember; + while (curGroupLink != NULL) { + format_object_id(idStrBuf, curGroupLink->obj); + gd_printf("%s", idStrBuf); + curGroupLink = curGroupLink->next; + } + gd_printf("\n"); + break; + case OBJ_TYPE_BONES: + gd_printf("Bone %s: ", idStrBuf); + curSubGroup = ((struct ObjBone *) curObj)->unk10C; + curGroupLink = curSubGroup->firstMember; + while (curGroupLink != NULL) { + format_object_id(idStrBuf, curGroupLink->obj); + gd_printf("%s", idStrBuf); + curGroupLink = curGroupLink->next; + } + gd_printf("\n"); + break; + case OBJ_TYPE_JOINTS: + gd_printf("Joint %s: ", idStrBuf); + curSubGroup = ((struct ObjJoint *) curObj)->unk1C4; + curGroupLink = curSubGroup->firstMember; + while (curGroupLink != NULL) { + format_object_id(idStrBuf, curGroupLink->obj); + gd_printf("%s", idStrBuf); + curGroupLink = curGroupLink->next; + } + gd_printf("\n"); + break; + default:; + } + } + curObj = curObj->next; + } +} + +/* @ 22C9B8 for 0x24 */ +s32 stub_objects_2(void) { + s32 sp4 = 0; + return sp4; +} + +/** + * Unused - called by __main__ + */ +s32 make_scene(void) { + s32 sp4 = 0; + return sp4; +} + +/* @ 22CA00 for 0x88 */ +static void reset_joint_or_net(struct GdObj *obj) { + struct GdObj *localObjPtr = obj; + + switch (obj->type) { + case OBJ_TYPE_JOINTS: + reset_joint((struct ObjJoint *) localObjPtr); + break; + case OBJ_TYPE_NETS: + reset_net((struct ObjNet *) localObjPtr); + break; + default:; + } +} + +/** + * called when the user clicks the "Reset Positions" item from the + * "Dynamics" menu. + */ +void menu_cb_reset_positions(void) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_joint_or_net, sCurrentMoveGrp); +} + +/** + * Unused (not called) - does nothing useful + */ +struct GdObj *func_8017E2F0(struct GdObj *obj, enum ObjTypeFlag type) { + UNUSED u32 sp2C; + enum ObjTypeFlag curObjType; + struct ListNode *node; + + curObjType = obj->type; + + switch (curObjType) { + case OBJ_TYPE_GROUPS: + node = ((struct ObjGroup *) obj)->firstMember; + while (node != NULL) { + func_8017E2F0(node->obj, type); + node = node->next; + } + break; + case OBJ_TYPE_BONES: + break; + default:; + } + + if (curObjType == type) { + return obj; + } + +//! @bug Nothing is returned if a GdObj of `type` is not found +#ifdef AVOID_UB + return NULL; +#endif +} + +/** + * Recursively calls `func` on all members of `group` whose type is in the + * `types` bitmask. + * Returns the number of objects this function was called on. + */ +s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup *group) { + struct ListNode *curLink; + struct ListNode *nextLink; + struct GdObj *linkedObj; + enum ObjTypeFlag linkedObjType; + applyproc_t objFn; + UNUSED u8 pad2C[0x20]; + s32 fnAppliedCount; + + fnAppliedCount = 0; + + //! @bug When `group` pointer is NULL, garbage is returned, not the + //! count of `fn` calls + if (group == NULL) { +#ifdef AVOID_UB + return fnAppliedCount; +#else + return; +#endif + } + + if (group->linkType & 1) { // compressed data, not an Obj + return fnAppliedCount; + } + + if (!((group->memberTypes & OBJ_TYPE_GROUPS) | (group->memberTypes & types))) { + return fnAppliedCount; + } + + objFn = func; + curLink = group->firstMember; + + while (curLink != NULL) { + linkedObj = curLink->obj; + linkedObjType = linkedObj->type; + nextLink = curLink->next; + + if (linkedObjType == OBJ_TYPE_GROUPS) { + fnAppliedCount += apply_to_obj_types_in_group(types, func, (struct ObjGroup *) linkedObj); + } + + if (linkedObjType & types) { + (*objFn)(linkedObj); + fnAppliedCount++; + } + + curLink = nextLink; + } + return fnAppliedCount; +} + +/* @ 22CD54 for 0x2B4 */ +void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { + struct GdVec3f sp94; + struct GdVec3f sp88; + struct GdVec3f sp7C; + struct GdVec3f sp70; + UNUSED u8 pad30[0x40]; // unused MyMatrix4x4? f32[4][4] + f32 sp2C; + UNUSED u32 sp28; + struct GdVec3f sp1C; + + sp70.x = a2->x; + sp70.y = a2->y; + sp70.z = a2->z; + + gd_normalize_vec3f(&sp70); + + sp7C.x = a1->x; + sp7C.y = a1->y; + sp7C.z = a1->z; + + sp1C.x = a0->centerOfGravity.x; + sp1C.y = a0->centerOfGravity.y; + sp1C.z = a0->centerOfGravity.z; + + gd_rotate_and_translate_vec3f(&sp1C, &a0->mat128); + + sp7C.x -= sp1C.x; + sp7C.y -= sp1C.y; + sp7C.z -= sp1C.z; + + if (gd_normalize_vec3f(&sp7C) == FALSE) { + sp7C.x = -sp70.x; + sp7C.y = -sp70.y; + sp7C.z = -sp70.z; + } + + gd_cross_vec3f(&sp70, a1, &sp94); + sp2C = (f32) gd_sqrt_d((sp94.x * sp94.x) + (sp94.z * sp94.z)); + + if (sp2C > 1000.0) { //? 1000.0f + sp2C = 1000.0f; + } + + sp2C /= 1000.0; //? 1000.0f + sp2C = 1.0 - sp2C; //? 1.0f - sp2C + + sp88.x = a2->x * sp2C; + sp88.y = a2->y * sp2C; + sp88.z = a2->z * sp2C; + + a0->collDisp.x += sp88.x; + a0->collDisp.y += sp88.y; + a0->collDisp.z += sp88.z; +} + +/* @ 22D008 for 0x1B4 */ +void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { + UNUSED u32 sp84; + UNUSED u32 sp80; + UNUSED u32 sp7C; + struct GdVec3f sp70; + struct GdVec3f sp64; + UNUSED u8 pad24[0x40]; + struct GdVec3f sp18; + + sp64.x = a1->x; + sp64.y = a1->y; + sp64.z = a1->z; + + sp18.x = a0->centerOfGravity.x; + sp18.y = a0->centerOfGravity.y; + sp18.z = a0->centerOfGravity.z; + + gd_rotate_and_translate_vec3f(&sp18, &a0->mat128); + + sp64.x -= sp18.x; + sp64.y -= sp18.y; + sp64.z -= sp18.z; + + sp64.x *= 0.01; //? 0.01f; + sp64.y *= 0.01; //? 0.01f; + sp64.z *= 0.01; //? 0.01f; + + gd_cross_vec3f(a2, &sp64, &sp70); + gd_clamp_vec3f(&sp70, 5.0f); + + a0->collTorque.x += sp70.x; + a0->collTorque.y += sp70.y; + a0->collTorque.z += sp70.z; +} + +/* @ 22D1BC for 0xA8 */ +void func_8017E9EC(struct ObjNet *net) { + struct GdVec3f sp5C; + Mat4f sp1C; + f32 sp18; + + sp5C.x = net->torque.x; + sp5C.y = net->torque.y; + sp5C.z = net->torque.z; + + gd_normalize_vec3f(&sp5C); + sp18 = gd_vec3f_magnitude(&net->torque); + gd_create_rot_mat_angular(&sp1C, &sp5C, -sp18); + gd_mult_mat4f(&D_801B9DC8, &sp1C, &D_801B9DC8); +} + +/** + * Unused (not called) + */ +s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix) { + if (vec->x >= matrix[2][2] && vec->x <= matrix[3][1] && vec->z >= matrix[3][0] + && vec->z <= matrix[3][3]) { + return 1; + } + + return 0; +} + +/** + * Unused (not called) + */ +s32 func_8017EB24(struct GdObj *obj1, struct GdObj *obj2) { + struct GdVec3f pos1; + struct GdVec3f pos2; + struct GdBoundingBox *bbox1; + struct GdBoundingBox *bbox2; + struct GdBoundingBox sp18; + + set_cur_dynobj(obj1); + d_get_world_pos(&pos1); + bbox1 = d_get_bounding_box(); + + set_cur_dynobj(obj2); + d_get_world_pos(&pos2); + bbox2 = d_get_bounding_box(); + + // bbox2 is an offset for bbox1? + sp18.minX = bbox1->minX + bbox2->minX; + sp18.minY = bbox1->minY + bbox2->minY; + sp18.minZ = bbox1->minZ + bbox2->minZ; + sp18.maxX = bbox1->maxX + bbox2->maxX; + sp18.maxY = bbox1->maxY + bbox2->maxY; + sp18.maxZ = bbox1->maxZ + bbox2->maxZ; + + D_801B9E08.x = pos2.x - pos1.x; + D_801B9E08.y = pos2.y - pos1.y; + D_801B9E08.z = pos2.z - pos1.z; + + if (D_801B9E08.x >= sp18.minX) { + if (D_801B9E08.x <= sp18.maxX) { + if (D_801B9E08.z >= sp18.minZ) { + if (D_801B9E08.z <= sp18.maxZ) { + return TRUE; + } + } + } + } + + return FALSE; +} + +/** + * Unused (not called) + */ +s32 is_obj_xz_in_bounding_box(struct GdObj *obj, struct GdBoundingBox *bbox) { + struct GdVec3f pos; + + set_cur_dynobj(obj); + d_get_world_pos(&pos); + + if (pos.x >= bbox->minX) { + if (pos.x <= bbox->maxX) { + if (pos.z >= bbox->minZ) { + if (pos.z <= bbox->maxZ) { + return TRUE; + } + } + } + } + + return FALSE; +} + +/** + * Unused (not called) + */ +s32 is_point_xz_in_bounding_box(struct GdVec3f *point, struct GdBoundingBox *bbox) { + if (point->x >= bbox->minX) { + if (point->x <= bbox->maxX) { + if (point->z >= bbox->minZ) { + if (point->z <= bbox->maxZ) { + return TRUE; + } + } + } + } + + return FALSE; +} + +/** + * Unused (called by func_801A71CC) - returns TRUE if any of the four corners of + * box1's X-Z plane lie within box2's X-Z plane + */ +s32 gd_plane_point_within(struct GdBoundingBox *box1, struct GdBoundingBox *box2) { + // test if min x and min z of box1 are within box2 + if (box1->minX >= box2->minX) { + if (box1->minX <= box2->maxX) { + if (box1->minZ >= box2->minZ) { + if (box1->minZ <= box2->maxZ) { + return TRUE; + } + } + } + } + + // test if max x and min z of box1 are within box2 + if (box1->maxX >= box2->minX) { + if (box1->maxX <= box2->maxX) { + if (box1->minZ >= box2->minZ) { + if (box1->minZ <= box2->maxZ) { + return TRUE; + } + } + } + } + + // test if max x and max z of box1 are within box2 + if (box1->maxX >= box2->minX) { + if (box1->maxX <= box2->maxX) { + if (box1->maxZ >= box2->minZ) { + if (box1->maxZ <= box2->maxZ) { + return TRUE; + } + } + } + } + + // test if min x and max z of box1 are within box2 + if (box1->minX >= box2->minX) { + if (box1->minX <= box2->maxX) { + if (box1->maxZ >= box2->minZ) { + if (box1->maxZ <= box2->maxZ) { + return TRUE; + } + } + } + } + + return FALSE; +} + +/* @ 22D824 for 0x1BC */ +s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj) { + struct ListNode *curLink; + struct ObjGroup *curGroup; + UNUSED u32 sp54; + Mat4f *parentUnkMtx; + Mat4f *iMtx; + Mat4f *unkMtx; + Mat4f *rotMtx; + Mat4f *rotMtx2; + UNUSED u8 pad20[0x18]; + struct GdVec3f scale; + + if (parentObj != NULL) { + set_cur_dynobj(parentObj); + parentUnkMtx = d_get_matrix_ptr(); + rotMtx = (Mat4f *) d_get_rot_mtx_ptr(); + + set_cur_dynobj(obj); + iMtx = d_get_i_mtx_ptr(); + rotMtx2 = (Mat4f *) d_get_rot_mtx_ptr(); + + d_get_scale(&scale); + + unkMtx = d_get_matrix_ptr(); + gd_mult_mat4f(iMtx, parentUnkMtx, unkMtx); + + gd_mult_mat4f(iMtx, rotMtx, rotMtx2); + gd_scale_mat4f_by_vec3f(rotMtx2, &scale); + } else { + set_cur_dynobj(obj); + unkMtx = d_get_matrix_ptr(); + iMtx = d_get_i_mtx_ptr(); + rotMtx = (Mat4f *) d_get_rot_mtx_ptr(); + + d_get_scale(&scale); + gd_set_identity_mat4(unkMtx); + gd_copy_mat4f(iMtx, rotMtx); + gd_scale_mat4f_by_vec3f(rotMtx, &scale); + } + + // Recursively call this function on attached children + set_cur_dynobj(obj); + curGroup = d_get_att_objgroup(); + if (curGroup != NULL) { + curLink = curGroup->firstMember; + while (curLink != NULL) { + transform_child_objects_recursive(curLink->obj, obj); + curLink = curLink->next; + } + } + return 0; +} + +/* @ 22D9E0 for 0x1BC */ +s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { + struct ListNode *sp6C; + struct ObjGroup *sp68; + UNUSED u32 sp64; + UNUSED Mat4f *sp60; + Mat4f *sp5C; + UNUSED Mat4f *sp58; + Mat4f *sp54; + Mat4f *sp50; + UNUSED u8 pad38[0x18]; + struct GdVec3f sp2C; + s32 count = 0; + + count++; + + if (a1 != NULL) { + set_cur_dynobj(a1); + sp60 = d_get_matrix_ptr(); + sp54 = (Mat4f *) d_get_rot_mtx_ptr(); + + set_cur_dynobj(a0); + sp5C = d_get_i_mtx_ptr(); + sp50 = (Mat4f *) d_get_rot_mtx_ptr(); + + d_get_scale(&sp2C); + gd_mult_mat4f(sp5C, sp54, sp50); + gd_scale_mat4f_by_vec3f(sp50, &sp2C); + } else { + set_cur_dynobj(a0); + sp58 = d_get_matrix_ptr(); + sp5C = d_get_i_mtx_ptr(); + sp54 = (Mat4f *) d_get_rot_mtx_ptr(); + + d_get_scale(&sp2C); + gd_copy_mat4f(sp5C, sp54); + gd_scale_mat4f_by_vec3f(sp54, &sp2C); + } + + set_cur_dynobj(a0); + sp68 = d_get_att_objgroup(); + + if (sp68 != NULL) { + sp6C = sp68->firstMember; + while (sp6C != NULL) { + count += func_8017F210(sp6C->obj, a0); + sp6C = sp6C->next; + } + } + return count; +} + +/* @ 22DB9C for 0x38; a0 might be ObjUnk200000* */ +void func_8017F3CC(struct Unk8017F3CC *a0) { + gd_rotate_and_translate_vec3f(&a0->unk20, D_801B9E48); +} + +/* @ 22DBD4 for 0x20 */ +void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2) { + UNUSED u8 pad[0x30]; +} + +/** + * Interpolates between animation transformations `t1` and `t2`, with `dt` as + * the interpolation factor (between 0 and 1). Sets the current dynobj's matrix + * as the result of the transformation. + */ +void interpolate_animation_transform(struct GdAnimTransform *t1, struct GdAnimTransform *t2, f32 dt) { + Mat4f mtx; + + gd_set_identity_mat4(&mtx); + + if (dt != 0.0f) { + struct GdAnimTransform transform; + + // interpolate rotation between t1 and t2 + transform.rotate.x = t1->rotate.x + (t2->rotate.x - t1->rotate.x) * dt; + transform.rotate.y = t1->rotate.y + (t2->rotate.y - t1->rotate.y) * dt; + transform.rotate.z = t1->rotate.z + (t2->rotate.z - t1->rotate.z) * dt; + + // interpolate position between t1 and t2 + transform.pos.x = t1->pos.x + (t2->pos.x - t1->pos.x) * dt; + transform.pos.y = t1->pos.y + (t2->pos.y - t1->pos.y) * dt; + transform.pos.z = t1->pos.z + (t2->pos.z - t1->pos.z) * dt; + + // not going to interpolate scale? + + gd_scale_mat4f_by_vec3f(&mtx, &t1->scale); + gd_rot_mat_about_vec(&mtx, &transform.rotate); + gd_add_vec3f_to_mat4f_offset(&mtx, &transform.pos); + } else { + d_set_scale(t1->scale.x, t1->scale.y, t1->scale.z); + gd_rot_mat_about_vec(&mtx, &t1->rotate); + gd_add_vec3f_to_mat4f_offset(&mtx, &t1->pos); + } + d_set_i_matrix(&mtx); +} + +/* @ 22DD94 for 0x1060; orig name: func_8017F5C4 */ +void move_animator(struct ObjAnimator *animObj) { + struct AnimDataInfo *animData; // array? + Mat4f *mtxArr; + Mat4f localMtx; + struct GdAnimTransform *triPtr; + struct GdAnimTransform currTransform; // transformation for the current keyframe + struct GdAnimTransform nextTransform; // transformation for the next keyframe + s16(*animData9s16)[9]; // GdTriangleH[]? + s16(*animData3s16)[3]; // MyVec3h[]? + s16(*animData6s16)[6]; // GdPlaneH[]? + s16(*animDataCam)[6]; // camera GdPlaneH[]? + struct GdObj *stubObj1 = NULL; // used only for call to stubbed function + struct GdObj *stubObj2 = NULL; // used only for call to stubbed function + UNUSED s32 sp50; + UNUSED s32 sp4C; + UNUSED s32 sp48; + UNUSED struct GdVec3f unusedVec; + s32 currKeyFrame; + s32 nextKeyFrame; + f32 dt; + f32 scale = 0.1f; + struct AnimMtxVec *sp28; + register struct ListNode *link; + struct GdObj *linkedObj; + + if (animObj->controlFunc != NULL) { + animObj->controlFunc(animObj); + } + + if (animObj->animatedPartsGrp == NULL) { + return; // nothing to animate + } + + animData = (struct AnimDataInfo *) animObj->animdataGrp->firstMember->obj; + + if (animObj->attachedToObj != NULL) { + animObj->frame = ((struct ObjAnimator *) animObj->attachedToObj)->frame + / ((struct ObjAnimator *) animObj->attachedToObj)->unk24; + animData += ((struct ObjAnimator *) animObj->attachedToObj)->animSeqNum; + } + + if (animData->type == 0) { + return; + } + + unusedVec.x = 4.0f; + unusedVec.y = 1.0f; + unusedVec.z = 1.0f; + + if (animObj->frame > (f32) animData->count) { + animObj->frame = 1.0f; + } else if (animObj->frame < 0.0f) { + animObj->frame = (f32) animData->count; + } + + currKeyFrame = (s32) animObj->frame; + dt = animObj->frame - (f32) currKeyFrame; + nextKeyFrame = currKeyFrame + 1; + + if (nextKeyFrame > animData->count) { + nextKeyFrame = 1; + } + + // convert frame numbers to zero-indexed + currKeyFrame--; + nextKeyFrame--; + + link = animObj->animatedPartsGrp->firstMember; + while (link != NULL) { + linkedObj = link->obj; + set_cur_dynobj(linkedObj); + switch (animData->type) { + case GD_ANIM_MTX4x4: // data = Mat4f* (f32[4][4]) + mtxArr = (Mat4f *) animData->data; + /* This needs be be un-dereferenced pointer addition to make the registers match */ + d_set_i_matrix(mtxArr + (s32) animObj->frame); + break; + case GD_ANIM_ROT3S: // data = s16(*)[3] - rotation only + animData3s16 = (s16(*)[3]) animData->data; + + // keep current object scale + d_get_scale(&currTransform.scale); + nextTransform.scale.x = currTransform.scale.x; + nextTransform.scale.y = currTransform.scale.y; + nextTransform.scale.z = currTransform.scale.z; + + // keep current object position + d_get_init_pos(&currTransform.pos); + nextTransform.pos.x = currTransform.pos.x; + nextTransform.pos.y = currTransform.pos.y; + nextTransform.pos.z = currTransform.pos.z; + + // use animation rotation + currTransform.rotate.x = (f32) animData3s16[currKeyFrame][0] * scale; + currTransform.rotate.y = (f32) animData3s16[currKeyFrame][1] * scale; + currTransform.rotate.z = (f32) animData3s16[currKeyFrame][2] * scale; + + nextTransform.rotate.x = (f32) animData3s16[nextKeyFrame][0] * scale; + nextTransform.rotate.y = (f32) animData3s16[nextKeyFrame][1] * scale; + nextTransform.rotate.z = (f32) animData3s16[nextKeyFrame][2] * scale; + + interpolate_animation_transform(&currTransform, &nextTransform, dt); + break; + case GD_ANIM_POS3S: // data = s16(*)[3] - position only + animData3s16 = (s16(*)[3]) animData->data; + + // keep current object scale + d_get_scale(&currTransform.scale); + nextTransform.scale.x = currTransform.scale.x; + nextTransform.scale.y = currTransform.scale.y; + nextTransform.scale.z = currTransform.scale.z; + + // keep current object rotation + d_get_init_rot(&currTransform.rotate); + nextTransform.rotate.x = currTransform.rotate.x; + nextTransform.rotate.y = currTransform.rotate.y; + nextTransform.rotate.z = currTransform.rotate.z; + + // use animation position + currTransform.pos.x = (f32) animData3s16[currKeyFrame][0]; + currTransform.pos.y = (f32) animData3s16[currKeyFrame][1]; + currTransform.pos.z = (f32) animData3s16[currKeyFrame][2]; + + nextTransform.pos.x = (f32) animData3s16[nextKeyFrame][0]; + nextTransform.pos.y = (f32) animData3s16[nextKeyFrame][1]; + nextTransform.pos.z = (f32) animData3s16[nextKeyFrame][2]; + + interpolate_animation_transform(&currTransform, &nextTransform, dt); + break; + case GD_ANIM_ROT3S_POS3S: // data = s16(*)[6] - rotation and position + animData6s16 = (s16(*)[6]) animData->data; + + // keep current object scale + d_get_scale(&currTransform.scale); + nextTransform.scale.x = currTransform.scale.x; + nextTransform.scale.y = currTransform.scale.y; + nextTransform.scale.z = currTransform.scale.z; + + // use animation rotation + currTransform.rotate.x = (f32) animData6s16[currKeyFrame][0] * scale; + currTransform.rotate.y = (f32) animData6s16[currKeyFrame][1] * scale; + currTransform.rotate.z = (f32) animData6s16[currKeyFrame][2] * scale; + + nextTransform.rotate.x = (f32) animData6s16[nextKeyFrame][0] * scale; + nextTransform.rotate.y = (f32) animData6s16[nextKeyFrame][1] * scale; + nextTransform.rotate.z = (f32) animData6s16[nextKeyFrame][2] * scale; + + // use animation position + currTransform.pos.x = (f32) animData6s16[currKeyFrame][3]; + currTransform.pos.y = (f32) animData6s16[currKeyFrame][4]; + currTransform.pos.z = (f32) animData6s16[currKeyFrame][5]; + + nextTransform.pos.x = (f32) animData6s16[nextKeyFrame][3]; + nextTransform.pos.y = (f32) animData6s16[nextKeyFrame][4]; + nextTransform.pos.z = (f32) animData6s16[nextKeyFrame][5]; + + interpolate_animation_transform(&currTransform, &nextTransform, dt); + break; + case GD_ANIM_SCALE3S_POS3S_ROT3S: // data = s16(*)[9] - scale, position, and rotation + animData9s16 = (s16(*)[9]) animData->data; + + currTransform.scale.x = (f32) animData9s16[currKeyFrame][0] * scale; + currTransform.scale.y = (f32) animData9s16[currKeyFrame][1] * scale; + currTransform.scale.z = (f32) animData9s16[currKeyFrame][2] * scale; + + currTransform.rotate.x = (f32) animData9s16[currKeyFrame][3] * scale; + currTransform.rotate.y = (f32) animData9s16[currKeyFrame][4] * scale; + currTransform.rotate.z = (f32) animData9s16[currKeyFrame][5] * scale; + + currTransform.pos.x = (f32) animData9s16[currKeyFrame][6]; + currTransform.pos.y = (f32) animData9s16[currKeyFrame][7]; + currTransform.pos.z = (f32) animData9s16[currKeyFrame][8]; + + nextTransform.scale.x = (f32) animData9s16[nextKeyFrame][0] * scale; + nextTransform.scale.y = (f32) animData9s16[nextKeyFrame][1] * scale; + nextTransform.scale.z = (f32) animData9s16[nextKeyFrame][2] * scale; + + nextTransform.rotate.x = (f32) animData9s16[nextKeyFrame][3] * scale; + nextTransform.rotate.y = (f32) animData9s16[nextKeyFrame][4] * scale; + nextTransform.rotate.z = (f32) animData9s16[nextKeyFrame][5] * scale; + + nextTransform.pos.x = (f32) animData9s16[nextKeyFrame][6]; + nextTransform.pos.y = (f32) animData9s16[nextKeyFrame][7]; + nextTransform.pos.z = (f32) animData9s16[nextKeyFrame][8]; + + interpolate_animation_transform(&currTransform, &nextTransform, dt); + break; + case GD_ANIM_CAMERA_EYE3S_LOOKAT3S: // s16(*)[6]? + if (linkedObj->type == OBJ_TYPE_CAMERAS) { + animDataCam = animData->data; + + // eye position + currTransform.pos.x = (f32) animDataCam[currKeyFrame][0]; + currTransform.pos.y = (f32) animDataCam[currKeyFrame][1]; + currTransform.pos.z = (f32) animDataCam[currKeyFrame][2]; + + // lookat position + nextTransform.pos.x = (f32) animDataCam[currKeyFrame][3]; + nextTransform.pos.y = (f32) animDataCam[currKeyFrame][4]; + nextTransform.pos.z = (f32) animDataCam[currKeyFrame][5]; + + ((struct ObjCamera *) linkedObj)->worldPos.x = currTransform.pos.x; + ((struct ObjCamera *) linkedObj)->worldPos.y = currTransform.pos.y; + ((struct ObjCamera *) linkedObj)->worldPos.z = currTransform.pos.z; + + ((struct ObjCamera *) linkedObj)->lookAt.x = nextTransform.pos.x; + ((struct ObjCamera *) linkedObj)->lookAt.y = nextTransform.pos.y; + ((struct ObjCamera *) linkedObj)->lookAt.z = nextTransform.pos.z; + } + break; + case GD_ANIM_SCALE3F_ROT3F_POS3F: // scale, rotation, and position (as floats) + triPtr = (struct GdAnimTransform *) animData->data; + interpolate_animation_transform(&triPtr[currKeyFrame], &triPtr[nextKeyFrame], dt); + break; + case GD_ANIM_MTX4x4F_SCALE3F: // AnimMtxVec[] + sp28 = &((struct AnimMtxVec *) animData->data)[currKeyFrame]; + d_set_i_matrix(&sp28->matrix); + d_set_scale(sp28->vec.x, sp28->vec.y, sp28->vec.z); + break; + case GD_ANIM_SCALE3F_ROT3F_POS3F_2: // similar to GD_ANIM_SCALE3F_ROT3F_POS3F, but no interpolation? what matrix does d_set_i_matrix set? + triPtr = (struct GdAnimTransform *) animData->data; + gd_set_identity_mat4(&localMtx); + gd_scale_mat4f_by_vec3f(&localMtx, &triPtr->scale); + gd_rot_mat_about_vec(&localMtx, &triPtr->rotate); + gd_add_vec3f_to_mat4f_offset(&localMtx, &triPtr->pos); + d_set_i_matrix(&localMtx); + break; + case GD_ANIM_STUB: + if (stubObj1 == NULL) { + stubObj1 = linkedObj; + } else { + if (stubObj2 == NULL) { + stubObj2 = linkedObj; + stub_objects_3(animObj->frame, stubObj1, stubObj2); + } else { + fatal_printf("Too many objects to morph"); + } + } + break; + default: + fatal_printf("move_animator(): Unkown animation data type"); + } + link = link->next; + } +} + +/* @ 22EDF4 for 0x300; orig name: func_80180624 */ +void drag_picked_object(struct GdObj *inputObj) { + UNUSED u32 spE4; + UNUSED u32 spE0; + UNUSED u32 spDC; + struct GdVec3f displacement; + struct GdVec3f spC4; + struct GdControl *ctrl; + Mat4f sp80; + Mat4f sp40; + UNUSED u32 pad34[3]; + struct GdObj *obj; + UNUSED u32 pad2C; + f32 dispMag; + + ctrl = &gGdCtrl; + + if (gViewUpdateCamera == NULL) { + return; + } + + dispMag = gd_vec3f_magnitude(&gViewUpdateCamera->unk40); + dispMag /= 1000.0f; + + displacement.x = ((f32)(ctrl->csrX - ctrl->dragStartX)) * dispMag; + displacement.y = ((f32) - (ctrl->csrY - ctrl->dragStartY)) * dispMag; + displacement.z = 0.0f; + + gd_inverse_mat4f(&gViewUpdateCamera->unkE8, &sp40); + gd_mat4f_mult_vec3f(&displacement, &sp40); + + obj = inputObj; + if ((inputObj->drawFlags & OBJ_PICKED) && gGdCtrl.dragging) { + gd_play_sfx(GD_SFX_PINCH_FACE); + // Note: this second sfx won't play, as it is "overwritten" by the first + if (ABS(ctrl->stickDeltaX) + ABS(ctrl->stickDeltaY) >= 11) { + gd_play_sfx(GD_SFX_PINCH_FACE_2); + } + + switch (inputObj->type) { + case OBJ_TYPE_JOINTS: + ((struct ObjJoint *) obj)->mat128[3][0] += displacement.x; + ((struct ObjJoint *) obj)->mat128[3][1] += displacement.y; + ((struct ObjJoint *) obj)->mat128[3][2] += displacement.z; + break; + case OBJ_TYPE_GADGETS: + break; + case OBJ_TYPE_NETS: + gd_inverse_mat4f(&((struct ObjNet *) obj)->mat128, &sp80); + spC4.x = displacement.x; + spC4.y = displacement.y; + spC4.z = displacement.z; + + gd_mat4f_mult_vec3f(&spC4, &sp80); + ((struct ObjNet *) obj)->matE8[3][0] += displacement.x; + ((struct ObjNet *) obj)->matE8[3][1] += displacement.y; + ((struct ObjNet *) obj)->matE8[3][2] += displacement.z; + break; + case OBJ_TYPE_PARTICLES: + break; + default:; + } + } +} + +/* @ 22F0F4 for 0x50; orig name: func_80180924*/ +void move_animators(struct ObjGroup *group) { + restart_timer("move_animators"); + apply_to_obj_types_in_group(OBJ_TYPE_ANIMATORS, (applyproc_t) move_animator, group); + split_timer("move_animators"); +} + +/* @ 22F144 for 0x3C; orig name: func_80180974 */ +void find_and_drag_picked_object(struct ObjGroup *group) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) drag_picked_object, group); +} + +/* @ 22F180 for 0x624; orig name: func_801809B0 */ +void move_camera(struct ObjCamera *cam) { + struct GdObj *spEC; + struct GdVec3f spE0; + struct GdVec3f spD4; + struct GdVec3f spC8; + UNUSED u8 padBC[0xC8 - 0xBC]; + struct GdVec3f spB0; + Mat4f sp70; + UNUSED u8 pad30[0x70 - 0x30]; + Mat4f *sp2C; + struct GdControl *ctrl; + + ctrl = &gGdCtrl; + if (!(cam->flags & 0x10)) { + return; + } + + spE0.x = spE0.y = spE0.z = 0.0f; + spB0.x = spB0.y = spB0.z = 0.0f; + + if ((spEC = cam->unk30) != NULL) { + set_cur_dynobj(spEC); + d_get_world_pos(&spE0); + d_get_matrix(&sp70); + + spC8.x = sp70[2][0] - cam->unk58; + spC8.z = sp70[2][2] - cam->unk60; + + cam->unk58 += spC8.x * cam->unk180.y; + cam->unk60 += spC8.z * cam->unk180.y; + + cam->unkA8[2][0] = cam->unk58; + cam->unkA8[2][1] = 0.0f; + cam->unkA8[2][2] = cam->unk60; + + cam->unkA8[0][0] = cam->unkA8[2][2]; + cam->unkA8[0][1] = 0.0f; + cam->unkA8[0][2] = -cam->unkA8[2][0]; + + cam->unkA8[1][0] = 0.0f; + cam->unkA8[1][1] = 1.0f; + cam->unkA8[1][2] = 0.0f; + + // setting the unkA8 matrix above is pointless, if we're just going to overwrite it with the identity matrix. + gd_set_identity_mat4(&cam->unkA8); + } else { + gd_set_identity_mat4(&cam->unkA8); + } + + sp2C = &cam->unk64; + if ((cam->flags & CAMERA_FLAG_CONTROLLABLE) != 0) { + if (ctrl->btnB != FALSE && ctrl->prevFrame->btnB == FALSE) { // new B press + cam->zoomLevel++; + if (cam->zoomLevel > cam->maxZoomLevel) { + cam->zoomLevel = 0; + } + + switch (cam->zoomLevel) { + case 0: + gd_play_sfx(GD_SFX_CAM_ZOOM_IN); + break; + case 1: + case 2: + gd_play_sfx(GD_SFX_CAM_ZOOM_OUT); + break; + } + } + + if (ctrl->cleft) { + cam->unk128.y += cam->unk134.y; + } + + if (ctrl->cright) { + cam->unk128.y -= cam->unk134.y; + } + + if (ctrl->cup) { + cam->unk128.x += cam->unk134.x; + } + + if (ctrl->cdown) { + cam->unk128.x -= cam->unk134.x; + } + + cam->unk128.x = gd_clamp_f32(cam->unk128.x, 80.0f); + + cam->unk4C.x = cam->zoomPositions[cam->zoomLevel].x; + cam->unk4C.y = cam->zoomPositions[cam->zoomLevel].y; + cam->unk4C.z = cam->zoomPositions[cam->zoomLevel].z; + + gd_rot_2d_vec(cam->unk128.x, &cam->unk4C.y, &cam->unk4C.z); + gd_rot_2d_vec(-cam->unk128.y, &cam->unk4C.x, &cam->unk4C.z); + + cam->unk40.x += (cam->unk4C.x - cam->unk40.x) * cam->unk17C; + cam->unk40.y += (cam->unk4C.y - cam->unk40.y) * cam->unk17C; + cam->unk40.z += (cam->unk4C.z - cam->unk40.z) * cam->unk17C; + } else { + gd_set_identity_mat4(sp2C); + } + + spD4.x = cam->unk40.x; + spD4.y = cam->unk40.y; + spD4.z = cam->unk40.z; + + spD4.x += spB0.x; + spD4.y += spB0.y; + spD4.z += spB0.z; + + gd_mult_mat4f(sp2C, &cam->unkA8, &cam->unkA8); + gd_mat4f_mult_vec3f(&spD4, &cam->unkA8); + + cam->worldPos.x = spD4.x; + cam->worldPos.y = spD4.y; + cam->worldPos.z = spD4.z; + + cam->worldPos.x += spE0.x; + cam->worldPos.y += spE0.y; + cam->worldPos.z += spE0.z; +} + +/* @ 22F7A4 for 0x38; orig name: func_80180FD4 */ +void move_cameras_in_grp(struct ObjGroup *group) { + apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t) move_camera, group); +} + +/* @ 22F7DC for 0x36C*/ +void func_8018100C(struct ObjLight *light) { + Mat4f mtx; + UNUSED u32 pad1C[3]; + + if (light->unk40 == 3) { + if (light->unk30 > 0.0) { //? 0.0f + light->unk30 -= 0.2; //? 0.2f + } + + if (light->unk30 < 0.0f) { + light->unk30 = 0.0f; + } + + if ((light->unk3C & 0x1) != 0) { + light->unk30 = 1.0f; + } + + light->unk3C &= ~1; + } + // if (1)? + return; + // unreachable + light->position.x += light->unk80.x; + light->position.y += light->unk80.y; + light->position.z += light->unk80.z; + + // should be position.x for second comparison? + if (light->position.x > 500.0f || light->position.y < -500.0f) { + light->unk80.x = -light->unk80.x; + } + + if (light->position.y > 500.0f || light->position.y < -500.0f) { + light->unk80.y = -light->unk80.y; + } + + if (light->position.z > 500.0f || light->position.z < -500.0f) { + light->unk80.z = -light->unk80.z; + } + + return; + // more unreachable + D_801A81C0 += 1.0; //? 1.0f + D_801A81C4 += 0.6; //? 0.6f + + gd_set_identity_mat4(&mtx); + gd_absrot_mat4(&mtx, GD_Y_AXIS, light->unk68.y); + gd_absrot_mat4(&mtx, GD_X_AXIS, light->unk68.x); + gd_absrot_mat4(&mtx, GD_Z_AXIS, light->unk68.z); + gd_mat4f_mult_vec3f(&light->unk8C, &mtx); + + light->position.x = light->unk8C.x; + light->position.y = light->unk8C.y; + light->position.z = light->unk8C.z; + return; + // even more unreachable + gd_mat4f_mult_vec3f(&light->unk80, &mtx); + imout(); // this call would cause an issue if it was reachable +} + +/* @ 22FB48 for 0x38; orig name: func_80181378 */ +void move_lights_in_grp(struct ObjGroup *group) { + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) func_8018100C, group); +} + +/* @ 22FB80 for 0xAC; orig name: func_801813B0 */ +void move_group_members(void) { + s32 i; + + if (gGdMoveScene != 0) { + reset_gadgets_in_grp(sCurrentMoveGrp); + move_lights_in_grp(sCurrentMoveGrp); + move_particles_in_grp(sCurrentMoveGrp); + move_animators(sCurrentMoveGrp); + + for (i = 0; i <= 0; i++) { + move_nets(sCurrentMoveGrp); + } + + move_cameras_in_grp(sCurrentMoveGrp); + } +} + +/* @ 22FC2C for 0x98; orig name: func_8018145C */ +void proc_view_movement(struct ObjView *view) { + imin("movement"); + sCurrentMoveCamera = view->activeCam; + sCurrentMoveView = view; + if ((sCurrentMoveGrp = view->components) != NULL) { + move_group_members(); + } + if ((sCurrentMoveGrp = view->lights) != NULL) { + move_group_members(); + } + imout(); +} + +/* @ 22FCC4 for 0x44; orig name: func_801814F4 */ +void reset_nets_and_gadgets(struct ObjGroup *group) { + func_80193848(group); + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget, group); +} + +/* @ 22FD08 for 0x9C; orig name: func_80181538*/ +void null_obj_lists(void) { + D_801B9E44 = 0; + gGdObjCount = 0; + gGdGroupCount = 0; + gGdPlaneCount = 0; + gGdCameraCount = 0; + sGdViewInfo.count = 0; + + gGdCameraList = NULL; + D_801B9E50 = NULL; + gGdBoneList = NULL; + gGdJointList = NULL; + gGdGroupList = NULL; + D_801B9E80 = NULL; + gGdObjectList = NULL; + gGdViewsGroup = NULL; + + reset_net_count(); + reset_joint_counts(); +} diff --git a/src/goddard/objects.h b/src/goddard/objects.h new file mode 100644 index 00000000..bdf14c18 --- /dev/null +++ b/src/goddard/objects.h @@ -0,0 +1,105 @@ +#ifndef GD_OBJECTS_H +#define GD_OBJECTS_H + +#include + +#include "gd_types.h" +#include "macros.h" + +// types +// Type to erase for func arg to `apply_to_obj_types_in_group`. Maybe one day this +// can be the proper type of 'void (*)(struct GdObj *)... +typedef void (*applyproc_t)(void *); + +// structs +struct DebugCounters { + u32 ctr0; + s32 ctr1; +}; + +// bss +extern struct GdBoundingBox gSomeBoundingBox; +extern struct ObjCamera *sCurrentMoveCamera; +extern struct ObjView *sCurrentMoveView; +extern struct DebugCounters gGdCounter; +extern Mat4f D_801B9DC8; +extern struct GdVec3f D_801B9E08; +extern struct ObjGroup* sCurrentMoveGrp; +extern struct GdVec3f D_801B9E18; +extern struct GdVec3f D_801B9E28; +extern f32 D_801B9E34; +extern Mat4f* D_801B9E38; /* never read from */ +extern struct ObjParticle *D_801B9E3C; /* never read from */ +extern s32 D_801B9E40; /* always 0 */ +extern s32 D_801B9E44; +extern Mat4f* D_801B9E48; +extern struct ObjCamera* gGdCameraList; +extern void* D_801B9E50; +extern struct ObjGroup* gGdGroupList; +extern s32 gGdObjCount; +extern s32 gGdGroupCount; +extern s32 gGdPlaneCount; +extern s32 gGdCameraCount; +extern struct Unk801B9E68 sGdViewInfo; /* count in first member? */ +extern void* D_801B9E80; +extern struct ObjJoint* gGdJointList; +extern struct ObjBone* gGdBoneList; +extern struct GdObj* gGdObjectList; +extern struct ObjGroup* gGdViewsGroup; + +// functions +void reset_bounding_box(void); +void add_obj_pos_to_bounding_box(struct GdObj *a0); +void get_some_bounding_box(struct GdBoundingBox *a0); +void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1); +struct GdObj *make_object(enum ObjTypeFlag objFlag); +struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *a1, struct ObjGroup *a2); +struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1); +struct ListNode *make_link_to_obj(struct ListNode *head, struct GdObj *a1); +struct VtxLink *make_vtx_link(struct VtxLink *prevLink, Vtx *data); +struct ObjValPtr *make_valptr(struct GdObj *obj, s32 flags, enum ValPtrType type, size_t offset); +void reset_plane(struct ObjPlane *plane); +struct ObjPlane *make_plane(s32 inZone, struct ObjFace *a1); +struct ObjCamera *make_camera(s32 a0, struct GdObj *a1); +struct ObjMaterial *make_material(UNUSED s32 a0, char *name, s32 id); +struct ObjLight *make_light(s32 flags, char *name, s32 id); +struct ObjView *make_view(const char *name, s32 flags, s32 a2, s32 ulx, s32 uly, s32 lrx, s32 lry, + struct ObjGroup *parts); +struct ObjAnimator *make_animator(void); +struct ObjWeight *make_weight(UNUSED s32 a0, s32 id, struct ObjVertex *vtx, f32 weight); +struct ObjGroup *make_group_of_type(enum ObjTypeFlag, struct GdObj*, struct GdObj*); +void format_object_id(char*, struct GdObj*); +struct ObjGroup* make_group(s32 count, ...); +void addto_group(struct ObjGroup *group, struct GdObj *obj); +void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj); +s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj); +void show_details(enum ObjTypeFlag type); +s32 stub_objects_2(void); +s32 make_scene(void); +void menu_cb_reset_positions(void); +s32 apply_to_obj_types_in_group(s32 types, applyproc_t fn, struct ObjGroup *group); +void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2); +void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2); +void func_8017E9EC(struct ObjNet *a0); +s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix); +s32 func_8017EB24(struct GdObj *a0, struct GdObj *a1); +s32 is_obj_xz_in_bounding_box(struct GdObj *a0, struct GdBoundingBox *a1); +s32 is_point_xz_in_bounding_box(struct GdVec3f *a0, struct GdBoundingBox *a1); +s32 gd_plane_point_within(struct GdBoundingBox *a0, struct GdBoundingBox *a1); +s32 transform_child_objects_recursive(struct GdObj *a0, struct GdObj *a1); +s32 func_8017F210(struct GdObj *a0, struct GdObj *a1); +void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2); +void interpolate_animation_transform(struct GdAnimTransform *a0, struct GdAnimTransform *a1, f32 a2); +void move_animator(struct ObjAnimator *animObj); +void drag_picked_object(struct GdObj *inputObj); +void move_animators(struct ObjGroup *group); +void find_and_drag_picked_object(struct ObjGroup *group); +void move_camera(struct ObjCamera *cam); +void move_cameras_in_grp(struct ObjGroup *group); +void func_8018100C(struct ObjLight *light); +void move_lights_in_grp(struct ObjGroup *group); +void proc_view_movement(struct ObjView *view); +void reset_nets_and_gadgets(struct ObjGroup *group); +void null_obj_lists(void); + +#endif // GD_OBJECTS_H diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c new file mode 100644 index 00000000..7d4751cb --- /dev/null +++ b/src/goddard/old_menu.c @@ -0,0 +1,254 @@ +#include +#include + +#include "debug_utils.h" +#include "dynlist_proc.h" +#include "gd_types.h" +#include "macros.h" +#include "objects.h" +#include "old_menu.h" +#include "renderer.h" + +/** + * @file old_menu.c + * + * This file contains remnants of code for rendering what appears to be a GUI + * that used the IRIX Graphics Library, from when this program was a standalone demo. + * It also contains code for creating labels and gadget, which are `GdObj`s that + * allow for displaying text and memory values on screen. Those `GdObj`s are not + * created in-game, but there are some functions in `renderer.c` that use + * them, and those functions may still work if called. + */ + +// bss +static char sDefSettingsMenuStr[0x100]; +static struct GdVec3f sStaticVec; +static struct GdVec3f unusedVec; +static struct ObjGadget *sCurGadgetPtr; + +// forward declarations +static void reset_gadget_default(struct ObjGadget *); + +/* 239EC0 -> 239F78 */ +void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t offset) { + union ObjVarVal *objAddr = (void *) ((u8 *) base + offset); + + switch (type) { + case OBJ_VALUE_INT: + dst->i = objAddr->i; + break; + case OBJ_VALUE_FLOAT: + dst->f = objAddr->f; + break; + default: + fatal_printf("%s: Undefined ValueType", "get_objvalue"); + } +} + +/* 239F78 -> 23A00C */ +void Unknown8018B7A8(void *a0) { + struct GdVec3f sp1C; + + set_cur_dynobj(a0); + d_get_init_pos(&sp1C); + + sp1C.x += sStaticVec.x; + sp1C.y += sStaticVec.y; + sp1C.z += sStaticVec.z; + d_set_world_pos(sp1C.x, sp1C.y, sp1C.z); +} + +/** + * Unused - called when an item is selected from the "Default Settings" menu. + * + * @param itemId ID of the menu item that was clicked + */ +static void menu_cb_default_settings(intptr_t itemId) { + struct ObjGroup *group = (struct ObjGroup *)itemId; // Unpack pointer from menu item ID + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget_default, group); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) stub_renderer_6, gGdViewsGroup); +} + +/** + * Unused - appends a menu item for the group to sDefSettingsMenuStr. + */ +static void add_item_to_default_settings_menu(struct ObjGroup *group) { + char buf[0x100]; + + if (group->debugPrint == 1) { + // Convert pointer to integer and store it as the menu item ID. + sprintf(buf, "| %s %%x%d", group->name, (u32) (intptr_t) group); + gd_strcat(sDefSettingsMenuStr, buf); + } +} + +/** + * Unused - creates a popup menu that allows the user to control some settings. + */ +long create_gui_menu(struct ObjGroup *grp) { + long dynamicsMenuId; + long defaultSettingMenuId; + long contTypeMenuId; + + gd_strcpy(sDefSettingsMenuStr, "Default Settings %t %F"); + apply_to_obj_types_in_group(OBJ_TYPE_GROUPS, (applyproc_t) add_item_to_default_settings_menu, grp); + defaultSettingMenuId = defpup(sDefSettingsMenuStr, &menu_cb_default_settings); + + contTypeMenuId = defpup( + "Control Type %t %F" + "| U-64 Analogue Joystick %x1 " + "| Keyboard %x2 " + "| Mouse %x3", + &menu_cb_control_type); + + dynamicsMenuId = defpup( + "Dynamics %t " + "|\t\t\tReset Positions %f " + "|\t\t\tSet Defaults %m " + "|\t\t\tSet Controller %m " + "|\t\t\tRe-Calibrate Controller %f " + "|\t\t\tQuit %f", + &menu_cb_reset_positions, defaultSettingMenuId, contTypeMenuId, &menu_cb_recalibrate_controller, &gd_exit); + + return dynamicsMenuId; +} + +/* 23A190 -> 23A250 */ +struct ObjLabel *make_label(struct ObjValPtr *ptr, char *str, s32 a2, f32 x, f32 y, f32 z) { + struct ObjLabel *label = (struct ObjLabel *) make_object(OBJ_TYPE_LABELS); + label->valfn = NULL; + label->valptr = ptr; + label->fmtstr = str; + label->unk24 = a2; + label->unk30 = 4; + label->position.x = x; + label->position.y = y; + label->position.z = z; + + return label; +} + +/* 23A250 -> 23A32C */ +struct ObjGadget *make_gadget(UNUSED s32 a0, s32 a1) { + struct ObjGadget *gdgt = (struct ObjGadget *) make_object(OBJ_TYPE_GADGETS); + gdgt->valueGrp = NULL; + gdgt->rangeMax = 1.0f; + gdgt->rangeMin = 0.0f; + gdgt->unk20 = a1; + gdgt->colourNum = 0; + gdgt->sliderPos = 1.0f; + gdgt->size.x = 100.0f; + gdgt->size.y = 10.0f; + gdgt->size.z = 10.0f; // how is this useful? + + return gdgt; +} + +/* 23A32C -> 23A3E4 */ +void set_objvalue(union ObjVarVal *src, enum ValPtrType type, void *base, size_t offset) { + union ObjVarVal *dst = (void *) ((u8 *) base + offset); + switch (type) { + case OBJ_VALUE_INT: + dst->i = src->i; + break; + case OBJ_VALUE_FLOAT: + dst->f = src->f; + break; + default: + fatal_printf("%s: Undefined ValueType", "set_objvalue"); + } +} + +/* 23A3E4 -> 23A488; orig name: Unknown8018BD54 */ +void set_static_gdgt_value(struct ObjValPtr *vp) { + switch (vp->datatype) { + case OBJ_VALUE_FLOAT: + set_objvalue(&sCurGadgetPtr->varval, OBJ_VALUE_FLOAT, vp->obj, vp->offset); + break; + case OBJ_VALUE_INT: + set_objvalue(&sCurGadgetPtr->varval, OBJ_VALUE_INT, vp->obj, vp->offset); + break; + } +} + +/* 23A488 -> 23A4D0 */ +static void reset_gadget_default(struct ObjGadget *gdgt) { + UNUSED u8 pad[4]; + + sCurGadgetPtr = gdgt; + apply_to_obj_types_in_group(OBJ_TYPE_VALPTRS, (applyproc_t) set_static_gdgt_value, gdgt->valueGrp); +} + +/* 23A4D0 -> 23A784 */ +void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { + UNUSED u8 pad[8]; + f32 range; + struct ObjValPtr *vp; + + if (gdgt->type == 1) { + gdgt->sliderPos += a2 * (-sCurrentMoveCamera->unk40.z * 1.0E-5); + } else if (gdgt->type == 2) { + gdgt->sliderPos += a1 * (-sCurrentMoveCamera->unk40.z * 1.0E-5); + } + + // slider position must be between 0 and 1 (inclusive) + if (gdgt->sliderPos < 0.0f) { + gdgt->sliderPos = 0.0f; + } else if (gdgt->sliderPos > 1.0f) { + gdgt->sliderPos = 1.0f; + } + + range = gdgt->rangeMax - gdgt->rangeMin; + + if (gdgt->valueGrp != NULL) { + vp = (struct ObjValPtr *) gdgt->valueGrp->firstMember->obj; + + switch (vp->datatype) { + case OBJ_VALUE_FLOAT: + gdgt->varval.f = gdgt->sliderPos * range + gdgt->rangeMin; + break; + case OBJ_VALUE_INT: + gdgt->varval.i = ((s32)(gdgt->sliderPos * range)) + gdgt->rangeMin; + break; + default: + fatal_printf("%s: Undefined ValueType", "adjust_gadget"); + } + } + + reset_gadget_default(gdgt); +} + +/* 23A784 -> 23A940; orig name: Unknown8018BFB4 */ +void reset_gadget(struct ObjGadget *gdgt) { + UNUSED u8 pad[8]; + f32 range; + struct ObjValPtr *vp; + + if (gdgt->rangeMax - gdgt->rangeMin == 0.0f) { + fatal_printf("gadget has zero range (%f -> %f)\n", gdgt->rangeMin, gdgt->rangeMax); + } + + range = (f32)(1.0 / (gdgt->rangeMax - gdgt->rangeMin)); + + if (gdgt->valueGrp != NULL) { + vp = (struct ObjValPtr *) gdgt->valueGrp->firstMember->obj; + + switch (vp->datatype) { + case OBJ_VALUE_FLOAT: + get_objvalue(&gdgt->varval, OBJ_VALUE_FLOAT, vp->obj, vp->offset); + gdgt->sliderPos = (gdgt->varval.f - gdgt->rangeMin) * range; + break; + case OBJ_VALUE_INT: + get_objvalue(&gdgt->varval, OBJ_VALUE_INT, vp->obj, vp->offset); + gdgt->sliderPos = (gdgt->varval.i - gdgt->rangeMin) * range; + break; + default: + fatal_printf("%s: Undefined ValueType", "reset_gadget"); + } + } +} + +/* 23A940 -> 23A980 */ +void reset_gadgets_in_grp(struct ObjGroup *grp) { + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget, grp); +} diff --git a/src/goddard/old_menu.h b/src/goddard/old_menu.h new file mode 100644 index 00000000..5d71b342 --- /dev/null +++ b/src/goddard/old_menu.h @@ -0,0 +1,19 @@ +#ifndef GD_OLD_MENU_H +#define GD_OLD_MENU_H + +#include + +#include "gd_types.h" +#include "macros.h" + +void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t offset); +struct ObjGadget *make_gadget(UNUSED s32 a0, s32 a1); +void reset_gadget(struct ObjGadget *gdgt); +void reset_gadgets_in_grp(struct ObjGroup *grp); + +// see bad_declarations.h +#ifndef GD_USE_BAD_DECLARATIONS +struct ObjLabel *make_label(struct ObjValPtr *ptr, char *str, s32 a2, f32 x, f32 y, f32 z); +#endif + +#endif // GD_OLD_MENU_H diff --git a/src/goddard/particles.c b/src/goddard/particles.c new file mode 100644 index 00000000..26b3cb86 --- /dev/null +++ b/src/goddard/particles.c @@ -0,0 +1,526 @@ +#include + +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "gd_math.h" +#include "gd_types.h" +#include "macros.h" +#include "objects.h" +#include "particles.h" +#include "renderer.h" +#include "skin.h" + +// static types +typedef union { + struct ObjVertex *vtx; + struct ObjParticle *ptc; +} VtxPtc; + +struct Connection { + struct GdObj header; // this header is never used + u8 filler14[8]; + VtxPtc node1; // first connected vertex or particle + VtxPtc node2; // second connected vertex or particle + f32 unk24; + u32 unk28; // union tag? 0 = vertex; 1 = particle? +}; + +// data +static void *sUnused801A81D0 = NULL; +static s32 D_801A81D4[25] = { + /* ID? X Y Z */ + 9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55, + -6, 20, -23, 70, -2, 20, -23, 135, 0, 16, 0, 0 /* Terminator */ +}; +static s32 D_801A8238[5] = { + /* ID? X Y Z */ + 15, 0, 22, 0, 0 /* Terminator */ +}; + +// static bss +static struct ObjFace *D_801B9EF0; + +// fn declarations +struct Connection *make_connection(struct ObjVertex *, struct ObjVertex *); +void Unknown80181D14(struct ObjFace *); +void func_80181EB0(struct Connection *); +void func_80182088(struct Connection *); +void move_particle(struct ObjParticle *); +struct Connection *make_connection(struct ObjVertex *, struct ObjVertex *); +int func_80182778(struct ObjParticle *); +void func_80182A08(struct ObjParticle *, struct GdVec3f *b); +void func_801838D0(struct ObjParticle *); +void Unknown801835C8(struct ObjParticle *ptc); + +static void connect_vertices(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { + struct Connection *newConn; + register struct ListNode *link; + + if (vtx1 == vtx2) { + return; + } + link = gGdSkinNet->unk1C0->firstMember; + while (link != NULL) { + // FIXME: types + struct Connection *conn = (struct Connection *) link->obj; + + if ((conn->node1.vtx == vtx1 || conn->node1.vtx == vtx2) + && (conn->node2.vtx == vtx1 || conn->node2.vtx == vtx2)) { + break; + } + link = link->next; + } + if (link == NULL) { + newConn = make_connection(vtx1, vtx2); + //! make_connection never sets the header, so not sure what happens here + addto_group(gGdSkinNet->unk1C0, &newConn->header); + } +} + +/* 2304E4 -> 230680 */ +void Unknown80181D14(struct ObjFace *face) { + s32 i; + s32 j; + struct ObjVertex *vtx1; + struct ObjVertex *vtx2; + + for (i = 0; i < face->vtxCount - 1; i++) { + vtx1 = face->vertices[i]; + vtx2 = face->vertices[i + 1]; + connect_vertices(vtx1, vtx2); + } + if (D_801B9EF0 != NULL) { + for (i = 0; i < face->vtxCount; i++) { + vtx1 = face->vertices[i]; + for (j = 0; j < D_801B9EF0->vtxCount; j++) { + vtx2 = D_801B9EF0->vertices[j]; + connect_vertices(vtx1, vtx2); + } + } + } + D_801B9EF0 = face; +} + +/* 230680 -> 230858 */ +void func_80181EB0(struct Connection *cxn) { + struct GdVec3f sp34; + UNUSED u8 unused[0x2C]; + struct ObjParticle *sp4 = cxn->node1.ptc; + struct ObjParticle *sp0 = cxn->node2.ptc; + + sp34.x = 0.0f; + sp34.y = sp4->pos.y - sp0->pos.y; + sp34.z = 0.0f; + sp34.y *= 0.01; + sp4->unk38.x -= sp34.x; + sp4->unk38.y -= sp34.y; + sp4->unk38.z -= sp34.z; + sp0->unk38.x += sp34.x; + sp0->unk38.y += sp34.y; + sp0->unk38.z += sp34.z; + if (!(sp4->flags & 2)) { + sp4->pos.x -= sp34.x; + sp4->pos.y -= sp34.y; + sp4->pos.z -= sp34.z; + } + if (!(sp0->flags & 2)) { + sp0->pos.x += sp34.x; + sp0->pos.y += sp34.y; + sp0->pos.z += sp34.z; + } +} + +/* @ 230858 -> 230B70 */ +void func_80182088(struct Connection *cxn) { + struct GdVec3f sp4C; + UNUSED u8 unused[0x24]; + f32 sp24; + f32 sp20; + struct ObjParticle *sp1C; + struct ObjParticle *sp18; + + if (cxn->unk28 & 1) { + func_80181EB0(cxn); + return; + } + sp1C = cxn->node1.ptc; + sp18 = cxn->node2.ptc; + sp4C.x = sp1C->pos.x - sp18->pos.x; + sp4C.y = sp1C->pos.y - sp18->pos.y; + sp4C.z = sp1C->pos.z - sp18->pos.z; + sp20 = gd_vec3f_magnitude(&sp4C); + sp24 = sp20 - cxn->unk24; + sp4C.x /= sp20; + sp4C.y /= sp20; + sp4C.z /= sp20; + sp4C.x *= sp24 * 0.1; + sp4C.y *= sp24 * 0.1; + sp4C.z *= sp24 * 0.1; + sp1C->unk38.x -= sp4C.x; + sp1C->unk38.y -= sp4C.y; + sp1C->unk38.z -= sp4C.z; + sp18->unk38.x += sp4C.x; + sp18->unk38.y += sp4C.y; + sp18->unk38.z += sp4C.z; + if (!(sp1C->flags & 2)) { + sp1C->pos.x -= sp4C.x; + sp1C->pos.y -= sp4C.y; + sp1C->pos.z -= sp4C.z; + } + if (!(sp18->flags & 2)) { + sp18->pos.x += sp4C.x; + sp18->pos.y += sp4C.y; + sp18->pos.z += sp4C.z; + } +} + +/* 230B70 -> 230CC0 */ +void func_801823A0(struct ObjNet *net) { + register struct ListNode *link; + struct Connection *cxn; + + gGdSkinNet = net; + switch (net->unk3C) { + case 1: // Shape; Are these flags the same as net->netType (+0x1EC)? + net->unk1C8 = net->shapePtr->vtxGroup; + net->unk1C0 = make_group(0); + D_801B9EF0 = NULL; + + apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t) Unknown80181D14, + net->shapePtr->faceGroup); + net->unk3C = 2; + break; + case 2: + link = net->unk1C0->firstMember; + while (link != NULL) { + // FIXME: types + cxn = (struct Connection *) link->obj; + func_80182088(cxn); + link = link->next; + } + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, net->unk1C8); + apply_to_obj_types_in_group(OBJ_TYPE_PLANES, (applyproc_t) reset_plane, net->unk1CC); + break; + } +} + +/* 230CC0 -> 230DCC */ +struct ObjParticle *make_particle(u32 flags, s32 colourNum, f32 x, f32 y, f32 z) { + struct ObjParticle *particle = (struct ObjParticle *) make_object(OBJ_TYPE_PARTICLES); + UNUSED u8 unused[8]; + + particle->pos.x = x; + particle->pos.y = y; + particle->pos.z = z; + particle->unk38.x = particle->unk38.y = particle->unk38.z = 0.0f; + particle->colourNum = colourNum; + particle->flags = flags | 8; + particle->timeout = -1; + particle->id = D_801B9E40; /* should this be D_801B9E40++? */ + particle->shapePtr = NULL; + particle->unkB0 = 1; + return particle; +} + +/* 230DCC -> 230F48 */ +struct Connection *make_connection(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { + struct Connection *conn = gd_malloc_perm(sizeof(struct Connection)); + struct GdVec3f sp28; + struct GdVec3f sp1C; + + if (conn == NULL) { + fatal_print("Cant allocate connection memory!"); + } + conn->node1.vtx = vtx1; + conn->node2.vtx = vtx2; + d_stash_dynobj(); + set_cur_dynobj((struct GdObj *)vtx1); + d_get_world_pos(&sp28); + set_cur_dynobj((struct GdObj *)vtx2); + d_get_world_pos(&sp1C); + sp28.x -= sp1C.x; + sp28.y -= sp1C.y; + sp28.z -= sp1C.z; + conn->unk24 = gd_vec3f_magnitude(&sp28); + // Duplicate conditional. Possibly should've checked `vtx2`; + // Also, this shouldn't be called with particle types... + if (vtx1->header.type == OBJ_TYPE_PARTICLES && vtx1->header.type == OBJ_TYPE_PARTICLES) { + if ((((struct ObjParticle *) vtx1)->flags & 4) && (((struct ObjParticle *) vtx2)->flags & 4)) { + conn->unk28 |= 1; + } + } + d_unstash_dynobj(); + return conn; +} + +/* 230F48 -> 2311D8 */ +int func_80182778(struct ObjParticle *ptc) { + s32 sp4 = 0; + + if (ptc->unk7C->animSeqNum == 2 && ptc->unk74 == 1) { + while (D_801A81D4[sp4] != 0) { + if (D_801A81D4[sp4] == ptc->unk7C->frame) { + ptc->pos.x = D_801A81D4[sp4 + 1] * 10.0f; + ptc->pos.y = D_801A81D4[sp4 + 2] * 10.0f; + ptc->pos.z = D_801A81D4[sp4 + 3] * 10.0f; + return TRUE; + } + sp4 += 4; + } + } + if (ptc->unk7C->animSeqNum == 1 && ptc->unk74 == 1) { + while (D_801A8238[sp4] != 0) { + if (D_801A8238[sp4] == ptc->unk7C->frame) { + ptc->pos.x = D_801A8238[sp4 + 1] * 10.0f; + ptc->pos.y = D_801A8238[sp4 + 2] * 10.0f; + ptc->pos.z = D_801A8238[sp4 + 3] * 10.0f; + return TRUE; + } + sp4 += 4; + } + } + return FALSE; +} + +/* 2311D8 -> 231454 */ +void func_80182A08(struct ObjParticle *ptc, struct GdVec3f *b) { + register struct ListNode *link; + struct ObjParticle *sp20; + + if (ptc->subParticlesGrp != NULL) { + link = ptc->subParticlesGrp->firstMember; + while (link != NULL) { + // FIXME: types + sp20 = (struct ObjParticle *) link->obj; + if (sp20->timeout <= 0) { + sp20->pos.x = ptc->pos.x; + sp20->pos.y = ptc->pos.y; + sp20->pos.z = ptc->pos.z; + sp20->timeout = 12.0f - gd_rand_float() * 5.0f; + do { + sp20->unk38.x = gd_rand_float() * 50.0 - 25.0; + sp20->unk38.y = gd_rand_float() * 50.0 - 25.0; + sp20->unk38.z = gd_rand_float() * 50.0 - 25.0; + } while (gd_vec3f_magnitude(&sp20->unk38) > 30.0); + sp20->unk38.x += b->x; + sp20->unk38.y += b->y; + sp20->unk38.z += b->z; + sp20->header.drawFlags &= ~OBJ_INVISIBLE; + sp20->flags |= 8; + } + link = link->next; + } + } +} + +/* 231454 -> 231D40; orig name: Unknown80182C84 */ +void move_particle(struct ObjParticle *ptc) { + f32 sp7C; + UNUSED u8 unused2[12]; + struct GdVec3f sp64; + struct ObjParticle *sp60; + UNUSED u8 unused1[4]; + s32 i; + UNUSED u8 unused4[4]; + UNUSED u8 unused5[4]; + struct ObjCamera *sp4C; + struct GdVec3f sp40; + struct GdVec3f sp34; + + if (ptc->flags & 2) { + return; + } + if (!(ptc->flags & 8)) { + return; + } + if (ptc->unk60 == 3) { + sp40.x = -gViewUpdateCamera->unkE8[2][0] * 50.0f; + sp40.y = -gViewUpdateCamera->unkE8[2][1] * 50.0f; + sp40.z = gViewUpdateCamera->unkE8[2][2] * 50.0f; + sp34.x = gViewUpdateCamera->unkE8[2][0] * -20.0f; + sp34.y = gViewUpdateCamera->unkE8[2][1] * -20.0f; + sp34.z = gViewUpdateCamera->unkE8[2][2] * -20.0f; + } + if (ptc->attachedToObj != NULL) { + set_cur_dynobj(ptc->attachedToObj); + if (ptc->unk60 == 3) { + if (ptc->unk64 == 3) { + sp4C = (struct ObjCamera *) ptc->attachedToObj; + // Camera->unk18C = ObjView here + if (sp4C->unk18C->pickedObj != NULL) { + set_cur_dynobj(sp4C->unk18C->pickedObj); + ptc->flags |= 0x20; + ; // needed to match + } else { + ptc->flags &= ~0x10; + ptc->flags &= ~0x20; + } + } + } + d_get_world_pos(&sp64); + ptc->pos.x = sp64.x; + ptc->pos.y = sp64.y; + ptc->pos.z = sp64.z; + } + sp7C = -0.4f; + ptc->pos.x += ptc->unk38.x; + ptc->pos.y += ptc->unk38.y; + ptc->pos.z += ptc->unk38.z; + if (ptc->flags & 1) { + ptc->unk38.y += sp7C; + } + func_801838D0(ptc); + switch (ptc->unkB0) { + case 1: + ptc->unkB0 = 2; + if (ptc->unk60 == 3) { + switch (ptc->unk64) { + case 1: + ptc->subParticlesGrp = make_group(0); + for (i = 0; i < 50; i++) { + sp60 = make_particle(1, -1, ptc->pos.x, ptc->pos.y, ptc->pos.z); + sp60->shapePtr = ptc->shapePtr; + addto_group(ptc->subParticlesGrp, &sp60->header); + sp60->flags &= ~8; + } + break; + case 2: + case 3: + ptc->subParticlesGrp = make_group(0); + for (i = 0; i < 30; i++) { + sp60 = make_particle(1, -1, ptc->pos.x, ptc->pos.y, ptc->pos.z); + sp60->shapePtr = ptc->shapePtr; + addto_group(ptc->subParticlesGrp, &sp60->header); + sp60->flags &= ~8; + } + break; + } + } + break; + default: + break; + } + ptc->unk38.x *= 0.9; + ptc->unk38.y *= 0.9; + ptc->unk38.z *= 0.9; + if (ptc->unk60 == 3) { + switch (ptc->unk64) { + case 1: + if (func_80182778(ptc) && ptc->subParticlesGrp != NULL) { + register struct ListNode *link; + + if (ptc->unk80 != NULL) { + ptc->unk80->unk3C |= 1; + ptc->unk80->position.x = ptc->pos.x; + ptc->unk80->position.y = ptc->pos.y; + ptc->unk80->position.z = ptc->pos.z; + } + link = ptc->subParticlesGrp->firstMember; + while (link != NULL) { + struct ObjParticle *sp2C = (struct ObjParticle *) link->obj; + + sp2C->pos.x = ptc->pos.x; + sp2C->pos.y = ptc->pos.y; + sp2C->pos.z = ptc->pos.z; + sp2C->timeout = 20; + do { + sp2C->unk38.x = gd_rand_float() * 64.0 - 32.0; + sp2C->unk38.y = gd_rand_float() * 64.0 - 32.0; + sp2C->unk38.z = gd_rand_float() * 64.0 - 32.0; + } while (gd_vec3f_magnitude(&sp2C->unk38) > 32.0); + sp2C->unk30 = gd_rand_float() * 180.0f; + sp2C->header.drawFlags &= ~OBJ_INVISIBLE; + sp2C->flags |= 8; + link = link->next; + } + } + break; + case 3: + if ((ptc->flags & 0x20) && !(ptc->flags & 0x10)) { + func_80182A08(ptc, &sp40); + ptc->flags |= 0x10; + } + break; + case 2: + func_80182A08(ptc, &sp34); + break; + } + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, ptc->subParticlesGrp); + } + if (ptc->timeout >= 0) { + if (ptc->timeout-- <= 0) { + ptc->header.drawFlags |= OBJ_INVISIBLE; + ptc->flags &= ~8; + } + } +} + +/* 231D40 -> 231D98; orig name: func_80183570 */ +void move_particles_in_grp(struct ObjGroup *group) { + start_timer("particles"); + gGdSkinNet = NULL; + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, group); + stop_timer("particles"); +} + +#define ABS(x) ((x) < 0.0f ? -(x) : (x)) +/* 231D98 -> 232040 */ +void Unknown801835C8(struct ObjParticle *ptc) { + struct GdVec3f sp54; + f32 sp50; + register struct ListNode *link; + + gd_printf("p(%d)=", ptc->attachedObjsGrp->memberCount); + link = ptc->attachedObjsGrp->firstMember; + while (link != NULL) { + // FIXME: types + struct ObjParticle *sp48 = (struct ObjParticle *) link->obj; + + sp54.x = sp48->pos.x - ptc->pos.x; + sp54.y = sp48->pos.y - ptc->pos.y; + sp54.z = sp48->pos.z - ptc->pos.z; + sp50 = 150.0f - (ABS(sp54.x) + ABS(sp54.y) + ABS(sp54.z)); + gd_printf(",%f ", sp50); + sp50 *= 0.00000005; + ptc->pos.x += sp50 * sp54.x; + ptc->pos.y += sp50 * sp54.y; + ptc->pos.z += sp50 * sp54.z; + sp48->pos.x -= sp50 * sp54.x; + sp48->pos.y -= sp50 * sp54.y; + sp48->pos.z -= sp50 * sp54.z; + link = link->next; + } + gd_printf("\n"); +} + +/** + * Unused + */ +void stub_particles_1(UNUSED s32 a) { +} + +/** + * Unused + */ +void stub_particles_2(UNUSED s32 a) { +} + +/** + * Unused + */ +void stub_particles_3(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c) { +} + +/** + * Unused + */ +void stub_particles_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c) { +} + +/* 2320A0 -> 2320D4; pad to 2320E0 */ +void func_801838D0(struct ObjParticle *ptc) { + D_801B9E3C = ptc; + if (ptc->pos.y < -15.0f) { + } +} diff --git a/src/goddard/particles.h b/src/goddard/particles.h new file mode 100644 index 00000000..3ea34999 --- /dev/null +++ b/src/goddard/particles.h @@ -0,0 +1,13 @@ +#ifndef GD_PARTICLES_H +#define GD_PARTICLES_H + +#include + +#include "gd_types.h" + +// functions +void func_801823A0(struct ObjNet *net); +struct ObjParticle *make_particle(u32 a, s32 b, f32 x, f32 y, f32 z); +void move_particles_in_grp(struct ObjGroup *group); + +#endif // GD_PARTICLES_H diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c new file mode 100644 index 00000000..e569b6d8 --- /dev/null +++ b/src/goddard/renderer.c @@ -0,0 +1,3933 @@ +#include +#include +#include + +#if defined(VERSION_JP) || defined(VERSION_US) +#include "prevent_bss_reordering.h" +#endif + +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "dynlists/dynlists.h" +#include "gd_macros.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_memory.h" +#include "gd_types.h" +#include "macros.h" +#include "objects.h" +#include "renderer.h" +#include "sfx.h" +#include "shape_helper.h" +#include "skin.h" +#include "types.h" + +#define MAX_GD_DLS 1000 +#define OS_MESG_SI_COMPLETE 0x33333333 + +#ifndef NO_SEGMENTED_MEMORY +#define GD_VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) &0x0FFFFFFF) +#define GD_LOWER_24(addr) ((uintptr_t)(addr) &0x00FFFFFF) +#define GD_LOWER_29(addr) (((uintptr_t)(addr)) & 0x1FFFFFFF) +#else +#define GD_VIRTUAL_TO_PHYSICAL(addr) (addr) +#define GD_LOWER_24(addr) ((uintptr_t)(addr)) +#define GD_LOWER_29(addr) (((uintptr_t)(addr))) +#endif + +#define MTX_INTPART_PACK(w1, w2) (((w1) &0xFFFF0000) | (((w2) >> 16) & 0xFFFF)) +#define MTX_FRACPART_PACK(w1, w2) ((((w1) << 16) & 0xFFFF0000) | ((w2) &0xFFFF)) +#define LOOKAT_PACK(c) ((s32) MIN(((c) * (128.0)), 127.0) & 0xff) + +// structs +struct GdDisplayList { + /* Vertices */ + /*0x00*/ s32 curVtxIdx; + /*0x04*/ s32 totalVtx; + /*0x08*/ Vtx *vtx; + /* Matrices */ + /*0x0C*/ s32 curMtxIdx; + /*0x10*/ s32 totalMtx; + /*0x14*/ Mtx *mtx; + /* Lights */ + /*0x18*/ s32 curLightIdx; + /*0x1C*/ s32 totalLights; + /*0x20*/ Lights4 *light; + /* Gfx-es */ + /*0x24*/ s32 curGfxIdx; + /*0x28*/ s32 totalGfx; + /*0x2C*/ Gfx *gfx; // active position in DL + /*0x30*/ Gfx **dlptr; // pointer to list/array of display lists for each frame? + /* Viewports */ + /*0x34*/ s32 curVpIdx; + /*0x38*/ s32 totalVp; + /*0x3C*/ Vp *vp; + /* GD DL Info */ + /*0x40*/ u32 id; // user specified + /*0x44*/ u32 number; // count + /*0x48*/ u8 pad48[4]; + /*0x4C*/ struct GdDisplayList *parent; // not quite sure? +}; /* sizeof = 0x50 */ +// accessor macros for gd dl +#define DL_CURRENT_VTX(dl) ((dl)->vtx[(dl)->curVtxIdx]) +#define DL_CURRENT_MTX(dl) ((dl)->mtx[(dl)->curMtxIdx]) +#define DL_CURRENT_LIGHT(dl) ((dl)->light[(dl)->curLightIdx]) +#define DL_CURRENT_GFX(dl) ((dl)->gfx[(dl)->curGfxIdx]) +#define DL_CURRENT_VP(dl) ((dl)->vp[(dl)->curVpIdx]) + +struct LightDirVec { + s32 x, y, z; +}; + +enum DynListBankFlag { TABLE_END = -1, STD_LIST_BANK = 3 }; + +struct DynListBankInfo { + /* 0x00 */ enum DynListBankFlag flag; + /* 0x04 */ struct DynList *list; +}; + +// bss +#if defined(VERSION_EU) || defined(VERSION_SH) +static OSMesgQueue D_801BE830; // controller msg queue +static OSMesg D_801BE848[10]; +u8 EUpad1[0x40]; +static OSMesgQueue D_801BE8B0; +static OSMesgQueue sGdDMAQueue; // @ 801BE8C8 +// static u32 unref_801be870[16]; +// static u32 unref_801be8e0[25]; +// static u32 unref_801be948[13]; +u8 EUpad2[0x64]; +static OSMesg sGdMesgBuf[1]; // @ 801BE944 +u8 EUpad3[0x34]; +static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue +static OSIoMesg sGdDMAReqMesg; +static struct ObjView *D_801BE994; // store if View flag 0x40 set + +u8 EUpad4[0x88]; +#endif +static OSContStatus D_801BAE60[4]; +static OSContPad sGdContPads[4]; // @ 801BAE70 +static OSContPad sPrevFrameCont[4]; // @ 801BAE88 +static u8 D_801BAEA0; +static struct ObjGadget *sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8 +static u32 D_801BAF28; // RAM addr offset? +static s16 sTriangleBuf[13][8]; // [[s16; 8]; 13]? vert indices? +static u32 unref_801bb000[3]; +static u8 *sMemBlockPoolBase; // @ 801BB00C +static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes +static u32 unref_801bb014; +static s32 D_801BB018; +static s32 D_801BB01C; +static void *sLoadedTextures[0x10]; // texture pointers +static s32 sTextureDisplayLists[0x10]; // gd_dl indices +static s16 sVtxCvrtTCBuf[2]; // @ 801BB0A0 +static s32 sCarGdDlNum; // @ 801BB0A4 +static struct ObjGroup *sYoshiSceneGrp; // @ 801BB0A8 +static s32 unusedDl801BB0AC; // unused DL number +static struct ObjGroup *sMarioSceneGrp; // @ 801BB0B0 +static s32 D_801BB0B4; // second offset into sTriangleBuf +static struct ObjGroup *sCarSceneGrp; // @ 801BB0B8 +static s32 sVertexBufCount; // vtx's to load into RPD? Vtx len in GD Dl and in the lower bank (AF30) +static struct ObjView *sYoshiSceneView; // @ 801BB0C0 +static s32 sTriangleBufCount; // number of triangles in sTriangleBuf +static struct ObjView *sMSceneView; // @ 801BB0C8; Mario scene view +static s32 sVertexBufStartIndex; // Vtx start in GD Dl +static struct ObjView *sCarSceneView; // @ 801BB0D0 +static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex? +static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex? +static u32 unref_801bb0dc; +static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used +static u32 unref_801bb0e4; +static struct GdVec3f sTextDrawPos; // position to draw text? only set in one function, never used +static u32 unref_801bb0f8[2]; +static Mtx sIdnMtx; // @ 801BB100 +static Mat4f sInitIdnMat4; // @ 801BB140 +static s8 sVtxCvrtNormBuf[3]; // @ 801BB180 +static s16 sAlpha; +static s32 sNumLights; +static struct GdColour sAmbScaleColour; // @ 801BB190 +static struct GdColour sLightScaleColours[2]; // @ 801BB1A0 +static struct LightDirVec sLightDirections[2]; +static s32 sLightId; +static Hilite sHilites[600]; +static struct GdVec3f D_801BD758; +static struct GdVec3f D_801BD768; // had to migrate earlier +static u32 D_801BD774; +static struct GdObj *sMenuGadgets[9]; // @ 801BD778; d_obj ptr storage? menu? +static struct ObjView *sDebugViews[2]; // Seems to be a list of ObjViews for displaying debug info +static struct GdDisplayList *sStaticDl; // @ 801BD7A8 +static struct GdDisplayList *sDynamicMainDls[2]; // @ 801BD7B0 +static struct GdDisplayList *sGdDlStash; // @ 801BD7B8 +static struct GdDisplayList *sMHeadMainDls[2]; // @ 801BD7C0; two DLs, double buffered one per frame - seem to be basic dls that branch to actual lists? +static struct GdDisplayList *sViewDls[3][2]; // I guess? 801BD7C8 -> 801BD7E0? +static struct GdDisplayList *sGdDLArray[MAX_GD_DLS]; // @ 801BD7E0; indexed by dl number (gddl+0x44) +static s32 sPickBufLen; // @ 801BE780 +static s32 sPickBufPosition; // @ 801BE784 +static s16 *sPickBuf; // @ 801BE788 +static LookAt D_801BE790[2]; +static LookAt D_801BE7D0[3]; +#if defined(VERSION_JP) || defined(VERSION_US) +static OSMesgQueue D_801BE830; // controller msg queue +static OSMesg D_801BE848[10]; +static u32 unref_801be870[16]; +static OSMesgQueue D_801BE8B0; +static OSMesgQueue sGdDMAQueue; // @ 801BE8C8 +static u32 unref_801be8e0[25]; +static OSMesg sGdMesgBuf[1]; // @ 801BE944 +static u32 unref_801be948[13]; +static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue +static OSIoMesg sGdDMAReqMesg; +static struct ObjView *D_801BE994; // store if View flag 0x40 set +#endif + +// data +static u32 unref_801a8670 = 0; +static s32 D_801A8674 = 0; +static u32 unref_801a8678 = 0; +static s32 D_801A867C = 0; +static s32 D_801A8680 = 0; +static f32 sTracked1FrameTime = 0.0f; // @ 801A8684 +static f32 sDynamicsTime = 0.0f; // @ 801A8688 +static f32 sDLGenTime = 0.0f; // @ 801A868C +static f32 sRCPTime = 0.0f; // @ 801A8690 +static f32 sTimeScaleFactor = 1.0f; // @ D_801A8694 +static u32 sMemBlockPoolSize = 1; // @ 801A8698 +static s32 sMemBlockPoolUsed = 0; // @ 801A869C +static s32 sTextureCount = 0; // maybe? +static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp +static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp +static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp +s32 gGdFrameBufNum = 0; // @ 801A86B0 +static u32 unref_801a86B4 = 0; +static struct ObjShape *sHandShape = NULL; // @ 801A86B8 +static s32 D_801A86BC = 1; +static s32 D_801A86C0 = 0; // gd_dl id for something? +static u32 unref_801a86C4 = 10; +static s32 sMtxParamType = G_MTX_PROJECTION; +static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }; +static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl +static struct ObjView *sScreenView = NULL; // @ 801A86DC +static struct ObjView *D_801A86E0 = NULL; +static struct ObjView *sHandView = NULL; // @ 801A86E4 +static struct ObjView *sMenuView = NULL; // @ 801A86E8 +static u32 sItemsInMenu = 0; // @ 801A86EC +static s32 sDebugViewsCount = 0; // number of elements in the sDebugViews array +static s32 sCurrDebugViewIndex = 0; // @ 801A86F4; timing activate cool down counter? +static u32 unref_801a86F8 = 0; +static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC +static u32 sGdDlCount = 0; // @ 801A8700 +static struct DynListBankInfo sDynLists[] = { // @ 801A8704 + { STD_LIST_BANK, dynlist_test_cube }, + { STD_LIST_BANK, dynlist_spot_shape }, + { STD_LIST_BANK, dynlist_mario_master }, + { TABLE_END, NULL } +}; + +// textures and display list data +static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728 + gsSPEndDisplayList(), +}; + +ALIGNED8 static Texture gd_texture_hand_open[] = { +#include "textures/intro_raw/hand_open.rgba16.inc.c" +}; + +static Gfx gd_texture2_dummy_aligner1[] = { + gsSPEndDisplayList() +}; + +ALIGNED8 static Texture gd_texture_hand_closed[] = { +#include "textures/intro_raw/hand_closed.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_0[] = { +#include "textures/intro_raw/red_star_0.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_1[] = { +#include "textures/intro_raw/red_star_1.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_2[] = { +#include "textures/intro_raw/red_star_2.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_3[] = { +#include "textures/intro_raw/red_star_3.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_4[] = { +#include "textures/intro_raw/red_star_4.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_5[] = { +#include "textures/intro_raw/red_star_5.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_6[] = { +#include "textures/intro_raw/red_star_6.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_red_star_7[] = { +#include "textures/intro_raw/red_star_7.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_0[] = { +#include "textures/intro_raw/white_star_0.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_1[] = { +#include "textures/intro_raw/white_star_1.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_2[] = { +#include "textures/intro_raw/white_star_2.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_3[] = { +#include "textures/intro_raw/white_star_3.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_4[] = { +#include "textures/intro_raw/white_star_4.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_5[] = { +#include "textures/intro_raw/white_star_5.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_6[] = { +#include "textures/intro_raw/white_star_6.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_white_star_7[] = { +#include "textures/intro_raw/white_star_7.rgba16.inc.c" +}; + +static Vtx_t gd_vertex_star[] = { + {{-64, 0, 0}, 0, { 0, 992}, {0x00, 0x00, 0x7F}}, + {{ 64, 0, 0}, 0, {992, 992}, {0x00, 0x00, 0x7F}}, + {{ 64, 128, 0}, 0, {992, 0}, {0x00, 0x00, 0x7F}}, + {{-64, 128, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7F}}, +}; + +//! no references to these vertices +UNUSED static Vtx_t gd_unused_vertex[] = { + {{16384, 0, 0}, 0, {0, 16384}, {0x00, 0x00, 0x00}}, + {{ 0, 0, 16384}, 0, {0, 0}, {0x00, 0x00, 0x40}}, + {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, + {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, +}; + +static Gfx gd_dl_star_common[] = { + gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), + gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), + gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_NOOP2), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPLoadSync(), + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), + gsSPVertex(gd_vertex_star, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), + gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_red_star_0[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_0), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_1[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_1), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_2[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_2), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_3[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_3), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_4[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_4), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_5[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_5), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_6[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_6), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_red_star_7[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_red_star_7), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_0[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_0), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_1[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_1), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_2[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_2), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_3[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_3), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_4[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_4), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_5[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_5), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_6[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_6), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx gd_dl_silver_star_7[] = { + gsDPPipeSync(), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_white_star_7), + gsSPBranchList(gd_dl_star_common), +}; + +static Gfx *gd_red_star_dl_array[] = { + gd_dl_red_star_0, + gd_dl_red_star_0, + gd_dl_red_star_1, + gd_dl_red_star_1, + gd_dl_red_star_2, + gd_dl_red_star_2, + gd_dl_red_star_3, + gd_dl_red_star_3, + gd_dl_red_star_4, + gd_dl_red_star_4, + gd_dl_red_star_5, + gd_dl_red_star_5, + gd_dl_red_star_6, + gd_dl_red_star_6, + gd_dl_red_star_7, + gd_dl_red_star_7, +}; + +static Gfx *gd_silver_star_dl_array[] = { + gd_dl_silver_star_0, + gd_dl_silver_star_0, + gd_dl_silver_star_1, + gd_dl_silver_star_1, + gd_dl_silver_star_2, + gd_dl_silver_star_2, + gd_dl_silver_star_3, + gd_dl_silver_star_3, + gd_dl_silver_star_4, + gd_dl_silver_star_4, + gd_dl_silver_star_5, + gd_dl_silver_star_5, + gd_dl_silver_star_6, + gd_dl_silver_star_6, + gd_dl_silver_star_7, + gd_dl_silver_star_7, +}; + +ALIGNED8 static Texture gd_texture_sparkle_0[] = { +#include "textures/intro_raw/sparkle_0.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_sparkle_1[] = { +#include "textures/intro_raw/sparkle_1.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_sparkle_2[] = { +#include "textures/intro_raw/sparkle_2.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_sparkle_3[] = { +#include "textures/intro_raw/sparkle_3.rgba16.inc.c" +}; + +ALIGNED8 static Texture gd_texture_sparkle_4[] = { +#include "textures/intro_raw/sparkle_4.rgba16.inc.c" +}; + +//! No reference to this texture. Two DL's uses the same previous texture +// instead of using this texture. +ALIGNED8 static Texture gd_texture_sparkle_5[] = { +#include "textures/intro_raw/sparkle_5.rgba16.inc.c" +}; + +static Vtx_t gd_vertex_sparkle[] = { + {{ -32, 0, 0}, 0, { 0, 1984}, { 0x00, 0x00, 0x7F, 0x00}}, + {{ 32, 0, 0}, 0, { 1984, 1984}, { 0x00, 0x00, 0x7F, 0x00}}, + {{ 32, 64, 0}, 0, { 1984, 0}, { 0x00, 0x00, 0x7F, 0x00}}, + {{ -32, 64, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x7F, 0x00}}, +}; + +static Gfx gd_dl_sparkle[] = { + gsDPSetCombineMode(G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM), + gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), + gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_NOOP2), + gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsDPLoadSync(), + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), + gsSPVertex(gd_vertex_sparkle, 4, 0), + gsSP2Triangles(0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF), + gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_sparkle_red_color[] = { + gsDPSetPrimColor(0, 0, 255, 0, 0, 255), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_sparkle_white_color[] = { + gsDPSetPrimColor(0, 0, 255, 255, 255, 255), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_red_sparkle_0[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_0), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_red_sparkle_1[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_1), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_red_sparkle_2[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_2), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_red_sparkle_3[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_3), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_red_sparkle_4[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_red_sparkle_4_dup[] ={ + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_red_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), // 4 again, correct texture would be 5 + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_0[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_0), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_1[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_1), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_2[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_2), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_3[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_3), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_4[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx gd_dl_silver_sparkle_4_dup[] = { + gsDPPipeSync(), + gsSPDisplayList(gd_dl_sparkle_white_color), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), // 4 again, correct texture would be 5 + gsSPBranchList(gd_dl_sparkle), +}; + +static Gfx *gd_red_sparkle_dl_array[] = { + gd_dl_red_sparkle_4, + gd_dl_red_sparkle_4, + gd_dl_red_sparkle_3, + gd_dl_red_sparkle_3, + gd_dl_red_sparkle_2, + gd_dl_red_sparkle_2, + gd_dl_red_sparkle_1, + gd_dl_red_sparkle_1, + gd_dl_red_sparkle_0, + gd_dl_red_sparkle_0, + gd_dl_red_sparkle_4_dup, + gd_dl_red_sparkle_4_dup, +}; + +static Gfx *gd_silver_sparkle_dl_array[] = { + gd_dl_silver_sparkle_4, + gd_dl_silver_sparkle_4, + gd_dl_silver_sparkle_3, + gd_dl_silver_sparkle_3, + gd_dl_silver_sparkle_2, + gd_dl_silver_sparkle_2, + gd_dl_silver_sparkle_1, + gd_dl_silver_sparkle_1, + gd_dl_silver_sparkle_0, + gd_dl_silver_sparkle_0, + gd_dl_silver_sparkle_4_dup, + gd_dl_silver_sparkle_4_dup, +}; + +static Gfx gd_texture3_dummy_aligner1[] = { + gsSPEndDisplayList(), +}; + +ALIGNED8 static Texture gd_texture_mario_face_shine[] = { +#include "textures/intro_raw/mario_face_shine.ia8.inc.c" +}; + +static Gfx gd_dl_mario_face_shine[] = { + gsSPSetGeometryMode(G_TEXTURE_GEN), + gsSPTexture(0x07C0, 0x07C0, 0, G_TX_RENDERTILE, G_ON), + gsDPSetTexturePersp(G_TP_PERSP), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetCombineMode(G_CC_HILITERGBA, G_CC_HILITERGBA), + gsDPLoadTextureBlock(gd_texture_mario_face_shine, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPPipeSync(), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_rsp_init[] = { + gsSPClearGeometryMode(0xFFFFFFFF), + gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_rdp_init[] = { + gsDPPipeSync(), + gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetTextureLOD(G_TL_TILE), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTexturePersp(G_TP_PERSP), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetTextureConvert(G_TC_FILT), + gsDPSetCombineKey(G_CK_NONE), + gsDPSetAlphaCompare(G_AC_NONE), + gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), + gsDPNoOp(), + gsDPSetColorDither(G_CD_MAGICSQ), + gsDPPipeSync(), + gsSPEndDisplayList(), +}; + +static u32 gd_unused_pad1 = 0; + +float sGdPerspTimer = 1.0; + +static u32 gd_unused_pad2 = 0; + +static Gfx gd_texture4_dummy_aligner1[] = { + gsDPPipeSync(), + gsSPEndDisplayList(), +}; + +static Vtx_t gd_unused_mesh_vertex_group1[] = { + {{-8, 8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, + {{ 8, -2, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, + {{ 2, -8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, +}; + +static Vtx_t gd_unused_mesh_vertex_group2[] = { + {{-6, 6, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}, + {{ 7, -3, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, + {{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, +}; + +static Gfx gd_dl_unused_mesh[] = { + gsDPPipeSync(), + gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), + gsSPClearGeometryMode(0xFFFFFFFF), + gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), + gsDPPipeSync(), + gsSPVertex(gd_unused_mesh_vertex_group1, 3, 0), + gsSP1Triangle(0, 1, 2, 0x0), + gsSPVertex(gd_unused_mesh_vertex_group2, 3, 0), + gsSP1Triangle(0, 1, 2, 0x0), + gsSPEndDisplayList(), +}; + +static Gfx gd_dl_sprite_start_tex_block[] = { + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON), + gsDPSetAlphaCompare(G_AC_THRESHOLD), + gsDPSetBlendColor(0, 0, 0, 1), + gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_NOOP2), + gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetTexturePersp(G_TP_NONE), + gsSPEndDisplayList(), +}; + +// linker (ROM addresses) +extern u8 _gd_dynlistsSegmentRomStart[]; +extern u8 _gd_dynlistsSegmentRomEnd[]; + +// forward declarations +u32 new_gddl_from(Gfx *, s32); +void gd_setup_cursor(struct ObjGroup *); +void parse_p1_controller(void); +void update_cursor(void); +void update_view_and_dl(struct ObjView *); +static void update_render_mode(void); +void gddl_is_loading_shine_dl(s32); +void func_801A3370(f32, f32, f32); +void gd_put_sprite(u16 *, s32, s32, s32, s32); +void reset_cur_dl_indices(void); + +// TODO: make a gddl_num_t? + +u32 get_alloc_mem_amt(void) { + return sAllocMemory; +} + +/** + * Returns the current time + */ +s32 gd_get_ostime(void) { + return osGetTime(); +} + +f32 get_time_scale(void) { + return sTimeScaleFactor; +} + +void dump_disp_list(void) { + gd_printf("%d\n", sCurrentGdDl->id); + gd_printf("Vtx=%d/%d, Mtx=%d/%d, Light=%d/%d, Gfx=%d/%d\n", sCurrentGdDl->curVtxIdx, + sCurrentGdDl->totalVtx, sCurrentGdDl->curMtxIdx, sCurrentGdDl->totalMtx, + sCurrentGdDl->curLightIdx, sCurrentGdDl->totalLights, sCurrentGdDl->curGfxIdx, + sCurrentGdDl->totalGfx); +} + +/** + * Increments the current display list's Gfx index list and returns a pointer to the next Gfx element + */ +static Gfx *next_gfx(void) { + if (sCurrentGdDl->curGfxIdx >= sCurrentGdDl->totalGfx) { + dump_disp_list(); + fatal_printf("Gfx list overflow"); + } + + return &sCurrentGdDl->gfx[sCurrentGdDl->curGfxIdx++]; +} + +/** + * Increments the current display list's Light index list and returns a pointer to the next Light element + */ +static Lights4 *next_light(void) { + if (sCurrentGdDl->curLightIdx >= sCurrentGdDl->totalLights) { + dump_disp_list(); + fatal_printf("Light list overflow"); + } + + return &sCurrentGdDl->light[sCurrentGdDl->curLightIdx++]; +} + +/** + * Increments the current display list's matrix index list and returns a pointer to the next matrix element + */ +static Mtx *next_mtx(void) { + if (sCurrentGdDl->curMtxIdx >= sCurrentGdDl->totalMtx) { + dump_disp_list(); + fatal_printf("Mtx list overflow"); + } + + return &sCurrentGdDl->mtx[sCurrentGdDl->curMtxIdx++]; +} + +/** + * Increments the current display list's vertex index list and returns a pointer to the next vertex element + */ +static Vtx *next_vtx(void) { + if (sCurrentGdDl->curVtxIdx >= sCurrentGdDl->totalVtx) { + dump_disp_list(); + fatal_printf("Vtx list overflow"); + } + + return &sCurrentGdDl->vtx[sCurrentGdDl->curVtxIdx++]; +} + +/** + * Increments the current display list's viewport list and returns a pointer to the next viewport element + */ +static Vp *next_vp(void) { + if (sCurrentGdDl->curVpIdx >= sCurrentGdDl->totalVp) { + dump_disp_list(); + fatal_printf("Vp list overflow"); + } + + return &sCurrentGdDl->vp[sCurrentGdDl->curVpIdx++]; +} + +/* 249AAC -> 249AEC */ +f64 gd_sin_d(f64 x) { + return sinf(x); +} + +/* 249AEC -> 249B2C */ +f64 gd_cos_d(f64 x) { + return cosf(x); +} + +/* 249B2C -> 249BA4 */ +f64 gd_sqrt_d(f64 x) { + if (x < 1.0e-7) { + return 0.0; + } + return sqrtf(x); +} + +/** + * Unused + */ +f64 stub_renderer_1(UNUSED f64 x) { + return 0.0; +} + +/* 249BCC -> 24A19C */ +void gd_printf(const char *format, ...) { + s32 i; + UNUSED u32 pad158; + char c; + char f; + UNUSED u32 pad150; + char buf[0x100]; + char *csr = buf; + char spec[8]; // specifier string + UNUSED u32 pad40; + union PrintVal val; + va_list args; + + *csr = '\0'; + va_start(args, format); + while ((c = *format++)) { + switch (c) { + case '%': + f = *format++; + i = 0; + // handle f32 precision formatter (N.Mf) + if (f >= '0' && f <= '9') { + for (i = 0; i < 3; i++) { + if ((f >= '0' && f <= '9') || f == '.') { + spec[i] = f; + } else { + break; + } + + f = *format++; + } + } + + spec[i] = f; + i++; + spec[i] = '\0'; + + switch ((c = spec[0])) { + case 'd': + val.i = va_arg(args, s32); + csr = sprint_val_withspecifiers(csr, val, spec); + break; + case 'x': + val.i = va_arg(args, u32); + csr = sprint_val_withspecifiers(csr, val, spec); + break; + case '%': + *csr = '%'; + csr++; + *csr = '\0'; + break; + break; // needed to match + case 'f': + val.f = (f32) va_arg(args, double); + csr = sprint_val_withspecifiers(csr, val, spec); + break; + case 's': + csr = gd_strcat(csr, va_arg(args, char *)); + break; + case 'c': + //! @bug formatter 'c' uses `s32` for va_arg instead of `char` + *csr = va_arg(args, s32); + csr++; + *csr = '\0'; + break; + default: + if (spec[3] == 'f') { + val.f = (f32) va_arg(args, double); + csr = sprint_val_withspecifiers(csr, val, spec); + } + break; + } + break; + case '\\': + *csr = '\\'; + csr++; + *csr = '\0'; + break; + case '\n': + *csr = '\n'; + csr++; + *csr = '\0'; + break; + default: + *csr = c; + csr++; + *csr = '\0'; + break; + } + } + va_end(args); + + *csr = '\0'; + if (csr - buf >= ARRAY_COUNT(buf) - 1) { + fatal_printf("printf too long"); + } +} + +/* 24A19C -> 24A1D4 */ +void gd_exit(UNUSED s32 code) { + gd_printf("exit\n"); + while (TRUE) { + } +} + +/* 24A1D4 -> 24A220; orig name: func_8019BA04 */ +void gd_free(void *ptr) { + sAllocMemory -= gd_free_mem(ptr); +} + +/* 24A220 -> 24A318 */ +void *gd_allocblock(u32 size) { + void *block; // 1c + + size = ALIGN(size, 8); + if ((sMemBlockPoolUsed + size) > sMemBlockPoolSize) { + gd_printf("gd_allocblock(): Failed request: %dk (%d bytes)\n", size / 1024, size); + gd_printf("gd_allocblock(): Heap usage: %dk (%d bytes) \n", sMemBlockPoolUsed / 1024, + sMemBlockPoolUsed); + print_all_memtrackers(); + mem_stats(); + fatal_printf("exit"); + } + + block = sMemBlockPoolBase + sMemBlockPoolUsed; + sMemBlockPoolUsed += size; + return block; +} + +/* 24A318 -> 24A3E8 */ +void *gd_malloc(u32 size, u8 perm) { + void *ptr; // 1c + size = ALIGN(size, 8); + ptr = gd_request_mem(size, perm); + + if (ptr == NULL) { + gd_printf("gd_malloc(): Failed request: %dk (%d bytes)\n", size / 1024, size); + gd_printf("gd_malloc(): Heap usage: %dk (%d bytes) \n", sAllocMemory / 1024, sAllocMemory); + print_all_memtrackers(); + mem_stats(); + return NULL; + } + + sAllocMemory += size; + + return ptr; +} + +/* 24A3E8 -> 24A420; orig name: func_8019BC18 */ +void *gd_malloc_perm(u32 size) { + return gd_malloc(size, PERM_G_MEM_BLOCK); +} + +/* 24A420 -> 24A458; orig name: func_8019BC50 */ +void *gd_malloc_temp(u32 size) { + return gd_malloc(size, TEMP_G_MEM_BLOCK); +} + +/* 24A458 -> 24A4A4 */ +void *Unknown8019BC88(u32 size, u32 count) { + return gd_malloc_perm(size * count); +} + +/* 24A4A4 -> 24A4DC */ +void *Unknown8019BCD4(u32 size) { + return gd_malloc_perm(size); +} + +/* 24A4DC -> 24A598 */ +void draw_indexed_dl(s32 dlNum, s32 gfxIdx) { + Gfx *dl; + + if (gfxIdx != 0) { + dl = sGdDLArray[dlNum]->dlptr[gfxIdx - 1]; // multiple display lists (determined by frame) + } else { + dl = sGdDLArray[dlNum]->gfx; // only one display list + } + gSPDisplayList(next_gfx(), GD_VIRTUAL_TO_PHYSICAL(dl)); +} + +/* 24A598 -> 24A610; orig name: func_8019BDC8 */ +void branch_cur_dl_to_num(s32 dlNum) { + Gfx *dl; + UNUSED u32 pad[2]; + + dl = sGdDLArray[dlNum]->gfx; + gSPDisplayList(next_gfx(), GD_VIRTUAL_TO_PHYSICAL(dl)); +} + +/** + * Unused (not called) + */ +Gfx *get_dl_gfx(s32 num) { + return sGdDLArray[num]->gfx; +} + +/** + * Creates `ObjShape`s for the stars and sparkles + */ +void setup_stars(void) { + gShapeRedStar = make_shape(0, "redstar"); + gShapeRedStar->dlNums[0] = new_gddl_from(NULL, 0); + gShapeRedStar->dlNums[1] = gShapeRedStar->dlNums[0]; + sGdDLArray[gShapeRedStar->dlNums[0]]->dlptr = gd_red_star_dl_array; + sGdDLArray[gShapeRedStar->dlNums[1]]->dlptr = gd_red_star_dl_array; + + gShapeSilverStar = make_shape(0, "silverstar"); + gShapeSilverStar->dlNums[0] = new_gddl_from(NULL, 0); + gShapeSilverStar->dlNums[1] = gShapeSilverStar->dlNums[0]; + sGdDLArray[gShapeSilverStar->dlNums[0]]->dlptr = gd_silver_star_dl_array; + sGdDLArray[gShapeSilverStar->dlNums[1]]->dlptr = gd_silver_star_dl_array; + + // make_shape names of the dl array they call are misnamed (swapped) + // "sspark" calls red sparkles and "rspark" calls silver sparkles + gShapeRedSpark = make_shape(0, "sspark"); + gShapeRedSpark->dlNums[0] = new_gddl_from(NULL, 0); + gShapeRedSpark->dlNums[1] = gShapeRedSpark->dlNums[0]; + sGdDLArray[gShapeRedSpark->dlNums[0]]->dlptr = gd_red_sparkle_dl_array; + sGdDLArray[gShapeRedSpark->dlNums[1]]->dlptr = gd_red_sparkle_dl_array; + + gShapeSilverSpark = make_shape(0, "rspark"); + gShapeSilverSpark->dlNums[0] = new_gddl_from(NULL, 0); + gShapeSilverSpark->dlNums[1] = gShapeSilverSpark->dlNums[0]; + sGdDLArray[gShapeSilverSpark->dlNums[0]]->dlptr = gd_silver_sparkle_dl_array; + sGdDLArray[gShapeSilverSpark->dlNums[1]]->dlptr = gd_silver_sparkle_dl_array; +} + +/* 24A8D0 -> 24AA40 */ +void setup_timers(void) { + start_timer("updateshaders"); + stop_timer("updateshaders"); + start_timer("childpos"); + stop_timer("childpos"); + start_timer("netupd"); + stop_timer("netupd"); + start_timer("drawshape2d"); + stop_timer("drawshape2d"); + + start_timer("drawshape"); + start_timer("drawobj"); + start_timer("drawscene"); + start_timer("camsearch"); + start_timer("move_animators"); + start_timer("move_nets"); + stop_timer("move_animators"); + stop_timer("move_nets"); + stop_timer("drawshape"); + stop_timer("drawobj"); + stop_timer("drawscene"); + stop_timer("camsearch"); + + start_timer("move_bones"); + stop_timer("move_bones"); + start_timer("move_skin"); + stop_timer("move_skin"); + start_timer("draw1"); + stop_timer("draw1"); + start_timer("dynamics"); + stop_timer("dynamics"); +} + +/* 24AA40 -> 24AA58 */ +void Unknown8019C270(u8 *buf) { + gGdStreamBuffer = buf; +} + +/* 24AA58 -> 24AAA8 */ +void Unknown8019C288(s32 stickX, s32 stickY) { + struct GdControl *ctrl = &gGdCtrl; // 4 + + ctrl->stickXf = (f32) stickX; + ctrl->stickYf = (f32)(stickY / 2); +} + +/* 24AAA8 -> 24AAE0; orig name: func_8019C2D8 */ +void gd_add_to_heap(void *addr, u32 size) { + // TODO: is this `1` for permanence special? + gd_add_mem_to_heap(size, addr, 1); +} + +/* 24AAE0 -> 24AB7C */ +void gdm_init(void *blockpool, u32 size) { + UNUSED u32 pad; + + imin("gdm_init"); + // Align downwards? + size = (size - 8) & ~7; + // Align to next double word boundry? + blockpool = (void *) (((uintptr_t) blockpool + 8) & ~7); + sMemBlockPoolBase = blockpool; + sMemBlockPoolSize = size; + sMemBlockPoolUsed = 0; + sAllocMemory = 0; + init_mem_block_lists(); + gd_reset_sfx(); + imout(); +} + +/** + * Initializes the Mario head demo + */ +void gdm_setup(void) { + UNUSED u32 pad; + + imin("gdm_setup"); + sYoshiSceneGrp = NULL; + sMarioSceneGrp = NULL; + sUpdateYoshiScene = FALSE; + sUpdateMarioScene = FALSE; + sCarGdDlNum = 0; + osViSetSpecialFeatures(OS_VI_GAMMA_OFF); + osCreateMesgQueue(&sGdDMAQueue, sGdMesgBuf, ARRAY_COUNT(sGdMesgBuf)); + gd_init(); + load_shapes2(); + reset_cur_dl_indices(); + setup_stars(); + imout(); +} + +/* 24AC18 -> 24AC2C */ +void stub_renderer_2(UNUSED u32 a0) { +} + +/* 24AC2C -> 24AC80; not called; orig name: Unknown8019C45C */ +void print_gdm_stats(void) { + stop_memtracker("total"); + gd_printf("\ngdm stats:\n"); + print_all_memtrackers(); + mem_stats(); + start_memtracker("total"); +} + +/* 24AC80 -> 24AD14; orig name: func_8019C4B0 */ +struct ObjView *make_view_withgrp(char *name, struct ObjGroup *grp) { + struct ObjView *view = make_view(name, (VIEW_DRAW | VIEW_ALLOC_ZBUF | VIEW_MOVEMENT), 1, 0, 0, 320, 240, grp); + UNUSED struct ObjGroup *viewgrp = make_group(2, grp, view); + + view->lights = gGdLightGroup; + return view; +} + +/* 24AD14 -> 24AEB8 */ +void gdm_maketestdl(s32 id) { + UNUSED u32 pad[3]; + + imin("gdm_maketestdl"); + switch (id) { + case 0: + sYoshiSceneView = make_view_withgrp("yoshi_scene", sYoshiSceneGrp); + break; + case 1: + reset_nets_and_gadgets(sYoshiSceneGrp); + break; + case 2: // normal Mario head + if (sMarioSceneGrp == NULL) { + load_mario_head(animate_mario_head_normal); + sMarioSceneGrp = gMarioFaceGrp; // gMarioFaceGrp set by load_mario_head + gd_setup_cursor(NULL); + } + sMSceneView = make_view_withgrp("mscene", sMarioSceneGrp); + break; + case 3: // game over Mario head + if (sMarioSceneGrp == NULL) { + load_mario_head(animate_mario_head_gameover); + sMarioSceneGrp = gMarioFaceGrp; + gd_setup_cursor(NULL); + } + sMSceneView = make_view_withgrp("mscene", sMarioSceneGrp); + break; + case 4: + sCarSceneView = make_view_withgrp("car_scene", sCarSceneGrp); + break; + case 5: + reset_nets_and_gadgets(sCarSceneGrp); + break; + default: + fatal_printf("gdm_maketestdl(): unknown dl"); + } + imout(); +} + +/* 24AEB8 -> 24AED0 */ +void set_time_scale(f32 factor) { + sTimeScaleFactor = factor; +} + +/* 24AED0 -> 24AF04 */ +void Unknown8019C840(void) { + gd_printf("\n"); + print_all_timers(); +} + +/** + * Runs every frame at V-blank. Handles input and updates state. + */ +void gd_vblank(void) { + gd_sfx_update(); + if (sUpdateYoshiScene) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, sYoshiSceneGrp); + } + if (sUpdateMarioScene) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, sMarioSceneGrp); + } + sUpdateYoshiScene = FALSE; + sUpdateMarioScene = FALSE; + gGdFrameBufNum ^= 1; + reset_cur_dl_indices(); + parse_p1_controller(); + update_cursor(); +} + +/** + * Copies the player1 controller data from p1cont to sGdContPads[0]. + */ +void gd_copy_p1_contpad(OSContPad *p1cont) { + u32 i; // 24 + u8 *src = (u8 *) p1cont; // 20 + u8 *dest = (u8 *) &sGdContPads[0]; // 1c + + for (i = 0; i < sizeof(OSContPad); i++) { + dest[i] = src[i]; + } + + if (p1cont->button & Z_TRIG) { + print_all_timers(); + } +} + +/* 24B058 -> 24B088; orig name: gd_sfx_to_play */ +s32 gd_sfx_to_play(void) { + return gd_new_sfx_to_play(); +} + +/* 24B088 -> 24B418 */ +Gfx *gdm_gettestdl(s32 id) { + struct GdObj *dobj; + struct GdDisplayList *gddl; + UNUSED u32 pad28[2]; + struct GdVec3f vec; + + start_timer("dlgen"); + vec.x = vec.y = vec.z = 0.0f; + gddl = NULL; + + switch (id) { + case 0: + if (sYoshiSceneView == NULL) { + fatal_printf("gdm_gettestdl(): DL number %d undefined", id); + } + //! @bug Code treats `sYoshiSceneView` as group; not called in game though + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, + (struct ObjGroup *) sYoshiSceneView); + dobj = d_use_obj("yoshi_scene"); + gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; + sUpdateYoshiScene = TRUE; + break; + case 1: + if (sYoshiSceneGrp == NULL) { + fatal_printf("gdm_gettestdl(): DL number %d undefined", id); + } + dobj = d_use_obj("yoshi_sh_l1"); + gddl = sGdDLArray[((struct ObjShape *) dobj)->dlNums[gGdFrameBufNum]]; + sUpdateYoshiScene = TRUE; + break; + case GD_SCENE_REGULAR_MARIO: + case GD_SCENE_DIZZY_MARIO: + setup_timers(); + update_view_and_dl(sMSceneView); + if (sHandView != NULL) { + update_view_and_dl(sHandView); + } + sCurrentGdDl = sMHeadMainDls[gGdFrameBufNum]; + gSPEndDisplayList(next_gfx()); + gddl = sCurrentGdDl; + sUpdateMarioScene = TRUE; + break; + case 4: + if (sCarSceneView == NULL) { + fatal_printf("gdm_gettestdl(): DL number %d undefined", id); + } + //! @bug Code treats `sCarSceneView` as group; not called in game though + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, + (struct ObjGroup *) sCarSceneView); + dobj = d_use_obj("car_scene"); + gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; + sUpdateCarScene = TRUE; + break; + case 5: + sActiveView = sScreenView; + set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + dobj = d_use_obj("testnet2"); + sCarGdDlNum = gd_startdisplist(8); + + if (sCarGdDlNum == 0) { + fatal_printf("no memory for car DL\n"); + } + apply_obj_draw_fn(dobj); + gd_enddlsplist_parent(); + gddl = sGdDLArray[sCarGdDlNum]; + sUpdateCarScene = TRUE; + break; + default: + fatal_printf("gdm_gettestdl(): %d out of range", id); + } + + if (gddl == NULL) { + fatal_printf("no display list"); + } + stop_timer("dlgen"); + return (void *) osVirtualToPhysical(gddl->gfx); +} + +/* 24B418 -> 24B4CC; not called */ +void gdm_getpos(s32 id, struct GdVec3f *dst) { + struct GdObj *dobj; // 1c + switch (id) { + case 5: + set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); + dobj = d_use_obj("testnet2"); + dst->x = ((struct ObjNet *) dobj)->worldPos.x; + dst->y = ((struct ObjNet *) dobj)->worldPos.y; + dst->z = ((struct ObjNet *) dobj)->worldPos.z; + break; + default: + fatal_printf("gdm_getpos(): %d out of range", id); + } + return; +} + +/** + * Clamps the coordinates so that they are within the active view + */ +static void clamp_coords_to_active_view(f32 *x, f32 *y) { + struct ObjView *view = sActiveView; + + if (*x < 0.0f) { + *x = 0.0f; + } else if (*x > view->lowerRight.x) { + *x = view->lowerRight.x; + } + + if (*y < 0.0f) { + *y = 0.0f; + } else if (*y > view->lowerRight.y) { + *y = view->lowerRight.y; + } +} + +/* 24B5A8 -> 24B5D4; orig name: func_8019CDD8 */ +void fatal_no_dl_mem(void) { + fatal_printf("Out of DL mem\n"); +} + +/* 24B5D4 -> 24B6AC */ +struct GdDisplayList *alloc_displaylist(u32 id) { + struct GdDisplayList *gdDl; + + gdDl = gd_malloc_perm(sizeof(struct GdDisplayList)); + if (gdDl == NULL) { + fatal_no_dl_mem(); + } + + gdDl->number = sGdDlCount++; + if (sGdDlCount >= MAX_GD_DLS) { + fatal_printf("alloc_displaylist() too many display lists %d (MAX %d)", sGdDlCount + 1, + MAX_GD_DLS); + } + sGdDLArray[gdDl->number] = gdDl; + gdDl->id = id; + return gdDl; +} + +/* 24B6AC -> 24B7A0; orig name: func_8019CEDC */ +void cpy_remaining_gddl(struct GdDisplayList *dst, struct GdDisplayList *src) { + dst->vtx = &DL_CURRENT_VTX(src); + dst->mtx = &DL_CURRENT_MTX(src); + dst->light = &DL_CURRENT_LIGHT(src); + dst->gfx = &DL_CURRENT_GFX(src); + dst->vp = &DL_CURRENT_VP(src); + dst->totalVtx = src->totalVtx - src->curVtxIdx; + dst->totalMtx = src->totalMtx - src->curMtxIdx; + dst->totalLights = src->totalLights - src->curLightIdx; + dst->totalGfx = src->totalGfx - src->curGfxIdx; + dst->totalVp = src->totalVp - src->curVpIdx; + dst->curVtxIdx = 0; + dst->curMtxIdx = 0; + dst->curLightIdx = 0; + dst->curGfxIdx = 0; + dst->curVpIdx = 0; +} + +/* 24B7A0 -> 24B7F8; orig name: func_8019CFD0 */ +struct GdDisplayList *create_child_gdl(s32 id, struct GdDisplayList *srcDl) { + struct GdDisplayList *newDl; + + newDl = alloc_displaylist(id); + newDl->parent = srcDl; + cpy_remaining_gddl(newDl, srcDl); +//! @bug No return statement, despite return value being used. +//! Goddard lucked out that `v0` return from alloc_displaylist() +//! is not overwriten, as that pointer is what should be returned +#ifdef AVOID_UB + return newDl; +#endif +} + +/* 24B7F8 -> 24BA48; orig name: func_8019D028 */ +struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 lights, s32 vps) { + struct GdDisplayList *dl; // 24 + + dl = alloc_displaylist(id); + dl->parent = NULL; + if (verts == 0) { + verts = 1; + } + dl->curVtxIdx = 0; + dl->totalVtx = verts; + if ((dl->vtx = gd_malloc_perm(verts * sizeof(Vtx))) == NULL) { + fatal_no_dl_mem(); + } + + if (mtxs == 0) { + mtxs = 1; + } + dl->curMtxIdx = 0; + dl->totalMtx = mtxs; + if ((dl->mtx = gd_malloc_perm(mtxs * sizeof(Mtx))) == NULL) { + fatal_no_dl_mem(); + } + + if (lights == 0) { + lights = 1; + } + dl->curLightIdx = 0; + dl->totalLights = lights; + if ((dl->light = gd_malloc_perm(lights * sizeof(Lights4))) == NULL) { + fatal_no_dl_mem(); + } + + if (gfxs == 0) { + gfxs = 1; + } + dl->curGfxIdx = 0; + dl->totalGfx = gfxs; + if ((dl->gfx = gd_malloc_perm(gfxs * sizeof(Gfx))) == NULL) { + fatal_no_dl_mem(); + } + + if (vps == 0) { + vps = 1; + } + dl->curVpIdx = 0; + dl->totalVp = vps; + if ((dl->vp = gd_malloc_perm(vps * sizeof(Vp))) == NULL) { + fatal_no_dl_mem(); + } + + dl->dlptr = NULL; + return dl; +} + +/* 24BA48 -> 24BABC; not called */ +void gd_rsp_init(void) { + gSPDisplayList(next_gfx(), osVirtualToPhysical(&gd_dl_rsp_init)); + gDPPipeSync(next_gfx()); +} + +/* 24BABC -> 24BB30; not called */ +void gd_rdp_init(void) { + gSPDisplayList(next_gfx(), osVirtualToPhysical(&gd_dl_rdp_init)); + gDPPipeSync(next_gfx()); +} + +/* 24BB30 -> 24BED8; orig name: func_8019D360 */ +void gd_draw_rect(f32 ulx, f32 uly, f32 lrx, f32 lry) { + clamp_coords_to_active_view(&ulx, &uly); + clamp_coords_to_active_view(&lrx, &lry); + + if (lrx > ulx && lry > uly) { + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), + (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), + (u32)(lry + sActiveView->upperLeft.y)); + } + + gDPPipeSync(next_gfx()); + gDPSetCycleType(next_gfx(), G_CYC_1CYCLE); + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2); +} + +/* 24BED8 -> 24CAC8; orig name: func_8019D708 */ +void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry) { + clamp_coords_to_active_view(&ulx, &uly); + clamp_coords_to_active_view(&lrx, &lry); + + if (lrx > ulx && lry > uly) { + gDPFillRectangle( + next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), (u32)(uly + sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + ulx + 5.0f), (u32)(lry + sActiveView->upperLeft.y)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + lrx - 5.0f), + (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), + (u32)(lry + sActiveView->upperLeft.y)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), + (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), + (u32)(uly + sActiveView->upperLeft.y + 5.0f)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), + (u32)(lry + sActiveView->upperLeft.y - 5.0f), + (u32)(sActiveView->upperLeft.x + lrx), (u32)(lry + sActiveView->upperLeft.y)); + } + + gDPPipeSync(next_gfx()); + gDPSetCycleType(next_gfx(), G_CYC_1CYCLE); + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2); +} + +/* 24CAC8 -> 24CDB4; orig name: func_8019E2F8 */ +void gd_dl_set_fill(struct GdColour *colour) { + u8 r, g, b; + + r = colour->r * 255.0f; + g = colour->g * 255.0f; + b = colour->b * 255.0f; + + gDPPipeSync(next_gfx()); + gDPSetCycleType(next_gfx(), G_CYC_FILL); + gDPSetRenderMode(next_gfx(), G_RM_OPA_SURF, G_RM_OPA_SURF2); + gDPSetFillColor(next_gfx(), GPACK_RGBA5551(r, g, b, 1) << 16 | GPACK_RGBA5551(r, g, b, 1)); +} + +/* 24CDB4 -> 24CE10; orig name: func_8019E5E4 */ +void gd_dl_set_zbuffer_area(void) { + gDPSetDepthImage(next_gfx(), GD_LOWER_24(sActiveView->parent->zbuf)); +} + +/* 24CE10 -> 24CF2C; orig name: func_8019E640 */ +void gd_set_color_fb(void) { + gDPSetColorImage(next_gfx(), G_IM_FMT_RGBA, G_IM_SIZ_16b, sActiveView->parent->lowerRight.x, + GD_LOWER_24(sActiveView->parent->colourBufs[gGdFrameBufNum])); +} + +/* 24CF2C -> 24CFCC; orig name: func_8019E75C */ +void reset_cur_dl_indices(void) { + sMHeadMainDls[gGdFrameBufNum]->curGfxIdx = 0; + sCurrentGdDl = sDynamicMainDls[gGdFrameBufNum]; + sCurrentGdDl->curVtxIdx = 0; + sCurrentGdDl->curMtxIdx = 0; + sCurrentGdDl->curLightIdx = 0; + sCurrentGdDl->curGfxIdx = 0; + sCurrentGdDl->curVpIdx = 0; +} + +/* 24CFCC -> 24D044; orig name: func_8019E7FC */ +void begin_gddl(s32 num) { + sCurrentGdDl = sGdDLArray[num]; + sCurrentGdDl->curVtxIdx = 0; + sCurrentGdDl->curMtxIdx = 0; + sCurrentGdDl->curLightIdx = 0; + sCurrentGdDl->curGfxIdx = 0; + sCurrentGdDl->curVpIdx = 0; +} + +/* 24D044 -> 24D064; orig name: func_8019E874 */ +void stash_current_gddl(void) { + sGdDlStash = sCurrentGdDl; +} + +/* 24D064 -> 24D084; orig name: func_8019E894 */ +void pop_gddl_stash(void) { + sCurrentGdDl = sGdDlStash; +} + +/* 24D084 -> 24D1D4 */ +s32 gd_startdisplist(s32 memarea) { + D_801BB018 = 0; + D_801BB01C = 1; + + switch (memarea) { + case 7: // Create new display list as a child of sStaticDl + sCurrentGdDl = create_child_gdl(0, sStaticDl); + break; + case 8: // Use the active view's display list + if (sActiveView->id > 2) { + fatal_printf("gd_startdisplist(): Too many views to display"); + } + + sCurrentGdDl = sViewDls[sActiveView->id][gGdFrameBufNum]; + cpy_remaining_gddl(sCurrentGdDl, sCurrentGdDl->parent); + break; + default: + fatal_printf("gd_startdisplist(): Unknown memory area"); + break; + } + gDPPipeSync(next_gfx()); + + return sCurrentGdDl->number; +} + +/* 24D1D4 -> 24D23C */ +void gd_enddlsplist(void) { + gDPPipeSync(next_gfx()); + gSPEndDisplayList(next_gfx()); +} + +/* 24D23C -> 24D39C; orig name: func_8019EA6C */ +s32 gd_enddlsplist_parent(void) { + s32 curDlIdx = 0; // 24 + + gDPPipeSync(next_gfx()); + gSPEndDisplayList(next_gfx()); + if (sCurrentGdDl->parent != NULL) { + sCurrentGdDl->parent->curVtxIdx = (sCurrentGdDl->parent->curVtxIdx + sCurrentGdDl->curVtxIdx); + sCurrentGdDl->parent->curMtxIdx = (sCurrentGdDl->parent->curMtxIdx + sCurrentGdDl->curMtxIdx); + sCurrentGdDl->parent->curLightIdx = + (sCurrentGdDl->parent->curLightIdx + sCurrentGdDl->curLightIdx); + sCurrentGdDl->parent->curGfxIdx = (sCurrentGdDl->parent->curGfxIdx + sCurrentGdDl->curGfxIdx); + sCurrentGdDl->parent->curVpIdx = (sCurrentGdDl->parent->curVpIdx + sCurrentGdDl->curVpIdx); + } + curDlIdx = sCurrentGdDl->curGfxIdx; + return curDlIdx; +} + +/* 24D39C -> 24D3D8 */ +void Unknown8019EBCC(s32 num, uintptr_t gfxptr) { + sGdDLArray[num]->gfx = (Gfx *) (GD_LOWER_24(gfxptr) + D_801BAF28); +} + +/* 24D3D8 -> 24D458; orig name: func_8019EC08 */ +u32 new_gddl_from(Gfx *dl, UNUSED s32 arg1) { + struct GdDisplayList *gddl; + + gddl = new_gd_dl(0, 0, 0, 0, 0, 0); + gddl->gfx = (Gfx *) (GD_LOWER_24((uintptr_t) dl) + D_801BAF28); + return gddl->number; +} + +/* 24D458 -> 24D4C4 */ +u32 Unknown8019EC88(Gfx *dl, UNUSED s32 arg1) { + struct GdDisplayList *gddl; + + gddl = new_gd_dl(0, 0, 0, 0, 0, 0); + gddl->gfx = dl; + return gddl->number; +} + +/* 24D4C4 -> 24D63C; orig name: func_8019ECF4 */ +void mat4_to_mtx(Mat4f *src, Mtx *dst) { +#ifndef GBI_FLOATS + s32 i; // 14 + s32 j; // 10 + s32 w1; + s32 w2; + s32 *mtxInt = (s32 *) dst->m[0]; // s32 part + s32 *mtxFrc = (s32 *) dst->m[2]; // frac part + + for (i = 0; i < 4; i++) { + for (j = 0; j < 2; j++) { + w1 = (s32)((*src)[i][j * 2] * 65536.0f); + w2 = (s32)((*src)[i][j * 2 + 1] * 65536.0f); + *mtxInt = MTX_INTPART_PACK(w1, w2); + mtxInt++; + *mtxFrc = MTX_FRACPART_PACK(w1, w2); + mtxFrc++; + } + } +#else + guMtxF2L(*src, dst); +#endif +} + +/** + * Adds a display list operation that multiplies the current matrix with `mtx`. + */ +void gd_dl_mul_matrix(Mat4f *mtx) { + mat4_to_mtx(mtx, &DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), sMtxParamType | G_MTX_MUL | G_MTX_NOPUSH); + next_mtx(); +} + +/** + * Adds a display list operation that replaces the current matrix with `mtx`. + */ +void gd_dl_load_matrix(Mat4f *mtx) { + mat4_to_mtx(mtx, &DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), + sMtxParamType | G_MTX_LOAD | G_MTX_NOPUSH); + next_mtx(); +} + +/** + * Adds a display list operation that replaces the current matrix with the + * identity matrix. + */ +void gd_dl_load_identity_matrix(void) { + gSPMatrix(next_gfx(), osVirtualToPhysical(&sIdnMtx), sMtxParamType | G_MTX_LOAD | G_MTX_NOPUSH); +} + +/** + * Adds a display list operation that pushes the current matrix onto the matrix + * stack. + */ +void gd_dl_push_matrix(void) { + gSPMatrix(next_gfx(), osVirtualToPhysical(&sIdnMtx), sMtxParamType | G_MTX_MUL | G_MTX_PUSH); +} + +/** + * Adds a display list operation that pops a matrix from the matrix stack. + */ +void gd_dl_pop_matrix(void) { + gSPPopMatrix(next_gfx(), sMtxParamType); +} + +/** + * Adds a display list operation that translates the current matrix by `x`, `y`, and `z`. + */ +void gd_dl_mul_trans_matrix(f32 x, f32 y, f32 z) { + guTranslate(&DL_CURRENT_MTX(sCurrentGdDl), x, y, z); + gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), sMtxParamType | G_MTX_MUL | G_MTX_NOPUSH); + next_mtx(); +} + +/** + * Adds a display list operation that loads a translation matrix. + */ +void gd_dl_load_trans_matrix(f32 x, f32 y, f32 z) { + guTranslate(&DL_CURRENT_MTX(sCurrentGdDl), x, y, z); + gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), + sMtxParamType | G_MTX_LOAD | G_MTX_NOPUSH); + next_mtx(); +} + +/** + * Adds a display list operation that scales the current matrix by `x`, `y`, and `z`. + */ +void gd_dl_scale(f32 x, f32 y, f32 z) { + Mat4f mtx; + struct GdVec3f vec; + + vec.x = x; + vec.y = y; + vec.z = z; + gd_set_identity_mat4(&mtx); + gd_scale_mat4f_by_vec3f(&mtx, &vec); + gd_dl_mul_matrix(&mtx); +} + +/* 24DA94 -> 24DAE8 */ +void func_8019F2C4(f32 arg0, s8 arg1) { + Mat4f mtx; // 18 + + gd_set_identity_mat4(&mtx); + gd_absrot_mat4(&mtx, arg1 - 120, -arg0); + gd_dl_mul_matrix(&mtx); +} + +/* 24DAE8 -> 24E1A8 */ +void gd_dl_lookat(struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + LookAt *lookat; + + arg7 *= RAD_PER_DEG; + + gd_mat4f_lookat(&cam->unkE8, arg1, arg2, arg3, arg4, arg5, arg6, gd_sin_d(arg7), gd_cos_d(arg7), + 0.0f); + + mat4_to_mtx(&cam->unkE8, &DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), + G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); + + /* col colc dir + 0 1 2 3 4 5 6 7 8 9 10 11 + { { 0, 0, 0}, _, {0, 0, 0}, _, {0, 0, 0}, _} + 16 17 18 19 20 21 22 23 24 25 26 27 + { { 0, 0, 0}, _, {0, 0, 0}, _, {0, 0, 0}, _} + */ + lookat = &D_801BE7D0[gGdFrameBufNum]; + + lookat->l[0].l.dir[0] = LOOKAT_PACK(cam->unkE8[0][0]); + lookat->l[0].l.dir[1] = LOOKAT_PACK(cam->unkE8[1][0]); + lookat->l[0].l.dir[2] = LOOKAT_PACK(cam->unkE8[2][0]); + + lookat->l[1].l.dir[0] = LOOKAT_PACK(cam->unkE8[0][1]); + lookat->l[1].l.dir[1] = LOOKAT_PACK(cam->unkE8[1][1]); + lookat->l[1].l.dir[2] = LOOKAT_PACK(cam->unkE8[2][1]); + + lookat->l[0].l.col[0] = 0; + lookat->l[0].l.col[1] = 0; + lookat->l[0].l.col[2] = 0; + lookat->l[0].l.pad1 = 0; + lookat->l[0].l.colc[0] = 0; + lookat->l[0].l.colc[1] = 0; + lookat->l[0].l.colc[2] = 0; + lookat->l[0].l.pad2 = 0; + lookat->l[1].l.col[0] = 0; + lookat->l[1].l.col[1] = 0x80; + lookat->l[1].l.col[2] = 0; + lookat->l[1].l.pad1 = 0; + lookat->l[1].l.colc[0] = 0; + lookat->l[1].l.colc[1] = 0x80; + lookat->l[1].l.colc[2] = 0; + lookat->l[1].l.pad2 = 0; + + lookat = &D_801BE790[0]; + lookat->l[0].l.dir[0] = 1; + lookat->l[0].l.dir[1] = 0; + lookat->l[0].l.dir[2] = 0; + + lookat->l[1].l.dir[0] = 0; + lookat->l[1].l.dir[1] = 1; + lookat->l[1].l.dir[2] = 0; + + lookat->l[0].l.col[0] = 0; + lookat->l[0].l.col[1] = 0; + lookat->l[0].l.col[2] = 0; + lookat->l[0].l.pad1 = 0; + lookat->l[0].l.colc[0] = 0; + lookat->l[0].l.colc[1] = 0; + lookat->l[0].l.colc[2] = 0; + lookat->l[0].l.pad2 = 0; + lookat->l[1].l.col[0] = 0; + lookat->l[1].l.col[1] = 0x80; + lookat->l[1].l.col[2] = 0; + lookat->l[1].l.pad1 = 0; + lookat->l[1].l.colc[0] = 0; + lookat->l[1].l.colc[1] = 0x80; + lookat->l[1].l.colc[2] = 0; + lookat->l[1].l.pad2 = 0; + + gSPLookAt(next_gfx(), osVirtualToPhysical(&D_801BE7D0[gGdFrameBufNum])); + next_mtx(); +} + +/* 24E1A8 -> 24E230; orig name: func_8019F9D8 */ +void check_tri_display(s32 vtxcount) { + D_801A86C0 = sCurrentGdDl->curVtxIdx; + D_801BB0B4 = 0; + if (vtxcount != 3) { + fatal_printf("cant display no tris\n"); + } + if (D_801BB018 != 0 || D_801BB01C != 0) { + ; + } +} + +/** + * Adds a vertex to the current display list. Returns a pointer to the vertex if + * it is new, or NULL if the vertex already exists. + */ +Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha) { + Vtx *vtx = NULL; + s32 i; + + // Add the vertex index to the buffer if it doesn't already exist + for (i = sVertexBufStartIndex; i < (sVertexBufStartIndex + sVertexBufCount); i++) { + // the ifs need to be separate to match... + if (sCurrentGdDl->vtx[i].n.ob[0] == (s16) x) { + if (sCurrentGdDl->vtx[i].n.ob[1] == (s16) y) { + if (sCurrentGdDl->vtx[i].n.ob[2] == (s16) z) { + sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16) i; + return NULL; + } + } + } + } + + sVertexBufCount++; + sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16) sCurrentGdDl->curVtxIdx; + + DL_CURRENT_VTX(sCurrentGdDl).n.ob[0] = (s16) x; + DL_CURRENT_VTX(sCurrentGdDl).n.ob[1] = (s16) y; + DL_CURRENT_VTX(sCurrentGdDl).n.ob[2] = (s16) z; + DL_CURRENT_VTX(sCurrentGdDl).n.flag = 0; + DL_CURRENT_VTX(sCurrentGdDl).n.tc[0] = sVtxCvrtTCBuf[0]; + DL_CURRENT_VTX(sCurrentGdDl).n.tc[1] = sVtxCvrtTCBuf[1]; + DL_CURRENT_VTX(sCurrentGdDl).n.n[0] = sVtxCvrtNormBuf[0]; + DL_CURRENT_VTX(sCurrentGdDl).n.n[1] = sVtxCvrtNormBuf[1]; + DL_CURRENT_VTX(sCurrentGdDl).n.n[2] = sVtxCvrtNormBuf[2]; + DL_CURRENT_VTX(sCurrentGdDl).n.a = (u8)(alpha * 255.0f); + + vtx = &DL_CURRENT_VTX(sCurrentGdDl); + next_vtx(); + return vtx; +} + +/* 24E6C0 -> 24E724 */ +void func_8019FEF0(void) { + sTriangleBufCount++; + if (sVertexBufCount >= 12) { + gd_dl_flush_vertices(); + func_801A0038(); + } + D_801BB018 = 0; +} + +/** + * Adds a triange to the current display list. + */ +void gd_dl_make_triangle(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3) { + Vtx *vtx; + + vtx = &DL_CURRENT_VTX(sCurrentGdDl); + gd_dl_make_vertex(x1, y1, z1, 1.0f); + gd_dl_make_vertex(x2, y2, z2, 1.0f); + gd_dl_make_vertex(x3, y3, z3, 1.0f); + + gSPVertex(next_gfx(), osVirtualToPhysical(vtx), 3, 0); + gSP1Triangle(next_gfx(), 0, 1, 2, 0); +} + +/* 24E808 -> 24E840 */ +void func_801A0038(void) { + sVertexBufCount = 0; + sTriangleBufCount = 0; + sVertexBufStartIndex = sCurrentGdDl->curVtxIdx; +} + +/* 24E840 -> 24E9BC */ +void gd_dl_flush_vertices(void) { + UNUSED u32 pad; + s32 i; + UNUSED s32 startvtx = sVertexBufStartIndex; + + if (sVertexBufCount != 0) { + // load vertex data + gSPVertex(next_gfx(), osVirtualToPhysical(&sCurrentGdDl->vtx[sVertexBufStartIndex]), sVertexBufCount, 0); + // load triangle data + for (i = 0; i < sTriangleBufCount; i++) { + gSP1Triangle(next_gfx(), + sTriangleBuf[i][0] - sVertexBufStartIndex, + sTriangleBuf[i][1] - sVertexBufStartIndex, + sTriangleBuf[i][2] - sVertexBufStartIndex, + 0); + } + } + func_801A0038(); +} + +/** + * Unused - called by func_801A520C + */ +static void func_801A01EC(void) { + if (D_801BE8B0.validCount >= D_801BE8B0.msgCount) { + osRecvMesg(&D_801BE8B0, &sGdDMACompleteMsg, OS_MESG_BLOCK); + } + osRecvMesg(&D_801BE8B0, &sGdDMACompleteMsg, OS_MESG_BLOCK); +} + +/** + * Unused - called by func_801A520C + */ +static void func_801A025C(void) { + gGdFrameBufNum ^= 1; + osViSwapBuffer(sScreenView->parent->colourBufs[gGdFrameBufNum]); +} + +/* 24EA88 -> 24EAF4 */ +void set_render_alpha(f32 alpha) { + sAlpha = alpha * 255.0f; + update_render_mode(); +} + +/* 24EAF4 -> 24EB0C */ +// light id? +void set_light_id(s32 index) { + sLightId = index; +} + +/* 24EB0C -> 24EB24; orig name: func_801A033C */ +void set_light_num(s32 n) { + sNumLights = n; +} + +/* 24EB24 -> 24EC18 */ +s32 create_mtl_gddl(UNUSED s32 mtlType) { + s32 dlnum; // 24 + struct GdColour blue; // 18 + + blue.r = 0.0f; + blue.g = 0.0f; + blue.b = 1.0f; + dlnum = gd_startdisplist(7); + gd_dl_material_lighting(dlnum, &blue, GD_MTL_TEX_OFF); + gd_enddlsplist_parent(); + sCurrentGdDl->totalVtx = sCurrentGdDl->curVtxIdx; + sCurrentGdDl->totalMtx = sCurrentGdDl->curMtxIdx; + sCurrentGdDl->totalLights = sCurrentGdDl->curLightIdx; + sCurrentGdDl->totalGfx = sCurrentGdDl->curGfxIdx; + sCurrentGdDl->totalVp = sCurrentGdDl->curVpIdx; + return dlnum; +} + +/* 24EC18 -> 24EC48; orig name: func_801A0448 */ +void branch_to_gddl(s32 dlNum) { + branch_cur_dl_to_num(dlNum); +} + +/* 24EC48 -> 24F03C */ +// phong shading function? +void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array + struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, + struct GdVec3f *arg4, // vector to light source? + struct GdColour *colour // light color +) { + UNUSED u32 pad2[24]; + Hilite *hilite; // 4c + struct GdVec3f sp40; + f32 sp3C; // magnitude of sp40 + f32 sp38; + f32 sp34; + UNUSED u32 pad[6]; + + sp38 = 32.0f; // x scale factor? + sp34 = 32.0f; // y scale factor? + if (idx >= 0xc8) { + fatal_printf("too many hilites"); + } + hilite = &sHilites[idx]; + + gDPSetPrimColor(next_gfx(), 0, 0, (s32)(colour->r * 255.0f), (s32)(colour->g * 255.0f), + (s32)(colour->b * 255.0f), 255); + sp40.z = cam->unkE8[0][2] + arg4->x; + sp40.y = cam->unkE8[1][2] + arg4->y; + sp40.x = cam->unkE8[2][2] + arg4->z; + sp3C = sqrtf(SQ(sp40.z) + SQ(sp40.y) + SQ(sp40.x)); + if (sp3C > 0.1) { + sp3C = 1.0 / sp3C; //? 1.0f + sp40.z *= sp3C; + sp40.y *= sp3C; + sp40.x *= sp3C; + + hilite->h.x1 = + (((sp40.z * cam->unkE8[0][0]) + (sp40.y * cam->unkE8[1][0]) + (sp40.x * cam->unkE8[2][0])) + * sp38 * 2.0f) + + (sp38 * 4.0f); + hilite->h.y1 = + (((sp40.z * cam->unkE8[0][1]) + (sp40.y * cam->unkE8[1][1]) + (sp40.x * cam->unkE8[2][1])) + * sp34 * 2.0f) + + (sp34 * 4.0f); + } else { + hilite->h.x1 = sp38 * 2.0f; + hilite->h.y1 = sp34 * 2.0f; + } +} + +/** + * Adds some display list commands that perform lighting for a material + */ +s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { + UNUSED u32 pad60[2]; + s32 i; + s32 numLights = sNumLights; + s32 scaledColours[3]; + s32 lightDir[3]; + + if (id > 0) { + begin_gddl(id); + } + switch (material) { + case GD_MTL_TEX_OFF: + gddl_is_loading_stub_dl(FALSE); + gddl_is_loading_stub_dl(FALSE); + gddl_is_loading_stub_dl(FALSE); + gddl_is_loading_stub_dl(FALSE); + gddl_is_loading_shine_dl(FALSE); + gddl_is_loading_shine_dl(FALSE); + gddl_is_loading_shine_dl(FALSE); + gddl_is_loading_shine_dl(FALSE); + numLights = NUMLIGHTS_2; + break; + case GD_MTL_STUB_DL: + gddl_is_loading_stub_dl(TRUE); + break; + case GD_MTL_SHINE_DL: + gddl_is_loading_shine_dl(TRUE); + if (id >= 200) { + fatal_printf("too many hilites"); + } + gDPSetHilite1Tile(next_gfx(), G_TX_RENDERTILE, &sHilites[id], 32, 32); + break; + case GD_MTL_BREAK: + break; + default: + gddl_is_loading_stub_dl(FALSE); + gddl_is_loading_shine_dl(FALSE); + + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[0] = colour->r * 255.0f; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[1] = colour->g * 255.0f; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[2] = colour->b * 255.0f; + + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[0] = DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[1] = DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[2] = DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[2]; + // 801A0D04 + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.col[0] = 0; + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.col[1] = 0; + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.col[2] = 0; + + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.colc[0] = 0; + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.colc[1] = 0; + DL_CURRENT_LIGHT(sCurrentGdDl).l[0].l.colc[2] = 0; + + gSPNumLights(next_gfx(), NUMLIGHTS_1); + gSPLight(next_gfx(), osVirtualToPhysical(&DL_CURRENT_LIGHT(sCurrentGdDl).l), LIGHT_1); + gSPLight(next_gfx(), osVirtualToPhysical(&DL_CURRENT_LIGHT(sCurrentGdDl).a), LIGHT_2); + next_light(); + if (id > 0) { + gd_enddlsplist(); + } + return 0; + break; + } + // L801A0EF4 + scaledColours[0] = (s32)(colour->r * sAmbScaleColour.r * 255.0f); + scaledColours[1] = (s32)(colour->g * sAmbScaleColour.g * 255.0f); + scaledColours[2] = (s32)(colour->b * sAmbScaleColour.b * 255.0f); + // 801A0FE4 + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[0] = scaledColours[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[1] = scaledColours[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.col[2] = scaledColours[2]; + // 801A1068 + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[0] = scaledColours[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[1] = scaledColours[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).a.l.colc[2] = scaledColours[2]; + // 801A10EC + gSPNumLights(next_gfx(), numLights); + for (i = 0; i < numLights; i++) { // L801A1134 + scaledColours[0] = colour->r * sLightScaleColours[i].r * 255.0f; + scaledColours[1] = colour->g * sLightScaleColours[i].g * 255.0f; + scaledColours[2] = colour->b * sLightScaleColours[i].b * 255.0f; + // 801A1260 + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.col[0] = scaledColours[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.col[1] = scaledColours[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.col[2] = scaledColours[2]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.colc[0] = scaledColours[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.colc[1] = scaledColours[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.colc[2] = scaledColours[2]; + + // 801A13B0 + lightDir[0] = (s8)sLightDirections[i].x; + lightDir[1] = (s8)sLightDirections[i].y; + lightDir[2] = (s8)sLightDirections[i].z; + // 801A141C + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.dir[0] = lightDir[0]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.dir[1] = lightDir[1]; + DL_CURRENT_LIGHT(sCurrentGdDl).l[i].l.dir[2] = lightDir[2]; + // 801A14C4 + gSPLight(next_gfx(), osVirtualToPhysical(&DL_CURRENT_LIGHT(sCurrentGdDl).l[i]), i + 1); + } + // L801A1550 + gSPLight(next_gfx(), osVirtualToPhysical(&DL_CURRENT_LIGHT(sCurrentGdDl)), i + 1); + next_light(); + gd_enddlsplist(); + return 0; +} + +/* 24FDB8 -> 24FE94; orig name: func_801A15E8; only from faces? */ +void set_Vtx_norm_buf_1(struct GdVec3f *norm) { + sVtxCvrtNormBuf[0] = (s8)(norm->x * 127.0f); + sVtxCvrtNormBuf[1] = (s8)(norm->y * 127.0f); + sVtxCvrtNormBuf[2] = (s8)(norm->z * 127.0f); +} + +/* 24FE94 -> 24FF80; orig name: func_801A16C4; only from verts? */ +void set_Vtx_norm_buf_2(struct GdVec3f *norm) { + sVtxCvrtNormBuf[0] = (s8)(norm->x * 127.0f); + sVtxCvrtNormBuf[1] = (s8)(norm->y * 127.0f); + sVtxCvrtNormBuf[2] = (s8)(norm->z * 127.0f); + + //? are these stub functions? + return; // @ 801A17A0 + return; // @ 801A17A8 +} + +/* 24FF80 -> 24FFDC; orig name: func_801A17B0 */ +void set_gd_mtx_parameters(s32 params) { + switch (params) { + case G_MTX_PROJECTION | G_MTX_MUL | G_MTX_PUSH: + sMtxParamType = G_MTX_PROJECTION; + break; + case G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH: + sMtxParamType = G_MTX_MODELVIEW; + break; + } +} + +/** + * Adds a viewport to the current display list based on the current active view + */ +static void gd_dl_viewport(void) { + Vp *vp; + + vp = &DL_CURRENT_VP(sCurrentGdDl); + + vp->vp.vscale[0] = (s16)(sActiveView->lowerRight.x * 2.0f); // x scale + vp->vp.vscale[1] = (s16)(sActiveView->lowerRight.y * 2.0f); // y scale + vp->vp.vscale[2] = 0x1FF; // z scale + vp->vp.vscale[3] = 0x000; + + vp->vp.vtrans[0] = (s16)((sActiveView->upperLeft.x * 4.0f) + (sActiveView->lowerRight.x * 2.0f)); // x offset + vp->vp.vtrans[1] = (s16)((sActiveView->upperLeft.y * 4.0f) + (sActiveView->lowerRight.y * 2.0f)); // y offset + vp->vp.vtrans[2] = 0x1FF; // z offset + vp->vp.vtrans[3] = 0x000; + + gSPViewport(next_gfx(), osVirtualToPhysical(vp)); + next_vp(); +} + +/* 2501D0 -> 250300 */ +static void update_render_mode(void) { + if ((sActiveView->flags & VIEW_ALLOC_ZBUF) != 0) { + if (sAlpha != 0xff) { + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2); + } else { + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2); + } + } else { + if (sAlpha != 0xff) { + gDPSetRenderMode(next_gfx(), G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2); + } else { + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2); + } + } +} + +/* 250300 -> 250640 */ +void Unknown801A1B30(void) { + gDPPipeSync(next_gfx()); + gd_set_color_fb(); + gd_dl_set_fill(&sActiveView->colour); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x), (u32)(sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + sActiveView->lowerRight.x - 1.0f), + (u32)(sActiveView->upperLeft.y + sActiveView->lowerRight.y - 1.0f)); + gDPPipeSync(next_gfx()); +} + +/* 250640 -> 250AE0 */ +void Unknown801A1E70(void) { + gDPPipeSync(next_gfx()); + gDPSetCycleType(next_gfx(), G_CYC_FILL); + gDPSetRenderMode(next_gfx(), G_RM_OPA_SURF, G_RM_OPA_SURF2); + gd_dl_set_zbuffer_area(); + gDPSetColorImage(next_gfx(), G_IM_FMT_RGBA, G_IM_SIZ_16b, sActiveView->parent->lowerRight.x, + GD_LOWER_24(sActiveView->parent->zbuf)); + gDPSetFillColor(next_gfx(), GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x), (u32)(sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + sActiveView->lowerRight.x - 1.0f), + (u32)(sActiveView->upperLeft.y + sActiveView->lowerRight.y - 1.0f)); + gDPPipeSync(next_gfx()); + gd_set_color_fb(); +} + +/* 250AE0 -> 250B30; orig name: func_801A2310 */ +void gd_set_one_cycle(void) { + gDPSetCycleType(next_gfx(), G_CYC_1CYCLE); + update_render_mode(); +} + +/* 250B30 -> 250B44 */ +void stub_renderer_3(void) { + UNUSED u32 pad[4]; +} + +/* 250B44 -> 250B58 */ +void gddl_is_loading_stub_dl(UNUSED s32 dlLoad) { +} + +/* 250B58 -> 250C18 */ +void gddl_is_loading_shine_dl(s32 dlLoad) { + if (dlLoad) { + gSPDisplayList(next_gfx(), osVirtualToPhysical(&gd_dl_mario_face_shine)); + } else { + gSPTexture(next_gfx(), 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_OFF); + gDPSetCombineMode(next_gfx(), G_CC_SHADE, G_CC_SHADE); + } +} + +/* 250C18 -> 251014; orig name: func_801A2448 */ +void start_view_dl(struct ObjView *view) { + f32 ulx; + f32 uly; + f32 lrx; + f32 lry; + + if (view->upperLeft.x < view->parent->upperLeft.x) { + ulx = view->parent->upperLeft.x; + } else { + ulx = view->upperLeft.x; + } + + if (view->upperLeft.x + view->lowerRight.x + > view->parent->upperLeft.x + view->parent->lowerRight.x) { + lrx = view->parent->upperLeft.x + view->parent->lowerRight.x; + } else { + lrx = view->upperLeft.x + view->lowerRight.x; + } + + if (view->upperLeft.y < view->parent->upperLeft.y) { + uly = view->parent->upperLeft.y; + } else { + uly = view->upperLeft.y; + } + + if (view->upperLeft.y + view->lowerRight.y + > view->parent->upperLeft.y + view->parent->lowerRight.y) { + lry = view->parent->upperLeft.y + view->parent->lowerRight.y; + } else { + lry = view->upperLeft.y + view->lowerRight.y; + } + + if (ulx >= lrx) { + ulx = lrx - 1.0f; + } + if (uly >= lry) { + uly = lry - 1.0f; + } + + gDPSetScissor(next_gfx(), G_SC_NON_INTERLACE, ulx, uly, lrx, lry); + gSPClearGeometryMode(next_gfx(), 0xFFFFFFFF); + gSPSetGeometryMode(next_gfx(), G_LIGHTING | G_CULL_BACK | G_SHADING_SMOOTH | G_SHADE); + if (view->flags & VIEW_ALLOC_ZBUF) { + gSPSetGeometryMode(next_gfx(), G_ZBUFFER); + } + gd_dl_viewport(); + update_render_mode(); + gDPPipeSync(next_gfx()); +} + +/* 251014 -> 251A1C; orig name: func_801A2844 */ +void parse_p1_controller(void) { + u32 i; + struct GdControl *gdctrl = &gGdCtrl; + OSContPad *currInputs; + OSContPad *prevInputs; + + // Copy current inputs to previous + u8 *src = (u8 *) gdctrl; + u8 *dest = (u8 *) gdctrl->prevFrame; + for (i = 0; i < sizeof(struct GdControl); i++) { + *dest++ = *src++; + } + + gdctrl->unk50 = gdctrl->unk4C = gdctrl->dup = gdctrl->ddown = 0; + + currInputs = &sGdContPads[0]; + prevInputs = &sPrevFrameCont[0]; + // stick values + gdctrl->stickXf = currInputs->stick_x; + gdctrl->stickYf = currInputs->stick_y; + gdctrl->stickDeltaX = gdctrl->stickX; + gdctrl->stickDeltaY = gdctrl->stickY; + gdctrl->stickX = currInputs->stick_x; + gdctrl->stickY = currInputs->stick_y; + gdctrl->stickDeltaX -= gdctrl->stickX; + gdctrl->stickDeltaY -= gdctrl->stickY; + // button values (as bools) + gdctrl->trgL = (currInputs->button & L_TRIG) != 0; + gdctrl->trgR = (currInputs->button & R_TRIG) != 0; + gdctrl->btnA = (currInputs->button & A_BUTTON) != 0; + gdctrl->btnB = (currInputs->button & B_BUTTON) != 0; + gdctrl->cleft = (currInputs->button & L_CBUTTONS) != 0; + gdctrl->cright = (currInputs->button & R_CBUTTONS) != 0; + gdctrl->cup = (currInputs->button & U_CBUTTONS) != 0; + gdctrl->cdown = (currInputs->button & D_CBUTTONS) != 0; + // but not these buttons?? + gdctrl->dleft = currInputs->button & L_JPAD; + gdctrl->dright = currInputs->button & R_JPAD; + gdctrl->dup = currInputs->button & U_JPAD; + gdctrl->ddown = currInputs->button & D_JPAD; + + if (gdctrl->btnA && !gdctrl->dragging) { + gdctrl->startedDragging = TRUE; + } else { + gdctrl->startedDragging = FALSE; + } + // toggle if A is pressed? or is this just some seed for an rng? + gdctrl->dragging = gdctrl->btnA; + gdctrl->unkD8b20 = gdctrl->unkD8b40 = FALSE; + gdctrl->AbtnPressWait = FALSE; + + if (gdctrl->startedDragging) { + gdctrl->dragStartX = gdctrl->csrX; + gdctrl->dragStartY = gdctrl->csrY; + + if (gdctrl->currFrame - gdctrl->dragStartFrame < 10) { + gdctrl->AbtnPressWait = TRUE; + } + } + + if (gdctrl->dragging) { + gdctrl->dragStartFrame = gdctrl->currFrame; + } + gdctrl->currFrame++; + + if (currInputs->button & START_BUTTON && !(prevInputs->button & START_BUTTON)) { + gdctrl->newStartPress ^= 1; + } + + if (currInputs->button & Z_TRIG && !(prevInputs->button & Z_TRIG)) { + sCurrDebugViewIndex++; + } + + if (sCurrDebugViewIndex > sDebugViewsCount) { + sCurrDebugViewIndex = 0; + } else if (sCurrDebugViewIndex < 0) { + sCurrDebugViewIndex = sDebugViewsCount; + } + + if (sCurrDebugViewIndex) { + deactivate_timing(); + } else { + activate_timing(); + } + + for (i = 0; ((s32) i) < sDebugViewsCount; i++) { + sDebugViews[i]->flags &= ~VIEW_UPDATE; + } + + if (sCurrDebugViewIndex) { + sDebugViews[sCurrDebugViewIndex - 1]->flags |= VIEW_UPDATE; + } + + // deadzone checks + if (ABS(gdctrl->stickX) >= 6) { + gdctrl->csrX += gdctrl->stickX * 0.1; + } + if (ABS(gdctrl->stickY) >= 6) { + gdctrl->csrY -= gdctrl->stickY * 0.1; + } + + // clamp cursor position within screen view bounds + if (gdctrl->csrX < sScreenView->parent->upperLeft.x + 16.0f) { + gdctrl->csrX = sScreenView->parent->upperLeft.x + 16.0f; + } + if (gdctrl->csrX > sScreenView->parent->upperLeft.x + sScreenView->parent->lowerRight.x - 48.0f) { + gdctrl->csrX = sScreenView->parent->upperLeft.x + sScreenView->parent->lowerRight.x - 48.0f; + } + if (gdctrl->csrY < sScreenView->parent->upperLeft.y + 16.0f) { + gdctrl->csrY = sScreenView->parent->upperLeft.y + 16.0f; + } + if (gdctrl->csrY > sScreenView->parent->upperLeft.y + sScreenView->parent->lowerRight.y - 32.0f) { + gdctrl->csrY = sScreenView->parent->upperLeft.y + sScreenView->parent->lowerRight.y - 32.0f; + } + + for (i = 0; i < sizeof(OSContPad); i++) { + ((u8 *) prevInputs)[i] = ((u8 *) currInputs)[i]; + } +} + +void stub_renderer_4(f32 arg0) { + return; + + // dead code + if (D_801BD768.x * D_801A86CC.x + arg0 * 2.0f > 160.0) + { + func_801A3370(D_801BD758.x - D_801BD768.x, -20.0f, 0.0f); + D_801BD768.x = D_801BD758.x; + } +} + +/** + * Unused + */ +void Unknown801A32F4(s32 arg0) { + D_801BD774 = GD_LOWER_24(arg0) + D_801BAF28; +} + +/* 251AF4 -> 251B40 */ +void func_801A3324(f32 x, f32 y, f32 z) { + D_801BD768.x = x; + D_801BD768.y = y; + D_801BD768.z = z; + D_801BD758.x = x; + D_801BD758.y = y; + D_801BD758.z = z; +} + +/* 251B40 -> 251BC8 */ +void func_801A3370(f32 x, f32 y, f32 z) { + gd_dl_mul_trans_matrix(x, y, z); + D_801BD768.x += x; + D_801BD768.y += y; + D_801BD768.z += z; +} + +/** + * Unused + */ +void Unknown801A33F8(f32 x, f32 y, f32 z) { + gd_dl_mul_trans_matrix(x - D_801BD768.x, y - D_801BD768.y, z - D_801BD768.z); + + D_801BD768.x = x; + D_801BD768.y = y; + D_801BD768.z = z; +} + +/** + * Unused + */ +void Unknown801A347C(f32 x, f32 y, f32 z) { + D_801A86CC.x = x; + D_801A86CC.y = y; + D_801A86CC.z = z; + gd_dl_scale(x, y, z); +} + +/* 251CB0 -> 251D44; orig name: func_801A34E0 */ +void border_active_view(void) { + if (sActiveView->flags & VIEW_BORDERED) { + gd_dl_set_fill(gd_get_colour(1)); + gd_draw_border_rect(0.0f, 0.0f, (sActiveView->lowerRight.x - 1.0f), + (sActiveView->lowerRight.y - 1.0f)); + } +} + +/* 251D44 -> 251DAC */ +void gd_shading(s32 model) { + switch (model) { + case 9: + break; + case 10: + break; + default: + fatal_printf("gd_shading(): Unknown shading model"); + } +} + +/* 251DAC -> 251E18 */ +s32 gd_getproperty(s32 prop, UNUSED void *arg1) { + s32 got = FALSE; + + switch (prop) { + case 3: + got = TRUE; + break; + default: + fatal_printf("gd_getproperty(): Unkown property"); + } + + return got; +} + +/* 251E18 -> 2522B0 */ +void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { + UNUSED f32 sp3C = 1.0f; + s32 parm; + + switch (prop) { + case GD_PROP_LIGHTING: + parm = (s32) f1; + switch (parm) { + case 1: + gSPSetGeometryMode(next_gfx(), G_LIGHTING); + break; + case 0: + gSPClearGeometryMode(next_gfx(), G_LIGHTING); + break; + } + break; + case GD_PROP_AMB_COLOUR: + sAmbScaleColour.r = f1; + sAmbScaleColour.g = f2; + sAmbScaleColour.b = f3; + break; + case GD_PROP_LIGHT_DIR: + sLightDirections[sLightId].x = (s32)(f1 * 120.f); + sLightDirections[sLightId].y = (s32)(f2 * 120.f); + sLightDirections[sLightId].z = (s32)(f3 * 120.f); + break; + case GD_PROP_DIFUSE_COLOUR: + sLightScaleColours[sLightId].r = f1; + sLightScaleColours[sLightId].g = f2; + sLightScaleColours[sLightId].b = f3; + break; + case GD_PROP_CULLING: + parm = (s32) f1; + switch (parm) { + case 1: + gSPSetGeometryMode(next_gfx(), G_CULL_BACK); + break; + case 0: + gSPClearGeometryMode(next_gfx(), G_CULL_BACK); + break; + } + break; + case GD_PROP_OVERLAY: + parm = (s32) f1; + switch (parm) { + case 1: + break; + case 0: + break; + default: + fatal_printf("Bad GD_OVERLAY parm"); + } + break; + case GD_PROP_ZBUF_FN: + parm = (s32) f1; + switch (parm) { + case 23: + break; + case 24: + break; + case 25: + break; + default: + fatal_printf("Bad zbuf function"); + } + //? no break? + case GD_PROP_STUB17: + break; + case GD_PROP_STUB18: + break; + case GD_PROP_STUB19: + break; + case GD_PROP_STUB20: + break; + case GD_PROP_STUB21: + break; + default: + fatal_printf("gd_setproperty(): Unkown property"); + } +} + +/* 2522B0 -> 2522C0 */ +void stub_renderer_5(void) { +} + +/* 2522C0 -> 25245C */ +void gd_create_ortho_matrix(f32 l, f32 r, f32 b, f32 t, f32 n, f32 f) { + uintptr_t orthoMtx; + uintptr_t rotMtx; + + // Should produce G_RDPHALF_1 in Fast3D + gSPPerspNormalize(next_gfx(), 0xFFFF); + + guOrtho(&DL_CURRENT_MTX(sCurrentGdDl), l, r, b, t, n, f, 1.0f); + orthoMtx = GD_LOWER_29(&DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), orthoMtx, G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH); + + next_mtx(); + guRotate(&DL_CURRENT_MTX(sCurrentGdDl), 0.0f, 0.0f, 0.0f, 1.0f); + rotMtx = GD_LOWER_29(&DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), rotMtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + + func_801A3324(0.0f, 0.0f, 0.0f); + next_mtx(); +} + +/* 25245C -> 25262C */ +void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far) { + u16 perspNorm; + UNUSED u32 unused1; + uintptr_t perspecMtx; + uintptr_t rotMtx; + UNUSED u32 unused2; + UNUSED f32 unusedf = 0.0625f; + + sGdPerspTimer += 0.1; + guPerspective(&DL_CURRENT_MTX(sCurrentGdDl), &perspNorm, fovy, aspect, near, far, 1.0f); + + gSPPerspNormalize(next_gfx(), perspNorm); + + perspecMtx = GD_LOWER_29(&DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), perspecMtx, G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH); + next_mtx(); + + guRotate(&DL_CURRENT_MTX(sCurrentGdDl), 0.0f, 0.0f, 0.0f, 1.0f); + rotMtx = GD_LOWER_29(&DL_CURRENT_MTX(sCurrentGdDl)); + gSPMatrix(next_gfx(), rotMtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + func_801A3324(0.0f, 0.0f, 0.0f); + next_mtx(); +} + +/* 25262C -> 252AF8 */ +s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, + UNUSED s32 lrx, UNUSED s32 lry) { + char memtrackerName[0x100]; + + if (view->flags & (VIEW_Z_BUF | VIEW_COLOUR_BUF) && !(view->flags & VIEW_UNK_1000)) { + if (view->flags & VIEW_COLOUR_BUF) { + sprintf(memtrackerName, "%s CBuf", name); + start_memtracker(memtrackerName); + view->colourBufs[0] = + gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); + + if (view->flags & VIEW_2_COL_BUF) { + view->colourBufs[1] = + gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); + } else { + view->colourBufs[1] = view->colourBufs[0]; + } + + view->colourBufs[0] = (void *) ALIGN((uintptr_t) view->colourBufs[0], 64); + view->colourBufs[1] = (void *) ALIGN((uintptr_t) view->colourBufs[1], 64); + stop_memtracker(memtrackerName); + + if (view->colourBufs[0] == NULL || view->colourBufs[1] == NULL) { + fatal_printf("Not enough DRAM for colour buffers\n"); + } + view->parent = view; + } else { + view->parent = sScreenView; + } + + if (view->flags & VIEW_Z_BUF) { + sprintf(memtrackerName, "%s ZBuf", name); + start_memtracker(memtrackerName); + if (view->flags & VIEW_ALLOC_ZBUF) { + view->zbuf = + gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x40); + if (view->zbuf == NULL) { + fatal_printf("Not enough DRAM for Z buffer\n"); + } + view->zbuf = (void *) ALIGN((uintptr_t) view->zbuf, 64); + } + stop_memtracker(memtrackerName); + } else { + view->zbuf = sScreenView->zbuf; + } + } else { + view->parent = sScreenView; + } + + view->gdDlNum = 0; + view->unk74 = 0; + + if (view->flags & VIEW_DEFAULT_PARENT) { + view->parent = D_801A86E0; + } + +//! @bug No actual return, but the return value is used. +//! There is no obvious value to return. Since the function +//! doesn't use four of its parameters, this function may have +//! had a fair amount of its code commented out. In game, the +//! returned value is always 0, so the fix returns that value +#ifdef AVOID_UB + return 0; +#endif +} + +/* 252AF8 -> 252BAC; orig name: _InitControllers */ +void gd_init_controllers(void) { + OSContPad *p1cont = &sPrevFrameCont[0]; // 1c + u32 i; // 18 + + osCreateMesgQueue(&D_801BE830, D_801BE848, ARRAY_COUNT(D_801BE848)); + osSetEventMesg(OS_EVENT_SI, &D_801BE830, (OSMesg) OS_MESG_SI_COMPLETE); + osContInit(&D_801BE830, &D_801BAEA0, D_801BAE60); + osContStartReadData(&D_801BE830); + + for (i = 0; i < sizeof(OSContPad); i++) { + ((u8 *) p1cont)[i] = 0; + } +} + +/* 252BAC -> 252BC0 */ +void stub_renderer_6(UNUSED struct GdObj *obj) { +} + +/** + * Unused - This is likely a stub version of the `defpup` function from the IRIX + * Graphics Library. It was used to define a popup menu. See the IRIX "Graphics + * Library Reference Manual, C Edition" for details. + * + * @param menufmt a format string defining the menu items to be added to the + * popup menu. + * @return an identifier of the menu just defined + */ +long defpup(UNUSED const char *menufmt, ...) { + //! @bug no return; function was stubbed +} + +/** + * Unused - called when the user picks an item from the "Control Type" menu. + * Presumably, this would allow switching inputs between controller, keyboard, + * and mouse. + * + * @param itemId ID of the menu item that was clicked + * (1 = "U-64 Analogue Joystick", 2 = "Keyboard", 3 = "Mouse") + */ +void menu_cb_control_type(UNUSED u32 itemId) { +} + +/** + * Unused - called when the user clicks the "Re-Calibrate Controller" item from + * the "Dynamics" menu. + */ +void menu_cb_recalibrate_controller(UNUSED u32 itemId) { +} + +/* 252C08 -> 252C70 */ +void func_801A4438(f32 x, f32 y, f32 z) { + sTextDrawPos.x = x - (sActiveView->lowerRight.x / 2.0f); + sTextDrawPos.y = (sActiveView->lowerRight.y / 2.0f) - y; + sTextDrawPos.z = z; +} + +/* 252C70 -> 252DB4 */ +s32 gd_gentexture(void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 arg4) { + UNUSED s32 sp2C; + UNUSED s32 sp28 = 1; + s32 dl; // 24 + + switch (fmt) { + case 29: + fmt = 0; + break; + case 31: + fmt = 3; + break; + default: + fatal_printf("gd_gentexture(): bad format"); + } + + switch (size) { + case 33: + size = 2; + sp2C = 16; + break; + default: + fatal_printf("gd_gentexture(): bad size"); + } + + sLoadedTextures[++sTextureCount] = texture; + dl = gd_startdisplist(7); + + if (dl == 0) { + fatal_printf("Cant generate DL for texture"); + } + gd_enddlsplist_parent(); + sTextureDisplayLists[sTextureCount] = dl; + + return dl; +} + +/** + * Unused (not called) + */ +void *load_texture_from_file(const char *file, s32 fmt, s32 size, u32 arg3, u32 arg4) { + struct GdFile *txFile; // 3c + void *texture; // 38 + u32 txSize; // 34 + u32 i; // 30 + u16 *txHalf; // 2C + u8 buf[3]; // 28 + u8 alpha; // 27 + s32 dl; // 20 + + txFile = gd_fopen(file, "r"); + if (txFile == NULL) { + fatal_print("Cant load texture"); + } + txSize = gd_get_file_size(txFile); + texture = gd_malloc_perm(txSize / 3 * 2); + if (texture == NULL) { + fatal_printf("Cant allocate memory for texture"); + } + txHalf = (u16 *) texture; + for (i = 0; i < txSize / 3; i++) { + gd_fread((s8 *) buf, 3, 1, txFile); + alpha = 0xFF; + *txHalf = ((buf[2] >> 3) << 11) | ((buf[1] >> 3) << 6) | ((buf[0] >> 3) << 1) | (alpha >> 7); + txHalf++; + } + gd_printf("Loaded texture '%s' (%d bytes)\n", file, txSize); + gd_fclose(txFile); + dl = gd_gentexture(texture, fmt, size, arg3, arg4); + gd_printf("Generated '%s' (%d) display list ok.\n", file, dl); + + return texture; +} + +/* 252F88 -> 252FAC */ +void Unknown801A47B8(struct ObjView *v) { + if (v->flags & VIEW_SAVE_TO_GLOBAL) { + D_801BE994 = v; + } +} + +void stub_renderer_7(void) { +} + +/* 252FC4 -> 252FD8 */ +void stub_renderer_8(UNUSED u32 arg0) { +} + +/** + * Unused - called by func_801A520C and Unknown801A5344 + */ +void func_801A4808(void) { + while (D_801A8674 != 0) { + ; + } + + return; +} + +/* 253018 -> 253084 */ +void func_801A4848(s32 linkDl) { + struct GdDisplayList *curDl; + + curDl = sCurrentGdDl; + sCurrentGdDl = sMHeadMainDls[gGdFrameBufNum]; + branch_cur_dl_to_num(linkDl); + sCurrentGdDl = curDl; +} + +/** + * Unused - called by func_801A520C and Unknown801A5344 + */ +void stub_renderer_9(void) { +} + +/* 253094 -> 2530A8 */ +void stub_renderer_10(UNUSED u32 arg0) { +} + +/* 2530A8 -> 2530C0 */ +void stub_draw_label_text(UNUSED char *s) { + UNUSED u32 pad2; + UNUSED char *save = s; + UNUSED u8 pad[0x18]; +} + +/* 2530C0 -> 2530D8; orig name: func_801A48F0 */ +void set_active_view(struct ObjView *v) { + sActiveView = v; +} + +void stub_renderer_11(void) { +} + +/** + * Unused - called by func_801A520C + */ +void func_801A4918(void) { + f32 x; // c + f32 y; // 8 + u32 ydiff; // 4 + + if (sHandView == NULL || sMenuView == NULL) { + return; + } + + x = sHandView->upperLeft.x; + y = sHandView->upperLeft.y; + + if (!(x > sMenuView->upperLeft.x && x < sMenuView->upperLeft.x + sMenuView->lowerRight.x + && y > sMenuView->upperLeft.y && y < sMenuView->upperLeft.y + sMenuView->lowerRight.y)) { + return; + } + ydiff = (y - sMenuView->upperLeft.y) / 25.0f; + + if (ydiff < sItemsInMenu) { + sMenuGadgets[ydiff]->drawFlags |= OBJ_HIGHLIGHTED; + } +} + +/* 2532D4 -> 2533DC */ +void Unknown801A4B04(void) { + if (D_801A86AC != NULL) { + D_801A86AC->prevScaledTotal = 20.0f; + } + if (D_801A86A4 != NULL) { + D_801A86A4->prevScaledTotal = (f32)((sDLGenTime * 50.0f) + 20.0f); + } + if (D_801A86A8 != NULL) { + D_801A86A8->prevScaledTotal = (f32)((sDLGenTime * 50.0f) + 20.0f); + } + sDLGenTime = get_scaled_timer_total("dlgen"); + sRCPTime = get_scaled_timer_total("rcp"); + sDynamicsTime = get_scaled_timer_total("dynamics"); +} + +/* 2533DC -> 253728; orig name: func_801A4C0C */ +void update_cursor(void) { + if (sHandView == NULL) + return; + + if (gGdCtrl.currFrame - gGdCtrl.dragStartFrame < 300) { + sHandView->flags |= VIEW_UPDATE; + // by playing the sfx every frame, it will only play once as it + // never leaves the "sfx played last frame" buffer + gd_play_sfx(GD_SFX_HAND_APPEAR); + } else { + sHandView->flags &= ~VIEW_UPDATE; + gd_play_sfx(GD_SFX_HAND_DISAPPEAR); + } + + sHandView->upperLeft.x = (f32) gGdCtrl.csrX; + sHandView->upperLeft.y = (f32) gGdCtrl.csrY; + + // Make hand display list + begin_gddl(sHandShape->dlNums[gGdFrameBufNum]); + if (gGdCtrl.dragging) { + gd_put_sprite((u16 *) gd_texture_hand_closed, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + } else { + gd_put_sprite((u16 *) gd_texture_hand_open, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + } + gd_enddlsplist_parent(); + + if (sHandView->upperLeft.x < sHandView->parent->upperLeft.x) { + sHandView->upperLeft.x = sHandView->parent->upperLeft.x; + } + if (sHandView->upperLeft.x > (sHandView->parent->upperLeft.x + sHandView->parent->lowerRight.x)) { + sHandView->upperLeft.x = sHandView->parent->upperLeft.x + sHandView->parent->lowerRight.x; + } + + if (sHandView->upperLeft.y < sHandView->parent->upperLeft.y) { + sHandView->upperLeft.y = sHandView->parent->upperLeft.y; + } + if (sHandView->upperLeft.y > (sHandView->parent->upperLeft.y + sHandView->parent->lowerRight.y)) { + sHandView->upperLeft.y = sHandView->parent->upperLeft.y + sHandView->parent->lowerRight.y; + } +} + +/* 253728 -> 2538E0 */ +void Unknown801A4F58(void) { + register s16 *cbufOff; // a0 + register s16 *cbufOn; // a1 + register u16 *zbuf; // a2 + register s16 colour; // a3 + register s16 r; // t0 + register s16 g; // t1 + register s16 b; // t2 + register s32 i; // t3 + + cbufOff = sScreenView->colourBufs[gGdFrameBufNum ^ 1]; + cbufOn = sScreenView->colourBufs[gGdFrameBufNum]; + zbuf = sScreenView->zbuf; + + for (i = 0; i < (320 * 240); i++) { // L801A4FCC + colour = cbufOff[i]; + if (colour) { + r = (s16)(colour >> 11 & 0x1F); + g = (s16)(colour >> 6 & 0x1F); + b = (s16)(colour >> 1 & 0x1F); + if ((r -= 1) < 0) { + r = 0; + } + if ((g -= 1) < 0) { + g = 0; + } + if ((b -= 1) < 0) { + b = 0; + } + + colour = (s16)(r << 11 | g << 6 | b << 1); + cbufOff[i] = colour; + cbufOn[i] = colour; + } else { // L801A50D8 + zbuf[i] = 0xFFFC; + } + } +} + +/* 2538E0 -> 253938 */ +void Proc801A5110(struct ObjView *view) { + if (view->flags & VIEW_UPDATE) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, view->components); + } +} + +/* 253938 -> 2539DC; orig name: func_801A5168 */ +void update_view_and_dl(struct ObjView *view) { + UNUSED u32 pad; + s32 prevFlags; // 18 + + prevFlags = view->flags; + update_view(view); + if (prevFlags & VIEW_UPDATE) { + sCurrentGdDl = sMHeadMainDls[gGdFrameBufNum]; + if (view->gdDlNum != 0) { + func_801A4848(view->gdDlNum); + } + } +} + +/** + * Unused - called by __main__ + */ +void func_801A520C(void) { + UNUSED u32 pad[2]; + + start_timer("1frame"); + start_timer("cpu"); + stub_renderer_9(); + reset_cur_dl_indices(); + parse_p1_controller(); + setup_timers(); + start_timer("dlgen"); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view_and_dl, gGdViewsGroup); + stop_timer("dlgen"); + restart_timer("netupd"); + if (!gGdCtrl.newStartPress) { + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) Proc801A5110, gGdViewsGroup); + } + split_timer("netupd"); + split_timer("cpu"); + func_801A4808(); + restart_timer("cpu"); + func_801A025C(); + update_cursor(); + func_801A4918(); + stop_timer("1frame"); + sTracked1FrameTime = get_scaled_timer_total("1frame"); + split_timer("cpu"); + func_801A01EC(); +} + +/** + * Unused + */ +void Unknown801A5344(void) { + if ((sActiveView = sScreenView) == NULL) { + return; + } + + reset_cur_dl_indices(); + sScreenView->gdDlNum = gd_startdisplist(8); + start_view_dl(sScreenView); + gd_set_one_cycle(); + gd_enddlsplist_parent(); + func_801A4848(sScreenView->gdDlNum); + stub_renderer_9(); + func_801A4808(); + sScreenView->gdDlNum = 0; +} + +/* 253BC8 -> 2540E0 */ +void gd_init(void) { + s32 i; // 34 + UNUSED u32 pad30; + s8 *data; // 2c + + imin("gd_init"); + i = (u32)(sMemBlockPoolSize - DOUBLE_SIZE_ON_64_BIT(0x3E800)); + data = gd_allocblock(i); + gd_add_mem_to_heap(i, data, 0x10); + sAlpha = (u16) 0xff; + D_801A867C = 0; + D_801A8680 = 0; + sTextureCount = 0; + gGdFrameBufNum = 0; + D_801A86BC = 1; + sItemsInMenu = 0; + sDebugViewsCount = 0; + sCurrDebugViewIndex = 0; + sGdDlCount = 0; + D_801A8674 = 0; + sLightId = 0; + sAmbScaleColour.r = 0.0f; + sAmbScaleColour.g = 0.0f; + sAmbScaleColour.b = 0.0f; + + for (i = 0; i < ARRAY_COUNT(sLightScaleColours); i++) { + sLightScaleColours[i].r = 1.0f; + sLightScaleColours[i].g = 0.0f; + sLightScaleColours[i].b = 0.0f; + sLightDirections[i].x = 0; + sLightDirections[i].y = 120; + sLightDirections[i].z = 0; + } + + sNumLights = NUMLIGHTS_2; + gd_set_identity_mat4(&sInitIdnMat4); + mat4_to_mtx(&sInitIdnMat4, &sIdnMtx); + remove_all_memtrackers(); + null_obj_lists(); + start_memtracker("total"); + remove_all_timers(); + + start_memtracker("Static DL"); + sStaticDl = new_gd_dl(0, 1900, 4000, 1, 300, 8); + stop_memtracker("Static DL"); + + start_memtracker("Dynamic DLs"); + sDynamicMainDls[0] = new_gd_dl(1, 600, 10, 200, 10, 3); + sDynamicMainDls[1] = new_gd_dl(1, 600, 10, 200, 10, 3); + stop_memtracker("Dynamic DLs"); + + sMHeadMainDls[0] = new_gd_dl(1, 100, 0, 0, 0, 0); + sMHeadMainDls[1] = new_gd_dl(1, 100, 0, 0, 0, 0); + + for (i = 0; i < ARRAY_COUNT(sViewDls); i++) { + sViewDls[i][0] = create_child_gdl(1, sDynamicMainDls[0]); + sViewDls[i][1] = create_child_gdl(1, sDynamicMainDls[1]); + } + + sScreenView = + make_view("screenview2", (VIEW_2_COL_BUF | VIEW_UNK_1000 | VIEW_COLOUR_BUF | VIEW_Z_BUF), 0, 0, + 0, 320, 240, NULL); + sScreenView->colour.r = 0.0f; + sScreenView->colour.g = 0.0f; + sScreenView->colour.b = 0.0f; + sScreenView->parent = sScreenView; + sScreenView->flags &= ~VIEW_UPDATE; + sActiveView = sScreenView; + + // Zero out controller inputs + data = (s8 *) &gGdCtrl; + for (i = 0; (u32) i < sizeof(struct GdControl); i++) { + *data++ = 0; + } + + // 801A5868 + gGdCtrl.unk88 = 1.0f; + gGdCtrl.unkA0 = -45.0f; + gGdCtrl.unkAC = 45.0f; + gGdCtrl.unk00 = 2; + gGdCtrl.newStartPress = FALSE; + gGdCtrl.prevFrame = &gGdCtrlPrev; + gGdCtrl.csrX = 160; + gGdCtrl.csrY = 120; + gGdCtrl.dragStartFrame = -1000; + unusedDl801BB0AC = create_mtl_gddl(4); + imout(); +} + +/** + * Unused - reverses the characters in `str`. + */ +void reverse_string(char *str, s32 len) { + char buf[100]; + s32 i; + + for (i = 0; i < len; i++) { + buf[i] = str[len - i - 1]; + } + + for (i = 0; i < len; i++) { + str[i] = buf[i]; + } +} + +/* 254168 -> 25417C */ +void stub_renderer_12(UNUSED s8 *arg0) { +} + +/* 25417C -> 254190 */ +void stub_renderer_13(UNUSED void *arg0) { +} + +/* 254190 -> 2541A4 */ +void stub_renderer_14(UNUSED s8 *arg0) { +} + +/** + * Initializes the pick buffer. This functions like the `pick` or `gselect` + * functions from IRIS GL. + * @param buf pointer to an array of 16-bit values + * @param len maximum number of values to store + */ +void init_pick_buf(s16 *buf, s32 len) { + buf[0] = 0; + buf[1] = 0; + sPickBufLen = len; + sPickBuf = buf; + sPickBufPosition = 0; +} + +/** + * Stores a 16-bit value into the pick buffer. This functions like the + * `pushname` function from IRIS GL. + */ +void store_in_pickbuf(s16 data) { + sPickBuf[sPickBufPosition++] = data; +} + +/* 25421C -> 254250; orig name: func_801A5A4C +** Divides by 3, since in the final game, only thing stored +** in the pick buf is a tupple of three halves: (datasize, objtype, objnumber) +** (datasize is always 2) */ +s32 get_cur_pickbuf_offset(UNUSED s16 *arg0) { + return sPickBufPosition / 3; +} + +/* 254250 -> 254264 */ +void stub_renderer_15(UNUSED u32 arg0) { +} + +/* 254264 -> 254278 */ +void stub_renderer_16(UNUSED u32 arg0) { +} + +/* 254278 -> 254288 */ +void stub_renderer_17(void) { +} + +/* 254288 -> 2542B0 */ +void *Unknown801A5AB8(s32 texnum) { + return sLoadedTextures[texnum]; +} + +/* 2542B0 -> 254328 */ +void Unknown801A5AE0(s32 arg0) { + D_801BB018 = arg0; + if (D_801BB01C != D_801BB018) { + branch_cur_dl_to_num(sTextureDisplayLists[arg0]); + D_801BB01C = D_801BB018; + } +} + +/* 254328 -> 2543B8; orig name: func_801A5B58 */ +void set_vtx_tc_buf(f32 tcS, f32 tcT) { + sVtxCvrtTCBuf[0] = (s16)(tcS * 512.0f); + sVtxCvrtTCBuf[1] = (s16)(tcT * 512.0f); +} + +/* 2543B8 -> 2543F4 */ +void add_debug_view(struct ObjView *view) { + sDebugViews[sDebugViewsCount++] = view; +} + +/* 2543F4 -> 254450; orig name: Unknown801A5C24 */ +union ObjVarVal *cvrt_val_to_kb(union ObjVarVal *dst, union ObjVarVal src) { + union ObjVarVal temp; + + temp.f = src.f / 1024.0; //? 1024.0f + return (*dst = temp, dst); +} + +/* 254450 -> 254560 */ +void Unknown801A5C80(struct ObjGroup *parentGroup) { + struct ObjLabel *label; // 3c + struct ObjGroup *debugGroup; // 38 + + d_start_group("debugg"); + label = (struct ObjLabel *) d_makeobj(D_LABEL, 0); + d_set_rel_pos(10.0f, 230.0f, 0.0f); + d_set_parm_ptr(PARM_PTR_CHAR, gd_strdup("FT %2.2f")); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTracked1FrameTime); + label->unk30 = 3; + d_end_group("debugg"); + + debugGroup = (struct ObjGroup *) d_use_obj("debugg"); + make_view("debugview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_DRAW), 2, 0, 0, 320, + 240, debugGroup); + + if (parentGroup != NULL) { + addto_group(parentGroup, &debugGroup->header); + } +} + +/* 254560 -> 2547C8 */ +void Unknown801A5D90(struct ObjGroup *arg0) { + struct ObjLabel *mtLabel; // 254 + struct ObjGroup *labelgrp; // 250 + struct ObjView *memview; // 24c + s32 trackerNum; // memtracker id and/or i + s32 sp244; // label y position? + s32 sp240; // done checking all memtrakcers + s32 sp23C; // memtracker label made? + char mtStatsFmt[0x100]; // 13c + char groupId[0x100]; // 3c + struct MemTracker *mt; // 38 + + sp240 = FALSE; + trackerNum = -1; + + while (!sp240) { + sprintf(groupId, "memg%d\n", trackerNum); + d_start_group(AsDynName(groupId)); + sp244 = 20; + sp23C = FALSE; + + for (;;) { + trackerNum += 1; + mt = get_memtracker_by_index(trackerNum); + + if (mt->name != NULL) { + sprintf(mtStatsFmt, "%s %%6.2fk", mt->name); + mtLabel = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + d_set_rel_pos(10.0f, sp244, 0.0f); + d_set_parm_ptr(PARM_PTR_CHAR, gd_strdup(mtStatsFmt)); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &mt->total); + mtLabel->unk30 = 3; + d_add_valproc(cvrt_val_to_kb); + sp23C = TRUE; + sp244 += 14; + if (sp244 > 200) { + break; + } + } + + if (trackerNum >= GD_NUM_MEM_TRACKERS) { + sp240 = TRUE; + break; + } + } + + d_end_group(AsDynName(groupId)); + labelgrp = (struct ObjGroup *) d_use_obj(AsDynName(groupId)); + + if (sp23C) { + memview = make_view("memview", + (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 + | VIEW_1_CYCLE | VIEW_DRAW), + 2, 0, 10, 320, 200, labelgrp); + memview->colour.r = 0.0f; + memview->colour.g = 0.0f; + memview->colour.b = 0.0f; + addto_group(arg0, &labelgrp->header); + memview->flags &= ~VIEW_UPDATE; + add_debug_view(memview); + } + } +} + +/* 2547C8 -> 254AC0 */ +void Unknown801A5FF8(struct ObjGroup *arg0) { + struct ObjView *menuview; // 3c + UNUSED struct ObjLabel *label; // 38 + struct ObjGroup *menugrp; // 34 + UNUSED u32 pad2C[2]; + + d_start_group("menug"); + sMenuGadgets[0] = d_makeobj(D_GADGET, "menu0"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(5.0f, 0.0f, 0.0f); + d_set_scale(100.0f, 20.0f, 0.0f); + d_set_type(6); + d_set_colour_num(2); + label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + d_set_rel_pos(5.0f, 18.0f, 0.0f); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 1"); + d_add_valptr("menu0", 0x40000, 0, (uintptr_t) NULL); + + sMenuGadgets[1] = d_makeobj(D_GADGET, "menu1"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(5.0f, 25.0f, 0.0f); + d_set_scale(100.0f, 20.0f, 0.0f); + d_set_type(6); + d_set_colour_num(4); + label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + d_set_rel_pos(5.0f, 18.0f, 0.0f); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 2"); + d_add_valptr("menu1", 0x40000, 0, (uintptr_t) NULL); + + sMenuGadgets[2] = d_makeobj(D_GADGET, "menu2"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(5.0f, 50.0f, 0.0f); + d_set_scale(100.0f, 20.0f, 0.0f); + d_set_type(6); + d_set_colour_num(3); + label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + d_set_rel_pos(5.0f, 18.0f, 0.0f); + d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 3"); + d_add_valptr("menu2", 0x40000, 0, (uintptr_t) NULL); + sItemsInMenu = 3; + d_end_group("menug"); + + menugrp = (struct ObjGroup *) d_use_obj("menug"); + menuview = make_view( + "menuview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_BORDERED | VIEW_UNK_2000 | VIEW_UNK_4000), + 2, 100, 20, 110, 150, menugrp); + menuview->colour.r = 0.0f; + menuview->colour.g = 0.0f; + menuview->colour.b = 0.0f; + addto_group(arg0, &menugrp->header); + sMenuView = menuview; +} + +/* 254AC0 -> 254DFC; orig name: PutSprite */ +void gd_put_sprite(u16 *sprite, s32 x, s32 y, s32 wx, s32 wy) { + s32 c; // 5c + s32 r; // 58 + + gSPDisplayList(next_gfx(), osVirtualToPhysical(gd_dl_sprite_start_tex_block)); + for (r = 0; r < wy; r += 32) { + for (c = 0; c < wx; c += 32) { + gDPLoadTextureBlock(next_gfx(), (r * 32) + sprite + c, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD) + gSPTextureRectangle(next_gfx(), x << 2, (y + r) << 2, (x + 32) << 2, (y + r + 32) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } + } + + gDPPipeSync(next_gfx()); + gDPSetCycleType(next_gfx(), G_CYC_1CYCLE); + gDPSetRenderMode(next_gfx(), G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2); + gSPTexture(next_gfx(), 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_OFF); +} + +/* 254DFC -> 254F94; orig name: proc_dyn_list */ +void gd_setup_cursor(struct ObjGroup *parentgrp) { + struct ObjView *mouseview; // 34 + struct ObjGroup *mousegrp; // 30 + UNUSED struct ObjNet *net; // 2c + + sHandShape = make_shape(0, "mouse"); + sHandShape->dlNums[0] = gd_startdisplist(7); + gd_put_sprite((u16 *) gd_texture_hand_open, 100, 100, 32, 32); + gd_enddlsplist_parent(); + sHandShape->dlNums[1] = gd_startdisplist(7); + gd_put_sprite((u16 *) gd_texture_hand_open, 100, 100, 32, 32); + gd_enddlsplist_parent(); + + d_start_group("mouseg"); + net = (struct ObjNet *) d_makeobj(D_NET, AsDynName(0)); + d_set_init_pos(0.0f, 0.0f, 0.0f); + d_set_type(3); + d_set_shapeptrptr(&sHandShape); + d_end_group("mouseg"); + + mousegrp = (struct ObjGroup *) d_use_obj("mouseg"); + mouseview = make_view("mouseview", + (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), + 2, 0, 0, 32, 32, mousegrp); + mouseview->flags &= ~VIEW_UPDATE; + sHandView = mouseview; + if (parentgrp != NULL) { + addto_group(parentgrp, &mousegrp->header); + } +} + +/** + * 254F94 -> 254FE4; orig name: Proc801A67C4 + * This prints all timers if the view was not updated for a frame + **/ +void view_proc_print_timers(struct ObjView *self) { + if (self->flags & VIEW_WAS_UPDATED) { + return; + } + + print_all_timers(); +} + +/* 254FE4 -> 255600; not called; orig name: Unknown801A6814 */ +void make_timer_gadgets(void) { + struct ObjLabel *timerLabel; + struct ObjGroup *timerg; + UNUSED u32 pad6C; + struct ObjView *timersview; + struct ObjGadget *bar1; + struct ObjGadget *bar2; + struct ObjGadget *bar3; + struct ObjGadget *bar4; + struct ObjGadget *bar5; + struct ObjGadget *bar6; + struct GdTimer *timer; + s32 i; + char timerNameBuf[0x20]; + + d_start_group("timerg"); + d_makeobj(D_GADGET, "bar1"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(20.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar1 = (struct ObjGadget *) d_use_obj("bar1"); + bar1->colourNum = COLOUR_WHITE; + + d_makeobj(D_GADGET, "bar2"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(70.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar2 = (struct ObjGadget *) d_use_obj("bar2"); + bar2->colourNum = COLOUR_PINK; + + d_makeobj(D_GADGET, "bar3"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(120.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar3 = (struct ObjGadget *) d_use_obj("bar3"); + bar3->colourNum = COLOUR_WHITE; + + d_makeobj(D_GADGET, "bar4"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(170.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar4 = (struct ObjGadget *) d_use_obj("bar4"); + bar4->colourNum = COLOUR_PINK; + + d_makeobj(D_GADGET, "bar5"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(220.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar5 = (struct ObjGadget *) d_use_obj("bar5"); + bar5->colourNum = COLOUR_WHITE; + + d_makeobj(D_GADGET, "bar6"); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(270.0f, 5.0f, 0.0f); + d_set_scale(50.0f, 5.0f, 0.0f); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0); + d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); + bar6 = (struct ObjGadget *) d_use_obj("bar6"); + bar6->colourNum = COLOUR_PINK; + + for (i = 0; i < GD_NUM_TIMERS; i++) { + sprintf(timerNameBuf, "tim%d\n", i); + + timer = get_timernum(i); + + d_makeobj(D_GADGET, timerNameBuf); + d_set_obj_draw_flag(OBJ_IS_GRABBALE); + d_set_world_pos(20.0f, (f32)((i * 15) + 15), 0.0f); + d_set_scale(50.0f, 14.0f, 0); + d_set_type(4); + d_set_parm_f(PARM_F_RANGE_MIN, 0.0f); + d_set_parm_f(PARM_F_RANGE_MAX, 1.0f); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &timer->prevScaledTotal); + sTimerGadgets[i] = (struct ObjGadget *) d_use_obj(timerNameBuf); + sTimerGadgets[i]->colourNum = timer->gadgetColourNum; + + timerLabel = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + d_set_rel_pos(5.0f, 14.0f, 0); + d_set_parm_ptr(PARM_PTR_CHAR, (void *) timer->name); + d_add_valptr(timerNameBuf, 0x40000, 0, (uintptr_t) NULL); + timerLabel->unk30 = 3; + } + + d_end_group("timerg"); + timerg = (struct ObjGroup *) d_use_obj("timerg"); + timersview = make_view( + "timersview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), 2, + 0, 10, 320, 270, timerg); + timersview->colour.r = 0.0f; + timersview->colour.g = 0.0f; + timersview->colour.b = 0.0f; + timersview->flags &= ~VIEW_UPDATE; + timersview->proc = view_proc_print_timers; + add_debug_view(timersview); + + return; +} + +/* 255600 -> 255614 */ +void stub_renderer_18(UNUSED u32 a0) { +} + +/* 255614 -> 255628 */ +void stub_renderer_19(UNUSED u32 a0) { +} + +#ifndef NO_SEGMENTED_MEMORY +/** + * Copies `size` bytes of data from ROM address `romAddr` to RAM address `vAddr`. + */ +static void gd_block_dma(u32 romAddr, void *vAddr, s32 size) { + s32 blockSize; + + do { + if ((blockSize = size) > 0x1000) { + blockSize = 0x1000; + } + + osPiStartDma(&sGdDMAReqMesg, OS_MESG_PRI_NORMAL, OS_READ, romAddr, vAddr, blockSize, &sGdDMAQueue); + osRecvMesg(&sGdDMAQueue, &sGdDMACompleteMsg, OS_MESG_BLOCK); + romAddr += blockSize; + vAddr = (void *) ((uintptr_t) vAddr + blockSize); + size -= 0x1000; + } while (size > 0); +} + +/** + * Loads the specified DynList from ROM and processes it. + */ +struct GdObj *load_dynlist(struct DynList *dynlist) { + u32 segSize; + u8 *allocSegSpace; + void *allocPtr; + uintptr_t dynlistSegStart; + uintptr_t dynlistSegEnd; + s32 i; + s32 tlbEntries; + struct GdObj *loadedList; + + i = -1; + + // Make sure the dynlist exists + while (sDynLists[++i].list != NULL) { + if (sDynLists[i].list == dynlist) { + break; + } + } + if (sDynLists[i].list == NULL) { + fatal_printf("load_dynlist() ptr not found in any banks"); + } + + switch (sDynLists[i].flag) { + case STD_LIST_BANK: + dynlistSegStart = (uintptr_t) _gd_dynlistsSegmentRomStart; + dynlistSegEnd = (uintptr_t) _gd_dynlistsSegmentRomEnd; + break; + default: + fatal_printf("load_dynlist() unkown bank"); + } + +#define PAGE_SIZE 65536 // size of a 64K TLB page + + segSize = dynlistSegEnd - dynlistSegStart; + allocSegSpace = gd_malloc_temp(segSize + PAGE_SIZE); + + if ((allocPtr = (void *) allocSegSpace) == NULL) { + fatal_printf("Not enough DRAM for DATA segment \n"); + } + + allocSegSpace = (u8 *) (((uintptr_t) allocSegSpace + PAGE_SIZE) & 0xFFFF0000); + + // Copy the dynlist data from ROM + gd_block_dma(dynlistSegStart, (void *) allocSegSpace, segSize); + + osUnmapTLBAll(); + + tlbEntries = (segSize / PAGE_SIZE) / 2 + 1; + if (tlbEntries >= 31) { + fatal_printf("load_dynlist() too many TLBs"); + } + + // Map virtual address 0x04000000 to `allocSegSpace` + for (i = 0; i < tlbEntries; i++) { + osMapTLB(i, OS_PM_64K, + (void *) (uintptr_t) (0x04000000 + (i * 2 * PAGE_SIZE)), // virtual address to map + GD_LOWER_24(((uintptr_t) allocSegSpace) + (i * 2 * PAGE_SIZE) + 0), // even page address + GD_LOWER_24(((uintptr_t) allocSegSpace) + (i * 2 * PAGE_SIZE) + PAGE_SIZE), // odd page address + -1); + } + +#undef PAGE_SIZE + + // process the dynlist + loadedList = proc_dynlist(dynlist); + + gd_free(allocPtr); + osUnmapTLBAll(); + + return loadedList; +} +#else +struct GdObj *load_dynlist(struct DynList *dynlist) { + return proc_dynlist(dynlist); +} +#endif + +/** + * Unused (not called) + */ +void stub_renderer_20(UNUSED u32 a0) { +} + +/** + * Unused (not called) + */ +void func_801A71CC(struct ObjNet *net) { + s32 i; // spB4 + s32 j; // spB0 + f32 spAC; + f32 spA8; + struct GdBoundingBox bbox; + UNUSED u32 pad8C; + struct ObjZone *sp88; + register struct ListNode *link; // s0 (84) + s32 sp80; // linked planes contained in zone? + s32 sp7C; // linked planes in net count? + register struct ListNode *link1; // s1 (78) + register struct ListNode *link2; // s2 (74) + register struct ListNode *link3; // s3 (70) + struct GdVec3f sp64; + UNUSED u32 pad60; + struct ObjPlane *plane; // 5c + UNUSED u32 pad58; + struct ObjZone *linkedZone; // 54 + UNUSED u32 pad50; + struct ObjPlane *planeL2; // 4c + UNUSED u32 pad48; + struct ObjPlane *planeL3; // 44 + + if (net->unk21C == NULL) { + net->unk21C = make_group(0); + } + + gd_print_bounding_box("making zones for net=", &net->boundingBox); + + sp64.x = (ABS(net->boundingBox.minX) + ABS(net->boundingBox.maxX)) / 16.0f; + sp64.z = (ABS(net->boundingBox.minZ) + ABS(net->boundingBox.maxZ)) / 16.0f; + + spA8 = net->boundingBox.minZ + sp64.z / 2.0f; + + for (i = 0; i < 16; i++) { + spAC = net->boundingBox.minX + sp64.x / 2.0f; + + for (j = 0; j < 16; j++) { + bbox.minX = spAC - (sp64.x / 2.0f); + bbox.minY = 0.0f; + bbox.minZ = spA8 - (sp64.z / 2.0f); + + bbox.maxX = spAC + (sp64.x / 2.0f); + bbox.maxY = 0.0f; + bbox.maxZ = spA8 + (sp64.z / 2.0f); + + sp88 = make_zone(NULL, &bbox, NULL); + addto_group(net->unk21C, &sp88->header); + sp88->unk2C = make_group(0); + + spAC += sp64.x; + } + spA8 += sp64.z; + } + + for (link = net->unk1CC->firstMember; link != NULL; link = link->next) { + plane = (struct ObjPlane *) link->obj; + plane->unk18 = FALSE; + } + + i = 0; // acts as Zone N here... kinda + for (link1 = net->unk21C->firstMember; link1 != NULL; link1 = link1->next) { + linkedZone = (struct ObjZone *) link1->obj; + sp88 = linkedZone; + sp7C = 0; + sp80 = 0; + + for (link2 = net->unk1CC->firstMember; link2 != NULL; link2 = link2->next) { + planeL2 = (struct ObjPlane *) link2->obj; + sp7C += 1; + if (gd_plane_point_within(&planeL2->boundingBox, &sp88->boundingBox)) { + planeL2->unk18 = TRUE; + addto_group(sp88->unk2C, &planeL2->header); + sp80 += 1; + } + } + + if (sp80 == 0) { + stub_objects_1(net->unk21C, &linkedZone->header); // stubbed fatal function? + } else { + gd_printf("%d/%d planes in zone %d\n", sp80, sp7C, i++); + } + } + + for (link3 = net->unk1CC->firstMember; link3 != NULL; link3 = link3->next) { + planeL3 = (struct ObjPlane *) link3->obj; + + if (!planeL3->unk18) { + gd_print_bounding_box("plane=", &planeL3->boundingBox); + fatal_printf("plane not in any zones\n"); + } + } +} + +/* 255EB0 -> 255EC0 */ +void stub_renderer_21(void) { +} diff --git a/src/goddard/renderer.h b/src/goddard/renderer.h new file mode 100644 index 00000000..dfd9fe78 --- /dev/null +++ b/src/goddard/renderer.h @@ -0,0 +1,126 @@ +#ifndef GD_RENDERER_H +#define GD_RENDERER_H + +#include +#include + +#include "gd_types.h" +#include "macros.h" + +// types +/// Properties types used in [gd_setproperty](@ref gd_setproperty); most are stubbed out. +enum GdProperty { + GD_PROP_OVERLAY = 4, + GD_PROP_LIGHTING = 11, + GD_PROP_AMB_COLOUR = 12, + GD_PROP_DIFUSE_COLOUR = 13, + GD_PROP_LIGHT_DIR = 15, + GD_PROP_CULLING = 16, + GD_PROP_STUB17 = 17, + GD_PROP_STUB18 = 18, + GD_PROP_STUB19 = 19, + GD_PROP_STUB20 = 20, + GD_PROP_STUB21 = 21, + GD_PROP_ZBUF_FN = 22 +}; + +enum GdSceneId { + GD_SCENE_YOSHI, // create yoshi? + GD_SCENE_YOSHI1, // destroy yoshi? + GD_SCENE_REGULAR_MARIO, + GD_SCENE_DIZZY_MARIO, + GD_SCENE_CAR, // create car? + GD_SCENE_CAR5 // destroy car? +}; + +// data +extern s32 gGdFrameBufNum; + +// functions +u32 get_alloc_mem_amt(void); +s32 gd_get_ostime(void); +f32 get_time_scale(void); +f64 gd_sin_d(f64 x); +f64 gd_cos_d(f64 x); +f64 gd_sqrt_d(f64 x); +void gd_printf(const char *format, ...); +void gd_exit(UNUSED s32 code) NORETURN; +void gd_free(void *ptr); +void *gd_allocblock(u32 size); +void *gd_malloc(u32 size, u8 perm); +void *gd_malloc_perm(u32 size); +void *gd_malloc_temp(u32 size); +void draw_indexed_dl(s32 dlNum, s32 gfxIdx); +void gd_add_to_heap(void *addr, u32 size); +void gdm_init(void *blockpool, u32 size); +void gdm_setup(void); +void gdm_maketestdl(s32 id); +void gd_vblank(void); +void gd_copy_p1_contpad(OSContPad *p1cont); +s32 gd_sfx_to_play(void); +Gfx *gdm_gettestdl(s32 id); +void gd_draw_rect(f32 ulx, f32 uly, f32 lrx, f32 lry); +void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry); +void gd_dl_set_fill(struct GdColour *colour); +void stash_current_gddl(void); +void pop_gddl_stash(void); +s32 gd_startdisplist(s32 memarea); +s32 gd_enddlsplist_parent(void); +void gd_dl_load_matrix(Mat4f *mtx); +void gd_dl_push_matrix(void); +void gd_dl_pop_matrix(void); +void gd_dl_mul_trans_matrix(f32 x, f32 y, f32 z); +void gd_dl_load_trans_matrix(f32 x, f32 y, f32 z); +void gd_dl_scale(f32 x, f32 y, f32 z); +void func_8019F2C4(f32 arg0, s8 arg1); +void gd_dl_lookat(struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7); +void check_tri_display(s32 vtxcount); +Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha); +void func_8019FEF0(void); +void gd_dl_make_triangle(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3); +void func_801A0038(void); +void gd_dl_flush_vertices(void); +void set_render_alpha(f32 arg0); +void set_light_id(s32 index); +void set_light_num(s32 n); +s32 create_mtl_gddl(s32 mtlType); +void branch_to_gddl(s32 dlNum); +void gd_dl_hilite(s32, struct ObjCamera *, struct GdVec3f *, struct GdVec3f *, struct GdVec3f *, struct GdColour *); +void gd_dl_hilite(s32 idx, struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, + struct GdVec3f *arg4, struct GdColour *colour); +s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material); +void set_Vtx_norm_buf_1(struct GdVec3f *norm); +void set_Vtx_norm_buf_2(struct GdVec3f *norm); +void set_gd_mtx_parameters(s32 params); +void gd_set_one_cycle(void); +void gddl_is_loading_stub_dl(UNUSED s32 dlLoad); +void start_view_dl(struct ObjView *view); +void border_active_view(void); +void gd_shading(s32 model); +s32 gd_getproperty(s32 prop, UNUSED void *arg1); +void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3); +void gd_create_ortho_matrix(f32 l, f32 r, f32 b, f32 t, f32 n, f32 f); +void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far); +s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, + UNUSED s32 lrx, UNUSED s32 lry); +void gd_init_controllers(void); +void stub_renderer_6(struct GdObj *obj); //apply to OBJ_TYPE_VIEWS +long defpup(UNUSED const char *menufmt, ...); +void menu_cb_control_type(u32); +void menu_cb_recalibrate_controller(u32); +void func_801A4438(f32 x, f32 y, f32 z); +void stub_renderer_10(u32 arg0); +void stub_draw_label_text(UNUSED char *s); +void set_active_view(struct ObjView *v); +void func_801A520C(void); +void gd_init(void); +void stub_renderer_12(s8 *arg0); /* convert LE bytes to BE word? */ +void stub_renderer_13(UNUSED void *arg0); +void stub_renderer_14(UNUSED s8 *arg0); /* convert LE bytes to BE f32? */ +void init_pick_buf(s16 *buf, s32 len); +void store_in_pickbuf(s16 data); +s32 get_cur_pickbuf_offset(UNUSED s16 *arg0); +void set_vtx_tc_buf(f32 tcS, f32 tcT); +struct GdObj *load_dynlist(struct DynList *dynlist); + +#endif // GD_RENDERER_H diff --git a/src/goddard/sfx.c b/src/goddard/sfx.c new file mode 100644 index 00000000..5d3b8dc7 --- /dev/null +++ b/src/goddard/sfx.c @@ -0,0 +1,38 @@ +#include + +#include "sfx.h" + +static u32 sCurrSfx; // bitset of currently playing sound effects +static u32 sPrevSfx; // bitset of sound effects that were playing on the previous frame + +/** + * Stops all sound effects + */ +void gd_reset_sfx(void) { + sPrevSfx = GD_SFX_NONE; + sCurrSfx = GD_SFX_NONE; +} + +/** + * Returns a bitset of the newly started sound effects. + * This is used by geo_draw_mario_head_goddard to start new sounds. + */ +u32 gd_new_sfx_to_play(void) { + return ~sPrevSfx & sCurrSfx; +} + +/** + * Called at the start of a frame. + */ +void gd_sfx_update(void) { + sPrevSfx = sCurrSfx; + sCurrSfx = GD_SFX_NONE; +} + +/** + * Marks a sound effect to be played. This must be called repeatedly once per + * frame to keep the sound effect playing. + */ +void gd_play_sfx(enum GdSfx sfx) { + sCurrSfx |= sfx; +} diff --git a/src/goddard/sfx.h b/src/goddard/sfx.h new file mode 100644 index 00000000..8865afc6 --- /dev/null +++ b/src/goddard/sfx.h @@ -0,0 +1,25 @@ +#ifndef GD_SFX_H +#define GD_SFX_H + +#include + +// Sfx for Mario Head Screen +enum GdSfx { + GD_SFX_NONE = 0x00, + GD_SFX_HAND_APPEAR = 0x01, + GD_SFX_HAND_DISAPPEAR = 0x02, + GD_SFX_UNUSED_COIN = 0x04, + GD_SFX_PINCH_FACE = 0x08, + GD_SFX_PINCH_FACE_2 = 0x10, + GD_SFX_LET_GO_FACE = 0x20, + GD_SFX_CAM_ZOOM_IN = 0x40, + GD_SFX_CAM_ZOOM_OUT = 0x80 +}; + +// functions +void gd_reset_sfx(void); +u32 gd_new_sfx_to_play(void); +void gd_sfx_update(void); +void gd_play_sfx(enum GdSfx sfx); + +#endif // GD_SFX_H diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c new file mode 100644 index 00000000..a0cd7ff0 --- /dev/null +++ b/src/goddard/shape_helper.c @@ -0,0 +1,1538 @@ +#include + +#include "debug_utils.h" +#include "draw_objects.h" +#include "dynlist_proc.h" +#include "dynlists/dynlist_macros.h" +#include "dynlists/dynlists.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "objects.h" +#include "particles.h" +#include "renderer.h" +#include "shape_helper.h" +#include "skin.h" + +#ifndef VERSION_EU +#include +#endif + +// data +struct ObjGroup *gMarioFaceGrp = NULL; // @ 801A82E0; returned by load_dynlist +struct ObjShape *gSpotShape = NULL; // Shape used for drawing lights? +static struct ObjShape *sGrabJointTestShape = NULL; // Test shape for showing grab joints. This isn't rendered due to make_grabber_joint setting the drawFlags to OBJ_INVISIBLE. +struct ObjShape *gShapeRedSpark = NULL; // @ 801A82EC +struct ObjShape *gShapeSilverSpark = NULL; // @ 801A82F0 +struct ObjShape *gShapeRedStar = NULL; // @ 801A82F4 +struct ObjShape *gShapeSilverStar = NULL; // @ 801A82F8 + +// Not sure what this data is, but it looks like stub animation data + +static struct GdAnimTransform unusedAnimData1[] = { + { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, +}; + +static struct AnimDataInfo unusedAnim1 = { ARRAY_COUNT(unusedAnimData1), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData1 }; + +static struct GdAnimTransform unusedAnimData2[] = { + { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, +}; + +static struct AnimDataInfo unusedAnim2 = { ARRAY_COUNT(unusedAnimData2), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData2 }; + +static struct GdAnimTransform unusedAnimData3[] = { + { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, +}; + +static struct AnimDataInfo unusedAnim3 = { ARRAY_COUNT(unusedAnimData3), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData3 }; + +static s32 sUnref801A838C[6] = { 0 }; +struct ObjShape *sSimpleShape = NULL; +static s32 sUnref801A83A8[31] = { 0 }; +static struct DynList sSimpleDylist[8] = { // unused + BeginList(), + StartGroup("simpleg"), + MakeDynObj(D_NET, "simple"), + SetType(3), + SetShapePtrPtr(&sSimpleShape), + EndGroup("simpleg"), + UseObj("simpleg"), + EndList(), +}; +static struct DynList sDynlist801A84E4[3] = { + BeginList(), + SetFlag(0x1800), + EndList(), +}; +static struct DynList sDynlist801A85B3[5] = { + BeginList(), CallList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01), + EndList(), +}; +static struct DynList sDynlist801A85A4[4] = { + BeginList(), + CallList(sDynlist801A84E4), + SetFriction(0.04, 0.01, 0.01), + EndList(), +}; +static struct DynList sDynlist801A8604[4] = { + BeginList(), + CallList(sDynlist801A84E4), + SetFriction(0.005, 0.005, 0.005), + EndList(), +}; +static f64 D_801A8668 = 0.0; + +// bss +static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00 +static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C +static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30 +static struct ObjShape *sCubeShape; // @ 801BAB3C +static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40 +static char sGdLineBuf[0x100]; // @ 801BAB48 +static s32 sGdLineBufCsr; // @ 801BAC48 +static struct GdFile *sGdShapeFile; // @ 801BAC4C +static struct ObjShape *sGdShapeListHead; // @ 801BAC50 +static u32 sGdShapeCount; // @ 801BAC54 +static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58 +static struct GdVec3f D_801BAC60; +static u32 sUnrefSpaceC6C; // @ 801BAC6C +static u32 sUnrefSpaceC70; // @ 801BAC70 +static struct ObjPlane *D_801BAC74; +static struct ObjPlane *D_801BAC78; // sShapeNetHead? +static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 +static struct ObjFace *D_801BAC9C; +static struct ObjFace *D_801BACA0; +static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 +/// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()` +static struct GdVec3f sVertexScaleFactor; +/// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()` +static struct GdVec3f sVertexTranslateOffset; +static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 +static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape +static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 +static struct GdVec3f sShapeCenter; // printed with "c=" +static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 + +// Forward Declarations +struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32); + +/* @ 245A50 for 0x40 */ +/* Something to do with shape list/group initialization? */ +void func_80197280(void) { + sGdShapeCount = 0; + sGdShapeListHead = NULL; + gGdLightGroup = make_group(0); +} + +/** + * Computes the normal vector for a face based on three of its vertices. + */ +void calc_face_normal(struct ObjFace *face) { + UNUSED u32 pad5C; + struct GdVec3f p1; + struct GdVec3f p2; + struct GdVec3f p3; + struct GdVec3f normal; + struct ObjVertex *vtx1; + struct ObjVertex *vtx2; + struct ObjVertex *vtx3; + UNUSED u32 pad1C; + f32 mul = 1000.0f; + + imin("calc_facenormal"); + + if (face->vtxCount >= 3) { // need at least three points to compute a normal + vtx1 = face->vertices[0]; + p1.x = vtx1->pos.x; + p1.y = vtx1->pos.y; + p1.z = vtx1->pos.z; + + vtx2 = face->vertices[1]; + p2.x = vtx2->pos.x; + p2.y = vtx2->pos.y; + p2.z = vtx2->pos.z; + + vtx3 = face->vertices[2]; + p3.x = vtx3->pos.x; + p3.y = vtx3->pos.y; + p3.z = vtx3->pos.z; + + // calculate the cross product of edges (p2 - p1) and (p3 - p2) + // not sure why each component is multiplied by 1000. maybe to avoid loss of precision when normalizing? + normal.x = (((p2.y - p1.y) * (p3.z - p2.z)) - ((p2.z - p1.z) * (p3.y - p2.y))) * mul; + normal.y = (((p2.z - p1.z) * (p3.x - p2.x)) - ((p2.x - p1.x) * (p3.z - p2.z))) * mul; + normal.z = (((p2.x - p1.x) * (p3.y - p2.y)) - ((p2.y - p1.y) * (p3.x - p2.x))) * mul; + + gd_normalize_vec3f(&normal); + + face->normal.x = normal.x; + face->normal.y = normal.y; + face->normal.z = normal.z; + } + imout(); +} + +/* @ 245CDC for 0x118 */ +struct ObjVertex *gd_make_vertex(f32 x, f32 y, f32 z) { + struct ObjVertex *vtx; + + vtx = (struct ObjVertex *) make_object(OBJ_TYPE_VERTICES); + vtx->id = 0xD1D4; + + vtx->pos.x = x; + vtx->pos.y = y; + vtx->pos.z = z; + + vtx->initPos.x = x; + vtx->initPos.y = y; + vtx->initPos.z = z; + + vtx->scaleFactor = 1.0f; + vtx->gbiVerts = NULL; + vtx->alpha = 1.0f; + + vtx->normal.x = 0.0f; + vtx->normal.y = 1.0f; + vtx->normal.z = 0.0f; + + return vtx; +} + +/* @ 245DF4 for 0xAC */ +struct ObjFace *make_face_with_colour(f32 r, f32 g, f32 b) { + struct ObjFace *newFace; + + imin("make_face"); + newFace = (struct ObjFace *) make_object(OBJ_TYPE_FACES); + + newFace->colour.r = r; + newFace->colour.g = g; + newFace->colour.b = b; + + newFace->vtxCount = 0; + newFace->mtlId = -1; + newFace->mtl = NULL; + + imout(); + return newFace; +} + +/* @ 245EA0 for 0x6C */ +struct ObjFace *make_face_with_material(struct ObjMaterial *mtl) { + struct ObjFace *newFace; + + newFace = (struct ObjFace *) make_object(OBJ_TYPE_FACES); + + newFace->vtxCount = 0; + newFace->mtlId = mtl->id; + newFace->mtl = mtl; + + return newFace; +} + +/* @ 245F0C for 0x88 */ +void add_4_vertices_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjVertex *vtx2, + struct ObjVertex *vtx3, struct ObjVertex *vtx4) { + face->vertices[0] = vtx1; + face->vertices[1] = vtx2; + face->vertices[2] = vtx3; + face->vertices[3] = vtx4; + face->vtxCount = 4; + calc_face_normal(face); +} + +/* @ 245F94 for 0x78; orig name: func_801977C4 */ +void add_3_vtx_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjVertex *vtx2, + struct ObjVertex *vtx3) { + face->vertices[0] = vtx1; + face->vertices[1] = vtx2; + face->vertices[2] = vtx3; + face->vtxCount = 3; + calc_face_normal(face); +} + +/** + * Creates an `ObjShape` object + */ +struct ObjShape *make_shape(s32 flag, const char *name) { + struct ObjShape *newShape; + struct ObjShape *curShapeHead; + UNUSED u32 pad; + + newShape = (struct ObjShape *) make_object(OBJ_TYPE_SHAPES); + + if (name != NULL) { + gd_strcpy(newShape->name, name); + } else { + gd_strcpy(newShape->name, "NoName"); + } + + sGdShapeCount++; + + curShapeHead = sGdShapeListHead; + sGdShapeListHead = newShape; + + if (curShapeHead != NULL) { + newShape->nextShape = curShapeHead; + curShapeHead->prevShape = newShape; + } + + newShape->id = sGdShapeCount; + newShape->flag = flag; + + newShape->vtxCount = 0; + newShape->faceCount = 0; + newShape->dlNums[0] = 0; + newShape->dlNums[1] = 0; + newShape->unk3C = 0; + newShape->faceGroup = NULL; /* whoops, NULL-ed twice */ + + newShape->alpha = 1.0f; + + newShape->vtxGroup = NULL; + newShape->faceGroup = NULL; + newShape->mtlGroup = NULL; + newShape->unk30 = 0; + newShape->unk50 = 0; + + return newShape; +} + +/* @ 2461A4 for 0x30; orig name: func_801979D4 */ +void clear_buf_to_cr(void) { + sGdLineBufCsr = 0; + sGdLineBuf[sGdLineBufCsr] = '\r'; +} + +/* @ 2461D4 for 0x2c; orig name: func_80197A04 */ +s8 get_current_buf_char(void) { + return sGdLineBuf[sGdLineBufCsr]; +} + +/* @ 246200 for 0x64; orig name: func_80197A30 */ +s8 get_and_advance_buf(void) { + if (get_current_buf_char() == '\0') { + return '\0'; + } + + return sGdLineBuf[sGdLineBufCsr++]; +} + +/* @ 246264 for 0x80; orig name: func_80197A94 */ +s8 load_next_line_into_buf(void) { + sGdLineBufCsr = 0; + + if (gd_feof(sGdShapeFile) != 0) { + sGdLineBuf[sGdLineBufCsr] = '\0'; + } else { + gd_fread_line(sGdLineBuf, 0xFF, sGdShapeFile); + } + + return get_current_buf_char(); +} + +/* @ 2462E4 for 0x38; orig name: func_80197B14 */ +s32 is_line_end(char c) { + return c == '\r' || c == '\n'; +} + +/* @ 24631C for 0x38; orig name: func_80197B4C */ +s32 is_white_space(char c) { + return c == ' ' || c == '\t'; +} + +/* @ 246354 for 0xEC; orig name: func_80197B84 */ +/* Advances buffer cursor to next non-white-space character, if possible. + * Returns TRUE if a character is found, or FALSE if EOF or \0 */ +s32 scan_to_next_non_whitespace(void) { + char curChar; + + for (curChar = get_current_buf_char(); curChar != '\0'; curChar = get_current_buf_char()) { + if (is_white_space(curChar)) { + get_and_advance_buf(); + continue; + } + + if (curChar == '\x1a') { //'SUB' character: "soft EOF" in older systems + return FALSE; + continue; // unreachable + } + + if (is_line_end(curChar)) { + if (load_next_line_into_buf() == '\0') { + return FALSE; + } + } else { + break; + } + } + + return !!curChar; +} + +/* @ 246440 for 0xE0; orig name: func_80197C70 */ +s32 is_next_buf_word(char *a0) { + char curChar; + char wordBuf[0xfc]; + u32 bufLength; + + bufLength = 0; + for (curChar = get_and_advance_buf(); curChar != '\0'; curChar = get_and_advance_buf()) { + if (is_white_space(curChar) || is_line_end(curChar)) { + break; + continue; // unreachable + nonsensical + } + wordBuf[bufLength] = curChar; + bufLength++; + } + + wordBuf[bufLength] = '\0'; + + return !gd_str_not_equal(a0, wordBuf); +} + +/* @ 246520 for 0x198; orig name: func_80197D50 */ +s32 getfloat(f32 *floatPtr) { + char charBuf[0x100]; + u32 bufCsr; + char curChar; + u32 sp34; + f64 parsedDouble; + + imin("getfloat"); + + if (is_line_end(get_current_buf_char())) { + fatal_printf("getfloat(): Unexpected EOL"); + } + + while (is_white_space(get_current_buf_char())) { + get_and_advance_buf(); + } + + bufCsr = 0; + + for (curChar = get_and_advance_buf(); curChar != '\0'; curChar = get_and_advance_buf()) { + if (!is_white_space(curChar) && !is_line_end(curChar)) { + charBuf[bufCsr] = curChar; + bufCsr++; + } else { + break; + } + } + + charBuf[bufCsr] = '\0'; + + parsedDouble = gd_lazy_atof(charBuf, &sp34); + *floatPtr = (f32) parsedDouble; + + imout(); + return !!bufCsr; +} + +/* @ 2466B8 for 0x180; orig name: func_80197EE8 */ +s32 getint(s32 *intPtr) { + char charBuf[0x100]; + u32 bufCsr; + char curChar; + + imin("getint"); + + if (is_line_end(get_current_buf_char())) { + fatal_printf("getint(): Unexpected EOL"); + } + + while (is_white_space(get_current_buf_char())) { + get_and_advance_buf(); + } + + bufCsr = 0; + for (curChar = get_and_advance_buf(); curChar != '\0'; curChar = get_and_advance_buf()) { + if (is_white_space(curChar) || is_line_end(curChar)) { + break; + } + + charBuf[bufCsr] = curChar; + bufCsr++; + } + + charBuf[bufCsr] = '\0'; + *intPtr = gd_atoi(charBuf); + + imout(); + return !!bufCsr; +} + +/* @ 246838 for 0x14 */ +void Unknown80198068(UNUSED f32 a0) { + printf("max=%f\n", a0); +} + +/* @ 24684C for 0x6C */ +void func_8019807C(struct ObjVertex *vtx) { + gd_rot_2d_vec(D_801BAC60.x, &vtx->pos.y, &vtx->pos.z); + gd_rot_2d_vec(D_801BAC60.y, &vtx->pos.x, &vtx->pos.z); + gd_rot_2d_vec(D_801BAC60.z, &vtx->pos.x, &vtx->pos.y); +} + +/* @ 2468B8 for 0x6C */ +void func_801980E8(f32 *a0) { + gd_rot_2d_vec(D_801BAC60.x, &a0[1], &a0[2]); + gd_rot_2d_vec(D_801BAC60.y, &a0[0], &a0[2]); + gd_rot_2d_vec(D_801BAC60.z, &a0[0], &a0[1]); +} + +/* @ 246924 for 0x30 */ +void Unknown80198154(f32 x, f32 y, f32 z) { + D_801BAC60.x = x; + D_801BAC60.y = y; + D_801BAC60.z = z; +} + +/* @ 246954 for 0x6c */ +void Unknown80198184(struct ObjShape *shape, f32 x, f32 y, f32 z) { + UNUSED struct GdVec3f unusedVec; + unusedVec.x = x; + unusedVec.y = y; + unusedVec.z = z; + + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) func_8019807C, shape->vtxGroup); +} + +/* @ 2469C0 for 0xc8 */ +void scale_obj_position(struct GdObj *obj) { + struct GdVec3f pos; + + if (obj->type == OBJ_TYPE_GROUPS) { + return; + } + + set_cur_dynobj(obj); + d_get_rel_pos(&pos); + + pos.x *= sVertexScaleFactor.x; + pos.y *= sVertexScaleFactor.y; + pos.z *= sVertexScaleFactor.z; + + d_set_rel_pos(pos.x, pos.y, pos.z); + d_set_init_pos(pos.x, pos.y, pos.z); +} + +/* @ 246A88 for 0x94 */ +void translate_obj_position(struct GdObj *obj) { + struct GdVec3f pos; + + set_cur_dynobj(obj); + d_get_rel_pos(&pos); + + pos.x += sVertexTranslateOffset.x; + pos.y += sVertexTranslateOffset.y; + pos.z += sVertexTranslateOffset.z; + + d_set_rel_pos(pos.x, pos.y, pos.z); +} + +/* @ 246B1C for 0x88 */ +void scale_verts_in_shape(struct ObjShape *shape, f32 x, f32 y, f32 z) { + sVertexScaleFactor.x = x; + sVertexScaleFactor.y = y; + sVertexScaleFactor.z = z; + + if (shape->vtxGroup != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) scale_obj_position, shape->vtxGroup); + } +} + +/* @ 246BA4 for 0x70; not called */ +// Guessing on the type of a0 +void translate_verts_in_shape(struct ObjShape *shape, f32 x, f32 y, f32 z) { + sVertexTranslateOffset.x = x; + sVertexTranslateOffset.y = y; + sVertexTranslateOffset.z = z; + + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) translate_obj_position, shape->vtxGroup); +} + +/* @ 246C14 for 0xe0 */ +void Unknown80198444(struct ObjVertex *vtx) { + f64 distance; + + add_obj_pos_to_bounding_box(&vtx->header); + + distance = vtx->pos.x * vtx->pos.x + vtx->pos.y * vtx->pos.y + vtx->pos.z * vtx->pos.z; + + if (distance != 0.0) { + distance = gd_sqrt_d(distance); // sqrtd? + + if (distance > D_801A8668) { + D_801A8668 = distance; + } + } +} + +/* @ 246CF4 for 0xc4 */ +void Unknown80198524(struct ObjVertex *vtx) { + vtx->pos.x -= sShapeCenter.x; + vtx->pos.y -= sShapeCenter.y; + vtx->pos.z -= sShapeCenter.z; + + vtx->pos.x /= D_801A8668; + vtx->pos.y /= D_801A8668; + vtx->pos.z /= D_801A8668; +} + +/* @ 246DB8 for 0x11c */ +void Unknown801985E8(struct ObjShape *shape) { + struct GdBoundingBox bbox; + + D_801A8668 = 0.0; + reset_bounding_box(); + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) Unknown80198444, shape->vtxGroup); + + get_some_bounding_box(&bbox); + + sShapeCenter.x = (f32)((bbox.minX + bbox.maxX) / 2.0); //? 2.0f + sShapeCenter.y = (f32)((bbox.minY + bbox.maxY) / 2.0); //? 2.0f + sShapeCenter.z = (f32)((bbox.minZ + bbox.maxZ) / 2.0); //? 2.0f + + gd_print_vec("c=", &sShapeCenter); + + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) Unknown80198524, shape->vtxGroup); +} + +/* @ 246ED4 for 0x4FC; orig name: func_80198704 */ +void get_3DG1_shape(struct ObjShape *shape) { + UNUSED u8 pad78[8]; + struct GdVec3f tempNormal; /* maybe? */ + s32 curFaceVtx; + s32 faceVtxID; + s32 totalVtx; + s32 totalFacePoints; + struct GdVec3f tempVec; + struct ObjFace *newFace; + struct ObjVertex *vtxHead = NULL; // ptr to first made ObjVertex in the Obj* list + s32 vtxCount = 0; + struct ObjFace *faceHead = NULL; // ptr to first made OBjFace in the Obj* list + s32 faceCount = 0; + struct ObjFace **facePtrArr; + struct ObjVertex **vtxPtrArr; + struct ObjMaterial *mtl; + + shape->mtlGroup = make_group(0); + imin("get_3DG1_shape"); + + vtxPtrArr = gd_malloc_perm(72000 * sizeof(struct ObjVertex *)); // 288,000 = 72,000 * 4 + facePtrArr = gd_malloc_perm(76000 * sizeof(struct ObjFace *)); // 304,000 = 76,000 * 4 + + tempNormal.x = 0.0f; + tempNormal.y = 0.0f; + tempNormal.z = 1.0f; + + load_next_line_into_buf(); + if (!getint(&totalVtx)) { + fatal_printf("Missing number of points"); + } + + load_next_line_into_buf(); + while (scan_to_next_non_whitespace()) { + getfloat(&tempVec.x); + getfloat(&tempVec.y); + getfloat(&tempVec.z); + vtxPtrArr[vtxCount] = gd_make_vertex(tempVec.x, tempVec.y, tempVec.z); + + if (vtxHead == NULL) { + vtxHead = vtxPtrArr[vtxCount]; + } + + func_8019807C(vtxPtrArr[vtxCount]); + vtxCount++; + + if (vtxCount >= 4000) { + fatal_printf("Too many vertices in shape data"); + } + + shape->vtxCount++; + clear_buf_to_cr(); + + if (--totalVtx == 0) { /* Count down vertex ponts */ + break; + } + } + + while (scan_to_next_non_whitespace()) { + if (!getint(&totalFacePoints)) { + fatal_printf("Missing number of points in face"); + } + + mtl = find_or_add_new_mtl(shape->mtlGroup, 0, tempNormal.x, tempNormal.y, tempNormal.z); + newFace = make_face_with_material(mtl); + + if (faceHead == NULL) { + faceHead = newFace; + } + + facePtrArr[faceCount] = newFace; + faceCount++; + if (faceCount >= 4000) { + fatal_printf("Too many faces in shape data"); + } + + curFaceVtx = 0; + while (get_current_buf_char() != '\0') { + getint(&faceVtxID); + + if (curFaceVtx > 3) { + fatal_printf("Too many points in a face(%d)", curFaceVtx); + } + + newFace->vertices[curFaceVtx] = vtxPtrArr[faceVtxID]; + curFaceVtx++; + + if (is_line_end(get_current_buf_char()) || --totalFacePoints == 0) { + break; + } + } + + newFace->vtxCount = curFaceVtx; + + if (newFace->vtxCount > 3) { + fatal_printf("Too many points in a face(%d)", newFace->vtxCount); + } + + calc_face_normal(newFace); + + tempNormal.x = newFace->normal.x > 0.0f ? 1.0f : 0.0f; + tempNormal.y = newFace->normal.y > 0.0f ? 1.0f : 0.0f; + tempNormal.z = newFace->normal.z > 0.0f ? 1.0f : 0.0f; + + shape->faceCount++; + + clear_buf_to_cr(); + } + + gd_free(vtxPtrArr); + gd_free(facePtrArr); + + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) vtxHead, NULL); + shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj *) faceHead, NULL); + + imout(); +} + +/* @ 2473D0 for 0x390; orig name: func_80198C00 */ +void get_OBJ_shape(struct ObjShape *shape) { + UNUSED u8 pad7D54[4]; + struct GdColour faceClr; + s32 curFaceVtx; + s32 faceVtxIndex; + struct GdVec3f tempVec; + struct ObjFace *newFace; + struct ObjVertex *vtxArr[4000]; + struct ObjFace *faceArr[4000]; + s32 faceCount = 0; + s32 vtxCount = 0; + + faceClr.r = 1.0f; + faceClr.g = 0.5f; + faceClr.b = 1.0f; + + sGdLineBufCsr = 0; + + while (scan_to_next_non_whitespace()) { + switch (get_and_advance_buf()) { + case 'v': + getfloat(&tempVec.x); + getfloat(&tempVec.y); + getfloat(&tempVec.z); + + vtxArr[vtxCount] = gd_make_vertex(tempVec.x, tempVec.y, tempVec.z); + func_8019807C(vtxArr[vtxCount]); + vtxCount++; + + if (vtxCount >= 4000) { + fatal_printf("Too many vertices in shape data"); + } + + shape->vtxCount++; + break; + + case 'f': + newFace = make_face_with_colour(faceClr.r, faceClr.g, faceClr.b); + faceArr[faceCount] = newFace; + faceCount++; + + if (faceCount >= 4000) { + fatal_printf("Too many faces in shape data"); + } + + curFaceVtx = 0; + while (get_current_buf_char() != '\0') { + getint(&faceVtxIndex); + + if (curFaceVtx > 3) { + fatal_printf("Too many points in a face(%d)", curFaceVtx); + } + + /* .obj vertex list is 1-indexed */ + newFace->vertices[curFaceVtx] = vtxArr[faceVtxIndex - 1]; + curFaceVtx++; + + if (is_line_end(get_current_buf_char())) { + break; + } + } + + /* These are already set by make_face_with_colour... */ + newFace->colour.r = faceClr.r; + newFace->colour.g = faceClr.g; + newFace->colour.b = faceClr.b; + + newFace->vtxCount = curFaceVtx; + + if (newFace->vtxCount > 3) { + fatal_printf("Too many points in a face(%d)", newFace->vtxCount); + } + + calc_face_normal(newFace); + + shape->faceCount++; + break; + + case 'g': + break; + case '#': + break; + default: + break; + } + + clear_buf_to_cr(); + } + + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) vtxArr[0], NULL); + shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj *) faceArr[0], NULL); +} + +/* @ 247760 for 0x124; orig name: func_80198F90 */ +struct ObjGroup *group_faces_in_mtl_grp(struct ObjGroup *mtlGroup, struct GdObj *fromObj, + struct GdObj *toObj) { + struct ObjMaterial *curObjAsMtl; + struct ObjGroup *newGroup; + struct GdObj *curObj; + register struct ListNode *node; + struct GdObj *curLinkedObj; + + newGroup = make_group(0); + + for (node = mtlGroup->firstMember; node != NULL; node = node->next) { + curLinkedObj = node->obj; + curObjAsMtl = (struct ObjMaterial *) curLinkedObj; + + curObj = fromObj; + while (curObj != NULL) { + if (curObj == toObj) { + break; + } + + if (curObj->type == OBJ_TYPE_FACES) { + if (((struct ObjFace *) curObj)->mtl == curObjAsMtl) { + addto_group(newGroup, curObj); + } + } + curObj = curObj->prev; + } + } + + return newGroup; +} + +/* @ 247884 for 0x13c; orig name: func_801990B4 */ +struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *group, UNUSED s32 a1, f32 r, f32 g, f32 b) { + struct ObjMaterial *newMtl; + register struct ListNode *node; + struct ObjMaterial *foundMtl; + + for (node = group->firstMember; node != NULL; node = node->next) { + foundMtl = (struct ObjMaterial *) node->obj; + + if (foundMtl->header.type == OBJ_TYPE_MATERIALS) { + if (foundMtl->Kd.r == r) { + if (foundMtl->Kd.g == g) { + if (foundMtl->Kd.b == b) { + return foundMtl; + } + } + } + } + } + + newMtl = make_material(0, NULL, 1); + set_cur_dynobj((struct GdObj *)newMtl); + d_set_diffuse(r, g, b); + addto_group(group, (struct GdObj *) newMtl); + + return newMtl; +} + +/* @ 2479C0 for 0x470; orig name: func_801991F0 */ +void read_ARK_shape(struct ObjShape *shape, char *fileName) { + union { + s8 bytes[0x48]; + struct { + u8 pad[0x40]; + s32 word40; + s32 word44; + } data; + } fileInfo; + + union { + s8 bytes[0x10]; + struct { + f32 v[3]; + s32 faceCount; + } data; + } faceInfo; // face normal x,y,z? + count + + union { + s8 bytes[0x10]; + struct { + s32 vtxCount; + f32 x, y, z; + } data; + } face; // face vtx count + vtx x,y,z ? + + union { + s8 bytes[0x18]; + struct { + f32 v[3]; + f32 nv[3]; /* Guessing on the normals; they aren't used */ + } data; + } vtx; + + UNUSED u8 pad54[4]; + struct GdVec3f sp48; + struct ObjFace *sp44; // newly made face with mtl sp34; + struct ObjFace *sp40 = NULL; // first made face + struct ObjVertex *sp3C; // newly made vtx + struct ObjVertex *sp38 = NULL; // first made vtx + struct ObjMaterial *sp34; // found or new mtl for face + UNUSED s32 sp30 = 0; + UNUSED s32 sp2C = 0; + + shape->mtlGroup = make_group(0); + + sp48.x = 1.0f; + sp48.y = 0.5f; + sp48.z = 1.0f; + + sGdShapeFile = gd_fopen(fileName, "rb"); + + if (sGdShapeFile == NULL) { + fatal_printf("Cant load shape '%s'", fileName); + } + + gd_fread(fileInfo.bytes, 0x48, 1, sGdShapeFile); + stub_renderer_12(&fileInfo.bytes[0x40]); // face count? + stub_renderer_12(&fileInfo.bytes[0x44]); + + while (fileInfo.data.word40-- > 0) { + gd_fread(faceInfo.bytes, 0x10, 1, sGdShapeFile); + stub_renderer_14(&faceInfo.bytes[0x0]); + stub_renderer_14(&faceInfo.bytes[0x4]); + stub_renderer_14(&faceInfo.bytes[0x8]); + + sp48.x = faceInfo.data.v[0]; + sp48.y = faceInfo.data.v[1]; + sp48.z = faceInfo.data.v[2]; + + sp34 = find_or_add_new_mtl(shape->mtlGroup, 0, sp48.x, sp48.y, sp48.z); + + stub_renderer_12(&faceInfo.bytes[0xC]); + + while (faceInfo.data.faceCount-- > 0) { + shape->faceCount++; + gd_fread(face.bytes, 0x10, 1, sGdShapeFile); + stub_renderer_14(&face.bytes[0x4]); // read word as f32? + stub_renderer_14(&face.bytes[0x8]); + stub_renderer_14(&face.bytes[0xC]); + + sp44 = make_face_with_material(sp34); + + if (sp40 == NULL) { + sp40 = sp44; + } + + stub_renderer_12(&face.bytes[0x0]); + + if (face.data.vtxCount > 3) { + while (face.data.vtxCount-- > 0) { + gd_fread(vtx.bytes, 0x18, 1, sGdShapeFile); + } + continue; + } + + while (face.data.vtxCount-- > 0) { + shape->vtxCount++; + gd_fread(vtx.bytes, 0x18, 1, sGdShapeFile); + stub_renderer_14(&vtx.bytes[0x00]); + stub_renderer_14(&vtx.bytes[0x04]); + stub_renderer_14(&vtx.bytes[0x08]); + stub_renderer_14(&vtx.bytes[0x0C]); + stub_renderer_14(&vtx.bytes[0x10]); + stub_renderer_14(&vtx.bytes[0x14]); + + func_801980E8(vtx.data.v); + sp3C = gd_make_vertex(vtx.data.v[0], vtx.data.v[1], vtx.data.v[2]); + + if (sp44->vtxCount > 3) { + fatal_printf("Too many points in a face(%d)", sp44->vtxCount); + } + + sp44->vertices[sp44->vtxCount] = sp3C; + sp44->vtxCount++; + + if (sp38 == NULL) { + sp38 = sp3C; + } + } + + calc_face_normal(sp44); + } + } + + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) sp38, NULL); + shape->faceGroup = group_faces_in_mtl_grp(shape->mtlGroup, (struct GdObj *) sp40, NULL); + gd_fclose(sGdShapeFile); +} + +/* @ 247E30 for 0x148; orig name: Unknown80199660 */ +struct GdFile *get_shape_from_file(struct ObjShape *shape, char *fileName) { + printf("Loading %s...\n", fileName); + start_memtracker(fileName); + shape->unk3C = 0; + shape->faceCount = 0; + shape->vtxCount = 0; + + if (gd_str_contains(fileName, ".ark")) { + read_ARK_shape(shape, fileName); + } else { + sGdShapeFile = gd_fopen(fileName, "r"); + + if (sGdShapeFile == NULL) { + fatal_printf("Cant open shape '%s'", fileName); + } + + sGdLineBufCsr = 0; + sGdLineBuf[sGdLineBufCsr] = '\0'; + load_next_line_into_buf(); + + if (is_next_buf_word("3DG1")) { + get_3DG1_shape(shape); + } else { + get_OBJ_shape(shape); + } + + printf("Num Vertices=%d\n", shape->vtxCount); + printf("Num Faces=%d\n", shape->faceCount); + printf("\n"); + + gd_fclose(sGdShapeFile); + } + + stop_memtracker(fileName); + + return sGdShapeFile; +} + +/* @ 247F78 for 0x69c; orig name: Unknown801997A8 */ +struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 a3, s32 a4) { + UNUSED u32 pad1074; + void *objBuf[32][32]; // vertex or particle depending on gridType + f32 sp70; + f32 sp6C; + f32 sp68; + UNUSED u32 pad64; + UNUSED u32 pad60; + f32 sp5C; + s32 parI; + s32 row; + s32 col; + UNUSED s32 sp4C = 0; + struct ObjShape *gridShape; + f32 sp44; + struct ObjFace *sp40 = NULL; // first made shape? + struct ObjGroup *parOrVtxGrp; // group of made particles or vertices (based on gridType) + UNUSED u32 pad38; + struct ObjGroup *mtlGroup; + struct GdVec3f *sp30; // GdVec3f* ? from gd_get_colour + struct GdVec3f *sp2C; //^ + struct ObjMaterial *mtl1; // first made material + struct ObjMaterial *mtl2; // second made material + UNUSED u32 pad20; + + sp30 = (struct GdVec3f *) gd_get_colour(a1); + sp2C = (struct GdVec3f *) gd_get_colour(a2); + + mtl1 = make_material(0, NULL, 1); + set_cur_dynobj((struct GdObj *) mtl1); + d_set_diffuse(sp30->x, sp30->y, sp30->z); + mtl1->type = 0x40; + + mtl2 = make_material(0, NULL, 2); + set_cur_dynobj((struct GdObj *) mtl2); + d_set_diffuse(sp2C->x, sp2C->y, sp2C->z); + mtl2->type = 0x40; + + mtlGroup = make_group(2, mtl1, mtl2); + gridShape = make_shape(0, "grid"); + gridShape->faceCount = 0; + gridShape->vtxCount = 0; + + sp44 = 2.0 / a3; //? 2.0f + sp5C = -1.0f; + sp6C = 0.0f; + sp70 = -1.0f; + + for (col = 0; col <= a4; col++) { + sp68 = sp5C; + for (row = 0; row <= a3; row++) { + gridShape->vtxCount++; + if (gridType == OBJ_TYPE_VERTICES) { + objBuf[row][col] = gd_make_vertex(sp68, sp6C, sp70); + } else if (gridType == OBJ_TYPE_PARTICLES) { + objBuf[row][col] = make_particle(0, 0, sp68, sp6C + 2.0f, sp70); + ((struct ObjParticle *) objBuf[row][col])->unk44 = (1.0 + sp68) / 2.0; + ((struct ObjParticle *) objBuf[row][col])->unk48 = (1.0 + sp70) / 2.0; + } + sp68 += sp44; + } + sp70 += sp44; + } + + for (col = 0; col < a4; col++) { + for (row = 0; row < a3; row++) { + gridShape->faceCount += 2; + if (a1 != a2) { + if ((row + col) & 1) { + D_801BAC9C = make_face_with_material(mtl1); + D_801BACA0 = make_face_with_material(mtl1); + } else { + D_801BAC9C = make_face_with_material(mtl2); + D_801BACA0 = make_face_with_material(mtl2); + } + } else { + D_801BAC9C = make_face_with_material(mtl1); + D_801BACA0 = make_face_with_material(mtl2); + } + + if (sp40 == NULL) { + sp40 = D_801BAC9C; + } + + add_3_vtx_to_face(D_801BAC9C, objBuf[row][col + 1], objBuf[row + 1][col + 1], + objBuf[row][col]); + add_3_vtx_to_face(D_801BACA0, objBuf[row + 1][col + 1], objBuf[row + 1][col], + objBuf[row][col]); + } + } + + if (gridType == OBJ_TYPE_PARTICLES) { + for (parI = 0; parI <= a3; parI++) { + ((struct ObjParticle *) objBuf[parI][0])->flags |= 2; + ((struct ObjParticle *) objBuf[parI][a4])->flags |= 2; + } + + for (parI = 0; parI <= a4; parI++) { + ((struct ObjParticle *) objBuf[0][parI])->flags |= 2; + ((struct ObjParticle *) objBuf[a3][parI])->flags |= 2; + } + } + + parOrVtxGrp = make_group_of_type(gridType, (struct GdObj *) objBuf[0][0], NULL); + gridShape->vtxGroup = parOrVtxGrp; + gridShape->mtlGroup = mtlGroup; + + gridShape->faceGroup = group_faces_in_mtl_grp(gridShape->mtlGroup, (struct GdObj *) sp40, NULL); + + printf("grid: points=%d, faces=%d\n", gridShape->vtxGroup->id, gridShape->faceGroup->id); + return gridShape; +} + +/* @ 248614 for 0x44 */ +void Unknown80199E44(UNUSED s32 a0, struct GdObj *a1, struct GdObj *a2, UNUSED s32 a3) { + UNUSED struct ObjGroup *sp1C = make_group(2, a1, a2); +} + +/* @ 248658 for 0x5c */ +void Unknown80199E88(struct ObjFace *face) { + D_801BAC74 = make_plane(FALSE, face); + + if (D_801BAC78 == NULL) { + D_801BAC78 = D_801BAC74; + } +} + +/* @ 2486B4 for 0xbc; orig name: func_80199EE4 */ +struct ObjNet *make_netfromshape(struct ObjShape *shape) { + struct ObjNet *newNet; + + if (shape == NULL) { + fatal_printf("make_netfromshape(): null shape ptr"); + } + + D_801BAC78 = NULL; + apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t) Unknown80199E88, shape->faceGroup); + D_801BAD08 = make_group_of_type(OBJ_TYPE_PLANES, (struct GdObj *) D_801BAC78, NULL); + newNet = make_net(0, shape, NULL, D_801BAD08, shape->vtxGroup); + newNet->netType = 1; + + return newNet; +} + +/** + * Controls the dizzy (game over) animation of Mario's head. + */ +void animate_mario_head_gameover(struct ObjAnimator *self) { + switch (self->state) { + case 0: + self->frame = 1.0f; + self->animSeqNum = 1; // game over anim sequence + self->state = 1; + break; + case 1: + self->frame += 1.0f; + // After the gameover animation ends, switch to the normal animation + if (self->frame == 166.0f) { + self->frame = 69.0f; + self->state = 4; + self->controlFunc = animate_mario_head_normal; + self->animSeqNum = 0; // normal anim sequence + } + break; + } +} + +/** + * Controls the normal animation of Mario's head. This functions like a state machine. + */ +void animate_mario_head_normal(struct ObjAnimator *self) { + s32 state = 0; // TODO: label these states + s32 aBtnPressed = gGdCtrl.dragging; + + switch (self->state) { + case 0: + // initialize? + self->frame = 1.0f; + self->animSeqNum = 0; // normal anim sequence + state = 2; + self->nods = 5; + break; + case 2: + if (aBtnPressed) { + state = 5; + } + + self->frame += 1.0f; + + if (self->frame == 810.0f) { + self->frame = 750.0f; + self->nods -= 1; + if (self->nods == 0) { + state = 3; + } + } + break; + case 3: + self->frame += 1.0f; + + if (self->frame == 820.0f) { + self->frame = 69.0f; + state = 4; + } + break; + case 4: + self->frame += 1.0f; + + if (self->frame == 660.0f) { + self->frame = 661.0f; + state = 2; + self->nods = 5; + } + break; + case 5: + if (self->frame == 660.0f) { + state = 7; + } else if (self->frame > 660.0f) { + self->frame -= 1.0f; + } else if (self->frame < 660.0f) { + self->frame += 1.0f; + } + + self->stillTimer = 150; + break; + case 7: // Mario is staying still while his eyes follow the cursor + if (aBtnPressed) { + self->stillTimer = 300; + } else { + self->stillTimer--; + if (self->stillTimer == 0) { + state = 6; + } + } + self->frame = 660.0f; + break; + case 6: + state = 2; + self->nods = 5; + break; + } + + if (state != 0) { + self->state = state; + } +} + +/** + * Loads the Mario head from `dynlist_mario_master`, sets up grabbers, and makes + * sparkle particles + */ +s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { + struct ObjNet *sp54; // net made with sp48 group + UNUSED u8 pad4C[0x54 - 0x4c]; + struct ObjGroup *sp48; // Joint group + UNUSED u8 pad40[0x48 - 0x40]; + struct ObjGroup *mainShapesGrp; + struct GdObj *sp38; // object list head before making a bunch of joints + struct GdObj *faceJoint; // joint on the face that `grabberJoint` pulls + struct ObjJoint *grabberJoint; // joint that's dragged by the cursor + struct ObjCamera *camera; + struct ObjAnimator *animator; + struct ObjParticle *particle; + + // Load Mario head from the dynlist + + start_memtracker("mario face"); + d_set_name_suffix("l"); // add "l" to the end of all dynobj names generated by the dynlist, for some reason + + d_use_integer_names(TRUE); + animator = (struct ObjAnimator *) d_makeobj(D_ANIMATOR, AsDynName(DYNOBJ_MARIO_MAIN_ANIMATOR)); + animator->controlFunc = aniFn; + d_use_integer_names(FALSE); + // FIXME: make segment address work once seg4 is disassembled + gMarioFaceGrp = (struct ObjGroup *) load_dynlist(dynlist_mario_master); + stop_memtracker("mario face"); + + // Make camera + + camera = (struct ObjCamera *) d_makeobj(D_CAMERA, NULL); + d_set_rel_pos(0.0f, 200.0f, 2000.0f); + d_set_world_pos(0.0f, 200.0f, 2000.0f); + d_set_flags(4); + camera->lookAt.x = 0.0f; + camera->lookAt.y = 200.0f; + camera->lookAt.z = 0.0f; + + addto_group(gMarioFaceGrp, &camera->header); + addto_group(gMarioFaceGrp, &animator->header); + + d_set_name_suffix(NULL); // stop adding "l" to generated dynobj names + + // Make sparkle particles + + particle = make_particle(0, COLOUR_WHITE, 0.0f, 0.0f, 0.0f); + particle->unk60 = 3; + particle->unk64 = 3; + particle->attachedToObj = &camera->header; + particle->shapePtr = gShapeSilverSpark; + addto_group(gGdLightGroup, &particle->header); + + particle = make_particle(0, COLOUR_WHITE, 0.0f, 0.0f, 0.0f); + particle->unk60 = 3; + particle->unk64 = 2; + particle->attachedToObj = d_use_obj("N228l"); // DYNOBJ_SILVER_STAR_LIGHT + particle->shapePtr = gShapeSilverSpark; + addto_group(gGdLightGroup, &particle->header); + + particle = make_particle(0, COLOUR_RED, 0.0f, 0.0f, 0.0f); + particle->unk60 = 3; + particle->unk64 = 2; + particle->attachedToObj = d_use_obj("N231l"); // DYNOBJ_RED_STAR_LIGHT + particle->shapePtr = gShapeRedSpark; + addto_group(gGdLightGroup, &particle->header); + + mainShapesGrp = (struct ObjGroup *) d_use_obj("N1000l"); // DYNOBJ_MARIO_MAIN_SHAPES_GROUP + create_gddl_for_shapes(mainShapesGrp); + sp38 = gGdObjectList; + + // Make grabbers to move the face with the cursor + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -500.0f, 0.0f, -150.0f); + faceJoint = d_use_obj("N167l"); // DYNOBJ_MARIO_LEFT_EAR_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 500.0f, 0.0f, -150.0f); + faceJoint = d_use_obj("N176l"); // DYNOBJ_MARIO_RIGHT_EAR_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, 700.0f, 300.0f); + faceJoint = d_use_obj("N131l"); // DYNOBJ_MARIO_CAP_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + // drag eyelids and eyebrows along with cap? + faceJoint = d_use_obj("N206l"); // DYNOBJ_LEFT_EYELID_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + faceJoint = d_use_obj("N215l"); // DYNOBJ_RIGHT_EYELID_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + faceJoint = d_use_obj("N31l"); // DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + faceJoint = d_use_obj("N65l"); // DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, 0.0f, 600.0f); + faceJoint = d_use_obj("N185l"); // DYNOBJ_MARIO_NOSE_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, -300.0f, 300.0f); + faceJoint = d_use_obj("N194l"); // DYNOBJ_MARIO_LEFT_JAW_JOINT + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 250.0f, -150.0f, 300.0f); + faceJoint = d_use_obj("N158l"); // DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + faceJoint = d_use_obj("N15l"); // DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -250.0f, -150.0f, 300.0f); + faceJoint = d_use_obj("N149l"); // DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1 + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + + faceJoint = d_use_obj("N6l"); // DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1 + addto_group(grabberJoint->attachedObjsGrp, faceJoint); + + // make the left eye follow cursor + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 100.0f, 200.0f, 400.0f); + faceJoint = d_use_obj("N112l"); // DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + grabberJoint->updateFunc = eye_joint_update_func; + grabberJoint->rootAnimator = animator; + grabberJoint->header.drawFlags &= ~OBJ_IS_GRABBALE; + + // make the right eye follow cursor + grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -100.0f, 200.0f, 400.0f); + faceJoint = d_use_obj("N96l"); // DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET + grabberJoint->attachedObjsGrp = make_group(1, faceJoint); + grabberJoint->updateFunc = eye_joint_update_func; + grabberJoint->rootAnimator = animator; + grabberJoint->header.drawFlags &= ~OBJ_IS_GRABBALE; + + sp48 = make_group_of_type(OBJ_TYPE_JOINTS, sp38, NULL); + sp54 = make_net(0, NULL, sp48, NULL, NULL); + sp54->netType = 3; + addto_group(gMarioFaceGrp, &sp48->header); + addto_groupfirst(gMarioFaceGrp, &sp54->header); + + return 0; +} + +/* @ 249288 for 0xe0 */ +void load_shapes2(void) { + imin("load_shapes2()"); + reset_dynlist(); + func_80197280(); + + sCubeShape = make_shape(0, "cube"); + + gSpotShape = (struct ObjShape *) load_dynlist(dynlist_spot_shape); + scale_verts_in_shape(gSpotShape, 200.0f, 200.0f, 200.0f); + + sGrabJointTestShape = (struct ObjShape *) load_dynlist(dynlist_test_cube); + scale_verts_in_shape(sGrabJointTestShape, 30.0f, 30.0f, 30.0f); + + sCubeShapeGroup = make_group_of_type(OBJ_TYPE_SHAPES, &sCubeShape->header, NULL); + create_gddl_for_shapes(sCubeShapeGroup); + + imout(); +} + +/* @ 249368 -> 249594 */ +struct ObjGroup *Unknown8019AB98(UNUSED u32 a0) { + struct ObjLight *light1; + struct ObjLight *light2; + struct GdObj *oldObjHead = gGdObjectList; // obj head node before making lights + + light1 = make_light(0, NULL, 0); + light1->position.x = 100.0f; + light1->position.y = 200.0f; + light1->position.z = 300.0f; + + light1->diffuse.r = 1.0f; + light1->diffuse.g = 0.0f; + light1->diffuse.b = 0.0f; + + light1->unk30 = 1.0f; + + light1->unk68.x = 0.4f; + light1->unk68.y = 0.9f; + + light1->unk80.x = 4.0f; + light1->unk80.y = 4.0f; + light1->unk80.z = 2.0f; + + light2 = make_light(0, NULL, 1); + light2->position.x = 100.0f; + light2->position.y = 200.0f; + light2->position.z = 300.0f; + + light2->diffuse.r = 0.0f; + light2->diffuse.g = 0.0f; + light2->diffuse.b = 1.0f; + + light2->unk30 = 1.0f; + + light2->unk80.x = -4.0f; + light2->unk80.y = 4.0f; + light2->unk80.z = -2.0f; + + gGdLightGroup = make_group_of_type(OBJ_TYPE_LIGHTS, oldObjHead, NULL); + + return gGdLightGroup; +} + +/* @ 249594 for 0x100 */ +struct ObjGroup *Unknown8019ADC4(UNUSED u32 a0) { + UNUSED struct ObjLight *unusedLight; + struct ObjLight *newLight; + struct GdObj *oldObjHead; + + unusedLight = make_light(0, NULL, 0); + oldObjHead = gGdObjectList; + newLight = make_light(0, NULL, 0); + + newLight->position.x = 0.0f; + newLight->position.y = -500.0f; + newLight->position.z = 0.0f; + + newLight->diffuse.r = 1.0f; + newLight->diffuse.g = 0.0f; + newLight->diffuse.b = 0.0f; + + newLight->unk30 = 1.0f; + + gGdLightGroup = make_group_of_type(OBJ_TYPE_LIGHTS, oldObjHead, NULL); + + return gGdLightGroup; +} + +/* @ 249694 for 0x5c */ +struct ObjGroup *Unknown8019AEC4(UNUSED u32 a0) { + UNUSED u32 sp24; + UNUSED u32 sp20; + UNUSED struct GdObj *sp1C; + + sp1C = gGdObjectList; + gGdLightGroup = make_group(0); + return gGdLightGroup; +} diff --git a/src/goddard/shape_helper.h b/src/goddard/shape_helper.h new file mode 100644 index 00000000..bf55901e --- /dev/null +++ b/src/goddard/shape_helper.h @@ -0,0 +1,33 @@ +#ifndef GD_SHAPE_HELPER_H +#define GD_SHAPE_HELPER_H + +#include + +#include "gd_types.h" + +// data +extern struct ObjGroup *gMarioFaceGrp; +extern struct ObjShape *gSpotShape; +extern struct ObjShape *gShapeRedSpark; +extern struct ObjShape *gShapeSilverSpark; +extern struct ObjShape *gShapeRedStar; +extern struct ObjShape *gShapeSilverStar; + +// functions +void calc_face_normal(struct ObjFace *face); +struct ObjVertex *gd_make_vertex(f32 x, f32 y, f32 z); +void add_3_vtx_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjVertex *vtx2, struct ObjVertex *vtx3); +struct ObjShape *make_shape(s32 flag, const char *name); +void scale_verts_in_shape(struct ObjShape *shape, f32 x, f32 y, f32 z); +struct ObjNet *make_netfromshape(struct ObjShape *shape); +void animate_mario_head_gameover(struct ObjAnimator *self); +void animate_mario_head_normal(struct ObjAnimator *self); +s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)); +void load_shapes2(void); + +// see bad_declarations.h +#ifndef GD_USE_BAD_DECLARATIONS +struct ObjFace* make_face_with_colour(f32 r, f32 g, f32 b); +#endif + +#endif // GD_SHAPE_HELPER_H diff --git a/src/goddard/skin.c b/src/goddard/skin.c new file mode 100644 index 00000000..069d0c55 --- /dev/null +++ b/src/goddard/skin.c @@ -0,0 +1,528 @@ +#include + +#if defined(VERSION_EU) || defined(VERSION_SH) +#include "prevent_bss_reordering.h" +#endif + +#include "debug_utils.h" +#include "gd_main.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "objects.h" +#include "particles.h" +#include "renderer.h" +#include "skin.h" +#include "skin_movement.h" + +// bss +struct ObjNet *gGdSkinNet; // @ 801BAAF0 + +static s32 D_801BAAF4; +static s32 sNetCount; // @ 801BAAF8 + +/* 2406E0 -> 240894 */ +void compute_net_bounding_box(struct ObjNet *net) { + reset_bounding_box(); + if (net->unk1D0 != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) add_obj_pos_to_bounding_box, net->unk1D0); + } + if (net->unk1C8 != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) add_obj_pos_to_bounding_box, net->unk1C8); + } + gSomeBoundingBox.minX *= net->scale.x; + gSomeBoundingBox.maxX *= net->scale.x; + gSomeBoundingBox.minY *= net->scale.y; + gSomeBoundingBox.maxY *= net->scale.y; + gSomeBoundingBox.minZ *= net->scale.z; + gSomeBoundingBox.maxZ *= net->scale.z; + + net->boundingBox.minX = gSomeBoundingBox.minX; + net->boundingBox.minY = gSomeBoundingBox.minY; + net->boundingBox.minZ = gSomeBoundingBox.minZ; + net->boundingBox.maxX = gSomeBoundingBox.maxX; + net->boundingBox.maxY = gSomeBoundingBox.maxY; + net->boundingBox.maxZ = gSomeBoundingBox.maxZ; +} + +/* 240894 -> 240A64; orig name: func_801920C4 */ +void reset_net(struct ObjNet *net) { + struct ObjGroup *grp; + + printf("reset_net %d\n", net->id); + + net->worldPos.x = net->initPos.x; + net->worldPos.y = net->initPos.y; + net->worldPos.z = net->initPos.z; + net->velocity.x = net->velocity.y = net->velocity.z = 0.0f; + net->torque.x = net->torque.y = net->torque.z = 0.0f; + + compute_net_bounding_box(net); + gd_print_vec("net scale: ", &net->scale); + gd_print_bounding_box("net box: ", &net->boundingBox); + + gGdSkinNet = net; + D_801BAAF4 = 0; + gd_set_identity_mat4(&net->mat168); + gd_set_identity_mat4(&net->matE8); + gd_rot_mat_about_vec(&net->matE8, &net->unk68); // set rot mtx to initial rotation? + gd_add_vec3f_to_mat4f_offset(&net->matE8, &net->worldPos); // set to initial position? + gd_copy_mat4f(&net->matE8, &net->mat128); + + if ((grp = net->unk1C8) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) reset_joint, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191220, grp); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FB58, grp); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FA68, grp); + } +} + +/* 240A64 -> 240ACC */ +void func_80192294(struct ObjNet *net) { + UNUSED s32 sp1C = 0; + + if (net->attachedToObj == NULL) { + restart_timer("childpos"); + sp1C = transform_child_objects_recursive(&net->header, NULL); + split_timer("childpos"); + } +} + +/* 240ACC -> 240B84 */ +void func_801922FC(struct ObjNet *net) { + struct ObjGroup *group; // 24 + UNUSED u32 pad18[2]; + + gGdSkinNet = net; + // TODO: netype constants? + if (net->netType == 4) { + if (net->shapePtr != NULL) { + D_801B9E38 = &net->mat128; + scale_verts(net->shapePtr->vtxGroup); + } + if ((group = net->unk1C8) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) reset_joint_weights, group); + } + } +} + +/* 240B84 -> 240CF8 */ +struct ObjNet *make_net(UNUSED s32 a0, struct ObjShape *shapedata, struct ObjGroup *a2, + struct ObjGroup *a3, struct ObjGroup *a4) { + struct ObjNet *net; + + net = (struct ObjNet *) make_object(OBJ_TYPE_NETS); + gd_set_identity_mat4(&net->mat128); + net->initPos.x = net->initPos.y = net->initPos.z = 0.0f; + net->id = ++sNetCount; + net->scale.x = net->scale.y = net->scale.z = 1.0f; + net->shapePtr = shapedata; + net->unk1C8 = a2; + net->unk1CC = a3; + net->unk1D0 = a4; + net->netType = 0; + net->ctrlType = 0; + net->unk21C = NULL; + net->unk3C = 1; + net->colourNum = 0; + net->skinGrp = NULL; + reset_net(net); + + return net; +} + +/* 240CF8 -> 240E74 */ +void func_80192528(struct ObjNet *net) { + net->unusedForce.x = net->unusedForce.y = net->unusedForce.z = 0.0f; + net->collDisp.x = net->collDisp.y = net->collDisp.z = 0.0f; + net->collTorque.x = net->collTorque.y = net->collTorque.z = 0.0f; + net->unusedCollDispOff.x = net->unusedCollDispOff.y = net->unusedCollDispOff.z = 0.0f; + net->unusedCollMaxD = 0.0f; + + gGdCounter.ctr0 = 0; + gGdCounter.ctr1 = 0; + D_801B9E18.x = 0.0f; + D_801B9E18.y = 0.0f; + D_801B9E18.z = 0.0f; + D_801B9E28.x = 0.0f; + D_801B9E28.y = 0.0f; + D_801B9E28.z = 0.0f; + D_801B9E34 = 0.0f; + + if (net->flags & 0x1) { + net->velocity.y += -4.0; //? 4.0f + } + + net->worldPos.x += net->velocity.x / 1.0f; + net->worldPos.y += net->velocity.y / 1.0f; + net->worldPos.z += net->velocity.z / 1.0f; +} + +/* 240E74 -> 2412A0 */ +void collision_something_801926A4(struct ObjNet *net) { + if (gGdCounter.ctr1 != 0) { + if (D_801B9E34 != 0.0f) { + D_801B9E28.x /= D_801B9E34; + D_801B9E28.y /= D_801B9E34; + D_801B9E28.z /= D_801B9E34; + } + + D_801B9E28.x *= 1.0 / gGdCounter.ctr1; // !1.0f + D_801B9E28.y *= 1.0 / gGdCounter.ctr1; // !1.0f + D_801B9E28.z *= 1.0 / gGdCounter.ctr1; // !1.0f + D_801B9E18.x *= 1.0 / gGdCounter.ctr1; // !1.0f + D_801B9E18.y *= 1.0 / gGdCounter.ctr1; // !1.0f + D_801B9E18.z *= 1.0 / gGdCounter.ctr1; // !1.0f + + func_8017E584(gGdSkinNet, &D_801B9E28, &D_801B9E18); + func_8017E838(gGdSkinNet, &D_801B9E28, &D_801B9E18); + } + + net->torque.x += net->collTorque.x; + net->torque.y += net->collTorque.y; + net->torque.z += net->collTorque.z; + net->collDisp.x *= 1.0; // 1.0f; + net->collDisp.y *= 1.0; // 1.0f; + net->collDisp.z *= 1.0; // 1.0f; + net->velocity.x += net->collDisp.x; + net->velocity.y += net->collDisp.y; + net->velocity.z += net->collDisp.z; + net->worldPos.x += net->collDisp.x; + net->worldPos.y += net->collDisp.y; + net->worldPos.z += net->collDisp.z; + func_8017E9EC(net); + + net->torque.x *= 0.98; //? 0.98f + net->torque.z *= 0.98; //? 0.98f + net->torque.y *= 0.9; //? 0.9f +} + +/* 2412A0 -> 24142C; not called */ +void func_80192AD0(struct ObjNet *net) { + UNUSED u32 pad64; + struct ObjGroup *sp60; + UNUSED u32 pad20[0x10]; + UNUSED u32 sp1C; + struct ObjNet *sp18; + + if ((sp60 = net->unk1C8) == NULL) { + return; + } + + sp18 = net->unk1F0; + net->worldPos.x = net->unk1F4.x; + net->worldPos.y = net->unk1F4.y; + net->worldPos.z = net->unk1F4.z; + gd_rotate_and_translate_vec3f(&net->worldPos, &sp18->mat128); + + net->worldPos.x += net->unk1F0->worldPos.x; + net->worldPos.y += net->unk1F0->worldPos.y; + net->worldPos.z += net->unk1F0->worldPos.z; + net->unk200.x = 0.0f; + net->unk200.y = 10.0f; + net->unk200.z = -4.0f; + gd_rotate_and_translate_vec3f(&net->unk200, &sp18->mat128); + + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191824, sp60); + func_80191E88(sp60); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018F328, net->unk20C); +} + +/* 24142C -> 24149C; orig name: func_80192C5C */ +void move_bonesnet(struct ObjNet *net) { + struct ObjGroup *sp24; + UNUSED u32 pad18[3]; + + imin("move_bonesnet"); + gd_set_identity_mat4(&D_801B9DC8); + if ((sp24 = net->unk1C8) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, sp24); + } + imout(); +} + +/* 24149C -> 241768 */ +void func_80192CCC(struct ObjNet *net) { + Mat4f sp38; + UNUSED struct GdControl *ctrl; // 34 + struct ObjGroup *group; // 30 + struct GdVec3f sp24; + + ctrl = &gGdCtrl; + if (gGdCtrl.unk2C != NULL) { + menu_cb_reset_positions(); + } + gd_set_identity_mat4(&D_801B9DC8); + + if (gGdCtrl.unk30 != NULL) { + sp24.x = net->mat128[0][0]; + sp24.y = net->mat128[0][1]; + sp24.z = net->mat128[0][2]; + gd_create_rot_mat_angular(&sp38, &sp24, 4.0f); + gd_mult_mat4f(&sp38, &D_801B9DC8, &D_801B9DC8); + net->torque.x = net->torque.y = net->torque.z = 0.0f; + } + + if (gGdCtrl.unk28 != NULL) { + sp24.x = net->mat128[0][0]; + sp24.y = net->mat128[0][1]; + sp24.z = net->mat128[0][2]; + gd_create_rot_mat_angular(&sp38, &sp24, -4.0f); + gd_mult_mat4f(&sp38, &D_801B9DC8, &D_801B9DC8); + net->torque.x = net->torque.y = net->torque.z = 0.0f; + } + + if (gGdCtrl.newStartPress) { + return; + } // start was pressed + + switch (net->ctrlType) { + case 2: + break; + } + + func_80192528(net); + if ((group = net->unk1C8) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191220, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913F0, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) stub_joints_2, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801911A8, group); + } + + collision_something_801926A4(net); + gd_mult_mat4f(&net->mat128, &D_801B9DC8, &net->mat128); + if (group != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, group); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FA68, group); + } +} + +/* 241768 -> 241AB4; orig name: func_80192F98 */ +void convert_gd_verts_to_Vn(struct ObjGroup *grp) { + UNUSED u8 pad[0x40 - 0x2c]; + Vtx *vn; // 28 + u8 nx, ny, nz; // 24, 25, 26 + UNUSED u32 pad20; + register struct VtxLink *vtxlink; // a1 +#ifndef GBI_FLOATS + register s16 *vnPos; // a2 +#endif + register s16 x; // a3 + register s16 y; // t0 + register s16 z; // t1 + register struct ObjVertex *vtx; // t2 + register struct ListNode *link; // t3 + struct GdObj *obj; // sp4 + + for (link = grp->firstMember; link != NULL; link = link->next) { + obj = link->obj; + vtx = (struct ObjVertex *) obj; + x = (s16) vtx->pos.x; + y = (s16) vtx->pos.y; + z = (s16) vtx->pos.z; + + nx = (u8)(vtx->normal.x * 255.0f); + ny = (u8)(vtx->normal.y * 255.0f); + nz = (u8)(vtx->normal.z * 255.0f); + + for (vtxlink = vtx->gbiVerts; vtxlink != NULL; vtxlink = vtxlink->prev) { +#ifndef GBI_FLOATS + vnPos = vtxlink->data->n.ob; + vn = vtxlink->data; + *vnPos++ = x; + *vnPos++ = y; + *vnPos++ = z; +#else + vn = vtxlink->data; + vn->n.ob[0] = x; + vn->n.ob[1] = y; + vn->n.ob[2] = z; +#endif + vn->n.n[0] = nx; + vn->n.n[1] = ny; + vn->n.n[2] = nz; + } + } +} + +/* 241AB4 -> 241BCC; orig name: func_801932E4 */ +void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { + UNUSED u32 pad24[6]; + register struct VtxLink *vtxlink; // a1 +#ifndef GBI_FLOATS + register s16 *vtxcoords; // a2 +#endif + register s16 x; // a3 + register s16 y; // t0 + register s16 z; // t1 + register struct ObjVertex *vtx; // t2 + register struct ListNode *link; // t3 + struct GdObj *obj; // sp4 + + for (link = grp->firstMember; link != NULL; link = link->next) { + obj = link->obj; + vtx = (struct ObjVertex *) obj; + x = (s16) vtx->pos.x; + y = (s16) vtx->pos.y; + z = (s16) vtx->pos.z; + + for (vtxlink = vtx->gbiVerts; vtxlink != NULL; vtxlink = vtxlink->prev) { +#ifndef GBI_FLOATS + vtxcoords = vtxlink->data->v.ob; + vtxcoords[0] = x; + vtxcoords[1] = y; + vtxcoords[2] = z; +#else + vtxlink->data->v.ob[0] = x; + vtxlink->data->v.ob[1] = y; + vtxlink->data->v.ob[2] = z; +#endif + } + } +} + +/* 241BCC -> 241CA0; orig name: Proc801933FC */ +void convert_net_verts(struct ObjNet *net) { + if (net->shapePtr != NULL) { + if (net->shapePtr->unk30) { + convert_gd_verts_to_Vn(net->shapePtr->vtxGroup); + } + } + + switch (net->netType) { + case 2: + if (net->shapePtr != NULL) { + convert_gd_verts_to_Vtx(net->shapePtr->scaledVtxGroup); + } + break; + } +} + +/* 241CA0 -> 241D6C */ +static void move_joints_in_net(struct ObjNet *net) { + struct ObjGroup *grp; // 2c + register struct ListNode *link; // s0 + struct GdObj *obj; // 24 + + if ((grp = net->unk1C8) != NULL) { + for (link = grp->firstMember; link != NULL; link = link->next) { + obj = link->obj; + switch (obj->type) { + case OBJ_TYPE_JOINTS: + if (((struct ObjJoint *) obj)->updateFunc != NULL) { + (*((struct ObjJoint *) obj)->updateFunc)((struct ObjJoint *) obj); + } + break; + default:; + } + } + } +} + +/* 241D6C -> 241E94; orig name: func_8019359C */ +void move_net(struct ObjNet *net) { + gGdSkinNet = net; + + switch (net->netType) { + case 1: + break; + case 7: + func_80192CCC(net); + break; + case 4: + restart_timer("move_bones"); + move_bonesnet(net); + split_timer("move_bones"); + break; + case 2: + restart_timer("move_skin"); + move_skin(net); + split_timer("move_skin"); + break; + case 3: + move_joints_in_net(net); + break; + case 5: + func_801823A0(net); + break; + case 6: + break; + default: + fatal_printf("move_net(%d(%d)): Undefined net type", net->id, net->netType); + } +} + +/* 241E94 -> 241F0C; orig name: func_801936C4 */ +void move_nets(struct ObjGroup *group) { + imin("move_nets"); + restart_timer("move_nets"); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_80192294, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) move_net, group); + split_timer("move_nets"); + imout(); +} + +/* 241F0C -> 242018 */ +void func_8019373C(struct ObjNet *net) { + register struct ListNode *link; + struct ObjVertex *vtx; + + switch (net->netType) { + case 2: + if (net->shapePtr != NULL) { + net->shapePtr->scaledVtxGroup = make_group(0); + for (link = net->shapePtr->vtxGroup->firstMember; link != NULL; link = link->next) { + vtx = (struct ObjVertex *) link->obj; + if (vtx->scaleFactor != 1.0) { + addto_group(net->shapePtr->scaledVtxGroup, &vtx->header); + } + } + } + break; + } +} + +/* 242018 -> 24208C */ +void func_80193848(struct ObjGroup *group) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_net, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_80192294, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_801922FC, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_8019373C, group); +} + +/* 24208C -> 2422E0; not called; orig name: func_801938BC */ +void gd_print_net(struct ObjNet *net) { + gd_printf("Flags:%x\n", net->flags); + gd_print_vec("World:", &net->worldPos); + gd_print_vec("Force:", &net->unusedForce); + gd_print_vec("Vel:", &net->velocity); + gd_print_vec("Rot:", &net->rotation); + gd_print_vec("CollDisp:", &net->collDisp); + gd_print_vec("CollTorque:", &net->collTorque); + gd_print_vec("CollTorqueL:", &net->unusedCollTorqueL); + gd_print_vec("CollTorqueD:", &net->unusedCollTorqueD); + gd_print_vec("Torque:", &net->torque); + gd_print_vec("CofG:", &net->centerOfGravity); + gd_print_bounding_box("BoundBox:", &net->boundingBox); + gd_print_vec("CollDispOff:", &net->unusedCollDispOff); + gd_printf("CollMaxD: %f\n", net->unusedCollMaxD); + gd_printf("MaxRadius: %f\n", net->maxRadius); + gd_print_mtx("Matrix:", &net->mat128); + if (net->shapePtr != NULL) { + gd_printf("ShapePtr: %x (%s)\n", (u32) (uintptr_t) net->shapePtr, net->shapePtr->name); + } else { + gd_printf("ShapePtr: NULL\n"); + } + gd_print_vec("Scale:", &net->scale); + gd_printf("Mass: %f\n", net->unusedMass); + gd_printf("NumModes: %d\n", net->numModes); + gd_printf("NodeGroup: %x\n", (u32) (uintptr_t) net->unk1C8); + gd_printf("PlaneGroup: %x\n", (u32) (uintptr_t) net->unk1CC); + gd_printf("VertexGroup: %x\n", (u32) (uintptr_t) net->unk1D0); +} + +/* 2422E0 -> 2422F8; orig name: func_80193B10 */ +void reset_net_count(void) { + sNetCount = 0; +} diff --git a/src/goddard/skin.h b/src/goddard/skin.h new file mode 100644 index 00000000..428b3639 --- /dev/null +++ b/src/goddard/skin.h @@ -0,0 +1,20 @@ +#ifndef GD_SKIN_H +#define GD_SKIN_H + +#include + +#include "gd_types.h" + +// bss +extern struct ObjNet* gGdSkinNet; // @ 801BAAF0 + +// functions +void reset_net(struct ObjNet *net); +struct ObjNet *make_net(UNUSED s32 a0, struct ObjShape *shapedata, struct ObjGroup *a2, + struct ObjGroup *a3, struct ObjGroup *a4); +void convert_net_verts(struct ObjNet *net); +void move_nets(struct ObjGroup *group); +void func_80193848(struct ObjGroup *group); +void reset_net_count(void); + +#endif // GD_SKIN_H diff --git a/src/goddard/skin_movement.c b/src/goddard/skin_movement.c new file mode 100644 index 00000000..7105ec76 --- /dev/null +++ b/src/goddard/skin_movement.c @@ -0,0 +1,158 @@ +#include + +#include "debug_utils.h" +#include "gd_math.h" +#include "gd_types.h" +#include "joints.h" +#include "macros.h" +#include "objects.h" +#include "skin.h" +#include "skin_movement.h" + +/* bss */ +struct ObjWeight *sResetCurWeight; +static Mat4f D_801B9EA8; // TODO: rename to sHead2Mtx? +static struct ObjJoint *D_801B9EE8; // set but not used + +/* @ 22FDB0 for 0x180 */ +void func_801815E0(Mat4f *mtx) { + struct GdVec3f scratchVec; + + scratchVec.x = (*mtx)[0][0]; + scratchVec.y = (*mtx)[0][1]; + scratchVec.z = (*mtx)[0][2]; + gd_normalize_vec3f(&scratchVec); + (*mtx)[0][0] = scratchVec.x; + (*mtx)[0][1] = scratchVec.y; + (*mtx)[0][2] = scratchVec.z; + + scratchVec.x = (*mtx)[1][0]; + scratchVec.y = (*mtx)[1][1]; + scratchVec.z = (*mtx)[1][2]; + gd_normalize_vec3f(&scratchVec); + (*mtx)[1][0] = scratchVec.x; + (*mtx)[1][1] = scratchVec.y; + (*mtx)[1][2] = scratchVec.z; + + scratchVec.x = (*mtx)[2][0]; + scratchVec.y = (*mtx)[2][1]; + scratchVec.z = (*mtx)[2][2]; + gd_normalize_vec3f(&scratchVec); + (*mtx)[2][0] = scratchVec.x; + (*mtx)[2][1] = scratchVec.y; + (*mtx)[2][2] = scratchVec.z; +} + +/* @ 22FF30 for 0xDC */ +/* called with ObjNext->unk1A8 (variable obj ptr?) ->unk20 or ->unk24 ptr*/ +// TODO: figure out the proper object type for a0 +void scale_verts(struct ObjGroup *a0) { + register f32 sp1C; + register struct ListNode *link; + struct ObjVertex *vtx; + + for (link = a0->firstMember; link != NULL; link = link->next) { + vtx = (struct ObjVertex *) link->obj; + + if ((sp1C = vtx->scaleFactor) != 0.0f) { + vtx->pos.x = vtx->initPos.x * sp1C; + vtx->pos.y = vtx->initPos.y * sp1C; + vtx->pos.z = vtx->initPos.z * sp1C; + } else { + vtx->pos.x = vtx->pos.y = vtx->pos.z = 0.0f; + } + } +} + +/* @ 23000C for 0x58; orig name: func8018183C*/ +void move_skin(struct ObjNet *net) { + UNUSED u8 pad1C[8]; + + if (net->shapePtr != NULL) { + scale_verts(net->shapePtr->scaledVtxGroup); + } +} + +/* @ 230064 for 0x13C*/ +void func_80181894(struct ObjJoint *joint) { + register struct ObjGroup *weightGroup; // baseGroup? weights Only? + struct GdVec3f stackVec; + register struct ObjWeight *curWeight; + register struct ObjVertex *connectedVtx; + register struct ListNode *link; + register f32 scaleFactor; + struct GdObj *linkedObj; + + weightGroup = joint->weightGrp; + if (weightGroup != NULL) { + for (link = weightGroup->firstMember; link != NULL; link = link->next) { + linkedObj = link->obj; + curWeight = (struct ObjWeight *) linkedObj; + + if (curWeight->weightVal > 0.0) //? 0.0f + { + stackVec.x = curWeight->vec20.x; + stackVec.y = curWeight->vec20.y; + stackVec.z = curWeight->vec20.z; + gd_rotate_and_translate_vec3f(&stackVec, &joint->matE8); + + connectedVtx = curWeight->vtx; + scaleFactor = curWeight->weightVal; + + connectedVtx->pos.x += stackVec.x * scaleFactor; + connectedVtx->pos.y += stackVec.y * scaleFactor; + connectedVtx->pos.z += stackVec.z * scaleFactor; + } + } + } +} + +/* @ 2301A0 for 0x110 */ +void reset_weight_vtx(struct ObjVertex *vtx) { + struct GdVec3f localVec; + UNUSED u8 pad24[0x10]; + + if (sResetWeightVtxNum++ == sResetCurWeight->vtxId) { // found matching vertex + sResetCurWeight->vtx = vtx; + localVec.x = vtx->pos.x; + localVec.y = vtx->pos.y; + localVec.z = vtx->pos.z; + + gd_rotate_and_translate_vec3f(&localVec, &D_801B9EA8); + sResetCurWeight->vec20.x = localVec.x; + sResetCurWeight->vec20.y = localVec.y; + sResetCurWeight->vec20.z = localVec.z; + + vtx->scaleFactor -= sResetCurWeight->weightVal; + } +} + +void reset_weight(struct ObjWeight *weight) { + UNUSED u32 vtxCount; + UNUSED u32 pad20; + struct ObjGroup *skinGroup; + + sResetCurWeight = weight; + sResetWeightVtxNum = 0; + if ((skinGroup = gGdSkinNet->skinGrp) != NULL) { + // Go through every vertex in the skin group, and reset the weight if the vertex is managed by the weight + vtxCount = + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) reset_weight_vtx, skinGroup); + } else { + fatal_printf("reset_weight(): Skin net has no SkinGroup"); + } + + if (weight->vtx == NULL) { + fatal_printf("reset_weight(): Skin vertex ID %d not found", weight->vtxId); + } +} + +void reset_joint_weights(struct ObjJoint *joint) { + struct ObjGroup *group; + + gd_inverse_mat4f(&joint->matE8, &D_801B9EA8); + D_801B9EE8 = joint; + if ((group = joint->weightGrp) != NULL) { + apply_to_obj_types_in_group(OBJ_TYPE_WEIGHTS, (applyproc_t) reset_weight, group); + } +} diff --git a/src/goddard/skin_movement.h b/src/goddard/skin_movement.h new file mode 100644 index 00000000..c98c2c93 --- /dev/null +++ b/src/goddard/skin_movement.h @@ -0,0 +1,11 @@ +#ifndef GD_SKIN_MOVEMENT_H +#define GD_SKIN_MOVEMENT_H + +#include "gd_types.h" + +void scale_verts(struct ObjGroup *a0); +void move_skin(struct ObjNet *net); +void func_80181894(struct ObjJoint *joint); +void reset_joint_weights(struct ObjJoint *joint); + +#endif // GD_SKIN_MOVEMENT_H