Basic Questions and Answers Thread

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

  1. HiddenPalace

    HiddenPalace Active Member Member

    Joined:
    Feb 9, 2010
    Messages:
    33
    It is replacing unused Level 9.
     
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I guess the music can be heard, looks like something isn't loading then.


    It could be stopped at several points. I think you should first check the PLCs, then the level size data, and third the deformation routines. Make sure they all exist and are in the right format, the error is probably one of those.
     
  3. HiddenPalace

    HiddenPalace Active Member Member

    Joined:
    Feb 9, 2010
    Messages:
    33
    Where are the deformation routines?
     
  4. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Under DeformBgLayer: there's an index (SwScrl_Index) which should send to "swscrl_minimal" for level 9. Since you didn't know, I assume you didn't modify it, so that one shouldn't be the problem.
     
  5. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I have a question. I'm trying to understand how the horizontal interrupt is working, and use it to load water palettes like s3 does.


    So, in the "vectors", vector 29, is related to this. In s1, the content of the 29th vector is PalToCRAM, and in s3, it's $FFFFFFF6.


    S1 sends directly to the right routine, while s3 stores "4EF9" in $FFFFFFF6 and the address of the routine to process in $FFFFFFF8 (a part of the program changes the content of those addresses). 4EF9 is "jmp" in hex. So, what's really in that vector (through the address) is, for example "jmp HInt4". So far, I think I'm not completely wrong yet. But, the question is...


    When is it being processed? There should be an exception, but I can't find where/how it happens (ie how to tell the processor the right line has been reached).
     
  6. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    The VDP has a register (8A) that deals with what number of lines should run until interruption is allowed, if we set it to 01, then every 1 line the interrupt will run, if we set it to 02, then every 2 lines the interrupt will run. The interrupt will run on the set lines when the beam is off and is moving back during what is known as a "Blanking Interval". Sonic games tend to set the line number based on the Y position of water, the problem here though is that if it's set to 03 (meaning 3 pixels from the top of the screen to display water), the next 3 lines after that the interrupt will run again, and the next 3 lines after that, etc. So they would presumably have a check to see if it's already been run once during the frame, and if so, skip the palette swapping (to make sure it only happens once).


    That's the basic idea behind it anyway, no doubt different games (different Sonic games too probably) may go about programming it slightly differently, but the same method is there anyway.
     
  7. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Thanks.


    The way I'd have done it, I'd have set the interruption line to the water level on screen, and on interruption, loaded the palette line, added 1 to the interruption line number, etc. But I can't find anything that simple in s3, so it looks like I'm still missing an important part of the program xD
     
  8. Hanoch

    Hanoch Well-Known Member Member

    Joined:
    Aug 3, 2008
    Messages:
    312
    Location:
    Israel
    Is it possible to edit the interrupts to make curved water? Like, a pool of water.


    Or maybe the best way is to make a sprite to act as an "overlay" for the curved area and make that sprite animate in a way it looks transparent (and apply water physics too)


    (read: various levels from project MD used this method)


    What I mean is, lets say I want a level with water but only in one part of the level. First I would need to edit the water height object to also use X positions, but the main problem is the VDP stuff, can it allow specific pixels on the screen to palette switch, or maybe its only for lines/coloumns?


    Theoretically, if I only move one pixel forward, only one pixel of water is supposed to show up, so all of the knewly drawn coloumn creates itself, while one specific pixel sets itself to palette switch. The main question is, how do you do it? Have other genesis/MD games done it before?
     
  9. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Maybe do it like the lava in mz. You have your blank tiles made up in soned2, and then include the art in sonic1.asm and then create the animation routine to load it etc. That way, whether you put those blank tiles in soned2, techinaly that should produce the desired sprite(s). Dunno if this would definatly work but think its one way of doing it.
     
  10. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    Check the obj34_config subroutine. I noticed that the guide follows a 3-act configuration, but the game has originally 4. Try expanding this for 4 configs per zone.
     
  11. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Hi. How I can check into the object's code, what subtype is defined?


    I don't know how to do these things the other objects, such as Obj2E, and Its not explained in the Work With Objects guide.


    How I can do these checks?
     
  12. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    $28(a-) is the space where the sub-type is loaded to.
     
  13. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok, and how to call a object with a subtype, with SingleObjLoad?
     
  14. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Load object, load object type in a0, load object subtype in $28(a0).
     
  15. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok, it worked perfecty ^^


    I needed it, because my object table is complete (?)
     
  16. GalliumGrant

    GalliumGrant Void. Member

    Joined:
    May 11, 2010
    Messages:
    384
    I have a problem, when I compile my ROM, after making some edits to the code (I'm following a guide)


    I see errors, but the compiler goes away before I can read them. Do you know what to type in the


    command prompt to allow me to see the errors?
     
  17. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Pause


    You write it at the bottom of your build.bat file and it will pause, forcing the window to stay opened.
     
  18. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    I lol'd


    add the "pause" command at the end of build.bat, and if you read some branch or out of range error, change the bsr by jsr, bra.X by jmp, or bne.b to bne.w... Something like this
     
  19. DeoxysKyogre

    DeoxysKyogre No idea what to put here .-. Member

    Joined:
    Jan 31, 2009
    Messages:
    298
    So basically what I was trying is to do a health bar for my hack's bosses...



    Code:
    ; ---------------------------------------------------------------------------
    
    ; Display routine
    
    ; ---------------------------------------------------------------------------
    
    
    
    obj4f_Flash:
    
    				lea	($FFFFD010).w,a4
    
    				cmpi.w  #8,$21(a4)
    
    				bne.s   s7_Hits
    
    				bchg	#$0,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s7_Hits:
    
    				cmpi.w  #7,$21(a4)
    
    				bne.s   s6_Hits
    
    				bchg	#$1,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s6_Hits:
    
    				cmpi.b  #6,$21(a4)
    
    				bne.s   s5_Hits
    
    				bchg  #$2,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s5_Hits:
    
    				cmpi.b  #5,$21(a4)
    
    				bne.s   s4_Hits
    
    				bchg  #$3,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s4_Hits:
    
    				cmpi.b  #4,$21(a4)
    
    				bne.s   s3_Hits
    
    				bchg  #$4,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s3_Hits:
    
    				cmpi.b  #3,$21(a4)
    
    				bne.s   s2_Hits
    
    				bchg  #$5,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s2_Hits:
    
    				cmpi.b  #2,$21(a4)
    
    				bne.s   s1_Hit
    
    				bchg  #$6,$1C(a0)
    
    				bra.s   Continue_Bar
    
    s1_Hit:
    
    				cmpi.b  #1,$21(a4)
    
    				bne.s   Boss_Death_Remove
    
    				bchg   #$7,$1C(a0)
    
    				bra.s   Continue_Bar
    
    Boss_Death_Remove:
    
    				bchg  #$8,$1C(a0)
    
    Continue_Bar:
    
    		lea	(Ani_obj4f).l,a1		&#59; load animation script address
    
    		jsr	AnimateSprite			&#59; load correct map ID based on the script
    
    		jmp	DisplaySprite			&#59; save object ram space ready for display
    But the frames aren't changing. What can I do? Thanks from advance
     
  20. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Hmm, try using a not odd RAM instead of a SST...