]> git.sur5r.net Git - cc65/commitdiff
Tape load and save functions for the Oric Atmos. By Stefan Haubenthal.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 28 May 2012 11:11:39 +0000 (11:11 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 28 May 2012 11:11:39 +0000 (11:11 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5660 b7a2c559-68d2-44c3-8de9-860c34a00d81

doc/atmos.sgml
doc/funcref.sgml
include/atmos.h
libsrc/atmos/Makefile
libsrc/atmos/atmos_load.s [new file with mode: 0644]
libsrc/atmos/atmos_save.s [new file with mode: 0644]
libsrc/atmos/store_filename.s [new file with mode: 0644]

index 6b9755d4de556ceed682a65d091c8c1d1bd08363..2de4b8d6fba6f084d6d4a3888f2ecfd12d4b11cd 100644 (file)
@@ -62,6 +62,17 @@ Special locations:
 Programs containing Atmos specific code may use the <tt/atmos.h/ header file.
 
 
+<sect1>Atmos specific functions<p>
+
+The functions listed below are special for the Atmos. See the <htmlurl
+url="funcref.html" name="function reference"> for declaration and usage.
+
+<itemize>
+<item>atmos_load
+<item>atmos_save
+</itemize>
+
+
 <sect1>Hardware access<p>
 
 The following pseudo variables declared in the <tt/atmos.h/ header file do allow
@@ -197,7 +208,7 @@ supported by BASIC, the following syntax was chosen:
 
 <sect1>Interrupts<p>
 
-The runtime for the Atmos uses routines marked as <tt/.CONDES/ type 2 for
+The runtime for the Atmos uses routines marked as <tt/.INTERRUPTOR/ for
 interrupt handlers. Such routines must be written as simple machine language
 subroutines and will be called automatically by the interrupt handler code
 when they are linked into a program. See the discussion of the <tt/.CONDES/
index fe832c563a8ee0b86f527f82af09115d822a40d9..db86e270615cc682e6e9a6c9c790d6a4e902b6dc 100644 (file)
@@ -112,7 +112,10 @@ function.
 
 <sect1><tt/atmos.h/<label id="atmos.h"><p>
 
-(incomplete)
+<itemize>
+<item><ref id="atmos_load" name="atmos_load">
+<item><ref id="atmos_save" name="atmos_save">
+</itemize>
 
 
 <sect1><tt/c128.h/<label id="c128.h"><p>
@@ -138,6 +141,37 @@ function.
 </itemize>
 
 
+<sect1><tt/cbm.h/<label id="cbm.h"><p>
+
+<itemize>
+<!-- <item><ref id="cbm_clall" name="cbm_clall"> -->
+<!-- <item><ref id="cbm_close" name="cbm_close"> -->
+<!-- <item><ref id="cbm_closedir" name="cbm_closedir"> -->
+<!-- <item><ref id="cbm_k_basin" name="cbm_k_basin"> -->
+<!-- <item><ref id="cbm_k_bsout" name="cbm_k_bsout"> -->
+<!-- <item><ref id="cbm_k_chkin" name="cbm_k_chkin"> -->
+<!-- <item><ref id="cbm_k_ckout" name="cbm_k_ckout"> -->
+<!-- <item><ref id="cbm_k_close" name="cbm_k_close"> -->
+<!-- <item><ref id="cbm_k_clrch" name="cbm_k_clrch"> -->
+<!-- <item><ref id="cbm_k_getin" name="cbm_k_getin"> -->
+<!-- <item><ref id="cbm_k_load" name="cbm_k_load"> -->
+<!-- <item><ref id="cbm_k_open" name="cbm_k_open"> -->
+<!-- <item><ref id="cbm_k_readst" name="cbm_k_readst"> -->
+<!-- <item><ref id="cbm_k_save" name="cbm_k_save"> -->
+<!-- <item><ref id="cbm_k_setlfs" name="cbm_k_setlfs"> -->
+<!-- <item><ref id="cbm_k_setnam" name="cbm_k_setnam"> -->
+<!-- <item><ref id="cbm_load" name="cbm_load"> -->
+<!-- <item><ref id="cbm_open" name="cbm_open"> -->
+<!-- <item><ref id="cbm_opendir" name="cbm_opendir"> -->
+<!-- <item><ref id="cbm_read" name="cbm_read"> -->
+<!-- <item><ref id="cbm_readdir" name="cbm_readdir"> -->
+<!-- <item><ref id="cbm_save" name="cbm_save"> -->
+<!-- <item><ref id="cbm_write" name="cbm_write"> -->
+</itemize>
+
+(incomplete)
+
+
 <sect1><tt/cbm510.h/<label id="cbm510.h"><p>
 
 <itemize>
@@ -1156,6 +1190,40 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>atmos_load<label id="atmos_load"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load Atmos tape.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_load(const char* name);/
+<tag/Description/<tt/atmos_load/ reads a memory block from tape.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_save" name="atmos_save">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>atmos_save<label id="atmos_save"><p>
+
+<quote>
+<descrip>
+<tag/Function/Save Atmos tape.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_save(const char* name, const void* start, const void* end);/
+<tag/Description/<tt/atmos_save/ writes a memory block to tape.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_load" name="atmos_load">
+<tag/Example/<verb>
+atmos_save("hires", 0xa000, 0xc000);
+</verb>
+</descrip>
+</quote>
+
+
 <sect1>atoi<label id="atoi"><p>
 
 <quote>
index a73b13a06e413dcef4d79273e1a3788d5721d97f..8155ee8b27643e9f808007e2ae46954b558b2bf5 100644 (file)
 #define CH_LIRA                 95
 #define CH_ESC          27
 
+void __fastcall__ atmos_load(const char* name);
+/* Load Atmos tape. */
+
+void __fastcall__ atmos_save(const char* name, const void* start, const void* end);
+/* Save Atmos tape. */
+
 
 
 /* End of atmos.h */
index 5dd2ca158f7398ef146204e678a0e97d997e2de2..e38da12618e2bf6afcc82517c808abb3f0201c5c 100644 (file)
@@ -45,6 +45,8 @@ CFLAGS        = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
 # Object files
 
 OBJS  =        _scrsize.o      \
+        atmos_load.o    \
+        atmos_save.o    \
         cclear.o        \
         cgetc.o         \
         chline.o        \
@@ -63,6 +65,7 @@ OBJS  =       _scrsize.o      \
         oserrlist.o     \
         oserror.o       \
         revers.o        \
+        store_filename.o\
         systime.o       \
         sysuname.o      \
         tgi_colors.o    \
diff --git a/libsrc/atmos/atmos_load.s b/libsrc/atmos/atmos_load.s
new file mode 100644 (file)
index 0000000..30d67ab
--- /dev/null
@@ -0,0 +1,25 @@
+; Stefan Haubenthal, 2012-05-06
+; based on code by Twilighte
+; void __fastcall__ atmos_load(const char* name);
+
+       .export         _atmos_load
+       .import         store_filename
+
+
+.proc  _atmos_load
+
+       sei
+       jsr     store_filename
+       ldx     #$00
+       stx     $02ad
+       stx     $02ae
+       stx     $025a
+       stx     $025b
+       jsr     cload_bit
+       cli
+       rts
+cload_bit:
+       pha
+       jmp     $e874
+
+.endproc
diff --git a/libsrc/atmos/atmos_save.s b/libsrc/atmos/atmos_save.s
new file mode 100644 (file)
index 0000000..7a4e68a
--- /dev/null
@@ -0,0 +1,28 @@
+; Stefan Haubenthal, 2012-05-06
+; based on code by Twilighte
+; void __fastcall__ atmos_save(const char* name, const void* start, const void* end);
+
+       .export         _atmos_save
+       .import         popax, store_filename
+
+
+.proc  _atmos_save
+
+       sei
+       sta     $02ab   ; file end lo
+       stx     $02ac   ; file end hi
+       jsr     popax
+       sta     $02a9   ; file start lo
+       stx     $02aa   ; file start hi
+       jsr     popax
+       jsr     store_filename
+       lda     #00
+       sta     $02ad
+       jsr     csave_bit
+       cli
+       rts
+csave_bit:
+       php
+       jmp     $e92c
+
+.endproc
diff --git a/libsrc/atmos/store_filename.s b/libsrc/atmos/store_filename.s
new file mode 100644 (file)
index 0000000..a909bcf
--- /dev/null
@@ -0,0 +1,12 @@
+       .export         store_filename
+       .importzp       ptr1
+
+store_filename:
+       sta     ptr1
+       stx     ptr1+1
+       ldy     #$0f   ;store filename
+:      lda     (ptr1),y
+       sta     $027f,y
+       dey
+       bpl     :-
+       rts