sotn-decomp/.gitignore

36 lines
438 B
Plaintext
Raw Normal View History

2022-01-01 17:45:41 +00:00
main.exe
DRA.BIN
2022-03-07 22:46:43 +00:00
BIN/ARC_F.BIN
BIN/RIC.BIN
2022-01-20 22:02:05 +00:00
ST/
2022-01-01 17:45:41 +00:00
2022-10-15 10:18:32 +00:00
ctx.c
2022-10-15 10:45:20 +00:00
ctx.c.m2c
Custom debugging module (#108) # What Adds a custom debug menu. It is written in C and it is meant to replace the Bat familar `SERVANT/TT_000.BIN`. Once loaded you can long-press SELECT+START to soft-reset the game and keep using the debug menu everywhere, including when playing with Richter or during the credits. One key requirement to run this is to have an emulator that emulates the 8MB of RAM. This is a key requirement to have the debug module surviving soft-resets or accessing to the in-game menu. I personally used [PCSX Redux](https://github.com/grumpycoders/pcsx-redux) to build this module. I am not sure about the compatibility with other emulators. This does **NOT** work on real hardware and it is a choice by design. The debug module is intended to test different areas of the game and help decompiling. It is not intended to be used in normal gameplay. # Build Simply invoke `make disk_debug` to create a disk image of the game in `build/` with the debug module replacing the Bat familiar. # Usage ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/15a040b6-6191-41c4-b2b8-a4a906ed59eb) On PCSX Redux go to Configuration, Emulation and tick the box `8MB`. ## Loading the module ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/65b7ccb3-800e-4b66-84f5-5703fc91babe) You need to enable the Bat Card from the menu. This will load the debug module from the disk. If you want to re-load the module you need to select another Familar Card, un-pause, pause again and select the Bat Card once more. ## The main screen ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/b528425a-ea6c-4c10-9c19-522612d0ad2a) You will know you have loaded the debug module when you see the blue rectangle on the top right. You can press R2 to cycle between the menus. Some menus will temporarily freeze the game, some not. To quickly return in-game you can either press TRIANGLE or START. To bring back the paused debug menu just press R2 once again. ## Debug Mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/12cac1ee-725b-484f-8564-89c03b6a755b) ### Stage Teleports the player to a different stage. It is not stable and it can crash often. ### Player Switches between Alucard and Richter. Currently switching from Richter to Alucard consistently crashes the game. ### No Clip Allows to freely move the player within the room and without the collisions on. Once the flag is enabled from the debug menu, pressing L2 while in-game will temporarily freeze the player movement and make it immune to collision checking. You can then press the directional buttons to slowly move the player or you can hold CROSS to move it faster. You can also use SQUARE or CIRCLE to cycle between the player frames. Press L2 again to deactivate the NoClip mode. ### Frame by frame Freezes the game outside the debug module. Press L1 to advance by 1 frame. Hold L2 to put the game in slow-motion. ### Show hitboxes ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/ea8dd918-cf37-4be1-bb87-541a66ac7f16) As shown in the image ### Show debug messages ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/5c9bc7b2-6bc7-4831-949a-bf73cdf910e8) When the debug menu is un-paused, prints on the top left all the debug messages from the game itself. ### Show collision layer ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/959ad1ab-dfe0-42fe-a8d0-65c619469280) This prints the internal collision value for every 16x16 tile on the screen. Look the CheckCollision function for more information on how each printed value is used. ### Show draw calls ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/a52970fc-bf30-430d-98e3-5fca33c9f6f7) Shows the maximum GPU resource usage since the game started. Currently only the `max` option works. The `current` option will not show anything. ### Show HBlank ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/81759019-6bf9-4cf2-b88c-aa60eaa5ddcb) Prints the current horizontal blank interrupt count. ## Entity Spawn ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/f0fdc024-4537-4c07-a80d-816d605a3583) Allows to immediately spawn new entities in the current map ### Mode There are three list of entities, each one with their own ID: DRA, Stage and RIC. The option RIC is hidden if Richter is not the current playing character. As the list of entities per stage is maintained manually, stage entities might not be available for all stages. The `Alloc` shows how many entities are reserved or actually used. Pressing the SQUARE button here will destroy all the entities within that range. ### ID Press Left or Right to cycle between the different IDs available. Some of them might crash the game immediately once spawned. Press CROSS to immediately spawn the entity. ### Params Each entity might have its own parameters. Sometimes the flag 0x8000 is used, which can be toggled with the SQUARE button. Press CROSS to immediately spawn the entity. ### Entity preview Shows the entity before spawning it. This is turned off by default as it can immediately crash by cycling through the available entity IDs. ### Place entity Pressing CROSS will allow to move the entity across the screen before placing it. Press CROSS again to place the entity and return to the previous screen. Press SQUARE to quickly place multiple entities of the same type. ## Sound player ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/9d8ad3a5-bc78-4674-abd0-94537bbfae98) There are three macro categories the sound player is split into. For what is currently known only the sounds within the Kind 3 changes based on the loaded stage. ### Stop all sounds This will also disable the SPU IRQ, effectively unlocking the frame rate. ### Load Stage Loads a different sound font than the current loaded stage. This can help to quickly preview and test SFXs from other stages without necessarily moving the player there. ### Load Servant Loads the sound font of a specific servant without necessarily equipping the Familiar Card. ## Castle flags Preview all the flags used to modify the behaviour of different parts of the two castles. ### Edit mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/b03ada2f-0fb4-4345-ad50-81209702032c) You can move the cursor with the directional buttons and flip the flag with CROSS. Press L1 or R1 to cycle between the pages. The cursor warps when reaching the border of the flag grid, allowing a faster navigation. ### View mode Allows to move between the flags more flexibly. ### Listen mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/4f9ed118-d09d-4658-ba25-5865dbebbf3c) Listens for the modified flags while playing. Every time a flag is modified the offset and its value is registered on the top left up to 4 rows. When all the rows are occupied, new values will just remove the oldest one. The last modified flag will always be displayed at the bottom. --------- Co-authored-by: Alejandro Asenjo Nitti <sonicdcer@users.noreply.github.com> Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-08-10 17:55:24 +00:00
*.map
2022-01-01 17:45:41 +00:00
*auto.*.txt
2022-01-20 22:02:05 +00:00
generated.symbols.*.txt
2022-01-01 17:45:41 +00:00
__pycache__
asm/
/assets/
2022-10-25 20:26:35 +00:00
build/
expected/
2023-02-21 23:25:24 +00:00
disks/
2023-03-16 12:31:37 +00:00
.vscode/settings.json
New asset manager (#1343) This aims to deprecate all the Splat tools in `tools/splat_ext` in favour of a more centralised asset manager. This brings the following advantages: * Much faster extraction * Faster build * Automatically define `static` symbols or unique names whenever `static` is not possible * Allow to embed assets into the output binary * Drastically simplify `Makefile` by removing all the asset build rules * Avoid situations where it is not possible to extract and build assets that is not 4-byte aligned This is achieved by having the splat YAML targeting a normal C file as data and have an external tool to take care of the following: 1. Extract asset files straight from the overlay binary file into human readable file in `assets/st/STAGE_NAME` 2. Build assets as header files that go into `src/st/STAGE_NAME` to just include them from any C file This requires each stage header to have the following new format: please see `src/st/nz0/header.c` Built assets in `src/st` are ignored by Git. As for now, for simplicity sake, the steps `make extract_assets` and `make build_assets` are just executed within `make extract` exclusively for the US version. I plan to auto-generate files such as `src/st/nz0/tile_data.c`. For a first iteration I am aiming to handle the following: * [X] Extract rooms: `assets/st/*/rooms.json` * [X] Extract room layers: `assets/st/*/entity_layouts.json` * [X] Extract tilemap data: `assets/st/*/tilemap_*.bin` * [X] Extract tilemap definitions: `assets/st/*/tiledef_*.json` * [X] Extract sprites: `assets/st/*/sprites.json` * [x] Extract entity layouts * [X] Build rooms: `src/st/*/rooms.h` * [X] Build room layers: `src/st/*/layers.h` * [X] Build tilemap data: `src/st/*/tilemap_*.h` * [X] Build tilemap definitions: `src/st/*/tiledef_*.h` * [x] Build sprites (aka `g_SpriteBanks`) * [x] Build entity layouts * [x] Allow the tool to suggest how to adjust the Splat config for each overlay I want the tool to cover the following stages: * [x] CEN * [x] DRE * ~MAD~ I do not think this can be done, it is way too different from the other overlays * [x] NO3 * [x] NP3 * [X] NZ0 * [x] ST0 * [X] WRP * [x] RWRP * ~WRP (PSP)~ Maybe in a follow-up PR For a later iteration I plan on extracting and build: * Entity GFX thingie * The CLUT thingie in the header * Uncompressed GFX data * Cutscene data * Blueprints * The `src/config_us.h` thingie --------- Co-authored-by: Josh Lory <josh.lory@outlook.com>
2024-07-02 20:38:36 +00:00
.idea/
Python virtualenv Support (#1620) Ubuntu/Debian and Python recommend using virtual environments for project-specific Python dependencies and as of Ubuntu 24 this is lightly enforced when installing packages via pip. This is due to pip and the system package manager installing files to the same location which may cause either's internal state to no longer reflect what is actually installed. This updates the project to use a Python `virtualenv` for project dependencies and updates internal scripts to support both global and virtualenvs, but favors virtualenvs for new workspaces. All tools that hardcode `/usr/bin/python3` now use `env(1)` to find the first `python3` in the path. For those with a virtualenv configured, this will be the Python managed there. For everyone else, this should be the system Python or whatever other scheme they may have used previously (assuming `python3` already existed in their `PATH`). The `Makefile` has been updated to prepend `.venv/bin` to the `PATH` and use `python3` from there if it exists and has been configured. It also has a new `python-dependencies` target which will configure the venv and install all python dependnecies there. The `Dockerfile` has been updated to create an external `.venv` outside of the project directory. Python's `virtualenv`s are not relocatable and may hardcode paths which are mounted differently in the container and host. To deal with differences in paths between the container (which mounts the host's project directory to `/sotn`) host which may be at an arbitarary directory the `VENV_PATH` environment variable is used to override paths in the `Makefile`. GitHub workflows have been updated to use `.venv`.
2024-09-18 06:19:20 +00:00
.venv/
tools/go
Custom debugging module (#108) # What Adds a custom debug menu. It is written in C and it is meant to replace the Bat familar `SERVANT/TT_000.BIN`. Once loaded you can long-press SELECT+START to soft-reset the game and keep using the debug menu everywhere, including when playing with Richter or during the credits. One key requirement to run this is to have an emulator that emulates the 8MB of RAM. This is a key requirement to have the debug module surviving soft-resets or accessing to the in-game menu. I personally used [PCSX Redux](https://github.com/grumpycoders/pcsx-redux) to build this module. I am not sure about the compatibility with other emulators. This does **NOT** work on real hardware and it is a choice by design. The debug module is intended to test different areas of the game and help decompiling. It is not intended to be used in normal gameplay. # Build Simply invoke `make disk_debug` to create a disk image of the game in `build/` with the debug module replacing the Bat familiar. # Usage ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/15a040b6-6191-41c4-b2b8-a4a906ed59eb) On PCSX Redux go to Configuration, Emulation and tick the box `8MB`. ## Loading the module ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/65b7ccb3-800e-4b66-84f5-5703fc91babe) You need to enable the Bat Card from the menu. This will load the debug module from the disk. If you want to re-load the module you need to select another Familar Card, un-pause, pause again and select the Bat Card once more. ## The main screen ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/b528425a-ea6c-4c10-9c19-522612d0ad2a) You will know you have loaded the debug module when you see the blue rectangle on the top right. You can press R2 to cycle between the menus. Some menus will temporarily freeze the game, some not. To quickly return in-game you can either press TRIANGLE or START. To bring back the paused debug menu just press R2 once again. ## Debug Mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/12cac1ee-725b-484f-8564-89c03b6a755b) ### Stage Teleports the player to a different stage. It is not stable and it can crash often. ### Player Switches between Alucard and Richter. Currently switching from Richter to Alucard consistently crashes the game. ### No Clip Allows to freely move the player within the room and without the collisions on. Once the flag is enabled from the debug menu, pressing L2 while in-game will temporarily freeze the player movement and make it immune to collision checking. You can then press the directional buttons to slowly move the player or you can hold CROSS to move it faster. You can also use SQUARE or CIRCLE to cycle between the player frames. Press L2 again to deactivate the NoClip mode. ### Frame by frame Freezes the game outside the debug module. Press L1 to advance by 1 frame. Hold L2 to put the game in slow-motion. ### Show hitboxes ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/ea8dd918-cf37-4be1-bb87-541a66ac7f16) As shown in the image ### Show debug messages ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/5c9bc7b2-6bc7-4831-949a-bf73cdf910e8) When the debug menu is un-paused, prints on the top left all the debug messages from the game itself. ### Show collision layer ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/959ad1ab-dfe0-42fe-a8d0-65c619469280) This prints the internal collision value for every 16x16 tile on the screen. Look the CheckCollision function for more information on how each printed value is used. ### Show draw calls ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/a52970fc-bf30-430d-98e3-5fca33c9f6f7) Shows the maximum GPU resource usage since the game started. Currently only the `max` option works. The `current` option will not show anything. ### Show HBlank ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/81759019-6bf9-4cf2-b88c-aa60eaa5ddcb) Prints the current horizontal blank interrupt count. ## Entity Spawn ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/f0fdc024-4537-4c07-a80d-816d605a3583) Allows to immediately spawn new entities in the current map ### Mode There are three list of entities, each one with their own ID: DRA, Stage and RIC. The option RIC is hidden if Richter is not the current playing character. As the list of entities per stage is maintained manually, stage entities might not be available for all stages. The `Alloc` shows how many entities are reserved or actually used. Pressing the SQUARE button here will destroy all the entities within that range. ### ID Press Left or Right to cycle between the different IDs available. Some of them might crash the game immediately once spawned. Press CROSS to immediately spawn the entity. ### Params Each entity might have its own parameters. Sometimes the flag 0x8000 is used, which can be toggled with the SQUARE button. Press CROSS to immediately spawn the entity. ### Entity preview Shows the entity before spawning it. This is turned off by default as it can immediately crash by cycling through the available entity IDs. ### Place entity Pressing CROSS will allow to move the entity across the screen before placing it. Press CROSS again to place the entity and return to the previous screen. Press SQUARE to quickly place multiple entities of the same type. ## Sound player ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/9d8ad3a5-bc78-4674-abd0-94537bbfae98) There are three macro categories the sound player is split into. For what is currently known only the sounds within the Kind 3 changes based on the loaded stage. ### Stop all sounds This will also disable the SPU IRQ, effectively unlocking the frame rate. ### Load Stage Loads a different sound font than the current loaded stage. This can help to quickly preview and test SFXs from other stages without necessarily moving the player there. ### Load Servant Loads the sound font of a specific servant without necessarily equipping the Familiar Card. ## Castle flags Preview all the flags used to modify the behaviour of different parts of the two castles. ### Edit mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/b03ada2f-0fb4-4345-ad50-81209702032c) You can move the cursor with the directional buttons and flip the flag with CROSS. Press L1 or R1 to cycle between the pages. The cursor warps when reaching the border of the flag grid, allowing a faster navigation. ### View mode Allows to move between the flags more flexibly. ### Listen mode ![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/4f9ed118-d09d-4658-ba25-5865dbebbf3c) Listens for the modified flags while playing. Every time a flag is modified the offset and its value is registered on the top left up to 4 rows. When all the rows are occupied, new values will just remove the oldest one. The last modified flag will always be displayed at the bottom. --------- Co-authored-by: Alejandro Asenjo Nitti <sonicdcer@users.noreply.github.com> Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-08-10 17:55:24 +00:00
!tools/sotn-debugmodule/sotn-debugmodule.ld
2023-06-03 18:09:44 +00:00
tools/saturn_toolchain/GCCSH
config/saturn/game_syms.txt
config/saturn/stage_02_syms.txt
config/saturn/t_bat_syms.txt
config/saturn/zero_syms.txt
sotn_calltree.txt
function_calls
gmon.out