Commit Graph

172 Commits (08c6ff061e00aab5fce5f306800980331fed7664)

Author SHA1 Message Date
MysterD eb2ede88fa Fix up includes for clang 2022-08-05 20:55:31 -07:00
MysterD 74afddef7b Enforce type lengths for bin compression 2022-08-05 19:12:57 -07:00
MysterD df286fe9d3 added more info to uncompress error 2022-08-05 18:43:45 -07:00
MysterD 72a9a2f5af Display uncompress error 2022-08-05 18:04:33 -07:00
MysterD 66d38e8791 Prevent double free in DynOS compression code 2022-08-05 15:10:00 -07:00
PeachyPeach 92f4b22015 DynOS Bin Compression (#131) 2022-06-25 00:52:53 -07:00
MysterD fe6bc9405c Refactor sync objects, move syncIds to u32 2022-06-06 19:13:04 -07:00
MysterD 1a1f593a38 Added ability to have completely custom levels that don't override anything 2022-06-05 21:55:31 -07:00
Isaac0-dev 40cdfc28f5 Raspberry Pi Support (#117) 2022-06-05 19:40:21 -07:00
MysterD 4a93e44779 Allowed LEVEL_ENDING to be overridden by DynOS 2022-06-02 22:06:33 -07:00
MysterD 12af07a5e9 More custom bhv cleanup 2022-06-02 19:33:28 -07:00
MysterD 03b21082a6 Cleanup ; recursive descent fixes ; fixed behavior override comparisons
Moved dynos parsing for bhvs and models to a common file
Fixed recursive descent to correctly parse the entire expression
Adjusted bhv generation to use recursive descent
Switched all known behavior comparisons to the overridden versions
Fixed issue with Chain Chomp in star road
2022-06-02 19:07:43 -07:00
Prince Frizzy 2a611034a6 Added a full new custom behavior system (#124) 2022-06-02 12:19:54 -07:00
MysterD efaf87ab11 Unhardcoded more values ; generated more tex files ; special set home function ; fixed lua bhv bugs
Unhardcoded KingBobomb values, Mips values, star dialog values
Generated tex files when they're of the form levels/XXX/NUMBER
Now lua behaviors can call cur_obj_set_home_once() to set home correctly
Lua behaviors are now overridden correctly when created through spawn infos
Behavior checks now translate to the overridden behavior before checking
2022-06-01 23:04:21 -07:00
MysterD 8fd9d76f5a Fix mac compile 2022-05-28 21:09:27 -07:00
MysterD e829943461 Allow set_mario_colors on any layer, add recursive descent to geo parsing, fix color flashing in Arena 2022-05-28 01:26:40 -07:00
PeachyPeach f433dbfcf6 Fixed various audio bugs; DynOS can now detect texture duplicates to decrease generated bin files size (#110)
Fixed the following audio bugs:
    Bug: Rom-hacks sequences don't seem to be affected by volume scaling and
         muting
    Fix: Force the BGM sequences to follow the vanilla behavior:
        Volume can't go higher than default volume
        Volume is reduced to 31% when the game is paused
        Audio is stopped when the game is paused outside the Castle levels
    Bug: (Pointed out by Draco) Mario's voice clips are not replaced by the
         player's character's in the following instances: fall to death
         barrier, "here we go" in the ending cutscene, "let's a go"
         after selecting a star, "okey dokey" after starting the game.
    Fix: The first two ones now call
         play_character_sound(m, CHAR_SOUND_...) instead of
         play_sound(SOUND_MARIO_..., pos). The last two ones couldn't be
         fixed the same way for two reasons: First, the corresponding sounds
         were not referenced in the sound table, second, the sound played is
         always cut-off after a few frames (due to how sm64 resets the sound
         banks after loading a level).

Added SOUND_*_LETS_A_GO and SOUND_*_OKEY_DOKEY sounds for each playable
    character as Bass samples.
    Character Bass sounds work the same way as vanilla sounds (i.e. can be
    played with play_character_sound), but they cannot be prematurely stopped
    by sm64 sound banks shenanigans.
    This fixes the cut-off for both the star select and the castle grounds
    entry, plays the sound corresponding to the player's character, and doesn't
    need to extend or edit the sound table.

DynOS can detect texture duplicates when generating a bin or lvl file.
    When a duplicate is detected, the name of the original texture node is
    written instead of the whole PNG data, decreasing significantly the
    resulting file size.
2022-05-19 16:40:45 -07:00
PeachyPeach 18503ecc52 Various bug fixes + Added is_game_paused() and more background music functions to lua (#93)
Bug: DynOS models with animations cannot swap animations if they are
     loaded via lua (smlua_model_util_get_id and
     obj_set_model_extended).
Fix: DynOS_Actor_GetActorGfx takes a graph node instead of a georef,
     and checks for DynosValidActors graph nodes if georef is NULL.

Bug: The game can crash when calling obj_set_model_extended inside a
     HOOK_ON_OBJECT_RENDER hook.
Fix: The crash happens in smlua_model_util_load_with_pool_and_cache_id
     due to pool being NULL. If the game can't allocate an
     AllocOnlyPool object, use DynOS to generate the graph node.

Bug: warp_to_level and similar functions don't trigger HOOK_ON_WARP.
Fix: Call HOOK_ON_WARP hooks in DynOS_Warp_UpdateWarp and
     DynOS_Warp_UpdateExit after level and mario initialization.

Bug: The game sometimes calls HOOK_ON_OBJECT_RENDER hooks for
     unintended objects.
Fix: Initialize hookRender field to 0 when creating an object.

Bug: Actions can't apply gfx offsets to characters that have an anim
     offset (Waluigi, Wario)
Fix: Add m->curAnimOffset to gfx.pos[1] instead of setting it to
     m->pos[1] + m->curAnimOffset, except during the jumbo star
     cutscene.
2022-05-14 14:28:25 -07:00
EmeraldLoc 75a83d6244 Fixed mac compilation (#88) 2022-05-10 21:20:19 -07:00
MysterD 679c5963a3 Attempt #3 2022-05-09 09:45:14 -07:00
MysterD 4f8c58faf6 Actual fix for crash when disconnecting with custom models in level 2022-05-09 09:28:20 -07:00
MysterD 319736520c Fixed crash when disconnecting with custom models in the level 2022-05-09 08:40:18 -07:00
MysterD f9411da5a6 Started working toward allowing disconnection 2022-05-09 07:27:47 -07:00
PeachyPeach 82aca5404e More rom-hacks globals to lua; more bug fixes (#84)
New gLevelValues exposed to lua:
        pssSlideStarTime: the time limit in frames for PSS-style levels (default: 630)
        pssSlideStarIndex: the index of the star spawned below the time limit for PSS-style levels (default: 1)
        coinsRequiredForCoinStar: number of coins required to spawn the 7th star of a main course (default: 100)
        wingCapDuration: duration in frames of the wing cap (default: 1800)
        metalCapDuration: duration in frames of the metal cap (default: 600)
        vanishCapDuration: duration in frames of the vanish cap (default: 600)
        wingCapDurationTotwc: duration in frames of the wing cap given to the player at the entrance of TOTWC (default: 1200)
        metalCapDurationCotmc: duration in frames of the metal cap given to the player at the entrance of COTMC (default: 600)
        vanishCapDurationVcutm: duration in frames of the vanish cap given to the player at the entrance of VCUTM (default: 600)
    Fixed a bug preventing the level music from restarting after defeating a Boss.
    Fixed some bugs with 3D coins or any model with the geo_rotate_coin function:
        Disable billboard and cylboard attributes.
        Set the pitch and roll to 0 for the model to rotate properly.
        The model no longer rotates every frame (even when the game is paused), but every time the object is updated.
2022-05-08 12:18:25 -07:00
MysterD 0b7e4244e7 Only load DynOS model or texture packs once they're enabled 2022-05-07 18:20:53 -07:00
MysterD 5a81f072e0 Fixed custom textures on Windows 2022-05-07 16:39:19 -07:00
MysterD 39244b11aa Fix various checks for whether or not we should generate tex files 2022-05-07 15:54:27 -07:00
MysterD 51296bd36b Allow Lua to get any vanilla texture 2022-05-07 03:05:25 -07:00
MysterD e1fd969cf3 Add support for custom HUD textures and faster texture packs w/o EXTERNAL_DATA 2022-05-06 22:03:12 -07:00
MysterD b313e402c9 Automatically disable billboards on DynOS models with >6 vertices 2022-05-04 00:14:33 -07:00
PeachyPeach 208c092e12 [BUG FIX] DynOS Bin Vtx overflow (#79)
Vertex coords are saved as s16 instead of f32 inside DynOS .bin files,
causing unintended overflow for vertex coords outside of the range
[-32768, +32767]. The format cannot be changed without breaking all
existing DynOS models, so, when writing a .bin file, a sentinel value
is added at the top of the vertex buffer for buffers that need f32
coords. If that sentinel is detected during the reading process,
the next vertex coords will be read as f32 instead of s16.
2022-05-02 17:31:29 -07:00
MysterD 41aac2a3c4 Possible mac compile fix 2022-04-23 15:54:39 -07:00
MysterD 55ed56b7f4 Revert DynOS auto-disable-billboard 2022-04-23 14:28:02 -07:00
MysterD 40896e09d0 Prevent DynOS packs from being enabled then disabled on launch 2022-04-23 03:23:30 -07:00
MysterD 0f821483b1 Automatically disable billboards when a DynOS model uses more than 6 vertices 2022-04-23 03:05:16 -07:00
MysterD a8fbf26338 Fix crash when toggling dynos packs 2022-04-23 02:22:12 -07:00
MysterD 03b81569e9 More performance improvements 2022-04-22 20:57:18 -07:00
MysterD 4a4501d0e4 Fixed finding of renamed custom actors 2022-04-22 18:54:11 -07:00
MysterD a3df8d9c0b Massive DynOS refactor for performance/organization 2022-04-19 21:06:18 -07:00
MysterD 8ddf90a058 Make DynOS texture lookup use a set for performance 2022-04-19 18:24:26 -07:00
MysterD b856648d6e Fix bug in dynos level gen of custom behaviors 2022-04-18 23:13:11 -07:00
MysterD 0c696edf0c Display a message on screen when script errors are found 2022-04-16 22:47:16 -07:00
MysterD d7bd7be7c5 Have level scripts prefer their local datanodes 2022-04-16 22:06:38 -07:00
Prince Frizzy 7c5261554e Merge in small changes. (#63) 2022-04-16 19:12:12 -07:00
MysterD b6be0a0e78 Rewrite of hash/cache system 2022-04-16 13:05:10 -07:00
MysterD 2636185156 Stop music on dynos warp 2022-04-15 19:32:53 -07:00
MysterD 70143353bf Prevent DynOS from attempting to generate lvls when they already exist 2022-04-15 18:24:17 -07:00
MysterD f774f34863 Prevent generating extra geos for player models, allow referencing mario textures 2022-04-14 21:49:41 -07:00
MysterD a51e85531a Fix buffer overrun 2022-04-13 21:24:38 -07:00
MysterD 75a46622f3 Added actor textures to dynos builtin list; added shadow_spike_ext 2022-04-13 19:13:25 -07:00