Project Sonic 1: Two-Eight

Discussion in 'Discussion and Q&A Archive' started by MarkeyJester, Jun 24, 2010.

Thread Status:
Not open for further replies.
  1. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    oh geez, I always somehow forget to post what I release at SonicRetro here too =$ (Also wasn't sure if the Q&A was infact the best place to post this, by all means staff, move if you feel it's necessary.)

     
    Last edited by a moderator: Jul 6, 2010
  2. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    Heh-heh. You have 256 posts! =P


    Haha, this is interesting! I can see this opening the pathway for many new ideas of level editing!


    But ask me this: Why is there 2 LZ3 projects? Just curious. =P
     
    Last edited by a moderator: Jun 24, 2010
  3. iojnekns

    iojnekns OBAMA '012!!!!1!!!!!&#33 Member

    Joined:
    Mar 27, 2009
    Messages:
    258
    I'M MOVING THIS STRAIGHT TO THE TRASH!
     
  4. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Haha, oh boy, man how could I have not spotted that!

    I'll answer you it insted of asking, basically in LZ act 3 there's a switch, when pressing that switch a chunk ID in layout ram is changed, this makes a slide/wall change or open up, and when going through the wall, the wall is retored, but because of the nature of Sonic 2's layout data being too big, it had to be read from rom insted of ram as it wouldn't fit in it's original space, and as you well know, altering the rom's values is prohibited. So there are two layouts, one with the wall intacted as a slide (the normal LZ 3), and one with the wall removed and replaced with an opened space (the LZ 3 (WALL)), which are read individually depending on whether the button/switch is pressed or not.
     
  5. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    I'm stea... err... borrowing this.
     
  6. Goonie

    Goonie Active Member Member

    Joined:
    Jun 14, 2010
    Messages:
    47
    Location:
    Australia
    Nice one Markey Jester thanking you!!!
     
  7. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    Looks like StephenUK and myself have discovered a flaw with this - it's not Rev 01 effect friendly. Which is lame, as the improved rasterization makes the zone BGs look better. Any chance you could look into this?
     
  8. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Doing it now, bare with me...


    (Will edit this post when information is ready)


    EDIT:


    Ok found what's wrong, when porting the Rev effects, it ports not only the BG deformation but the draw code from the Rev version, and of course, this overwrites my modification of the 128x128 engine.


    If you've ported the Rev effects to the Two-Eight engine, then you must follow these further steps to enable it to work correctly:



    Code:
    ----------------------------------------------------
    
    goto sub_6886:
    
    
    
    change
    
    
    
    		lea	($FFFFA440).w,a4
    
    
    
    to
    
    
    
    		movea.l	($FFFFA404).w,a4&#59; MJ: Load address of layout BG
    
    
    
    ----------------------------------------------------
    
    goto LoadTilesAsYouMove:
    
    
    
    change
    
    
    
    		lea	($FFFFA440).w,a4
    
    
    
    to
    
    
    
    		movea.l	($FFFFA404).w,a4&#59; MJ: Load address of layout BG
    
    
    
    and change
    
    
    
    		lea	($FFFFA400).w,a4
    
    
    
    to
    
    
    
    		movea.l	($FFFFA400).w,a4&#59; MJ: Load address of layout
    
    
    
    ----------------------------------------------------
    
    goto sub_70AC:  (Was sub_6B32: in normal S1)
    
    
    
    change
    
    
    
    		btst	#4,(a0)
    
    
    
    to
    
    
    
    		btst	#3,(a0)		&#59; MJ: checking bit 3 not 4 (Flip)
    
    
    
    and change
    
    
    
    		btst	#3,(a0)
    
    
    
    to
    
    
    
    		btst	#2,(a0)		&#59; MJ: checking bit 2 not 3 (Mirror)
    
    
    
    ----------------------------------------------------
    
    goto loc_70E8: (Was loc_6B6E: in normal S1)
    
    
    
    change
    
    
    
    		btst	#3,(a0)
    
    
    
    to
    
    
    
    		btst	#2,(a0) 	&#59; MJ: checking bit 2 not 3 (Mirror)
    
    
    
    
    
    
    
    ----------------------------------------------------
    
    goto loc_712C: (Was sub_6BD6: in normal S1)
    
    
    
    remove
    
    
    
    		lsr.w	#1,d3
    
    
    
    change
    
    
    
    		andi.w	#$380,d3
    
    
    
    to
    
    
    
    		andi.w	#$780,d3	&#59; MJ: get within 780 (Not 380) (E00 pixels (not 700)) in multiples of 80
    
    
    
    
    
    and change
    
    
    
    		lsr.w	#5,d0
    
    
    
    to
    
    
    
    		lsr.w	#4,d0		&#59; MJ: divide by 10 (Not 20)
    
    
    
    under this command
    
    
    
    		andi.w	#$7F,d0; ''
    
    
    
    insert this
    
    
    
    		lsl.w	#$01,d3		&#59; MJ: multiply by 2 (So it skips the BG)
    
    
    
    remove these two
    
    
    
    		beq.s	locret_7172
    
    		subq.b	#1,d3
    
    
    
    change
    
    
    
    		andi.w	#$7F,d3; ''
    
    
    
    to
    
    
    
    		andi.w	#$FF,d3		&#59; MJ: keep within FF
    
    
    
    under this command
    
    
    
    		ror.w	#7,d3
    
    
    
    insert this
    
    
    
    		ror.w	#2,d3		&#59; MJ: ..plus an extra 2 (so it's within 80 bytes, not 200)
    
    
    
    remove
    
    
    
    		add.w	d4,d4
    
    
    
    change these two
    
    
    
    		andi.w	#$1E0,d4
    
    		andi.w	#$1E,d5
    
    
    
    to this
    
    
    
    		andi.w	#$070,d4	&#59; MJ: keep Y pos within 80 pixels
    
    		andi.w	#$0E,d5		&#59; MJ: keep X pos within 10
    
    
    
    ----------------------------------------------------
    
    goto LoadTilesFromStart:
    
    
    
    change
    
    
    
    		lea	($FFFFA400).w,a4
    
    
    
    to
    
    
    
    		movea.l	($FFFFA400).w,a4&#59; MJ: Load address of layout
    
    
    
    and change
    
    
    
    		lea	($FFFFA440).w,a4
    
    
    
    to
    
    
    
    		movea.l	($FFFFA404).w,a4&#59; MJ: Load address of layout BG

    You don't have to have the "; MJ:" comments in there, but it is suggested that you do, so you can at least remember where the changes were to be made, for the record I will provide a disassembly here of the Two-Eight engine with the rev effects, thanks for the bug report, much appreciated.
     
    Last edited by a moderator: Jul 6, 2010
Thread Status:
Not open for further replies.