don't click here

Project Sonic 1: Two-Eight

Discussion in 'Engineering & Reverse Engineering' started by MarkeyJester, Jun 24, 2010.

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

    MarkeyJester

    Original, No substitute Resident Jester
    2,201
    431
    63
    Japan
    Yes, that could work, though I would imagine you'd need more than one, as it's more of taking the X and Y positions of the level and manipulating them into reading the correct position of the layout data (which collects the chunk in question and reads from there, etc), and this will vary depending on the size of the level's data on X and Y axiz (should they be altered), and not just the size of the chunks in question.

    I think he's referring to the chunk size which can be altered by changing a simple value (making it more easy to change at a programmer's will), and not SonED.
     
  2. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,201
    431
    63
    Japan
    Sorry to bump and double post...

    <!--quoteo(post=20026:date=Sunday 4th July 2010, 5:10 pm:name=OrdosAlpha)--><div class='quotetop'>QUOTE (OrdosAlpha @ Sunday 4th July 2010, 5:10 pm) [​IMG]</div><div class='quotemain'><!--quotec-->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?[/QUOTE]
    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 (Text):
    1. ----------------------------------------------------
    2. goto sub_6886:
    3.  
    4. change
    5.  
    6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lea&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA440).w,a4
    7.  
    8. to
    9.  
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movea.l&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA404).w,a4; MJ: Load address of layout BG
    11.  
    12. ----------------------------------------------------
    13. goto LoadTilesAsYouMove:
    14.  
    15. change
    16.  
    17. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lea&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA440).w,a4
    18.  
    19. to
    20.  
    21. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movea.l&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA404).w,a4; MJ: Load address of layout BG
    22.  
    23. and change
    24.  
    25. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lea&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA400).w,a4
    26.  
    27. to
    28.  
    29. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movea.l&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA400).w,a4; MJ: Load address of layout
    30.  
    31. ----------------------------------------------------
    32. goto sub_70AC:&nbsp;&nbsp;(Was sub_6B32: in normal S1)
    33.  
    34. change
    35.  
    36. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#4,(a0)
    37.  
    38. to
    39.  
    40. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#3,(a0)&nbsp;&nbsp;&nbsp;&nbsp;; MJ: checking bit 3 not 4 (Flip)
    41.  
    42. and change
    43.  
    44. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#3,(a0)
    45.  
    46. to
    47.  
    48. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#2,(a0)&nbsp;&nbsp;&nbsp;&nbsp;; MJ: checking bit 2 not 3 (Mirror)
    49.  
    50. ----------------------------------------------------
    51. goto loc_70E8: (Was loc_6B6E: in normal S1)
    52.  
    53. change
    54.  
    55. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#3,(a0)
    56.  
    57. to
    58.  
    59. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btst&nbsp;&nbsp;&nbsp;&nbsp;#2,(a0) ; MJ: checking bit 2 not 3 (Mirror)
    60.  
    61.  
    62.  
    63. ----------------------------------------------------
    64. goto loc_712C: (Was sub_6BD6: in normal S1)
    65.  
    66. remove
    67.  
    68. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lsr.w&nbsp;&nbsp;&nbsp;&nbsp;#1,d3
    69.  
    70. change
    71.  
    72. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$380,d3
    73.  
    74. to
    75.  
    76. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$780,d3; MJ: get within 780 (Not 380) (E00 pixels (not 700)) in multiples of 80
    77.  
    78.  
    79. and change
    80.  
    81. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lsr.w&nbsp;&nbsp;&nbsp;&nbsp;#5,d0
    82.  
    83. to
    84.  
    85. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lsr.w&nbsp;&nbsp;&nbsp;&nbsp;#4,d0&nbsp;&nbsp;&nbsp;&nbsp;; MJ: divide by 10 (Not 20)
    86.  
    87. under this command
    88.  
    89. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$7F,d0; ''
    90.  
    91. insert this
    92.  
    93. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lsl.w&nbsp;&nbsp;&nbsp;&nbsp;#$01,d3&nbsp;&nbsp;&nbsp;&nbsp;; MJ: multiply by 2 (So it skips the BG)
    94.  
    95. remove these two
    96.  
    97. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq.s&nbsp;&nbsp;&nbsp;&nbsp;locret_7172
    98. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subq.b&nbsp;&nbsp;&nbsp;&nbsp;#1,d3
    99.  
    100. change
    101.  
    102. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$7F,d3; ''
    103.  
    104. to
    105.  
    106. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$FF,d3&nbsp;&nbsp;&nbsp;&nbsp;; MJ: keep within FF
    107.  
    108. under this command
    109.  
    110. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ror.w&nbsp;&nbsp;&nbsp;&nbsp;#7,d3
    111.  
    112. insert this
    113.  
    114. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ror.w&nbsp;&nbsp;&nbsp;&nbsp;#2,d3&nbsp;&nbsp;&nbsp;&nbsp;; MJ: ..plus an extra 2 (so it's within 80 bytes, not 200)
    115.  
    116. remove
    117.  
    118. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;add.w&nbsp;&nbsp;&nbsp;&nbsp;d4,d4
    119.  
    120. change these two
    121.  
    122. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$1E0,d4
    123. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$1E,d5
    124.  
    125. to this
    126.  
    127. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$070,d4; MJ: keep Y pos within 80 pixels
    128. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;andi.w&nbsp;&nbsp;&nbsp;&nbsp;#$0E,d5&nbsp;&nbsp;&nbsp;&nbsp;; MJ: keep X pos within 10
    129.  
    130. ----------------------------------------------------
    131. goto LoadTilesFromStart:
    132.  
    133. change
    134.  
    135. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lea&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA400).w,a4
    136.  
    137. to
    138.  
    139. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movea.l&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA400).w,a4; MJ: Load address of layout
    140.  
    141. and change
    142.  
    143. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lea&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA440).w,a4
    144.  
    145. to
    146.  
    147. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;movea.l&nbsp;&nbsp;&nbsp;&nbsp;($FFFFA404).w,a4; 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.
     
  3. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Excellent work as always, thanks for addressing this Markey :thumbsup:
     
Thread Status:
Not open for further replies.