From: Bernard Blackham Date: Mon, 4 Aug 2003 02:39:31 +0000 (+0000) Subject: stuff X-Git-Tag: ROMW~115 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=4ea08a808de214d65129b5e3240b6de4a60b8db6 stuff --- diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index 576324f..e0c0428 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -1,4 +1,4 @@ -;0000 +;0000 set to 1 at the end of a keypad read and turned off at the next rti ;0001 coin mask? (cf 0x001a, 0x3000, 0xc430) ;0003 global only used in jump71 ;0005 number of motors we have @@ -8,7 +8,7 @@ ;0009 ;000a ;000c -;0012 another buffer for 1800 +;0012 another buffer for 1800 - what change to give? ;0013 ;0014 buffer for 3800 register ;0015 @@ -44,6 +44,7 @@ ;005b last known keypad row 0 state ;005a - result of number to string operations (jump55) ; 005f +;0067 working space of 0bc0 ;0073 ;0076-0077 word ;007f @@ -60,7 +61,15 @@ ;0bbd ;0bd8 related to 0017 and 0021 (only lower 3 bits used) ;0bd9 also related -;0bc0 bit 0, 2, 1, 3 +;0bc0 machine capabilities flags +; bit0: have dumb mech +; bit1: +; bit2: have card reader +; bit3: have bill validator +; bit4: link master - price holding enabled +; bit5: link master - price display enabled +; bit6: have $1 changer +; bit7: free vend ;0bc1 error status: (from jump72) ; bit0: changer powerup ; bit1: card powerup @@ -69,14 +78,33 @@ ; bit4: coin jam ; bit5: bad sensor ; bit6: tube error -;0bc2 - 0bce SCI read into these locations -;0bd +; +; SCI read buffer: +; +;0bc2 multiplied by 10^0bc3 and stored into 0baa +;0bc3 10 is raise to the power of this number shr 4, and multiplied by 0baa +;0bc4 index of something +;0bc5 index of something else +;0bc6 index of another thing +;0bc7 word number of something +;0bc8 +;0bc9 word number of something else +;0bca +;0bcb word number of another thing +;0bcc +;0bcd word number of another else +;0bce +; ;0bc4 array index into 0bc7 ;0bc5 ;0bc6 another array index into 0bc7 ;0bc7 word array ; -;0be1 +;0bdd value of coin mech quarters +;0bdf value of coin mech dimes +;0be1 value of coin mech nickels + +; ;0bd7 init'd to 0x01 ;0bd8 init'd to 0x04 ;0bd9 init'd to 0x02 @@ -86,10 +114,22 @@ ; ;0cbc serial number (string) ;0ccc machine ID (string) -;0ce7 audit number (1-bit) +;0ce7 audit number (word) +; ;0cd9 counter of something - reset to 4 on some serial input ;0cda counter of something - reset to 4 on some serial input ;0cdb also counts something - reset to 4 on some serial input + +;0ce9 value or number of $1 coins +;0ceb value or number of 20c coins +;0ced value or number of 10c coins +;0cef value or number of 5c coins + +;0cdc number of value of $1 coins +;0cdb number or value of 20c coin +;0cda number or value of 10c coins +;0cd9 number or value of 5c coins + ;0dff - 0e04 keypad buffer - most recent in 0e04 ;0e05 array index of the array to follow ;0e06 - ?? array of digits*10 @@ -409,7 +449,7 @@ jump72: ; initial menu when door opens? 8100 F6 00 1D ... ldab 001d 8103 C4 10 .. andb #10 -8105 27 3D '= beq 3d +8105 27 3D '= beq 3d ; to 8144 8107 BD D6 52 ..R jsr d652 ;jump5 810A CE 00 1D ... ldx #001d 810D 1D 00 10 ... bclr 00,x, #10 @@ -431,6 +471,7 @@ jump72: 813B 7F 0E 02 ... clr 0e02 813E 7F 0E 03 ... clr 0e03 8141 7F 0E 04 ... clr 0e04 +; 8144 F6 00 42 ..B ldab 0042 8147 C1 0B .. cmpb #0b 8149 26 0F &. bne 0f @@ -916,6 +957,7 @@ jump14: 85BE 39 9 rts jump28: +; drop some change out of the changer? 85BF F6 00 12 ... ldab 0012 85C2 C4 1E .. andb #1e ; 00011110 85C4 4F O clra @@ -934,7 +976,7 @@ jump28: 85EC 7F 00 2C .., clr 002c 85EF F6 0C D9 ... ldab 0cd9 85F2 27 03 '. beq 03 -85F4 7A 0C D9 z.. dec 0cd9 +85F4 7A 0C D9 z.. dec 0cd9 ; decrement number of 5c coins 85F7 BD 97 F6 ... jsr 97f6 ;jump27 85FA CC 01 5E ..^ ldd #015e 85FD BD E5 71 ..q jsr e571 ;msdelay @@ -949,7 +991,7 @@ jump28: 8616 7F 00 2C .., clr 002c 8619 F6 0C DA ... ldab 0cda 861C 27 03 '. beq 03 -861E 7A 0C DA z.. dec 0cda +861E 7A 0C DA z.. dec 0cda ; decrement number of 10c coins 8621 BD 97 F6 ... jsr 97f6 ;jump27 8624 CC 01 5E ..^ ldd #015e 8627 BD E5 71 ..q jsr e571 ;msdelay @@ -964,7 +1006,7 @@ jump28: 8640 7F 00 2C .., clr 002c 8643 F6 0C DB ... ldab 0cdb 8646 27 03 '. beq 03 -8648 7A 0C DB z.. dec 0cdb +8648 7A 0C DB z.. dec 0cdb ; decrement number of 20c coins 864B BD 97 F6 ... jsr 97f6 ;jump27 864E CC 01 5E ..^ ldd #015e 8651 BD E5 71 ..q jsr e571 ;msdelay @@ -979,7 +1021,7 @@ jump28: 8669 7F 00 2C .., clr 002c 866C F6 0C DC ... ldab 0cdc 866F 27 03 '. beq 03 -8671 7A 0C DC z.. dec 0cdc +8671 7A 0C DC z.. dec 0cdc ; decrement number of $1 coins 8674 BD 97 F6 ... jsr 97f6 ;jump27 8677 CC 01 5E ..^ ldd #015e 867A BD E5 71 ..q jsr e571 ;msdelay @@ -3579,6 +3621,7 @@ jump142: 9E88 39 9 rts jump100: +; print out information to display 9E89 BD BE 4B ..K jsr be4b ;displayblank 9E8C F6 00 48 ..H ldab 0048 9E8F 4F O clra @@ -3824,7 +3867,7 @@ A0CC 4F O clra A0CD BD A3 1A ... jsr a31a ;jump93 A0D0 38 8 pulx A0D1 7E A1 C4 ~.. jmp a1c4 ;goto19 -A0D4 CC B3 F2 ... ldd #b3f2 +A0D4 CC B3 F2 ... ldd #b3f2 ; "DIMES" A0D7 BD C0 BA ... jsr c0ba ;display: A0DA 7E A1 C4 ~.. jmp a1c4 ;goto19 A0DD FE 0C ED ... ldx 0ced @@ -3834,7 +3877,7 @@ A0E4 4F O clra A0E5 BD A3 1A ... jsr a31a ;jump93 A0E8 38 8 pulx A0E9 7E A1 C4 ~.. jmp a1c4 ;goto19 -A0EC CC B4 04 ... ldd #b404 +A0EC CC B4 04 ... ldd #b404 ; "NICKELS" A0EF BD C0 BA ... jsr c0ba ;display: A0F2 7E A1 C4 ~.. jmp a1c4 ;goto19 A0F5 FE 0C EF ... ldx 0cef @@ -4080,6 +4123,7 @@ A318 38 8 pulx A319 39 9 rts jump93: +; write number to display A31A 37 7 pshb A31B 36 6 psha A31C 30 0 tsx @@ -4257,6 +4301,7 @@ A455 BD A3 6C ..l jsr a36c ;jump81 A458 39 9 rts jump110: +; some sort of defaults setting loading? plays with 0067 an awful lot A459 3C < pshx A45A F6 00 67 ..g ldab 0067 A45D C4 02 .. andb #02 @@ -7384,28 +7429,28 @@ B91C 7F 00 2C .., clr 002c B91F BD BE 01 ... jsr be01 ;jump70 write to display B922 C6 0A .. ldab #0a B924 F7 00 2C .., stab 002c -B927 7E BA 81 ~.. jmp ba81 ;goto27 +B927 7E BA 81 ~.. jmp ba81 ;goto27 - return goto25: B92A F6 0E 6D ..m ldab 0e6d B92D C1 01 .. cmpb #01 B92F 27 03 '. beq 03 -B931 7E BA 81 ~.. jmp ba81 ;goto27 +B931 7E BA 81 ~.. jmp ba81 ;goto27 - return B934 F6 0E 00 ... ldab 0e00 B937 C1 05 .. cmpb #05 B939 27 03 '. beq 03 -B93B 7E BA 81 ~.. jmp ba81 ;goto27 +B93B 7E BA 81 ~.. jmp ba81 ;goto27 - return B93E F6 0E 01 ... ldab 0e01 B941 C1 05 .. cmpb #05 B943 27 03 '. beq 03 -B945 7E BA 81 ~.. jmp ba81 ;goto27 +B945 7E BA 81 ~.. jmp ba81 ;goto27 - return B948 F6 0E 02 ... ldab 0e02 B94B C1 05 .. cmpb #05 B94D 27 03 '. beq 03 -B94F 7E BA 81 ~.. jmp ba81 ;goto27 +B94F 7E BA 81 ~.. jmp ba81 ;goto27 - return B952 F6 00 12 ... ldab 0012 B955 C4 20 . andb #20 ; test the door switch B957 26 03 &. bne 03 -B959 7E BA 81 ~.. jmp ba81 ;goto27 +B959 7E BA 81 ~.. jmp ba81 ;goto27 - return B95C F6 0E 04 ... ldab 0e04 B95F C1 05 .. cmpb #05 B961 26 79 &y bne 79 @@ -7463,22 +7508,26 @@ B9CE 7F 00 2C .., clr 002c B9D1 BD BE 01 ... jsr be01 ;jump70 - display B9D4 C6 1E .. ldab #1e B9D6 F7 00 2C .., stab 002c -B9D9 7E BA 81 ~.. jmp ba81 ;goto27 +B9D9 7E BA 81 ~.. jmp ba81 ;goto27 - return +; B9DC F6 0E 04 ... ldab 0e04 B9DF C1 01 .. cmpb #01 B9E1 27 0A '. beq 0a B9E3 F6 0E 04 ... ldab 0e04 B9E6 C1 02 .. cmpb #02 B9E8 27 03 '. beq 03 -B9EA 7E BA 81 ~.. jmp ba81 ;goto27 +B9EA 7E BA 81 ~.. jmp ba81 ;goto27 - return +; B9ED F6 0E 03 ... ldab 0e03 B9F0 C1 00 .. cmpb #00 B9F2 22 03 ". bhi 03 -B9F4 7E BA 81 ~.. jmp ba81 ;goto27 +B9F4 7E BA 81 ~.. jmp ba81 ;goto27 - return +; B9F7 F6 0E 03 ... ldab 0e03 B9FA C1 05 .. cmpb #05 B9FC 26 03 &. bne 03 -B9FE 7E BA 81 ~.. jmp ba81 ;goto27 +B9FE 7E BA 81 ~.. jmp ba81 ;goto27 - return +; BA01 F6 0E 03 ... ldab 0e03 BA04 C1 07 .. cmpb #07 BA06 24 79 $y bcc 79 @@ -8673,6 +8722,7 @@ C323 01 . nop C324 39 9 rts jump64: +; has a good long chat to the bill validator C325 F6 10 00 ... ldab 1000 C328 C4 01 .. andb #01 C32A 26 13 &. bne 13 @@ -8795,14 +8845,15 @@ C452 F7 30 00 .0. stab 3000 ; changer outputs again C455 39 9 rts jump47: +; coin have something to do with coin counting? C456 FC 00 40 ..@ ldd 0040 C459 26 03 &. bne 03 -C45B 7E C5 C6 ~.. jmp c5c6 ;goto39 +C45B 7E C5 C6 ~.. jmp c5c6 ;goto39 - unset 0x30 in 0021 & return C45E CE 00 1A ... ldx #001a C461 1C 00 01 .. bset 00,x, #01 C464 F6 00 1A ... ldab 001a C467 F7 30 00 .0. stab 3000 ; changer accept off -C46A CC 03 E8 ... ldd #03e8 +C46A CC 03 E8 ... ldd #03e8 ; 1000 C46D BD E5 71 ..q jsr e571 ;msdelay goto42: C470 FC 00 40 ..@ ldd 0040 @@ -8912,7 +8963,7 @@ C577 5F _ clrb C578 4F O clra C579 FD 00 40 ..@ std 0040 goto41: -C57C CC 01 2C .., ldd #012c +C57C CC 01 2C .., ldd #012c ;300 ms C57F BD E5 71 ..q jsr e571 ;msdelay C582 F6 00 1B ... ldab 001b C585 C4 20 . andb #20 @@ -8921,7 +8972,7 @@ C589 CE 00 1A ... ldx #001a C58C 1D 00 01 .. bclr 00,x, #01 C58F F6 00 1A ... ldab 001a C592 F7 30 00 .0. stab 3000 ; changer accept' low -C595 CC 00 0C ... ldd #000c +C595 CC 00 0C ... ldd #000c ; 12 ms C598 BD E5 71 ..q jsr e571 ;msdelay C59B CE 00 1A ... ldx #001a C59E 1C 00 01 .. bset 00,x, #01 @@ -8929,7 +8980,7 @@ C5A1 F6 00 1A ... ldab 001a C5A4 F7 30 00 .0. stab 3000 ; changer accept' high C5A7 CC 00 23 ..# ldd #0023 C5AA BD E5 71 ..q jsr e571 ;msdelay -C5AD 7E C4 70 ~.p jmp c470 ;goto42 +C5AD 7E C4 70 ~.p jmp c470 ;goto42 - loop goto40: C5B0 F6 0B C0 ... ldab 0bc0 C5B3 C4 04 .. andb #04 @@ -8944,8 +8995,8 @@ goto39: C5C6 CE 00 21 ..! ldx #0021 C5C9 1D 00 10 ... bclr 00,x, #10 C5CC CE 00 1B ... ldx #001b -C5CF 1D 00 .. bclr add,x 00,x -C5D1 20 39 9 bra 39 +C5CF 1D 00 .. bclr 00,x, #20 +C5D2 39 . rts jump6: C5D3 F6 00 15 ... ldab 0015 @@ -9350,7 +9401,7 @@ C943 25 12 %. bcs 12 ; to c957 C945 CE 00 17 ... ldx #0017 C948 1D 00 04 ... bclr 00,x, #04 C94B 7F 00 08 ... clr 0008 -C94E BD CE 48 ..H jsr ce48 ;jump48 +C94E BD CE 48 ..H jsr ce48 ;jump48 - update values? C951 7F 00 2C .., clr 002c C954 7E CA 5C ~.\ jmp ca5c ;goto50 - clean exit ; @@ -9425,9 +9476,9 @@ C9DD 20 7A z bra 7a ;goto51 - inc 0008 & clean exit C9DF F6 10 2F ../ ldab 102f ; read SCI data C9E2 F7 0B C4 ... stab 0bc4 C9E5 F6 0B C4 ... ldab 0bc4 -C9E8 C1 80 .. cmpb #80 +C9E8 C1 80 .. cmpb #80 ; if == 128 C9EA 26 05 &. bne 05 -C9EC C6 0F .. ldab #0f +C9EC C6 0F .. ldab #0f ; put 15 => 0bc4 C9EE F7 0B C4 ... stab 0bc4 C9F1 20 66 f bra 66 ;goto51 - inc 0008 & clean exit ; @@ -9531,7 +9582,7 @@ CABA 1C 00 .. bset 00,x, #20 CABD CE 00 1B ... ldx #001b CAC0 1D 00 40 ... bclr 00,x, #40 CAC3 7F 00 25 ..% clr 0025 -CAC6 7E CB 64 ~.d jmp cb64 ;goto53 +CAC6 7E CB 64 ~.d jmp cb64 ;goto53 - cleanup & exit ; CAC9 F6 00 17 ... ldab 0017 CACC C4 08 .. andb #08 @@ -9965,7 +10016,7 @@ CE39 20 0B . bra 0b ; to ce46 (exit) goto54: ; just swallow two bytes? CE3B F6 10 2E ... ldab 102e ; SCI Status CE3E 30 0 tsx -CE3F E7 00 .. stab 00,x +CE3F E7 00 .. stab 00,x ; store into stack variable CE41 F6 10 2F ../ ldab 102f ; read SCI data CE44 E7 00 .. stab 00,x goto47: @@ -10459,18 +10510,18 @@ D213 F6 00 1F ... ldab 001f D216 C4 04 .. andb #04 D218 26 12 &. bne 12 D21A F6 0B C0 ... ldab 0bc0 -D21D C4 10 .. andb #10 +D21D C4 10 .. andb #10 ; am i link master? D21F 26 0B &. bne 0b D221 CE 00 00 ... ldx #0000 D224 3C < pshx D225 FC 00 44 ..D ldd 0044 -D228 BD BE 9E ... jsr be9e ;jump50 +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 D234 F6 00 06 ... ldab 0006 -D237 BD D4 68 ..h jsr d468 ;jump51 +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 @@ -11051,13 +11102,13 @@ D66A 39 9 rts jump107: D66B F6 0B C0 ... ldab 0bc0 -D66E C4 08 .. andb #08 -D670 27 07 '. beq 07 +D66E C4 08 .. andb #08 ; we have a bill validator? +D670 27 07 '. beq 07 ; if not, to d679 D672 F6 00 7D ..} ldab 007d D675 27 02 '. beq 02 -D677 20 F9 . bra f9 +D677 20 F9 . bra f9 ; to d672 - wait for a bill? D679 F6 00 15 ... ldab 0015 -D67C 2D 77 -w blt 77 +D67C 2D 77 -w blt 77 ; return D67E FC 00 40 ..@ ldd 0040 D681 F3 00 3E ..> addd 003e D684 B3 00 0F ... subd 000f @@ -11108,6 +11159,7 @@ D6F5 39 9 rts jump106: ; puts (0cdb+0bdd)+(0cda*0bdf)+(0cd9*0be1) => 0bef +; calculates how much money we have in the coin mech!!!! D6F6 F6 0C DB ... ldab 0cdb D6F9 4F O clra D6FA 37 7 pshb @@ -11871,7 +11923,7 @@ DCC8 37 7 pshb DCC9 36 6 psha DCCA CE E1 00 ... ldx #e100 DCCD 3C < pshx -DCCE CC 05 F5 ... ldd #05f5 +DCCE CC 05 F5 ... ldd #05f5 ; 100000000 DCD1 37 7 pshb DCD2 36 6 psha DCD3 30 0 tsx @@ -12167,12 +12219,12 @@ DF4B 26 20 & bne 20 DF4D F6 00 1B ... ldab 001b DF50 C4 40 .@ andb #40 DF52 27 19 '. beq 19 -DF54 BD D6 52 ..R jsr d652 ;jump5 +DF54 BD D6 52 ..R jsr d652 ;jump5 - pulse bill acceptor DF57 FC 00 40 ..@ ldd 0040 DF5A 26 05 &. bne 05 DF5C FC 00 3E ..> ldd 003e DF5F 27 03 '. beq 03 -DF61 BD DB 44 ..D jsr db44 ;jump104 +DF61 BD DB 44 ..D jsr db44 ;jump104 - say thanks DF64 BD D6 6B ..k jsr d66b ;jump107 DF67 CE 00 1B ... ldx #001b DF6A 1D 00 40 ... bclr 00,x, #40 @@ -12297,7 +12349,7 @@ E074 BD E7 C7 ... jsr e7c7 ;jump114 E077 F6 00 06 ... ldab 0006 E07A C1 59 .Y cmpb #59 ; 89 E07C 26 06 &. bne 06 -E07E BD DE 09 ... jsr de09 ;jump119 +E07E BD DE 09 ... jsr de09 ;jump119 - display machine id E081 7E E5 5E ~.^ jmp e55e ;goto74 E084 F6 00 06 ... ldab 0006 E087 BD D4 68 ..h jsr d468 ;jump51 @@ -12587,7 +12639,7 @@ E2F2 24 15 $. bcc 15 E2F4 F6 00 11 ... ldab 0011 E2F7 C4 10 .. andb #10 E2F9 26 0E &. bne 0e -E2FB BD DB 44 ..D jsr db44 ;jump104 +E2FB BD DB 44 ..D jsr db44 ;jump104 - say thanks E2FE CE 00 1B ... ldx #001b E301 1D 00 40 ... bclr 00,x, #40 E304 7F 00 25 ..% clr 0025 @@ -12922,7 +12974,7 @@ E5C0 FC 00 3B ..; ldd 003b E5C3 27 06 '. beq 06 ; to e5cb E5C5 CC 02 33 ..3 ldd #0233 E5C8 FD 00 3B ..; std 003b -E5CB C6 02 .. ldab #02 +E5CB C6 02 .. ldab #02 ; make a beep E5CD F7 00 33 ..3 stab 0033 E5D0 39 9 rts @@ -14747,7 +14799,7 @@ F413 38 8 pulx F414 39 9 rts jump112: -; print a report? +; print a report to printer F415 F6 0B C0 ... ldab 0bc0 F418 C4 02 .. andb #02 F41A 27 15 '. beq 15 @@ -15023,7 +15075,7 @@ F6DF BD F1 5B ..[ jsr f15b ;jump53 F6E2 F6 00 19 ... ldab 0019 F6E5 C4 40 .@ andb #40 F6E7 26 07 &. bne 07 -F6E9 FE 0C E7 ... ldx 0ce7 +F6E9 FE 0C E7 ... ldx 0ce7 ;increment the audit number? F6EC 08 . inx F6ED FF 0C E7 ... stx 0ce7 F6F0 CE 00 1D ... ldx #001d @@ -15044,10 +15096,10 @@ F717 39 9 rts rti: F718 3C < pshx -F719 F6 0B C0 ... ldab 0bc0 +F719 F6 0B C0 ... ldab 0bc0 ; if we have a bill validator F71C C4 08 .. andb #08 F71E 27 03 '. beq 03 -F720 BD C3 25 ..% jsr c325 ;jump64 +F720 BD C3 25 ..% jsr c325 ;jump64 - go query the bill validator F723 7C 00 0C |.. inc 000c F726 F6 00 0C ... ldab 000c F729 C1 02 .. cmpb #02 @@ -15318,9 +15370,12 @@ F94F F7 00 35 ..5 stab 0035 ; ; end of power line test ; +; +; chat to the bill validator if we need to +; F952 F6 0B C0 ... ldab 0bc0 F955 C4 08 .. andb #08 -F957 27 16 '. beq 16 ; to f96f +F957 27 16 '. beq 16 ; to f96f if no bill validator F959 CE 00 02 ... ldx #0002 F95C 3C < pshx F95D CC 10 00 ... ldd #1000 @@ -15354,10 +15409,11 @@ F99C 26 03 &. bne 03 F99E BD D6 F6 ... jsr d6f6 ;jump106 F9A1 F6 00 12 ... ldab 0012 F9A4 C4 20 . andb #20 ; test door switch -F9A6 27 08 '. beq 08 +F9A6 27 08 '. beq 08 ; to f9b0 F9A8 F6 00 35 ..5 ldab 0035 F9AB 26 03 &. bne 03 F9AD 7E FA 79 ~.y jmp fa79 ;goto83 +; F9B0 CE 00 1F ... ldx #001f F9B3 1D 00 04 ... bclr 00,x, #04 F9B6 CE 00 1D ... ldx #001d @@ -15652,6 +15708,7 @@ FC23 31 1 ins FC24 39 9 rts jump85: +; long addition function? FC25 3C < pshx FC26 30 0 tsx FC27 E3 06 .. addd 06,x