ICEMELT.S 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ; ICEMELT.S
  2. ; THIS ROUTINE HANDLES THE ICE CREAM CONE DRIPPING. WHEN THE VALUE
  3. ; IN "FINFO" REACHES 0, IT'S TIME FOR ANOTHER DRIP.
  4. ; AT THIS POINT I DECREMENT "FSTATE", WHICH IS ESSENTIALLY
  5. ; A FRAME COUNTER. WHEN "FSTATE" REACHES 0, THE CONE HAS
  6. ; COMPLETELY MELTED AND I SHOULD INITIATE THE HERO-CONE-TIME-OUT
  7. ; SEQUENCE.
  8. ; THE COUNTER "FINFO" IS DECREMENTED IN THE KERNEL,
  9. ; TO ENSURE ONLY ONE DECREMENT EVERY 30TH OF A SECOND.
  10. GLBL HEROKILL ; IN "CHEFHIT.S"
  11. GLBL ICEMELT
  12. ; This routine has been placed here so that I can branch to it from the
  13. ; beginning of ICEMELT, rather than having to JUMP.
  14. ; ROUTINE JUMPS HERE IF RACK IS ENDING VIA CHUCK DYING
  15. CFLASH LDA FINFO
  16. BNE IMBYE
  17. ZCF00 LDA #10
  18. STA FINFO
  19. INC FSTATE ; LOW BIT TELLS WHETHER FLASH OR NOT
  20. LDA FDLPOS ; FIND OUT WHERE TO PUT THE STAMP
  21. AND #$F
  22. TAX
  23. LDA LISTTABL,X
  24. STA LISTPTRA
  25. LDA LISTTABH,X
  26. STA LISTPTRA+1
  27. LDA FDLPOS
  28. AND #$F0
  29. LSR A
  30. LSR A
  31. TAY ; INDEX FOR DLIST IS NOW IN Y
  32. LDA FSTATE ; FIND OUT WHICH STAMP
  33. LSR A
  34. BCC ZFLSH002
  35. ZFLSH001 LDA ICECHAR ; FLASH STAMP
  36. BNE ZFLSH003 a jump
  37. ZFLSH002 LDA ICECHAR+1 ; EMPTY CONE
  38. ZFLSH003 STA (LISTPTRA),Y ; CHANGE LOW BYTE OF STAMP
  39. IMBYE RTS
  40. *****************************************
  41. ICEMELT
  42. LDA STATUS
  43. CMP #STATDIEC ; IF CONE IS FLASHING
  44. BEQ CFLASH
  45. IMCONT00 CMP #STATDIEH ; if he's dying (except for STATDIEC)
  46. BPL IMBYE ; don't continue
  47. IMCONT10 CMP #STATHIT
  48. BEQ IMBYE
  49. IMCONT01 CMP #STATBON ; IF FOOD IS HITTING SCORE, DON'T MELT
  50. BEQ IMBYE
  51. ; IF WE GET HERE, WE'RE MELTING. HANDLE THE ANIMATION, ETC.--
  52. IMCONT02 LDA DRIPFRAM
  53. CMP #99 ; THIS MEANS WAIT BEFORE NEXT DRIP
  54. BEQ ZDRPWAIT
  55. LDA DRIPTIME
  56. BEQ NXTDRIP
  57. JMP ZIM000
  58. NXTDRIP LDA #5
  59. STA DRIPTIME
  60. DEC DRIPFRAM
  61. LDA DRIPFRAM
  62. CMP #1 ; FIRST SPLASH
  63. BEQ ZSPLSH00
  64. CMP #0
  65. BEQ ZSPLSH01
  66. BMI ZDRPSTRT ; IF NEGATIVE, START ANOTHER DROPLET
  67. LDA CYPOS+DRIPSTRT ; ELSE, JUST MOVE THE DROP DOWN
  68. SEC
  69. SBC #1
  70. STA CYPOS+DRIPSTRT
  71. JMP ZIM000
  72. ZSPLSH00 LDA DRIPCHAR+1
  73. STA CSTAMP+DRIPSTRT
  74. LDA #14