Permalink
Browse files

Added support for the ATARI 8-bit with Dragon Cart.

The actual ATARI-specific code is "inspired" by the IP65 variant published in http://atariage.com/forums/topic/211161-dragoncart-software/?p=2734494. The timer routines are modeled after the ones for the VIC20.
  • Loading branch information...
oliverschmidt committed Aug 28, 2015
1 parent fad1b73 commit 6987df44ed26592df0d5fc6679141d5c41dbd6fb
Showing with 538 additions and 17 deletions.
  1. +5 −4 .gitignore
  2. +12 −0 drivers/Makefile
  3. +31 −0 drivers/atrcharconv.s
  4. +91 −0 drivers/atrinput.s
  5. +43 −0 drivers/atrkernal.s
  6. +97 −0 drivers/atrprint.s
  7. +132 −0 drivers/atrtimer.s
  8. +37 −0 drivers/dragoncart.s
  9. +30 −3 test/Makefile
  10. +3 −0 test/cifs.s
  11. +3 −0 test/dns.s
  12. +3 −0 test/dottedquad.s
  13. +8 −1 test/geturl.s
  14. +3 −0 test/httpd.s
  15. +7 −1 test/parsequerystring.s
  16. +9 −1 test/parser.s
  17. +6 −2 test/ping.s
  18. +5 −0 test/sntp.s
  19. +9 −4 test/tcp.s
  20. +4 −1 test/tftp.s
View
@@ -1,9 +1,10 @@
-*.bin
-*.d64
-*.dsk
+*.o
*.lib
*.map
-*.o
*.prg
*.bin
+*.com
*.vicprg
+*.d64
+*.dsk
+*.atr
View
@@ -6,6 +6,7 @@
# a2lancegs.lib : Apple ][ with LANceGS (default slot: #3)
# a2uther2.lib : Apple ][ with Uthernet II (default slot: #3)
# a2combo.lib : Apple ][ with Uthernet or LANceGS or Uthernet II (default slot: #3)
+# atrdragon.lib : ATARI 8-bit with Dragon Cart (default base addr: $d500)
# vic20rrnet.lib : VIC20 with RR-Net or clone (default base addr: $980x)
DRIVERS=\
@@ -17,6 +18,7 @@ DRIVERS=\
a2lancegs.lib \
a2uther2.lib \
a2combo.lib \
+ atrdragon.lib \
vic20rrnet.lib
all: $(DRIVERS)
@@ -40,6 +42,13 @@ A2OBJS=\
a2filteredinput.o \
a2charconv.o
+ATROBJS=\
+ atrprint.o \
+ atrtimer.o \
+ atrkernal.o \
+ atrinput.o \
+ atrcharconv.o
+
VIC20OBJS=\
vic20print.o \
vic20timer.o \
@@ -72,6 +81,9 @@ a2uther2.lib: uthernet2.o w5100.o w5100driver.o ethernet.o a2slot.o $(A2OBJS)
a2combo.lib: uthernet.o cs8900a.o lancegs.o lan91c96.o uthernet2.o w5100.o ethernetcombo.o a2slotcombo.o $(A2OBJS)
ar65 a $@ $^
+atrdragon.lib: dragoncart.o cs8900a.o cs8900adriver.o ethernet.o $(ATROBJS)
+ ar65 a $@ $^
+
vic20rrnet.lib: vic20-rr-net.o cs8900a.o cs8900adriver.o ethernet.o $(VIC20OBJS)
ar65 a $@ $^
View
@@ -0,0 +1,31 @@
+.export ascii_to_native
+.export native_to_ascii
+
+; given an Atari Screen Code char in A, return equivalent ASCII
+native_to_ascii:
+ rts
+
+; given an ASCII char in A, return equivalent Atari Screen Code
+ascii_to_native:
+ rts
+
+
+
+; -- LICENSE FOR atrcharconv.s --
+; The contents of this file are subject to the Mozilla Public License
+; Version 1.1 (the "License"); you may not use this file except in
+; compliance with the License. You may obtain a copy of the License at
+; http://www.mozilla.org/MPL/
+;
+; Software distributed under the License is distributed on an "AS IS"
+; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+; License for the specific language governing rights and limitations
+; under the License.
+;
+; The Original Code is ip65.
+;
+; The Initial Developer of the Original Code is Jonno Downes,
+; jonno@jamtronix.com.
+; Portions created by the Initial Developer are Copyright (C) 2009
+; Jonno Downes. All Rights Reserved.
+; -- LICENSE END --
View
@@ -0,0 +1,91 @@
+.export get_key
+.export check_for_abort_key
+.export get_key_if_available
+.export get_key_ip65
+
+.import ip65_process
+
+
+.data
+
+iocb: .byte 0
+kname: .byte "K:",155
+
+
+.code
+
+; inputs: none
+; outputs: A contains ASCII value of key just pressed
+get_key:
+ jsr get_key_if_available
+ beq get_key
+ rts
+
+; inputs: none
+; outputs: A contains ASCII value of key just pressed (0 if no key pressed)
+get_key_if_available:
+ lda $02fc ; GLOBAL VARIABLE FOR KEYBOARD
+ cmp #255
+ beq @nokey
+ ldx iocb ; K: already open?
+ bne @read
+ ldx #$40 ; IOCB to use for keyboard input
+ stx iocb ; mark K: as open
+ lda #<kname
+ sta $344,x ; 1-byte low buffer address
+ lda #>kname
+ sta $345,x ; 1-byte high buffer address
+ lda #3 ; open
+ sta $342,x ; COMMAND CODE
+ lda #4 ; open for input (all devices)
+ sta $34a,x ; 1-byte first auxiliary information
+ jsr $e456 ; vector to CIO
+@read:
+ lda #0
+ sta $348,x ; 1-byte low buffer length
+ sta $349,x ; 1-byte high buffer length
+ lda #7 ; get character(s)
+ sta $342,x ; COMMAND CODE
+ jsr $e456 ; vector to CIO
+ ldx #255
+ stx $02fc ; GLOBAL VARIABLE FOR KEYBOARD
+ rts
+@nokey:
+ lda #0
+ rts
+
+; process inbound ip packets while waiting for a keypress
+get_key_ip65:
+ jsr ip65_process
+ jsr get_key_if_available
+ beq get_key_ip65
+ rts
+
+;check whether the ??? key is being pressed
+;inputs: none
+;outputs: sec if ??? pressed, clear otherwise
+check_for_abort_key:
+ ; TODO: implement actual check
+ clc
+ rts
+
+
+
+;-- LICENSE FOR atrinputs.s --
+; The contents of this file are subject to the Mozilla Public License
+; Version 1.1 (the "License"); you may not use this file except in
+; compliance with the License. You may obtain a copy of the License at
+; http://www.mozilla.org/MPL/
+;
+; Software distributed under the License is distributed on an "AS IS"
+; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+; License for the specific language governing rights and limitations
+; under the License.
+;
+; The Original Code is ip65.
+;
+; The Initial Developer of the Original Code is Jonno Downes,
+; jonno@jamtronix.com.
+; Portions created by the Initial Developer are Copyright (C) 2009
+; Jonno Downes. All Rights Reserved.
+; -- LICENSE END --
View
@@ -0,0 +1,43 @@
+.include "../inc/common.i"
+
+.export exit_to_basic
+
+.import timer_exit
+.import print
+.import get_key
+
+
+.data
+
+press_any_key:
+ .byte "Press any key to return to DOS ",0
+
+
+.code
+
+exit_to_basic:
+ jsr timer_exit
+ ldax #press_any_key
+ jsr print
+ jmp get_key
+
+
+
+; -- LICENSE FOR atrkernal.s --
+; The contents of this file are subject to the Mozilla Public License
+; Version 1.1 (the "License"); you may not use this file except in
+; compliance with the License. You may obtain a copy of the License at
+; http://www.mozilla.org/MPL/
+;
+; Software distributed under the License is distributed on an "AS IS"
+; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+; License for the specific language governing rights and limitations
+; under the License.
+;
+; The Original Code is ip65.
+;
+; The Initial Developer of the Original Code is Jonno Downes,
+; jonno@jamtronix.com.
+; Portions created by the Initial Developer are Copyright (C) 2009
+; Jonno Downes. All Rights Reserved.
+; -- LICENSE END --
View
@@ -0,0 +1,97 @@
+.include "../inc/common.i"
+
+.export print_a
+.export print_a_inverse
+.export print_cr
+.export cls
+.export beep
+.exportzp screen_current_row
+.exportzp screen_current_col
+
+screen_current_col = $55 ; 2-byte cursor column
+screen_current_row = $54 ; 1-byte cursor row
+
+
+.bss
+
+char: .res 1
+
+
+.code
+
+; use ATARI CIOV function to display 1 char
+; inputs: A should be set to ASCII char to display
+; outputs: none
+print_a:
+ cmp #10 ; is it a CR?
+ bne @not_lf
+ lda #155 ; CR/LF char
+@not_lf:
+ cmp #13 ; is it a LF?
+ bne @not_cr
+ lda #155 ; CR/LF char
+@not_cr:
+ sta char
+ txa
+ pha
+ tya
+ pha
+ ldax #1
+ stax $0348 ; 2-byte buffer length
+ ldax #char
+ stax $0344 ; 2-byte buffer address
+ ldx #11 ; put character(s)
+ stx $0342 ; COMMAND CODE
+ ldx #0
+ jsr $e456 ; vector to CIO
+ pla
+ tay
+ pla
+ tax
+ rts
+
+; use ATARI CIOV function to move to new line
+; inputs: none
+; outputs: none
+print_cr:
+ lda #155 ; CR/LF char
+ jmp print_a
+
+; use ATARI CIOV function to clear the screen
+; inputs: none
+; outputs: none
+cls:
+ lda #125 ; clear screen
+ jmp print_a
+
+; use ATARI CIOV function to make a 'beep' noise
+; inputs: none
+; outputs: none
+beep:
+ lda #253 ; beep char
+ jmp print_a
+
+print_a_inverse:
+ ora #$80 ; turn on top bit
+ jmp print_a
+
+
+
+;-- LICENSE FOR atrprint.s --
+; The contents of this file are subject to the Mozilla Public License
+; Version 1.1 (the "License"); you may not use this file except in
+; compliance with the License. You may obtain a copy of the License at
+; http://www.mozilla.org/MPL/
+;
+; Software distributed under the License is distributed on an "AS IS"
+; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+; License for the specific language governing rights and limitations
+; under the License.
+;
+; The Original Code is ip65.
+;
+; The Initial Developer of the Original Code is Jonno Downes,
+; jonno@jamtronix.com.
+; Portions created by the Initial Developer are Copyright (C) 2009
+; Jonno Downes. All Rights Reserved.
+; -- LICENSE END --
Oops, something went wrong.

0 comments on commit 6987df4

Please sign in to comment.