HISCORE.S 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. ; HISCORE.S
  2. ; THIS FILE CONTAINS THE HANDLERS FOR THE INTERFACE TO THE HISCORE
  3. ; MODULE. "MKHISCOR" AND "MKENTER" INITIATE MODES;
  4. ; "HISCORE" AND "ENTER" JUST LOOP IN WAIT.
  5. GLBL XDMAON,XDMAOFF
  6. GLBL MKHISCOR
  7. GLBL MKENTER
  8. GLBL MKLOGO
  9. GLBL DRAWLOGO
  10. GLBL HSCRTN
  11. GLBL HSCROM,HSCSCORE,HSCDIFF
  12. GLBL HSCRAM
  13. GLBL TUNER,DLISTB,DLIST9,DLIST8,DLIST7
  14. GLBL NMIRTN
  15. GLBL DLI1,PL0SCORE,PL1SCORE,M160X2
  16. GLBL COLRINIT
  17. GLBL DLLRAM
  18. GLBL NULL2,TXTLIST1,DWORDL,DWORDH,DWORDLEN
  19. GLBL COLORS
  20. GLBL DPPINIT,CLEARALL
  21. GLBL PREFRESH
  22. ; HIGH SCORE: ROM IS AT 800, RAM IS AT 1000
  23. HSCATRCT EQU $3FFA
  24. HSCENTER EQU $3FFD
  25. HSCSTAT EQU $3FF7
  26. RAMDEF ; ZERO PAGE
  27. RSEG CODE2
  28. MKHISCOR LDA #H(DLISTB) ; DON'T SET WRITE MODE ANYMORE
  29. STA DLLRAM+1
  30. LDA #L(DLISTB)
  31. STA DLLRAM+2
  32. JSR BUILDHSC
  33. JSR FHISCORE
  34. JMP HSCATRCT will RTS
  35. MKENTER MOVE HOWHARD,TEMP4
  36. JSR BUILDHSC
  37. JSR FENTER
  38. JMP HSCENTER will RTS
  39. ; COME HERE IF 1) NO HSC, 2) HSC IS OVER
  40. HSCMISS PLA pops two levels out
  41. PLA
  42. RTS
  43. ; SETUP HISCORE PARAMETERS
  44. BUILDHSC LDA $3900
  45. CMP #$C6
  46. BNE HSCMISS
  47. LDA $3904
  48. CMP #$FE
  49. BNE HSCMISS
  50. DMAOFF
  51. INITARGS
  52. LDX #$0F copy into RAM
  53. COPYHSC0 LDA HSCROM,X
  54. STA HSCRAM,X
  55. DEX
  56. BPL COPYHSC0
  57. LDA #L(HSCDLI1) ; ENSURE THAT I'M IN VBLANK
  58. STA DLIADR
  59. LDA #H(HSCDLI1)
  60. STA DLIADR+1
  61. LDA TEMP4 ; DIFFICULTY LEVEL FOR THIS CALL
  62. TAX
  63. ASL A ; --CALLED 4 TIMES FROM "LOGO"
  64. ASL A
  65. ORA CURRENT
  66. STA HSCRAM+2
  67. LDA CURRENT
  68. BEQ BUILDRTS
  69. LDA #L(PL1SCORE) ; 2ND PLAYER
  70. STA HSCRAM+8
  71. LDA #H(PL1SCORE)
  72. STA HSCRAM+9
  73. BUILDRTS
  74. RTS
  75. FHISCORE LDY #H(HSCRAM) for HSCSTAT
  76. JSR HSCSTAT see if cart is here
  77. BMI HSCMISS if negative, no table for this level
  78. FENTER ONSCREEN make sure i'm offscreen
  79. INVBLANK
  80. JSR DRAWLOGO ; LOAD UP DISPLAY LISTS
  81. JSR PUTDNAME ; "TEMP4" SET IN "LOGO"
  82. JSR INITARGS since they're in a dlist
  83. JSR PREFRESH make sure new colors are stored
  84. LDY #H(HSCRAM) for the following routine
  85. LDA #4 four seconds
  86. STA HSCRAM+14
  87. REETS RTS
  88. ; THIS TABLE IS COPIED INTO RAM WHEN HSC IS CALLED. IT'S THE ARGUMENT BLOCK
  89. ; NEEDED BY THE HSC.
  90. HSCROM DB $23,$23 ; CARTRIDGE ID NUMBER
  91. DB $00 ; DIFFICULTY LEVEL
  92. ; + PLAYER NUMBER (BOTTOM 2 BITS)
  93. DB $00 ; CONTROLLER TYPE
  94. DB $00,$00 ; HSC NAME-- IGNORED IF I HAVE A DLIST
  95. DB $00,$00 ; MAKES HSC COPY 14 MORE SCAN LINES
  96. ; FOR DISPLAY LIST WITH NAME
  97. DB L(PL0SCORE),H(PL0SCORE) ; POINTER TO THE SCORE
  98. ; WILL BE PL0SCORE OR PL1SCORE
  99. DB L(HSCDLL),H(HSCDLL) ; DLIST LIST POINTER FOR LOGO
  100. DB L(REETS),H(REETS) ; SOUND ROUTINE
  101. DB $00 ; SECONDS TO WAIT BEFORE RETURNING
  102. ; (FOR EACH DIFFICULTY LEVEL)
  103. HSCDLL DB $8F
  104. DB H(DLISTB),L(DLISTB) ; NULL LIST; DLI FOR MODE CHANGE
  105. DB $0D
  106. DB H(DLISTB),L(DLISTB)
  107. DB $0F ; USE "MKLOGO" TO DO THIS
  108. DB H(DLIST9),L(DLIST9)
  109. DB $0F
  110. DB H(DLIST8),L(DLIST8)
  111. DB $09 ; BRINGS NUMBER TO 70 LINES
  112. DB H(DLISTB),L(DLISTB)
  113. DB $07 ; DISPLAYS DIFFICULTY NAME
  114. DB H(DLIST7),L(DLIST7)
  115. ; DB $82
  116. ; DB H(DLISTB),L(DLISTB)
  117. HSCDLI1 LDA #L(HSCDLI2) ; OCCURS AT TOP OF SCREEN
  118. STA DLIADR
  119. LDA #H(HSCDLI2)
  120. STA DLIADR+1
  121. LDA #$50 ; 160X2, 2 BYTE CHARACTERS
  122. STA CTRL
  123. LDA #$E8
  124. STA CHARBASE
  125. JMP NMIRTN
  126. HSCDLI2 LDA #L(HSCDLI1) ; CHANGE BACK FOR HSC DISPLAY
  127. STA DLIADR
  128. LDA #H(HSCDLI1) ; CHANGED FROM (HSCDLI2) [ROB 6.19.84]
  129. STA DLIADR+1
  130. STA WSYNC
  131. STA WSYNC
  132. LDA #$4B
  133. STA CTRL
  134. LDA #$39
  135. STA CHARBASE
  136. JMP NMIRTN
  137. ; THIS ROUTINE IS CALLED FROM THE TWO ABOVE ROUTINES TO INSERT
  138. ; THE DIFFICULTY NAME INTO DLIST7.
  139. PUTDNAME LDX #11 ; BLANK OUT TXTLIST1
  140. LDA #NULL2
  141. HSLOLP0 STA TXTLIST1,X
  142. DEX
  143. BNE HSLOLP0
  144. LDA #$19 ; COLORS FOR TEXT
  145. STA COLORS+20
  146. LDA #$15
  147. STA COLORS+21
  148. LDA #$1F
  149. STA COLORS+22
  150. LDA #L(TXTLIST1)
  151. STA DLIST7
  152. LDA #$60
  153. STA DLIST7+1
  154. LDA #H(TXTLIST1)
  155. STA DLIST7+2
  156. LDA #$B4 ; PALETTE 5, WIDTH 12
  157. STA DLIST7+3
  158. LDA #0
  159. STA DLIST7+6
  160. LDX TEMP4 ; UPDATE DIFFICULTY WORD
  161. LDA DWORDL,X ; COPY WORD INTO "TXTLIST2"
  162. STA TEMP0
  163. LDA DWORDH,X
  164. STA TEMP1
  165. LDA HSWPOS,X
  166. STA DLIST7+4 ; HPOS
  167. LDY DWORDLEN,X
  168. HSDIFFLP LDA (TEMP0),Y
  169. STA TXTLIST1,Y
  170. DEY
  171. BPL HSDIFFLP
  172. RTS
  173. ; This routine is called after calls to HSC are done, from LOGO and INIT
  174. HSCRTN
  175. ONSCREEN
  176. INVBLANK
  177. JSR COLRINIT
  178. JSR CLEARALL
  179. JSR DPPINIT reset DPP, turning DMA on
  180. ; waits for vblank
  181. LDA #$E8
  182. STA CHARBASE
  183. LDA #L(DLI1) we're in vblank
  184. STA DLIADR
  185. LDA #H(DLI1)
  186. STA DLIADR+1
  187. RTS
  188. HSWPOS DB 48,32,48,56
  189. END