2017-01-22 20:41:49 +00:00
<!doctype linuxdoc system>
<article>
<title>Oric Telestrat-specific information for cc65
<author>
<url url="mailto:jede@oric.org" name="Jede">,<newline>
<date>2017-01-22
<abstract>
2017-02-02 21:44:06 +00:00
An overview over the Telestrat (Telemon 3.0 : http://orix.oric.org) runtime system as it is implemented for the cc65 C
2017-02-01 22:58:33 +00:00
compiler.)
2017-01-22 20:41:49 +00:00
</abstract>
<!-- Table of contents -->
<toc>
<!-- Begin the document -->
<sect>Overview<p>
This file contains an overview of the Telestrat runtime system as it comes with the
2017-02-01 22:58:33 +00:00
cc65 C compiler. It describes the memory layout, Telestrat-specific header files,
2017-01-22 20:41:49 +00:00
available drivers, and any pitfalls specific to that platform.
2017-02-01 22:58:33 +00:00
Please note that Telestrat-specific functions are just mentioned here, they are
2017-01-22 20:41:49 +00:00
described in detail in the separate <url url="funcref.html" name="function
reference">. Even functions marked as "platform dependent" may be available on
more than one platform. Please see the function reference for more
information.
2017-02-01 22:58:33 +00:00
<sect>Binary format<p>
2017-01-22 20:41:49 +00:00
2017-02-01 22:58:33 +00:00
The standard binary output format generated the linker for the Telestrat target
is a machine language program with a 20 bytes header described here : http://orix.oric.org/doku.php?id=orix:header
2017-01-22 20:41:49 +00:00
2017-02-01 22:58:33 +00:00
This header is used for Telemon 3.0.
2017-02-02 21:44:06 +00:00
Anyway, for Telemon 2.4, there is no file management, there is no TAPE routine in Telemon, there is no way to load a binary easily.
2017-02-01 22:58:33 +00:00
Stratsed (the Telestrat operating system) handles files management. Stratsed is loaded to memory from floppy disk.
There is no tool to insert a binary in a Stratsed floppy disk.
The only way to load a binary (for Telemon 2.4) is to :
<itemize>
<item>remove the 20 bytes header
<item>download osdk : http://osdk.defence-force.org/index?page=download
2017-02-02 21:44:06 +00:00
<item>use Floppybuilder in OSDK to insert the binary with the tool (please read FloppyBuilder manual to insert your binary, and to start microdisc boot sector when Telestrat starts)
2017-02-01 22:58:33 +00:00
</itemize>
2017-01-22 20:41:49 +00:00
2017-02-02 21:44:06 +00:00
Please note also, that the binary converted into TAP file, will not produce a right stratsed file when tap2dsk and old2mfm are used. You will be in the case that Telestrat/Stratsed crashed when you do "DIR" command.
2017-01-22 20:41:49 +00:00
2017-02-02 21:44:06 +00:00
If you know the Stratsed disk format, please contact the author of this doc.
2017-01-22 20:41:49 +00:00
<sect>Memory layout<p>
In the standard setup, cc65-generated programs use the memory from
$0801 to $9800; so, nearly 37K of memory (including the stack) is
available. ROM calls are possible without further precautions.
Special locations:
<descrip>
<tag/Stack/
The C runtime stack is located at $97FF (or $B3FF), and grows
downwards.
<tag/Heap/
The C heap is located at the end of the program, and grows towards the C
runtime stack.
</descrip><p>
<sect>Platform-specific header files<p>
2017-02-01 22:58:33 +00:00
Programs containing Telestrat -specific code may use the <tt/telestrat.h/ header file.
2017-01-22 20:41:49 +00:00
2017-02-01 22:58:33 +00:00
<sect1>Telestrat-specific functions<p>
2017-01-22 20:41:49 +00:00
2017-02-01 22:58:33 +00:00
The functions listed below are special for the Telestrat. See the <url
2017-01-22 20:41:49 +00:00
url="funcref.html" name="function reference"> for declaration and usage.
<itemize>
<item>explode
<item>ping
<item>shoot
<item>zap
2017-02-01 22:58:33 +00:00
<item>oups
2017-01-22 20:41:49 +00:00
</itemize>
<sect1>Hardware access<p>
2017-02-01 22:58:33 +00:00
The following pseudo variables declared in the <tt/telestrat.h/ header file do allow
2017-01-22 20:41:49 +00:00
access to hardware located in the address space. Some variables are
structures; accessing the struct fields will access the chip registers.
<descrip>
<tag><tt/VIA/</tag>
Access to the VIA (Versatile Interface Adapter) chip is available via the
<tt/VIA/ variable. The structure behind this variable is explained in <tt/_6522.h/.
</descrip><p>
<sect>Loadable drivers<p>
<sect1>Extended memory drivers<p>
2017-02-01 22:58:33 +00:00
No extended memory drivers are currently available for the Telestrat.
2017-01-22 20:41:49 +00:00
<sect1>Joystick drivers<p>
<descrip>
2017-02-01 22:58:33 +00:00
telemon 2.4 & 3.0 manages joysticks but it had been handled yet.
2017-01-22 20:41:49 +00:00
2017-02-02 21:44:06 +00:00
</descrip>
2017-01-22 20:41:49 +00:00
<sect1>Mouse drivers<p>
2017-02-02 21:44:06 +00:00
<descrip>
2017-02-01 22:58:33 +00:00
Telestrat manages also mouse, but it had been no handled yet in this version.
2017-01-22 20:41:49 +00:00
2017-02-02 21:44:06 +00:00
</descrip>
2017-01-22 20:41:49 +00:00
<sect1>RS232 device drivers<p>
<descrip>
2017-02-02 21:44:06 +00:00
Telestrat has a RS232 port, but it's not used
2017-01-22 20:41:49 +00:00
2017-02-25 20:32:42 +00:00
</descrip>
2017-01-22 20:41:49 +00:00
<sect>Limitations<label id="limitations"><p>
<sect1>Disk I/O<p>
2017-02-09 17:46:56 +00:00
Telemon 3.0 handles fopen, fread, fclose primitives. It means that this function will crash the Telestrat because Telemon 2.4 does not have these primitives.
2017-02-02 21:44:06 +00:00
By the way, Telemon 3.0 uses an extension "ch376 card" which handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS, Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread, fclose).
2017-01-22 20:41:49 +00:00
<itemize>
<item>fclose
<item>fopen
<item>fread
</itemize>
<sect>Other hints<p>
<sect>License<p>
This software is provided 'as-is', without any expressed or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>