From: Bernard Blackham Date: Thu, 7 Aug 2003 17:08:01 +0000 (+0000) Subject: motor findings X-Git-Tag: ROMW~92 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3c028aa7c0a5f826866d71c7d6a5c6bbb8838c97;p=uccvend-snackrom.git motor findings --- diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index fe7d7b2..72a6909 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -9,13 +9,16 @@ ;000a ;000c ;0012 another buffer for 1800 - what change to give? -;0013 +;0013 location of decimal point? ;0014 buffer for 3800 register ;0015 ;0016 new key state (cf 0029) ;0017 bits 5-7 used mostly ;0018 -;0019 +;0019 error statuses: +; bit 0 - over current +; bit 1 - home sensor failure +; bit 2 - check prices ;001a buffer for 3000 register - initialised to 7F ;001b bit 3 - denote motor fault? ;001c used for loop variables @@ -25,6 +28,7 @@ ; bit 5 denotes machine out of order ;0023 buffer for 1800 ;0026 used exclusively in SCI interrupt handler +;0027 price of current item ;0029 previous key state (cf 0016) ;002c inhibits display writes? ;0032 to do with the beeper (see jump52) @@ -1669,7 +1673,7 @@ goto7: 8C72 39 9 rts jump75: -;fetches a price for the given slot? +;fetches a price & other info for the given slot? 8C73 F6 00 06 ... ldab 0006 8C76 4F O clra 8C77 05 . asld @@ -1697,7 +1701,7 @@ jump75: 8CA1 84 08 .. anda #08 8CA3 27 08 '. beq 08 8CA5 CE 00 19 ... ldx #0019 -8CA8 1C 00 10 ... bset 00,x, #10 +8CA8 1C 00 10 ... bset 00,x, #10 ; corresponds to whatever '*' is on price display 8CAB 20 06 . bra 06 8CAD CE 00 19 ... ldx #0019 8CB0 1D 00 10 ... bclr 00,x, #10 @@ -2178,7 +2182,7 @@ jump21: 9126 7F 00 09 ... clr 0009 9129 7F 00 0A ... clr 000a 912C 39 9 rts - +; 912D F6 00 19 ... ldab 0019 9130 2C 28 ,( bge 28 9132 BD A9 CF ... jsr a9cf ;jump131 @@ -2258,10 +2262,8 @@ jump76: 91E2 7F 00 54 ..T clr 0054 91E5 7F 00 60 ..` clr 0060 91E8 CE 00 19 ... ldx #0019 -91EB 1D 00 .. bclr add,x 00,x -91ED 80 7F .. suba #7f -91EF 00 . test -91F0 36 6 psha +91EB 1D 00 80 .. bclr 00,x, #80 +91EE 7F 00 36 .. clr 0036 91F1 20 66 f bra 66 91F3 F6 00 0A ... ldab 000a 91F6 4F O clra @@ -2717,11 +2719,11 @@ jump203: 9623 26 21 &! bne 21 9625 BD D3 11 ... jsr d311 ;jump30 - test position exists 9628 83 00 00 ... subd #0000 -962B 26 0B &. bne 0b +962B 26 0B &. bne 0b ; to 9638 962D CE 00 1F ... ldx #001f -9630 1C 00 40 ... bset 00,x, #40 -9633 BD 8C 73 ..s jsr 8c73 ;jump75 -9636 20 06 . bra 06 +9630 1C 00 40 ... bset 00,x, #40 ; denotes an invalid slot or unmarked price? (fills display with XXX.XX) +9633 BD 8C 73 ..s jsr 8c73 ;jump75 - fetch slot info +9636 20 06 . bra 06 ; to 963e 9638 CE 00 1F ... ldx #001f 963B 1D 00 40 ... bclr 00,x, #40 963E 7F 00 2C .., clr 002c @@ -2737,25 +2739,21 @@ jump203: goto93: 965A 20 2B . bra 2b goto16: -965C F6 00 +. bmi f6 -965D 00 . test -965E 1D 2C ., bclr add,x 2c,x -9660 26 BD &. bne bd -9662 D2 13 83 ... sbcb 13 -9665 00 . test -9666 00 . test +965C F6 00 1D +. ldab 001d +965F 2C 26 ., bge 26 +9661 BD D2 13 &. jsr d213 ;jump45 +9664 83 00 00 ... subd #0000 9667 26 0F &. bne 0f 9669 CC 00 64 ..d ldd #0064 966C BD E5 71 ..q jsr e571 ;msdelay 966F BD E5 D1 ... jsr e5d1 ;jump52 - triple beep -9672 CC 03 84 ... ldd #0384 +9672 CC 03 84 ... ldd #0384 ; 900 9675 BD E5 71 ..q jsr e571 ;msdelay 9678 7F 00 2E ... clr 002e 967B CE 00 1D ... ldx #001d -967E 1D 00 .. bclr add,x 00,x -9680 80 CE .. suba #ce -9682 00 . test -9683 1F 1C 00 02 .... brclr 1c,x 00 02 +967E 1D 00 80 .. bclr 00,x, #80 +9680 CE 00 1F .. ldx #001f +9683 1C 00 02 ... bset 00,x #02 9687 39 9 rts jump148: @@ -3183,7 +3181,7 @@ jump39: 9A5F F7 0B 97 ... stab 0b97 9A62 F6 00 1F ... ldab 001f 9A65 C4 40 .@ andb #40 -9A67 27 45 'E beq 45 +9A67 27 45 'E beq 45 ; to 9aae 9A69 FC 00 27 ..' ldd 0027 9A6C BD E7 45 ..E jsr e745 ;jump55 - number to string 9A6F F6 00 5A ..Z ldab 005a @@ -3208,22 +3206,24 @@ jump39: 9AA3 F7 0B 91 ... stab 0b91 9AA6 F6 00 5F .._ ldab 005f 9AA9 F7 0B 90 ... stab 0b90 -9AAC 20 1E . bra 1e -9AAE C6 58 .X ldab #58 : "X" +9AAC 20 1E . bra 1e ; to 9acc +; +9AAE C6 58 .X ldab #58 ; "X" 9AB0 F7 0B 96 ... stab 0b96 -9AB3 C6 58 .X ldab #58 : "X" +9AB3 C6 58 .X ldab #58 ; "X" 9AB5 F7 0B 95 ... stab 0b95 -9AB8 C6 58 .X ldab #58 : "X" +9AB8 C6 58 .X ldab #58 ; "X" 9ABA F7 0B 94 ... stab 0b94 -9ABD C6 58 .X ldab #58 : "X" +9ABD C6 58 .X ldab #58 ; "X" 9ABF F7 0B 93 ... stab 0b93 -9AC2 C6 58 .X ldab #58 : "X" +9AC2 C6 58 .X ldab #58 ; "X" 9AC4 F7 0B 91 ... stab 0b91 -9AC7 C6 58 .X ldab #58 : "X" +9AC7 C6 58 .X ldab #58 ; "X" 9AC9 F7 0B 90 ... stab 0b90 +; 9ACC F6 00 13 ... ldab 0013 9ACF C1 01 .. cmpb #01 -9AD1 23 4C #L bls 4c +9AD1 23 4C #L bls 4c ; to 9b1f 9AD3 F6 0B 91 ... ldab 0b91 9AD6 F7 0B 90 ... stab 0b90 9AD9 F6 0B 92 ... ldab 0b92 @@ -3237,7 +3237,7 @@ jump39: 9AF0 26 07 &. bne 07 9AF2 C6 2E .. ldab #2e ; "." 9AF4 F7 0B 94 ... stab 0b94 -9AF7 20 26 & bra 26 +9AF7 20 26 & bra 26 ; to 9b1f 9AF9 C1 04 .. cmpb #04 9AFB 26 0D &. bne 0d 9AFD F6 0B 95 ... ldab 0b95 @@ -3253,9 +3253,12 @@ jump39: 9B17 F7 0B 95 ... stab 0b95 9B1A C6 2E .. ldab #2e 9B1C F7 0B 96 ... stab 0b96 +; 9B1F F6 00 2C .., ldab 002c 9B22 26 3E &> bne 3e 9B24 BD BE 69 ..i jsr be69 ;displayreset +95EB 00 . test +95EC 3A : abx 9B27 F6 00 13 ... ldab 0013 9B2A C1 01 .. cmpb #01 9B2C 23 2C #, bls 2c @@ -3503,7 +3506,7 @@ jump89: 9D77 F7 0B 90 ... stab 0b90 9D7A BD BE 01 ... jsr be01 ;jump70 9D7D 39 9 rts - +; 9D7E BD BE 4B ..K jsr be4b ;displayblank 9D81 F6 00 60 ..` ldab 0060 9D84 4F O clra @@ -4808,7 +4811,7 @@ A87B 31 1 ins A87C 31 1 ins A87D 2C 0A ,. bge 0a A87F F6 00 60 ..` ldab 0060 -A882 C1 F9 .. cmpb #f9 +A882 C1 F9 .. cmpb #f9 ; -7 A884 24 03 $. bcc 03 A886 7C 00 60 |.` inc 0060 A889 20 0A . bra 0a @@ -4822,19 +4825,19 @@ jump98: A896 F6 00 36 ..6 ldab 0036 A899 26 39 &9 bne 39 A89B F6 00 54 ..T ldab 0054 -A89E C1 27 .' cmpb #27 +A89E C1 27 .' cmpb #27 ; 39 A8A0 24 20 $ bcc 20 A8A2 7C 00 54 |.T inc 0054 A8A5 F6 00 09 ... ldab 0009 A8A8 C1 01 .. cmpb #01 A8AA 26 0C &. bne 0c A8AC F6 00 54 ..T ldab 0054 -A8AF C1 27 .' cmpb #27 +A8AF C1 27 .' cmpb #27 ; 39 A8B1 26 03 &. bne 03 A8B3 7F 00 54 ..T clr 0054 A8B6 20 0A . bra 0a A8B8 F6 00 54 ..T ldab 0054 -A8BB C1 24 .$ cmpb #24 +A8BB C1 24 .$ cmpb #24 ; 36 A8BD 26 03 &. bne 03 A8BF 7F 00 54 ..T clr 0054 A8C2 F6 00 54 ..T ldab 0054 @@ -4999,11 +5002,11 @@ AA06 F7 00 61 ..a stab 0061 AA09 39 9 rts jump130: -AA0A C6 53 .S ldab #53 +AA0A C6 53 .S ldab #53 ; 'S' AA0C F7 0C B9 ... stab 0cb9 -AA0F C6 29 .) ldab #29 +AA0F C6 29 .) ldab #29 ; ')' AA11 F7 0C BA ... stab 0cba -AA14 C6 20 . ldab #20 +AA14 C6 20 . ldab #20 ; ' ' AA16 F7 0C BB ... stab 0cbb AA19 7F 00 54 ..T clr 0054 AA1C F6 00 54 ..T ldab 0054 @@ -8451,7 +8454,7 @@ C10A F6 00 15 ... ldab 0015 C10D C4 1F .. andb #1f C10F 26 03 &. bne 03 C111 7E C3 1B ~.. jmp c31b ;goto34 -C114 C6 14 .. ldab #14 +C114 C6 14 .. ldab #14 ; 20 C116 F7 00 31 ..1 stab 0031 C119 F6 00 15 ... ldab 0015 C11C 2D 15 -. blt 15 @@ -10518,80 +10521,83 @@ D210 ED 00 .. std 00,x D212 39 9 rts jump45: +; dispense an item from slot 0006 D213 F6 00 1F ... ldab 001f D216 C4 04 .. andb #04 -D218 26 12 &. bne 12 +D218 26 12 &. bne 12 ; to d22c D21A F6 0B C0 ... ldab 0bc0 D21D C4 10 .. andb #10 ; have link master price holding -D21F 26 0B &. bne 0b +D21F 26 0B &. bne 0b ; to d22c D221 CE 00 00 ... ldx #0000 D224 3C < pshx D225 FC 00 44 ..D ldd 0044 D228 BD BE 9E ... jsr be9e ;jump50 - write slot & price to screen? D22B 38 8 pulx +; D22C BD D3 11 ... jsr d311 ;jump30 - test position exists D22F 83 00 00 ... subd #0000 -D232 27 13 '. beq 13 +D232 27 13 '. beq 13 ; to d247 D234 F6 00 06 ... ldab 0006 D237 BD D4 68 ..h jsr d468 ;jump51 - lookup in 0800 table & and with 8000 D23A 83 00 00 ... subd #0000 D23D 27 05 '. beq 05 -D23F 8D BC .. bsr bc ;jump90 -D241 BD D6 3C ..< jsr d63c ;jump33 +D23F 8D BC .. bsr bc ;jump90 - or entry in 0800 table of slot with #4000 +D241 BD D6 3C ..< jsr d63c ;jump33 - as above, but with #0400 D244 5F _ clrb D245 4F O clra D246 39 9 rts - +; D247 BD D1 3D ..= jsr d13d ;jump34 - motor on -D24A C6 3C .< ldab #3c +D24A C6 3C .< ldab #3c ; 60 D24C F7 00 2E ... stab 002e -D24F C6 41 .A ldab #41 +D24F C6 41 .A ldab #41 ; 65 D251 F7 00 31 ..1 stab 0031 D254 CE 00 1B ... ldx #001b D257 1D 00 08 ... bclr 00,x #08 goto59: D25A F6 00 1B ... ldab 001b D25D C4 08 .. andb #08 -D25F 26 22 &" bne 22 +D25F 26 22 &" bne 22 ; to d283 D261 F6 00 2E ... ldab 002e -D264 C1 35 .5 cmpb #35 +D264 C1 35 .5 cmpb #35 ; 53 D266 23 10 #. bls 10 -D268 BD D5 70 ..p jsr d570 ;jump35 +D268 BD D5 70 ..p jsr d570 ;jump35 - check home sensor departed D26B 83 00 00 ... subd #0000 -D26E 27 06 '. beq 06 +D26E 27 06 '. beq 06 ; to d276 D270 CE 00 1B ... ldx #001b D273 1C 00 08 ... bset 00,x, #08 -D276 20 0B . bra 0b +D276 20 0B . bra 0b ; to d283 +; something went afoul. mark the motor as bad? D278 BD D1 05 ... jsr d105 ;motors_off -D27B 8D 80 .. bsr 80 ;jump90 -D27D BD D6 3C ..< jsr d63c ;jump33 +D27B 8D 80 .. bsr 80 ;jump90 - mark motor as faulty? +D27D BD D6 3C ..< jsr d63c ;jump33 - mark motor as faulty? D280 5F _ clrb D281 4F O clra D282 39 9 rts - +; D283 F6 00 2E ... ldab 002e -D286 C1 36 .6 cmpb #36 +D286 C1 36 .6 cmpb #36 ; 54 D288 24 56 $V bcc 56 ; to d2e0 -D28A BD D5 F7 ... jsr d5f7 ;jump108 +D28A BD D5 F7 ... jsr d5f7 ;jump108 - check motor overcurrent D28D 83 00 00 ... subd #0000 D290 27 4E 'N beq 4e ; to d2e0 -D292 BD D5 B0 ... jsr d5b0 ;jump31 +D292 BD D5 B0 ... jsr d5b0 ;jump31 - check home sensor returned D295 83 00 00 ... subd #0000 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 -D2A2 22 07 ". bhi 07 -D2A4 8D 6B .k bsr dest 6b +D2A2 22 07 ". bhi 07 ; to d2ab +D2A4 8D 6B .k bsr 6b ;jump30 - test motor overvoltage? D2A6 83 00 00 ... subd #0000 -D2A9 27 0C '. beq 0c +D2A9 27 0C '. beq 0c ; to d2b7 D2AB BD D1 05 ... jsr d105 ;motors_off -D2AE BD D1 FD ... jsr d1fd ;jump90 -D2B1 BD D6 3C ..< jsr d63c ;jump33 +D2AE BD D1 FD ... jsr d1fd ;jump90 - mark motor as faulty? +D2B1 BD D6 3C ..< jsr d63c ;jump33 - mark motor as faulty? D2B4 5F _ clrb D2B5 4F O clra D2B6 39 9 rts - +; D2B7 F6 00 06 ... ldab 0006 D2BA 4F O clra D2BB C3 0E 06 ... addd #0e06 @@ -10614,10 +10620,10 @@ D2D9 33 3 pulb D2DA E7 00 .. stab 00,x D2DC CC 00 01 ... ldd #0001 D2DF 39 9 rts - +; D2E0 F6 00 2E ... ldab 002e D2E3 26 14 &. bne 14 -D2E5 BD D5 F7 ... jsr d5f7 ;jump108 +D2E5 BD D5 F7 ... jsr d5f7 ;jump108 - check motor overcurrent status D2E8 83 00 00 ... subd #0000 D2EB 26 0C &. bne 0c D2ED BD D1 05 ... jsr d105 ;motors_off @@ -10626,7 +10632,7 @@ D2F3 BD D6 26 ..& jsr d626 ;jump91 D2F6 5F _ clrb D2F7 4F O clra D2F8 39 9 rts - +; D2F9 F6 00 2E ... ldab 002e D2FC 26 0C &. bne 0c D2FE BD D1 05 ... jsr d105 ;motors_off @@ -10635,8 +10641,8 @@ D304 BD D6 3C ..< jsr d63c ;jump33 D307 5F _ clrb D308 4F O clra D309 39 9 rts - -D30A 7E D2 5A ~.Z jmp d25a ;goto59 +; +D30A 7E D2 5A ~.Z jmp d25a ;goto59 - try again? D30D BD E6 1B ... jsr e61b ;jump4 D310 39 9 rts @@ -11044,15 +11050,16 @@ D5F5 4F O clra D5F6 39 9 rts jump108: +; check motor overcurrent status D5F7 C6 07 .. ldab #07 D5F9 F7 00 1C ... stab 001c D5FC 7F 00 18 ... clr 0018 ; D5FF F6 00 1C ... ldab 001c -D602 27 1E '. beq 1e ; to d620 +D602 27 1E '. beq 1e ; to d622 D604 7A 00 1C z.. dec 001c D607 F6 10 0A ... ldab 100a -D60A C4 01 .. andb #01 +D60A C4 01 .. andb #01 ; motor overcurrent sense! D60C 26 12 &. bne 12 ; to d620 D60E C6 07 .. ldab #07 D610 F7 00 1C ... stab 001c