Basic Questions and Answers Thread

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

  1. Flamewing

    Flamewing Elite Hacker Member

    Joined:
    Aug 28, 2011
    Messages:
    37
    Location:
    France
    Now that I looked at that guide again, I remember why I forgot about it — the way it bends over backwards to get the driver working in S1 with a crap assembler (ams68k) instead of doing it the right way and using a slightly less crap assembler (AS) that supports z80 as well as 68k. This works great if yiu never intend to change, improve or upgrade the driver, but itmsucks in all other cases.


    To follow that guide with my driver, you would have to dump the assembled version, find the pointer tables for music and data in the binary and modify them like is done in the guide, then include the rest as bytes instead of z80 assembly. Were I to do it, I would prefer to convert the S1 disassembly to use AS and just plop the driver directly similar to the link I posted.
     
  2. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    I barely understood a word you just said. :p So how do I do this AS conversion? (I'm wasting all my posts here with stupid questions.)

    Also, how are you a pro user with 24 posts still ranked as a newbie?
     
  3. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    You can enter a custom rank in your UCP. If you don't, you'll get one of the default ranks, according to your postcount.
     
  4. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Here's a question, but not a problem. Is there any possible way to replace the Title Card with a seperate screen?

    I've been trying to edit it to work similarly to the Sonic 2 MS games with the image and the zone name, and then the level.

    Every time I make the slightest edit to the code, though, the game crashes upon selecting a level.

    So, once again, is this possible?
     
  5. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    Okay, this one's just weird. Sometimes monitors in my custom levels restore themselves after being opened and I walk far enough away from then and return, and some smash automatically after I walk a certain distance from them. I'm just adding them in with SonED2, so why is this happening?
     
  6. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Yes.

    Remember, your main limit is the hardware.

    It might have something to do with the "remember sprite state" flag not being set, but don't quote me on that, it's been a while since I've fiddled with Sonic games.
     
    Last edited by a moderator: Jan 26, 2014
  7. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    424
    Location:
    Western New York, USA
    It might have something to do with the "remember sprite state" flag not being set, but don't quote me on that, it's been a while since I've fiddled with Sonic games.

    Yes, I can confirm that this is likely the case here. The "Remember Sprite State" flag basically tells the game to remember that the object is destroyed (or modified in some way) once it leaves the screen. If not set, the object will reload as normal once you walk far away enough from it. Things like fall/stand platforms usually have this off (which is why they eventually re-spawn when you walk away from them). On the other hand, all monitors need to have this flag "on" because of the way they are organized. When you break a monitor, the object switches to the 'broken' frame, and is not simply deleted (like most enemies and certain objects).When one monitor's flag is not set, it screws with the animations of the other ones around it because of this. Therefore, the game needs to remember state of every monitor so that it knows which ones are broken, and which ones are not. Thankfully, this flag can be easily toggled on/off in SonED2 (by hovering over the monitor and pressing "0") and SonLVL (by simply changing the value in the properties toolbar after selecting the object).

    If by any chance they are all set to "true/on", did you mess with their animations/mappings at all? I had issues with this when adding/making new monitors in my own project.
     
  8. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    I edited the monitor's design to look like the Sonic 3 ones, made the Eggman monitor functional, and replaced the S monitor with one that takes you to Final Zone (weird story). I didn't switch the flags in SonED2 in any way, unless it was by accident. I can't check and see at the moment whether they are on or off, but I suspect my monitor additions may have something to do with it.
     
  9. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Well been a while since I have asked for help so, hope you can help me :p

    Anyway, I have finally started coding cutscenes, Ill explain what this one is supposed to do than explain my problem



    Obj_Cutscenes_Scene_3_routine_00:
    move.w #$720,(camera_max_Y_pos).w ; Clear camera_max_Y
    move.w #$3586,(camera_max_X_pos).w ; Clear camera_max_X
    st (Control_Locked).w
    clr.w (Tails_control_counter).w
    clr.b (control_locked_tails).w
    move.w #$800,(Ctrl_1_Logical).w
    tst.w (maincharacter+jumping).w ; is Sonic jumping?
    blt.s +
    btst #5,(maincharacter+status).w; is Sonic pushing against something?
    beq.s +
    move.w #$870,(Ctrl_1_Logical).w
    +
    cmpi.w #$3633,(MainCharacter+x_pos).w
    bls.s +
    clr.b (ctrl_1_logical).w
    +
    cmpi.w #$3623,(MainCharacter+x_pos).w
    bls.s Scene3_return
    cmpi.w #$36ED,(MainCharacter+x_pos).w
    bgt.s Scene3_return
    cmpi.w #$780,(MainCharacter+y_pos).w
    bls.s Scene3_return
    move.w #$B00,(Current_ZoneAndAct).w
    clr.b (Last_star_pole_hit).w
    clr.b (Last_star_pole_hit_2P).w
    move.w #1,(Level_Inactive_flag).w
    Scene3_return:
    rts 
    First things first, the main character positions are checks to see if the cutscene should end and than go to the next zone when sonic is at that exact location. If he is not at that exact location, the controls lock and the first (ctrl_1_logical) is to move him forward. Next, since the egg prison is going to be in the way, I loaded a check for sonic to jump when pushing.

                  Ok finally to my issue, since Ctrl_Held is disabled, while the controls are locked, (Sonic Retro), it will be on press the whole time, so I added that bset to set jumping so sonic can gain his maximum height to act like the control is on hold, problem is it did not do that, tried move,b and that didn't work either.

           Im doing something wrong, but I have no clue what it is, thought someone could help. It would be greatly appreciated. :)

    Edit: Cleaned up code.
     
    Last edited by a moderator: Jan 28, 2014
  10. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    Now that I actually got a chance to look into it, the flags are all set to "on". Additionally, it seems as if badniks are respawning too, which doesn't make sense because they are actually deleted when they are destroyed. I'm wondering if this has to do with the fact that I made Sonic and Anti-Sonic load separate object layouts, and there's a bug with it or something that makes it re-load objects.
     
  11. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    Can anyone tell me how or where to switch the pallets for the Special stage in Sonic 1 for when my other character (Tails) is selected? I have the pallets already setup for most of the other situations (like his normal pallet is different than sonic as well as is LZ and SBZ3 underwater pallet) and his life icons + signpost are in, but I'm not sure what to do for the special stage. He's just in there as a ball (no tails) with Sonic's Pallet (which doesn't look good).

    I might leave that and the continue screen items alone since those seem a little harder to put together just for a character switch and I want to get into level design soon, but if anyone has any advice, please let me know.
     
    Last edited by a moderator: Jan 29, 2014
  12. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    The special stage comes with four palette lines worth of colours:

    moveq #$A,d0
    bsr.w PalLoad1 ; load special stage pallet
    Code:
    	dc.l Pal_Special
    	dc.w $FB00
    	dc.w $1F
    Which means there is another Sonic palette inside the special stage palette itself. If however you wish to use the character's level palettes, then the most simple solution would be to place:
    Code:
    		moveq	#$3,d0
    		bsr.w	PalLoad1	; load Sonic's palette
    Under the the special stage palette loading, this will overwrite Sonic's colours from the special stage, with Sonic's colours from the level.
    If you wish for a more professional fix, then do the above, but additionally change:

    dc.l Pal_Special
    dc.w $FB00
    dc.w $1FInto:
    Code:
    	dc.l Pal_Special
    	dc.w $FB20
    	dc.w $17
    And then remove the first line of colours from the special stage palette file (marked red)
    04 00 00 00 08 22 0A 44 0C 66 0E 88 0E EE 0A AA 08 88 04 44 08 AE 04 6A 00 0E 00 08 00 04 00 EE

    04 00 00 00 00 24 00 68 00 AC 02 EE 0E EE 0A AA 08 88 04 44 0A E4 06 A2 00 EE 00 88 00 44 00 00

    04 00 00 00 02 04 06 28 0A 4C 0C 6E 0E CE 08 00 0C 42 0E 86 0E CA 0E EC 00 00 0E E0 0A A0 04 40

    04 00 00 00 00 60 00 A0 00 C6 00 EA 0A EC 0E EA 0E E0 0A A0 08 80 06 60 04 40 0E E0 0A A0 04 40

    Those are Sonic's colours.
     
  13. BombchuLink

    BombchuLink Newcomer Trialist

    Joined:
    Jan 30, 2014
    Messages:
    5
    Location:
    The Ocean Floor
    OK, so I've started hacking Sonic ROMs and after doing some researching and fiddling around with multiple dissembles I read the thread of useful links and found this.

    So I'm wanting to Hack Sonic 1 because it looks more versatile, but Sonic 2 looks more documented/user friendly.

    I don't really have a preference on which one I do, but I don't want to be 3 years down the line biting myself in the rear over a bad decision I made now.
     
  14. LazloPsylus

    LazloPsylus The Railgun Member

    Joined:
    Nov 25, 2009
    Messages:
    Location:
    Academy City
    It's honestly a personal choice, as Sonic 1 and Sonic 2 are very well-documented. Many would consider Sonic 1 to be the better choice due to its ease of adaptability, but it honestly comes down to which game you think has the best base for you to build your hack off of. What you may kick yourself in the ass about in the future is the choice of disassembly, though, is the choice of which disassembly to use for the game you decide to use. The subject of whether the SVN (now Mercurial) disassemblies are an improvement or a clutch in comparison to their older counterparts is a very ripe controversy, with reasonable arguments for each along with the downsides associated with them. I would instead recommend grabbing both, playing with both a bit, determining which disassembly is more comfortable for you to use and learn with, and stick with it. After that point, you may have the occasional want to have the other when you run into guides and users that support one but not the other, but there ultimately shouldn't be regrets, as you picked what you felt would be best for you and not for others.

    This seems to be a complex subject, and to a degree it is, but stick with it. There's plenty to learn and the ultimate limits to what you can do with your hack are the hardware and you. If you're looking for personal recommendations for where to start, I would personally go with the Sonic 1 Hivebrain disassembly, as it is what I personally found to be the easiest to learn and the most versatile. Your milage may vary. Pick them up, play with them, decide what's more comfortable for you, and go with it. Good luck.
     
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Actually, the current disassemblies are no longer hosted on SVN or Mercurial, they've moved to GitHub.
     
  16. BombchuLink

    BombchuLink Newcomer Trialist

    Joined:
    Jan 30, 2014
    Messages:
    5
    Location:
    The Ocean Floor
    For some reason I'm having issues with my custom loop chunks in Sonic 1.

    My loop chunk is chunk 41 and 42.

    [​IMG]

    And this is how it look in the level editor

    [​IMG]

    And yes, I did enable the (loop) thing to the active chunk.
     
    Last edited by a moderator: Feb 7, 2014
  17. fdswerty

    fdswerty Well-Known Member Member

    Joined:
    Apr 10, 2013
    Messages:
    138
    If I'm not wrong, I'm sure you'll have to add the chunk number $C1 ($41 + $80) to the file "loopnums.bin" in the misc/ folder (Hivebrain disassembly) to get it working. I may be wrong, though, as I've not worked with this for some long time.

    Btw, I would recommend you to use the 128x128 disassembly, as it's easier to work with loops because path-swappers.
     
  18. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Like everything, it's a matter of personal preference. Personally, I think path swappers are a pain in the ass, and I'd actually love to see a 256×256 version of Sonic 2.
     
  19. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    In S1's lvl_size.bin, what do the 12 bytes for each act represent? I did a search and see that "24 BF" in the first 12 bytes (GHZ1) is supposed to be the right x boundary (?) for example, so I could change it to affect the horizontal length of the level. I've seen the effect of changing that, but I don't know what the bytes surrounding it are supposed to represent.

    Also, I don't quite understand "lvl_ord.bin" either. It's a really short file, but I don't get the pattern. Like why are the first 6 bytes "00 01 00 02 02 00" instead of "00 01 00 02 00 03" if it's ZZAA (zone number then act number) format?
     
  20. D.A. Garden

    D.A. Garden Sonic CD's Sound Test Member

    Joined:
    Aug 6, 2009
    Messages:
    582
    Location:
    England
    Not too sure about the level boundary file but I do know about the level order file:

    It's still ZZAA, it's just that 0 (zero) is a number in hex. Added to the fact that lvl_ord.bin starts counting from Green Hill Zone Act 2 (it doesn't need to count Green Hill Zone Act 1 as that's decided by the title screen when you press start), then it makes more sense.

    You've got "00 01 (Green Hill Zone, Act 2), 00 02 (Green Hill Zone, Act 3), 02 00 (Marble Zone, Act 1)".

    The original Zone order is also used from the level select, so Zone's are numbered 00 (GHZ), 01 (LZ), 02 (MZ), 03 (SLZ), 04 (SYZ) and 05 (SBZ).
     
    Last edited by a moderator: Feb 13, 2014