sonic 1 problem with saving mappings

Discussion in 'Discussion and Q&A Archive' started by Baraksha, Mar 4, 2016.

  1. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    basically, I had project I was working on where I basically replace sonic's sprites with different ones and I have a problem with sonic 1's disassembly from the sonic retro github , for some reason I can't save the mappings and the pattern cues without failing to rebuilding the rom, according to the error text file most errors are due to undefined symbols. I didn't know what to do so I moved the project to sonic 2 which works fine, but now that I finaly decided to try this forum I guess I could probably ask you guys for help so I may try sonic 1 again
     
  2. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    Undefined as in the random ACSII bytes, or labels that don't exist?

    Could you show the error report in the errors.log (or s1.log, ect') so it's easier to understand the issue?
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    This is a common problem with the S1 GitHub disassembly, because somebody thought it would be a good idea to include constant definitions for each mapping frame inside the mappings, but mappings editing programs can't preserve those because they can only read and write mapping data. Also, SonMapEd doesn't save the original labels, so that might be a problem as well (Flex does IIRC).

    There are two ways to fix this: you can use a mappings editor on a copy of the files and then manually copy the changed sprite data into the original files, or you can move the constant definitions out of the mapping file and replace the fancy math with plain numbers.
     
  4. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    is there a chance you could recommend me a good mapping editor ?, i'm kind of new to this and also you don't have to, but I would appreciate it if you could give me some instructions
     
    Last edited: Mar 4, 2016
  5. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    also i'm preatty sure that MainMemory have figured it out , but just for the hack of it here is the "errors" text file
     

    Attached Files:

  6. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    In case you didn't understand, it's a bug with SonMapEd not preserving the labels.

    As said, MainMemory recommended Flex. http://snk.digibase.ca/flex/
    Either that, or the second method mentioned (as I've done), just manually re-insert the mappings back into a properly labeled mappings file.
     
  7. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    yeh, the second option sounds interesting, just one question, how do I " manually re-insert the mappings back into a properly labeled mappings file"
     
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    If you read what I said, the first issue with the constants applies to any mappings editor, there is no editor that won't have the problem.

    As for how to manually re-insert the mappings, well, you would have to compare the data in both files side-by-side, and whenever the bytes (not the labels) are different, you copy the new bytes into the old file.
     
  9. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    how do I "compare the data" do I need to open both in notepad? also, bytes?
     
  10. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    By using your eyes, what else? See how they're different and apply the changes from one to the other. Bytes are these things:
    Code:
    		dc.b $E8, $D, 0, 0, $EC
    		dc.b $E8, 1, 0,	8, $C
    		dc.b $F8, $B, 0, $A, $F4
    Not these:
    Code:
    MS_Burnt:
    MS_Surf:
    Just copy the changes to those $XX things from one file to another.

    I once wrote up how to make the Git mappings work with SonMapEd, but I can't seem to find it on this site, right now.
     
  11. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    ok, I don't want to bother you to much with my lack of knowledge, but the differences between the two asm files seem kind of big from each other, i'm not sure what bytes to copy to where
     

    Attached Files:

    Last edited: Mar 4, 2016
  12. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    With only exception to NULL not containing any mappings, copy the dc.b's from the strings of values, and replace the ones that are in the same position in the properly labelled mappings.

    In this case, "SME_qSV5p_B4" is "MS_Null," as "SME_qSV5p_B5" is "MS_Stand," BB is wait1, and so on.

    EDIT(2): Revised image after finding my own mistake in explaining.

    [​IMG]
     
    Last edited: Mar 5, 2016
  13. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    You may want to use another text editor; the one you use does not correctly recognize /n character (newline). You could use ConTEXT or Sublime Text 3. Plus you get a lot of useful features!
     
  14. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    I will try it later, but one question, do I have to change all the code or can I just change it for the animation I changed sprites for?
     
  15. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    well, I didn't though you need anything special so I just used whatever came with windows
     
  16. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    its not that you really need it, but that you will have a lot better time with it (generally speaking)
     
  17. LazloPsylus

    LazloPsylus The Railgun Member

    Joined:
    Nov 25, 2009
    Messages:
    Location:
    Academy City
  18. Baraksha

    Baraksha Well-Known Member Member

    Joined:
    Dec 23, 2015
    Messages:
    99
    do I have to copy every single line of code? is this why I need a better text editor?
     
  19. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Well like Natsumi said, you don't need it, it will just make things so much easier for you. Also that's what those programs he suggested were made for. Also did you even read what Laz posted? Doesn't seem like it since you didn't capitalize your sentences, again.