User Tools

Site Tools


super:data_locations:sprite_obj_locations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
super:data_locations:sprite_obj_locations [2020/03/04 03:05] – small rewording thing mccadsuper:data_locations:sprite_obj_locations [2020/03/07 16:20] (current) – Finishing and using your new sprite objects mccad
Line 23: Line 23:
 ===== Sprite object list ===== ===== Sprite object list =====
  
-^ Sprite Object ID      ^ Description       ^ Base tile number / palette bits   ^ +^ Sprite Object ID      ^ Description       ^ Base tile number / palette bits   ^ Notes    
-| 00    | Grapple Flash     | #$0000        | +| 00    | Grapple Flash     | #$0000        
-| 01    | Charge beam sparks     | #$0000        | +| 01    | Charge beam sparks     | #$0000        
-| 02    | Charge beam sparks + flash     | #$0000        | +| 02    | Charge beam sparks + flash     | #$0000        
-| 03    | Super missile explosion     | #$0000        | +| 03    | Super missile explosion     | #$0000        
-| 04    | Bomb explosion     | #$0000        | +| 04    | Bomb explosion     | #$0000        
-| 05    | Ice beam particles     | #$0000        | +| 05    | Ice beam particles     | #$0000        
-| 06    | Dud shot     | #$0000        | +| 06    | Dud shot     | #$0000        
-| 07    | Power bomb     | #$0000        | +| 07    | Power bomb     | #$0000        
-| 08    | Some sort of energy shot, only 1 frame     | #$0000        | +| 08    | Some sort of energy shot, only 1 frame     | #$0000        
-| 09    | Smoke plume     | #$0000        | +| 09    | Smoke plume     | #$0000        
-| 0A    | Dust 1     | #$0000        | +| 0A    | Dust 1     | #$0000        
-| 0B    | Dust 2     | #$0000        | +| 0B    | Dust 2     | #$0000        
-| 0C    | Unused? Explosion     | #$0000        | +| 0C    | Small explosion from the large enemy death AI     | #$0000        
-| 0D    | Small health pickup     | #$0000        | +| 0D    | Small health pickup     | #$0000        
-| 0E    | Large health pickup     | #$0000        | +| 0E    | Large health pickup     | #$0000        
-| 0F    | Morph bomb     | #$0000        | +| 0F    | Morph bomb     | #$0000        
-| 10    | Slower small health pickup     | #$0000        | +| 10    | Slower small health pickup     | #$0000        
-| 11    | Screw attack kill particles     | #$0000        | +| 11    | Screw attack kill particles     | #$0000        
-| 12    | Large, fast dust     | #$0000        | +| 12    | Large, fast dust     | #$0000        
-| 13    | Large, fast dust with a glitchy end frame     | #$0000        | +| 13    | Large, fast dust with a glitchy end frame     | #$0000        
-| 14    | Large, fast dust with an extended glitchy end frame     | #$0000        | +| 14    | Large, fast dust with an extended glitchy end frame     | #$0000        
-| 15    | Large, slow dust     | #$0000        | +| 15    | Large, slow dust     | #$0000        
-| 16    | Glitched space pirate shot?     | #$0000        | +| 16    | Glitched space pirate shot?     | #$0000        
-| 17    | Glitched space pirate shot?     | #$0000        | +| 17    | Glitched space pirate shot?     | #$0000        
-| 18    | Bubbles     | #$0000        | +| 18    | Bubbles     | #$0000        
-| 19    | Save station electricity?     | #$0000        | +| 19    | Save station electricity?     | #$0000        
-| 1A    | Slowly extending vertical shutter     | #$0000        | +| 1A    | Slowly extending vertical shutter     | #$0000        
-| 1B    | Somewhat quickly contracting vertical shutter     | #$0000        | +| 1B    | Somewhat quickly contracting vertical shutter     | #$0000        
-| 1C    | Elevator platform, permanent     | #$0000        | +| 1C    | Elevator platform, permanent     | #$0000        
-| 1D    | Large enemy explosion     | #$0000        | +| 1D    | Large enemy explosion     | #$0000        
-| 32    | Metroid electricity     | $0F96,X : ORA $0F98,       | +| 32    | Metroid electricity     | $0F96,X : ORA $0F98,       |Enemy DD7F must be allowed
-| 34    | Metroid shell     | $0F96,X : ORA $0F98,        |+| 34    | Metroid shell     | $0F96,X : ORA $0F98,        |Enemy DD7F must be allowed| 
 + 
 + 
 +---- 
  
 ====== Creating Custom Sprite Objects ====== ====== Creating Custom Sprite Objects ======
Line 64: Line 68:
   * $B4BE24 - The instruction lists for each sprite object; additional custom instruction lists can be placed anywhere in the bank.   * $B4BE24 - The instruction lists for each sprite object; additional custom instruction lists can be placed anywhere in the bank.
   * $B4C630 - Sprite Object Spritemaps; these can also be placed anywhere in the bank.   * $B4C630 - Sprite Object Spritemaps; these can also be placed anywhere in the bank.
 +
 +
 +----
 +
  
 ===== Repointing the Sprite Object Table ===== ===== Repointing the Sprite Object Table =====
Line 75: Line 83:
  
 At this point, all additional sprite objects and other modifications to your Sprite Object pointer table should be done to the newly repointed table. To avoid confusion, I suggest that you mark the old table as freespace by filling it with $FF At this point, all additional sprite objects and other modifications to your Sprite Object pointer table should be done to the newly repointed table. To avoid confusion, I suggest that you mark the old table as freespace by filling it with $FF
 +
 +Please note that Sprite Object pointers are not called by their address in the rom, but are instead called by their index in the Sprite Object pointer table. You can find the index by dividing their offset from the start of the table by 2. For instance, a Sprite Object who's pointer is $64 bytes from the start of the table would be spawned using the index $32.
 +
 +
 +----
 +
  
 ===== Creating and modifying Sprite Object instructions ===== ===== Creating and modifying Sprite Object instructions =====
Line 98: Line 112:
 Note: All relevant Sprite Object instructions can be found in [[http://patrickjohnston.org/bank/B4|PJ's bank log]]. Note: All relevant Sprite Object instructions can be found in [[http://patrickjohnston.org/bank/B4|PJ's bank log]].
  
 +Custom instruction lists can be placed anywhere within the bank. In order to call these instruction lists with a Sprite Object, you must add a new pointer to your Sprite Object pointerlist, which points to the start of your new instruction list.
 +
 +
 +----
 +
 +
 +===== Creating and modifying Spritemaps =====
 +
 +Sprite objects are not limited to single sprite tiles, but instead consist of several spritemaps, which are called by instructions and set to frame delays in order to create animated effects. In order to create visually unique sprite objects, you will need to create new spritemaps, or modify existing ones.
 +
 +Within Super Metroid, spritemaps are formatted like so:
 +<code>
 +$NNNN                     ;Number of sprite entries within this spritemap
 +$XX, $SS, $YY, $TT, $AA   ;Sprite entry 0
 +$XX, $SS, $YY, $TT, $AA   ;Sprite entry 1
 +...                       ;Sprite entry...
 +
 +$XX    ;X offset from the center of the spritemap
 +$SS    ;Size - +80 to set to 16x16, +01 to reverse the X offset.
 +$YY    ;Y offset from the center of the spritemap
 +$TT    ;Tile number. Counts from left to right, top to bottom.
 +$AA    ;Attributes. Starts at 20, +10 for layer priority, +40 for X flip, +80 for Y flip
 +
 +</code>
 +
 +Its important to note that spritemaps have NO terminator. Instead, the engine determines where and when to stop reading based on the initial 2 bytes of the spritemap.
 +
 +Custom spritemaps for sprite objects can be placed anywhere within the bank. Assuming you really know what you're doing, you could also potentially write a custom instruction to load a spritemap from a long address, but without doing so, spritemap load instructions can only be preformed using short addresses.
 +
 +
 +----
 +
 +
 +===== Finishing and using your new sprite objects =====
 +
 +Once you have assembled all of your desired spritemaps, and have written an instruction list which utilizes them, all that is left to do is add the entry to your Sprite Object Pointer table, and call it ingame.
 +In order to add the new Sprite Object to your pointer table, simply add the address of your instruction list to the pointer table. Make note of this new pointer's location within the table, as you will need to use this index within the table to spawn your sprite object. Once again, this index can be calculated by dividing the new pointer's offset from the start of the table by 2.
  
 +In summary: Sprite Objects are driven and controlled by their Instruction Lists, which point to and animate their spritemaps.
super/data_locations/sprite_obj_locations.1583291109.txt.gz · Last modified: 2020/03/04 03:05 by mccad