Basic Questions and Answers Thread

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

  1. Kaz

    Kaz Well-Known Member Member

    Joined:
    Nov 2, 2013
    Messages:
    66
    @maskValue:
    add.w d0,d0
    and.w loc_1C8A(pc,d0.w),d1
    add.w d3,d1
    move.b (a0)+,d5
    lsl.w #8,d5
    move.b (a0)+,d5
    rts
    ; ---------------------------------------------------------------------------

    @enoughBits:
    beq.s @justEnough
    lsr.w d7,d1
    move.w a5,d0
    add.w d0,d0
    and.w loc_1C8A(pc,d0.w),d1
    add.w d3,d1
    move.w a5,d0
    bra.s EniDecomp_FetchByte
    ; ---------------------------------------------------------------------------

    @justEnough:
    moveq #$10,d6

    loc_1C8A:
    bra.s @maskValue

    This part of the Enigma decompressing code outputs a 'symbol not defined' error when assembled using local names in ASM68k. Can anybody help?

    (2612) : Error : Symbol '@maskvalue' not defined
     
  2. Clownacy

    Clownacy Negative Clownancy Staff

    Joined:
    Aug 15, 2014
    Messages:
    884
    Label 'loc_1C8A' lies between the reference to local label @maskValue, and the definition of @maskValue. You must either make loc_1C8A a local label also, or make @maskValue a normal label. this can be done by adding or removing the '@', respectively.
     
  3. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    How do I make seperate Super music in S3K? Let's say S3 invincibility music for normal invincibility and SK invincibility for Super music? I'm sure it's been answered before...
     
  4. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    868
    You locate every piece of code that plays the invincibility music, and have it check the super sonic flag and play a different song when it's not 0.
     
  5. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    I have this in front of the init code (yes, underneath the label so that it runs) of the HPZ emerald object:

    Obj12_CheckActivation:
        move.w    subtype(a0),d1      ;mostly copy-paste from starpost, this line moves suptype to d1
        andi.w    #$7F,d1                   ;round out d1, I think?
        move.w    (emerald_count).w,d2   ;move emerald count to d2 (incompatible with hardware, this is temporary)
        andi.w    #$7F,d2                   ;round out d2, I think?
        cmp.w    d2,d1                       ;check if d2 is bigger then d1
        bcc.w    HPZemeraldrts    ;checks Subtype, if less then d1, branch

    ...

    HPZemeraldrts:

        rts

    It's supposed to check if the emerald count is bigger then the subtype, and if so, not spawn. Instead, this addition causes every itereation of the object to not spawn at all, no matter how many emeralds the player has. This is temporary behaviour, but I want to find out what I'm doing wrong so I can fix in later code (This exact same issue keeps poping up, no matter what I do).
     
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    868
    The subtype is a byte, not a word.
     
  7. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
  8. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    Did you move all the way to the end of the level? When you get there, do you get screen locked at the end, or can you run backwards through the level again?
     
  9. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
  10. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    Why not flip flop Act 3 and Act 4?  So that you don't have to do much editing in terms of the boss.

    Speaking of that, I have a question on that matter.

    So, in my hack, Scrap Brain Zone is meant to represent the Death Egg.  After Spring Yard Zone (Eggmanland Zone), the player is taken to "Death Egg Act 2", which is the interior of the Death Egg.  When he reaches the end, Sonic meets Eggman as he would in the normal game, but instead of being sent to SBZ3/LZ4, Sonic is sent to "Death Egg Act 1" to be the exterior of the Death Egg, in a similar fashion to S3&K, where, once completed, he has a showdown with Eggman in the Death Egg Core Zone (FZ).  Therefore, SBZ Act 2 is now Death Egg Zone Act 1, and SBZ1 is now Death Egg Zone Act 2.  The problem is that I want the Title Cards to reflect this instead of it showing Act 2 first and then Act 1, but I do not know where I would go about editing the data that chooses the number of the act that is appearing.
     
    Last edited by a moderator: Nov 5, 2014
  11. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    229
    Well, just take a look to the "Zone Title Cards" object... the object 34... there is all you need.
     
  12. sparkpin

    sparkpin Newcomer Trialist

    Joined:
    Oct 23, 2011
    Messages:
    2
    Location:
    Carnival Night Zone Act 2
    Hello, this is my first post, but that's irrelevant.

    I have some experience in Sonic ROM hacking, and so I decided to port Knuckles into Sonic 2 using this guide.

    [​IMG]

    Looks good, here we go!

    [​IMG]

    Umm.

    [​IMG]

    What's wrong right with this picture?

    I have followed the guide to the letter twice. The only other things I have done are add one new act in a "new" zone (which is really just MCZ3, like how MZ3 is handled), added a new 2P monitor mode (Robotnik) and added Flamewing's driver.
     
  13. Ralakimia

    Ralakimia Pour your misery down on me Member

    Joined:
    Aug 26, 2013
    Messages:
    987
    The guide uses the old HG disassembly and things have been changed in the new GitHub (pretty much the same disassembly, but with changes), especially in the PLC portion of the disassembly. Compare your new PLC entries with the ones already set in the disassembly and you'll probably get a solution.

    EDIT: Here's the solution:

    Go to PlrList_KnucklesLife and you should see something like this:


    plreq tiles_to_bytes(ArtTile_ArtNem_life_counter), ArtNem_KTELife

    Go down until you've reach the end of the Knuckles PLCs and delete each "tiles_to_bytes" and the corresponding parenthesis for each of the Knuckles PLCs. The first entry should now look like this:


    plreq ArtTile_ArtNem_life_counter, ArtNem_KTELife
    The reason why you need to do this is because in the new GitHub disassembly, they changed the plreq macro so you don't need to type in "tiles_to_bytes" for each entry.
     
    Last edited by a moderator: Nov 7, 2014
  14. sparkpin

    sparkpin Newcomer Trialist

    Joined:
    Oct 23, 2011
    Messages:
    2
    Location:
    Carnival Night Zone Act 2
    Thanks dude, worked like magic.
     
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    868
    It's not entirely accurate to say it's written for an old version, especially since I mention GitHub right at the top. I initially wrote it before the move, and that particular commit, but I've been updating it since then, I just missed that one part somehow.

    I've fixed the guide now.
     
  16. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
    Im looking to change obj52 into a badnik that doesnt move or animate just stays stationary, I tried making my own failed code but it didnt seem to work and usually the object loads invisible even though I have changed the art.
     
  17. Ralakimia

    Ralakimia Pour your misery down on me Member

    Joined:
    Aug 26, 2013
    Messages:
    987
    Did you add "jsr SpeedToPos" in the code?
     
  18. Pacca

    Pacca Why succeed when you can profit off of failure? Member

    Joined:
    Jul 5, 2014
    Messages:
    1,149
    Location:
    Triton (Moon)
    So I've been working on making some code again, and ran into some odd issues. I'm trying to make it so that if you get the chaos emerald at the end of Sonic 2s' special stages, a different ram address is set depending on previously defined variable. So far, it functions perfectly for the first value (which is 0), but for every other value, the game freezes, a behavior I simply can't explain. Here's my noobish pile of code: Pastebin
     
  19. TheInvisibleSun

    TheInvisibleSun Visible Member

    Joined:
    Jul 2, 2013
    Messages:
    299
    Location:
    Buffalo, NY, USA
    Did you set up your Dynamic Level Events for the Act 4's? If so are you loading the boss into Act 4 in Green Hill's DLE's? Check out  _inc/DynamicLevelEvents.asm
     
    Last edited by a moderator: Nov 8, 2014
  20. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    I haven't touched my hack in while (made a few tweaks here and there and added a little more to the boss), but I had a few questions:

    -I want to port Tails' flight sound effect from Sonic 3 to my hack (Sonic 1). I added it in as-is and got an error. Do I have to do anything special to the .bin file like with porting music for it to work? Also how do I get the sound to loop and stop when he lands from flight? I think the only sound I recall having some sort of similar loop effect in Sonic 1 is the electricity sound effect from the final boss, but I don't know what triggers it to do that and to stop.

    -I've been noticing tool assisted runs of players flying over some parts of my stages despite me trying to place chunks strategically to prevent that. Placing more chunks would kind of ruin the layout, so is there a good way to set a boundary at the top of the level so the player can't pass over large portions of the stage like that?

    Placing Invisible solid blocks may be a way, but I was wondering if there's a cleaner way?

    -Lastly, I was wondering if anyone could personally help me with creating and porting BG art and changing the title screen art. The only BG I successfully got in was swapping the BG for SLZ with something from Sonic 2 and changing the pallette on that. But I had major issues with trying to use a different image in other zones (messed up the entire foreground collision) and I'm not that artistically inclined to begin with (I would just like it to look a little different).
     
    Last edited by a moderator: Nov 11, 2014