Guest User

Vertwrap "fix"

a guest
Jul 6th, 2016
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lorom
  2.  
  3. !Check = $5C
  4.  
  5. if read1($00FFD5) == $23
  6. !SA1 = 1
  7. sa1rom
  8. else
  9. !SA1 = 0
  10. endif
  11.  
  12. if !SA1
  13. !base1 = $3000
  14. !base2 = $6000
  15.  
  16.  
  17. !E4 = $322C
  18. !14E0 = $326E
  19. else
  20. !base1 = $0000
  21. !base2 = $0000
  22.  
  23. !E4 = $E4
  24. !14E0 = $14E0
  25. endif
  26.  
  27. org $008E9A ;status bar routine hijack, run every frame
  28. autoclean JSL MainCode
  29.  
  30. org $00E9A1
  31. autoclean JML VertDisablewall
  32.  
  33. org $03B66E
  34. autoclean JSL Marionox ;;;;
  35.  
  36. org $03B6BB
  37. autoclean JSL Spritanox ;;;;
  38.  
  39.  
  40. freedata ; this one doesn't change the data bank register, so it uses the RAM mirrors from another bank, so I might as well toss it into banks 40+
  41.  
  42. Marionox:
  43. ADC #$00
  44. PHA
  45. LDA $5B
  46. AND !Check
  47. AND #$01
  48. BEQ .horz
  49. PLA
  50. AND #$01
  51. STA $08
  52. RTL
  53. .horz
  54. PLA
  55. STA $08
  56. RTL
  57.  
  58. Spritanox:
  59. ADC $0F
  60. PHA
  61. LDA $5B
  62. AND !Check
  63. AND #$01
  64. BEQ .horz
  65. PLA
  66. AND #$01
  67. STA $0A
  68. RTL
  69. .horz
  70. PLA
  71. STA $0A
  72. RTL
  73.  
  74. MainCode:
  75. STA $00
  76. STZ $01
  77.  
  78. LDA $5B
  79. AND !Check
  80. AND #$01
  81. BEQ Return
  82.  
  83. REP #$20
  84. LDA #$0020
  85. STA $1A
  86. ;BRA SkipSpriteRun
  87.  
  88. ;LDA $1337
  89. PHX
  90. SEP #$20
  91.  
  92. LDX #$00
  93. SpriteLoop:
  94. LDA !14E0,x
  95. XBA
  96. LDA !E4,x
  97. REP #$20
  98. CMP #$0010
  99. BCS NoSpriteWrapL
  100. LDA #$0120
  101. BRA EndSprCycle
  102. NoSpriteWrapL:
  103. CMP #$0121
  104. BCC EndSprCycle
  105. LDA #$0010
  106. EndSprCycle:
  107. SEP #$20
  108. STA !E4,x
  109. XBA
  110. STA !14E0,x
  111. INX
  112. CPX #$0C
  113. BNE SpriteLoop
  114.  
  115. LDX #$00
  116. ExtSpriteLoop:
  117. LDA $1733+!base2,x
  118. XBA
  119. LDA $171F+!base2,x
  120. REP #$20
  121. CMP #$0022
  122. BCS NoExtSpriteWrapL
  123. LDA #$0110
  124. BRA EndExtSprCycle
  125. NoExtSpriteWrapL:
  126. CMP #$0111
  127. BCC EndExtSprCycle
  128. LDA #$0023
  129. EndExtSprCycle:
  130. SEP #$20
  131. STA $171F+!base2,x
  132. XBA
  133. STA $1733+!base2,x
  134. INX
  135. CPX #$0B
  136. BNE ExtSpriteLoop
  137. REP #$20
  138. PLX
  139.  
  140. SkipSpriteRun:
  141. LDA $94
  142. CMP #$0010
  143. BCS NoWrapL
  144. LDA #$0120
  145. STA $94
  146. SEP #$20
  147. RTL
  148. NoWrapL:
  149. CMP #$0121
  150. BCC Return
  151. LDA #$0010
  152. STA $94
  153. Return:
  154. SEP #$20
  155. RTL
  156.  
  157. VertDisablewall:
  158. LDA $5B
  159. AND !Check
  160. AND #$01
  161. BNE DoNoWrap
  162. LDA $7E
  163. CMP #$F0
  164. JML $00E9A5
  165. DoNoWrap:
  166. JML $00E9FB
RAW Paste Data