Difference between revisions of "Convert the Hivebrain 2005 disassembly to ASM68K"
From Sonic Retro
m |
Brainulator (talk | contribs) m (removing broken code) |
||
(12 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{GuideBy|Puto}} | |
− | This guide covers converting your split disassembly from SNASM68K (the | + | This guide covers converting your split disassembly from SNASM68K (the assembler) to a better, faster assembler known as ASM68K. This tutorial is also necesary if you want to work on a 64-bit OS without restarting on a new split. |
− | The only thing that SNASM68K has that ASM68K doesn't seem to support, is the "align" directive, as well as negative cnops. The align issue can be fixed with a simple macro that can | + | The only thing that SNASM68K has that ASM68K doesn't seem to support, is the "align" directive, as well as negative cnops. The align issue can be fixed with a simple macro that can be placed above <b>StartOfRom:</b> |
− | be placed above <b>StartOfRom:</b> | + | <syntaxhighlight lang="asm"> |
− | <asm> | ||
align macro | align macro | ||
cnop 0,\1 | cnop 0,\1 | ||
− | endm</ | + | endm</syntaxhighlight> |
− | Next edit the line below in | + | Next edit the line below in '''build.bat:''' |
<pre>snasm68k.exe -emax 0 -p -o ae- s1comb.asm, s1built.bin</pre> | <pre>snasm68k.exe -emax 0 -p -o ae- s1comb.asm, s1built.bin</pre> | ||
With this: | With this: | ||
<pre>asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- s1comb.asm, s1built.bin</pre> | <pre>asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- s1comb.asm, s1built.bin</pre> | ||
− | And then in the source file itself | + | And then in the source file itself replace this incorrect line in "SkipSecurity:": |
− | <asm> move a6,usp ; set usp to $0</ | + | <syntaxhighlight lang="asm"> move a6,usp ; set usp to $0</syntaxhighlight> |
− | + | with the proper: | |
− | <asm> move.l a6,usp ; set usp to $0</ | + | <syntaxhighlight lang="asm"> move.l a6,usp ; set usp to $0</syntaxhighlight> |
− | + | to result in a perfectly assembled ROM, which assembles so quickly I can barely have time to see the window open. | |
− | Better yet, since this supports long filenames, I can then replace the include.exe directives (in the format of ; include=xxx) with proper "include" directives, which allows me to completely skip the creation of s1comb.asm! This is very useful, because it means when you get a compiling error, you'll no longer have to check the line in s1comb.asm, and then track the location to sonic1.asm. | + | Better yet, since this supports long filenames, I can then replace the include.exe directives (in the format of ; include=xxx) with proper "include" directives, which allows me to completely skip the creation of s1comb.asm! This is very useful, because it means when you get a compiling error, you'll no longer have to check the line in s1comb.asm, and then track the location to sonic1.asm. |
+ | |||
+ | In the source file, replace all instances of: | ||
+ | <syntaxhighlight lang="asm">; include=</syntaxhighlight> | ||
+ | with the proper: | ||
+ | <syntaxhighlight lang="asm"> include "</syntaxhighlight> | ||
+ | |||
+ | Ensure that you replace all instances of: | ||
+ | <syntaxhighlight lang="asm">.asm</syntaxhighlight> | ||
+ | With: | ||
+ | <syntaxhighlight lang="asm">.asm"</syntaxhighlight> | ||
As such, this entire line becomes unneeded in build.bat: | As such, this entire line becomes unneeded in build.bat: | ||
<pre>include.exe sonic1.asm s1comb.asm</pre> | <pre>include.exe sonic1.asm s1comb.asm</pre> | ||
− | And the | + | And the ASM68K line can be changed to assemble sonic1.asm directly. |
+ | |||
+ | Now, delete this files: | ||
+ | |||
+ | *SNASM68K.EXE | ||
+ | *include.exe | ||
+ | *s1comb.asm (if it exists) | ||
That's it! Enjoy a faster build of your hack. | That's it! Enjoy a faster build of your hack. | ||
− | + | {{S1Howtos}} |
Latest revision as of 20:19, 17 October 2021
(Original guide by Puto)
This guide covers converting your split disassembly from SNASM68K (the assembler) to a better, faster assembler known as ASM68K. This tutorial is also necesary if you want to work on a 64-bit OS without restarting on a new split.
The only thing that SNASM68K has that ASM68K doesn't seem to support, is the "align" directive, as well as negative cnops. The align issue can be fixed with a simple macro that can be placed above StartOfRom:
align macro
cnop 0,\1
endm
Next edit the line below in build.bat:
snasm68k.exe -emax 0 -p -o ae- s1comb.asm, s1built.bin
With this:
asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- s1comb.asm, s1built.bin
And then in the source file itself replace this incorrect line in "SkipSecurity:":
move a6,usp ; set usp to $0
with the proper:
move.l a6,usp ; set usp to $0
to result in a perfectly assembled ROM, which assembles so quickly I can barely have time to see the window open.
Better yet, since this supports long filenames, I can then replace the include.exe directives (in the format of ; include=xxx) with proper "include" directives, which allows me to completely skip the creation of s1comb.asm! This is very useful, because it means when you get a compiling error, you'll no longer have to check the line in s1comb.asm, and then track the location to sonic1.asm.
In the source file, replace all instances of:
; include=
with the proper:
include "
Ensure that you replace all instances of:
.asm
With:
.asm"
As such, this entire line becomes unneeded in build.bat:
include.exe sonic1.asm s1comb.asm
And the ASM68K line can be changed to assemble sonic1.asm directly.
Now, delete this files:
- SNASM68K.EXE
- include.exe
- s1comb.asm (if it exists)
That's it! Enjoy a faster build of your hack.