Basic Questions and Answers Thread

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

  1. JoenickROS

    JoenickROS ROS is on hiatus. (...again) Member

    Joined:
    Feb 5, 2012
    Messages:
    919
    Oh really oh and then ill probably have to make some nesssary changes too. I can probably manage that but if I get stuck on something I might ask for help, but I've probably annoyed you enough as it is so ill try my hardest not to ask for any more help.

    EDIT: Wow it seems you still update your guide because last time I checked there was nothing about getting knuckles sound effects to work in Sonic 2.
     
    Last edited by a moderator: Mar 10, 2013
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    Alternately, you could copy the ASM versions of the title card and end of act mappings from the Hg disassembly and then follow my guide as is.

    If you're going to look for the mappings in KiS2, you can search for the name of the first frame, byte_311BF6.
     
    Last edited by a moderator: Mar 10, 2013
  3. JoenickROS

    JoenickROS ROS is on hiatus. (...again) Member

    Joined:
    Feb 5, 2012
    Messages:
    919
    Ok thanks Mainmemory that should help me a lot.
     
    Last edited by a moderator: Mar 10, 2013
  4. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    My hack got slower to start (I guess it's related to the checksum, the rom is now 4MB), is there a way to avoid that?

    Or more precisely, is it safe to just skip the checksum?
     
    Last edited by a moderator: Mar 14, 2013
  5. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    860
    It is safe to skip the checksum.
     
  6. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,772
    Location:
    italy
    Yeah, skipping the checksum is safe. I think it was checked back in the day to make sure the ROM data wasn't corrupted, but since we're talking about files on our hard drives I doubt this problem still applies. It would still make a difference if someone burns a ROM on a faulty flash cart to play it on real hardware, but eh. That's a slim chance.


    If you're hacking Sonic 1 with the Hivebrain disassembly, change:

    Code:
    GameProgram:
    		tst.w	($C00004).l
    		btst	#6,($A1000D).l
    		beq.s	CheckSumCheck
    		cmpi.l	#'init',($FFFFFFFC).w ; has checksum routine already run?
    		beq.w	GameInit	; if yes, branch
    
    CheckSumCheck:
    		movea.l	#ErrorTrap,a0	; start	checking bytes after the header	($200)
    		movea.l	#RomEndLoc,a1	; stop at end of ROM
    		move.l	(a1),d0
    		moveq	#0,d1
    
    loc_32C:
    		add.w	(a0)+,d1
    		cmp.l	a0,d0
    		bcc.s	loc_32C
    		movea.l	#Checksum,a1	; read the checksum
    		cmp.w	(a1),d1		; compare correct checksum to the one in ROM
    		bne.w	CheckSumError	; if they don't match, branch
    		lea	($FFFFFE00).w,a6
    		moveq	#0,d7
    		move.w	#$7F,d6
    
    loc_348:
    		move.l	d7,(a6)+
    		dbf	d6,loc_348
    		move.b	($A10001).l,d0
    		andi.b	#$C0,d0
    		move.b	d0,($FFFFFFF8).w
    		move.l	#'init',($FFFFFFFC).w ; set flag so checksum won't be run again
    
    GameInit:
    
    To
    Code:
    GameProgram:
    GameInit:
    At least, that's what I did in my hack. As a bonus, you get 4 bytes of free RAM you can use as you prefer (from $FFFFFFFC to $FFFFFFFF).
     
    Last edited by a moderator: Mar 14, 2013
  7. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    382
    Location:
    Russia
    In emulation, yes. This is totally unnecessary.

    The checksum was mainly meant to protect from ROM chips, defected during manufacturing, but most likely, as a reminder for you to clean the cartridge (the dust on cartridge pins was the main reason of ROM being read incorrectly). If the data is improper, the game can't function correctly, and to avoid possible mind-blowing bugs and artifacts, most of games signalized about the problem with a red screen.

    Of course, something like this would never happen with an emulator, so there is no reason to keep this check.

    EDIT: Damn, ninja'd by both MainMemory and Nineko =S
     
    Last edited by a moderator: Mar 14, 2013
  8. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    389
    Location:
    Town Creek, AL
    Working on the end of act sign, life counter, ending sequence (sonic 1), what pieces of code do i change to have with different characters?

    example:

    Code:
    cmpi.b #1, (character).w
    
    beq loadwhatever
    
    bra whatever
    
    loadwhatever: Life art, sign art, end art for 2nd character code
    
    whatever: the rest of it's code
    
    [code]
    
    I have mentioned that i am working on Richter Belmont in sonic, keeping sonic in the game, but don't know where to look for art change. I have the art ready but search Nem_endsonic and the only one is it's binary, endsonic.bin. same with life icon and end of act sign.
    
    
     
  9. JoenickROS

    JoenickROS ROS is on hiatus. (...again) Member

    Joined:
    Feb 5, 2012
    Messages:
    919
    What are some of the things I would have to do to restore the breakable wall in Sonic 2?

    Edit: Has anyone done it before even?

    I know the sprite mappings are still there but I cant seem to find the nemesis art for it

    Edit: found out how just need to create the art now
     
    Last edited by a moderator: Mar 16, 2013
  10. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I have a strange problem with SonMapEd.

    When I load the mapping, it displays an error message "At byte #777, tile pattern = $89, which is greater than the maximum $0F. This is most commonly caused by loading with the wrong game format selected, or loading the wrong file."

    The game format is right (S1), and it's obviously the right file. I put and F in that byte 777 and it loaded correctly, but the mapping was wrong, of course. I also saved the mapping several times (new file, asm/binary), and it still tells there's a problem at byte 777, whatever is in byte 777 (if it's another piece, it shows the same error with the relevant tile pattern value).

    What is causing this and what can I do?

    (and the mapping is displayed correctly in game)
     
    Last edited by a moderator: Mar 16, 2013
  11. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    911
    Location:
    the united states. where else?
    Alright, I have some experience with SonMapEd, so let me try my hand at figuring out what's happening.

    First, let's look at what we know. We know the following:

     - If the file is left as is, there's a problem with byte 777.

     - If an F is put in byte 777, it loads properly, but the mapping is wrong.

     - The game being hacked is Sonic 1.

     - SonMapEd gives this error regardless of the file type (.bin or .asm)

     - The mapping displays properly ingame

    ...Quick question for you: Does this problem occur if you load an unedited Sonic mappings file (as in one from a clean disassembly) from the same disassembly? If you haven't tried it yet, copy a fresh mappings file from a clean disassembly, rename it to Sonic_old.asm, and open it with SonMapEd. If the same error occurs, still try to tell us as much as possible. And are you loading all three art-related files for Sonic? If you're not, that's the EXACT reason why the mappings are displayed incorrectly. For example, before (I hack Sonic 2 and I'm displaying the Super Peel-Out for this example, so your art files might be slightly different since you're hacking Sonic 1 and you might not have the Super Peel-Out sprites):

    [​IMG]

    After:

    [​IMG]

    SEE?
     
    Last edited by a moderator: Mar 16, 2013
  12. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Do you realize your post is almost completely useless, and essentially off-topic? Let alone that your experience with sonmaped is that of a baby with a chainsaw.

    I'm asking details about a bug in sonmaped that causes it to show an error message when it loads a perfectly fine map. The map "IS" good, it's a bug of sonmaped. If I add a frame (even a blank one), the map will load fine, no error message, if I remove that frame, the error message will show again.

    Therefore the question (to people who would know something about this): what causes sonmaped to show an irrelevant error message such as the one described above?
     
  13. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    911
    Location:
    the united states. where else?
    Goddamnit. Well, at least I can say I tried, but I'm afraid I can't help you.
     
  14. daninthemix

    daninthemix Newcomer Trialist

    Joined:
    Mar 16, 2013
    Messages:
    2
    Can someone help me disable the music in Sonic 1, so I just get sound effects? Is there a GG/PAR code that can accomplish, or is it a case of hacking the ROM?
     
  15. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    382
    Location:
    Russia
  16. daninthemix

    daninthemix Newcomer Trialist

    Joined:
    Mar 16, 2013
    Messages:
    2
    Thanks a lot!. Sonic 1 doesn't boot though - I just get a red screen.
     
  17. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    382
    Location:
    Russia
    This is because of unfixed checksum. The ROM was modified, so the data now has a different checksum from what is written in ROM's header. I usually fix checksums or delete the verifying code (the one that shows red screen, if the check fails), but it looks like I forgot to do it back then.

    Just enable 'Auto Fix Checksums' in your emulator options to fix this.
     
  18. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I'll post more details about this Sonmaped bug, it's really annoying.
     
    First of all, here's the mapping causing a problem when loaded:

    ; --------------------------------------------------------------------------------
    ; Sprite mappings - output from SonMapEd - Sonic 1 format
    ; --------------------------------------------------------------------------------

    SME_LSgHw:
    dc.w SME_LSgHw_18-SME_LSgHw, SME_LSgHw_28-SME_LSgHw
    dc.w SME_LSgHw_42-SME_LSgHw, SME_LSgHw_75-SME_LSgHw
    dc.w SME_LSgHw_C1-SME_LSgHw, SME_LSgHw_117-SME_LSgHw
    dc.w SME_LSgHw_159-SME_LSgHw, SME_LSgHw_191-SME_LSgHw
    dc.w SME_LSgHw_1F1-SME_LSgHw, SME_LSgHw_25B-SME_LSgHw
    dc.w SME_LSgHw_2C0-SME_LSgHw, SME_LSgHw_325-SME_LSgHw
    SME_LSgHw_18: dc.b 3
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    SME_LSgHw_28: dc.b 5
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    dc.b $30, $E, 0, $23, 8
    dc.b $30, $E, 0, $2F, $28
    SME_LSgHw_42: dc.b $A
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    dc.b $30, $E, 0, $23, 8
    dc.b $30, $E, 0, $2F, $28
    dc.b $48, $D, 0, $3B, 0
    dc.b $48, 9, 0, $43, $20
    dc.b $48, 0, 0, $49, $38
    dc.b $58, $C, 0, $4A, 8
    dc.b $58, 0, 0, $4E, $28
    SME_LSgHw_75: dc.b $F
    dc.b $48, $E, 1, $BD, $20
    dc.b $38, 5, 1, $C9, $38
    dc.b $40, 0, 1, $CD, $30
    dc.b $48, 0, 1, $CE, $40
    dc.b $60, 0, 1, $CF, $20
    dc.b $10, $E, 0, $4F, 8
    dc.b $10, $E, 0, $5B, $28
    dc.b $18, 1, 0, $67, $48
    dc.b $28, 2, 0, $69, 0
    dc.b $28, $F, 0, $6C, 8
    dc.b $28, $F, 0, $7C, $28
    dc.b $30, 2, 0, $8C, $48
    dc.b $48, $E, 0, $8F, $10
    dc.b $48, 9, 0, $9B, $30
    dc.b $58, 4, 0, $A1, $30
    SME_LSgHw_C1: dc.b $11
    dc.b $38, $E, 1, $BD, $28
    dc.b $28, 5, 1, $C9, $40
    dc.b $30, 0, 1, $CD, $38
    dc.b $38, 0, 1, $CE, $48
    dc.b $50, 0, 1, $CF, $28
    dc.b $20, $F, 1, $A9, 8
    dc.b $20, 3, 1, $B9, $28
    dc.b $10, $E, 0, $4F, 8
    dc.b $10, $E, 0, $5B, $28
    dc.b $18, 1, 0, $67, $48
    dc.b $28, 2, 0, $69, 0
    dc.b $28, $F, 0, $6C, 8
    dc.b $28, $F, 0, $7C, $28
    dc.b $30, 2, 0, $8C, $48
    dc.b $48, $E, 0, $8F, $10
    dc.b $48, 9, 0, $9B, $30
    dc.b $58, 4, 0, $A1, $30
    SME_LSgHw_117: dc.b $D
    dc.b $10, $F, 0, $A3, 8
    dc.b 8, 8, 0, $B3, $28
    dc.b $10, $F, 0, $B6, $28
    dc.b $18, 0, 0, $C6, $48
    dc.b $20, 6, 0, $C7, $48
    dc.b $38, 0, 0, $CD, $48
    dc.b $30, $D, 0, $CE, 8
    dc.b $30, $E, 0, $D6, $28
    dc.b $40, $B, 0, $E2, $10
    dc.b $48, 8, 0, $EE, $28
    dc.b $50, 1, 0, $F1, 8
    dc.b $50, 4, 0, $F3, $28
    dc.b $58, 0, 0, $F5, $28
    SME_LSgHw_159: dc.b $B
    dc.b 8, $F, 0, $F6, $10
    dc.b 8, $B, 1, 6, $30
    dc.b $10, 6, 1, $12, $48
    dc.b $28, $E, 1, $18, $18
    dc.b $28, $E, 1, $24, $38
    dc.b $28, 1, 1, $30, $10
    dc.b $40, $E, 1, $32, $10
    dc.b $40, 6, 1, $3E, $30
    dc.b $40, 4, 1, $44, $40
    dc.b $48, 0, 1, $46, $40
    dc.b $58, 8, 1, $47, $18
    SME_LSgHw_191: dc.b $13
    dc.b $28, $E, 1, $E4, $38
    dc.b $18, 5, 1, $F0, $48
    dc.b $40, 8, 1, $F4, $38
    dc.b $48, 4, 1, $F7, $38
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_LSgHw_1F1: dc.b $15
    dc.b $28, $E, 1, $E4, $38
    dc.b $18, 5, 1, $F0, $48
    dc.b $40, 8, 1, $F4, $38
    dc.b $48, 4, 1, $F7, $38
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_LSgHw_25B: dc.b $14
    dc.b $17, 5, 2, $D, $3F
    dc.b $27, $B, 2, $11, $37
    dc.b $47, 4, 2, $1D, $39
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_LSgHw_2C0: dc.b $14
    dc.b $17, 5, 2, $1F, $3C
    dc.b $27, $B, 2, $23, $34
    dc.b $47, 4, 2, $2F, $3B
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50 ; this is where the data comes from
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_LSgHw_325: dc.b $16
    dc.b $18, 4, 1, $F9, $38
    dc.b $20, 0, 1, $FB, $38
    dc.b $28, 8, 1, $FC, $30
    dc.b $30, 1, 1, $FF, $30
    dc.b $30, $B, 2, 1, $38
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    even
    Then, here's the mapping generated by sonmaped with this error:

    ; --------------------------------------------------------------------------------
    ; Sprite mappings - output from SonMapEd - Sonic 1 format
    ; --------------------------------------------------------------------------------

    SME_SU1ns:
    dc.w SME_SU1ns_1A-SME_SU1ns, SME_SU1ns_2A-SME_SU1ns
    dc.w SME_SU1ns_44-SME_SU1ns, SME_SU1ns_77-SME_SU1ns
    dc.w SME_SU1ns_C3-SME_SU1ns, SME_SU1ns_119-SME_SU1ns
    dc.w SME_SU1ns_15B-SME_SU1ns, SME_SU1ns_193-SME_SU1ns
    dc.w SME_SU1ns_1F3-SME_SU1ns, SME_SU1ns_25D-SME_SU1ns
    dc.w SME_SU1ns_2C2-SME_SU1ns, SME_SU1ns_327-SME_SU1ns
    dc.w SME_SU1ns_396-SME_SU1ns
    SME_SU1ns_1A: dc.b 3
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    SME_SU1ns_2A: dc.b 5
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    dc.b $30, $E, 0, $23, 8
    dc.b $30, $E, 0, $2F, $28
    SME_SU1ns_44: dc.b $A
    dc.b 8, 8, 0, 0, 8
    dc.b $10, $F, 0, 3, 8
    dc.b $10, $F, 0, $13, $28
    dc.b $30, $E, 0, $23, 8
    dc.b $30, $E, 0, $2F, $28
    dc.b $48, $D, 0, $3B, 0
    dc.b $48, 9, 0, $43, $20
    dc.b $48, 0, 0, $49, $38
    dc.b $58, $C, 0, $4A, 8
    dc.b $58, 0, 0, $4E, $28
    SME_SU1ns_77: dc.b $F
    dc.b $48, $E, 1, $BD, $20
    dc.b $38, 5, 1, $C9, $38
    dc.b $40, 0, 1, $CD, $30
    dc.b $48, 0, 1, $CE, $40
    dc.b $60, 0, 1, $CF, $20
    dc.b $10, $E, 0, $4F, 8
    dc.b $10, $E, 0, $5B, $28
    dc.b $18, 1, 0, $67, $48
    dc.b $28, 2, 0, $69, 0
    dc.b $28, $F, 0, $6C, 8
    dc.b $28, $F, 0, $7C, $28
    dc.b $30, 2, 0, $8C, $48
    dc.b $48, $E, 0, $8F, $10
    dc.b $48, 9, 0, $9B, $30
    dc.b $58, 4, 0, $A1, $30
    SME_SU1ns_C3: dc.b $11
    dc.b $38, $E, 1, $BD, $28
    dc.b $28, 5, 1, $C9, $40
    dc.b $30, 0, 1, $CD, $38
    dc.b $38, 0, 1, $CE, $48
    dc.b $50, 0, 1, $CF, $28
    dc.b $20, $F, 1, $A9, 8
    dc.b $20, 3, 1, $B9, $28
    dc.b $10, $E, 0, $4F, 8
    dc.b $10, $E, 0, $5B, $28
    dc.b $18, 1, 0, $67, $48
    dc.b $28, 2, 0, $69, 0
    dc.b $28, $F, 0, $6C, 8
    dc.b $28, $F, 0, $7C, $28
    dc.b $30, 2, 0, $8C, $48
    dc.b $48, $E, 0, $8F, $10
    dc.b $48, 9, 0, $9B, $30
    dc.b $58, 4, 0, $A1, $30
    SME_SU1ns_119: dc.b $D
    dc.b $10, $F, 0, $A3, 8
    dc.b 8, 8, 0, $B3, $28
    dc.b $10, $F, 0, $B6, $28
    dc.b $18, 0, 0, $C6, $48
    dc.b $20, 6, 0, $C7, $48
    dc.b $38, 0, 0, $CD, $48
    dc.b $30, $D, 0, $CE, 8
    dc.b $30, $E, 0, $D6, $28
    dc.b $40, $B, 0, $E2, $10
    dc.b $48, 8, 0, $EE, $28
    dc.b $50, 1, 0, $F1, 8
    dc.b $50, 4, 0, $F3, $28
    dc.b $58, 0, 0, $F5, $28
    SME_SU1ns_15B: dc.b $B
    dc.b 8, $F, 0, $F6, $10
    dc.b 8, $B, 1, 6, $30
    dc.b $10, 6, 1, $12, $48
    dc.b $28, $E, 1, $18, $18
    dc.b $28, $E, 1, $24, $38
    dc.b $28, 1, 1, $30, $10
    dc.b $40, $E, 1, $32, $10
    dc.b $40, 6, 1, $3E, $30
    dc.b $40, 4, 1, $44, $40
    dc.b $48, 0, 1, $46, $40
    dc.b $58, 8, 1, $47, $18
    SME_SU1ns_193: dc.b $13
    dc.b $28, $E, 1, $E4, $38
    dc.b $18, 5, 1, $F0, $48
    dc.b $40, 8, 1, $F4, $38
    dc.b $48, 4, 1, $F7, $38
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_SU1ns_1F3: dc.b $15
    dc.b $28, $E, 1, $E4, $38
    dc.b $18, 5, 1, $F0, $48
    dc.b $40, 8, 1, $F4, $38
    dc.b $48, 4, 1, $F7, $38
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_SU1ns_25D: dc.b $14
    dc.b $17, 5, 2, $D, $3F
    dc.b $27, $B, 2, $11, $37
    dc.b $47, 4, 2, $1D, $39
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_SU1ns_2C2: dc.b $14
    dc.b $17, 5, 2, $1F, $3C
    dc.b $27, $B, 2, $23, $34
    dc.b $47, 4, 2, $2F, $3B
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_SU1ns_327: dc.b $16
    dc.b $18, 4, 1, $F9, $38
    dc.b $20, 0, 1, $FB, $38
    dc.b $28, 8, 1, $FC, $30
    dc.b $30, 1, 1, $FF, $30
    dc.b $30, $B, 2, 1, $38
    dc.b $18, $F, 1, $D0, 8
    dc.b $18, 3, 1, $E0, $28
    dc.b $10, $F, 1, $4A, $10
    dc.b 8, 4, 1, $5A, $20
    dc.b 0, $B, 1, $5C, $30
    dc.b 8, 0, 1, $68, $48
    dc.b $18, 0, 1, $69, $48
    dc.b $18, 5, 1, $6A, 0
    dc.b $28, 2, 1, $6E, 8
    dc.b $30, $F, 1, $71, $10
    dc.b $20, $D, 1, $81, $30
    dc.b $20, 1, 1, $89, $50
    dc.b $30, 8, 1, $8B, $30
    dc.b $38, $E, 1, $8E, $30
    dc.b $50, $D, 1, $9A, 8
    dc.b $50, $C, 1, $A2, $28
    dc.b $58, 8, 1, $A6, $28
    SME_SU1ns_396: dc.b 1
    dc.b 1, $89, $50, $30, 8
    even
    So, as you can see, it adds a frame, for no apparent reason.

    The data in this frame actually comes from a piece found above. You can read it 1, 1, $89, $50, $30, 8, which is exactly what's written on the line with a comment. That false mapping begins at the 777th byte (308 in hex) of the mapping data in binary.

    I really don't understand what's happening there :/

    edit: sorry but asm and tabs don't seem to work :/

    Edit2: I think I understand what's happening. Sonmaped can't actually tell the addresses from the data at the beginning of the mappings, most likely because there's nothing to tell how many frames there are in the file. So there's some internal stuff to tell the addresses from the mapping data, and apparently it can make mistakes.

    Here's the beginning of the raw data: 0018 0028 0042 0075 00C1 0117 0159 0191 01F1 025B 02C0 0325 0308.
    The first 12 words are the relative addresses of the frame data, the 13th (in red) is the very beginning of the first sprite. But sonmaped reads it as an address as well for some reason, and then tries to read frame data from address 308 (in hex), therefore the error.

    Now the question is: how to make sure it won't read some mapping data as an address? :/

    I thought it would use the first word to know where to stop (0018 is the beginning of the mapping, so it's the end of the addresses), but apparently that's not what it does, or maybe there's a glitch in this particular case...
     
    Last edited by a moderator: Mar 17, 2013
  19. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    382
    Location:
    Russia
    This is weird, SpirituInsanum, but I don't have any issues with loading those in SonMapEd.

    I've straightly copied the code from your post (without tabulation) and opened it with SonMapEd.

    (Speaking of tabulation though, this is really awful ASM and CODE tags now don't handle spaces in the beginning of lines, like ordinary HTML containers, this is the reason I'm not even able to update my Mega PCM guide by adding a correction I've written in a later post. Actually, I could post a properly tabbed code via CODE tag, but that worked only in visual mode, and visual editor is buggy as hell)

    [​IMG]

    From what I see, they load correctly as they are shaping a proper Sonic's head. But there's an odd small frame in the end, is that one the bug you were referring to? Anyways, I didn't receive any error messages on loading and I was able to save and reload this without any further issues.

    Here's SonMapEd's output after I saved mappings to another file: http://pastebin.com/7iUAKBvT

    I'm quite sure SonMapEd recognizes the end of pointers list just the way you supposed. This is the wisest and the most obvious way in programming regard. Perhaps this is a glitch of SonMapEd's inner compiler or another rare bug. Have you tried converting your data to binary and then loading it?
     
  20. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    That odd small frame is indeed the wrong frame, it doesn't exist in the mapping you loaded.

    Maybe your error messages are turned off, the option's off by default "settings > miscellaneous > disable all warning and prompts".  Anyway, as you can see, your output is the same as the "wrong" one I posted. It adds a frame at the end with data taken after the 776th byte.

    I tried with binary as well, it does exactly the same.

    Thanks for checking, at least now I know it's really something wrong with sonmaped and not some unlikely bug from a faulty temp file or something.