-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more binary mappings!
- Loading branch information
Showing
495 changed files
with
16,343 additions
and
1,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
; macro to declare a mappings table (taken from Sonic 2 Hg disassembly) | ||
mappingsTable macro {INTLABEL} | ||
__LABEL__ label * | ||
.current_mappings_table := __LABEL__ | ||
endm | ||
|
||
; macro to declare an entry in a mappings table (taken from Sonic 2 Hg disassembly) | ||
mappingsTableEntry macro ptr | ||
dc.ATTRIBUTE ptr-.current_mappings_table | ||
endm | ||
|
||
spriteHeader macro {INTLABEL} | ||
__LABEL__ label * | ||
if SonicMappingsVer==1 | ||
dc.b ((__LABEL___End - __LABEL___Begin) / 5) | ||
elseif SonicMappingsVer==2 | ||
dc.w ((__LABEL___End - __LABEL___Begin) / 8) | ||
else | ||
dc.w ((__LABEL___End - __LABEL___Begin) / 6) | ||
endif | ||
__LABEL___Begin label * | ||
endm | ||
|
||
spritePiece macro xpos,ypos,width,height,tile,xflip,yflip,pal,pri | ||
if SonicMappingsVer==1 | ||
dc.b ypos | ||
dc.b (((width-1)&3)<<2)|((height-1)&3) | ||
dc.b ((pri&1)<<7)|((pal&3)<<5)|((yflip&1)<<4)|((xflip&1)<<3)|((tile&$700)>>8) | ||
dc.b tile&$FF | ||
dc.b xpos | ||
elseif SonicMappingsVer==2 | ||
dc.w ((ypos&$FF)<<8)|(((width-1)&3)<<2)|((height-1)&3) | ||
dc.w ((pri&1)<<15)|((pal&3)<<13)|((yflip&1)<<12)|((xflip&1)<<11)|(tile&$7FF) | ||
dc.w ((pri&1)<<15)|((pal&3)<<13)|((yflip&1)<<12)|((xflip&1)<<11)|((tile>>1)&$7FF) | ||
dc.w xpos | ||
else | ||
dc.w ((ypos&$FF)<<8)|(((width-1)&3)<<2)|((height-1)&3) | ||
dc.w ((pri&1)<<15)|((pal&3)<<13)|((yflip&1)<<12)|((xflip&1)<<11)|(tile&$7FF) | ||
dc.w xpos | ||
endif | ||
endm | ||
|
||
spritePiece2P macro xpos,ypos,width,height,tile,xflip,yflip,pal,pri,tile2,xflip2,yflip2,pal2,pri2 | ||
if SonicMappingsVer==1 | ||
dc.b ypos | ||
dc.b (((width-1)&3)<<2)|((height-1)&3) | ||
dc.b ((pri&1)<<7)|((pal&3)<<5)|((yflip&1)<<4)|((xflip&1)<<3)|((tile&$700)>>8) | ||
dc.b tile&$FF | ||
dc.b xpos | ||
elseif SonicMappingsVer==2 | ||
dc.w ((ypos&$FF)<<8)|(((width-1)&3)<<2)|((height-1)&3) | ||
dc.w ((pri&1)<<15)|((pal&3)<<13)|((yflip&1)<<12)|((xflip&1)<<11)|(tile&$7FF) | ||
dc.w ((pri2&1)<<15)|((pal2&3)<<13)|((yflip2&1)<<12)|((xflip2&1)<<11)|(tile2&$7FF) | ||
dc.w xpos | ||
else | ||
dc.w ((ypos&$FF)<<8)|(((width-1)&3)<<2)|((height-1)&3) | ||
dc.w ((pri&1)<<15)|((pal&3)<<13)|((yflip&1)<<12)|((xflip&1)<<11)|(tile&$7FF) | ||
dc.w xpos | ||
endif | ||
endm | ||
|
||
dplcHeader macro {INTLABEL} | ||
__LABEL__ label * | ||
if SonicMappingsVer==1 | ||
dc.b ((__LABEL___End - __LABEL___Begin) / 2) | ||
elseif SonicMappingsVer==2 | ||
dc.w ((__LABEL___End - __LABEL___Begin) / 2) | ||
else | ||
dc.w (((__LABEL___End - __LABEL___Begin) / 2)-1) | ||
endif | ||
__LABEL___Begin label * | ||
endm | ||
|
||
dplcEntry macro tiles,offset | ||
if SonicMappingsVer==3 | ||
dc.w ((offset&$FFF)<<4)|((tiles-1)&$F) | ||
else | ||
dc.w (((tiles-1)&$F)<<12)|(offset&$FFF) | ||
endif | ||
endm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.