893 Commits
Author SHA1 Message Date
JaceCearandOliver Bell 1bb658fbbc More align SA1 and SA2 (#203)
* Align InitPlayerHitRingsScatter

* Align InitScatteringRings

* More rings_scatter.c alignment

* More general alignment with SA1

* Align INCREMENT_SCORE macros with SA1

* Align Task_8008DCC with SA1

* Align Demo Manager with SA1

* Some minor cleanup

* Document static PlayerSpriteInfo vars

* Remove nonmatch SA1 code from entities_manager.c and rigns_scatter.c

* Use SA1's matching, yet technically bugged, loop in InitializePlayer

* Fix a potential bug due to memory alignment in Player struct

* Fix crashes due to uninitialized pointers

* Simplify InitializePlayer

Co-authored-by: Oliver Bell <freshollie@gmail.com>

-----------------------------------------

Co-authored-by: Oliver Bell <freshollie@gmail.com>
2025-02-14 12:31:38 +01:00
Oliver Bell f28508ac87 match multiplayer indicators 2025-02-12 16:45:27 +00:00
Oliver Bell 7bf4860079 match Task_801951C 2025-02-12 01:11:46 +00:00
Oliver Bell 443f5d2ec4 match Task_RingsMgrMain 2025-01-28 00:46:13 +00:00
Oliver Bell c2954e3b52 fake match sub_804AE40 2025-01-24 00:43:47 +00:00
Oliver Bell 68ec412457 match sub_804F1EC 2025-01-22 23:17:44 +00:00
Oliver Bell fe9e7c0b09 match sub_804FC10 2025-01-22 21:55:44 +00:00
Oliver BellandMCboy 81376b5c56 match sub_800DF8C
Co-authored-by: MCboy <atasro2@gmail.com>
2025-01-22 11:58:08 +00:00
Oliver BellandMCboy 0b6965bbb8 match CreateTrueArea53Boss
Co-authored-by: MCboy <atasro2@gmail.com>
2025-01-22 11:25:14 +00:00
Oliver Bell 2cc6095e70 match sub_804FAA4 2025-01-22 01:37:09 +00:00
Fractal c4b50f9bb1 Research & Document various commonly used objects & systems (#194)
* document ItemBox object

* research & document Spring object

* research & document Platform objects

* research & document misc shared objects

* research & document a ton of player related vars & funcs

* research & document spikes object

* research & document Checkpoint

* research & document StageGoal & RoomEvent

* add RoomEvent type parameters

* add comment(s) for future research
2025-01-21 13:08:31 +00:00
Oliver Bell 191f6d815c match SpawnMapEntities 2025-01-20 10:06:58 +00:00
Oliver Bell 188ebc4a9e match entities manager Task_8008DCC 2025-01-20 09:08:48 +00:00
Oliver Bell 05eebf465f match sub_80064A8 and sub_8006228 2025-01-19 23:37:30 +00:00
JaceCear 2508a8d1a2 Document Spotlight Beam func names (#193)
* Document Spotlight Beam func names

* Rename spot_light_subtask.c -> spot_light_beam_task.c
2025-01-19 22:00:46 +01:00
Oliver Bell c6a0a8c614 match sub_803FF44 2025-01-16 01:06:36 +00:00
Oliver Bell e0eaf39e4c match sub_803FC14 2025-01-15 02:04:53 +00:00
Oliver BellandMCboy e74b8a5f3a match sub_800C4FC
Co-authored-by: MCboy <atasro2@gmail.com>
2025-01-15 01:49:22 +00:00
Oliver Bell c20fd5e97c match final intro function 2025-01-13 21:50:29 +00:00
Oliver Bell 46c43f12d9 match more boss functions 2025-01-13 20:10:10 +00:00
Oliver Bell 743b2cb31d match sub_804E15C 2025-01-13 01:06:21 +00:00
Oliver Bell 91d071968d match AeroEgg_InitPartsDefeated 2025-01-12 19:44:04 +00:00
Oliver Bell d3110b8234 match Task_802F9F8, better task matches 2025-01-12 19:04:07 +00:00
Oliver Bell 756104b4bb mark the rest of math as unused 2025-01-12 01:14:55 +00:00
Oliver Bell 9944eacfde more matches, some matching improvements 2025-01-09 00:26:42 +00:00
Oliver Bell a86b727e8d match Zone7BgUpdate_Outside 2025-01-06 23:05:18 +00:00
Oliver Bell a8fdb6b771 match sub_802DF18, attempt to match sub_804AE40 2025-01-06 01:05:48 +00:00
Oliver Bell db841c44cd decompile sub_802E784, fix some macos compiler issues 2025-01-05 23:34:28 +00:00
JaceCear ac3c4ebca6 Rename Player.x|y -> .qWorldX|qWorldY and SpecialStagePlayer.x -> .q1… (#177)
* Rename Player.x|y -> .qWorldX|qWorldY and SpecialStagePlayer.x -> .q16WorldX|.q16WorldY

* Align Music Manager with SA1

* stage/game_2 -> grind_effect_2

* SpriteTransform.x|y -> .qScaleX|Y

* Auto-insert platform #define for convenience
2025-01-05 23:41:36 +01:00
JaceCear 4aa35ee10b Some more documentation and cleanup (#176)
* Some cleanup in title_screen.c

* Some documentation in unused_level_select.c

* Unify sa1_sa2_shared/collision.c and collision_1.c

* Remove sub_800D0A0 from stub.c

* Small pieces of documentation

* Document some globals and align characters.h with SA1

* Mostly align amy_attack_heart_effect.c with SA1

* Rename file of Ring -> Magnetic Ring

* Align save.h with SA1

* Rename Player.unk90|unk94 -> Player.spriteInfoBody|Limbs

* Add some comments

* Rename Spark Effect -> Grind Effect, document SA1's and SA2's versions a bit
2025-01-05 00:50:31 +01:00
Oliver Bell a6a6c61cdc fix some non matches 2024-12-31 18:17:27 +00:00
JaceCear 57376092f0 Various RAM map documentation and alignment with SA3 (#175)
* Various documentation and alignment with SA3

* Extract input_recorder.c .data section from core.c, as in SA3

* Align multi_sio.c with SA3

* Document parameters of DisplaySprites

* Document centerOffsetX/Y in DisplaySprites

* Only display copyright note

* Split GAME_ and ENGINE_ macros

* Use ENGINE macros in core.c

* Rename game<->engine interface procedures

* Remove searching in /src for header files in genctx.py

* Fix global.h<->config.h dependency in genctx.py

* Only enable Task logging in debug versions

* Fix uses of DEBUG, remove TEST_GFX_POINTERS because current gfx copy implementation already makes it redundant

* Use 64bit as default target in Win SDL

* Align some files with sa1 and sa3

* Align sprite.c and other files closer with sa1 and sa3

* Various documentation

* Some dodumentation and cleanup from SA1 core.c integration

* Rename sa1_leftovers/ -> sa1_sa2_shared/

* Put gEwramHeap into ewram_data section
2024-12-28 21:12:56 +01:00
JaceCear aabbf861da Document Backgrounds queue (#170) 2024-11-08 18:55:48 +01:00
Oliver Bell b32c325b4b match grindrail 2024-11-02 01:30:52 +00:00
Oliver Bell a9b54a03f8 match grind rail air, fix speeding platform 2024-11-01 18:34:39 +00:00
Oliver Bell e4e58af16c finish decompiling water effects 2024-10-30 01:46:43 +00:00
JaceCearandOliver Bell 1f8bee518d Implement m4a for PC (#166)
* Refactor m4a for better names
* Bring in m4a PC backend code
* Update songs data to work on 64bit
* Move m4a to it's own folder
* Add linker map to sdl build

---------

Co-authored-by: Oliver Bell <freshollie@gmail.com>
2024-10-28 11:07:36 +00:00
Oliver Bell e9124c295e match magnetic ring and flipped gravity rings scatter 2024-10-21 19:36:53 +01:00
Oliver Bell 8402d023b9 match RingsScatterSingleplayer_NormalGravity 2024-10-21 17:47:35 +01:00
Oliver Bell 2890d4c4be match some easy fixes 2024-10-18 11:52:18 +01:00
Oliver Bell 0342efa64b match sub_802302C 2024-10-18 03:21:15 +01:00
1bc34d0ac8 Move Animation data to C, fix native sdl build (#157)
* Remove and move comments to the correct procedures

* Fix regular SDL compilation

* Move animation data from Asm to C

* Layout the anim macros in a common way. Add Big Endian support to them (I think?)

* add CI for sdl objs, fix some of the build on linux

* make native macos work

---------

Co-authored-by: bitten2up <bitten2up@courvix.com>
Co-authored-by: Oliver Bell <freshollie@gmail.com>
2024-10-10 01:07:04 +01:00
JaceCear 8d3dc36b97 Documentation and 'sakit' rename to 'sa1_leftovers'. (#155)
* Rename SpriteBase.spriteY -> SpriteBase.id

* Add explicit returns after TaskDestroy calls

* Rename 'sakit' -> 'sa1_leftovers' and put it into ./src/game/

* Some documentation

* Document more Player Transition values

* Rename to Player_Debug_TestRingScatter

* Use cast to make this code path compile in regular debug builds
2024-09-08 15:35:17 +02:00
JaceCear 7687ec7fe7 Introduce and document CHARSTATE values and general Player documentation (#154)
* Document some Player callbacks

* Add SE_WATERFALL_SURFACE_HIT and add TRUE/FALSE to Player.isBoosting definitions

* Add constants/char_states.h, add those to sCharStateAnimInfo

* Document many uses of CHARSTATE_xyz

* Remove magic nums when comparing/setting Player.prevCharState

* Document PlayerTransitions and some Spring data

* Document various PlayerTransitions, charStates and player callback functions

* Document a bunch of Player function names

* Fix NONMATCH path typo and more Player funcs

* Document MOVESTATE_GOAL_REACHED

* Document Player Taunt procedure names

* Remove gotos in sub_8023610

* More Player documentation

* More character documentation

* Add DISABLE_TRICK_AIR_WAIT to player.h
2024-08-26 22:47:54 +02:00
Oliver Bell 12c9b05e2a merge bg triangle files 2024-08-19 00:57:15 +01:00
Oliver Bell b827e3e7fc merge math file together 2024-08-18 20:08:06 +01:00
JaceCear 8fdd433a2b Some matching improvements, documentation and make fixes (#151)
* Some cleanup for sub_802DF18, but still non-matching

* Almost match sub_802E278, down to one add instr

* Some grind variable documentation

* Fix some of the logic in sub_801EE64

* Some general documentation

* Document Bouncy Bar tasks and fix compilation

* Some documentation in rotating handle

* Fix standalone compile/link

* Add standalone build CI

* Fix copy-paste of Q_24_8

* Align whitespace

* Potential random crash fix

* Add some DMA doc to standalone

* Remove old nonmatch ASM and add SDL comment

* Cleanup and #ifdef fix in player.c
2024-07-28 23:25:50 +02:00
Oliver Bell be7a797a58 match CreateCharacterSelectionScreen 2024-07-03 01:35:16 +01:00
JaceCear 564b3b876c More matches, Sprite.unk10 -> .frameFlags, Sprite.unk1A -> .oamFlags (#148)
* Match sub_802966C, fixing some control issues

* Some additions to Task_CreateStageUnknownTask

* Make CreateCharacterSelectionScreen scratch more recent

* Cleanup

* boss_run.s data -> boss_run.c

* Merge boss_run and boss_8

* Rename BOSS_8_ARM_ -> ARM_, since it's a local macro, anyway

* Remove boss_run from ldscript

* Remove data stubs

* Inline StageInit_SetMusic as was probably the case originally

* Some documentation

* Minor documentation

* Sprite.unk10 -> .frameFlags

* Sprite.unk1A -> .oamFlags

* Formatter...

* Set all Sprite.oamFlags values using SPRITE_OAM_ORDER macro

* Minor documentation

* Get logic of sub_8004860 to match the game closer, but ASM percentage is worse.

* Fix big parts of sub_8004860's logic, still not matching very well

* Rename sub_8004860 -> TransformSprite

* Minor cleanup

* Add potential fix for tile copying

* Reorder DMA offsets

* Add SDL fullscreen (Alt+Return)

* Formatter

* SPRITE_MAYBE_SWITCH_ANIM -> SPRITE_INIT_ANIM_IF_CHANGED

* Add graphics queue macros

* Reorder for compiler flags

* Add GFX Queue macros and logging

* Reformulate task logging

* Reorder compiler flags

* Minor boss8 cleanup

* Use new DMA layout

* Replace Div and Mod calls with macros

* Minor cleanup

* Add EXTENDED_OAM (WIP)

* Camera.unk38|.unk3C -> .dx|.dy

* Split logging output

* Fix syntax error
2024-07-03 01:07:19 +01:00
JaceCearandOliver Bell fd116efcf2 Solve some non-matches and document stuff (#147)
* Match MaskPaletteWithUnderwaterColor

* Document CheeseTarget and HomingTarget. Some cleanup

* Implement sub_8085968, but non-matching

* Ollie matched sub_8085968

Co-authored-by: Oliver Bell <freshollie@gmail.com>

* EXTRA_STATE__* -> STAGE_FLAG__*

* Document Gravity Toggle

* Minor documentation in stage 2 background

* Rename IS_OUT_OF_GRAV_TRIGGER_RANGE -> IS_OUT_OF_CAM_RANGE_2

* Prettify ternary operators

* Simplify sub_807E66C

* Make StageBgUpdate_Zone2Acts12 match vanilla more closely

* More progress on StageBgUpdate_Zone2Acts12

* ReadMe -> ReadMapEntity

* Some documentation for Collect Ring's time_display.c

* Split math_0.s at unsed functions

---------

Co-authored-by: Oliver Bell <freshollie@gmail.com>
2024-06-28 09:58:35 +02:00