825B F6 00 54 ..T ldab 0054
825E F7 00 06 ... stab 0006
8261 F6 00 06 ... ldab 0006
-8264 BD D7 A0 ... jsr d7a0 ;jump10
+8264 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8267 83 00 00 ... subd #0000
826A 27 15 '. beq 15
826C CC 7F FF ... ldd #7fff
82E4 F6 00 54 ..T ldab 0054
82E7 F7 00 06 ... stab 0006
82EA F6 00 06 ... ldab 0006
-82ED BD D7 A0 ... jsr d7a0 ;jump10
+82ED BD D7 A0 ... jsr d7a0 ;is_invalid_slot
82F0 83 00 00 ... subd #0000
82F3 27 15 '. beq 15
82F5 CC 7F FF ... ldd #7fff
836D F6 00 54 ..T ldab 0054
8370 F7 00 06 ... stab 0006
8373 F6 00 06 ... ldab 0006
-8376 BD D7 A0 ... jsr d7a0 ;jump10
+8376 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8379 83 00 00 ... subd #0000
837C 26 17 &. bne 17
837E F6 00 54 ..T ldab 0054
8518 BD FE 16 ... jsr fe16 ;jump2
851B 00 00 .
851C 00 0B .
-851F 85 80 ..
-8521 85 39 .9
+851F 85 80 .. ; default action - leave menu?
+8521 85 39 .9 ; 0 - no key pressed
8523 85 4A .J ; key 1 - changer loading & calibration
8525 85 4F .O ; key 2 - win-a-snack odds programming
8527 85 54 .T ; key 3 - set pricing
87FE E6 00 .. ldab 00,x
8800 F7 00 06 ... stab 0006
8803 F6 00 06 ... ldab 0006
-8806 BD D7 A0 ... jsr d7a0 ;jump10
+8806 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8809 83 00 00 ... subd #0000
880C 26 11 &. bne 11
880E BD D3 11 ... jsr d311 ;jump30
8978 CE 00 1D ... ldx #001d
897B 1C 00 80 .. bset 00,x, #80
897E F6 0B 94 .. ldab 0b94
-8980 CB D0 .. addb #d0
+8980 CB D0 .. addb #d0 ; -48 (unmake it a digit)
8983 37 7 pshb
8984 F6 0B 95 ... ldab 0b95
-8987 CB D0 .. addb #d0
+8987 CB D0 .. addb #d0 ; -48 (unmake it a digit)
8989 86 0A .. ldaa #0a
898B 3D = mul
898C 30 0 tsx
8993 C6 32 .2 ldab #32
8995 F7 00 3A ..: stab 003a
8998 F6 00 06 ... ldab 0006
-899B BD D7 A0 ... jsr d7a0 ;jump10
+899B BD D7 A0 ... jsr d7a0 ;is_invalid_slot
899E 83 00 00 ... subd #0000
-89A1 26 27 &' bne 27
+89A1 26 27 &' bne 27 ; to 89ca
89A3 BD D3 11 ... jsr d311 ;jump30
89A6 83 00 00 ... subd #0000
89A9 26 0B &. bne 0b
89C2 BD A3 85 ... jsr a385 ;jump40
89C5 BD 9A 47 ..G jsr 9a47 ;jump39
89C8 20 0C . bra 0c
+;
89CA CE 00 1D ... ldx #001d
89CD 1D 00 .. bclr 00,x, #80
89D0 CE 00 1F ... ldx #001f
89D8 CE 00 1D ... ldx #001d
89DB 1D 00 80 ... bclr 00,x, #80
;goto6
-89DE 7E 8C 72 .~ jmp 8c72 ;goto7
+89DE 7E 8C 72 .~ jmp 8c72 ;goto7 (exit)
;goto5
89E1 F6 00 1D ... ldab 001d
89E4 2D 03 -. blt 03
-89E6 7E 8C 72 ~.r jmp 8c72 ;goto7
+89E6 7E 8C 72 ~.r jmp 8c72 ;goto7 (exit)
89E9 F6 00 09 ... ldab 0009
89EC 4F O clra
89ED BD FE 16 ... jsr fe16 ;jump2
89F0 00 00 00 0B .... ; params to jump2
-89F4 8C 72 ..
-89F6 8A 0E ..
-89F8 8A 14 ..
+89F4 8C 72 .. ; default action
+89F6 8A 0E .. ; 0 - display price on screen?
+89F8 8A 14 .. ; 1 -
89FA 8A AA ..
89FC 8B 5E .^
89FE 8B 9E ..
8A0A 8C 67 ..
8A0C 8C 6F ..
8A0E BD 9A 47 .. jsr 9a47 ;jump39
-8A11 7E 8C 72 ... jmp 8c72 ;goto7
+8A11 7E 8C 72 ... jmp 8c72 ;goto7 (exit)
8A14 F6 00 36 ... ldab 0036
8A17 27 03 '. beq 03
8A19 7E 8A 9B ~.. jmp 8a9b ;goto8
8A3E 4F O clra
8A3F 37 7 pshb
8A40 36 6 psha
-8A41 CC 00 FA ... ldd #00fa
-8A44 BD FB BA ... jsr fbba ;jump38
+8A41 CC 00 FA ... ldd #00fa ; 250 or -6
+8A44 BD FB BA ... jsr fbba ;jump38 - multiply?
8A47 B3 00 27 ..' subd 0027
8A4A 24 05 $. bcc 05
8A4C 5F _ clrb
8A93 BD 9A 47 ..G jsr 9a47 ;jump39
8A96 C6 02 .. ldab #02
8A98 F7 00 36 ..6 stab 0036
-
goto8:
8A9B CE 00 1B ... ldx #001b
8A9E 1C 00 10 ... bset 00,x, #10
8AA1 CC 02 33 ..3 ldd #0233
8AA4 FD 00 3B ..; std 003b
-8AA7 7E 8C 72 ~.r jmp 8c72 ;goto7
+8AA7 7E 8C 72 ~.r jmp 8c72 ;goto7 (exit)
+;
8AAA F6 00 36 ..6 ldab 0036
8AAD 27 03 '. beq 03
8AAF 7E 8B 4F ~.O jmp 8b4f ;goto9
8B52 1C 00 10 .. bset 00,x, #10
8B55 CC 02 33 ..3 ldd #0233
8B58 FD 00 3B ..; std 003b
-8B5B 7E 8C 72 ~.r jmp 8c72 ;goto7
+8B5B 7E 8C 72 ~.r jmp 8c72 ;goto7 (exit)
8B5E F6 00 36 ..6 ldab 0036
8B61 26 2C &, bne 2c
8B63 F6 00 1F ... ldab 001f
8B92 1C 00 10 .. bset 00,x, #10
8B95 CC 02 33 ..3 ldd #0233
8B98 FD 00 3B ..; std 003b
-8B9B 7E 8C 72 ~.r jmp 8c72 ;goto7
+8B9B 7E 8C 72 ~.r jmp 8c72 ;goto7 (exit)
8B9E F6 00 36 ..6 ldab 0036
8BA1 26 29 &) bne 29
8BA3 F6 00 1F ... ldab 001f
8BCF 1C 00 10 ... bset 00,x, #10
8BD2 CC 02 33 ..3 ldd #0233
8BD5 FD 00 3B ..; std 003b
-8BD8 7E 8C 72 ~.r jmp 8c72 ;goto7
+8BD8 7E 8C 72 ~.r jmp 8c72 ;goto7 (exit)
8BDB F6 00 1F ... ldab 001f
8BDE C4 40 .@ andb #40
8BE0 27 15 '. beq 15
8C04 24 24 $$ bcc 24
8C06 BD 97 6F ..o jsr 976f ;jump41
8C09 F6 00 06 ... ldab 0006
-8C0C BD D7 A0 ... jsr d7a0 ;jump10
+8C0C BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8C0F 83 00 00 ... subd #0000
8C12 27 16 '. beq 16
8C14 F6 00 06 ... ldab 0006
8F6B F6 00 24 ..$ ldab 0024
8F6E F7 00 06 ... stab 0006
8F71 F6 00 06 ... ldab 0006
-8F74 BD D7 A0 ... jsr d7a0 ;jump10
+8F74 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8F77 83 00 00 ... subd #0000
8F7A 27 03 '. beq 03
8F7C 7C 00 24 |.$ inc 0024
8FD5 F6 00 24 ..$ ldab 0024
8FD8 F7 00 06 ... stab 0006
8FDB F6 00 06 ... ldab 0006
-8FDE BD D7 A0 ... jsr d7a0 ;jump10
+8FDE BD D7 A0 ... jsr d7a0 ;is_invalid_slot
8FE1 83 00 00 ... subd #0000
8FE4 27 03 '. beq 03
8FE6 7A 00 24 z.$ dec 0024
901B F6 00 2A ..* ldab 002a
901E F7 00 06 ... stab 0006
9021 F6 00 06 ... ldab 0006
-9024 BD D7 A0 ... jsr d7a0 ;jump10
+9024 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
9027 83 00 00 ... subd #0000
902A 27 03 '. beq 03
902C 7C 00 2A |.* inc 002a
9084 F6 00 2A ..* ldab 002a
9087 F7 00 06 ... stab 0006
908A F6 00 06 ... ldab 0006
-908D BD D7 A0 ... jsr d7a0 ;jump10
+908D BD D7 A0 ... jsr d7a0 ;is_invalid_slot
9090 83 00 00 ... subd #0000
9093 27 03 '. beq 03
9095 7A 00 2A z.* dec 002a
9615 C6 32 .2 ldab #32
9617 F7 00 3A ..: stab 003a
961A F6 00 06 ... ldab 0006
-961D BD D7 A0 ... jsr d7a0 ;jump10
+961D BD D7 A0 ... jsr d7a0 ;is_invalid_slot
9620 83 00 00 ... subd #0000
9623 26 21 &! bne 21
9625 BD D3 11 ... jsr d311 ;jump30
9743 C6 45 .E ldab #45
9745 F7 00 06 ... stab 0006
9748 F6 00 06 ... ldab 0006
-974B BD D7 A0 ... jsr d7a0 ;jump10
+974B BD D7 A0 ... jsr d7a0 ;is_invalid_slot
974E 83 00 00 ... subd #0000
9751 27 15 '. beq 15
9753 F6 00 06 ... ldab 0006
ABBE 26 03 &. bne 03
ABC0 7E AC 7B ~.{ jmp ac7b ;goto23
ABC3 F6 00 06 ... ldab 0006
-ABC6 BD D7 A0 ... jsr d7a0 ;jump10
+ABC6 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
ABC9 83 00 00 ... subd #0000
ABCC 27 03 '. beq 03
ABCE 7E AC 7B ~.{ jmp ac7b ;goto23
B855 83 00 00 ... subd #0000
B858 27 0B '. beq 0b
B85A F6 0E 05 ... ldab 0e05
-B85D BD D7 A0 ... jsr d7a0 ;jump10
+B85D BD D7 A0 ... jsr d7a0 ;is_invalid_slot
B860 83 00 00 ... subd #0000
B863 27 09 '. beq 09
B865 30 0 tsx
B883 26 03 &. bne 03
B885 7E B9 0A ~.. jmp b90a ;goto26
B888 F6 0E 05 ... ldab 0e05
-B88B BD D7 A0 ... jsr d7a0 ;jump10
+B88B BD D7 A0 ... jsr d7a0 ;is_invalid_slot
B88E 83 00 00 ... subd #0000
B891 26 77 &w bne 77
B893 BD BE 4B ..K jsr be4b ;displayblank
D4BD 27 03 '. beq 03
D4BF 7E D5 45 ~.E jmp d545 ;goto64
D4C2 F6 00 06 ... ldab 0006
-D4C5 BD D7 A0 ... jsr d7a0 ;jump10
+D4C5 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
D4C8 83 00 00 ... subd #0000
D4CB 26 78 &x bne 78
D4CD BD D5 B0 ... jsr d5b0 ;jump31
D79E 4F O clra
D79F 39 9 rts
-jump10:
+is_invalid_slot:
+; validates a slot number? (return 1 if invalid)
+; let i = number on stack
+; if i in [9, 69, 79, 89, 99], return 1
+; if 0e6d!=1 return 0
+; if i%10 not in [1,2] return 1
+; if i < 11 return 1
+; if i <= 62 return 0
+; return 1
D7A0 37 7 pshb
D7A1 30 0 tsx
D7A2 E6 00 .. ldab 00,x
-D7A4 C1 09 .. cmpb #09
-D7A6 27 18 '. beq 18
+D7A4 C1 09 .. cmpb #09 ; 9
+D7A6 27 18 '. beq 18 ; to d7c0 (returns 1)
D7A8 E6 00 .. ldab 00,x
-D7AA C1 45 .E cmpb #45
-D7AC 27 12 '. beq 12
+D7AA C1 45 .E cmpb #45 ; 69
+D7AC 27 12 '. beq 12 ; to d7c0 (returns 1)
D7AE E6 00 .. ldab 00,x
-D7B0 C1 4F .O cmpb #4f
-D7B2 27 0C '. beq 0c
+D7B0 C1 4F .O cmpb #4f ; 79
+D7B2 27 0C '. beq 0c ; to d7c0 (returns 1)
D7B4 E6 00 .. ldab 00,x
-D7B6 C1 59 .Y cmpb #59
-D7B8 27 06 '. beq 06
+D7B6 C1 59 .Y cmpb #59 ; 89
+D7B8 27 06 '. beq 06 ; to d7c0 (returns 1)
D7BA E6 00 .. ldab 00,x
-D7BC C1 63 .c cmpb #63
-D7BE 26 05 &. bne 05
+D7BC C1 63 .c cmpb #63 ; 99 (also returns 1)
+D7BE 26 05 &. bne 05 ; to d7c5 if not equal
D7C0 CC 00 01 ... ldd #0001
-D7C3 20 38 8 bra 38
+D7C3 20 38 8 bra 38 ; to d7fd (return 1)
D7C5 F6 0E 6D ..m ldab 0e6d
D7C8 C1 01 .. cmpb #01
-D7CA 26 2F &/ bne 2f
+D7CA 26 2F &/ bne 2f ;to d7fb (return 0)
D7CC 30 0 tsx
D7CD E6 00 .. ldab 00,x
D7CF 4F O clra
D7D0 CE 00 0A ... ldx #000a
D7D3 02 . idiv
-D7D4 C1 01 .. cmpb #01
-D7D6 27 11 '. beq 11
+D7D4 C1 01 .. cmpb #01
+D7D6 27 11 '. beq 11 ;to d7e9 if num%10==1
D7D8 30 0 tsx
D7D9 E6 00 .. ldab 00,x
D7DB 4F O clra
D7DC CE 00 0A ... ldx #000a
D7DF 02 . idiv
D7E0 C1 02 .. cmpb #02
-D7E2 27 05 '. beq 05
+D7E2 27 05 '. beq 05 ;to d7e9 if num%10==2
D7E4 CC 00 01 ... ldd #0001
-D7E7 20 14 . bra 14
+D7E7 20 14 . bra 14 ; to d7fd (return 1)
D7E9 30 0 tsx
D7EA E6 00 .. ldab 00,x
-D7EC C1 0B .. cmpb #0b
-D7EE 25 06 %. bcs 06
+D7EC C1 0B .. cmpb #0b ; 11
+D7EE 25 06 %. bcs 06 ; return 1
D7F0 E6 00 .. ldab 00,x
-D7F2 C1 3E .> cmpb #3e
-D7F4 23 05 #. bls 05
+D7F2 C1 3E .> cmpb #3e ; 62
+D7F4 23 05 #. bls 05 ; return 0
D7F6 CC 00 01 ... ldd #0001
D7F9 20 02 . bra 02
D7FB 5F _ clrb
E7D0 26 03 &. bne 03
E7D2 7E E8 99 ~.. jmp e899 ;goto79
E7D5 F6 00 06 ... ldab 0006
-E7D8 BD D7 A0 ... jsr d7a0 ;jump10
+E7D8 BD D7 A0 ... jsr d7a0 ;is_invalid_slot
E7DB 83 00 00 ... subd #0000
E7DE 27 03 '. beq 03
E7E0 7E E8 99 ~.. jmp e899 ;goto79
E8B7 5D ] tstb
E8B8 27 54 'T beq 54
E8BA F6 00 06 ... ldab 0006
-E8BD BD D7 A0 ... jsr d7a0 ;jump10
+E8BD BD D7 A0 ... jsr d7a0 ;is_invalid_slot
E8C0 83 00 00 ... subd #0000
E8C3 26 49 &I bne 49
E8C5 F6 00 06 ... ldab 0006