mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-21 10:32:08 +00:00
Updated Apple 2 headers and added Apple 2 test files
This commit is contained in:
parent
e92f6823cc
commit
45cead9330
4
apple2/a2disk.bat
Normal file
4
apple2/a2disk.bat
Normal file
@ -0,0 +1,4 @@
|
||||
REM Create Bootable Disk with Binary File
|
||||
copy /Y boot.dsk %1.dsk
|
||||
echo BRUN %1 |a2tools in t %1.dsk command
|
||||
a2tools in b.0C00 %1.dsk %1 %1.bin
|
12
apple2/a2test.c02
Normal file
12
apple2/a2test.c02
Normal file
@ -0,0 +1,12 @@
|
||||
/* C02 Apple II Test Program */
|
||||
|
||||
#include <apple2.h02>
|
||||
|
||||
char i;
|
||||
|
||||
main:
|
||||
for (i=32; i:+; i++) {
|
||||
if (!i&31) newlin();
|
||||
prchr(i);
|
||||
}
|
||||
goto exit;
|
BIN
apple2/a2test.dsk
Normal file
BIN
apple2/a2test.dsk
Normal file
Binary file not shown.
1
apple2/a2win.bat
Normal file
1
apple2/a2win.bat
Normal file
@ -0,0 +1 @@
|
||||
c:\programs\applewin\applewin -d1 %1.dsk
|
BIN
apple2/boot.dsk
Normal file
BIN
apple2/boot.dsk
Normal file
Binary file not shown.
5
apple2/c02.bat
Normal file
5
apple2/c02.bat
Normal file
@ -0,0 +1,5 @@
|
||||
@ECHO Compiling File %1.c02
|
||||
..\c02.exe %1
|
||||
|
||||
@ECHO Assembling File %1.asm
|
||||
C:\Programs\dasm %1.asm -f3 -o%1.bin -l%1.lst -s%1.sym
|
34
apple2/include/a2min.a02
Normal file
34
apple2/include/a2min.a02
Normal file
@ -0,0 +1,34 @@
|
||||
;Apple 1 program initialization code for c02 programs
|
||||
|
||||
;Locations used by Operating System
|
||||
PROMPT EQU $33 ;ASCII character for INPUT prompt symbol
|
||||
LOMEM EQU $4A ;
|
||||
HIMEM EQU $4C
|
||||
BASIC $67 ;Start of BASIC program
|
||||
VARBLS $69 ;End of BASIC program and start of variable space
|
||||
ARRAYS $6B ;Start of defined array space
|
||||
ARRAYE $6D ;End of defined array space
|
||||
STRNGS $6F ;Start of string storag
|
||||
|
||||
TIMEDM EQU $BF90 ;Day/month
|
||||
TIMEYR EQU $BF91 ;Year
|
||||
TIMEMN EQU $BF92 ;Minute
|
||||
TIMEHR EQU $BF93 ;Hour
|
||||
|
||||
;ROM Routines
|
||||
EXIT EQU $3D0 ;Return to BASIC
|
||||
RDKEY EQU $FD0C ;Waits for keypress and return in A
|
||||
KEYIN EQU $FD1B ;Waits for keypress and cycle random-number generator
|
||||
RDCHAR EQU $FD35 ;Read keyboard (processing escapes)
|
||||
GETLIN EQU $FD6A ;Get Line from Keyboard into Input Buffer
|
||||
CROUT EQU $FD8E ;Performs a carriage return
|
||||
PRBYTE EQU $FDDA ;Print Accumulator as Hexadecimal Number
|
||||
PRHEX EQU $FDE3 ;Print Low Nybble of Accumulator as Hex Digit
|
||||
COUT EQU $FDED ;Print Character in Accumulator
|
||||
BELL EQU $FF3A ;Ring Bell through COUT
|
||||
|
||||
ORG $0C00 ;Safe Area for Machine Language
|
||||
|
||||
START: JMP MAIN ;Execute Program
|
||||
|
||||
|
15
apple2/include/a2min.h02
Normal file
15
apple2/include/a2min.h02
Normal file
@ -0,0 +1,15 @@
|
||||
/* C02 Minimal Header File for Apple II */
|
||||
|
||||
/* Monitor Variables */
|
||||
|
||||
//PIA 6820 Registers
|
||||
char kbd; //Keyboard Data
|
||||
char kbdcr; //Keyboard Control Register
|
||||
|
||||
//Monitor Subroutines
|
||||
void echo(); //Print Character in Accumulator
|
||||
void prbyte(); //Print Accumulator as Hexadadecimal number
|
||||
void prhex(); //Print Low Nybble of Accumulator as Hex Digit
|
||||
|
||||
//System Subroutines
|
||||
char rdkey(); //Wait for raw character from Keyboard
|
46
apple2/include/apple2.asm
Normal file
46
apple2/include/apple2.asm
Normal file
@ -0,0 +1,46 @@
|
||||
;Apple 1 program initialization code for c02 programs
|
||||
|
||||
;Locations used by Operating System
|
||||
PROMPT EQU $33 ;ASCII character for INPUT prompt symbol
|
||||
LOMEM EQU $4A ;
|
||||
HIMEM EQU $4C
|
||||
BASIC EQU $67 ;Start of BASIC program
|
||||
VARBLS EQU $69 ;End of BASIC program and start of variable space
|
||||
ARRAYS EQU $6B ;Start of defined array space
|
||||
ARRAYE EQU $6D ;End of defined array space
|
||||
STRNGS EQU $6F ;Start of string storag
|
||||
|
||||
;Locations used by Hi-Res Graphics
|
||||
HPLOTX $E0 ;X of last HPLOT
|
||||
HPLOTY $E2 ;Y of last HPLOT
|
||||
HCOLOR $E4 ;
|
||||
HIRES $E6 ;
|
||||
SCALE $E7 ;
|
||||
SHAPES $E8 ;Shape table start address
|
||||
XDRAWS $EA
|
||||
CSPEED $F1
|
||||
ROTATE $F9
|
||||
|
||||
TIMEDM EQU $BF90 ;Day/month
|
||||
TIMEYR EQU $BF91 ;Year
|
||||
TIMEMN EQU $BF92 ;Minute
|
||||
TIMEHR EQU $BF93 ;Hour
|
||||
|
||||
|
||||
|
||||
EXIT EQU $FF00 ;Monitor Entry Point
|
||||
ECHO EQU $FFEF ;Subroutine - Print Character in Accumulator
|
||||
PRBYTE EQU $FFDC ;Subroutine - Print Accumulator as Hexadadecimal number
|
||||
PRHEX EQU $FFE5 ;Subroutine - Print Low Nybble of Accumulator as Hex Digit
|
||||
|
||||
ORG $0300 ;Start one page above Monitor input buffer
|
||||
|
||||
START: LDX #$FF ;Reset stack - the monitor doesn't do this
|
||||
TXS ; (probably because of lack of space)
|
||||
JMP MAIN ;Execute Program
|
||||
|
||||
RDKEY: BIT KBDCR ;Check the Keyboard Control Register
|
||||
BPL RDKEY ; and loop if key not pressed
|
||||
LDA KBD ; Read key into Accumulator
|
||||
RTS
|
||||
|
@ -5,7 +5,7 @@ DELKEY EQU $08 ;Delete/Backspace Key (Left Arrow)
|
||||
ESCKEY EQU $1B ;Escape/Stop Key (Escape)
|
||||
RTNKEY EQU $0D ;Return/Enter Key (Return)
|
||||
|
||||
;Standard Library Variables
|
||||
;Zero Page Variables (*=System Variable)
|
||||
DSTLO EQU $06 ;Destination String Pointer (string.a02)
|
||||
DSTHI EQU $07
|
||||
BLKLO EQU $08 ;Block Segment Pointer (block.a02)
|
||||
@ -13,7 +13,8 @@ BLKHI EQU $09
|
||||
PTRLO EQU $1D ;System Pointer (pointer.a02)
|
||||
PTRHI EQU $1E
|
||||
RANDOM EQU $1F ;Random Number
|
||||
RDSEED EQU $4E ;O/S Random Number Low Byte
|
||||
INVFLG EQU $32 ;*Inverse Flag: $3F=Blinking, $7F=Inverse, $FF=Normal
|
||||
RDSEED EQU $4E ;O/S Random Number Low Byte
|
||||
; EQU $4F ;O/S Random Number High Byte
|
||||
SRCLO EQU $71 ;Source String Pointer (stdio.a02)
|
||||
SRCHI EQU $72
|
||||
@ -28,11 +29,18 @@ TEMP1 EQU $FD
|
||||
TEMP2 EQU $FE
|
||||
TEMP3 EQU $FF
|
||||
|
||||
;Page 3 Vectors
|
||||
WARMST EQU $3D0 ;Jump vector to DOS warm start
|
||||
COLDST EQU $3D3 ;Jump vector to DOS cold start
|
||||
|
||||
;I/O Locations
|
||||
KBD EQU $C000 ;Keyboard Data
|
||||
AKD EQU $C010 ;Keyboard Strobe Register
|
||||
|
||||
;Monitor Routines
|
||||
PRBLNK EQU $F94C ;Print 3 blanks
|
||||
PRBLNX EQU $F94C ;Print X blanks
|
||||
PRBLAX EQU $F94C ;Print character in A followed by X-1 blanks
|
||||
RDKEY EQU $FD0C ;Waits for keypress and return in A
|
||||
KEYIN EQU $FD1B ;Waits for keypress and cycle random-number generator
|
||||
RDCHAR EQU $FD35 ;Read keyboard (processing escapes)
|
||||
@ -40,18 +48,18 @@ GETLIN EQU $FD6A ;Get Line from Keyboard into Input Buffer
|
||||
CROUT EQU $FD8E ;Performs a carriage return
|
||||
PRBYTE EQU $FDDA ;Print Accumulator as Hexadecimal Number
|
||||
PRHEX EQU $FDE3 ;Print Low Nybble of Accumulator as Hex Digit
|
||||
COUT EQU $FDED ;Print Character in Accumulator
|
||||
COUT EQU $FDED ;Print Character to Current Output Device
|
||||
COUT1 EQU $FDF0 ;Print Character to Screen
|
||||
BELL EQU $FF3A ;Ring Bell through COUT
|
||||
MONZ EQU $FF69 ;Enter monitor (<Control-C>, <Return> leaves the monitor)
|
||||
|
||||
ECHO EQU COUT ;Print Character
|
||||
EXIT EQU MONZ ;Return to Monitor
|
||||
ECHO EQU COUT1 ;Print Character
|
||||
EXIT EQU WARMST ;Return to Monitor
|
||||
|
||||
ORG $0C00 ;Safe Area for Machine Language
|
||||
|
||||
START: JMP MAIN ;Execute Program
|
||||
|
||||
|
||||
;Subroutine Poll Keyboard
|
||||
PLKEY: LDA #0 ;Clear Accumulator
|
||||
BIT KBD ;Check Keyboard Strobe Bit
|
||||
@ -63,12 +71,17 @@ PLKEYR: RTS
|
||||
;Read Keyboard
|
||||
GETKEY EQU KEYIN ;Alias to Monitor Routine
|
||||
|
||||
PRCHR EQU ECHO ;Alias to Monitor Routine
|
||||
;Print Character to Screen
|
||||
PRCHR: ORA #$80 ;Set High Bit
|
||||
CMP #$E0 ;
|
||||
BCC PRCHRX ;If Lower Case
|
||||
AND #$DF ; Convert to Upper Case
|
||||
PRCHRX: JMP ECHO ;Alias to Monitor Routine
|
||||
|
||||
;Delete Previous Character
|
||||
DELCHR: LDX #2 ;Two Characters Total
|
||||
LDA #$88 ;Load Backspace Character
|
||||
JSR PRBLNX ;Print Accumulator and X-1 Blanks
|
||||
JSR PRBLAX ;Print Accumulator and X-1 Blanks
|
||||
LDA #$88 ;Load Backspace Character
|
||||
JMP PRCHR ;and Print it
|
||||
|
||||
|
@ -14,7 +14,10 @@ char blklen; //Block Segment Length
|
||||
|
||||
char temp0, temp1, temp2, temp3; //Temporary Variables
|
||||
|
||||
//PIA 6820 Registers
|
||||
//System Variables
|
||||
char invflg; //Video Invert Mask
|
||||
|
||||
//Keyboard I/O
|
||||
char kbd; //Keyboard Data
|
||||
char abd; //Keyboard Strobe
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user