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
<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/
<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>
</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>
</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>
--- /dev/null
+; 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