Code Monkey home page Code Monkey logo

skdisasm's Introduction

DISCLAIMER

Any and all content presented in this repository is presented for informational and educational purposes only. Commercial usage is expressly prohibited. Sonic Retro claims no ownership of any code in these repositories. You assume any and all responsibility for using this content responsibly. Sonic Retro claims no responsibiliy or warranty.

Sonic 3/Sonic & Knuckles Disassembly

The Directory Structure

As should be noted, the directory structure of this disassembly is decidedly different from releases of previous split disassemblies. Instead of generally organizing data solely based on what type of data it is, effort has been made to seperate data contextually, grouping each file more by what they are used for than anything else. The first primary directory is 'General', which contains data used for various miscellaneous elements of the game including the title screen, special stage, menus, etc, and also contains the 'Sprites' folder, which itself contains seperate folders for each badnik and for each general-usage object. This is also where the data regarding the player objects themselves are stored.

The second directory is 'Levels', which provides seperate folders for each zone in the game, each containing all data directly used for that level, be it tiles, blocks, chunks, miscellaneous object data for various level elements, etc.

For the sake of convenience, all sound-related data has been seperated into its own folder, 'sound'.

And finally, data expressly used for the Sonic 3 Lock-on functionality is included in the 'Lockon S3' folder.

Please explore each folder to learn where everything is and how data is organized.

The 'Sonic3_Complete' Flag

Referenced throughout the Sonic & Knuckles disassembly is the 'Sonic3_Complete' flag. When it is set to 0, the disassembly will build a byte-perfect Sonic & Knuckles ROM, not using any specific Sonic 3 data, instead relying on an appended Sonic 3 ROM for that purpose. Setting it to 1, however, will change the assembly process, incorporating all necessary Sonic 3 data split from the original ROM to create a complete Sonic 3 & Knuckles ROM without any filler. This macro also enables certain minor changes to the code to better facilitate changes to the game. If your goal is to heavily modify Sonic 3 & Knuckles, then keeping 'Sonic3_Complete' set to 1 is the recommended choice.

Building the Disassembly

The base directory contains two sets of build scripts - the Windows Batch files (.bat), and the Lua scripts (.lua). The Batch files are the simplest to use but will only work on Windows. The Lua scripts are cross platform (Windows, Mac, Linux, FreeBSD) but require Lua to be installed. The Batch files are ran by double-clicking them, while the Lua scripts are ran on the command line with 'lua nameOfScript'.

buildS3 - Builds a byte-perfect copy of the Sonic 3 ROM. buildSK - Builds a byte-perfect copy of the Sonic & Knuckles ROM. buildS3Complete - Builds a combined Sonic 3 & Knuckles ROM (using the 'Sonic3_Complete' flag detailed above). chkbitperfect - Builds both an S3 ROM and an S&K ROM, then verifies that they are byte-identical to the original ROMs.

Editing with SonLVL

Inside the 'SonLVL INI Files' directory are project files for SonLVL. SonLVL can be found here: https://info.sonicretro.org/SonLVL

Editing with SonED2

The disassembly also comes with a 'SonED Projects' folder, which contains prebuilt project files for use with SonEd2 v. 11.02.24, recently released and available at Stealth's site.

The Disassembly's Completion

Though this split disassembly is "complete" in that it splits all relevant data and is usable for editing, there are still many aspects of the disassembly that await completion. The naming scheme for various routines and data is inconsistent at best, and much of the code and unsplit data remains unidentified. Community work has been done to other disassemblies to alleviate the incomplete portions of those disassemblies and it is my expectation that similar efforts will be made on this one. Neither any of the contributors mentioned above nor I bear any direct responsibility for changes that may be made to the disassembly from this release forward unless otherwise stated.

How Sonic & Knuckles Works

Sonic & Knuckles, and Sonic 3 for that matter, are obviously extensions of Sonic 2's code, but are still very different in how they do things. Sonic & Knuckles overhauls many of the internal systems that Sonic 2 used for the sake of convenience, organization, and speed. This includes but is not limited to Moduled Kosinski decompression for realtime decompression of art data, changes to the object system in various ways, including major changes to the Sprite Status Table, usage of built-in routines to better handle relationships between different objects, such as those between parent and child objects, and a completely overhauled level drawing system that offloads much of the work to outside VBlank and, while being far more flexible and capable, requires a significantly higher level of skill and knowledge to use properly as opposed to how Sonic 2 did things. Furthermore, Sonic 3 & Knuckles is heavily event-driven, relying on very specific hardcoded instructions in various levels that must be taken into account when making any modifications, and require a knowledge of ASM coding to understand and change. Thus it is to be noted that great care must be taken in modifying Sonic 3 & Knuckles directly and that you MUST KNOW WHAT YOU ARE DOING to bear fruitful results. If you are not prepared for that type of task, then it's recommended that the disassembly and its data be used mostly for research purposes while work is done using the far more accesible Sonic 1 or Sonic 2 disassemblies as a base.

skdisasm's People

Contributors

avegee24 avatar awuwunya avatar brainulator9 avatar clownacy avatar flamewing avatar fourhawk avatar fragag avatar gerbilsoft avatar infernogear avatar kirjavascript avatar lavagaming1 avatar lavesiime avatar liliambean avatar mainmemory avatar notaz avatar pikanoob avatar pokepunch avatar seanieb64 avatar tiddlets avatar vinegar97 avatar vladikcomper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skdisasm's Issues

Incomplete RAM equates

Recently, I've equated all the RAM addresses in Sonic 3, and Sonic & Knuckles. However, some RAM addresses still don't have known use, good names, and some are blatantly incorrectly equated. Additionally, the RAM table of equates is not very intelligently organized. For the future, I think it would be very wise to focus on improving this aspect of the disassembly. I've laid a lot of groundwork for that, but I would like to see other people step up to the task as well.

disassembly doesnt work and i did everything

Program: SonLVL
Build Date: 12/27/2021 21:10:17
OS Version: Microsoft Windows NT 6.2.9200.0
Log:
Operating system: Microsoft Windows NT 6.2.9200.0
Opening INI file "C:\Users\DAFO\Desktop\s3diss\Sonic 3K Git INIs\SonLVL.ini"...
Game type is S3K.
Loading Azure Lake...
128x128 chunk file "../Levels/ALZ/Chunks/Primary.bin" not found.
16x16 block file "../Levels/ALZ/Blocks/Primary.bin" not found.
8x8 tile file "../Levels/ALZ/Tiles/Primary.bin" not found.
Layout file "../Levels/ALZ/Layout/1.bin" not found.
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in D:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---

Loading Angel Island Zone Act 1 Intro...
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Primary.bin" not found.
128x128 chunk file "../Levels/AIZ/Chunks/Act 1.bin" not found.
16x16 block file "../Levels/AIZ/Blocks/Act 1 Primary.bin" not found.
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Secondary.bin" not found.
Layout file "../Levels/AIZ/Layout/1.bin" not found.
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
16x16 block file "../Levels/AIZ/Blocks/Act 1 Secondary.bin" not found.
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in D:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---

Loading Angel Island Zone Act 1...
Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Primary.bin", using compression Kosinski...
Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Primary.bin", using compression KosinskiM...
Loading 128x128 chunks from file "../Levels/AIZ/Chunks/Act 1.bin", using compression Kosinski...
Loading layout from file "../Levels/AIZ/Layout/1.bin", using compression Uncompressed...
Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Main Level.bin", using compression Kosinski...
Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Main Level.bin", using compression KosinskiM...
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in D:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---

Loading Angel Island Zone Act 1 Intro...
Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Primary.bin", using compression Kosinski...
Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Primary.bin", using compression KosinskiM...
Loading 128x128 chunks from file "../Levels/AIZ/Chunks/Act 1.bin", using compression Kosinski...
Loading layout from file "../Levels/AIZ/Layout/1.bin", using compression Uncompressed...
Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Secondary.bin", using compression Kosinski...
Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Secondary.bin", using compression KosinskiM...
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in D:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in D:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 689
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---

how do I use SONLVL with sonic 3 & knuckles

Sorry to waste your time, but how do I use SonLVL with sonic 3 and knuckles? When I try to build and run, it doesn't work and I cant find the log file, sorry 'bout that.

Add support for MapMacros to be consistent with the Sonic 1 and 2 Disassemblies

While the Sonic 1 and 2 Disassemblies did get updated to add in full MapMacros support, Sonic 3 & Knuckles' Disassembly doesn't have anything of that sort, especially when it would be helpful to make it work to make sure that all Sonic Retro Disassemblies of the Classic Sonic games stay consistent with one another.

Sonic 2 Bugs Carried Over and Bugs that have not yet been covered in this disassembly

I've noticed that a lot of bugs are not properly covered in this disassembly that are fixed on other wikis but never given the proper method on how to fix them within a disassembly. Luckily, I've taken it upon myself to document some of these bugs and how to fix them.

  • Firstly, the Super Sonic palette cycle is bugged the exact same way that it is in Sonic 2 where it skips 1 palette, so that solution can be applied both to the routine itself and a duplicate of the routine in the AIZ Intro Plane object by changing the blo to a bls.
  • The next bug is another palette cycling bug, notably the way that LRZ2 cycles the palette lines, this bug is present at loc_276A and can be fixed by putting 4 in front of (a0,d0.w),(Normal_palette_line_4+$1A).w (This bug has been documented before but only gave Game Genie codes in order to fix it).
  • Another thing I consider to be a bug is with the Iwamodoki enemy not actually giving you 100 points, this bug is present at loc_8FB76.
  • Some more palette bugs include the palette line not being correct at ObjDat3_7A178, where make_art_tile($001,3,0) should be make_art_tile($001,2,1), this fixes the palette bug with LRZ3 platforms.
  • Also at ObjDat3_7A660 and ObjDat3_7A66C the palette lines used there are also not correct and should use make_art_tile($468,0,0) instead of make_art_tile($468,1,0), this fixes the GHZ boss issues at SSZ.

ObjCheckLeftWallDist oddities

This issue focuses on this one line: eori.w #$F,d3
I find it odd that in S1 and S2's version of the routine, this line supposedly fixes erratic collision:

; Engine bug: colliding with left walls is erratic with this function.
; The cause is this: a missing instruction to flip collision on the found
; 16x16 block; this one:
;eori.w    #$F,d3

Yet in S&K's version of the routine, the line apparently causes a bug:

eori.w    #$F,d3    ; this was not here in S1/S2, resulting in a bug

Is there a reason for this?

Macro-ify the byte_1BB16 array

This is the table that sets the amount of compatible loops for Create_New_Sprite3. I guess this one is a little complex to deal with because its rather unusual logic; an attempt has been made by MoDule through an external tool, a friend of mine previously tried in macro format resulting in a not-so comprehensive sequence...

https://pastebin.com/9h5tVGxs
(tab-aligned)

There's the proper formula, but notice there's also two extra hacks:

  • Prevent last loop to fit address past the final slot (Iteration #38 would give $1F otherwise, causing possible RAM overflow)
  • DBF patch

Document title screen a little better

some things about the title screen, especially the target position for the banner, are not documented

I used to know where it is but I've forgotten

Produced S&K ROM is not byte-perfect

After 10bf17f, the S&K ROMs produced by buildSK.bat and buildSK.py are no longer byte-perfect to sk.bin. buildAndVerify.py is unaffected.

The issue seems to be that the new "accurate" flag is not being passed to the assembler when verify is false, but it seems to me that it should always get passed for the S3 and SK builds. Otherwise verify is a pretty big misnomer.

The zone cannot open

Program: SonLVL
Build Date: 03/22/2023 18:17:11
OS Version: Microsoft Windows NT 6.2.9200.0
Log:
Operating system: Microsoft Windows NT 6.2.9200.0
Opening INI file "C:\Users\Admin\Downloads\SonLVL Updater\Sonic 3K Git INIs\SonLVL - S3.ini"...
Game type is S3K.
Loading Angel Island Zone Act 1 Intro...
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Primary.bin" not found.
16x16 block file "../Levels/AIZ/Blocks/Act 1 Primary.bin" not found.
128x128 chunk file "../Levels/AIZ/Chunks/Act 1.bin" not found.
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Secondary.bin" not found.
16x16 block file "../Levels/AIZ/Blocks/Act 1 Secondary.bin" not found.
Layout file "../Levels/AIZ/Layout/1.bin" not found.
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 691
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in C:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 691
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---

Loading Angel Island Zone Act 1 Intro...
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Primary.bin" not found.
8x8 tile file "../Levels/AIZ/Tiles/Act 1 Secondary.bin" not found.
16x16 block file "../Levels/AIZ/Blocks/Act 1 Primary.bin" not found.
16x16 block file "../Levels/AIZ/Blocks/Act 1 Secondary.bin" not found.
Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
Source: 0 Destination: 0 Length: 16
128x128 chunk file "../Levels/AIZ/Chunks/Act 1.bin" not found.
Layout file "../Levels/AIZ/Layout/1.bin" not found.
System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 691
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
at System.Threading.Tasks.Parallel.Invoke(Action[] actions)
at SonicRetro.SonLVL.API.LevelData.LoadLevel(String levelname, Boolean loadGraphics) in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 184
at SonicRetro.SonLVL.GUI.MainForm.backgroundLevelLoader_DoWork(Object sender, DoWorkEventArgs e) in C:\Programs\SonLVL\SonLVL\MainForm.cs:line 574
---> (Inner Exception #0) System.IO.FileNotFoundException: Palette file could not be loaded! Have you set up your disassembly properly?
File name: '../General/Sprites/Sonic/Palettes/SonicAndTails.bin'
at SonicRetro.SonLVL.API.LevelData.LoadLevelPalette() in C:\Programs\SonLVL\SonLVLAPI\LevelData.cs:line 691
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
So this error code show why I cant open a zone

Issues with "org $C71A0" in Sonic 3

So I've been trying to port FBZ into Sonic 3, but unfortunately, I always get an error due to the "org $C71A0" right before the sound data. I tried commenting this out but it caused issues. Any help would be greatly appreciated.

Special Stage Drawing

I would like to know what routines are responsible for drawing the Special Stage and how they work. I ask this because in Sonic & Knuckles Collection, there is an extremely noticeable desynchronization between the positions of the sprites and the position of the floor. Knowing how it's supposed to work in the MD version could be very helpful in trying to figure out what's gone wrong in S&KC.

Question: Split a S3&K rom hack into disassembly

So, I have a rom I already moddified with Esreal Sonic Editor II, but since the app isn't able to edit title cards, I turned myself to disassemblies, my quesion is:

Is it possible for me to split my hack rom which is directly a S3&K rom (not a S3 alone or S&K alone) or will I have to find a way to put every color palettes, and the modifications I made to the level select screen into the already existing disassembly ?

Issue with building on Arch Linux x86_64 machine

Hi all,

Thanks for the disassembly/project, looks interesting, however I receive the following build error:

warning, detected non-ANSI time format specifier '%R'
> > >Z80 Sound Driver.asm(487): error #1820: expression must be evaluatable in first pass                    
> > >           !org zTracksSFXStart                    
> > >Z80 Sound Driver.asm(500): error: The RAM variable declarations are too large. It's 150h bytes past the start of the bottom of the stack, at 1FA0h.                    
> > >           fatal "The RAM variable declarations are too large. It's \{*-z80_stack_end}h bytes past the start of the bottom of the stack, at \{z80_stack_end}h."                    
fatal error, assembly terminated

Any advice is appreciated.

Z80 sound driver broken on Windows

So with the changes made over the previous month, S&K and S3K both now build with a broken sound driver, at least on Windows. S3 is unaffected because the driver isn't actually disassembled (laughs).

SegaPCM Loop Rate Decode

I always thought it was weird that there wasn't a pcmLoopCounter macro in this disassembly. So I took it upon myself to do all the calculations for this disassembly so that the loop count for the sample can be read with ease! Here's what I came up with:

At zPlaySegaPCM (once the pcmLoopCounter macro is added in), this is what I think the loop code should look like.

.loop:
		ld	a, (hl)						; 7	; a = next byte of SEGA PCM
		ld	(zYM2612_D0), a				; 13	; Send to DAC
		ld	a, (zMusicNumber)			; 13	; Check next song number
		cp	mus_StopSEGA				; 7	; Is it the command to stop playing SEGA PCM?
		jr	z, .done					; 7	; Break the loop if yes
		nop							; 4
		nop							; 4

		ld	b, pcmLoopCounter(14500,97)			; 7	; Loop counter
		djnz	$						; 8	; Loop in this instruction, decrementing b each iteration, until b = 0

		inc	hl							; 6	; Advance to next byte of SEGA PCM
		dec	de							; 6	; Mark one byte as being done
		ld	a, d						; 4	; a = d
		or	e							; 4	; Is length zero?
		jr	nz, .loop					; 7	; Loop if not
									; 97 in total

I have built this myself and it is accurate. The value of pcmLoopCounter(14500/97) is 0Ch, exactly the same as what's in the disassembly.

No Sonic 3 disassembly

Why don't we have a Sonic 3 disassembly? That's very strange and there seems to be no reason for that.

Various macros break scope

Macros, such as org and org0 break the scope, so referencing a local lable after an even will make assembly fail, despite there being no need to. Changing variable names such as diff to .diff should solve this issue (though, a name collision is of concern here)

s3p2bin overlapping regions

There seems to be strange issues with custom sound drivers. I am not sure on the specifics, but s3p2bin complains about overlapping regions, despite there actually being none. It seems that either some padding or the z80 init driver causes that kind of a problem. I think this used to be a problem with s2p2bin earlier too, but with some updates to s2disasm it was fixed. In fact, s2p2bin will still work with assembling this custom sound driver. I think there is some code in s2p2bin to work around this issue, but this code seems to not be present in s3p2bin. I am not familiar with the code for either of them, so someone who is, may they be able to look into this? I can provide files that caused that issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.