don't click here

Sonic Retro on GitHub

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Feb 9, 2014.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    Over the years, the community repository has been running Subversion (SVN), and then Mercurial (Hg), both of which have had many issues over time. So last December SeanieB gave up trying to get Hg to work, and decided to move everything off Retro to GitHub.

    The community disassemblies and programs have been moved to the Sonic Retro organization on GitHub. The organization's current owners are: SeanieB (seanieb64 on GitHub), FraGag (also runs the IRC channel), andlabs and MainMemory.

    • If you want to download the latest copies of the disassemblies: The Disassemblies page on the wiki has links that will create a zip of the latest version of the disassemblies.
    • If you're a Tech Member and want to contribute: You can post your GitHub account name in this topic, or PM one of the owners on the forum or IRC. You will be added to the "Techies" team, which has push access to all repositories.
    • If you are not a Tech Member and want to contribute: Fork the repository and submit a pull request. Someone will review your changes, and if they're good, they can be merged in.
    • If you want to make your own fork of one of the repositories: Go ahead, you should probably credit the original contributors though.
    • If you want to be notified whenever commits are made and/or discuss the projects: Come to the IRC channel #repo on irc.badnik.zone.
    • If you want to add a new project: Contact one of the organization owners.
    • How do I Git? https://www.atlassian.com/git/tutorials
     
  2. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    Ah... that third bullet point. Good to know. I'll have a way to submit what I've been working on with the S3K disassembly then. Good stuff.
     
  3. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,373
    81
    28
    HoleNet!
    Sonic Worlds Next
    My GitHub user name is Techokami.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    Added.
     
  5. Tiddles

    Tiddles

    Diamond Dust Tech Member
    471
    0
    0
    Leicester, England
    Get in an accident and wake up in 1973
    Hello, I am "tiddlets" and I would like to humbly request fabulous secret powers.

    (That said, I may well do the pull request thing anyway when the time comes, because extra pairs of eyes never hurt!)
     
  6. FraGag

    FraGag

    Tech Member
    I've given you push access.
     
  7. Mikel

    Mikel

    Member
    Just joined GitHub on my end, and my user name should be Mikel93.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    I have just renamed all the repositories to remove the "_git" from their names, and have renamed "sadxpc_tools" to "sa_tools".
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    I merged everything from the SAModel repository into the sa_tools repository, and deleted the old SAModel repository in an effort to make cross-project references less dumb.

    I also have a question about the Sonic 1 disassembly: would it be worthwhile to make a branch designed to work with the AS assembler?
     
  10. Clownacy

    Clownacy

    Tech Member
    1,051
    570
    93
    I'd agree. I've converted my copy of the disassembly, and it has been greatly beneficial to make up for the slower build time: I can build Z80 without pre-assembling it, I can use Flamewing's debugger (which he says in incompatible with ASM68K due to a bug in the assembler). There's also the possibility of including the Z80 DAC disassembly, and dynamically building it and compressing it as Sonic 2's disassembly does its sound driver. You might even be able to create bit-perfect builds with the supposedly better macro support, again, as the Sonic 2 one does with its '0(a0)'s, though, here, you'd have to fix that ext d1,d0 in the Final Boss' code, also. If help in porting the disassembly is needed, I can give some pointers.

    EDIT: In fact... what would it mean in terms of cross-platform support, would it have any benefit over using ASM68K with things such as WINE?
     
  11. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,161
    65
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Using AS instead of ASM68K has definite benefits in terms of portability – for example, I am on Linux, and using a fully native build system for my hack. The same build system would work in OSX with appropriate binaries, which can easily be compiled as well. It could even be used in Windows with Msys + GnuWin32, but it is overkill.
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    I just started work on the AS branch. I copied the build scripts from the S&K disasm, and at present only the Windows build.bat is set up properly.
    I converted all the local labels to composed temporary symbols (beginning with . as opposed to $$) because AS is dumb with named temporary symbols.
    Currently there are a lot of jsr/jmp instructions that don't specify an operand size, which causes the assembler to try word addressing on the first pass, and long addressing on the second pass, which causes PC-relative forward references to stop working because it's using the old value for the label from pass 1, which becomes out of range for the new PC value from the current pass. I've fixed enough of them that it doesn't cause any errors, but it may cause errors in a hack.
    Additionally, for some reason p2bin is only producing a 32KB output file.
    It's mostly fixed, but still not producing a bit-perfect file.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    Bumping because the AS branch is building a perfect rev00 ROM now. I haven't tested if the rev01 build is perfect because I don't have a rev01 ROM, but it does build.

    The only thing left to be done is Linux and OSX build scripts.
     
  14. Clownacy

    Clownacy

    Tech Member
    1,051
    570
    93
    The S&K and S2 build script layouts sure are different, I actually got lost just trying to build. Way too used to S2's, because my build scripts were based on S2's, with S&K's s3p2bin.exe.

    I used the S2 disasm's checkbitperfect.bat (call me vain), and I wasn't getting bit-perfect results. Until...

    Code (ASM):
    1. loc_19EA8:
    2.         ...
    3.         exg d0,d1
    Code (ASM):
    1. loc_19EA8:
    2.         ...
    3.         exg d1,d0
    Now it's bit perfect! 'Bout time.

    Now, REV01... Oh dear... I'm not getting the best of results, a whole lotta differences according to chkbitperfect.bat. This isn't the case with the ASM68K disasm, where the only differences detected are those of that exg.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,734
    330
    63
    SonLVL
    ...I guess I shouldn't have used the s1built.bin that comes with the disassembly as my example of a bit-perfect ROM. ASM68K misassembles exg d1,d0 as exg d0,d1 and I changed the disassembly to match it.
     
  16. RetroKoH

    RetroKoH

    Member
    1,662
    22
    18
    Project Sonic 8x16
    So I've finally got myself forked onto the Mega Drive disassemblies. Expect plenty of pull requests as far as the S3K disasm goes, in the coming months... I've been hard at work.
     
  17. Clownacy

    Clownacy

    Tech Member
    1,051
    570
    93
    How does cross-commiting work? I've documented S1's sound driver in the master branch, and want to begin improving the AS branch's using AS features. The thing is that commits made to the master branch aren't 'merged' with the AS branch, and I know that if I manually commit the changes to the AS branch, GitHub will say that the AS branch is both 1 commit ahead and 1 commit behind the master, ahead because of its own copy of the commit, and behind because of the master's copy of the commit.
     
  18. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    On your local clone, do a full 'git fetch --all', check out the AS branch, and do one of the following:

    1. Full merge:
    Code (Text):
    1. git merge --no-ff origin/master
    2. Cherry-pick:
    Code (Text):
    1. git cherry-pick -xe (commit-tag)
    Cherry-pick allows you to merge individual commits, whereas a full merge merges all changes. In the case of a single commit, a full merge should work fine.

    You can then push the changes back upstream.
     
  19. Clownacy

    Clownacy

    Tech Member
    1,051
    570
    93
    Even with cherry-picking, GitHub counts the commit as another commit to put AS ahead of master, instead of subtracting 1 from the commits that put AS behind master.
     
  20. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    It's always going to be ahead of master until you merge the changes back.

    It's not really that big of a deal though, since it goes away once it's merged back to master.

    EDIT: ...if the AS branch isn't actually going to be merged back from master (I.e. considered completely separate), then something's wrong. That's usually not how git development works. Maybe it'd be better to use some macro trickery to split out AS-specific code from asm68k-specific code in a single codebase?