The C64 OS Programmer's Guide is being written
This guide is being written and released and few chapters at a time. If a chapter seems to be empty, or if you click a chapter in the table of contents but it loads up Chapter 1, that's mostly likely because the chapter you've clicked doesn't exist yet.
Discussion of development topics are on-going about what to put in this guide. The discusssions are happening in the C64 OS Community Support Discord server, available to licensed C64 OS users.
C64 OS PROGRAMMER'S GUIDE
Appendices
File Extension Registry
Officially recognized file extensions
The following filenaame extensions are officially recognized by C64 OS. Before creating a new filename extension for a C64 OS Application data file format, this list should be consulted. And discussion in the C64 OS developer channels on Discord are required to get your filename extension listed in this registry.
Extension | Type | Note | Developer |
---|---|---|---|
3dk | SEQ | 3D Koala. Multi-color matrix graphics. | OpCoders Inc. |
a | PRG | TurboMacroPro binary file | Style64 |
art | PRG | ArtStudio hi-res graphics | Oxford Computer Publishing |
car | SEQ | C64 Archiver | OpCoders Inc. |
cgx | SEQ | Commodore Graphix | OpCoders Inc. |
chs | SEQ | Chess for C64 OS saved game | OpCoders Inc. |
cwg | PRG | Create with Garfield multi-color graphics | Ahead Designs |
d | SEQ/PRG | Raw data, unstructured. See: dat | Generic |
d41 | SEQ/PRG | 1541 disk image. See: d64 | Peter Schepers |
d64 | SEQ/PRG | 1541 disk image. See: d41 | Peter Schepers |
d71 | SEQ/PRG | 1571 disk image | Peter Schepers |
d81 | SEQ/PRG | 1581 disk image | Peter Schepers |
dat | SEQ/PRG | Raw data, unstructured. See: d | Generic |
dd | PRG | Doodle hi-res graphics. See: ddl | Mark R. Rubin |
ddl | PRG | Doodle hi-res graphics. See: dd | Mark R. Rubin |
dnp | SEQ/PRG | CMD native partition image | Peter Schepers |
ech | SEQ | Eliza for C64 OS chat document | OpCoders Inc. |
gz | SEQ | GZip compressed file | Jean-loup Gailly, Mark Adler |
h | SEQ | Programming header for method and routine offsets | Style64 |
hbm | PRG | Hi-res black and white graphics. See: hbw | Fun Graphics Machine |
hbw | PRG | Hi-res black and white graphics. See: hbm | Fun Graphics Machine |
hed | PRG | Hi-Eddi hi-res graphics | Hans Haberl |
i | SEQ | C64 OS binary config data file | OpCoders Inc. |
joy | PRG | Game Controller (Joystick) input driver | OpCoders Inc. |
kbd | PRG | Keyboard input driver | OpCoders Inc. |
kla | PRG | Koala multi-color graphics. See: koa | Audio Light |
koa | PRG | Koala multi-color graphics. See: kla | Audio Light |
l | SEQ | TurboMacroPro label export. See: xl | Style64 |
m | SEQ | C64 OS Application menu definition | OpCoders Inc. |
nhd | PRG | Network hardware driver | OpCoders Inc. |
o | PRG | C64 OS assembled object file, fixed load address. | OpCoders Inc. |
pa | SEQ | PRG alias | OpCoders Inc. |
pbot | SEQ | PETSCII Bot hi-res character mode graphics | Cal Skuthorpe |
pet | SEQ | PETSCII graphics. C64 OS screenshot format. | OpCoders Inc. |
prs | SEQ | Presenter for C64 OS | Erik van der Tier |
ptr | PRG | Mouse Pointer input driver | OpCoders Inc. |
r | PRG | C64 OS assembled object file, relocatable load address. | OpCoders Inc. |
rtc | PRG | Realtime Clock (RTC) driver | OpCoders Inc. |
s | SEQ | Programming header for constants, structures and static memory addresses. | Style64 |
sid | PRG | SID music in the PSID format | Michael Schwendt |
t | SEQ | PETSCII encoded text. May contain MText codes. | OpCoders Inc. |
txt | SEQ | PETSCII or ASCII encoded text. May contain MText codes. | Generic |
xl | SEQ | TurboMacroPro label export, trimmed using Exlabel Tool. See: l | OpCoders Inc. |
zip | SEQ/PRG | ZIP archive file | PKWARE, Inc. |
Toolkit Classes
Built-In Classes
The following classes are built into the C64 OS KERNAL. A RegPtr to the class definition can be obtained by calling classptr in the Toolkit KERNAL module, and passing the Class ID in the X register.
Object size is measured in bytes.
Class ID | Class Name | Method Count | Object Size |
---|---|---|---|
0 | tkobj | 2 | 2 |
1 | tkview | 19 | 39 |
2 | tksplit | 20 | 45 |
3 | tktabs | 22 | 54 |
4 | tkscroll | 23 | 46 |
5 | tklabel | 20 | 44 |
6 | tkctrl | 25 | 54 |
7 | tkbutton | 27 | 62 |
8 | tksbar | 27 | 65 |
Runtime Loadable Classes
These classes are found in the //os/tk/ directory. They must be loaded for relocation. First allocate the number of pages indicated by the page size column for the class, using pgalloc in the Memory KERNAL module. Initialize it as a system file reference using getsfref in the Service KERNAL module. Append "tk/" to the directory path.
Set the filename to the name of the class with a ".r" extension. E.g., if the class name is tklist, set the filename to "tklist.r". Load the class workspace variable (defined by //os/s/:toolkit.s) with a pointer to the superclass. E.g., If you are loading tklist, a pointer to tkview must first be installed in class. Load a RegPtr to the file reference to the class to load and call loadreloc in the Service KERNAL module. The pointer to the newly loaded and linked class is found in class.
Object size is measured in bytes. Complete size is measured in bytes. For classes whose complete size is bigger than its object size, this is because the class is complex; it internally instantiates one or more other classes. The complete size includes the malloc header sizes of the other classes automatically instantiated.
Class Name | Superclass | Page Size | Object Size | Complete Size |
---|---|---|---|---|
tklist | tkview | 2 | 49 | * |
tktcols | tkscroll | 4 | 54 | * |
tktable | tklist | 2 | 51 | * |
tkplaces | tkview | 6 | 48 | 219 |
tkdirinfo | tkview | 2 | 39 | * |
tkfilemeta | tkview | 5 | 45 | * |
tkinput | tkctrl | 6 | 60 | * |
tktext | tkview | 6 | 52 | * |
tkicon | tkctrl | 2 | 57 | * |
tkpbar | tkview | 2 | 42 | * |
tkdatepick | tkview | 5 | 45 | 240 |
tktimepick | tkview | 5 | 45 | 240 |
tkrating | tkctrl | 2 | 54 | * |
Table of Contents
This document is subject to revision updates.
Last modified: Sep 03, 2024