From e98b9db700066184f043752f35da1942dc588093 Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Sun, 3 Aug 2003 08:15:48 +0000 Subject: [PATCH] Found a motor lookup table --- ROM-2003/vend.asm | 214 +++++++++++++++++++++++++++------------------- 1 file changed, 126 insertions(+), 88 deletions(-) diff --git a/ROM-2003/vend.asm b/ROM-2003/vend.asm index a34ad31..70e215b 100644 --- a/ROM-2003/vend.asm +++ b/ROM-2003/vend.asm @@ -52,6 +52,7 @@ ;0b90 - 0b99 display buffer (backwards) ;0b9a - some sort of id? press 89 on the machine ;0baa +;0bae ;0bb5 win-a-snack odds (is this in NVRAM?) ;0bbd ;0bd8 related to 0017 and 0021 (only lower 3 bits used) @@ -76,13 +77,13 @@ ;0e06 - ?? array of digits*10 ;1000 ;1009 +;1016 - timer output compare 1 register ;1026 ;1028 SPCR (Serial Peripheral Control Register) ;1030 ;103c -;1016 - timer output compare 1 register ;1800 Internal switches ; 7 changer INT' @@ -1122,11 +1123,11 @@ jump74: 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 ; 80 +87F2 C1 50 .P cmpb #50 ; 80 entries in lookup table 87F4 24 2E $. bcc 2e ; to 8824 87F6 F6 00 54 ..T ldab 0054 87F9 4F O clra -87FA C3 B0 D3 ... addd #b0d3 +87FA C3 B0 D3 ... addd #b0d3 ; lookup table 87FD 8F . xgdx 87FE E6 00 .. ldab 00,x 8800 F7 00 06 ... stab 0006 @@ -6147,78 +6148,114 @@ B0C1 3F ? swi B0C2 00 . test B0C3 14 00 . ;20 -B0C5 14 C8 . ;20 +B0C5 14 C8 . ;20 200 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 ". - -B0D9 44 D lsra -B0DA 4F O clra -B0DB 0B . sev -B0DC 16 . tab -B0DD 21 2C !, brn 2c -B0DF 38 8 pulx -B0E0 43 C coma -B0E1 4E N illegal -B0E2 59 Y rolb -B0E3 15 . bclr -B0E4 20 2B + bra 2b -B0E6 36 6 psha -B0E7 42 B illegal -B0E8 4D M tsta -B0E9 58 X aslb -B0EA 63 1F c. com 1f,x -B0EC 2A 35 *5 bpl 35 -B0EE 40 @ nega -B0EF 4C L inca -B0F0 57 W asrb -B0F1 62 b illegal -B0F2 09 . dex -B0F3 29 34 )4 bvs 34 -B0F5 3F ? swi -B0F6 4A J deca -B0F7 56 V rorb -B0F8 61 a illegal -B0F9 08 . inx -B0FA 13 . brclr -B0FB 33 3 pulb -B0FC 3E > wai -B0FD 49 I rola -B0FE 54 T lsrb -B0FF 60 07 `. neg 07,x -B101 12 . brset -B102 1D 3D 48 ... bclr 3d,x, #48 -B105 53 S comb -B106 5E ^ illegal -B107 06 . tap -B108 11 . cba -B109 1C 27 47 ... bset 27,x, #47 ; fixed by ./fixbset.pl - verify me -B10C 52 R illegal -B10D 5D ] tstb -B10E 04 . lsrd -B10F 10 . sba -B110 1B . aba -B111 26 31 &1 bne 31 -B113 51 Q illegal -B114 5C \ incb -B115 03 . fdiv -B116 0E . cli -B117 1A . illegal -B118 25 30 %0 bcs 30 -B11A 3B ; rti -B11B 5B [ illegal -B11C 02 . idiv -B11D 0D . sec -B11E 18 . illegal -B11F 24 2F $/ bcc 2f -B121 3A : abx -B122 45 E illegal + + + + + +; +; here's a lookup table of some sort, for finding the slot +; numbers of each motor in turn +; +; 80 entries for 80 motors? +; +B0D3 01 . ;01 +B0D4 0C . ;12 +B0D5 17 . ;23 +B0D6 22 . ;34 +B0D7 2E . ;46 +B0D8 39 . ;57 +B0D9 44 D ;68 +B0DA 4F O ;79 +; +B0DB 0B . ;11 +B0DC 16 . ;22 +B0DD 21 ! ;33 +B0DE 2C . ;44 +B0DF 38 8 ;56 +B0E0 43 C ;67 +B0E1 4E N ;78 +B0E2 59 Y ;89 +; +B0E3 15 . ;21 +B0E4 20 . ;32 +B0E5 2B + ;43 +B0E6 36 6 ;54 +B0E7 42 B ;66 +B0E8 4D M ;77 +B0E9 58 X ;88 +B0EA 63 c ;99 +; +B0EB 1F . ;31 +B0EC 2A *. ;42 +B0ED 35 . ;53 +B0EE 40 @ ;64 +B0EF 4C L ;76 +B0F0 57 W ;87 +B0F1 62 b ;98 +; +B0F2 09 . ;09 +B0F3 29 ) ;41 +B0F4 34 . ;52 +B0F5 3F ? ;63 +B0F6 4A J ;74 +B0F7 56 V ;86 +B0F8 61 a ;97 +; +B0F9 08 . ;08 +B0FA 13 . ;19 +B0FB 33 3 ;51 +B0FC 3E > ;62 +B0FD 49 I ;73 +B0FE 54 T ;84 +B0FF 60 ` ;96 +; +B000 07 . ;07 +B101 12 . ;18 +B102 1D . ;29 +B103 3D . ;61 +B104 48 . ;72 +B105 53 S ;83 +B106 5E ^ ;94 +; +B107 06 . ;06 +B108 11 . ;17 +B109 1C . ;28 +B10A 27 . ;39 +B10B 47 . ;71 +B10C 52 R ;82 +B10D 5D ] ;93 +; +B10E 04 . ;04 +B10F 10 . ;16 +B110 1B . ;27 +B111 26 & ;38 +B111 31 & ;49 +B113 51 Q ;81 +B114 5C \ ;92 +; +B115 03 . ;03 +B116 0E . ;14 +B117 1A . ;26 +B118 25 % ;37 +B119 30 % ;48 +B11A 3B ; ;59 +B11B 5B [ ;91 +; +B11C 02 . ;02 +B11D 0D . ;13 +B11E 18 . ;24 +B11F 24 $ ;36 +B120 2F $ ;47 +B121 3A : ;58 +B122 45 E ;69 table of powers of 2 @@ -9606,7 +9643,7 @@ CBCB F6 10 2F ../ ldab 102f ; read SCI data 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 CBD7 1C 00 10 ... bset 00,x, #10 goto48: ; cleanup and exit @@ -9868,7 +9905,7 @@ CDE2 F6 00 19 ... ldab 0019 CDE5 C4 08 .. andb #08 CDE7 26 19 &. bne 19 CDE9 CC 00 FE ... ldd #00fe -CDEC BD C7 E7 ... jsr c7e7 ;jump37 - send byte to coin mech +CDEC BD C7 E7 ... jsr c7e7 ;jump37 - send #fe to coin mech CDEF F6 00 1F ... ldab 001f CDF2 C4 08 .. andb #08 CDF4 27 0A '. beq 0a @@ -10722,12 +10759,12 @@ D49B 20 DF . bra df D49D 7F 00 05 ... clr 0005 goto65: D4A0 F6 00 05 ... ldab 0005 -D4A3 C1 50 .P cmpb #50 +D4A3 C1 50 .P cmpb #50 ; 80 D4A5 25 03 %. bcs 03 -D4A7 7E D5 60 ~.` jmp d560 ;goto63 +D4A7 7E D5 60 ~.` jmp d560 ;goto63 - exit D4AA F6 00 05 ... ldab 0005 D4AD 4F O clra -D4AE C3 B0 D3 ... addd #b0d3 +D4AE C3 B0 D3 ... addd #b0d3 ;motor lookup table D4B1 8F . xgdx D4B2 E6 00 .. ldab 00,x D4B4 F7 00 06 ... stab 0006 @@ -11281,7 +11318,7 @@ D8A1 3C < pshx D8A2 FC 0D E7 ... ldd 0de7 D8A5 37 7 pshb D8A6 36 6 psha -D8A7 CE E1 00 ... ldx #e100 +D8A7 CE E1 00 ... ldx #e100 ; 57600 D8AA 3C < pshx D8AB CC 05 F5 ... ldd #05f5 D8AE 37 7 pshb @@ -11371,19 +11408,19 @@ D959 39 9 rts jump123: D95A F6 00 06 ... ldab 0006 D95D F1 0B AF ... cmpb 0baf -D960 26 0D &. bne 0d +D960 26 0D &. bne 0d ; to d984 D962 BD D7 FF ... jsr d7ff ;jump80 D965 F6 0B B4 ... ldab 0bb4 D968 F7 00 06 ... stab 0006 D96B 8D 55 .U bsr 55 ;jump205 -D96D 20 52 R bra 52 +D96D 20 52 R bra 52 ; exit D96F F6 00 06 ... ldab 0006 D972 F1 0B AE ... cmpb 0bae -D975 26 0D &. bne 0d +D975 26 0D &. bne 0d ; to d984 D977 BD D7 FF ... jsr d7ff ;jump80 D97A F6 0B B3 ... ldab 0bb3 D97D F7 00 06 ... stab 0006 -D980 8D 40 .@ bsr dest 40 +D980 8D 40 .@ bsr 40 ;jump205 D982 20 3D = bra 3d D984 F6 00 06 ... ldab 0006 D987 F1 0B AD ... cmpb 0bad @@ -11391,7 +11428,7 @@ D98A 26 0D &. bne 0d D98C BD D7 FF ... jsr d7ff ;jump80 D98F F6 0B B2 ... ldab 0bb2 D992 F7 00 06 ... stab 0006 -D995 8D 2B .+ bsr dest 2b +D995 8D 2B .+ bsr 2b ;jump205 D997 20 28 ( bra 28 D999 F6 00 06 ... ldab 0006 D99C F1 0B AC ... cmpb 0bac @@ -11399,7 +11436,7 @@ D99F 26 0D &. bne 0d D9A1 BD D7 FF ... jsr d7ff ;jump80 D9A4 F6 0B B1 ... ldab 0bb1 D9A7 F7 00 06 ... stab 0006 -D9AA 8D 16 .. bsr dest 16 +D9AA 8D 16 .. bsr 16 ;jump205 D9AC 20 13 . bra 13 D9AE F6 00 06 ... ldab 0006 D9B1 F1 0B AB ... cmpb 0bab @@ -11407,7 +11444,7 @@ D9B4 26 0B &. bne 0b D9B6 BD D7 FF ... jsr d7ff ;jump80 D9B9 F6 0B B0 ... ldab 0bb0 D9BC F7 00 06 ... stab 0006 -D9BF 8D 01 .. bsr dest 01 +D9BF 8D 01 .. bsr 01 ;jump205 D9C1 39 9 rts jump205: @@ -12386,7 +12423,7 @@ E1F9 BD D2 13 .. jsr d213 ;jump45 E1FC 83 00 00 ... subd #0000 E200 26 12 &. bne 12 E202 BD E5 D1 ... jsr e5d1 ;jump52 - triple beep -E205 BD D8 E9 ... jsr d8e9 ;jump92 +E205 BD D8 E9 ... jsr d8e9 ;jump92 - "SELECT OTHER ITEM" E208 FC 00 40 ..@ ldd 0040 E20B F3 00 44 ..D addd 0044 E20E FD 00 40 ..@ std 0040 @@ -12837,6 +12874,7 @@ E5A8 31 1 ins E5A9 39 9 rts jump12: +; beep if keypressed? E5AA F6 00 33 ..3 ldab 0033 E5AD 27 0C '. beq 0c ; to e5bb E5AF F6 00 29 ..) ldab 0029 ; key state @@ -15342,9 +15380,9 @@ FA5E BD E8 9A ... jsr e89a ;jump68 FA61 BD BE 69 ..i jsr be69 ;displayreset FA64 7F 00 06 ... clr 0006 FA67 CE 00 1F ... ldx #001f -FA6A 1D 00 .. bclr add,x 00,x -FA6C 20 C6 . bra c6 -FA6E 1E F7 00 35 ...5 brset f7,x 00 35 +FA6A 1D 00 20 .. bclr 00,x, #20 +FA6D C6 1E . ldab #1e +FA6F F7 00 35 ...5 stab 0035 FA72 20 03 . bra 03 goto84: FA74 BD DE E7 ... jsr dee7 ;jump116 @@ -15352,7 +15390,7 @@ FA77 20 66 f bra 66 goto83: FA79 F6 00 12 ... ldab 0012 FA7C C4 20 . andb #20 -FA7E 27 5F '_ beq 5f +FA7E 27 5F '_ beq 5f ; to fadf - restart loop FA80 F6 00 1F ... ldab 001f FA83 C4 20 . andb #20 FA85 26 03 &. bne 03 @@ -15376,7 +15414,7 @@ FAB0 CC 02 33 .. ldd #0233 FAB4 FD 00 3B ..; std 003b FAB7 20 09 . bra 09 ; to fac2 ; -FAB9 BD E5 AA ... jsr e5aa ;jump12 +FAB9 BD E5 AA ... jsr e5aa ;jump12 - beep if key pressed? FABC CE 00 1F ... ldx #001f FABF 1D 00 04 ... bclr 00,x, #04 FAC2 CE 00 1D ... ldx #001d -- 2.20.1