Advertisement
arriopolis

SmallMenuTest

May 18th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .nolist
  2. #include    "ti83plus.inc"
  3. #define    ProgStart    $9D95
  4. .list
  5. .org    ProgStart - 2
  6.     .db t2byteTok, tAsmCmp
  7.     SET TextWrite, (IY + SGrFlags)
  8. InputMolairVolume:
  9.     CALL InputScherm
  10.     LD IX, InputVensterDrieKeuzes
  11.     CALL InputKeuzes
  12.     LD HL, $1118
  13.     LD (PenCol), HL
  14.     LD HL, InputTextMolairVolume
  15.     b_call(_VPutS)
  16.     CALL SmallMenu
  17.     .DB 3
  18.     .DB "    1:22.4    ", 0
  19.     .DB "    2:24.5   ", 0
  20.     .DB " 3:Ander ", 0
  21.     LD A, B
  22.     CP 3
  23.     JR Z, InputMolairVolumeGetal
  24.     CP 2
  25.     JR Z, InputMolairVolume245
  26. InputMolairVolume245:
  27. InputMolairVolumeGetal:
  28.     RET
  29.  
  30. InputScherm:
  31.     LD HL, InputVensterBovenkant
  32.     LD DE, PlotSScreen + 16*12
  33.     LD B, 12
  34. InputSchermBovenkantDisplay:
  35.     LD A, (DE)
  36.     OR (HL)
  37.     LD (DE), A
  38.     INC DE
  39.     INC HL
  40.     DJNZ InputSchermBovenkantDisplay
  41.     LD C, 15
  42. InputSchermMiddenDisplay2:
  43.     LD B, 12
  44.     LD HL, InputVensterMidden
  45.     LD IX, InputVensterMiddenSchoon
  46. InputSchermMiddenDisplay:
  47.     LD A, (DE)
  48.     AND (IX)
  49.     OR (HL)
  50.     LD (DE), A
  51.     INC HL
  52.     INC DE
  53.     INC IX
  54.     DJNZ InputSchermMiddenDisplay
  55.     DEC C
  56.     JR NZ, InputSchermMIddenDisplay2
  57.     LD B, 24
  58. InputSchermOnderDisplay:
  59.     LD A, (DE)
  60.     OR (HL)
  61.     LD (DE), A
  62.     INC HL
  63.     INC DE
  64.     DJNZ InputSchermOnderDisplay
  65.     RET
  66.  
  67. InputKeuzes:
  68.     LD HL, InputVensterOnder
  69.     LD DE, PlotSScreen + 288
  70.     LD B, 12
  71. InputDrieKeuzesFirstLoop:
  72.     LD A, (DE)
  73.     OR (HL)
  74.     LD (DE), A
  75.     INC DE
  76.     INC HL
  77.     DJNZ InputDrieKeuzesFirstLoop
  78.     LD C, 7
  79. InputDrieKeuzesSecondLoop2:
  80.     LD B, 12
  81.     PUSH IX
  82.     POP HL
  83. InputDrieKeuzesSecondLoop1:
  84.     LD A, (DE)
  85.     OR (HL)
  86.     LD (DE), A
  87.     INC DE
  88.     INC HL
  89.     DJNZ InputDrieKeuzesSecondLoop1
  90.     DEC C
  91.     JR NZ, InputDrieKeuzesSecondLoop2
  92.     b_call(_GrBufCpy)
  93.     RET
  94.  
  95. SmallMenu:
  96.     LD B, 1
  97.     POP HL
  98.     LD C, (HL)
  99.     INC HL
  100. SmallMenuDraw:
  101.     PUSH HL
  102.     POP IX
  103.     LD DE, $1905
  104.     LD (PenCol), DE
  105.     LD A, C
  106.     CP 2
  107.     LD A, B
  108.     JR NZ, SmallMenuNiet2Keuzes
  109.     CP 1
  110.     CALL Z, TextInverseOn
  111.     CALL NZ, TextInverseOff
  112.     b_call(_VPutS)
  113.     LD DE, $1931
  114.     LD (PenCol), DE
  115.     LD A, B
  116.     CP 2
  117.     CALL Z, TextInverseOn
  118.     CALL NZ, TextInverseOff
  119.     b_call(_VPutS)
  120.     JR SmallMenuContinue
  121. SmallMenuNiet2Keuzes:
  122.     CP 1
  123.     CALL Z, TextInverseOn
  124.     CALL NZ, TextInverseOff
  125.     b_call(_VPutS)
  126.     LD DE, $1922
  127.     LD (PenCol), DE
  128.     LD A, B
  129.     CP 2
  130.     CALL Z, TextInverseOn
  131.     CALL NZ, TextInverseOff
  132.     b_call(_VPutS)
  133.     LD DE, $193E
  134.     LD (PenCol), DE
  135.     LD A, B
  136.     CP 3
  137.     CALL Z, TextInverseOn
  138.     CALL NZ, TextInverseOff
  139.     b_call(_VPutS)
  140. SmallMenuContinue:
  141.     PUSH BC
  142.     PUSH HL
  143.     b_call(_GrBufCpy)
  144.     POP HL
  145.     POP BC
  146. SmallMenuGetKey:
  147.     PUSH HL
  148.     b_call(_getKey)
  149.     CP kEnter
  150.     RET Z
  151.     POP HL
  152.     CP kRight
  153.     JR Z, InclineMenuSmall
  154.     CP kLeft
  155.     JR Z, DeclineMenuSmall
  156.     JR SmallMenuGetKey
  157.  
  158. InclineMenuSmall:
  159.     LD A, B
  160.     CP C
  161.     JR NZ, InclineMenuSmallContinue
  162.     LD B, 0
  163. InclineMenuSmallContinue:
  164.     INC B
  165.     PUSH IX
  166.     POP HL
  167.     JP SmallMenuDraw
  168. DeclineMenuSmall:
  169.     DEC B
  170.     JR NZ, DeclineMenuSmallContinue
  171.     LD B, C
  172. DeclineMenuSmallContinue:
  173.     PUSH IX
  174.     POP HL
  175.     JP SmallMenuDraw
  176.  
  177. TextInverseOn:
  178.     SET TextInverse, (IY + TextFlags)
  179.     RET
  180. TextInverseOff:
  181.     RES TextInverse, (IY + TextFlags)
  182.     RET
  183.  
  184. InputVensterBovenkant:
  185.     .DB %00001111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11110000
  186. InputVensterMiddenSchoon:
  187.     .DB %11111000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00111111
  188. InputVensterMidden:
  189.     .Db %00001000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %00110000
  190. InputVensterOnder:
  191.     .DB %00001111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11110000
  192. InputVensterSchaduw:
  193.     .DB %00000111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11110000
  194. InputVensterTweeKeuzes:
  195.     .DB %00000000, %00000000, %00000000, %00000000, %00000000, %00000000, %10000000, %00000000, %00000000, %00000000, %00000000, %00000000
  196. InputVensterDrieKeuzes:
  197.     .DB %00000000, %00000000, %00000000, %00000000, %01000000, %00000000, %00000000, %00000100, %00000000, %00000000, %00000000, %00000000
  198. InputTextMolairVolume:            .DB "Molair volume:", 0
  199. .end
  200. .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement