Basic Questions and Answers Thread

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

  1. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    Hi guys!
    I got a question regarding Sonic 2 SMS and swapping around the zone order.
    I attempted to get in contact with Ravenfreak about it, but I haven't got a response yet, so I decided to ask the other 8-bit ROM Hackers here.
    I swapped around GHZ with UGZ.
    Everything but the tileset mapping, zone/act screen palette and music is correct.
    I don't understand how the mapping isn't there, but the tileset is, considering both are defined in the level_headers.asm file correctly.
    Is there something in s2.asm that I missed in regards to mapping?
    The music is something I can't figure out either, what do I need to do to fix that?

    Problem solved.
     
    Last edited: Jul 16, 2018
  2. Prilix

    Prilix A normal romhacker In Limbo

    Joined:
    Sep 19, 2017
    Messages:
    20
    Location:
    Argentina
    ooff... am very Rookie, will be very difficult.
     
    Last edited: Jul 16, 2018
  3. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    Hi all
    I'm in need of assistance of implementing Super Sonic in Sonic 1
    I initially wanted to completely implement him with his own sprites and what-not, but I realized I was jumping the gun a tad bit and decided JUST to implement Super Sonic minus his sprites (as I have no clue on how to add custom sprites to Sonic 1)
    I've tried the tutorial on Sonic Retro, but I just can't get it to work. If it helps, I'm using the Hivebrain 2005 disassembly.
    Any advice/fixes would be greatly appreciated!
     
  4. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    You know, "I can't get it to work" isn't the most helpful description ever, for all we know you could be seeing a black screen because you forgot to turn on your monitor.
     
  5. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    What I mean by "I can't get it to work" is that I get this error everytime
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24442) : Error : Symbol 'y_vel' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24471) : Error : Symbol 'super_sonic_flag' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24475) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24478) : Error : Symbol 'super_sonic_palette' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24479) : Error : Symbol 'palette_frame_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24480) : Error : Symbol 'super_sonic_flag' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24481) : Error : Symbol 'obj_control' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24482) : Error : Symbol 'anim' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24484) : Error : Symbol 'sonic_top_speed' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24485) : Error : Symbol 'sonic_acceleration' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24486) : Error : Symbol 'sonic_deceleration' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24487) : Error : Symbol 'invincibility_time' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24488) : Error : Symbol 'status_secondary' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24508) : Error : Symbol 'super_sonic_flag' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24510) : Error : Symbol 'update_hud_timer' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24512) : Error : Symbol 'super_sonic_frame_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24514) : Error : Symbol 'super_sonic_frame_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24515) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24517) : Error : Symbol 'update_hud_rings' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24518) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24520) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24522) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24525) : Error : Symbol 'update_hud_rings' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24527) : Error : Symbol 'ring_count' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24531) : Error : Symbol 'super_sonic_palette' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24533) : Error : Symbol 'super_sonic_flag' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24534) : Error : Symbol 'next_anim' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24535) : Error : Symbol 'invincibility_time' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24536) : Error : Symbol 'sonic_top_speed' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24537) : Error : Symbol 'sonic_acceleration' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24538) : Error : Symbol 'sonic_deceleration' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24539) : Error : Symbol 'status' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24541) : Error : Symbol 'sonic_top_speed' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24542) : Error : Symbol 'sonic_acceleration' not defined
    C:\USERS\THOMAS\DESKTOP\FUSION364\S1DISASM-MASTER - COPY\SONIC1.ASM(24543) : Error : Symbol 'sonic_deceleration' not defined
    Note that I'm just trying to add Super Sonic and NOT his animations
    I'm also using this tutorial as It's the only one I can find
    http://info.sonicretro.org/SCHG_How-to:Add_Super_Sonic_to_Sonic_1
     
  6. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    You failed to transfer the constants properly. That should've been obvious by the many "<name> not defined" errors.
     
  7. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    It looks like there are multiple uses of something that doesn't exist - an undefined. Make sure you have them declared in the .asm, or if you're using another .asm to store it, include "the.asm" at the start of the code, after the important .asms (macro, sound driver).
     
  8. Greenknight9000

    Greenknight9000 Well-Known Member Member

    Joined:
    Apr 30, 2014
    Messages:
    53
    I get no errors now after building, though Sonic doesn't turn Super (I checked the required emeralds needed)
    Should I send my Sonic.asm file to see what's wrong?
     
  9. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    I had a tutorial on here at one point, but however still needs to be fixed with what each bit of code does. Before I posted it I made sure it worked 99 percent. It still needs to be fixed, I'm not sure if I deleted the bit of code that moves the hud off screen (which is odd) I used Hivebrain and Xenowhirl to do this while making Sonic 2 in Sonic 1 (which I desperately hope ain't on my corrupt drive)
    Edit: checking THAT tutorial on the RETRO I seen it is indeed mine, the one I had on here. I only changed the + to Loc1, Loc2 and so on cause it's shorter.
     
    Last edited: Aug 12, 2018
  10. Prilix

    Prilix A normal romhacker In Limbo

    Joined:
    Sep 19, 2017
    Messages:
    20
    Location:
    Argentina
    One question
    ¿How do I add the water of labyrinth in other zones???
     
  11. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
  12. Prilix

    Prilix A normal romhacker In Limbo

    Joined:
    Sep 19, 2017
    Messages:
    20
    Location:
    Argentina
  13. maple_t

    maple_t Exists Member

    Joined:
    Jul 5, 2018
    Messages:
    56
    Location:
    a rock and a cold place (Canada)
    I'm having a slight issue with something I want to do with my hack.

    I want to add more frames of animations to rings, and possibly other objects.

    The thing is, I'm not really sure where to start.
    I've already made the new sprites, I just need the game to display them correctly, I think?
     
  14. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    It depends on the object. Some objects function differently then others, and rings work in a completely different fashion from most other animated entities. I believe I've found out how rings work (untested, but I'm like 90% sure I'm right), and I've been working with "standard" object animation quite a bit, so I'll try to explain both of them.

    Rings appear to use "Rings_anim_frame" to store which mapping to display at a given time; Obj25 (the debug placed ring object, and Sonic 1 leftover) pushes whatever value is in this variable directly into it's mapping frame. Thus, when this value is 0, it displays frame 0, etc. The value of that address is only ever changed directly in "ChangeRingFrame", in this little bit of code:
    Code:
        subq.b    #1,(Rings_anim_counter).w
        bpl.s    +
        move.b    #7,(Rings_anim_counter).w
        addq.b    #1,(Rings_anim_frame).w ; animate rings in the level (obj25)
        andi.b    #3,(Rings_anim_frame).w
    +
    
    Modifying the 7 in "move.b #7,(Rings_anim_counter).w" should change how quickly the animation cycles, and increasing the value in "andi.b #3,(Rings_anim_frame).w" should allow the animation frame for rings to cycle through extra frames before looping back to frame 0. Once that's done, you'd just need to add extra frames to the ring mappings among the usual ones in Flex, Flex 2 or SonMapED, and adjust VRAM to account for any extra art that's added; even a single extra tile will cause the rings to overwrite HUD art. Then you'd have to adjust the mapping values in "Ani_Ring", to make the sparkle effect line up to the new mappings. This is similar to how most "normal" object animation works, so I'll just explain it in the next part.

    "Normal" object animation is handled specially by a routine called "AnimateSprite". It accepts an input value in a1, which is a script to an objects animation sequence. Put simply, any object that calls AnimateSprite needs to give it a list of animations that tells it how to animate the object. These are usually pretty easy to edit by hand. It starts with a list of pointers, one for each animation the object can do. The pointers go to lists of values, which start with a bunch of values for the mappings to use, then end with a command byte which tells the animation routine how to finish the animation. Since we're on the subject, I'll use "Ani_Ring" as an example:
    Code:
    Ani_Ring:    offsetTable
            offsetTableEntry.w +    ; 0
    +        dc.b   5,  4,  5,  6,  7,$FC
    
    Ani_Ring is an animation script. It has only one entry, for animation 0; any other animation would animate garbage. Animation 0 has the values 5,4,5,6,7,$FC. The values before $FC correspond to mapping frames; if you open the ring mappings in a mappings editor, you'll see that they all match to the sparkle frames that happen after you collect a ring. Shifting the mappings around will mess up this animation script, so you'll need to update it with the new positions of the sparkle frames if you add more ring frames. The byte at the end, $FC itself, is the control byte in the animation. This particular one cause the object to change it's routine. Other common values are $FD (reads the byte after $FD, and runs the animation number given), $FE (reads next byte, back tracks that many frames back, essentially looping the animation, but with an intro section), and $FF (Restarts the whole animation, always from the very start).


    Keep in mind that all the stuff specifically relating to the rings might not be 100% accurate; I haven't tested any of it yet, as I have no need too.
     
    MarkeyJester, maple_t, Kilo and 2 others like this.
  15. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Few corrections to Pacguy's post; changing the andi line, you need to be sure that the number is always a correct bitmask. For example, 3 in binary is 0011, 7 is 0111, 15 is 1111. This is important, because when the value goes ivov, say, 3, it will wrap back to 0, resetting the counter. In order to preserve this correct behavior, each number should be any power of 2 minus 1. This will give you the power of 2 number of frames to use.

    Also when it comes to animation data, the first byte is (almost) always a timer. Timer value of 5 means that the frame will be displayed for 5 frames, and then the next byte is processed.
     
    maple_t, Kilo and Pacca like this.
  16. maple_t

    maple_t Exists Member

    Joined:
    Jul 5, 2018
    Messages:
    56
    Location:
    a rock and a cold place (Canada)
    Okay, I understand, and I managed to get the scattered rings and rings placed in debug mode to display all of the new sprites, but I'm still having a bit of trouble with the rings because, well, I'm not sure where I need to go to adjust the VRAM to account for this, since the HUD is kinda broken visually if left untouched. (on a less serious note the rings kinda look like bananas lol)
    [​IMG]
     
  17. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Ah, VRAM can be kind of a pain to work with. Maybe I'll make a guide on it someday, given how important it can be...
     
    Jdpense likes this.
  18. AsuharaMoon

    AsuharaMoon kakyoin did you lay this egg Member

    Joined:
    Aug 15, 2013
    Messages:
    67
    What function does the RAM address $FFFFF74F have in S3&K? I ask, because its counterpart of KiS2 ($FFFFF7AD) doesn't seem to have any use in special.
     
  19. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    A quick search through the asm file in the GitHub S3K disassembly brought up this line:
    Code:
    bset    #7,($FFFFF74F).w    ; Disable wall grabbing for Knuckles
    Does that answer your question?
     
    Niko and TheInvisibleSun like this.
  20. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Yes indeed, it looks like this was intended on being a bitfield for various things, but only ended up being for disabling/enabling the wall grab. Few sections of the game could break if Knuckles has holding onto a wall (automated cutscenes), so they most likely added it to make sure nothing funny happens
     
    Niko, AsuharaMoon and AkumaYin like this.