Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. AURORA☆FIELDS

    AURORA☆FIELDS

    The cute one here Tech Member
    216
    21
    18
    Finland
    AMPS
    one of the most obvious issues in Sonic 1 is mappings limit; I am not sure what would happen if this has gone over, but I am fairly certain reading illegal data would occur. Here is a fix for that.
    Other thing to note would to double check you exported everything in Sonic 1 format correctly.
     
  2. Campbellsonic

    Campbellsonic

    Member
    19
    0
    1
    I suspected that that might be the issue and reduced the frames down to 7F by removing ones I wouldn't need, but it's still the same issue. I thought there might be a pattern to the ones that work and the ones that don't, and it seems that for the most part frames above $28 are garbled and earlier ones aren't. Curiously, exceptions are $31 (which works fine), and 7, 8, and $B which have numbers scrambled into them, which aren't even from Sonic's art.

    [​IMG]
     
  3. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,158
    54
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Sonic 1 DPLCs only transfer $2E0 bytes (23 tiles), and many S3&K sprites (especially the diagonal ones) use more than that. The game just uses whatever tiles are already present in VRAM past these.

    Edit: Also note that the RAM buffer used by S1 for storing Sonic's art is 24 tiles long ($300 bytes); so you would need to change its size too, or change the DPLC method to be more like the one from S2/S3&K.
     
  4. Campbellsonic

    Campbellsonic

    Member
    19
    0
    1
    So... I have to port the DPLC method from Sonic 2 or 3 and extend the RAM buffer for Sonic's art? I don't even know where to begin there, so would it be simpler to simply map the sprites in S1 format manually? I started out doing that and quickly realized it was very tedious, but it seems it may actually be the simpler way to go here.
     
  5. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,158
    54
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    You would have to either port the S2/S3&K method or extend the art buffer; in either case you also need to free up some VRAM for the frames that need more art. The S2/S3&K method don't need an art buffer (and it could be used for the RAM requirements of it). I think there was a tutorial about it on the wiki.

    Remapping it to use less tiles is also a possibility.
     
  6. AURORA☆FIELDS

    AURORA☆FIELDS

    The cute one here Tech Member
    216
    21
    18
    Finland
    AMPS
    yes the spindash tutorial has the whole DMA thing in hand, so porting the spindash will result in porting the DMA queue.
     
  7. rata

    rata

    Member
    600
    21
    18
    Argentina
    Trying to be useful somehow.
    This, and another tip that means more work but that it will worth it. If you 'break' the sprites, you can create additional blank tiles so you can decrease the amount of tiles loaded even futher. I will post the same example since this is one case that really show the benefit of it.
    [​IMG]


    Of course that this means editing the art file, but in frames like this one you can load up to 4 tiles less than without breaking it. It also means a more complex mapping, but if you're using SonMapEd, you have no excuse to not do it. I do have to say that I don't know how optimized the S3 sprites are, but at least in S1 you can save a lot of space with this.


    I will also stop being an asshole and accept that I need help with some issue with porting the bloody DMA Queue. You'll see, Im using the GitHub disassembly since Im a newbie and I need all things labeled and tagged and split into a lot of individual files (2005 one's 3MB sonic.asm file lags like hell in my netbook) and I wanted (still want) to port Green Snake's multi-character guide from the old disam format to the GH one, and after some help I have all done... except the DMA Queue. So, I started porting that, and I can not make Sonic appear at all. Im sure that the problem is here, but I don't know what to do. Here's the thing:
    Once you've finished, go to "loc_CD4", "loc_DAE", "loc_EEE", and loc_FAE"

    Once you've finished, go to "loc_CD4", "loc_DAE", "loc_EEE", and loc_FAE". Replace this piece of code.
    [68k]
    tst.b ($FFFFF767).w
    beq.s loc_D50
    lea ($C00004).l,a5
    move.l #$94019370,(a5)
    move.l #$96E49500,(a5)
    move.w #$977F,(a5)
    move.w #$7000,(a5)
    move.w #$83,($FFFFF640).w
    move.w ($FFFFF640).w,(a5)
    move.b #0,($FFFFF767).w[/68k]



    With this.
    [68k] jsr (ProcessDMAQueue).l [/68k]My disam doesn't have this, but after comparing them side by side, I figured out that it would be this part:

    Once you've finished, go to "VBla_08/@waterbelow", "VBla_0A", "VBla_0C/@waterbelow", and "VBla_16"

    Replace this piece of code.

    [68k]
    tst.b (f_sonframechg).w ; has Sonic's sprite changed?
    beq.s @nochg ; if not, branch

    writeVRAM v_sgfx_buffer,$2E0,vram_sonic ; load new Sonic gfx
    move.b #0,(f_sonframechg).w[/68k]


    The WriteVRAM macro is this:

    [68k]
    writeVRAM: macro
    lea (vdp_control_port).l,a5
    move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
    move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
    move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
    move.w #$4000+(\3&$3FFF),(a5)
    move.w #$80+((\3&$C000)>>14),(v_vdp_buffer2).w
    move.w (v_vdp_buffer2).w,(a5)
    endm[/68k]

    The guide says that if you build and you see Sonic, you deserve a cookie. well, Sonic does NOT appear therefore I have NO COOKIE!
    Also, while I see that the macro HAS TO BE the thing that I have to replace because it's too bloody similar, I have no idea what those >((())$%$· things are.
    Can someone explain to me what am I doing wrong, please? I have this thing pending since I joined the comunity (yes, I am THAT dumb).


     
  8. RetroKoH

    RetroKoH

    Member
    1,661
    17
    18
    Project Sonic 8x16
    In S3K, Tails has a couple of frames in his sprite set where his feet are up in the air, but the head and hands are in the tired animation... it looks like it should be his sprite for falling from flight... but I've NEVER seen it used... that said, it's not on the cutting room floor... is this sprite EVER used?
     
  9. Clownacy

    Clownacy

    Tech Member
    838
    79
    28
    Yeah, it's used. Get Tails to carry Sonic while underwater, he instantly gets tired and uses that animation.
     
  10. RetroKoH

    RetroKoH

    Member
    1,661
    17
    18
    Project Sonic 8x16
    Oh wow... I feel stupid... feel like I should've remembered that one. Cheers
     
  11. LuigiXHero

    LuigiXHero

    Member
    37
    25
    18
    Sonic 1 Character Pak
    So I decided to start a S2 hack but I'm having one problem. How do you actually use the S2 Sound Driver? I'm trying to replace the music but I don't know how to extend the banks to fit my new music. I been searching Retro but haven't really found any useful information.
     
  12. Clownacy

    Clownacy

    Tech Member
    838
    79
    28
    Replacing music (as opposed to adding it) shouldn't be that hard at all. It should be said that S2's driver is pretty heavily optimised at a cost of flexibility, one example of this being that there are only two music banks. The first bank is only used by the continue music, so there's plenty of room in that one. Really, if your song's too big for that bank, you've got bigger problems to tend to.

    Jokes aside, the bank you're looking for is MusicPoint1, but just putting your music there isn't all you need to do: you also need to modify the entry of your music in zMasterPlaylist. Basically, change it from 'id(MusPtr_name)' to '(MusPtr_name-MusicPoint1)/ptrsize'. What this is really doing is subtracting $80 from the value, since the highest bit determines which bank to use. I should really change the Git disasm to be less stupid with that. zMasterPlaylist is useful for some other things as well: if your music is uncompressed, put '+20h' at the end of the entry to make the driver handle it properly. Also, if you want your music to slow down on PAL consoles (like the drowning theme), put '+40h' at the end as well.
     
  13. LuigiXHero

    LuigiXHero

    Member
    37
    25
    18
    Sonic 1 Character Pak
    Thanks but after talking with some people I got convinced to use flamewing's S3K driver.

    I got it to work perfectly (I edited it to use default S2 slots as well)

    Now my new question is: How do I add more music? I made it so each act has it's own music but now I can't seem to add any more music. I now how to add more music to the banks themselves but I can't seem to actually get them into a slot.
     
  14. Clownacy

    Clownacy

    Tech Member
    838
    79
    28
    There should just be some tables in the driver you need to add to. Just copy the label of one of the driver's already-working songs, and search for it in the driver's file. That should find all of them. I'm not at a computer right now, so I can't check, sorry.

    EDIT: Yeah, there's z80_MusicBanks and z80_MusicPointers, those I found immediately just by searching 'Snd_GameOver'. Really, try doing that once in a while, it'll save you a few questions. Anyway, you may also need to adjust MusID__End, since, in S&K and flamewing's driver, it's hardcoded. My details might not be exact, unless you felt like porting the current version of flamewing's driver yourself, since the already-ported copy of the driver supplied with a certain guide is outdated and pretty broken last I checked.
     
  15. LuigiXHero

    LuigiXHero

    Member
    37
    25
    18
    Sonic 1 Character Pak
    Oh thanks I I didn't know I had to adjust MusID_End.

    As for porting over the current version. I litterally had to change 1 line of code to get it to compile and run. I now have to go through and fix all the IDs though now. But neat how it wasn't too hard to get it running.
     
  16. E-122-Psi

    E-122-Psi

    Member
    2,133
    345
    63
    Okay this is a more diverse one. I've been looking at this hex tutorial for PAL PS2 Gems Collection and have been trying to convert it into an ARMAX code:
    http://forums.sonicretro.org/index.php?showtopic=17172

    All my attempts have caused the game to freeze at the first loading screen.

    The two lines I tried converting I typed as such:
    1353439c 412e504a
    1353439d 412e504a

    Am I doing something wrong (I know the data is compiled from different files which may complicate it a little).
     
  17. LuigiXHero

    LuigiXHero

    Member
    37
    25
    18
    Sonic 1 Character Pak
    I have a small question:

    Does anyone have a PSG table of S3D?

    I tried to port Spring Stadium to S1, but the psg is all wrong, and it doesn't seem to use the same psg as S3K.

    I looked around can couldn't find any info on it's PSG
     
  18. Clownacy

    Clownacy

    Tech Member
    838
    79
    28
    I was going to suggest Valley Bell's SMPS Research Pack, but it doesn't seem to contain any direct PSG rips. So I just ripped the thing from the driver itself:

    S3
    Code (ASM):
    1. VolEnvPtrs: dw PSG_1, PSG_2, PSG_3, PSG_4
    2.         dw PSG_5, PSG_6, PSG_7, PSG_8
    3.         dw PSG_9, PSG_A, PSG_B, PSG_C
    4.         dw PSG_D, PSG_E, PSG_F, PSG_10
    5.         dw PSG_11, PSG_12, PSG_13, PSG_14
    6.         dw PSG_15, PSG_16, PSG_17, PSG_18
    7.         dw PSG_19, PSG_1A, PSG_1B, PSG_1C
    8.         dw PSG_1D, PSG_1E, PSG_1F, PSG_20
    9.         dw PSG_21, PSG_22, PSG_23, PSG_24
    10.         dw PSG_25, PSG_26, PSG_27
    11. PSG_1:      db 2, 83h
    12. PSG_2:      db 0, 2, 4, 6, 8, 10h, 83h
    13. PSG_3:      db 2, 1, 0, 0, 1, 2, 2, 2, 2, 2
    14.         db 2, 2, 2, 2, 2, 2, 2, 3, 3, 3
    15.         db 4, 4, 4, 5, 81h
    16. PSG_4:      db 0, 0, 2, 3, 4, 4, 5, 5, 5, 6
    17.         db 6, 81h
    18. PSG_5:      db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    19.         db 81h
    20. PSG_6:      db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    21.         db 8, 7, 7, 6, 81h
    22. PSG_7:      db 1, 0Ch, 3, 0Fh, 2, 7, 3, 0Fh, 80h
    23. PSG_8:      db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    24.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    25. PSG_9:      db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    26.         db 81h
    27. PSG_A:      db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    28.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    29.         db 81h
    30. PSG_B:      db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 0F0h, 80h
    31. PSG_C:      db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    32. PSG_D:      db 0, 81h
    33. PSG_E:      db 2, 83h
    34. PSG_F:      db 0, 2, 4, 6, 8, 10h, 83h
    35. PSG_10:     db 9, 9, 9, 8, 8, 8, 7, 7, 7, 6
    36.         db 6, 6, 5, 5, 5, 4, 4, 4, 3, 3
    37.         db 3, 2, 2, 2, 1, 1, 1, 0, 0, 0
    38.         db 81h
    39. PSG_11:     db 1, 1, 1, 0, 0, 0, 81h
    40. PSG_12:     db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    41.         db 81h
    42. PSG_13:     db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    43.         db 8, 7, 7, 6, 81h
    44. PSG_14:     db 0Ah, 5, 0, 4, 8, 83h
    45. PSG_15:     db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    46.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    47. PSG_16:     db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    48.         db 81h
    49. PSG_17:     db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    50.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    51.         db 81h
    52. PSG_18:     db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h
    53.         db 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h, 30h, 40h
    54.         db 30h, 20h, 10h, 0, 80h
    55. PSG_19:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    56. PSG_1A:     db 0, 2, 4, 6, 8, 16h, 83h
    57. PSG_1B:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    58. PSG_1C:     db 4, 4, 4, 4, 3, 3, 3, 3, 2, 2
    59.         db 2, 2, 1, 1, 1, 1, 83h
    60. PSG_1D:     db 0, 0, 0, 0, 1, 1, 1, 1, 2, 2
    61.         db 2, 2, 3, 3, 3, 3, 4, 4, 4, 4
    62.         db 5, 5, 5, 5, 6, 6, 6, 6, 7, 7
    63.         db 7, 7, 8, 8, 8, 8, 9, 9, 9, 9
    64.         db 0Ah, 0Ah, 0Ah, 0Ah, 81h
    65. PSG_1E:     db 0, 0Ah, 83h
    66. PSG_1F:     db 0, 2, 4, 81h
    67. PSG_20:     db 30h, 20h, 10h, 0, 0, 0, 0, 0, 8, 10h
    68.         db 20h, 30h, 81h
    69. PSG_21:     db 0, 4, 4, 4, 4, 4, 4, 4, 4, 4
    70.         db 4, 6, 6, 6, 8, 8, 0Ah, 83h
    71. PSG_22:     db 0, 2, 3, 4, 6, 7, 81h
    72. PSG_23:     db 2, 1, 0, 0, 0, 2, 4, 7, 81h
    73. PSG_24:     db 0Fh, 1, 5, 83h
    74. PSG_25:     db 8, 6, 2, 3, 4, 5, 6, 7, 8, 9
    75.         db 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh, 10h, 83h
    76. PSG_26:     db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    77.         db 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    78.         db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
    79.         db 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
    80.         db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
    81.         db 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
    82.         db 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
    83.         db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
    84.         db 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
    85.         db 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
    86.         db 83h
    87. PSG_27:     db 0, 2, 2, 2, 3, 3, 3, 4, 4, 4
    88.         db 5, 5, 83h

    S&K
    Code (ASM):
    1. VolEnvPtrs: dw PSG_1, PSG_2, PSG_3, PSG_4
    2.         dw PSG_5, PSG_6, PSG_7, PSG_8
    3.         dw PSG_9, PSG_A, PSG_B, PSG_C
    4.         dw PSG_D, PSG_E, PSG_F, PSG_10
    5.         dw PSG_11, PSG_12, PSG_13, PSG_14
    6.         dw PSG_15, PSG_16, PSG_17, PSG_18
    7.         dw PSG_19, PSG_1A, PSG_1B, PSG_1C
    8.         dw PSG_1D, PSG_1E, PSG_1F, PSG_20
    9.         dw PSG_21, PSG_22, PSG_23, PSG_24
    10.         dw PSG_25, PSG_26, PSG_27
    11. PSG_1:      db 2, 83h
    12. PSG_2:      db 0, 2, 4, 6, 8, 10h, 83h
    13. PSG_3:      db 2, 1, 0, 0, 1, 2, 2, 2, 2, 2
    14.         db 2, 2, 2, 2, 2, 2, 2, 3, 3, 3
    15.         db 4, 4, 4, 5, 81h
    16. PSG_4:      db 0, 0, 2, 3, 4, 4, 5, 5, 5, 6
    17.         db 6, 81h
    18. PSG_5:      db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    19.         db 81h
    20. PSG_6:      db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    21.         db 8, 7, 7, 6, 81h
    22. PSG_7:      db 1, 0Ch, 3, 0Fh, 2, 7, 3, 0Fh, 80h
    23. PSG_8:      db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    24.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    25. PSG_9:      db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    26.         db 81h
    27. PSG_A:      db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    28.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    29.         db 81h
    30. PSG_B:      db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 0F0h, 80h
    31. PSG_C:      db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    32. PSG_D:      db 0, 81h
    33. PSG_E:      db 2, 83h
    34. PSG_F:      db 0, 2, 4, 6, 8, 10h, 83h
    35. PSG_10:     db 9, 9, 9, 8, 8, 8, 7, 7, 7, 6
    36.         db 6, 6, 5, 5, 5, 4, 4, 4, 3, 3
    37.         db 3, 2, 2, 2, 1, 1, 1, 0, 0, 0
    38.         db 81h
    39. PSG_11:     db 1, 1, 1, 0, 0, 0, 81h
    40. PSG_12:     db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    41.         db 81h
    42. PSG_13:     db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    43.         db 8, 7, 7, 6, 81h
    44. PSG_14:     db 0Ah, 5, 0, 4, 8, 83h
    45. PSG_15:     db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    46.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    47. PSG_16:     db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    48.         db 81h
    49. PSG_17:     db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    50.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    51.         db 81h
    52. PSG_18:     db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h
    53.         db 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h, 30h, 40h
    54.         db 30h, 20h, 10h, 0, 80h
    55. PSG_19:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    56. PSG_1A:     db 0, 2, 4, 6, 8, 16h, 83h
    57. PSG_1B:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    58. PSG_1C:     db 4, 4, 4, 4, 3, 3, 3, 3, 2, 2
    59.         db 2, 2, 1, 1, 1, 1, 83h
    60. PSG_1D:     db 0, 0, 0, 0, 1, 1, 1, 1, 2, 2
    61.         db 2, 2, 3, 3, 3, 3, 4, 4, 4, 4
    62.         db 5, 5, 5, 5, 6, 6, 6, 6, 7, 7
    63.         db 7, 7, 8, 8, 8, 8, 9, 9, 9, 9
    64.         db 0Ah, 0Ah, 0Ah, 0Ah, 81h
    65. PSG_1E:     db 0, 0Ah, 83h
    66. PSG_1F:     db 0, 2, 4, 81h
    67. PSG_20:     db 30h, 20h, 10h, 0, 0, 0, 0, 0, 8, 10h
    68.         db 20h, 30h, 81h
    69. PSG_21:     db 0, 4, 4, 4, 4, 4, 4, 4, 4, 4
    70.         db 4, 6, 6, 6, 8, 8, 0Ah, 83h
    71. PSG_22:     db 0, 2, 3, 4, 6, 7, 81h
    72. PSG_23:     db 2, 1, 0, 0, 0, 2, 4, 7, 81h
    73. PSG_24:     db 0Fh, 1, 5, 83h
    74. PSG_25:     db 8, 6, 2, 3, 4, 5, 6, 7, 8, 9
    75.         db 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh, 10h, 83h
    76. PSG_26:     db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    77.         db 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    78.         db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
    79.         db 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
    80.         db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
    81.         db 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
    82.         db 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
    83.         db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
    84.         db 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
    85.         db 9, 9, 9, 9, 9, 9, 9, 9, 83h
    86. PSG_27:     db 0, 2, 2, 2, 3, 3, 3, 4, 4, 4
    87.         db 5, 5, 83h

    S3D
    Code (ASM):
    1. off_1387:   dw PSG_1, PSG_2, PSG_3, PSG_4
    2.         dw PSG_5, PSG_6, PSG_7, PSG_8
    3.         dw PSG_9, PSG_A, PSG_B, PSG_C
    4.         dw PSG_D, PSG_E, PSG_F, PSG_10
    5.         dw PSG_11, PSG_12, PSG_13, PSG_14
    6.         dw PSG_15, PSG_16, PSG_17, PSG_18
    7.         dw PSG_19, PSG_1A, PSG_1B, PSG_1C
    8.         dw PSG_1D, PSG_1E, PSG_1F, PSG_20
    9.         dw PSG_21, PSG_22, PSG_23, PSG_24
    10.         dw PSG_25, PSG_26, PSG_27, PSG_28
    11. PSG_1:      db 2, 83h
    12. PSG_2:      db 0, 2, 4, 6, 8, 10h, 83h
    13. PSG_3:      db 2, 1, 0, 0, 1, 2, 2, 2, 2, 2
    14.         db 2, 2, 2, 2, 2, 2, 2, 3, 3, 3
    15.         db 4, 4, 4, 5, 81h
    16. PSG_4:      db 0, 0, 2, 3, 4, 4, 5, 5, 5, 6
    17.         db 6, 6, 6, 6, 6, 6, 6, 6, 7, 7
    18.         db 7, 7, 7, 7, 7, 7, 7, 8, 8, 8
    19.         db 8, 8, 8, 8, 8, 81h
    20. PSG_5:      db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    21.         db 81h
    22. PSG_6:      db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    23.         db 8, 7, 7, 6, 81h
    24. PSG_7:      db 1, 0Ch, 3, 0Fh, 2, 7, 3, 0Fh, 80h
    25. PSG_8:      db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    26.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    27. PSG_9:      db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    28.         db 81h
    29. PSG_A:      db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    30.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    31.         db 81h
    32. PSG_B:      db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 0F0h, 80h
    33. PSG_C:      db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    34. PSG_D:      db 0, 81h
    35. PSG_E:      db 2, 83h
    36. PSG_F:      db 0, 2, 4, 6, 8, 10h, 83h
    37. PSG_10:     db 9, 9, 9, 8, 8, 8, 7, 7, 7, 6
    38.         db 6, 6, 5, 5, 5, 4, 4, 4, 3, 3
    39.         db 3, 2, 2, 2, 1, 1, 1, 0, 0, 0
    40.         db 81h
    41. PSG_11:     db 1, 1, 1, 0, 0, 0, 81h
    42. PSG_12:     db 3, 0, 1, 1, 1, 2, 3, 4, 4, 5
    43.         db 81h
    44. PSG_13:     db 0, 0, 1, 1, 2, 3, 4, 5, 5, 6
    45.         db 8, 7, 7, 6, 81h
    46. PSG_14:     db 0Ah, 5, 0, 4, 8, 83h
    47. PSG_15:     db 0, 0, 0, 2, 3, 3, 4, 5, 6, 7
    48.         db 8, 9, 0Ah, 0Bh, 0Eh, 0Fh, 83h
    49. PSG_16:     db 3, 2, 1, 1, 0, 0, 1, 2, 3, 4
    50.         db 81h
    51. PSG_17:     db 1, 0, 0, 0, 0, 1, 1, 1, 2, 2
    52.         db 2, 3, 3, 3, 3, 4, 4, 4, 5, 5
    53.         db 81h
    54. PSG_18:     db 10h, 20h, 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h
    55.         db 30h, 40h, 30h, 20h, 10h, 0, 10h, 20h, 30h, 40h
    56.         db 30h, 20h, 10h, 0, 80h
    57. PSG_19:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    58. PSG_1A:     db 0, 2, 4, 6, 8, 16h, 83h
    59. PSG_1B:     db 0, 0, 1, 1, 3, 3, 4, 5, 83h
    60. PSG_1C:     db 4, 4, 4, 4, 3, 3, 3, 3, 2, 2
    61.         db 2, 2, 1, 1, 1, 1, 83h
    62. PSG_1D:     db 0, 0, 0, 0, 1, 1, 1, 1, 2, 2
    63.         db 2, 2, 3, 3, 3, 3, 4, 4, 4, 4
    64.         db 5, 5, 5, 5, 6, 6, 6, 6, 7, 7
    65.         db 7, 7, 8, 8, 8, 8, 9, 9, 9, 9
    66.         db 0Ah, 0Ah, 0Ah, 0Ah, 81h
    67. PSG_1E:     db 0, 0Ah, 83h
    68. PSG_1F:     db 0, 2, 4, 81h
    69. PSG_20:     db 30h, 20h, 10h, 0, 0, 0, 0, 0, 8, 10h
    70.         db 20h, 30h, 81h
    71. PSG_21:     db 0, 4, 4, 4, 4, 4, 4, 4, 4, 4
    72.         db 4, 6, 6, 6, 8, 8, 0Ah, 83h
    73. PSG_22:     db 0, 2, 3, 4, 6, 7, 81h
    74. PSG_23:     db 2, 1, 0, 0, 0, 2, 4, 7, 81h
    75. PSG_24:     db 0Fh, 1, 5, 83h
    76. PSG_25:     db 8, 6, 2, 3, 4, 5, 6, 7, 8, 9
    77.         db 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh, 10h, 83h
    78. PSG_26:     db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    79.         db 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    80.         db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
    81.         db 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
    82.         db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
    83.         db 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
    84.         db 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
    85.         db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
    86.         db 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
    87.         db 9, 9, 9, 9, 9, 9, 9, 9, 83h
    88. PSG_27:     db 0, 2, 2, 2, 3, 3, 3, 4, 4, 4
    89.         db 5, 5, 83h
    90. PSG_28:     db 7, 1, 5, 6, 6, 3, 3, 2, 2, 1
    91.         db 1, 0, 0, 1, 2, 3, 4, 5, 6, 7
    92.         db 8, 9, 9, 9, 8, 7, 7, 6, 6, 6
    93.         db 6, 7, 8, 9, 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh
    94.         db 0Fh, 83h

    As you can see, the differences include...

    S3->S&K
    1. PSG_26 is a bit shorter

    S&K->S3D
    1. PSG_4 is much longer
    2. PSG_28 has been added
     
  19. Jimmy Hedgehog

    Jimmy Hedgehog

    Member
    1,728
    8
    18
    England - Slough
    Getting the motivation to continue old projects
    Right, been a while since I've asked something but I'm not quite sure how to work this. How would I go about loading the HUD into the Special Stages in Sonic 1? I imagine the background art interferes with space so that would have to be removed I guess, but how would I load a HUD just for time and have it count down rather than forwards? I imagine loading the HUD would be similar to loading it normally, but the main thing I'm unsure about what bits would be unnecessary and the art space, as well as countdown reversal.
     
  20. MarkeyJester

    MarkeyJester

    A D V A N C E Resident Jester
    2,085
    218
    43
    Japan
    At VRAM F200 to F2DF (Tile 790 to 796) there is space for 7 tiles. Directly after it at VRAM F2E0 to F63F (tile 797 to 7B1) is unused "ZONE" icon art which occupies 1B tiles. This gives you a nice stretch of 480 bytes (24 tiles) altogether in one go.

    You also have at VRAM FA80 to FBFF (Tile 7D4 to 7DF) space where the lives HUD would be stored which isn't used in the special stage, this occupies C tiles.

    The in-level HUD takes up 35 tiles (including the spaces for numbers, but not including the lives HUD), you have 30 tiles in total to make do with. However, you say you only need the time counter? You'll have plenty of space, though at this stage you'd probably see it better through with new HUD code, rather than editing the original.