From: Bernard Blackham Date: Sat, 2 Aug 2003 17:20:57 +0000 (+0000) Subject: more findings X-Git-Tag: ROMW~125 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=7998f2a292d3b8a74893792933d257e9066e3ce3;p=uccvend-snackrom.git more findings --- diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index 60f07de..21a2497 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -1,6 +1,7 @@ ;0000 ;0001 coin mask? (cf 0x001a, 0x3000, 0xc430) ;0003 global only used in jump71 +;0005 number of motors we have ;0006 slot number ;0007 06 stored into it sometimes. ;0008 used exclusively in SCI interrupt @@ -25,7 +26,7 @@ ;0026 used exclusively in SCI interrupt handler ;0029 previous key state (cf 0016) ;002c inhibits display writes? -;0032 +;0032 to do with the beeper ;0033 ;0035 only ever contains #1e ;003b commonly contains $0233 @@ -35,11 +36,12 @@ ;0048 error status ;004a ;0052 win-a-snack odds (in ram) +;0054 0..100 ;0056 last known keypad row 1 state ;005b last known keypad row 0 state -;005d -;005e Y in location XY (row?) -;005f X in location XY (column?) +;005d dollars +;005e Y in location XY (row?) cents1 +;005f X in location XY (column?) cents2 ;0073 ;0076-0077 word ;007f @@ -383,6 +385,7 @@ 80FF 05 . asld jump72: +; initial menu when door opens? 8100 F6 00 1D ... ldab 001d 8103 C4 10 .. andb #10 8105 27 3D '= beq 3d @@ -1113,11 +1116,12 @@ goto4: 87E8 39 9 rts jump74: +;motor count procedure 87E9 7F 00 05 ... clr 0005 87EC 7F 00 54 ..T clr 0054 87EF F6 00 54 ..T ldab 0054 -87F2 C1 50 .P cmpb #50 -87F4 24 2E $. bcc 2e +87F2 C1 50 .P cmpb #50 ; 80 +87F4 24 2E $. bcc 2e ; to 8824 87F6 F6 00 54 ..T ldab 0054 87F9 4F O clra 87FA C3 B0 D3 ... addd #b0d3 @@ -1128,7 +1132,7 @@ jump74: 8806 BD D7 A0 ... jsr d7a0 ;is_invalid_slot 8809 83 00 00 ... subd #0000 880C 26 11 &. bne 11 -880E BD D3 11 ... jsr d311 ;jump30 +880E BD D3 11 ... jsr d311 ;jump30 - test it 8811 83 00 00 ... subd #0000 8814 26 03 &. bne 03 8816 7C 00 05 |.. inc 0005 @@ -1136,7 +1140,7 @@ jump74: 881C BD E5 71 ..q jsr e571 ;msdelay 881F 7C 00 54 |.T inc 0054 8822 20 CB . bra cb -8824 BD 99 81 ... jsr 9981 ;jump144 +8824 BD 99 81 ... jsr 9981 ;jump144 - write "MOTORS XX" (from 0005) 8827 CC 07 D0 ... ldd #07d0 882A BD E5 71 ..q jsr e571 ;msdelay 882D 39 9 rts @@ -1297,7 +1301,7 @@ jump17: 899B BD D7 A0 ... jsr d7a0 ;is_invalid_slot 899E 83 00 00 ... subd #0000 89A1 26 27 &' bne 27 ; to 89ca -89A3 BD D3 11 ... jsr d311 ;jump30 +89A3 BD D3 11 ... jsr d311 ;jump30 - test position exists 89A6 83 00 00 ... subd #0000 89A9 26 0B &. bne 0b 89AB CE 00 1F ... ldx #001f @@ -1306,7 +1310,7 @@ jump17: 89B4 20 0F . bra 0f 89B6 CE 00 1F ... ldx #001f 89B9 1D 00 40 .. bclr 00,x, #40 -89BC CC 2A FF .*. ldd #2aff +89BC CC 2A FF .*. ldd #2aff ; 00101010 11111111 89BF FD 00 27 ..' std 0027 89C2 BD A3 85 ... jsr a385 ;jump40 89C5 BD 9A 47 ..G jsr 9a47 ;jump39 @@ -1578,7 +1582,7 @@ goto9: 8C3C C4 7F .. andb #7f 8C3E 4F O clra 8C3F FD 00 46 ..F std 0046 -8C42 BD D3 11 ... jsr d311 ;jump30 +8C42 BD D3 11 ... jsr d311 ;jump30 - test position exists 8C45 83 00 00 ... subd #0000 8C48 26 12 &. bne 12 8C4A CE 00 1F ... ldx #001f @@ -2519,28 +2523,30 @@ jump24: 94FB 4F O clra 94FC BD FE 32 ..2 jsr fe32 ;jump25 94FF 95 19 00 00 .... ; no key -9503 95 21 00 01 .!.. ; key 1 -9507 95 2C 00 01 .,.. ; key 2 -950B 95 30 00 01 .0.. ; key 3 +9503 95 21 00 01 .!.. ; key 1 - motor count procedure +9507 95 2C 00 01 .,.. ; key 2 - single test vend +950B 95 30 00 01 .0.. ; key 3 - test vend everything 950F 95 35 00 08 .5.. ; reset 9513 95 38 FF F5 .8.. 9517 00 00 .. ; end of array data 9519 CC B0 A2 ... ldd #b0a2 ; "MTR FUNCT?" 951C BD C0 BA ... jsr c0ba ;display: 951F 20 1D . bra 1d -9521 BD 87 E9 ... jsr 87e9 ;jump74 +9521 BD 87 E9 ... jsr 87e9 ;jump74 - motor count procedure 9524 CE 00 1F ... ldx #001f 9527 1C 00 02 ... bset 00,x, #02 952A 20 12 . bra 12 -952C 8D 11 .. bsr dest 11 +952C 8D 11 .. bsr dest 11 ;jump203 - test single vend 952E 20 0E . bra 0e -9530 BD 96 88 ... jsr 9688 ;jump148 +9530 BD 96 88 ... jsr 9688 ;jump148 - test all vends 9533 20 09 . bra 09 9535 BD 85 AF ... jsr 85af ;jump14 9538 7F 00 09 ... clr 0009 953B 7F 00 0A ... clr 000a 953E 39 9 rts -; + +jump203: +; test a single vend 953F F6 00 19 ... ldab 0019 9542 2D 0A -. blt 0a 9544 F6 00 3A ..: ldab 003a @@ -2642,7 +2648,7 @@ jump24: 961D BD D7 A0 ... jsr d7a0 ;is_invalid_slot 9620 83 00 00 ... subd #0000 9623 26 21 &! bne 21 -9625 BD D3 11 ... jsr d311 ;jump30 +9625 BD D3 11 ... jsr d311 ;jump30 - test position exists 9628 83 00 00 ... subd #0000 962B 26 0B &. bne 0b 962D CE 00 1F ... ldx #001f @@ -2690,14 +2696,14 @@ jump24: 9687 39 9 rts jump148: +;tests all vends 9688 34 4 des 9689 F6 00 19 ... ldab 0019 968C 2C 19 ,. bge 19 968E CE 00 19 ... ldx #0019 -9691 1D 00 .. bclr add,x 00,x -9693 80 CC .. suba #cc -9695 B0 97 BD ... suba 97bd -9698 C0 BA .. subb #ba +9691 1D 00 80 .. bclr 00,x, #80 +9694 CC B0 97 ... ldd #b097 ; "TEST VEND" +9697 BD C0 BA ... jsr c0ba ; display 969A C6 0A .. ldab #0a 969C F7 00 38 ..8 stab 0038 969F 7F 00 05 ... clr 0005 @@ -2705,27 +2711,27 @@ jump148: 96A4 F7 00 06 ... stab 0006 96A7 F6 00 0A ... ldab 000a 96AA C1 0B .. cmpb #0b -96AC 26 0C &. bne 0c +96AC 26 0C &. bne 0c ; to 96ba 96AE CC 02 33 ..3 ldd #0233 96B1 FD 00 3B ..; std 003b 96B4 CE 00 1F ... ldx #001f 96B7 1C 00 02 ... bset 00,x, #02 96BA F6 00 38 ..8 ldab 0038 96BD 27 03 '. beq 03 -96BF 7E 97 6D ~.m jmp 976d ;goto17 +96BF 7E 97 6D ~.m jmp 976d ;goto17 - return 96C2 F6 00 06 ... ldab 0006 -96C5 C1 63 .c cmpb #63 +96C5 C1 63 .c cmpb #63 ; exit if >63 96C7 23 03 #. bls 03 -96C9 7E 97 6D ~.m jmp 976d ;goto17 +96C9 7E 97 6D ~.m jmp 976d ;goto17 - return 96CC F6 00 06 ... ldab 0006 96CF C1 63 .c cmpb #63 96D1 26 0F &. bne 0f -96D3 BD 99 C3 ... jsr 99c3 ;jump143 -96D6 CC 07 D0 ... ldd #07d0 +96D3 BD 99 C3 ... jsr 99c3 ;jump143 - write "VENDS XXX" (from 0005) +96D6 CC 07 D0 ... ldd #07d0 ; 2000 96D9 BD E5 71 ..q jsr e571 ;msdelay 96DC CE 00 1F ... ldx #001f 96DF 1C 00 02 ... bset 00,x, #02 -96E2 BD D3 11 ... jsr d311 ;jump30 +96E2 BD D3 11 ... jsr d311 ;jump30 - test position exists 96E5 83 00 00 ... subd #0000 96E8 26 0B &. bne 0b 96EA CE 00 1F ... ldx #001f @@ -2862,7 +2868,7 @@ jump27: 980C 98 65 .. 980E F6 0C D9 .. ldab 0cd9 9811 4F . clra -9812 BD E7 95 ... jsr e795 ;jump54 +9812 BD E7 95 ... jsr e795 ;jump54 - number to string 9815 C6 4E .N ldab #4e 9817 F7 0B 99 ... stab 0b99 981A C6 49 .I ldab #49 @@ -2874,7 +2880,7 @@ jump27: 9829 20 55 U bra 55 982B F6 0C DA ... ldab 0cda 982E 4F O clra -982F BD E7 95 ... jsr e795 ;jump54 +982F BD E7 95 ... jsr e795 ;jump54 - number to string 9832 C6 44 .D ldab #44 9834 F7 0B 99 ... stab 0b99 9837 C6 49 .I ldab #49 @@ -2886,7 +2892,7 @@ jump27: 9846 20 38 8 bra 38 9848 F6 0C DB ... ldab 0cdb 984B 4F O clra -984C BD E7 95 ... jsr e795 ;jump54 +984C BD E7 95 ... jsr e795 ;jump54 - number to string 984F C6 51 .Q ldab #51 9851 F7 0B 99 ... stab 0b99 9854 C6 55 .U ldab #55 @@ -2898,7 +2904,7 @@ jump27: 9863 20 1B . bra 1b 9865 F6 0C DC ... ldab 0cdc 9868 4F O clra -9869 BD E7 95 ... jsr e795 ;jump54 +9869 BD E7 95 ... jsr e795 ;jump54 - number to string 986C C6 44 .D ldab #44 ; "D" 986E F7 0B 99 ... stab 0b99 9871 C6 4F .O ldab #4f ; "O" @@ -2923,15 +2929,16 @@ jump27: 98A4 39 9 rts jump11: +; prints contents of 0054 to display 98A5 BD BE 4B ..K jsr be4b ;displayblank 98A8 F6 00 54 ..T ldab 0054 98AB 4F O clra -98AC BD E7 95 ... jsr e795 ;jump54 -98AF F6 00 5E ..^ ldab 005e +98AC BD E7 95 ... jsr e795 ; slot number to digits +98AF F6 00 5E ..^ ldab 005e 98B2 F7 0B 95 ... stab 0b95 98B5 F6 00 5F .._ ldab 005f 98B8 F7 0B 94 ... stab 0b94 -98BB BD BE 01 ... jsr be01 ;jump70 +98BB BD BE 01 ... jsr be01 ;jump70 - write to display 98BE 39 9 rts jump146: @@ -3015,53 +3022,55 @@ jump145: 9980 39 9 rts jump144: +; writes "MOTORS XX" where XX is the slot number in 0005 9981 BD BE 4B ..K jsr be4b ;displayblank 9984 F6 00 05 ... ldab 0005 9987 4F O clra -9988 BD E7 95 ... jsr e795 ;jump54 -998B C6 4D .M ldab #4d +9988 BD E7 95 ... jsr e795 ;jump54 - number to string +998B C6 4D .M ldab #4d ; "M" 998D F7 0B 99 ... stab 0b99 -9990 C6 4F .O ldab #4f +9990 C6 4F .O ldab #4f ; "O" 9992 F7 0B 98 ... stab 0b98 -9995 C6 54 .T ldab #54 +9995 C6 54 .T ldab #54 ; "T" 9997 F7 0B 97 ... stab 0b97 -999A C6 4F .O ldab #4f +999A C6 4F .O ldab #4f ; "O" 999C F7 0B 96 ... stab 0b96 -999F C6 52 .R ldab #52 +999F C6 52 .R ldab #52 ; "R" 99A1 F7 0B 95 ... stab 0b95 -99A4 C6 53 .S ldab #53 +99A4 C6 53 .S ldab #53 ; "S" 99A6 F7 0B 94 ... stab 0b94 -99A9 C6 20 . ldab #20 +99A9 C6 20 . ldab #20 ; " " 99AB F7 0B 93 ... stab 0b93 -99AE C6 20 . ldab #20 +99AE C6 20 . ldab #20 ; " " 99B0 F7 0B 92 ... stab 0b92 99B3 F6 00 5E ..^ ldab 005e 99B6 F7 0B 91 ... stab 0b91 99B9 F6 00 5F .._ ldab 005f 99BC F7 0B 90 ... stab 0b90 -99BF BD BE 01 ... jsr be01 ;jump70 +99BF BD BE 01 ... jsr be01 ;jump70 - display 99C2 39 9 rts jump143: +; writes VENDS XX where XX is contents of 0005 99C3 BD BE 4B ..K jsr be4b ;displayblank 99C6 F6 00 05 ... ldab 0005 99C9 4F O clra -99CA BD E7 95 ... jsr e795 ;jump54 -99CD C6 56 .V ldab #56 +99CA BD E7 95 ... jsr e795 ;jump54 - number to string +99CD C6 56 .V ldab #56 ; "V" 99CF F7 0B 99 ... stab 0b99 -99D2 C6 45 .E ldab #45 +99D2 C6 45 .E ldab #45 ; "E" 99D4 F7 0B 98 ... stab 0b98 -99D7 C6 4E .N ldab #4e +99D7 C6 4E .N ldab #4e ; "N" 99D9 F7 0B 97 ... stab 0b97 -99DC C6 44 .D ldab #44 +99DC C6 44 .D ldab #44 ; "D" 99DE F7 0B 96 ... stab 0b96 -99E1 C6 53 .S ldab #53 +99E1 C6 53 .S ldab #53 ; "S" 99E3 F7 0B 95 ... stab 0b95 -99E6 C6 20 . ldab #20 +99E6 C6 20 . ldab #20 ; " " 99E8 F7 0B 94 ... stab 0b94 -99EB C6 20 . ldab #20 +99EB C6 20 . ldab #20 ; " " 99ED F7 0B 93 ... stab 0b93 -99F0 C6 20 . ldab #20 +99F0 C6 20 . ldab #20 ; " " 99F2 F7 0B 92 ... stab 0b92 99F5 F6 00 5E ..^ ldab 005e 99F8 F7 0B 91 ... stab 0b91 @@ -3073,7 +3082,7 @@ jump143: jump102: 9A05 BD BE 4B ..K jsr be4b ;displayblank 9A08 FC 00 52 ..R ldd 0052 -9A0B BD E7 45 ..E jsr e745 ;jump55 +9A0B BD E7 45 ..E jsr e745 ;jump55 - number to string 9A0E C6 4F .O ldab #4f ; "O" 9A10 F7 0B 99 ... stab 0b99 9A13 C6 44 .D ldab #44 ; "D" @@ -3101,7 +3110,7 @@ jump39: 9A47 BD BE 4B ..K jsr be4b ;displayblank 9A4A F6 00 06 ... ldab 0006 9A4D 4F O clra -9A4E BD E7 95 ... jsr e795 ;jump54 +9A4E BD E7 95 ... jsr e795 ;jump54 - number to string 9A51 F6 00 5E ..^ ldab 005e 9A54 F7 0B 99 ... stab 0b99 9A57 F6 00 5F .._ ldab 005f @@ -3112,7 +3121,7 @@ jump39: 9A65 C4 40 .@ andb #40 9A67 27 45 'E beq 45 9A69 FC 00 27 ..' ldd 0027 -9A6C BD E7 45 ..E jsr e745 ;jump55 +9A6C BD E7 45 ..E jsr e745 ;jump55 - number to string 9A6F F6 00 5A ..Z ldab 005a 9A72 F7 0B 96 ... stab 0b96 9A75 F6 00 5D ..] ldab 005d @@ -3130,7 +3139,7 @@ jump39: 9A95 C6 20 . ldab #20 9A97 F7 0B 92 ... stab 0b92 9A9A FC 00 46 ..F ldd 0046 -9A9D BD E7 45 ..E jsr e745 ;jump55 +9A9D BD E7 45 ..E jsr e745 ;jump55 - number to string 9AA0 F6 00 5E ..^ ldab 005e 9AA3 F7 0B 91 ... stab 0b91 9AA6 F6 00 5F .._ ldab 005f @@ -3213,7 +3222,7 @@ jump39: jump101: 9B63 BD BE 4B ..K jsr be4b ;displayblank 9B66 FC 00 0D ... ldd 000d -9B69 BD E7 45 ..E jsr e745 ;jump55 +9B69 BD E7 45 ..E jsr e745 ;jump55 - number to string 9B6C C6 44 .D ldab #44 9B6E F7 0B 99 ... stab 0b99 9B71 C6 53 .S ldab #53 @@ -3400,7 +3409,7 @@ jump89: 9D2A BD BE 4B ..K jsr be4b ;displayblank 9D2D F6 00 22 .." ldab 0022 9D30 4F O clra -9D31 BD E7 95 ... jsr e795 ;jump54 +9D31 BD E7 95 ... jsr e795 ;jump54 - number to string 9D34 F6 00 5E ..^ ldab 005e 9D37 F7 0B 99 ... stab 0b99 9D3A F6 00 5F .._ ldab 005f @@ -3409,7 +3418,7 @@ jump89: 9D42 F7 0B 97 ... stab 0b97 9D45 F6 00 24 ..$ ldab 0024 9D48 4F O clra -9D49 BD E7 95 ... jsr e795 ;jump54 +9D49 BD E7 95 ... jsr e795 ;jump54 - number to string 9D4C C6 50 .P ldab #50 9D4E F7 0B 96 ... stab 0b96 9D51 F6 00 5E ..^ ldab 005e @@ -3420,7 +3429,7 @@ jump89: 9D5F F7 0B 93 ... stab 0b93 9D62 F6 00 2A ..* ldab 002a 9D65 4F O clra -9D66 BD E7 95 ... jsr e795 ;jump54 +9D66 BD E7 95 ... jsr e795 ;jump54 - number to string 9D69 C6 46 .F ldab #46 9D6B F7 0B 92 ... stab 0b92 9D6E F6 00 5E ..^ ldab 005e @@ -3627,7 +3636,7 @@ jump100: 9F34 BD A2 D4 ... jsr a2d4 ;jump79 9F37 38 8 pulx 9F38 7E A1 C4 ~.. jmp a1c4 ;goto19 -9F3B CC B2 C6 ... ldd #b2c6 +9F3B CC B2 C6 ... ldd #b2c6 ; "SALES (R) " 9F3E BD C0 BA ... jsr c0ba ;display: 9F41 7E A1 C4 ~.. jmp a1c4 ;goto19 9F44 FE 0D E9 ... ldx 0de9 @@ -3636,7 +3645,7 @@ jump100: 9F4B BD A3 41 ..A jsr a341 ;jump77 9F4E 38 8 pulx 9F4F 7E A1 C4 ~.. jmp a1c4 ;goto19 -9F52 CC B2 D8 ... ldd #b2d8 +9F52 CC B2 D8 ... ldd #b2d8 ; "SALES (N) " 9F55 BD C0 BA ... jsr c0ba ;display: 9F58 7E A1 C4 ~.. jmp a1c4 ;goto19 9F5B FE 0D ED ... ldx 0ded @@ -3645,7 +3654,7 @@ jump100: 9F62 BD A3 41 ..A jsr a341 ;jump77 9F65 38 8 pulx 9F66 7E A1 C4 ~.. jmp a1c4 ;goto19 -9F69 CC B2 EA ... ldd #b2ea +9F69 CC B2 EA ... ldd #b2ea ; "BAG TOTAL" 9F6C BD C0 BA ... jsr c0ba ;display: 9F6F 7E A1 C4 ~.. jmp a1c4 ;goto19 9F72 FE 0D F1 ... ldx 0df1 @@ -3654,7 +3663,7 @@ jump100: 9F79 BD A3 41 ..A jsr a341 ;jump77 9F7C 38 8 pulx 9F7D 7E A1 C4 ~.. jmp a1c4 ;goto19 -9F80 CC B2 FC ... ldd #b2fc +9F80 CC B2 FC ... ldd #b2fc ; "CASH BOX" 9F83 BD C0 BA ... jsr c0ba ;display: 9F86 7E A1 C4 ~.. jmp a1c4 ;goto19 9F89 FE 0D F9 ... ldx 0df9 @@ -3663,7 +3672,7 @@ jump100: 9F90 BD A3 41 ..A jsr a341 ;jump77 9F93 38 8 pulx 9F94 7E A1 C4 ~.. jmp a1c4 ;goto19 -9F97 CC B3 0E ... ldd #b30e +9F97 CC B3 0E ... ldd #b30e ; "CARD SALES" 9F9A BD C0 BA ... jsr c0ba ;display: 9F9D 7E A1 C4 ~.. jmp a1c4 ;goto19 9FA0 FE 0D FD ... ldx 0dfd @@ -3672,7 +3681,7 @@ jump100: 9FA7 BD A3 41 ..A jsr a341 ;jump77 9FAA 38 8 pulx 9FAB 7E A1 C4 ~.. jmp a1c4 ;goto19 -9FAE CC B3 35 ..5 ldd #b335 +9FAE CC B3 35 ..5 ldd #b335 ; "BILL TOTAL" 9FB1 BD C0 BA ... jsr c0ba ;display: 9FB4 7E A1 C4 ~.. jmp a1c4 ;goto19 9FB7 FE 0D F5 ... ldx 0df5 @@ -3765,7 +3774,7 @@ A083 FC 0D 03 ... ldd 0d03 A086 BD A3 41 ..A jsr a341 ;jump77 A089 38 8 pulx A08A 7E A1 C4 ~.. jmp a1c4 ;goto19 -A08D CC B3 B7 ... ldd #b3b7 +A08D CC B3 B7 ... ldd #b3b7 ; "TUBE TOTAL" A090 BD C0 BA ... jsr c0ba ;display: A093 7E A1 C4 ~.. jmp a1c4 ;goto19 A096 CE 00 01 ... ldx #0001 @@ -3774,7 +3783,7 @@ A09A FC 0C F1 ... ldd 0cf1 A09D BD A2 D4 ... jsr a2d4 ;jump79 A0A0 38 8 pulx A0A1 7E A1 C4 ~.. jmp a1c4 ;goto19 -A0A4 CC B3 CE ... ldd #b3ce +A0A4 CC B3 CE ... ldd #b3ce ; "$1 COIN" A0A7 BD C0 BA ... jsr c0ba ;display: A0AA 7E A1 C4 ~.. jmp a1c4 ;goto19 A0AD FE 0C E9 ... ldx 0ce9 @@ -3784,7 +3793,7 @@ A0B4 4F O clra A0B5 BD A3 1A ... jsr a31a ;jump93 A0B8 38 8 pulx A0B9 7E A1 C4 ~.. jmp a1c4 ;goto19 -A0BC CC B3 E0 ... ldd #b3e0 +A0BC CC B3 E0 ... ldd #b3e0 ; "QUARTERS" A0BF BD C0 BA ... jsr c0ba ;display: A0C2 7E A1 C4 ~.. jmp a1c4 ;goto19 A0C5 FE 0C EB ... ldx 0ceb @@ -3894,7 +3903,7 @@ A1B5 FC 0D 1B ... ldd 0d1b A1B8 BD A3 41 ..A jsr a341 ;jump77 A1BB 38 8 pulx A1BC 20 06 . bra 06 -A1BE CC B4 84 ... ldd #b484 +A1BE CC B4 84 ... ldd #b484 ; "VENDS/CODE" A1C1 BD C0 BA ... jsr c0ba ;display: goto19: A1C4 F6 00 48 ..H ldab 0048 @@ -3920,7 +3929,7 @@ A1ED 20 E3 . bra e3 A1EF F6 00 48 ..H ldab 0048 A1F2 4F O clra A1F3 C3 FF D2 ... addd #ffd2 -A1F6 BD E7 95 ... jsr e795 ;jump54 +A1F6 BD E7 95 ... jsr e795 ;jump54 - number to string A1F9 F6 00 5E ..^ ldab 005e A1FC F7 0B 99 ... stab 0b99 A1FF F6 00 5F .._ ldab 005f @@ -3931,7 +3940,7 @@ A209 05 . asld A20A C3 0C C3 ... addd #0cc3 A20D 8F . xgdx A20E EC 00 .. ldd 00,x -A210 BD E7 45 ..E jsr e745 ;jump55 +A210 BD E7 45 ..E jsr e745 ;jump55 - number to string A213 F6 00 57 ..W ldab 0057 A216 F7 0B 94 ... stab 0b94 A219 F6 00 5A ..Z ldab 005a @@ -3955,10 +3964,10 @@ A244 26 15 &. bne 15 A246 F6 00 1F ... ldab 001f A249 C4 10 .. andb #10 A24B 27 08 '. beq 08 -A24D CC AF 9A ... ldd #af9a +A24D CC AF 9A ... ldd #af9a ; "CLR MIS Y" A250 BD C0 BA ... jsr c0ba ;display: A253 20 06 . bra 06 -A255 CC AF A5 ... ldd #afa5 +A255 CC AF A5 ... ldd #afa5 ; "CLR MIS N" A258 BD C0 BA ... jsr c0ba ;display: A25B 39 9 rts @@ -4020,7 +4029,7 @@ A2D4 37 7 pshb A2D5 36 6 psha A2D6 30 0 tsx A2D7 EC 00 .. ldd 00,x -A2D9 BD E7 45 ..E jsr e745 ;jump55 +A2D9 BD E7 45 ..E jsr e745 ;jump55 - number to string A2DC F6 00 57 ..W ldab 0057 A2DF F7 0B 94 ... stab 0b94 A2E2 F6 00 5A ..Z ldab 005a @@ -4054,7 +4063,7 @@ A31B 36 6 psha A31C 30 0 tsx A31D E6 01 .. ldab 01,x A31F 4F O clra -A320 BD E7 95 ... jsr e795 ;jump54 +A320 BD E7 95 ... jsr e795 ;jump54 - number to string A323 F6 00 5D ..] ldab 005d A326 F7 0B 99 ... stab 0b99 A329 F6 00 5E ..^ ldab 005e @@ -4175,7 +4184,7 @@ A3F9 38 8 pulx A3FA 8F . xgdx A3FB ED 00 .. std 00,x A3FD 20 22 " bra 22 -A3FF CC 2A FF .*. ldd #2aff +A3FF CC 2A FF .*. ldd #2aff ; 00101010 11111111 A402 37 7 pshb A403 36 6 psha A404 F6 00 06 ... ldab 0006 @@ -5113,7 +5122,7 @@ AB86 20 8C . bra 8c AB88 39 9 rts jump7: -AB89 CC B0 8C ... ldd #b08c +AB89 CC B0 8C ... ldd #b08c ; "NO ERRORS" AB8C BD C0 BA ... jsr c0ba ;display: AB8F CC 01 F4 ... ldd #01f4 AB92 BD E5 71 ..q jsr e571 ;msdelay @@ -5144,7 +5153,7 @@ ABC6 BD D7 A0 ... jsr d7a0 ;is_invalid_slot ABC9 83 00 00 ... subd #0000 ABCC 27 03 '. beq 03 ABCE 7E AC 7B ~.{ jmp ac7b ;goto23 -ABD1 BD D3 11 ... jsr d311 ;jump30 +ABD1 BD D3 11 ... jsr d311 ;jump30 - test position exists ABD4 83 00 00 ... subd #0000 ABD7 27 2B '+ beq 2b ABD9 F6 00 05 ... ldab 0005 @@ -6138,15 +6147,15 @@ B0C0 4E N illegal B0C1 3F ? swi B0C2 00 . test -B0C3 14 00 . -B0C5 14 C8 . -B0C7 05 00 .. -B0C9 05 00 . -B0CB 02 00 . -B0CD 02 00 . -B0CF 01 00 . -B0D1 01 00 . -B0D3 01 0C . +B0C3 14 00 . ;20 +B0C5 14 C8 . ;20 +B0C7 05 00 .. ;05 +B0C9 05 00 . ;05 +B0CB 02 00 . ;02 +B0CD 02 00 . ;02 +B0CF 01 00 . ;01 +B0D1 01 00 . ;01 +B0D3 01 0C . ;01 B0D5 17 22 . B0D7 2E 39 ". @@ -7969,6 +7978,7 @@ BE9D 39 9 rts jump50: +; writes a slot and price to the screen? BE9E 37 7 pshb BE9F 36 6 psha BEA0 8D A9 .. bsr a9 ; to be4b - displayblank @@ -8095,7 +8105,8 @@ BF6D C3 0B 93 ... addd #0b93 BF70 8F . xgdx BF71 33 3 pulb BF72 E7 00 .. stab 00,x -BF74 20 68 h bra 68 +BF74 20 68 h bra 68 ;goto32 +; BF76 C1 04 .. cmpb #04 BF78 26 26 && bne 26 BF7A 30 0 tsx @@ -8164,16 +8175,17 @@ BFDC E7 00 .. stab 00,x goto32: BFDE F6 0B C0 ... ldab 0bc0 BFE1 C4 01 .. andb #01 -BFE3 26 0E &. bne 0e +BFE3 26 0E &. bne 0e ; to bff3 BFE5 F6 0B C0 ... ldab 0bc0 BFE8 C4 04 .. andb #04 -BFEA 26 07 &. bne 07 +BFEA 26 07 &. bne 07 ; to bff3 BFEC F6 0B C0 ... ldab 0bc0 BFEF C4 08 .. andb #08 -BFF1 27 15 '. beq 15 +BFF1 27 15 '. beq 15 ; to c008 BFF3 F6 00 17 ... ldab 0017 BFF6 C4 08 .. andb #08 -BFF8 26 0E &. bne 0e +BFF8 26 0E &. bne 0e ; to c008 +; plonk a dollar sign somewhere BFFA C6 24 .$ ldab #24 ; "$" BFFC 37 7 pshb BFFD 30 0 tsx @@ -8188,15 +8200,15 @@ C00B F6 00 13 ... ldab 0013 C00E C1 01 .. cmpb #01 C010 23 17 #. bls 17 C012 CE 10 28 ..( ldx #1028 -C015 1C 00 40 ... bset 00,x, #40 ; enable SCI send +C015 1C 00 40 ... bset 00,x, #40 ; enable SPI send C018 CE 00 01 ... ldx #0001 C01B 3C < pshx C01C CC 00 20 .. ldd #0020 -C01F BD BD B5 ... jsr bdb5 ;jump78 +C01F BD BD B5 ... jsr bdb5 ;jump78 - send space to display C022 38 8 pulx -C023 CE 10 28 ..( ldx #1028 ; disable SCI send +C023 CE 10 28 ..( ldx #1028 ; disable SPI send C026 1D 00 40 ... bclr 00,x, #40 -C029 BD BE 10 ... jsr be10 ;jump88 +C029 BD BE 10 ... jsr be10 ;jump88 - write buffer to display C02C 38 8 pulx C02D 39 9 rts @@ -8879,7 +8891,7 @@ 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 -; + jump6: C5D3 F6 00 15 ... ldab 0015 C5D6 C4 1F .. andb #1f @@ -8943,6 +8955,7 @@ goto43: C67C 39 9 rts jump124: +; chat to changer C67D F6 00 30 ..0 ldab 0030 C680 26 55 &U bne 55 C682 F6 0B C0 ... ldab 0bc0 @@ -10199,7 +10212,7 @@ D0B3 E7 00 .. stab 00,x D0B5 30 0 tsx D0B6 6C 00 l. inc 00,x D0B8 20 DE . bra de ; to d098 - +; D0BA C6 05 .. ldab #05 D0BC F7 0B AA ... stab 0baa D0BF C6 04 .. ldab #04 @@ -10231,7 +10244,7 @@ D100 F7 0B DC ... stab 0bdc D103 31 1 ins D104 39 9 rts -jump32: +motors_off: ; turns all motors off D105 34 4 des D106 CE 00 1A ... ldx #001a @@ -10385,7 +10398,7 @@ D224 3C < pshx D225 FC 00 44 ..D ldd 0044 D228 BD BE 9E ... jsr be9e ;jump50 D22B 38 8 pulx -D22C BD D3 11 ... jsr d311 ;jump30 +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 @@ -10398,7 +10411,7 @@ D244 5F _ clrb D245 4F O clra D246 39 9 rts -D247 BD D1 3D ..= jsr d13d ;jump34 +D247 BD D1 3D ..= jsr d13d ;jump34 - motor on D24A C6 3C .< ldab #3c D24C F7 00 2E ... stab 002e D24F C6 41 .A ldab #41 @@ -10418,7 +10431,7 @@ D26E 27 06 '. beq 06 D270 CE 00 1B ... ldx #001b D273 1C 00 08 ... bset 00,x, #08 D276 20 0B . bra 0b -D278 BD D1 05 ... jsr d105 ;jump32 +D278 BD D1 05 ... jsr d105 ;motors_off D27B 8D 80 .. bsr 80 ;jump90 D27D BD D6 3C ..< jsr d63c ;jump33 D280 5F _ clrb @@ -10434,14 +10447,14 @@ D290 27 4E 'N beq 4e ; to d2e0 D292 BD D5 B0 ... jsr d5b0 ;jump31 D295 83 00 00 ... subd #0000 D298 27 46 'F beq 46 ; to d2e0 -D29A BD D1 05 ... jsr d105 ;jump32 +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 D2A6 83 00 00 ... subd #0000 D2A9 27 0C '. beq 0c -D2AB BD D1 05 ... jsr d105 ;jump32 +D2AB BD D1 05 ... jsr d105 ;motors_off D2AE BD D1 FD ... jsr d1fd ;jump90 D2B1 BD D6 3C ..< jsr d63c ;jump33 D2B4 5F _ clrb @@ -10476,7 +10489,7 @@ D2E3 26 14 &. bne 14 D2E5 BD D5 F7 ... jsr d5f7 ;jump108 D2E8 83 00 00 ... subd #0000 D2EB 26 0C &. bne 0c -D2ED BD D1 05 ... jsr d105 ;jump32 +D2ED BD D1 05 ... jsr d105 ;motors_off D2F0 BD D1 FD ... jsr d1fd ;jump90 D2F3 BD D6 26 ..& jsr d626 ;jump91 D2F6 5F _ clrb @@ -10485,7 +10498,7 @@ D2F8 39 9 rts D2F9 F6 00 2E ... ldab 002e D2FC 26 0C &. bne 0c -D2FE BD D1 05 ... jsr d105 ;jump32 +D2FE BD D1 05 ... jsr d105 ;motors_off D301 BD D1 FD ... jsr d1fd ;jump90 D304 BD D6 3C ..< jsr d63c ;jump33 D307 5F _ clrb @@ -10497,7 +10510,8 @@ D30D BD E6 1B ... jsr e61b ;jump4 D310 39 9 rts jump30: -D311 BD D1 3D ..= jsr d13d ;jump34 +; tests to see if a motor exists here +D311 BD D1 3D ..= jsr d13d ;jump34 - motor on D314 7F 00 1C ... clr 001c D317 7F 00 18 ... clr 0018 D31A F6 10 0A ... ldab 100a @@ -10507,22 +10521,22 @@ D321 7C 00 1C |.. inc 001c D324 F6 00 1C ... ldab 001c D327 C1 FF .. cmpb #ff D329 26 07 &. bne 07 -D32B BD D1 05 ... jsr d105 ;jump32 +D32B BD D1 05 ... jsr d105 ;motors_off D32E CC 00 01 ... ldd #0001 D331 39 9 rts - -D332 20 10 . bra 10 +; +D332 20 10 . bra 10 ; to d344 D334 7C 00 18 |.. inc 0018 D337 F6 00 18 ... ldab 0018 D33A C1 08 .. cmpb #08 -D33C 26 06 &. bne 06 -D33E BD D1 05 ... jsr d105 ;jump32 +D33C 26 06 &. bne 06 ; continue +D33E BD D1 05 ... jsr d105 ;motors_off D341 5F _ clrb D342 4F O clra D343 39 9 rts +D344 20 D4 . bra d4 ; continue jump43: -D344 20 D4 . bra d4 ; to d31a? D346 3C < pshx D347 3C < pshx D348 3C < pshx @@ -10577,7 +10591,7 @@ D3A5 26 05 &. bne 05 D3A7 C6 80 .. ldab #80 D3A9 30 0 tsx D3AA E7 00 .. stab 00,x -D3AC BD D1 3D ..= jsr d13d ;jump34 +D3AC BD D1 3D ..= jsr d13d ;jump34 - motor on D3AF 5F _ clrb D3B0 4F O clra D3B1 30 0 tsx @@ -10608,7 +10622,7 @@ D3D8 EC 05 .. ldd 05,x D3DA 83 00 01 ... subd #0001 D3DD ED 05 .. std 05,x D3DF 20 D8 . bra loop ;d3b9 -D3E1 BD D1 05 ... jsr d105 ;jump32 - turn motors off +D3E1 BD D1 05 ... jsr d105 ;motors_off - turn motors off D3E4 30 0 tsx D3E5 EC 03 .. ldd 03,x D3E7 2C 16 ,. bge 16 @@ -10642,7 +10656,7 @@ D421 27 07 '. beq 07 D423 F6 00 06 ... ldab 0006 D426 C1 3B .; cmpb #3b D428 26 37 &7 bne 37 -D42A BD D1 3D ..= jsr d13d ;jump34 +D42A BD D1 3D ..= jsr d13d ;jump34 - motor on D42D 7F 00 1C ... clr 001c D430 7F 00 18 ... clr 0018 D433 F6 18 00 ... ldab 1800 @@ -10652,7 +10666,7 @@ D43A 7C 00 1C |.. inc 001c D43D F6 00 1C ... ldab 001c D440 C1 FF .. cmpb #ff D442 26 08 &. bne 08 -D444 BD D1 05 ... jsr d105 ;jump32 +D444 BD D1 05 ... jsr d105 ;motors_off D447 CC 00 01 ... ldd #0001 D44A 20 17 . bra 17 D44C 20 11 . bra 11 @@ -10660,7 +10674,7 @@ D44E 7C 00 18 |.. inc 0018 D451 F6 00 18 ... ldab 0018 D454 C1 08 .. cmpb #08 D456 26 07 &. bne 07 -D458 BD D1 05 ... jsr d105 ;jump32 +D458 BD D1 05 ... jsr d105 ;motors_off D45B 5F _ clrb D45C 4F O clra D45D 20 04 . bra 04 @@ -10718,7 +10732,7 @@ D4AE C3 B0 D3 ... addd #b0d3 D4B1 8F . xgdx D4B2 E6 00 .. ldab 00,x D4B4 F7 00 06 ... stab 0006 -D4B7 BD D3 11 ... jsr d311 ;jump30 +D4B7 BD D3 11 ... jsr d311 ;jump30 - test position exists D4BA 83 00 00 ... subd #0000 D4BD 27 03 '. beq 03 D4BF 7E D5 45 ~.E jmp d545 ;goto64 @@ -11059,7 +11073,7 @@ D737 FC 00 40 ..@ ldd 0040 D73A F3 00 3E ..> addd 003e D73D B3 0B EF ... subd 0bef D740 23 19 #. bls 19 -D742 CC B0 6B ..k ldd #b06b +D742 CC B0 6B ..k ldd #b06b ; "NO CHANGE" D745 BD C0 BA ... jsr c0ba ;display: D748 CC 01 F4 ... ldd #01f4 D74B BD E5 71 ..q jsr e571 ;msdelay @@ -11068,13 +11082,13 @@ D751 CC 01 F4 ... ldd #01f4 D754 BD E5 71 ..q jsr e571 ;msdelay D757 CC 00 01 ... ldd #0001 D75A 39 9 rts - +; D75B F6 00 15 ... ldab 0015 D75E C4 04 .. andb #04 D760 27 1E '. beq 1e D762 F6 0E 6E ..n ldab 0e6e D765 26 19 &. bne 19 -D767 CC B0 76 ..v ldd #b076 +D767 CC B0 76 ..v ldd #b076 ; "NO FIVES" D76A BD C0 BA ... jsr c0ba ;display: D76D CC 01 F4 ... ldd #01f4 D770 BD E5 71 ..q jsr e571 ;msdelay @@ -11083,7 +11097,7 @@ D776 CC 01 F4 ... ldd #01f4 D779 BD E5 71 ..q jsr e571 ;msdelay D77C CC 00 01 ... ldd #0001 D77F 39 9 rts - +; D780 5F _ clrb D781 4F O clra D782 39 9 rts @@ -11158,10 +11172,10 @@ D7E4 CC 00 01 ... ldd #0001 D7E7 20 14 . bra 14 ; to d7fd (return 1) D7E9 30 0 tsx D7EA E6 00 .. ldab 00,x -D7EC C1 0B .. cmpb #0b ; 11 +D7EC C1 0B .. cmpb #0b ; < 11 D7EE 25 06 %. bcs 06 ; return 1 D7F0 E6 00 .. ldab 00,x -D7F2 C1 3E .> cmpb #3e ; 62 +D7F2 C1 3E .> cmpb #3e ; <= 62 D7F4 23 05 #. bls 05 ; return 0 D7F6 CC 00 01 ... ldd #0001 D7F9 20 02 . bra 02 @@ -11599,6 +11613,7 @@ DB40 1C 00 10 ... bset 00,x, #10 DB43 39 9 rts jump104: +; say thankyou? DB44 F6 00 2B ..+ ldab 002b DB47 C1 00 .. cmpb #00 DB49 26 08 &. bne 08 @@ -11607,7 +11622,7 @@ DB4E BD C0 BA ... jsr c0ba ;display: DB51 20 1E . bra 1e DB53 C1 01 .. cmpb #01 DB55 26 08 &. bne 08 -DB57 CC AC D4 ... ldd #acd4 +DB57 CC AC D4 ... ldd #acd4 ; "CHANGE" DB5A BD C0 BA ... jsr c0ba ;display: DB5D 20 12 . bra 12 DB5F C1 02 .. cmpb #02 @@ -11636,20 +11651,20 @@ DB97 BD C5 D3 ... jsr c5d3 ;jump6 DB9A F6 00 2B ..+ ldab 002b DB9D C1 00 .. cmpb #00 DB9F 26 08 &. bne 08 -DBA1 CC AD 16 ... ldd #ad16 +DBA1 CC AD 16 ... ldd #ad16 ; "GRACIAS" DBA4 BD C0 BA ... jsr c0ba ;display: DBA7 20 1E . bra 1e DBA9 C1 01 .. cmpb #01 DBAB 26 08 &. bne 08 -DBAD CC AD 0B ... ldd #ad0b +DBAD CC AD 0B ... ldd #ad0b ; "DANKE" DBB0 BD C0 BA ... jsr c0ba ;display: DBB3 20 12 . bra 12 DBB5 C1 02 .. cmpb #02 DBB7 26 08 &. bne 08 -DBB9 CC AD 00 ... ldd #ad00 +DBB9 CC AD 00 ... ldd #ad00 ; "MERCI" DBBC BD C0 BA ... jsr c0ba ;display: DBBF 20 06 . bra 06 -DBC1 CC AC F5 ... ldd #acf5 +DBC1 CC AC F5 ... ldd #acf5 ; "THANKS" DBC4 BD C0 BA ... jsr c0ba ;display: DBC7 BD D8 D3 ... jsr d8d3 ;jump84 500ms delay DBCA 39 9 rts @@ -11968,7 +11983,7 @@ DE55 F6 00 06 ... ldab 0006 DE58 F1 0B AB ... cmpb 0bab DE5B 26 0B &. bne 0b DE5D CE 00 1B ... ldx #001b -DE60 1D 00 01 ... bclr 00,x, #01 ; fixed by ./fixbset.pl - verify me +DE60 1D 00 01 ... bclr 00,x, #01 DE63 7F 00 4F ..O clr 004f DE66 20 3C < bra 3c DE68 FC 00 44 ..D ldd 0044 @@ -11994,7 +12009,7 @@ DE93 F3 00 44 ..D addd 0044 DE96 FD 00 44 ..D std 0044 DE99 20 09 . bra 09 DE9B CE 00 1B ... ldx #001b -DE9E 1D 00 01 ... bclr 00,x, #01 ; fixed by ./fixbset.pl - verify me +DE9E 1D 00 01 ... bclr 00,x, #01 DEA1 7F 00 4F ..O clr 004f goto70: DEA4 39 9 rts @@ -12044,8 +12059,8 @@ DEF5 C6 FF .. ldab #ff DEF7 F7 0B BC ... stab 0bbc DEFA F6 00 15 ... ldab 0015 DEFD 2D 03 -. blt 03 -DEFF BD C6 7D ..} jsr c67d ;jump124 -DF02 BD D6 6B ..k jsr d66b ;jump107 +DEFF BD C6 7D ..} jsr c67d ;jump124 - chat to changer +DF02 BD D6 6B ..k jsr d66b ;jump107 - chat to bill acceptor DF05 BD DC A3 ... jsr dca3 ;jump29 DF08 20 25 % bra 25 DF0A F6 0B C0 ... ldab 0bc0 @@ -12073,7 +12088,7 @@ DF3C 39 9 rts DF3D F6 00 4F ..O ldab 004f DF40 26 06 &. bne 06 DF42 CE 00 1B ... ldx #001b -DF45 1D 00 01 ... bclr 00,x, #01 ; fixed by ./fixbset.pl - verify me +DF45 1D 00 01 ... bclr 00,x, #01 DF48 F6 00 25 ..% ldab 0025 DF4B 26 20 & bne 20 DF4D F6 00 1B ... ldab 001b @@ -12087,7 +12102,7 @@ DF5F 27 03 '. beq 03 DF61 BD DB 44 ..D jsr db44 ;jump104 DF64 BD D6 6B ..k jsr d66b ;jump107 DF67 CE 00 1B ... ldx #001b -DF6A 1D 00 40 ... bclr 00,x, #40 ; fixed by ./fixbset.pl - verify me +DF6A 1D 00 40 ... bclr 00,x, #40 DF6D F6 00 2C .., ldab 002c DF70 27 03 '. beq 03 DF72 7E E0 66 ~.f jmp e066 ;goto71 @@ -12501,7 +12516,7 @@ E2F7 C4 10 .. andb #10 E2F9 26 0E &. bne 0e E2FB BD DB 44 ..D jsr db44 ;jump104 E2FE CE 00 1B ... ldx #001b -E301 1D 00 40 ... bclr 00,x, #40 ; fixed by ./fixbset.pl - verify me +E301 1D 00 40 ... bclr 00,x, #40 E304 7F 00 25 ..% clr 0025 E307 20 1A . bra 1a E309 7F 00 2C .., clr 002c @@ -12640,13 +12655,13 @@ E44F 38 8 pulx E450 FC 00 76 ..v ldd 0076 E453 26 06 &. bne 06 E455 CE 00 17 ... ldx #0017 -E458 1D 00 02 ... bclr 00,x, #02 ; fixed by ./fixbset.pl - verify me +E458 1D 00 02 ... bclr 00,x, #02 E45B F6 00 17 ... ldab 0017 E45E C4 02 .. andb #02 E460 27 09 '. beq 09 E462 BD E5 D1 ... jsr e5d1 ;jump52 E465 CE 00 17 ... ldx #0017 -E468 1D 00 02 ... bclr 00,x, #02 ; fixed by ./fixbset.pl - verify me +E468 1D 00 02 ... bclr 00,x, #02 E46B 7E E3 DE ~.. jmp e3de ;goto77 goto76: E46E CE 00 21 ..! ldx #0021 @@ -12822,7 +12837,7 @@ E5A9 39 9 rts jump12: E5AA F6 00 33 ..3 ldab 0033 E5AD 27 0C '. beq 0c ; to e5bb -E5AF F6 00 29 ..) ldab 0029 +E5AF F6 00 29 ..) ldab 0029 ; key state E5B2 27 05 '. beq 05 ; to e5b9 (out) E5B4 C6 02 .. ldab #02 E5B6 F7 00 33 ..3 stab 0033 @@ -12838,7 +12853,7 @@ E5CD F7 00 33 ..3 stab 0033 E5D0 39 9 rts jump52: -E5D1 C6 0B .. ldab #0b +E5D1 C6 0B .. ldab #0b ; 1011 E5D3 F7 00 32 ..2 stab 0032 E5D6 39 9 rts @@ -13070,6 +13085,7 @@ E742 31 1 ins E743 6E 00 n. jmp 00,x jump55: +; number to string. number is <= 99999. puts it into 0057, 005a, 005d-005f E745 37 7 pshb E746 36 6 psha E747 30 0 tsx @@ -13078,7 +13094,7 @@ E74A CE 27 10 .'. ldx #2710 ; 10000 E74D 02 . idiv E74E 8F . xgdx E74F CB 30 .0 addb #30 -E751 F7 00 57 ..W stab 0057 +E751 F7 00 57 ..W stab 0057 ; num/10000 => 0057 E754 30 0 tsx E755 EC 00 .. ldd 00,x E757 CE 27 10 .'. ldx #2710 ; 10000 @@ -13087,7 +13103,7 @@ E75B CE 03 E8 ... ldx #03e8 E75E 02 . idiv E75F 8F . xgdx E760 CB 30 .0 addb #30 -E762 F7 00 5A ..Z stab 005a +E762 F7 00 5A ..Z stab 005a ; num%10000/1000 => 005a E765 30 0 tsx E766 EC 00 .. ldd 00,x E768 CE 03 E8 ... ldx #03e8 @@ -13096,7 +13112,7 @@ E76C CE 00 64 ..d ldx #0064 E76F 02 . idiv E770 8F . xgdx E771 CB 30 .0 addb #30 -E773 F7 00 5D ..] stab 005d +E773 F7 00 5D ..] stab 005d ; num%1000/100 => 005d E776 30 0 tsx E777 EC 00 .. ldd 00,x E779 CE 00 64 ..d ldx #0064 @@ -13105,26 +13121,27 @@ E77D CE 00 0A ... ldx #000a E780 02 . idiv E781 8F . xgdx E782 CB 30 .0 addb #30 -E784 F7 00 5E ..^ stab 005e +E784 F7 00 5E ..^ stab 005e ; num%100/10 => 005e E787 30 0 tsx E788 EC 00 .. ldd 00,x E78A CE 00 0A ... ldx #000a E78D 02 . idiv E78E CB 30 .0 addb #30 -E790 F7 00 5F .._ stab 005f +E790 F7 00 5F .._ stab 005f ; num%10 => 005f E793 38 8 pulx E794 39 9 rts jump54: +; number to string. number is <= 999. puts it into 005d-005f E795 37 7 pshb E796 36 6 psha E797 30 0 tsx E798 E6 01 .. ldab 01,x E79A 4F O clra -E79B CE 00 64 ..d ldx #0064 +E79B CE 00 64 ..d ldx #0064 ; /100 E79E 02 . idiv E79F 8F . xgdx -E7A0 CB 30 .0 addb #30 +E7A0 CB 30 .0 addb #30 ; make it a digit E7A2 F7 00 5D ..] stab 005d E7A5 30 0 tsx E7A6 E6 01 .. ldab 01,x @@ -13135,7 +13152,7 @@ E7AD 4F O clra E7AE CE 00 0A ... ldx #000a E7B1 02 . idiv E7B2 8F . xgdx -E7B3 CB 30 .0 addb #30 +E7B3 CB 30 .0 addb #30 ; %100 / 10 -> digit E7B5 F7 00 5E ..^ stab 005e E7B8 30 0 tsx E7B9 E6 01 .. ldab 01,x @@ -13143,7 +13160,7 @@ E7BB 4F O clra E7BC CE 00 0A ... ldx #000a E7BF 02 . idiv E7C0 CB 30 .0 addb #30 -E7C2 F7 00 5F .._ stab 005f +E7C2 F7 00 5F .._ stab 005f ; %10 E7C5 38 8 pulx E7C6 39 9 rts @@ -13496,7 +13513,6 @@ EA58 39 9 rts jump65: EA59 34 4 des - ; test PE2 - remote no-sale switch. EA5A CE 00 04 ... ldx #0004 EA5D 3C < pshx @@ -13971,6 +13987,7 @@ EE01 31 1 ins EE02 39 9 rts jump36: +; writes msg to screen for 1.5s EE03 37 7 pshb EE04 36 6 psha EE05 30 0 tsx @@ -14236,7 +14253,7 @@ F0A2 C3 B1 C8 ... addd #b1c8 F0A5 8F . xgdx F0A6 E6 00 .. ldab 00,x F0A8 F7 00 06 ... stab 0006 -F0AB BD D3 11 ... jsr d311 ;jump30 +F0AB BD D3 11 ... jsr d311 ;jump30 - test position exists F0AE 83 00 00 ... subd #0000 F0B1 27 08 '. beq 08 F0B3 CC B1 A7 ... ldd #b1a7 @@ -14254,15 +14271,15 @@ F0CE C3 B1 C8 ... addd #b1c8 F0D1 8F . xgdx F0D2 E6 00 .. ldab 00,x F0D4 F7 00 06 ... stab 0006 -F0D7 BD D1 3D ..= jsr d13d ;jump34 +F0D7 BD D1 3D ..= jsr d13d ;jump34 - motor on F0DA BD D5 70 ..p jsr d570 ;jump35 F0DD 83 00 00 ... subd #0000 F0E0 26 0B &. bne 0b -F0E2 BD D1 05 ... jsr d105 ;jump32 +F0E2 BD D1 05 ... jsr d105 ;motors_off F0E5 CC B1 B2 ... ldd #b1b2 F0E8 BD EE 03 ... jsr ee03 ;jump36 F0EB 20 08 . bra 08 -F0ED BD D1 05 ... jsr d105 ;jump32 +F0ED BD D1 05 ... jsr d105 ;motors_off F0F0 7C 00 61 |.a inc 0061 F0F3 20 CE . bra ce F0F5 7F 00 61 ..a clr 0061 @@ -14275,17 +14292,17 @@ F103 C3 B1 C8 ... addd #b1c8 F106 8F . xgdx F107 E6 00 .. ldab 00,x F109 F7 00 06 ... stab 0006 -F10C BD D1 3D ..= jsr d13d ;jump34 +F10C BD D1 3D ..= jsr d13d ;jump34 - motor on F10F CC 00 0A ... ldd #000a F112 BD E5 71 ..q jsr e571 ;msdelay F115 F6 18 00 ... ldab 1800 F118 C4 40 .@ andb #40 F11A 26 0B &. bne 0b -F11C BD D1 05 ... jsr d105 ;jump32 +F11C BD D1 05 ... jsr d105 ;motors_off F11F CC B1 B2 ... ldd #b1b2 F122 BD EE 03 ... jsr ee03 ;jump36 F125 20 1D . bra 1d -F127 BD D1 05 ... jsr d105 ;jump32 +F127 BD D1 05 ... jsr d105 ;motors_off F12A CC 00 0A ... ldd #000a F12D BD E5 71 ..q jsr e571 ;msdelay F130 F6 18 00 ... ldab 1800 @@ -14416,7 +14433,7 @@ F21A 1C 00 01 ... bset 00,x, #01 F21D 30 0 tsx F21E E6 01 .. ldab 01,x F220 4F O clra -F221 BD E7 95 ... jsr e795 ;jump54 +F221 BD E7 95 ... jsr e795 ;jump54 - number to string F224 F6 00 5D ..] ldab 005d F227 4F O clra F228 BD F1 5B ..[ jsr f15b ;jump53 @@ -14445,7 +14462,7 @@ F256 CE 00 1D ... ldx #001d F259 1C 00 01 ... bset 00,x, #01 F25C 30 0 tsx F25D EC 00 .. ldd 00,x -F25F BD E7 45 ..E jsr e745 ;jump55 +F25F BD E7 45 ..E jsr e745 ;jump55 - number to string F262 F6 00 57 ..W ldab 0057 F265 4F O clra F266 BD F1 5B ..[ jsr f15b ;jump53 @@ -14486,7 +14503,7 @@ F2AF CE 00 1D ... ldx #001d F2B2 1C 00 01 ... bset 00,x, #01 F2B5 30 0 tsx F2B6 EC 00 .. ldd 00,x -F2B8 BD E7 45 ..E jsr e745 ;jump55 +F2B8 BD E7 45 ..E jsr e745 ;jump55 - number to string F2BB F6 00 57 ..W ldab 0057 F2BE 4F O clra F2BF BD F1 5B ..[ jsr f15b ;jump53 @@ -14994,23 +15011,23 @@ F77C 38 8 pulx F77D 08 . inx F77E 3C < pshx F77F 20 DE . bra de ; to f75f - +; F781 F6 00 32 ..2 ldab 0032 F784 27 07 '. beq 07 ; to f78d F786 F6 00 32 ..2 ldab 0032 F789 C4 02 .. andb #02 F78B 26 08 &. bne 08 ; to f795 - +; F78D CE 10 00 ... ldx #1000 ; chime off F790 1D 00 10 .. bclr 00,x, #10 F793 20 0D . bra 0d ; to f7a2 - +; F795 F6 00 32 ..2 ldab 0032 F798 C4 01 .. andb #01 F79A 26 06 &. bne 06 ; to f7a2 F79C CE 10 00 ... ldx #1000 ; chime on F79F 1C 00 10 .. bset 00,x, #10 - +; F7A2 7C 00 4C |.L inc 004c F7A5 F6 00 4C ..L ldab 004c F7A8 C1 4B .K cmpb #4b @@ -15029,55 +15046,55 @@ F7C7 F6 00 7F ... ldab 007f F7CA 27 03 '. beq 03 F7CC BD FE 69 ..i jsr fe69 ;inhibit interrupts F7CF C6 40 .@ ldab #40 -F7D1 F7 10 25 ..% stab 1025 +F7D1 F7 10 25 ..% stab 1025 ; notify end of RTI period F7D4 38 8 pulx F7D5 3B ; rti main: - +; F7D6 7F 00 14 ... clr 0014 ;0 -> 0014 - +; ; clears the bits of U14 flipflop F7D9 5F _ clrb ;0 -> B F7DA F7 38 00 .8. stab 3800 ;B -> 3800 - +; F7DD C6 7F .. ldab #7f ;7F -> B F7DF F7 00 1A ... stab 001a ;B -> 001a - +; ; set changer outputs all on, row motors off F7E2 C6 7F .. ldab #7f ;7F -> B F7E4 F7 30 00 .0. stab 3000 ; - +; ; sets priority select bits 0-3 (elevates interrupt priority of all interrupts) F7E7 C6 07 .. ldab #07 ;7 -> B F7E9 F7 10 3C ..< stab 103c - +; ; Set PA7 output, PA3 input, RT clock rate to 314 Hz (4.9152Mhz / 2^14) F7EC C6 81 .. ldab #81 ;81 -> B F7EE F7 10 26 ..& stab 1026 - +; ; clear ADC register F7F1 5F _ clrb ;0 -> B F7F2 F7 10 30 ..0 stab 1030 - +; ; talk to coin mech, beep, tie clock motors & display reset high (off) F7F5 C6 C8 .. ldab #c8 ;c8 -> B ; 11001000 F7F7 F7 10 00 ... stab 1000 ; to port A - +; ; sets PortD directions. XXX: Why is PD2 an output? F7FA C6 3E .> ldab #3e ;3e -> B 00111110 F7FC F7 10 09 ... stab 1009 ; port D DDR - +; ; make PortD pins open-drain, set clock polarity F7FF C6 12 .. ldab #12 ;12 -> B F801 F7 10 28 ..( stab 1028 ; SPCR 00101000 - +; ; initialize the display F804 BD BE 69 ..i jsr be69 ;displayreset - +; ; initialize the bill validator F807 BD EA 59 ..Y jsr ea59 ;jump65 - +; F80A CC 00 64 ..d ldd #0064 ; 100-unit delay F80D BD E5 71 ..q jsr e571 ;msdelay ; lotsa text @@ -15097,34 +15114,34 @@ F834 CC B2 10 ... ldd #b210 "5900 VER 5" F837 BD C0 BA ... jsr c0ba ;display: F83A CC 00 0A ... ldd #000a F83D BD E5 71 ..q jsr e571 ;msdelay - - +; +; F840 7F 00 7F ... clr 007f F843 7F 00 21 ..! clr 0021 F846 7F 00 1F ... clr 001f F849 7F 00 1D ... clr 001d F84C 7F 00 1B ... clr 001b F84F 7F 00 19 ... clr 0019 - +; F852 F6 0B C0 ... ldab 0bc0 F855 C4 01 .. andb #01 F857 27 08 '. beq 08 ; to f861 F859 CE 0B C1 ... ldx #0bc1 -F85C 1C 00 01 ... bset 00,x, #01 +F85C 1C 00 01 ... bset 00,x, #01 ; set changer powerup fail F85F 20 06 . bra 06 ; to f867 F861 CE 0B C1 ... ldx #0bc1 -F864 1D 00 01 ... bclr 00,x, #01 - +F864 1D 00 01 ... bclr 00,x, #01 ; clear changer powerup fail +; F867 F6 0B C0 ... ldab 0bc0 F86A C4 04 .. andb #04 F86C 27 08 '. beq 08 ; to f876 F86E CE 0B C1 ... ldx #0bc1 -F871 1C 00 02 ... bset 00,x, #02 +F871 1C 00 02 ... bset 00,x, #02 ; set card powerup fail F874 20 06 . bra 06 ; to f87c F876 CE 0B C1 ... ldx #0bc1 -F879 1D 00 02 .. bclr 00,x, #02 +F879 1D 00 02 .. bclr 00,x, #02 ; clear card powerup fail F87C CE 0B C1 ... ldx #0bc1 -F87F 1D 00 04 .. bclr 00,x, #04 +F87F 1D 00 04 .. bclr 00,x, #04 ; clear link powerup fail F882 F6 0B C0 ... ldab 0bc0 F885 C4 02 .. andb #02 F887 27 2D '- beq 2d ; to f8b6 @@ -15175,34 +15192,35 @@ F8F6 BD E5 71 ..q jsr e571 ;msdelay F8F9 C6 1E .. ldab #1e F8FB F7 00 35 ..5 stab 0035 F8FE 0E . cli - +; ; begin of main loop goto85: F8FF BD E6 1B ... jsr e61b ;jump4 set 0031 to 10 -F902 BD D1 05 ... jsr d105 ;jump32 motors off +F902 BD D1 05 ... jsr d105 ;motors_off F905 F6 10 0A ... ldab 100a F908 C4 08 .. andb #08 ; 24VUN line too low F90A 27 46 'F beq 46 ; to f952 F90C F6 10 0A ... ldab 100a F90F C4 08 .. andb #08 -F911 27 11 '. beq 11 +F911 27 11 '. beq 11 ; to f924 F913 CE 00 1A ... ldx #001a F916 1C 00 04 .. bset 00,x, #04 F919 F6 00 1A ... ldab 001a F91C F7 30 00 .0. stab 3000 ; changer reset -F91F BD E6 1B ... jsr e61b ;jump4 -F922 20 E8 . bra e8 -F924 BD D0 94 ... jsr d094 ;jump66 +F91F BD E6 1B ... jsr e61b ;jump4 put #0a => 0031 +F922 20 E8 . bra e8 ; to f90c +; +F924 BD D0 94 ... jsr d094 ;jump66 - reset some variables to defaults? F927 F6 0B C0 ... ldab 0bc0 F92A C4 01 .. andb #01 F92C 27 06 '. beq 06 F92E CE 0B C1 ... ldx #0bc1 -F931 1C 00 01 .. bset 00,x, #01 +F931 1C 00 01 .. bset 00,x, #01 ; set changer powerup fail F934 F6 0B C0 ... ldab 0bc0 F937 C4 04 .. andb #04 F939 27 06 '. beq 06 F93B CE 0B C1 ... ldx #0bc1 -F93E 1C 00 02 .. bset 00,x, #02 +F93E 1C 00 02 .. bset 00,x, #02 ; set card powerup fail F941 CE 00 1A ... ldx #001a F944 1D 00 04 .. bclr 00,x, #04 F947 F6 00 1A ... ldab 001a @@ -15224,7 +15242,7 @@ F969 CE 0B C1 ... ldx #0bc1 F96C 1C 00 08 .. bset 00,x, #08 ; set bill error bit ; F96F F6 0B C1 ... ldab 0bc1 -F972 C4 07 .. andb #07 +F972 C4 07 .. andb #07 ; test for power failures F974 27 0D '. beq 0d ; to f983 F976 F6 00 35 ..5 ldab 0035 F979 26 08 &. bne 08 @@ -15284,7 +15302,7 @@ FA03 C6 3C .< ldab #3c FA05 F7 00 31 ..1 stab 0031 FA08 0E . cli FA09 CC 00 FF ... ldd #00ff -FA0C BD C7 E7 ... jsr c7e7 ;jump37 +FA0C BD C7 E7 ... jsr c7e7 ;jump37 - send #ff to coin mech FA0F 5F _ clrb FA10 4F O clra FA11 FD 00 40 ..@ std 0040 @@ -15335,10 +15353,8 @@ FA83 C4 20 . andb #20 FA85 26 03 &. bne 03 FA87 BD E5 AA ... jsr e5aa ;jump12 FA8A CE 00 1F ... ldx #001f -FA8D 1C 00 .. bset add,x 00,x -FA8F 20 F6 . bra f6 -FA91 00 . test -FA92 12 . brset +FA8D 1C 00 .. bset 00,x, #20 +FA8F F6 00 12 ... ldab 0012 FA93 C4 01 .. andb #01 FA95 26 33 &3 bne 33 FA97 F6 00 1D ... ldab 001d @@ -15350,10 +15366,8 @@ FAA3 26 14 &. bne 14 FAA5 CE 00 1F ... ldx #001f FAA8 1C 00 04 ... bset 00,x, #04 FAAB CE 00 1F ... ldx #001f -FAAE 1C 00 .. bset add,x 00,x -FAB0 80 CC .. suba #cc -FAB2 02 . idiv -FAB3 33 3 pulb +FAAE 1C 00 .. bset 00,x, #80 +FAB0 CC 02 33 .. ldd #0233 FAB4 FD 00 3B ..; std 003b FAB7 20 09 . bra 09 ; to fac2 ;