Basic Questions and Answers Thread

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

  1. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    All it goes to is a pink screen.

    o-o
     
  2. RocketRobz

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    In "_inc/Pattern load cues.asm",

    you will see this:

    PLC_Main:    dc.w 4


    Change the "4" to a "3". (Without the quotes, of course)
     
  3. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Okay, thank you bobesh, it's working.

    For FFUser, his head is now static and when he pushes the lamppost tiles appear.

    -_-
     
  4. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    We can talk about that through PMs. I had that happen too and the fix is probably simple if it's the exact same thing on your end.
     
  5. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    I'm making a Sonic hack where there are two characters: Sonic and Anti-Sonic. I don't know much about Sonic coding (or whatever the proper terminology is, maybe ASM coding), so most of the coded elements are from tutorials here and on Sonic Retro. I used the extra characters tutorial on Sonic Retro, then went on to make Anti-Sonic load a separate pallet, and it works fine. The problem: badniks, monitors, sign posts, and Eggman all use Sonic's pallet, so their colors are all fucked up. How can I get those objects to always load Sonic's pallet, even when playing as Anti-Sonic?
     
  6. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    You can't. Do to the limited lines of palette on screen, you can only have the main palette line and the three level palette lines. And no, replacing a palette line isn't an option. Kuddos for getting that far as a beginner though.
     
  7. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    That's not possible. This has been explained several times, but it doesn't hurt to say it again. You only have 4 palettes available at a given time on the Genesis, and each of them can only use 15 colours + a transparent index (with one exception, but let's not get technical). We usually refer to them as "palette lines". The main character (e.g. Sonic) uses the first palette line; in Sonic 1, that line is used by many other objects as well, which is why it's not so trivial to implement other characters (e.g. Tails and/or Knuckles, or even Super Sonic) without screwing most other graphic elements in the process. From Sonic 2 onwards, they made sure that most objects didn't use the first palette line anymore, to avoid this kind of problem (one notable exception is that certain springs flash if you play as Super Tails in Sonic 3 & Knuckles).


    You will need to redraw something, either by finding a way to put some needed colours in your new first palette line, or by finding suitable colors in the other palette lines, or a combination of the above techniques and/or some palette index rearranging. Not impossible, but time consuming. Good luck!


    edit: damn you SuperEgg, it took me a lot of time to write this post because I was chatting with a cute girl in the mean time :p
     
    Last edited by a moderator: Jan 22, 2014
  8. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    Well, I guess Eggman is gonna be gothic in my hack, thanks to changing Anti-Sonic's reds to black :p. I should probably just stop being lazy and use the blacks that are already in Sonic's pallet to recolor his shoes in his art. (This is the part where you facepalm at me :p)

    EDIT: Oh, that's right. I had another question. I want to use music from both Sonic 2 and 3&K in my hack (and don't worry, I know what a sound driver is, but not much about them). Is it possible to have two sound drivers in one hack? (Apologies if I sound like an idiot right now.) If not, how do other hacks I've seen have music from various different games? Would I have to modify the tracks so they work on a different sound driver?
     
    Last edited by a moderator: Jan 22, 2014
  9. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    From what I know with the music and stuff, all they did was convert the songs to be played on Sonic 1's Z80, but I really have no idea on how to do so. As for your first question, I believe it's not impossible, but nearly.
     
  10. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Well, I can't help it if you're pushing the Nineko charm on an unsuspecting, hot, barely legal, Italian girl. You should've took her home instead of coming here, asshat =P

    Oh, put two sound drivers into a game. Trust me, it CAN be done. Ask vladikcomper, he's the one who made it possible. Anywho, the concept of it is now really void and no longer needed. You'd be better off just plopping in the S3K/flamewing driver into your S1 hack, or you could plop in the S2 2007 disasm's z80 driver, but modify it to run non-saxman compressed tracks. I actually have that lying around if you need help, so there's always that.
     
  11. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Once again, I agree. Look into Flamewing's driver and you'll be able to use all the songs you want.
     
  12. Starfruity

    Starfruity Newcomer Trialist

    Joined:
    Jan 17, 2014
    Messages:
    18
    I'm starting to think the only thing in this hack that will done by me is the concept, at this rate. I have a lot more ideas that I probably won't be able to pull off, but I'll try anyways. And most likely you will be the ones doing to dirty work :p
     
  13. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    I'm just saying, that really isn't the attitude to have. As they say, practice makes perfect, and if you want something done, do it yourself.
     
  14. TimpZ

    TimpZ Well-Known Member Member

    Joined:
    Apr 30, 2013
    Messages:
    63
    Location:
    Lund
    Just exactly where is the limitation in the palette anyway? Of course there's only so much space in CRAM but is there a bottleneck anywhere else in the process?

    If I'm coding, I could theoretically have a palette and draw an object and send that to the VDP or wherever the final image product gets stored while waiting for all image information. Then within the same frame, change the palette and draw some other objects and send that as well. Basically:

    Load Anti-sonic's palette

    Draw it

    Load the normal palette

    Draw the rest of the stuff that uses that palette

    Send the full image using both palette's to the TV.

    My initial guess is that this would result in the last defined palette to be used for everything, but why?

    I know something similar is used with the water palettes since the lines being drawn can be interrupted by such a change. Could that theoretically work with a vertical line as well if you have enough interrupts instead of just a single one by the correct horizontal line (as in: can you interrupt the drawing process and change palette mid-line)? If so, why not a box around Sonic :p?

    EDIT: Nevermind I think I figured out the answer to my own question :p. Anyway the one question still remains, if you can change a palette mid-line or if it only can be done between them.
     
    Last edited by a moderator: Jan 23, 2014
  15. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    Stop thinking outside the box TimpZ, you're going to hurt yourself =P This is SSRG, not a serious hardware website =P
     
    Last edited by a moderator: Jan 23, 2014
  16. TimpZ

    TimpZ Well-Known Member Member

    Joined:
    Apr 30, 2013
    Messages:
    63
    Location:
    Lund
    Well first off I think it's an interesting question. Usually you start with simple questions, but as you learn more you get more complex questions, a whole heap of them at that. I find it to be a good method of learning.

    Another reason I'm interested is because I've thought of incorporating water in new ways. Not to spoil anything but think of Asteroid Coaster from Sonic Colours.
     
    Last edited by a moderator: Jan 23, 2014
  17. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    I have some questions regarding fixing some issues with a Tails attack I've been working on for Sonic 1. One has to do with the way the animation is playing and the other is how the object designated to act like a "hitbox" behaves when the character is facing left. Edit: the hitbox thing is fixed and I edited the code section to reflect that, but I still don't know what to do with the animation issue

    I wanted the animation to play once whenever you press A whether you're just standing or walking/running on the ground, but it only seems to play out the whole animation when there's ground velocity acting on the character and when you're not pressing any directions. It only plays the first frame of animation when he's standing still then it goes right back to idle animation. I'm guessing the same type of thing is going on when you press a direction too (the attack animation is "interrupted" by the walking or running animation, when I'd like it to be the other way around). I've been searching around and am still not really sure what to do about it. Any help/advice?

    Here's the code for the attack (branched only from Obj02_MdNormal):


    Tails_Attack:
    move.b ($FFFFF603).w,d0 ; read controller
    andi.b #$40,d0 ; pressing A?
    beq.s TAttack_End
    move.b #33,$1C(a0)
    move.w #$A2,d0 ; set sound effect for the attack
    jsr (PlaySound_Special).l ;and play it



    ;Tails_Active_Hitbox:

    tst.b $2A(a0) ;is there already a hitbox on screen
    bne.s TAttack_End
    move.b #1,$2A(a0) ;Set flag until hitbox is gone
    bsr.w SingleObjLoad
    bne.s TAttack_End
    move.b #$6,0(a1) ; load tails hitbox object
    move.w 8(a0),8(a1)
    move.w $C(a0),$C(a1)
    move.w $10(a0),$10(a1)
    move.w #$14,d0
    move.w #$100,d1
    btst #0,$22(a0) ;Is Tails facing left
    beq.s TAttack_left
    neg.w d0
    neg.w d1
    neg.w $10(a1)


    TAttack_left:


    move.w $10(a0),$10(a1) ;testing
    add.w d0,8(a1)
    add.w d1,$10(a1)
    move.b $22(a0),$22(a1)
    move.b #1,$28(a1)


    TAttack_End:
    rts

    And here's the animation code for it:

    Code:
    TailsAni_Attack:	dc.b 2,$8B,$8C,$8D,$8E,$8F,$90,$91,$92,$93,$6A,$FD,0
    
     
    Last edited by a moderator: Jan 24, 2014
  18. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    edit: this message is a reply to TimpZ. Once again someone else posted while I was typing.


    It is possible to change palettes (almost) as much as you want, that's how Flamewing performs his 3-players black magic in Sonic 1 & 2: Heroes, but that's not trivial at all and it's not 100% faultproof, either. It also takes some time to update a full palette line, I don't remember how much, but I do remember that the moving "wave" objects on the water surface in water levels are added to somehow hide the few screen lines which use partially updated palette lines.
     
    Last edited by a moderator: Jan 23, 2014
  19. Samario

    Samario Newcomer Trialist

    Joined:
    Dec 19, 2013
    Messages:
    18
    Location:
    In s2.asm
    -last question; I'll have 19 posts after this one-

    I'm trying to add a health meter to Terra; and it seems to either allow her infinite hits or no hits (disregard a shield). I swear I'm doing something wrong.


    HurtCharacter:
    move.w (Ring_count).w,d0
    cmpa.w #MainCharacter,a0
    beq.s loc_3F88C
    tst.w (Two_player_mode).w
    beq.s Hurt_Sidekick
    move.w (Ring_count_2P).w,d0

    loc_3F88C:
    btst #0,status_secondary(a0) ; Does Sonic not have a shield?
    bne.s Hurt_Shield ; if he does, remove the shield
    take1HP_return:
    tst.w d0 ; does he have zero rings?
    beq.w Test_0HP ; if so, test if Sonic has 0 HP
    jmp HurtSonic2 ; jump over HP related code
    Take1HP:
    subi.b #1,$FFFFE740 ; Since we branched here, we must have more than 0 HP; reduce it by 1
    Test_0HP:
    tst.w $FFFFE740 ; Does Sonic have 0 HP?
    bne.w Hurt_Shield ; No, he has over 0 HP left; hurt him, but don't kill him
    beq.w KillCharacter ; Yes, he has 0 HP; kill him
    Test_take1HP:
    tst.w $FFFE740 ; does he have zero HP?
    bne.w Take1HP ; take 1 HP away if he doesn't, else, continue
    jmp take1HP_return ; go back to checking crap related to being hurt if he had over 1 HP

    HurtSonic2:
    jsr (SingleObjLoad).l
    bne.s Hurt_Shield
    move.b #ObjID_LostRings,id(a1) ; load object
    move.w x_pos(a0),x_pos(a1)
    move.w y_pos(a0),y_pos(a1)
    move.w a0,parent(a1)
    ; loc_3F8B8:
    Hurt_Shield:
    bclr #0,status_secondary(a0) ; remove shield
    ; loc_3F8BE:
    Hurt_Sidekick:
    move.b #4,routine(a0)
    bsr.w JmpTo_Sonic_ResetOnFloor_Part2
    bset #1,status(a0)
    move.w #-$400,y_vel(a0) ; make Sonic bounce away from the object
    move.w #-$200,x_vel(a0)
    btst #6,status(a0) ; underwater?
    beq.s Hurt_Reverse ; if not, branch
    move.w #-$200,y_vel(a0) ; bounce slower
    move.w #-$100,x_vel(a0)

    ; loc_3F8EE:
    Hurt_Reverse:
    move.w x_pos(a0),d0
    cmp.w x_pos(a2),d0
    blo.s Hurt_ChkSpikes ; if Sonic is left of the object, branch
    neg.w x_vel(a0) ; if Sonic is right of the object, reverse

    ; loc_3F8FC:
    Hurt_ChkSpikes:
    move.w #0,inertia(a0)
    move.b #AniIDSonAni_Hurt2,anim(a0)
    move.w #$78,invulnerable_time(a0)
    move.w #SndID_Hurt,d0 ; load normal damage sound
    cmpi.b #ObjID_Spikes,(a2) ; was damage caused by spikes?
    bne.s Hurt_Sound ; if not, branch
    move.w #SndID_HurtBySpikes,d0 ; load spikes damage sound

    ; loc_3F91C:
    Hurt_Sound:
    jsr (PlaySound).l
    moveq #-1,d0
    rts

    What am I doing wrong?

    EDIT: Ralakimus: if she has rings, don't lose any HP and act like Sonic; if she doesn't and has >0 HP, take one HP off and act as if she'd been hit with a shield; if she has no rings and no HP, kill her
     
    Last edited by a moderator: Jan 24, 2014
  20. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    Do you want Terra to lose rings when HP is 0, or is it just part of the code that is to be removed?