I am planning to fork the main git tree for some totally new branches, but until then you can use this: Code (Text): ; 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__-1)/5) elseif SonicMappingsVer=2 dc.w ((__LABEL___End-__LABEL__-2)/8) else dc.w ((__LABEL___End-__LABEL__-2)/6) endif 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__-1)/2) elseif SonicMappingsVer=2 dc.w ((__LABEL___End-__LABEL__-2)/2) else dc.w ((__LABEL___End-__LABEL__-4)/2) endif 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 ; I don't know why, but S3K uses Sonic 2's DPLC format for players, and its own for everything else ; So to avoid having to set and reset SonicMappingsVer I'll just make special macros s3kPlayerDplcHeader macro {INTLABEL} __LABEL__ label * dc.w ((__LABEL___End-__LABEL__-2)/2) endm s3kPlayerDplcEntry macro tiles,offset dc.w (((tiles-1)&$F)<<12)|(offset&$FFF) endm just note that the format of macro mappings is unchanged from the asm68k version, this is just for asw based disassemblies only.
Um. There's already a version of SpritePiece.asm for AS, in fact, it was the original, the ASM68K version was made later. Plus, IIRC my conversion program comes with both files included.
Well, the fork is in progress (s1disasm-MapMacrosAS), by the way, thanks for letting me know about that file's existance, I can't believe how identical my version and yours are though, I guess I got the conversion right. Other branches I intend to add are ProjectSonic1TwoEightAS, MusicMacrosAS, and Unified (All branches as one) for sonic1 disasm, will do similar things for the s2disasm. MusicMacrosAS will use Flamewing's asm music format btw
Not as much as you think. I will just maintain the fork, thus unofficial disassemblies, retro can maintain the official branches on official retro disassemblies. The real nightmare is initial merge, and once that is done, I just pull in upstream changes from official branches, i.e. MapMacrosAS just needs MapMacros changes from upstream and AS changes from upstream, I can use diff patches if needed and merge in .reject lumps if they come up. I have a lot of time on my hands. As a matter of fact, having these branches in my opinion actually can be helpful, i.e. you want MapMacros but do not have Windows and still want to hack the z80 sound driver too, MapMacrosAS would be perfect for you.
Even still, another issue is corrected by this: some disassemblies use asw and others use asm68k which means syntax issues but if all used as or all used asm68k, no issues, mine will all use asw. Another I intend to fix later, is symbol name conflicts, i.e. a symbol called one thing in sonic1 disasm, and another in sonic2 disasm. No more mess trying to port an object. Thus your strawman argument is meaningless in this context, besides, if nobody uses the branch, then why does it exist? I say at least enough people use it to warrant its existence and the small number would likely be because it doesn't play nice with a lot of hack projects. On the other hand if a change was made that did make it play a lot more nicely, then it might get used more.
It exists because I made it and use it, and nobody is bothered enough by its existence to remove it. If there was a time when programs supported the macros, I would probably petition for the branch to be merged into master, because there wouldn't be any reason not to. How, exactly, are you going to "fix" symbol name conflicts?
I see, oh and how the conflicts will be fixed is by naming all symbols which point to identical code that serves the same purpose in one disasm, the same thing in the other, oh and by identical, I mean has to be close enough to tell that it is the same sub, function, or method. Alternatively, it can be similar code that works way different but still fulfills the same role, i.e. the sound driver init method. The result, as long as the function, sub, or, method being requested exists it will work since the name is the same, no more need to hunt around the code, it is either there, or it isn't and needs porting in your hack. We get rid of the meaningless work so that productivity can go towards more impressive things, such as a new custom boss. On another note, by your logic, I should drop all but the unified branch since it is everything added except things best done by the end user, though it is simpler if I pull in the AS branch official changes, merge them into the rest, merge other branch changes that don't break any branches or violate naming rules or strict choice of assembler, then merge in everything to unified.