;0035 only ever contains #1e
;003b commonly contains $0233
;003d
+;003e mask for 0040? (see f996)
+;003f
;0040
;0042 current key press
;0048 error status
;0076-0077 word
;007f
;00c8
+;0800 motor information array - each is a 16-bit value
+;
;08c8 array of prices of each slot??
;0993 custom message?
;0b90 - 0b99 display buffer (backwards)
; bit5: bad sensor
; bit6: tube error
;0bc2 - 0bce SCI read into these locations
+;0bd
+;0bc4 array index into 0bc7
+;0bc5
+;0bc6 another array index into 0bc7
+;0bc7 word array
+;
+;0be1
+;0bd7 init'd to 0x01
+;0bd8 init'd to 0x04
+;0bd9 init'd to 0x02
+;0bda init'd to 0x20
+;0bdb init'd to 0x08
+;0bdc init'd to 0x10
+;
;0cbc serial number
;0ccc machine ID
;0cd9 counter of something - reset to 4 on some serial input
; PE6 <unused>
; PE5 <unused>
; PE4 <unused>
-; PE3 goes high when 24VUN line is too low
+; PE3 goes high when 24VUN line is *really* low (like 20V)
; PE2 remote no-sale switch (active low)
; PE1 motor overvoltage sense (active high)
; PE0 motor overcurrent sense (active low)
CE47 3B ; rti
jump48:
+;
CE48 F6 0B C4 ... ldab 0bc4
CE4B F1 0B C5 ... cmpb 0bc5
CE4E 25 53 %S bcs 53
CE98 F7 0B DB ... stab 0bdb
CE9B C6 10 .. ldab #10
CE9D F7 0B DC ... stab 0bdc
-CEA0 7E D0 66 ~.f jmp d066 ;goto58
+CEA0 7E D0 66 ~.f jmp d066 ;goto58 - multiply
CEA3 F6 0B C4 ... ldab 0bc4
CEA6 F1 0B C6 ... cmpb 0bc6
CEA9 25 53 %S bcs 53
D004 F7 0B DB ... stab 0bdb
D007 C6 08 .. ldab #08
D009 F7 0B DC ... stab 0bdc
-D00C 20 58 X bra 58
+D00C 20 58 X bra 58 ;goto58
D00E F6 0B C6 ... ldab 0bc6
D011 F1 0B C5 ... cmpb 0bc5
D014 25 50 %P bcs 50
D05C C6 08 .. ldab #08
D05E F7 0B DB ... stab 0bdb
D061 C6 20 . ldab #20
-D063 F7 0B DC ... stab 0bdc
+D063 F7 0B DC ... stab 0bdc ;goto58
goto58:
D066 F6 0B AA ... ldab 0baa
D069 4F O clra
jump67:
D479 7F 00 1C ... clr 001c
+; begin loop
D47C F6 00 1C ... ldab 001c
-D47F C1 64 .d cmpb #64
-D481 24 1A $. bcc 1a
+D47F C1 64 .d cmpb #64 ; to 100
+D481 24 1A $. bcc 1a ; to d49d
D483 CC FF 7F ... ldd #ff7f
D486 37 7 pshb
D487 36 6 psha
D494 E4 01 .. andb 01,x
D496 ED 00 .. std 00,x
D498 7C 00 1C |.. inc 001c
-D49B 20 DF . bra df
+D49B 20 DF . bra df ; to d47c
D49D 7F 00 05 ... clr 0005
-goto65:
+goto65: ; begin motor count loop
D4A0 F6 00 05 ... ldab 0005
D4A3 C1 50 .P cmpb #50 ; 80
D4A5 25 03 %. bcs 03
D53F EA 01 .. orb 01,x
D541 ED 00 .. std 00,x
D543 20 15 . bra 15
-goto64:
+goto64: ; mark a motor position as valid?
D545 CC 7F FF ... ldd #7fff
D548 37 7 pshb
D549 36 6 psha
D556 E4 01 .. andb 01,x
D558 ED 00 .. std 00,x
D55A 7C 00 05 |.. inc 0005
-D55D 7E D4 A0 ~.. jmp d4a0 ;goto65
+D55D 7E D4 A0 ~.. jmp d4a0 ;goto65 - loop again
goto63:
D560 39 9 rts
;
; begin of main loop
goto85:
+; test power lines
F8FF BD E6 1B ... jsr e61b ;jump4 set 0031 to 10
F902 BD D1 05 ... jsr d105 ;motors_off
F905 F6 10 0A ... ldab 100a
F94D C6 1E .. ldab #1e
F94F F7 00 35 ..5 stab 0035
;
+; end of power line test
+;
F952 F6 0B C0 ... ldab 0bc0
F955 C4 08 .. andb #08
F957 27 16 '. beq 16 ; to f96f
F96C 1C 00 08 .. bset 00,x, #08 ; set bill error bit
;
F96F F6 0B C1 ... ldab 0bc1
-F972 C4 07 .. andb #07 ; test for power failures
+F972 C4 07 .. andb #07 ; was there a power failure?
F974 27 0D '. beq 0d ; to f983
F976 F6 00 35 ..5 ldab 0035
F979 26 08 &. bne 08
F97E 1C 00 20 .. bset 00,x, #20
F981 20 06 .. bra 06 ; to f989
;
+;
F983 CE 00 21 ..! ldx #0021
F986 1D 00 20 .. bclr 00,x, #20
F989 BD BB 63 . jsr bb63 ;jump200 - read the keypad