Advertisement
AnthonyCagliano

Key Get Code

Jan 22nd, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. GameStart:
  2. KeyGetLoop:
  3. ld hl, $F50000 \ ld a, 1
  4. ld (hl), a ; Set indiscriminate scan mode
  5. nop \ nop
  6. Key_WaitLoop
  7. ld hl, $f50008
  8. bit 2, (hl) \ jr nz, Key_WaitLoop
  9. call _kbdscan
  10. ld a, (kbdScanCode)
  11. push af
  12. ld hl, $F50000 \ ld a, 1
  13. ld (hl), a ; Set indiscriminate scan mode
  14. nop \ nop
  15. Key_WaitRelease:
  16. ld hl, $f50008
  17. bit 2, (hl) \ jr z, Key_WaitRelease
  18. pop af
  19. ; keypad reading
  20. ld hl, playsAllowedFlags
  21. bit playRoll, (hl)
  22. jr z, noRolls
  23. cp sk2nd
  24. jp z, RollDie
  25. cp skYequ \ jp z, holdDie
  26. cp skWindow \ jp z, holdDie
  27. cp skZoom \ jp z, holdDie
  28. cp skTrace \ jp z, holdDie
  29. cp skGraph \ jp z, holdDie
  30. bit playScore, (hl)
  31. jr z, noScores
  32. noRolls:
  33. ; Scoring
  34. bit playScore, (hl)
  35. jr z, noScores
  36. cp skDown
  37. jp z, SwapRow
  38. cp skUp
  39. jp z, SwapRow
  40. cp skRight
  41. jp z, MoveRight
  42. cp skLeft
  43. jp z, MoveLeft
  44. cp skEnter
  45. jp z, ScoreCombo
  46. noScores:
  47. cp skClear
  48. jp z, Quit
  49. jp KeyGetLoop
  50.  
  51. GameLoop_End:
  52. call CalcCurrentScore
  53. ld hl, comboFlags1 \ ld a, (hl)
  54. cp %00111111 \ jp nz, GameStart
  55. ld hl, comboFlags2 \ ld a, (hl)
  56. cp %01111111 \ jp nz, GameStart
  57. jr GameOver
  58. ; exit game conditions
  59. jp GameStart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement