FOODDEF.S 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  1. ; FOODDEF.S
  2. ; THIS ROUTINE CONTAINS DEFINITIONS FOR:
  3. ; ALL TIA REGISTERS;
  4. ; ALL MARIA REGISTERS;
  5. ; ALL 6532 TIMERS AND PORTS;
  6. ; ALL OF THE VARIABLES USED;
  7. ; ALL OF THE SYMBOLIC CONSTANTS USED.
  8. ; USED BY "WALLDRAW.S":
  9. GLBL RNDSTA,RNDSTA2,RNDCMP,RNDCMP2
  10. GLBL XDMAON,XDMAOFF
  11. GLBL LISTPTR
  12. GLBL ULCORNER,URCORNER,LLCORNER,LRCORNER,LWALL,RWALL,WHORIZ
  13. GLBL CORNPALW,WALLPALW,SIDEPALW,XRIGHT,XLEFT,TOPWHGH,BOTWHGH
  14. GLBL TEMP3,TEMPY,BLOCK2
  15. GLBL LISTSTRT
  16. GLBL STATUS,NUMFOOD
  17. GLBL MODE,FOODSTUF
  18. GLBL FPRESET,FPSELECT,FPPAUSE
  19. GLBL PSREADY,SELREADY,RESREADY,THREADY
  20. ; USED BY FOODMOVE.A
  21. GLBL THRWTUFF to get it in symbol table
  22. GLBL CHSTAMP,BLOCK1,SYSCOUNT,THRWTIME
  23. GLBL NEXTPILE,LASTPILE,FINFO,FSTATE,NUMEPILE,PILESTRT
  24. GLBL FXPOS,FYPOS,CSPEED,CFRAME,CTYPE,CFLYTIME,CYPOS
  25. GLBL CSINDEX
  26. GLBL CSTATE,FLYING,STATHIT,CDIR,CXPOS,TEMPX
  27. GLBL DEAD,WON,CACOUNT,CSTAMP,CPALW,CINFO,STATBON
  28. GLBL STATDIE,FOODSTRT,NUMINAIR,ALLGONE,SPLAT,HSPLAT
  29. GLBL ANGLE,STICKING,NUMSTUCK
  30. GLBL CXSPEED,CXSPEEDL,CYSPEED,CYSPEEDL
  31. GLBL CXPOSL,CYPOSL
  32. GLBL TEMP2,TEMP4,TEMP5,TEMP6
  33. GLBL STATEND,STATENDR
  34. ; USED BY FOODHIT.A
  35. GLBL FALLING,YCENTER,TEMP0
  36. GLBL CREATOR,DYCHAR,DXCHAR
  37. GLBL TEMP1,CARRYING,HELDFOOD,RETREAT,LEAVING,RLEAVING
  38. GLBL NUMCHHIT,NUMFALL
  39. GLBL LASTCHEF
  40. ; USED BY SOUND.A
  41. GLBL TBASE,TBASEH,VBASE,VBASEH,CBASE,CBASEH
  42. GLBL VOLTABL,FREQTABL
  43. GLBL DCH0,DCH1,TUNNUM,TUNNUM1,TINDEX0,TINDEX1,CINDEX0
  44. GLBL VINDEX0,VINDEX1,MPTRL,MPTRH,TUNTEMP
  45. GLBL AUDV0,AUDV1,STATATTR,AUDF0,AUDC0
  46. GLBL IRTNDONE
  47. ; USED BY HOLEHIT.A
  48. GLBL NUMHOLES,DYHOLE,DXHOLE,FSPEED,RUNNING
  49. GLBL FEETRISE,FEETFALL,STATDIEH,CSECOND,HATHITE,HEADHITE,REJOYING
  50. GLBL CHEFSTRT,PL0LIVES,PLLIVES
  51. GLBL HOLEUSED
  52. ; CONEHIT.A
  53. GLBL XCLOSE,STATWON,PL0CARRY,P1C3
  54. GLBL CARRIED
  55. GLBL DXHERO,DYHERO
  56. ; CHEFHIT.A
  57. GLBL GOALX,GOALY,NULLCHAR,FRAMECNT
  58. GLBL IRCHTIME,IRDXHERO,IRDYHERO
  59. ; INPUT.S
  60. GLBL TRUE,FALSE
  61. GLBL SWCHA,SWCHB,INPT4
  62. GLBL THROWBUT,JOYDIR
  63. GLBL OLDDIR,STATPLAY
  64. GLBL CYCLEIDX,THROWIDX,IRDIRA,IRDIRB,IRTHROW,IRCCNT
  65. GLBL IRDIRC,IRDIRD
  66. GLBL CYCLECNT
  67. GLBL STATCOMB
  68. ; MAIN.S
  69. GLBL GAMECNT
  70. GLBL INTIM,CTLSWA,CTLSWB,HIGHSCOR,M160X2,CTRL,MSTAT
  71. GLBL MNODMA
  72. GLBL M2BYTE
  73. GLBL STATINIT,STATWAIT,PL0RACK,PL1RACK
  74. GLBL PLBANAN
  75. GLBL PL0FIRST,PL1FIRST,PLFIRST
  76. GLBL PL0IRTIM,PL1IRTIM
  77. GLBL PL1LIVES,PL0SCORE,PL1SCORE,PL1CARRY
  78. GLBL PL0BONUS,PL1BONUS
  79. GLBL PL0BCD,PL1BCD
  80. GLBL PLRACK,PLCARRY,PLBCD
  81. GLBL RANDOM0,RANDOM1,RANDOM2,CMAP1,SCORELST,CMAPHIGH
  82. GLBL RANDSEED,RANDJ,RANDK
  83. GLBL CMAP2,CLOWMAP1,CLOWMAP2,STATLIST,CHARBASE,NULL2
  84. GLBL TXTLIST1,TXTLIST2,TXTLIST3
  85. GLBL BACKCOLR,BACKGRND,P0C1,STATLOGO,P1C1,P1C2
  86. GLBL COLORS
  87. GLBL P5C1,P5C2,P5C3
  88. GLBL DLIST0,DLIST1,DLIST2,DLIST3,DLIST4,DLIST5,DLIST6
  89. GLBL DLIST7,DLIST8,DLIST9,DLIST10
  90. GLBL DLISTA,DLISTB
  91. GLBL DLLRAM,DPPL,DPPH,DLIADR,P0C2,M320X1
  92. GLBL P0C3
  93. GLBL STATREPL
  94. GLBL STHEADCH
  95. GLBL DOITOVER
  96. GLBL HTHROW,HJOYDIR
  97. GLBL OTHER,CURRENT,PLAYNUM,PLMESS
  98. GLBL HOWHARD,HIGHEST,OLDHIGH
  99. GLBL WAITCNT
  100. GLBL DRIPTIME
  101. GLBL RUNLOAD,OLDFCNT
  102. GLBL WSYNC
  103. GLBL OFFSET
  104. ; FOR GOD.S
  105. GLBL MGAME,MLOGO,MATTRACT,MHISCORE,MENDGAME,MENTER,MPAUSE
  106. GLBL NUMCYCLE,MAXCYCLE
  107. GLBL MBLANK,MSELECT
  108. ; FOR TEXT.S
  109. GLBL LISTSIZE,LISTPTRA
  110. GLBL MTEXT
  111. GLBL HSCRAM
  112. ; FOR ATTRACT.S
  113. GLBL AIRDIRA,AIRDIRB,AIRDIRC,AIRDIRD,AIRTHROW
  114. GLBL ASET
  115. * TIA REGISTERS
  116. INPT4 EQU $0C ;BUTTONS
  117. INPT5 EQU $0D
  118. AUDC0 EQU $15 ;BITS 3210 AUDIO CONTROL 0
  119. AUDC1 EQU $16 ;BITS 3210 AUDIO CONTROL 1
  120. AUDF0 EQU $17 ;BITS 3210 AUDIO FREQUENCY 0
  121. AUDF1 EQU $18 ;BITS 3210 AUDIO FREQUENCY 1
  122. AUDV0 EQU $19 ;BITS 3210 AUDIO VOLUME 0
  123. AUDV1 EQU $1A ;BITS 3210 AUDIO VOLUME 1
  124. * MARIA REGISTERS
  125. ORG $20
  126. BACKGRND EQU $20 ;BACKGROUND COLOR RW
  127. P0C1 EQU $21 ;PALETTE ZERO COLOR ONE RW
  128. P0C2 EQU $22 ;PALETTE ZERO COLOR TWO RW
  129. P0C3 EQU $23 ;PALETTE ZERO COLOR THREE RW
  130. WSYNC EQU $24 ;FAST MARIA WSYNC STROBE
  131. P1C1 EQU $25 ;PALETTE ONE COLOR ONE RW
  132. P1C2 EQU $26 ;PALETTE ONE COLOR TWO RW
  133. P1C3 EQU $27 ;PALETTE ONE COLOR THREE RW
  134. MSTAT EQU $28 ;BIT 6 IN VBLANK, BIT ? IN DISPLAY RO
  135. P2C1 EQU $29 ;PALETTE TWO COLOR ONE RW
  136. P2C2 EQU $2A ;PALETTE TWO COLOR TWO RW
  137. P2C3 EQU $2B ;PALETTE TWO COLOR THREE RW
  138. DPPH EQU $2C ;DISPLAY LIST LIST POINTER HIGH WO
  139. P3C1 EQU $2D ;PALETTE THREE COLOR ONE RW
  140. P3C2 EQU $2E ;PALETTE THREE COLOR TWO RW
  141. P3C3 EQU $2F ;PALETTE THREE COLOR THREE RW
  142. DPPL EQU $30 ;DISPLAY LIST LIST POINTER LOW WO
  143. P4C1 EQU $31 ;PALETTE FOUR COLOR ONE RW
  144. P4C2 EQU $32 ;PALETTE FOUR COLOR TWO RW
  145. P4C3 EQU $33 ;PALETTE FOUR COLOR THREE RW
  146. CHARBASE EQU $34 :CHARACTER MODE HIGH POINTER WO
  147. P5C1 EQU $35 ;PALETTE FIVE COLOR ONE RW
  148. P5C2 EQU $36 ;PALETTE FIVE COLOR TWO RW
  149. P5C3 EQU $37 ;PALETTE FIVE COLOR THREE RW
  150. OFFSET EQU $38 ;OLD-- STORE ZERO HERE ALWAYS RW
  151. P6C1 EQU $39 ;PALETTE SIX COLOR ONE RW
  152. P6C2 EQU $3A ;PALETTE SIX COLOR TWO RW
  153. P6C3 EQU $3B ;PALETTE SIX COLOR THREE RW
  154. CTRL EQU $3C ;?????? ;BIT 7 CHARACTER WIDTH,BIT 6 BCNT WO
  155. P7C1 EQU $3D ;PALETTE SEVEN COLOR ONE RW
  156. P7C2 EQU $3E ;PALETTE SEVEN COLOR TWO RW
  157. P7C3 EQU $3F ;PALETTE SEVEN COLOR THREE RW
  158. * 6532 TIMERS AND PORTS
  159. SWCHA EQU $280 ;PO, P1 JOYSTICKS
  160. ; BIT 7 PLAYER 0 EAST IF CLEAR
  161. ; BIT 6 WEST
  162. ; BIT 5 SOUTH
  163. ; BIT 4 NORTH
  164. ; BIT 3 PLAYER 1 EAST IF CLEAR
  165. ; BIT 2 WEST
  166. ; BIT 1 SOUTH
  167. ; BIT 0 NORTH
  168. SWCHB EQU $282 ;CONSOLE SWITCHES
  169. ; BIT 7 PLAYER 1 DIFFICULTY A IF SET B IF CLEAR
  170. ; BIT 6 PLAYER 0 DIFFICULTY A IF SET B IF CLEAR
  171. ; BIT 3 BLACK & WHITE/COLOR COLOR WHEN SET
  172. ; BIT 1 GAME SELECT CLEAR WHEN PRESSED
  173. ; BIT 0 GAME RESET CLEAR WHEN PRESSED
  174. CTLSWA EQU $281
  175. CTLSWB EQU $283
  176. INTIM EQU $284 ;INTERVAL TIMER IN
  177. TIM8T EQU $295 ;TIMER 8T WRITE OUT
  178. TIM64T EQU $296 ;TIMER 64T WRITE OUT
  179. TIM64TI EQU $29E ;INTERUPT TIMER 64T
  180. ********************************************************************************
  181. * ZERO PAGE RAM 40-FF *
  182. * 93 BYTES CURRENTLY STORED HERE ! *
  183. ********************************************************************************
  184. NUMZONES EQU 11
  185. ORG $40
  186. DLIADR EQU $40 ; JMP INDIRECT FROM NMI VECTOR
  187. LISTPTR EQU $42 ; USED IN LOADER AS A DLIST POINTER
  188. LISTPTRA EQU $44
  189. LISTSIZE EQU $46 ; MUST BE IN ZERO PAGE, SO THAT
  190. ; "STY LISTSIZE,X" WORKS
  191. LISTSTRT EQU LISTSIZE+NUMZONES ; BEGINNING OF MOVING CHAR INFO
  192. TEMP0 EQU $5C
  193. TEMP1 EQU TEMP0+1
  194. TEMP2 EQU TEMP0+2
  195. TEMP3 EQU TEMP0+3
  196. TEMP4 EQU TEMP0+4
  197. TEMP5 EQU TEMP0+5
  198. TEMP6 EQU TEMP0+6
  199. KTEMP0 EQU TEMP0+7 ; USED FOR SOUND DRIVER
  200. KTEMP1 EQU TEMP0+8
  201. RANDOM0 EQU $65 ; THESE ARE USED BY RANDOM ROUTINES
  202. RANDOM1 EQU RANDOM0+1
  203. RANDOM2 EQU RANDOM0+2
  204. TEMPX EQU $68 ; USED FOR INDEX REGISTERS
  205. TEMPY EQU TEMPX+1
  206. LTEMPY EQU $6A ; FOR THE LOADER
  207. LSECOND EQU LTEMPY+1 ; USED FOR OVERLAP TEST
  208. TEMPYPOS EQU LTEMPY+2 ; ALSO FOR THE LOADER
  209. HIGHPOS EQU LTEMPY+3 ; USED BY THE LOADER FOR HIGH BYTE
  210. RTEMPX EQU $6E
  211. RTEMPY EQU RTEMPX+1 ; FOR RANDOM ROUTINES
  212. RTEMP0 EQU HIGHPOS+3
  213. RTEMP1 EQU HIGHPOS+4
  214. HEADER0 EQU $72 ; LOADER : TEMP STORAGE FOR HEADER
  215. HEADER1 EQU HEADER0+1 ; BYTES
  216. HEADER2 EQU HEADER0+2
  217. HEADER3 EQU HEADER0+3
  218. FRAMECNT EQU $76 ; ONE PER VBLANK
  219. OLDFCNT EQU FRAMECNT+1
  220. CYCLECNT EQU FRAMECNT+2 ; ONE PER GAMEPLAY CYCLE
  221. NUMCYCLE EQU FRAMECNT+3
  222. MAXCYCLE EQU FRAMECNT+4
  223. SYSCOUNT EQU FRAMECNT+5
  224. STATUS EQU FRAMECNT+7
  225. MODE EQU FRAMECNT+8
  226. ; 63 BYTES UP TO THIS POINT.
  227. ; NOTE "TOTALCH" WAS EQU $20 AND "TOTALCHR" DID NOT EXIST.
  228. TOTALCH EQU $20 ; 32 MOVING CHARS (ROB 6.14.84)
  229. TOTALCHR EQU $20 ; 32 OBJECTS RESERVED (ROB 6.14.84)
  230. TOTALFX EQU $1B ; 27 FIXED OBJECTS PER SCREEN
  231. CSTATE EQU $7F ; 32 BYTES EACH
  232. CYPOS EQU CSTATE+TOTALCHR
  233. CXPOS EQU CYPOS+TOTALCHR
  234. ; 159 BYTES UP TO THIS POINT
  235. PLAYNUM EQU $DF ; TRUE IF TWO-PLAYER
  236. CURRENT EQU $E0 ; TELLS WHICH PLAYER
  237. RUNLOAD EQU $E1 ; WHETHER TO RUN LOADER OR NOT
  238. GODPTR EQU $E2 two bytes
  239. ; added late-- Jan. 30, 1984
  240. GAMECNT EQU $E4
  241. WAITCNT EQU $E5
  242. OTHER EQU $E6
  243. HOWHARD EQU $E7
  244. HIGHEST EQU $E8 two bytes
  245. PLRACK EQU $EA
  246. PLCARRY EQU $EB
  247. PLLIVES EQU $EC
  248. PLBCD EQU $ED two bytes
  249. PSREADY EQU $EF
  250. RESREADY EQU $F0
  251. SELREADY EQU $F1
  252. THREADY EQU $F2 ; USED BY "SELECT"
  253. GOALX EQU $F3
  254. GOALY EQU $F4
  255. CYCLEIDX EQU $F5 ; AT RACK START, EQUALS 0
  256. THROWIDX EQU $F7
  257. THROWBUT EQU $F8 ; FOR PURPOSE OF GAMEPLAY
  258. JOYDIR EQU $F9
  259. HJOYDIR EQU $FA ; CONTROLLER STATUS
  260. HTHROW EQU $FB
  261. DOITOVER EQU $FC
  262. FPRESET EQU $FD
  263. FPSELECT EQU $FE
  264. FPPAUSE EQU $FF
  265. ********************************************************************************
  266. * *
  267. * FIRST PAGE RAM-- 140--1FF *
  268. * THE STACK STARTS AT 1FF *
  269. *
  270. ********************************************************************************
  271. ORG $140
  272. ; END OF PAGE 1 RAM
  273. ********************************************************************************
  274. ; RAM-- 1800 TO 2800
  275. ; SOME OF THIS RAM IS SHADOWED ELSEWHERE:
  276. ; 2040-20FF IS A SHADOW OF 40-FF
  277. ; 2140-21FF IS A SHADOW OF 140-1FF
  278. ********************************************************************************
  279. ; SINCE THE LARGEST CONTIGUOUS BLOCK OF RAM IS 1800-2000 (2K),
  280. ; PLACE ALL DISPLAY LISTS AND INSTANT REPLAY ARRAYS HERE.
  281. ORG $1800
  282. ; DISPLAY LISTS FIRST-- REQUIRES 1261 BYTES, 1800-1CED
  283. DLSIZE EQU $72 ; ENOUGH FOR 20 HEADERS + EOL
  284. SCORESIZ EQU $11 ; ENOUGH FOR 3 HEADERS + 2
  285. STATSIZE EQU $0C ; 2 HEADERS + 2
  286. BLOCK1 EQU $A0 ; FIRST 16 PAGES
  287. BLOCK2 EQU $E0 ; NEXT 16 PAGES
  288. STAMPHGH EQU $A0 ; OLD CONSTANT FOR FIRST 16 PAGES
  289. ; DISPLAY LISTS TAKE UP A TOTAL OF (11) * (114) + 7 = 1261 BYTES
  290. ; ALSO USE THIS AREA FOR THE HIGH SCORE TABLES; MAKE SURE
  291. ; THAT THE 2 PAGES (512 BYTES) DON'T EXTEND INTO DLIST8 AND DLIST9
  292. HSCRAM
  293. DLIST0 DS DLSIZE
  294. DLIST1 DS DLSIZE
  295. DLIST2 DS DLSIZE
  296. DLIST3 DS DLSIZE
  297. DLIST4 DS DLSIZE
  298. DLIST5 DS DLSIZE+5 ; IN CASE OF TEXT
  299. DLIST6 DS DLSIZE+5
  300. DLIST7 DS DLSIZE+5
  301. DLIST8 DS DLSIZE
  302. DLIST9 DS DLSIZE
  303. DLIST10 DS DLSIZE
  304. DLISTA DS 5 ; SETS WRITE MODE
  305. DLISTB DS 2 ; NULL DLIST
  306. ********************************************************************************
  307. * ORG $1CED ; FIRST RAM AFTER DLISTS
  308. *
  309. * (PLACE INSTANT REPLAY TABLES HERE)
  310. ********************************************************************************
  311. ; INSTANT REPLAY TABLES-- (1CE6-1F7A)
  312. IRCCNT DS 1 ; "FRAMECNT" VALUE AT RACK START
  313. IRAND0 DS 1 ; VALUES AT RACK START
  314. IRAND1 DS 1
  315. IRCARRY DS 1 ; TELLS IF HE WAS CARRYING
  316. AIRCCNT DS 1 values for the awesome IR
  317. AIRAND0 DS 1
  318. AIRAND1 DS 1
  319. AIRCARRY DS 1
  320. AIRLEVEL DS 1 tells which level this was
  321. AIRBCD DS 1
  322. IRTNDONE DS 1
  323. ; Note: these were changed 1/24/84 to reflect half the old polling rate.
  324. ; It's now once every 4 cycles, rather than every 2.
  325. IRDIRA DS $40 ; 128 EACH = 8 SECONDS
  326. IRDIRB DS $40
  327. IRDIRC DS $40
  328. IRDIRD DS $40
  329. IRTHROW DS $40
  330. IRCHTIME DS 2 ; HOW LONG NEAR CHEFS ?
  331. AIRDIRA DS $40 last instant replay gets stored here
  332. AIRDIRB DS $40 for attract mode
  333. AIRDIRC DS $40
  334. AIRDIRD DS $40
  335. AIRTHROW DS $40
  336. ASET DS 1 flag will be set if A tables set
  337. ; AFTER INSTANT REPLAY TABLES:
  338. ; SHOULD BE $1F7C
  339. DLLRAM DS 57 ; ENOUGH ROOM FOR 19 ENTRIES
  340. COLORS DS 31 need 4*7 + 3
  341. ; FREE SPACE SHOULD BE AT $1Fcd
  342. ********************************************************************************
  343. * 2200-27FF
  344. * LAST LARGE BLOCK OF MEMORY
  345. * 863 BYTES CURRENTLY STORED HERE (2200-255F)
  346. *
  347. ********************************************************************************
  348. ORG $2200
  349. SCORELST DS SCORESIZ ; TABLE FOR SCORE INFO
  350. STATLIST DS STATSIZE ; TABLE FOR LEVEL AND LIVES REMAINING
  351. TXTLIST1 DS 14 ; NUMBER OF LETTERS EACH
  352. TXTLIST2 DS 15 ; "INSTANT REPLAY"-- LONGEST STRING
  353. TXTLIST3 DS 14 ; "LET'S SEE THAT"
  354. CMAP1 DS $08 ; PLAYER 1 SCORE
  355. CMAP2 DS $08 ; PLAYER 2 SCORE
  356. CMAPHIGH DS $08 ; HIGH SCORE
  357. CLOWMAP1 DS $11 ; CHUCKS REMAINING (ROOM FOR 6)
  358. ; 5X3 + 2
  359. CLOWMAP2 DS $12 ; 18 (LEVEL NNN = 9 CHARACTERS)
  360. ;MOVING CHARACER INFORMATION
  361. NUMFOOD EQU $10 ; CHANGED FROM $10 -ROB 6-13-84
  362. ; ALL MOVING CHARACTERS HAVE THEIR INFO STORED HERE. THERE ARE TABLES FOR:
  363. ; STATE (CSTATE): STATUS INFORMATION FOR A CHARACTER;
  364. ; NOTE-- CSTATE, CYPOS, CXPOS ARE ALL IN ZERO PAGE
  365. ; STAMP CHARACTER (CSTAMP): A POINTER TO THE ROM TABLE FOR THE CHAR;
  366. ; PALETTE/WIDTH (CPALW): 2ND BYTE OF THE HEADER (3 BIT PALETTE);
  367. ; COORDINATES (CXPOS, CYPOS): POSITION ON THE SCREEN, GIVEN AN
  368. ; ORIGIN IN THE LOWER LEFT CORNER.
  369. ; CURRENTLY, THE CHARACTERS ARE STORED:
  370. ; 0-2: HERO STAMPS
  371. ; 3-14: CHEF STAMPS
  372. ; 15-31: FLYING FOODS
  373. ; 32: CONE DROPLET
  374. CPALW DS TOTALCHR
  375. CXPOSL DS TOTALCHR
  376. CYPOSL DS TOTALCHR
  377. CSTAMP DS TOTALCHR
  378. CHSTAMP DS TOTALCHR
  379. CSECOND DS TOTALCHR ; USED BY LOADER TO DECIDE ON 2ND HALF
  380. CINFO DS TOTALCHR
  381. CTYPE DS TOTALCHR
  382. CDIR DS TOTALCHR
  383. CYSPEED DS TOTALCHR
  384. CYSPEEDL DS TOTALCHR
  385. CXSPEED DS TOTALCHR
  386. CXSPEEDL DS TOTALCHR
  387. CSINDEX DS TOTALCHR ; TELLS THE OVERALL SPEED GRADATION
  388. CFRAME DS TOTALCHR ; TELLS HOW SOON WE MOVE AND ANIMATE
  389. CSPEED DS TOTALCHR ; VALUE TO RESET "CFRAME" WITH
  390. CACOUNT DS TOTALCHR ; ANIMATE FRAME COUNTER
  391. HOLEUSED
  392. CFLYTIME DS TOTALCHR
  393. CREATOR DS TOTALCHR ; NOT NEEDED WHEN FOOD IS ANGLED
  394. THRWTIME DS $0E ; DEBOUNCING FOR THE THROW BUTTON
  395. ; AS WELL AS COUNTERS FOR THE CHEFS
  396. HELDFOOD DS $0D ; TELLS WHICH FOOD IS BEING CARRIED
  397. OLDDIR DS $0D ; COMPARE WITH NEW DIRECTION TO SEE
  398. ; IF SPEED DELTAS SHOULD CHANGE
  399. MOODTUFF DS 1
  400. THRWTUFF DS 2
  401. ; FIXED CHARACTERS
  402. ; THE FOLLOWING TABLES CONTAIN INFORMATION FOR CHARACTERS WHICH DON'T MOVE:
  403. ; FOOD PILES, MANHOLES, AND THE ICE CREAM CONE. THIS INFORMATION
  404. ; IS IN A SEPARATE TABLE FROM THE MOVING INFO TO MAKE THE LOADER
  405. ; MUCH QUICKER.
  406. ; THE MAXIMUMS ARE: 10 PILES, 8 MANHOLES, 1 CONE. THE BANANAS AND TOMATOES
  407. ; CAN TAKE 2 ENTRIES FOR ONE PILE, FOR A WORST CASE OF 20 ENTRIES.
  408. ;
  409. ; NOTE-- FSTATE IS NOW IN ZERO PAGE
  410. FSTAMP DS TOTALFX
  411. FHSTAMP DS TOTALFX
  412. FPALW DS TOTALFX
  413. FCENTER DS TOTALFX
  414. FDX DS TOTALFX
  415. FYCENTER DS TOTALFX
  416. FDY DS TOTALFX
  417. FXPOSH DS 1 ; FOR HERO
  418. FXPOS DS TOTALFX
  419. FYPOSH DS 1
  420. FYPOS DS TOTALFX
  421. FSTATE DS TOTALFX
  422. FINFO DS TOTALFX ; TOP BIT IS FLAG FOR DOUBLE PILE
  423. FDLPOS DS TOTALFX ; TELLS WHERE IN THE DLIST THIS IS
  424. DRIPTIME DS 1 ; COUNTER FOR DRIP ANIMATION
  425. DRIPFRAM DS 1
  426. ; LOCATIONS NEEDED BY THE SOUND DRIVER:
  427. DCH0 DS 1 ONE BYTE--DURATION CNTR CHAN. 0
  428. DCH1 DS 1 ONE BYTE--DURATION CNTR CHAN. 1
  429. TUNNUM DS 1 ONE BYTE--TUNE NUM FOR CHAN. 0
  430. TUNNUM1 DS 1 ONE BYTE--TUNE NUM FOR CHAN. 1
  431. TINDEX0 DS 1 ONE BYTE--NOTE POINTER 0
  432. TINDEX1 DS 1 ONE BYTE--NOTE POINTER 1
  433. CINDEX0 DS 1 CONTROL INDEX
  434. CINDEX1 DS 1
  435. VINDEX0 DS 1 VOLUME INDEX
  436. VINDEX1 DS 1
  437. MPTRL EQU KTEMP0 ZERO PAGE TEMP(NOT GAMEPLAY)
  438. MPTRH EQU KTEMP1 ZERO PAGE TEMP(NOT GAMEPLAY)
  439. TUNTEMP EQU TEMP4
  440. ; addresses up to this point should be $2660
  441. ;THIS WAS IN FIRST PAGE BUT MOVED BY MGF ON 6/1/84 TO MAKE SURE
  442. ;THAT THE STACK NEVER GETS DOWN HERE. GRASPING AT STRAWS, HUH??
  443. NUMCHHIT DS 1 ; NUMBER OF CHEFS HIT DURING RACK
  444. HOLENUM DS 1 ; NUMBER OF HOLES THIS LEVEL
  445. STEMPX DS 1 ; FOR SCORE ROUTINES
  446. STEMPY DS 1
  447. INDEX DS 1 ; USED AS MAXIMUM INDEX IN LOOPS
  448. PL0SCORE DS 4
  449. PL1SCORE DS 4
  450. PL0BONUS DS 4
  451. PL1BONUS DS 4
  452. PL0RACK DS 1
  453. PL1RACK DS 1
  454. PLBANAN DS 1 ; USED TO SLOW BANANA ANIMATION AFTER
  455. ; LEVEL 17. <ROB 6.18.84>
  456. PL0LIVES DS 1
  457. PL1LIVES DS 1
  458. PL0CARRY DS 1
  459. PL1CARRY DS 1
  460. PL0BCD DS 2
  461. PL1BCD DS 2
  462. PL0FIRST DS 1
  463. PL1FIRST DS 1
  464. PL0IRTIM DS 1
  465. PL1IRTIM DS 1
  466. PLFIRST DS 1
  467. PLMESS DS 1
  468. NUMSTUCK DS 1
  469. NUMINAIR DS 1
  470. ALLGONE DS 1
  471. HIGHSCOR DS 4
  472. NUMFALL DS 1 ; NUMBER OF CHEFS FALLEN
  473. LASTCHEF DS 1 ; LAST CHEF TO HAVE FALLEN
  474. FOODSTUF DS 1
  475. NEXTPILE DS 1
  476. LASTPILE DS 1
  477. ; RESERVE LOCATIONS FF80-FFF7 FOR THE ENCRYPTION ALGORITHM:
  478. ORG $FF80
  479. DS $77 ; FF80+77=FFF7
  480. ****************** CONSTANTS ***************************************************
  481. MGAME EQU $00
  482. MLOGO EQU $01
  483. MATTRACT EQU $02
  484. MHISCORE EQU $03
  485. MENDGAME EQU $04
  486. MENTER EQU $05
  487. MPAUSE EQU $06
  488. MBLANK EQU $08
  489. MTEXT EQU $09
  490. MSELECT EQU $0A
  491. TRUE EQU $FF
  492. FALSE EQU $00
  493. M160X2 EQU $40 ; 160 X 2
  494. M320X1 EQU $43 ; 320 X 1, 1 BYTE CHARS
  495. M2BYTE EQU $50 ; 2 BYTE CHARACTERS
  496. MNODMA EQU $60 ; TURN OFF DMA
  497. CTRLOFF EQU $60
  498. STATINIT EQU $00 ; WHILE CHEFS ARE RISING
  499. STATWAIT EQU $01 ; CHEFS WAITING AFTER RISE
  500. STATPLAY EQU $02 ; DURING GAMEPLAY
  501. STATWON EQU $03 ; HERO EATING CONE; CHEFS RUNNING AWAY
  502. STATBON EQU $04
  503. STATDIEH EQU $05 ; FALLING THROUGH HOLE
  504. STATDIE EQU $06 ; HERO JUST DIED; REJOICING CHEFS
  505. STATDIEC EQU $07 ; DEATH FROM CONE
  506. STATHIT EQU $08 ; WHILE FOOD IS HITTING HERO
  507. STATLOGO EQU $10 ; WHILE LOGO IS DISPLAYED
  508. STATATTR EQU $11
  509. STATREPL EQU $12 ; INSTANT REPLAY
  510. STATEND EQU $13
  511. STATENDR EQU $14
  512. STATCOMB EQU $15
  513. DLISTCH EQU $1C ; MAXIMUM HEADERS PER DLIST (28)
  514. LISTLENG EQU $70 ; VALUE OF LISTSIZE IF FULL
  515. XMAX EQU $9D ; MAXIMUM X COORDINATE
  516. XMIN EQU $05 ; MINIMUM X COORDINATE
  517. YMAX EQU $AC ; MAXIMUM Y COORDINATE
  518. YMIN EQU $05 ; MINIMUM Y COORDINATE
  519. XLEFT EQU $00
  520. XRIGHT EQU $A0
  521. TOPTHIRD EQU 124 ; USED BY HWIN ROUTINE TO MAKE CHEFS
  522. BOTTHIRD EQU 66 ; RUN AWAY IN THE RIGHT DIRECTION
  523. BACKCOLR EQU $00
  524. ; CONSTANTS USED TO HANDLE THE MANHOLE FALLING AND RISING SEQUENCES:
  525. FSPEED EQU $2 ; FALL ONE PIXEL EVERY 8*2 CYCLES
  526. RZSPEED EQU $4 ; RISE HALF AS FAST
  527. ;CHUCK:
  528. CFEETTOP EQU $10 ; 16 HIGH, FOR NOW ANYWAY
  529. CFTXTRA EQU $08 ; 16-FEET HEIGHT
  530. CHDXTRA EQU $00 ; HEAD IS 16 HIGH
  531. CFTHITE EQU $08
  532. CHDHITE EQU $10
  533. CHEADEND EQU $01
  534. CFEETEND EQU $11 ; CFRAME VALUE TO ERASE FEET
  535. CFALLCNT EQU $17 ; HEAD HITE + FEET HITE
  536. SMILECH EQU $2D
  537. ; CHEFS:
  538. FTTOP EQU $0F ; 10 + 5 (HAT + HEAD HEIGHT)
  539. HDTOP EQU $0A ; HAT HEIGHT
  540. FEETXTRA EQU $0C ; 16 - FEET HEIGHT
  541. HEADXTRA EQU $0B ; 16 - HEAD HEIGHT
  542. FEETEND EQU $12 ; IFALLFRM - FEET HEIGHT
  543. HEADEND EQU $0D ; FTEND - HEAD HEIGHT
  544. FEETHITE EQU $04
  545. HEADHITE EQU $05
  546. HATHITE EQU $0A
  547. HATXTRA EQU $06 ; EXTRA FOR HAT; 16 - HAT HEIGHT
  548. ; FALLING AND RISING STATES:
  549. FALLING EQU $09
  550. FEETFALL EQU $09
  551. HEADFALL EQU $0A
  552. HATFALL EQU $0B
  553. HATRISE EQU $0C
  554. HEADRISE EQU $0D
  555. FEETRISE EQU $0E
  556. ; THESE CONSTANTS TELL WHERE IN THE MOVING AND FIXED CHARACTER TABLES
  557. ; EACH CHARACTER TYPE BEGINS. THEY'RE NECESSARY FOR THE DRIVERS:
  558. ;MOVING CHARACTERS:
  559. HEROSTRT EQU $00
  560. CHEFSTRT EQU $03 ; FIRST THREE ARE HERO CHARACTERS
  561. FOODSTRT EQU $0F ; 12 STAMPS FOR THE CHEFS
  562. DRIPSTRT EQU $1F ; LAST MOVING CHARACTER
  563. NUMHERO EQU $02
  564. NUMCHEF EQU $0C ; 3 STAMPS PER CHEF; 4 CHEFS
  565. *NUMFOOD EQU $10 ; ALREADY DEFINED ABOVE
  566. ; FIXED CHARACTERS:
  567. ; NOTE: THESE MUST COME IN THE SAME ORDER WHICH THEY ARE INITIALIZED IN,
  568. ; BECAUSE OF THE NEED TO SET "FDLPOS" AT INITIALIZATION TIME.
  569. CONESTRT EQU $00
  570. PILESTRT EQU $01
  571. HOLESTRT EQU $11 ; 16 FOOD PILES
  572. NUMEPILE EQU $10 ; 16 ENTRIES FOR 8 PILES
  573. NUMPILES EQU $08 ; 8 PILES (ACTUALLY, 16 ENTRIES)
  574. NUMHOLES EQU $0A
  575. NUMCONE EQU $01
  576. ; VALUES FOR THE "STATE" SLOT:
  577. RUNNING EQU $00 ; CARRYING FLAG IS BIT 1
  578. DEAD EQU $01
  579. CARRYING EQU $02
  580. WON EQU $03 ; WHEN THE HERO REACHES THE CONE
  581. DYING EQU $05 ; DEATH ANIMATION
  582. FLYING EQU $07 ; FOR FLYING FOODS
  583. CARRIED EQU $08 ; FOR CARRIED FOODS
  584. ; 9-11 ARE FALLING STATES
  585. SPLAT EQU $0C ; FOOD SPLATTING ON CHARACTER
  586. LEAVING EQU $10
  587. NOTYET EQU $11
  588. ANGLE EQU $12
  589. STICKING EQU $13
  590. RETREAT EQU $14
  591. HSPLAT EQU $15 ; IF FOOD IS HITTING HERO
  592. REJOYING EQU $16
  593. RLEAVING EQU $17 was leaving but becomes rejoicing
  594. ; HOLE STATES
  595. OPEN EQU $01
  596. CLOSED EQU $00
  597. ; FOOD STATES (TRY MAKING THIS VALUE REPRESENT THE NUMBER OF FOODS IN THE PILE)
  598. ACTIVE EQU $01
  599. EMPTY EQU $00
  600. ********** CHARACTER INFORMATION **************************
  601. ; CONSTANTS FOR LOGO DISPLAY:
  602. LOGOTOP1 EQU $5A
  603. LOGOTOP2 EQU $6A
  604. LOGOBOT1 EQU $78
  605. LOGOBOT2 EQU $88
  606. LOGOPW1 EQU $D0 ; PALETTE 6, WIDTH 16 BYTES
  607. LOGOPW2 EQU $D2 ; PALETTE 6, WIDTH 14 BYTES
  608. ; (TOTAL WIDTH OF 30)
  609. ; CHARACTER INFORMATION FOR THE WALLS:
  610. WALLPALW EQU $10 ; PALETTE AND WIDTH OF TOP AND BOTTOM
  611. CORNPALW EQU $1E ; CORNERS ARE 8 BITS WIDE
  612. SIDEPALW EQU $1F ; SIDE WALLS ARE 4 BITS WIDE (1 BYTE)
  613. WHORIZ EQU $A2 ; THESE ARE WALL CHARACTER LOW BYTES
  614. TOPWHGH EQU $D1 ; HIGH BYTE OF TOP WALL
  615. BOTWHGH EQU $E0 ; HIGH BYTE OF BOTTOM WALL
  616. ULCORNER EQU $98 ; THE FOUR CORNERS
  617. URCORNER EQU $9A
  618. LRCORNER EQU $9C
  619. LLCORNER EQU $9E
  620. LWALL EQU $A0 ; THE LEFT AND RIGHT VERTICAL SIDES
  621. RWALL EQU $A1
  622. NUMCHAR EQU $D6 ; 160X2 NUMBERS
  623. ; CHARACTER INFO FOR THE HERO AND CHEFS:
  624. HEROPALW EQU $1E ; PALETTE 0, WIDTH 2 BYTES
  625. ARMPALW EQU $1D ; WIDTH OF 3 BYTES
  626. HEROX EQU $8C ; HERO STARTING X POSITION
  627. SADCHAR EQU $96 ; FACING FORWARD LOOKING SAD
  628. STHEADCH EQU $B2
  629. ; THESE ARE FOR THE 3 CHEF STAMPS' ADJUSTMENT:
  630. HEADTOP EQU $0A ; DISTANCE FROM HAT TO HEAD
  631. FEETTOP EQU $01 ; DISTANCE FROM HEAD TO FEET
  632. ; INFO FOR THE CONE, THE MANHOLES:
  633. XCLOSE EQU $11 ; WHEN HERO'S GETTING CLOSE
  634. CONEX EQU $04 ; CONE X POSITION
  635. SPLASHX EQU $02
  636. DRIPX EQU $03
  637. CONECHAR EQU $00 ; IN BLOCK2
  638. CONEPALW EQU $FE ; PALETTE 7, WIDTH 2 BYTES
  639. SHUTCHAR EQU $B8 ; HOLE CLOSED
  640. OPENCHAR EQU $BB ; HOLE OPEN
  641. HOLEPALW EQU $1D ; PALETTE 0, WIDTH 4 BYTES
  642. ; INFO FOR ALL OF THE PILES:
  643. ; NOTE THAT ALL OF THE CHARACTER INFO IS STORED
  644. ; IN TABLES AT THE END OF "MAIN.S", FOR PILE SIZES 8 THROUGH 1.
  645. BANTYPE EQU $00
  646. PEATYPE EQU $01
  647. PIETYPE EQU $02
  648. TOMTYPE EQU $03
  649. WATTYPE EQU $04
  650. PEAFLYPW EQU $7E ; FLYING PEAS ALL THE SAME WIDTH
  651. ; BANANAS:
  652. B12PALW EQU $BE ; PALETTE 5, WIDTH 2
  653. B34PALW EQU $BC ; WIDTH 4
  654. ; PEAS:
  655. P84PALW EQU $7D ; PALETTE 3, WIDTH 3
  656. P31PALW EQU $7E ; WIDTH 2
  657. ; PIES:
  658. PIEPALW EQU $5C ; PALETTE 2, WIDTH 4
  659. ; TOMATOES:
  660. TOMPALW EQU $9D ; PALETTE 4, WIDTH 3
  661. ; WATERMELON
  662. WATPALW EQU $DD ; PALETTE 6, WIDTH 3
  663. WATCHAR EQU $78
  664. SLICECH EQU $F4
  665. SLICEPW EQU $DE
  666. ; NULL CHARACTERS
  667. NULLCHAR EQU $BE ; FOR BLOCK1
  668. NULL2 EQU $2F ; FOR BLOCK2
  669. ; DELTA VALUES FOR ALL THE CHARACTERS:
  670. DXHERO EQU $02
  671. DYHERO EQU $0A
  672. DXHCHEF EQU $02
  673. DYHCHEF EQU $06
  674. DXFCHEF EQU $04
  675. DYFCHEF EQU $08
  676. DXCONE EQU $03
  677. DYCONE EQU $07
  678. DXHOLE EQU $03
  679. DYHOLE EQU $02
  680. YCENTER EQU $0A ; CHARCENTER - FOODCENTER
  681. DXFOOD EQU $03
  682. DYFOOD EQU $03
  683. DXCHAR EQU $04 ; GENERIC DELTAS FOR USE BY "PILEHIT"
  684. DYCHAR EQU $08
  685. DXCLOSE EQU $10 ; FOR INITIALIZATION
  686. DYCLOSE EQU $10 just more than the next zone
  687. IRDXHERO EQU 15 ; IF CHEFS ARE THIS NEAR, COUNT FOR
  688. IRDYHERO EQU 22 ; REPLAY
  689. DOIRLOW EQU 30 ; GIVE HIM A REPLAY