diff --git a/vic20/include/file.a02 b/vic20/include/file.a02 deleted file mode 100644 index 79df879..0000000 --- a/vic20/include/file.a02 +++ /dev/null @@ -1,289 +0,0 @@ -; Requires external routines SETSRC and SETDST -; Requires the following RAM locations be defined -; external zero page byte pairs SRCLO,SRCHI and DSTLO,DSTHI -; and external bytes TEMP0, TEMP1, TEMP2, and TEMP3 -; as well as constant FOMAX and a table of FOMAX+1 -; consecutive bytes named FTBL - -;finit() - Initialize File System -FSINIT: LDA #$40 ;Control Messages Only - JSR SETMSG ;Kernal - Set System Messages - JMP FSHUT ;Close All Files - - LDA #15 ;OPEN 15,8,15,"I" - LDX #8 - TAY - JMP SETLFS - LDA 1 - LDY #>FSINII - LDX # FOMAX * - * file table entry, otherwise */ -char fstat(); - -/* Open File * - * Args: fd - device number * - * &f - string containing filename * - * Returns: file pointer if successful * - 0 if an error occurs */ -char fopen(); - -/* Close File * - * Args: fp - file pointer * - * Returns: 0 if successful * - 255 if an error occurred */ -char fclose(); - -/* Close All Files * - * Returns: system dependent error number * - 0 if no error */ -char fclall(); - -/* End of File * - * Args: fp - file pointer * -* Returns: 0 if not at end of file * - 255 if end of file reached */ -char feof(); - -/* File Error * - * Returns: system dependent error number * - 0 if no error */ -char ferror(); - -/* Read Character from File * - * Args: fp - file pointer * - * Returns: ASCII value of character * - * system dependent garbage * - character if past end of file */ -char fgetc(); - -/* Write Character to File * - * Args: fp - file pointer * - * c - ASCII character to write * - * Returns: ASCII value of character */ -char fputc(); - -/* Read String from File * - * Args: fp - file pointer * - * &s - string read from file * - * Returns: length of string * - * 255 if error during write */ -char fgets(); - -/* Write String to File * - * Args: fp - file pointer * - * &s - string to print from * - * Returns: ending position in string * - * 255 if error during write */ -char fputs(); - -/* Write Line to File * - * Args: fp - file pointer * - * &s - string to print from * - * Returns: ending position in string * - * 255 if error during write */ -char fputln(); - -/* Set Array for fread() * - * Args: &s - Destination string */ -void fsdst(); - -/* Read Bytes from File * - * Args: fp - file pointer * - * n - number of bytes to read * - * Returns: number of bytes read */ -char fread(); - -/* Set Array for fwrite() * - * Args: &s - Destination string */ -void fssrc(); - -/* Write Bytes to File * - * Args: fp - file pointer * - * n - number of bytes to write * - * Returns: number of bytes written */ -char fwrite(); - \ No newline at end of file diff --git a/vic20/include/hires.a02 b/vic20/include/hires.a02 deleted file mode 100644 index 0ccae19..0000000 --- a/vic20/include/hires.a02 +++ /dev/null @@ -1,50 +0,0 @@ -; C02 library hires.h02 assembly language subroutines -; Requires Thomas Magnusson's HIRES Package loaded at $1C00 - -;void hrinit() - Initialize High Resolution Graphics -HRINIT EQU $1C00 ;Aliased to Initialize Routine - -;void hrfclr() - Set Foreground Color -HRFCLR EQU $1C2E ;Set Dot Color Routine Alternate Entry Point - -;void hrclrs() - Clear High Resolution Screen -HRCLRS EQU $1C37 ;Aliased to Clear Screen Routine - -;void hrsetp(x, y) - Set Pixel to Foreground Color -HRSETP JSR HRSTRT ;Store X and Y Coordinates - JMP $1CB2 ;Execute Draw Dot Routine - -;void hrrstp(x, y) - Reset Pixel to Background Color -HRRSTP JSR HRSTRT ;Store X and Y Coordinates - JMP $1CC0 ;Execute Clear Dot Routine - -;char hrgetp(x, y) - Get Pixel Status -HRGETP JSR HRSTRT ;Store X and Y Coordinates - JMP $1CCD ;Execute Get Dot Routine - -HRSTRX STX 2 ;Store A, Y, and X Registers -;void hrstrt(x, y) - Set Start Point -HRSTRT STA 0 ;Store X Coordinate - STY 1 ;Store Y Coordianate - RTS - -;void hrdrto(x, y) - Draw To Point -HRDRTO STA 2 ;Store Ending X Coordinate - STY 3 ;Store Ending Y Coordinate - JMP $1D98 ;Execute Draw Line Routine - -;void hrclto(x, y) - Clear to Point -HRCLTO STA 2 ;Store Ending X Coordinate - STY 3 ;Store Ending Y Coordinate - JMP $1D98 ;Execute Draw Line Routine - -;void hrsave() - Save Image from Tape -HRSAVE EQU $1DA8 ;Aliased to Save ROutine - -;void hrload(f, r, b) - Load Image from Tape -HRLOAD JSR HRSTRX ;Store A, Y and X Registers - JMP $1DBA ;Execute Load Routine - -;void hrsetc(f, r, b) - Set Screen Colors -HRSETC JSR HRSTRX ;Store A, Y and X Registers - JMP $1DCC ;Execute Set Screen Colors Routine diff --git a/vic20/include/vic20.a02 b/vic20/include/vic20.a02 deleted file mode 100644 index 05b10ce..0000000 --- a/vic20/include/vic20.a02 +++ /dev/null @@ -1,157 +0,0 @@ -; c02 Program Initialization Code for Unexpanded VIC-20 - -;ASCII Control Codes Equivalents -CR EQU $0D ;Carriage Return -LF EQU $11 ;Line Feed (Cursor Down) -DEL EQU $14 ;Delete -HT EQU $1D ;Horizontal Tab (Cursor Right) -VT EQU $91 ;Vertical Tab (Cursor Up) -FF EQU $93 ;Form Feed (Clear Screen) -BS EQU $9D ;Backspace (Cursor Left) - -;PETSCII Key Mappings -DELKEY EQU $14 ;Delete/Backspace Key (Delete) -ESCKEY EQU $03 ;Escape/Stop Key (RUN/STOP) -RTNKEY EQU $0D ;Return/Enter Key (RETURN) - -;Standard Library Constants -FOMAX EQU 7 ;Maximum Number of Open Files -FNMAX EQU 16 ;Maximum Filename Length - -;Zero Page Variables -PTRLO EQU $35 ;System Pointer (pointer.a02) -PTRHI EQU $36 ;NOTE: Overwritten by BASIC String Routines - -BLKLO EQU $50 ;Block Pointer (block.a02) -BLKHI EQU $51 ;NOTE: Overwritten by BASIC String Routines - -TIMEH EQU $A0 ;Jiffy Clock High Byte -TIMEM EQU $A1 ;Jiffy Clock Middle Byte -TIMEL EQU $A2 ;Jiffy Clock Low Byte - -SRCLO EQU $FB ;Source Pointer Low Byte (stdlib.a02, etc.) -SRCHI EQU $FC ;Source Pointer High Byte -DSTLO EQU $FD ;Destination Pointer Low Byte (stdlib.a02, etc.) -DSTHI EQU $FE ;Destination Pointer High Byte - -;Page 1 RAM Locations (Unused Area at Bottom of Stack) -FTBL EQU $0140 ;File Table (files.a02) Same on PET - -;Other RAM Locations -TEMP0 EQU $0310 ;Temporary Variables -TEMP1 EQU $0311 ;Used by Library Functions -TEMP2 EQU $0312 -TEMP3 EQU $0334 ;($0313 is Free on VIC-20 but not C64) -BLKLEN EQU $0335 ;Block Segment Length -BLKSLO EQU $0336 ;Block Start Address -BLKSHI EQU $0337 -BLKELO EQU $0338 ;Block End Address -BLKEHI EQU $0339 -; EQU $033A ;Free Byte for User Programs -; EQU $033B ;Free Byte for User Programs -TBFFR EQU $033C ;Cassette I/O Buffer -; EQU $03FC ;Free Byte for User Programs -RANDOM EQU $03FD ;Seed for rand() Function -RDSEED EQU $03FE ;Seed for random() Function -STKPTR EQU $03FF ;Stack Pointer Storage - -;Video RAM and ROM -VICSCN EQU $1E00 ;Video Screen Memory Area (Unexpanded) -CHRROM EQU $8000 ;Character Generator ROM -VICCLR EQU $9600 ;COLOR RAM (UNEXPANDED) - -;Kernal Routines -SETMSG EQU $FF90 ;Control System Message Output -SETLFS EQU $FFBA ;Set up Logical File -READST EQU $FFB7 ;Read Status Word -SETNAM EQU $FFBD ;Set File Name -OPEN EQU $FFC0 ;Open a Logical File -CLOSE EQU $FFC3 ;Close Logical File -CHKIN EQU $FFC6 ;Open Channel for Input -CHKOUT EQU $FFC9 ;Open Channel for Output -CLRCHN EQU $FFCC ;Clear I/O Channels -CHRIN EQU $FFCF ;Input Character to Channel -CHROUT EQU $FFD2 ;Output Character to Channel -GETIN EQU $FFE4 ;Read Character from Keyboard Buffer -CLALL EQU $FFE7 ;Close All Files - -;Machine Language Basic Stub - ORG $1001 ;Start -BASIC: DC $0C, $10 ; Pointer to Next Line (4108) - DC $00, $00 ; Line Number (0) - DC $9E ; SYS - DC $20 ; ' ' - DC $34, $31, $31 ,$30 ; "4110" - DC $00 ;End of Line Marker - DC $00, $00 ;End of Basic Program - -START: TSX ;Get Stack Pointer - STX STKPTR ;and Save for Exit - LDA TIMEL ;Load Jiffy Clock Low Byte - STA RDSEED ;and Store in Random Seed - JMP MAIN ;Execute Program - -EXIT: LDX STKPTR ;Retrieve Saved Stack Pointer - TXS ;and Restore It - RTS ;Return to BASIC - -;Poll Keyboard for Character -PLKEY EQU GETIN ;Read Character from Keyboard Buffer - -;Get Character from Keyboard -GETKEY: -;Wait for Character from Keyboard -RDKEY: JSR PLKEY ;Poll Keyboard - BEQ GETKEY ;If No Key, Loop - RTS - -;Print Character to Console -PRCHR EQU CHROUT ; - -;Delete Previous Character -DELCHR: LDA #$9D ;Load Cursor Left into Accumulator - JSR PRCHR ; and Print it - LDA #$14 ;Load Delete into Accumulater - JMP PRCHR ; and Print it - -;Advance Character to Next line -NEWLIN: LDA #$0D ;Load C/R into Accumulator - JMP PRCHR ; and Print it - -;Print Byte as Two-Digit Hex Number to Console -PRBYTE: PHA ;Save Accumulater - LSR ;Shift Hi Nybble to Low Nybble - LSR - LSR - LSR - JSR PRHEX ; and Print it - PLA ;Restore Accumulator - ; and fall into prhex - -;Print Low Nybble as Hex Digit to Console -PRHEX: AND #$0F ;Strip High Nybble - CMP #$0A ;If Low Nybble >= 10 - BCC PRHEXC ; - ADC #$06 ; Convert ':' to 'A'... -PRHEXC: ADC #$30 ;Convert to ASCII Character - JMP PRCHR ;Print Hex Digit and Return - -;Functions to set String Pointers -;Used by memory, stdio, stdlin, string, and stringx libraries - -;Initialize Destination String Pointer and Index -SETDST: STX DSTLO ;Save Destination String Pointer - STY DSTHI - RTS - -;Initialize Source String Pointer and Index -SETSRC: STX SRCLO ;Save Source String Pointer - STY SRCHI - LDY #$00 ;Initialize Index Into String - RTS - -;Retrieve Source String Pointer -GETSRC: LDX SRCLO - LDY SRCHI - RTS -** \ No newline at end of file diff --git a/vic20/include/vic20.h02 b/vic20/include/vic20.h02 deleted file mode 100644 index 40036aa..0000000 --- a/vic20/include/vic20.h02 +++ /dev/null @@ -1,37 +0,0 @@ -/* C02 Header File for Unexpanded VIC-20 */ - -//Zero Page Variables -char ptrhi, ptrlo; //Pointer Library -char blkhi, blklo; //Block Pointer -char srchi, srclo; //Source Pointer -char dsthi, dstlo; //Destination Pointer - -//File Library Constants -//define #fomax //Maximum Number of Open Files -//define #fnmax //Maximum Filename Length - -//Static Library Variables -char blklen; //Block Segment Length -char blkshi, blkslo; //Block Start Address -char blkehi, blkelo; //Block End Address - -//Temporary Variables - Used by Libraries -char temp0, temp1, temp2, temp3; - -//Useful Areas in RAM -char tbffr; //Tape Buffer (192 bytes) - -//Kernal Routines Memory Mapped I/O -char chrin(); //Input Character to Channel -void chrout(); //Output Character to Channel -char getin(); //Read Character from Keyboard Buffer - -//System Subroutines -char plkey(); //Poll Console for character -char rdkey(); //Wait for character from Console -char getkey(); //Read ASCII character from Console -void newlin(); //Advance cursor to beginning of next line -void prchr(); //Print ASCII character to Console -void prbyte(); //Print Accumulator as Hexadadecimal number -void prhex(); //Print Low Nybble of Accumulator as Hex Digit - diff --git a/vic20/include/vic20a0.a02 b/vic20/include/vic20a0.a02 deleted file mode 100644 index b0cb651..0000000 --- a/vic20/include/vic20a0.a02 +++ /dev/null @@ -1,128 +0,0 @@ -; c02 Program Initialization Code for Unexpanded VIC-20 - -;ASCII Control Codes Equivalents -CR EQU $0D ;Carriage Return -LF EQU $11 ;Line Feed (Cursor Down) -DEL EQU $14 ;Delete -HT EQU $1D ;Horizontal Tab (Cursor Right) -VT EQU $91 ;Vertical Tab (Cursor Up) -FF EQU $93 ;Form Feed (Clear Screen) -BS EQU $9D ;Backspace (Cursor Left) - -;PETSCII Key Mappings -DELKEY EQU $14 ;Delete/Backspace Key (Delete) -ESCKEY EQU $03 ;Escape/Stop Key (RUN/STOP) -RTNKEY EQU $0D ;Return/Enter Key (RETURN) - -;Standard Library Constants -FOMAX EQU 7 ;Maximum Number of Open Files -FNMAX EQU 16 ;Maximum Filename Length - -;Zero Page Locations -SRCLO EQU $FB ;String Pointer (stdio.asm) -SRCHI EQU $FC ;Free Byte for User Programs -DSTLO EQU $FD ;Free Byte for User Programs -DSTHI EQU $FE ;Free Byte for User Programs - -;Other RAM Locations -TEMP0 EQU $0310 ;Free Byte for User Programs -TEMP1 EQU $0311 ;Free Byte for User Programs -TEMP2 EQU $0312 ;Free Byte for User Programs -TEMP3 EQU $0313 ;Free Byte for User Programs -FTBL EQU $0334 ;File Table (files.a02) -TBFFR EQU $033C ;Cassette I/O Buffer -user12 EQU $03FC ;Free Byte for User Programs -user13 EQU $03FD ;Free Byte for User Programs -user14 EQU $03FE ;Free Byte for User Programs -STKPTR EQU $03FF ;Stack Pointer Storage - -;Video RAM and ROM -VICSCN EQU $1E00 ;Video Screen Memory Area (Unexpanded) -CHRROM EQU $8000 ;Character Generator ROM -VICCLR EQU $9600 ;COLOR RAM (UNEXPANDED) - -;Kernal Routines -SETMSG EQU $FF90 ;Control System Message Output -SETLFS EQU $FFBA ;Set up Logical File -READST EQU $FFB7 ;Read Status Word -SETNAM EQU $FFBD ;Set File Name -OPEN EQU $FFC0 ;Open a Logical File -CLOSE EQU $FFC3 ;Close Logical File -CHKIN EQU $FFC6 ;Open Channel for Input -CHKOUT EQU $FFC9 ;Open Channel for Output -CLRCHN EQU $FFCC ;Clear I/O Channels -CHRIN EQU $FFCF ;Input Character to Channel -CHROUT EQU $FFD2 ;Output Character to Channel -GETIN EQU $FFE4 ;Read Character from Keyboard Buffer -CLALL EQU $FFE7 ;Close All Files - -;Machine Language Basic Stub - ORG $A000 ;Start -START: TSX ;Get Stack Pointer - STX STKPTR ;and Save for Exit - JMP MAIN ;Execute Program - -EXIT: LDX STKPTR ;Retrieve Saved Stack Pointer - TXS ;and Restore It - RTS ;Return to BASIC - -;Poll Keyboard for Character -PLKEY EQU GETIN ;Read Character from Keyboard Buffer - -;Get Character from Keyboard -GETKEY: -;Wait for Character from Keyboard -RDKEY: JSR PLKEY ;Poll Keyboard - BEQ GETKEY ;If No Key, Loop - RTS - -;Print Character to Console -PRCHR EQU CHROUT ; - -;Delete Previous Character -DELCHR: LDA #$9D ;Load Cursor Left into Accumulator - JSR PRCHR ; and Print it - LDA #$14 ;Load Delete into Accumulater - JMP PRCHR ; and Print it - -;Advance Character to Next line -NEWLIN: LDA #$0D ;Load C/R into Accumulator - JMP PRCHR ; and Print it - -;Print Byte as Two-Digit Hex Number to Console -PRBYTE: PHA ;Save Accumulater - LSR ;Shift Hi Nybble to Low Nybble - LSR - LSR - LSR - JSR PRHEX ; and Print it - PLA ;Restore Accumulator - ; and fall into prhex - -;Print Low Nybble as Hex Digit to Console -PRHEX: AND #$0F ;Strip High Nybble - CMP #$0A ;If Low Nybble >= 10 - BCC PRHEXC ; - ADC #$06 ; Convert ':' to 'A'... -PRHEXC: ADC #$30 ;Convert to ASCII Character - JMP PRCHR ;Print Hex Digit and Return - -;Functions to set String Pointers -;Used by memory, stdio, stdlin, string, and stringx libraries - -;Initialize Destination String Pointer and Index -SETDST: STX DSTLO ;Save Destination String Pointer - STY DSTHI - RTS - -;Initialize Source String Pointer and Index -SETSRC: STX SRCLO ;Save Source String Pointer - STY SRCHI - LDY #$00 ;Initialize Index Into String - RTS - -;Retrieve Source String Pointer -GETSRC: LDX SRCLO - LDY SRCHI - RTS -** \ No newline at end of file diff --git a/vic20/include/vic20a0.h02 b/vic20/include/vic20a0.h02 deleted file mode 100644 index 24a26ab..0000000 --- a/vic20/include/vic20a0.h02 +++ /dev/null @@ -1,24 +0,0 @@ -/* VIC0-20 $A000 Header File * - * Compiles into Block 5 RAM at $A000 * - * Load using LOAD "progfile",8,1 * - * Execute using SYS 40960 */ - -//Zero Page Variables -char srchi, srclo; //Source Pointer -char dsthi, dstlo; //Destination Pointer - - -//Kernal Routines Memory Mapped I/O -char chrin(); //Input Character to Channel -void chrout(); //Output Character to Channel -char getin(); //Read Character from Keyboard Buffer - -//System Subroutines -char plkey(); //Poll Console for character -char rdkey(); //Wait for character from Console -char getkey(); //Read ASCII character from Console -void newlin(); //Advance cursor to beginning of next line -void prchr(); //Print ASCII character to Console -void prbyte(); //Print Accumulator as Hexadadecimal number -void prhex(); //Print Low Nybble of Accumulator as Hex Digit - diff --git a/vic20/include/vic20a0cart.a02 b/vic20/include/vic20a0cart.a02 deleted file mode 100644 index 07a0d34..0000000 --- a/vic20/include/vic20a0cart.a02 +++ /dev/null @@ -1,133 +0,0 @@ -; c02 Program Initialization Code for Unexpanded VIC-20 - -;ASCII Control Codes Equivalents -CR EQU $0D ;Carriage Return -LF EQU $11 ;Line Feed (Cursor Down) -DEL EQU $14 ;Delete -HT EQU $1D ;Horizontal Tab (Cursor Right) -VT EQU $91 ;Vertical Tab (Cursor Up) -FF EQU $93 ;Form Feed (Clear Screen) -BS EQU $9D ;Backspace (Cursor Left) - -;PETSCII Key Mappings -DELKEY EQU $14 ;Delete/Backspace Key (Delete) -ESCKEY EQU $03 ;Escape/Stop Key (RUN/STOP) -RTNKEY EQU $0D ;Return/Enter Key (RETURN) - -;Standard Library Constants -FOMAX EQU 7 ;Maximum Number of Open Files -FNMAX EQU 16 ;Maximum Filename Length - -;Zero Page Locations -SRCLO EQU $FB ;String Pointer (stdio.asm) -SRCHI EQU $FC ;Free Byte for User Programs -DSTLO EQU $FD ;Free Byte for User Programs -DSTHI EQU $FE ;Free Byte for User Programs - -;Other RAM Locations -TEMP0 EQU $0310 ;Free Byte for User Programs -TEMP1 EQU $0311 ;Free Byte for User Programs -TEMP2 EQU $0312 ;Free Byte for User Programs -TEMP3 EQU $0313 ;Free Byte for User Programs -FTBL EQU $0334 ;File Table (files.a02) -TBFFR EQU $033C ;Cassette I/O Buffer -user12 EQU $03FC ;Free Byte for User Programs -user13 EQU $03FD ;Free Byte for User Programs -user14 EQU $03FE ;Free Byte for User Programs -STKPTR EQU $03FF ;Stack Pointer Storage - -;Video RAM and ROM -VICSCN EQU $1E00 ;Video Screen Memory Area (Unexpanded) -CHRROM EQU $8000 ;Character Generator ROM -VICCLR EQU $9600 ;COLOR RAM (UNEXPANDED) - -;Kernal Routines -SETMSG EQU $FF90 ;Control System Message Output -SETLFS EQU $FFBA ;Set up Logical File -READST EQU $FFB7 ;Read Status Word -SETNAM EQU $FFBD ;Set File Name -OPEN EQU $FFC0 ;Open a Logical File -CLOSE EQU $FFC3 ;Close Logical File -CHKIN EQU $FFC6 ;Open Channel for Input -CHKOUT EQU $FFC9 ;Open Channel for Output -CLRCHN EQU $FFCC ;Clear I/O Channels -CHRIN EQU $FFCF ;Input Character to Channel -CHROUT EQU $FFD2 ;Output Character to Channel -GETIN EQU $FFE4 ;Read Character from Keyboard Buffer -CLALL EQU $FFE7 ;Close All Files - -;Machine Language Basic Stub - ORG $A000 ;Start - DC.W START ;Cartridge Start Address - DC.W RESTR ;Restore Key Routine - DC $41,$30,$C3,$C2,$CD ;Cartridge Start Sequence -START: JMP MAIN ;Execute Program - -;Exit - Return to BASIC -;Execute a Warm Start, bypassing the Cartridge Check Code -EXIT: LDX #$FF ; Set X for stack - SEI ; Disable interrupts - TXS ; Clear stack - CLD ; Clear decimal mode - JMP $FD2F ; Jump into Initialization Code - - ;Poll Keyboard for Character -PLKEY EQU GETIN ;Read Character from Keyboard Buffer - -;Get Character from Keyboard -GETKEY: -;Wait for Character from Keyboard -RDKEY: JSR PLKEY ;Poll Keyboard - BEQ GETKEY ;If No Key, Loop - RTS - -;Print Character to Console -PRCHR EQU CHROUT ; - -;Delete Previous Character -DELCHR: LDA #$9D ;Load Cursor Left into Accumulator - JSR PRCHR ; and Print it - LDA #$14 ;Load Delete into Accumulater - JMP PRCHR ; and Print it - -;Advance Character to Next line -NEWLIN: LDA #$0D ;Load C/R into Accumulator - JMP PRCHR ; and Print it - -;Print Byte as Two-Digit Hex Number to Console -PRBYTE: PHA ;Save Accumulater - LSR ;Shift Hi Nybble to Low Nybble - LSR - LSR - LSR - JSR PRHEX ; and Print it - PLA ;Restore Accumulator - ; and fall into prhex - -;Print Low Nybble as Hex Digit to Console -PRHEX: AND #$0F ;Strip High Nybble - CMP #$0A ;If Low Nybble >= 10 - BCC PRHEXC ; - ADC #$06 ; Convert ':' to 'A'... -PRHEXC: ADC #$30 ;Convert to ASCII Character - JMP PRCHR ;Print Hex Digit and Return - -;Functions to set String Pointers -;Used by memory, stdio, stdlin, string, and stringx libraries - -;Initialize Destination String Pointer and Index -SETDST: STX DSTLO ;Save Destination String Pointer - STY DSTHI - RTS - -;Initialize Source String Pointer and Index -SETSRC: STX SRCLO ;Save Source String Pointer - STY SRCHI - LDY #$00 ;Initialize Index Into String - RTS - -;Retrieve Source String Pointer -GETSRC: LDX SRCLO - LDY SRCHI - RTS -** \ No newline at end of file diff --git a/vic20/include/vic6560.a02 b/vic20/include/vic6560.a02 deleted file mode 100644 index 03a53a7..0000000 --- a/vic20/include/vic6560.a02 +++ /dev/null @@ -1,57 +0,0 @@ -; VIC-20 Assembly Language Routines for VIC 6560 Chip - -;VIC Chip Registers -VICSCH EQU $9000 ;Interlace Mode + Horizontal Screen Origin -VICSCV EQU $9001 ;Vertical Screen Origin -VICCOL EQU $9002 ;Screen Memory Location + Number of Video Columns -VICROW EQU $9003 ;Raster Value + Number of Video Rows + Character Size -VICRST EQU $9004 ;Raster Value -VICLOC EQU $9005 ;Screen Memory Location + Character Memory Location -VICLPH EQU $9006 ;Light Pen - Horizontal -VICLPV EQU $9007 ;Light Pen - Vertical -VICPD1 EQU $9008 ;Paddle 1 -VICPD2 EQU $9009 ;Paddle 2 -VICBSF EQU $900A ;Bass Sound Switch and Frequency -VICASF EQU $900B ;Alto Sound Switch and Frequency -VICSSF EQU $900C ;Soprano Sound Switch and Frequency -VICNSF EQU $900D ;Noise Switch and Frequency -VICAVL EQU $900E ;Auxillary Color + Sound Volume -VICCLR EQU $900F ;Screen Color + Reverse Mode + Border Color - -;Set Screen Origin and Interlace Mode -;Args: A = Horizontal Screen Origin -; Y = Vertical Screen Origin -; X = Interlace Mode, 0=Off, !0=On -SETORG: AND #$7F ;Clear Accumulator High Bit - CPX #0 ;Test Interlace Mode - BEQ SETORH ;If Not Zero - ORA #$80 ; Set Accumulator High Bit - STA VICSCH ;Write to Horizontal Origin Register - STY VICSCV ;Write Y to Vertical Origin Register - RTS - -;Set Memory Locations and Number of Columns -;Args: A = Screen Memory Address Offset - Y = Character Address Memory Offset - X = Number of Video Columns -SETSCN: LSR ;Roll Screen Offset Low Bit into Carry Flag - PHA ;And Save Top Four Bits on Stack - TXA ;Copy Columns into Accumulator - AND #$7F ;Clear High Bit - BCC SETSCC ;If Carry Set from Roll - ORA #$80 ; Set High Bit - STA VICCOL ;Write to Video Columns Register - PLA ;Retrieve Screen Memory Offset - ASL ;Shift to High Bit - ASL - ASL - ASL - PHA ;And Push onto Stack - TYA ;Put Character Address Offset in Accumulator - AND #$0F ;Clear High Nybble - TSX ;Get Index to Screen Address Offset - ORA $101,X ;Load Into Accumulator High Nybble - STA VICLOC ;Write to Memory Locations Register - PLA ;Clean up Stack - RTS -