$008000
|
39 bytes |
ASM |
This is the starting address of SMW. This takes care of basic initialization such as disabling IRQ, HDMA, DMA, clearing the SPC ports, enabling F-blank, disabling emulation mode, disabling decimal mode, initializing the direct page, and setting up the stack. |
$008027
|
43 bytes |
ASM |
This is code is responsible for uploading the OAM clear routine to $7F8000. The uploaded routine is essentially an unrolled loop which stores #$F0 to all of the OAM mirror($0200) Y positions. |
$008052
|
25 bytes |
ASM |
This is the main part of the SMW initialization routine. SPC engine upload, sample upload, OAM setup, windowing setup, and RAM clearing all happens here. |
$00806B
|
14 bytes |
ASM |
This is the main game loop of SMW. It is used to wait for V-blank to complete before executing the code of the next frame. One of the frame counters ($13) is also incremented here. |
$00810E
|
15 bytes |
Subroutine (JSR) |
OW Music uploader. |
$008134
|
37 bytes |
Subroutine (JSR) |
Uploads level music bank. |
$008159
|
17 bytes |
Subroutine (JSR) |
Credit music uploader. |
$00816A
|
522 bytes |
Misc. |
SMW's NMI routine. For more information, see here. |
$008179
|
49 bytes |
ASM |
Handles transfers to and from the SPC700 (I/O). Changing all values to [EA] (NOP) or jumping over the code effectively mutes all sound. |
$008293
|
1 byte |
Misc. |
How many scanlines the status bar uses during a regular level. |
$00835D
|
1 byte |
Layer 3 |
How many scanlines the status bar uses during the battles with Bowser, Ludwig, and Reznor. |
$008370
|
1 byte |
Layer 3 |
How many scanlines the status bar and ceiling use during the battles with Morton and Roy. |
$008374
|
162 bytes |
Misc. |
SMW's IRQ routine. |
$008449
|
44 bytes |
Misc. |
Code that transfer Sprite OAM mirror (sprite OAM table at $7E0200-$7E041F, a total of 544 bytes) to register $2104 to draw sprites. |
$008494
|
52 bytes |
Sprite tilemap related |
Copies OAM's extra bits (size and 9th bit X position: %000000SX) data stored in $7E0420, and reformats, or “compacts” each 4 bytes of that into each byte to $7E0400 (%SXSXSXSX). |
$0420 and $0400 format
|
$0084C8
|
8 bytes |
Subroutine (JSL) |
JSL wrapper for the stripe image uploader (pointer lies in $12), which can be found at $0085D2. Because it upload tiles, it must run in either f- or v-blank (e.g. in NMI). |
$0084D0
|
258 bytes |
Stripe Image |
Stripe image pointer table. Each 24-bit pointer here corresponds to a value of $12, but only multiples of 3 are used (the first pointer is for value $00, the second is for value $03, the third for $06, etc.). |
$0085D2
|
40 bytes |
Subroutine (JSR) |
Subroutine which uploads the stripe image pointed by $12 to VRAM. The pointer is loaded from the table at $0084D0, and then the routine at $00871E is called. Afterwards, if $12 is #$00, the stripe image length at $7F837B is set to 0 and the terminator $FF is written to the beginning of $7F837D. In any case, $12 is reset to 0 before returning.
To call this routine from outside bank 0 you can JSL to the wrapper at $0084C8. This should only be done during a blank period (usually NMI). |
$0085FA
|
86 bytes |
Subroutine (JSR) |
Fills the entire layer 3 tilemap with tile 0x0FC (transparent tile) i.e. the code "empties" it. Also wipes the OAM before returning. |
$008650
|
119 bytes |
Subroutine (JSR) |
This is the routine that polls the controller and updates $15, $16, $17, $18.
$0086A0 (x8A0) - Change to [9C A0 0D AD A0 0D A2 00] to cause both player 1 & 2 to be controlled by controller 1. |
$0086C7
|
24 bytes |
Subroutine (JSR) |
Subroutine that initializes the OAM table in Roy, Morton and Ludwig's rooms. It first initializes the first 100 tiles to be 16x16 (by setting $0420,x to #$02), then jumps in the middle of the standard OAM clear routine (JSL $7F812E). |
$0086DF
|
27 bytes |
Subroutine (JSL) |
Pointer subroutine: Jump to a 2-byte pointer, the position of the pointer used is "Position after the JSL + 1 + (A*2)". The subroutine should always be accessed by a JSL. |
$0086FA
|
36 bytes |
Subroutine (JSL) |
Pointer subroutine: Jump to a 3-byte pointer, the position of the pointer used is "Position after the JSL + 1 + (A*3)". The subroutine should always be accessed by a JSL. |
$00871E
|
143 bytes |
Stripe Image |
Stripe Image Uploader. Uses $00-$02 as a 24-bit pointer to tile data. See this thread how the stripe image format works. Must be run during a blank, usually NMI.
To call from a custom routine, do this:
- Store stripe image pointer (24-bit) to $00-$02
- Push 24-bit return address (bank -> mid -> lo)
- PHB : LDA #$00 : PHA : PLB
- PEA $84CD
- JSL $00871E |
$0087AD
|
617 bytes |
Subroutine (JSL) |
This routine is the DMA routine in charge of updating layers one and two as needed. This is controlled by the addresses $1BE4 and $1CE6 when they are a non-zero value. |
Follow Us On