-
Notifications
You must be signed in to change notification settings - Fork 21
SRC Folder Overview
This is the starting point for the assembler. Other .asm files are referenced from here with the incsrc command. Some build options can also be found here, such as the RAW_TILE_GRAPHICS option.
This file contains macros for the assembler. When a macro is used elsewhere, the assembler replaces it with the code that is defined here. The most commonly used macros are for changing the width (8bit/16bit) of the accumulator (A) and index (X/Y) registers.
Defines are string replacements used by the assembler. They are used to label memory addresses and constant values so they are more humanly readable. During assembly, they will be converted into the proper binary values.
This file is for the game loop hijack where the game state code is located and executed. It's used to check inputs for matching controller shortcuts and execute them. At the end of any shortcut routines, the carry flag is either set to skip processing game state code, or cleared to continue execution when returning from the hijack.
This is the savestate code which can be excluded if DFEATURE_SD2SNES is set to 0 as an assembler option in the build script.
The bulk of the practice hack's HUD features live here or are included here. Hijacks for timers, segments, and the HUD update routine are at the top. Subroutines are bundled into a common org. The main game loop routine handles input display, HUD display modes, and other features that need to be executed every frame. InfoHUD modes and room strats are incsrc'd from a separate file but still bundled in the common org when assembled. The very bottom of the file contains pointer tables for HUD graphics and routines that must live in bank $80.
Due to the growing number of features, and the complexity of those new features, the HUD display modes (including Room Strats) were moved into a separate file to make infohud.asm easier to navigate.
Here you will find all of the framework needed to pause the game, draw the various menu options, navigate those options, and execute their functions. The data used to draw the menu options is incsrc'd here as mainmenu.asm and bundled in the same org.
The data for each menu option is defined here. This is the primary starting point for contributors that don't have assembly knowledge. A clever system of macros are defined at the top of the file, along with some code specifically for Preset menus. The main menu section starts with a list of pointers to each menu item, followed by the menu macro (%cm_) which tells the code what type of option it is, what text to draw, and any other values and pointers needed. All of the options on the main menu are submenus, meaning they lead to another menu setup the same way (list of pointers, macros for each pointer, and any related code/data).
Routines related to loading presets live here. Category preset data and menus are incsrc'd at the bottom.
These files list the pointers and menu macros for a preset category. They are generated automatically by the teledump.lua script found in the tools directory.
These files list the data that is loaded into memory by the preset routines. Each preset contains only the data that changed since the previous preset. These files are generated automatically by the teledump.lua script. Manual edits are sometimes made to make adjustments or workaround shortcomings of the Preset system.
This file contains hijacks related to the HUD and minimap. Graphics for the HUD and map are included here as binary data files with the incbin command.
Despite the mundane name, this file contains a lot of critical code/data. Pause/unpause hooks, music/sound fx, artificial lag, copy protection, debug routines and more!
This file contains the RAM initialization routine that runs on boot/reset. All SRAM addresses should be initialized to a known/sane value before being used for the first time. New SRAM values are added in a way that keeps older SRAM versions compatible with new ones.
This file is for hijacks and code related to RNG features such as Phantoon's pattern selection.
Hijacks related to the item fanfare and message boxes.
This is an OAM routine hijack that allows Samus to be placed on the top graphics layer.
This file hijacks the sprite drawing routine to add features such as out of bounds tile and hitbox viewers.
This file contains hijacks for door ASM. It also contains patches to make rooms match Area Randomizer layouts.
Code related to cutscenes and other idle sequences are included here.
Menu code/data related to the RAM Watch/Editor lives here. Code related to displaying RAM Watch values in the HUD live in infohudmodes.asm
Decompressed tile graphics, tables, and palettes are incsrc'd here along with their own routines for loading them. When RAW_TILE_GRAPHICS is enabled, the Presets feature will use make use of the pre-decompressed data to speed up loading times significantly. These graphics are only used when loading presets, and will not change how graphics are loaded during normal gameplay. This feature can be toggled in main.asm as a build option or in the Presets Menu, which may be necessary if applying other patches to the practice hack.
Need help? Practice Hack maintainers can be found in the SM Speedrunning Discord. #practice-hack