;0015
;0016 new key state (cf 0029)
;0017 bits 5-7 used mostly
-;0018
+;0018 another loop variable
;0019 error statuses:
; bit 0 - over current
; bit 1 - home sensor failure
; 005f
;0067 working space of 0bc0
;0073
+;0075 something about link master price holding
;0076-0077 word
;007f
;00c8
C7C6 83 00 00 ... subd #0000
C7C9 27 05 '. beq 05
C7CB F6 10 2C .., ldab 102c ; test the 9th bit
-C7CE 2D 10 -. blt 10 ; to c7e0
+C7CE 2D 10 -. blt 10 ; to c7e0 - return 1
+;
C7D0 F6 10 2F ../ ldab 102f ; sci data
C7D3 4F O clra
C7D4 8D BE .. bsr c794 ; parity test?
C7D6 83 00 00 ... subd #0000
-C7D9 26 09 &. bne 09 ; to c7e4
+C7D9 26 09 &. bne 09 ; to c7e4 - return 0
C7DB F6 10 2C .., ldab 102c ; test the 9th bit
C7DE 2D 04 -. blt 04
+;
C7E0 CC 00 01 ... ldd #0001 ; return 1
C7E3 39 9 rts
; return 0
;
;
;
+;
+;
+;
+;
+;
+;
+;
+;
+;
+;
+;
+;
goto44:
CBFF F6 0B C0 ... ldab 0bc0 ; do we have our changer (link master)?
CC02 C4 02 .. andb #02
CC49 BD C7 E7 ... jsr c7e7 ;jump37 - send 0043 to coin mech - retry?
CC4C 7E CE 39 ~.9 jmp ce39 ;goto55 - exit
;
-CC4F F6 00 08 ... ldab 0008
+CC4F F6 00 08 ... ldab 0008 ; already in a packet?
CC52 26 03 &. bne 03
CC54 7E CD 94 ~.. jmp cd94 ;goto56
;
CC57 F6 10 2F ../ ldab 102f ; read SCI data
CC5A C4 F0 .. andb #f0 ; 11110000
-CC5C C1 20 . cmpb #20 ; 00100000
+CC5C C1 20 . cmpb #20 ; 00100000 ; 4th bit clear
CC5E 27 03 '. beq 03
CC60 7E CD 94 ~.. jmp cd94 ;goto56
CC63 F6 10 2F ../ ldab 102f ; read SCI data
-CC66 C4 0F .. andb #0f
+CC66 C4 0F .. andb #0f ; place lower nibble (data) onto stack var
CC68 30 0 tsx
CC69 E7 00 .. stab 00,x
CC6B F6 00 08 ... ldab 0008
CDAB CE 34 FF C8 .4.. ; 0
CDAF 00 00 .. ; end of array data
;
+; got 00110001 - "1"
CDB1 F6 00 21 ..! ldab 0021
-CDB4 2C 08 ,. bge 08
+CDB4 2C 08 ,. bge 08 ; something to do with link master price holding
CDB6 CC 00 80 ... ldd #0080
CDB9 BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech
-CDBC 20 1B . bra 1b ; to cdd9
+CDBC 20 1B . bra 1b ; to cdd9 - exit
CDBE 5F _ clrb
CDBF 4F O clra
CDC0 BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech
CDD1 7C 00 75 |.u inc 0075
CDD4 20 03 . bra 03
CDD6 7F 00 75 ..u clr 0075
-CDD9 20 5E ^ bra 5e
+CDD9 20 5E ^ bra 5e ; to ce39 - exit
;
+; got 00110001 - "2"
CDDB F6 00 1D ... ldab 001d
CDDE C4 02 .. andb #02
CDE0 27 07 '. beq 07
CDEC BD C7 E7 ... jsr c7e7 ;jump37 - send #fe to coin mech
CDEF F6 00 1F ... ldab 001f
CDF2 C4 08 .. andb #08
-CDF4 27 0A '. beq 0a
+CDF4 27 0A '. beq 0a ; to ce00, to exit
CDF6 F6 0B C0 ... ldab 0bc0
CDF9 C4 10 .. andb #10 ; have link master price holding
CDFB 27 03 '. beq 03
CDFD 7C 00 75 |.u inc 0075
-CE00 20 1C . bra 1c
+CE00 20 1C . bra 1c ; to ce1e, to ce39, exit
+;
CE02 FC 00 44 ..D ldd 0044
CE05 37 7 pshb
CE06 36 6 psha
CE15 1D 00 08 ... bclr 00,x, #08
CE18 CE 00 1F ... ldx #001f
CE1B 1C 00 08 ... bset 00,x, #08
-CE1E 20 19 . bra 19
+CE1E 20 19 . bra 19 ; to ce39, exit
+;
+; got 00110001 - "3"
CE20 CE 00 1D ... ldx #001d
CE23 1D 00 02 ... bclr 00,x, #02
CE26 20 11 . bra 11
+;
+; got 00110001 - "8"
CE28 C6 01 .. ldab #01
CE2A F7 00 08 ... stab 0008
CE2D 5F _ clrb
CE2E 4F O clra
CE2F BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech
CE32 20 05 . bra 05
+;
CE34 5F _ clrb
CE35 4F O clra
CE36 BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech
D247 BD D1 3D ..= jsr d13d ;jump34 - motor on
D24A C6 3C .< ldab #3c ; 60
D24C F7 00 2E ... stab 002e
-D24F C6 41 .A ldab #41 ; 65
+D24F C6 41 .A ldab #41 ; 65 01000001
D251 F7 00 31 ..1 stab 0031
D254 CE 00 1B ... ldx #001b
D257 1D 00 08 ... bclr 00,x #08
D25F 26 22 &" bne 22 ; to d283
D261 F6 00 2E ... ldab 002e
D264 C1 35 .5 cmpb #35 ; 53
-D266 23 10 #. bls 10
+D266 23 10 #. bls 10 ; to d278
D268 BD D5 70 ..p jsr d570 ;jump35 - check home sensor departed
D26B 83 00 00 ... subd #0000
D26E 27 06 '. beq 06 ; to d276
D298 27 46 'F beq 46 ; to d2e0
D29A BD D1 05 ... jsr d105 ;motors_off
D29D F6 00 2E ... ldab 002e
-D2A0 C1 32 .2 cmpb #32
+D2A0 C1 32 .2 cmpb #32 ; 50
D2A2 22 07 ". bhi 07 ; to d2ab
D2A4 8D 6B .k bsr 6b ;jump30 - test motor overvoltage?
D2A6 83 00 00 ... subd #0000
D311 BD D1 3D ..= jsr d13d ;jump34 - motor on
D314 7F 00 1C ... clr 001c
D317 7F 00 18 ... clr 0018
+; loop:
D31A F6 10 0A ... ldab 100a
D31D C4 02 .. andb #02 ; motor overvoltage sense
D31F 27 13 '. beq 13 ; to d334
D321 7C 00 1C |.. inc 001c
D324 F6 00 1C ... ldab 001c
D327 C1 FF .. cmpb #ff
-D329 26 07 &. bne 07
+D329 26 07 &. bne 07 ; continue
D32B BD D1 05 ... jsr d105 ;motors_off
D32E CC 00 01 ... ldd #0001
D331 39 9 rts
D5AF 39 9 rts
;This does almost the same - check the home sensor for this row (slot number
-;is in 0006) up to 5 times. If it is 1, return 0. If it stays 0, return 0.
+;is in 0006) up to 5 times. If it is 1, return 0. If it stays 0, return 1.
;(this is the reverse of the routine above). But also check bit 0 of 100a.
;If it is ever 0, return 0.
;005f is the row number
E34A CE 00 17 ... ldx #0017
E34D 1D 00 02 ... bclr 00,x, #02
E350 FC 00 44 ..D ldd 0044
-E353 26 1C &. bne 1c
+E353 26 1C &. bne 1c ; to e371
E355 F6 0B C0 ... ldab 0bc0
E358 C4 10 .. andb #10 ; have link master price holding
E35A 26 08 &. bne 08
E367 1D 00 80 .. bclr 00,x, #80
E369 C6 05 .. ldab #05
E36C F7 00 75 ..u stab 0075
-E36F 20 57 W bra 57
+E36F 20 57 W bra 57 ; to e3c8
+;
E371 F6 0B C0 ... ldab 0bc0
E374 C4 10 .. andb #10 ; have link master price holding
-E376 27 50 'P beq 50
+E376 27 50 'P beq 50 ; to e3c8
E378 FC 00 40 ..@ ldd 0040
-E37B 26 4B &K bne 4b
+E37B 26 4B &K bne 4b ; to e3c8
E37D F6 0B C0 ... ldab 0bc0
E380 C4 20 . andb #20 ; have link master price holding - price display
-E382 27 3E '> beq 3e
+E382 27 3E '> beq 3e ; e3c2
E384 CE 00 17 ... ldx #0017
E387 1C 00 01 ... bset 00,x, #01
E38A F6 00 2B ..+ ldab 002b
E3BA CE 00 17 ... ldx #0017
E3BD 1C 00 02 ... bset 00,x, #02
E3C0 20 06 . bra 06
+;
E3C2 CE 00 1F ... ldx #001f
E3C5 1C 00 08 ... bset 00,x, #08
+;
E3C8 CE 00 1D ... ldx #001d
E3CB 1C 00 02 ... bset 00,x, #02
E3CE CE 00 19 ... ldx #0019
E485 BD C7 E7 ... jsr c7e7 ;jump37 - send to serial port
E488 BD E5 D1 ... jsr e5d1 ;jump52 - triple beep
E48B BD D8 E9 ... jsr d8e9 ;jump92 - "SELECT OTHER ITEM"
-E48E 7E E5 5E ~.^ jmp e55e ;goto74
+E48E 7E E5 5E ~.^ jmp e55e ;goto74 - bail
E491 F6 00 2B ..+ ldab 002b
E494 C1 00 .. cmpb #00
E496 26 08 &. bne 08
;
F7B7 F6 00 25 ..% ldab 0025
F7BA 27 03 '. beq 03
+; from jump34
F7BC 7A 00 25 z.% dec 0025
;
F7BF F6 00 31 ..1 ldab 0031