From 510a3086ef684887bac8dc32969f7a00649598dc Mon Sep 17 00:00:00 2001 From: mrWheel <5585427+mrWheel@users.noreply.github.com> Date: Fri, 26 Feb 2021 15:01:19 +0100 Subject: [PATCH] Version 2.0 (first final release) --- README.md | 20 +- digitalTapeRecorder/data/DF/microChessTTY.asm | 873 ++++++++++++++++++ digitalTapeRecorder/data/DF/microChessTTY.hex | 123 ++- digitalTapeRecorder/data/DF/microChessTTY.ptp | 120 +-- digitalTapeRecorder/data/DF/microChessTTY.txt | 68 +- 5 files changed, 1032 insertions(+), 172 deletions(-) create mode 100644 digitalTapeRecorder/data/DF/microChessTTY.asm diff --git a/README.md b/README.md index 3c6fc66..d9d9587 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,9 @@ A Solid State Digital Tape Recorder for the KIM-1 and microKIM -More info: +[Here](https://willem.aandewiel.nl/index.php/2021/02/20/digital-tape-recorder-for-the-kim-1-and-clones/) you can find more information about this project. -https://willem.aandewiel.nl/index.php/2021/02/20/digital-tape-recorder-for-the-kim-1-and-clones/ - -For a small demo see: - -https://www.youtube.com/watch?v=R_zD5T_khKs - -This is a development version for the 2.0 release. -Do not (yet) use this for production but feel free to try it out! +[This](https://www.youtube.com/watch?v=R_zD5T_khKs) is a small demo. ![dTR_Anim](https://user-images.githubusercontent.com/5585427/109011507-3f67fa80-76b1-11eb-91c5-ab61ccd1cf4a.gif) @@ -20,10 +13,11 @@ For first time use see [here](docs/firstTimeUse.md). [Here](docs/flashFirmware.md) you can read how to flash the firmware to the digital Tape Recorder. -* The [schematic](docs/ADW1710_Schematic.pdf). -* The [BOM](docs/ADW1710_BOM.pdf). -* Modification to the digital Tape Recorder for use with a [genuine KIM-1](docs/dTR_KIM-1_mod.pdf) -* How to connect the digital Tape Recorder to a [genuine KIM-1](docs/dTR_KIM-1_A.pdf) +* The [schematic](docs/ADW1710_Schematic.pdf); +* The [BOM](docs/ADW1710_BOM.pdf); +* Building the [digital Tape Recorder](https://user-images.githubusercontent.com/5585427/109309085-1bd4b980-7843-11eb-97f5-dcc749f5732b.gif); +* Modification to the digital Tape Recorder for use with a [genuine KIM-1](docs/dTR_KIM-1_mod.pdf); +* How to connect the digital Tape Recorder to a [genuine KIM-1](docs/dTR_KIM-1_A.pdf). ![SSTR_FSexplorer](https://user-images.githubusercontent.com/5585427/108217058-73807000-7133-11eb-94bc-dc09b9f65778.png) diff --git a/digitalTapeRecorder/data/DF/microChessTTY.asm b/digitalTapeRecorder/data/DF/microChessTTY.asm new file mode 100644 index 0000000..e025973 --- /dev/null +++ b/digitalTapeRecorder/data/DF/microChessTTY.asm @@ -0,0 +1,873 @@ +;*********************************************************************** +; +; Kim-1 MicroChess (c) 1976-2005 Peter Jennings, www.benlo.com +; +;*********************************************************************** + +; All rights reserved. + +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions +; are met: +; 1. Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; 2. Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; 3. The name of the author may not be used to endorse or promote products +; derived from this software without specific prior written permission. + +; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR +; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +; +; modified by Daryl Rictor to work over a +; serial terminal connection, August 2002. +; +; Updated with corrections to earlier OCR errors by Bill Forster, August 2005. +; +;; cpu 65c02 +;; page 0,132 +; +;KIM I/O +OUTCH =$1EA0 +GETCH =$1E5A +KIMMON =$1C00 +; +; page zero variables +; +BOARD .EQU $50 +BK .EQU $60 +PIECE .EQU $B0 +SQUARE .EQU $B1 +SP2 .EQU $B2 +SP1 .EQU $B3 +INCHEK .EQU $B4 +STATE .EQU $B5 +MOVEN .EQU $B6 +REV .EQU $B7 +OMOVE .EQU $DC +WCAP0 .EQU $DD +COUNT .EQU $DE +BCAP2 .EQU $DE +WCAP2 .EQU $DF +BCAP1 .EQU $E0 +WCAP1 .EQU $E1 +BCAP0 .EQU $E2 +MOB .EQU $E3 +MAXC .EQU $E4 +CC .EQU $E5 +PCAP .EQU $E6 +BMOB .EQU $E3 +BMAXC .EQU $E4 +BMCC .EQU $E5 ; was BCC (TASS doesn't like it as a label) +BMAXP .EQU $E6 +XMAXC .EQU $E8 +WMOB .EQU $EB +WMAXC .EQU $EC +WCC .EQU $ED +WMAXP .EQU $EE +PMOB .EQU $EF +PMAXC .EQU $F0 +PCC .EQU $F1 +PCP .EQU $F2 +OLDKY .EQU $F3 +BESTP .EQU $FB +BESTV .EQU $FA +BESTM .EQU $F9 +DIS1 .EQU $FB +DIS2 .EQU $FA +DIS3 .EQU $F9 +TEMP .EQU $FC +; +; + .ORG $2000 ; load into RAM @ $2000-$25FF + + LDA #$00 ; REVERSE TOGGLE + STA REV +; +CHESS CLD ; INITIALIZE + LDX #$FF ; TWO STACKS + TXS + LDX #$C8 + STX SP2 +; +; ROUTINES TO LIGHT LED +; DISPLAY AND GET KEY +; FROM KEYBOARD +; +OUT JSR POUT ; DISPLAY AND + JSR KIN +; + CMP #$43 ; [C] + BNE NOSET ; SET UP + LDX #$1F ; BOARD +WHSET LDA SETW,X ; FROM + STA BOARD,X ; SETW + DEX + BPL WHSET + LDX #$1B ; *ADDED + STX OMOVE ; INITS TO $FF + LDA #$CC ; Display CCC + BNE CLDSP +; +NOSET CMP #$45 ; [E] + BNE NOREV ; REVERSE + JSR REVERSE ; BOARD IS + SEC + LDA #$01 + SBC REV + STA REV ; TOGGLE REV FLAG + LDA #$EE ; IS + BNE CLDSP +; +NOREV CMP #$40 ; [P] + BNE NOGO ; PLAY CHESS + JSR GO +CLDSP STA DIS1 ; DISPLAY + STA DIS2 ; ACROSS + STA DIS3 ; DISPLAY + BNE CHESS +; +NOGO CMP #$0D ; [Enter] + BNE NOMV ; MOVE MAN + JSR MOVE ; AS ENTERED + JMP DISP +NOMV CMP #$41 ; [Q] ***Added to allow game exit*** + BEQ DONE ; quit the game, exit back to system. + JMP INPUT ; process move +DONE JMP KIMMON ; *** MUST set this to YOUR OS starting address +; +; THE ROUTINE JANUS DIRECTS THE +; ANALYSIS BY DETERMINING WHAT +; SHOULD OCCUR AFTER EACH MOVE +; GENERATED BY GNM +; +; +; +JANUS LDX STATE + BMI NOCOUNT +; +; THIS ROUTINE COUNTS OCCURRENCES +; IT DEPENDS UPON STATE TO INDEX +; THE CORRECT COUNTERS +; +COUNTS LDA PIECE + BEQ OVER ; IF STATE=8 + CPX #$08 ; DO NOT COUNT + BNE OVER ; BLK MAX CAP + CMP BMAXP ; MOVES FOR + BEQ XRT ; WHITE +; +OVER INC MOB,X ; MOBILITY + CMP #$01 ; + QUEEN + BNE NOQ ; FOR TWO + INC MOB,X +; +NOQ BVC NOCAP + LDY #$0F ; CALCULATE + LDA SQUARE ; POINTS +ELOOP CMP BK,Y ; CAPTURED + BEQ FOUN ; BY THIS + DEY ; MOVE + BPL ELOOP +FOUN LDA POINTS,Y + CMP MAXC,X + BCC LESS ; SAVE IF + STY PCAP,X ; BEST THIS + STA MAXC,X ; STATE +; +LESS CLC + PHP ; ADD TO + ADC CC,X ; CAPTURE + STA CC,X ; COUNTS + PLP +; +NOCAP CPX #$04 + BEQ ON4 + BMI TREE ;(=00 ONLY) +XRT RTS +; +; GENERATE FURTHER MOVES FOR COUNT +; AND ANALYSIS +; +ON4 LDA XMAXC ; SAVE ACTUAL + STA WCAP0 ; CAPTURE + LDA #$00 ; STATE=0 + STA STATE + JSR MOVE ; GENERATE + JSR REVERSE ; IMMEDIATE + JSR GNMZ ; REPLY MOVES + JSR REVERSE +; + LDA #$08 ; STATE=8 + STA STATE ; GENERATE + JSR GNM ; CONTINUATION + JSR UMOVE ; MOVES +; + JMP STRATGY ; FINAL EVALUATION +NOCOUNT CPX #$F9 + BNE TREE +; +; DETERMINE IF THE KING CAN BE +; TAKEN, USED BY CHKCHK +; + LDA BK ; IS KING + CMP SQUARE ; IN CHECK? + BNE RETJ ; SET INCHEK=0 + LDA #$00 ; IF IT IS + STA INCHEK +RETJ RTS +; +; IF A PIECE HAS BEEN CAPTURED BY +; A TRIAL MOVE, GENERATE REPLIES & +; EVALUATE THE EXCHANGE GAIN/LOSS +; +TREE BVC RETJ ; NO CAP + LDY #$07 ; (PIECES) + LDA SQUARE +LOOPX CMP BK,Y + BEQ FOUNX + DEY + BEQ RETJ ; (KING) + BPL LOOPX ; SAVE +FOUNX LDA POINTS,Y ; BEST CAP + CMP BCAP0,X ; AT THIS + BCC NOMAX ; LEVEL + STA BCAP0,X +NOMAX DEC STATE + LDA #$FB ; IF STATE=FB + CMP STATE ; TIME TO TURN + BEQ UPTREE ; AROUND + JSR GENRM ; GENERATE FURTHER +UPTREE INC STATE ; CAPTURES + RTS +; +; THE PLAYER'S MOVE IS INPUT +; +INPUT CMP #$08 ; NOT A LEGAL + BCS ERROR ; SQUARE # + JSR DISMV +DISP LDX #$1F +SEARCH LDA BOARD,X + CMP DIS2 + BEQ HERE ; DISPLAY + DEX ; PIECE AT + BPL SEARCH ; FROM +HERE STX DIS1 ; SQUARE + STX PIECE +ERROR JMP CHESS +; +; GENERATE ALL MOVES FOR ONE +; SIDE, CALL JANUS AFTER EACH +; ONE FOR NEXT STEP +; +; +GNMZ LDX #$10 ; CLEAR +GNMX LDA #$00 ; COUNTERS +CLRCNTR STA COUNT,X + DEX + BPL CLRCNTR +; +GNM LDA #$10 ; SET UP + STA PIECE ; PIECE +NEWP DEC PIECE ; NEW PIECE + BPL NEX ; ALL DONE? + RTS ; -YES +; +NEX JSR RESET ; READY + LDY PIECE ; GET PIECE + LDX #$08 + STX MOVEN ; COMMON START + CPY #$08 ; WHAT IS IT? + BPL PAWN ; PAWN + CPY #$06 + BPL KNIGHT ; KNIGHT + CPY #$04 + BPL BISHOP ; BISHOP + CPY #$01 + BEQ QUEEN ; QUEEN + BPL ROOK ; ROOK +; +KING JSR SNGMV ; MUST BE KING! + BNE KING ; MOVES + BEQ NEWP ; 8 TO 1 +QUEEN JSR LINE + BNE QUEEN ; MOVES + BEQ NEWP ; 8 TO 1 +; +ROOK LDX #$04 + STX MOVEN ; MOVES +AGNR JSR LINE ; 4 TO 1 + BNE AGNR + BEQ NEWP +; +BISHOP JSR LINE + LDA MOVEN ; MOVES + CMP #$04 ; 8 TO 5 + BNE BISHOP + BEQ NEWP +; +KNIGHT LDX #$10 + STX MOVEN ; MOVES +AGNN JSR SNGMV ; 16 TO 9 + LDA MOVEN + CMP #$08 + BNE AGNN + BEQ NEWP +; +PAWN LDX #$06 + STX MOVEN +P1 JSR CMOVE ; RIGHT CAP? + BVC P2 + BMI P2 + JSR JANUS ; YES +P2 JSR RESET + DEC MOVEN ; LEFT CAP? + LDA MOVEN + CMP #$05 + BEQ P1 +P3 JSR CMOVE ; AHEAD + BVS NEWP ; ILLEGAL + BMI NEWP + JSR JANUS + LDA SQUARE ; GETS TO + AND #$F0 ; 3RD RANK? + CMP #$20 + BEQ P3 ; DO DOUBLE + JMP NEWP +; +; CALCULATE SINGLE STEP MOVES +; FOR K,N +; +SNGMV JSR CMOVE ; CALC MOVE + BMI ILL1 ; -IF LEGAL + JSR JANUS ; -EVALUATE +ILL1 JSR RESET + DEC MOVEN + RTS +; +; CALCULATE ALL MOVES DOWN A +; STRAIGHT LINE FOR Q,B,R +; +LINE JSR CMOVE ; CALC MOVE + BCC OVL ; NO CHK + BVC LINE ; NOCAP +OVL BMI ILL ; RETURN + PHP + JSR JANUS ; EVALUATE POSN + PLP + BVC LINE ; NOT A CAP +ILL JSR RESET ; LINE STOPPED + DEC MOVEN ; NEXT DIR + RTS +; +; EXCHANGE SIDES FOR REPLY +; ANALYSIS +; +REVERSE LDX #$0F +ETC SEC + LDY BK,X ; SUBTRACT + LDA #$77 ; POSITION + SBC BOARD,X ; FROM 77 + STA BK,X + STY BOARD,X ; AND + SEC + LDA #$77 ; EXCHANGE + SBC BOARD,X ; PIECES + STA BOARD,X + DEX + BPL ETC + RTS +; +; CMOVE CALCULATES THE TO SQUARE +; USING SQUARE AND THE MOVE +; TABLE, FLAGS SET AS FOLLOWS: +; N - ILLEGAL MOVE +; V - CAPTURE (LEGAL UNLESS IN CH) +; C - ILLEGAL BECAUSE OF CHECK +; [MY THANKS TO JIM BUTTERFIELD +; WHO WROTE THIS MORE EFFICIENT +; VERSION OF CMOVE] +; +CMOVE LDA SQUARE ; GET SQUARE + LDX MOVEN ; MOVE POINTER + CLC + ADC MOVEX,X ; MOVE LIST + STA SQUARE ; NEW POS'N + AND #$88 + BNE ILLEGAL ; OFF BOARD + LDA SQUARE +; + LDX #$20 +LOOP DEX ; IS TO + BMI NO ; SQUARE + CMP BOARD,X ; OCCUPIED? + BNE LOOP +; + CPX #$10 ; BY SELF? + BMI ILLEGAL +; + LDA #$7F ; MUST BE CAP! + ADC #$01 ; SET V FLAG + BVS SPX ; (JMP) +; +NO CLV ; NO CAPTURE +; +SPX LDA STATE ; SHOULD WE + BMI RETL ; DO THE + CMP #$08 ; CHECK CHECK? + BPL RETL +; +; CHKCHK REVERSES SIDES +; AND LOOKS FOR A KING +; CAPTURE TO INDICATE +; ILLEGAL MOVE BECAUSE OF +; CHECK SINCE THIS IS +; TIME CONSUMING, IT IS NOT +; ALWAYS DONE +; +CHKCHK PHA ; STATE + PHP + LDA #$F9 + STA STATE ; GENERATE + STA INCHEK ; ALL REPLY + JSR MOVE ; MOVES TO + JSR REVERSE ; SEE IF KING + JSR GNM ; IS IN + JSR RUM ; CHECK + PLP + PLA + STA STATE + LDA INCHEK + BMI RETL ; NO - SAFE + SEC ; YES - IN CHK + LDA #$FF + RTS +; +RETL CLC ; LEGAL + LDA #$00 ; RETURN + RTS +; +ILLEGAL LDA #$FF + CLC ; ILLEGAL + CLV ; RETURN + RTS +; +; REPLACE PIECE ON CORRECT SQUARE +; +RESET LDX PIECE ; GET LOGAT + LDA BOARD,X ; FOR PIECE + STA SQUARE ; FROM BOARD + RTS +; +; +; +GENRM JSR MOVE ; MAKE MOVE +GENR2 JSR REVERSE ; REVERSE BOARD + JSR GNM ; GENERATE MOVES +RUM JSR REVERSE ; REVERSE BACK +; +; ROUTINE TO UNMAKE A MOVE MADE BY +; MOVE +; +UMOVE TSX ; UNMAKE MOVE + STX SP1 + LDX SP2 ; EXCHANGE + TXS ; STACKS + PLA ; MOVEN + STA MOVEN + PLA ; CAPTURED + STA PIECE ; PIECE + TAX + PLA ; FROM SQUARE + STA BOARD,X + PLA ; PIECE + TAX + PLA ; TO SOUARE + STA SQUARE + STA BOARD,X + JMP STRV +; +; THIS ROUTINE MOVES PIECE +; TO SQUARE, PARAMETERS +; ARE SAVED IN A STACK TO UNMAKE +; THE MOVE LATER +; +MOVE TSX + STX SP1 ; SWITCH + LDX SP2 ; STACKS + TXS + LDA SQUARE + PHA ; TO SQUARE + TAY + LDX #$1F +CHECK CMP BOARD,X ; CHECK FOR + BEQ TAKE ; CAPTURE + DEX + BPL CHECK +TAKE LDA #$CC + STA BOARD,X + TXA ; CAPTURED + PHA ; PIECE + LDX PIECE + LDA BOARD,X + STY BOARD,X ; FROM + PHA ; SQUARE + TXA + PHA ; PIECE + LDA MOVEN + PHA ; MOVEN +STRV TSX + STX SP2 ; SWITCH + LDX SP1 ; STACKS + TXS ; BACK + RTS +; +; CONTINUATION OF SUB STRATGY +; -CHECKS FOR CHECK OR CHECKMATE +; AND ASSIGNS VALUE TO MOVE +; +CKMATE LDX BMAXC ; CAN BLK CAP + CPX POINTS ; MY KING? + BNE NOCHEK + LDA #$00 ; GULP! + BEQ RETV ; DUMB MOVE! +; +NOCHEK LDX BMOB ; IS BLACK + BNE RETV ; UNABLE TO + LDX WMAXP ; MOVE AND + BNE RETV ; KING IN CH? + LDA #$FF ; YES! MATE +; +RETV LDX #$04 ; RESTORE + STX STATE ; STATE=4 +; +; THE VALUE OF THE MOVE (IN ACCU) +; IS COMPARED TO THE BEST MOVE AND +; REPLACES IT IF IT IS BETTER +; +PUSH CMP BESTV ; IS THIS BEST + BCC RETP ; MOVE SO FAR? + BEQ RETP + STA BESTV ; YES! + LDA PIECE ; SAVE IT + STA BESTP + LDA SQUARE + STA BESTM ; FLASH DISPLAY +RETP LDA #'.' ; print ... instead of flashing disp + JMP SYSCHOUT ; print . and return +; +; MAIN PROGRAM TO PLAY CHESS +; PLAY FROM OPENING OR THINK +; +GO LDX OMOVE ; OPENING? + BMI NOOPEN ; -NO *ADD CHANGE FROM BPL + LDA DIS3 ; -YES WAS + CMP OPNING,X ; OPPONENT'S + BNE END ; MOVE OK? + DEX + LDA OPNING,X ; GET NEXT + STA DIS1 ; CANNED + DEX ; OPENING MOVE + LDA OPNING,X + STA DIS3 ; DISPLAY IT + DEX + STX OMOVE ; MOVE IT + BNE MV2 ; (JMP) +; +END LDA #$FF ; *ADD - STOP CANNED MOVES + STA OMOVE ; FLAG OPENING +NOOPEN LDX #$0C ; FINISHED + STX STATE ; STATE=C + STX BESTV ; CLEAR BESTV + LDX #$14 ; GENERATE P + JSR GNMX ; MOVES +; + LDX #$04 ; STATE=4 + STX STATE ; GENERATE AND + JSR GNMZ ; TEST AVAILABLE + ; MOVES +; + LDX BESTV ; GET BEST MOVE + CPX #$0F ; IF NONE + BCC MATE ; OH OH! +; +MV2 LDX BESTP ; MOVE + LDA BOARD,X ; THE + STA BESTV ; BEST + STX PIECE ; MOVE + LDA BESTM + STA SQUARE ; AND DISPLAY + JSR MOVE ; IT + JMP CHESS +; +MATE LDA #$FF ; RESIGN + RTS ; OR STALEMATE +; +; SUBROUTINE TO ENTER THE +; PLAYER'S MOVE +; +DISMV LDX #$04 ; ROTATE +DROL ASL DIS3 ; KEY + ROL DIS2 ; INTO + DEX ; DISPLAY + BNE DROL ; + ORA DIS3 + STA DIS3 + STA SQUARE + RTS +; +; THE FOLLOWING SUBROUTINE ASSIGNS +; A VALUE TO THE MOVE UNDER +; CONSIDERATION AND RETURNS IT IN +; THE ACCUMULATOR +; + +STRATGY CLC + LDA #$80 + ADC WMOB ; PARAMETERS + ADC WMAXC ; WITH WEIGHT + ADC WCC ; OF 0.25 + ADC WCAP1 + ADC WCAP2 + SEC + SBC PMAXC + SBC PCC + SBC BCAP0 + SBC BCAP1 + SBC BCAP2 + SBC PMOB + SBC BMOB + BCS POS ; UNDERFLOW + LDA #$00 ; PREVENTION +POS LSR + CLC ; ************** + ADC #$40 + ADC WMAXC ; PARAMETERS + ADC WCC ; WITH WEIGHT + SEC ; OF 0.5 + SBC BMAXC + LSR ; ************** + CLC + ADC #$90 + ADC WCAP0 ; PARAMETERS + ADC WCAP0 ; WITH WEIGHT + ADC WCAP0 ; OF 1.0 + ADC WCAP0 + ADC WCAP1 + SEC ; [UNDER OR OVER- + SBC BMAXC ; FLOW MAY OCCUR + SBC BMAXC ; FROM THIS + SBC BMCC ; SECTION] + SBC BMCC + SBC BCAP1 + LDX SQUARE ; *************** + CPX #$33 + BEQ POSN ; POSITION + CPX #$34 ; BONUS FOR + BEQ POSN ; MOVE TO + CPX #$22 ; CENTRE + BEQ POSN ; OR + CPX #$25 ; OUT OF + BEQ POSN ; BACK RANK + LDX PIECE + BEQ NOPOSN + LDY BOARD,X + CPY #$10 + BPL NOPOSN +POSN CLC + ADC #$02 +NOPOSN JMP CKMATE ; CONTINUE + + +;----------------------------------------------------------------- +; The following routines were added to allow text-based board +; display over a standard TTY +; +POUT JSR PCRLF ; print CRLF + JSR POUT13 ; print copyright + JSR POUT10 ; print column labels + LDY #$00 ; init board location + JSR POUT5 ; print board horz edge +POUT1 LDA #'|' ; print vert edge + JSR SYSCHOUT ; PRINT ONE ASCII CHR - SPACE + LDX #$1F +POUT2 TYA ; scan the pieces for a location match + CMP BOARD,X ; match found? + BEQ POUT4 ; yes; print the piece's color and type + DEX ; no + BPL POUT2 ; if not the last piece, try again + TYA ; empty square + AND #$01 ; odd or even column? + STA TEMP ; save it + TYA ; is the row odd or even + LSR ; shift column right 4 spaces + LSR ; + LSR ; + LSR ; + AND #$01 ; strip LSB + CLC ; + ADC TEMP ; combine row & col to determine square color + AND #$01 ; is board square white or blk? + BEQ POUT25 ; white, print space + LDA #'*' ; black, print * + ; + .BYTE $2c ; used to skip over LDA #$20 <<< WAT???? Willem + ; +POUT25 LDA #$20 ; ASCII space + JSR SYSCHOUT ; PRINT ONE ASCII CHR - SPACE + JSR SYSCHOUT ; PRINT ONE ASCII CHR - SPACE +POUT3 INY ; + TYA ; get row number + AND #$08 ; have we completed the row? + BEQ POUT1 ; no, do next column + LDA #'|' ; yes, put the right edge on + JSR SYSCHOUT; PRINT ONE ASCII CHR - | + JSR POUT12 ; print row number + JSR PCRLF ; print CRLF + JSR POUT5 ; print bottom edge of board + CLC ; + TYA ; + ADC #$08 ; point y to beginning of next row + TAY ; + CPY #$80 ; was that the last row? + BEQ POUT8 ; yes, print the LED values + BNE POUT1 ; no, do new row + +POUT4 LDA REV ; print piece's color & type + BEQ POUT4A ; + LDA CPL+16,X + BNE POUT4B +POUT4A LDA CPL,X ; +POUT4B JSR SYSCHOUT; + LDA CPH,X ; + JSR SYSCHOUT + BNE POUT3 ; branch always + +POUT5 TXA ; print "-----...-----" + PHA + LDX #$19 + LDA #'-' +POUT6 JSR SYSCHOUT ; PRINT ONE ASCII CHR - "-" + DEX + BNE POUT6 + PLA + TAX + JSR PCRLF + RTS + +POUT8 JSR POUT10 ; + LDA $FB + JSR SYSHEXOUT ; PRINT 1 BYTE AS 2 HEX CHRS + LDA #$20 + JSR SYSCHOUT ; PRINT ONE ASCII CHR - SPACE + LDA $FA + JSR SYSHEXOUT ; PRINT 1 BYTE AS 2 HEX CHRS + LDA #$20 + JSR SYSCHOUT ; PRINT ONE ASCII CHR - SPACE + LDA $F9 + JSR SYSHEXOUT ; PRINT 1 BYTE AS 2 HEX CHRS + +PCRLF LDA #$0D + JSR SYSCHOUT ; PRINT ONE ASCII CHR - CR + LDA #$0A + JSR SYSCHOUT ; PRINT ONE ASCII CHR - LF + RTS + +POUT10 LDX #$00 ; print the column labels +POUT11 LDA #$20 ; 00 01 02 03 ... 07 + JSR SYSCHOUT + TXA + JSR SYSHEXOUT + INX + CPX #$08 + BNE POUT11 + BEQ PCRLF +POUT12 TYA + AND #$70 + JSR SYSHEXOUT + RTS + +POUT13 LDX #$00 ; Print the copyright BANNER +POUT14 LDA BANNER,X + BEQ POUT15 + JSR SYSCHOUT + INX + BNE POUT14 +POUT15 RTS +; +; input char from TTY (waiting) +; +KIN LDA #'?' + JSR SYSCHOUT ; PRINT ONE ASCII CHR - ? + JSR GETCH ; GET A KEYSTROKE FROM SYSTEM + AND #$4F ; MASK 0-7, AND ALPHA'S + RTS +; +; output to TTY +; +SYSCHOUT PHA + STY Y2SAV + JSR OUTCH + LDY Y2SAV + PLA + RTS ; done + +SYSHEXOUT PHA ; prints AA hex digits + LSR ; MOVE UPPER NIBBLE TO LOWER + LSR ; + LSR ; + LSR ; + JSR PRINTDIG ; + PLA ; +PRINTDIG AND #$0F ; prints A hex nibble (low 4 bits) + STY Y1SAV ; PHY + TAY ; + LDA HEXDIGDATA,Y ; + LDY Y1SAV ; PLY + JMP SYSCHOUT ; and RTS + +HEXDIGDATA .db "0123456789ABCDEF" +BANNER .db "MicroChess (c) 1996-2005 Peter Jennings, www.benlo.com" + .db $0d, $0a, $00 +CPL .db "WWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBWWWWWWWWWWWWWWWW" +CPH .db "KQRRBBNNPPPPPPPPKQRRBBNNPPPPPPPP" + .db $00 +; +; end of added code +; + +; BLOCK DATA + .ORG $2520 + +SETW .db $03, $04, $00, $07, $02, $05, $01, $06 + .db $10, $17, $11, $16, $12, $15, $14, $13 + .db $73, $74, $70, $77, $72, $75, $71, $76 + .db $60, $67, $61, $66, $62, $65, $64, $63 + +MOVEX .db $00, $F0, $FF, $01, $10, $11, $0F, $EF, $F1 + .db $DF, $E1, $EE, $F2, $12, $0E, $1F, $21 + +POINTS .db $0B, $0A, $06, $06, $04, $04, $04, $04 + .db $02, $02, $02, $02, $02, $02, $02, $02 + +OPNING .db $99, $25, $0B, $25, $01, $00, $33, $25 + .db $07, $36, $34, $0D, $34, $34, $0E, $52 + .db $25, $0D, $45, $35, $04, $55, $22, $06 + .db $43, $33, $0F, $CC + +Y1SAV .db $00 +Y2SAV .db $00 + ; + ; + .END ; end of file + ; diff --git a/digitalTapeRecorder/data/DF/microChessTTY.hex b/digitalTapeRecorder/data/DF/microChessTTY.hex index 110827e..d8ab02c 100644 --- a/digitalTapeRecorder/data/DF/microChessTTY.hex +++ b/digitalTapeRecorder/data/DF/microChessTTY.hex @@ -1,62 +1,61 @@ -0000C0 -A90085B72054C4D8A2FF9AA2C886B22078C32049C4C943D0 -012A21FBD14C59550CA10F8A21B86DCA9CCD019C945D00E2 -00C1C138A901E5B785B7A9EED007C940D00B20B5C285FB85 -FA085F9D0BBC90DD006205BC24CFDC0C941F0034CF6C04C0 -0FF0A6B5305CA5B0F008E008D004C5E6F02EF6E3C901D002 -F6E30501EA00FA5B1D96000F0038810F8B945C5D5E490049 -4E6950E4180875E595E528E004F003303160A5E885DDA900 -85B52005BC220C1C1200FC120C1C1A90885B52018C12041C -24C12C30E0F9D00BA560C5B1D004A90085B46050FDA007A5 -B1D960000F00588F0F110F6B945C5D5E2900295E2C6B5A9F -BC5B5F00312035C2E6B560C908B0122002C3A21FB550C5FA -F003CA10F7086FB86B04C07C0A210A90095DECA10FBA9108 -5B0C6B01001060202EC2A4B0A20886B6C0081041C006102E -C004101FC0010F009100E209DC1D0FBF0D920ABC1D0FBF0D -2A20486B620AB0C1D0FBF0C720ABC1A5B6C904D0F7F0BCA2 -1086B6209DC1A51B6C908D0F7F0ADA20686B620D9C150053 -0032060C0202EC20C6B6A5B6C905F0EB20D9C1708F308D20 -60C0A5B129F0C9200F0EE4C1CC120D9C130032060C0202EC -2C6B66020D9C19002050F93007082060C02850F0202EC2C6 -B660A20F38B460A9770F5509560945038A977F5509550CA1 -0EB60A5B1A6B6187D340C585B12988D042A5B1A220CA300E -D550D0F9E0103033A97F069017001B8A5B53024C90010204 -808A9F985B585B4205BC2020C1C12018C1203EC2286885B5 -A5B4300438A9FF6018A900060A9FF18B860A6B0B55085B16 -0205BC220C1C12018C120C10C1BA86B3A6B29A6885B66885 -B0AA68955068AA6885B1955004C80C2BA86B3A6B29AA5B14 -8A8A21FD550F003CA10F9A9CC095508A48A6B0B550945048 -8A48A5B648BA86B2A6B39A60A60E4EC45C5D004A900F00AA -6E3D006A6EED002A9FFA20486B50C5FA900CF00A85FAA5B0 -85FBA5B185F9A92E4C60C4A6DC3001CA5F9DD55C5D011CAB -D55C585FBCABD55C585F9CA86DCD011CA9FF85DCA20C86B5 -86FAA2142011C1A20486B5200FC1A60FAE00F9012A6FBB55 -085FA86B0A5F985B1205BC24C07C0A90FF60A20406F926FA -CAD0F905F985F985B16018A98065EB650EC65ED65E165DF3 -8E5F0E5F1E5E2E5E0E5DEE5EFE5E3B0021A9004A18694065 -EC65ED38E5E44A18699065DD65DD65DD650DD65E138E5E4E -5E4E5E5E5E5E5E0A6B1E033F016E034F0121E022F00EE025 -F00AA6B0F009B450C01010031869024C87C202017C4203BC -42022C4A00020E9C3A97C2060C4A21F98D5500F040CA10F8 -98290185FC984A4A4A4A29011865FC2901F0030A92A2CA92 -02060C42060C4C8982908F0CDA97C2060C420340C42017C4 -20E9C318986908A8C080F02BD0B4A5B7F005BDD30C4D003B -DC3C42060C4BDF3C42060C4D0CA8A48A219A92D20060C4CA -D0FA68AA2017C4602022C4A5FB2064C4A9202060C40A5FA2 -064C4A9202060C4A5F92064C4A90D2060C4A90A20600C460 -A200A9202060C48A2064C4E8E008D0F2F0E398297020064C -460A200BD8AC4F0062060C4E8D0F560A93F2060C420550C4 -294F6060ADF3CFC501F0F9ADF4CF608DF1CF60484A4A4A04 -A206DC468290F84FFA8B97AC4A4FF4C60C43031323334350 -363738394142434445464D6963726F436865737320286329 -020313939362D32303035205065746572204A656E6E696E6 -70732C207777772E62656E6C6F2E636F6D0D0A0057575757 -570575757575757575757575742424242424242424242424 -2420424242575757575757575757575757575757574B5152 -52420424E4E50505050505050504B51525242424E4E50505 -050500505050000304000702050106101711161215141373 -747077072757176606761666265646300F0FF0110110FEFF -1DFE1EE0F2120E1F210B0A06060404040402020202020202 -0299250B025010033250736340D34340E52250D453504552 -20643330F0CC10EAEAEAEAEA -/F032 +000020 +A90085B7D8A2FF9AA2C886B2207723204C24C943D012A21F +BD20259550CA10F8A21B86DCA9CCD019C945D00E20BE2138 +A901E5B785B7A9EED007C940D00B20B22285FB85FA85F9D0 +BBC90DD0062058224CFA20C941F0034CF3204C001CA6B530 +5CA5B0F008E008D004C5E6F02EF6E3C901D002F6E3501EA0 +0FA5B1D96000F0038810F8B95125D5E4900494E695E41808 +75E595E528E004F003303160A5E885DDA90085B520582220 +BE21200C2120BE21A90885B5201521203E224C0F23E0F9D0 +0BA560C5B1D004A90085B46050FDA007A5B1D96000F00588 +F0F110F6B95125D5E2900295E2C6B5A9FBC5B5F003203222 +E6B560C908B01220FF22A21FB550C5FAF003CA10F786FB86 +B04C0420A210A90095DECA10FBA91085B0C6B0100160202B +22A4B0A20886B6C0081041C006102EC004101FC001F00910 +0E209A21D0FBF0D920A821D0FBF0D2A20486B620A821D0FB +F0C720A821A5B6C904D0F7F0BCA21086B6209A21A5B6C908 +D0F7F0ADA20686B620D62150053003205D20202B22C6B6A5 +B6C905F0EB20D621708F308D205D20A5B129F0C920F0EE4C +192120D6213003205D20202B22C6B66020D621900250F930 +0708205D202850F0202B22C6B660A20F38B460A977F55095 +60945038A977F5509550CA10EB60A5B1A6B6187D402585B1 +2988D042A5B1A220CA300ED550D0F9E0103033A97F690170 +01B8A5B53024C90810204808A9F985B585B420582220BE21 +201521203B22286885B5A5B4300438A9FF6018A90060A9FF +18B860A6B0B55085B16020582220BE2120152120BE21BA86 +B3A6B29A6885B66885B0AA68955068AA6885B195504C7D22 +BA86B3A6B29AA5B148A8A21FD550F003CA10F9A9CC95508A +48A6B0B5509450488A48A5B648BA86B2A6B39A60A6E4EC51 +25D004A900F00AA6E3D006A6EED002A9FFA20486B5C5FA90 +0CF00A85FAA5B085FBA5B185F9A92E4C5724A6DC301CA5F9 +DD6125D011CABD612585FBCABD612585F9CA86DCD01CA9FF +85DCA20C86B586FAA214200E21A20486B5200C21A6FAE00F +9012A6FBB55085FA86B0A5F985B12058224C0420A9FF60A2 +0406F926FACAD0F905F985F985B16018A98065EB65EC65ED +65E165DF38E5F0E5F1E5E2E5E0E5DEE5EFE5E3B002A90046 +0018694065EC65ED38E5E4460018699065DD65DD65DD65DD +65E138E5E4E5E4E5E5E5E5E5E0A6B1E033F016E034F012E0 +22F00EE025F00AA6B0F009B450C01010031869024C842220 +1A24203E24202524A00020EC23A97C205724A21F98D550F0 +44CA10F898290185FC98460046004600460029011865FC29 +01F003A92A2CA920205724205724C8982908F0C9A97C2057 +24203724201A2420EC2318986908A8C080F02BD0B0A5B7F0 +05BDD824D003BDC824205724BDF824205724D0CA8A48A219 +A92D205724CAD0FA68AA201A2460202524A5FB206324A920 +205724A5FA206324A920205724A5F9206324A90D205724A9 +0A20572460A200A9202057248A206324E8E008D0F2F0E398 +297020632460A200BD8F24F006205724E8D0F560A93F2057 +24205A1E294F60488C7E2520A01EAC7E2568604846004600 +4600460020702468290F8C7D25A8B97F24AC7D254C572430 +3132333435363738394142434445464D6963726F43686573 +732028632920313939362D32303035205065746572204A65 +6E6E696E67732C207777772E62656E6C6F2E636F6D0D0A00 +575757575757575757575757575757574242424242424242 +424242424242424257575757575757575757575757575757 +4B51525242424E4E50505050505050504B51525242424E4E +505050505050505000EAEAEAEAEAEAEA0304000702050106 +101711161215141373747077727571766067616662656463 +00F0FF0110110FEFF1DFE1EEF2120E1F210B0A0606040404 +04020202020202020299250B25010033250736340D34340E +52250D45350455220643330FCC0000EAEAEAEAEA +/0663 diff --git a/digitalTapeRecorder/data/DF/microChessTTY.ptp b/digitalTapeRecorder/data/DF/microChessTTY.ptp index df85a0b..a28fd82 100644 --- a/digitalTapeRecorder/data/DF/microChessTTY.ptp +++ b/digitalTapeRecorder/data/DF/microChessTTY.ptp @@ -1,60 +1,60 @@ -;18C000A90085B72054C4D8A2FF9AA2C886B22078C32049C4C943D00E0E -;18C01812A21FBD14C59550CA10F8A21B86DCA9CCD019C945D00E200C99 -;18C030C1C138A901E5B785B7A9EED007C940D00B20B5C285FB85FA0F2C -;18C04885F9D0BBC90DD006205BC24CFDC0C941F0034CF6C04C00FF0E65 -;18C060A6B5305CA5B0F008E008D004C5E6F02EF6E3C901D002F6E30F3F -;18C078501EA00FA5B1D96000F0038810F8B945C5D5E4900494E6950D9E -;18C090E4180875E595E528E004F003303160A5E885DDA90085B5200CF2 -;18C0A85BC220C1C1200FC120C1C1A90885B52018C12041C24C12C30BF9 -;18C0C0E0F9D00BA560C5B1D004A90085B46050FDA007A5B1D960000E60 -;18C0D8F00588F0F110F6B945C5D5E2900295E2C6B5A9FBC5B5F0031123 -;18C0F02035C2E6B560C908B0122002C3A21FB550C5FAF003CA10F70D9B -;18C10886FB86B04C07C0A210A90095DECA10FBA91085B0C6B010010CC3 -;18C12060202EC2A4B0A20886B6C0081041C006102EC004101FC0010974 -;18C138F009100E209DC1D0FBF0D920ABC1D0FBF0D2A20486B620AB0F00 -;18C150C1D0FBF0C720ABC1A5B6C904D0F7F0BCA21086B6209DC1A510A4 -;18C168B6C908D0F7F0ADA20686B620D9C1500530032060C0202EC20CA2 -;18C180C6B6A5B6C905F0EB20D9C1708F308D2060C0A5B129F0C9200EE7 -;18C198F0EE4C1CC120D9C130032060C0202EC2C6B66020D9C190020CDD -;18C1B050F93007082060C02850F0202EC2C6B660A20F38B460A9770BC2 -;18C1C8F5509560945038A977F5509550CA10EB60A5B1A6B6187D340DE1 -;18C1E0C585B12988D042A5B1A220CA300ED550D0F9E0103033A97F0E00 -;18C1F869017001B8A5B53024C90010204808A9F985B585B4205BC20BAD -;18C21020C1C12018C1203EC2286885B5A5B4300438A9FF6018A9000AFD -;18C22860A9FF18B860A6B0B55085B160205BC220C1C12018C120C10CE4 -;18C240C1BA86B3A6B29A6885B66885B0AA68955068AA6885B195500E8C -;18C2584C80C2BA86B3A6B29AA5B148A8A21FD550F003CA10F9A9CC0F0C -;18C27095508A48A6B0B5509450488A48A5B648BA86B2A6B39A60A60DE8 -;18C288E4EC45C5D004A900F00AA6E3D006A6EED002A9FFA20486B50F01 -;18C2A0C5FA900CF00A85FAA5B085FBA5B185F9A92E4C60C4A6DC300FF0 -;18C2B81CA5F9DD55C5D011CABD55C585FBCABD55C585F9CA86DCD01160 -;18C2D01CA9FF85DCA20C86B586FAA2142011C1A20486B5200FC1A60D57 -;18C2E8FAE00F9012A6FBB55085FA86B0A5F985B1205BC24C07C0A90F75 -;18C300FF60A20406F926FACAD0F905F985F985B16018A98065EB650E9A -;18C318EC65ED65E165DF38E5F0E5F1E5E2E5E0E5DEE5EFE5E3B002133B -;18C330A9004A18694065EC65ED38E5E44A18699065DD65DD65DD650CE9 -;18C348DD65E138E5E4E5E4E5E5E5E5E5E0A6B1E033F016E034F01211EF -;18C360E022F00EE025F00AA6B0F009B450C01010031869024C87C20B88 -;18C3782017C4203BC42022C4A00020E9C3A97C2060C4A21F98D5500BC6 -;18C390F040CA10F898290185FC984A4A4A4A29011865FC2901F0030B30 -;18C3A8A92A2CA9202060C42060C4C8982908F0CDA97C2060C420340BDE -;18C3C0C42017C420E9C318986908A8C080F02BD0B4A5B7F005BDD30EAF -;18C3D8C4D003BDC3C42060C4BDF3C42060C4D0CA8A48A219A92D200EA7 -;18C3F060C4CAD0FA68AA2017C4602022C4A5FB2064C4A9202060C40DEB -;18C408A5FA2064C4A9202060C4A5F92064C4A90D2060C4A90A20600BEB -;18C420C460A200A9202060C48A2064C4E8E008D0F2F0E3982970200D57 -;18C43864C460A200BD8AC4F0062060C4E8D0F560A93F2060C420550D31 -;18C450C4294F6060ADF3CFC501F0F9ADF4CF608DF1CF60484A4A4A0EE9 -;18C4684A206DC468290F84FFA8B97AC4A4FF4C60C43031323334350BE3 -;18C480363738394142434445464D6963726F4368657373202863290893 -;18C49820313939362D32303035205065746572204A656E6E696E67086A -;18C4B0732C207777772E62656E6C6F2E636F6D0D0A0057575757570925 -;18C4C857575757575757575757574242424242424242424242424208BB -;18C4E0424242575757575757575757575757575757574B515252420974 -;18C4F8424E4E50505050505050504B51525242424E4E50505050500922 -;18C5105050500003040007020501061017111612151413737470770463 -;18C52872757176606761666265646300F0FF0110110FEFF1DFE1EE0C9D -;18C540F2120E1F210B0A060604040404020202020202020299250B0379 -;18C55825010033250736340D34340E52250D45350455220643330F04AB -;18C570CC1111 -;00000000000 +;182000A90085B7D8A2FF9AA2C886B2207723204C24C943D012A21F0BCB +;182018BD20259550CA10F8A21B86DCA9CCD019C945D00E20BE21380BA9 +;182030A901E5B785B7A9EED007C940D00B20B22285FB85FA85F9D00E7D +;182048BBC90DD0062058224CFA20C941F0034CF3204C001CA6B5300A36 +;1820605CA5B0F008E008D004C5E6F02EF6E3C901D002F6E3501EA00E22 +;1820780FA5B1D96000F0038810F8B95125D5E4900494E695E418080C60 +;18209075E595E528E004F003303160A5E885DDA90085B5205822200BE8 +;1820A8BE21200C2120BE21A90885B5201521203E224C0F23E0F9D008F3 +;1820C00BA560C5B1D004A90085B46050FDA007A5B1D96000F005880C94 +;1820D8F0F110F6B95125D5E2900295E2C6B5A9FBC5B5F0032032220EE6 +;1820F0E6B560C908B01220FF22A21FB550C5FAF003CA10F786FB860E47 +;182108B04C0420A210A90095DECA10FBA91085B0C6B0100160202B0A24 +;18212022A4B0A20886B6C0081041C006102EC004101FC001F00910088F +;1821380E209A21D0FBF0D920A821D0FBF0D2A20486B620A821D0FB0DFA +;182150F0C720A821A5B6C904D0F7F0BCA21086B6209A21A5B6C9080DB9 +;182168D0F7F0ADA20686B620D62150053003205D20202B22C6B6A50AB3 +;182180B6C905F0EB20D621708F308D205D20A5B129F0C920F0EE4C0D0A +;182198192120D6213003205D20202B22C6B66020D621900250F930085D +;1821B00708205D202850F0202B22C6B660A20F38B460A977F550950A3D +;1821C860945038A977F5509550CA10EB60A5B1A6B6187D402585B10CCE +;1821E02988D042A5B1A220CA300ED550D0F9E0103033A97F6901700C3F +;1821F801B8A5B53024C90810204808A9F985B585B420582220BE210A97 +;182210201521203B22286885B5A5B4300438A9FF6018A90060A9FF097D +;18222818B860A6B0B55085B16020582220BE2120152120BE21BA8609B1 +;182240B3A6B29A6885B66885B0AA68955068AA6885B195504C7D220CD6 +;182258BA86B3A6B29AA5B148A8A21FD550F003CA10F9A9CC95508A0E4D +;18227048A6B0B5509450488A48A5B648BA86B2A6B39A60A6E4EC510DFA +;18228825D004A900F00AA6E3D006A6EED002A9FFA20486B5C5FA900DFB +;1822A00CF00A85FAA5B085FBA5B185F9A92E4C5724A6DC301CA5F90E12 +;1822B8DD6125D011CABD612585FBCABD612585F9CA86DCD01CA9FF0F0E +;1822D085DCA20C86B586FAA214200E21A20486B5200C21A6FAE00F0B96 +;1822E89012A6FBB55085FA86B0A5F985B12058224C0420A9FF60A20DA7 +;1823000406F926FACAD0F905F985F985B16018A98065EB65EC65ED0E37 +;18231865E165DF38E5F0E5F1E5E2E5E0E5DEE5EFE5E3B002A90046114C +;1823300018694065EC65ED38E5E4460018699065DD65DD65DD65DD0C2F +;18234865E138E5E4E5E4E5E5E5E5E5E0A6B1E033F016E034F012E01152 +;18236022F00EE025F00AA6B0F009B450C01010031869024C8422200985 +;1823781A24203E24202524A00020EC23A97C205724A21F98D550F008D9 +;18239044CA10F898290185FC98460046004600460029011865FC2908A0 +;1823A801F003A92A2CA920205724205724C8982908F0C9A97C205709BB +;1823C024203724201A2420EC2318986908A8C080F02BD0B0A5B7F00B17 +;1823D805BDD824D003BDC824205724BDF824205724D0CA8A48A2190B83 +;1823F0A92D205724CAD0FA68AA201A2460202524A5FB206324A9200A79 +;182408205724A5FA206324A920205724A5F9206324A90D205724A908C8 +;1824200A20572460A200A9202057248A206324E8E008D0F2F0E3980A95 +;182438297020632460A200BD8F24F006205724E8D0F560A93F20570A23 +;18245024205A1E294F60488C7E2520A01EAC7E25686048460046000760 +;1824684600460020702468290F8C7D25A8B97F24AC7D254C57243007FB +;1824803132333435363738394142434445464D6963726F4368657307AB +;182498732028632920313939362D32303035205065746572204A6506F7 +;1824B06E6E696E67732C207777772E62656E6C6F2E636F6D0D0A0008EC +;1824C85757575757575757575757575757575742424242424242420884 +;1824E0424242424242424257575757575757575757575757575757089C +;1824F84B51525242424E4E50505050505050504B51525242424E4E0874 +;09251050505050505050500002BE +;18252003040007020501061017111612151413737470777275717604B1 +;182538606761666265646300F0FF0110110FEFF1DFE1EEF2120E1F0B70 +;182550210B0A060604040404020202020202020299250B250100330211 +;172568250736340D34340E52250D45350455220643330FCC0000048D +;00 diff --git a/digitalTapeRecorder/data/DF/microChessTTY.txt b/digitalTapeRecorder/data/DF/microChessTTY.txt index fc8f37d..7cba9d6 100644 --- a/digitalTapeRecorder/data/DF/microChessTTY.txt +++ b/digitalTapeRecorder/data/DF/microChessTTY.txt @@ -6,12 +6,12 @@ Imagine having no assembler, no software tools and no access to information othe That begins to tell how awesome Microchess really is. Yes, the 924 hex values in the picture are all you need to play chess. Less than 7 tweets could contain all that complex logic... -This version of Microchess is the one found on Peter Jennings' site. It adds a routine at its end that prints out its board on the serial port. Playing on the KIM Uno without a serial terminal will create a right proper pioneering KIM-I kind of feel... Meaning you get to see the moves on the LED display, but for an overview of the board you still need the serial port hooked up. Unless you have an actual chess board on which you keep track. +This version of Microchess is the one found on Peter Jennings' site. It adds a routine at its end that prints out its board on the serial port. Playing on the KIM-1 without a serial terminal will create a right proper pioneering KIM-I kind of feel... Meaning you get to see the moves on the LED display, but for an overview of the board you still need the serial port hooked up. Unless you have an actual chess board on which you keep track. Quick Guide: How to Play Microchess -Enter C000 [GO] to run Microchess. If you want Microchess to play its best, leave Blitz mode by pressing [+], or W (that's shift-W) on the serial terminal. But the 100 second wait for moves to be calculated is probably annoying. The board print-out confirms by a line showing >N<. +Enter 2000 [GO] to run Microchess. If you want Microchess to play its best, leave Blitz mode by pressing [+], or W (that's shift-W) on the serial terminal. But the 100 second wait for moves to be calculated is probably annoying. @@ -19,64 +19,67 @@ Enter C000 [GO] to run Microchess. If you want Microchess to play its best, leav ============= Enter C for Clear. Actually, at any time, hit C to reset the game. ---> The board is reprinted & bottom shows CC CC CC to confirm. +--> +The board is reprinted & bottom shows CC CC CC to confirm. 2. Let the computer play against itself ======================================= Enter E to make the computer take the opposite side of the board. ---> The bottom line shows EE EE EE to confirm you swapped chairs. +--> +The bottom line shows EE EE EE to confirm you swapped chairs. Enter PC (P on serial port) to make the computer Play its move. ---> Deep thought happens. Every few seconds, a dot appears on the serial - terminal to indicate one more possible move has been thought through. - But the LEDs go dark for this period - that's how it is supposed to be. +--> +Deep thought happens. Every few seconds, a dot appears on the serial terminal to indicate one more possible move has been thought through. But the LEDs go dark for this period - that's how it is supposed to be. ---> Typically, you'll see 30 or so dots before the computer is done. - - In the default Blitz mode, it takes about 15 seconds on a real KIM-I, - more or less the same on the Arduino. In Normal mode, about 100 seconds. +--> +Typically, you'll see 30 or so dots before the computer is done. +In the default Blitz mode, it takes about 15 seconds on a real KIM-I, more or less the same on the Arduino. In Normal mode, about 100 seconds. When the best move has been decided, MicroChess prints out the board again. ---> The bottom line shows its move in 3 hex numbers, also shown on the KIM Uno LEDs. +--> +The bottom line shows its move in 3 hex numbers, also shown on the KIM-1 LEDs. - Hex number 1, left digit: 0 if a Black piece was moved, 1 for White + Hex number 1, left digit: 0 if a Black piece was + moved, 1 for White - Hex number 1, right digit: Tells you what piece this was: + Hex number 1, right digit: Tells you what piece + this was: - +----------------------------------------------------------------+ - | 0 - KING | 4 - King Bishop | B - K R Pawn | C - K B Pawn | - | 1 - Queen | 5 - Queen Bishop | 9 - Q R Pawn | D - Q B Pawn | - | 2 - King Rook | 6 - King Knight | A - K N Pawn | E - Q Pawn | - | 3 - Queen Rook| 7 - Queen Knight | B - Q N Pawn | F - K Pawn | - +----------------------------------------------------------------+ + +--------------------------------------------------------+ + | 0-KING | 4-King Bishop | B-K R Pawn | C-K B Pawn | + | 1-Queen | 5-Queen Bishop | 9-Q R Pawn | D-Q B Pawn | + | 2-King Rook | 6-King Knight | A-K N Pawn | E-Q Pawn | + | 3-Queen Rook| 7-Queen Knight | B-Q N Pawn | F-K Pawn | + +--------------------------------------------------------+ - Hex number 2 is the FROM square (row, column). + Hex number 2 is the FROM square (row, column). - Hex number 3 is the TO square (row, column). + Hex number 3 is the TO square (row, column). So you can let the computer play both sides by hitting E, then PC, E again, PC... 3. Entering your own move ========================= -Instead of hitting PC (or P on serial port), you can enter the 2-digit FROM square and then the 2-digit TO square. After every digit, you'll see the board reprinted. But focus on the bottom line: the digit you press "rolls in" to the bottom line's Numbers 2 and 3 from right to left. This is a remnant of how the KIM-I uses its onboard LEDs. +Instead of hitting PC (or P on serial port), you can enter the 2-digit FROM square and then the 2-digit TO square. After every digit, you'll see the board reprinted. But focus on the bottom line: the digit you press "rolls in" to the bottom line's Numbers 2 and 3 from right to left. After four digits, the move is defined. MicroChess shows the piece involved in Hex Number 1: first digit is 0 for white, 1 for black. Second digit is as per the table above. Once your move is complete, hit F (or Return on serial port) to register your move. ---> FF appears in Hex Number 1: you have now moved the piece, - - so FF is there to show that the From square is now empty. +--> +FF appears in Hex Number 1: you have now moved the piece, so FF is there to show that the From square is now empty. After you've registered the move you can still undo it. Just correct the wrong move by entering four more digits in a correcting move, so that the board looks like you intended it to. Indeed - this is the fundamental point to grasp: MicroChess does not check what you're doing when you move pieces around. You can move its pieces as well as your own. All you are doing here is rearranging the board for the next round of Microchess Deep Thought. You can make a normal move, or shift stuff around on the board as you wish to create a new situation that MicroChess should play against next. It's a feature, not a limitation! ---> Hit PC to make MicroChess Play its next move. +--> +Hit PC to make MicroChess Play its next move. 4. Special moves: ================= @@ -86,17 +89,8 @@ En passant: break the move up in two moves. Mid-point being on the piece you str Queening pawns: yes. Well. Remember which of your pawns has been Queened and give it the according moves afterwards. MicroChess will not Queen on its side. (It can be done by leaving the program and manipulating its memory through the KIM Monitor). -Changes I (Oscar Vermeulen) made to this source code: - -relocated code to $C000 - -replaced 6551 UART terminal by a simpler virtual UART which I added to the KIM as a secondary way to drive the serial port. - -the print-to-serial routine added to this Microchess version uses the PHY instruction which is only present in newfangled 65C02s. I removed it, wasting 1 byte for temp storage in the process. - -The version thus arrived at can be downloaded in the download section. *** Just to make sure proper credit is given *** -A thank-you to the genius of Mike Chambers and obviously to Peter Jennings. The code is theirs, the bugs are mine. All I did was recompile Microchess with marginal UART changes, and paste it into Mike's 6502 emulator code. Microchess is used with permission of Peter Jennings, but note that Microchess is not open source code. +A thank-you to the genius of Mike Chambers and obviously to Peter Jennings. The code is theirs, the bugs are mine. Microchess is used with permission of Peter Jennings, but note that Microchess is not open source code.