don't click here

Basic Questions & Answers thread

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

  1. 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)
    For what is worth it, Chaotix uses pea a lot.
     
  2. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    Nice, I will look into that and study it.
     
  3. Glaber

    Glaber

    Has Beaten Sonic Genesis for GBA Oldbie
    How do I get at the voice files located in SH_VOICE_E.afs

    I completely missed out on when it was first cracked and I'd like to be able to use the Sonic Heroes Voices in source Film Maker.

    I got lucky I could find an ADX converter for the SADX voice file and hopefully Sa2B used the same format.
     
  4. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,620
    191
    43
    Buffalo, NY, USA
    The Water
    Has anyone figured out the issues with the How-To Add New Monitors page yet?

    Specifically, this bit:


    First I tried to use other values (like 16 or 17, because the broken monitor was moved to this, order-wise). Since all I got was glitchy or incorrect animations, I tried to fix this by just moving all the new monitor mappings and animations after the 'broken' one, and keeping the other value at 9. Strangely, what resulted was a weird Broken/Static animation/sprite, instead of the normal broken animation/sprite.

    Has anyone circumvented/fixed this yet?
     
  5. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    Can you show us your animation code for this please?
     
  6. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,620
    191
    43
    Buffalo, NY, USA
    The Water
    I used this from the guide:
    Code (Text):
    1.  
    2. ; ---------------------------------------------------------------------------
    3. ; Animation script - monitors
    4. ; ---------------------------------------------------------------------------
    5. Ani_Monitor:    dc.w @static-Ani_Monitor, @eggman-Ani_Monitor, @sonic-Ani_Monitor
    6.         dc.w @shoes-Ani_Monitor, @shield-Ani_Monitor, @invincible-Ani_Monitor
    7.         dc.w @rings-Ani_Monitor, @s-Ani_Monitor, @goggles-Ani_Monitor
    8.         dc.w @s2-Ani_Monitor, @s3-Ani_Monitor, @s4-Ani_Monitor
    9.         dc.w @s5-Ani_Monitor, @s6-Ani_Monitor, @s7-Ani_Monitor
    10.         dc.w @s8-Ani_Monitor, @breaking-Ani_Monitor
    11. @static:    dc.b 1, 0, 1, 2, afEnd
    12.         even
    13. @eggman:    dc.b 1, 0, 3, 3, 1, 3, 3, 2, 3, 3, afEnd
    14.         even
    15. @sonic:     dc.b 1, 0, 4, 4, 1, 4, 4, 2, 4, 4, afEnd
    16.         even
    17. @shoes:     dc.b 1, 0, 5, 5, 1, 5, 5, 2, 5, 5, afEnd
    18.         even
    19. @shield:    dc.b 1, 0, 6, 6, 1, 6, 6, 2, 6, 6, afEnd
    20.         even
    21. @invincible:    dc.b 1, 0, 7, 7, 1, 7, 7, 2, 7, 7, afEnd
    22.         even
    23. @rings:     dc.b 1, 0, 8, 8, 1, 8, 8, 2, 8, 8, afEnd
    24.         even
    25. @s:     dc.b 1, 0, 9, 9, 1, 9, 9, 2, 9, 9, afEnd
    26.         even
    27. @goggles:   dc.b 1, 0, $A, $A, 1, $A, $A, 2, $A, $A, afEnd
    28.         even
    29. @s2:        dc.b 1, 0, $B, $B, 1, $B, $B, 2, $B,    $B, afEnd
    30.         even
    31. @s3:        dc.b 1, 0, $C, $C, 1, $C, $C, 2, $C,    $C, afEnd
    32.         even
    33. @s4:        dc.b 1, 0, $D, $D, 1, $D, $D, 2, $D,    $D, afEnd
    34.         even
    35. @s5:        dc.b 1, 0, $E, $E, 1, $E, $E, 2, $E,    $E, afEnd
    36.         even
    37. @s6:        dc.b 1, 0, $F, $F, 1, $F, $F, 2, $F,    $F, afEnd
    38.         even
    39. @s7:        dc.b 1, 0, 10, 10, 1, 10, 10, 2, 10,    10, afEnd
    40.         even
    41. @s8:        dc.b 1, 0, 11, 11, 1, 11, 11, 2, 11,    11, afEnd
    42.         even
    43. @breaking:  dc.b 2, 0, 1, 2, $D, afBack, 1
    44.         even
    What I changed it to was this:

    Code (Text):
    1.  
    2. ; ---------------------------------------------------------------------------
    3. ; Animation script - monitors
    4. ; ---------------------------------------------------------------------------
    5. Ani_Monitor:    dc.w @static-Ani_Monitor, @eggman-Ani_Monitor, @sonic-Ani_Monitor
    6.         dc.w @shoes-Ani_Monitor, @shield-Ani_Monitor, @invincible-Ani_Monitor
    7.         dc.w @rings-Ani_Monitor, @s-Ani_Monitor, @goggles-Ani_Monitor
    8.         dc.w @breaking-Ani_Monitor, @s2-Ani_Monitor, @s3-Ani_Monitor,
    9.         dc.w @s4-Ani_Monitor, @s5-Ani_Monitor, @s6-Ani_Monitor,
    10.         dc.w @s7-Ani_Monitor, @s8-Ani_Monitor, @breaking-Ani_Monitor
    11. @static:    dc.b 1, 0, 1, 2, afEnd
    12.         even
    13. @eggman:    dc.b 1, 0, 3, 3, 1, 3, 3, 2, 3, 3, afEnd
    14.         even
    15. @sonic:     dc.b 1, 0, 4, 4, 1, 4, 4, 2, 4, 4, afEnd
    16.         even
    17. @shoes:     dc.b 1, 0, 5, 5, 1, 5, 5, 2, 5, 5, afEnd
    18.         even
    19. @shield:    dc.b 1, 0, 6, 6, 1, 6, 6, 2, 6, 6, afEnd
    20.         even
    21. @invincible:    dc.b 1, 0, 7, 7, 1, 7, 7, 2, 7, 7, afEnd
    22.         even
    23. @rings:     dc.b 1, 0, 8, 8, 1, 8, 8, 2, 8, 8, afEnd
    24.         even
    25. @s:     dc.b 1, 0, 9, 9, 1, 9, 9, 2, 9, 9, afEnd
    26.         even
    27. @goggles:   dc.b 1, 0, $A, $A, 1, $A, $A, 2, $A, $A, afEnd
    28.         even
    29. @breaking:  dc.b 2, 0, 1, 2, $D, afBack, 1
    30.         even
    31. @s2:        dc.b 1, 0, $B, $B, 1, $B, $B, 2, $B,    $B, afEnd
    32.         even
    33. @s3:        dc.b 1, 0, $C, $C, 1, $C, $C, 2, $C,    $C, afEnd
    34.         even
    35. @s4:        dc.b 1, 0, $D, $D, 1, $D, $D, 2, $D,    $D, afEnd
    36.         even
    37. @s5:        dc.b 1, 0, $E, $E, 1, $E, $E, 2, $E,    $E, afEnd
    38.         even
    39. @s6:        dc.b 1, 0, $F, $F, 1, $F, $F, 2, $F,    $F, afEnd
    40.         even
    41. @s7:        dc.b 1, 0, 10, 10, 1, 10, 10, 2, 10,    10, afEnd
    42.         even
    43. @s8:        dc.b 1, 0, 11, 11, 1, 11, 11, 2, 11,    11, afEnd
    44.         even
    45.  
    So that "move.b #9,obAnim(a0)" doesn't have to change to "move.b #12,obAnim(a0)" (or any other value), as the guide dictates.

    (I also did this to the sprite map files, as well)

    Both resulted in glitchy graphics/animations, (with the latter, being somewhat closer than the former).
     
  7. RetroKoH

    RetroKoH

    Member
    1,661
    18
    18
    Project Sonic 8x16
    Quick question... anyone familiar with Scribus, or editing .sla?

    I'm downloading the program now and going to have a go at trying to hack Sonic Jump. Just wanted to know if anyone is familiar with the program and/or filetype and could be of assistance.

    EDIT: So I've tried opening the sla file and it's saying that either the file is damaged OR is done by a newer version of Scriptus.

    If I could post something online, could a Tech Member or someone take a look at one of these files?
    All of Sonic Jump is done primarily with .xml and .sla.
     
  8. Glaber

    Glaber

    Has Beaten Sonic Genesis for GBA Oldbie
    Is there any documentation on how to use SALVL or any of accompanying programs? I can't even find a readme file (probably because there isn't one)
     
  9. What I would love to find out is, how can I peek inside the Wii version of Sonic the Hedgehog 4: Episode 1? I have the game saved on an SD card. Is there any way to actually do so?
     
  10. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,620
    191
    43
    Buffalo, NY, USA
    The Water
    I have a quick question about/problem importing Monitor Art into SonMapEd:

    For some reason, every time I try to import new art for the 'S' monitor using "Import Sprite Over Active Frame", it imports said art over the first frame (static) instead of the 'S' Monitor Frame that I have selected. Does anyone know why this is happening?

    EDIT: Also, does anyone know where the Mapping file for the Title Screen's "Sonic The Hedgehog" is? I'm trying to edit it in SonMapEd, but I don't know what mapping file to load.
     
  11. vladikcomper

    vladikcomper

    Tech Member
    203
    125
    43
    Sonic Warped
    This is due to the way monitor mappings are done. You see, each frame takes static monitor sprite as a base and places a monitor contents icon over it. This helps to save quite a lot of tiles, otherwise the monitor base art was repeated for every monitor, which isn't good because of VRAM limitations.

    The file you're looking for is mapeni\titlescr.bin. But you can't edit it SonMapEd since it's a Plane, not Sprite Mappings. To edit plane mappings use a tool called PlaneED. If you want to totally change the title screen by importing new art, you might also want to use ImaGenesis tool to import a new image: it will generate tile, mappings and palette files for you to replace the original ones (don't forget to compress mappings into Engima and tiles intro Nemesis).
     
  12. Ryuki

    Ryuki

    Member
    96
    0
    6
    Just three questions.. I'm using MarkeyJester's Projct Two-Eight Disassembly.

    A few days ago I started my first real attempt at adding something 'major' to Sonic 1, for my hack; this feature being Super Sonic. At first it was more of a joke, seeing how far I could get before giving up; but to my astonishment I've managed to port him completely save for two critical things that I'd appreciate some help with.

    The first being his rotating palette and how I should go about including it; though I've not invested much time into learning how this particular routine works in Sonic 2, so I'll probably have another crack at it later today. The closest I got in my last attempt is copying the last two rows of the transformation palette over the first two (basically removing the fade from blue to yellow, hack-ish I know, but at the time I was stumped) and making the game load that palette as soon as the transformation animation ended. Not only is this a cheap and shite way of including this feature, but in some levels such as Spring Yard and Scrap Brain, the rotating palettes from those stages would appear on Sonic instead and would cycle as they would normally, irrelevant of whether you were super or not. I'm assuming this is because of where the Super-Cycle was stored or something along those lines.

    The second question is regarding the 'Super Sonic Star' object. I've not even attempted this yet, mainly because I wouldn't know how to add a new object, load it's art, load it's mappings, or under what Object ID to store it in. (I've read somewhere on the forums that any object past $80 won't be loaded? Not sure how long ago this was, mind.)

    The third question is about DPLCs, I've looked at adding the S3K elemental shields; again, I haven't attempted this, because I'm aware of how differently S1 handles shields and Invincibiilty from S3K. IE S1 Shield and Invincibility both load under the same object ID, both use the same Mappings and Anim files, whereas in S3K the Invincibility stars are stored under a separate object ID from the shields, and that each shield loads their own Art, Mappings, Anim, and (unlike S1) DPLC files. My question is, I've heard somebody talk about converting the S1 shield to make use of DPLC files, how would I go about implementing this feature, and what advantages does this have over the original method?

    I've stopped myself from posting any questions on the forum so far, as I'm much happier figuring something out for myself, but for these particular issues I wouldn't even know where to being even learning about how to overcome them.
    Apologies for the wall of text, but I didn't know how else to portray the fact that I've tried my best not to ask unless I'm completely and utterly stumped.

    Thanks in advance for any answers, if you want me to clear something up please let me know. :eng101:
     
  13. TehKaker

    TehKaker

    Member
    12
    0
    1
    Hello everyone.

    I wanna know, how I could extend the map updating area, in Sonic 1 two height? I want the screen to be at 320x240 in PAL mode, but the map updating is noticeable at the screen's bottom, and I can't understand the drawing code.
    Don't worry about the HScroll size's transfer, it's fixed.

    Thanks.
     
  14. MarkeyJester

    MarkeyJester

    Time to Grow Up. Resident Jester
    2,127
    253
    63
    Japan
    At "sub_6B04", you will find this:

    Code (Text):
    1.         moveq   #$F,d6
    This is the number of blocks to write vertically, you've extended the screen resolution to another 10 (hex) pixels, so increasing that value to 10 will sort the FG out, as for the BG, you'll find in routines "loc_698E" and "loc_69BE", the following codes below:

    Code (Text):
    1.         cmpi.w  #$F,d6
    2.         bcs.s   loc_69BA
    3.         moveq   #$F,d6
    Code (Text):
    1.         cmpi.w  #$F,d6
    2.         bcs.s   loc_69EE
    3.         moveq   #$F,d6
    Again, same principle, F to 10, Green Hill Zone uses a special background routine that does not draw horizontal lines above or below for the BG (considering it doesn't need to) at "sub_69F4", however, due to the design of the BG, it looks as though you will not need to tamper with anything in that routine. Finally at "LoadTilesFromStart2":

    Code (Text):
    1.         moveq   #$F,d6
    Again, F to 10, this is for drawing the entire screen as soon as the level starts.

    Well done sir, I'm please to see someone actually putting effort into "learning" what it is they want to do, and in that case, I'll try not to give the answers straight up and simply point you in the right direction...

    I don't know much about Sonic 2, however, there are similarities you might be interested in; Sonic 1:

    Code (Text):
    1. PalCycle_Load:              ; XREF: Demo; Level_MainLoop; End_MainLoop
    2.         moveq   #0,d2
    3.         moveq   #0,d0
    4.         move.b  ($FFFFFE10).w,d0 ; get level number
    5.         add.w   d0,d0       ; multiply by 2
    6.         move.w  PalCycle(pc,d0.w),d0 ; load animated pallets offset index into d0
    7.         jmp PalCycle(pc,d0.w) ; jump to PalCycle + offset index
    Sonic 2:

    Code (Text):
    1. PalCycle_Load:
    2.     bsr.w   PalCycle_SuperSonic
    3.     moveq   #0,d2
    4.     moveq   #0,d0
    5.     move.b  (Current_Zone).w,d0 ; use level number as index into palette cycles
    6.     add.w   d0,d0           ; (multiply by element size = 2 bytes)
    7.     move.w  PalCycle(pc,d0.w),d0    ; load animated palettes offset index into d0
    8.     jmp PalCycle(pc,d0.w)   ; jump to PalCycle + offset index
    If I'm not mistaken the routine "PalCycle_SuperSonic" handles everything Super Sonic palette related including the transformation, and it all seems to be controlled by the RAM address "$FFFFF65F" or as Sonic 2 would put it "Super_Sonic_palette", additionally to note is the colour data themselves are stored in binary files, and need including:

    Code (Text):
    1. ; ===========================================================================
    2. ;----------------------------------------------------------------------------
    3. ;Palette for transformation to Super Sonic
    4. ;----------------------------------------------------------------------------
    5. Pal_2246:   BINCLUDE    "art/palettes/Super Sonic transformation.bin"
    6. ;----------------------------------------------------------------------------
    7. ;Palette for transformation to Super Sonic while underwater in CPZ
    8. ;----------------------------------------------------------------------------
    9. Pal_22C6:   BINCLUDE    "art/palettes/CPZWater SS transformation.bin"
    10. ;----------------------------------------------------------------------------
    11. ;Palette for transformation to Super Sonic while underwater in ARZ
    12. ;----------------------------------------------------------------------------
    13. Pal_2346:   BINCLUDE    "art/palettes/ARZWater SS transformation.bin"
    I generally go against the old copy/paste scenario and I would recommend giving it a go yourself by tampering about with the palette, a major series of trail and error are recommended.

    You might find this useful Object Tutorial, as for ID limits, Sonic 1's object limit is indeed 01 - 7F, this is only for object position data though as the most significant bit is used for the "remember/respawn sprite" flag. For general objects that are NOT created by the object position (I.e. you load them manually in the code yourself, like the star object), then you can use object ID's from 80 to FF as well as 01 to 7F:

    "_inc\Object pointers.asm"

    In that source file, you will find a list of pointers all pointing up to object 8C, you can simply add more if you really wanted to, for example:

    Code (Text):
    1. ...
    2.     dc.l Obj89, Obj8A, Obj8B, Obj8C
    3.     dc.l Obj8D
    Object 8D, then in "sonic1.asm" somewhere, you would start putting in your object:

    Code (Text):
    1. ; ===========================================================================
    2. ; ---------------------------------------------------------------------------
    3. ; Object 8D - My new object
    4. ; ---------------------------------------------------------------------------
    5.  
    6. Obj8D:
    7.         bra.w   DeleteObject                ; delete the object
    8.  
    9. ; ===========================================================================
    Of course, there are still object ID slots from 01 to 7F still freely available, like Object 10 for example, I recommend using them slots for objects that you plan to put in the level itself as part of the object position list.

    The only DPLC that Sonic 1 performs is Sonic himself, if you are looking to add DPLCs for the shield art, then you'll need to look into porting the DPLC routine itself, either that, or write your own routine to do something similar, or find yourself some free VRAM space to fit the entire shield's art into, the latter is probably the least recommended.

    Good luck with your Super Sonic port.
     
  15. Elektro-Omega

    Elektro-Omega

    Mushroom Hill'in Member
    400
    0
    0
    UK
    -
    I'm getting back into Sonic 1 hacking (yay) and I have a few questions.

    1) How would I go about changing the pallet if an object is touched?

    2) If I decided I wanted to permanently get rid of Motobug, how would I disable it from VRAM loading and how much space would this save me / what could be done with the extra space (a simple example would suffice, I know the possibilities here are pretty much endless).

    Edit: 3) How would I go about freezing the timer at my own will, say, when the 'A' button is pressed?
     
  16. vladikcomper

    vladikcomper

    Tech Member
    203
    125
    43
    Sonic Warped
    You can change the palette line by changing object's art pointer, referenced to as 2(a0) from object's code. Besides number of the start tile (in VRAM) for object sprites, it also has bits to set palette line and priority (to put object's sprite in top of all, used by HUD object and title cards).

    To set the palette line bits and actually change sprites' palette, add the following values to 2(a0):
    $2000 - for the 2nd palette line
    $4000 - for the 3rd palette line
    $6000 - for the 4th palette line

    As for checking collision with Sonic, game's engine has a handy feature to help you with this. If you set touch response byte $20(a0) to the values between $40 and $5F, the game engine will automatically increment object's routine counter $24(a0) when Sonic collides with object's hitbox. For instance, ring object uses this to check if Sonic touched it. Hitbox size depends on what value between $40-$5F you choose. Ring object uses the value of $47 (if I remember right), which gives 8x8 pixels hitbox. The hitbox sizes are loaded from a special table, which you can find in TouchResponse subroutine. $47, for example, will load 7th entry from the table, so will $07 (but the game will do a different action on collision then).

    So, you can arrange your objects routines like this:

    Code (Text):
    1.   dc.w  ObjXX_Normal-ObjXX_Index
    2.   dc.w  ObjXX_Touched-ObjXX_Index
    If you set $20(a0) to $40-$5F in ObjXX_Normal, the game will switch to ObjXX_Touched for you, when Sonic collides with the object. Don't forget to reset $20(a0) back to $00 in ObjXX_Touched, otherwise, the game will switch routines every frame Sonic is in the object, eventually forcing non-existing routine to run, crashing the game.

    Open _inc\Pattern Load Cues.asm, find PLC_GHZ, take out these lines:

    Code (Text):
    1.         dc.l Nem_Motobug    ; motobug enemy
    2.         dc.w $9E00
    Then, as you reduced PLC list, find:

    Code (Text):
    1. PLC_GHZ:    dc.w $A
    And replace $A with 9.

    This will save as much space as motobug tiles were taking. You can count tiles by loading its art in SonMapEd for example.

    What could be done? You can use free space to store your own tiles, make your own sprites of them etc.
     
  17. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,620
    191
    43
    Buffalo, NY, USA
    The Water
    Thanks for the helpful response. Ironically, I eventually figured this out, and thus also finally figured out how to import monitor art correctly, a couple of days ago (I don't have home internet access, so I am limited in that regard, especially over the holidays). For those who had the same problem/confusion as me, what you need to do first is move the sprite piece of the specific monitor to a new, empty frame, and then export that frame. Second, you then need to import your changes into the new frame ("Import Sprite Over Active Frame"). Third, move the piece back to the previous sprite, and bring it to the front of the frame. Delete the now empty frame and save the compressed graphics file.

    Thanks again! :)
     
  18. Ryuki

    Ryuki

    Member
    96
    0
    6
    Super Sonic is now fully implemented, can't thank you enough for the nudge in the right direction, MarkeyJester. :)
    Now for that Special Stage message that says "Sonic can now become Super Sonic", then that's it. :v:
     
  19. alexman

    alexman

    Doing work once again Member
    3
    0
    0
    Music. Lots of it.
    I have another question; I am using MIDI2SMPS to convert vgmusic midis into my hack. So far, it is working pretty well. But I have one problem. I'm having trouble getting the songs to loop.

    Now I'm sure that I might be missing something obvious here, and I apologize if so. But can someone at least get me on the right track? I would really appreciate it.

    Thanks for the help, guys! I really appreciate it! [​IMG]

    EDIT: Also, a completely different matter, but still associated with my hack...
    I am currently editing art in my hack, and I want to do green hill zone. Something is up, because only the objects appear. After looking at the "artnem" folder in the Hivebrain 2005 disassembly, I realized that I must combine 8x8ghz1.bin with 8x8ghz2.bin. I do not know how to do this. I assume that it has something to do with a batch file, but I still need assistance.
     
  20. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    I'm sure you have to insert midi controller event #111 (0x6F) on all channels in the midi itself. Then when using MID2SMPS, it should make it loop automatically. I'm no music expert though. ValleyBell will be able to answer your question more precisely though as it's his program. I'll make sure he spots this.