Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    when you build, does it not PAUSE so that you can see what line it's in?

    (caps for a reason)

    if not, open build.bat in notepad & add PAUSE at the end. then you should be able to keep window up for you to see what line it's in.
     
  2. Sonic master

    Sonic master Well-Known Member Member

    Joined:
    Mar 27, 2010
    Messages:
    303
    Window is case insensitive. Although it has been a long time since I have used windows I do remember using pause as all lowercase and it works just fine also I have the batch files to back it up and also at-least with the git dissasembly (not sure about others) errors are outputted to a text file making it easy to view or copy and paste for later study and posting if needed.
     
  3. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I did make it pause, but it doesn't show me the line that has the branch error.
     
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Well, in AS, there is a way to make it spit out the errors in a log file, making it possible to show the log, which in turn makes it about 10x easier to solve your problem.

    This is all assuming you're using an AS-based disasm. If your disasm uses ASM68K, I'm afraid I can't help you. Otherwise, open the spoiler below for how to do the above.

    Anywho, if it turns out you are using AS, then go into build.bat and change this:


    REM // run the assembler
    REM // -xx shows the most detailed error output
    REM // -c outputs a shared file (s1.h)
    REM // -A gives us a small speedup
    set AS_MSGPATH=win32/msg
    set USEANSI=n
    "win32/asw" -xx -c -A s1.asm

    REM // combine the assembler output into a rom
    IF EXIST s1.p "win32/s2p2bin" s1.p s1built.bin s1.h

    To this:


    REM // run the assembler
    REM // -xx shows the most detailed error output
    REM // -c outputs a shared file (s1.h)
    REM // -A gives us a small speedup
    set AS_MSGPATH=win32/msg
    set USEANSI=n

    REM // allow the user to choose to print error messages out by supplying the -pe parameter
    IF "%1"=="-pe" ( "win32/asw" -xx -c -A s1.asm ) ELSE "win32/asw" -xx -c -E -A s1.asm

    REM // if there were errors, a log file is produced
    IF EXIST s1.log goto LABLERROR4

    REM // combine the assembler output into a rom
    IF EXIST s1.p "win32/s2p2bin" s1.p s1built.bin s1.h

    And then after this:


    exit /b

    :LABLERROR3
    echo Failed to build because write access to s1built.bin was denied.
    pause

    Insert this:

    Code:
    
    exit /b
    
    :LABLERROR4
    REM // display a noticeable message
    echo.
    echo **********************************************************************
    echo *                                                                    *
    echo *   There were build errors/warnings. See s1.log for more details.   *
    echo *                                                                    *
    echo **********************************************************************
    echo.
    pause
    
     
    Last edited by a moderator: Aug 4, 2014
  5. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    Open build.bat and look at this line:


    asm68k /o op+ /o os+ /o ow+ /o oz+ /o oaq+ /o osq+ /o omq+ /p /o ae- sonic1.asm, s1built.bin

    So you need to add


    >errors.txt

    right after the line above (notice: don't create new line). Copied from GitHub disasm.
     
  6. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Here's a snapshot of the window:

    [​IMG]

    It doesn't tell me which line to fix, it just spits out non-user friendly numbers :(
     
  7. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    The line number is shown after "C:StuffSonicSonLVLNew Disassembly - Copysonic1.asm".

    The first error is pointed at line 24986. The second one at 24988.
     
    Last edited by a moderator: Aug 4, 2014
  8. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    It's actually telling you the numbered line to go to in the .asm file. (Those numbers next to SONIC1.ASM)

    I use Notepad++ to find this line, due to the fact that it numbers each line for you.

    EDIT: Dang it, Ralakimus!
     
    Last edited by a moderator: Aug 4, 2014
  9. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How would I find them by line number in notepad or wordpad (the windows 8 versions)? I don't have notepad++.
     
  10. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Count.

    Just kidding, but seriously, I would get Notepad++ as I really don't know if there really is a definitive way to find a line number in Note/Wordpad.
     
  11. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I personally use Notepad2, but whatever fits your boat works.

    If you really insist on sticking with Microsoft's bare-bone editor though, press Ctrl+G ("GoTo") and enter the line number.
     
  12. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Ok, this is starting to get weird. I found the two lines, but neither of them are branches that are covered anywhere. Here's the two lines:

            bcs.w    loc_18F38

    and

            ext.w    d4

    I changed their .s's to .w, but it didn't change much.
     
  13. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Not sure about the ext.w, but I can definitely tell you that the bcs's cause of going out of range is that, well, it is out of range. You need to convert it into a small check to execute an absolute jmp instead, like this:

    Code:
    		bcc.s	@CarryClear
    		jmp	loc_18F38
    
    @CarryClear:
     
  14. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Doing this oddly creates three errors, none of which make any sense.

    [​IMG]

    Here's a copy of my current ASM, if that helps:

    Download removed
     
    Last edited by a moderator: Aug 4, 2014
  15. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    What isn't making sense? They are just more out-of-range errors. They happen all the time; better get used to them as early as you can.

    The first two are fixed by overwriting your Boundary_Bottom routine with this:

    Boundary_Bottom:
    move.w ($FFFFF726).w,d0
    move.w ($FFFFF72E).w,d1
    cmp.w d0,d1
    blt.s Boundary_Bottom_locret
    cmpi.w #$501,($FFFFFE10).w ; is level SBZ2 ?
    bne.s Boundary_Bottom_kill ; if not, kill Sonic
    cmpi.w #$2000,($FFFFD008).w
    bcs.s Boundary_Bottom_kill
    clr.b ($FFFFFE30).w ; clear lamppost counter
    move.w #1,($FFFFFE02).w ; restart the level
    move.w #$100,($FFFFFE10).w ; set level to SRZ (act 1)

    Boundary_Bottom_locret:
    rts

    Boundary_Bottom_kill:
    jmp KillSonicThe third one is located as the last line of loc_18EB4. Just replace the bra.s with bra.w and there you go.
    For more information, read this guide I wrote an eternity ago: http://sonicresearch.org/forums/index.php?showtopic=857
     
  16. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Thank you so much! Now I can add more code! I might need to PM you later to figure out how to fix later errors in the future, though.
     
  17. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I don't give assistance via PM all that much. However, since I think I'm slowly getting back into this community I might as well keep an eye open for this thread more often.
     
  18. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    Good afternoon. I would just like some advice on how to extract .bin files from a "clean/modified" (i.e. 4.096 KB) S3K Rom. The thing is, I want to use the SK special stages that I modified using an utility, so I thought the way to do it would be to extract the .bin files "SK Set 1" and "SK Set 2" in a copy of the disassembly, at "General/Special Stage/Layout". I have been using the "skdisasm-master" disassembly. How do I convert the S3K Rom into a full, skdisasm-master-compatible disassembly, so I can copy/overwrite those 2 specific .bin files?

    note: I am familiar with editing their layout via hex if they were not compressed (Kosinski, I think) like the S3 ones. And I tried using Sega Data Compressor to "decompress" the "SK Set" .bin files, to no avail: it results in a 1 KB file with only a few zeros.
     
  19. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    You will have to sit and create your own disASM from a modified ROM. Creating disASMs takes time and effort, there is no wonder tool that will magically create one for you.
     
  20. brickrick

    brickrick Active Member Member

    Joined:
    Apr 30, 2012
    Messages:
    33
    Oh, I clearly had no idea about that worked... my bad. I thought one of the .batch in the Build Scripts folder would allow something of the like. Nevermind. That leaves me with the Sega Data Compressor matter then. I read at Sonic Retro (in the "Blue Balls v1.02 entry) that the SK Special Stages could be edited by decompressing them with the Sega Data C., Kosinski, but I must have missed a step (probably?). What I only need to know is how to decompress/convert the "SK Set 1" and "SK Set 2" .bin files, so it can be edited?

    Thanks for your time, btw.

    EDIT: I plan on editing them with a Hex Editor instead of the Blue Balls program due to some glitches it gave on me.
     
    Last edited by a moderator: Aug 6, 2014