1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-09 06:29:38 +00:00

Tape load and save functions for the Oric Atmos. By Stefan Haubenthal.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5660 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-05-28 11:11:39 +00:00
parent 47c87eb335
commit 293c279416
7 changed files with 155 additions and 2 deletions

View 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/

View 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>

View File

@ -98,6 +98,12 @@
#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 */

View 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 \

25
libsrc/atmos/atmos_load.s Normal file
View File

@ -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

28
libsrc/atmos/atmos_save.s Normal file
View File

@ -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

View File

@ -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