From 02660a62ba05d1b5b55da5a1f8634d9ae3ca472d Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Mon, 4 Aug 2003 03:01:25 +0000 Subject: [PATCH] making sense of error status bits --- ROM-2003/vend.asm | 76 ++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index e0c0428..f945890 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -63,7 +63,7 @@ ;0bd9 also related ;0bc0 machine capabilities flags ; bit0: have dumb mech -; bit1: +; bit1: have a changer ; bit2: have card reader ; bit3: have bill validator ; bit4: link master - price holding enabled @@ -5193,7 +5193,7 @@ AB92 BD E5 71 ..q jsr e571 ;msdelay AB95 BD D4 79 ..y jsr d479 ;jump67 AB98 BD E8 9A ... jsr e89a ;jump68 AB9B BD E9 EA ... jsr e9ea ;jump113 -AB9E 7F 0B C1 ... clr 0bc1 +AB9E 7F 0B C1 ... clr 0bc1 ; clear all errors ABA1 39 9 rts jump8: @@ -5311,7 +5311,7 @@ AC81 F6 00 19 ... ldab 0019 AC84 C4 07 .. andb #07 AC86 26 0A &. bne 0a AC88 F6 0B C1 ... ldab 0bc1 -AC8B C4 7F .. andb #7f +AC8B C4 7F .. andb #7f ; have errors? AC8D 26 03 &. bne 03 AC8F 5F _ clrb AC90 20 02 . bra 02 @@ -8755,7 +8755,7 @@ C36F 7E C4 2F ~./ jmp c42f ;goto36 C372 CE 00 15 ... ldx #0015 C375 1C 00 80 .. bset 00,x, #80 C378 CE 0B C1 ... ldx #0bc1 -C37B 1D 00 08 .. bclr 00,x #08 +C37B 1D 00 08 .. bclr 00,x #08 ; clear bill error bit C37E F6 00 1D ... ldab 001d C381 C4 20 . andb #20 C383 27 03 '. beq 03 @@ -9081,12 +9081,12 @@ C6A5 F6 0B C0 ... ldab 0bc0 C6A8 C4 01 .. andb #01 C6AA 27 06 '. beq 06 C6AC CE 0B C1 ... ldx #0bc1 -C6AF 1C 00 01 ... bset 00,x, #01 +C6AF 1C 00 01 ... bset 00,x, #01 ; set changer powerup error bit C6B2 F6 0B C0 ... ldab 0bc0 C6B5 C4 04 .. andb #04 C6B7 27 06 '. beq 06 C6B9 CE 0B C1 ... ldx #0bc1 -C6BC 1C 00 02 ... bset 00,x, #02 +C6BC 1C 00 02 ... bset 00,x, #02 ; set card powerup error bit C6BF CE 00 1A ... ldx #001a C6C2 1D 00 04 ... bclr 00,x, #04 ; keypad strobe finish C6C5 F6 00 1A ... ldab 001a @@ -9271,14 +9271,16 @@ C81B 39 9 rts sciinterrupt: C81C 34 4 des C81D F6 0B C0 ... ldab 0bc0 -C820 C4 01 .. andb #01 -C822 26 0A &. bne 0e ; to c82e +C820 C4 01 .. andb #01 ; do we have a dumb mech? +C822 26 0A &. bne 0a ; if so, to c82e +; C824 F6 0B C0 ... ldab 0bc0 -C827 C4 04 .. andb #04 -C829 26 03 &. bne 03 ; to c82e -C82B 7E CB FF ~.. jmp cbff ;goto44 +C827 C4 04 .. andb #04 ; do we have a card reader? +C829 26 03 &. bne 03 ; if so, to c82e +C82B 7E CB FF ~.. jmp cbff ; else to goto44 +; C82E C6 96 .. ldab #96 ; 150 -C830 F7 00 30 ..0 stab 0030 +C830 F7 00 30 ..0 stab 0030 ; changer related still C833 F6 10 2E ... ldab 102e ; SCI status C836 C4 02 .. andb #02 ; test for Framing Error C838 26 0B &. bne 0b ; if so, to c845 @@ -9323,7 +9325,8 @@ C889 1D 00 .. bclr 00,x, #20 C88C C6 04 . andb #04 C88E F7 0C DB ... stab 0cdb C891 CE 0B C1 ... ldx #0bc1 -C894 1C 00 40 ... bset 00,x, #40 ;endif +C894 1C 00 40 ... bset 00,x, #40 ; set tube error +; C897 F6 00 21 ..! ldab 0021 C89A F4 0B D8 ... andb 0bd8 C89D 27 08 '. beq 08 ; to c8a7 @@ -9339,7 +9342,7 @@ C8B1 1D 00 40 ... bclr 00,x, #40 C8B4 C6 04 .. ldab #04 C8B6 F7 0C DA ... stab 0cda C8B9 CE 0B C1 ... ldx #0bc1 -C8BC 1C 00 40 ... bset 00,x, #40 +C8BC 1C 00 40 ... bset 00,x, #40 ; set tube error ; if 0021 & 0bd9, then set bit 7 of 0017, else unset it. C8BF F6 00 21 ..! ldab 0021 C8C2 F4 0B D9 ... andb 0bd9 @@ -9357,7 +9360,7 @@ C8D9 C6 04 .. ldab #04 C8DC F7 0C D9 ... stab 0cd9 ; set tube error bit C8DF CE 0B C1 ... ldx #0bc1 -C8E2 1C 00 40 ... bset 00,x, #40 +C8E2 1C 00 40 ... bset 00,x, #40 ; set tube error bit C8E5 20 31 1 bra 31 ; to c918 ; goto46: ; pulse the send' line of the changer @@ -9548,7 +9551,7 @@ CA71 1C 00 04 ... bset 00,x, #04 CA74 C6 01 .. ldab #01 CA76 F7 00 08 ... stab 0008 CA79 CE 0B C1 ... ldx #0bc1 -CA7C 1D 00 01 ... bclr 00,x, #01 +CA7C 1D 00 01 ... bclr 00,x, #01 ; clear card powerup error bit CA7F 7E CB DA ~.. jmp cbda ;goto48 (clean exit) ; CA82 F6 10 2F ../ ldab 102f ; read SCI data @@ -9675,38 +9678,40 @@ CB78 C4 08 .. andb #08 CB7A 27 08 '. beq 08 CB7C CE 00 21 ..! ldx #0021 CB7F 1C 00 10 ... bset 00,x, #10 -CB82 20 56 V bra 56 ; to cbda - cleanup and exit +CB82 20 56 V bra 56 ;goto48 - cleanup and exit ; CB84 F6 10 2F ../ ldab 102f ; read SCI data CB87 C4 EF .. andb #ef ; 11101111 CB89 C1 E3 .. cmpb #e3 ; 11100111 CB8B 26 08 &. bne 08 ; to cb95 CB8D CE 0B C1 ... ldx #0bc1 -CB90 1D 00 02 ... bclr 00,x, #02 -CB93 20 45 E bra 45 +CB90 1D 00 02 ... bclr 00,x, #02 ; clear card powerup error bit +CB93 20 45 E bra 45 ;goto48 - cleanup and exit ; +; this could be the coin mech powerup message? CB95 F6 10 2F ../ ldab 102f ; read SCI data CB98 C4 EF .. andb #ef ; 11101111 CB9A C1 63 .c cmpb #63 ; 01101110 CB9C 26 1C &. bne 1c ; to cbba -CB9E CE 0B C1 ... ldx #0bc1 +CB9E CE 0B C1 ... ldx #0bc1 ; clear changer powerup error bit CBA1 1D 00 01 ... bclr 00,x, #01 CBA4 F6 0B C0 ... ldab 0bc0 -CBA7 C4 01 .. andb #01 -CBA9 27 0D '. beq 0d ; to cbb8 +CBA7 C4 01 .. andb #01 ; do we have a changer? +CBA9 27 0D '. beq 0d ; to cbb8 - cleanup & exit CBAB F6 0B C0 ... ldab 0bc0 -CBAE C4 04 .. andb #04 +CBAE C4 04 .. andb #04 ; if we don't have a card reader, we don't have an error reading from it. duh. CBB0 27 06 '. beq 06 ; to cbb8 CBB2 CE 0B C1 ... ldx #0bc1 -CBB5 1D 00 02 ... bclr 00,x, #02 +CBB5 1D 00 02 ... bclr 00,x, #02 ; clear card powerup error bit CBB8 20 20 bra 20 ;goto48 - cleanup & exit ; +; the coin mech is telling us it has a bad sensor CBBA F6 10 2F ../ ldab 102f ; read SCI data CBBD C4 EF .. andb #ef ; 11101111 CBBF C1 67 .g cmpb #67 ; 01100111 CBC1 26 08 &. bne 08 ; to cbcb CBC3 CE 0B C1 ... ldx #0bc1 -CBC6 1C 00 .. bset 00,x, #20 +CBC6 1C 00 .. bset 00,x, #20 ; set bad sensor error bit CBC9 20 0F bra 0f ;goto48 - cleanup & exit ; CBCB F6 10 2F ../ ldab 102f ; read SCI data @@ -9714,7 +9719,7 @@ CBCE C4 EF .. andb #ef ; 11101111 CBD0 C1 27 .' cmpb #27 ; 00100111 CBD2 26 06 &. bne 06 ;goto48 - cleanup & exit ; -CBD4 CE 0B C1 ... ldx #0bc1 +CBD4 CE 0B C1 ... ldx #0bc1 ; set coin jam error bit CBD7 1C 00 10 ... bset 00,x, #10 goto48: ; cleanup and exit CBDA CE 00 1A ... ldx #001a @@ -9733,15 +9738,18 @@ CBF9 7F 00 3D ..= clr 003d CBFC 7E CE 46 ~.F jmp ce46 ;goto47 (exit) ; goto44: -CBFF F6 0B C0 ... ldab 0bc0 +CBFF F6 0B C0 ... ldab 0bc0 ; do we have a changer? CC02 C4 02 .. andb #02 -CC04 26 03 &. bne 03 -CC06 7E CE 3B ~.; jmp ce3b ;goto54 - swallow 2 bytes & exit +CC04 26 03 &. bne 03 ; if so, swallow & exit +CC06 7E CE 3B ~.; jmp ce3b ; goto54 - swallow a byte & exit + ; else +; CC09 F6 10 2F ../ ldab 102f ; read SCI data CC0C C4 E0 .. andb #e0 CC0E C1 20 . cmpb #20 CC10 27 03 '. beq 03 -CC12 7E CE 3B ~.; jmp ce3b ;goto54 - swallow 2 bytes & exit +CC12 7E CE 3B ~.; jmp ce3b ;goto54 - swallow a byte & exit +; CC15 C6 32 .2 ldab #32 ; 50 CC17 F7 00 2F ../ stab 002f CC1A CE 00 1B ... ldx #001b @@ -10013,7 +10021,7 @@ CE35 4F O clra CE36 BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech goto55: CE39 20 0B . bra 0b ; to ce46 (exit) -goto54: ; just swallow two bytes? +goto54: ; just swallow a byte? CE3B F6 10 2E ... ldab 102e ; SCI Status CE3E 30 0 tsx CE3F E7 00 .. stab 00,x ; store into stack variable @@ -12201,7 +12209,7 @@ DF20 BD C7 E7 ... jsr c7e7 ;jump37 - send to serial port DF23 CE 00 1B ... ldx #001b DF26 1C 00 02 .. bset 00,x, #02 DF29 CE 0B C1 ... ldx #0bc1 -DF2C 1C 00 04 .. bset 00,x, #04 +DF2C 1C 00 04 .. bset 00,x, #04 ; set link powerup error bit DF2F F6 00 21 ..! ldab 0021 DF32 C4 20 . andb #20 DF34 27 07 '. beq 07 @@ -12294,7 +12302,7 @@ DFFD F6 0B C0 ... ldab 0bc0 E000 C4 08 .. andb #08 E002 27 52 'R beq 52 E004 F6 0B C1 ... ldab 0bc1 -E007 C4 08 .. andb #08 +E007 C4 08 .. andb #08 ; test bill error bit E009 26 08 &. bne 08 E00B FC 0B EF ... ldd 0bef E00E 83 00 64 ..d subd #0064 @@ -12658,7 +12666,7 @@ E326 BD D8 40 ..@ jsr d840 ;jump105 goto92: E329 BD E8 9A ... jsr e89a ;jump68 E32C CE 0B C1 ... ldx #0bc1 -E32F 1D 00 08 ... bclr 00,x, #08 +E32F 1D 00 08 ... bclr 00,x, #08 ; clear bill error bit E332 7E E5 5E ~.^ jmp e55e ;goto74 goto75: E335 F6 0B C0 ... ldab 0bc0 -- 2.20.1