Actions

SCHG How-to

Difference between revisions of "Convert the Hivebrain 2005 disassembly to ASM68K"

From Sonic Retro

m (Text replace - '[[Category:SCHG How-tos|' to '{{S1Howtos}} [[Category:SCHG How-tos|')
Line 5: Line 5:
 
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>
<asm>align macro
+
<asm>
 +
align macro
 
     cnop 0,\1
 
     cnop 0,\1
 
     endm</asm>
 
     endm</asm>

Revision as of 19:49, 8 June 2015

(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: <asm> align macro

    cnop 0,\1
    endm</asm>

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 replaced this incorrect line in SkipSecurity: <asm> move a6,usp  ; set usp to $0</asm> With the proper: <asm> move.l a6,usp  ; set usp to $0</asm> Which results in a perfectly assembling 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: <asm>; include=</asm> With the proper: <asm> include "</asm>

Ensure that you replace all instances of: <asm>.asm</asm> With: <asm>.asm"</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.

That's it! Enjoy a faster build of your hack.

SCHG How-To Guide: Sonic the Hedgehog (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix the SEGA Sound | Display the Press Start Button Text | Fix the Level Select Menu | Fix the Hidden Points Bug | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix the Walk-Jump Bug | Correct Drowning Bugs | Fix the Death Boundary Bug | Fix the Camera Follow Bug | Fix Song Restoration Bugs | Fix the HUD Blinking | Fix the Level Select Graphics Bug | Fix a remember sprite related bug
Changing Design Choices
Change Spike Behavior | Collide with Water After Being Hurt | Fix Special Stage Jumping Physics | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Remove the Speed Cap | Port the REV01 Background Effects | Port Sonic 2's Level Art Loader | Retain Rings Between Acts | Add Sonic 2 (Simon Wai Prototype) Level Select | Improve ObjectMove Subroutines | Port Sonic 2 Level Select
Adding Features
Add Spin Dash ( Part 1 / Part 2 / Part 3 / Part 4 ) | Add Eggman Monitor | Add Super Sonic | Add the Air Roll
Sound Features
Expand the Sound Index | Play Different Songs Per Act | Port Sonic 2 Final Sound Driver | Port Sonic 3's Sound Driver | Port Flamewing's Sonic 3 & Knuckles Sound Driver | Change The SEGA Sound
Extending the Game
Load Chunks From ROM | Add Extra Characters | Make an Alternative Title Screen | Use Dynamic Tilesets | Make GHZ Load Alternate Art | Make Ending Load Alternate Art | Add a New Zone | Set Up the Goggle Monitor | Add New Moves | Add a Dynamic Collision System | Dynamic Special Stage Walls System | Extend Sprite Mappings and Art Limit | Enigma Credits | Use Dynamic Palettes
Miscellaneous
Convert the Hivebrain 2005 Disassembly to ASM68K
Split Disassembly Guides
Set Up a Split Disassembly | Basic Level Editing | Basic Art Editing | Basic ASM Editing (Spin Dash)