From c6500f191191453b882d00bd0847e7772e5819ad Mon Sep 17 00:00:00 2001 From: Dagen Brock Date: Tue, 24 Feb 2015 15:05:03 -0600 Subject: [PATCH] string engine partially workign --- src/applerom.s | 55 ++++++++++++++++++++++++++++++ src/mt.s | 91 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 src/applerom.s diff --git a/src/applerom.s b/src/applerom.s new file mode 100644 index 0000000..3c28959 --- /dev/null +++ b/src/applerom.s @@ -0,0 +1,55 @@ +************************************************** +* Apple Standard Memory Locations +************************************************** +CLRLORES equ $F832 +LORES equ $C050 +TXTSET equ $C051 +MIXCLR equ $C052 +MIXSET equ $C053 +TXTPAGE1 equ $C054 +TXTPAGE2 equ $C055 +KEY equ $C000 +C80STOREOFF equ $C000 +C80STOREON equ $C001 +STROBE equ $C010 +SPEAKER equ $C030 +VBL equ $C02E +RDVBLBAR equ $C019 ;not VBL (VBL signal low + +RAMWRTAUX equ $C005 +RAMWRTMAIN equ $C004 +SETAN3 equ $C05E ;Set annunciator-3 output to 0 +SET80VID equ $C00D ;enable 80-column display mode (WR-only) + + + +COUT equ $FDED ; Calls the output routine whose address is stored in CSW, + ; normally COUTI +CLREOL equ $FC9C ; Clears to end of line from current cursor position +CLEOLZ equ $FC9E ; Clear to end ofline using contents of Y register as cursor + ; position +CLREOP equ $FC42 ; Clears to bottom of window +CLRSCR equ $F832 ; Clears the low-resolution screen +CLRTOP equ $F836 ; Clears the top 40 lines of the low-resolution screen +COUTI equ $FDF0 ; Displays a character on the screen +CROUT equ $FD8E ; Generates a carriage return +CROUT1 equ $FD8B ; Clears to end ofline and then generates a carriage return +GETLN equ $FD6A ; Displays the prompt character; accepts a string of characters + ; by means of RDKEY +HLINE equ $F819 ; Draws a horizontal line of blocks +HOME equ $FC58 ; Clears the window and puts the cursor in the upper left + ; corner of the window +KEYIN equ $FD1B ; With 80-column fumware inactive, displays checkerboard + ; cursor; accepts characters from keyboard +PLOT equ $F800 ; Plots a single low-resolution block on the screen +PRBL2 equ $F94A ; Sends 1 to 256 blank spaces to the output device +PRBYTE equ $FDDA ; Prints a hexadecimal byte +PRHEX equ $FDE3 ; Prints 4 bits as a hexadecimal number + +PRNTAX equ $F941 ; Prints the contents of A and X in hexadecimal format +RDKEY equ $FD0C ; Displays blinking cursor; goes to standard input + ; routine, nonnally KEYIN or BASICIN +SCRN equ $F871 ; Reads color of a low-resolution block +SETCOL equ $F864 ; Sets the color for plotting in low-resolution block +VTABZ equ $FC24 ; Sets the cursor vertical position +VLINE equ $F828 ; Draws a vertical line of low-resolution blocks diff --git a/src/mt.s b/src/mt.s index ee1b6b9..5141e49 100644 --- a/src/mt.s +++ b/src/mt.s @@ -1,16 +1,20 @@ **************************************** -* Quit8 * +* MemoryTester * * * * Dagen Brock * -* 2013-06-24 * +* 2015-02-23 * **************************************** org $2000 ; start at $2000 (all ProDOS8 system files) typ $ff ; set P8 type ($ff = "SYS") for output file - DSK mtsystem ; tell compiler what name for output file + dsk mtsystem ; tell compiler what name for output file + put applerom + MLI equ $bf00 + jsr DrawMenu + jsr WaitKey Quit jsr MLI ; first actual command, call ProDOS vector @@ -27,3 +31,84 @@ QuitParm dfb 4 ; number of parameters Error brk $00 ; shouldn't be here either + +DrawMenu jsr HOME + lda #MenuStrs + ldy #>MenuStrs + ldx #05 ; horiz pos + jsr PrintStringsX + rts + +; lda #MenuStr1 +; ldy #>MenuStr1 +; jsr PrintString + +PrintStringsX stx _printstringsx_horiz ; IGNORED! 4 NOW! + + sta $0 + sty $1 +:loop lda $0 ; slower, but allows API reuse + ldy $1 + jsr PrintString ; y is last val + iny + lda ($0),y + beq :done + tya ; not done so add strlen to source ptr + clc + adc $0 + sta $0 + bcc :nocarry + inc $1 +:nocarry bra :loop + + +:done rts + + + +_printstringsx_horiz db 00 + +* PrintString (A=Low Byte, Y=High Byte) +PrintString sta $0 + sty $1 + + ldy #0 +:loop lda ($0),y + beq :done + jsr COUT + iny + bra :loop +:done rts + +MenuStrs + asc " *********************** ",$8D,$00 + asc " ** **",$8D,$00 + asc " ** Mini Memory Tester **",$8D,$00 + asc " ** Reactive Micro **",$8D,$00 + asc " ** (beta) **",$8D,$00 + asc " ** **",$8D,$00 + asc " *********************** ",$8D,$00 + asc $8D,$8D,$8D,$00 + asc " Start BANK: ",$8D,$00 + asc " End BANK: ",$8D,$8D,$00 + asc " Start ADDR: ",$8D,$00 + asc " End ADDR: ",$8D,$8D,$8D,$00 + asc " Test Byte: (Leave empty = random)",$8D,00 + + hex 00,00 + + + + +WaitKey +:kloop lda KEY + bpl :kloop + sta STROBE + rts + +* DEFAULTS +StartBank db #$02 +EndBank db #$7F +StartAddr dw #$0000 +EndAddr dw #$FFFF +