Sonic and Sega Retro Message Board: OSX support in S3&K dissassembly - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

OSX support in S3&K dissassembly Working locally, does SVN want it?

#1 User is offline Orangy Tang 

Posted 10 July 2011 - 01:28 PM

  • Posts: 9
  • Joined: 24-June 11
I'm trying to get a S3&K hacking environment setup on my macbook, so as a first step I've pulled down the SVN dissassembly and been tweaking it to build in OSX.

I can now build what (appears to be) a working S3&K rom. I need to do some more testing to make sure it's byte-accurate, but a quick play through of Angel Island showed everything looking normal. Changes I had to make:

- Fix and build an AS binary for OSX. Mostly resolving it's wonky strcpy replacement.
- Builld an s3p2bin binary for OSX. Worked without changes, so kudos to whoever wrote that in the first place.
- Knock up a replacement build script (works, but needs refinement).
- Alter the .asm files to use forward slashes in file paths rather than backwards slashes.

So, questions:
1. Are people interested in having this added to the community SVN? What's the best way of going about this? Assuming I've got commit permissions I could add it in a branch and someone could give it a sanity check before moving it into trunk.

2. Is it worth having my modified source for AS included in SVN as well? Not sure if this is helpful or not myself.

3. While I'm making changes I'd like to rearrange the build scripts so they're separate from the source files, and have output files in a separate dir as well. Has anyone got any thoughts on this?

4. Is anyone else hacking on OSX? Just wondering what kind of setup other people have got.

Thanks.

#2 User is offline flamewing 

Posted 10 July 2011 - 02:37 PM

  • Emerald Hunter
  • Posts: 767
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
I would definitely like to see it, especially what you have done for AS. While I am on Linux, it may be instructive to see how you managed to get a native build of AS that does not missassemble the input...

#3 User is offline Orangy Tang 

Posted 10 July 2011 - 05:48 PM

  • Posts: 9
  • Joined: 24-June 11
I tried to make a branch for these changes, but I'm getting the same handshake error you were getting ( http://forums.sonicretro.org/index.php?showtopic=25094 ), so I guess I can't do that until someone resolves that.

Instead I've uploaded the changes here if you want to give it a try: http://www.triangularpixels.com/Junk/RomHacking/ (the build script is actually python, but I renamed it .txt to stop my webserver trying to execute the damn thing).

The as-current.zip is basically the latest C code (the 'beta' version from here: http://john.ccac.rwth-aachen.de:8000/as/download.html ) with the custom strcpy replaced so it would build. And also a small fix in the parsing code where it was incorrectly using strcpy with overlapped strings.

What misassembled output were you seeing? I didn't do anything particularly special but it seems to work. I guess the parsing bug might have been the problem - it really looks like the author doesn't really understand C strings, and frankly I'm suspicious of anyone's code who likes to drag Pascal's BEGIN/END into C via macro defines. >_<

Give it a go and let me know how it goes. It looks like there's preprocessor defines for a couple of vanilla linux setups, so with any luck it should just build.

#4 User is offline MainMemory 

Posted 10 July 2011 - 06:21 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3207
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I'm not getting any SSL errors here.

#5 User is offline Orangy Tang 

Posted 11 July 2011 - 02:38 AM

  • Posts: 9
  • Joined: 24-June 11
Ah I figured it out - the url in the SVN post is wrong, it says https://sonicretro.org/asm_svn when it should be https://svn.sonicretro.org/asm_svn.

#6 User is offline MainMemory 

Posted 11 July 2011 - 05:15 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3207
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
https://sonicretro.org/asm_svn works fine for me...

#7 User is offline sasuke 

Posted 11 July 2011 - 04:22 PM

  • Posts: 66
  • Joined: 05-June 09
  • Gender:Male
  • Wiki edits:1
QUOTE (Orangy Tang @ Jul 10 2011, 02:28 PM)
- Fix and build an AS binary for OSX. Mostly resolving it's wonky strcpy replacement.


Thanks very much. I actually attempted to compile AS a couple weeks ago, but, while it compiled, it kept giving me ENOTTY errors when I ran it.

#8 User is offline FraGag 

Posted 11 July 2011 - 08:11 PM

  • Posts: 656
  • Joined: 09-January 08
  • Gender:Male
  • Location:Québec, Canada
  • Project:an assembler
  • Wiki edits:6
QUOTE (Orangy Tang @ Jul 10 2011, 02:28 PM)
1. Are people interested in having this added to the community SVN? What's the best way of going about this? Assuming I've got commit permissions I could add it in a branch and someone could give it a sanity check before moving it into trunk.

Sure, go ahead.

QUOTE (Orangy Tang @ Jul 10 2011, 02:28 PM)
2. Is it worth having my modified source for AS included in SVN as well? Not sure if this is helpful or not myself.

If AS's author is still maintaining AS, it might be better for everyone to send him your changes directly. If AS isn't being actively maintained anymore, then just releasing an archive with the updated sources and binaries should be enough. Since I'm working on my own assembler, I tend to consider updating the other assemblers we use a low priority. :P

QUOTE (Orangy Tang @ Jul 10 2011, 02:28 PM)
3. While I'm making changes I'd like to rearrange the build scripts so they're separate from the source files, and have output files in a separate dir as well. Has anyone got any thoughts on this?

Considering the small number of files the build scripts and the output files represent, I think it's not necessary to do this. I have recently adopted out-of-source builds in my C and C++ projects and it's useful when you have one .o/.obj file for each .c/.cpp file, but in our disassemblies, we have only one output file (though AS generates other intermediate files that we don't use). Furthermore, most of the people who use the disassemblies aren't programmers, so giving them a simple build system makes it easier for them. Those who prefer to work with a more complex build system usually have the skills to make it themselves.

QUOTE (Orangy Tang @ Jul 10 2011, 02:28 PM)
4. Is anyone else hacking on OSX? Just wondering what kind of setup other people have got.

I can't comment on this, but I can say that making an easy and consistent hacking experience across operating systems is one of the reasons I started working on my assembler.

#9 User is offline Orangy Tang 

Posted 15 July 2011 - 04:17 AM

  • Posts: 9
  • Joined: 24-June 11
I've made a branch of S&K and checked my changes into it now, you can find it here: http://svn.sonicretr...a1eddfd7fcdfbde

This contains Osx binaries for the build tools and new python build scripts. Here's the bit from the README about building now:

The 'BuildScripts' directory contains two sets of build scripts - the windows batch files (*.bat), and the python scripts (*.py).
The .bat ones are the simplest to use but will only work on windows. The python scripts are cross platform (windows and mac) but
require python to be installed.

Batch files: (double click to run)
buildSK.bat          - builds a byte-perfect copy of the Sonic And Knuckles rom in the base dir.
buildS3Complete.bat  - builds a combined Sonic 3 And Knuckles rom (using the SONIC3_COMPLETE macro detailed above).

Python files: (run with 'python nameOfScript')
buildSK.py             - builds a byte-perfect copy of the Sonic And Knuckles rom in the base dir. Output and errors go in the 'Builds' sub dir.
buildS3Complete.py     - builds a combined Sonic 3 And Knuckles rom (using the SONIC3_COMPLETE macro detailed above). Output and errors go in the 'Builds' sub dir.
buildAndVerify.py      - builds both a S&K rom and a S3 Complete rom, then verifies that the S&K rom is byte identical to the original rom. Output and errors go in the 'Builds' dir


In theory the new build scripts should work in Linux too, but you'll have to compile a version of AS and s3p2bin yourself.

Unless there's any objections I'll promote this into the main branch in a few days.

#10 User is offline flamewing 

Posted 15 July 2011 - 09:17 AM

  • Emerald Hunter
  • Posts: 767
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12

View PostOrangy Tang, on 10 July 2011 - 05:48 PM, said:

The as-current.zip is basically the latest C code (the 'beta' version from here: <a href="http://john.ccac.rwth-aachen.de:8000/as/download.html" target="_blank">http://john.ccac.rwth-aachen.de:8000/as/download.html</a> ) with the custom strcpy replaced so it would build. And also a small fix in the parsing code where it was incorrectly using strcpy with overlapped strings.

Can you generate a diff from it? Or send me the modified code?

#11 User is offline Orangy Tang 

Posted 15 July 2011 - 03:33 PM

  • Posts: 9
  • Joined: 24-June 11

View Postflamewing, on 15 July 2011 - 09:17 AM, said:

View PostOrangy Tang, on 10 July 2011 - 05:48 PM, said:

The as-current.zip is basically the latest C code (the 'beta' version from here: <a href="http://john.ccac.rwth-aachen.de:8000/as/download.html" target="_blank">http://john.ccac.rwth-aachen.de:8000/as/download.html</a> ) with the custom strcpy replaced so it would build. And also a small fix in the parsing code where it was incorrectly using strcpy with overlapped strings.

Can you generate a diff from it? Or send me the modified code?

The modified code is already uploaded here: http://www.triangula...asl-current.zip

Probably easier if you download that and do a local compare, there's lots of files with one line changes so a diff file would be pretty huge. It looks like it's got platform defs for a couple of flavours of linux, so with a bit of luck you'll just have to run make.

#12 User is offline Andlabs 

Posted 16 July 2011 - 06:02 PM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
My Mac is still stuck on an update so I can't check right now, but: does this build system generate bit-perfect ROMs?

#13 User is offline MainMemory 

Posted 16 July 2011 - 06:07 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3207
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
You made a commit with the description "Orangy Tang - S&K - merged OSX port changes into trunk", but all it did was revert my edit to "/Mega Drive Disassemblies/Sonic & Knuckles Split Disassembly/General/Sprites/Level Misc/Map - Path Swap.asm"...

Edit: And now you've reverted all my other edits.
This post has been edited by MainMemory: 16 July 2011 - 07:16 PM

#14 User is offline Orangy Tang 

Posted 17 July 2011 - 04:38 AM

  • Posts: 9
  • Joined: 24-June 11
Oh balls. Sorry about that. I'm using a different SVN client from what I'm used to and it handles merges oddly.

I'll have a look at putting your changes back now.

Andlabs: Yes.

Edit: Oh I see you've already put your changes back. Sorry about that, hope it wasn't too much trouble. >_<
This post has been edited by Orangy Tang: 17 July 2011 - 04:42 AM

#15 User is offline MainMemory 

Posted 17 July 2011 - 04:46 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3207
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Also for some reason you commented out the line that defines Sonic3_Complete.
This post has been edited by MainMemory: 17 July 2011 - 04:48 AM

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users