Refresh 2

This commit is contained in:
n64 2019-10-05 15:08:05 -04:00
parent 1ef98ec785
commit 52e605f075
316 changed files with 16346 additions and 16367 deletions

29
CHANGES
View File

@ -1,3 +1,32 @@
Refresh #2
Changes from Refresh #1:
1.) Label src/game/behaviors/boo.inc.c
2.) Verify half of audio_defines.h
3.) Label ingame_menu.c and some dialog stuff
4.) Improve handle_dialog_text_and_pages EU non-matching
5.) Fix texture format for water splash/sparkle
6.) Merge ucode.bin and ucode_unk.bin
7.) 64-bit fixes
8.) [AUDIO] Match func_80316928
9.) Documented bug in Tuxie's mother's code
10.) [AUDIO] Slightly closer matching for process_level_music_dynamics
11.) Name channel scripts in sequence 0
12.) Nicer error message when sha1sum doesn't match
13.) Refactor object fields
14.) Document file_select.c
15.) Document star_select.c
16.) Add uncompressed string support to textconv
17.) Document main_menu geo and leveldata
18.) Document hud.c and rename char textures
19.) Correct gSPTextureRectangle values
20.) Linker script wildcard
- Fixes "undefined reference to x in discarded section y" linker errors.
- Also means that you no longer have to add linker script entries for source files.
21.) Reference qemu-irix package and add project structure
- Installing qemu-irix is as simple as installing the provided Debian package on the GitHub "Releases" tab
(https://github.com/n64decomp/qemu-irix).
- Old qemu-irix installs are unaffected by this change, and it is still possible to install qemu-irix with the older method.
Refresh #1 Refresh #1
Changes from initial release: Changes from initial release:

View File

@ -131,7 +131,7 @@ TEXTURE_DIR := textures
ACTOR_DIR := actors ACTOR_DIR := actors
# Directories containing source files # Directories containing source files
SRC_DIRS := src src/engine src/game src/audio SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers
ASM_DIRS := asm actors lib data levels assets sound text ASM_DIRS := asm actors lib data levels assets sound text
BIN_DIRS := bin bin/$(VERSION) BIN_DIRS := bin bin/$(VERSION)
@ -207,6 +207,14 @@ else
CROSS := mips64-elf- CROSS := mips64-elf-
endif endif
# check that either QEMU_IRIX is set or qemu-irix package installed
ifndef QEMU_IRIX
QEMU_IRIX := $(shell which qemu-irix)
ifeq (, $(QEMU_IRIX))
$(error Please install qemu-irix package or set QEMU_IRIX env var to the full qemu-irix binary path)
endif
endif
AS := $(CROSS)as AS := $(CROSS)as
CC := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc CC := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc
CPP := cpp -P CPP := cpp -P
@ -260,15 +268,11 @@ ifeq ($(BINUTILS_DEPEND),0)
$(error binutils version 2.27 required, version $(BINUTILS_VER_MAJOR).$(BINUTILS_VER_MINOR) detected) $(error binutils version 2.27 required, version $(BINUTILS_VER_MAJOR).$(BINUTILS_VER_MINOR) detected)
endif endif
ifndef QEMU_IRIX
$(error env variable QEMU_IRIX should point to the qemu-mips binary)
endif
######################## Targets ############################# ######################## Targets #############################
all: $(ROM) all: $(ROM)
ifeq ($(COMPARE),1) ifeq ($(COMPARE),1)
@$(SHA1SUM) -c $(TARGET).sha1 @$(SHA1SUM) -c $(TARGET).sha1 || (echo 'The build succeeded, but did not match the official ROM. This is expected if you are making changes to the game.\nTo silence this message, use "make COMPARE=0"'. && false)
endif endif
clean: clean:
@ -288,13 +292,16 @@ libultra: $(BUILD_DIR)/libultra.a
asm/boot.s: $(BUILD_DIR)/lib/bin/ipl3_font.bin asm/boot.s: $(BUILD_DIR)/lib/bin/ipl3_font.bin
$(BUILD_DIR)/lib/bin/ipl3_font.bin: lib/ipl3_font.png | $(BUILD_DIR) $(BUILD_DIR)/lib/bin/ipl3_font.bin: lib/ipl3_font.png
$(IPLFONTUTIL) e $< $@ $(IPLFONTUTIL) e $< $@
$(BUILD_DIR)/include/text_strings.h: include/text_strings.h.in | $(BUILD_DIR) $(BUILD_DIR)/include/text_strings.h: include/text_strings.h.in
$(TEXTCONV) charmap.txt $< $@ $(TEXTCONV) charmap.txt $< $@
$(BUILD_DIR)/text/%.s: text/$(VERSION)/%.s.in | $(BUILD_DIR) $(BUILD_DIR)/include/text_menu_strings.h: include/text_menu_strings.h.in
$(TEXTCONV) charmap_menu.txt $< $@
$(BUILD_DIR)/text/%.s: text/$(VERSION)/%.s.in
$(TEXTCONV) charmap.txt $< $@ $(TEXTCONV) charmap.txt $< $@
ifeq ($(VERSION),eu) ifeq ($(VERSION),eu)
@ -313,8 +320,8 @@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(GOD
# Make sure build directory exists before compiling anything # Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS) DUMMY != mkdir -p $(ALL_DIRS)
$(BUILD_DIR)/src/game/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/include/text_menu_strings.h
$(BUILD_DIR)/src/game/file_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/include/text_menu_strings.h
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
################################################################ ################################################################

View File

@ -35,33 +35,22 @@ __Debian / Ubuntu__
sudo apt install build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev sudo apt install build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev
``` ```
Download latest package from [qemu-irix Releases](https://github.com/n64decomp/qemu-irix/releases)
```
sudo dpkg -i qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb
```
(Optional) Clone https://github.com/n64decomp/qemu-irix and follow the install instructions in the README.
__Arch Linux__ __Arch Linux__
``` ```
sudo pacman -Sy base-devel python audiofile sudo pacman -S base-devel python audiofile
``` ```
Install the following AUR packages: Install the following AUR packages:
* [mips64-elf-binutils](https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR) * [mips64-elf-binutils](https://aur.archlinux.org/packages/mips64-elf-binutils) (AUR)
* [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git) (AUR) * [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git) (AUR)
#### 3. Install qemu-irix #### 3. Build ROM
1. Options:
1. Clone https://github.com/n64decomp/qemu-irix to somewhere and follow its install instructions in the README.
2. Optionally, grab the prebuilt qemu-irix from the [Releases](https://github.com/n64decomp/sm64/releases) section.
3. (Arch) Use AUR package [qemu-irix-git](https://aur.archlinux.org/packages/qemu-irix-git)
2. (For the first two options), copy executable `qemu-irix` from irix-linux-user to
somewhere convenient with a relatively short path. e.g.:
```
mkdir -p /opt/qemu-irix/bin
cp irix-linux-user/qemu-irix /opt/qemu-irix/bin
```
3. Define `QEMU_IRIX` environment variable in your `~/.bashrc` to point to this qemu-irix executable.
```
export QEMU_IRIX=/opt/qemu-irix/bin/qemu-irix
```
#### 4. Build ROM
Run `make` to build the ROM (defaults to `VERSION=us`). Make sure your path to the repo Run `make` to build the ROM (defaults to `VERSION=us`). Make sure your path to the repo
is not too long or else this process will error, as the emulated IDO compiler cannot is not too long or else this process will error, as the emulated IDO compiler cannot
@ -85,6 +74,37 @@ Then follow the directions in the [Linux](#linux) installation section above.
macOS is currently unsupported as qemu-irix is unable to be built for macOS host. macOS is currently unsupported as qemu-irix is unable to be built for macOS host.
The recommended path is installing a Linux distribution under a VM. The recommended path is installing a Linux distribution under a VM.
## Project Structure
```
sm64
├── actors: object behaviors, geo layout, and display lists
├── asm: handwritten assembly code
│   └── non_matchings: asm for non-matching sections
├── assets: animation and demo data
│   ├── anims: animation data
│   └── demos: demo data
├── bin: asm files for ordering display lists and textures
├── build: output directory
├── data: behavior scripts, misc. data
├── doxygen: documentation infrastructure
├── enhancements: example source modifications
├── include: header files
├── levels: level scripts, geo layout, and display lists
├── lib: SDK library code
├── sound: sequences, sound samples, and sound banks
├── src: C source code for game
│   ├── audio: audio code
│   ├── buffers: stacks, heaps, and task buffers
│   ├── engine: script processing engines and utils
│   ├── game: behaviors and rest of game source
│   ├── goddard: Mario intro screen
│   └── menu: title screen and file, act, and debug level selection menus
├── text: dialog, level names, act names
├── textures: skybox and generic texture data
└── tools: build tools
```
## Contributing ## Contributing
Pull requests are welcome. For major changes, please open an issue first to Pull requests are welcome. For major changes, please open an issue first to

View File

@ -2,8 +2,7 @@
# It's possible that bubba and bub used to be 2 "actors" in # It's possible that bubba and bub used to be 2 "actors" in
# one actor file. # one actor file.
.word 0 .dword 0 # Bin ID? What is this?
.word 0 # Bin ID? What is this?
# Bubba # Bubba

View File

@ -8,7 +8,8 @@ vertex 26, -26, 0, 992, 992, 0xFF, 0xFF, 0xFF, 0xFF
vertex 26, 26, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex 26, 26, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF
vertex -26, 26, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex -26, 26, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF
.word 0, 0 # align but balign wont here? .dword 0 # align? binid?
chain_ball_seg6_texture_06020AE8: # 0x06020AE8 chain_ball_seg6_texture_06020AE8: # 0x06020AE8
.incbin "actors/chain_ball/chain_ball.rgba16" .incbin "actors/chain_ball/chain_ball.rgba16"

View File

@ -1,8 +1,7 @@
# Cyan Fish # Cyan Fish
# ??? # ???
.word 0 .dword 0
.word 0
cyan_fish_seg6_texture_0600D468: # 0x0600D468 cyan_fish_seg6_texture_0600D468: # 0x0600D468
.incbin "actors/cyan_fish/cyan_fish.rgba16" .incbin "actors/cyan_fish/cyan_fish.rgba16"

View File

@ -1,8 +1,7 @@
# Flyguy # Flyguy
# ??? # ???
.word 0 .dword 0
.word 0
flyguy_seg8_texture_0800E088: # 0x0800E088 flyguy_seg8_texture_0800E088: # 0x0800E088
.incbin "actors/flyguy/flyguy_cloth_wrinkle.rgba16" .incbin "actors/flyguy/flyguy_cloth_wrinkle.rgba16"

View File

@ -1,7 +1,6 @@
# Possible Removed Actor File # Possible Removed Actor File
.word 0 .dword 0 # Bin ID? What is this?
.word 0 # Bin ID? What is this?
# Klepto # Klepto

View File

@ -2191,5 +2191,4 @@ glabel piranha_plant_seg6_anims_0601C31C # 0x0601C31C
.word 0 .word 0
# huh? this isnt following the Bin ID format? # huh? this isnt following the Bin ID format?
.word 0 .dword 1
.word 1

View File

@ -1,50 +1,48 @@
# Power Meter HUD # Power Meter HUD
# ??? .word 0, 0
.word 0
.word 0
power_meter_seg3_texture_030233E0: # 0x030233E0 texture_power_meter_left_side: # 0x030233E0
.incbin "actors/power_meter/power_meter_left_side.rgba16" .incbin "actors/power_meter/power_meter_left_side.rgba16"
power_meter_seg3_texture_030243E0: # 0x030243E0 texture_power_meter_right_side: # 0x030243E0
.incbin "actors/power_meter/power_meter_right_side.rgba16" .incbin "actors/power_meter/power_meter_right_side.rgba16"
power_meter_seg3_texture_030253E0: # 0x030253E0 texture_power_meter_full: # 0x030253E0
.incbin "actors/power_meter/power_meter_full.rgba16" .incbin "actors/power_meter/power_meter_full.rgba16"
power_meter_seg3_texture_03025BE0: # 0x03025BE0 texture_power_meter_seven_segments: # 0x03025BE0
.incbin "actors/power_meter/power_meter_seven_segments.rgba16" .incbin "actors/power_meter/power_meter_seven_segments.rgba16"
power_meter_seg3_texture_030263E0: # 0x030263E0 texture_power_meter_six_segments: # 0x030263E0
.incbin "actors/power_meter/power_meter_six_segments.rgba16" .incbin "actors/power_meter/power_meter_six_segments.rgba16"
power_meter_seg3_texture_03026BE0: # 0x03026BE0 texture_power_meter_five_segments: # 0x03026BE0
.incbin "actors/power_meter/power_meter_five_segments.rgba16" .incbin "actors/power_meter/power_meter_five_segments.rgba16"
power_meter_seg3_texture_030273E0: # 0x030273E0 texture_power_meter_four_segments: # 0x030273E0
.incbin "actors/power_meter/power_meter_four_segments.rgba16" .incbin "actors/power_meter/power_meter_four_segments.rgba16"
power_meter_seg3_texture_03027BE0: # 0x03027BE0 texture_power_meter_three_segments: # 0x03027BE0
.incbin "actors/power_meter/power_meter_three_segments.rgba16" .incbin "actors/power_meter/power_meter_three_segments.rgba16"
power_meter_seg3_texture_030283E0: # 0x030283E0 texture_power_meter_two_segments: # 0x030283E0
.incbin "actors/power_meter/power_meter_two_segments.rgba16" .incbin "actors/power_meter/power_meter_two_segments.rgba16"
power_meter_seg3_texture_03028BE0: # 0x03028BE0 texture_power_meter_one_segments: # 0x03028BE0
.incbin "actors/power_meter/power_meter_one_segment.rgba16" .incbin "actors/power_meter/power_meter_one_segment.rgba16"
glabel power_meter_seg3_health_icons_030293E0 # 0x030293E0 glabel power_meter_health_segments_lut # 0x030293E0
.word power_meter_seg3_texture_03028BE0 .word texture_power_meter_one_segments
.word power_meter_seg3_texture_030283E0 .word texture_power_meter_two_segments
.word power_meter_seg3_texture_03027BE0 .word texture_power_meter_three_segments
.word power_meter_seg3_texture_030273E0 .word texture_power_meter_four_segments
.word power_meter_seg3_texture_03026BE0 .word texture_power_meter_five_segments
.word power_meter_seg3_texture_030263E0 .word texture_power_meter_six_segments
.word power_meter_seg3_texture_03025BE0 .word texture_power_meter_seven_segments
.word power_meter_seg3_texture_030253E0 .word texture_power_meter_full
power_meter_seg3_vertex_03029400: # 0x03029400 vertex_power_meter_base: # 0x03029400
vertex -32, -32, 0, 0, 2016, 0xFF, 0xFF, 0xFF, 0xFF vertex -32, -32, 0, 0, 2016, 0xFF, 0xFF, 0xFF, 0xFF
vertex 0, -32, 0, 992, 2016, 0xFF, 0xFF, 0xFF, 0xFF vertex 0, -32, 0, 992, 2016, 0xFF, 0xFF, 0xFF, 0xFF
vertex 0, 32, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex 0, 32, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF
@ -54,7 +52,7 @@ vertex 32, -32, 0, 1024, 2016, 0xFF, 0xFF, 0xFF, 0xFF
vertex 32, 32, 0, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex 32, 32, 0, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF
vertex 0, 32, 0, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex 0, 32, 0, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF
glabel power_meter_seg3_dl_03029480 # 0x03029480 - 0x03029530 glabel dl_power_meter_base # 0x03029480 - 0x03029530
gsDPPipeSync gsDPPipeSync
gsSPClearGeometryMode G_LIGHTING gsSPClearGeometryMode G_LIGHTING
gsDPSetCombineModeLERP1Cycle G_CCMUX_0, G_CCMUX_0, G_CCMUX_0, G_CCMUX_TEXEL0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_TEXEL0 gsDPSetCombineModeLERP1Cycle G_CCMUX_0, G_CCMUX_0, G_CCMUX_0, G_CCMUX_TEXEL0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_TEXEL0
@ -67,36 +65,36 @@ gsDPSetRenderMode G_RM_TEX_EDGE, G_RM_TEX_EDGE2
gsDPSetTextureFilter G_TF_POINT gsDPSetTextureFilter G_TF_POINT
gsSPTexture -1, -1, 0, 0, 1 gsSPTexture -1, -1, 0, 0, 1
gsSPVertex power_meter_seg3_vertex_03029400, 8, 0 gsSPVertex vertex_power_meter_base, 8, 0
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 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
gsDPTileSync gsDPTileSync
gsDPSetTile G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, G_TX_NOLOD, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD gsDPSetTile G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, G_TX_NOLOD, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD
gsDPSetTileSize 0, 0, 0, 124, 252 gsDPSetTileSize 0, 0, 0, 124, 252
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, power_meter_seg3_texture_030233E0 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture_power_meter_left_side
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100
gsSP2Triangles 0, 1, 2, 0x0, 0, 2, 3, 0x0 gsSP2Triangles 0, 1, 2, 0x0, 0, 2, 3, 0x0
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, power_meter_seg3_texture_030243E0 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture_power_meter_right_side
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100
gsSP2Triangles 4, 5, 6, 0x0, 4, 6, 7, 0x0 gsSP2Triangles 4, 5, 6, 0x0, 4, 6, 7, 0x0
gsSPEndDisplayList gsSPEndDisplayList
power_meter_seg3_vertex_03029530: # 0x03029530 vertex_power_meter_health_segments: # 0x03029530
vertex -16, -16, 0, 0, 992, 0xFF, 0xFF, 0xFF, 0xFF vertex -16, -16, 0, 0, 992, 0xFF, 0xFF, 0xFF, 0xFF
vertex 15, -16, 0, 992, 992, 0xFF, 0xFF, 0xFF, 0xFF vertex 15, -16, 0, 992, 992, 0xFF, 0xFF, 0xFF, 0xFF
vertex 15, 16, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex 15, 16, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF
vertex -16, 16, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex -16, 16, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF
glabel power_meter_seg3_dl_03029570 # 0x03029570 - 0x030295A0 glabel dl_power_meter_health_segments_begin # 0x03029570 - 0x030295A0
gsDPPipeSync gsDPPipeSync
gsSPVertex power_meter_seg3_vertex_03029530, 4, 0 gsSPVertex vertex_power_meter_health_segments, 4, 0
gsDPTileSync gsDPTileSync
gsDPSetTile G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD gsDPSetTile G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_CLAMP | G_TX_NOMIRROR, 5, G_TX_NOLOD
gsDPSetTileSize 0, 0, 0, 124, 124 gsDPSetTileSize 0, 0, 0, 124, 124
gsSPEndDisplayList gsSPEndDisplayList
glabel power_meter_seg3_dl_030295A0 # 0x030295A0 - 0x030295D8 glabel dl_power_meter_health_segments_end # 0x030295A0 - 0x030295D8
gsDPPipeSync gsDPPipeSync
gsSPTexture -1, -1, 0, 0, 0 gsSPTexture -1, -1, 0, 0, 0
gsSPSetGeometryMode G_LIGHTING gsSPSetGeometryMode G_LIGHTING

View File

@ -1,8 +1,7 @@
# Small Key (unused) # Small Key (unused)
# ??? # ???
.word 0 .dword 0
.word 0
small_key_seg5_light_05005798: # 0x05005798 small_key_seg5_light_05005798: # 0x05005798
.byte 0x3F, 0x19, 0x0C, 0x00, 0x3F, 0x19, 0x0C, 0x00 .byte 0x3F, 0x19, 0x0C, 0x00, 0x3F, 0x19, 0x0C, 0x00
@ -32,7 +31,7 @@ small_key_seg5_light_050057E8: # 0x050057E8
.byte 0xCC, 0xFF, 0x00, 0x00, 0xCC, 0xFF, 0x00, 0x00 .byte 0xCC, 0xFF, 0x00, 0x00, 0xCC, 0xFF, 0x00, 0x00
.byte 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00
.word 0, 0 # align? .balign 16
small_key_seg5_vertex_05005800: # 0x05005800 small_key_seg5_vertex_05005800: # 0x05005800
vertex -14, -109, 14, 0, 0, 0x00, 0x00, 0x7F, 0x00 vertex -14, -109, 14, 0, 0, 0x00, 0x00, 0x7F, 0x00
vertex 14, -109, 14, 0, 0, 0x00, 0x00, 0x7F, 0x00 vertex 14, -109, 14, 0, 0, 0x00, 0x00, 0x7F, 0x00

View File

@ -1,8 +1,7 @@
# Snowman # Snowman
# ??? # ???
.word 0 .dword 1
.word 1
# Unreferenced light # Unreferenced light
.byte 0x0D, 0x0C, 0x28, 0x00, 0x0D, 0x0C, 0x28, 0x00 .byte 0x0D, 0x0C, 0x28, 0x00, 0x0D, 0x0C, 0x28, 0x00

View File

@ -7,22 +7,22 @@ vertex 32, 64, 0, 1984, 0, 0x00, 0x00, 0x7F, 0x00
vertex -32, 64, 0, 0, 0, 0x00, 0x00, 0x7F, 0x00 vertex -32, 64, 0, 0, 0, 0x00, 0x00, 0x7F, 0x00
sparkles_seg4_texture_04027490: # 0x04027490 sparkles_seg4_texture_04027490: # 0x04027490
.incbin "actors/sparkle/sparkle_0.ia16" .incbin "actors/sparkle/sparkle_0.rgba16"
sparkles_seg4_texture_04027C90: # 0x04027C90 sparkles_seg4_texture_04027C90: # 0x04027C90
.incbin "actors/sparkle/sparkle_1.ia16" .incbin "actors/sparkle/sparkle_1.rgba16"
sparkles_seg4_texture_04028490: # 0x04028490 sparkles_seg4_texture_04028490: # 0x04028490
.incbin "actors/sparkle/sparkle_2.ia16" .incbin "actors/sparkle/sparkle_2.rgba16"
sparkles_seg4_texture_04028C90: # 0x04028C90 sparkles_seg4_texture_04028C90: # 0x04028C90
.incbin "actors/sparkle/sparkle_3.ia16" .incbin "actors/sparkle/sparkle_3.rgba16"
sparkles_seg4_texture_04029490: # 0x04029490 sparkles_seg4_texture_04029490: # 0x04029490
.incbin "actors/sparkle/sparkle_4.ia16" .incbin "actors/sparkle/sparkle_4.rgba16"
sparkles_seg4_texture_04029C90: # 0x04029C90 sparkles_seg4_texture_04029C90: # 0x04029C90
.incbin "actors/sparkle/sparkle_5.ia16" .incbin "actors/sparkle/sparkle_5.rgba16"
glabel sparkles_seg4_dl_0402A490 # 0x0402A490 - 0x0402A4F8 glabel sparkles_seg4_dl_0402A490 # 0x0402A490 - 0x0402A4F8
gsDPSetCombineModeLERP1Cycle G_CCMUX_0, G_CCMUX_0, G_CCMUX_0, G_CCMUX_TEXEL0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_TEXEL0 gsDPSetCombineModeLERP1Cycle G_CCMUX_0, G_CCMUX_0, G_CCMUX_0, G_CCMUX_TEXEL0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_0, G_ACMUX_TEXEL0

View File

@ -184,10 +184,9 @@ spindrift_seg5_anim_050006AC: # 0x050006AC
.word spindrift_seg5_animindex_050005F8 .word spindrift_seg5_animindex_050005F8
.word 0 .word 0
.word 0 .balign 8
.word 0 .dword 1 # False Bin ID?
.word 1 # False Bin ID?
spindrift_seg5_texture_050006D0: # 0x050006D0 spindrift_seg5_texture_050006D0: # 0x050006D0
.incbin "actors/spindrift/spindrift_face.rgba16" .incbin "actors/spindrift/spindrift_face.rgba16"

View File

@ -3,8 +3,7 @@
# Could be a duplicate binid of the previous actor, but i'm putting it here for # Could be a duplicate binid of the previous actor, but i'm putting it here for
# macro reasons so I don't have to clutter the macros.inc with a new macro for this # macro reasons so I don't have to clutter the macros.inc with a new macro for this
# case. # case.
.word 0 .dword 1
.word 1
sushi_seg5_texture_05008ED0: # 0x05008ED0 sushi_seg5_texture_05008ED0: # 0x05008ED0
.incbin "actors/sushi/sushi_snout.rgba16" .incbin "actors/sushi/sushi_snout.rgba16"

View File

@ -19,8 +19,7 @@ ukiki_seg5_light_05007BA8: # 0x05007BA8
.byte 0xE7, 0x93, 0x61, 0x00, 0xE7, 0x93, 0x61, 0x00 .byte 0xE7, 0x93, 0x61, 0x00, 0xE7, 0x93, 0x61, 0x00
.byte 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00
.word 0 .dword 1 # The hell?
.word 1 # The hell?
ukiki_seg5_texture_05007BC0: # 0x05007BC0 ukiki_seg5_texture_05007BC0: # 0x05007BC0
.incbin "actors/ukiki/ukiki_face.rgba16" .incbin "actors/ukiki/ukiki_face.rgba16"

View File

@ -7,28 +7,28 @@ vertex 64, 256, 0, 992, 0, 0xFF, 0xFF, 0xFF, 0xFF
vertex -64, 256, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF vertex -64, 256, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF
water_splash_seg4_texture_0402A5C8: # 0x0402A5C8 water_splash_seg4_texture_0402A5C8: # 0x0402A5C8
.incbin "actors/water_splash/water_splash_0.ia16" .incbin "actors/water_splash/water_splash_0.rgba16"
water_splash_seg4_texture_0402B5C8: # 0x0402B5C8 water_splash_seg4_texture_0402B5C8: # 0x0402B5C8
.incbin "actors/water_splash/water_splash_1.ia16" .incbin "actors/water_splash/water_splash_1.rgba16"
water_splash_seg4_texture_0402C5C8: # 0x0402C5C8 water_splash_seg4_texture_0402C5C8: # 0x0402C5C8
.incbin "actors/water_splash/water_splash_2.ia16" .incbin "actors/water_splash/water_splash_2.rgba16"
water_splash_seg4_texture_0402D5C8: # 0x0402D5C8 water_splash_seg4_texture_0402D5C8: # 0x0402D5C8
.incbin "actors/water_splash/water_splash_3.ia16" .incbin "actors/water_splash/water_splash_3.rgba16"
water_splash_seg4_texture_0402E5C8: # 0x0402E5C8 water_splash_seg4_texture_0402E5C8: # 0x0402E5C8
.incbin "actors/water_splash/water_splash_4.ia16" .incbin "actors/water_splash/water_splash_4.rgba16"
water_splash_seg4_texture_0402F5C8: # 0x0402F5C8 water_splash_seg4_texture_0402F5C8: # 0x0402F5C8
.incbin "actors/water_splash/water_splash_5.ia16" .incbin "actors/water_splash/water_splash_5.rgba16"
water_splash_seg4_texture_040305C8: # 0x040305C8 water_splash_seg4_texture_040305C8: # 0x040305C8
.incbin "actors/water_splash/water_splash_6.ia16" .incbin "actors/water_splash/water_splash_6.rgba16"
water_splash_seg4_texture_040315C8: # 0x040315C8 water_splash_seg4_texture_040315C8: # 0x040315C8
.incbin "actors/water_splash/water_splash_7.ia16" .incbin "actors/water_splash/water_splash_7.rgba16"
glabel water_splash_seg4_dl_040325C8 # 0x040325C8 - 0x04032640 glabel water_splash_seg4_dl_040325C8 # 0x040325C8 - 0x04032640
gsSPClearGeometryMode G_LIGHTING gsSPClearGeometryMode G_LIGHTING

View File

@ -13,23 +13,6 @@ colVertex 150, 430, -3
colVertex 150, 50, -3 colVertex 150, 50, -3
colVertex -200, 430, -3 colVertex -200, 430, -3
colTriInit SURFACE_CAM_NO_COL, 12
colTri 2, 1, 0
colTri 3, 2, 0
colTri 6, 5, 4
colTri 5, 7, 4
colTri 7, 5, 3
colTri 5, 2, 3
colTri 6, 4, 0
colTri 1, 6, 0
colTri 5, 1, 2
colTri 6, 1, 5
colTri 0, 7, 3
colTri 0, 4, 7
colTriStop
colEnd
.word 0
.else .else
colInit colInit
@ -42,6 +25,7 @@ colVertex -150, 50, -3
colVertex 150, 430, -3 colVertex 150, 430, -3
colVertex 150, 50, -3 colVertex 150, 50, -3
colVertex -150, 430, -3 colVertex -150, 430, -3
.endif
colTriInit SURFACE_CAM_NO_COL, 12 colTriInit SURFACE_CAM_NO_COL, 12
colTri 2, 1, 0 colTri 2, 1, 0
@ -58,5 +42,5 @@ colTri 0, 7, 3
colTri 0, 4, 7 colTri 0, 4, 7
colTriStop colTriStop
colEnd colEnd
.word 0 .word 0
.endif

View File

@ -1,8 +1,7 @@
# Whomp # Whomp
# ??? # ???
.word 0 .dword 2
.word 2
.balign 8 .balign 8
@ -571,4 +570,3 @@ whomp_seg6_anim_060209EC: # 0x060209EC
glabel whomp_seg6_anims_06020A04 # 0x06020A04 glabel whomp_seg6_anims_06020A04 # 0x06020A04
.word whomp_seg6_anim_060209EC .word whomp_seg6_anim_060209EC
.word whomp_seg6_anim_060202DC .word whomp_seg6_anim_060202DC
# no terminator? TODO: What does the 0 at the end of these structs actually do?

View File

@ -1,469 +0,0 @@
.late_rodata
glabel jtbl_80337BE0
.word L80316BD0
.word L80316BDC
.word L80316C1C
.word L80316BEC
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316BFC
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316C1C
.word L80316C0C
.text
glabel func_80316928
/* 0D1928 80316928 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 0D192C 8031692C 3C0E8033 */ lui $t6, %hi(gAudioLoadLock) # $t6, 0x8033
/* 0D1930 80316930 AFBF0024 */ sw $ra, 0x24($sp)
/* 0D1934 80316934 AFB30020 */ sw $s3, 0x20($sp)
/* 0D1938 80316938 AFB2001C */ sw $s2, 0x1c($sp)
/* 0D193C 8031693C AFB10018 */ sw $s1, 0x18($sp)
/* 0D1940 80316940 AFB00014 */ sw $s0, 0x14($sp)
/* 0D1944 80316944 AFA40038 */ sw $a0, 0x38($sp)
/* 0D1948 80316948 25CE3EF4 */ addiu $t6, %lo(gAudioLoadLock) # addiu $t6, $t6, 0x3ef4
/* 0D194C 8031694C 8DCF0000 */ lw $t7, ($t6)
/* 0D1950 80316950 51E0007A */ beql $t7, $zero, .L80316B3C
/* 0D1954 80316954 8FB80038 */ lw $t8, 0x38($sp)
/* 0D1958 80316958 0C0C5A33 */ jal func_803168CC
/* 0D195C 8031695C 00000000 */ nop
/* 0D1960 80316960 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D1964 80316964 8C636D70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D1968 80316968 00008025 */ move $s0, $zero
/* 0D196C 8031696C 00002025 */ move $a0, $zero
/* 0D1970 80316970 18600027 */ blez $v1, .L80316A10
/* 0D1974 80316974 00008825 */ move $s1, $zero
/* 0D1978 80316978 3C068022 */ lui $a2, %hi(gAudioUpdatesPerFrame) # $a2, 0x8022
/* 0D197C 8031697C 3C058022 */ lui $a1, %hi(gNotes) # $a1, 0x8022
/* 0D1980 80316980 24A52A10 */ addiu $a1, %lo(gNotes) # addiu $a1, $a1, 0x2a10
/* 0D1984 80316984 24C66D7E */ addiu $a2, %lo(gAudioUpdatesPerFrame) # addiu $a2, $a2, 0x6d7e
.L80316988:
/* 0D1988 80316988 8CB80000 */ lw $t8, ($a1)
/* 0D198C 8031698C 26100001 */ addiu $s0, $s0, 1
/* 0D1990 80316990 03041021 */ addu $v0, $t8, $a0
/* 0D1994 80316994 8C590000 */ lw $t9, ($v0)
/* 0D1998 80316998 001967C2 */ srl $t4, $t9, 0x1f
/* 0D199C 8031699C 5180001A */ beql $t4, $zero, .L80316A08
/* 0D19A0 803169A0 0203082A */ slt $at, $s0, $v1
/* 0D19A4 803169A4 904D0055 */ lbu $t5, 0x55($v0)
/* 0D19A8 803169A8 51A00017 */ beql $t5, $zero, .L80316A08
/* 0D19AC 803169AC 0203082A */ slt $at, $s0, $v1
/* 0D19B0 803169B0 80CE0000 */ lb $t6, ($a2)
/* 0D19B4 803169B4 340F8000 */ li $t7, 32768
/* 0D19B8 803169B8 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D19BC 803169BC 01EE001A */ div $zero, $t7, $t6
/* 0D19C0 803169C0 0000C012 */ mflo $t8
/* 0D19C4 803169C4 A4580062 */ sh $t8, 0x62($v0)
/* 0D19C8 803169C8 8CB90000 */ lw $t9, ($a1)
/* 0D19CC 803169CC 15C00002 */ bnez $t6, .L803169D8
/* 0D19D0 803169D0 00000000 */ nop
/* 0D19D4 803169D4 0007000D */ break 7
.L803169D8:
/* 0D19D8 803169D8 2401FFFF */ li $at, -1
/* 0D19DC 803169DC 15C10004 */ bne $t6, $at, .L803169F0
/* 0D19E0 803169E0 3C018000 */ lui $at, 0x8000
/* 0D19E4 803169E4 15E10002 */ bne $t7, $at, .L803169F0
/* 0D19E8 803169E8 00000000 */ nop
/* 0D19EC 803169EC 0006000D */ break 6
.L803169F0:
/* 0D19F0 803169F0 03241021 */ addu $v0, $t9, $a0
/* 0D19F4 803169F4 904C0054 */ lbu $t4, 0x54($v0)
/* 0D19F8 803169F8 358D0010 */ ori $t5, $t4, 0x10
/* 0D19FC 803169FC A04D0054 */ sb $t5, 0x54($v0)
/* 0D1A00 80316A00 8C636D70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D1A04 80316A04 0203082A */ slt $at, $s0, $v1
.L80316A08:
/* 0D1A08 80316A08 1420FFDF */ bnez $at, .L80316988
/* 0D1A0C 80316A0C 248400C0 */ addiu $a0, $a0, 0xc0
.L80316A10:
/* 0D1A10 80316A10 0C0C5A3D */ jal wait_for_audio_frames
/* 0D1A14 80316A14 24040001 */ li $a0, 1
/* 0D1A18 80316A18 26310001 */ addiu $s1, $s1, 1
/* 0D1A1C 80316A1C 2A2100F1 */ slti $at, $s1, 0xf1
/* 0D1A20 80316A20 10200013 */ beqz $at, .L80316A70
/* 0D1A24 80316A24 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D1A28 80316A28 8C636D70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D1A2C 80316A2C 00008025 */ move $s0, $zero
/* 0D1A30 80316A30 3C028022 */ lui $v0, %hi(gNotes) # $v0, 0x8022
/* 0D1A34 80316A34 1860000A */ blez $v1, .L80316A60
/* 0D1A38 80316A38 00000000 */ nop
/* 0D1A3C 80316A3C 8C422A10 */ lw $v0, %lo(gNotes)($v0)
.L80316A40:
/* 0D1A40 80316A40 8C4F0000 */ lw $t7, ($v0)
/* 0D1A44 80316A44 000F77C2 */ srl $t6, $t7, 0x1f
/* 0D1A48 80316A48 15C00005 */ bnez $t6, .L80316A60
/* 0D1A4C 80316A4C 00000000 */ nop
/* 0D1A50 80316A50 26100001 */ addiu $s0, $s0, 1
/* 0D1A54 80316A54 0203082A */ slt $at, $s0, $v1
/* 0D1A58 80316A58 1420FFF9 */ bnez $at, .L80316A40
/* 0D1A5C 80316A5C 244200C0 */ addiu $v0, $v0, 0xc0
.L80316A60:
/* 0D1A60 80316A60 12030003 */ beq $s0, $v1, .L80316A70
/* 0D1A64 80316A64 00000000 */ nop
/* 0D1A68 80316A68 1000FFE9 */ b .L80316A10
/* 0D1A6C 80316A6C 00000000 */ nop
.L80316A70:
/* 0D1A70 80316A70 0C0C5A33 */ jal func_803168CC
/* 0D1A74 80316A74 00000000 */ nop
/* 0D1A78 80316A78 0C0C5A3D */ jal wait_for_audio_frames
/* 0D1A7C 80316A7C 24040003 */ li $a0, 3
/* 0D1A80 80316A80 3C181971 */ lui $t8, (0x19710515 >> 16) # lui $t8, 0x1971
/* 0D1A84 80316A84 3C198033 */ lui $t9, %hi(gAudioLoadLock) # $t9, 0x8033
/* 0D1A88 80316A88 27393EF4 */ addiu $t9, %lo(gAudioLoadLock) # addiu $t9, $t9, 0x3ef4
/* 0D1A8C 80316A8C 37180515 */ ori $t8, (0x19710515 & 0xFFFF) # ori $t8, $t8, 0x515
/* 0D1A90 80316A90 AF380000 */ sw $t8, ($t9)
/* 0D1A94 80316A94 0C0C5A3D */ jal wait_for_audio_frames
/* 0D1A98 80316A98 24040003 */ li $a0, 3
/* 0D1A9C 80316A9C 3C138022 */ lui $s3, %hi(gCurrAudioFrameDmaCount) # $s3, 0x8022
/* 0D1AA0 80316AA0 26736D84 */ addiu $s3, %lo(gCurrAudioFrameDmaCount) # addiu $s3, $s3, 0x6d84
/* 0D1AA4 80316AA4 8E710000 */ lw $s1, ($s3)
/* 0D1AA8 80316AA8 1A200014 */ blez $s1, .L80316AFC
/* 0D1AAC 80316AAC 00000000 */ nop
/* 0D1AB0 80316AB0 3C128022 */ lui $s2, %hi(gCurrAudioFrameDmaQueue) # $s2, 0x8022
/* 0D1AB4 80316AB4 26525EE8 */ addiu $s2, %lo(gCurrAudioFrameDmaQueue) # addiu $s2, $s2, 0x5ee8
/* 0D1AB8 80316AB8 8E6C0000 */ lw $t4, ($s3)
.L80316ABC:
/* 0D1ABC 80316ABC 00008025 */ move $s0, $zero
/* 0D1AC0 80316AC0 1980000C */ blez $t4, .L80316AF4
/* 0D1AC4 80316AC4 02402025 */ move $a0, $s2
.L80316AC8:
/* 0D1AC8 80316AC8 00002825 */ move $a1, $zero
/* 0D1ACC 80316ACC 0C0C8634 */ jal osRecvMesg
/* 0D1AD0 80316AD0 00003025 */ move $a2, $zero
/* 0D1AD4 80316AD4 54400003 */ bnezl $v0, .L80316AE4
/* 0D1AD8 80316AD8 8E6D0000 */ lw $t5, ($s3)
/* 0D1ADC 80316ADC 2631FFFF */ addiu $s1, $s1, -1
/* 0D1AE0 80316AE0 8E6D0000 */ lw $t5, ($s3)
.L80316AE4:
/* 0D1AE4 80316AE4 26100001 */ addiu $s0, $s0, 1
/* 0D1AE8 80316AE8 020D082A */ slt $at, $s0, $t5
/* 0D1AEC 80316AEC 5420FFF6 */ bnezl $at, .L80316AC8
/* 0D1AF0 80316AF0 02402025 */ move $a0, $s2
.L80316AF4:
/* 0D1AF4 80316AF4 5E20FFF1 */ bgtzl $s1, .L80316ABC
/* 0D1AF8 80316AF8 8E6C0000 */ lw $t4, ($s3)
.L80316AFC:
/* 0D1AFC 80316AFC 3C038022 */ lui $v1, %hi(gAiBuffers) # $v1, 0x8022
/* 0D1B00 80316B00 3C068022 */ lui $a2, %hi(gAiBuffers + 0xC) # $a2, 0x8022
/* 0D1B04 80316B04 AE600000 */ sw $zero, ($s3)
/* 0D1B08 80316B08 24C66E4C */ addiu $a2, %lo(gAiBuffers + 0xC) # addiu $a2, $a2, 0x6e4c
/* 0D1B0C 80316B0C 24636E40 */ addiu $v1, %lo(gAiBuffers) # addiu $v1, $v1, 0x6e40
/* 0D1B10 80316B10 24040A00 */ li $a0, 2560
/* 0D1B14 80316B14 00001025 */ move $v0, $zero
.L80316B18:
/* 0D1B18 80316B18 8C6F0000 */ lw $t7, ($v1)
/* 0D1B1C 80316B1C 01E27021 */ addu $t6, $t7, $v0
/* 0D1B20 80316B20 24420002 */ addiu $v0, $v0, 2
/* 0D1B24 80316B24 1444FFFC */ bne $v0, $a0, .L80316B18
/* 0D1B28 80316B28 A5C00000 */ sh $zero, ($t6)
/* 0D1B2C 80316B2C 24630004 */ addiu $v1, $v1, 4
/* 0D1B30 80316B30 5466FFF9 */ bnel $v1, $a2, .L80316B18
/* 0D1B34 80316B34 00001025 */ move $v0, $zero
/* 0D1B38 80316B38 8FB80038 */ lw $t8, 0x38($sp)
.L80316B3C:
/* 0D1B3C 80316B3C 3C018022 */ lui $at, %hi(gSampleDmaNumListItems) # $at, 0x8022
/* 0D1B40 80316B40 AC206B38 */ sw $zero, %lo(gSampleDmaNumListItems)($at)
/* 0D1B44 80316B44 97190006 */ lhu $t9, 6($t8)
/* 0D1B48 80316B48 AFB9002C */ sw $t9, 0x2c($sp)
/* 0D1B4C 80316B4C 0C0C9290 */ jal osAiSetFrequency
/* 0D1B50 80316B50 8F040000 */ lw $a0, ($t8)
/* 0D1B54 80316B54 2401003C */ li $at, 60
/* 0D1B58 80316B58 0041001A */ div $zero, $v0, $at
/* 0D1B5C 80316B5C 8FA80038 */ lw $t0, 0x38($sp)
/* 0D1B60 80316B60 3C038022 */ lui $v1, %hi(gAiFrequency) # $v1, 0x8022
/* 0D1B64 80316B64 24636D64 */ addiu $v1, %lo(gAiFrequency) # addiu $v1, $v1, 0x6d64
/* 0D1B68 80316B68 AC620000 */ sw $v0, ($v1)
/* 0D1B6C 80316B6C 910C0004 */ lbu $t4, 4($t0)
/* 0D1B70 80316B70 00007812 */ mflo $t7
/* 0D1B74 80316B74 3C0A8022 */ lui $t2, %hi(D_80226D74) # $t2, 0x8022
/* 0D1B78 80316B78 3C0B8022 */ lui $t3, %hi(gMaxSimultaneousNotes) # $t3, 0x8022
/* 0D1B7C 80316B7C 25EE000F */ addiu $t6, $t7, 0xf
/* 0D1B80 80316B80 2401FFF0 */ li $at, -16
/* 0D1B84 80316B84 256B6D70 */ addiu $t3, %lo(gMaxSimultaneousNotes) # addiu $t3, $t3, 0x6d70
/* 0D1B88 80316B88 254A6D74 */ addiu $t2, %lo(D_80226D74) # addiu $t2, $t2, 0x6d74
/* 0D1B8C 80316B8C 01C1C824 */ and $t9, $t6, $at
/* 0D1B90 80316B90 AD590000 */ sw $t9, ($t2)
/* 0D1B94 80316B94 AD6C0000 */ sw $t4, ($t3)
/* 0D1B98 80316B98 91180005 */ lbu $t8, 5($t0)
/* 0D1B9C 80316B9C 3C098022 */ lui $t1, %hi(D_802212A2) # $t1, 0x8022
/* 0D1BA0 80316BA0 252912A2 */ addiu $t1, %lo(D_802212A2) # addiu $t1, $t1, 0x12a2
/* 0D1BA4 80316BA4 A1380000 */ sb $t8, ($t1)
/* 0D1BA8 80316BA8 812C0000 */ lb $t4, ($t1)
/* 0D1BAC 80316BAC 258DFFFF */ addiu $t5, $t4, -1
/* 0D1BB0 80316BB0 2DA10010 */ sltiu $at, $t5, 0x10
/* 0D1BB4 80316BB4 10200019 */ beqz $at, .L80316C1C
/* 0D1BB8 80316BB8 000D6880 */ sll $t5, $t5, 2
/* 0D1BBC 80316BBC 3C018033 */ lui $at, %hi(jtbl_80337BE0)
/* 0D1BC0 80316BC0 002D0821 */ addu $at, $at, $t5
/* 0D1BC4 80316BC4 8C2D7BE0 */ lw $t5, %lo(jtbl_80337BE0)($at)
/* 0D1BC8 80316BC8 01A00008 */ jr $t5
/* 0D1BCC 80316BCC 00000000 */ nop
glabel L80316BD0
/* 0D1BD0 80316BD0 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1BD4 80316BD4 10000013 */ b .L80316C24
/* 0D1BD8 80316BD8 A02012A3 */ sb $zero, %lo(D_802212A3)($at)
glabel L80316BDC
/* 0D1BDC 80316BDC 240F0001 */ li $t7, 1
/* 0D1BE0 80316BE0 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1BE4 80316BE4 1000000F */ b .L80316C24
/* 0D1BE8 80316BE8 A02F12A3 */ sb $t7, %lo(D_802212A3)($at)
glabel L80316BEC
/* 0D1BEC 80316BEC 240E0002 */ li $t6, 2
/* 0D1BF0 80316BF0 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1BF4 80316BF4 1000000B */ b .L80316C24
/* 0D1BF8 80316BF8 A02E12A3 */ sb $t6, %lo(D_802212A3)($at)
glabel L80316BFC
/* 0D1BFC 80316BFC 24190003 */ li $t9, 3
/* 0D1C00 80316C00 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1C04 80316C04 10000007 */ b .L80316C24
/* 0D1C08 80316C08 A03912A3 */ sb $t9, %lo(D_802212A3)($at)
glabel L80316C0C
/* 0D1C0C 80316C0C 24180004 */ li $t8, 4
/* 0D1C10 80316C10 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1C14 80316C14 10000003 */ b .L80316C24
/* 0D1C18 80316C18 A03812A3 */ sb $t8, %lo(D_802212A3)($at)
.L80316C1C:
glabel L80316C1C
/* 0D1C1C 80316C1C 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D1C20 80316C20 A02012A3 */ sb $zero, %lo(D_802212A3)($at)
.L80316C24:
/* 0D1C24 80316C24 910C0005 */ lbu $t4, 5($t0)
/* 0D1C28 80316C28 3C018022 */ lui $at, %hi(D_802212A0) # $at, 0x8022
/* 0D1C2C 80316C2C 3C188033 */ lui $t8, %hi(gTatumsPerBeat) # $t8, 0x8033
/* 0D1C30 80316C30 A12C0000 */ sb $t4, ($t1)
/* 0D1C34 80316C34 950D000A */ lhu $t5, 0xa($t0)
/* 0D1C38 80316C38 87183EE4 */ lh $t8, %lo(gTatumsPerBeat)($t8)
/* 0D1C3C 80316C3C 3C138022 */ lui $s3, %hi(D_80226D6C) # $s3, 0x8022
/* 0D1C40 80316C40 A42D12A0 */ sh $t5, %lo(D_802212A0)($at)
/* 0D1C44 80316C44 8D420000 */ lw $v0, ($t2)
/* 0D1C48 80316C48 3C018022 */ lui $at, %hi(gMinAiBufferLength) # $at, 0x8022
/* 0D1C4C 80316C4C 26736D6C */ addiu $s3, %lo(D_80226D6C) # addiu $s3, $s3, 0x6d6c
/* 0D1C50 80316C50 244FFFF0 */ addiu $t7, $v0, -0x10
/* 0D1C54 80316C54 AC2F6D78 */ sw $t7, %lo(gMinAiBufferLength)($at)
/* 0D1C58 80316C58 240100A0 */ li $at, 160
/* 0D1C5C 80316C5C 0041001A */ div $zero, $v0, $at
/* 0D1C60 80316C60 00001812 */ mflo $v1
/* 0D1C64 80316C64 24630001 */ addiu $v1, $v1, 1
/* 0D1C68 80316C68 00032E00 */ sll $a1, $v1, 0x18
/* 0D1C6C 80316C6C 00057603 */ sra $t6, $a1, 0x18
/* 0D1C70 80316C70 000EC8C0 */ sll $t9, $t6, 3
/* 0D1C74 80316C74 032EC823 */ subu $t9, $t9, $t6
/* 0D1C78 80316C78 0019C940 */ sll $t9, $t9, 5
/* 0D1C7C 80316C7C 032EC821 */ addu $t9, $t9, $t6
/* 0D1C80 80316C80 0019C900 */ sll $t9, $t9, 4
/* 0D1C84 80316C84 0338001A */ div $zero, $t9, $t8
/* 0D1C88 80316C88 3C018022 */ lui $at, %hi(gAudioUpdatesPerFrame) # $at, 0x8022
/* 0D1C8C 80316C8C A0236D7E */ sb $v1, %lo(gAudioUpdatesPerFrame)($at)
/* 0D1C90 80316C90 00006012 */ mflo $t4
/* 0D1C94 80316C94 01C02825 */ move $a1, $t6
/* 0D1C98 80316C98 3C048022 */ lui $a0, %hi(D_80221898) # $a0, 0x8022
/* 0D1C9C 80316C9C 24841898 */ addiu $a0, %lo(D_80221898) # addiu $a0, $a0, 0x1898
/* 0D1CA0 80316CA0 17000002 */ bnez $t8, .L80316CAC
/* 0D1CA4 80316CA4 00000000 */ nop
/* 0D1CA8 80316CA8 0007000D */ break 7
.L80316CAC:
/* 0D1CAC 80316CAC 2401FFFF */ li $at, -1
/* 0D1CB0 80316CB0 17010004 */ bne $t8, $at, .L80316CC4
/* 0D1CB4 80316CB4 3C018000 */ lui $at, 0x8000
/* 0D1CB8 80316CB8 17210002 */ bne $t9, $at, .L80316CC4
/* 0D1CBC 80316CBC 00000000 */ nop
/* 0D1CC0 80316CC0 0006000D */ break 6
.L80316CC4:
/* 0D1CC4 80316CC4 3C018022 */ lui $at, %hi(gTempoInternalToExternal) # $at, 0x8022
/* 0D1CC8 80316CC8 A42C6D7C */ sh $t4, %lo(gTempoInternalToExternal)($at)
/* 0D1CCC 80316CCC 8D6D0000 */ lw $t5, ($t3)
/* 0D1CD0 80316CD0 000D7880 */ sll $t7, $t5, 2
/* 0D1CD4 80316CD4 01ED7821 */ addu $t7, $t7, $t5
/* 0D1CD8 80316CD8 000F7880 */ sll $t7, $t7, 2
/* 0D1CDC 80316CDC 01E50019 */ multu $t7, $a1
/* 0D1CE0 80316CE0 00007012 */ mflo $t6
/* 0D1CE4 80316CE4 25D90140 */ addiu $t9, $t6, 0x140
/* 0D1CE8 80316CE8 AE790000 */ sw $t9, ($s3)
/* 0D1CEC 80316CEC 8D0C000C */ lw $t4, 0xc($t0)
/* 0D1CF0 80316CF0 8D180010 */ lw $t8, 0x10($t0)
/* 0D1CF4 80316CF4 8D0F0014 */ lw $t7, 0x14($t0)
/* 0D1CF8 80316CF8 8D0D0018 */ lw $t5, 0x18($t0)
/* 0D1CFC 80316CFC 3C0E8022 */ lui $t6, %hi(D_802212A8 + 8) # $t6, 0x8022
/* 0D1D00 80316D00 8DCE12B0 */ lw $t6, %lo(D_802212A8 + 8)($t6)
/* 0D1D04 80316D04 030C8021 */ addu $s0, $t8, $t4
/* 0D1D08 80316D08 01AF8821 */ addu $s1, $t5, $t7
/* 0D1D0C 80316D0C 02113021 */ addu $a2, $s0, $s1
/* 0D1D10 80316D10 01C63823 */ subu $a3, $t6, $a2
/* 0D1D14 80316D14 24E7FF00 */ addiu $a3, $a3, -0x100
/* 0D1D18 80316D18 AC870000 */ sw $a3, ($a0)
/* 0D1D1C 80316D1C 0C0C5859 */ jal func_80316164
/* 0D1D20 80316D20 AC86000C */ sw $a2, 0xc($a0)
/* 0D1D24 80316D24 3C048022 */ lui $a0, %hi(D_802218A8) # $a0, 0x8022
/* 0D1D28 80316D28 248418A8 */ addiu $a0, %lo(D_802218A8) # addiu $a0, $a0, 0x18a8
/* 0D1D2C 80316D2C AC900000 */ sw $s0, ($a0)
/* 0D1D30 80316D30 0C0C5878 */ jal func_803161E0
/* 0D1D34 80316D34 AC910004 */ sw $s1, 4($a0)
/* 0D1D38 80316D38 8FA20038 */ lw $v0, 0x38($sp)
/* 0D1D3C 80316D3C 3C048022 */ lui $a0, %hi(D_802218B0) # $a0, 0x8022
/* 0D1D40 80316D40 248418B0 */ addiu $a0, %lo(D_802218B0) # addiu $a0, $a0, 0x18b0
/* 0D1D44 80316D44 8C59000C */ lw $t9, 0xc($v0)
/* 0D1D48 80316D48 AC990000 */ sw $t9, ($a0)
/* 0D1D4C 80316D4C 8C580010 */ lw $t8, 0x10($v0)
/* 0D1D50 80316D50 AC800008 */ sw $zero, 8($a0)
/* 0D1D54 80316D54 0C0C5897 */ jal func_8031625C
/* 0D1D58 80316D58 AC980004 */ sw $t8, 4($a0)
/* 0D1D5C 80316D5C 8FAC0038 */ lw $t4, 0x38($sp)
/* 0D1D60 80316D60 8FAF0038 */ lw $t7, 0x38($sp)
/* 0D1D64 80316D64 3C048022 */ lui $a0, %hi(D_802218C0) # $a0, 0x8022
/* 0D1D68 80316D68 8D8D0014 */ lw $t5, 0x14($t4)
/* 0D1D6C 80316D6C 248418C0 */ addiu $a0, %lo(D_802218C0) # addiu $a0, $a0, 0x18c0
/* 0D1D70 80316D70 AC8D0000 */ sw $t5, ($a0)
/* 0D1D74 80316D74 8DEE0018 */ lw $t6, 0x18($t7)
/* 0D1D78 80316D78 AC800008 */ sw $zero, 8($a0)
/* 0D1D7C 80316D7C 0C0C58C6 */ jal func_80316318
/* 0D1D80 80316D80 AC8E0004 */ sw $t6, 4($a0)
/* 0D1D84 80316D84 0C0C5798 */ jal reset_bank_and_seq_load_status
/* 0D1D88 80316D88 00000000 */ nop
/* 0D1D8C 80316D8C 3C108022 */ lui $s0, %hi(gAudioCmdBuffers) # $s0, 0x8022
/* 0D1D90 80316D90 3C128022 */ lui $s2, %hi(D_802212C8) # $s2, 0x8022
/* 0D1D94 80316D94 3C118022 */ lui $s1, %hi(gAudioCmdBuffers + 8) # $s1, 0x8022
/* 0D1D98 80316D98 26316D98 */ addiu $s1, %lo(gAudioCmdBuffers + 8) # addiu $s1, $s1, 0x6d98
/* 0D1D9C 80316D9C 265212C8 */ addiu $s2, %lo(D_802212C8) # addiu $s2, $s2, 0x12c8
/* 0D1DA0 80316DA0 26106D90 */ addiu $s0, %lo(gAudioCmdBuffers) # addiu $s0, $s0, 0x6d90
.L80316DA4:
/* 0D1DA4 80316DA4 8E650000 */ lw $a1, ($s3)
/* 0D1DA8 80316DA8 02402025 */ move $a0, $s2
/* 0D1DAC 80316DAC 0005C8C0 */ sll $t9, $a1, 3
/* 0D1DB0 80316DB0 0C0C5808 */ jal soundAlloc
/* 0D1DB4 80316DB4 03202825 */ move $a1, $t9
/* 0D1DB8 80316DB8 26100004 */ addiu $s0, $s0, 4
/* 0D1DBC 80316DBC 1611FFF9 */ bne $s0, $s1, .L80316DA4
/* 0D1DC0 80316DC0 AE02FFFC */ sw $v0, -4($s0)
/* 0D1DC4 80316DC4 3C058022 */ lui $a1, %hi(gMaxSimultaneousNotes) # $a1, 0x8022
/* 0D1DC8 80316DC8 8CA56D70 */ lw $a1, %lo(gMaxSimultaneousNotes)($a1)
/* 0D1DCC 80316DCC 02402025 */ move $a0, $s2
/* 0D1DD0 80316DD0 0005C080 */ sll $t8, $a1, 2
/* 0D1DD4 80316DD4 0305C023 */ subu $t8, $t8, $a1
/* 0D1DD8 80316DD8 0C0C5808 */ jal soundAlloc
/* 0D1DDC 80316DDC 00182980 */ sll $a1, $t8, 6
/* 0D1DE0 80316DE0 3C018022 */ lui $at, %hi(gNotes) # $at, 0x8022
/* 0D1DE4 80316DE4 0C0C6750 */ jal note_init_all
/* 0D1DE8 80316DE8 AC222A10 */ sw $v0, %lo(gNotes)($at)
/* 0D1DEC 80316DEC 0C0C6492 */ jal init_note_free_list
/* 0D1DF0 80316DF0 00000000 */ nop
/* 0D1DF4 80316DF4 8FA2002C */ lw $v0, 0x2c($sp)
/* 0D1DF8 80316DF8 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D1DFC 80316DFC 263111B0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0x11b0
/* 0D1E00 80316E00 14400005 */ bnez $v0, .L80316E18
/* 0D1E04 80316E04 240C0008 */ li $t4, 8
/* 0D1E08 80316E08 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D1E0C 80316E0C 263111B0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0x11b0
/* 0D1E10 80316E10 10000051 */ b .L80316F58
/* 0D1E14 80316E14 A2200001 */ sb $zero, 1($s1)
.L80316E18:
/* 0D1E18 80316E18 00028040 */ sll $s0, $v0, 1
/* 0D1E1C 80316E1C A22C0001 */ sb $t4, 1($s1)
/* 0D1E20 80316E20 02002825 */ move $a1, $s0
/* 0D1E24 80316E24 0C0C5808 */ jal soundAlloc
/* 0D1E28 80316E28 02402025 */ move $a0, $s2
/* 0D1E2C 80316E2C AE220014 */ sw $v0, 0x14($s1)
/* 0D1E30 80316E30 02402025 */ move $a0, $s2
/* 0D1E34 80316E34 0C0C5808 */ jal soundAlloc
/* 0D1E38 80316E38 02002825 */ move $a1, $s0
/* 0D1E3C 80316E3C 8FAD002C */ lw $t5, 0x2c($sp)
/* 0D1E40 80316E40 8FAF0038 */ lw $t7, 0x38($sp)
/* 0D1E44 80316E44 AE220018 */ sw $v0, 0x18($s1)
/* 0D1E48 80316E48 AE200008 */ sw $zero, 8($s1)
/* 0D1E4C 80316E4C AE20000C */ sw $zero, 0xc($s1)
/* 0D1E50 80316E50 A2200003 */ sb $zero, 3($s1)
/* 0D1E54 80316E54 AE2D0010 */ sw $t5, 0x10($s1)
/* 0D1E58 80316E58 95EE0008 */ lhu $t6, 8($t7)
/* 0D1E5C 80316E5C 24190002 */ li $t9, 2
/* 0D1E60 80316E60 A2390002 */ sb $t9, 2($s1)
/* 0D1E64 80316E64 3C038022 */ lui $v1, %hi(D_802212A2) # $v1, 0x8022
/* 0D1E68 80316E68 A62E0004 */ sh $t6, 4($s1)
/* 0D1E6C 80316E6C 806312A2 */ lb $v1, %lo(D_802212A2)($v1)
/* 0D1E70 80316E70 24010001 */ li $at, 1
/* 0D1E74 80316E74 24180001 */ li $t8, 1
/* 0D1E78 80316E78 10610037 */ beq $v1, $at, .L80316F58
/* 0D1E7C 80316E7C 340C8000 */ li $t4, 32768
/* 0D1E80 80316E80 0183001A */ div $zero, $t4, $v1
/* 0D1E84 80316E84 00006812 */ mflo $t5
/* 0D1E88 80316E88 A2380000 */ sb $t8, ($s1)
/* 0D1E8C 80316E8C 14600002 */ bnez $v1, .L80316E98
/* 0D1E90 80316E90 00000000 */ nop
/* 0D1E94 80316E94 0007000D */ break 7
.L80316E98:
/* 0D1E98 80316E98 2401FFFF */ li $at, -1
/* 0D1E9C 80316E9C 14610004 */ bne $v1, $at, .L80316EB0
/* 0D1EA0 80316EA0 3C018000 */ lui $at, 0x8000
/* 0D1EA4 80316EA4 15810002 */ bne $t4, $at, .L80316EB0
/* 0D1EA8 80316EA8 00000000 */ nop
/* 0D1EAC 80316EAC 0006000D */ break 6
.L80316EB0:
/* 0D1EB0 80316EB0 A62D0006 */ sh $t5, 6($s1)
/* 0D1EB4 80316EB4 02402025 */ move $a0, $s2
/* 0D1EB8 80316EB8 24050020 */ li $a1, 32
/* 0D1EBC 80316EBC 0C0C5808 */ jal soundAlloc
/* 0D1EC0 80316EC0 00008025 */ move $s0, $zero
/* 0D1EC4 80316EC4 AE22001C */ sw $v0, 0x1c($s1)
/* 0D1EC8 80316EC8 02402025 */ move $a0, $s2
/* 0D1ECC 80316ECC 0C0C5808 */ jal soundAlloc
/* 0D1ED0 80316ED0 24050020 */ li $a1, 32
/* 0D1ED4 80316ED4 AE220020 */ sw $v0, 0x20($s1)
/* 0D1ED8 80316ED8 02402025 */ move $a0, $s2
/* 0D1EDC 80316EDC 0C0C5808 */ jal soundAlloc
/* 0D1EE0 80316EE0 24050020 */ li $a1, 32
/* 0D1EE4 80316EE4 AE220024 */ sw $v0, 0x24($s1)
/* 0D1EE8 80316EE8 02402025 */ move $a0, $s2
/* 0D1EEC 80316EEC 0C0C5808 */ jal soundAlloc
/* 0D1EF0 80316EF0 24050020 */ li $a1, 32
/* 0D1EF4 80316EF4 AE220028 */ sw $v0, 0x28($s1)
/* 0D1EF8 80316EF8 3C0F8022 */ lui $t7, %hi(gAudioUpdatesPerFrame) # $t7, 0x8022
/* 0D1EFC 80316EFC 81EF6D7E */ lb $t7, %lo(gAudioUpdatesPerFrame)($t7)
/* 0D1F00 80316F00 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D1F04 80316F04 263111B0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0x11b0
/* 0D1F08 80316F08 19E00013 */ blez $t7, .L80316F58
/* 0D1F0C 80316F0C 02402025 */ move $a0, $s2
.L80316F10:
/* 0D1F10 80316F10 0C0C5808 */ jal soundAlloc
/* 0D1F14 80316F14 24050280 */ li $a1, 640
/* 0D1F18 80316F18 244E0140 */ addiu $t6, $v0, 0x140
/* 0D1F1C 80316F1C AE220030 */ sw $v0, 0x30($s1)
/* 0D1F20 80316F20 AE2E0034 */ sw $t6, 0x34($s1)
/* 0D1F24 80316F24 02402025 */ move $a0, $s2
/* 0D1F28 80316F28 0C0C5808 */ jal soundAlloc
/* 0D1F2C 80316F2C 24050280 */ li $a1, 640
/* 0D1F30 80316F30 24590140 */ addiu $t9, $v0, 0x140
/* 0D1F34 80316F34 3C188022 */ lui $t8, %hi(gAudioUpdatesPerFrame) # $t8, 0x8022
/* 0D1F38 80316F38 AE220080 */ sw $v0, 0x80($s1)
/* 0D1F3C 80316F3C AE390084 */ sw $t9, 0x84($s1)
/* 0D1F40 80316F40 83186D7E */ lb $t8, %lo(gAudioUpdatesPerFrame)($t8)
/* 0D1F44 80316F44 26100001 */ addiu $s0, $s0, 1
/* 0D1F48 80316F48 26310014 */ addiu $s1, $s1, 0x14
/* 0D1F4C 80316F4C 0218082A */ slt $at, $s0, $t8
/* 0D1F50 80316F50 5420FFEF */ bnezl $at, .L80316F10
/* 0D1F54 80316F54 02402025 */ move $a0, $s2
.L80316F58:
/* 0D1F58 80316F58 3C048022 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8022
/* 0D1F5C 80316F5C 0C0C5D63 */ jal func_8031758C
/* 0D1F60 80316F60 8C846D70 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 0D1F64 80316F64 0C0C8804 */ jal osWritebackDCacheAll
/* 0D1F68 80316F68 00000000 */ nop
/* 0D1F6C 80316F6C 3C0C8033 */ lui $t4, %hi(gAudioLoadLock) # $t4, 0x8033
/* 0D1F70 80316F70 258C3EF4 */ addiu $t4, %lo(gAudioLoadLock) # addiu $t4, $t4, 0x3ef4
/* 0D1F74 80316F74 8D8D0000 */ lw $t5, ($t4)
/* 0D1F78 80316F78 3C0F7655 */ lui $t7, (0x76557364 >> 16) # lui $t7, 0x7655
/* 0D1F7C 80316F7C 35EF7364 */ ori $t7, (0x76557364 & 0xFFFF) # ori $t7, $t7, 0x7364
/* 0D1F80 80316F80 51A00003 */ beql $t5, $zero, .L80316F90
/* 0D1F84 80316F84 8FBF0024 */ lw $ra, 0x24($sp)
/* 0D1F88 80316F88 AD8F0000 */ sw $t7, ($t4)
/* 0D1F8C 80316F8C 8FBF0024 */ lw $ra, 0x24($sp)
.L80316F90:
/* 0D1F90 80316F90 8FB00014 */ lw $s0, 0x14($sp)
/* 0D1F94 80316F94 8FB10018 */ lw $s1, 0x18($sp)
/* 0D1F98 80316F98 8FB2001C */ lw $s2, 0x1c($sp)
/* 0D1F9C 80316F9C 8FB30020 */ lw $s3, 0x20($sp)
/* 0D1FA0 80316FA0 03E00008 */ jr $ra
/* 0D1FA4 80316FA4 27BD0038 */ addiu $sp, $sp, 0x38

View File

@ -1,503 +0,0 @@
.late_rodata
glabel jtbl_80337BE0
.word L80317BF0
.word L80317BFC
.word L80317C3C
.word L80317C0C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C1C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C3C
.word L80317C2C
glabel D_U_80338E00
.word 0x4A2FC800 /* 2880000.0f */
glabel D_U_80338E04
.word 0x4185B439 /* 16.713f */
.text
glabel func_80316928
/* 0D2948 80317948 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 0D294C 8031794C 3C0E8033 */ lui $t6, %hi(gAudioLoadLock) # $t6, 0x8033
/* 0D2950 80317950 AFBF0024 */ sw $ra, 0x24($sp)
/* 0D2954 80317954 AFB30020 */ sw $s3, 0x20($sp)
/* 0D2958 80317958 AFB2001C */ sw $s2, 0x1c($sp)
/* 0D295C 8031795C AFB10018 */ sw $s1, 0x18($sp)
/* 0D2960 80317960 AFB00014 */ sw $s0, 0x14($sp)
/* 0D2964 80317964 AFA40038 */ sw $a0, 0x38($sp)
/* 0D2968 80317968 25CE5004 */ addiu $t6, %lo(gAudioLoadLock) # addiu $t6, $t6, 0x5004
/* 0D296C 8031796C 8DCF0000 */ lw $t7, ($t6)
/* 0D2970 80317970 51E0007A */ beql $t7, $zero, .L80317B5C
/* 0D2974 80317974 8FB80038 */ lw $t8, 0x38($sp)
/* 0D2978 80317978 0C0C5E3B */ jal func_803168CC
/* 0D297C 8031797C 00000000 */ nop
/* 0D2980 80317980 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D2984 80317984 8C636B70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D2988 80317988 00008025 */ move $s0, $zero
/* 0D298C 8031798C 00002025 */ move $a0, $zero
/* 0D2990 80317990 18600027 */ blez $v1, .L80317A30
/* 0D2994 80317994 00008825 */ move $s1, $zero
/* 0D2998 80317998 3C068022 */ lui $a2, %hi(gAudioUpdatesPerFrame) # $a2, 0x8022
/* 0D299C 8031799C 3C058022 */ lui $a1, %hi(gNotes) # $a1, 0x8022
/* 0D29A0 803179A0 24A52610 */ addiu $a1, %lo(gNotes) # addiu $a1, $a1, 0x2610
/* 0D29A4 803179A4 24C66B7E */ addiu $a2, %lo(gAudioUpdatesPerFrame) # addiu $a2, $a2, 0x6b7e
.L803179A8:
/* 0D29A8 803179A8 8CB80000 */ lw $t8, ($a1)
/* 0D29AC 803179AC 26100001 */ addiu $s0, $s0, 1
/* 0D29B0 803179B0 03041021 */ addu $v0, $t8, $a0
/* 0D29B4 803179B4 8C590000 */ lw $t9, ($v0)
/* 0D29B8 803179B8 001967C2 */ srl $t4, $t9, 0x1f
/* 0D29BC 803179BC 5180001A */ beql $t4, $zero, .L80317A28
/* 0D29C0 803179C0 0203082A */ slt $at, $s0, $v1
/* 0D29C4 803179C4 904D0055 */ lbu $t5, 0x55($v0)
/* 0D29C8 803179C8 51A00017 */ beql $t5, $zero, .L80317A28
/* 0D29CC 803179CC 0203082A */ slt $at, $s0, $v1
/* 0D29D0 803179D0 80CE0000 */ lb $t6, ($a2)
/* 0D29D4 803179D4 340F8000 */ li $t7, 32768
/* 0D29D8 803179D8 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D29DC 803179DC 01EE001A */ div $zero, $t7, $t6
/* 0D29E0 803179E0 0000C012 */ mflo $t8
/* 0D29E4 803179E4 A4580062 */ sh $t8, 0x62($v0)
/* 0D29E8 803179E8 8CB90000 */ lw $t9, ($a1)
/* 0D29EC 803179EC 15C00002 */ bnez $t6, .L803179F8
/* 0D29F0 803179F0 00000000 */ nop
/* 0D29F4 803179F4 0007000D */ break 7
.L803179F8:
/* 0D29F8 803179F8 2401FFFF */ li $at, -1
/* 0D29FC 803179FC 15C10004 */ bne $t6, $at, .L80317A10
/* 0D2A00 80317A00 3C018000 */ lui $at, 0x8000
/* 0D2A04 80317A04 15E10002 */ bne $t7, $at, .L80317A10
/* 0D2A08 80317A08 00000000 */ nop
/* 0D2A0C 80317A0C 0006000D */ break 6
.L80317A10:
/* 0D2A10 80317A10 03241021 */ addu $v0, $t9, $a0
/* 0D2A14 80317A14 904C0054 */ lbu $t4, 0x54($v0)
/* 0D2A18 80317A18 358D0010 */ ori $t5, $t4, 0x10
/* 0D2A1C 80317A1C A04D0054 */ sb $t5, 0x54($v0)
/* 0D2A20 80317A20 8C636B70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D2A24 80317A24 0203082A */ slt $at, $s0, $v1
.L80317A28:
/* 0D2A28 80317A28 1420FFDF */ bnez $at, .L803179A8
/* 0D2A2C 80317A2C 248400C0 */ addiu $a0, $a0, 0xc0
.L80317A30:
/* 0D2A30 80317A30 0C0C5E45 */ jal wait_for_audio_frames
/* 0D2A34 80317A34 24040001 */ li $a0, 1
/* 0D2A38 80317A38 26310001 */ addiu $s1, $s1, 1
/* 0D2A3C 80317A3C 2A2100F1 */ slti $at, $s1, 0xf1
/* 0D2A40 80317A40 10200013 */ beqz $at, .L80317A90
/* 0D2A44 80317A44 3C038022 */ lui $v1, %hi(gMaxSimultaneousNotes) # $v1, 0x8022
/* 0D2A48 80317A48 8C636B70 */ lw $v1, %lo(gMaxSimultaneousNotes)($v1)
/* 0D2A4C 80317A4C 00008025 */ move $s0, $zero
/* 0D2A50 80317A50 3C028022 */ lui $v0, %hi(gNotes) # $v0, 0x8022
/* 0D2A54 80317A54 1860000A */ blez $v1, .L80317A80
/* 0D2A58 80317A58 00000000 */ nop
/* 0D2A5C 80317A5C 8C422610 */ lw $v0, %lo(gNotes)($v0)
.L80317A60:
/* 0D2A60 80317A60 8C4F0000 */ lw $t7, ($v0)
/* 0D2A64 80317A64 000F77C2 */ srl $t6, $t7, 0x1f
/* 0D2A68 80317A68 15C00005 */ bnez $t6, .L80317A80
/* 0D2A6C 80317A6C 00000000 */ nop
/* 0D2A70 80317A70 26100001 */ addiu $s0, $s0, 1
/* 0D2A74 80317A74 0203082A */ slt $at, $s0, $v1
/* 0D2A78 80317A78 1420FFF9 */ bnez $at, .L80317A60
/* 0D2A7C 80317A7C 244200C0 */ addiu $v0, $v0, 0xc0
.L80317A80:
/* 0D2A80 80317A80 12030003 */ beq $s0, $v1, .L80317A90
/* 0D2A84 80317A84 00000000 */ nop
/* 0D2A88 80317A88 1000FFE9 */ b .L80317A30
/* 0D2A8C 80317A8C 00000000 */ nop
.L80317A90:
/* 0D2A90 80317A90 0C0C5E3B */ jal func_803168CC
/* 0D2A94 80317A94 00000000 */ nop
/* 0D2A98 80317A98 0C0C5E45 */ jal wait_for_audio_frames
/* 0D2A9C 80317A9C 24040003 */ li $a0, 3
/* 0D2AA0 80317AA0 3C181971 */ lui $t8, (0x19710515 >> 16) # lui $t8, 0x1971
/* 0D2AA4 80317AA4 3C198033 */ lui $t9, %hi(gAudioLoadLock) # $t9, 0x8033
/* 0D2AA8 80317AA8 27395004 */ addiu $t9, %lo(gAudioLoadLock) # addiu $t9, $t9, 0x5004
/* 0D2AAC 80317AAC 37180515 */ ori $t8, (0x19710515 & 0xFFFF) # ori $t8, $t8, 0x515
/* 0D2AB0 80317AB0 AF380000 */ sw $t8, ($t9)
/* 0D2AB4 80317AB4 0C0C5E45 */ jal wait_for_audio_frames
/* 0D2AB8 80317AB8 24040003 */ li $a0, 3
/* 0D2ABC 80317ABC 3C138022 */ lui $s3, %hi(gCurrAudioFrameDmaCount) # $s3, 0x8022
/* 0D2AC0 80317AC0 26736B84 */ addiu $s3, %lo(gCurrAudioFrameDmaCount) # addiu $s3, $s3, 0x6b84
/* 0D2AC4 80317AC4 8E710000 */ lw $s1, ($s3)
/* 0D2AC8 80317AC8 3C128022 */ lui $s2, %hi(gCurrAudioFrameDmaQueue) # $s2, 0x8022
/* 0D2ACC 80317ACC 26525CE8 */ addiu $s2, %lo(gCurrAudioFrameDmaQueue) # addiu $s2, $s2, 0x5ce8
/* 0D2AD0 80317AD0 1A200012 */ blez $s1, .L80317B1C
/* 0D2AD4 80317AD4 00000000 */ nop
/* 0D2AD8 80317AD8 8E6C0000 */ lw $t4, ($s3)
.L80317ADC:
/* 0D2ADC 80317ADC 00008025 */ move $s0, $zero
/* 0D2AE0 80317AE0 1980000C */ blez $t4, .L80317B14
/* 0D2AE4 80317AE4 02402025 */ move $a0, $s2
.L80317AE8:
/* 0D2AE8 80317AE8 00002825 */ move $a1, $zero
/* 0D2AEC 80317AEC 0C0C8A00 */ jal osRecvMesg
/* 0D2AF0 80317AF0 00003025 */ move $a2, $zero
/* 0D2AF4 80317AF4 54400003 */ bnezl $v0, .L80317B04
/* 0D2AF8 80317AF8 8E6D0000 */ lw $t5, ($s3)
/* 0D2AFC 80317AFC 2631FFFF */ addiu $s1, $s1, -1
/* 0D2B00 80317B00 8E6D0000 */ lw $t5, ($s3)
.L80317B04:
/* 0D2B04 80317B04 26100001 */ addiu $s0, $s0, 1
/* 0D2B08 80317B08 020D082A */ slt $at, $s0, $t5
/* 0D2B0C 80317B0C 5420FFF6 */ bnezl $at, .L80317AE8
/* 0D2B10 80317B10 02402025 */ move $a0, $s2
.L80317B14:
/* 0D2B14 80317B14 5E20FFF1 */ bgtzl $s1, .L80317ADC
/* 0D2B18 80317B18 8E6C0000 */ lw $t4, ($s3)
.L80317B1C:
/* 0D2B1C 80317B1C 3C038022 */ lui $v1, %hi(gAiBuffers) # $v1, 0x8022
/* 0D2B20 80317B20 3C068022 */ lui $a2, %hi(gAiBuffers + 0xC) # $a2, 0x8022
/* 0D2B24 80317B24 AE600000 */ sw $zero, ($s3)
/* 0D2B28 80317B28 24C66C4C */ addiu $a2, %lo(gAiBuffers + 0xC) # addiu $a2, $a2, 0x6c4c
/* 0D2B2C 80317B2C 24636C40 */ addiu $v1, %lo(gAiBuffers) # addiu $v1, $v1, 0x6c40
/* 0D2B30 80317B30 24040A00 */ li $a0, 2560
/* 0D2B34 80317B34 00001025 */ move $v0, $zero
.L80317B38:
/* 0D2B38 80317B38 8C6F0000 */ lw $t7, ($v1)
/* 0D2B3C 80317B3C 01E27021 */ addu $t6, $t7, $v0
/* 0D2B40 80317B40 24420002 */ addiu $v0, $v0, 2
/* 0D2B44 80317B44 1444FFFC */ bne $v0, $a0, .L80317B38
/* 0D2B48 80317B48 A5C00000 */ sh $zero, ($t6)
/* 0D2B4C 80317B4C 24630004 */ addiu $v1, $v1, 4
/* 0D2B50 80317B50 5466FFF9 */ bnel $v1, $a2, .L80317B38
/* 0D2B54 80317B54 00001025 */ move $v0, $zero
/* 0D2B58 80317B58 8FB80038 */ lw $t8, 0x38($sp)
.L80317B5C:
/* 0D2B5C 80317B5C 3C018022 */ lui $at, %hi(gSampleDmaNumListItems) # $at, 0x8022
/* 0D2B60 80317B60 AC206938 */ sw $zero, %lo(gSampleDmaNumListItems)($at)
/* 0D2B64 80317B64 97190006 */ lhu $t9, 6($t8)
/* 0D2B68 80317B68 AFB9002C */ sw $t9, 0x2c($sp)
/* 0D2B6C 80317B6C 0C0C965C */ jal osAiSetFrequency
/* 0D2B70 80317B70 8F040000 */ lw $a0, ($t8)
/* 0D2B74 80317B74 2401003C */ li $at, 60
/* 0D2B78 80317B78 0041001A */ div $zero, $v0, $at
/* 0D2B7C 80317B7C 8FA80038 */ lw $t0, 0x38($sp)
/* 0D2B80 80317B80 3C038022 */ lui $v1, %hi(gAiFrequency) # $v1, 0x8022
/* 0D2B84 80317B84 24636B64 */ addiu $v1, %lo(gAiFrequency) # addiu $v1, $v1, 0x6b64
/* 0D2B88 80317B88 AC620000 */ sw $v0, ($v1)
/* 0D2B8C 80317B8C 910C0004 */ lbu $t4, 4($t0)
/* 0D2B90 80317B90 00007812 */ mflo $t7
/* 0D2B94 80317B94 3C0A8022 */ lui $t2, %hi(D_80226D74) # $t2, 0x8022
/* 0D2B98 80317B98 3C0B8022 */ lui $t3, %hi(gMaxSimultaneousNotes) # $t3, 0x8022
/* 0D2B9C 80317B9C 25EE000F */ addiu $t6, $t7, 0xf
/* 0D2BA0 80317BA0 2401FFF0 */ li $at, -16
/* 0D2BA4 80317BA4 256B6B70 */ addiu $t3, %lo(gMaxSimultaneousNotes) # addiu $t3, $t3, 0x6b70
/* 0D2BA8 80317BA8 254A6B74 */ addiu $t2, %lo(D_80226D74) # addiu $t2, $t2, 0x6b74
/* 0D2BAC 80317BAC 01C1C824 */ and $t9, $t6, $at
/* 0D2BB0 80317BB0 AD590000 */ sw $t9, ($t2)
/* 0D2BB4 80317BB4 AD6C0000 */ sw $t4, ($t3)
/* 0D2BB8 80317BB8 91180005 */ lbu $t8, 5($t0)
/* 0D2BBC 80317BBC 3C098022 */ lui $t1, %hi(D_802212A2) # $t1, 0x8022
/* 0D2BC0 80317BC0 25290EA2 */ addiu $t1, %lo(D_802212A2) # addiu $t1, $t1, 0xea2
/* 0D2BC4 80317BC4 A1380000 */ sb $t8, ($t1)
/* 0D2BC8 80317BC8 812C0000 */ lb $t4, ($t1)
/* 0D2BCC 80317BCC 258DFFFF */ addiu $t5, $t4, -1
/* 0D2BD0 80317BD0 2DA10010 */ sltiu $at, $t5, 0x10
/* 0D2BD4 80317BD4 10200019 */ beqz $at, .L80317C3C
/* 0D2BD8 80317BD8 000D6880 */ sll $t5, $t5, 2
/* 0D2BDC 80317BDC 3C018034 */ lui $at, %hi(jtbl_80337BE0)
/* 0D2BE0 80317BE0 002D0821 */ addu $at, $at, $t5
/* 0D2BE4 80317BE4 8C2D8DC0 */ lw $t5, %lo(jtbl_80337BE0)($at)
/* 0D2BE8 80317BE8 01A00008 */ jr $t5
/* 0D2BEC 80317BEC 00000000 */ nop
glabel L80317BF0
/* 0D2BF0 80317BF0 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2BF4 80317BF4 10000013 */ b .L80317C44
/* 0D2BF8 80317BF8 A0200EA3 */ sb $zero, %lo(D_802212A3)($at)
glabel L80317BFC
/* 0D2BFC 80317BFC 240F0001 */ li $t7, 1
/* 0D2C00 80317C00 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2C04 80317C04 1000000F */ b .L80317C44
/* 0D2C08 80317C08 A02F0EA3 */ sb $t7, %lo(D_802212A3)($at)
glabel L80317C0C
/* 0D2C0C 80317C0C 240E0002 */ li $t6, 2
/* 0D2C10 80317C10 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2C14 80317C14 1000000B */ b .L80317C44
/* 0D2C18 80317C18 A02E0EA3 */ sb $t6, %lo(D_802212A3)($at)
glabel L80317C1C
/* 0D2C1C 80317C1C 24190003 */ li $t9, 3
/* 0D2C20 80317C20 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2C24 80317C24 10000007 */ b .L80317C44
/* 0D2C28 80317C28 A0390EA3 */ sb $t9, %lo(D_802212A3)($at)
glabel L80317C2C
/* 0D2C2C 80317C2C 24180004 */ li $t8, 4
/* 0D2C30 80317C30 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2C34 80317C34 10000003 */ b .L80317C44
/* 0D2C38 80317C38 A0380EA3 */ sb $t8, %lo(D_802212A3)($at)
glabel L80317C3C
.L80317C3C:
/* 0D2C3C 80317C3C 3C018022 */ lui $at, %hi(D_802212A3) # $at, 0x8022
/* 0D2C40 80317C40 A0200EA3 */ sb $zero, %lo(D_802212A3)($at)
.L80317C44:
/* 0D2C44 80317C44 910C0005 */ lbu $t4, 5($t0)
/* 0D2C48 80317C48 3C018022 */ lui $at, %hi(D_802212A0) # $at, 0x8022
/* 0D2C4C 80317C4C 3C198033 */ lui $t9, %hi(gTatumsPerBeat) # $t9, 0x8033
/* 0D2C50 80317C50 A12C0000 */ sb $t4, ($t1)
/* 0D2C54 80317C54 950D000A */ lhu $t5, 0xa($t0)
/* 0D2C58 80317C58 87394FF4 */ lh $t9, %lo(gTatumsPerBeat)($t9)
/* 0D2C5C 80317C5C 240C0001 */ li $t4, 1
/* 0D2C60 80317C60 A42D0EA0 */ sh $t5, %lo(D_802212A0)($at)
/* 0D2C64 80317C64 8D420000 */ lw $v0, ($t2)
/* 0D2C68 80317C68 3C018022 */ lui $at, %hi(gMinAiBufferLength) # $at, 0x8022
/* 0D2C6C 80317C6C 44998000 */ mtc1 $t9, $f16
/* 0D2C70 80317C70 244FFFF0 */ addiu $t7, $v0, -0x10
/* 0D2C74 80317C74 AC2F6B78 */ sw $t7, %lo(gMinAiBufferLength)($at)
/* 0D2C78 80317C78 240100A0 */ li $at, 160
/* 0D2C7C 80317C7C 0041001A */ div $zero, $v0, $at
/* 0D2C80 80317C80 00001812 */ mflo $v1
/* 0D2C84 80317C84 24630001 */ addiu $v1, $v1, 1
/* 0D2C88 80317C88 00032E00 */ sll $a1, $v1, 0x18
/* 0D2C8C 80317C8C 00057603 */ sra $t6, $a1, 0x18
/* 0D2C90 80317C90 01C02825 */ move $a1, $t6
/* 0D2C94 80317C94 44852000 */ mtc1 $a1, $f4
/* 0D2C98 80317C98 3C018022 */ lui $at, %hi(gAudioUpdatesPerFrame) # $at, 0x8022
/* 0D2C9C 80317C9C A0236B7E */ sb $v1, %lo(gAudioUpdatesPerFrame)($at)
/* 0D2CA0 80317CA0 468021A0 */ cvt.s.w $f6, $f4
/* 0D2CA4 80317CA4 3C018034 */ lui $at, %hi(D_U_80338E00) # $at, 0x8034
/* 0D2CA8 80317CA8 C4288E00 */ lwc1 $f8, %lo(D_U_80338E00)($at)
/* 0D2CAC 80317CAC 3C018034 */ lui $at, %hi(D_U_80338E04) # $at, 0x8034
/* 0D2CB0 80317CB0 3C048022 */ lui $a0, %hi(D_80221898) # $a0, 0x8022
/* 0D2CB4 80317CB4 468084A0 */ cvt.s.w $f18, $f16
/* 0D2CB8 80317CB8 46083282 */ mul.s $f10, $f6, $f8
/* 0D2CBC 80317CBC C4268E04 */ lwc1 $f6, %lo(D_U_80338E04)($at)
/* 0D2CC0 80317CC0 3C138022 */ lui $s3, %hi(D_80226D6C) # $s3, 0x8022
/* 0D2CC4 80317CC4 26736B6C */ addiu $s3, %lo(D_80226D6C) # addiu $s3, $s3, 0x6b6c
/* 0D2CC8 80317CC8 24841498 */ addiu $a0, %lo(D_80221898) # addiu $a0, $a0, 0x1498
/* 0D2CCC 80317CCC 46125103 */ div.s $f4, $f10, $f18
/* 0D2CD0 80317CD0 46062203 */ div.s $f8, $f4, $f6
/* 0D2CD4 80317CD4 4458F800 */ cfc1 $t8, $31
/* 0D2CD8 80317CD8 44CCF800 */ ctc1 $t4, $31
/* 0D2CDC 80317CDC 00000000 */ nop
/* 0D2CE0 80317CE0 46004424 */ cvt.w.s $f16, $f8
/* 0D2CE4 80317CE4 444CF800 */ cfc1 $t4, $31
/* 0D2CE8 80317CE8 00000000 */ nop
/* 0D2CEC 80317CEC 318C0078 */ andi $t4, $t4, 0x78
/* 0D2CF0 80317CF0 11800012 */ beqz $t4, .L80317D3C
/* 0D2CF4 80317CF4 3C014F00 */ li $at, 0x4F000000 # 2147483648.000000
/* 0D2CF8 80317CF8 44818000 */ mtc1 $at, $f16
/* 0D2CFC 80317CFC 240C0001 */ li $t4, 1
/* 0D2D00 80317D00 46104401 */ sub.s $f16, $f8, $f16
/* 0D2D04 80317D04 44CCF800 */ ctc1 $t4, $31
/* 0D2D08 80317D08 00000000 */ nop
/* 0D2D0C 80317D0C 46008424 */ cvt.w.s $f16, $f16
/* 0D2D10 80317D10 444CF800 */ cfc1 $t4, $31
/* 0D2D14 80317D14 00000000 */ nop
/* 0D2D18 80317D18 318C0078 */ andi $t4, $t4, 0x78
/* 0D2D1C 80317D1C 15800005 */ bnez $t4, .L80317D34
/* 0D2D20 80317D20 00000000 */ nop
/* 0D2D24 80317D24 440C8000 */ mfc1 $t4, $f16
/* 0D2D28 80317D28 3C018000 */ lui $at, 0x8000
/* 0D2D2C 80317D2C 10000007 */ b .L80317D4C
/* 0D2D30 80317D30 01816025 */ or $t4, $t4, $at
.L80317D34:
/* 0D2D34 80317D34 10000005 */ b .L80317D4C
/* 0D2D38 80317D38 240CFFFF */ li $t4, -1
.L80317D3C:
/* 0D2D3C 80317D3C 440C8000 */ mfc1 $t4, $f16
/* 0D2D40 80317D40 00000000 */ nop
/* 0D2D44 80317D44 0580FFFB */ bltz $t4, .L80317D34
/* 0D2D48 80317D48 00000000 */ nop
.L80317D4C:
/* 0D2D4C 80317D4C 3C018022 */ lui $at, %hi(gTempoInternalToExternal) # $at, 0x8022
/* 0D2D50 80317D50 A42C6B7C */ sh $t4, %lo(gTempoInternalToExternal)($at)
/* 0D2D54 80317D54 8D6D0000 */ lw $t5, ($t3)
/* 0D2D58 80317D58 44D8F800 */ ctc1 $t8, $31
/* 0D2D5C 80317D5C 000D7880 */ sll $t7, $t5, 2
/* 0D2D60 80317D60 01ED7821 */ addu $t7, $t7, $t5
/* 0D2D64 80317D64 000F7880 */ sll $t7, $t7, 2
/* 0D2D68 80317D68 01E50019 */ multu $t7, $a1
/* 0D2D6C 80317D6C 00007012 */ mflo $t6
/* 0D2D70 80317D70 25D90140 */ addiu $t9, $t6, 0x140
/* 0D2D74 80317D74 AE790000 */ sw $t9, ($s3)
/* 0D2D78 80317D78 8D0C000C */ lw $t4, 0xc($t0)
/* 0D2D7C 80317D7C 8D180010 */ lw $t8, 0x10($t0)
/* 0D2D80 80317D80 8D0F0014 */ lw $t7, 0x14($t0)
/* 0D2D84 80317D84 8D0D0018 */ lw $t5, 0x18($t0)
/* 0D2D88 80317D88 3C0E8022 */ lui $t6, %hi(D_802212A8 + 8) # $t6, 0x8022
/* 0D2D8C 80317D8C 8DCE0EB0 */ lw $t6, %lo(D_802212A8 + 8)($t6)
/* 0D2D90 80317D90 030C8021 */ addu $s0, $t8, $t4
/* 0D2D94 80317D94 01AF8821 */ addu $s1, $t5, $t7
/* 0D2D98 80317D98 02113021 */ addu $a2, $s0, $s1
/* 0D2D9C 80317D9C 01C63823 */ subu $a3, $t6, $a2
/* 0D2DA0 80317DA0 24E7FF00 */ addiu $a3, $a3, -0x100
/* 0D2DA4 80317DA4 AC870000 */ sw $a3, ($a0)
/* 0D2DA8 80317DA8 0C0C5C61 */ jal func_80316164
/* 0D2DAC 80317DAC AC86000C */ sw $a2, 0xc($a0)
/* 0D2DB0 80317DB0 3C048022 */ lui $a0, %hi(D_802218A8) # $a0, 0x8022
/* 0D2DB4 80317DB4 248414A8 */ addiu $a0, %lo(D_802218A8) # addiu $a0, $a0, 0x14a8
/* 0D2DB8 80317DB8 AC900000 */ sw $s0, ($a0)
/* 0D2DBC 80317DBC 0C0C5C80 */ jal func_803161E0
/* 0D2DC0 80317DC0 AC910004 */ sw $s1, 4($a0)
/* 0D2DC4 80317DC4 8FA20038 */ lw $v0, 0x38($sp)
/* 0D2DC8 80317DC8 3C048022 */ lui $a0, %hi(D_802218B0) # $a0, 0x8022
/* 0D2DCC 80317DCC 248414B0 */ addiu $a0, %lo(D_802218B0) # addiu $a0, $a0, 0x14b0
/* 0D2DD0 80317DD0 8C59000C */ lw $t9, 0xc($v0)
/* 0D2DD4 80317DD4 AC990000 */ sw $t9, ($a0)
/* 0D2DD8 80317DD8 8C580010 */ lw $t8, 0x10($v0)
/* 0D2DDC 80317DDC AC800008 */ sw $zero, 8($a0)
/* 0D2DE0 80317DE0 0C0C5C9F */ jal func_8031625C
/* 0D2DE4 80317DE4 AC980004 */ sw $t8, 4($a0)
/* 0D2DE8 80317DE8 8FAC0038 */ lw $t4, 0x38($sp)
/* 0D2DEC 80317DEC 8FAF0038 */ lw $t7, 0x38($sp)
/* 0D2DF0 80317DF0 3C048022 */ lui $a0, %hi(D_802218C0) # $a0, 0x8022
/* 0D2DF4 80317DF4 8D8D0014 */ lw $t5, 0x14($t4)
/* 0D2DF8 80317DF8 248414C0 */ addiu $a0, %lo(D_802218C0) # addiu $a0, $a0, 0x14c0
/* 0D2DFC 80317DFC AC8D0000 */ sw $t5, ($a0)
/* 0D2E00 80317E00 8DEE0018 */ lw $t6, 0x18($t7)
/* 0D2E04 80317E04 AC800008 */ sw $zero, 8($a0)
/* 0D2E08 80317E08 0C0C5CCE */ jal func_80316318
/* 0D2E0C 80317E0C AC8E0004 */ sw $t6, 4($a0)
/* 0D2E10 80317E10 0C0C5BA0 */ jal reset_bank_and_seq_load_status
/* 0D2E14 80317E14 00000000 */ nop
/* 0D2E18 80317E18 3C108022 */ lui $s0, %hi(gAudioCmdBuffers) # $s0, 0x8022
/* 0D2E1C 80317E1C 3C128022 */ lui $s2, %hi(D_802212C8) # $s2, 0x8022
/* 0D2E20 80317E20 3C118022 */ lui $s1, %hi(gAudioCmdBuffers + 8) # $s1, 0x8022
/* 0D2E24 80317E24 26316B98 */ addiu $s1, %lo(gAudioCmdBuffers + 8) # addiu $s1, $s1, 0x6b98
/* 0D2E28 80317E28 26520EC8 */ addiu $s2, %lo(D_802212C8) # addiu $s2, $s2, 0xec8
/* 0D2E2C 80317E2C 26106B90 */ addiu $s0, %lo(gAudioCmdBuffers) # addiu $s0, $s0, 0x6b90
.L80317E30:
/* 0D2E30 80317E30 8E650000 */ lw $a1, ($s3)
/* 0D2E34 80317E34 02402025 */ move $a0, $s2
/* 0D2E38 80317E38 0005C8C0 */ sll $t9, $a1, 3
/* 0D2E3C 80317E3C 0C0C5C10 */ jal soundAlloc
/* 0D2E40 80317E40 03202825 */ move $a1, $t9
/* 0D2E44 80317E44 26100004 */ addiu $s0, $s0, 4
/* 0D2E48 80317E48 1611FFF9 */ bne $s0, $s1, .L80317E30
/* 0D2E4C 80317E4C AE02FFFC */ sw $v0, -4($s0)
/* 0D2E50 80317E50 3C058022 */ lui $a1, %hi(gMaxSimultaneousNotes) # $a1, 0x8022
/* 0D2E54 80317E54 8CA56B70 */ lw $a1, %lo(gMaxSimultaneousNotes)($a1)
/* 0D2E58 80317E58 02402025 */ move $a0, $s2
/* 0D2E5C 80317E5C 0005C080 */ sll $t8, $a1, 2
/* 0D2E60 80317E60 0305C023 */ subu $t8, $t8, $a1
/* 0D2E64 80317E64 0C0C5C10 */ jal soundAlloc
/* 0D2E68 80317E68 00182980 */ sll $a1, $t8, 6
/* 0D2E6C 80317E6C 3C018022 */ lui $at, %hi(gNotes) # $at, 0x8022
/* 0D2E70 80317E70 0C0C6B6B */ jal note_init_all
/* 0D2E74 80317E74 AC222610 */ sw $v0, %lo(gNotes)($at)
/* 0D2E78 80317E78 0C0C68AD */ jal init_note_free_list
/* 0D2E7C 80317E7C 00000000 */ nop
/* 0D2E80 80317E80 8FA2002C */ lw $v0, 0x2c($sp)
/* 0D2E84 80317E84 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D2E88 80317E88 26310DB0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0xdb0
/* 0D2E8C 80317E8C 14400005 */ bnez $v0, .L80317EA4
/* 0D2E90 80317E90 240C0008 */ li $t4, 8
/* 0D2E94 80317E94 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D2E98 80317E98 26310DB0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0xdb0
/* 0D2E9C 80317E9C 10000051 */ b .L80317FE4
/* 0D2EA0 80317EA0 A2200001 */ sb $zero, 1($s1)
.L80317EA4:
/* 0D2EA4 80317EA4 00028040 */ sll $s0, $v0, 1
/* 0D2EA8 80317EA8 A22C0001 */ sb $t4, 1($s1)
/* 0D2EAC 80317EAC 02002825 */ move $a1, $s0
/* 0D2EB0 80317EB0 0C0C5C10 */ jal soundAlloc
/* 0D2EB4 80317EB4 02402025 */ move $a0, $s2
/* 0D2EB8 80317EB8 AE220014 */ sw $v0, 0x14($s1)
/* 0D2EBC 80317EBC 02402025 */ move $a0, $s2
/* 0D2EC0 80317EC0 0C0C5C10 */ jal soundAlloc
/* 0D2EC4 80317EC4 02002825 */ move $a1, $s0
/* 0D2EC8 80317EC8 8FAD002C */ lw $t5, 0x2c($sp)
/* 0D2ECC 80317ECC 8FAF0038 */ lw $t7, 0x38($sp)
/* 0D2ED0 80317ED0 AE220018 */ sw $v0, 0x18($s1)
/* 0D2ED4 80317ED4 AE200008 */ sw $zero, 8($s1)
/* 0D2ED8 80317ED8 AE20000C */ sw $zero, 0xc($s1)
/* 0D2EDC 80317EDC A2200003 */ sb $zero, 3($s1)
/* 0D2EE0 80317EE0 AE2D0010 */ sw $t5, 0x10($s1)
/* 0D2EE4 80317EE4 95EE0008 */ lhu $t6, 8($t7)
/* 0D2EE8 80317EE8 24190002 */ li $t9, 2
/* 0D2EEC 80317EEC A2390002 */ sb $t9, 2($s1)
/* 0D2EF0 80317EF0 3C038022 */ lui $v1, %hi(D_802212A2) # $v1, 0x8022
/* 0D2EF4 80317EF4 A62E0004 */ sh $t6, 4($s1)
/* 0D2EF8 80317EF8 80630EA2 */ lb $v1, %lo(D_802212A2)($v1)
/* 0D2EFC 80317EFC 24010001 */ li $at, 1
/* 0D2F00 80317F00 24180001 */ li $t8, 1
/* 0D2F04 80317F04 10610037 */ beq $v1, $at, .L80317FE4
/* 0D2F08 80317F08 340C8000 */ li $t4, 32768
/* 0D2F0C 80317F0C 0183001A */ div $zero, $t4, $v1
/* 0D2F10 80317F10 00006812 */ mflo $t5
/* 0D2F14 80317F14 A2380000 */ sb $t8, ($s1)
/* 0D2F18 80317F18 14600002 */ bnez $v1, .L80317F24
/* 0D2F1C 80317F1C 00000000 */ nop
/* 0D2F20 80317F20 0007000D */ break 7
.L80317F24:
/* 0D2F24 80317F24 2401FFFF */ li $at, -1
/* 0D2F28 80317F28 14610004 */ bne $v1, $at, .L80317F3C
/* 0D2F2C 80317F2C 3C018000 */ lui $at, 0x8000
/* 0D2F30 80317F30 15810002 */ bne $t4, $at, .L80317F3C
/* 0D2F34 80317F34 00000000 */ nop
/* 0D2F38 80317F38 0006000D */ break 6
.L80317F3C:
/* 0D2F3C 80317F3C A62D0006 */ sh $t5, 6($s1)
/* 0D2F40 80317F40 02402025 */ move $a0, $s2
/* 0D2F44 80317F44 24050020 */ li $a1, 32
/* 0D2F48 80317F48 0C0C5C10 */ jal soundAlloc
/* 0D2F4C 80317F4C 00008025 */ move $s0, $zero
/* 0D2F50 80317F50 AE22001C */ sw $v0, 0x1c($s1)
/* 0D2F54 80317F54 02402025 */ move $a0, $s2
/* 0D2F58 80317F58 0C0C5C10 */ jal soundAlloc
/* 0D2F5C 80317F5C 24050020 */ li $a1, 32
/* 0D2F60 80317F60 AE220020 */ sw $v0, 0x20($s1)
/* 0D2F64 80317F64 02402025 */ move $a0, $s2
/* 0D2F68 80317F68 0C0C5C10 */ jal soundAlloc
/* 0D2F6C 80317F6C 24050020 */ li $a1, 32
/* 0D2F70 80317F70 AE220024 */ sw $v0, 0x24($s1)
/* 0D2F74 80317F74 02402025 */ move $a0, $s2
/* 0D2F78 80317F78 0C0C5C10 */ jal soundAlloc
/* 0D2F7C 80317F7C 24050020 */ li $a1, 32
/* 0D2F80 80317F80 AE220028 */ sw $v0, 0x28($s1)
/* 0D2F84 80317F84 3C0F8022 */ lui $t7, %hi(gAudioUpdatesPerFrame) # $t7, 0x8022
/* 0D2F88 80317F88 81EF6B7E */ lb $t7, %lo(gAudioUpdatesPerFrame)($t7)
/* 0D2F8C 80317F8C 3C118022 */ lui $s1, %hi(D_802211B0) # $s1, 0x8022
/* 0D2F90 80317F90 26310DB0 */ addiu $s1, %lo(D_802211B0) # addiu $s1, $s1, 0xdb0
/* 0D2F94 80317F94 19E00013 */ blez $t7, .L80317FE4
/* 0D2F98 80317F98 02402025 */ move $a0, $s2
.L80317F9C:
/* 0D2F9C 80317F9C 0C0C5C10 */ jal soundAlloc
/* 0D2FA0 80317FA0 24050280 */ li $a1, 640
/* 0D2FA4 80317FA4 244E0140 */ addiu $t6, $v0, 0x140
/* 0D2FA8 80317FA8 AE220030 */ sw $v0, 0x30($s1)
/* 0D2FAC 80317FAC AE2E0034 */ sw $t6, 0x34($s1)
/* 0D2FB0 80317FB0 02402025 */ move $a0, $s2
/* 0D2FB4 80317FB4 0C0C5C10 */ jal soundAlloc
/* 0D2FB8 80317FB8 24050280 */ li $a1, 640
/* 0D2FBC 80317FBC 24590140 */ addiu $t9, $v0, 0x140
/* 0D2FC0 80317FC0 3C188022 */ lui $t8, %hi(gAudioUpdatesPerFrame) # $t8, 0x8022
/* 0D2FC4 80317FC4 AE220080 */ sw $v0, 0x80($s1)
/* 0D2FC8 80317FC8 AE390084 */ sw $t9, 0x84($s1)
/* 0D2FCC 80317FCC 83186B7E */ lb $t8, %lo(gAudioUpdatesPerFrame)($t8)
/* 0D2FD0 80317FD0 26100001 */ addiu $s0, $s0, 1
/* 0D2FD4 80317FD4 26310014 */ addiu $s1, $s1, 0x14
/* 0D2FD8 80317FD8 0218082A */ slt $at, $s0, $t8
/* 0D2FDC 80317FDC 5420FFEF */ bnezl $at, .L80317F9C
/* 0D2FE0 80317FE0 02402025 */ move $a0, $s2
.L80317FE4:
/* 0D2FE4 80317FE4 3C048022 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8022
/* 0D2FE8 80317FE8 0C0C618D */ jal func_8031758C
/* 0D2FEC 80317FEC 8C846B70 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
/* 0D2FF0 80317FF0 0C0C8BD0 */ jal osWritebackDCacheAll
/* 0D2FF4 80317FF4 00000000 */ nop
/* 0D2FF8 80317FF8 3C0C8033 */ lui $t4, %hi(gAudioLoadLock) # $t4, 0x8033
/* 0D2FFC 80317FFC 258C5004 */ addiu $t4, %lo(gAudioLoadLock) # addiu $t4, $t4, 0x5004
/* 0D3000 80318000 8D8D0000 */ lw $t5, ($t4)
/* 0D3004 80318004 3C0F7655 */ lui $t7, (0x76557364 >> 16) # lui $t7, 0x7655
/* 0D3008 80318008 35EF7364 */ ori $t7, (0x76557364 & 0xFFFF) # ori $t7, $t7, 0x7364
/* 0D300C 8031800C 51A00003 */ beql $t5, $zero, .L8031801C
/* 0D3010 80318010 8FBF0024 */ lw $ra, 0x24($sp)
/* 0D3014 80318014 AD8F0000 */ sw $t7, ($t4)
/* 0D3018 80318018 8FBF0024 */ lw $ra, 0x24($sp)
.L8031801C:
/* 0D301C 8031801C 8FB00014 */ lw $s0, 0x14($sp)
/* 0D3020 80318020 8FB10018 */ lw $s1, 0x18($sp)
/* 0D3024 80318024 8FB2001C */ lw $s2, 0x1c($sp)
/* 0D3028 80318028 8FB30020 */ lw $s3, 0x20($sp)
/* 0D302C 8031802C 03E00008 */ jr $ra
/* 0D3030 80318030 27BD0038 */ addiu $sp, $sp, 0x38

View File

@ -34,7 +34,7 @@ glabel jtbl_80305A60
.word L_EU_802AFBD0, L_EU_802AFACC, L_EU_802AFACC .word L_EU_802AFBD0, L_EU_802AFACC, L_EU_802AFACC
.text .text
glabel func_802D8980 # EU: func_802AF808 glabel handle_dialog_text_and_pages # EU: func_802AF808
/* 06F008 802AF808 27BDFF90 */ addiu $sp, $sp, -0x70 /* 06F008 802AF808 27BDFF90 */ addiu $sp, $sp, -0x70
/* 06F00C 802AF80C AFB50034 */ sw $s5, 0x34($sp) /* 06F00C 802AF80C AFB50034 */ sw $s5, 0x34($sp)
/* 06F010 802AF810 0006AE00 */ sll $s5, $a2, 0x18 /* 06F010 802AF810 0006AE00 */ sll $s5, $a2, 0x18
@ -82,11 +82,11 @@ glabel func_802D8980 # EU: func_802AF808
/* 06F0B0 802AF8B0 ACCB0000 */ sw $t3, ($a2) /* 06F0B0 802AF8B0 ACCB0000 */ sw $t3, ($a2)
/* 06F0B4 802AF8B4 3C0C0600 */ lui $t4, 0x600 /* 06F0B4 802AF8B4 3C0C0600 */ lui $t4, 0x600
/* 06F0B8 802AF8B8 3C128033 */ lui $s2, %hi(gDialogX) # $s2, 0x8033 /* 06F0B8 802AF8B8 3C128033 */ lui $s2, %hi(gDialogX) # $s2, 0x8033
/* 06F0BC 802AF8BC 3C178030 */ lui $s7, %hi(D_8033042C) # $s7, 0x8030 /* 06F0BC 802AF8BC 3C178030 */ lui $s7, %hi(gDialogTextPos) # $s7, 0x8030
/* 06F0C0 802AF8C0 AC6C0000 */ sw $t4, ($v1) /* 06F0C0 802AF8C0 AC6C0000 */ sw $t4, ($v1)
/* 06F0C4 802AF8C4 AC6D0004 */ sw $t5, 4($v1) /* 06F0C4 802AF8C4 AC6D0004 */ sw $t5, 4($v1)
/* 06F0C8 802AF8C8 2652F69A */ addiu $s2, %lo(gDialogX) # addiu $s2, $s2, -0x966 /* 06F0C8 802AF8C8 2652F69A */ addiu $s2, %lo(gDialogX) # addiu $s2, $s2, -0x966
/* 06F0CC 802AF8CC 86F7D64C */ lh $s7, %lo(D_8033042C)($s7) /* 06F0CC 802AF8CC 86F7D64C */ lh $s7, %lo(gDialogTextPos)($s7)
/* 06F0D0 802AF8D0 A6400000 */ sh $zero, ($s2) /* 06F0D0 802AF8D0 A6400000 */ sh $zero, ($s2)
/* 06F0D4 802AF8D4 240E000E */ li $t6, 14 /* 06F0D4 802AF8D4 240E000E */ li $t6, 14
/* 06F0D8 802AF8D8 3C018033 */ lui $at, %hi(gDialogY) # $at, 0x8033 /* 06F0D8 802AF8D8 3C018033 */ lui $at, %hi(gDialogY) # $at, 0x8033
@ -111,7 +111,7 @@ glabel func_802D8980 # EU: func_802AF808
/* 06F11C 802AF91C 00132E00 */ sll $a1, $s3, 0x18 /* 06F11C 802AF91C 00132E00 */ sll $a1, $s3, 0x18
/* 06F120 802AF920 00055E03 */ sra $t3, $a1, 0x18 /* 06F120 802AF920 00055E03 */ sra $t3, $a1, 0x18
/* 06F124 802AF924 01602825 */ move $a1, $t3 /* 06F124 802AF924 01602825 */ move $a1, $t3
/* 06F128 802AF928 0C0ABBFE */ jal func_802D8450 # func_802AEFF8 /* 06F128 802AF928 0C0ABBFE */ jal change_and_flash_dialog_text_color_lines # func_802AEFF8
/* 06F12C 802AF92C 83A40073 */ lb $a0, 0x73($sp) /* 06F12C 802AF92C 83A40073 */ lb $a0, 0x73($sp)
/* 06F130 802AF930 8FAC0060 */ lw $t4, 0x60($sp) /* 06F130 802AF930 8FAC0060 */ lw $t4, 0x60($sp)
/* 06F134 802AF934 02EC6821 */ addu $t5, $s7, $t4 /* 06F134 802AF934 02EC6821 */ addu $t5, $s7, $t4
@ -151,7 +151,7 @@ glabel L_EU_802AF99C
/* 06F1B0 802AF9B0 01402025 */ move $a0, $t2 /* 06F1B0 802AF9B0 01402025 */ move $a0, $t2
/* 06F1B4 802AF9B4 83A5005E */ lb $a1, 0x5e($sp) /* 06F1B4 802AF9B4 83A5005E */ lb $a1, 0x5e($sp)
/* 06F1B8 802AF9B8 27A6005D */ addiu $a2, $sp, 0x5d /* 06F1B8 802AF9B8 27A6005D */ addiu $a2, $sp, 0x5d
/* 06F1BC 802AF9BC 0C0ABD0B */ jal func_802D8690 # func_802AF42C /* 06F1BC 802AF9BC 0C0ABD0B */ jal handle_dialog_scroll_page_state # func_802AF42C
/* 06F1C0 802AF9C0 27A7005B */ addiu $a3, $sp, 0x5b /* 06F1C0 802AF9C0 27A7005B */ addiu $a3, $sp, 0x5b
/* 06F1C4 802AF9C4 10000091 */ b .L802AFC0C /* 06F1C4 802AF9C4 10000091 */ b .L802AFC0C
/* 06F1C8 802AF9C8 A6400000 */ sh $zero, ($s2) /* 06F1C8 802AF9C8 A6400000 */ sh $zero, ($s2)
@ -160,7 +160,7 @@ glabel L_EU_802AF9CC
/* 06F1D0 802AF9D0 30CB000F */ andi $t3, $a2, 0xf /* 06F1D0 802AF9D0 30CB000F */ andi $t3, $a2, 0xf
/* 06F1D4 802AF9D4 01603025 */ move $a2, $t3 /* 06F1D4 802AF9D4 01603025 */ move $a2, $t3
/* 06F1D8 802AF9D8 02202025 */ move $a0, $s1 /* 06F1D8 802AF9D8 02202025 */ move $a0, $s1
/* 06F1DC 802AF9DC 0C0ABDB5 */ jal func_eu_802AF6D4 /* 06F1DC 802AF9DC 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
/* 06F1E0 802AF9E0 24050024 */ li $a1, 36 /* 06F1E0 802AF9E0 24050024 */ li $a1, 36
/* 06F1E4 802AF9E4 1000008A */ b .L802AFC10 /* 06F1E4 802AF9E4 1000008A */ b .L802AFC10
/* 06F1E8 802AF9E8 83A9005D */ lb $t1, 0x5d($sp) /* 06F1E8 802AF9E8 83A9005D */ lb $t1, 0x5d($sp)
@ -169,7 +169,7 @@ glabel L_EU_802AF9EC
/* 06F1F0 802AF9F0 30CC000F */ andi $t4, $a2, 0xf /* 06F1F0 802AF9F0 30CC000F */ andi $t4, $a2, 0xf
/* 06F1F4 802AF9F4 01803025 */ move $a2, $t4 /* 06F1F4 802AF9F4 01803025 */ move $a2, $t4
/* 06F1F8 802AF9F8 02202025 */ move $a0, $s1 /* 06F1F8 802AF9F8 02202025 */ move $a0, $s1
/* 06F1FC 802AF9FC 0C0ABDD6 */ jal func_eu_802AF758 /* 06F1FC 802AF9FC 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
/* 06F200 802AFA00 2405000A */ li $a1, 10 /* 06F200 802AFA00 2405000A */ li $a1, 10
/* 06F204 802AFA04 10000082 */ b .L802AFC10 /* 06F204 802AFA04 10000082 */ b .L802AFC10
/* 06F208 802AFA08 83A9005D */ lb $t1, 0x5d($sp) /* 06F208 802AFA08 83A9005D */ lb $t1, 0x5d($sp)
@ -178,7 +178,7 @@ glabel L_EU_802AFA0C
/* 06F210 802AFA10 30CD000F */ andi $t5, $a2, 0xf /* 06F210 802AFA10 30CD000F */ andi $t5, $a2, 0xf
/* 06F214 802AFA14 01A03025 */ move $a2, $t5 /* 06F214 802AFA14 01A03025 */ move $a2, $t5
/* 06F218 802AFA18 02202025 */ move $a0, $s1 /* 06F218 802AFA18 02202025 */ move $a0, $s1
/* 06F21C 802AFA1C 0C0ABDB5 */ jal func_eu_802AF6D4 /* 06F21C 802AFA1C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
/* 06F220 802AFA20 24050028 */ li $a1, 40 /* 06F220 802AFA20 24050028 */ li $a1, 40
/* 06F224 802AFA24 1000007A */ b .L802AFC10 /* 06F224 802AFA24 1000007A */ b .L802AFC10
/* 06F228 802AFA28 83A9005D */ lb $t1, 0x5d($sp) /* 06F228 802AFA28 83A9005D */ lb $t1, 0x5d($sp)
@ -187,7 +187,7 @@ glabel L_EU_802AFA2C
/* 06F230 802AFA30 30CE000F */ andi $t6, $a2, 0xf /* 06F230 802AFA30 30CE000F */ andi $t6, $a2, 0xf
/* 06F234 802AFA34 01C03025 */ move $a2, $t6 /* 06F234 802AFA34 01C03025 */ move $a2, $t6
/* 06F238 802AFA38 02202025 */ move $a0, $s1 /* 06F238 802AFA38 02202025 */ move $a0, $s1
/* 06F23C 802AFA3C 0C0ABDD6 */ jal func_eu_802AF758 /* 06F23C 802AFA3C 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
/* 06F240 802AFA40 2405000E */ li $a1, 14 /* 06F240 802AFA40 2405000E */ li $a1, 14
/* 06F244 802AFA44 10000072 */ b .L802AFC10 /* 06F244 802AFA44 10000072 */ b .L802AFC10
/* 06F248 802AFA48 83A9005D */ lb $t1, 0x5d($sp) /* 06F248 802AFA48 83A9005D */ lb $t1, 0x5d($sp)
@ -196,7 +196,7 @@ glabel L_EU_802AFA4C
/* 06F250 802AFA50 30CF000F */ andi $t7, $a2, 0xf /* 06F250 802AFA50 30CF000F */ andi $t7, $a2, 0xf
/* 06F254 802AFA54 01E03025 */ move $a2, $t7 /* 06F254 802AFA54 01E03025 */ move $a2, $t7
/* 06F258 802AFA58 02202025 */ move $a0, $s1 /* 06F258 802AFA58 02202025 */ move $a0, $s1
/* 06F25C 802AFA5C 0C0ABDB5 */ jal func_eu_802AF6D4 /* 06F25C 802AFA5C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
/* 06F260 802AFA60 24050038 */ li $a1, 56 /* 06F260 802AFA60 24050038 */ li $a1, 56
/* 06F264 802AFA64 1000006A */ b .L802AFC10 /* 06F264 802AFA64 1000006A */ b .L802AFC10
/* 06F268 802AFA68 83A9005D */ lb $t1, 0x5d($sp) /* 06F268 802AFA68 83A9005D */ lb $t1, 0x5d($sp)
@ -205,7 +205,7 @@ glabel L_EU_802AFA6C
/* 06F270 802AFA70 30D8000F */ andi $t8, $a2, 0xf /* 06F270 802AFA70 30D8000F */ andi $t8, $a2, 0xf
/* 06F274 802AFA74 03003025 */ move $a2, $t8 /* 06F274 802AFA74 03003025 */ move $a2, $t8
/* 06F278 802AFA78 02202025 */ move $a0, $s1 /* 06F278 802AFA78 02202025 */ move $a0, $s1
/* 06F27C 802AFA7C 0C0ABDD6 */ jal func_eu_802AF758 /* 06F27C 802AFA7C 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
/* 06F280 802AFA80 2405001E */ li $a1, 30 /* 06F280 802AFA80 2405001E */ li $a1, 30
/* 06F284 802AFA84 10000062 */ b .L802AFC10 /* 06F284 802AFA84 10000062 */ b .L802AFC10
/* 06F288 802AFA88 83A9005D */ lb $t1, 0x5d($sp) /* 06F288 802AFA88 83A9005D */ lb $t1, 0x5d($sp)
@ -214,7 +214,7 @@ glabel L_EU_802AFA8C
/* 06F290 802AFA90 30D9000F */ andi $t9, $a2, 0xf /* 06F290 802AFA90 30D9000F */ andi $t9, $a2, 0xf
/* 06F294 802AFA94 03203025 */ move $a2, $t9 /* 06F294 802AFA94 03203025 */ move $a2, $t9
/* 06F298 802AFA98 02202025 */ move $a0, $s1 /* 06F298 802AFA98 02202025 */ move $a0, $s1
/* 06F29C 802AFA9C 0C0ABDB5 */ jal func_eu_802AF6D4 /* 06F29C 802AFA9C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
/* 06F2A0 802AFAA0 24050032 */ li $a1, 50 /* 06F2A0 802AFAA0 24050032 */ li $a1, 50
/* 06F2A4 802AFAA4 1000005A */ b .L802AFC10 /* 06F2A4 802AFAA4 1000005A */ b .L802AFC10
/* 06F2A8 802AFAA8 83A9005D */ lb $t1, 0x5d($sp) /* 06F2A8 802AFAA8 83A9005D */ lb $t1, 0x5d($sp)
@ -223,7 +223,7 @@ glabel L_EU_802AFAAC
/* 06F2B0 802AFAB0 30C9000F */ andi $t1, $a2, 0xf /* 06F2B0 802AFAB0 30C9000F */ andi $t1, $a2, 0xf
/* 06F2B4 802AFAB4 01203025 */ move $a2, $t1 /* 06F2B4 802AFAB4 01203025 */ move $a2, $t1
/* 06F2B8 802AFAB8 02202025 */ move $a0, $s1 /* 06F2B8 802AFAB8 02202025 */ move $a0, $s1
/* 06F2BC 802AFABC 0C0ABDD6 */ jal func_eu_802AF758 /* 06F2BC 802AFABC 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
/* 06F2C0 802AFAC0 24050018 */ li $a1, 24 /* 06F2C0 802AFAC0 24050018 */ li $a1, 24
/* 06F2C4 802AFAC4 10000052 */ b .L802AFC10 /* 06F2C4 802AFAC4 10000052 */ b .L802AFC10
/* 06F2C8 802AFAC8 83A9005D */ lb $t1, 0x5d($sp) /* 06F2C8 802AFAC8 83A9005D */ lb $t1, 0x5d($sp)
@ -232,7 +232,7 @@ glabel L_EU_802AFACC
/* 06F2D0 802AFAD0 30CA000F */ andi $t2, $a2, 0xf /* 06F2D0 802AFAD0 30CA000F */ andi $t2, $a2, 0xf
/* 06F2D4 802AFAD4 01403025 */ move $a2, $t2 /* 06F2D4 802AFAD4 01403025 */ move $a2, $t2
/* 06F2D8 802AFAD8 02202025 */ move $a0, $s1 /* 06F2D8 802AFAD8 02202025 */ move $a0, $s1
/* 06F2DC 802AFADC 0C0ABDB5 */ jal func_eu_802AF6D4 /* 06F2DC 802AFADC 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
/* 06F2E0 802AFAE0 240500EB */ li $a1, 235 /* 06F2E0 802AFAE0 240500EB */ li $a1, 235
/* 06F2E4 802AFAE4 1000004A */ b .L802AFC10 /* 06F2E4 802AFAE4 1000004A */ b .L802AFC10
/* 06F2E8 802AFAE8 83A9005D */ lb $t1, 0x5d($sp) /* 06F2E8 802AFAE8 83A9005D */ lb $t1, 0x5d($sp)
@ -259,7 +259,7 @@ glabel L_EU_802AFB18
/* 06F330 802AFB30 00002025 */ move $a0, $zero /* 06F330 802AFB30 00002025 */ move $a0, $zero
/* 06F334 802AFB34 83A7005B */ lb $a3, 0x5b($sp) /* 06F334 802AFB34 83A7005B */ lb $a3, 0x5b($sp)
/* 06F338 802AFB38 AFB50010 */ sw $s5, 0x10($sp) /* 06F338 802AFB38 AFB50010 */ sw $s5, 0x10($sp)
/* 06F33C 802AFB3C 0C0ABD64 */ jal func_eu_802AF590 /* 06F33C 802AFB3C 0C0ABD64 */ jal render_multi_text_string_lines
/* 06F340 802AFB40 AFB10014 */ sw $s1, 0x14($sp) /* 06F340 802AFB40 AFB10014 */ sw $s1, 0x14($sp)
/* 06F344 802AFB44 240B0001 */ li $t3, 1 /* 06F344 802AFB44 240B0001 */ li $t3, 1
/* 06F348 802AFB48 10000030 */ b .L802AFC0C /* 06F348 802AFB48 10000030 */ b .L802AFC0C
@ -274,14 +274,14 @@ glabel L_EU_802AFB50
/* 06F368 802AFB68 24040001 */ li $a0, 1 /* 06F368 802AFB68 24040001 */ li $a0, 1
/* 06F36C 802AFB6C 83A7005B */ lb $a3, 0x5b($sp) /* 06F36C 802AFB6C 83A7005B */ lb $a3, 0x5b($sp)
/* 06F370 802AFB70 AFB50010 */ sw $s5, 0x10($sp) /* 06F370 802AFB70 AFB50010 */ sw $s5, 0x10($sp)
/* 06F374 802AFB74 0C0ABD64 */ jal func_eu_802AF590 /* 06F374 802AFB74 0C0ABD64 */ jal render_multi_text_string_lines
/* 06F378 802AFB78 AFB10014 */ sw $s1, 0x14($sp) /* 06F378 802AFB78 AFB10014 */ sw $s1, 0x14($sp)
/* 06F37C 802AFB7C 240F0001 */ li $t7, 1 /* 06F37C 802AFB7C 240F0001 */ li $t7, 1
/* 06F380 802AFB80 10000022 */ b .L802AFC0C /* 06F380 802AFB80 10000022 */ b .L802AFC0C
/* 06F384 802AFB84 A3AF005B */ sb $t7, 0x5b($sp) /* 06F384 802AFB84 A3AF005B */ sb $t7, 0x5b($sp)
glabel L_EU_802AFB88 glabel L_EU_802AFB88
/* 06F388 802AFB88 02202025 */ move $a0, $s1 /* 06F388 802AFB88 02202025 */ move $a0, $s1
/* 06F38C 802AFB8C 0C0ABD1E */ jal func_eu_802AF478 /* 06F38C 802AFB8C 0C0ABD1E */ jal render_star_count_dialog_text
/* 06F390 802AFB90 27A5005B */ addiu $a1, $sp, 0x5b /* 06F390 802AFB90 27A5005B */ addiu $a1, $sp, 0x5b
/* 06F394 802AFB94 1000001E */ b .L802AFC10 /* 06F394 802AFB94 1000001E */ b .L802AFC10
/* 06F398 802AFB98 83A9005D */ lb $t1, 0x5d($sp) /* 06F398 802AFB98 83A9005D */ lb $t1, 0x5d($sp)
@ -292,7 +292,7 @@ glabel L_EU_802AFB9C
/* 06F3A8 802AFBA8 24C60008 */ addiu $a2, $a2, 8 /* 06F3A8 802AFBA8 24C60008 */ addiu $a2, $a2, 8
/* 06F3AC 802AFBAC 00067400 */ sll $t6, $a2, 0x10 /* 06F3AC 802AFBAC 00067400 */ sll $t6, $a2, 0x10
/* 06F3B0 802AFBB0 000E3403 */ sra $a2, $t6, 0x10 /* 06F3B0 802AFBB0 000E3403 */ sra $a2, $t6, 0x10
/* 06F3B4 802AFBB4 0C0ABC6E */ jal func_eu_802AF1B8 /* 06F3B4 802AFBB4 0C0ABC6E */ jal render_generic_dialog_char_at_pos
/* 06F3B8 802AFBB8 240700F6 */ li $a3, 246 /* 06F3B8 802AFBB8 240700F6 */ li $a3, 246
/* 06F3BC 802AFBBC 86590000 */ lh $t9, ($s2) /* 06F3BC 802AFBBC 86590000 */ lh $t9, ($s2)
/* 06F3C0 802AFBC0 928900F6 */ lbu $t1, 0xf6($s4) /* 06F3C0 802AFBC0 928900F6 */ lbu $t1, 0xf6($s4)
@ -309,7 +309,7 @@ glabel L_EU_802AFBD0
/* 06F3E4 802AFBE4 02202025 */ move $a0, $s1 /* 06F3E4 802AFBE4 02202025 */ move $a0, $s1
/* 06F3E8 802AFBE8 86450000 */ lh $a1, ($s2) /* 06F3E8 802AFBE8 86450000 */ lh $a1, ($s2)
/* 06F3EC 802AFBEC 87C60000 */ lh $a2, ($fp) /* 06F3EC 802AFBEC 87C60000 */ lh $a2, ($fp)
/* 06F3F0 802AFBF0 0C0ABC6E */ jal func_eu_802AF1B8 /* 06F3F0 802AFBF0 0C0ABC6E */ jal render_generic_dialog_char_at_pos
/* 06F3F4 802AFBF4 320700FF */ andi $a3, $s0, 0xff /* 06F3F4 802AFBF4 320700FF */ andi $a3, $s0, 0xff
.L802AFBF8: .L802AFBF8:
/* 06F3F8 802AFBF8 02906821 */ addu $t5, $s4, $s0 /* 06F3F8 802AFBF8 02906821 */ addu $t5, $s4, $s0
@ -344,7 +344,7 @@ glabel L_EU_802AFBD0
/* 06F460 802AFC60 55810009 */ bnel $t4, $at, .L802AFC88 /* 06F460 802AFC60 55810009 */ bnel $t4, $at, .L802AFC88
/* 06F464 802AFC64 8FBF0044 */ lw $ra, 0x44($sp) /* 06F464 802AFC64 8FBF0044 */ lw $ra, 0x44($sp)
/* 06F468 802AFC68 15E70005 */ bne $t7, $a3, .L802AFC80 /* 06F468 802AFC68 15E70005 */ bne $t7, $a3, .L802AFC80
/* 06F46C 802AFC6C 3C018030 */ lui $at, 0x8030 /* 06F46C 802AFC6C 3C018030 */ lui $at, %hi(gLastDialogPageStrPos)
/* 06F470 802AFC70 240EFFFF */ li $t6, -1 /* 06F470 802AFC70 240EFFFF */ li $t6, -1
/* 06F474 802AFC74 3C018030 */ lui $at, %hi(gLastDialogPageStrPos) # $at, 0x8030 /* 06F474 802AFC74 3C018030 */ lui $at, %hi(gLastDialogPageStrPos) # $at, 0x8030
/* 06F478 802AFC78 10000002 */ b .L802AFC84 /* 06F478 802AFC78 10000002 */ b .L802AFC84

View File

@ -357,12 +357,12 @@
"actors/snufit/snufit_eye.rgba16.png": [32,32,2048,{"jp":[1991184,30944],"us":[1998560,30944],"eu":[1870528,30944]}], "actors/snufit/snufit_eye.rgba16.png": [32,32,2048,{"jp":[1991184,30944],"us":[1998560,30944],"eu":[1870528,30944]}],
"actors/snufit/snufit_mask_strap.rgba16.png": [16,32,1024,{"jp":[1991184,32992],"us":[1998560,32992],"eu":[1870528,32992]}], "actors/snufit/snufit_mask_strap.rgba16.png": [16,32,1024,{"jp":[1991184,32992],"us":[1998560,32992],"eu":[1870528,32992]}],
"actors/snufit/snufit_mouth.rgba16.png": [32,32,2048,{"jp":[1991184,34016],"us":[1998560,34016],"eu":[1870528,34016]}], "actors/snufit/snufit_mouth.rgba16.png": [32,32,2048,{"jp":[1991184,34016],"us":[1998560,34016],"eu":[1870528,34016]}],
"actors/sparkle/sparkle_0.ia16.png": [32,32,2048,{"jp":[1125200,160912],"us":[1132368,160912],"eu":[1004336,160912]}], "actors/sparkle/sparkle_0.rgba16.png": [32,32,2048,{"jp":[1125200,160912],"us":[1132368,160912],"eu":[1004336,160912]}],
"actors/sparkle/sparkle_1.ia16.png": [32,32,2048,{"jp":[1125200,162960],"us":[1132368,162960],"eu":[1004336,162960]}], "actors/sparkle/sparkle_1.rgba16.png": [32,32,2048,{"jp":[1125200,162960],"us":[1132368,162960],"eu":[1004336,162960]}],
"actors/sparkle/sparkle_2.ia16.png": [32,32,2048,{"jp":[1125200,165008],"us":[1132368,165008],"eu":[1004336,165008]}], "actors/sparkle/sparkle_2.rgba16.png": [32,32,2048,{"jp":[1125200,165008],"us":[1132368,165008],"eu":[1004336,165008]}],
"actors/sparkle/sparkle_3.ia16.png": [32,32,2048,{"jp":[1125200,167056],"us":[1132368,167056],"eu":[1004336,167056]}], "actors/sparkle/sparkle_3.rgba16.png": [32,32,2048,{"jp":[1125200,167056],"us":[1132368,167056],"eu":[1004336,167056]}],
"actors/sparkle/sparkle_4.ia16.png": [32,32,2048,{"jp":[1125200,169104],"us":[1132368,169104],"eu":[1004336,169104]}], "actors/sparkle/sparkle_4.rgba16.png": [32,32,2048,{"jp":[1125200,169104],"us":[1132368,169104],"eu":[1004336,169104]}],
"actors/sparkle/sparkle_5.ia16.png": [32,32,2048,{"jp":[1125200,171152],"us":[1132368,171152],"eu":[1004336,171152]}], "actors/sparkle/sparkle_5.rgba16.png": [32,32,2048,{"jp":[1125200,171152],"us":[1132368,171152],"eu":[1004336,171152]}],
"actors/sparkle_animation/sparkle_animation_0.ia16.png": [32,32,2048,{"jp":[1125200,207496],"us":[1132368,207496],"eu":[1004336,207496]}], "actors/sparkle_animation/sparkle_animation_0.ia16.png": [32,32,2048,{"jp":[1125200,207496],"us":[1132368,207496],"eu":[1004336,207496]}],
"actors/sparkle_animation/sparkle_animation_1.ia16.png": [32,32,2048,{"jp":[1125200,209544],"us":[1132368,209544],"eu":[1004336,209544]}], "actors/sparkle_animation/sparkle_animation_1.ia16.png": [32,32,2048,{"jp":[1125200,209544],"us":[1132368,209544],"eu":[1004336,209544]}],
"actors/sparkle_animation/sparkle_animation_2.ia16.png": [32,32,2048,{"jp":[1125200,211592],"us":[1132368,211592],"eu":[1004336,211592]}], "actors/sparkle_animation/sparkle_animation_2.ia16.png": [32,32,2048,{"jp":[1125200,211592],"us":[1132368,211592],"eu":[1004336,211592]}],
@ -427,14 +427,14 @@
"actors/water_mine/water_mine_right_side_unused.rgba16.png": [32,64,4096,{"jp":[1599504,363200],"us":[1606720,363536],"eu":[1478688,363536]}], "actors/water_mine/water_mine_right_side_unused.rgba16.png": [32,64,4096,{"jp":[1599504,363200],"us":[1606720,363536],"eu":[1478688,363536]}],
"actors/water_mine/water_mine_spike_unused.rgba16.png": [32,32,2048,{"jp":[1599504,367296],"us":[1606720,367632],"eu":[1478688,367632]}], "actors/water_mine/water_mine_spike_unused.rgba16.png": [32,32,2048,{"jp":[1599504,367296],"us":[1606720,367632],"eu":[1478688,367632]}],
"actors/water_ring/water_ring.rgba16.png": [64,32,4096,{"jp":[1802256,74624],"us":[1809600,74624],"eu":[1681568,74624]}], "actors/water_ring/water_ring.rgba16.png": [64,32,4096,{"jp":[1802256,74624],"us":[1809600,74624],"eu":[1681568,74624]}],
"actors/water_splash/water_splash_0.ia16.png": [32,64,4096,{"jp":[1125200,173512],"us":[1132368,173512],"eu":[1004336,173512]}], "actors/water_splash/water_splash_0.rgba16.png": [32,64,4096,{"jp":[1125200,173512],"us":[1132368,173512],"eu":[1004336,173512]}],
"actors/water_splash/water_splash_1.ia16.png": [32,64,4096,{"jp":[1125200,177608],"us":[1132368,177608],"eu":[1004336,177608]}], "actors/water_splash/water_splash_1.rgba16.png": [32,64,4096,{"jp":[1125200,177608],"us":[1132368,177608],"eu":[1004336,177608]}],
"actors/water_splash/water_splash_2.ia16.png": [32,64,4096,{"jp":[1125200,181704],"us":[1132368,181704],"eu":[1004336,181704]}], "actors/water_splash/water_splash_2.rgba16.png": [32,64,4096,{"jp":[1125200,181704],"us":[1132368,181704],"eu":[1004336,181704]}],
"actors/water_splash/water_splash_3.ia16.png": [32,64,4096,{"jp":[1125200,185800],"us":[1132368,185800],"eu":[1004336,185800]}], "actors/water_splash/water_splash_3.rgba16.png": [32,64,4096,{"jp":[1125200,185800],"us":[1132368,185800],"eu":[1004336,185800]}],
"actors/water_splash/water_splash_4.ia16.png": [32,64,4096,{"jp":[1125200,189896],"us":[1132368,189896],"eu":[1004336,189896]}], "actors/water_splash/water_splash_4.rgba16.png": [32,64,4096,{"jp":[1125200,189896],"us":[1132368,189896],"eu":[1004336,189896]}],
"actors/water_splash/water_splash_5.ia16.png": [32,64,4096,{"jp":[1125200,193992],"us":[1132368,193992],"eu":[1004336,193992]}], "actors/water_splash/water_splash_5.rgba16.png": [32,64,4096,{"jp":[1125200,193992],"us":[1132368,193992],"eu":[1004336,193992]}],
"actors/water_splash/water_splash_6.ia16.png": [32,64,4096,{"jp":[1125200,198088],"us":[1132368,198088],"eu":[1004336,198088]}], "actors/water_splash/water_splash_6.rgba16.png": [32,64,4096,{"jp":[1125200,198088],"us":[1132368,198088],"eu":[1004336,198088]}],
"actors/water_splash/water_splash_7.ia16.png": [32,64,4096,{"jp":[1125200,202184],"us":[1132368,202184],"eu":[1004336,202184]}], "actors/water_splash/water_splash_7.rgba16.png": [32,64,4096,{"jp":[1125200,202184],"us":[1132368,202184],"eu":[1004336,202184]}],
"actors/water_waves/water_waves_0.ia16.png": [32,32,2048,{"jp":[1125200,152408],"us":[1132368,152408],"eu":[1004336,152408]}], "actors/water_waves/water_waves_0.ia16.png": [32,32,2048,{"jp":[1125200,152408],"us":[1132368,152408],"eu":[1004336,152408]}],
"actors/water_waves/water_waves_1.ia16.png": [32,32,2048,{"jp":[1125200,154456],"us":[1132368,154456],"eu":[1004336,154456]}], "actors/water_waves/water_waves_1.ia16.png": [32,32,2048,{"jp":[1125200,154456],"us":[1132368,154456],"eu":[1004336,154456]}],
"actors/water_waves/water_waves_2.ia16.png": [32,32,2048,{"jp":[1125200,156504],"us":[1132368,156504],"eu":[1004336,156504]}], "actors/water_waves/water_waves_2.ia16.png": [32,32,2048,{"jp":[1125200,156504],"us":[1132368,156504],"eu":[1004336,156504]}],

View File

@ -3,13 +3,15 @@
.section .data .section .data
.macro demo name .macro demo name
.word (\name - gDemoInputs), (\name\()_end - \name) .word32 (\name - gDemoInputs)
.word32 (\name\()_end - \name)
.endm .endm
# Whomp's Fortress has the wrong size. The original entries probably manually # Whomp's Fortress has the wrong size. The original entries probably manually
# input the sizes, but we opt for macros for cleanliness. # input the sizes, but we opt for macros for cleanliness.
.macro demo2 name .macro demo2 name
.word (\name - gDemoInputs), ((\name\()_end + 0x170) - \name) .word32 (\name - gDemoInputs)
.word32 ((\name\()_end + 0x170) - \name)
.endm .endm
.macro demofile name .macro demofile name
@ -19,9 +21,9 @@
.endm .endm
glabel gDemoInputs glabel gDemoInputs
.word (demo_entry_end - demo_entry_start) / 8 # number of entries .word32 (demo_entry_end - demo_entry_start) / 8 # number of entries
.word 0
.align 3, 0x00
demo_entry_start: demo_entry_start:
.ifdef VERSION_US .ifdef VERSION_US
demo bitdw # Bowser in the Dark World demo bitdw # Bowser in the Dark World

View File

@ -1,6 +1,6 @@
.include "macros.inc" .include "macros.inc"
.data .section .data
.macro anim_file name .macro anim_file name
.balign 4, 0 .balign 4, 0
@ -8,19 +8,20 @@
.endm .endm
.macro anim_entry name .macro anim_entry name
.word (\name - gMarioAnims), (\name\()_end - \name) .word32 (\name - gMarioAnims)
.word32 (\name\()_end - \name)
.endm .endm
.macro anim_header name, flags, unk02, unk04, unk06, length, numnodes .macro anim_header name, flags, unk02, unk04, unk06, length, numnodes
\name: \name:
.hword \flags, \unk02, \unk04, \unk06, \length, \numnodes .hword \flags, \unk02, \unk04, \unk06, \length, \numnodes
.word \name\()_values - \name .word32 \name\()_values - \name
.word \name\()_indices - \name .word32 \name\()_indices - \name
.word \name\()_end - \name .word32 \name\()_end - \name
.endm .endm
glabel gMarioAnims glabel gMarioAnims
.word (anim_table_end - anim_table_start) / 8 # number of entries .word32 (anim_table_end - anim_table_start) / 8 # number of entries
.word 0 .word 0
anim_table_start: anim_table_start:

View File

@ -78,7 +78,7 @@ glabel bubble_ptr_0B006848 # 0x0B006848
effect_0B00684C: # 0x0B00684C effect_0B00684C: # 0x0B00684C
.incbin "textures/effect/tiny_bubble.0684C.rgba16" .incbin "textures/effect/tiny_bubble.0684C.rgba16"
.word 0 # align? .balign 16
glabel tiny_bubble_dl_0B006A50 # 0x0B006A50 - 0x0B006AB0 glabel tiny_bubble_dl_0B006A50 # 0x0B006A50 - 0x0B006AB0
gsDPPipeSync gsDPPipeSync
gsSPClearGeometryMode G_LIGHTING | G_CULL_BACK | G_SHADING_SMOOTH gsSPClearGeometryMode G_LIGHTING | G_CULL_BACK | G_SHADING_SMOOTH

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,10 @@
'z' = 0x3D 'z' = 0x3D
'\'' = 0x3E '\'' = 0x3E
'.' = 0x3F '.' = 0x3F
# Mario face US/EU menu string (Note: NOT multi-text, each char has a part of the face)
'☺' = 0x40, 0x41
'あ' = 0x40 'あ' = 0x40
'い' = 0x41 'い' = 0x41
'う' = 0x42 'う' = 0x42
@ -154,6 +158,8 @@
'レ' = 0x99 'レ' = 0x99
'ロ' = 0x9A 'ロ' = 0x9A
'ワ' = 0x9B 'ワ' = 0x9B
# 0x9C is unused, only defined in jp menu char lut
'ヲ' = 0x9C
'ン' = 0x9D 'ン' = 0x9D
' ' = 0x9E ' ' = 0x9E
'-' = 0x9F '-' = 0x9F
@ -177,11 +183,8 @@
'ォ' = 0xD8 'ォ' = 0xD8
'[%]' = 0xE0 '[%]' = 0xE0
'(' = 0xE1 '(' = 0xE1
'{' = 0xE1
')(' = 0xE2 ')(' = 0xE2
')' = 0xE3 ')' = 0xE3
# these two are a hack because US depends on the non combined character. TODO: Better way to handle this?
'}' = 0xE3
'+' = 0xE4 '+' = 0xE4
'&' = 0xE5 '&' = 0xE5
':' = 0xE6 ':' = 0xE6
@ -193,13 +196,13 @@
'~' = 0xF7 '~' = 0xF7
'…' = 0xF8 '…' = 0xF8
'$' = 0xF9 '$' = 0xF9
'*' = 0xFA '' = 0xFA
'[x]' = 0xFB '×' = 0xFB
'・' = 0xFC '・' = 0xFC
'#' = 0xFD '' = 0xFD
'\n' = 0xFE '\n' = 0xFE
# kana with dakuten # kana or hira with dakuten
'が' = 0xF0, 0x45 'が' = 0xF0, 0x45
'ぎ' = 0xF0, 0x46 'ぎ' = 0xF0, 0x46
'ぐ' = 0xF0, 0x47 'ぐ' = 0xF0, 0x47
@ -241,7 +244,7 @@
'ベ' = 0xF0, 0x8C 'ベ' = 0xF0, 0x8C
'ボ' = 0xF0, 0x8D 'ボ' = 0xF0, 0x8D
# kana with handakuten # kana or hira with handakuten
'ぱ' = 0xF1, 0x59 'ぱ' = 0xF1, 0x59
'ぴ' = 0xF1, 0x5A 'ぴ' = 0xF1, 0x5A
'ぷ' = 0xF1, 0x5B 'ぷ' = 0xF1, 0x5B

30
charmap_menu.txt Normal file
View File

@ -0,0 +1,30 @@
# Menu HUD chars, only used in JP
# Char values used by text_menu_strings.h.in
'フ' = 0x00
'ァ' = 0x01
'イ' = 0x02
'ル' = 0x03
'セ' = 0x04
'レ' = 0x05
'ク' = 0x06
'ト' = 0x07
'を' = 0x08
'コ' = 0x09
'ピ' = 0x0A
'ー' = 0x0B
'す' = 0x0C
'る' = 0x0D
'け' = 0x0E
'マ' = 0x0F
'リ' = 0x10
'オ' = 0x11
'ス' = 0x12
'ア' = 0x13
'み' = 0x14
'ど' = 0x15
'の' = 0x16
'?' = 0x17
'サ' = 0x18
'ウ' = 0x19
'ン' = 0x1A
'ド' = 0x1B

View File

@ -241,7 +241,8 @@
.macro obj_child model_id, beh .macro obj_child model_id, beh
bytes4 0x1C, 0x00, 0x00, 0x00 bytes4 0x1C, 0x00, 0x00, 0x00
.word \model_id, \beh .word \model_id
.word \beh
.endm .endm
.macro deactivate .macro deactivate
@ -3301,35 +3302,35 @@ glabel bhvYellowBackgroundInMenu # 2FA0
glabel bhvMenuButton # 2FC4 glabel bhvMenuButton # 2FC4
begin OBJ_LIST_LEVEL begin OBJ_LIST_LEVEL
obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE
callnative bhvMenuButton_init callnative bhv_menu_button_init
begin_loop begin_loop
obj_set_int objIntangibleTimer, 0 obj_set_int objIntangibleTimer, 0
callnative bhvMenuButton_loop callnative bhv_menu_button_loop
end_loop end_loop
glabel bhvMenuButtonManager # 2FE8 glabel bhvMenuButtonManager # 2FE8
begin OBJ_LIST_LEVEL begin OBJ_LIST_LEVEL
obj_or_int objFlags, (OBJ_FLAG_0800 | OBJ_FLAG_0020 | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE) obj_or_int objFlags, (OBJ_FLAG_0800 | OBJ_FLAG_0020 | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)
callnative bhvMenuButtonManager_init callnative bhv_menu_button_manager_init
begin_loop begin_loop
obj_set_int objIntangibleTimer, 0 obj_set_int objIntangibleTimer, 0
callnative bhvMenuButtonManager_loop callnative bhv_menu_button_manager_loop
end_loop end_loop
glabel bhvStarInActSelector # 300C glabel bhvActSelectorStarType # 300C
begin OBJ_LIST_DEFAULT begin OBJ_LIST_DEFAULT
obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE
obj_set_pos obj_set_pos
begin_loop begin_loop
callnative BehStarActSelectorLoop callnative bhv_act_selector_star_type_loop
end_loop end_loop
glabel bhvActSelector # 3028 glabel bhvActSelector # 3028
begin OBJ_LIST_DEFAULT begin OBJ_LIST_DEFAULT
obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE obj_or_int objFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE
callnative BehActSelectorInit callnative bhv_act_selector_init
begin_loop begin_loop
callnative BehActSelectorLoop callnative bhv_act_selector_loop
end_loop end_loop
glabel bhvMovingYellowCoin # 3048 glabel bhvMovingYellowCoin # 3048

File diff suppressed because it is too large Load Diff

16
diff.sh
View File

@ -70,11 +70,15 @@ fi
START="$1" START="$1"
BASE=0 BASE=0
if [ $DIFF_OBJ != 1 ] && [ $MAKE = 1 ]; then
make $MAKEFLAGS "$MYIMG"
fi
set +e set +e
if [ -n "$MAPFILE" ]; then if [ -n "$MAPFILE" ] && [ "${START:0:2}" != "0x" ]; then
LINE=$(grep "$1$" $MAPFILE) LINE=$(grep "$1$" $MAPFILE)
if [[ -n "$LINE" && "${1:0:2}" != "0x" ]]; then if [ -n "$LINE" ]; then
START=$(echo $LINE | cut -d' ' -f1) START=$(echo $LINE | cut -d' ' -f1)
if [[ $DIFF_OBJ = 1 ]]; then if [[ $DIFF_OBJ = 1 ]]; then
LINE2=$(grep "$1$\|^ .text" $MAPFILE | grep "$1$" -B1 | head -n1) LINE2=$(grep "$1$\|^ .text" $MAPFILE | grep "$1$" -B1 | head -n1)
@ -88,6 +92,11 @@ if [ -n "$MAPFILE" ]; then
fi fi
fi fi
if ! [[ "$START" =~ ^[0-9] ]]; then
echo "Function $1 not found in map file." >&2
exit 1
fi
set -e set -e
if [[ $DIFF_OBJ = 1 ]]; then if [[ $DIFF_OBJ = 1 ]]; then
@ -109,9 +118,6 @@ if [[ $DIFF_OBJ = 1 ]]; then
$OBJDUMP $OBJFILE | grep "<$1>:" -A1000 > $MYDUMP $OBJDUMP $OBJFILE | grep "<$1>:" -A1000 > $MYDUMP
DIFF_ARGS+=" -o" DIFF_ARGS+=" -o"
else else
if [[ $MAKE = 1 ]]; then
make $MAKEFLAGS "$MYIMG"
fi
END="$START + 0x1000" END="$START + 0x1000"
if [[ $# -ge 2 ]]; then if [[ $# -ge 2 ]]; then
END="$2" END="$2"

View File

@ -143,16 +143,16 @@ Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED
print_text(10, 210, "ERROR Need more memory"); print_text(10, 210, "ERROR Need more memory");
// Init generic text rendering // Init generic text rendering
dl_add_new_ortho_matrix(); create_dl_ortho_matrix();
gSPDisplayList(gDisplayListHead++, gSPDisplayList(gDisplayListHead++,
dl_ia8_text_begin); // Init rendering stuff for generic text dl_ia8_text_begin); // Init rendering stuff for generic text
// Set text color to white // Set text color to white
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255);
PrintGenericText(8, 170, text_console_8mb); print_generic_string(8, 170, text_console_8mb);
PrintGenericText(8, 120, text_pj64); print_generic_string(8, 120, text_pj64);
PrintGenericText(8, 54, text_pj64_2); print_generic_string(8, 54, text_pj64_2);
// Cleanup // Cleanup
gSPDisplayList(gDisplayListHead++, gSPDisplayList(gDisplayListHead++,
@ -173,7 +173,7 @@ void thread5_mem_error_message_loop(UNUSED void *arg) {
setup_game_memory(); setup_game_memory();
set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1); set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1);
addr = (struct LevelCommand *) segmented_to_virtual(level_script_entry_error_screen); addr = segmented_to_virtual(level_script_entry_error_screen);
func_80247ED8(); func_80247ED8();

View File

@ -211,12 +211,13 @@ typedef struct {
*/ */
typedef struct { typedef struct {
unsigned int w0; uintptr_t w0;
unsigned int w1; uintptr_t w1;
} Awords; } Awords;
typedef union { typedef union {
Awords words; Awords words;
#if !defined(__x86_64__) && !defined(__i386__)
Aadpcm adpcm; Aadpcm adpcm;
Apolef polef; Apolef polef;
Aclearbuff clearbuff; Aclearbuff clearbuff;
@ -234,6 +235,7 @@ typedef union {
Aloadadpcm loadadpcm; Aloadadpcm loadadpcm;
Amixer mixer; Amixer mixer;
Asetloop setloop; Asetloop setloop;
#endif
long long int force_union_align; /* dummy, force alignment */ long long int force_union_align; /* dummy, force alignment */
} Acmd; } Acmd;
@ -272,7 +274,7 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \ _a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aPoleFilter(pkt, f, g, s) \ #define aPoleFilter(pkt, f, g, s) \
@ -281,7 +283,7 @@ typedef short ENVMIX_STATE[40];
\ \
_a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \
_SHIFTL(g, 0, 16)); \ _SHIFTL(g, 0, 16)); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aClearBuffer(pkt, d, c) \ #define aClearBuffer(pkt, d, c) \
@ -289,7 +291,7 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \ _a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \
_a->words.w1 = (unsigned int)(c); \ _a->words.w1 = (uintptr_t)(c); \
} }
#define aEnvMixer(pkt, f, s) \ #define aEnvMixer(pkt, f, s) \
@ -297,7 +299,7 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \ _a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aInterleave(pkt, l, r) \ #define aInterleave(pkt, l, r) \
@ -313,7 +315,7 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \ _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aMix(pkt, f, g, i, o) \ #define aMix(pkt, f, g, i, o) \
@ -331,7 +333,7 @@ typedef short ENVMIX_STATE[40];
\ \
_a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \ _a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \
_SHIFTL(d, 0, 16)); \ _SHIFTL(d, 0, 16)); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aResample(pkt, f, p, s) \ #define aResample(pkt, f, p, s) \
@ -340,7 +342,7 @@ typedef short ENVMIX_STATE[40];
\ \
_a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\ _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\
_SHIFTL(p, 0, 16)); \ _SHIFTL(p, 0, 16)); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aSaveBuffer(pkt, s) \ #define aSaveBuffer(pkt, s) \
@ -348,7 +350,7 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \ _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \
_a->words.w1 = (unsigned int)(s); \ _a->words.w1 = (uintptr_t)(s); \
} }
#define aSegment(pkt, s, b) \ #define aSegment(pkt, s, b) \
@ -381,7 +383,7 @@ typedef short ENVMIX_STATE[40];
{ \ { \
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
_a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \ _a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \
_a->words.w1 = (unsigned int)(a); \ _a->words.w1 = (uintptr_t)(a); \
} }
#define aDMEMMove(pkt, i, o, c) \ #define aDMEMMove(pkt, i, o, c) \
@ -397,19 +399,13 @@ typedef short ENVMIX_STATE[40];
Acmd *_a = (Acmd *)pkt; \ Acmd *_a = (Acmd *)pkt; \
\ \
_a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \
_a->words.w1 = (unsigned int) d; \ _a->words.w1 = (uintptr_t) d; \
} }
/* // This is a version of aSetVolume which takes a single 32-bit parameter
* --------------------------------------------------------------------
* The below command is seemingly declared manually and used for the
* sound driver.
* --------------------------------------------------------------------
*/
// This is a version of aSetAudio which takes a single 32-bit parameter
// instead of two 16-bit ones. According to AziAudio, it is used to set // instead of two 16-bit ones. According to AziAudio, it is used to set
// ramping values when neither bit 4 nor bit 8 is set in the flags parameter. // ramping values when neither bit 4 nor bit 8 is set in the flags parameter.
// It does not appear in the official abi.h header.
#define aSetVolume32(pkt, f, v, tr) \ #define aSetVolume32(pkt, f, v, tr) \
{ \ { \
@ -417,12 +413,9 @@ typedef short ENVMIX_STATE[40];
\ \
_a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \
_SHIFTL(v, 0, 16)); \ _SHIFTL(v, 0, 16)); \
_a->words.w1 = (unsigned int)(tr); \ _a->words.w1 = (uintptr_t)(tr); \
} }
#endif /* _LANGUAGE_C */ #endif /* _LANGUAGE_C */
#endif /* !_ABI_H_ */ #endif /* !_ABI_H_ */

View File

@ -1485,7 +1485,7 @@ typedef struct {
int cmd:8; int cmd:8;
unsigned int par:8; unsigned int par:8;
unsigned int len:16; unsigned int len:16;
unsigned int addr; uintptr_t addr;
} Gdma; } Gdma;
/* /*
@ -1570,7 +1570,7 @@ typedef struct {
unsigned int siz:2; unsigned int siz:2;
unsigned int pad:7; unsigned int pad:7;
unsigned int wd:12; /* really only 10 bits, extra */ unsigned int wd:12; /* really only 10 bits, extra */
unsigned int dram; /* to account for 1024 */ uintptr_t dram; /* to account for 1024 */
} Gsetimg; } Gsetimg;
typedef struct { typedef struct {
@ -1667,16 +1667,21 @@ typedef struct {
* Generic Gfx Packet * Generic Gfx Packet
*/ */
typedef struct { typedef struct {
unsigned int w0; uintptr_t w0;
unsigned int w1; uintptr_t w1;
} Gwords; } Gwords;
/* /*
* This union is the fundamental type of the display list. * This union is the fundamental type of the display list.
* It is, by law, exactly 64 bits in size. * It is, by law, exactly 64 bits in size.
*
* (Edit: except on 64-bit, where it is exactly 128 bit. On little-endian or
* 64-bit systems, only the 'words' member may be accessed; the rest of the
* structs don't have matching layouts for now.)
*/ */
typedef union { typedef union {
Gwords words; Gwords words;
#if !defined(__x86_64__) && !defined(__i386__)
Gdma dma; Gdma dma;
Gtri tri; Gtri tri;
Gline3D line; Gline3D line;
@ -1694,6 +1699,7 @@ typedef union {
Gloadtile loadtile; /* use for loadblock also, th is dxt */ Gloadtile loadtile; /* use for loadblock also, th is dxt */
Gsettilesize settilesize; Gsettilesize settilesize;
Gloadtlut loadtlut; Gloadtlut loadtlut;
#endif
long long int force_structure_alignment; long long int force_structure_alignment;
} Gfx; } Gfx;
@ -1709,12 +1715,12 @@ typedef union {
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
\ \
_g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \ _g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \
_g->words.w1 = (unsigned int)(s); \ _g->words.w1 = (uintptr_t)(s); \
} }
#define gsDma0p(c, s, l) \ #define gsDma0p(c, s, l) \
{{ \ {{ \
_SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (unsigned int)(s) \ _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (uintptr_t)(s) \
}} }}
#define gDma1p(pkt, c, s, l, p) \ #define gDma1p(pkt, c, s, l, p) \
@ -1723,14 +1729,14 @@ typedef union {
\ \
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
_SHIFTL((l), 0, 16)); \ _SHIFTL((l), 0, 16)); \
_g->words.w1 = (unsigned int)(s); \ _g->words.w1 = (uintptr_t)(s); \
} }
#define gsDma1p(c, s, l, p) \ #define gsDma1p(c, s, l, p) \
{{ \ {{ \
(_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \
_SHIFTL((l), 0, 16)), \ _SHIFTL((l), 0, 16)), \
(unsigned int)(s) \ (uintptr_t)(s) \
}} }}
#define gDma2p(pkt, c, adrs, len, idx, ofs) \ #define gDma2p(pkt, c, adrs, len, idx, ofs) \
@ -1738,13 +1744,13 @@ typedef union {
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ _g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \ _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \
_g->words.w1 = (unsigned int)(adrs); \ _g->words.w1 = (uintptr_t)(adrs); \
} }
#define gsDma2p(c, adrs, len, idx, ofs) \ #define gsDma2p(c, adrs, len, idx, ofs) \
{{ \ {{ \
(_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \
_SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \ _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \
(unsigned int)(adrs) \ (uintptr_t)(adrs) \
}} }}
#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0) #define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0)
@ -1775,12 +1781,12 @@ typedef union {
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = \ _g->words.w0 = \
_SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7); \ _SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7); \
_g->words.w1 = (unsigned int)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
# define gsSPVertex(v, n, v0) \ # define gsSPVertex(v, n, v0) \
{{ \ {{ \
(_SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7)), \ (_SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7)), \
(unsigned int)(v) \ (uintptr_t)(v) \
}} }}
#elif (defined(F3DEX_GBI)||defined(F3DLP_GBI)) #elif (defined(F3DEX_GBI)||defined(F3DLP_GBI))
/* /*
@ -1845,12 +1851,12 @@ typedef union {
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
\ \
_g->words.w0 = _SHIFTL((c), 24, 8); \ _g->words.w0 = _SHIFTL((c), 24, 8); \
_g->words.w1 = (unsigned int)(p0); \ _g->words.w1 = (uintptr_t)(p0); \
} }
#define gsImmp1(c, p0) \ #define gsImmp1(c, p0) \
{{ \ {{ \
_SHIFTL((c), 24, 8), (unsigned int)(p0) \ _SHIFTL((c), 24, 8), (uintptr_t)(p0) \
}} }}
#define gImmp2(pkt, c, p0, p1) \ #define gImmp2(pkt, c, p0, p1) \
@ -1887,13 +1893,13 @@ typedef union {
\ \
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \
_SHIFTL((p1), 0, 8)); \ _SHIFTL((p1), 0, 8)); \
_g->words.w1 = (unsigned int) (dat); \ _g->words.w1 = (uintptr_t) (dat); \
} }
#define gsImmp21(c, p0, p1, dat) \ #define gsImmp21(c, p0, p1, dat) \
{{ \ {{ \
_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8),\ _SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8),\
(unsigned int) (dat) \ (uintptr_t) (dat) \
}} }}
#ifdef F3DEX_GBI_2 #ifdef F3DEX_GBI_2
@ -2332,7 +2338,7 @@ typedef union {
{ \ { \
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
_g->words.w1 = (unsigned int)(dl); \ _g->words.w1 = (uintptr_t)(dl); \
_g = (Gfx *)(pkt); \ _g = (Gfx *)(pkt); \
_g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \
_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \
@ -2341,7 +2347,7 @@ typedef union {
#define gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, zmin, zmax) \ #define gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, zmin, zmax) \
{{ _SHIFTL(G_RDPHALF_1,24,8), \ {{ _SHIFTL(G_RDPHALF_1,24,8), \
(unsigned int)(dl), }}, \ (uintptr_t)(dl), }}, \
{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ {{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
G_DEPTOZSrg(zval, near, far, flag, zmin, zmax), }} G_DEPTOZSrg(zval, near, far, flag, zmin, zmax), }}
@ -2361,7 +2367,7 @@ typedef union {
{ \ { \
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
_g->words.w1 = (unsigned int)(dl); \ _g->words.w1 = (uintptr_t)(dl); \
_g = (Gfx *)(pkt); \ _g = (Gfx *)(pkt); \
_g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \
_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \
@ -2370,7 +2376,7 @@ typedef union {
#define gsSPBranchLessZraw(dl, vtx, zval) \ #define gsSPBranchLessZraw(dl, vtx, zval) \
{{ _SHIFTL(G_RDPHALF_1,24,8), \ {{ _SHIFTL(G_RDPHALF_1,24,8), \
(unsigned int)(dl), }}, \ (uintptr_t)(dl), }}, \
{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ {{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
(unsigned int)(zval), }} (unsigned int)(zval), }}
@ -2384,19 +2390,19 @@ typedef union {
{ \ { \
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \
_g->words.w1 = (unsigned int)(uc_dstart); \ _g->words.w1 = (uintptr_t)(uc_dstart); \
_g = (Gfx *)(pkt); \ _g = (Gfx *)(pkt); \
_g->words.w0 = (_SHIFTL(G_LOAD_UCODE,24,8)| \ _g->words.w0 = (_SHIFTL(G_LOAD_UCODE,24,8)| \
_SHIFTL((int)(uc_dsize)-1,0,16)); \ _SHIFTL((int)(uc_dsize)-1,0,16)); \
_g->words.w1 = (unsigned int)(uc_start); \ _g->words.w1 = (uintptr_t)(uc_start); \
} }
#define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \ #define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \
{{ _SHIFTL(G_RDPHALF_1,24,8), \ {{ _SHIFTL(G_RDPHALF_1,24,8), \
(unsigned int)(uc_dstart), }}, \ (uintptr_t)(uc_dstart), }}, \
{{ _SHIFTL(G_LOAD_UCODE,24,8)| \ {{ _SHIFTL(G_LOAD_UCODE,24,8)| \
_SHIFTL((int)(uc_dsize)-1,0,16), \ _SHIFTL((int)(uc_dsize)-1,0,16), \
(unsigned int)(uc_start), }} (uintptr_t)(uc_start), }}
#define gSPLoadUcode(pkt, uc_start, uc_dstart) \ #define gSPLoadUcode(pkt, uc_start, uc_dstart) \
gSPLoadUcodeEx((pkt), (uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) gSPLoadUcodeEx((pkt), (uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
@ -2420,14 +2426,14 @@ typedef union {
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ _g->words.w0 = _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \
_SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12); \ _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12); \
_g->words.w1 = (unsigned int)(dram); \ _g->words.w1 = (uintptr_t)(dram); \
} }
#define gsSPDma_io(flag, dmem, dram, size) \ #define gsSPDma_io(flag, dmem, dram, size) \
{{ \ {{ \
_SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \
_SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12), \ _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12), \
(unsigned int)(dram) \ (uintptr_t)(dram) \
}} }}
#define gSPDmaRead(pkt,dmem,dram,size) gSPDma_io((pkt),0,(dmem),(dram),(size)) #define gSPDmaRead(pkt,dmem,dram,size) gSPDma_io((pkt),0,(dmem),(dram),(size))
@ -3000,14 +3006,14 @@ typedef union {
\ \
_g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ _g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \ _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \
_g->words.w1 = (unsigned int)(i); \ _g->words.w1 = (uintptr_t)(i); \
} }
#define gsSetImage(cmd, fmt, siz, width, i) \ #define gsSetImage(cmd, fmt, siz, width, i) \
{{ \ {{ \
_SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \
_SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \ _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \
(unsigned int)(i) \ (uintptr_t)(i) \
}} }}
#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i) #define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i)
@ -4542,15 +4548,15 @@ typedef union {
} }
#define gsDPWord(wordhi, wordlo) \ #define gsDPWord(wordhi, wordlo) \
gsImmp1(G_RDPHALF_1, (unsigned int)(wordhi)), \ gsImmp1(G_RDPHALF_1, (uintptr_t)(wordhi)), \
gsImmp1(G_RDPHALF_2, (unsigned int)(wordlo)) gsImmp1(G_RDPHALF_2, (uintptr_t)(wordlo))
#define gDPWord(pkt, wordhi, wordlo) \ #define gDPWord(pkt, wordhi, wordlo) \
{ \ { \
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
\ \
gImmp1(pkt, G_RDPHALF_1, (unsigned int)(wordhi)); \ gImmp1(pkt, G_RDPHALF_1, (uintptr_t)(wordhi)); \
gImmp1(pkt, G_RDPHALF_2, (unsigned int)(wordlo)); \ gImmp1(pkt, G_RDPHALF_2, (uintptr_t)(wordlo)); \
} }
#define gDPFullSync(pkt) gDPNoParam(pkt, G_RDPFULLSYNC) #define gDPFullSync(pkt) gDPNoParam(pkt, G_RDPFULLSYNC)

View File

@ -10,13 +10,19 @@
/* Macros */ /* Macros */
.macro bytes4 byte1, byte2, byte3, byte4
.word ((\byte1 & 0xFF) << 24) | ((\byte2 & 0xFF) << 16) | ((\byte3 & 0xFF) << 8) | (\byte4 & 0xFF)
.endm
/* commands with no parameters */ /* commands with no parameters */
.macro f3d_noparam cmd .macro f3d_noparam cmd
.word (\cmd << 24), 0x00000000 .word (\cmd << 24)
.word 0
.endm .endm
.macro gsImmp1 cmd, param .macro gsImmp1 cmd, param
.word (\cmd << 24), \param .word (\cmd << 24)
.word \param
.endm .endm
/* DMA helper */ /* DMA helper */
@ -27,14 +33,14 @@
/* DMA helper 3*/ /* DMA helper 3*/
.macro gsDma3p cmd, byte2, byte3, byte4, segAddr .macro gsDma3p cmd, byte2, byte3, byte4, segAddr
.byte \cmd, \byte2, \byte3, \byte4 bytes4 \cmd, \byte2, \byte3, \byte4
.word \segAddr .word \segAddr
.endm .endm
/* Helper for RGBA colors. */ /* Helper for RGBA colors. */
.macro sDPRGBColor cmd r, g, b, a .macro sDPRGBColor cmd r, g, b, a
.word \cmd << 24 .word \cmd << 24
.byte \r, \g, \b, \a bytes4 \r, \g, \b, \a
.endm .endm
/* Opcodes */ /* Opcodes */
@ -667,7 +673,7 @@
.word (\v0*10 << 16) | (\v1*10 << 8) | \v2*10 .word (\v0*10 << 16) | (\v1*10 << 8) | \v2*10
.endif .endif
.else /* Fast3DEX2 */ .else /* Fast3DEX2 */
.byte G_TRI1, \v0*2, \v1*2, \v2*2 bytes4 G_TRI1, \v0*2, \v1*2, \v2*2
.word 0 .word 0
.endif .endif
.endm .endm

View File

@ -53,8 +53,8 @@ typedef union
typedef struct typedef struct
{ {
unsigned int w0; uintptr_t w0;
unsigned int w1; uintptr_t w1;
} Gwords; } Gwords;
/* TODO: fill in the rest of the members */ /* TODO: fill in the rest of the members */
@ -630,16 +630,16 @@ typedef union
#define gDma1p(pkt, c, s, l, p) \ #define gDma1p(pkt, c, s, l, p) \
{ \ { \
Gfx *_g = (Gfx *)(pkt); \ Gfx *_g = (Gfx *)(pkt); \
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) \
_SHIFTL((l), 0, 16)); \ | _SHIFTL((l), 0, 16)); \
_g->words.w1 = (unsigned int)(s); \ _g->words.w1 = (uintptr_t)(s); \
} }
#define gsDma1p(c, s, l, p) \ #define gsDma1p(c, s, l, p) \
{ \ { \
_g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) \
_SHIFTL((l), 0, 16)); \ | _SHIFTL((l), 0, 16)); \
_g->words.w1 = (unsigned int)(s); \ _g->words.w1 = (uintptr_t)(s); \
} }
/* Matrix */ /* Matrix */
@ -650,7 +650,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_MTX, 24, 8) \
| _SHIFTL((p), 16, 8) \ | _SHIFTL((p), 16, 8) \
| _SHIFTL(sizeof(Mtx), 0, 16); \ | _SHIFTL(sizeof(Mtx), 0, 16); \
_g->words.w1 = (u32)(m); \ _g->words.w1 = (uintptr_t)(m); \
} }
#define gsSPMatrix(m, p) \ #define gsSPMatrix(m, p) \
@ -658,7 +658,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_MTX, 24, 8) \
| _SHIFTL((p), 16, 8) \ | _SHIFTL((p), 16, 8) \
| _SHIFTL(sizeof(Mtx), 0, 16); \ | _SHIFTL(sizeof(Mtx), 0, 16); \
_g->words.w1 = (u32)(m); \ _g->words.w1 = (uintptr_t)(m); \
} }
/* Vertex */ /* Vertex */
@ -671,7 +671,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_VTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_VTX, 24, 8) \
| _SHIFTL(((n)-1) << 4 | (v0), 16, 8) \ | _SHIFTL(((n)-1) << 4 | (v0), 16, 8) \
| _SHIFTL(sizeof(Vtx)*(n), 0, 16); \ | _SHIFTL(sizeof(Vtx)*(n), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
#define gsSPVertex(v, n, v0) \ #define gsSPVertex(v, n, v0) \
@ -679,7 +679,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_VTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_VTX, 24, 8) \
| _SHIFTL(((n)-1) << 4 | (v0), 16, 8) \ | _SHIFTL(((n)-1) << 4 | (v0), 16, 8) \
| _SHIFTL(sizeof(Vtx)*(n), 0, 16); \ | _SHIFTL(sizeof(Vtx)*(n), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
#else /* Fast3DEX */ #else /* Fast3DEX */
@ -689,7 +689,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_VTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_VTX, 24, 8) \
| _SHIFTL(((v0)*2), 16, 8) \ | _SHIFTL(((v0)*2), 16, 8) \
| _SHIFTL((n << 10) | ((sizeof(Vtx)*(n))-1), 0, 16); \ | _SHIFTL((n << 10) | ((sizeof(Vtx)*(n))-1), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
#define gsSPVertex(v, n, v0) \ #define gsSPVertex(v, n, v0) \
@ -697,7 +697,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_VTX, 24, 8) \ _g->words.w0 = _SHIFTL(G_VTX, 24, 8) \
| _SHIFTL(((v0)*2), 16, 8) \ | _SHIFTL(((v0)*2), 16, 8) \
| _SHIFTL((n << 10) | ((sizeof(Vtx)*(n))-1), 0, 16); \ | _SHIFTL((n << 10) | ((sizeof(Vtx)*(n))-1), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
#endif #endif
@ -767,13 +767,13 @@ typedef union
{ \ { \
Gfx *_g = (Gfx *) (pkt); \ Gfx *_g = (Gfx *) (pkt); \
_g->words.w0 = _SHIFTL(G_DL, 24, 8); \ _g->words.w0 = _SHIFTL(G_DL, 24, 8); \
_g->words.w1 = (u32)(dl); \ _g->words.w1 = (uintptr_t)(dl); \
} }
#define gsSPDisplayList(dl) \ #define gsSPDisplayList(dl) \
{ \ { \
_g->words.w0 = _SHIFTL(G_DL, 24, 8); \ _g->words.w0 = _SHIFTL(G_DL, 24, 8); \
_g->words.w1 = (u32)(dl); \ _g->words.w1 = (uintptr_t)(dl); \
} }
/* BranchList */ /* BranchList */
@ -1239,7 +1239,7 @@ typedef union
| _SHIFTL((fmt), 21, 3) \ | _SHIFTL((fmt), 21, 3) \
| _SHIFTL((size), 19, 2) \ | _SHIFTL((size), 19, 2) \
| _SHIFTL((width)-1, 0, 12); \ | _SHIFTL((width)-1, 0, 12); \
_g->words.w1 = (u32)(img); \ _g->words.w1 = (uintptr_t)(img); \
} }
#define gsDPSetTextureImage(fmt, size, width, img) \ #define gsDPSetTextureImage(fmt, size, width, img) \
@ -1248,7 +1248,7 @@ typedef union
| _SHIFTL((fmt), 21, 3) \ | _SHIFTL((fmt), 21, 3) \
| _SHIFTL((size), 19, 2) \ | _SHIFTL((size), 19, 2) \
| _SHIFTL((width)-1, 0, 12); \ | _SHIFTL((width)-1, 0, 12); \
_g->words.w1 = (u32)(img); \ _g->words.w1 = (uintptr_t)(img); \
} }
/* MoveWd */ /* MoveWd */
@ -1259,7 +1259,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MOVEWORD, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEWORD, 24, 8) \
| _SHIFTL((offset), 8, 16) \ | _SHIFTL((offset), 8, 16) \
| _SHIFTL((index), 0, 8); \ | _SHIFTL((index), 0, 8); \
_g->words.w1 = (u32)(data); \ _g->words.w1 = (uintptr_t)(data); \
} }
#define gsMoveWd(index, offset, data) \ #define gsMoveWd(index, offset, data) \
@ -1267,7 +1267,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MOVEWORD, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEWORD, 24, 8) \
| _SHIFTL((offset), 8, 16) \ | _SHIFTL((offset), 8, 16) \
| _SHIFTL((index), 0, 8); \ | _SHIFTL((index), 0, 8); \
_g->words.w1 = (u32)(data); \ _g->words.w1 = (uintptr_t)(data); \
} }
/* Matrix Operations */ /* Matrix Operations */
@ -1302,7 +1302,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_VIEWPORT, 16, 8) \ | _SHIFTL(G_MV_VIEWPORT, 16, 8) \
| _SHIFTL(sizeof(Vp), 0, 16); \ | _SHIFTL(sizeof(Vp), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
#define gsSPViewport(v) \ #define gsSPViewport(v) \
@ -1310,7 +1310,7 @@ typedef union
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_VIEWPORT, 16, 8) \ | _SHIFTL(G_MV_VIEWPORT, 16, 8) \
| _SHIFTL(sizeof(Vp), 0, 16); \ | _SHIFTL(sizeof(Vp), 0, 16); \
_g->words.w1 = (u32)(v); \ _g->words.w1 = (uintptr_t)(v); \
} }
/* 1Triangle */ /* 1Triangle */
@ -1524,7 +1524,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(((n)-1)*2+G_MV_L0, 16, 8) \ | _SHIFTL(((n)-1)*2+G_MV_L0, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(l); \ _g->words.w1 = (uintptr_t)(l); \
} }
#define gsSPLight(l, n) \ #define gsSPLight(l, n) \
@ -1532,7 +1532,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(((n)-1)*2+G_MV_L0, 16, 8) \ | _SHIFTL(((n)-1)*2+G_MV_L0, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(l); \ _g->words.w1 = (uintptr_t)(l); \
} }
/* LookAtX */ /* LookAtX */
@ -1543,7 +1543,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_LOOKATX, 16, 8) \ | _SHIFTL(G_MV_LOOKATX, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(la); \ _g->words.w1 = (uintptr_t)(la); \
} }
#define gsSPLookAtX(la) \ #define gsSPLookAtX(la) \
@ -1551,7 +1551,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_LOOKATX, 16, 8) \ | _SHIFTL(G_MV_LOOKATX, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(la); \ _g->words.w1 = (uintptr_t)(la); \
} }
/* LookAtY */ /* LookAtY */
@ -1562,7 +1562,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_LOOKATY, 16, 8) \ | _SHIFTL(G_MV_LOOKATY, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(la); \ _g->words.w1 = (uintptr_t)(la); \
} }
#define gsSPLookAtY(la) \ #define gsSPLookAtY(la) \
@ -1570,7 +1570,7 @@ typedef union {
_g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \ _g->words.w0 = _SHIFTL(G_MOVEMEM, 24, 8) \
| _SHIFTL(G_MV_LOOKATY, 16, 8) \ | _SHIFTL(G_MV_LOOKATY, 16, 8) \
| _SHIFTL(sizeof(Light), 0, 16); \ | _SHIFTL(sizeof(Light), 0, 16); \
_g->words.w1 = (u32)(la); \ _g->words.w1 = (uintptr_t)(la); \
} }
/* LookAt */ /* LookAt */

View File

@ -81,9 +81,9 @@ extern "C" {
/* Cache operations and macros */ /* Cache operations and macros */
extern void osInvalDCache(void *, s32); extern void osInvalDCache(void *, size_t);
extern void osInvalICache(void *, s32); extern void osInvalICache(void *, size_t);
extern void osWritebackDCache(void *, s32); extern void osWritebackDCache(void *, size_t);
extern void osWritebackDCacheAll(void); extern void osWritebackDCacheAll(void);

View File

@ -6,6 +6,6 @@
void osInitialize(void); void osInitialize(void);
u32 osGetCount(void); u32 osGetCount(void);
u32 osVirtualToPhysical(void *); uintptr_t osVirtualToPhysical(void *);
#endif #endif

View File

@ -21,7 +21,7 @@ typedef struct
u16 transferMode; u16 transferMode;
u16 blockNum; u16 blockNum;
s32 sectorNum; s32 sectorNum;
u32 devAddr; uintptr_t devAddr;
u32 bmCtlShadow; u32 bmCtlShadow;
u32 seqCtlShadow; u32 seqCtlShadow;
__OSBlockInfo block[2]; __OSBlockInfo block[2];
@ -44,7 +44,7 @@ typedef struct OSPiHandle_s
typedef struct typedef struct
{ {
u8 type; u8 type;
u32 address; uintptr_t address;
} OSPiInfo; } OSPiInfo;
typedef struct typedef struct
@ -59,8 +59,8 @@ typedef struct
{ {
/*0x00*/ OSIoMesgHdr hdr; /*0x00*/ OSIoMesgHdr hdr;
/*0x08*/ void *dramAddr; /*0x08*/ void *dramAddr;
/*0x0C*/ u32 devAddr; /*0x0C*/ uintptr_t devAddr;
/*0x10*/ u32 size; /*0x10*/ size_t size;
//OSPiHandle *piHandle; //from the official definition //OSPiHandle *piHandle; //from the official definition
} OSIoMesg; } OSIoMesg;
@ -75,11 +75,11 @@ typedef struct
/* Functions */ /* Functions */
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction,
u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *mq); uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq);
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf,
s32 cmdMsgCnt); s32 cmdMsgCnt);
OSMesgQueue *osPiGetCmdQueue(void); OSMesgQueue *osPiGetCmdQueue(void);
s32 osPiWriteIo(u32 devAddr, u32 data); s32 osPiWriteIo(uintptr_t devAddr, u32 data);
s32 osPiReadIo(u32 devAddr, u32 *data); s32 osPiReadIo(uintptr_t devAddr, u32 *data);
#endif #endif

View File

@ -29,6 +29,18 @@ typedef volatile s64 vs64;
typedef float f32; typedef float f32;
typedef double f64; typedef double f64;
typedef unsigned long size_t; #ifdef __x86_64__
typedef u64 size_t;
typedef s64 ssize_t;
typedef u64 uintptr_t;
typedef s64 intptr_t;
typedef s64 ptrdiff_t;
#else
typedef u32 size_t;
typedef s32 ssize_t;
typedef u32 uintptr_t;
typedef s32 intptr_t;
typedef s32 ptrdiff_t;
#endif
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -317,7 +317,7 @@ extern u32 bhvRandomAnimatedTexture[];
extern u32 bhvYellowBackgroundInMenu[]; extern u32 bhvYellowBackgroundInMenu[];
extern u32 bhvMenuButton[]; extern u32 bhvMenuButton[];
extern u32 bhvMenuButtonManager[]; extern u32 bhvMenuButtonManager[];
extern u32 bhvStarInActSelector[]; extern u32 bhvActSelectorStarType[];
extern u32 bhvActSelector[]; extern u32 bhvActSelector[];
extern u32 bhvMovingYellowCoin[]; extern u32 bhvMovingYellowCoin[];
extern u32 bhvMovingBlueCoin[]; extern u32 bhvMovingBlueCoin[];

View File

@ -1,5 +1,5 @@
#ifndef _CONFIG_H_ #ifndef CONFIG_H
#define _CONFIG_H_ #define CONFIG_H
/** /**
* @file config.h * @file config.h
@ -17,6 +17,8 @@
// --| US Version Nintendo Bug Fixes // --| US Version Nintendo Bug Fixes
/// Fixes bug where obtaining over 999 coins sets the number of lives to 999 (or -25) /// Fixes bug where obtaining over 999 coins sets the number of lives to 999 (or -25)
#define BUGFIX_MAX_LIVES (0 || VERSION_US || VERSION_EU) #define BUGFIX_MAX_LIVES (0 || VERSION_US || VERSION_EU)
/// Fixes bug where the Boss music won't fade out after defeating King Bob-omb
#define BUGFIX_KING_BOB_OMB_FADE_MUSIC (0 || VERSION_US || VERSION_EU)
/// Fixes bug in Bob-Omb Battlefield where entering a warp stops the Koopa race music /// Fixes bug in Bob-Omb Battlefield where entering a warp stops the Koopa race music
#define BUGFIX_KOOPA_RACE_MUSIC (0 || VERSION_US || VERSION_EU) #define BUGFIX_KOOPA_RACE_MUSIC (0 || VERSION_US || VERSION_EU)
/// Fixes bug where Piranha Plants do not reset their action state when the /// Fixes bug where Piranha Plants do not reset their action state when the

View File

@ -414,7 +414,7 @@
.byte 0x00 .byte 0x00
.endif .endif
.byte 0x00, 0x00 .byte 0x00, 0x00
.word \scale .word32 \scale
.if (\displayList != 0) .if (\displayList != 0)
.word \displayList .word \displayList
.endif .endif

View File

@ -21,7 +21,7 @@
.macro execute seg, script, scriptEnd, entry .macro execute seg, script, scriptEnd, entry
.byte 0x00, 0x10 .byte 0x00, 0x04 + 3 * PTR_WIDTH
.hword \seg .hword \seg
.word \script .word \script
.word \scriptEnd .word \scriptEnd
@ -29,7 +29,7 @@
.endm .endm
.macro exit_and_execute seg, script, scriptEnd, entry .macro exit_and_execute seg, script, scriptEnd, entry
.byte 0x01, 0x10 .byte 0x01, 0x04 + 3 * PTR_WIDTH
.hword \seg .hword \seg
.word \script .word \script
.word \scriptEnd .word \scriptEnd
@ -52,13 +52,13 @@
.endm .endm
.macro jump target .macro jump target
.byte 0x05, 0x08 .byte 0x05, 0x04 + PTR_WIDTH
.hword 0 .hword 0
.word \target .word \target
.endm .endm
.macro jump_link target .macro jump_link target
.byte 0x06, 0x08 .byte 0x06, 0x04 + PTR_WIDTH
.hword 0 .hword 0
.word \target .word \target
.endm .endm
@ -84,25 +84,25 @@
.endm .endm
.macro loop_until op, arg .macro loop_until op, arg
.byte 0x0B, 0x08 .byte 0x0B, 0x04 + PTR_WIDTH
.byte \op .byte \op
.byte 0 .byte 0
.word \arg .word \arg
.endm .endm
.macro jump_if op, arg, target .macro jump_if op, arg, target
.byte 0x0C, 0x0C .byte 0x0C, 0x08 + PTR_WIDTH
.byte \op .byte \op
.byte 0 .byte 0
.word \arg .word32 \arg
.word \target .word \target
.endm .endm
.macro jump_link_if op, arg, target .macro jump_link_if op, arg, target
.byte 0x0D, 0x0C .byte 0x0D, 0x08 + PTR_WIDTH
.byte \op .byte \op
.byte 0 .byte 0
.word \arg .word32 \arg
.word \target .word \target
.endm .endm
@ -110,7 +110,7 @@
.byte 0x0E, 0x08 .byte 0x0E, 0x08
.byte \op .byte \op
.byte 0 .byte 0
.word \arg .word32 \arg
.endm .endm
.macro skip .macro skip
@ -124,13 +124,13 @@
.endm .endm
.macro call arg, func .macro call arg, func
.byte 0x11, 0x08 .byte 0x11, 0x04 + PTR_WIDTH
.hword \arg .hword \arg
.word \func .word \func
.endm .endm
.macro call_loop arg, func .macro call_loop arg, func
.byte 0x12, 0x08 .byte 0x12, 0x04 + PTR_WIDTH
.hword \arg .hword \arg
.word \func .word \func
.endm .endm
@ -151,7 +151,7 @@
.endm .endm
.macro fixed_load loadAddr, romStart, romEnd .macro fixed_load loadAddr, romStart, romEnd
.byte 0x16, 0x10 .byte 0x16, 0x04 + 3 * PTR_WIDTH
.hword 0 .hword 0
.word \loadAddr .word \loadAddr
.word \romStart .word \romStart
@ -159,14 +159,14 @@
.endm .endm
.macro load_raw seg, romStart, romEnd .macro load_raw seg, romStart, romEnd
.byte 0x17, 0x0C .byte 0x17, 0x04 + 2 * PTR_WIDTH
.hword \seg .hword \seg
.word \romStart .word \romStart
.word \romEnd .word \romEnd
.endm .endm
.macro load_mio0 seg, romStart, romEnd .macro load_mio0 seg, romStart, romEnd
.byte 0x18, 0x0C .byte 0x18, 0x04 + 2 * PTR_WIDTH
.hword \seg .hword \seg
.word \romStart .word \romStart
.word \romEnd .word \romEnd
@ -178,7 +178,7 @@
.endm .endm
.macro load_mio0_texture seg, romStart, romEnd .macro load_mio0_texture seg, romStart, romEnd
.byte 0x1A, 0x0C .byte 0x1A, 0x04 + 2 * PTR_WIDTH
.hword \seg .hword \seg
.word \romStart .word \romStart
.word \romEnd .word \romEnd
@ -205,7 +205,7 @@
.endm .endm
.macro area index, geo .macro area index, geo
.byte 0x1F, 0x08 .byte 0x1F, 0x04 + PTR_WIDTH
.byte \index .byte \index
.byte 0 .byte 0
.word \geo .word \geo
@ -217,26 +217,26 @@
.endm .endm
.macro load_model_from_dl model, dl, layer .macro load_model_from_dl model, dl, layer
.byte 0x21, 0x08 .byte 0x21, 0x04 + PTR_WIDTH
.hword (\layer << 12) | \model .hword (\layer << 12) | \model
.word \dl .word \dl
.endm .endm
.macro load_model_from_geo model, geo .macro load_model_from_geo model, geo
.byte 0x22, 0x08 .byte 0x22, 0x04 + PTR_WIDTH
.hword \model .hword \model
.word \geo .word \geo
.endm .endm
.macro cmd23 model, unk4, unk8 .macro cmd23 model, unk4, unk8
.byte 0x23, 0x0C .byte 0x23, 0x08 + PTR_WIDTH
.hword \model .hword \model
.word \unk4 .word \unk4
.word \unk8 .float \unk8
.endm .endm
.macro object model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, acts=0x1F .macro object model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, acts=0x1F
.byte 0x24, 0x18 .byte 0x24, 0x14 + PTR_WIDTH
.byte \acts .byte \acts
.byte \model .byte \model
.hword \posX .hword \posX
@ -245,15 +245,15 @@
.hword \angleX .hword \angleX
.hword \angleY .hword \angleY
.hword \angleZ .hword \angleZ
.word \behParam .word32 \behParam
.word \beh .word \beh
.endm .endm
.macro mario unk3, behArg, beh .macro mario unk3, behArg, beh
.byte 0x25, 0x0C .byte 0x25, 0x08 + PTR_WIDTH
.byte 0 .byte 0
.byte \unk3 .byte \unk3
.word \behArg .word32 \behArg
.word \beh .word \beh
.endm .endm
@ -312,13 +312,13 @@
.endm .endm
.macro terrain terrainData .macro terrain terrainData
.byte 0x2E, 0x08 .byte 0x2E, 0x04 + PTR_WIDTH
.hword 0 .hword 0
.word \terrainData .word \terrainData
.endm .endm
.macro rooms surfaceRooms .macro rooms surfaceRooms
.byte 0x2F, 0x08 .byte 0x2F, 0x04 + PTR_WIDTH
.hword 0 .hword 0
.word \surfaceRooms .word \surfaceRooms
.endm .endm
@ -379,7 +379,7 @@
.endm .endm
.macro macro_objects objList .macro macro_objects objList
.byte 0x39, 0x08 .byte 0x39, 0x04 + PTR_WIDTH
.hword 0 .hword 0
.word \objList .word \objList
.endm .endm

View File

@ -25,4 +25,13 @@
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1] #define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
#endif #endif
// convert a virtual address to physical.
#define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) & 0x1FFFFFFF)
// convert a physical address to virtual.
#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) | 0x80000000)
// another way of converting virtual to physical
#define VIRTUAL_TO_PHYSICAL2(addr) ((u8 *)(addr) - 0x80000000U)
#endif #endif

View File

@ -9,12 +9,18 @@
.set K2BASE, 0xC0000000 .set K2BASE, 0xC0000000
.set SCREEN_WIDTH, 320 .set SCREEN_WIDTH, 320
.set SCREEN_HEIGHT, 240 .set SCREEN_HEIGHT, 240
.set PTR_WIDTH, 4
.macro glabel label .macro glabel label
.global \label .global \label
.balign 4
\label: \label:
.endm .endm
.macro .word32 x
.word \x
.endm
# F3D vertex # F3D vertex
.macro vertex x, y, z, u, v, r=0xFF, g=0xFF, b=0xFF, a=0xFF .macro vertex x, y, z, u, v, r=0xFF, g=0xFF, b=0xFF, a=0xFF
.hword \x, \y, \z, 0, \u, \v .hword \x, \y, \z, 0, \u, \v
@ -105,8 +111,8 @@ binid
.endm .endm
.macro dialog_entry w1, w2, w3, w4 .macro dialog_entry w1, w2, w3, w4
.word \w1 .word32 \w1
.byte (\w2 >> 24), 0x00 .byte (\w2 >> 24), 0x00
.hword (\w2 & 0xFFFF), (\w3 >> 16), 0x0000 .hword (\w2 & 0xFFFF), (\w3 >> 16), 0x0000
.long \w4 .word \w4
.endm .endm

View File

@ -59,8 +59,8 @@
#define DIALOG_UNK1_AWAIT_DIALOG 3 #define DIALOG_UNK1_AWAIT_DIALOG 3
#define DIALOG_UNK1_DISABLE_TIME_STOP 4 #define DIALOG_UNK1_DISABLE_TIME_STOP 4
#define DIALOG_UNK1_FLAG_1 (1 << 1) // 0x02 #define DIALOG_UNK1_FLAG_DEFAULT (1 << 1) // 0x02
#define DIALOG_UNK1_FLAG_2 (1 << 2) // 0x04 #define DIALOG_UNK1_FLAG_RESPONSE (1 << 2) // 0x04
#define DIALOG_UNK1_FLAG_4 (1 << 4) // 0x10 #define DIALOG_UNK1_FLAG_4 (1 << 4) // 0x10
#define DIALOG_UNK2_ENABLE_TIME_STOP 0 #define DIALOG_UNK2_ENABLE_TIME_STOP 0
@ -352,6 +352,11 @@
#define BOO_DEATH_STATUS_DYING 1 #define BOO_DEATH_STATUS_DYING 1
#define BOO_DEATH_STATUS_DEAD 2 #define BOO_DEATH_STATUS_DEAD 2
/* attackStatus */
#define BOO_NOT_ATTACKED 0
#define BOO_ATTACKED 1
#define BOO_BOUNCED_ON -1
/* Beta Boo Key */ /* Beta Boo Key */
/* oAction */ /* oAction */
#define BETA_BOO_KEY_ACT_IN_BOO 0 #define BETA_BOO_KEY_ACT_IN_BOO 0

File diff suppressed because it is too large Load Diff

View File

@ -122,8 +122,8 @@
#define MARIO_TELEPORTING 0x00000080 #define MARIO_TELEPORTING 0x00000080
#define MARIO_UNKNOWN_08 0x00000100 #define MARIO_UNKNOWN_08 0x00000100
#define MARIO_UNKNOWN_13 0x00002000 #define MARIO_UNKNOWN_13 0x00002000
#define MARIO_ENVIRONMENT_NOISE_PLAYED 0x00010000 #define MARIO_ACTION_SOUND_PLAYED 0x00010000
#define MARIO_ACTION_NOISE_PLAYED 0x00020000 #define MARIO_MARIO_SOUND_PLAYED 0x00020000
#define MARIO_UNKNOWN_18 0x00040000 #define MARIO_UNKNOWN_18 0x00040000
#define MARIO_PUNCHING 0x00100000 #define MARIO_PUNCHING 0x00100000
#define MARIO_KICKING 0x00200000 #define MARIO_KICKING 0x00200000
@ -415,11 +415,6 @@
#define ACT_HOLDING_BOWSER 0x00000391 // (0x191 | ACT_FLAG_STATIONARY) #define ACT_HOLDING_BOWSER 0x00000391 // (0x191 | ACT_FLAG_STATIONARY)
#define ACT_RELEASING_BOWSER 0x00000392 // (0x192 | ACT_FLAG_STATIONARY) #define ACT_RELEASING_BOWSER 0x00000392 // (0x192 | ACT_FLAG_STATIONARY)
// convert a virtual address to physical.
#define VIRTUAL_TO_PHYSICAL(addr) ((u32)(addr) & 0x1FFFFFFF)
// convert a physical address to virtual.
#define PHYSICAL_TO_VIRTUAL(addr) ((u32)(addr) | 0x80000000)
/* /*
this input mask is unused by the controller, this input mask is unused by the controller,
but END_DEMO is used internally to signal but END_DEMO is used internally to signal

View File

@ -0,0 +1,18 @@
#ifndef TEXT_MENU_STRINGS_H
#define TEXT_MENU_STRINGS_H
// These strings use a different table defined in menu_hud_lut
// Unlike text_strings.h.in, the charmap is different and
// uses char values from charmap_menu.txt
/**
* File Select JP HUD Text
*/
#define TEXT_JPHUD_MARIO _("マリオ")
#define TEXT_JPHUD_SELECT_FILE _("ファイルセレクト")
#define TEXT_JPHUD_CHECK_FILE _("どのスコアをみる?")
#define TEXT_JPHUD_COPY_FILE _("ファイルコピーする")
#define TEXT_JPHUD_ERASE_FILE _("ファイルけす")
#define TEXT_JPHUD_SOUND_SELECT _("サウンドセレクト")
#endif

View File

@ -1,115 +1,280 @@
#ifndef _TEXT_STRINGS_H_ #ifndef TEXT_STRINGS_H
#define _TEXT_STRINGS_H_ #define TEXT_STRINGS_H
// star select screen #include "text_menu_strings.h"
#define TEXT_0 _("0")
#define TEXT_COIN_X _("$[x]") /**
#define TEXT_STAR_X _("*[x]") * Global Symbols
*/
// common #define TEXT_ZERO _("0")
#define TEXT_COIN _("$") #define TEXT_COIN _("$")
#define TEXT_STAR _("*") #define TEXT_STAR _("★")
#define TEXT_VARIABLE_X _("[x]") #define TEXT_COIN_X _("$×")
#define TEXT_UNFILLED_STAR _("#") #define TEXT_STAR_X _("★×")
#define TEXT_NEW _("NEW") #define TEXT_VARIABLE_X _("×")
#define TEXT_UNFILLED_STAR _("☆")
/**
* Global Text
*/
// File Select
#define TEXT_NEW _("NEW") // New File Text
#define TEXT_4DASHES _("----") // Used in Score File Menu
// Ingame Menu
#define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses
#define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses
#ifdef VERSION_JP #ifdef VERSION_JP
#define TEXT_COURSE _("コ-ス")
/**
* File Select Text
*/
// Main Screens
// JPHUD menu strings are defined in "text_menu_strings.h.in"
#define TEXT_MARIO TEXT_JPHUD_MARIO // View Score Menu
#define TEXT_SELECT_FILE TEXT_JPHUD_SELECT_FILE
#define TEXT_CHECK_FILE TEXT_JPHUD_CHECK_FILE
#define TEXT_COPY_FILE TEXT_JPHUD_COPY_FILE
#define TEXT_ERASE_FILE TEXT_JPHUD_ERASE_FILE
#define TEXT_SOUND_SELECT TEXT_JPHUD_SOUND_SELECT
#define TEXT_FILE_MARIO_A _("マリオA")
#define TEXT_FILE_MARIO_B _("マリオB")
#define TEXT_FILE_MARIO_C _("マリオC")
#define TEXT_FILE_MARIO_D _("マリオD")
// Menu Options
#define TEXT_SCORE _("スコア")
#define TEXT_COPY _("コピ-")
#define TEXT_ERASE _("けす")
// Sound Options
#define TEXT_STEREO _("ステレオ")
#define TEXT_MONO _("モノラル")
#define TEXT_HEADSET _("ヘッドホン")
// Misc Menu Text
#define TEXT_SAVED_DATA_EXISTS _("ファイルにデ-タがはいってます")
#define TEXT_NO_SAVED_DATA_EXISTS _("ファイルにデ-タがありません")
// Inside a Menu
#define TEXT_RETURN _("もどる")
#define TEXT_CHECK_SCORE _("スコアをみる")
#define TEXT_COPY_FILE_BUTTON _("ファイルコピ-")
#define TEXT_ERASE_FILE_BUTTON _("ファイルけす")
// Score Menu
#define TEXT_HI_SCORE _("ハイスコア")
#define TEXT_MY_SCORE _("マイスコア") #define TEXT_MY_SCORE _("マイスコア")
#define TEXT_SCORE_MARIO_A _("マリオA")
#define TEXT_SCORE_MARIO_B _("マリオB")
#define TEXT_SCORE_MARIO_C _("マリオC")
#define TEXT_SCORE_MARIO_D _("マリオD")
// Copy Menu
#define TEXT_COPY_IT_TO_WHERE _("どこにコピ-しますか?")
#define TEXT_COPYING_COMPLETED _("コピ-おわりました")
#define TEXT_NO_FILE_TO_COPY_FROM _("からのファイルがありません")
// Erase Menu
#define TEXT_SURE _("ほんと?")
#define TEXT_YES _("はい")
#define TEXT_NO _("いいえ")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("マリオAをけしました")
/**
* Menus Text (Pause, Course Completed)
*/
// Main Courses
#define TEXT_COURSE _("コ-ス")
#define TEXT_MYSCORE _("マイスコア")
#define TEXT_CONTINUE _("つづけて マリオする?")
#define TEXT_EXIT_COURSE _("コ-スからでる?")
#define TEXT_CAMERA_ANGLE_R _("Rボタンのカメラきりかえ")
// Camera Options
#define TEXT_LAKITU_MARIO _("ジュゲム+マリオ") #define TEXT_LAKITU_MARIO _("ジュゲム+マリオ")
#define TEXT_LAKITU_STOP _("ジュゲム+ストップ") #define TEXT_LAKITU_STOP _("ジュゲム+ストップ")
#define TEXT_NORMAL_UPCLOSE _("(おすすめ)(リアル)") #define TEXT_NORMAL_UPCLOSE _("(おすすめ)(リアル)")
#define TEXT_NORMAL_FIXED _("(おすすめ)(とまる)") #define TEXT_NORMAL_FIXED _("(おすすめ)(とまる)")
#define TEXT_CONTINUE _("つづけて マリオする?")
#define TEXT_EXIT_COURSE _("コ-スからでる?") // Course Completed Misc Text
#define TEXT_CAMERA_ANGLE_R _("Rボタンのカメラきりかえ") #define TEXT_CATCH _("キャッチ!")
#define TEXT_CLEAR _("クリア!")
#define TEXT_HUD_HI_SCORE _("HISCORE")
// Save Options
#define TEXT_SAVE_AND_CONTINUE _("セ-ブしてつづける?") #define TEXT_SAVE_AND_CONTINUE _("セ-ブしてつづける?")
#define TEXT_SAVE_AND_QUIT _("セ-ブしておわる?") #define TEXT_SAVE_AND_QUIT _("セ-ブしておわる?")
#define TEXT_CONTINUE_WITHOUT_SAVING _("セ-ブしないでつづける?") #define TEXT_CONTINUE_WITHOUT_SAVING _("セ-ブしないでつづける?")
// ending cutscene subtitles
/**
* Ending Peach cutscene text.
*/
#define TEXT_FILE_MARIO_EXCLAMATION _("マリオ!!") #define TEXT_FILE_MARIO_EXCLAMATION _("マリオ!!")
#define TEXT_POWER_STARS_RESTORED _("おしろにスタ-が もどったのね") #define TEXT_POWER_STARS_RESTORED _("おしろにスタ-が もどったのね")
#define TEXT_THANKS_TO_YOU _("みんな あなたのおかげだわ!") #define TEXT_THANKS_TO_YOU _("みんな あなたのおかげだわ!")
#define TEXT_THANK_YOU_MARIO _("ありがとう マリオ") #define TEXT_THANK_YOU_MARIO _("ありがとう マリオ")
#define TEXT_SOMETHING_SPECIAL _("なにか おれいをしなくちゃ・・") #define TEXT_SOMETHING_SPECIAL _("なにか おれいをしなくちゃ・・")
#define TEXT_COME_ON_EVERYBODY _("さあ みんな") #define TEXT_LISTEN_EVERYBODY _("さあ みんな")
#define TEXT_LETS_HAVE_CAKE _("おいしいケ-キを やきましょう") #define TEXT_LETS_HAVE_CAKE _("おいしいケ-キを やきましょう")
#define TEXT_FOR_MARIO _("マリオの ために・・・") #define TEXT_FOR_MARIO _("マリオの ために・・・")
#define TEXT_FILE_MARIO_QUESTION _("マリオ?") #define TEXT_FILE_MARIO_QUESTION _("マリオ?")
#define TEXT_SURE _("ほんと?")
#define TEXT_NO_SAVED_DATA_EXISTS _("ファイルにデ-タがありません")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("マリオAをけしました")
#define TEXT_SAVED_DATA_EXISTS _("ファイルにデ-タがはいってます")
// file select
#define TEXT_RETURN _("もどる")
#define TEXT_CHECK_SCORE _("スコアをみる")
#define TEXT_HI_SCORE _("ハイスコア")
#define TEXT_MY_SCORE _("マイスコア")
#define TEXT_COPY_FILE_BUTTON _("ファイルコピ-")
#define TEXT_ERASE_FILE_BUTTON _("ファイルけす")
#define TEXT_STEREO _("ステレオ")
#define TEXT_MONO _("モノラル")
#define TEXT_HEADSET _("ヘッドホン")
#define TEXT_FILE_MARIO_A _("マリオA")
#define TEXT_FILE_MARIO_B _("マリオB")
#define TEXT_FILE_MARIO_C _("マリオC")
#define TEXT_FILE_MARIO_D _("マリオD")
#define TEXT_SCORE_MARIO_A _("マリオA")
#define TEXT_SCORE_MARIO_B _("マリオB")
#define TEXT_SCORE_MARIO_C _("マリオC")
#define TEXT_SCORE_MARIO_D _("マリオD")
#define TEXT_SCORE _("スコア")
#define TEXT_COPY _("コピ-")
#define TEXT_ERASE _("けす")
#define TEXT_COPY_IT_TO_WHERE _("どこにコピ-しますか?")
#define TEXT_COPYING_COMPLETED _("コピ-おわりました")
#define TEXT_NO_FILE_TO_COPY_FROM _("からのファイルがありません")
#define TEXT_YES _("はい")
#define TEXT_NO _("いいえ")
#define TEXT_4DASHES _("----")
#define TEXT_HI_SCORE_EN _("HISCORE")
#define TEXT_CLEAR _("クリア!")
#define TEXT_CATCH _("キャッチ!")
// todo: handle these strings
#define TEXT_MARIO 0x0F, 0x10, 0x11, 0xFF
#define TEXT_SELECT_FILE 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0xff
#define TEXT_CHECK_FILE 0x15, 0x16, 0x12, 0x09, 0x13, 0x08, 0x14, 0x0d, 0x17, 0xff
#define TEXT_COPY_FILE 0x00, 0x01, 0x02, 0x03, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0xff
#define TEXT_ERASE_FILE 0x00, 0x01, 0x02, 0x03, 0x0E, 0x0C, 0xFF
#define TEXT_SOUND_SELECT 0x18, 0x19, 0x1A, 0x1B, 0x04, 0x05, 0x06, 0x07, 0xFF
#endif
#if defined(VERSION_US) || defined(VERSION_EU)
/**
* File Select Text
*/
// Main Screens
#define TEXT_MARIO _("MARIO") // View Score Menu
#define TEXT_SELECT_FILE _("SELECT FILE")
#define TEXT_CHECK_FILE _("CHECK FILE")
#define TEXT_COPY_FILE _("COPY FILE")
#define TEXT_ERASE_FILE _("ERASE FILE")
#define TEXT_SOUND_SELECT _("SOUND SELECT")
#define TEXT_FILE_MARIO_A _("MARIO A")
#define TEXT_FILE_MARIO_B _("MARIO B")
#define TEXT_FILE_MARIO_C _("MARIO C")
#define TEXT_FILE_MARIO_D _("MARIO D")
// Menu Options
#define TEXT_SCORE _("SCORE")
#define TEXT_COPY _("COPY")
#define TEXT_ERASE _("ERASE")
// Sound Options
#define TEXT_STEREO _("STEREO")
#define TEXT_MONO _("MONO")
#define TEXT_HEADSET _("HEADSET")
// Misc Menu Text
#define TEXT_SAVED_DATA_EXISTS _("SAVED DATA EXITS") // Misspell
#define TEXT_NO_SAVED_DATA_EXISTS _("NO SAVED DATA EXISTS")
// Inside a Menu
#define TEXT_RETURN _("RETURN")
#define TEXT_CHECK_SCORE _("CHECK SCORE")
#define TEXT_COPY_FILE_BUTTON _("COPY FILE")
#define TEXT_ERASE_FILE_BUTTON _("ERASE FILE")
// Score Menu
#define TEXT_HI_SCORE _("HI SCORE")
#define TEXT_MY_SCORE _("MY SCORE")
// Score Mario Text ("☺" is the Mario face defined in the US/EU menu char table)
#define TEXT_SCORE_MARIO_A _("☺A")
#define TEXT_SCORE_MARIO_B _("☺B")
#define TEXT_SCORE_MARIO_C _("☺C")
#define TEXT_SCORE_MARIO_D _("☺D")
// Copy Menu
#define TEXT_COPY_IT_TO_WHERE _("COPY IT TO WHERE?")
#define TEXT_COPYING_COMPLETED _("COPYING COMPLETED")
#define TEXT_NO_FILE_TO_COPY_FROM _("NO EMPTY FILE")
// Erase Menu
#define TEXT_SURE _("SURE?")
#define TEXT_YES _("YES")
#define TEXT_NO _("NO")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("MARIO A JUST ERASED")
/**
* Menus Text (Pause, Course Completed)
*/
// Main Courses
#define TEXT_COURSE _("COURSE")
#define TEXT_MYSCORE _("MYSCORE")
#define TEXT_CONTINUE _("CONTINUE")
#define TEXT_EXIT_COURSE _("EXIT COURSE")
#ifndef VERSION_EU // "R" text is different in EU
#define TEXT_CAMERA_ANGLE_R _("SET CAMERA ANGLE WITH R")
#endif
// Camera Options
#define TEXT_LAKITU_MARIO _("LAKITU + MARIO")
#define TEXT_LAKITU_STOP _("LAKITU + STOP")
#define TEXT_NORMAL_UPCLOSE __("(NORMAL)(UP-CLOSE)")
#define TEXT_NORMAL_FIXED __("(NORMAL)(FIXED)")
// Course Completed Misc Text
#define TEXT_CATCH _("CATCH")
#define TEXT_CLEAR _("CLEAR")
#define TEXT_HUD_HI_SCORE _("HI SCORE")
// Save Options
#define TEXT_SAVE_AND_CONTINUE _("SAVE & CONTINUE")
#define TEXT_SAVE_AND_QUIT _("SAVE & QUIT")
#define TEXT_CONTINUE_WITHOUT_SAVING _("CONTINUE, DON'T SAVE")
/**
* Ending Peach cutscene text.
*/
#define TEXT_FILE_MARIO_EXCLAMATION _("Mario!")
#define TEXT_POWER_STARS_RESTORED __("The power of the Stars is restored to the castle...")
#define TEXT_THANKS_TO_YOU __("...and it's all thanks to you!")
#define TEXT_THANK_YOU_MARIO __("Thank you, Mario!")
#define TEXT_SOMETHING_SPECIAL __("We have to do something special for you...")
#define TEXT_LISTEN_EVERYBODY _("Listen, everybody,")
#define TEXT_LETS_HAVE_CAKE _("let's bake a delicious cake...")
#define TEXT_FOR_MARIO _("...for Mario...")
#define TEXT_FILE_MARIO_QUESTION _("Mario!")
#endif
#else
#ifdef VERSION_EU #ifdef VERSION_EU
#define TEXT_CAMERA_ANGLE_R_EN _("SET CAMERA ANGLE WITH [R]")
#define TEXT_MY_SCORE_FR _("MON SCORE") /**
* Menus Text (Pause, Course Completed)
*/
// Main Courses
// English, "R" text is different
#define TEXT_CAMERA_ANGLE_R _("SET CAMERA ANGLE WITH [R]")
// French
#define TEXT_COURSE_FR _("NIVEAU") #define TEXT_COURSE_FR _("NIVEAU")
#define TEXT_NORMAL_UPCLOSE_FR _("(NORMAL}{GROS-PLAN)") #define TEXT_MY_SCORE_FR _("MON SCORE")
#define TEXT_NORMAL_FIXED_FR _("(NORMAL}{FIXE)")
#define TEXT_CONTINUE_FR _("CONTINUER") #define TEXT_CONTINUE_FR _("CONTINUER")
#define TEXT_EXIT_COURSE_FR _("QUITTER NIVEAU") #define TEXT_EXIT_COURSE_FR _("QUITTER NIVEAU")
#define TEXT_CAMERA_ANGLE_R_FR _("RÉGLAGE CAMÉRA AVEC [R]") #define TEXT_CAMERA_ANGLE_R_FR _("RÉGLAGE CAMÉRA AVEC [R]")
#define TEXT_HI_SCORE_FR _("MEILLEUR SCORE") // German
#define TEXT_CONGRATULATIONS_FR _("FELICITATIONS")
#define TEXT_SAVE_AND_CONTINUE_FR _("SAUVEGARDER & CONTINUER")
#define TEXT_SAVE_AND_QUIT_FR _("SAUVEGARDER & QUITTER")
#define TEXT_CONTINUE_WITHOUT_SAVING_FR _("CONTINUER SANS SAUVEGARDER")
#define TEXT_MY_SCORE_DE _("LEISTUNG")
#define TEXT_COURSE_DE _("KURS") #define TEXT_COURSE_DE _("KURS")
#define TEXT_NORMAL_UPCLOSE_DE _("(NORMAL}{WEIT-ZOOM)") #define TEXT_MY_SCORE_DE _("LEISTUNG")
#define TEXT_NORMAL_FIXED_DE _("(NORMAL}{STATIV)")
#define TEXT_CONTINUE_DE _("WEITER") #define TEXT_CONTINUE_DE _("WEITER")
#define TEXT_EXIT_COURSE_DE _("KURS VERLASSEN") #define TEXT_EXIT_COURSE_DE _("KURS VERLASSEN")
#define TEXT_CAMERA_ANGLE_R_DE _("KAMERA MIT [R] VERSTELLEN") #define TEXT_CAMERA_ANGLE_R_DE _("KAMERA MIT [R] VERSTELLEN")
#define TEXT_HI_SCORE_DE _("BESTLEISTUNG")
#define TEXT_CONGRATULATIONS_DE _("GRATULATION") // Camera Options
// French
#define TEXT_NORMAL_UPCLOSE_FR __("(NORMAL)(GROS-PLAN)")
#define TEXT_NORMAL_FIXED_FR __("(NORMAL)(FIXE)")
// German
#define TEXT_NORMAL_UPCLOSE_DE __("(NORMAL)(WEIT-ZOOM)")
#define TEXT_NORMAL_FIXED_DE __("(NORMAL)(STATIV)")
// Course Completed Misc Text
// French
#define TEXT_HUD_HI_SCORE_FR _("MEILLEUR SCORE")
#define TEXT_HUD_CONGRATULATIONS_FR _("FELICITATIONS")
// German
#define TEXT_HUD_HI_SCORE_DE _("BESTLEISTUNG")
#define TEXT_HUD_CONGRATULATIONS_DE _("GRATULATION")
// Save Options
// French
#define TEXT_SAVE_AND_CONTINUE_FR _("SAUVEGARDER & CONTINUER")
#define TEXT_SAVE_AND_QUIT_FR _("SAUVEGARDER & QUITTER")
#define TEXT_CONTINUE_WITHOUT_SAVING_FR _("CONTINUER SANS SAUVEGARDER")
// German
#define TEXT_SAVE_AND_CONTINUE_DE _("SPEICHERN & WEITER") #define TEXT_SAVE_AND_CONTINUE_DE _("SPEICHERN & WEITER")
#define TEXT_SAVE_AND_QUIT_DE _("SPEICHERN & ENDE") #define TEXT_SAVE_AND_QUIT_DE _("SPEICHERN & ENDE")
#define TEXT_CONTINUE_WITHOUT_SAVING_DE _("WEITER OHNE ZU SPEICHERN") #define TEXT_CONTINUE_WITHOUT_SAVING_DE _("WEITER OHNE ZU SPEICHERN")
/**
* Ending Peach cutscene text.
*/
// French
#define TEXT_POWER_STARS_RESTORED_FR _("Grâce aux étoiles, le château a retrouvé ses pouvoirs...") #define TEXT_POWER_STARS_RESTORED_FR _("Grâce aux étoiles, le château a retrouvé ses pouvoirs...")
#define TEXT_THANKS_TO_YOU_FR _("...et ceci grâce à toi!") #define TEXT_THANKS_TO_YOU_FR _("...et ceci grâce à toi!")
#define TEXT_THANK_YOU_MARIO_FR _("Merci, Mario!") #define TEXT_THANK_YOU_MARIO_FR _("Merci, Mario!")
@ -117,7 +282,7 @@
#define TEXT_COME_ON_EVERYBODY_FR _("Venez les amis...") #define TEXT_COME_ON_EVERYBODY_FR _("Venez les amis...")
#define TEXT_LETS_HAVE_CAKE_FR _("Allons préparer un délicieux gâteau...") #define TEXT_LETS_HAVE_CAKE_FR _("Allons préparer un délicieux gâteau...")
#define TEXT_FOR_MARIO_FR _("...pour Mario...") #define TEXT_FOR_MARIO_FR _("...pour Mario...")
// German
#define TEXT_POWER_STARS_RESTORED_DE _("Die Macht der Sterne ruht wieder sicher im Schloss...") #define TEXT_POWER_STARS_RESTORED_DE _("Die Macht der Sterne ruht wieder sicher im Schloss...")
#define TEXT_THANKS_TO_YOU_DE _("...und alles dank Deiner Hilfe!") #define TEXT_THANKS_TO_YOU_DE _("...und alles dank Deiner Hilfe!")
#define TEXT_THANK_YOU_MARIO_DE _("Vielen Dank, Mario!") #define TEXT_THANK_YOU_MARIO_DE _("Vielen Dank, Mario!")
@ -125,80 +290,7 @@
#define TEXT_COME_ON_EVERYBODY_DE _("Hört alle her...") #define TEXT_COME_ON_EVERYBODY_DE _("Hört alle her...")
#define TEXT_LETS_HAVE_CAKE_DE _("Laßt uns einen leckeren Kuchen backen...") #define TEXT_LETS_HAVE_CAKE_DE _("Laßt uns einen leckeren Kuchen backen...")
#define TEXT_FOR_MARIO_DE _("...für Mario...") #define TEXT_FOR_MARIO_DE _("...für Mario...")
#endif
#endif
#define TEXT_COURSE _("COURSE")
#define TEXT_MY_SCORE _("MY SCORE")
#define TEXT_LAKITU_MARIO _("LAKITU + MARIO")
#define TEXT_LAKITU_STOP _("LAKITU + STOP")
#define TEXT_NORMAL_UPCLOSE _("(NORMAL}{UP-CLOSE)")
#define TEXT_NORMAL_FIXED _("(NORMAL}{FIXED)")
#define TEXT_CONTINUE _("CONTINUE")
#define TEXT_EXIT_COURSE _("EXIT COURSE")
#define TEXT_CAMERA_ANGLE_R _("SET CAMERA ANGLE WITH R")
#define TEXT_SAVE_AND_CONTINUE _("SAVE & CONTINUE")
#define TEXT_SAVE_AND_QUIT _("SAVE & QUIT")
#define TEXT_CONTINUE_WITHOUT_SAVING _("CONTINUE, DON'T SAVE")
#define TEXT_HI_SCORE_EN _("HI SCORE")
// ending cutscene subtitles
// TODO: Handle the following uncompressed strings
// #define TEXT_POWER_STARS_RESTORED __("The power of the Stars is restored to the castle...")
// #define TEXT_THANKS_TO_YOU __("...and it's all thanks to you!")
// #define TEXT_THANK_YOU_MARIO __("Thank you, Mario!")
// #define TEXT_SOMETHING_SPECIAL __("We have to do something special for you...")
#define TEXT_FILE_MARIO_EXCLAMATION _("Mario!")
#define TEXT_POWER_STARS_RESTORED 0x1D, 0x2B, 0x28, 0x9E, 0x33, 0x32, 0x3A, 0x28, 0x35, 0x9E, 0x32, 0x29, 0x9E, 0x37, 0x2B, 0x28, 0x9E, 0x1C, 0x37, 0x24, 0x35, 0x36, 0x9E, 0x2C, 0x36, 0x9E, 0x35, 0x28, 0x36, 0x37, 0x32, 0x35, 0x28, 0x27, 0x9E, 0x37, 0x32, 0x9E, 0x37, 0x2B, 0x28, 0x9E, 0x26, 0x24, 0x36, 0x37, 0x2F, 0x28, 0x3F, 0x3F, 0x3F, 0xFF
#define TEXT_THANKS_TO_YOU 0x3F, 0x3F, 0x3F, 0x24, 0x31, 0x27, 0x9E, 0x2C, 0x37, 0x3E, 0x36, 0x9E, 0x24, 0x2F, 0x2F, 0x9E, 0x37, 0x2B, 0x24, 0x31, 0x2E, 0x36, 0x9E, 0x37, 0x32, 0x9E, 0x3C, 0x32, 0x38, 0xF2, 0xFF
#define TEXT_THANK_YOU_MARIO 0x1D, 0x2B, 0x24, 0x31, 0x2E, 0x9E, 0x3C, 0x32, 0x38, 0x6F, 0x9E, 0x16, 0x24, 0x35, 0x2C, 0x32, 0xF2, 0xFF
#define TEXT_SOMETHING_SPECIAL 0x20, 0x28, 0x9E, 0x2B, 0x24, 0x39, 0x28, 0x9E, 0x37, 0x32, 0x9E, 0x27, 0x32, 0x9E, 0x36, 0x32, 0x30, 0x28, 0x37, 0x2B, 0x2C, 0x31, 0x2A, 0x9E, 0x36, 0x33, 0x28, 0x26, 0x2C, 0x24, 0x2F, 0x9E, 0x29, 0x32, 0x35, 0x9E, 0x3C, 0x32, 0x38, 0x3F, 0x3F, 0x3F, 0xFF
#define TEXT_COME_ON_EVERYBODY _("Listen, everybody,")
#define TEXT_LETS_HAVE_CAKE _("let's bake a delicious cake...")
#define TEXT_FOR_MARIO _("...for Mario...")
#define TEXT_FILE_MARIO_QUESTION _("Mario!")
#define TEXT_ERASE_FILE _("ERASE FILE")
#define TEXT_SURE _("SURE?")
#define TEXT_NO_SAVED_DATA_EXISTS _("NO SAVED DATA EXISTS")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("MARIO A JUST ERASED")
#define TEXT_SAVED_DATA_EXISTS _("SAVED DATA EXITS")
// file select
#define TEXT_RETURN _("RETURN")
#define TEXT_CHECK_SCORE _("CHECK SCORE")
#define TEXT_MYSCORE _("MYSCORE")
#define TEXT_COPY_FILE_BUTTON _("COPY FILE")
#define TEXT_ERASE_FILE_BUTTON _("ERASE FILE")
#define TEXT_STEREO _("STEREO")
#define TEXT_MONO _("MONO")
#define TEXT_HEADSET _("HEADSET")
#define TEXT_FILE_MARIO_A _("MARIO A")
#define TEXT_FILE_MARIO_B _("MARIO B")
#define TEXT_FILE_MARIO_C _("MARIO C")
#define TEXT_FILE_MARIO_D _("MARIO D")
#define TEXT_SCORE_MARIO_A 0x40, 0x41, 0x0A, 0xFF
#define TEXT_SCORE_MARIO_B 0x40, 0x41, 0x0B, 0xFF
#define TEXT_SCORE_MARIO_C 0x40, 0x41, 0x0C, 0xFF
#define TEXT_SCORE_MARIO_D 0x40, 0x41, 0x0D, 0xFF
#define TEXT_SCORE _("SCORE")
#define TEXT_COPY _("COPY")
#define TEXT_ERASE _("ERASE")
#define TEXT_COPY_IT_TO_WHERE _("COPY IT TO WHERE?")
#define TEXT_COPYING_COMPLETED _("COPYING COMPLETED")
#define TEXT_NO_FILE_TO_COPY_FROM _("NO EMPTY FILE")
#define TEXT_YES _("YES")
#define TEXT_NO _("NO")
#define TEXT_4DASHES _("----")
#define TEXT_CLEAR _("CLEAR")
#define TEXT_CATCH _("CATCH")
#define TEXT_MARIO _("MARIO")
#define TEXT_SELECT_FILE _("SELECT FILE")
#define TEXT_CHECK_FILE _("CHECK FILE")
#define TEXT_COPY_FILE _("COPY FILE")
#define TEXT_ERASE_FILE _("ERASE FILE")
#define TEXT_SOUND_SELECT _("SOUND SELECT")
#endif
#define TEXT_PAUSE _("PAUSE")
// course complete menu
#define TEXT_CONGRATULATIONS _("CONGRATULATIONS")
#endif #endif

View File

@ -136,21 +136,19 @@ struct Object
s32 asS32[0x50]; s32 asS32[0x50];
s16 asS16[0x50][2]; s16 asS16[0x50][2];
f32 asF32[0x50]; f32 asF32[0x50];
void *asVoidP[0x50];
s16 *asS16P[0x50]; s16 *asS16P[0x50];
s32 *asS32P[0x50]; s32 *asS32P[0x50];
u32 *asAnims[0x50]; struct Animation **asAnims[0x50];
struct Waypoint *asWaypoint[0x50]; struct Waypoint *asWaypoint[0x50];
struct ChainSegment *asChainSegment[0x50]; struct ChainSegment *asChainSegment[0x50];
struct Object *asObject[0x50]; struct Object *asObject[0x50];
struct Surface *asSurface[0x50]; struct Surface *asSurface[0x50];
void *asVoidPtr[0x50]; void *asVoidPtr[0x50];
struct Object *asObjPtr[0x50];
} rawData; } rawData;
/*0x1C8*/ u32 unk1C8; /*0x1C8*/ u32 unused1;
/*0x1CC*/ u32 *behScript; /*0x1CC*/ uintptr_t *behScript;
/*0x1D0*/ u32 stackIndex; /*0x1D0*/ u32 stackIndex;
/*0x1D4*/ u32 stack[8]; /*0x1D4*/ uintptr_t stack[8];
/*0x1F4*/ s16 unk1F4; /*0x1F4*/ s16 unk1F4;
/*0x1F6*/ s16 respawnInfoType; /*0x1F6*/ s16 respawnInfoType;
/*0x1F8*/ f32 hitboxRadius; /*0x1F8*/ f32 hitboxRadius;
@ -159,7 +157,7 @@ struct Object
/*0x204*/ f32 hurtboxHeight; /*0x204*/ f32 hurtboxHeight;
/*0x208*/ f32 hitboxDownOffset; /*0x208*/ f32 hitboxDownOffset;
/*0x20C*/ void *behavior; /*0x20C*/ void *behavior;
/*0x210*/ u32 unk210; /*0x210*/ u32 unused2;
/*0x214*/ struct Object *platform; /*0x214*/ struct Object *platform;
/*0x218*/ void *collisionData; /*0x218*/ void *collisionData;
/*0x21C*/ Mat4 transform; /*0x21C*/ Mat4 transform;
@ -218,19 +216,26 @@ struct MarioBodyState
/*0x0C*/ Vec3s unkC; /*0x0C*/ Vec3s unkC;
/*0x12*/ Vec3s unk12; /*0x12*/ Vec3s unk12;
/*0x18*/ Vec3f unk18; /*0x18*/ Vec3f unk18;
u8 padding[4]; // what is this? u8 padding[4];
};
struct MarioAnimSub
{
u32 offset;
u32 size;
}; };
struct MarioAnimDmaRelatedThing struct MarioAnimDmaRelatedThing
{ {
u32 unk0; u32 count;
u32 unk4; u8 *srcAddr;
struct MarioAnimSub anim[1]; // dynamic size
}; };
struct MarioAnimation struct MarioAnimation
{ {
struct MarioAnimDmaRelatedThing *animDmaTable; struct MarioAnimDmaRelatedThing *animDmaTable;
u32 currentDma; u8 *currentAnimAddr;
struct Animation *targetAnim; struct Animation *targetAnim;
u8 padding[4]; u8 padding[4];
}; };
@ -243,7 +248,7 @@ struct MarioState
/*0x08*/ u32 particleFlags; /*0x08*/ u32 particleFlags;
/*0x0C*/ u32 action; /*0x0C*/ u32 action;
/*0x10*/ u32 prevAction; /*0x10*/ u32 prevAction;
/*0x14*/ u32 stepSound; /*0x14*/ u32 terrainSoundAddend;
/*0x18*/ u16 actionState; /*0x18*/ u16 actionState;
/*0x1A*/ u16 actionTimer; /*0x1A*/ u16 actionTimer;
/*0x1C*/ u32 actionArg; /*0x1C*/ u32 actionArg;

View File

@ -21,13 +21,14 @@ castle_grounds_seg7_anim_indexes_flags: # 0x0700C8F0 - 0x0700C944
castle_grounds_seg7_anim_header_flags: # 0x0700C944 - 0x0700C95C castle_grounds_seg7_anim_header_flags: # 0x0700C944 - 0x0700C95C
.hword 0 # repeats .hword 0 # repeats
.hword 0x0000 .hword 0
.word 0x00000000 .hword 0
.hword 0
.hword 29 # frame count .hword 29 # frame count
.hword 6 # node count .hword 6 # node count
.word castle_grounds_seg7_anim_values_flags # 0x0700C7C8 .word castle_grounds_seg7_anim_values_flags # 0x0700C7C8
.word castle_grounds_seg7_anim_indexes_flags # 0x0700C8F0 .word castle_grounds_seg7_anim_indexes_flags # 0x0700C8F0
.word 0x00000000 .word 0
glabel castle_grounds_seg7_anim_flags # 0x0700C95C - 0x0700C960 glabel castle_grounds_seg7_anim_flags # 0x0700C95C - 0x0700C960
.word castle_grounds_seg7_anim_header_flags # 0x0700C944 .word castle_grounds_seg7_anim_header_flags # 0x0700C944

View File

@ -14,7 +14,7 @@ gsDPSetTileSize 0, 0, 0, 252, 124
gsDPSetTextureImage G_IM_FMT_IA, G_IM_SIZ_8b, 1, castle_grounds_seg7_us_texture_0700EAE8 gsDPSetTextureImage G_IM_FMT_IA, G_IM_SIZ_8b, 1, castle_grounds_seg7_us_texture_0700EAE8
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x100
gsSPTextureRectangle 464, 664, 720, 792, 0, 0, 0, 1024, 1024 gsSPTextureRectangle 116 << 2, 166 << 2, (116 + 64) << 2, (166 + 32) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10
gsDPPipeSync gsDPPipeSync
gsDPSetTexturePersp G_TP_PERSP gsDPSetTexturePersp G_TP_PERSP

View File

@ -18,4 +18,4 @@ glabel ending_geo_000050 # 0x0E000050
geo_close_node geo_close_node
geo_end geo_end
.word 0x0 .balign 16

View File

@ -139,143 +139,143 @@ gsDPSetTileSize 0, 0, 0, 252, 124
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07000000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07000000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 32, 252, 156, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 8 << 2, (0 + 63) << 2, (8 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07001000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07001000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 32, 508, 156, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 8 << 2, (64 + 63) << 2, (8 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07002000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07002000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 32, 764, 156, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 8 << 2, (128 + 63) << 2, (8 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07003000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07003000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 32, 1020, 156, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 8 << 2, (192 + 63) << 2, (8 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07004000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07004000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 32, 1276, 156, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 8 << 2, (256 + 63) << 2, (8 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07005000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07005000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 160, 252, 284, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 40 << 2, (0 + 63) << 2, (40 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07006000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07006000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 160, 508, 284, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 40 << 2, (64 + 63) << 2, (40 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07007000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07007000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 160, 764, 284, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 40 << 2, (128 + 63) << 2, (40 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07008000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07008000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 160, 1020, 284, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 40 << 2, (192 + 63) << 2, (40 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07009000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07009000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 160, 1276, 284, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 40 << 2, (256 + 63) << 2, (40 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700A000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700A000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 288, 252, 412, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 72 << 2, (0 + 63) << 2, (72 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700B000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700B000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 288, 508, 412, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 72 << 2, (64 + 63) << 2, (72 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700C000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700C000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 288, 764, 412, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 72 << 2, (128 + 63) << 2, (72 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700D000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700D000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 288, 1020, 412, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 72 << 2, (192 + 63) << 2, (72 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700E000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700E000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 288, 1276, 412, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 72 << 2, (256 + 63) << 2, (72 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700F000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0700F000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 416, 252, 540, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 104 << 2, (0 + 63) << 2, (104 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07010000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07010000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 416, 508, 540, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 104 << 2, (64 + 63) << 2, (104 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07011000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07011000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 416, 764, 540, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 104 << 2, (128 + 63) << 2, (104 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07012000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07012000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 416, 1020, 540, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 104 << 2, (192 + 63) << 2, (104 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07013000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07013000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 416, 1276, 540, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 104 << 2, (256 + 63) << 2, (104 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07014000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07014000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 544, 252, 668, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 136 << 2, (0 + 63) << 2, (136 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07015000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07015000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 544, 508, 668, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 136 << 2, (64 + 63) << 2, (136 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07016000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07016000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 544, 764, 668, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 136 << 2, (128 + 63) << 2, (136 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07017000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07017000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 544, 1020, 668, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 136 << 2, (192 + 63) << 2, (136 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07018000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07018000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 544, 1276, 668, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 136 << 2, (256 + 63) << 2, (136 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07019000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07019000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 672, 252, 796, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 168 << 2, (0 + 63) << 2, (168 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701A000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701A000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 672, 508, 796, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 168 << 2, (64 + 63) << 2, (168 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701B000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701B000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 672, 764, 796, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 168 << 2, (128 + 63) << 2, (168 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701C000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701C000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 672, 1020, 796, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 168 << 2, (192 + 63) << 2, (168 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701D000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701D000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 672, 1276, 796, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 168 << 2, (256 + 63) << 2, (168 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701E000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701E000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 0, 800, 252, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 0 << 2, 200 << 2, (0 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701F000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_0701F000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 256, 800, 508, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 64 << 2, 200 << 2, (64 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07020000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07020000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 800, 764, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 200 << 2, (128 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07021000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07021000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 768, 800, 1020, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 192 << 2, 200 << 2, (192 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07022000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07022000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 1024, 800, 1276, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 256 << 2, 200 << 2, (256 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsSPEndDisplayList gsSPEndDisplayList
dl_cake_end_eu_070296D8: # 0x070296D8 - 0x070296F8 dl_cake_end_eu_070296D8: # 0x070296D8 - 0x070296F8
@ -288,11 +288,11 @@ glabel dl_cake_end_screen_eu_070296F8 # 0x070296F8 - 0x07029768
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07026000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07026000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 800, 764, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 200 << 2, (128 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07023000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07023000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 500, 764, 624, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 125 << 2, (128 + 63) << 2, (125 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsSPDisplayList dl_cake_end_eu_070296D8 gsSPDisplayList dl_cake_end_eu_070296D8
gsSPEndDisplayList gsSPEndDisplayList
@ -300,11 +300,11 @@ glabel dl_cake_end_screen_eu_07029768 # 0x07029768 - 0x070297D8
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07027000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07027000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 800, 764, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 200 << 2, (128 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07024000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07024000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 500, 764, 624, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 125 << 2, (128 + 63) << 2, (125 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsSPDisplayList dl_cake_end_eu_070296D8 gsSPDisplayList dl_cake_end_eu_070296D8
gsSPEndDisplayList gsSPEndDisplayList
@ -312,11 +312,11 @@ glabel dl_cake_end_screen_eu_070297D8 # 0x070297D8 - 0x07029848
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07028000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07028000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 800, 764, 924, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 200 << 2, (128 + 63) << 2, (200 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07025000 gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_07025000
gsDPLoadSync gsDPLoadSync
gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080 gsDPLoadBlock 7, 0, 0, 0x7FF, 0x080
gsSPTextureRectangle 512, 500, 764, 624, 0, 0, 0, 4096, 1024 gsSPTextureRectangle 128 << 2, 125 << 2, (128 + 63) << 2, (125 + 31) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10
gsSPDisplayList dl_cake_end_eu_070296D8 gsSPDisplayList dl_cake_end_eu_070296D8
gsSPEndDisplayList gsSPEndDisplayList

View File

@ -481,7 +481,9 @@ hmc_seg7_triangles_070246A0: # 0x070246A0 - 0x07024CD2
.balign 4 .balign 4
hmc_seg7_painting_data_07024CD4: # 0x07024CD4 hmc_seg7_painting_data_07024CD4: # 0x07024CD4
.word hmc_seg7_pool_points_070242F0 .word hmc_seg7_pool_points_070242F0
.word 0, 0 .word 0
.balign 8
hmc_seg7_texture_07024CE0: # 0x07024CE0 - 0x070254E0 hmc_seg7_texture_07024CE0: # 0x07024CE0 - 0x070254E0
.incbin "levels/hmc/7.rgba16" .incbin "levels/hmc/7.rgba16"

View File

@ -97,4 +97,4 @@ glabel intro_geo_000414 # 0x0E000414
geo_close_node geo_close_node
geo_end geo_end
.word 0x0 .balign 16

View File

@ -1,108 +1,108 @@
glabel main_menu_geo_0001D0 # 0x0E0001D0 glabel geo_menu_mario_save_button # 0x0E0001D0
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003330 geo_display_list LAYER_OPAQUE, dl_menu_mario_save_button_base
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_070033D0 geo_display_list LAYER_OPAQUE, dl_menu_save_button_back
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000200 # 0x0E000200 glabel geo_menu_mario_save_button_fade # 0x0E000200
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003330 geo_display_list LAYER_OPAQUE, dl_menu_mario_save_button_base
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003400 geo_display_list LAYER_OPAQUE, dl_menu_save_button_fade_back
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000230 # 0x0E000230 glabel geo_menu_mario_new_button # 0x0E000230
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003380 geo_display_list LAYER_OPAQUE, dl_menu_mario_new_button_base
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_070033D0 geo_display_list LAYER_OPAQUE, dl_menu_save_button_back
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000260 # 0x0E000260 glabel geo_menu_mario_new_button_fade # 0x0E000260
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003380 geo_display_list LAYER_OPAQUE, dl_menu_mario_new_button_base
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07003400 geo_display_list LAYER_OPAQUE, dl_menu_save_button_fade_back
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000290 # 0x0E000290 glabel geo_menu_erase_button # 0x0E000290
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_070061C8 geo_display_list LAYER_OPAQUE, dl_menu_erase_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_0002B8 # 0x0E0002B8 glabel geo_menu_copy_button # 0x0E0002B8
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_070061F8 geo_display_list LAYER_OPAQUE, dl_menu_copy_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_0002E0 # 0x0E0002E0 glabel geo_menu_file_button # 0x0E0002E0
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07006228 geo_display_list LAYER_OPAQUE, dl_menu_file_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000308 # 0x0E000308 glabel geo_menu_score_button # 0x0E000308
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07006258 geo_display_list LAYER_OPAQUE, dl_menu_score_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000330 # 0x0E000330 glabel geo_menu_sound_button # 0x0E000330
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_07006288 geo_display_list LAYER_OPAQUE, dl_menu_sound_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000358 # 0x0E000358 glabel geo_menu_generic_button # 0x0E000358
geo_node_start geo_node_start
geo_open_node geo_open_node
geo_scale 0x00, 524288 geo_scale 0x00, 524288
geo_open_node geo_open_node
geo_display_list LAYER_OPAQUE, main_menu_seg7_dl_070062B8 geo_display_list LAYER_OPAQUE, dl_menu_generic_button
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000380 # 0x0E000380 glabel geo_menu_file_select_strings_and_menu_cursor # 0x0E000380
geo_node_screen_area 10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2 geo_node_screen_area 10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2
geo_open_node geo_open_node
geo_zbuffer 0 geo_zbuffer 0
@ -124,12 +124,12 @@ glabel main_menu_geo_000380 # 0x0E000380
geo_close_node geo_close_node
geo_zbuffer 0 geo_zbuffer 0
geo_open_node geo_open_node
geo_asm 0, Geo18_80176688 geo_asm 0, geo_file_select_strings_and_menu_cursor
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end
glabel main_menu_geo_000408 # 0x0E000408 glabel geo_menu_act_selector_strings # 0x0E000408
geo_node_screen_area 10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2 geo_node_screen_area 10, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2
geo_open_node geo_open_node
geo_zbuffer 0 geo_zbuffer 0
@ -151,7 +151,7 @@ glabel main_menu_geo_000408 # 0x0E000408
geo_close_node geo_close_node
geo_zbuffer 0 geo_zbuffer 0
geo_open_node geo_open_node
geo_asm 0, Geo18_80177518 geo_asm 0, geo_act_selector_strings
geo_close_node geo_close_node
geo_close_node geo_close_node
geo_end geo_end

File diff suppressed because it is too large Load Diff

View File

@ -4,18 +4,18 @@ glabel level_main_menu_entry_1
load_mio0 /*seg*/ 0x07, /*romStart*/ _menu_segment_7SegmentRomStart, /*romEnd*/ _menu_segment_7SegmentRomEnd load_mio0 /*seg*/ 0x07, /*romStart*/ _menu_segment_7SegmentRomStart, /*romEnd*/ _menu_segment_7SegmentRomEnd
load_raw /*seg*/ 0x13, /*romStart*/ _behaviorSegmentRomStart, /*romEnd*/ _behaviorSegmentRomEnd load_raw /*seg*/ 0x13, /*romStart*/ _behaviorSegmentRomStart, /*romEnd*/ _behaviorSegmentRomEnd
alloc_level_pool alloc_level_pool
load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, /*geo*/ main_menu_geo_0001D0 load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, /*geo*/ geo_menu_mario_save_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_RED_ERASE_BUTTON, /*geo*/ main_menu_geo_000290 load_model_from_geo /*model*/ MODEL_MAIN_MENU_RED_ERASE_BUTTON, /*geo*/ geo_menu_erase_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_BLUE_COPY_BUTTON, /*geo*/ main_menu_geo_0002B8 load_model_from_geo /*model*/ MODEL_MAIN_MENU_BLUE_COPY_BUTTON, /*geo*/ geo_menu_copy_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*geo*/ main_menu_geo_0002E0 load_model_from_geo /*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*geo*/ geo_menu_file_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, /*geo*/ main_menu_geo_000308 load_model_from_geo /*model*/ MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, /*geo*/ geo_menu_score_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, /*geo*/ main_menu_geo_000200 load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, /*geo*/ geo_menu_mario_save_button_fade
load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_NEW_BUTTON, /*geo*/ main_menu_geo_000230 load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_NEW_BUTTON, /*geo*/ geo_menu_mario_new_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, /*geo*/ main_menu_geo_000260 load_model_from_geo /*model*/ MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, /*geo*/ geo_menu_mario_new_button_fade
load_model_from_geo /*model*/ MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, /*geo*/ main_menu_geo_000330 load_model_from_geo /*model*/ MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, /*geo*/ geo_menu_sound_button
load_model_from_geo /*model*/ MODEL_MAIN_MENU_GENERIC_BUTTON, /*geo*/ main_menu_geo_000358 load_model_from_geo /*model*/ MODEL_MAIN_MENU_GENERIC_BUTTON, /*geo*/ geo_menu_generic_button
area /*index*/ 1, /*geo*/ main_menu_geo_000380 area /*index*/ 1, /*geo*/ geo_menu_file_select_strings_and_menu_cursor
object /*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager object /*model*/ MODEL_NONE, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvMenuButtonManager
object /*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu object /*model*/ MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, /*pos*/ 0, 0, -19000, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvYellowBackgroundInMenu
terrain /*terrainData*/ main_menu_seg7_collision terrain /*terrainData*/ main_menu_seg7_collision
@ -25,8 +25,8 @@ glabel level_main_menu_entry_1
load_area /*area*/ 1 load_area /*area*/ 1
set_menu_music /*seq*/ 0x0021 set_menu_music /*seq*/ 0x0021
transition /*unk2*/ 0, /*unk3*/ 16, /*color*/ -1, -1, -1 transition /*unk2*/ 0, /*unk3*/ 16, /*color*/ -1, -1, -1
call /*arg*/ 0, /*func*/ LevelProc_801766DC call /*arg*/ 0, /*func*/ lvl_init_menu_values_and_cursor_pos
call_loop /*arg*/ 0, /*func*/ LevelProc_801768A0 call_loop /*arg*/ 0, /*func*/ lvl_update_obj_and_load_file_selected
get_or_set /*op*/ OP_SET, /*var*/ VAR_CURR_SAVE_FILE_NUM get_or_set /*op*/ OP_SET, /*var*/ VAR_CURR_SAVE_FILE_NUM
cmd38 /*unk2*/ 0x00BE cmd38 /*unk2*/ 0x00BE
transition /*unk2*/ 1, /*unk3*/ 16, /*color*/ -1, -1, -1 transition /*unk2*/ 1, /*unk3*/ 16, /*color*/ -1, -1, -1
@ -44,7 +44,7 @@ glabel level_main_menu_entry_2
load_mio0 /*seg*/ 0x07, /*romStart*/ _menu_segment_7SegmentRomStart, /*romEnd*/ _menu_segment_7SegmentRomEnd load_mio0 /*seg*/ 0x07, /*romStart*/ _menu_segment_7SegmentRomStart, /*romEnd*/ _menu_segment_7SegmentRomEnd
alloc_level_pool alloc_level_pool
area /*index*/ 2, /*geo*/ main_menu_geo_000408 area /*index*/ 2, /*geo*/ geo_menu_act_selector_strings
object /*model*/ MODEL_NONE, /*pos*/ 0, -100, 0, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvActSelector object /*model*/ MODEL_NONE, /*pos*/ 0, -100, 0, /*angle*/ 0, 0, 0, /*behParam*/ 0x04000000, /*beh*/ bhvActSelector
terrain /*terrainData*/ main_menu_seg7_collision terrain /*terrainData*/ main_menu_seg7_collision
end_area end_area
@ -54,8 +54,8 @@ glabel level_main_menu_entry_2
transition /*unk2*/ 0, /*unk3*/ 16, /*color*/ -1, -1, -1 transition /*unk2*/ 0, /*unk3*/ 16, /*color*/ -1, -1, -1
sleep /*frames*/ 16 sleep /*frames*/ 16
set_menu_music /*seq*/ 0x000D set_menu_music /*seq*/ 0x000D
call /*arg*/ 0, /*func*/ LevelProc_80177560 call /*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars
call_loop /*arg*/ 0, /*func*/ LevelProc_80177610 call_loop /*arg*/ 0, /*func*/ lvl_update_obj_and_load_act_button_actions
get_or_set /*op*/ OP_SET, /*var*/ VAR_CURR_ACT_NUM get_or_set /*op*/ OP_SET, /*var*/ VAR_CURR_ACT_NUM
cmd38 /*unk2*/ 0x00BE cmd38 /*unk2*/ 0x00BE
transition /*unk2*/ 1, /*unk3*/ 16, /*color*/ -1, -1, -1 transition /*unk2*/ 1, /*unk3*/ 16, /*color*/ -1, -1, -1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,13 +8,6 @@ glabel rspF3DBootStart
.incbin "lib/PR/boot/F3D_boot.bin" .incbin "lib/PR/boot/F3D_boot.bin"
glabel rspF3DBootEnd glabel rspF3DBootEnd
/*
* Both of these ucode bins are 0x1000/0x800 respectively as defined in their
* ucode initializations, but there's extra data afterwards. However, it's not the
* RSP data as that is pointed to below in the rodata section. TODO: What are these
* extra bins?
*/
.balign 16 .balign 16
.ifndef F3DEX_GBI_SHARED .ifndef F3DEX_GBI_SHARED
glabel rspF3DStart /* Use regular Fast3D bins (default) */ glabel rspF3DStart /* Use regular Fast3D bins (default) */
@ -22,7 +15,6 @@ glabel rspF3DStart /* Use regular Fast3D bins (default) */
.incbin "lib/PR/f3d/new/F3D.bin" /* OS 2.0H (J2 and IQ) */ .incbin "lib/PR/f3d/new/F3D.bin" /* OS 2.0H (J2 and IQ) */
.else .else
.incbin "lib/PR/f3d/old/F3D.bin" /* OS 2.0D (US and JP) */ .incbin "lib/PR/f3d/old/F3D.bin" /* OS 2.0D (US and JP) */
.incbin "lib/PR/f3d/old/F3D_unk.bin"
.endif .endif
glabel rspF3DEnd glabel rspF3DEnd
@ -43,7 +35,6 @@ glabel rspF3DEnd
.balign 16 .balign 16
glabel rspAspMainStart glabel rspAspMainStart
.incbin "lib/PR/audio/aspMain.bin" .incbin "lib/PR/audio/aspMain.bin"
.incbin "lib/PR/audio/aspMain_unk.bin"
glabel rspAspMainEnd glabel rspAspMainEnd
/* /*

View File

@ -276,7 +276,7 @@ static void _Genld(printf_struct *px, u8 code, u8 *p, s16 nsig, s16 xexp) {
} }
*p++ = xexp / 10 + '0', xexp %= 10; *p++ = xexp / 10 + '0', xexp %= 10;
*p++ = xexp + '0'; *p++ = xexp + '0';
px->part3_len = (u32) p - (u32) &px->buff[px->part2_len]; px->part3_len = p - (u8 *) &px->buff[px->part2_len];
} }
if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */ if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */
int n = int n =

View File

@ -205,7 +205,7 @@ static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) {
break; break;
case 'p': case 'p':
a0->value.s64 = (long) va_arg(*args, void *); // void* a0->value.s64 = (intptr_t) va_arg(*args, void *);
a0->buff = (char *) &buff[a0->part1_len]; a0->buff = (char *) &buff[a0->part1_len];
_Litob(a0, 'x'); _Litob(a0, 'x');
break; break;

View File

@ -4,6 +4,6 @@ s32 __osSiRawReadIo(void *a0, u32 *a1) {
if (__osSiDeviceBusy()) { if (__osSiDeviceBusy()) {
return -1; return -1;
} }
*a1 = HW_REG((u32) a0, u32); *a1 = HW_REG((uintptr_t) a0, u32);
return 0; return 0;
} }

View File

@ -4,6 +4,6 @@ s32 __osSiRawWriteIo(void *a0, u32 a1) {
if (__osSiDeviceBusy()) { if (__osSiDeviceBusy()) {
return -1; return -1;
} }
HW_REG((u32) a0, u32) = a1; HW_REG((uintptr_t) a0, u32) = a1;
return 0; return 0;
} }

View File

@ -1,12 +1,12 @@
#include "libultra_internal.h" #include "libultra_internal.h"
#include "libaudio_internal.h" #include "libaudio_internal.h"
#define PATCH(SRC, BASE, TYPE) SRC = (TYPE)((u32) SRC + (u32) BASE) #define PATCH(SRC, BASE, TYPE) SRC = (TYPE)((uintptr_t) SRC + (uintptr_t) BASE)
void alSeqFileNew(ALSeqFile *f, u8 *base) { void alSeqFileNew(ALSeqFile *f, u8 *base) {
int i; int i;
for (i = 0; i < f->seqCount; i++) { for (i = 0; i < f->seqCount; i++) {
f->seqArray[i].offset = (u32)(f->seqArray[i].offset) + base; PATCH(f->seqArray[i].offset, base, u8 *);
} }
} }

View File

@ -1,7 +1,7 @@
#ifndef _HARDWARE_H_ #ifndef _HARDWARE_H_
#define _HARDWARE_H_ #define _HARDWARE_H_
#define HW_REG(reg, type) *(volatile type *)(reg | 0xa0000000) #define HW_REG(reg, type) *(volatile type *)(uintptr_t)(reg | 0xa0000000)
#define AI_DRAM_ADDR_REG 0x04500000 #define AI_DRAM_ADDR_REG 0x04500000
#define AI_LEN_REG 0x04500004 #define AI_LEN_REG 0x04500004

View File

@ -73,7 +73,7 @@ void process_command_memory() {
u32 sp18; u32 sp18;
sp1c = string_to_u32(&D_80365E40[1]); sp1c = string_to_u32(&D_80365E40[1]);
sp18 = string_to_u32(&D_80365E40[5]); sp18 = string_to_u32(&D_80365E40[5]);
send((u8 *) sp1c, sp18); send((u8 *) (uintptr_t) sp1c, sp18);
} }
void process_command_register() { void process_command_register() {
send((u8 *) &gInterruptedThread.context, sizeof(__OSThreadContext)); send((u8 *) &gInterruptedThread.context, sizeof(__OSThreadContext));

View File

@ -24,7 +24,7 @@ s32 osAiSetNextBuffer(void *buff, u32 len) {
sp1c -= 0x2000; sp1c -= 0x2000;
} }
if ((((u32) buff + len) & 0x3fff) == 0x2000) { if ((((uintptr_t) buff + len) & 0x3fff) == 0x2000) {
D_80334820 = 1; D_80334820 = 1;
} else { } else {
D_80334820 = 0; D_80334820 = 0;

View File

@ -12,8 +12,7 @@ s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size) {
HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr); HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr);
HW_REG(PI_CART_ADDR_REG, void *) = HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff);
(void *) ((osRomBase /*(*(u32 *)80000308)*/ | cart_addr) & 0x1fffffff);
switch (dir) { switch (dir) {
case 0: case 0:

View File

@ -2,7 +2,7 @@
extern OSMgrArgs piMgrArgs; extern OSMgrArgs piMgrArgs;
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *vAddr, u32 nbytes, s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes,
OSMesgQueue *mq) { OSMesgQueue *mq) {
register s32 result; register s32 result;
register OSMesgQueue *cmdQueue; register OSMesgQueue *cmdQueue;

View File

@ -3,7 +3,7 @@ extern OSThread *D_803348A0;
extern OSThread *D_80334898; extern OSThread *D_80334898;
void osStartThread(OSThread *thread) { void osStartThread(OSThread *thread) {
register u32 int_disabled; register u32 int_disabled;
register u32 state; register uintptr_t state;
int_disabled = __osDisableInt(); int_disabled = __osDisableInt();
state = thread->state; state = thread->state;
@ -22,7 +22,7 @@ void osStartThread(OSThread *thread) {
} else { } else {
thread->state = OS_STATE_WAITING; thread->state = OS_STATE_WAITING;
__osEnqueueThread(thread->queue, thread); __osEnqueueThread(thread->queue, thread);
state = (u32) __osPopThread(thread->queue); state = (uintptr_t) __osPopThread(thread->queue);
__osEnqueueThread(&D_80334898, (OSThread *) state); __osEnqueueThread(&D_80334898, (OSThread *) state);
} }
} }

View File

@ -1,12 +1,10 @@
#include "libultra_internal.h" #include "libultra_internal.h"
u32 osVirtualToPhysical(void *addr) { uintptr_t osVirtualToPhysical(void *addr) {
if ((u32) addr >= 0x80000000 && (u32) addr < 0xa0000000) { if ((uintptr_t) addr >= 0x80000000 && (uintptr_t) addr < 0xa0000000) {
return ((u32) addr & 0x1fffffff); return ((uintptr_t) addr & 0x1fffffff);
} } else if ((uintptr_t) addr >= 0xa0000000 && (uintptr_t) addr < 0xc0000000) {
return ((uintptr_t) addr & 0x1fffffff);
else if ((u32) addr >= 0xa0000000 && (u32) addr < 0xc0000000) {
return ((u32) addr & 0x1fffffff);
} else { } else {
return __osProbeTLB(addr); return __osProbeTLB(addr);
} }

56
sm64.ld
View File

@ -153,6 +153,8 @@ SECTIONS
BUILD_DIR/src/game/object_collision.o(.text); BUILD_DIR/src/game/object_collision.o(.text);
BUILD_DIR/src/game/spawn_object.o(.text); BUILD_DIR/src/game/spawn_object.o(.text);
#endif #endif
BUILD_DIR/src/game*.o(.text);
BUILD_DIR/src/audio*.o(.text);
#if VERSION_US #if VERSION_US
. += 0x40; . += 0x40;
#endif #endif
@ -260,6 +262,7 @@ SECTIONS
BUILD_DIR/libultra.a:__osGetCause.o(.text); BUILD_DIR/libultra.a:__osGetCause.o(.text);
BUILD_DIR/libultra.a:__osAtomicDec.o(.text); BUILD_DIR/libultra.a:__osAtomicDec.o(.text);
BUILD_DIR/libultra.a:guLookAtRef.o(.text); /* Fast3DEX2 only */ BUILD_DIR/libultra.a:guLookAtRef.o(.text); /* Fast3DEX2 only */
BUILD_DIR/libultra.a:*.o(.text);
BUILD_DIR/lib/rsp.o(.text); BUILD_DIR/lib/rsp.o(.text);
/* data */ /* data */
BUILD_DIR/src/game/crash_screen.o(.data*); BUILD_DIR/src/game/crash_screen.o(.data*);
@ -302,8 +305,10 @@ SECTIONS
BUILD_DIR/src/game/hud.o(.data*); BUILD_DIR/src/game/hud.o(.data*);
BUILD_DIR/src/game/obj_behaviors.o(.data*); BUILD_DIR/src/game/obj_behaviors.o(.data*);
BUILD_DIR/src/game/obj_behaviors_2.o(.data*); BUILD_DIR/src/game/obj_behaviors_2.o(.data*);
BUILD_DIR/src/game*.o(.data*);
BUILD_DIR/src/audio/external.o(.data*); BUILD_DIR/src/audio/external.o(.data*);
BUILD_DIR/src/audio/data.o(.data*); BUILD_DIR/src/audio/data.o(.data*);
BUILD_DIR/src/audio*.o(.data*);
BUILD_DIR/libultra.a:osCreateViManager.o(.data*); BUILD_DIR/libultra.a:osCreateViManager.o(.data*);
BUILD_DIR/libultra.a:osCreatePiManager.o(.data*); BUILD_DIR/libultra.a:osCreatePiManager.o(.data*);
BUILD_DIR/libultra.a:osInitialize.o(.data*); BUILD_DIR/libultra.a:osInitialize.o(.data*);
@ -321,7 +326,8 @@ SECTIONS
BUILD_DIR/libultra.a:osViData.o(.data*); BUILD_DIR/libultra.a:osViData.o(.data*);
BUILD_DIR/libultra.a:kdebugserver.o(.data*); BUILD_DIR/libultra.a:kdebugserver.o(.data*);
BUILD_DIR/libultra.a:__osSyncPutChars.o(.data*); BUILD_DIR/libultra.a:__osSyncPutChars.o(.data*);
BUILD_DIR/libultra.a:guRotateF.o(.data); BUILD_DIR/libultra.a:guRotateF.o(.data*);
BUILD_DIR/libultra.a:*.o(.data*);
/* rodata */ /* rodata */
BUILD_DIR/src/game/crash_screen.o(.rodata*); BUILD_DIR/src/game/crash_screen.o(.rodata*);
BUILD_DIR/src/game/main.o(.rodata*); BUILD_DIR/src/game/main.o(.rodata*);
@ -363,12 +369,14 @@ SECTIONS
BUILD_DIR/src/game/hud.o(.rodata*); BUILD_DIR/src/game/hud.o(.rodata*);
BUILD_DIR/src/game/obj_behaviors.o(.rodata*); BUILD_DIR/src/game/obj_behaviors.o(.rodata*);
BUILD_DIR/src/game/obj_behaviors_2.o(.rodata*); BUILD_DIR/src/game/obj_behaviors_2.o(.rodata*);
BUILD_DIR/src/game*.o(.rodata*);
BUILD_DIR/src/audio/synthesis.o(.rodata*); BUILD_DIR/src/audio/synthesis.o(.rodata*);
BUILD_DIR/src/audio/memory.o(.rodata*); BUILD_DIR/src/audio/memory.o(.rodata*);
BUILD_DIR/src/audio/playback.o(.rodata*); BUILD_DIR/src/audio/playback.o(.rodata*);
BUILD_DIR/src/audio/effects.o(.rodata*); BUILD_DIR/src/audio/effects.o(.rodata*);
BUILD_DIR/src/audio/seqplayer.o(.rodata*); BUILD_DIR/src/audio/seqplayer.o(.rodata*);
BUILD_DIR/src/audio/external.o(.rodata*); BUILD_DIR/src/audio/external.o(.rodata*);
BUILD_DIR/src/audio*.o(.rodata*);
BUILD_DIR/libultra.a:guPerspectiveF.o(.rodata*); BUILD_DIR/libultra.a:guPerspectiveF.o(.rodata*);
BUILD_DIR/libultra.a:llconv.o(.rodata*); BUILD_DIR/libultra.a:llconv.o(.rodata*);
BUILD_DIR/libultra.a:cosf.o(.rodata*); BUILD_DIR/libultra.a:cosf.o(.rodata*);
@ -381,6 +389,7 @@ SECTIONS
BUILD_DIR/libultra.a:_Ldtob.o(.rodata*); BUILD_DIR/libultra.a:_Ldtob.o(.rodata*);
BUILD_DIR/libultra.a:osSetIntMask.o(.rodata*); BUILD_DIR/libultra.a:osSetIntMask.o(.rodata*);
BUILD_DIR/libultra.a:guLookAtRef.o(.rodata*); /* Fast3DEX2 only */ BUILD_DIR/libultra.a:guLookAtRef.o(.rodata*); /* Fast3DEX2 only */
BUILD_DIR/libultra.a:*.o(.rodata*);
BUILD_DIR/lib/rsp.o(.rodata*); BUILD_DIR/lib/rsp.o(.rodata*);
} }
END_SEG(main) END_SEG(main)
@ -421,6 +430,7 @@ SECTIONS
BUILD_DIR/src/game/hud.o(.bss*); BUILD_DIR/src/game/hud.o(.bss*);
BUILD_DIR/src/game/obj_behaviors.o(.bss*); BUILD_DIR/src/game/obj_behaviors.o(.bss*);
BUILD_DIR/src/game/obj_behaviors_2.o(.bss*); BUILD_DIR/src/game/obj_behaviors_2.o(.bss*);
BUILD_DIR/src/game*.o(.bss*);
BUILD_DIR/src/audio/external.o(.bss*); BUILD_DIR/src/audio/external.o(.bss*);
BUILD_DIR/libultra.a:osSetEventMesg.o(.bss*); BUILD_DIR/libultra.a:osSetEventMesg.o(.bss*);
BUILD_DIR/libultra.a:osSpTaskLoadGo.o(.bss*); BUILD_DIR/libultra.a:osSpTaskLoadGo.o(.bss*);
@ -436,6 +446,7 @@ SECTIONS
BUILD_DIR/libultra.a:__osSiCreateAccessQueue.o(.bss*); BUILD_DIR/libultra.a:__osSiCreateAccessQueue.o(.bss*);
BUILD_DIR/libultra.a:osEepromWrite.o(.bss*); BUILD_DIR/libultra.a:osEepromWrite.o(.bss*);
BUILD_DIR/libultra.a:kdebugserver.o(.bss*); BUILD_DIR/libultra.a:kdebugserver.o(.bss*);
BUILD_DIR/libultra.a:*.o(.bss*);
} }
END_NOLOAD(main) END_NOLOAD(main)
@ -451,6 +462,7 @@ SECTIONS
BUILD_DIR/src/engine/surface_collision.o(.text); BUILD_DIR/src/engine/surface_collision.o(.text);
BUILD_DIR/src/engine/surface_load.o(.text); BUILD_DIR/src/engine/surface_load.o(.text);
BUILD_DIR/src/engine/behavior_script.o(.text); BUILD_DIR/src/engine/behavior_script.o(.text);
BUILD_DIR/src/engine*.o(.text);
/* data */ /* data */
BUILD_DIR/src/engine/graph_node.o(.data*); BUILD_DIR/src/engine/graph_node.o(.data*);
BUILD_DIR/src/engine/graph_node_manager.o(.data*); BUILD_DIR/src/engine/graph_node_manager.o(.data*);
@ -459,11 +471,13 @@ SECTIONS
BUILD_DIR/src/engine/geo_layout.o(.data*); BUILD_DIR/src/engine/geo_layout.o(.data*);
BUILD_DIR/src/engine/level_script.o(.data*); BUILD_DIR/src/engine/level_script.o(.data*);
BUILD_DIR/src/engine/behavior_script.o(.data*); BUILD_DIR/src/engine/behavior_script.o(.data*);
BUILD_DIR/src/engine*.o(.data*);
/* rodata */ /* rodata */
BUILD_DIR/src/engine/math_util.o(.rodata*); BUILD_DIR/src/engine/math_util.o(.rodata*);
BUILD_DIR/src/engine/level_script.o(.rodata*); BUILD_DIR/src/engine/level_script.o(.rodata*);
BUILD_DIR/src/engine/surface_collision.o(.rodata*); BUILD_DIR/src/engine/surface_collision.o(.rodata*);
BUILD_DIR/src/engine/surface_load.o(.rodata*); BUILD_DIR/src/engine/surface_load.o(.rodata*);
BUILD_DIR/src/engine*.o(.rodata*);
} }
END_SEG(engine) END_SEG(engine)
BEGIN_NOLOAD(engine) BEGIN_NOLOAD(engine)
@ -474,6 +488,7 @@ SECTIONS
BUILD_DIR/src/engine/surface_collision.o(.bss*); BUILD_DIR/src/engine/surface_collision.o(.bss*);
BUILD_DIR/src/engine/surface_load.o(.bss*); BUILD_DIR/src/engine/surface_load.o(.bss*);
BUILD_DIR/src/engine/behavior_script.o(.bss*); BUILD_DIR/src/engine/behavior_script.o(.bss*);
BUILD_DIR/src/engine*.o(.bss*);
} }
END_NOLOAD(engine) END_NOLOAD(engine)
@ -540,10 +555,11 @@ SECTIONS
/* 0x8016F000 21D7D0-255EC0 [386F0] */ /* 0x8016F000 21D7D0-255EC0 [386F0] */
BEGIN_SEG(goddard, SEG_GODDARD) BEGIN_SEG(goddard, SEG_GODDARD)
{ {
BUILD_DIR/src/game/level_select_menu.o(.text); BUILD_DIR/src/menu/level_select_menu.o(.text);
BUILD_DIR/src/game/intro_geo.o(.text); BUILD_DIR/src/menu/intro_geo.o(.text);
BUILD_DIR/src/game/file_select.o(.text); BUILD_DIR/src/menu/file_select.o(.text);
BUILD_DIR/src/game/star_select.o(.text); BUILD_DIR/src/menu/star_select.o(.text);
BUILD_DIR/src/menu*.o(.text);
BUILD_DIR/libgoddard.a:gd_main.o(.text); BUILD_DIR/libgoddard.a:gd_main.o(.text);
BUILD_DIR/libgoddard.a:gd_memory.o(.text); BUILD_DIR/libgoddard.a:gd_memory.o(.text);
BUILD_DIR/libgoddard.a:sfx.o(.text); BUILD_DIR/libgoddard.a:sfx.o(.text);
@ -559,14 +575,17 @@ SECTIONS
BUILD_DIR/libgoddard.a:gd_math.o(.text); BUILD_DIR/libgoddard.a:gd_math.o(.text);
BUILD_DIR/libgoddard.a:shape_helper.o(.text); BUILD_DIR/libgoddard.a:shape_helper.o(.text);
BUILD_DIR/libgoddard.a:renderer.o(.text); BUILD_DIR/libgoddard.a:renderer.o(.text);
BUILD_DIR/libgoddard.a:*.o(.text);
/* data, rodata, per file */ /* data, rodata, per file */
BUILD_DIR/src/game/level_select_menu.o(.data*); BUILD_DIR/src/menu/level_select_menu.o(.data*);
BUILD_DIR/src/game/level_select_menu.o(.rodata*); BUILD_DIR/src/menu/level_select_menu.o(.rodata*);
BUILD_DIR/src/game/intro_geo.o(.data*); BUILD_DIR/src/menu/intro_geo.o(.data*);
BUILD_DIR/src/game/file_select.o(.data*); BUILD_DIR/src/menu/file_select.o(.data*);
BUILD_DIR/src/game/file_select.o(.rodata*); BUILD_DIR/src/menu/file_select.o(.rodata*);
BUILD_DIR/src/game/star_select.o(.data*); BUILD_DIR/src/menu/star_select.o(.data*);
BUILD_DIR/src/game/star_select.o(.rodata*); BUILD_DIR/src/menu/star_select.o(.rodata*);
BUILD_DIR/src/menu*.o(.data*);
BUILD_DIR/src/menu*.o(.rodata*);
/* goddard subsystem data */ /* goddard subsystem data */
BUILD_DIR/libgoddard.a:gd_main.o(.data*); BUILD_DIR/libgoddard.a:gd_main.o(.data*);
BUILD_DIR/libgoddard.a:draw_objects.o(.data*); BUILD_DIR/libgoddard.a:draw_objects.o(.data*);
@ -598,9 +617,10 @@ SECTIONS
END_SEG(goddard) END_SEG(goddard)
BEGIN_NOLOAD(goddard) BEGIN_NOLOAD(goddard)
{ {
BUILD_DIR/src/game/intro_geo.o(.bss*); BUILD_DIR/src/menu/intro_geo.o(.bss*);
BUILD_DIR/src/game/file_select.o(.bss*); BUILD_DIR/src/menu/file_select.o(.bss*);
BUILD_DIR/src/game/star_select.o(.bss*); BUILD_DIR/src/menu/star_select.o(.bss*);
BUILD_DIR/src/menu*.o(.bss*);
BUILD_DIR/libgoddard.a:gd_main.o(.bss*); BUILD_DIR/libgoddard.a:gd_main.o(.bss*);
BUILD_DIR/libgoddard.a:gd_memory.o(.bss*); BUILD_DIR/libgoddard.a:gd_memory.o(.bss*);
BUILD_DIR/libgoddard.a:sfx.o(.bss*); BUILD_DIR/libgoddard.a:sfx.o(.bss*);
@ -615,6 +635,7 @@ SECTIONS
BUILD_DIR/libgoddard.a:skin.o(.bss*); BUILD_DIR/libgoddard.a:skin.o(.bss*);
BUILD_DIR/libgoddard.a:shape_helper.o(.bss*); BUILD_DIR/libgoddard.a:shape_helper.o(.bss*);
BUILD_DIR/libgoddard.a:renderer.o(.bss*); BUILD_DIR/libgoddard.a:renderer.o(.bss*);
BUILD_DIR/libgoddard.a:*.o(.bss*);
} }
END_NOLOAD(goddard) END_NOLOAD(goddard)
@ -623,13 +644,14 @@ SECTIONS
. = SEG_BUFFERS; . = SEG_BUFFERS;
BEGIN_NOLOAD(buffers) BEGIN_NOLOAD(buffers)
{ {
BUILD_DIR/src/game/buffers.o(.bss*); BUILD_DIR/src/buffers/buffers.o(.bss*);
BUILD_DIR/src/audio/globals_start.o(.bss*); BUILD_DIR/src/audio/globals_start.o(.bss*);
BUILD_DIR/src/audio/synthesis.o(.bss*); BUILD_DIR/src/audio/synthesis.o(.bss*);
BUILD_DIR/src/audio/memory.o(.bss*); BUILD_DIR/src/audio/memory.o(.bss*);
BUILD_DIR/src/audio/load.o(.bss*); BUILD_DIR/src/audio/load.o(.bss*);
BUILD_DIR/src/audio/data.o(.bss*); BUILD_DIR/src/audio/data.o(.bss*);
BUILD_DIR/src/audio/globals_end.o(.bss*); BUILD_DIR/src/audio/globals_end.o(.bss*);
BUILD_DIR/src/audio*.o(.bss*);
BUILD_DIR/data/gfx_output_buffer.o(.bss*); BUILD_DIR/data/gfx_output_buffer.o(.bss*);
} }
END_NOLOAD(buffers) END_NOLOAD(buffers)
@ -673,6 +695,8 @@ SECTIONS
BUILD_DIR/libgoddard.a:anim_group_2.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_test_cube.o(.rodata);
BUILD_DIR/libgoddard.a:dynlist_unused.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) END_SEG(gd_dynlists)

File diff suppressed because it is too large Load Diff

View File

@ -112,17 +112,17 @@ u8 sDialogSpeaker[170] = {
#undef _ #undef _
s32 sDialogSpeakerVoice[15] = { s32 sDialogSpeakerVoice[15] = {
SOUND_UKIKI_CHATTER_LONG, SOUND_OBJ_UKIKI_CHATTER_LONG,
SOUND_BIG_PENGUIN_YELL, SOUND_OBJ_BIG_PENGUIN_YELL,
SOUND_OBJECT_BOWSERINTROLAUGH, SOUND_OBJ_BOWSER_INTRO_LAUGH,
SOUND_OBJECT_KOOPA, SOUND_OBJ_KOOPA_TALK,
SOUND_OBJECT_KINGBOBOMB, SOUND_OBJ_KING_BOBOMB_TALK,
SOUND_BOO_LAUGH_LONG, SOUND_OBJ_BOO_LAUGH_LONG,
SOUND_OBJECT_BOBOMBBUDDY, SOUND_OBJ_BOBOMB_BUDDY_TALK,
SOUND_OBJECT_BOWSERLAUGH, SOUND_OBJ_BOWSER_LAUGH,
SOUND_BOSS_DIALOG_GRUNT, SOUND_OBJ2_BOSS_DIALOG_GRUNT,
SOUND_WIGGLER_DIALOG, SOUND_OBJ_WIGGLER_TALK,
SOUND_GENERAL_YOSHI, SOUND_GENERAL_YOSHI_TALK,
NO_SOUND, NO_SOUND,
NO_SOUND, NO_SOUND,
NO_SOUND, NO_SOUND,
@ -545,7 +545,7 @@ void unused_8031E568(void) {
/** /**
* Fade out a sequence player * Fade out a sequence player
*/ */
static void sequence_player_fade_out(s32 player, FadeT fadeOutTime) { static void sequence_player_fade_out_internal(s32 player, FadeT fadeOutTime) {
struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; struct SequencePlayer *seqPlayer = &gSequencePlayers[player];
#ifndef VERSION_JP #ifndef VERSION_JP
if (fadeOutTime == 0) { if (fadeOutTime == 0) {
@ -694,9 +694,9 @@ struct SPTask *create_next_audio_frame_task(void) {
task->type = M_AUDTASK; task->type = M_AUDTASK;
task->flags = flags; task->flags = flags;
task->ucode_boot = rspF3DBootStart; task->ucode_boot = rspF3DBootStart;
task->ucode_boot_size = (u32) rspF3DBootEnd - (u32) rspF3DBootStart; task->ucode_boot_size = (u8 *) rspF3DBootEnd - (u8 *) rspF3DBootStart;
task->ucode = rspAspMainStart; task->ucode = rspAspMainStart;
task->ucode_size = 0x800; task->ucode_size = 0x800; // (this size is ignored)
task->ucode_data = rspAspMainDataStart; task->ucode_data = rspAspMainDataStart;
task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64); task->ucode_data_size = (rspAspMainDataEnd - rspAspMainDataStart) * sizeof(u64);
task->dram_stack = NULL; task->dram_stack = NULL;
@ -1169,7 +1169,7 @@ void update_game_sound(void) {
*gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z); *gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z);
if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID) if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID)
== (SOUND_UNKNOWN_UNK1417 & SOUNDARGS_MASK_SOUNDID)) { == (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
ret = get_sound_freq_scale(bankIndex, index); ret = get_sound_freq_scale(bankIndex, index);
gSequencePlayers[2].channels[channelIndex]->freqScale = gSequencePlayers[2].channels[channelIndex]->freqScale =
((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret; ((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret;
@ -1261,7 +1261,7 @@ void update_game_sound(void) {
*gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z); *gSoundBanks[bankIndex][index].x, *gSoundBanks[bankIndex][index].z);
if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID) if ((gSoundBanks[bankIndex][index].soundBits & SOUNDARGS_MASK_SOUNDID)
== (SOUND_UNKNOWN_UNK1417 & SOUNDARGS_MASK_SOUNDID)) { == (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
ret = get_sound_freq_scale(bankIndex, index); ret = get_sound_freq_scale(bankIndex, index);
gSequencePlayers[2].channels[channelIndex]->freqScale = gSequencePlayers[2].channels[channelIndex]->freqScale =
((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret; ((f32) D_80363808[bankIndex] / US_FLOAT(80.0)) + ret;
@ -1349,11 +1349,11 @@ void play_sequence(u8 player, u8 seqId, u16 fadeTimer) {
} }
} }
void func_8031F7CC(u8 player, u16 fadeTimer) { void sequence_player_fade_out(u8 player, u16 fadeTimer) {
if (player == 0) { if (player == 0) {
gPlayer0CurSeqId = SEQUENCE_NONE; gPlayer0CurSeqId = SEQUENCE_NONE;
} }
sequence_player_fade_out(player, fadeTimer); sequence_player_fade_out_internal(player, fadeTimer);
} }
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer) { void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer) {
@ -1404,7 +1404,6 @@ void process_level_music_dynamics(void) {
s16 dur2; // sp38 s16 dur2; // sp38
u32 conditionBits; // s0 u32 conditionBits; // s0
u32 tempBits; // v1 u32 tempBits; // v1
s32 numConditions; // v1
u16 bit; // a1 u16 bit; // a1
u8 condIndex; // a0 (same as numConditions?) u8 condIndex; // a0 (same as numConditions?)
u8 i; // s1 u8 i; // s1
@ -1439,63 +1438,62 @@ void process_level_music_dynamics(void) {
} }
} }
numConditions = condIndex; for (j = 0; j < condIndex; j++) {
for (j = 0; j < numConditions; j++) {
// (having all 'temp' share a single variable affects regalloc) // (having all 'temp' share a single variable affects regalloc)
UNUSED s16 temp; UNUSED s16 temp;
switch (conditionTypes[j]) { switch (conditionTypes[j]) {
case MARIO_X_GE: { case MARIO_X_GE: {
s16 temp = gMarioStates[0].pos[0]; s16 temp = gMarioStates[0].pos[0];
if (temp < conditionValues[j]) if (temp < conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_Y_GE: { case MARIO_Y_GE: {
s16 temp = gMarioStates[0].pos[1]; s16 temp = gMarioStates[0].pos[1];
if (temp < conditionValues[j]) if (temp < conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_Z_GE: { case MARIO_Z_GE: {
s16 temp = gMarioStates[0].pos[2]; s16 temp = gMarioStates[0].pos[2];
if (temp < conditionValues[j]) if (temp < conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_X_LT: { case MARIO_X_LT: {
s16 temp = gMarioStates[0].pos[0]; s16 temp = gMarioStates[0].pos[0];
if (temp >= conditionValues[j]) if (temp >= conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_Y_LT: { case MARIO_Y_LT: {
s16 temp = gMarioStates[0].pos[1]; s16 temp = gMarioStates[0].pos[1];
if (temp >= conditionValues[j]) if (temp >= conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_Z_LT: { case MARIO_Z_LT: {
s16 temp = gMarioStates[0].pos[2]; s16 temp = gMarioStates[0].pos[2];
if (temp >= conditionValues[j]) if (temp >= conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_IS_IN_AREA: { case MARIO_IS_IN_AREA: {
s16 temp = gCurrAreaIndex; s16 temp = gCurrAreaIndex;
if (temp != conditionValues[j]) if (temp != conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
case MARIO_IS_IN_ROOM: { case MARIO_IS_IN_ROOM: {
s16 temp = gMarioCurrentRoom; s16 temp = gMarioCurrentRoom;
if (temp != conditionValues[j]) if (temp != conditionValues[j])
j = numConditions + 1; j = condIndex + 1;
break; break;
} }
} }
} }
if (j == numConditions) { if (j == condIndex) {
// The area matches. Break out of the loop. // The area matches. Break out of the loop.
tempBits = 0; tempBits = 0;
} else { } else {
@ -1565,7 +1563,7 @@ void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2) {
} }
} }
void func_80320040(u8 player, u16 fadeTimer) { void sequence_player_unlower(u8 player, u16 fadeTimer) {
sCapVolumeTo40 = FALSE; sCapVolumeTo40 = FALSE;
if (player == 0) { if (player == 0) {
if (gSequencePlayers[player].state != SEQUENCE_PLAYER_STATE_FADE_OUT) { if (gSequencePlayers[player].state != SEQUENCE_PLAYER_STATE_FADE_OUT) {
@ -1799,17 +1797,17 @@ void func_80320A4C(u8 bankIndex, u8 arg1) {
D_80363808[bankIndex] = arg1; D_80363808[bankIndex] = arg1;
} }
void play_dialog_sound(u8 dialogId) { void play_dialog_sound(u8 dialogID) {
u8 speaker; u8 speaker;
if (dialogId >= 170) { if (dialogID >= 170) {
dialogId = 0; dialogID = 0;
} }
speaker = sDialogSpeaker[dialogId]; speaker = sDialogSpeaker[dialogID];
if (speaker != 0xff) { if (speaker != 0xff) {
play_sound(sDialogSpeakerVoice[speaker], gDefaultSoundArgs); play_sound(sDialogSpeakerVoice[speaker], gDefaultSoundArgs);
if (speaker == 2) // SOUND_OBJECT_BOWSERINTROLAUGH if (speaker == 2) // SOUND_OBJ_BOWSER_INTRO_LAUGH
{ {
play_sequence(1, SEQ_EVENT_KOOPA_MESSAGE, 0); play_sequence(1, SEQ_EVENT_KOOPA_MESSAGE, 0);
} }
@ -1817,7 +1815,7 @@ void play_dialog_sound(u8 dialogId) {
#ifndef VERSION_JP #ifndef VERSION_JP
// "You've stepped on the (Wing|Metal|Vanish) Cap Switch" // "You've stepped on the (Wing|Metal|Vanish) Cap Switch"
if (dialogId == 10 || dialogId == 11 || dialogId == 12) { if (dialogID == 10 || dialogID == 11 || dialogID == 12) {
play_puzzle_jingle(); play_puzzle_jingle();
} }
#endif #endif
@ -1904,7 +1902,7 @@ void stop_background_music(u16 seqId) {
if (sBackgroundMusicQueueSize != 0) { if (sBackgroundMusicQueueSize != 0) {
play_sequence(0, sBackgroundMusicQueue[1].seqId, 0); play_sequence(0, sBackgroundMusicQueue[1].seqId, 0);
} else { } else {
func_8031F7CC(0, 20); sequence_player_fade_out(0, 20);
} }
} }
foundIndex = i; foundIndex = i;
@ -1925,7 +1923,7 @@ void stop_background_music(u16 seqId) {
void fadeout_background_music(u16 seqId, u16 fadeOut) { void fadeout_background_music(u16 seqId, u16 fadeOut) {
if (sBackgroundMusicQueueSize != 0 && sBackgroundMusicQueue[0].seqId == (u8)(seqId & 0xff)) { if (sBackgroundMusicQueueSize != 0 && sBackgroundMusicQueue[0].seqId == (u8)(seqId & 0xff)) {
func_8031F7CC(0, fadeOut); sequence_player_fade_out(0, fadeOut);
} }
} }
@ -1990,7 +1988,7 @@ void func_80321080(u16 fadeTimer) {
D_80332120 = 0; D_80332120 = 0;
D_80332124 = 0; D_80332124 = 0;
func_803200E4(fadeTimer); func_803200E4(fadeTimer);
func_8031F7CC(1, fadeTimer); sequence_player_fade_out(1, fadeTimer);
} }
} }
@ -2002,10 +2000,10 @@ void func_803210D4(u16 fadeOutTime) {
} }
if (gSequencePlayers[0].enabled == TRUE) { if (gSequencePlayers[0].enabled == TRUE) {
sequence_player_fade_out(0, fadeOutTime); sequence_player_fade_out_internal(0, fadeOutTime);
} }
if (gSequencePlayers[1].enabled == TRUE) { if (gSequencePlayers[1].enabled == TRUE) {
sequence_player_fade_out(1, fadeOutTime); sequence_player_fade_out_internal(1, fadeOutTime);
} }
for (i = 0; i < SOUND_BANK_COUNT; i++) { for (i = 0; i < SOUND_BANK_COUNT; i++) {

View File

@ -20,10 +20,10 @@ extern u8 gAudioSPTaskYieldBuffer[]; // ucode yield data ptr; only used in JP
struct SPTask *create_next_audio_frame_task(void); struct SPTask *create_next_audio_frame_task(void);
void play_sound(s32 soundBits, f32 *pos); void play_sound(s32 soundBits, f32 *pos);
void audio_signal_game_loop_tick(void); void audio_signal_game_loop_tick(void);
void func_8031F7CC(u8 player, u16 fadeTimer); void sequence_player_fade_out(u8 player, u16 fadeTimer);
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer); void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer);
void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2); void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2);
void func_80320040(u8 player, u16 fadeTimer); void sequence_player_unlower(u8 player, u16 fadeTimer);
void set_sound_disabled(u8 disabled); void set_sound_disabled(u8 disabled);
void sound_init(void); void sound_init(void);
void func_803205E8(u32 soundBits, f32 *vec); void func_803205E8(u32 soundBits, f32 *vec);
@ -32,7 +32,7 @@ void func_80320890(void);
void sound_banks_disable(u8 player, u16 bankMask); void sound_banks_disable(u8 player, u16 bankMask);
void sound_banks_enable(u8 player, u16 bankMask); void sound_banks_enable(u8 player, u16 bankMask);
void func_80320A4C(u8 bankIndex, u8 arg1); void func_80320A4C(u8 bankIndex, u8 arg1);
void play_dialog_sound(u8 dialogId); void play_dialog_sound(u8 dialogID);
void play_music(u8 player, u16 seqArgs, s16 fadeTimer); void play_music(u8 player, u16 seqArgs, s16 fadeTimer);
void stop_background_music(u16 seqId); void stop_background_music(u16 seqId);
void fadeout_background_music(u16 arg0, u16 fadeOut); void fadeout_background_music(u16 arg0, u16 fadeOut);

View File

@ -220,8 +220,8 @@ struct SequencePlayer
/*0x11C*/ OSIoMesg bankDmaIoMesg; /*0x11C*/ OSIoMesg bankDmaIoMesg;
/*0x130*/ u8 *bankDmaCurrMemAddr; /*0x130*/ u8 *bankDmaCurrMemAddr;
/*0x134*/ struct AudioBank *loadingBank; /*0x134*/ struct AudioBank *loadingBank;
/*0x138*/ u32 bankDmaCurrDevAddr; /*0x138*/ uintptr_t bankDmaCurrDevAddr;
/*0x13C*/ s32 bankDmaRemaining; /*0x13C*/ ssize_t bankDmaRemaining;
}; // size = 0x140 }; // size = 0x140
struct AdsrSettings struct AdsrSettings

View File

@ -10,7 +10,7 @@
struct SharedDma { struct SharedDma {
/*0x0*/ u8 *buffer; // target, points to pre-allocated buffer /*0x0*/ u8 *buffer; // target, points to pre-allocated buffer
/*0x4*/ u32 source; // device address /*0x4*/ uintptr_t source; // device address
/*0x8*/ u16 sizeUnused; // set to bufSize, never read /*0x8*/ u16 sizeUnused; // set to bufSize, never read
/*0xA*/ u16 bufSize; /*0xA*/ u16 bufSize;
/*0xC*/ u8 unused2; // set to 0, never read /*0xC*/ u8 unused2; // set to 0, never read
@ -69,8 +69,8 @@ extern u8 gBankSetsData[]; // bank_sets.s
/** /**
* Performs an immediate DMA copy * Performs an immediate DMA copy
*/ */
void audio_dma_copy_immediate(u32 devAddr, void *vAddr, u32 nbytes) { void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes) {
osInvalDCache(vAddr, (s32) nbytes); osInvalDCache(vAddr, nbytes);
osPiStartDma(&gAudioDmaIoMesg, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes, osPiStartDma(&gAudioDmaIoMesg, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes,
&gAudioDmaMesgQueue); &gAudioDmaMesgQueue);
osRecvMesg(&gAudioDmaMesgQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&gAudioDmaMesgQueue, NULL, OS_MESG_BLOCK);
@ -79,8 +79,8 @@ void audio_dma_copy_immediate(u32 devAddr, void *vAddr, u32 nbytes) {
/** /**
* Performs an asynchronus (normal priority) DMA copy * Performs an asynchronus (normal priority) DMA copy
*/ */
void audio_dma_copy_async(u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *queue, OSIoMesg *mesg) { void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *queue, OSIoMesg *mesg) {
osInvalDCache(vAddr, (s32) nbytes); osInvalDCache(vAddr, nbytes);
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue); osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue);
} }
@ -88,9 +88,9 @@ void audio_dma_copy_async(u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *que
* Performs a partial asynchronous (normal priority) DMA copy. This is limited * Performs a partial asynchronous (normal priority) DMA copy. This is limited
* to 0x1000 bytes transfer at once. * to 0x1000 bytes transfer at once.
*/ */
void audio_dma_partial_copy_async(u32 *devAddr, u8 **vAddr, s32 *remaining, OSMesgQueue *queue, void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue,
OSIoMesg *mesg) { OSIoMesg *mesg) {
s32 transfer = (*remaining < 0x1000 ? *remaining : 0x1000); ssize_t transfer = (*remaining < 0x1000 ? *remaining : 0x1000);
*remaining -= transfer; *remaining -= transfer;
osInvalDCache(*vAddr, transfer); osInvalDCache(*vAddr, transfer);
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, *devAddr, *vAddr, transfer, queue); osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, *devAddr, *vAddr, transfer, queue);
@ -129,7 +129,7 @@ void decrease_sample_dma_ttls() {
#ifdef NON_MATCHING #ifdef NON_MATCHING
void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) { void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
s32 bufferPos; // v0 ssize_t bufferPos; // v0
struct SharedDma *dma; // sp58, v1, t0 struct SharedDma *dma; // sp58, v1, t0
u32 transfer; // v0 u32 transfer; // v0
u32 dmaDevAddr; // s0 u32 dmaDevAddr; // s0
@ -141,8 +141,8 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
if (arg2 != 0 || *arg3 >= sSampleDmaListSize1) { if (arg2 != 0 || *arg3 >= sSampleDmaListSize1) {
for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) { for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) {
dma = sSampleDmas + i; dma = sSampleDmas + i;
bufferPos = (u32) devAddr - dma->source; bufferPos = (uintptr_t) devAddr - dma->source;
if (0 <= bufferPos && (u32) bufferPos <= dma->bufSize - size) { if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
// We already have a DMA request for this memory range. // We already have a DMA request for this memory range.
if (dma->ttl == 0 && sSampleDmaReuseQueueHead2 != sSampleDmaReuseQueueTail2) { if (dma->ttl == 0 && sSampleDmaReuseQueueHead2 != sSampleDmaReuseQueueTail2) {
// Move the DMA out of the reuse queue, by swapping it with the // Move the DMA out of the reuse queue, by swapping it with the
@ -157,7 +157,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
} }
dma->ttl = 60; dma->ttl = 60;
*arg3 = (u8) i; *arg3 = (u8) i;
bufferPos = (u32) devAddr - dma->source; bufferPos = (uintptr_t) devAddr - dma->source;
return dma->buffer + bufferPos; return dma->buffer + bufferPos;
} }
} }
@ -171,8 +171,8 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
} }
} else { } else {
dma = &sSampleDmas[*arg3]; dma = &sSampleDmas[*arg3];
bufferPos = (u32) devAddr - dma->source; bufferPos = (uintptr_t) devAddr - dma->source;
if (0 <= bufferPos && (u32) bufferPos <= dma->bufSize - size) { if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) {
// We already have DMA for this memory range. // We already have DMA for this memory range.
if (dma->ttl == 0) { if (dma->ttl == 0) {
// Move the DMA out of the reuse queue, by swapping it with the // Move the DMA out of the reuse queue, by swapping it with the
@ -184,7 +184,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
dma->reuseIndex; dma->reuseIndex;
} }
sSampleDmaReuseQueueTail1++; sSampleDmaReuseQueueTail1++;
bufferPos = (u32) devAddr - dma->source; bufferPos = (uintptr_t) devAddr - dma->source;
} }
dma->ttl = 2; dma->ttl = 2;
return dma->buffer + bufferPos; return dma->buffer + bufferPos;
@ -200,7 +200,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
} }
transfer = dma->bufSize; transfer = dma->bufSize;
dmaDevAddr = (u32) devAddr & ~0xF; dmaDevAddr = (uintptr_t) devAddr & ~0xF;
dma->ttl = 2; dma->ttl = 2;
dma->source = dmaDevAddr; dma->source = dmaDevAddr;
dma->sizeUnused = transfer; dma->sizeUnused = transfer;
@ -211,7 +211,7 @@ void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3) {
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL, osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL,
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue); OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
*arg3 = dmaIndex; *arg3 = dmaIndex;
return dma->buffer + (u32) devAddr - dmaDevAddr; return dma->buffer + (uintptr_t) devAddr - dmaDevAddr;
} }
#elif defined(VERSION_JP) #elif defined(VERSION_JP)
@ -301,8 +301,8 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
struct Instrument *instrument; struct Instrument *instrument;
struct Instrument **itInstrs; struct Instrument **itInstrs;
u32 i; u32 i;
u32 memBase = (u32) mem; uintptr_t memBase = (uintptr_t) mem;
u32 offsetBase = (u32) offset; uintptr_t offsetBase = (uintptr_t) offset;
#define INIT_SOUND(sound) \ #define INIT_SOUND(sound) \
{ \ { \
@ -315,16 +315,16 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
* Presumably sample and sample2 ought to have different types, \ * Presumably sample and sample2 ought to have different types, \
* but that doesn't matter for codegen. */ \ * but that doesn't matter for codegen. */ \
volatile struct AudioBankSample *sample, *sample2; \ volatile struct AudioBankSample *sample, *sample2; \
*itSample = (void *) (memBase + (u32)(*itSample)); \ *itSample = (void *) (memBase + (uintptr_t)(*itSample)); \
sample = *itSample; \ sample = *itSample; \
sample2 = *itSample; \ sample2 = *itSample; \
if (sample2->loaded == FALSE) { \ if (sample2->loaded == FALSE) { \
void *a = sample2->sampleAddr; \ void *a = sample2->sampleAddr; \
void *b = sample->loop; \ void *b = sample->loop; \
void *c = sample->book; \ void *c = sample->book; \
sample->sampleAddr = (void *) (offsetBase + (u32) a); \ sample->sampleAddr = (void *) (offsetBase + (uintptr_t) a); \
sample->loop = (void *) (memBase + (u32) b); \ sample->loop = (void *) (memBase + (uintptr_t) b); \
sample->book = (void *) (memBase + (u32) c); \ sample->book = (void *) (memBase + (uintptr_t) c); \
sample->loaded = TRUE; \ sample->loaded = TRUE; \
} \ } \
} \ } \
@ -332,7 +332,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
if (mem->drums != NULL) { if (mem->drums != NULL) {
if (numDrums != 0) { if (numDrums != 0) {
mem->drums = (struct Drum **) (memBase + (u32) mem->drums); mem->drums = (struct Drum **) (memBase + (uintptr_t) mem->drums);
if (numDrums != 0) { if (numDrums != 0) {
for (i = 0; i < numDrums; i++) { for (i = 0; i < numDrums; i++) {
#if 0 #if 0
@ -342,7 +342,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
struct Drum **h = &mem->drums[i]; struct Drum **h = &mem->drums[i];
if (*h == 0) continue; if (*h == 0) continue;
{ {
*h = (void *)(memBase + (u32)*h); *h = (void *)(memBase + (uintptr_t)*h);
drum = *h; drum = *h;
drum2 = *h; drum2 = *h;
if (drum2->loaded == FALSE) if (drum2->loaded == FALSE)
@ -351,7 +351,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
INIT_SOUND(((struct Drum *)drum2)->sound); INIT_SOUND(((struct Drum *)drum2)->sound);
d = drum2->envelope; d = drum2->envelope;
drum->loaded = TRUE; drum->loaded = TRUE;
drum->envelope = (void *) (memBase + (u32)d); drum->envelope = (void *) (memBase + (uintptr_t)d);
} }
} }
#else #else
@ -359,7 +359,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
// deduplicates it -- drum and drum2 end up in the same // deduplicates it -- drum and drum2 end up in the same
// register. // register.
struct Drum **drums = mem->drums; struct Drum **drums = mem->drums;
u32 h = (u32) drums[i]; uintptr_t h = (uintptr_t) drums[i];
if (h != 0) { if (h != 0) {
volatile struct Drum *drum, *drum2; volatile struct Drum *drum, *drum2;
drums[i] = (struct Drum *) (memBase + h); drums[i] = (struct Drum *) (memBase + h);
@ -370,7 +370,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
INIT_SOUND(((struct Drum *) drum)->sound); INIT_SOUND(((struct Drum *) drum)->sound);
d = drum->envelope; d = drum->envelope;
drum2->loaded = TRUE; drum2->loaded = TRUE;
drum2->envelope = (void *) (memBase + (u32) d); drum2->envelope = (void *) (memBase + (uintptr_t) d);
} }
} }
#endif #endif
@ -383,7 +383,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
itInstrs = mem->instruments; itInstrs = mem->instruments;
do { do {
if (*itInstrs) { if (*itInstrs) {
*itInstrs = (void *) (memBase + (u32) *itInstrs); *itInstrs = (void *) (memBase + (uintptr_t) *itInstrs);
instrument = *itInstrs; instrument = *itInstrs;
if (instrument->loaded == FALSE) { if (instrument->loaded == FALSE) {
@ -392,7 +392,7 @@ void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 nu
INIT_SOUND(instrument->highNotesSound); INIT_SOUND(instrument->highNotesSound);
instrument->loaded = TRUE; instrument->loaded = TRUE;
instrument->envelope = (void *) (memBase + (u32) instrument->envelope); instrument->envelope = (void *) (memBase + (uintptr_t) instrument->envelope);
} }
} }
itInstrs++; itInstrs++;
@ -424,10 +424,10 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) {
return NULL; return NULL;
} }
audio_dma_copy_immediate((u32) ctlData, buf, 0x10); audio_dma_copy_immediate((uintptr_t) ctlData, buf, 0x10);
numInstruments = buf[0]; numInstruments = buf[0];
numDrums = buf[1]; numDrums = buf[1];
audio_dma_copy_immediate((u32)(ctlData + 0x10), ret, alloc); audio_dma_copy_immediate((uintptr_t)(ctlData + 0x10), ret, alloc);
func_8031784C(ret, gAlTbl->seqArray[bankId].offset, numInstruments, numDrums); func_8031784C(ret, gAlTbl->seqArray[bankId].offset, numInstruments, numDrums);
gCtlEntries[bankId].numInstruments = (u8) numInstruments; gCtlEntries[bankId].numInstruments = (u8) numInstruments;
gCtlEntries[bankId].numDrums = (u8) numDrums; gCtlEntries[bankId].numDrums = (u8) numDrums;
@ -442,7 +442,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
UNUSED u32 pad1[2]; UNUSED u32 pad1[2];
u32 buf[4]; u32 buf[4];
UNUSED u32 pad2; UNUSED u32 pad2;
s32 alloc; size_t alloc;
struct AudioBank *ret; struct AudioBank *ret;
u8 *ctlData; u8 *ctlData;
OSMesgQueue *mesgQueue; OSMesgQueue *mesgQueue;
@ -456,7 +456,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
return NULL; return NULL;
} }
audio_dma_copy_immediate((u32) ctlData, buf, 0x10); audio_dma_copy_immediate((uintptr_t) ctlData, buf, 0x10);
numInstruments = buf[0]; numInstruments = buf[0];
numDrums = buf[1]; numDrums = buf[1];
seqPlayer->loadingBankId = (u8) bankId; seqPlayer->loadingBankId = (u8) bankId;
@ -464,7 +464,7 @@ struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *s
seqPlayer->loadingBankNumDrums = numDrums; seqPlayer->loadingBankNumDrums = numDrums;
seqPlayer->bankDmaCurrMemAddr = (u8 *) ret; seqPlayer->bankDmaCurrMemAddr = (u8 *) ret;
seqPlayer->loadingBank = ret; seqPlayer->loadingBank = ret;
seqPlayer->bankDmaCurrDevAddr = (u32)(ctlData + 0x10); seqPlayer->bankDmaCurrDevAddr = (uintptr_t)(ctlData + 0x10);
seqPlayer->bankDmaRemaining = alloc; seqPlayer->bankDmaRemaining = alloc;
mesgQueue = &seqPlayer->bankDmaMesgQueue; mesgQueue = &seqPlayer->bankDmaMesgQueue;
osCreateMesgQueue(mesgQueue, &seqPlayer->bankDmaMesg, 1); osCreateMesgQueue(mesgQueue, &seqPlayer->bankDmaMesg, 1);
@ -489,7 +489,7 @@ void *sequence_dma_immediate(s32 seqId, s32 arg1) {
return NULL; return NULL;
} }
audio_dma_copy_immediate((u32) seqData, ptr, seqLength); audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength);
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE; gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE;
return ptr; return ptr;
} }
@ -510,15 +510,15 @@ void *sequence_dma_async(s32 seqId, s32 arg1, struct SequencePlayer *seqPlayer)
if (seqLength <= 0x40) { if (seqLength <= 0x40) {
// Immediately load short sequenece // Immediately load short sequenece
audio_dma_copy_immediate((u32) seqData, ptr, seqLength); audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength);
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE; gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_COMPLETE;
} else { } else {
audio_dma_copy_immediate((u32) seqData, ptr, 0x40); audio_dma_copy_immediate((uintptr_t) seqData, ptr, 0x40);
mesgQueue = &seqPlayer->seqDmaMesgQueue; mesgQueue = &seqPlayer->seqDmaMesgQueue;
osCreateMesgQueue(mesgQueue, &seqPlayer->seqDmaMesg, 1); osCreateMesgQueue(mesgQueue, &seqPlayer->seqDmaMesg, 1);
seqPlayer->seqDmaMesg = NULL; seqPlayer->seqDmaMesg = NULL;
seqPlayer->seqDmaInProgress = TRUE; seqPlayer->seqDmaInProgress = TRUE;
audio_dma_copy_async((u32)(seqData + 0x40), (u8 *) ptr + 0x40, seqLength - 0x40, mesgQueue, audio_dma_copy_async((uintptr_t)(seqData + 0x40), (u8 *) ptr + 0x40, seqLength - 0x40, mesgQueue,
&seqPlayer->seqDmaIoMesg); &seqPlayer->seqDmaIoMesg);
gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_IN_PROGRESS; gSeqLoadStatus[seqId] = SOUND_LOAD_STATUS_IN_PROGRESS;
} }
@ -702,7 +702,7 @@ void audio_init() {
} }
i = 0; i = 0;
lim3 = ((u32) &gAudioGlobalsEndMarker - (u32) &gAudioGlobalsStartMarker) / 8; lim3 = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker) / 8;
ptr64 = &gAudioGlobalsStartMarker - 1; ptr64 = &gAudioGlobalsStartMarker - 1;
for (k = lim3; k >= 0; k--) { for (k = lim3; k >= 0; k--) {
i++; i++;
@ -741,36 +741,36 @@ void audio_init() {
// Load header for sequence data (assets/music_data.sbk.s) // Load header for sequence data (assets/music_data.sbk.s)
gSeqFileHeader = (ALSeqFile *) buf; gSeqFileHeader = (ALSeqFile *) buf;
data = gMusicData; data = gMusicData;
audio_dma_copy_immediate((u32) data, gSeqFileHeader, 0x10); audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, 0x10);
gSequenceCount = gSeqFileHeader->seqCount; gSequenceCount = gSeqFileHeader->seqCount;
size = ALIGN16(gSequenceCount * sizeof(ALSeqData) + 4); size = ALIGN16(gSequenceCount * sizeof(ALSeqData) + 4);
gSeqFileHeader = soundAlloc(&gSoundPool, size); gSeqFileHeader = soundAlloc(&gSoundPool, size);
audio_dma_copy_immediate((u32) data, gSeqFileHeader, size); audio_dma_copy_immediate((uintptr_t) data, gSeqFileHeader, size);
alSeqFileNew(gSeqFileHeader, data); alSeqFileNew(gSeqFileHeader, data);
// Load header for CTL (assets/sound_data.ctl.s, i.e. ADSR) // Load header for CTL (assets/sound_data.ctl.s, i.e. ADSR)
gAlCtlHeader = (ALSeqFile *) buf; gAlCtlHeader = (ALSeqFile *) buf;
data = gSoundDataADSR; data = gSoundDataADSR;
audio_dma_copy_immediate((u32) data, gAlCtlHeader, 0x10); audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, 0x10);
size = gAlCtlHeader->seqCount * sizeof(ALSeqData) + 4; size = gAlCtlHeader->seqCount * sizeof(ALSeqData) + 4;
size = ALIGN16(size); size = ALIGN16(size);
gCtlEntries = soundAlloc(&gSoundPool, gAlCtlHeader->seqCount * sizeof(struct CtlEntry)); gCtlEntries = soundAlloc(&gSoundPool, gAlCtlHeader->seqCount * sizeof(struct CtlEntry));
gAlCtlHeader = soundAlloc(&gSoundPool, size); gAlCtlHeader = soundAlloc(&gSoundPool, size);
audio_dma_copy_immediate((u32) data, gAlCtlHeader, size); audio_dma_copy_immediate((uintptr_t) data, gAlCtlHeader, size);
alSeqFileNew(gAlCtlHeader, data); alSeqFileNew(gAlCtlHeader, data);
// Load header for TBL (assets/sound_data.tbl.s, i.e. raw data) // Load header for TBL (assets/sound_data.tbl.s, i.e. raw data)
gAlTbl = (ALSeqFile *) buf; gAlTbl = (ALSeqFile *) buf;
audio_dma_copy_immediate((u32) data, gAlTbl, 0x10); audio_dma_copy_immediate((uintptr_t) data, gAlTbl, 0x10);
size = gAlTbl->seqCount * sizeof(ALSeqData) + 4; size = gAlTbl->seqCount * sizeof(ALSeqData) + 4;
size = ALIGN16(size); size = ALIGN16(size);
gAlTbl = soundAlloc(&gSoundPool, size); gAlTbl = soundAlloc(&gSoundPool, size);
audio_dma_copy_immediate((u32) gSoundDataRaw, gAlTbl, size); audio_dma_copy_immediate((uintptr_t) gSoundDataRaw, gAlTbl, size);
alSeqFileNew(gAlTbl, gSoundDataRaw); alSeqFileNew(gAlTbl, gSoundDataRaw);
// Load bank sets for each sequence (assets/bank_sets.s) // Load bank sets for each sequence (assets/bank_sets.s)
gAlBankSets = soundAlloc(&gSoundPool, 0x100); gAlBankSets = soundAlloc(&gSoundPool, 0x100);
audio_dma_copy_immediate((u32) gBankSetsData, gAlBankSets, 0x100); audio_dma_copy_immediate((uintptr_t) gBankSetsData, gAlBankSets, 0x100);
func_8031D4B8(); func_8031D4B8();
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING; gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;

View File

@ -8,7 +8,7 @@
#define PRELOAD_BANKS 2 #define PRELOAD_BANKS 2
#define PRELOAD_SEQUENCE 1 #define PRELOAD_SEQUENCE 1
#define IS_SEQUENCE_CHANNEL_VALID(ptr) ((u32)(ptr) != (u32)&gSequenceChannelNone) #define IS_SEQUENCE_CHANNEL_VALID(ptr) ((uintptr_t)(ptr) != (uintptr_t)&gSequenceChannelNone)
extern struct Note *gNotes; extern struct Note *gNotes;
@ -36,11 +36,11 @@ extern u32 gSampleDmaNumListItems;
extern ALSeqFile *gAlTbl; extern ALSeqFile *gAlTbl;
extern u8 *gAlBankSets; extern u8 *gAlBankSets;
void audio_dma_partial_copy_async(u32 *devAddr, u8 **vAddr, s32 *remaining, OSMesgQueue *queue, OSIoMesg *mesg); void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg);
void decrease_sample_dma_ttls(void); void decrease_sample_dma_ttls(void);
void *dma_sample_data(u8 *arg0, u32 arg1, s32 arg2, u8 *arg3); void *dma_sample_data(u8 *devAddr, u32 size, s32 arg2, u8 *arg3);
void func_8031758C(s32 arg0); void func_8031758C(s32 arg0);
void func_8031784C(struct AudioBank *arg0, u8 *offset, u32 arg2, u32 arg3); void func_8031784C(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums);
void preload_sequence(u32 seqId, u8 preloadMask); void preload_sequence(u32 seqId, u8 preloadMask);
void load_sequence(u32 player, u32 seqId, s32 loadAsync); void load_sequence(u32 player, u32 seqId, s32 loadAsync);

View File

@ -109,7 +109,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
} }
void func_80316094(struct SoundAllocPool *pool, void *arg1, u32 arg2) { void func_80316094(struct SoundAllocPool *pool, void *arg1, u32 arg2) {
pool->cur = pool->start = (u8 *) (((u32) arg1 + 0xf) & -0x10); pool->cur = pool->start = (u8 *) (((uintptr_t) arg1 + 0xf) & -0x10);
pool->size = arg2; pool->size = arg2;
pool->unused = 0; pool->unused = 0;
} }
@ -376,27 +376,24 @@ void func_803168CC(void) {
void wait_for_audio_frames(s32 frames) { void wait_for_audio_frames(s32 frames) {
gActiveAudioFrames = 0; gActiveAudioFrames = 0;
// Sound thread will update gActiveAudioFrames // Sound thread will update gActiveAudioFrames
while (gActiveAudioFrames < frames) { /* spin */ while (gActiveAudioFrames < frames) {
// spin
} }
} }
#ifdef NON_MATCHING
#define frames s1
void func_80316928(struct Struct80332190 *arg0) { void func_80316928(struct Struct80332190 *arg0) {
// Wrong regalloc, and a lui which is too far up. s8 updatesPerFrame;
s32 sp2C;
s16 *mem; s16 *mem;
s32 i; // s0 s32 sp2C;
s32 i;
s32 j; s32 j;
s32 k; s32 k;
s32 persistentMem; s32 persistentMem;
s32 temporaryMem; s32 temporaryMem;
s32 totalMem; s32 totalMem;
s32 wantMisc; s32 wantMisc;
s32 s1; s32 frames;
s8 temp8; s32 remainingDmas;
s32 size;
UNUSED s32 temp;
if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) { if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
func_803168CC(); func_803168CC();
@ -412,7 +409,7 @@ void func_80316928(struct Struct80332190 *arg0) {
for (;;) { for (;;) {
wait_for_audio_frames(1); wait_for_audio_frames(1);
frames++; frames++;
if (frames > 8 * 30) { if (frames > 4 * 60) {
// Break after 4 seconds // Break after 4 seconds
break; break;
} }
@ -433,11 +430,11 @@ void func_80316928(struct Struct80332190 *arg0) {
gAudioLoadLock = AUDIO_LOCK_LOADING; gAudioLoadLock = AUDIO_LOCK_LOADING;
wait_for_audio_frames(3); wait_for_audio_frames(3);
s1 = gCurrAudioFrameDmaCount; remainingDmas = gCurrAudioFrameDmaCount;
while (s1 > 0) { while (remainingDmas > 0) {
for (i = 0; i < gCurrAudioFrameDmaCount; i++) { for (i = 0; i < gCurrAudioFrameDmaCount; i++) {
if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0) if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0)
s1--; remainingDmas--;
} }
} }
gCurrAudioFrameDmaCount = 0; gCurrAudioFrameDmaCount = 0;
@ -453,8 +450,7 @@ void func_80316928(struct Struct80332190 *arg0) {
sp2C = arg0->unk6; sp2C = arg0->unk6;
gAiFrequency = osAiSetFrequency(arg0->frequency); gAiFrequency = osAiSetFrequency(arg0->frequency);
gMaxSimultaneousNotes = arg0->maxSimultaneousNotes; gMaxSimultaneousNotes = arg0->maxSimultaneousNotes;
size = gAiFrequency / 60; D_80226D74 = ALIGN16(gAiFrequency / 60);
D_80226D74 = ALIGN16(size);
D_802212A2 = arg0->unk5; D_802212A2 = arg0->unk5;
switch (D_802212A2) { switch (D_802212A2) {
@ -480,21 +476,22 @@ void func_80316928(struct Struct80332190 *arg0) {
D_802212A2 = arg0->unk5; D_802212A2 = arg0->unk5;
D_802212A0 = arg0->volume; D_802212A0 = arg0->volume;
gMinAiBufferLength = D_80226D74 - 0x10; gMinAiBufferLength = D_80226D74 - 0x10;
temp8 = D_80226D74 / 160 + 1; updatesPerFrame = D_80226D74 / 160 + 1;
gAudioUpdatesPerFrame = temp8; gAudioUpdatesPerFrame = D_80226D74 / 160 + 1;
// Compute conversion ratio from the internal unit tatums/tick to the // Compute conversion ratio from the internal unit tatums/tick to the
// external beats/minute (JP) or tatums/minute (US). In practice this is // external beats/minute (JP) or tatums/minute (US). In practice this is
// 300 on JP and 14360 on US. // 300 on JP and 14360 on US.
#ifdef VERSION_JP #ifdef VERSION_JP
gTempoInternalToExternal = temp8 * 3600 / gTatumsPerBeat; gTempoInternalToExternal = updatesPerFrame * 3600 / gTatumsPerBeat;
#else #else
gTempoInternalToExternal = (u32)(temp8 * 2880000.0f / gTatumsPerBeat / 16.713f); gTempoInternalToExternal = (u32)(updatesPerFrame * 2880000.0f / gTatumsPerBeat / 16.713f);
#endif #endif
D_80226D6C = gMaxSimultaneousNotes * 20 * temp8 + 320;
D_80226D6C = gMaxSimultaneousNotes * 20 * updatesPerFrame + 320;
persistentMem = arg0->persistentBankMem + arg0->persistentSeqMem; persistentMem = arg0->persistentBankMem + arg0->persistentSeqMem;
temporaryMem = arg0->temporaryBankMem + arg0->temporarySeqMem; temporaryMem = arg0->temporaryBankMem + arg0->temporarySeqMem;
totalMem = persistentMem + temporaryMem; totalMem = persistentMem + temporaryMem;
// (the address of D_802212A8.size is lui'd too far up)
wantMisc = D_802212A8.size - totalMem - 0x100; wantMisc = D_802212A8.size - totalMem - 0x100;
D_80221898.wantSeq = wantMisc; D_80221898.wantSeq = wantMisc;
D_80221898.wantCustom = totalMem; D_80221898.wantCustom = totalMem;
@ -556,9 +553,3 @@ void func_80316928(struct Struct80332190 *arg0) {
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING; gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
} }
} }
#elif defined(VERSION_JP)
GLOBAL_ASM("asm/non_matchings/func_80316928_jp.s")
#else
GLOBAL_ASM("asm/non_matchings/func_80316928_us.s")
#endif

View File

@ -491,11 +491,11 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
} }
temp_v0_11 = &layer->adsr; temp_v0_11 = &layer->adsr;
if (((u32) gBankLoadedPool.persistent.pool.start <= (u32) inst if (((uintptr_t) gBankLoadedPool.persistent.pool.start <= (uintptr_t) inst
&& (u32) inst <= (u32)(gBankLoadedPool.persistent.pool.start && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.persistent.pool.start
+ gBankLoadedPool.persistent.pool.size)) + gBankLoadedPool.persistent.pool.size))
|| ((u32) gBankLoadedPool.temporary.pool.start <= (u32) inst || ((uintptr_t) gBankLoadedPool.temporary.pool.start <= (uintptr_t) inst
&& (u32) inst <= (u32)(gBankLoadedPool.temporary.pool.start && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start
+ gBankLoadedPool.temporary.pool.size))) { + gBankLoadedPool.temporary.pool.size))) {
temp_v0_11->envelope = inst->envelope; temp_v0_11->envelope = inst->envelope;
temp_v0_11->releaseRate = inst->releaseRate; temp_v0_11->releaseRate = inst->releaseRate;
@ -802,11 +802,11 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume
} }
} }
if (((u32) gBankLoadedPool.persistent.pool.start <= (u32) inst if (((uintptr_t) gBankLoadedPool.persistent.pool.start <= (uintptr_t) inst
&& (u32) inst && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.persistent.pool.start
<= (u32)(gBankLoadedPool.persistent.pool.start + gBankLoadedPool.persistent.pool.size)) + gBankLoadedPool.persistent.pool.size))
|| ((u32) gBankLoadedPool.temporary.pool.start <= (u32) inst || ((uintptr_t) gBankLoadedPool.temporary.pool.start <= (uintptr_t) inst
&& (u32) inst <= (u32)(gBankLoadedPool.temporary.pool.start && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start
+ gBankLoadedPool.temporary.pool.size))) { + gBankLoadedPool.temporary.pool.size))) {
adsr->envelope = inst->envelope; adsr->envelope = inst->envelope;
adsr->releaseRate = inst->releaseRate; adsr->releaseRate = inst->releaseRate;

View File

@ -10,18 +10,17 @@
#define aSetLoadBufferPair(pkt, c, off) \ #define aSetLoadBufferPair(pkt, c, off) \
aSetBuffer(pkt, 0, c + 0x740, 0, 0x140 - c); \ aSetBuffer(pkt, 0, c + 0x740, 0, 0x140 - c); \
aLoadBuffer(pkt, FIX(&D_802211B0.unk14.unk00[off])); \ aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk00[off])); \
aSetBuffer(pkt, 0, c + 0x880, 0, 0x140 - c); \ aSetBuffer(pkt, 0, c + 0x880, 0, 0x140 - c); \
aLoadBuffer(pkt, FIX(&D_802211B0.unk14.unk04[off])); aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk04[off]));
#define aSetSaveBufferPair(pkt, c, d, off) \ #define aSetSaveBufferPair(pkt, c, d, off) \
aSetBuffer(pkt, 0, 0, c + 0x740, d); \ aSetBuffer(pkt, 0, 0, c + 0x740, d); \
aSaveBuffer(pkt, FIX(&D_802211B0.unk14.unk00[off])); \ aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk00[off])); \
aSetBuffer(pkt, 0, 0, c + 0x880, d); \ aSetBuffer(pkt, 0, 0, c + 0x880, d); \
aSaveBuffer(pkt, FIX(&D_802211B0.unk14.unk04[off])); aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(&D_802211B0.unk14.unk04[off]));
#define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1)) #define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
#define FIX(a) (u16 *) ((u8 *) (a) + 0x80000000U)
struct Struct802211B0 D_802211B0; struct Struct802211B0 D_802211B0;
u8 sAudioSynthesisPad[0x20]; u8 sAudioSynthesisPad[0x20];
@ -174,9 +173,9 @@ u64 *func_80313E54(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
aSetLoadBufferPair(cmd++, ra, 0); aSetLoadBufferPair(cmd++, ra, 0);
} }
aSetBuffer(cmd++, 0, t4 + 0x740, 0x4c0, bufLen << 1); aSetBuffer(cmd++, 0, t4 + 0x740, 0x4c0, bufLen << 1);
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, FIX(D_802211B0.unk1C)); aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk1C));
aSetBuffer(cmd++, 0, t4 + 0x880, 0x600, bufLen << 1); aSetBuffer(cmd++, 0, t4 + 0x880, 0x600, bufLen << 1);
aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, FIX(D_802211B0.unk20)); aResample(cmd++, D_802211B0.unk0, (u16) D_802211B0.unk6, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk20));
aSetBuffer(cmd++, 0, 0, 0, 0x280); aSetBuffer(cmd++, 0, 0, 0, 0x280);
aMix(cmd++, 0, /*gain*/ D_802211B0.unk4 + 32768, /*in*/ 0x4c0, /*out*/ 0x4c0); aMix(cmd++, 0, /*gain*/ D_802211B0.unk4 + 32768, /*in*/ 0x4c0, /*out*/ 0x4c0);
aDMEMMove(cmd++, 0x4c0, 0x740, 0x280); aDMEMMove(cmd++, 0x4c0, 0x740, 0x280);
@ -189,7 +188,7 @@ u64 *func_80313E54(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
} }
} else { } else {
aSetBuffer(cmd++, 0, 0, 0x740, 0x280); aSetBuffer(cmd++, 0, 0, 0x740, 0x280);
aSaveBuffer(cmd++, FIX(D_802211B0.unk2C[D_802211B0.unk3][updateIndex].unk4)); aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(D_802211B0.unk2C[D_802211B0.unk3][updateIndex].unk4));
D_802211B0.unk0 = 0; D_802211B0.unk0 = 0;
} }
} }
@ -324,7 +323,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
u32 v1; u32 v1;
sp15C = sp164->book->book; sp15C = sp164->book->book;
v1 = sp164->book->order * sp164->book->npredictors; v1 = sp164->book->order * sp164->book->npredictors;
aLoadADPCM(cmd++, v1 * 16, FIX(sp15C)); aLoadADPCM(cmd++, v1 * 16, VIRTUAL_TO_PHYSICAL2(sp15C));
} }
while (fp != t5) { while (fp != t5) {
@ -369,27 +368,27 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
// maybe keep a var for t0 * 9? // maybe keep a var for t0 * 9?
v0_2 = dma_sample_data(sp120 + (s7->unk14 - s2 + 0x10) / 16 * 9, t0 * 9, v0_2 = dma_sample_data(sp120 + (s7->unk14 - s2 + 0x10) / 16 * 9, t0 * 9,
sp148, &s7->sampleDmaIndex); sp148, &s7->sampleDmaIndex);
a3 = (u32) v0_2 & 0xf; a3 = (u32)((uintptr_t) v0_2 & 0xf);
aSetBuffer(cmd++, 0, 0x3f0, 0, t0 * 9 + a3); aSetBuffer(cmd++, 0, 0x3f0, 0, t0 * 9 + a3);
aLoadBuffer(cmd++, FIX(v0_2 - a3)); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(v0_2 - a3));
} else { } else {
s0 = 0; s0 = 0;
a3 = 0; a3 = 0;
} }
if (s7->unk0b20 != 0) { if (s7->unk0b20 != 0) {
aSetLoop(cmd++, FIX(sp164->loop->state)); aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(sp164->loop->state));
sp148 = A_LOOP; // = 2 sp148 = A_LOOP; // = 2
s7->unk0b20 = 0; s7->unk0b20 = 0;
} }
if (fp == 0) { if (fp == 0) {
aSetBuffer(cmd++, 0, a3 + 0x3f0, 0x180, s0 * 2); aSetBuffer(cmd++, 0, a3 + 0x3f0, 0x180, s0 * 2);
aADPCMdec(cmd++, sp148, FIX(s7->unk34->unk00)); aADPCMdec(cmd++, sp148, VIRTUAL_TO_PHYSICAL2(s7->unk34->unk00));
sp130 = s2 * 2; sp130 = s2 * 2;
} else { } else {
aSetBuffer(cmd++, 0, a3 + 0x3f0, ALIGN(s5, 5) + 0x180, s0 * 2); aSetBuffer(cmd++, 0, a3 + 0x3f0, ALIGN(s5, 5) + 0x180, s0 * 2);
aADPCMdec(cmd++, sp148, FIX(s7->unk34->unk00)); aADPCMdec(cmd++, sp148, VIRTUAL_TO_PHYSICAL2(s7->unk34->unk00));
aDMEMMove(cmd++, ALIGN(s5, 5) + (s2 * 2) + 0x180, s5 + 0x180, aDMEMMove(cmd++, ALIGN(s5, 5) + (s2 * 2) + 0x180, s5 + 0x180,
(s0 + s6_2 - s3) * 2); (s0 + s6_2 - s3) * 2);
} }
@ -440,7 +439,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
switch (spE4) { switch (spE4) {
case 0: case 0:
aSetBuffer(cmd++, 0, sp130 + 0x180, 0x20, t5 + 4); aSetBuffer(cmd++, 0, sp130 + 0x180, 0x20, t5 + 4);
aResample(cmd++, 0x1, 0xff60, FIX(s7->unk34->unkF0)); aResample(cmd++, 0x1, 0xff60, VIRTUAL_TO_PHYSICAL2(s7->unk34->unkF0));
spD8 = t5 + 4; spD8 = t5 + 4;
spD6 = 36; spD6 = 36;
if (s7->unk0b10 != 0) { if (s7->unk0b10 != 0) {
@ -450,7 +449,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
case 1: case 1:
aSetBuffer(cmd++, 0, sp130 + 0x180, 0x160, t5 + 8); aSetBuffer(cmd++, 0, sp130 + 0x180, 0x160, t5 + 8);
aResample(cmd++, 0x1, 0xff60, FIX(s7->unk34->unkF0)); aResample(cmd++, 0x1, 0xff60, VIRTUAL_TO_PHYSICAL2(s7->unk34->unkF0));
aDMEMMove(cmd++, 0x164, spD8 + 0x20, t5 + 4); aDMEMMove(cmd++, 0x164, spD8 + 0x20, t5 + 4);
break; break;
} }
@ -494,7 +493,7 @@ u64 *func_80314480(u16 *aiBuf, s32 bufLen, u64 *cmd) {
aInterleave(cmd++, 0x4c0, 0x600); aInterleave(cmd++, 0x4c0, 0x600);
t9 *= 2; t9 *= 2;
aSetBuffer(cmd++, 0, 0, 0, t9); aSetBuffer(cmd++, 0, 0, 0, t9);
aSaveBuffer(cmd++, FIX(aiBuf)); aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(aiBuf));
return cmd; return cmd;
} }
@ -509,7 +508,7 @@ u64 *func_80314F08(u64 *cmd, struct Note *note, s32 arg2) {
s32 i; s32 i;
aSetBuffer(cmd++, /*flags*/ 0, /*dmemin*/ 0x180, /*dmemout*/ 0, aSetBuffer(cmd++, /*flags*/ 0, /*dmemin*/ 0x180, /*dmemout*/ 0,
/*count*/ sizeof(note->unk34->samples)); // interesting that it's 128... /*count*/ sizeof(note->unk34->samples)); // interesting that it's 128...
aLoadBuffer(cmd++, FIX(note->unk34->samples)); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->samples));
note->unk14 = (note->sampleCount - 1) & note->unk14; note->unk14 = (note->sampleCount - 1) & note->unk14;
a3 = 64 - note->unk14; a3 = 64 - note->unk14;
if (a3 < arg2) { if (a3 < arg2) {
@ -525,7 +524,7 @@ u64 *func_80314F08(u64 *cmd, struct Note *note, s32 arg2) {
u64 *func_80314FD4(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, u16 arg4, u32 arg5) { u64 *func_80314FD4(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, u16 arg4, u32 arg5) {
aSetBuffer(cmd++, 0, arg4, 0, arg2); aSetBuffer(cmd++, 0, arg4, 0, arg2);
aResample(cmd++, arg5, arg3, FIX(note->unk34->unk20)); aResample(cmd++, arg5, arg3, VIRTUAL_TO_PHYSICAL2(note->unk34->unk20));
return cmd; return cmd;
} }
@ -593,7 +592,7 @@ u64 *func_80315094(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, s32 arg4,
aSetVolume(cmd++, A_AUX, D_802212A0, 0, note->reverbVol); aSetVolume(cmd++, A_AUX, D_802212A0, 0, note->reverbVol);
} }
if (D_802211B0.unk1 && note->reverb) { if (D_802211B0.unk1 && note->reverb) {
aEnvMixer(cmd++, mixerFlags | A_AUX, FIX(note->unk34->unk40)); aEnvMixer(cmd++, mixerFlags | A_AUX, VIRTUAL_TO_PHYSICAL2(note->unk34->unk40));
if (note->stereoStrongRight) { if (note->stereoStrongRight) {
aSetBuffer(cmd++, 0, 0, 0, arg2 * 2); aSetBuffer(cmd++, 0, 0, 0, arg2 * 2);
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0); aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0);
@ -604,7 +603,7 @@ u64 *func_80315094(u64 *cmd, struct Note *note, s32 arg2, u16 arg3, s32 arg4,
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x340, /*out*/ 0x880); aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x340, /*out*/ 0x880);
} }
} else { } else {
aEnvMixer(cmd++, mixerFlags, FIX(note->unk34->unk40)); aEnvMixer(cmd++, mixerFlags, VIRTUAL_TO_PHYSICAL2(note->unk34->unk40));
if (note->stereoStrongRight) { if (note->stereoStrongRight) {
aSetBuffer(cmd++, 0, 0, 0, arg2 * 2); aSetBuffer(cmd++, 0, 0, 0, arg2 * 2);
aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0); aMix(cmd++, 0, /*gain*/ 0x8000, /*in*/ 0x200, /*out*/ 0x4c0);
@ -649,20 +648,20 @@ u64 *func_803155F4(u64 *cmd, struct Note *note, s32 arg2, s32 arg3, s32 leftRigh
aClearBuffer(cmd++, 8, 8); aClearBuffer(cmd++, 8, 8);
aDMEMMove(cmd++, 0x200, 0x10, 0x10); aDMEMMove(cmd++, 0x200, 0x10, 0x10);
aSetBuffer(cmd++, 0, 0, 0, 32); aSetBuffer(cmd++, 0, 0, 0, 32);
aSaveBuffer(cmd++, FIX(note->unk34->unk90)); aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
pitch = (arg2 << 0xf) / (panVolume + arg2 - prevPanVolume + 8); pitch = (arg2 << 0xf) / (panVolume + arg2 - prevPanVolume + 8);
aSetBuffer(cmd++, 0, 0x208, 0, panVolume + arg2 - prevPanVolume); aSetBuffer(cmd++, 0, 0x208, 0, panVolume + arg2 - prevPanVolume);
aResample(cmd++, 0, pitch, FIX(note->unk34->unk90)); aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
} else { } else {
pitch = (panVolume == 0) ? (arg2 << 0xf) / (arg2 - prevPanVolume - 4) pitch = (panVolume == 0) ? (arg2 << 0xf) / (arg2 - prevPanVolume - 4)
: (arg2 << 0xf) / (arg2 + panVolume - prevPanVolume); : (arg2 << 0xf) / (arg2 + panVolume - prevPanVolume);
aSetBuffer(cmd++, 0, 0x200, 0, panVolume + arg2 - prevPanVolume); aSetBuffer(cmd++, 0, 0x200, 0, panVolume + arg2 - prevPanVolume);
aResample(cmd++, 0, pitch, FIX(note->unk34->unk90)); aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->unk34->unk90));
} }
if (prevPanVolume != 0) { if (prevPanVolume != 0) {
aSetBuffer(cmd++, 0, 0x200, 0, prevPanVolume); aSetBuffer(cmd++, 0, 0x200, 0, prevPanVolume);
aLoadBuffer(cmd++, FIX(note->unk34->unkB0)); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unkB0));
aDMEMMove(cmd++, 0, prevPanVolume + 0x200, panVolume + arg2 - prevPanVolume); aDMEMMove(cmd++, 0, prevPanVolume + 0x200, panVolume + arg2 - prevPanVolume);
} else { } else {
aDMEMMove(cmd++, 0, 0x200, panVolume + arg2 - prevPanVolume); aDMEMMove(cmd++, 0, 0x200, panVolume + arg2 - prevPanVolume);
@ -675,7 +674,7 @@ u64 *func_803155F4(u64 *cmd, struct Note *note, s32 arg2, s32 arg3, s32 leftRigh
if (panVolume) { if (panVolume) {
aSetBuffer(cmd++, 0, 0, arg2 + 0x200, panVolume); aSetBuffer(cmd++, 0, 0, arg2 + 0x200, panVolume);
aSaveBuffer(cmd++, FIX(note->unk34->unkB0)); aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->unk34->unkB0));
} }
aSetBuffer(cmd++, 0, 0, 0, arg2); aSetBuffer(cmd++, 0, 0, 0, arg2);

View File

@ -2,8 +2,8 @@
#define BUFFERS_H #define BUFFERS_H
#include "types.h" #include "types.h"
#include "save_file.h" #include "game/save_file.h"
#include "display.h" #include "game/display.h"
extern u8 gDecompressionHeap[]; extern u8 gDecompressionHeap[];

View File

@ -16,8 +16,8 @@
static u16 gRandomSeed16; static u16 gRandomSeed16;
// unused // unused
static void func_80383B70(u32 segptr) { static void func_80383B70(void *segptr) {
gBehCommand = segmented_to_virtual((void *) segptr); gBehCommand = segmented_to_virtual(segptr);
gCurrentObject->stackIndex = 0; gCurrentObject->stackIndex = 0;
} }
@ -72,13 +72,13 @@ void func_80383D68(struct Object *object) {
object->header.gfx.angle[2] = object->oFaceAngleRoll & 0xFFFF; object->header.gfx.angle[2] = object->oFaceAngleRoll & 0xFFFF;
} }
static void cur_object_stack_push(u32 value) { static void cur_object_stack_push(uintptr_t value) {
gCurrentObject->stack[gCurrentObject->stackIndex] = value; gCurrentObject->stack[gCurrentObject->stackIndex] = value;
gCurrentObject->stackIndex++; gCurrentObject->stackIndex++;
} }
static u32 cur_object_stack_pop(void) { static uintptr_t cur_object_stack_pop(void) {
u32 value; uintptr_t value;
gCurrentObject->stackIndex--; gCurrentObject->stackIndex--;
value = gCurrentObject->stack[gCurrentObject->stackIndex]; value = gCurrentObject->stack[gCurrentObject->stackIndex];
return value; return value;
@ -117,7 +117,7 @@ static s32 beh_cmd_graph_node(void) {
} }
static s32 beh_cmd_obj_load_chill(void) { static s32 beh_cmd_obj_load_chill(void) {
u32 model = gBehCommand[1]; u32 model = (u32) gBehCommand[1];
void *arg1 = (void *) gBehCommand[2]; void *arg1 = (void *) gBehCommand[2];
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1); struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
@ -129,7 +129,7 @@ static s32 beh_cmd_obj_load_chill(void) {
} }
static s32 beh_cmd_obj_spawn(void) { static s32 beh_cmd_obj_spawn(void) {
u32 model = gBehCommand[1]; u32 model = (u32) gBehCommand[1];
void *arg1 = (void *) gBehCommand[2]; void *arg1 = (void *) gBehCommand[2];
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1); struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg1);
@ -144,7 +144,7 @@ static s32 beh_cmd_obj_spawn(void) {
static s32 beh_cmd_obj_load_chill_param(void) { static s32 beh_cmd_obj_load_chill_param(void) {
u32 behParam = (s16)(gBehCommand[0] & 0xFFFF); u32 behParam = (s16)(gBehCommand[0] & 0xFFFF);
u32 model = gBehCommand[1]; u32 model = (u32) gBehCommand[1];
void *arg2 = (void *) gBehCommand[2]; void *arg2 = (void *) gBehCommand[2];
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg2); struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, arg2);
@ -172,23 +172,23 @@ static s32 beh_cmd_break2(void) {
} }
static s32 beh_cmd_call(void) { static s32 beh_cmd_call(void) {
u32 *jumpAddress; uintptr_t *jumpAddress;
gBehCommand++; gBehCommand++;
cur_object_stack_push((u32)(gBehCommand + 1)); cur_object_stack_push((uintptr_t)(gBehCommand + 1));
jumpAddress = (u32 *) segmented_to_virtual((void *) gBehCommand[0]); jumpAddress = segmented_to_virtual((void *) gBehCommand[0]);
gBehCommand = jumpAddress; gBehCommand = jumpAddress;
return BEH_CONTINUE; return BEH_CONTINUE;
} }
static s32 beh_cmd_return(void) { static s32 beh_cmd_return(void) {
gBehCommand = (u32 *) cur_object_stack_pop(); gBehCommand = (uintptr_t *) cur_object_stack_pop();
return BEH_CONTINUE; return BEH_CONTINUE;
} }
static s32 beh_cmd_delay(void) { static s32 beh_cmd_delay(void) {
s16 arg0 = gBehCommand[0] & 0xFFFF; s16 arg0 = (s16)(gBehCommand[0] & 0xFFFF);
if (gCurrentObject->unk1F4 < arg0 - 1) { if (gCurrentObject->unk1F4 < arg0 - 1) {
gCurrentObject->unk1F4++; gCurrentObject->unk1F4++;
@ -201,7 +201,7 @@ static s32 beh_cmd_delay(void) {
} }
static s32 beh_cmd_delay_var(void) { static s32 beh_cmd_delay_var(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 arg0 = cur_object_get_int(objectOffset); s32 arg0 = cur_object_get_int(objectOffset);
if (gCurrentObject->unk1F4 < (arg0 - 1)) { if (gCurrentObject->unk1F4 < (arg0 - 1)) {
@ -216,7 +216,7 @@ static s32 beh_cmd_delay_var(void) {
static s32 beh_cmd_goto(void) { static s32 beh_cmd_goto(void) {
gBehCommand++; gBehCommand++;
gBehCommand = (u32 *) segmented_to_virtual((void *) gBehCommand[0]); gBehCommand = segmented_to_virtual((void *) gBehCommand[0]);
return BEH_CONTINUE; return BEH_CONTINUE;
} }
@ -224,7 +224,7 @@ static s32 beh_cmd_goto(void) {
static s32 Behavior26(void) { static s32 Behavior26(void) {
s32 value = (u8)(gBehCommand[0] >> 16) & 0xFF; s32 value = (u8)(gBehCommand[0] >> 16) & 0xFF;
cur_object_stack_push((u32)(gBehCommand + 1)); cur_object_stack_push((uintptr_t)(gBehCommand + 1));
cur_object_stack_push(value); cur_object_stack_push(value);
gBehCommand++; gBehCommand++;
@ -235,7 +235,7 @@ static s32 Behavior26(void) {
static s32 beh_cmd_begin_repeat(void) { static s32 beh_cmd_begin_repeat(void) {
s32 count = (s16)(gBehCommand[0] & 0xFFFF); s32 count = (s16)(gBehCommand[0] & 0xFFFF);
cur_object_stack_push((u32)(gBehCommand + 1)); cur_object_stack_push((uintptr_t)(gBehCommand + 1));
cur_object_stack_push(count); cur_object_stack_push(count);
gBehCommand++; gBehCommand++;
@ -244,12 +244,12 @@ static s32 beh_cmd_begin_repeat(void) {
} }
static s32 beh_cmd_end_repeat(void) { static s32 beh_cmd_end_repeat(void) {
u32 count = cur_object_stack_pop(); u32 count = (u32) cur_object_stack_pop();
count--; count--;
if (count != 0) { if (count != 0) {
gBehCommand = (u32 *) cur_object_stack_pop(); gBehCommand = (uintptr_t *) cur_object_stack_pop();
cur_object_stack_push((u32) gBehCommand); cur_object_stack_push((uintptr_t) gBehCommand);
cur_object_stack_push(count); cur_object_stack_push(count);
} else { } else {
cur_object_stack_pop(); cur_object_stack_pop();
@ -260,12 +260,12 @@ static s32 beh_cmd_end_repeat(void) {
} }
static s32 beh_cmd_end_repeat_nobreak(void) { static s32 beh_cmd_end_repeat_nobreak(void) {
u32 count = cur_object_stack_pop(); u32 count = (u32) cur_object_stack_pop();
count--; count--;
if (count != 0) { if (count != 0) {
gBehCommand = (u32 *) cur_object_stack_pop(); gBehCommand = (uintptr_t *) cur_object_stack_pop();
cur_object_stack_push((u32) gBehCommand); cur_object_stack_push((uintptr_t) gBehCommand);
cur_object_stack_push(count); cur_object_stack_push(count);
} else { } else {
cur_object_stack_pop(); cur_object_stack_pop();
@ -276,15 +276,15 @@ static s32 beh_cmd_end_repeat_nobreak(void) {
} }
static s32 beh_cmd_begin_loop(void) { static s32 beh_cmd_begin_loop(void) {
cur_object_stack_push((u32)(gBehCommand + 1)); cur_object_stack_push((uintptr_t)(gBehCommand + 1));
gBehCommand++; gBehCommand++;
return BEH_CONTINUE; return BEH_CONTINUE;
} }
static s32 beh_cmd_end_loop(void) { static s32 beh_cmd_end_loop(void) {
gBehCommand = (u32 *) cur_object_stack_pop(); gBehCommand = (uintptr_t *) cur_object_stack_pop();
cur_object_stack_push((u32) gBehCommand); cur_object_stack_push((uintptr_t) gBehCommand);
return BEH_BREAK; return BEH_BREAK;
} }
@ -301,7 +301,7 @@ static s32 beh_cmd_callnative(void) {
} }
static s32 beh_cmd_obj_set_float(void) { static s32 beh_cmd_obj_set_float(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
f32 value = (s16)(gBehCommand[0] & 0xFFFF); f32 value = (s16)(gBehCommand[0] & 0xFFFF);
cur_object_set_float(objectOffset, value); cur_object_set_float(objectOffset, value);
@ -311,8 +311,8 @@ static s32 beh_cmd_obj_set_float(void) {
} }
static s32 beh_cmd_obj_set_int(void) { static s32 beh_cmd_obj_set_int(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s16 value = gBehCommand[0] & 0xFFFF; s16 value = (s16)(gBehCommand[0] & 0xFFFF);
cur_object_set_int(objectOffset, value); cur_object_set_int(objectOffset, value);
@ -322,7 +322,7 @@ static s32 beh_cmd_obj_set_int(void) {
// unused // unused
static s32 Behavior36(void) { static s32 Behavior36(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
u32 value = (s16)(gBehCommand[1] & 0xFFFF); u32 value = (s16)(gBehCommand[1] & 0xFFFF);
cur_object_set_int(objectOffset, value); cur_object_set_int(objectOffset, value);
@ -332,7 +332,7 @@ static s32 Behavior36(void) {
} }
static s32 beh_cmd_obj_set_float_rand(void) { static s32 beh_cmd_obj_set_float_rand(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
f32 min = (s16)(gBehCommand[0] & 0xFFFF); f32 min = (s16)(gBehCommand[0] & 0xFFFF);
f32 max = (s16)(gBehCommand[1] >> 16); f32 max = (s16)(gBehCommand[1] >> 16);
@ -343,7 +343,7 @@ static s32 beh_cmd_obj_set_float_rand(void) {
} }
static s32 beh_cmd_obj_set_int_rand(void) { static s32 beh_cmd_obj_set_int_rand(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 min = (s16)(gBehCommand[0] & 0xFFFF); s32 min = (s16)(gBehCommand[0] & 0xFFFF);
s32 max = (s16)(gBehCommand[1] >> 16); s32 max = (s16)(gBehCommand[1] >> 16);
@ -354,7 +354,7 @@ static s32 beh_cmd_obj_set_int_rand(void) {
} }
static s32 beh_cmd_obj_set_int_rand_rshift(void) { static s32 beh_cmd_obj_set_int_rand_rshift(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 min = (s16)(gBehCommand[0] & 0xFFFF); s32 min = (s16)(gBehCommand[0] & 0xFFFF);
s32 rshift = (s16)(gBehCommand[1] >> 16); s32 rshift = (s16)(gBehCommand[1] >> 16);
@ -365,7 +365,7 @@ static s32 beh_cmd_obj_set_int_rand_rshift(void) {
} }
static s32 beh_cmd_obj_add_float_rand(void) { static s32 beh_cmd_obj_add_float_rand(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
f32 min = (s16)(gBehCommand[0] & 0xFFFF); f32 min = (s16)(gBehCommand[0] & 0xFFFF);
f32 max = (s16)(gBehCommand[1] >> 16); f32 max = (s16)(gBehCommand[1] >> 16);
@ -378,7 +378,7 @@ static s32 beh_cmd_obj_add_float_rand(void) {
// unused // unused
static s32 beh_cmd_obj_add_int_rand_rshift(void) { static s32 beh_cmd_obj_add_int_rand_rshift(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 min = (s16)(gBehCommand[0] & 0xFFFF); s32 min = (s16)(gBehCommand[0] & 0xFFFF);
s32 rshift = (s16)(gBehCommand[1] >> 16); s32 rshift = (s16)(gBehCommand[1] >> 16);
s32 rnd = RandomU16(); s32 rnd = RandomU16();
@ -390,7 +390,7 @@ static s32 beh_cmd_obj_add_int_rand_rshift(void) {
} }
static s32 beh_cmd_obj_add_float(void) { static s32 beh_cmd_obj_add_float(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
f32 value = (s16)(gBehCommand[0] & 0xFFFF); f32 value = (s16)(gBehCommand[0] & 0xFFFF);
cur_object_add_float(objectOffset, value); cur_object_add_float(objectOffset, value);
@ -400,7 +400,7 @@ static s32 beh_cmd_obj_add_float(void) {
} }
static s32 beh_cmd_obj_add_int(void) { static s32 beh_cmd_obj_add_int(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s16 value = gBehCommand[0] & 0xFFFF; s16 value = gBehCommand[0] & 0xFFFF;
cur_object_add_int(objectOffset, value); cur_object_add_int(objectOffset, value);
@ -410,7 +410,7 @@ static s32 beh_cmd_obj_add_int(void) {
} }
static s32 beh_cmd_obj_or_int(void) { static s32 beh_cmd_obj_or_int(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 value = (s16)(gBehCommand[0] & 0xFFFF); s32 value = (s16)(gBehCommand[0] & 0xFFFF);
value &= 0xFFFF; value &= 0xFFFF;
@ -422,7 +422,7 @@ static s32 beh_cmd_obj_or_int(void) {
// unused // unused
static s32 beh_cmd_obj_bit_clear_int(void) { static s32 beh_cmd_obj_bit_clear_int(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 value = (s16)(gBehCommand[0] & 0xFFFF); s32 value = (s16)(gBehCommand[0] & 0xFFFF);
value = (value & 0xFFFF) ^ 0xFFFF; value = (value & 0xFFFF) ^ 0xFFFF;
@ -433,7 +433,7 @@ static s32 beh_cmd_obj_bit_clear_int(void) {
} }
static s32 beh_cmd_obj_set_int32(void) { static s32 beh_cmd_obj_set_int32(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
cur_object_set_int(objectOffset, gBehCommand[1]); cur_object_set_int(objectOffset, gBehCommand[1]);
@ -443,7 +443,7 @@ static s32 beh_cmd_obj_set_int32(void) {
static s32 beh_cmd_obj_animate(void) { static s32 beh_cmd_obj_animate(void) {
s32 animIndex = (u8)((gBehCommand[0] >> 16) & 0xFF); s32 animIndex = (u8)((gBehCommand[0] >> 16) & 0xFF);
u32 *animations = gCurrentObject->oAnimations; struct Animation **animations = gCurrentObject->oAnimations;
geo_obj_init_animation((struct GraphNodeObject *) gCurrentObject, &animations[animIndex]); geo_obj_init_animation((struct GraphNodeObject *) gCurrentObject, &animations[animIndex]);
@ -517,8 +517,8 @@ static s32 beh_cmd_obj_sum_int(void) {
} }
static s32 beh_cmd_set_hitbox(void) { static s32 beh_cmd_set_hitbox(void) {
s16 colSphereX = gBehCommand[1] >> 16; s16 colSphereX = (s16)(gBehCommand[1] >> 16);
s16 colSphereY = gBehCommand[1] & 0xFFFF; s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
gCurrentObject->hitboxRadius = colSphereX; gCurrentObject->hitboxRadius = colSphereX;
gCurrentObject->hitboxHeight = colSphereY; gCurrentObject->hitboxHeight = colSphereY;
@ -528,8 +528,8 @@ static s32 beh_cmd_set_hitbox(void) {
} }
static s32 beh_cmd_obj_set_float2(void) { static s32 beh_cmd_obj_set_float2(void) {
s16 arg0 = gBehCommand[1] >> 16; s16 arg0 = (s16)(gBehCommand[1] >> 16);
s16 arg1 = gBehCommand[1] & 0xFFFF; s16 arg1 = (s16)(gBehCommand[1] & 0xFFFF);
gCurrentObject->hurtboxRadius = arg0; gCurrentObject->hurtboxRadius = arg0;
gCurrentObject->hurtboxHeight = arg1; gCurrentObject->hurtboxHeight = arg1;
@ -539,9 +539,9 @@ static s32 beh_cmd_obj_set_float2(void) {
} }
static s32 beh_cmd_collision_sphere(void) { static s32 beh_cmd_collision_sphere(void) {
s16 colSphereX = gBehCommand[1] >> 16; s16 colSphereX = (s16)(gBehCommand[1] >> 16);
s16 colSphereY = gBehCommand[1] & 0xFFFF; s16 colSphereY = (s16)(gBehCommand[1] & 0xFFFF);
s16 unknown = gBehCommand[2] >> 16; s16 unknown = (s16)(gBehCommand[2] >> 16);
gCurrentObject->hitboxRadius = colSphereX; gCurrentObject->hitboxRadius = colSphereX;
gCurrentObject->hitboxHeight = colSphereY; gCurrentObject->hitboxHeight = colSphereY;
@ -576,7 +576,7 @@ static s32 beh_cmd_begin(void) {
} }
static void Unknown8038556C(s32 lastIndex) { static void Unknown8038556C(s32 lastIndex) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
u32 table[16]; u32 table[16];
s32 i; s32 i;
@ -604,7 +604,7 @@ static s32 beh_cmd_obj_set_pos(void) {
} }
static s32 beh_cmd_interact_type(void) { static s32 beh_cmd_interact_type(void) {
gCurrentObject->oInteractType = gBehCommand[1]; gCurrentObject->oInteractType = (u32) gBehCommand[1];
gBehCommand += 2; gBehCommand += 2;
return BEH_CONTINUE; return BEH_CONTINUE;
@ -612,14 +612,14 @@ static s32 beh_cmd_interact_type(void) {
// unused // unused
static s32 Behavior31(void) { static s32 Behavior31(void) {
gCurrentObject->oInteractionSubtype = gBehCommand[1]; gCurrentObject->oInteractionSubtype = (u32) gBehCommand[1];
gBehCommand += 2; gBehCommand += 2;
return BEH_CONTINUE; return BEH_CONTINUE;
} }
static s32 beh_cmd_scale(void) { static s32 beh_cmd_scale(void) {
UNUSED u8 sp1f = (gBehCommand[0] >> 16) & 0xFF; UNUSED u8 sp1f = (u8)((gBehCommand[0] >> 16) & 0xFF);
s16 sp1c = gBehCommand[0] & 0xFFFF; s16 sp1c = gBehCommand[0] & 0xFFFF;
obj_scale((f32) sp1c / 100.0f); obj_scale((f32) sp1c / 100.0f);
@ -647,7 +647,7 @@ static s32 beh_cmd_obj_set_gravity(void) {
} }
static s32 beh_cmd_obj_bit_clear_int32(void) { static s32 beh_cmd_obj_bit_clear_int32(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s32 flags = gBehCommand[1]; s32 flags = gBehCommand[1];
flags = flags ^ 0xFFFFFFFF; flags = flags ^ 0xFFFFFFFF;
@ -666,7 +666,7 @@ static s32 beh_cmd_spawn_addr(void) {
} }
static s32 beh_cmd_text_anim_rate(void) { static s32 beh_cmd_text_anim_rate(void) {
u8 objectOffset = (gBehCommand[0] >> 16) & 0xFF; u8 objectOffset = (u8)((gBehCommand[0] >> 16) & 0xFF);
s16 arg1 = (gBehCommand[0] & 0xFFFF); s16 arg1 = (gBehCommand[0] & 0xFFFF);
if ((gGlobalTimer % arg1) == 0) { if ((gGlobalTimer % arg1) == 0) {

View File

@ -91,7 +91,7 @@ UNUSED s32 D_8038BCA8;
struct GraphNode **gGeoViews; struct GraphNode **gGeoViews;
u16 gGeoNumViews; // length of gGeoViews array u16 gGeoNumViews; // length of gGeoViews array
u32 gGeoLayoutStack[16]; uintptr_t gGeoLayoutStack[16];
struct GraphNode *gCurGraphNodeList[32]; struct GraphNode *gCurGraphNodeList[32];
s16 gCurGraphNodeIndex; s16 gCurGraphNodeIndex;
s16 gGeoLayoutStackIndex; // similar to SP register in MIPS s16 gGeoLayoutStackIndex; // similar to SP register in MIPS
@ -107,10 +107,10 @@ u32 unused_8038B894[3] = { 0 };
cmd+0x04: void *branchTarget cmd+0x04: void *branchTarget
*/ */
void geo_layout_cmd_branch_and_link(void) { void geo_layout_cmd_branch_and_link(void) {
gGeoLayoutStack[gGeoLayoutStackIndex++] = (u32) &gGeoLayoutCommand[8]; gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + 4 + sizeof(void *));
gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex; gGeoLayoutStack[gGeoLayoutStackIndex++] = (gCurGraphNodeIndex << 16) + gGeoLayoutReturnIndex;
gGeoLayoutReturnIndex = gGeoLayoutStackIndex; gGeoLayoutReturnIndex = gGeoLayoutStackIndex;
gGeoLayoutCommand = (u8 *) segmented_to_virtual((void *) cur_geo_cmd_s32(0x04)); gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
} }
// 0x01: Terminate geo layout // 0x01: Terminate geo layout
@ -127,10 +127,10 @@ void geo_layout_cmd_end(void) {
*/ */
void geo_layout_cmd_branch(void) { void geo_layout_cmd_branch(void) {
if (cur_geo_cmd_u8(0x01) == 1) { if (cur_geo_cmd_u8(0x01) == 1) {
gGeoLayoutStack[gGeoLayoutStackIndex++] = (u32) &gGeoLayoutCommand[8]; gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + 4 + sizeof(void *));
} }
gGeoLayoutCommand = (u8 *) segmented_to_virtual((void *) cur_geo_cmd_s32(0x04)); gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04));
} }
// 0x03: Return from branch // 0x03: Return from branch
@ -216,8 +216,7 @@ void geo_layout_cmd_node_root(void) {
graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height); graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height);
// TODO: check type // TODO: check type
gGeoViews = gGeoViews = alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *));
(struct GraphNode **) alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(void *));
graphNode->views = gGeoViews; graphNode->views = gGeoViews;
graphNode->numViews = gGeoNumViews; graphNode->numViews = gGeoNumViews;
@ -263,8 +262,8 @@ void geo_layout_cmd_node_perspective(void) {
if (cur_geo_cmd_u8(0x01) != 0) { if (cur_geo_cmd_u8(0x01) != 0) {
// optional asm function // optional asm function
frustumFunc = (GraphNodeFunc) cur_geo_cmd_s32(0x08); frustumFunc = (GraphNodeFunc) cur_geo_cmd_ptr(0x08);
gGeoLayoutCommand += 0x04; gGeoLayoutCommand += sizeof(void *);
} }
graphNode = init_graph_node_perspective(gGraphNodePool, NULL, (f32) fov, near, far, frustumFunc, 0); graphNode = init_graph_node_perspective(gGraphNodePool, NULL, (f32) fov, near, far, frustumFunc, 0);
@ -340,12 +339,12 @@ void geo_layout_cmd_node_switch_case(void) {
init_graph_node_switch_case(gGraphNodePool, NULL, init_graph_node_switch_case(gGraphNodePool, NULL,
cur_geo_cmd_s16(0x02), // case which is initially selected cur_geo_cmd_s16(0x02), // case which is initially selected
0, 0,
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // case update function (GraphNodeFunc) cur_geo_cmd_ptr(0x04), // case update function
0); 0);
register_scene_graph_node(&graphNode->fnNode.node); register_scene_graph_node(&graphNode->fnNode.node);
gGeoLayoutCommand += 0x08; gGeoLayoutCommand += 0x04 + sizeof(void *);
} }
/* /*
@ -369,13 +368,13 @@ void geo_layout_cmd_node_camera(void) {
cmdPos = read_vec3s_to_vec3f(toPos, cmdPos); cmdPos = read_vec3s_to_vec3f(toPos, cmdPos);
graphNode = init_graph_node_camera(gGraphNodePool, NULL, fromPos, toPos, graphNode = init_graph_node_camera(gGraphNodePool, NULL, fromPos, toPos,
(GraphNodeFunc) cur_geo_cmd_s32(0x10), cur_geo_cmd_s16(0x02)); (GraphNodeFunc) cur_geo_cmd_ptr(0x10), cur_geo_cmd_s16(0x02));
register_scene_graph_node(&graphNode->fnNode.node); register_scene_graph_node(&graphNode->fnNode.node);
gGeoViews[0] = &graphNode->fnNode.node; gGeoViews[0] = &graphNode->fnNode.node;
gGeoLayoutCommand += 0x14; gGeoLayoutCommand += 0x10 + sizeof(void *);
} }
/* /*
@ -446,7 +445,7 @@ void geo_layout_cmd_node_translation_rotation(void) {
if (params & 0x80) { if (params & 0x80) {
displayList = *(void **) &cmdPos[0]; displayList = *(void **) &cmdPos[0];
drawingLayer = params & 0x0F; drawingLayer = params & 0x0F;
cmdPos += 2; cmdPos += sizeof(void*) / 2;
} }
graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList, graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList,
@ -481,7 +480,7 @@ void geo_layout_cmd_node_translation(void) {
if (params & 0x80) { if (params & 0x80) {
displayList = *(void **) &cmdPos[0]; displayList = *(void **) &cmdPos[0];
drawingLayer = params & 0x0F; drawingLayer = params & 0x0F;
cmdPos += 2; cmdPos += sizeof(void*) / 2;
} }
graphNode = graphNode =
@ -517,7 +516,7 @@ void geo_layout_cmd_node_rotation(void) {
if (params & 0x80) { if (params & 0x80) {
displayList = *(void **) &cmdPos[0]; displayList = *(void **) &cmdPos[0];
drawingLayer = params & 0x0F; drawingLayer = params & 0x0F;
cmdPos += 2; cmdPos += sizeof(void*) / 2;
} }
graphNode = init_graph_node_rotation(gGraphNodePool, NULL, drawingLayer, displayList, sp2c); graphNode = init_graph_node_rotation(gGraphNodePool, NULL, drawingLayer, displayList, sp2c);
@ -544,9 +543,9 @@ void geo_layout_cmd_node_scale(void) {
void *displayList = NULL; void *displayList = NULL;
if (params & 0x80) { if (params & 0x80) {
displayList = (void *) cur_geo_cmd_s32(0x08); displayList = cur_geo_cmd_ptr(0x08);
drawingLayer = params & 0x0F; drawingLayer = params & 0x0F;
gGeoLayoutCommand += 0x04; gGeoLayoutCommand += sizeof(void *);
} }
graphNode = init_graph_node_scale(gGraphNodePool, NULL, drawingLayer, displayList, scale); graphNode = init_graph_node_scale(gGraphNodePool, NULL, drawingLayer, displayList, scale);
@ -573,7 +572,7 @@ void geo_layout_cmd_node_animated_part(void) {
struct GraphNodeAnimatedPart *graphNode; struct GraphNodeAnimatedPart *graphNode;
Vec3s translation; Vec3s translation;
s32 drawingLayer = cur_geo_cmd_u8(0x01); s32 drawingLayer = cur_geo_cmd_u8(0x01);
void *displayList = (void *) cur_geo_cmd_s32(0x08); void *displayList = cur_geo_cmd_ptr(0x08);
s16 *cmdPos = (s16 *) gGeoLayoutCommand; s16 *cmdPos = (s16 *) gGeoLayoutCommand;
read_vec3s(translation, &cmdPos[1]); read_vec3s(translation, &cmdPos[1]);
@ -583,7 +582,7 @@ void geo_layout_cmd_node_animated_part(void) {
register_scene_graph_node(&graphNode->node); register_scene_graph_node(&graphNode->node);
gGeoLayoutCommand += 0x0C; gGeoLayoutCommand += 0x08 + sizeof(void *);
} }
/* /*
@ -609,7 +608,7 @@ void geo_layout_cmd_node_billboard(void) {
if (params & 0x80) { if (params & 0x80) {
displayList = *(void **) &cmdPos[0]; displayList = *(void **) &cmdPos[0];
drawingLayer = params & 0x0F; drawingLayer = params & 0x0F;
cmdPos += 2; cmdPos += sizeof(void*) / 2;
} }
graphNode = init_graph_node_billboard(gGraphNodePool, NULL, drawingLayer, displayList, translation); graphNode = init_graph_node_billboard(gGraphNodePool, NULL, drawingLayer, displayList, translation);
@ -627,13 +626,13 @@ void geo_layout_cmd_node_billboard(void) {
void geo_layout_cmd_node_display_list(void) { void geo_layout_cmd_node_display_list(void) {
struct GraphNodeDisplayList *graphNode; struct GraphNodeDisplayList *graphNode;
s32 drawingLayer = cur_geo_cmd_u8(0x01); s32 drawingLayer = cur_geo_cmd_u8(0x01);
void *displayList = (void *) cur_geo_cmd_s32(0x04); void *displayList = cur_geo_cmd_ptr(0x04);
graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList); graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList);
register_scene_graph_node(&graphNode->node); register_scene_graph_node(&graphNode->node);
gGeoLayoutCommand += 0x08; gGeoLayoutCommand += 0x04 + sizeof(void *);
} }
/* /*
@ -675,12 +674,12 @@ void geo_layout_cmd_node_generated(void) {
struct GraphNodeGenerated *graphNode; struct GraphNodeGenerated *graphNode;
graphNode = init_graph_node_generated(gGraphNodePool, NULL, graphNode = init_graph_node_generated(gGraphNodePool, NULL,
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // asm function (GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
cur_geo_cmd_s16(0x02)); // parameter cur_geo_cmd_s16(0x02)); // parameter
register_scene_graph_node(&graphNode->fnNode.node); register_scene_graph_node(&graphNode->fnNode.node);
gGeoLayoutCommand += 0x08; gGeoLayoutCommand += 0x04 + sizeof(void *);
} }
/* /*
@ -694,12 +693,12 @@ void geo_layout_cmd_node_background(void) {
graphNode = init_graph_node_background( graphNode = init_graph_node_background(
gGraphNodePool, NULL, gGraphNodePool, NULL,
cur_geo_cmd_s16(0x02), // background ID, or RGBA5551 color if asm function is null cur_geo_cmd_s16(0x02), // background ID, or RGBA5551 color if asm function is null
(GraphNodeFunc) cur_geo_cmd_s32(0x04), // asm function (GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function
0); 0);
register_scene_graph_node(&graphNode->fnNode.node); register_scene_graph_node(&graphNode->fnNode.node);
gGeoLayoutCommand += 0x08; gGeoLayoutCommand += 0x04 + sizeof(void *);
} }
// 0x1A: No operation // 0x1A: No operation
@ -749,11 +748,11 @@ void geo_layout_cmd_node_held_obj(void) {
read_vec3s(offset, (s16 *) &gGeoLayoutCommand[0x02]); read_vec3s(offset, (s16 *) &gGeoLayoutCommand[0x02]);
graphNode = init_graph_node_held_object( graphNode = init_graph_node_held_object(
gGraphNodePool, NULL, 0, offset, (GraphNodeFunc) cur_geo_cmd_s32(0x08), cur_geo_cmd_u8(0x01)); gGraphNodePool, NULL, NULL, offset, (GraphNodeFunc) cur_geo_cmd_ptr(0x08), cur_geo_cmd_u8(0x01));
register_scene_graph_node(&graphNode->fnNode.node); register_scene_graph_node(&graphNode->fnNode.node);
gGeoLayoutCommand += 0x0C; gGeoLayoutCommand += 0x08 + sizeof(void *);
} }
/* /*
@ -781,7 +780,7 @@ struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) {
gGeoLayoutStackIndex = 2; gGeoLayoutStackIndex = 2;
gGeoLayoutReturnIndex = 2; // stack index is often copied here? gGeoLayoutReturnIndex = 2; // stack index is often copied here?
gGeoLayoutCommand = (u8 *) segmented_to_virtual(segptr); gGeoLayoutCommand = segmented_to_virtual(segptr);
gGraphNodePool = pool; gGraphNodePool = pool;

View File

@ -19,12 +19,15 @@
#define cur_geo_cmd_u32(offset) \ #define cur_geo_cmd_u32(offset) \
(*(u32 *) &gGeoLayoutCommand[offset]) (*(u32 *) &gGeoLayoutCommand[offset])
#define cur_geo_cmd_ptr(offset) \
(*(void **) &gGeoLayoutCommand[offset])
extern struct AllocOnlyPool *gGraphNodePool; extern struct AllocOnlyPool *gGraphNodePool;
extern struct GraphNode *gCurRootGraphNode; extern struct GraphNode *gCurRootGraphNode;
extern UNUSED s32 D_8038BCA8; extern UNUSED s32 D_8038BCA8;
extern struct GraphNode **gGeoViews; extern struct GraphNode **gGeoViews;
extern u16 gGeoNumViews; extern u16 gGeoNumViews;
extern u32 gGeoLayoutStack[]; extern uintptr_t gGeoLayoutStack[];
extern struct GraphNode *gCurGraphNodeList[]; extern struct GraphNode *gCurGraphNodeList[];
extern s16 gCurGraphNodeIndex; extern s16 gCurGraphNodeIndex;
extern s16 gGeoLayoutStackIndex; extern s16 gGeoLayoutStackIndex;

View File

@ -497,7 +497,8 @@ struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *poo
*/ */
struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool,
struct GraphNodeHeldObject *graphNode, struct GraphNodeHeldObject *graphNode,
s32 objNode, Vec3s translation, struct GraphNodeObject *objNode,
Vec3s translation,
GraphNodeFunc nodeFunc, s32 unused) { GraphNodeFunc nodeFunc, s32 unused) {
if (pool != NULL) { if (pool != NULL) {
graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject)); graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject));
@ -506,7 +507,7 @@ struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *po
if (graphNode != NULL) { if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_HELD_OBJ); init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_HELD_OBJ);
vec3s_copy(graphNode->translation, translation); vec3s_copy(graphNode->translation, translation);
graphNode->objNode = (struct GraphNodeObject *) objNode; // assumed type graphNode->objNode = objNode;
graphNode->fnNode.func = nodeFunc; graphNode->fnNode.func = nodeFunc;
graphNode->unused = unused; graphNode->unused = unused;
@ -732,13 +733,13 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo
/** /**
* Initialize the animation of an object node * Initialize the animation of an object node
*/ */
void geo_obj_init_animation(struct GraphNodeObject *graphNode, void *sp34) { void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr) {
void **animSegmented = segmented_to_virtual(sp34); struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
struct Animation *anim = segmented_to_virtual(animSegmented[0]); struct Animation *anim = segmented_to_virtual(*animSegmented);
if (graphNode->unk38.curAnim != anim) { if (graphNode->unk38.curAnim != anim) {
graphNode->unk38.curAnim = anim; graphNode->unk38.curAnim = anim;
graphNode->unk38.animFrame = (anim->unk04) + ((anim->flags & ANIM_FLAG_FORWARD) ? 1 : -1); graphNode->unk38.animFrame = anim->unk04 + ((anim->flags & ANIM_FLAG_FORWARD) ? 1 : -1);
graphNode->unk38.animAccel = 0; graphNode->unk38.animAccel = 0;
graphNode->unk38.animYTrans = 0; graphNode->unk38.animYTrans = 0;
} }
@ -747,9 +748,9 @@ void geo_obj_init_animation(struct GraphNodeObject *graphNode, void *sp34) {
/** /**
* Initialize the animation of an object node * Initialize the animation of an object node
*/ */
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, void *sp34, u32 animAccel) { void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel) {
void **animSegmented = segmented_to_virtual(sp34); struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
struct Animation *anim = segmented_to_virtual(animSegmented[0]); struct Animation *anim = segmented_to_virtual(*animSegmented);
if (graphNode->unk38.curAnim != anim) { if (graphNode->unk38.curAnim != anim) {
graphNode->unk38.curAnim = anim; graphNode->unk38.curAnim = anim;

View File

@ -181,7 +181,8 @@ struct GraphNodeSwitchCase
/*0x1E*/ s16 selectedCase; /*0x1E*/ s16 selectedCase;
}; };
/** GraphNode that specifies the location and aim of the camera. /**
* GraphNode that specifies the location and aim of the camera.
* When the roll is 0, the up vector is (0, 1, 0). * When the roll is 0, the up vector is (0, 1, 0).
*/ */
struct GraphNodeCamera struct GraphNodeCamera
@ -401,7 +402,7 @@ struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool,
struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c, struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c,
u16 sp22, GraphNodeFunc sp24, s32 sp28); u16 sp22, GraphNodeFunc sp24, s32 sp28);
struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c, struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c,
s32 sp20, Vec3s sp24, GraphNodeFunc sp28, s32 sp2c); struct GraphNodeObject *objNode, Vec3s translation, GraphNodeFunc nodeFunc, s32 unused);
struct GraphNode *geo_add_child(struct GraphNode *, struct GraphNode *); struct GraphNode *geo_add_child(struct GraphNode *, struct GraphNode *);
struct GraphNode *geo_remove_child(struct GraphNode *); struct GraphNode *geo_remove_child(struct GraphNode *);
@ -413,8 +414,8 @@ void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 sp1c);
void geo_reset_object_node(struct GraphNodeObject *sp20); void geo_reset_object_node(struct GraphNodeObject *sp20);
void geo_obj_init(struct GraphNodeObject *sp18, void *sp1c, Vec3f sp20, Vec3s sp24); void geo_obj_init(struct GraphNodeObject *sp18, void *sp1c, Vec3f sp20, Vec3s sp24);
void geo_obj_init_spawninfo(struct GraphNodeObject *sp18, struct SpawnInfo *sp1c); void geo_obj_init_spawninfo(struct GraphNodeObject *sp18, struct SpawnInfo *sp1c);
void geo_obj_init_animation(struct GraphNodeObject *, void *); void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr);
void geo_obj_init_animation_accel(struct GraphNodeObject *sp30, void *sp34, u32 sp38); void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel);
s32 retrieve_animation_index(s32 a0, u16 **a1); s32 retrieve_animation_index(s32 a0, u16 **a1);

View File

@ -20,7 +20,7 @@
#include "goddard/renderer.h" #include "goddard/renderer.h"
#include "game/profiler.h" #include "game/profiler.h"
#define CMD_GET(type, offset) (*(type *) (offset + (u8 *) sCurrentCmd)) #define CMD_GET(type, offset) (*(type *) ((offset) + (u8 *) sCurrentCmd))
// These are equal // These are equal
#define CMD_NEXT ((struct LevelCommand *) ((u8 *) sCurrentCmd + sCurrentCmd->size)) #define CMD_NEXT ((struct LevelCommand *) ((u8 *) sCurrentCmd + sCurrentCmd->size))
@ -34,7 +34,7 @@ struct LevelCommand {
enum ScriptStatus { SCRIPT_RUNNING = 1, SCRIPT_PAUSED = 0, SCRIPT_PAUSED2 = -1 }; enum ScriptStatus { SCRIPT_RUNNING = 1, SCRIPT_PAUSED = 0, SCRIPT_PAUSED2 = -1 };
static u32 sStack[32]; static uintptr_t sStack[32];
static struct AllocOnlyPool *sLevelPool = NULL; static struct AllocOnlyPool *sLevelPool = NULL;
@ -43,8 +43,8 @@ static u16 sDelayFrames2 = 0;
static s16 sCurrAreaIndex = -1; static s16 sCurrAreaIndex = -1;
static u32 *sStackTop = sStack; static uintptr_t *sStackTop = sStack;
static u32 *sStackBase = NULL; static uintptr_t *sStackBase = NULL;
static s16 sScriptStatus; static s16 sScriptStatus;
static s32 sRegister; static s32 sRegister;
@ -85,32 +85,33 @@ static s32 eval_script_op(s8 op, s32 arg) {
static void level_cmd_load_and_execute(void) { static void level_cmd_load_and_execute(void) {
main_pool_push_state(); main_pool_push_state();
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT); load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)), MEMORY_POOL_LEFT);
*sStackTop++ = (u32) NEXT_CMD; *sStackTop++ = (uintptr_t) NEXT_CMD;
*sStackTop++ = (u32) sStackBase; *sStackTop++ = (uintptr_t) sStackBase;
sStackBase = sStackTop; sStackBase = sStackTop;
sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 12)); sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4 + 2 * sizeof(void *)));
} }
static void level_cmd_exit_and_execute(void) { static void level_cmd_exit_and_execute(void) {
void *targetAddr = CMD_GET(void *, 12); void *targetAddr = CMD_GET(void *, 4 + 2 * sizeof(void *));
main_pool_pop_state(); main_pool_pop_state();
main_pool_push_state(); main_pool_push_state();
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT); load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
MEMORY_POOL_LEFT);
sStackTop = sStackBase; sStackTop = sStackBase;
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(targetAddr); sCurrentCmd = segmented_to_virtual(targetAddr);
} }
static void level_cmd_exit(void) { static void level_cmd_exit(void) {
main_pool_pop_state(); main_pool_pop_state();
sStackTop = sStackBase; sStackTop = sStackBase;
sStackBase = (u32 *) *(--sStackTop); sStackBase = (uintptr_t *) *(--sStackTop);
sCurrentCmd = (struct LevelCommand *) *(--sStackTop); sCurrentCmd = (struct LevelCommand *) *(--sStackTop);
} }
@ -137,12 +138,12 @@ static void level_cmd_sleep2(void) {
} }
static void level_cmd_jump(void) { static void level_cmd_jump(void) {
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 4)); sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4));
} }
static void level_cmd_jump_and_link(void) { static void level_cmd_jump_and_link(void) {
*sStackTop++ = (u32) NEXT_CMD; *sStackTop++ = (uintptr_t) NEXT_CMD;
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 4)); sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4));
} }
static void level_cmd_return(void) { static void level_cmd_return(void) {
@ -150,7 +151,7 @@ static void level_cmd_return(void) {
} }
static void level_cmd_jump_and_link_push_arg(void) { static void level_cmd_jump_and_link_push_arg(void) {
*sStackTop++ = (u32) NEXT_CMD; *sStackTop++ = (uintptr_t) NEXT_CMD;
*sStackTop++ = CMD_GET(s16, 2); *sStackTop++ = CMD_GET(s16, 2);
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
@ -170,7 +171,7 @@ static void level_cmd_jump_repeat(void) {
} }
static void level_cmd_loop_begin(void) { static void level_cmd_loop_begin(void) {
*sStackTop++ = (u32) NEXT_CMD; *sStackTop++ = (uintptr_t) NEXT_CMD;
*sStackTop++ = 0; *sStackTop++ = 0;
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
@ -186,7 +187,7 @@ static void level_cmd_loop_until(void) {
static void level_cmd_jump_if(void) { static void level_cmd_jump_if(void) {
if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) {
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 8)); sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8));
} else { } else {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
@ -194,8 +195,8 @@ static void level_cmd_jump_if(void) {
static void level_cmd_jump_and_link_if(void) { static void level_cmd_jump_and_link_if(void) {
if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) {
*sStackTop++ = (u32) NEXT_CMD; *sStackTop++ = (uintptr_t) NEXT_CMD;
sCurrentCmd = (struct LevelCommand *) segmented_to_virtual(CMD_GET(void *, 8)); sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8));
} else { } else {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
@ -263,27 +264,29 @@ static void level_cmd_pop_pool_state(void) {
} }
static void level_cmd_load_to_fixed_address(void) { static void level_cmd_load_to_fixed_address(void) {
load_to_fixed_pool_addr(CMD_GET(void *, 4), CMD_GET(void *, 8), CMD_GET(void *, 12)); load_to_fixed_pool_addr(CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
CMD_GET(void *, 4 + 2 * sizeof(void *)));
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_load_segment(void) { static void level_cmd_load_raw(void) {
load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT); load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)),
MEMORY_POOL_LEFT);
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_load_compressed_segment(void) { static void level_cmd_load_mio0(void) {
load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8)); load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)));
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_19(void) { static void level_cmd_load_mario_head(void) {
// TODO: Fix these hardcoded sizes // TODO: Fix these hardcoded sizes
void *addr = main_pool_alloc(0xE1000, MEMORY_POOL_LEFT); void *addr = main_pool_alloc(0xE1000, MEMORY_POOL_LEFT);
if (addr != NULL) { if (addr != NULL) {
gdm_init(addr, 0xE1000); gdm_init(addr, 0xE1000);
gd_add_to_heap(gZBuffer, 0x25800); gd_add_to_heap(gZBuffer, SCREEN_WIDTH * SCREEN_HEIGHT * 2); // 0x25800
gd_add_to_heap(gFrameBuffer0, 0x70800); gd_add_to_heap(gFrameBuffer0, SCREEN_WIDTH * SCREEN_HEIGHT * 2 * 3); // 0x70800
gdm_setup(); gdm_setup();
gdm_maketestdl(CMD_GET(s16, 2)); gdm_maketestdl(CMD_GET(s16, 2));
} else { } else {
@ -292,8 +295,8 @@ static void level_cmd_19(void) {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_1A(void) { static void level_cmd_load_mio0_texture(void) {
func_80278304(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8)); func_80278304(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 4 + sizeof(void *)));
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
@ -368,7 +371,7 @@ static void level_cmd_end_area(void) {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_21(void) { static void level_cmd_load_model_from_dl(void) {
s16 val1 = CMD_GET(s16, 2) & 0x0FFF; s16 val1 = CMD_GET(s16, 2) & 0x0FFF;
s16 val2 = CMD_GET(u16, 2) >> 12; s16 val2 = CMD_GET(u16, 2) >> 12;
void *val3 = CMD_GET(void *, 4); void *val3 = CMD_GET(void *, 4);
@ -381,7 +384,7 @@ static void level_cmd_21(void) {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_22(void) { static void level_cmd_load_model_from_geo(void) {
s16 arg0 = CMD_GET(s16, 2); s16 arg0 = CMD_GET(s16, 2);
void *arg1 = CMD_GET(void *, 4); void *arg1 = CMD_GET(void *, 4);
@ -401,8 +404,8 @@ static void level_cmd_23(void) {
s16 model = CMD_GET(s16, 2) & 0x0FFF; s16 model = CMD_GET(s16, 2) & 0x0FFF;
s16 arg0H = CMD_GET(u16, 2) >> 12; s16 arg0H = CMD_GET(u16, 2) >> 12;
void *arg1 = CMD_GET(void *, 4); void *arg1 = CMD_GET(void *, 4);
arg2.i = CMD_GET(s32, 8); // store the raw word as a union s32. this allows is to reinterpret the // load an f32, but using an integer load instruction for some reason (hence the union)
// contents as a f32 without the value being converted implicitly. arg2.i = CMD_GET(s32, 4 + sizeof(void *));
if (model < 256) { if (model < 256) {
// GraphNodeScale has a GraphNode at the top. This // GraphNodeScale has a GraphNode at the top. This
@ -603,7 +606,7 @@ static void level_cmd_set_rooms(void) {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_39(void) { static void level_cmd_set_macro_objects(void) {
if (sCurrAreaIndex != -1) { if (sCurrAreaIndex != -1) {
gAreas[sCurrAreaIndex].macroObjects = segmented_to_virtual(CMD_GET(void *, 4)); gAreas[sCurrAreaIndex].macroObjects = segmented_to_virtual(CMD_GET(void *, 4));
} }
@ -655,7 +658,7 @@ static void level_cmd_nop(void) {
sCurrentCmd = CMD_NEXT; sCurrentCmd = CMD_NEXT;
} }
static void level_cmd_30(void) { static void level_cmd_show_dialog(void) {
if (sCurrAreaIndex != -1) { if (sCurrAreaIndex != -1) {
if (CMD_GET(u8, 2) < 2) { if (CMD_GET(u8, 2) < 2) {
gAreas[sCurrAreaIndex].dialog[CMD_GET(u8, 2)] = CMD_GET(u8, 3); gAreas[sCurrAreaIndex].dialog[CMD_GET(u8, 2)] = CMD_GET(u8, 3);
@ -748,18 +751,18 @@ static void (*LevelScriptJumpTable[])(void) = {
/*14*/ level_cmd_push_pool_state, /*14*/ level_cmd_push_pool_state,
/*15*/ level_cmd_pop_pool_state, /*15*/ level_cmd_pop_pool_state,
/*16*/ level_cmd_load_to_fixed_address, /*16*/ level_cmd_load_to_fixed_address,
/*17*/ level_cmd_load_segment, /*17*/ level_cmd_load_raw,
/*18*/ level_cmd_load_compressed_segment, /*18*/ level_cmd_load_mio0,
/*19*/ level_cmd_19, /*19*/ level_cmd_load_mario_head,
/*1A*/ level_cmd_1A, /*1A*/ level_cmd_load_mio0_texture,
/*1B*/ level_cmd_init_level, /*1B*/ level_cmd_init_level,
/*1C*/ level_cmd_clear_level, /*1C*/ level_cmd_clear_level,
/*1D*/ level_cmd_alloc_level_pool, /*1D*/ level_cmd_alloc_level_pool,
/*1E*/ level_cmd_free_level_pool, /*1E*/ level_cmd_free_level_pool,
/*1F*/ level_cmd_begin_area, /*1F*/ level_cmd_begin_area,
/*20*/ level_cmd_end_area, /*20*/ level_cmd_end_area,
/*21*/ level_cmd_21, /*21*/ level_cmd_load_model_from_dl,
/*22*/ level_cmd_22, /*22*/ level_cmd_load_model_from_geo,
/*23*/ level_cmd_23, /*23*/ level_cmd_23,
/*24*/ level_cmd_place_object, /*24*/ level_cmd_place_object,
/*25*/ level_cmd_init_mario, /*25*/ level_cmd_init_mario,
@ -773,7 +776,7 @@ static void (*LevelScriptJumpTable[])(void) = {
/*2D*/ level_cmd_2D, /*2D*/ level_cmd_2D,
/*2E*/ level_cmd_set_terrain_data, /*2E*/ level_cmd_set_terrain_data,
/*2F*/ level_cmd_set_rooms, /*2F*/ level_cmd_set_rooms,
/*30*/ level_cmd_30, /*30*/ level_cmd_show_dialog,
/*31*/ level_cmd_set_terrain_type, /*31*/ level_cmd_set_terrain_type,
/*32*/ level_cmd_nop, /*32*/ level_cmd_nop,
/*33*/ level_cmd_set_transition, /*33*/ level_cmd_set_transition,
@ -782,7 +785,7 @@ static void (*LevelScriptJumpTable[])(void) = {
/*36*/ level_cmd_set_music, /*36*/ level_cmd_set_music,
/*37*/ level_cmd_set_menu_music, /*37*/ level_cmd_set_menu_music,
/*38*/ level_cmd_38, /*38*/ level_cmd_38,
/*39*/ level_cmd_39, /*39*/ level_cmd_set_macro_objects,
/*3A*/ level_cmd_3A, /*3A*/ level_cmd_3A,
/*3B*/ level_cmd_create_whirlpool, /*3B*/ level_cmd_create_whirlpool,
/*3C*/ level_cmd_get_or_set_var, /*3C*/ level_cmd_get_or_set_var,

View File

@ -522,7 +522,7 @@ void alloc_surface_pools(void) {
sSurfacePool = main_pool_alloc(sSurfacePoolSize * sizeof(struct Surface), MEMORY_POOL_LEFT); sSurfacePool = main_pool_alloc(sSurfacePoolSize * sizeof(struct Surface), MEMORY_POOL_LEFT);
gCCMEnteredSlide = 0; gCCMEnteredSlide = 0;
func_802DA4DC(); reset_red_coins_collected();
} }
/** /**

View File

@ -30,8 +30,8 @@ s16 gCurrCourseNum;
s16 gCurrActNum; s16 gCurrActNum;
s16 gCurrAreaIndex; s16 gCurrAreaIndex;
s16 gSavedCourseNum; s16 gSavedCourseNum;
s16 D_8033A75E; s16 gPauseScreenMode;
s16 D_8033A760; s16 gSaveOptSelectIndex;
struct SpawnInfo *gMarioSpawnInfo = &gPlayerSpawnInfos[0]; struct SpawnInfo *gMarioSpawnInfo = &gPlayerSpawnInfos[0];
struct GraphNode **gLoadedGraphNodes = D_8033A160; struct GraphNode **gLoadedGraphNodes = D_8033A160;
@ -354,27 +354,27 @@ void render_game(void) {
gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00)); gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00));
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320, gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
240 - BORDER_HEIGHT); SCREEN_HEIGHT - BORDER_HEIGHT);
render_hud(); render_hud();
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, 320, 240); gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
render_text_labels(); render_text_labels();
do_cutscene_handler(); do_cutscene_handler();
print_displaying_credits_entry(); print_displaying_credits_entry();
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320, gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
240 - BORDER_HEIGHT); SCREEN_HEIGHT - BORDER_HEIGHT);
D_8033A75E = func_802DCD98(); gPauseScreenMode = render_menus_and_dialogs();
if (D_8033A75E != 0) { if (gPauseScreenMode != 0) {
D_8033A760 = D_8033A75E; gSaveOptSelectIndex = gPauseScreenMode;
} }
if (D_8032CE78 != NULL) { if (D_8032CE78 != NULL) {
make_viewport_clip_rect(D_8032CE78); make_viewport_clip_rect(D_8032CE78);
} else } else
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, 320, gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
240 - BORDER_HEIGHT); SCREEN_HEIGHT - BORDER_HEIGHT);
if (gWarpTransition.isActive) { if (gWarpTransition.isActive) {
if (gWarpTransDelay == 0) { if (gWarpTransDelay == 0) {

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