* Lots of code_80071F00 matches
Also removed a bunch of fake variables related to the object list.
Also gave names to some of the members of the object list type
Signed-off-by: Taggerung <tyler.taggerung@email.com>
* Make adjustments to the Mario Raceway course file
Added quotes in "*.mk" to the find command for finding the .mk files.
* Make adjustments to the Choco Mountain course file
* Make adjustments to the Frappe Snowland course file
* Make adjustments to the Toad's Turnpike course file
* Make adjustments to the Moo Moo Farm course file
* Make adjustments to the Luigi Raceway course file
* Make adjustments to the Koopa Troopa Beach course file
* Make adjustments to the Kalimari Desert course file
* Make adjustments to the Bowser's Castle course file
* Make adjustements to the Wario Stadium course file
* Make adjustments to the Sherbet Land course file
* Make adjustments to the Royal Raceway course file
* Make adjustments to the Banshee Boardwalk course file
* Make adjustments to the Yoshi Valley course file
* Make adjustments to the Rainbow Road course file
* Make adjustments to the Big Donut course file
* Make adjustments to the Block Fort course file
* Remove some unneeded lines from the Makefile
Signed-off-by: Taggerung <tyler.taggerung@email.com>
Mostly relocating rodata from data/* files to the appropriate
asm/nonmatching/* files, although there is some plain data
relocating to be found in here too.
Big change to note is the addition of the code_802AAA70.c file,
split from memory.c. Based on some padding in the ro/data for
memory it seems clear that a split is needed, although it is
not clear that exact spot chosen for the split is correct.
Still, it gets the file padding for the ro/data and text segments
correct so it can't be too wrong.
Also included is an update to the asm_processor tool to support
the .hword directive. I made a PR to the main repo of that
project with an identical change and it was accepted.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Give names to some textures
* Match a couple functions
* Remove a use of bin2c from the makefile
* Its a little strange, but two of the portrait textures share
a TLUT. I believe this necessitates that the portraits be
part of the same PNG file.
* 2nd portrait referenced in undefined_syms.txt
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Identified a couple more lists of object list indices, added some
comments indicating what they're used for. Those comments are
most likely non-exhaustive so there's still some investigation
to be done there.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Matches, add permute, and add notice to quick runners
* 80281fa0 matches, render_courses, and create defines for audio
* Renamed 80281fa0.h, func naming, and deleted data_121DA0
* Added clang format
* Matched load_surface_map
* Match func in memory.c
* Updated the Makefile to make the VERSION_US file
get used when compiling stuff.
* Updated the abi.h file to match SM64, with some modifications to
support the currently targeted version (US).
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Matches and m2c refreshing for code_80057C60
* Convert some Vtx's into a Mtx
Based on the usage of D_0D008E98, it seems like it should be a
Mtx. So this commit changes some Vtx's into a Mtx
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Couple matches functions, an update to a struct, a bunch of header
files adjustments, and some mips_to_c regenerations
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* More matches for code_800431B0
* Also added a header for the common_textures file since some other
files use the Gfx/Vtx variables defined there
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Required making an adjustment to the object struct, which was required to fix some other files.
* Decompiled some gfx
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Add a lot of header files
Did my best to move all relevant function prototypes and external
variable declarations into the header files too.
Matched a few functions in the process
* Updated progress.py
Some of the listed files/folders have been deleted/renamed,
so I reflected those changes in progress.py
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match a lot of functions, add header for objects
* Refreshed a TON of functions and created/added to several
header files
* Add header for code_800431B0, address comments
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Fix some of the memory allocation in framebuffers
Also includes a the questionable change of undoing a previously
made match for func_80027A20. The changes made here remove an
AVOID_UB usage and (I would argue) is therefore more "correct",
but undoing a byte-for-byte match is admittedly bad.
Also adds in some header files and updates some not-quite-right
decomps to be slighly more accurate.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Introduce waypoint struct, which code_80005FD0 seems to be
involved with.
Updated several mips_to_c outputs as well.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* change return type of func_8000546C
* try to fix submodules
* update asm_processor for new ASM directives
* split code_800AF8B0 into 3 files; move rodata into files/asm
* move rodata into code_800AF9B0 asm funcs
* decomp func_800AF9E4
* match 800AFF58
* merge in master (renamed code_800AF9B0.c to menus.c)
* revert menus.c back to code_800AF9B0.c
* add bss to code_800AF9B0
* rename code_800B0350.c to menus.c
* remove unused ALIGN macros
Matched its rodata too
Required making a minor adjustment to the Player struct, which
required updating a couple of other files
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This required making some minor adjustments to a struct in
common_structs.h, which further required a couple tiny updates to
some functions in a couple other files. Nothing too crazy.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Required getting the .rodata for that file correct too.
Matched a couple other funtions here and there as well.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Update header files for main, memory and math_util
* Required updating func_802A82E4 to keep the match
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* import random_u16 to sm64
* rand math decomp
* Match func_80298AC0
* Match some actor funcs
* Renames
* update gitignore for .bin textures
* update player struct member 34 to Vec3f
* Named and documented actor destroy funcs
I misunderstood how unions worked. In order to accomplish the
original goal, the 3 named s16's need to be in a struct instead
of just floating around.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Identify some Actor count variables
* Match place_all_item_boxes
Also more accurately define the UknownRock struct. Some of the
track specific data is spawning points for the "permanent"
actors (stuff like falling rocks, shrubbery, item boxes, etc.)
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Add a define for the size of the actor list, and add a comment
cautioning people about how to appropriately interact with
the specialized types.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* More actor decomp
* memory.c decomp plus bss import into actor code
* Match actors and segment D match
* Match common_textures.inc.c
* Add tool bin2c.py
* Added more actor types and some defines
Also adjusted the generic Actor struct to have some of its members
have names that are generally reasonable for all types of actors
Added a union to the BananActor struct, makes accessing the `rot`
member and the overlapping id/index members more sensible
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Add some more actor types, match a function
* Identify the boundBox member of the Player struct
Note that while the `flag` members are signed, they should be understood as just a group of bits.
Based on some googling around (see https://stackoverflow.com/a/11644749) the operation `thing.flag |= 0x8000`
is NOT undefined behaviour, even though that is setting the sign bit.
The numerical interpretation of the result as a signed number is implementation defined, while the
actual operation acts on the bit representation of the number.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
There's no reason to have our own special type when it exactly matches a GBI type.
This required updating some inc.c data as the old mk_Vtx_Flag type had the 'flag'
member in the incorrect location.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Sourced from https://github.com/micro500/mariokart64/wiki/Surface-Map,
only minor adjustments were made.
Updated the bounding box corner struct a little based on information from
the surface map struct.
Refreshed several mips_to_c outputs
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Some of the variables defined in kart_attributes.c had they're type wrong when
being used in other files.
This means that some previously defined variable no longer exist, however
that's fine as they were never directly referenced. Their existence was
almost certainly a decomp artifact.
For example, D_800E2404 was never "real". Instead it was likely a compiler
artifact caused by accessing D_800E2400 at the hard coded index of 1.
I've updated kart_attributes.h to reflect these changes
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
* Match func_802B5450, func_802B5F00, func_802B71CC
* Match func_802B4FF8
Also do some import fixing
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Move texture data from asm to C
Required dropping a couple typedefs since they no longer had a purpose
Regenerated a couple mips_to_c outputs based on the updated types
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match func_800AB290 and func_800AC978
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match func_800A15EC
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match func_800A1A20
* Get func_800A1F30 to NON_MATCHING
* Match func_800A3C84
mips_to_c does not currently support labels being in delay slots, although
practice that is fine. To get around this I put a nop in the delay slot
instead. No permanent change is being made to the target assembly.
* Update the mips_to_c output for a couple functions
Split asm file containing unused funcs and added mips_to_c output for them.
* Remove extraneous data file
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match func_800A4B38
* Match func_800A6034
* Change type of "blue" argument
This allows the function's type signature to look the same as the other
box drawing function.
* Match func_800AC300
* Matched func_800AAEF4
* Matched func_800AAF30 and func_800AAF70
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match func_80021C78
* Match func_8006E8C4
* Match func_80295BF8
* Match func_8001F980 (already matching)
* Match func_800219BC
* Match func_80022A98
* Add item defines
* Update the GfxPool struct and match some functions
Also reordered variables.h a bit
* Match 2 more functions
* Replace reaming ->buffer references with ->mtxPool
Update the mips_to_c output of a couple functions based on new GfxPool
definition
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Match functions related to struct at D_8018EE10
* Remove asm for matched functions
* Match func_800B64EC, func_800B6708, and func_800B6798
* Match func_80091EE4. Fix unused variable warnings in code_80091750.c
* Name some of the fields in struct_8018EE10_entry
* Name variables related to selecting a game from the main menu
* Match a couple functions requiring jumptable
* Match func_800B4728
* Match func_800B536C, func_800B5888, func_800B5AAC, and func_800B5AD8
* Name functions related to loading and validating SaveData
* Match func_800B4CB4
* Update selected player defines
* Match func_800B5404
* Match func_800B6088
* Add a couple header files
These files contain function prototypes for matches functions, NON_MATCHING functions,
and functions used by matched functions.
At this point in time those headers may contain prototypes for functions defined in
unrelated files, but fixing that will have take time
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Meaningful commit message
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Identify another struct and array
Regenerated a lot of mips_to_c code based on these identifications
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Decompile a couple code_800AF9B0 functions
* Match func_800B34E8, func_800B44AC, and func_800B45E0
* Use sizeof in func_800B45E0 instead of hard-coded numbers
* Match func_800B4520. Separate unused function func_800B4560 into new asm file
* Match func_800B5B2C and func_800B6A68. Create new unused func_800B6AF8
* Match func_800B4874 and func_800B4A10
* Improve matched functions reading time trial records
* Match func_800B13B0. Name variables related to data menu
* Match func_800B3B58. Remove warnings due to pointer type in osEepromLongWrite calls
* Rename gStartMenuCounterForDemos to gMenuTimingCounter
* Match func_800B5F30
Some of this is identifying some functions and structs related to the Controller
pak menu
Some of it is related to structs concerning textures and "animations" and their
associated functions
* Match draw_box, func_80098C18, func_80098FC8
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
gNextDemoId is a little weird. If a demo is currently running that variable is the ID
of the demo that will run next. It's never "current", its always one step ahead
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Text Color defines
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Updates based on comments
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* fixed float issue brought over from zeldaret
* Import trig_tables.inc.c
* Delete game_data_802BA370.s
* Import two funcs from sm64 into code_80004740.c
* Give names to some Grand Prix related variables
Namely variables related to points and standings
Also added some observational comments to a function
or two
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* Add defines for character IDs
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Gave some Player struct members proper names, mostly related to kart hop physics.
Renamed a couple of tables in kart_attributes to make their purpose and nature more obvious
Matched func_8002AAC0 with its assembly representation
Matched func_800225CC with its assembly representation
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
* match func_80000D3C + some renames
* Improved matching for init_game().
* Match thread5_game_logic
* Added osViModeTable and osCreateViManager from libultra