1 <!doctype linuxdoc system>
4 <title>Oric Telestrat-specific information for cc65
6 <url url="mailto:jede@oric.org" name="Jede">
9 An overview over the Telestrat (Telemon 2.4 & Telemon 3.x : http://orix.oric.org) runtime system as it is implemented for the cc65 C compiler.
12 <!-- Table of contents -->
15 <!-- Begin the document -->
19 This file contains an overview of the Telestrat runtime system as it comes
20 with the cc65 C compiler. It describes the memory layout, Telestrat-specific
21 header files, available drivers, and any pitfalls specific to that platform.
23 Please note that Telestrat-specific functions are just mentioned here, they are
24 described in detail in the separate <url url="funcref.html" name="function
25 reference">. Even functions marked as "platform dependent" may be available on
26 more than one platform. Please see the function reference for more
29 Oric Telestrat is the last Oric computer (Released in 1986, mainly in France).
30 This computer is an Atmos with extra hardware: RS232, cardridge(banking system),
31 joysticks (2 ports) or mouse (on joystick port), FDC.
33 Video chip, CPU, keyboard management, tape hardware are the same than Atmos.
35 Telestrat can start in Atmos mode with Atmos Cardridge (which is only the atmos
38 Telestrat can start in Sedoric (Atmos OS) and Atmos mode with Stratoric Cardridge.
39 This Cardridge has 3 banks of 16KB of rom with:
42 <item>a Basic 1.1 ROM (Atmos).
43 <item>a Basic 1.0 ROM (Oric-1).
46 The main Telestrat's configuration is the Telemon/Hyperbasic Cardridge inserted
47 with Stratsed in floppy drive.
49 Anyway, there is no way to load a tape file in Telemon/Hyperbasic mode without
52 There is also no software to write a Stratsed dsk file on PC.
54 This Telestrat target build an Orix binary file. But, in the future, it will be possible
55 to build a Stratsed disk. Orix uses the same systems calls than Telemon mode.
57 That is why if you need to do software for telestrat target, you have the choice to:
59 <item>use cc65 Atmos target and start Telestrat in Atmos mode: A tape file is required.
60 <item>use cc65 Atmos target and start Telestrat in Stratoric mode: A dsk file or tape file is required.
61 <item>use cc65 Telestrat target and start Telestrat in Orix mode (see <url
62 name="here" url="http://orix.oric.org/download/">).
63 <item>use cc65 Telestrat target, remove Orix header from binary, code a dsk tool for Stratsed,
64 add Stratsed header on your binary,insert your binary on floppy disk (this solution will be possible is the future).
67 Telestrat (from cardridge) can handle 8 banks (from $C000 to $FFFF): Bank 0 is the overlay ram. Others banks can be ROM or RAM.
69 <sect>Binary format<p>
71 The standard binary output format generated the linker for the Telestrat
72 target is a machine language program with a 20 bytes header described <url
73 name="here" url="http://orix.oric.org/orix-header/">
75 This header is used for Telemon 3.0.
77 Anyway, for Telemon 2.4, there is no file management, there is no TAPE routine
78 in Telemon, there is no way to load a binary easily.
80 Stratsed (the Telestrat operating system) handles files management. Stratsed
81 is loaded to memory from floppy disk. Stratsed vector are declared in asminc/telestrat.inc.
82 But, reverse engineering is required to find how theses vectors works. Please, note that
83 Stratsed is located in overlay memory (bank 0)
85 There is no tool to insert a binary in a Stratsed floppy disk.
87 The only way to load a binary (for Telemon 2.4) is to:
89 <item>remove the 20 bytes header
90 <item>download <url name="osdk" url="http://osdk.defence-force.org/index?page=download">
91 <item>use Floppybuilder in OSDK to insert the binary with the tool (please read
92 FloppyBuilder manual to learn how to insert your binary and how to start Microdisc boot sector
93 when Telestrat starts)
96 Please note also, that the binary converted into TAP file, will not produce
97 a right stratsed file when tap2dsk and old2mfm are used. You will be in the
98 case that Telestrat/Stratsed crashed when you do "DIR" command.
100 If you know the Stratsed disk format, please contact the author of this doc.
103 <sect>Memory layout<p>
105 In the standard setup, cc65-generated programs use the memory from
106 $0801 to $9800; so, nearly 37K of memory (including the stack) is
107 available. ROM calls are possible with BRK feature.
114 The C runtime stack is located at $97FF (or $B3FF), and grows
118 The C heap is located at the end of the program, and grows towards the C
125 <sect>Platform-specific header files<p>
127 Programs containing Telestrat-specific code may use the <tt/telestrat.h/ header file.
130 <sect1>Telestrat-specific functions<p>
132 The functions listed below are special for the Telestrat. See the <url
133 url="funcref.html" name="function reference"> for declaration and usage.
144 <sect1>Hardware access<p>
146 The following pseudo variables declared in the <tt/telestrat.h/ header file do allow
147 access to hardware located in the address space. Some variables are
148 structures; accessing the struct fields will access the chip registers.
153 Access to the VIA (Versatile Interface Adapter) chip is available via the
154 <tt/VIA/ variable. The structure behind this variable is explained in <tt/_6522.h/.
157 Access to the VIA2 (Versatile Interface Adapter) chip is available via the
158 <tt/VIA2/ variable. The structure behind this variable is explained in <tt/_6522.h/.
161 Access to the 6551 ACIA chip is available via the
162 <tt/ACIA/ variable. The structure behind this variable is explained in <tt/_6551.h/.
167 <sect>Loadable drivers<p>
171 TGI drivers is available on Oric Telestrat with some functions:
184 <sect1>Extended memory drivers<p>
186 No extended memory drivers are currently available for the Telestrat.
187 This feature could be done because telestrat can manage RAM inserted in his
190 <sect1>Joystick drivers<p>
192 Telemon 2.4 & 3.0 manages joysticks but it had been handled yet. This means that
193 joysticks driver could be written easily.
195 Telemon 2.4 returns in keyboard buffer the direction of the joysticks. This means that
196 if you get input from keyboard by conio cgetc function, you will get direction from joysticks.
198 <sect1>Mouse drivers<p>
200 Telestrat manages also mouse, but it had been no handled yet in this version.
201 Telestrat mouse is really difficult to find.
203 <sect1>RS232 device drivers<p>
205 Telestrat has a RS232 port, but it's not usable in cc65. It is possible to use
206 RS232 port with Telemon calls (see XSOUT primitive for example)
208 <sect>Limitations<label id="limitations"><p>
212 Telemon 3.0 handles fopen, fread, fclose primitives. It means that this
213 function will crash the Telestrat because Telemon 2.4 does not have these
214 primitives. By the way, Telemon 3.0 uses an extension "ch376 card" which
215 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).
230 This software is provided 'as-is', without any expressed or implied
231 warranty. In no event will the authors be held liable for any damages
232 arising from the use of this software.
234 Permission is granted to anyone to use this software for any purpose,
235 including commercial applications, and to alter it and redistribute it
236 freely, subject to the following restrictions:
239 <item> The origin of this software must not be misrepresented; you must not
240 claim that you wrote the original software. If you use this software
241 in a product, an acknowledgment in the product documentation would be
242 appreciated but is not required.
243 <item> Altered source versions must be plainly marked as such, and must not
244 be misrepresented as being the original software.
245 <item> This notice may not be removed or altered from any source