1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Merge branch 'master' into missing-purple

This commit is contained in:
Bob Andrews 2022-05-17 15:34:51 +02:00 committed by GitHub
commit e0cc3650e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
697 changed files with 12785 additions and 3271 deletions

16
.github/checks/Makefile vendored Normal file
View File

@ -0,0 +1,16 @@
.PHONY: checkstyle tabs lastline spaces noexec
checkstyle: tabs lastline spaces noexec
tabs: tabs.sh
@./tabs.sh
lastline: lastline.sh
@./lastline.sh
spaces: spaces.sh
@./spaces.sh
noexec: noexec.sh
@./noexec.sh

25
.github/checks/lastline.sh vendored Executable file
View File

@ -0,0 +1,25 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
nl='
'
nl=$'\n'
r1="${nl}$"
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | while read f; do
t=$(tail -c2 $f; printf x)
[[ ${t%x} =~ $r1 ]] || echo "$f"
done`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found following files that have no newline at the end:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi

18
.github/checks/noexec.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -executable -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: executable flag is set for the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi

18
.github/checks/spaces.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l ' $'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found dangling spaces in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi

18
.github/checks/tabs.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( \( -name \*.inc -a \! -name Makefile.inc \) -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l $'\t'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found TABs in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi

View File

@ -21,9 +21,15 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v2
- name: Do some simple style checks
shell: bash
run: make -j2 checkstyle
- name: Build the tools.
shell: bash
run: make -j2 bin USER_CFLAGS=-Werror
- name: Build the utilities.
shell: bash
run: make -j2 util
- name: Build the platform libraries.
shell: bash
run: make -j2 lib QUIET=1
@ -31,137 +37,9 @@ jobs:
shell: bash
run: make test QUIET=1
- name: Test that the samples can be built.
shell: bash
run: |
make SYS=apple2 -C samples
make SYS=apple2 -C samples clean
make SYS=apple2enh -C samples
make SYS=apple2enh -C samples clean
make SYS=atari -C samples
make SYS=atari -C samples clean
make SYS=atarixl -C samples
make SYS=atarixl -C samples clean
make SYS=atari2600 -C samples
make SYS=atari2600 -C samples clean
make SYS=atari5200 -C samples
make SYS=atari5200 -C samples clean
make SYS=atmos -C samples
make SYS=atmos -C samples clean
make SYS=bbc -C samples
make SYS=bbc -C samples clean
make SYS=c128 -C samples
make SYS=c128 -C samples clean
make SYS=c16 -C samples
make SYS=c16 -C samples clean
make SYS=c64 -C samples
make SYS=c64 -C samples clean
make SYS=cbm510 -C samples
make SYS=cbm510 -C samples clean
make SYS=cbm610 -C samples
make SYS=cbm610 -C samples clean
make SYS=creativision -C samples
make SYS=creativision -C samples clean
make SYS=cx16 -C samples
make SYS=cx16 -C samples clean
make SYS=gamate -C samples
make SYS=gamate -C samples clean
make SYS=geos-apple -C samples
make SYS=geos-apple -C samples clean
make SYS=geos-cbm -C samples
make SYS=geos-cbm -C samples clean
make SYS=lunix -C samples
make SYS=lunix -C samples clean
make SYS=lynx -C samples
make SYS=lynx -C samples clean
make SYS=nes -C samples
make SYS=nes -C samples clean
make SYS=osic1p -C samples
make SYS=osic1p -C samples clean
make SYS=pce -C samples
make SYS=pce -C samples clean
make SYS=pet -C samples
make SYS=pet -C samples clean
make SYS=plus4 -C samples
make SYS=plus4 -C samples clean
make SYS=sim6502 -C samples
make SYS=sim6502 -C samples clean
make SYS=sim65c02 -C samples
make SYS=sim65c02 -C samples clean
make SYS=supervision -C samples
make SYS=supervision -C samples clean
make SYS=sym1 -C samples
make SYS=sym1 -C samples clean
make SYS=telestrat -C samples
make SYS=telestrat -C samples clean
make SYS=vic20 -C samples
make SYS=vic20 -C samples clean
run: make -C samples platforms
- name: Test that the targettest programs can be built.
shell: bash
run: |
make SYS=c64 -C targettest all
make SYS=c64 -C targettest clean
make SYS=apple2 -C targettest
make SYS=apple2 -C targettest clean
make SYS=apple2enh -C targettest
make SYS=apple2enh -C targettest clean
make SYS=atari -C targettest
make SYS=atari -C targettest clean
make SYS=atarixl -C targettest
make SYS=atarixl -C targettest clean
# make SYS=atari2600 -C targettest
# make SYS=atari2600 -C targettest clean
# make SYS=atari5200 -C targettest
# make SYS=atari5200 -C targettest clean
# make SYS=atmos -C targettest
# make SYS=atmos -C targettest clean
# make SYS=bbc -C targettest
# make SYS=bbc -C targettest clean
# make SYS=c128 -C targettest
# make SYS=c128 -C targettest clean
# make SYS=c16 -C targettest
# make SYS=c16 -C targettest clean
make SYS=c64 -C targettest
make SYS=c64 -C targettest clean
# make SYS=cbm510 -C targettest
# make SYS=cbm510 -C targettest clean
# make SYS=cbm610 -C targettest
# make SYS=cbm610 -C targettest clean
# make SYS=creativision -C targettest
# make SYS=creativision -C targettest clean
# make SYS=cx16 -C targettest
# make SYS=cx16 -C targettest clean
# make SYS=gamate -C targettest
# make SYS=gamate -C targettest clean
# make SYS=geos-apple -C targettest
# make SYS=geos-apple -C targettest clean
# make SYS=geos-cbm -C targettest
# make SYS=geos-cbm -C targettest clean
# make SYS=lunix -C targettest
# make SYS=lunix -C targettest clean
# make SYS=lynx -C targettest
# make SYS=lynx -C targettest clean
# make SYS=nes -C targettest
# make SYS=nes -C targettest clean
# make SYS=osic1p -C targettest
# make SYS=osic1p -C targettest clean
# make SYS=pce -C targettest
# make SYS=pce -C targettest clean
# make SYS=pet -C targettest
# make SYS=pet -C targettest clean
# make SYS=plus4 -C targettest
# make SYS=plus4 -C targettest clean
# make SYS=sim6502 -C targettest
# make SYS=sim6502 -C targettest clean
# make SYS=sim65c02 -C targettest
# make SYS=sim65c02 -C targettest clean
# make SYS=supervision -C targettest
# make SYS=supervision -C targettest clean
# make SYS=sym1 -C targettest
# make SYS=sym1 -C targettest clean
# make SYS=telestrat -C targettest
# make SYS=telestrat -C targettest clean
make SYS=vic20 -C targettest
make SYS=vic20 -C targettest clean
run: make -C targettest platforms
- name: Build the document files.
shell: bash
run: make -j2 doc
@ -189,8 +67,3 @@ jobs:
- name: Build app (release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
# TODO: fix targettest Makefile for all currently commented out targets
# TODO: build targettest cbm subdir for all cbm targets
# TODO: build targettest atari subdir for all atari targets
# TODO: build targettest apple2 subdir for all apple2 targets

View File

@ -10,6 +10,7 @@ concurrency:
jobs:
build_windows:
name: Build (Windows)
if: github.repository == 'cc65/cc65'
runs-on: windows-latest
steps:
@ -29,9 +30,9 @@ jobs:
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
build_linux:
name: Build, Test and Snaphot (Linux)
name: Build, Test, and Snapshot (Linux)
if: github.repository == 'cc65/cc65'
runs-on: ubuntu-latest
needs: build_windows
steps:
- name: Install Dependencies
@ -45,9 +46,14 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v2
- name: Do some simple style checks
shell: bash
run: make -j2 checkstyle
- name: Build the tools.
shell: bash
run: make -j2 bin USER_CFLAGS=-Werror
run: |
make -j2 bin USER_CFLAGS=-Werror
make -j2 util
- name: Build the platform libraries.
shell: bash
run: make -j2 lib QUIET=1
@ -60,6 +66,9 @@ jobs:
- name: Remove the output from the samples tests.
shell: bash
run: make -C samples clean
- name: Remove programs in util directory
shell: bash
run: make -C util clean
- name: Build the document files.
shell: bash
run: make -j2 doc
@ -68,24 +77,35 @@ jobs:
make -C src clean
make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
make zip
mv cc65.zip cc65-win64.zip
mv cc65.zip cc65-snapshot-win64.zip
- name: Build and package 32-bit Windows versions of the tools.
run: |
make -C src clean
make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
make zip
mv cc65.zip cc65-win32.zip
mv cc65.zip cc65-snapshot-win32.zip
- name: Upload a 32-bit Snapshot Zip
uses: actions/upload-artifact@v2
with:
name: cc65-snapshot-win32.zip
path: cc65-win32.zip
path: cc65-snapshot-win32.zip
- name: Upload a 64-bit Snapshot Zip
uses: actions/upload-artifact@v2
with:
name: cc65-snapshot-win64.zip
path: cc65-win64.zip
path: cc65-snapshot-win64.zip
# enter secrets under "repository secrets"
- name: Upload snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-win32.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
# TODO: Update docs at https://github.com/cc65/doc
# TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io

3
.gitignore vendored
View File

@ -7,3 +7,6 @@
/testwrk/
/wrk/
/cc65.zip
/util/atari/*.exe
/util/gamate/*.exe

165
Contributing.md Normal file
View File

@ -0,0 +1,165 @@
This document contains all kinds of information that you should know if you want to contribute to the cc65 project. Before you start, please read all of it. If something is not clear to you, please ask - this document is an ongoing effort and may well be incomplete.
(''Note:'' The word "must" indicates a requirement. The word "should" indicates a recomendation.)
*this is work in progress and is constantly updated - if in doubt, please ask*
# generally
* You must obey these rules when contributing new code or documentation to cc65. We are well aware that not all existing code may respect all rules outlined here - but this is no reason for you not to respect them.
* One commit/patch/PR per issue. Do not mix several things unless they are very closely related.
# Codestyle rules
## All Sources
### TABs and spaces
This is an ongoing controversial topic - everyone knows that. However, the following is how we do it :)
* TAB characters must be expanded to spaces.
* 4 spaces per indention level (rather than 8) are preferred, especially if there are many different levels.
* No extra spaces at the end of lines.
* All text files must end with new-line characters. Don't leave the last line "dangling".
The (bash) scripts used to check the above rules can be found in ```.github/check```. You can also run all checks using ```make check```.
### misc
* 80 characters is the desired maximum width of files. But, it isn't a "strong" rule; sometimes, you will want to type longer lines, in order to keep the parts of expressions or comments together on the same line.
* You should avoid typing non-ASCII characters.
* If you change "normal" source code into comments, then you must add a comment about why that code is a comment.
* When you want to create a comment from several lines of code, you should use preprocessor lines, instead of ```/* */``` or "```;```". Example:
<pre>
#if 0
one ();
two ();
three = two () + one ();
#endif
</pre>
* You should type upper case characters for hex values.
* When you type zero-page addresses in hexadecimal, you should type two hex characters (after the hex prefix). When you type non-zero-page addresses in hex, you should type four hex characters.
* When you type lists of addresses, it is a good idea to sort them in ascending numerical order. That makes it easier for readers to build mental pictures of where things are in an address space. And, it is easier to see how big the variables and buffers are. Example:
<pre>
xCoord := $0703
yCoord := $0705 ; (this address implies that xCoord is 16 bits)
cmdbuf := $0706 ; (this address implies that yCoord is 8 bits)
cmdlen := $0786 ; (this address implies that cmdbuf is 128 bytes)
color := $0787
</pre>
## C Sources
The following is still very incomplete - if in doubt please look at existing sourcefiles and adapt to the existing style
* Your files should obey the C89 standard.
* We generally have a "no warnings" policy
* Warnings must not be hidden by using typecasts - fix the code instead
* In printf-style functions use the PRIX64 (and similar) macros to deal with 64bit values
* The normal indentation width should be four spaces.
* You must use ANSI C comments (```/* */```); you must not use C++ comments (```//```).
* When you add functions to an existing file, you should separate them by the same number of blank lines that separate the functions that already are in that file.
* All function declarations must be followed by a comment block that tells at least briefly what the function does, what the parameters are, and what is returned. This comment must sit between the declaration and the function body, like this:
<pre>
int foo(int bar)
/* Add 1 to bar, takes bar and returns the result */
{
return bar + 1;
}
</pre>
* When a function's argument list wraps around to a next line, you should indent that next line by either the normal width or enough spaces to align it with the arguments on the previous line.
* All declarations in a block must be at the beginning of that block.
* You should put a blank line between a list of local variable declarations and the first line of code.
* Always use curly braces even for single statements after ```if```, and the single statement should go into a new line.
* Use "cuddling" braces, ie the opening brace goes in the same line as the ```if```:
<pre>
if (foo > 42) {
bar = 23;
}
</pre>
* Should the ```if``` statement be followed by an empty conditional block, there should be a comment telling why this is the case
<pre>
if (check()) {
/* nothing happened, do nothing */
}
</pre>
* You must separate function names and parameter/argument lists by one space.
* When declaring/defining pointers, you must put the asterisk (```*```) next to the data type, with a space between it and the variable's name. Examples:
<pre>
int* namedPtr[5];
char* nextLine (FILE* f);
</pre>
### Header files
Headers that belong to the standard library (libc) must conform with the C standard. That means:
* all non standard functions, or functions that only exist in a certain standard, should be in #ifdefs
* the same is true for macros or typedefs
<pre>
#if __CC65_STD__ == __CC65_STD_C99__
/* stuff that only exists in C99 here */
#endif
#if __CC65_STD__ == __CC65_STD_CC65__
/* non standard stuff here */
#endif
</pre>
You can refer to Annex B of the ISO C99 standard ([here](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf) is the draft).
## Assembly Sources
* Op-code mnemonics must have lower-case letters. The names of instruction macroes may have upper-case letters.
* Op-codes must use their official and commonly used mnemonics, ie bcc and bcs and not bgt and blt
* Hexadecimal number constants should be used except where decimal or binary numbers make much more sense in that constant's context.
* Hexadecimal letters should be upper-case.
* When you set two registers or two memory locations to an immediate 16-bit zero, you should use the expressions ```#<$0000``` and ```#>$0000``` (they make it obvious where you are putting the lower and upper bytes).
* If a function is declared to return a char-sized value, it actually must return an integer-sized value. (When cc65 promotes a returned value, it sometimes assumes that the value already is an integer.)
* Functions, that are intended for a platform's system library, should be optimized as much as possible.
* Sometimes, there must be a trade-off between size and speed. If you think that a library function won't be used often, then you should make it small. Otherwise, you should make it fast.
* Comments that are put on the right side of instructions must be aligned (start in the same character columns).
* Assembly source fields (label, operation, operand, comment) should start ''after'' character columns that are multiples of eight (such as 1, 9, 17, 33, and 41).
## LinuxDoc Sources
* TAB characters must be expanded to spaces.
* All text files must end with new-line characters. Don't leave the last line "dangling".
* 80 characters is the desired maximum width of files.
* You should avoid typing non-ASCII characters.
* You should put blank lines between LinuxDoc sections:
* Three blank lines between ```<sect>``` sections.
* Two blank lines between ```<sect1>``` sections.
* One blank line between other sections.
# Library implementation rules
* By default the toolchain must output a "standard" binary for the platform, no emulator formats, no extra headers used by tools. If the resulting binaries can not be run as is on emulators or eg flash cartridges, the process of converting them to something that can be used with these should be documented in the user manual.
* Generally every function should live in a seperate source file - unless the functions are so closely related that splitting makes no sense.
* Source files should not contain commented out code - if they do, there should be a comment that explains why that commented out code exists.
# Makefile rules
* Makefiles must generally work on both *nix (ba)sh and windows cmd.exe.
* Makefiles must not use external tools that are not provided by the cc65 toolchain itself.
The only exception to the above are actions that are exclusive to the github actions - those may rely on bash and/or linux tools.
# Documentation rules
## User manual (LinuxDoc)
* This is the primary documentation.
## Wiki
* The Wiki is strictly for additional information that does not fit into the regular user manual (LinuxDoc). The wiki must not duplicate any information that is present in the user manual
# Roadmap / TODOs / open Ends
## Documentation
* the printf family of function does not completely implement all printf modifiers and does not behave as expected in some cases - all this should be documented in detail
## Test suite
* specific tests to check the optimizer (rather than the codegenerator) are needed.
* we need more specific tests to check standard conformance of the library headers

View File

@ -1,13 +1,23 @@
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check
.SUFFIXES:
all mostlyclean clean install zip:
all install zip:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
mostlyclean clean:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
@$(MAKE) -C test --no-print-directory $@
@$(MAKE) -C targettest --no-print-directory $@
avail unavail bin:
@$(MAKE) -C src --no-print-directory $@
@ -20,11 +30,26 @@ doc html info:
samples:
@$(MAKE) -C samples --no-print-directory $@
test:
@$(MAKE) -C test --no-print-directory $@
util:
@$(MAKE) -C util --no-print-directory $@
%65:
@$(MAKE) -C src --no-print-directory $@
%:
@$(MAKE) -C libsrc --no-print-directory $@
# check the code style
checkstyle:
@$(MAKE) -C .github/checks --no-print-directory $@
# simple "test" target, only run regression tests for c64 target
test:
@$(MAKE) -C test --no-print-directory $@
# GNU "check" target, which runs all tests
check:
@$(MAKE) -C .github/checks checkstyle --no-print-directory
@$(MAKE) test
@$(MAKE) -C targettest platforms --no-print-directory
@$(MAKE) -C samples platforms --no-print-directory

View File

@ -1,42 +1,51 @@
[Windows Snapshot](https://sourceforge.net/projects/cc65/files/cc65-snapshot-win32.zip)
[Documentation](https://cc65.github.io/doc)
[Wiki](https://github.com/cc65/wiki/wiki)
[![Snapshot Build](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml/badge.svg?branch=master)](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml)
# About cc65
cc65 is a complete cross development package for 65(C)02 systems, including
a powerful macro assembler, a C compiler, linker, librarian and several
other tools.
other tools. cc65 has C and runtime library support for many of the old 6502 machines.
For details look at the [Website](https://cc65.github.io).
cc65 has C and runtime library support for many of the old 6502 machines,
including
## People
- the following Commodore machines:
- VIC20
- C16/C116 and Plus/4
- C64
- C128
- CBM 510 (aka P500)
- the 600/700 family
- newer PET machines (not 2001).
- the Apple ]\[+ and successors.
- the Atari 8-bit machines.
- the Atari 2600 console.
- the Atari 5200 console.
- GEOS for the C64, C128 and Apple //e.
- the Bit Corporation Gamate console.
- the NEC PC-Engine (aka TurboGrafx-16) console.
- the Nintendo Entertainment System (NES) console.
- the Watara Supervision console.
- the VTech Creativision console.
- the Oric Atmos.
- the Oric Telestrat.
- the Lynx console.
- the Ohio Scientific Challenger 1P.
- the Commander X16.
- the Synertek Systems Sym-1.
Core team members:
The libraries are fairly portable, so creating a version for other 6502s
shouldn't be too much work.
* [Christian Groessler](https://github.com/groessler): Atari, Atari5200, and CreatiVision library Maintainer
* [dqh](https://github.com/dqh-au): GHA help
* [Greg King](https://github.com/greg-king5): all around hackery
* [groepaz](https://github.com/mrdudz): CBM libary, Project Maintainer
* [Oliver Schmidt](https://github.com/oliverschmidt): Apple II library Maintainer
External contributors:
* [acqn](https://github.com/acqn): various compiler fixes
* [jedeoric](https://github.com/jedeoric): Telestrat target
* [jmr](https://github.com/jmr): compiler fixes
* [karrika](https://github.com/karrika): Atari 7800 target
* [Stephan Mühlstrasser](https://github.com/smuehlst): osic1p target
* [Wayne Parham](https://github.com/WayneParham): Sym-1 target
*(The above list is incomplete, if you feel left out - please speak up or add yourself in a PR)*
For a complete list look at the [full team list](https://github.com/orgs/cc65/teams) or the list of [all contributors](https://github.com/cc65/cc65/graphs/contributors)
# Contact
For general discussion, questions, etc subscribe to the [mailing list](https://cc65.github.io/mailing-lists.html) or use the [github discussions](https://github.com/cc65/cc65/discussions).
Some of us may also be around on IRC [#cc65](https://web.libera.chat/#cc65) on libera.chat
# Documentation
* The main [Documentation](https://cc65.github.io/doc) for users and developers
* Info on [Contributing](Contributing.md) to the CC65 project. Please read this before working on something you want to contribute, and before reporting bugs.
* The [Wiki](https://github.com/cc65/wiki/wiki) contains some extra info that does not fit into the regular documentation.
# Downloads
* [Windows Snapshot](https://sourceforge.net/projects/cc65/files/cc65-snapshot-win32.zip)
* [Linux Snapshot DEB and RPM](https://software.opensuse.org//download.html?project=home%3Astrik&package=cc65)
[![Snapshot Build](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml/badge.svg?branch=master)](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml)

View File

@ -24,4 +24,4 @@ _FPUSHBACK = $08
; File table
.global __filetab

View File

@ -1,5 +1,5 @@
; Convert characters to screen codes
; Helper macro that converts and outputs one character
.macro _scrcode char
.if (char >= 0) .and (char <= 31)

View File

@ -7,7 +7,7 @@
;-------------------------------------------------------------------------
; ATASCII CHARACTER DEFS
;-------------------------------------------------------------------------
ATEOL = $9B ; END-OF-LINE, used by CONIO
;-------------------------------------------------------------------------
@ -27,9 +27,9 @@ CH_VLINE = $01 ; exclamation mark
POKMSK = $00 ; Mask for Pokey IRQ enable
RTCLOK = $01 ; 60 hz. clock
JUMP = $01
JUMP = $01
CRITIC = $03 ; Critical section
ATRACT = $04 ; Attract Mode
ATRACT = $04 ; Attract Mode
SDLSTL = $05 ; DLISTL Shadow
SDLSTH = $06 ; DLISTH "
@ -66,20 +66,20 @@ SAVMSC = $1B ; pointer to screen memory (conio)
;-------------------------------------------------------------------------
;Interrupt Vectors
VIMIRQ = $0200 ; Immediate IRQ
VIMIRQ = $0200 ; Immediate IRQ
; Preset $FC03 (SYSIRQ)
VVBLKI = $0202 ; Vblank immediate
; Preset $FCB8 (SYSVBL)
VVBLKD = $0204 ; Vblank deferred
; Preset $FCB2 (XITVBL)
VDSLST = $0206 ; Display List
VDSLST = $0206 ; Display List
; Preset $FEA1 (OSDLI)
VKYBDI = $0208 ; Keyboard immediate
; Preset $FD02 (SYSKBD)
VKYBDF = $020A ; Deferred Keyboard
; Preset $FCB2 (XITVBL)
VTRIGR = $020C ; Soft Trigger
VTRIGR = $020C ; Soft Trigger
VBRKOP = $020E ; BRK Opcode
VSERIN = $0210 ; Serial in Ready
VSEROR = $0212 ; Serial Out Ready

14
asminc/atari7800.inc Normal file
View File

@ -0,0 +1,14 @@
; Atari 7800 TIA & RIOT read / write registers
;
; Karri Kaksonen (karri@sipo.fi), 2022
; TIA, RIOT & MARIA registers mapping
.include "atari7800_tia.inc"
.include "atari7800_riot.inc"
.include "atari7800_maria.inc"
; constants for the conio implementation
mono_charsperline = 40
charsperline = 20
screenrows = 28

View File

@ -0,0 +1,39 @@
; Atari 7800 MARIA read / write registers
;
; Read registers
BKGRND := $20
P0C1 := $21
P0C2 := $22
P0C3 := $23
MWSYNC := $24
P1C1 := $25
P1C2 := $26
P1C3 := $27
MSTAT := $28
P2C1 := $29
P2C2 := $2A
P2C3 := $2B
DPPH := $2C
P3C1 := $2D
P3C2 := $2E
P3C3 := $2F
DPPL := $30
P4C1 := $31
P4C2 := $32
P4C3 := $33
CHBASE := $34
P5C1 := $35
P5C2 := $36
P5C3 := $37
OFFSET := $38
P6C1 := $39
P6C2 := $3A
P6C3 := $3B
CTRL := $3C
P7C1 := $3D
P7C2 := $3E
P7C3 := $3F
; Write registers

20
asminc/atari7800_riot.inc Normal file
View File

@ -0,0 +1,20 @@
; Atari 7800 RIOT read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
SWCHA := $0280
CTLSWA := $0281
SWCHB := $0282
CTLSWB := $0283
INTIM := $0284
TIMINT := $0285
; Write registers
TIM1T := $0294
TIM8T := $0295
TIM64T := $0296
T1024T := $0297

69
asminc/atari7800_tia.inc Normal file
View File

@ -0,0 +1,69 @@
; Atari 7800 TIA read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
VSYNC := $00
VBLANK := $01
WSYNC := $02
RSYNC := $03
NUSIZ0 := $04
NUSIZ1 := $05
COLUP0 := $06
COLUP1 := $07
COLUPF := $08
COLUBK := $09
CTRLPF := $0A
REFP0 := $0B
REFP1 := $0C
PF0 := $0D
PF1 := $0E
PF2 := $0F
RESP0 := $10
RESP1 := $11
RESM0 := $12
RESM1 := $13
RESBL := $14
AUDC0 := $15
AUDC1 := $16
AUDF0 := $17
AUDF1 := $18
AUDV0 := $19
AUDV1 := $1A
GRP0 := $1B
GRP1 := $1C
ENAM0 := $1D
ENAM1 := $1E
ENABL := $1F
HMP0 := $20
HMP1 := $21
HMM0 := $22
HMM1 := $23
HMBL := $24
VDELP0 := $25
VDELP1 := $26
VDELBL := $27
RESMP0 := $28
RESMP1 := $29
HMOVE := $2A
HMCLR := $2B
CXCLR := $2C
; Write registers
CXM0P := $00
CXM1P := $01
CXP0FB := $02
CXP1FB := $03
CXM0FB := $04
CXM1FB := $05
CXBLPF := $06
CXPPMM := $07
INPT0 := $08
INPT1 := $09
INPT2 := $0A
INPT3 := $0B
INPT4 := $0C
INPT5 := $0D

View File

@ -76,13 +76,13 @@ DL_CHR20x8x2 = 6 ; colour (duochrome per character), 20 character
DL_CHR20x16x2 = 7 ; colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2)
DL_MAP40x8x4 = 8 ; colour, 40 pixel & 8 scanlines per mode line (GR. 3)
DL_MAP80x4x2 = 9 ; 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4)
DL_MAP80x4x4 = 10 ; colour, 80 pixel & 4 scanlines per mode line (GR.5)
DL_MAP160x2x2 = 11 ; 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6)
DL_MAP160x1x2 = 12 ; 'duochrome', 160 pixel & 1 scanline per mode line (GR.14)
DL_MAP160x2x4 = 13 ; 4 colours, 160 pixel & 2 scanlines per mode line (GR.7)
DL_MAP160x1x4 = 14 ; 4 colours, 160 pixel & 1 scanline per mode line (GR.15)
DL_MAP320x1x1 = 15 ; monochrome, 320 pixel & 1 scanline per mode line (GR.8)
DL_MAP80x4x2 = 9 ; 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4)
DL_MAP80x4x4 = 10 ; colour, 80 pixel & 4 scanlines per mode line (GR.5)
DL_MAP160x2x2 = 11 ; 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6)
DL_MAP160x1x2 = 12 ; 'duochrome', 160 pixel & 1 scanline per mode line (GR.14)
DL_MAP160x2x4 = 13 ; 4 colours, 160 pixel & 2 scanlines per mode line (GR.7)
DL_MAP160x1x4 = 14 ; 4 colours, 160 pixel & 1 scanline per mode line (GR.15)
DL_MAP320x1x1 = 15 ; monochrome, 320 pixel & 1 scanline per mode line (GR.8)
; modifiers on mode lines...

View File

@ -7,8 +7,13 @@
.if .def(__CX16__)
; CX16 extended jump table
KBDBUF_PEEK := $FEBD
KBDBUF_GET_MODIFIERS := $FEC0
KBDBUF_PUT := $FEC3
I2C_READ_BYTE := $FEC6
I2C_WRITE_BYTE := $FEC9
CX_MONITOR := $FECC
ENTROPY_GET := $FECF
KEYBRD_BUF_PUT := $FED2
CONSOLE_SET_PAGE_MSG := $FED5
CONSOLE_PUT_IMAGE := $FED8
CONSOLE_INIT := $FEDB
@ -52,7 +57,7 @@
CLOCK_GET_DATE_TIME := $FF50
JOYSTICK_SCAN := $FF53
JOYSTICK_GET := $FF56
SCREEN_SET_MODE := $FF5F
SCREEN_MODE := $FF5F
SCREEN_SET_CHARSET := $FF62
MOUSE_CONFIG := $FF68
MOUSE_GET := $FF6B

View File

@ -1,5 +1,5 @@
;
; CX16 r38 definitions
; CX16 r39 definitions
;
; ---------------------------------------------------------------------------
@ -104,6 +104,10 @@ PI
; ---------------------------------------------------------------------------
; Zero page
; Banking registers
RAM_BANK := $00
ROM_BANK := $01
; GEOS and graphics pseudo-registers
.struct gREG
.org $02
@ -224,7 +228,7 @@ PI
; Kernal
KTEMP2 := $80 ; 2 bytes for temporary storage
IMPARM := $82 ; Pointer for PRIMM function
FNAM := $8C ; Pointer to filename
FNAM := $8A ; Pointer to filename
; BASIC
TXTPTR := $EE ; Pointer into BASIC source code
@ -234,14 +238,13 @@ TXTPTR := $EE ; Pointer into BASIC source code
BASIC_BUF := $0200 ; Location of command-line
BASIC_BUF_LEN = 81 ; Maximum length of command-line
SCREEN_MODE := $0261 ; Current screen mode (set by SCREEN_SET_MODE)
SCREEN_PTR := $0262 ; Pointer to current row on text screen (16 bits)
STATUS := $0286 ; Status from previous I/O operation
IN_DEV := $028A ; Current input device number
OUT_DEV := $028B ; Current output device number
FNAM_LEN := $028E ; Length of filename
SECADR := $0290 ; Secondary address
DEVNUM := $0291 ; Device number
STATUS := $0289 ; Status from previous I/O operation
IN_DEV := $028D ; Current input device number
OUT_DEV := $028E ; Current output device number
FNAM_LEN := $0291 ; Length of filename
SECADR := $0293 ; Secondary address
DEVNUM := $0294 ; Device number
CURS_COLOR := $0373 ; Color under the cursor
CHARCOLOR := $0376 ; Cursor's color nybbles (high: background, low: foreground)
RVS := $0377 ; Reverse flag
@ -268,6 +271,42 @@ NMIVec := $0318
; ---------------------------------------------------------------------------
; I/O locations
; 65C22 Versatile Interface Adapter
.struct VIA1 ; Versatile Interface Adapter
.org $9F00
PRB .byte ; mouse, LED, VIC bus (Port Register B)
PRA .byte ; keyboard, controllers (Port Register A)
DDRB .byte ; (Data Direction Register B)
DDRA .byte ; (Data Direction Register A)
T1 .word ; (Timer 1)
T1L .word ; (Timer 1 Latch)
T2 .word ; (Timer 2)
SR .byte ; (Shift Register)
ACR .byte ; (Auxiliary Control Register)
PCR .byte ; (Peripheral Control Register)
IFR .byte ; (Interrupt Flags Register)
IER .byte ; (Interrupt Enable Register)
PRA2 .byte ; keyboard, controllers (PRA without handshake)
.endstruct
; 65C22 Versatile Interface Adapter
.struct VIA2
.org $9F10
PRB .byte
PRA .byte
DDRB .byte
DDRA .byte
T1 .word
T1L .word
T2 .word
SR .byte
ACR .byte
PCR .byte
IFR .byte
IER .byte
PRA2 .byte
.endstruct
; Video Enhanced Retro Adapter
; Has audio and SPI.
.scope VERA
@ -496,44 +535,16 @@ NMIVec := $0318
.endstruct
.endscope
; 65C22
.struct VIA1 ; Versatile Interface Adapter
.org $9F60
PRB .byte ; ROM bank, IEC (Port Register B)
PRA .byte ; RAM bank (Port Register A)
DDRB .byte ; (Data Direction Register B)
DDRA .byte ; (Data Direction Register A)
T1 .word ; (Timer 1)
T1L .word ; (Timer 1 Latch)
T2 .word ; (Timer 2)
SR .byte ; (Shift Register)
ACR .byte ; (Auxiliary Control Register)
PCR .byte ; (Peripheral Control Register)
IFR .byte ; (Interrupt Flags Register)
IER .byte ; (Interrupt Enable Register)
PRA2 .byte ; RAM bank (Port Register A without handshaking)
; YM2151 audio chip
.struct YM2151
.org $9F40
.union
STATUS .byte
ADDR .byte
.endunion
DATA .byte
.endstruct
; 65C22
.struct VIA2
.org $9F70
PRB .byte ; Mouse communication ?
PRA .byte ; NES controller communication
DDRB .byte
DDRA .byte
T1 .word
T1L .word
T2 .word
SR .byte
ACR .byte
PCR .byte
IFR .byte
IER .byte
PRA2 .byte
.endstruct
; Real-Time Clock
; X16 Emulator device
; This device doesn't exist on the real machine.
.struct EMULATOR
@ -554,8 +565,7 @@ NMIVec := $0318
; ---------------------------------------------------------------------------
; Banked RAM and ROM
KEY_COUNT := $A00A ; (bank 0) Number of keys in input buffer
TIMER := $A037 ; (bank 0) 60 Hz. timer (3 bytes, big-endian)
TIMER := $A03B ; (bank 0) 60 Hz. timer (3 bytes, big-endian)
.struct BANK
.org $A000

View File

@ -75,7 +75,7 @@ EMD_API_VERSION = $02
;------------------------------------------------------------------------------
; Driver entry points
.global emd_install
.global emd_uninstall
.global emd_pagecount

View File

@ -1,4 +1,4 @@
;
;
; Ullrich von Bassewitz, 16.05.2000
;

View File

@ -135,35 +135,35 @@ STIMCTLB = $FD1F
TIM0BKUP = $FD00
TIM0CTLA = $FD01
TIM0CNT = $FD02
TIM0CTLB = $FD03
TIM0CTLB = $FD03
TIM1BKUP = $FD04
TIM1CTLA = $FD05
TIM1CNT = $FD06
TIM1CTLB = $FD07
TIM1CTLB = $FD07
TIM2BKUP = $FD08
TIM2CTLA = $FD09
TIM2CNT = $FD0A
TIM2CTLB = $FD0B
TIM2CTLB = $FD0B
TIM3BKUP = $FD0C
TIM3CTLA = $FD0D
TIM3CNT = $FD0E
TIM3CTLB = $FD0F
TIM3CTLB = $FD0F
TIM4BKUP = $FD10
TIM4CTLA = $FD11
TIM4CNT = $FD12
TIM4CTLB = $FD13
TIM4CTLB = $FD13
TIM5BKUP = $FD14
TIM5CTLA = $FD15
TIM5CNT = $FD16
TIM5CTLB = $FD17
TIM5CTLB = $FD17
TIM6BKUP = $FD18
TIM6CTLA = $FD19
TIM6CNT = $FD1A
TIM6CTLB = $FD1B
TIM6CTLB = $FD1B
TIM7BKUP = $FD1C
TIM7CTLA = $FD1D
TIM7CNT = $FD1E
TIM7CTLB = $FD1F
TIM7CTLB = $FD1F
; Mikey Audio

View File

@ -3,23 +3,23 @@
;
; Christian Krüger, latest change: 18-Sep-2010
;
; 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:
;
; 1. 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.
; 2. Altered source versions must be plainly marked as such, and must not
; be misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source
; distribution.
;
; 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:
;
; 1. 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.
; 2. Altered source versions must be plainly marked as such, and must not
; be misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source
; distribution.
;
; Opcode-Table
; ------------

View File

@ -1,7 +1,7 @@
;
; Oric TELEMON definition
; TELEMON 2.4 & TELEMON 3.x
; For TELEMON 3.x check http://orix.oric.org
; TELEMON 2.4 & Orix
; For Orix check http://orix.oric.org
;
; ---------------------------------------------------------------------------
@ -17,7 +17,7 @@ FNAME_LEN = 11 ; Maximum length of file-name
; ---------------------------------------------------------------------------
; I/O Identifier
; Theses identifers are used for channel management
;
;
XKBD = $80 ; Keyboard
XRSE = $83 ; RS232 in
@ -59,7 +59,7 @@ SCRNB := $28 ; Id of the current window
ADKBD := $2A ; Address ASCII conversion table
PTR_READ_DEST := $2C ; Used for XFREAD and XWRITE only in TELEMON 3.x
PTR_READ_DEST := $2C ; Used for XFREAD and XWRITE only in Orix
ADCLK := $40 ; Address for clock display
TIMEUS := $42
@ -87,27 +87,27 @@ HRSFB := $57
VABKP1 := $58
; RS232T
; b0-b3 : speed
; b0-b3 : speed
; 1111 => 19200 bps (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
; 1100 => 9600 bps (default from TELEMON)
; 1110 => 4800 bps
; 1010 => 2400 bps
; 1000 => 1200 bps
; 0111 => 600 bps
; 0110 => 300 bps
; 0101 => 150 bps
; 0010 => 75 bps
; 1110 => 4800 bps
; 1010 => 2400 bps
; 1000 => 1200 bps
; 0111 => 600 bps
; 0110 => 300 bps
; 0101 => 150 bps
; 0010 => 75 bps
; b4 : 0 external clock, 1 internal clock
; b6-b5 : 00 8 bits
; 01 7 bits
; 10 6 bits
; 11 5 bits
; b7 : 0 a stop
; b7 : 0 a stop
RS232T := $59
; RS232C
; RS232C
; b0-b3 : 0
; b4 : 1 if echo
; b5 : 1 if parity
@ -218,7 +218,7 @@ SCREEN := $BB80
; TELEMON primitives (2.4 & 3.x)
; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value'
; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value'
XOP0 = $00 ; Open device on channel 0
XOP1 = $01 ; Open device on channel 1
XOP2 = $02 ; Open device on channel 2
@ -249,10 +249,10 @@ XHIRES = $1A
XEFFHI = $1B ; Clear hires screen
XFILLM = $1C
XMINMA = $1F
XVARS = $24 ; Only in TELEMON 3.x, in TELEMON 2.4, it's XNOMFI ($24)
XVARS = $24 ; Only in Orix, in TELEMON 2.4, it's XNOMFI ($24)
XCRLF = $25 ; Jump a line and return to the beginning of the line
XDECAY = $26
XFREAD = $27 ; Only in TELEMON 3.x (bank 7 of Orix)
XFREAD = $27 ; Only in Orix
XBINDX = $28 ; Convert a number into hex and displays on channel 0
XDECIM = $29
XHEXA = $2A ; Convert a number into hex
@ -261,7 +261,7 @@ XEDT = $2D ; Launch editor
XINSER = $2E
XSCELG = $2F ; Search a line in editor mode
XOPEN = $30 ; Only in TELEMON 3.x (bank 7 of Orix)
XOPEN = $30 ; Only in Orix
XECRPR = $33 ; Displays prompt
XCOSCR = $34 ; Switch off cursor
XCSSCR = $35 ; Switch on cursor
@ -269,20 +269,20 @@ XSCRSE = $36
XSCROH = $37 ; Scroll up text screen
XSCROB = $38 ; Scroll down text screen
XSCRNE = $39 ; Load charset from rom to ram
XCLOSE = $3A ; Only in TELEMON 3.x close file (bank 7 of Orix)
XFWRITE = $3B ; Only in TELEMON 3.x write file (bank 7 of Orix)
XCLOSE = $3A ; Only in Orix close file
XFWRITE = $3B ; Only in Orix write file
; Clock primitive
XRECLK = $3C ; Reset clock
XCLCL = $3D ; Close clock
XWRCLK = $3E ; Displays clock in the adress in A & Y registers
XWRCLK = $3E ; Displays clock in the address in A & Y registers
; Sound primitives
XSONPS = $40 ; Send data to PSG register (14 values)
XOUPS = $42 ; Send Oups sound into PSG
XPLAY = $43 ; Play a sound
XSOUND = $44
XMUSIC = $45
XSOUND = $44
XMUSIC = $45
XZAP = $46 ; Send Zap sound to PSG
XSHOOT = $47
@ -291,30 +291,30 @@ XGETCWD = $48 ; Get current CWD
XPUTCWD = $49 ; Chdir
; File management
XMKDIR = $4B ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
XMKDIR = $4B ; Create a folder. Only available in Orix
XHCHRS = $4C ; Hard copy hires
; File management
XRM = $4D ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
XRM = $4D ; Remove a folder or a file. Only available in Orix
XFWR = $4E ; Put a char on the first screen. Only available in TELEMON 3.x (bank 7 of Orix)
XFWR = $4E ; Put a char on the first screen. Only available in Orix
; Keyboard primitives
XALLKB = $50 ; Read Keyboard, and populate KBDCOL
XKBDAS = $51 ; Ascii conversion
XGOKBD = $52 ; Swap keyboard type (Qwerty, French ...)
XGOKBD = $52 ; Swap keyboard type (Qwerty, French ...)
; Buffer management
XECRBU = $54 ; Write A or AY in the buffer
XLISBU = $55 ; Read A or AY in the buffer
XTSTBU = $56
XVIDBU = $57 ; Flush the buffer
XVIDBU = $57 ; Flush the buffer
XINIBU = $58 ; Initialize the buffer X
XDEFBU = $59 ; Reset all value of the buffer
XBUSY = $5A ; Test if the buffer is empty
XMALLOC = $5B ; Only in TELEMON 3.x (bank 7 of Orix)
XMALLOC = $5B ; Only in Orix
; RS232 primitives
XSDUMP = $5C ; RS232 input dump
@ -326,21 +326,23 @@ XSSAVE = $5F ; Write a file to RS232
XMLOAD = $60 ; Read a file from Minitel
XMSAVE = $61 ; Write a file to Minitel
XFREE = $62 ; Only in TELEMON 3.x (bank 7 of Orix)
XFREE = $62 ; Only in Orix
; Next Minitel primitives
XEXEC = $63 ; Only in Orix
; Next Minitel primitives
XWCXFI = $63 ; Wait connection
XLIGNE = $64 ;
XDECON = $65 ; Minitel disconnection
XMOUT = $66 ; Send a byte to minitel (from A)
XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 : if RS232 buffer is full, the Oric Telestrat freezes
XHRSSE = $8C ; Set hires position cursor
XDRAWA = $8D ; Draw a line absolute
XDRAWR = $8E ; Draw a line (relative)
XCIRCL = $8F ; Draw a circle
XCURSE = $90 ; Plot a pixel
XCURSE = $90 ; Plot a pixel
XCURMO = $91 ; Move to x,y pos in Hires
XPAPER = $92
XINK = $93
@ -358,8 +360,8 @@ XPING = $9D ; Send Ping sound to PSG
PWD_PTR = $00
; ---------------------------------------------------------------------------
;
BUFTRV := $100
;
BUFTRV := $100
; ---------------------------------------------------------------------------
@ -377,7 +379,7 @@ TIMES := $211
TIMEM := $212
TIMEH := $213
FLGCLK := $214
FLGCLK_FLAG := $215
FLGCLK_FLAG := $215
FLGCUR := $216 ; Cursor management flag
; screens position managements
@ -466,7 +468,7 @@ DESALO := $52D
FISALO := $52F
EXSALO := $531
EXTDEF := $55D ; Default extension. At the start of telemon, it's set to ".COM"
BUFEDT := $590 ; Buffer edition
BUFEDT := $590 ; Buffer edition
MAX_BUFEDT_LENGTH=110
@ -480,7 +482,7 @@ BUFBUF := $c080
; ---------------------------------------------------------------------------
; Stratsed vectors
; Stratsed is the main OS for Telestrat
; Stratsed is the main OS for Telestrat
XMERGE := $FF0E
XFST := $FF11
XSPUT := $FF14
@ -532,7 +534,7 @@ XPMAP := $FFA7
XRWTS := $FFAA
; ---------------------------------------------------------------------------
; MACRO
; MACRO
.macro BRK_TELEMON value
.byte $00,value

View File

@ -54,7 +54,7 @@ TGI_VF_CCOUNT = (TGI_VF_LASTCHAR - TGI_VF_FIRSTCHAR + 1)
; Font data loaded directly from file
.struct TGI_VECTORFONT
TOP .byte ; Height of char
BOTTOM .byte ; Descender
BOTTOM .byte ; Descender
HEIGHT .byte ; Maximum char height
WIDTHS .byte ::TGI_VF_CCOUNT ; Char widths
CHARS .word ::TGI_VF_CCOUNT ; Pointer to character defs

View File

@ -33,7 +33,7 @@
; Struct utsname
; Struct utsname
.struct utsname
sysname .byte 17
nodename .byte 9

View File

@ -12,7 +12,7 @@
.globalzp ptr1, ptr2, ptr3, ptr4
.globalzp tmp1, tmp2, tmp3, tmp4
.globalzp regbank
; The size of the register bank
regbanksize = 6

68
cfg/atari7800.cfg Normal file
View File

@ -0,0 +1,68 @@
# Atari VCS 7800 linker configuration file for cc65
# In order to add the a78 header to the build you can add
# "--force-import __EXEHDR__" to the command line
SYMBOLS {
__STACKSIZE__: type = weak, value = $0600; # C stack
__CARTSIZE__: type = weak, value = $8000;
__VEC_BOTTOM__: value = $fffa, type = export;
__VEC_SIZE__: value = $6, type = export;
__ENCRYPT_BOTTOM__: value = $ff7a, type = export;
__ENCRYPT_SIZE__: value = $80, type = export;
__MEMORY_TOP__: value = __ENCRYPT_BOTTOM__, type = export;
__INIT_SIZE__: value = 156, type = export;
__MEMORY_INIT__: value = __MEMORY_TOP__ - __INIT_SIZE__, type = export;
__MEMORY_BOTTOM__: value = $10000 - __CARTSIZE__, type = weak;
__FREE_ROM_SIZE__: value = __MEMORY_INIT__ - __MEMORY_BOTTOM__, type = export;
}
MEMORY {
ZP: file = "", define = yes, start = $0040, size = $00C0, type = rw;
SP: file = "", define = yes, start = $0140, size = $00C0, type = rw;
RAM1: file = "", define = yes, start = $1800, size = $0840, type = rw;
RAM2: file = "", define = yes, start = $2100, size = $0040, type = rw;
RAM3: file = "", define = yes, start = $2200, size = $0600, type = rw;
# For emulators you also need a header file
HEADER: file = %O, start = $0000, size = 128;
# "Normal" cartridge rom. Multiple banks arent supported
# by this script. You may change the rom size, but keep
# two things in mind:
# - start must be a multiple of $1000
# - ROM must end at $ff79
ROM: file = %O, define = yes, start = __MEMORY_BOTTOM__, size = __FREE_ROM_SIZE__, type = ro, fill = yes, fillval = $ff;
ROMS: file = %O, define = yes, start = __MEMORY_INIT__, size = __INIT_SIZE__, type = ro, fill = yes, fillval = $ff;
# Encryption stuff
ROME: file = %O, start = __ENCRYPT_BOTTOM__, size = __ENCRYPT_SIZE__, type = ro, fill = yes, fillval = $ff;
# Interrupt vectors
ROMV: file = %O, start = __VEC_BOTTOM__, size = __VEC_SIZE__, type = ro, fill = yes, fillval = $ff;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp;
EXEHDR: load = HEADER, type = ro, optional = yes;
STARTUP: load = ROMS, type = ro, define = yes;
ONCE: load = ROMS, type = ro, define = yes;
CODE: load = ROM, type = ro, define = yes;
RODATA: load = ROM, type = ro, define = yes, align = 256;
DATA: load = ROM, run = RAM1, type = rw, define = yes;
BSS: load = RAM1, type = bss, define = yes;
VECTORS: load = ROMV, type = ro, define = yes;
ENCRYPTION: load = ROME, type = ro define = yes;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = ONCE;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}

View File

@ -1,5 +1,3 @@
# Assembly configuration for R38
FEATURES {
STARTADDRESS: default = $0801;
}

View File

@ -29,7 +29,7 @@ MEMORY {
EXT: file = "", define = yes, start = $9000, size = $1000;
IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}

View File

@ -29,7 +29,7 @@ MEMORY {
EXT: file = "", define = yes, start = $9000, size = $1000;
IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}

View File

@ -29,7 +29,7 @@ MEMORY {
EXT: file = "", define = yes, start = $9000, size = $1000;
IO: file = "", define = yes, start = $A000, size = $1000;
RAE1: file = "", define = yes, start = $B000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $1000;
BASROM: file = "", define = yes, start = $C000, size = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}

View File

@ -46,7 +46,6 @@ clean:
$(RM) -r ../html ../info
install:
$(if $(PREFIX),,$(error variable "PREFIX" must be set))
ifeq ($(wildcard ../html),../html)
$(INSTALL) -d $(DESTDIR)$(htmldir)
$(INSTALL) -m0644 ../html/*.* $(DESTDIR)$(htmldir)

View File

@ -370,7 +370,7 @@ The names in the parentheses denote the symbols to be used for static linking of
In memory constrained situations the memory from &dollar;803 to &dollar;1FFF
can be made available to a program by calling <tt/_heapadd ((void *) 0x0803, 0x17FD);/
at the beginning of <tt/main()/. Doing so is beneficial even if the program
doesn't use the the heap explicitly because loading the driver (and in fact
doesn't use the heap explicitly because loading the driver (and in fact
already opening the driver file) uses the heap implicitly.
</descrip><p>

View File

@ -376,7 +376,7 @@ The names in the parentheses denote the symbols to be used for static linking of
In memory constrained situations the memory from &dollar;803 to &dollar;1FFF
can be made available to a program by calling <tt/_heapadd ((void *) 0x0803, 0x17FD);/
at the beginning of <tt/main()/. Doing so is beneficial even if the program
doesn't use the the heap explicitly because loading the driver (and in fact
doesn't use the heap explicitly because loading the driver (and in fact
already opening the driver file) uses the heap implicitly.
</descrip><p>

View File

@ -117,7 +117,7 @@ Special locations:
The startup code rearranges the memory as follows:
<enum>
<item>Sceen memory and display list are moved below the program start address.
<item>Screen memory and display list are moved below the program start address.
<item>The ROM is disabled, making the memory in the areas &lsqb;&dollar;C000-&dollar;CFFF&rsqb;
and &lsqb;&dollar;D800-&dollar;FFF9&rsqb; available.
<item>Character generator data is copied from ROM to the CHARGEN location specified in the

View File

@ -84,7 +84,7 @@ The names are the usual ones you can find in system reference manuals. Example:
tics = OS.rtclok[1] // get ticks
...
</verb></tscreen>
<sect1>Atari 5200 specific functions<p>
<itemize>
@ -221,7 +221,7 @@ you cannot use any of the following functions (and a few others):
<sect1>CAR format<p>
AtariROMMaker (<url url="https://www.wudsn.com/index.php/productions-atari800/tools/atarirommaker"> )
AtariROMMaker (<url url="https://www.wudsn.com/index.php/productions-atari800/tools/atarirommaker"> )
can be used to create a <tt/.CAR/ file from the binary ROM image cc65 generates.
This might be more convenient when working with emulators.

157
doc/atari7800.sgml Normal file
View File

@ -0,0 +1,157 @@
<!doctype linuxdoc system>
<article>
<title>Atari 7800 specific information for cc65
<author>
<url url="mailto:karri@sipo.fi" name="Karri Kaksonen"><newline>
<abstract>
An overview over the Atari 7800 runtime system as it is implemented
for the cc65 C compiler.
</abstract>
<!-- Table of contents -->
<toc>
<!-- Begin the document -->
<sect>Overview<p>
This file contains an overview of the Atari 7800 runtime system as it
comes with the cc65 C compiler. It describes the memory layout, Atari
7800 specific header files and any pitfalls specific to that platform.
<sect>Binary format<p>
The default binary output format generated by the linker for the Atari
7800 target is a 48K cartridge image.
<sect>A78 header<p>
There is lots of different cart hardware available for the atari7800.
Some carts have ROM, RAM, sound hardware, non-volatile high score chips.
In order to know what kind of hardware the cart build requires there is
a header file of 128 bytes in front of the binary.
The default build creates a cart file for a 48K rom cart without any
extra features like the pokey audio chip or extra RAM.
In order to make cc65 more user friendly the build will add the a78
header automatically. This allows you to run the binary on emulators
and flash carts on the real console.
<sect>Encryption<p>
In order to boot the game in a mode that supports atari7800 functions
the cart must be encrypted after the linking phase.
There is a program called sign7800 that can be used to sign the cart.
The encryption is not required for running the cart on emulators.
You can also run atari2600 games without encryption.
<sect>Memory layout<p>
cc65 generated programs with the default setup can use RAM from
from &dollar;1800 to &dollar;203f.
The 4k RAM is then mapped to zero page area.
&dollar;2040 to &dollar;20ff is visible as zero page.
After that we have a vero small RAM area that is unused.
&dollar;2100 to &dollar;213f.
Then we mirror a second block from the RAM to become the hardware stack.
This would be from &dollar;2140 to &dollar;21ff.
The C-stack starts at &dollar;2800 and it can grow down to &dollar;2200.
size of the system stack can be customized by defining the
__STACKSIZE__ linker variable.
Special locations:
<descrip>
<tag/Stack/ The C runtime stack is located at &dollar;2800 -
__STACKSIZE__ and growing downwards.
<tag/Heap/ The C heap is located at &dollar;2200 and grows upwards.
</descrip><p>
<sect>Start-up condition<p>
When powered-up, the Atari 7800 TIA registers contain random
values. During the initialization phase, the start-up code needs to
initialize the TIA registers to sound values (or else the console has
an unpredictable behavior). In this implementation, zeros are written
to all of TIA registers during the start-up phase.
Note that RIOT registers (mostly timers) are left uninitialized, as
they don't have any consequence on the console behavior.
<sect>Platform specific header files<p>
Programs containing Atari 7800 specific code may use the
<tt/atari7800.h/ header file.
The following pseudo variables declared in the <tt/atari7800.h/ header
file allow access to the Atari 7800 TIA, MARIA & RIOT chips registers.
<descrip>
<tag><tt/TIA/</tag> The <tt/TIA/ structure allows read/write access
to the Atari 7800 TIA chip registers. See the <tt/_tia.h/ header
file located in the include directory for the declaration of the
structure. Also refer to the Stella Programmer's Guide by Steve
Wright for a detailed description of the chip and its registers.
<tag><tt/RIOT/</tag> The <tt/RIOT/ structure allows read/write
access to the Atari 7800 RIOT chip registers. See the
<tt/_riot.h/ header file located in the include directory for the
declaration of the structure. Also refer to the Stella Programmer's
Guide by Steve Wright for a detailed description of the chip and its
registers.
<tag><tt/MARIA/</tag> The <tt/MARIA/ structure allows read/write
access to the Atari 7800 MARIA chip registers. See the
<tt/_maria.h/ header file located in the include directory for the
declaration of the structure.
</descrip><p>
<sect>Loadable drivers<p>
There are no drivers for the Atari 7800.
<sect>Limitations<p>
TBD
<sect>Other hints<p>
One may write a custom linker configuration file to tune the memory
layout of a program. See the <tt/atari7800.cfg/ file in the cfg
directory as a starting point.
<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>

View File

@ -126,7 +126,7 @@ and &dollar;FF3F.
In memory constrained situations the memory from &dollar;400 to &dollar;7FF
can be made available to a program by calling <tt/_heapadd ((void *) 0x0400, 0x0400);/
at the beginning of <tt/main()/. Doing so is beneficial even if the program
doesn't use the the heap explicitly because loading a driver uses the heap implicitly.
doesn't use the heap explicitly because loading a driver uses the heap implicitly.
Using <tt/c64-soft80.o/ is as simple as placing it on the linker command
line like this:

View File

@ -3108,7 +3108,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
<sect1><tt>.IFDEF</tt><label id=".IFDEF"><p>
Conditional assembly: Check if a symbol is defined. Must be followed by
a symbol name. The condition is true if the the given symbol is already
a symbol name. The condition is true if the given symbol is already
defined, and false otherwise.
See also: <tt><ref id=".DEFINED" name=".DEFINED"></tt>
@ -3143,7 +3143,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
<sect1><tt>.IFNDEF</tt><label id=".IFNDEF"><p>
Conditional assembly: Check if a symbol is defined. Must be followed by
a symbol name. The condition is true if the the given symbol is not
a symbol name. The condition is true if the given symbol is not
defined, and false otherwise.
See also: <tt><ref id=".DEFINED" name=".DEFINED"></tt>
@ -3152,7 +3152,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
<sect1><tt>.IFNREF</tt><label id=".IFNREF"><p>
Conditional assembly: Check if a symbol is referenced. Must be followed
by a symbol name. The condition is true if if the the given symbol was
by a symbol name. The condition is true if the given symbol was
not referenced before, and false otherwise.
See also: <tt><ref id=".REFERENCED" name=".REFERENCED"></tt>
@ -3197,7 +3197,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".CHARMAP" name=".CH
<sect1><tt>.IFREF</tt><label id=".IFREF"><p>
Conditional assembly: Check if a symbol is referenced. Must be followed
by a symbol name. The condition is true if if the the given symbol was
by a symbol name. The condition is true if the given symbol was
referenced before, and false otherwise.
This command may be used to build subroutine libraries in include files
@ -3622,7 +3622,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
<sect1><tt>.PDTV</tt><label id=".PDTV"><p>
Enable the 6502DTV instruction set. This is a superset of the 6502
Enable the 6502DTV instruction set. This is a superset of the 6502
instruction set.
See: <tt><ref id=".P02" name=".P02"></tt>
@ -3724,7 +3724,7 @@ See: <tt><ref id=".ASCIIZ" name=".ASCIIZ"></tt>,<tt><ref id=".BYTE" name=".BYTE"
<tt/.PUSHCHARMAP/ allows together with <tt><ref id=".POPCHARMAP"
name=".POPCHARMAP"></tt> to switch to another character mapping and to restore the old
characther mapping later, without knowledge of the current mapping.
character mapping later, without knowledge of the current mapping.
The assembler will print an error message if the character mapping stack is already full,
when this command is issued.
@ -4763,6 +4763,7 @@ compiler, depending on the target system selected:
<item><tt/__APPLE2ENH__/ - Target system is <tt/apple2enh/
<item><tt/__ATARI2600__/ - Target system is <tt/atari2600/
<item><tt/__ATARI5200__/ - Target system is <tt/atari5200/
<item><tt/__ATARI7800__/ - Target system is <tt/atari7800/
<item><tt/__ATARI__/ - Target system is <tt/atari/ or <tt/atarixl/
<item><tt/__ATARIXL__/ - Target system is <tt/atarixl/
<item><tt/__ATMOS__/ - Target system is <tt/atmos/

View File

@ -198,6 +198,189 @@ Here is a description of all the command line options:
Enables debug mode, for debugging the behavior of cc65.
<tag><tt>--debug-tables name</tt></tag>
Writes symbol table information to a file, which includes details on structs, unions
functions, and global variables. For example, given the following code:
<tscreen><verb>
struct l {
unsigned char m;
unsigned char n;
};
struct hello {
unsigned char j;
unsigned char k;
struct l l;
};
struct sub {
unsigned char x;
unsigned char y;
};
union xy {
struct sub xy;
unsigned int mem;
};
typedef struct hello thingy;
unsigned char single;
unsigned char test_local_vars_main(void) {
static unsigned char wahoo;
static unsigned char bonanza = 0x42;
unsigned char i;
unsigned int j;
unsigned int *random;
unsigned char *lol;
signed char whoa;
struct hello wow;
thingy *cool;
union xy xy;
return 0;
}
</verb></tscreen>
The following output would be produced:
<tscreen><verb>
SC_FUNC: _test_local_vars_main: Symbol table
============================================
__fixargs__:
Flags: SC_CONST SC_DEF
Type: unsigned int
__argsize__:
Flags: SC_CONST SC_DEF
Type: unsigned char
wahoo:
AsmName: M0001
Flags: SC_STATIC SC_DEF SC_REF
Type: unsigned char
bonanza:
AsmName: M0002
Flags: SC_STATIC SC_DEF SC_REF
Type: unsigned char
i:
Flags: SC_AUTO SC_DEF SC_REF
Type: unsigned char
j:
Flags: SC_AUTO SC_DEF SC_REF
Type: unsigned int
random:
Flags: SC_AUTO SC_DEF SC_REF
Type: unsigned int *
lol:
Flags: SC_AUTO SC_DEF SC_REF
Type: unsigned char *
whoa:
Flags: SC_AUTO SC_DEF SC_REF
Type: signed char
wow:
Flags: SC_AUTO SC_DEF SC_REF
Type: struct hello
cool:
Flags: SC_AUTO SC_DEF SC_REF
Type: struct hello *
xy:
Flags: SC_AUTO SC_DEF SC_REF
Type: union xy
Global symbol table
===================
thingy:
AsmName: _thingy
Flags: SC_TYPEDEF 0x100000
Type: struct hello
single:
AsmName: _single
Flags: SC_STATIC SC_EXTERN SC_STORAGE SC_DEF SC_REF 0x100000
Type: unsigned char
test_local_vars_main:
AsmName: _test_local_vars_main
Flags: SC_FUNC SC_STATIC SC_EXTERN SC_DEF 0x100000
Type: unsigned char (void)
Global tag table
================
l:
Flags: SC_STRUCT SC_DEF
Type: (none)
hello:
Flags: SC_STRUCT SC_DEF
Type: (none)
sub:
Flags: SC_STRUCT SC_DEF
Type: (none)
xy:
Flags: SC_UNION SC_DEF
Type: (none)
Global struct and union definitions
=========================
SC_STRUCT: l
============
m:
Flags: SC_STRUCTFIELD
Type: unsigned char
n:
Flags: SC_STRUCTFIELD
Type: unsigned char
SC_STRUCT: hello
================
j:
Flags: SC_STRUCTFIELD
Type: unsigned char
k:
Flags: SC_STRUCTFIELD
Type: unsigned char
l:
Flags: SC_STRUCTFIELD
Type: struct l
SC_STRUCT: sub
==============
x:
Flags: SC_STRUCTFIELD
Type: unsigned char
y:
Flags: SC_STRUCTFIELD
Type: unsigned char
SC_UNION: xy
============
xy:
Flags: SC_STRUCTFIELD
Type: struct sub
mem:
Flags: SC_STRUCTFIELD
Type: unsigned int
</verb></tscreen>
<tag><tt>--debug-opt name</tt></tag>
The named file contains a list of specific optimization steps to enable or disable.
@ -919,8 +1102,20 @@ The compiler defines several macros at startup:
<tag><tt>__CC65__</tt></tag>
This macro is always defined. Its value is the version number of the
compiler in hex. For example, version 2.14 of the compiler has this macro
defined as <tt/0x02E0/.
compiler in hex: <tt>(VER_MAJOR * 0x100) + VER_MINOR</tt>. The upper 8 bits
are the major-, the lower 8 bits are the minor version. For example, version
47.11 of the compiler would have this macro defined as <tt/0x2f0b/.
Note: until 2.19 this macro was defined as <tt>(VER_MAJOR * 0x100) + VER_MINOR * 0x10</tt> -
which resulted in broken values starting at version 2.16 of the compiler. For
this reason the value of this macro is considered purely informal - you should
not use it to check for a specific compiler version and use different code
according to the detected version - please update your code to work with the
recent version of the compiler instead (There is very little reason to not use
the most recent version - and even less to support older versions in your code).
Should you still insist on doing this for some reason - look at <tt>checkversion.c</tt>
in the samples directory for some preprocessor kludges that might help.
<tag><tt>__CC65_STD__</tt></tag>
@ -1673,7 +1868,7 @@ This is the original compiler copyright:
Anyone may copy or redistribute these programs, provided that:
1: You don't charge anything for the copy. It is permissable to
1: You don't charge anything for the copy. It is permissible to
charge a nominal fee for media, etc.
2: All source code and documentation for the programs is made

View File

@ -200,15 +200,23 @@ access to hardware located in the address space. Some variables are
structures, accessing the struct fields will access the chip registers.
<descrip>
<tag><tt/VERA/</tag>
The <tt/VERA/ structure allows access
to the Video Enhanced Retro Adapter chip.
<tag><tt/RAM_BANK/</tag>
A register that controls which bank of high RAM is visible in the
<tt/BANK_RAM/ window.
<tag><tt/ROM_BANK/</tag>
A register that controls which bank of ROM is active at the moment.
<tag><tt/VIA1, VIA2/</tag>
Access to the two VIA (Versatile Interface Adapter) chips is available via
the <tt/VIA1/ and <tt/VIA2/ variables. The structure behind those variables
is explained in <tt/_6522.h/.
<tag><tt/VERA/</tag>
The <tt/VERA/ structure allows access
to the Video Enhanced Retro Adapter chip.
<tag><tt/BANK_RAM/</tag>
A character array that mirrors the eight-Kibibyte window, at &dollar;A000,
into banked RAM.
@ -219,7 +227,7 @@ structures, accessing the struct fields will access the chip registers.
<sect>Loadable drivers<p>
The names in the parentheses denote the symbols to be used for static linking
of the drivers. The names fit into the 8.3 character limit of the SD-Card's
of the drivers. The names fit into the old 8.3-character limit of the SD-Card's
FAT32 file-system.
@ -230,7 +238,7 @@ point to <tt/cx320p1.tgi (cx320p1_tgi)/.
<descrip>
<tag><tt/cx320p1.tgi (cx320p1_tgi)/</tag>
This driver features a resolution of 320 across and 200 down with 256 colors,
This driver features a resolution of 320 across and 240 down with 256 colors,
and a slightly adjustable palette (the order of the colors can be changed in
a way that's compatible with some of the other color drivers).
</descrip><p>
@ -248,10 +256,10 @@ point to <tt/cx16-std.joy (cx16_std_joy)/.
<descrip>
<tag><tt/cx16-std.joy (cx16_std_joy)/</tag>
Supports up to two NES (and SNES) controllers connected to the joystick ports
of the CX16. It reads the four directions, and the <bf/A/, <bf/B/,
<bf/Select/, and <bf/Start/ buttons. Buttons <bf/A/ and <bf/B/ are
the first and second fire buttons.
Supports the keyboard emulation of a controller and up to four SNES (and NES)
controllers connected to the joystick ports of the CX16. It reads the four
directions, and the <bf/A/, <bf/B/, <bf/Select/, and <bf/Start/ buttons.
Buttons <bf/A/ and <bf/B/ are the first and second fire buttons.
</descrip><p>

View File

@ -119,9 +119,9 @@ Here is a description of all the command line options:
<item>4510
</itemize>
6502x is for the NMOS 6502 with unofficial opcodes. 6502dtv is for the
emulated CPU of the C64DTV device. huc6280 is the CPU of the PC engine.
4510 is the CPU of the Commodore C65. Support for the 65816 currently
6502x is for the NMOS 6502 with unofficial opcodes. 6502dtv is for the
emulated CPU of the C64DTV device. huc6280 is the CPU of the PC engine.
4510 is the CPU of the Commodore C65. Support for the 65816 currently
is not available.
@ -253,8 +253,8 @@ for this CPU. Invalid opcodes are translated into <tt/.byte/ commands.
With the command line option <tt><ref id="option--cpu" name="--cpu"></tt>, the
disassembler may be told to recognize either the 65SC02 or 65C02 CPUs. The
latter understands the same opcodes as the former, plus 16 additional bit
manipulation and bit test-and-branch commands. Using 6502x as CPU the illegal
opcodes of 6502 CPU are detected and displayed. 6502dtv setting recognizes the
manipulation and bit test-and-branch commands. Using 6502x as CPU the illegal
opcodes of 6502 CPU are detected and displayed. 6502dtv setting recognizes the
emulated CPU instructons of the C64DTV device.

View File

@ -16,7 +16,7 @@ How to debug your code using the VICE and Oricutron emulators.
<sect>Overview<p>
This document describes how to debug your programs using the cc65 development
tools and the VICE CBM emulator.
tools and the VICE or Oricutron emulator.
@ -126,6 +126,12 @@ and you may use them wherever you need to specify an address. Try
as an example (note that VICE needs a leading dot before all labels, and that
the compiler prepends an underline under most named labels).
If you start the emulator from the commandline, you can also load the labels
directly using something like this:
<tscreen><verb>
x64sc -moncommands hello.lbl hello.prg
</verb></tscreen>
<sect>How to use the label file with Oricutron<p>
@ -144,8 +150,7 @@ and you may use them wherever you need to specify an address. Try
d ._main
</verb></tscreen>
as an example (note that VICE needs a leading dot before all labels, and that
the compiler prepends an underline under most named labels).
as an example.

View File

@ -754,6 +754,16 @@ communication, see also <tt>testcode/lib/ser-test.c</tt>.
</itemize>
<sect1><tt/sym1.h/<label id="sym1.h"><p>
<itemize>
<item><ref id="beep" name="beep">
<item><ref id="fdisp" name="fdisp">
<item><ref id="loadt" name="loadt">
<item><ref id="dumpt" name="dumpt">
</itemize>
<sect1><tt/telestrat.h/<label id="telestrat.h"><p>
<itemize>
@ -1669,6 +1679,27 @@ used in presence of a prototype.
</quote>
<sect1>beep<label id="beep"><p>
<quote>
<descrip>
<tag/Function/Beep sound.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/void beep(void);/
<tag/Description/<tt/beep/ makes a brief tone.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="fdisp" name="fdisp">,
<ref id="loadt" name="loadt">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>
<sect1>bgcolor<label id="bgcolor"><p>
<quote>
@ -3363,6 +3394,30 @@ int main(void)
</quote>
<sect1>dumpt<label id="dumpt"><p>
<quote>
<descrip>
<tag/Function/Dump memory to tape.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/int __fastcall__ dumpt (unsigned char id, const void* start, const void* end);/
<tag/Description/<tt/dumpt/ saves memory onto data tape.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The return value is status. Non-zero status indicates an error.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="fdisp" name="fdisp">,
<ref id="loadt" name="loadt">,
<tag/Example/None.
</descrip>
</quote>
<sect1>em_commit<label id="em_commit"><p>
<quote>
@ -3513,7 +3568,7 @@ extended memory that should be supported. There is no autodetect capability.
<tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
<tag/Description/The function maps one page of extended memory into linear
memory and returns a pointer to the page frame. Depending on the hardware
and driver, the data is either mapped into the address space or transfered
and driver, the data is either mapped into the address space or transferred
into a buffer. If you don't need the actual contents of the page (for example
because you're going to overwrite it completely), it is better to call
<tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
@ -3721,6 +3776,28 @@ switching the CPU into double clock mode.
</quote>
<sect1>fdisp<label id="fdisp"><p>
<quote>
<descrip>
<tag/Function/Flash front-panel display.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/void fdisp(void);/
<tag/Description/<tt/fdisp/ flashes front-panel display.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The front-panel display buffer must be loaded prior to calling fdisp. See the DISPLAY struct definition in sym1.h.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="loadt" name="loadt">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>
<sect1>feof<label id="feof"><p>
<quote>
@ -3728,7 +3805,7 @@ switching the CPU into double clock mode.
<tag/Function/Return the end-of-file indicator of a stream.
<tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
<tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
<tag/Description/<tt/feof/ tests the end-of-file indicator ofthe stream
<tag/Description/<tt/feof/ tests the end-of-file indicator of the stream
<tt/f/, and returns a non zero value if it is set.
<tag/Notes/<itemize>
<item>The indicator is set only after a read past the end of a file is
@ -4172,7 +4249,7 @@ const char* optstring);/
is a string that contains command line option characters. If a character in
<tt/optstring/ is followed by a colon, the option requires an argument. An
option on the command line is recognized if it is one of the option characters
preceeded by a '-'.
preceded by a '-'.
<tt/getopt/ must be called repeatedly. It will return each option character
found on the command line and <tt/EOF/ (-1) if there is no other option. An
option argument is placed in <tt/optarg/, the index of the next element on the
@ -4961,6 +5038,30 @@ used in presence of a prototype.
</quote>
<sect1>loadt<label id="loadt"><p>
<quote>
<descrip>
<tag/Function/Load memory from tape.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Declaration/<tt/int __fastcall__ loadt (unsigned char id);/
<tag/Description/<tt/loadt/ loads memory from data tape.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The return value is status. Non-zero status indicates an error.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
<tag/Availability/cc65
<tag/See also/
<ref id="beep" name="beep">,
<ref id="fdisp" name="fdisp">,
<ref id="dumpt" name="dumpt">,
<tag/Example/None.
</descrip>
</quote>
<sect1>ltoa<label id="ltoa"><p>
<quote>
@ -5020,7 +5121,7 @@ always be the same.
<tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
<tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
<tag/Description/The <tt/longjmp/ function restores a program context from the
data in <tt/buf/, which must have been set by a preceeding call to
data in <tt/buf/, which must have been set by a preceding call to
<tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
<tt/retval/.
@ -5664,7 +5765,7 @@ cc65 allows to pass this argument, it is ignored.
<tag/Function/Open a directory.
<tag/Header/<tt/<ref id="dirent.h" name="dirent.h">/
<tag/Declaration/<tt/DIR* __fastcall__ opendir (const char* name);/
<tag/Description/<tt/opendir/ opens a directory and returns the direcory
<tag/Description/<tt/opendir/ opens a directory and returns the directory
descriptor associated with it. On error, NULL is returned and an error code is
stored in <tt/errno/.
<tag/Notes/<itemize>
@ -6026,7 +6127,7 @@ pointer you're passing somewhere else, otherwise
<tscreen><verb>
ptr = realloc (ptr, size);
</verb></tscreen>
will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
will lose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
</itemize>
@ -6863,7 +6964,7 @@ be used in presence of a prototype.
<quote>
<descrip>
<tag/Function/Concatentate two strings.
<tag/Function/Concatenate two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
<tag/Description/The <tt/strcat/ function appends a copy of the string
@ -7189,7 +7290,7 @@ be used in presence of a prototype.
<quote>
<descrip>
<tag/Function/Concatentate two strings.
<tag/Function/Concatenate two strings.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
<tag/Description/The <tt/strncat/ function appends not more than n characters
@ -7314,7 +7415,7 @@ be used in presence of a prototype.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strpbrk (const char* str, const char* set);/
<tag/Description/<tt/strpbrk()/ searches within <tt/str/ for the first
occurance of any character from <tt/set/. It returns a pointer to that
occurrence of any character from <tt/set/. It returns a pointer to that
character if found; otherwise, it returns <tt/NULL/.
<tag/Notes/<itemize>
<item>The function is available only as a fastcall function;
@ -7418,7 +7519,7 @@ be used in presence of a prototype.
<tag/Function/Find a substring.
<tag/Header/<tt/<ref id="string.h" name="string.h">/
<tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
<tag/Description/<tt/strstr/ searches for the first occurance of the string
<tag/Description/<tt/strstr/ searches for the first occurrence of the string
<tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
otherwise it returns <tt/NULL/.
<tag/Notes/<itemize>
@ -7485,7 +7586,7 @@ the behaviour is undefined.
<item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
<item>The function is only available as fastcall function, so it may only
be used in presence of a prototype.
<item>Since cc65 doesn't support different charcter sets, <tt/strxfrm/ will
<item>Since cc65 doesn't support different character sets, <tt/strxfrm/ will
just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
</itemize>
<tag/Availability/ISO 9899

View File

@ -1332,7 +1332,7 @@ This function returns the GEOS Kernal version combined (by logical OR) with the
<p>
This function returns the PAL/NTSC flag combined (by logical OR) with the 40/80 columns flag. This is
not the best way to check if the screen has 40 or 80 columns since a PAL/NTSC check is always
performed and it can take as long as a full raster frame. If you just want to know if the
performed and it can take as long as a full raster frame. If you just want to know if the
screen has 40 or 80 columns use the expression <tt/graphMode & 0x80/ which returns <tt/0/ for
40 columns and <tt/0x80/ for 80 columns. Remember that this value can be changed during
runtime. It is unclear if this will work for GEOS 64 so you probably do not want to test

View File

@ -124,6 +124,9 @@
<tag><htmlurl url="atari5200.html" name="atari5200.html"></tag>
Topics specific to the Atari 5200 Game Console.
<tag><htmlurl url="atari7800.html" name="atari7800.html"></tag>
Topics specific to the Atari 7800 Game Console.
<tag><htmlurl url="atmos.html" name="atmos.html"></tag>
Topics specific to the Oric Atmos.

View File

@ -410,7 +410,7 @@ Available at <url
url="https://github.com/commanderx16/x16-emulator/releases">:
Emulates the Commander X16 Single Board Computer, with sound, SD card images,
VGA and NTSC video, and a NES game controller emulation. Includes a monitor.
VGA and NTSC video, and a NES game controller emulation. Includes a monitor.
It runs on all SDL2 platforms.
Compile the tutorial with
@ -459,7 +459,7 @@ Substitute the name of a Commodore computer for that <tt/&lt;sys&gt;/:
Start the desired version of the emulator (CBM610 programs run on
the CBM II &lsqb;<tt/xcbm2/&rsqb; emulator).
Choose <bf>File&gt;Autostart disk/tape image...</bf>, choose your executable,
Choose <bf>File&gt;Autostart disk/tape image...</bf>, choose your executable,
and click <bf/OK/.
The file has a 14-byte header which corresponds to a PRG-format BASIC program,
@ -500,7 +500,7 @@ prompt.
Before you can run the cartridge image produced by the linker, the binary has to
be patched using the <bf/gamate-fixcart/ tool that is included in the cc65
package in the util/gamata directory.
package in the util/gamate/ directory.
<tscreen><verb>
gamate-fixcart <image.bin>

View File

@ -166,6 +166,7 @@ Here is a description of all of the command-line options:
<item>apple2
<item>apple2enh
<item>atari2600
<item>atari7800
<item>atari
<item>atarixl
<item>atmos

View File

@ -36,7 +36,7 @@ Here is a small traditional Hello World program for the Atari Lynx.
<tscreen><verb>
#include <lynx.h>
#include <tgi.h>
#include <6502.h>
#include <6502.h>
void main(void) {
tgi_install(tgi_static_stddrv);

View File

@ -112,7 +112,7 @@ For a C test compiled and linked with <tt/--target sim6502/ the
command line arguments to <tt/sim65/ will be passed to <tt/main/,
and the return value from <tt/main/ will become sim65's exit code.
The <tt/exit/ function may also be used to terminate with an exit code.
Exit codes are limited to 8 bits.
The standard C library high level file input and output is functional.

View File

@ -257,7 +257,7 @@ SMC LoadDefault, { LDX #25 }
<label id="Load value">
<tag><tt>SMC_LoadValue label (, register)</tt></tag>
Retreives the value of a SMC line.
Retrieves the value of a SMC line.
Example:
<tscreen><verb>

View File

@ -15,21 +15,40 @@ An overview over the Sym-1 runtime system as it is implemented for the cc65 C co
<sect>Overview<p>
This file contains an overview of the Sym-1 runtime system as it comes with the cc65 C compiler. It describes the memory layout, Sym-1 specific header files, available drivers, and any pitfalls specific to the platform.
This file contains an overview of the Sym-1 runtime system as it comes with the cc65 C compiler.
It describes the memory layout, Sym-1 specific header files, available drivers, and any pitfalls
specific to the platform.
Please note that Sym-1 specific functions are just mentioned here, they are 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.
Please note that Sym-1 specific functions are just mentioned here, they are described in detail
in the separate <url url="funcref.html" name="function reference">. Even functions marked as
&quot;platform dependent&quot; may be available on more than one platform. Please see the
function reference for more information.
<sect>Binary format<p>
The output format generated by the linker for the Sym-1 target is a raw binary BIN file, which is essentially a memory image. You can convert this to a HEX file using BIN2HEX, which is a popular open-source conversion utility program. A HEX file has ASCII representations of the hexadecimal byte values of the machine-language program. So the HEX file can be transferred to the Sym-1 using the RS-232 terminal port, just as if the machine-code was entered by hand. Enter 'm 200' in the monitor and start the HEX file transfer.
The output format generated by the linker for the Sym-1 target is a raw binary BIN file, which
is essentially a memory image. You can convert this to a HEX file using BIN2HEX, which is a
popular open-source conversion utility program. A HEX file has ASCII representations of the
hexadecimal byte values of the machine-language program. So the HEX file can be transferred
to the Sym-1 using the RS-232 terminal port, just as if the machine-code was entered by hand.
Enter 'm 200' in the monitor and start the HEX file transfer.
<p>
Included with this distribution is a 4k configuration file and a 32k config file. The Sym-1 on-board memory is limited to 4 kbytes but system memory can be increased to 32 kbytes of contiguous RAM with aftermarket add-on boards. So choose the config file that matches your system configuration before compiling and linking user programs.
Included with this distribution is a 4k configuration file and a 32k config file. The Sym-1
on-board memory is limited to 4 kbytes but system memory can be increased to 32 kbytes of
contiguous RAM with aftermarket add-on boards. So choose the config file that matches your
system configuration before compiling and linking user programs.
<sect>Memory layout<p>
The ROMs and I/O areas are defined in the configuration files, as are most of the entry points for useful subroutines in the Sym-1 monitor ROM. cc65 generated programs compiled and linked using 4k config run in the memory range of &dollar;200 - &dollar;0FFF. The 32k config expands this range to &dollar;7FFF. The starting memory location and entry point for running the program is &dollar;200, so when the program is transferred to the Sym-1, it is executed by typing 'g 200'. The system returns control back to the monitor ROM when the program terminates, providing the '.' prompt.
The ROMs and I/O areas are defined in the configuration files, as are most of the entry points
for useful subroutines in the Sym-1 monitor ROM. cc65 generated programs compiled and linked
using 4k config run in the memory range of &dollar;200 - &dollar;0FFF. The 32k config expands
this range to &dollar;7FFF. Memory above 32k can be used to extend the heap, as described below.
The starting memory location and entry point for running the program is &dollar;200, so when the
program is transferred to the Sym-1, it is executed by typing 'g 200'. The system returns control
back to the monitor ROM when the program terminates, providing the '.' prompt.
Special locations:
@ -38,10 +57,12 @@ Special locations:
Conio support is not currently available for the Sym-1. But stdio console functions are available.
<tag/Stack/
The C runtime stack is located at &dollar;0FFF on 4KB Syms, or at &dollar;7FFFfor 32KB systems. The stack always grows downwards.
The C runtime stack is located at &dollar;0FFF on 4kb Syms, or at &dollar;7FFF for 32kb systems.
The stack always grows downwards.
<tag/Heap/
The C heap is located at the end of the program and grows towards the C runtime stack.
The C heap is located at the end of the program and grows towards the C runtime stack. Extended
memory can be added to the heap, as described below.
</descrip><p>
@ -51,7 +72,8 @@ Programs containing Sym-1 code may use the <tt/sym1.h/ header file. See the hea
<sect1>Hardware access<p>
The pseudo variables declared in the <tt/sym1.inc/ include file allow access to hardware located in the address space. See the include file for more information.
The pseudo variables declared in the <tt/sym1.inc/ include file allow access to hardware located in the
address space. See the include file for more information.
<sect>Loadable drivers<p>
@ -61,7 +83,9 @@ No graphics drivers are currently available for the Sym-1.
<sect1>Extended memory drivers<p>
No extended memory drivers are currently available for the Sym-1.
There are no extended memory drivers for the Sym-1. However, there is a way to access memory beyond the
32kb boundary, if extended memory is physically present in the system. See the example program,
symExtendedMemory, in the samples directory.
<sect1>Joystick drivers<p>
@ -73,7 +97,8 @@ No mouse drivers are currently available for the Sym-1.
<sect1>RS232 device drivers<p>
No communication port drivers are currently available for the Sym-1. It has only the &quot;master console&quot; e.g. stdin and stdout.
No communication port drivers are currently available for the Sym-1. It has only the &quot;master console&quot;
e.g. stdin and stdout.
<sect>Limitations<p>
@ -94,29 +119,45 @@ To be more specific, this limitation means that you cannot use any of the follow
<sect>Other hints<p>
<sect1>sym1.h<p>
This header exposes Sym-specific I/O functions that are useful for reading and writing its ports and front panel. See the <tt/sym1.h/ include file for a list of the functions available.
This header exposes Sym-specific I/O functions that are useful for reading and writing its ports and front panel.
See the <tt/sym1.h/ include file for a list of the functions available.
<sect2>Limited memory applications<p>
As stated earlier, there are config files for 4KB and 32KB systems. If you have 32KB RAM, then you will probably want to use the sym1-32k configuration, but if not - if you are using the sym1-4k configuration - then you may want to use functions like getchar, putchar, gets and puts rather than functions like scanf and printf. Printf, for example, requires about 1KB because it needs to know how to process all the format specifiers.
As stated earlier, there are config files for 4kb and 32kb systems. If you have 32kb RAM, then you will probably
want to use the sym1-32k configuration, but if not - if you are using the sym1-4k configuration - then you may
want to use functions like getchar, putchar, gets and puts rather than functions like scanf and printf.
Printf, for example, requires about 1KB because it needs to know how to process all the format specifiers.
<sect3>Sample programs<p>
<sect3>Using extended memory<p>
All the samples will run on the &quot;stock&quot; 4KB Sym-1, except for symIO and symNotepad, which require 32KB. These sample programs can be found in the targettest/sym1 directory:
Memory may be physically present that is addressed at locations above the monitor ROM at $8000. This extended
memory is accessible by adding to the heap, as described in the symExtendedMemory sample program.
<sect4>Sample programs<p>
All the samples will run on the &quot;stock&quot; 4kb Sym-1, except for symIO and symNotepad, which require 32kb.
Additionally, symExtendedMemory shows how to access memory above 32kb, so it expects more than 32kb.
These sample programs can be found in the samples/sym1 directory:
<itemize>
<item>symHello prints &quot;Hello World!&quot; and then inputs characters, which are echoed on the screen. It also makes a &quot;beep&quot; sound.</item>
<item>symTiny does the same as symHello, but does it with puts() rather than printf() to show the difference in compiled binary size.</item>
<item>symHello prints &quot;Hello World!&quot; and then inputs characters, which are echoed on the screen.
It also makes a &quot;beep&quot; sound.</item>
<item>symTiny does the same as symHello, but does it with puts() rather than printf() to show the difference
in compiled binary size.</item>
<item>symDisplay allows entry of a message, which is then displayed by scrolling it across the front panel display.</item>
<item>symIO allows access to the Sym-1 digital I/O ports.</item>
<item>symNotepad is a simple text entry/retrieval program that uses tape storage.</item>
<item>symExtendedMemory demonstrates how to access upper-memory and add it to the heap.</item>
</itemize>
<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.
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:
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

View File

@ -79,7 +79,7 @@ in Telemon, there is no way to load a binary easily.
Stratsed (the Telestrat operating system) handles files management. Stratsed
is loaded to memory from floppy disk. Stratsed vector are declared in asminc/telestrat.inc.
But, reverse engineering is required to find how theses vectors works. Please, note that
But, reverse engineering is required to find how these vectors works. Please, note that
Stratsed is located in overlay memory (bank 0)
There is no tool to insert a binary in a Stratsed floppy disk.
@ -192,9 +192,9 @@ port cardridge.
Telemon 2.4 returns in keyboard buffer the direction of the joysticks. This means that
if you get input from keyboard by conio cgetc function, you will get direction from joysticks.
Anyway, if you don't want to use ROM, you can use joysticks standard drivers in your code.
Anyway, if you don't want to use ROM, you can use joysticks standard drivers in your code.
The standard driver manages two joysticks. Only one button is managed for theses joysticks.
The standard driver manages two joysticks. Only one button is managed for these joysticks.
Telestrat can handle one button for the left port, and three buttons for the right port (but this port was designed for a mouse).
@ -217,7 +217,7 @@ RS232 port with Telemon calls (see XSOUT primitive for example)
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. 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,
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).
<itemize>
@ -227,10 +227,10 @@ Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread, fclose).
</itemize>
<sect1>conio<p>
Functions textcolor and bgcolor are available only with Telemon 3.0 (Orix).
Telemon 2.4 primitives can't handle any change of colors in text mode except with XINK or
XPAPER primitives which put on the first and second columns ink and paper attributes.
The only way to change color on the same line for text is to handle it in pure assembly
Functions textcolor and bgcolor are available only with Telemon 3.0 (Orix).
Telemon 2.4 primitives can't handle any change of colors in text mode except with XINK or
XPAPER primitives which put on the first and second columns ink and paper attributes.
The only way to change color on the same line for text is to handle it in pure assembly
without systems calls.
<sect>Other hints<p>

View File

@ -76,13 +76,13 @@ ifneq ($(MAKECMDGOALS),clean)
endif
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
&#9;$(CC) -c $(CFLAGS) -o $@ $<
$(PROGRAM): $(SOURCES:.c=.o)
$(CC) $(LDFLAGS) -o $@ $^
&#9;$(CC) $(LDFLAGS) -o $@ $^
clean:
$(RM) $(SOURCES:.c=.o) $(SOURCES:.c=.d) $(PROGRAM) $(PROGRAM).map
&#9;$(RM) $(SOURCES:.c=.o) $(SOURCES:.c=.d) $(PROGRAM) $(PROGRAM).map
</verb></tscreen>
<bf/Important:/ When using the sample Makefile above via copy & paste it is

View File

@ -137,7 +137,7 @@ struct __antic {
** Called during every vertical blank; see SYSVBV, VVBLKI, CRITIC, and VVBLKD,
** as well as the SETVBV routine.
*/
#define NMIEN_VBI 0x40
#define NMIEN_VBI 0x40
/* [Reset] key pressed */
#define NMIEN_RESET 0x20

View File

@ -31,19 +31,19 @@
struct __os {
/*Page zero*/
unsigned char pokmsk; // = $00 System mask for POKEY IRQ enable
unsigned char pokmsk; // = $00 System mask for POKEY IRQ enable
unsigned char rtclok[2]; // = $01,$02 Real time clock
unsigned char critic; // = $03 Critical section flag
unsigned char critic; // = $03 Critical section flag
unsigned char atract; // = $04 Attract mode counter
union {
struct {
unsigned char sdlstl; // = $05 Save display list LO
unsigned char sdlsth; // = $06 Save display list HI
};
void* sdlst; // = $05,$06 Display list shadow
};
};
unsigned char sdmctl; // = $07 DMACTL shadow
unsigned char pcolr0; // = $08 PM color 0
unsigned char pcolr1; // = $09 PM color 1
@ -55,10 +55,10 @@ struct __os {
unsigned char color3; // = $0F PF color 3
unsigned char color4; // = $10 PF color 4
unsigned char _free_1[0xEF]; // = $11-$FF User space
/*Stack*/
unsigned char stack[0x100]; // = $100-$1FF Stack
/*Page 2 OS variables*/
void (*vinter)(void); // = $200 Immediate IRQ vector
void (*vvblki)(void); // = $202 Immediate VBI vector
@ -74,7 +74,7 @@ struct __os {
void (*vtimr1)(void); // = $216 POKEY timer 1 IRQ vector
void (*vtimr2)(void); // = $218 POKEY timer 2 IRQ vector
void (*vtimr4)(void); // = $21A POKEY timer 4 IRQ vector
};
#endif

View File

@ -66,7 +66,7 @@ struct __dcb {
unsigned char dtimlo; /* device timeout in seconds */
unsigned char dunuse; /* - unused - */
unsigned int dbyt; /* # of bytes to transfer */
union {
union {
struct {
unsigned char daux1; /* 1st command auxiliary byte */
unsigned char daux2; /* 2nd command auxiliary byte */
@ -105,7 +105,7 @@ struct __dos2x {
unsigned char* zbufp; /* points to user filename */
unsigned char* zdrva; /* points to serveral buffers (mostly VTOC) */
unsigned char* zsba; /* points to sector buffer */
unsigned char errno; /* number of occured error */
unsigned char errno; /* number of occurred error */
};
typedef struct __dos2x dos2x_t;
@ -167,28 +167,28 @@ struct __os {
#ifdef OSA
unsigned char* linzbs; // = $00/$01 LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
#else
#else
unsigned char linflg; // = $00 LNBUG FLAG (0 = NOT LNBUG)
unsigned char ngflag; // = $01 MEMORY STATUS (0 = FAILURE)
#endif
#endif
unsigned char* casini; // = $02/$03 CASSETTE INIT LOCATION
unsigned char* ramlo; // = $04/$05 RAM POINTER FOR MEMORY TEST
#ifdef OSA
#ifdef OSA
unsigned char tramsz; // = $06 FLAG FOR LEFT CARTRIDGE
unsigned char tstdat; // = $07 FLAG FOR RIGHT CARTRIDGE
#else
#else
unsigned char trnsmz; // = $06 TEMPORARY REGISTER FOR RAM SIZE
unsigned char tstdat; // = $07 UNUSED (NOT TOUCHED DURING RESET/COLD START)
#endif
// Cleared upon Coldstart only
// Cleared upon Coldstart only
unsigned char warmst; // = $08 WARM START FLAG
unsigned char bootq; // = $09 SUCCESSFUL BOOT FLAG
unsigned char bootq; // = $09 SUCCESSFUL BOOT FLAG
void (*dosvec)(void); // = $0A/$0B DISK SOFTWARE START VECTOR
void (*dosini)(void); // = $0C/$0D DISK SOFTWARE INIT ADDRESS
unsigned char* appmhi; // = $0E/$0F APPLICATIONS MEMORY HI LIMIT
unsigned char* appmhi; // = $0E/$0F APPLICATIONS MEMORY HI LIMIT
// Cleared upon Coldstart or Warmstart
@ -199,26 +199,26 @@ struct __os {
unsigned char iccomt; // = $17 COMMAND FOR VECTOR
unsigned char* dskfms; // = $18/$19 DISK FILE MANAGER POINTER
unsigned char* dskutl; // = $1A/$1B DISK UTILITIES POINTER
#ifdef OSA
#ifdef OSA
unsigned char ptimot; // = $1C PRINTER TIME OUT REGISTER
unsigned char pbpnt; // = $1D PRINT BUFFER POINTER
unsigned char pbufsz; // = $1E PRINT BUFFER SIZE
unsigned char ptemp; // = $1F TEMPORARY REGISTER
#else
#else
unsigned char abufpt[4]; // = $1C-$1F ACMI BUFFER POINTER AREA
#endif
#endif
iocb_t ziocb; // = $20-$2F ZERO PAGE I/O CONTROL BLOCK
unsigned char status; // = $30 INTERNAL STATUS STORAGE
unsigned char chksum; // = $31 CHECKSUM (SINGLE BYTE SUM WITH CARRY)
unsigned char* bufr; // = $32/$33 POINTER TO DATA BUFFER
unsigned char* bfen; // = $34/$35 NEXT BYTE PAST END OF THE DATA BUFFER LO
#ifdef OSA
#ifdef OSA
unsigned char cretry; // = $36 NUMBER OF COMMAND FRAME RETRIES
unsigned char dretry; // = $37 NUMBER OF DEVICE RETRIES
#else
#else
unsigned int ltemp; // = $36/$37 LOADER TEMPORARY
#endif
#endif
unsigned char bufrfl; // = $38 DATA BUFFER FULL FLAG
unsigned char recvdn; // = $39 RECEIVE DONE FLAG
unsigned char xmtdon; // = $3A TRANSMISSION DONE FLAG
@ -227,22 +227,22 @@ struct __os {
unsigned char bptr; // = $3D CASSETTE BUFFER POINTER
unsigned char ftype; // = $3E CASSETTE IRG TYPE
unsigned char feof; // = $3F CASSETTE EOF FLAG (0 // = QUIET)
unsigned char freq; // = $40 CASSETTE BEEP COUNTER
unsigned char soundr; // = $41 NOISY I/0 FLAG. (ZERO IS QUIET)
unsigned char critic; // = $42 DEFINES CRITICAL SECTION (CRITICAL IF NON-Z)
dos2x_t fmszpg; // = $43-$49 DISK FILE MANAGER SYSTEM ZERO PAGE
#ifdef OSA
#ifdef OSA
unsigned char ckey; // = $4A FLAG SET WHEN GAME START PRESSED
unsigned char cassbt; // = $4B CASSETTE BOOT FLAG
#else
#else
void* zchain; // = $4A/$4B HANDLER LINKAGE CHAIN POINTER
#endif
#endif
unsigned char dstat; // = $4C DISPLAY STATUS
unsigned char atract; // = $4D ATRACT FLAG
unsigned char drkmsk; // = $4E DARK ATRACT MASK
unsigned char colrsh; // = $4F ATRACT COLOR SHIFTER (EOR'ED WITH PLAYFIELD
unsigned char tmpchr; // = $50 TEMPORARY CHARACTER
unsigned char hold1; // = $51 TEMPORARY
unsigned char lmargn; // = $52 LEFT MARGIN (NORMALLY 2, CC65 C STARTUP CODE SETS IT TO 0)
@ -255,68 +255,68 @@ struct __os {
unsigned int oldcol; // = $5B/$5C PRIOR COLUMN
unsigned char oldchr; // = $5D DATA UNDER CURSOR
unsigned char* oldadr; // = $5E/$5F SAVED CURSOR MEMORY ADDRESS
#ifdef OSA
#ifdef OSA
unsigned char newrow; // = $60 POINT DRAW GOES TO
unsigned int newcol; // = $61/$62 COLUMN DRAW GOES TO
#else
#else
unsigned char* fkdef; // = $60/$61 FUNCTION KEY DEFINITION TABLE
unsigned char palnts; // = $62 PAL/NTSC INDICATOR (0 // = NTSC)
#endif
#endif
unsigned char logcol; // = $63 POINTS AT COLUMN IN LOGICAL LINE
unsigned char* adress; // = $64/$65 TEMPORARY ADDRESS
unsigned int mlttmp; // = $66/$67 TEMPORARY / FIRST BYTE IS USED IN OPEN AS TEMP
unsigned int savadr; // = $68/$69 SAVED ADDRESS
unsigned int mlttmp; // = $66/$67 TEMPORARY / FIRST BYTE IS USED IN OPEN AS TEMP
unsigned int savadr; // = $68/$69 SAVED ADDRESS
unsigned char ramtop; // = $6A RAM SIZE DEFINED BY POWER ON LOGIC
unsigned char bufcnt; // = $6B BUFFER COUNT
unsigned char* bufstr; // = $6C/$6D EDITOR GETCH POINTER
unsigned char bitmsk; // = $6E BIT MASK
unsigned char shfamt; // = $6F SHIFT AMOUNT FOR PIXEL JUSTIFUCATION
unsigned int rowac; // = $70/$71 DRAW WORKING ROW
unsigned int colac; // = $72/$73 DRAW WORKING COLUMN
unsigned char* endpt; // = $74/$75 END POINT
unsigned char deltar; // = $76 ROW DIFFERENCE
unsigned int deltac; // = $77/$78 COLUMN DIFFERENCE
#ifdef OSA
unsigned char rowinc; // = $79 ROWINC
#ifdef OSA
unsigned char rowinc; // = $79 ROWINC
unsigned char colinc; // = $7A COLINC
#else
#else
unsigned char* keydef; // = $79/$7A 2-BYTE KEY DEFINITION TABLE ADDRESS
#endif
#endif
unsigned char swpflg; // = $7B NON-0 1F TXT AND REGULAR RAM IS SWAPPED
unsigned char holdch; // = $7C CH IS MOVED HERE IN KGETCH BEFORE CNTL & SH
unsigned char insdat; // = $7D 1-BYTE TEMPORARY
unsigned int countr; // = $7E/$7F 2-BYTE DRAW ITERATION COUNT
unsigned char _free_1[0xD4-0x7F-1]; // USER SPACE
// Floating Point Package Page Zero Address Equates
fpreg_t fpreg[4]; // = $D4-$EB 4 REGSITERS, ACCCESS LIKE "fpreg[FPIDX_R0].fr"
unsigned char frx; // = $EC 1-BYTE TEMPORARY
fpreg_t fpreg[4]; // = $D4-$EB 4 REGSITERS, ACCCESS LIKE "fpreg[FPIDX_R0].fr"
unsigned char frx; // = $EC 1-BYTE TEMPORARY
unsigned char eexp; // = $ED VALUE OF EXP
#ifdef OS_REV2
#ifdef OS_REV2
unsigned char frsign; // = $EE ##REV2## 1-BYTE FLOATING POINT SIGN
unsigned char plycnt; // = $EF ##REV2## 1-BYTE POLYNOMIAL DEGREE
unsigned char sgnflg; // = $F0 ##REV2## 1-BYTE SIGN FLAG
unsigned char xfmflg; // = $F1 ##REV2## 1-BYTE TRANSFORM FLAG
#else
#else
unsigned char nsign; // = $EE SIGN OF #
unsigned char esign; // = $EF SIGN OF EXPONENT
unsigned char fchrflg; // = $F0 1ST CHAR FLAG
unsigned char digrt; // = $F1 # OF DIGITS RIGHT OF DECIMAL
#endif
#endif
unsigned char cix; // = $F2 CURRENT INPUT INDEX
unsigned char* inbuff; // = $F3/$F4 POINTS TO USER'S LINE INPUT BUFFER
unsigned char* inbuff; // = $F3/$F4 POINTS TO USER'S LINE INPUT BUFFER
unsigned int ztemp1; // = $F5/$F6 2-BYTE TEMPORARY
unsigned int ztemp4; // = $F7/$F8 2-BYTE TEMPORARY
unsigned int ztemp3; // = $F9/$FA 2-BYTE TEMPORARY
union {
union {
unsigned char degflg; // = $FB ##OLD## SAME AS RADFLG
unsigned char radflg; // = $FB ##OLD## 0=RADIANS, 6=DEGREES
};
fpreg_t* flptr; // = $FC/$FD 2-BYTE FLOATING POINT NUMBER POINTER
fpreg_t* fptr2; // = $FE/$FF 2-BYTE FLOATING POINT NUMBER POINTER
@ -356,28 +356,28 @@ struct __os {
union {
struct {
unsigned char sdlstl; // = $0230 SAVE DISPLAY LIST LOW BYTE
unsigned char sdlsth; // = $0231 SAVE DISPLAY LIST HI BYTE
unsigned char sdlsth; // = $0231 SAVE DISPLAY LIST HI BYTE
};
void* sdlst; // = $0230/$0231 (same as above as pointer)
};
unsigned char sskctl; // = $0232 SKCTL REGISTER RAM
#ifdef OSA
#ifdef OSA
unsigned char _spare_1; // = $0233 No OS use.
#else
unsigned char lcount; // = $0233 ##1200xl## 1-byte relocating loader record
#endif
#endif
unsigned char lpenh; // = $0234 LIGHT PEN HORIZONTAL VALUE
unsigned char lpenv; // = $0235 LIGHT PEN VERTICAL VALUE
void (*brkky)(void); // = $0236/$0237 BREAK KEY VECTOR
#ifdef OSA
#ifdef OSA
unsigned char spare2[2]; // = $0238/$0239 No OS use.
#else
#else
void (*vpirq)(void); // = $0238/$0239 ##rev2## 2-byte parallel device IRQ vector
#endif
#endif
unsigned char cdevic; // = $023A COMMAND FRAME BUFFER - DEVICE
unsigned char ccomnd; // = $023B COMMAND
union {
struct {
struct {
unsigned char caux1; // = $023C COMMAND AUX BYTE 1
unsigned char caux2; // = $023D COMMAND AUX BYTE 2
};
@ -389,15 +389,15 @@ struct __os {
unsigned char dbsect; // = $0241 NUMBER OF DISK BOOT SECTORS
unsigned char* bootad; // = $0242/$0243 ADDRESS WHERE DISK BOOT LOADER WILL BE PUT
unsigned char coldst; // = $0244 COLDSTART FLAG (1=IN MIDDLE OF COLDSTART>
#ifdef OSA
#ifdef OSA
unsigned char spare3; // = $0245 No OS use.
#else
#else
unsigned char reclen; // = $0245 ##1200xl## 1-byte relocating loader record length
#endif
#endif
unsigned char dsktim; // = $0246 DISK TIME OUT REGISTER
#ifdef OSA
#ifdef OSA
unsigned char linbuf[40]; // = $0247-$026E ##old## CHAR LINE BUFFER
#else
#else
unsigned char pdvmsk; // = $0247 ##rev2## 1-byte parallel device selection mask
unsigned char shpdvs; // = $0248 ##rev2## 1-byte PDVS (parallel device select)
unsigned char pdimsk; // = $0249 ##rev2## 1-byte parallel device IRQ selection
@ -409,7 +409,7 @@ struct __os {
unsigned char vsflag; // = $026C ##1200xl## 1-byte fine vertical scroll count
unsigned char keydis; // = $026D ##1200xl## 1-byte keyboard disable
unsigned char fine; // = $026E ##1200xl## 1-byte fine scrolling mode
#endif
#endif
unsigned char gprior; // = $026F GLOBAL PRIORITY CELL
unsigned char paddl0; // = $0270 1-BYTE POTENTIOMETER 0
unsigned char paddl1; // = $0271 1-BYTE POTENTIOMETER 1
@ -435,30 +435,30 @@ struct __os {
unsigned char strig1; // = $0285 1-BYTE JOYSTICK TRIGGER 1
unsigned char strig2; // = $0286 1-BYTE JOYSTICK TRIGGER 2
unsigned char strig3; // = $0287 1-BYTE JOYSTICK TRIGGER 3
#ifdef OSA
#ifdef OSA
unsigned char cstat; // = $0288 ##old## cassette status register
#else
#else
unsigned char hibyte; // = $0288 ##1200xl## 1-byte relocating loader high byte
#endif
#endif
unsigned char wmode; // = $0289 1-byte cassette WRITE mode
unsigned char blim; // = $028A 1-byte cassette buffer limit
#ifdef OSA
unsigned char _reserved_2[5]; // = $028B-$028F RESERVED
#else
#else
unsigned char imask; // = $028B ##rev2## (not used)
void (*jveck)(void); // = $028C/$028D 2-byte jump vector
unsigned newadr; // = $028E/028F ##1200xl## 2-byte relocating address
#endif
#endif
unsigned char txtrow; // = $0290 TEXT ROWCRS
unsigned txtcol; // = $0291/$0292 TEXT COLCRS
unsigned char tindex; // = $0293 TEXT INDEX
unsigned char* txtmsc; // = $0294/$0295 FOOLS CONVRT INTO NEW MSC
unsigned char txtold[6]; // = $0296-$029B OLDROW & OLDCOL FOR TEXT (AND THEN SOME)
#ifdef OSA
#ifdef OSA
unsigned char tmpx1; // = $029C ##old## 1--byte temporary register
#else
#else
unsigned char cretry; // = $029C ##1200xl## 1-byte number of command frame retries
#endif
#endif
unsigned char hold3; // = $029D 1-byte temporary
unsigned char subtmp; // = $029E 1-byte temporary
unsigned char hold2; // = $029F 1-byte (not used)
@ -473,41 +473,41 @@ struct __os {
unsigned tmpcol; // = $02B9/$02BA 2-byte temporary column
unsigned char scrflg; // = $02BB SET IF SCROLL OCCURS
unsigned char hold4; // = $02BC TEMP CELL USED IN DRAW ONLY
#ifdef OSA
#ifdef OSA
unsigned char hold5; // = $02BD ##old## DITTO
#else
#else
unsigned char dretry; // = $02BD ##1200xl## 1-byte number of device retries
#endif
#endif
unsigned char shflok; // = $02BE 1-byte shift/control lock flags
unsigned char botscr; // = $02BF BOTTOM OF SCREEN 24 NORM 4 SPLIT
unsigned char pcolr0; // = $02C0 1-byte player-missile 0 color/luminance
unsigned char pcolr1; // = $02C1 1-byte player-missile 1 color/luminance
unsigned char pcolr2; // = $02C2 1-byte player-missile 2 color/luminance
unsigned char pcolr3; // = $02C3 1-byte player-missile 3 color/luminance
unsigned char pcolr3; // = $02C3 1-byte player-missile 3 color/luminance
unsigned char color0; // = $02C4 1-byte playfield 0 color/luminance
unsigned char color1; // = $02C5 1-byte playfield 1 color/luminance
unsigned char color2; // = $02C6 1-byte playfield 2 color/luminance
unsigned char color3; // = $02C7 1-byte playfield 3 color/luminance
unsigned char color4; // = $02C8 1-byte background color/luminance
#ifdef OSA
#ifdef OSA
unsigned char _spare_2[23]; // = $02C9-$02DF No OS use.
#else
union {
unsigned char parmbl[6]; // = $02C9 ##rev2## 6-byte relocating loader parameter
struct {
struct {
void (*runadr)(void); // = $02C9 ##1200xl## 2-byte run address
unsigned int hiused; // = $02CB ##1200xl## 2-byte highest non-zero page address
unsigned int zhiuse; // = $02CD ##1200xl## 2-byte highest zero page address
};
};
union {
};
};
union {
unsigned char oldpar[6]; // = $02CF ##rev2## 6-byte relocating loader parameter
struct {
struct {
void (*gbytea)(void); // = $02CF ##1200xl## 2-byte GET-BYTE routine address
unsigned int loadad; // = $02D1 ##1200xl## 2-byte non-zero page load address
unsigned int zloada; // = $02D3 ##1200xl## 2-byte zero page load address
};
};
};
};
unsigned int dsctln; // = $02D5 ##1200xl## 2-byte disk sector length
unsigned int acmisr; // = $02D7 ##1200xl## 2-byte ACMI interrupt service routine
unsigned char krpdel; // = $02D9 ##1200xl## 1-byte auto-repeat delay
@ -517,78 +517,78 @@ struct __os {
unsigned char dmasav; // = $02DD ##1200xl## 1-byte SDMCTL save/restore
unsigned char pbpnt; // = $02DE ##1200xl## 1-byte printer buffer pointer
unsigned char pbufsz; // = $02DF ##1200xl## 1-byte printer buffer size
#endif
union {
#endif
union {
unsigned char glbabs[4]; // = $02E0-$02E3 byte global variables for non-DOS users
struct {
struct {
void (*runad)(void); // = $02E0 ##map## 2-byte binary file run address
void (*initad)(void); // = $02E2 ##map## 2-byte binary file initialization address
};
};
};
};
unsigned char ramsiz; // = $02E4 RAM SIZE (HI BYTE ONLY)
void* memtop; // = $02E5 TOP OF AVAILABLE USER MEMORY
void* memlo; // = $02E7 BOTTOM OF AVAILABLE USER MEMORY
#ifdef OSA
#ifdef OSA
unsigned char _spare_3; // = $02E9 No OS use.
#else
#else
unsigned char hndlod; // = $02E9 ##1200xl## 1-byte user load flag
#endif
#endif
unsigned char dvstat[4]; // = $02EA-$02ED STATUS BUFFER
union {
union {
unsigned int cbaud; // = $02EE/$02EF 2-byte cassette baud rate
struct {
struct {
unsigned char cbaudl; // = $02EE 1-byte low cassette baud rate
unsigned char cbaudh; // = $02EF 1-byte high cassette baud rate
};
};
};
};
unsigned char crsinh; // = $02F0 CURSOR INHIBIT (00 = CURSOR ON)
unsigned char keydel; // = $02F1 KEY DELAY
unsigned char ch1; // = $02F2 1-byte prior keyboard character
unsigned char chact; // = $02F3 CHACTL REGISTER RAM
unsigned char chbas; // = $02F4 CHBAS REGISTER RAM
#ifdef OSA
#ifdef OSA
unsigned char _spare_4[5]; // = $02F5-$02F9 No OS use.
#else
#else
unsigned char newrow; // = $02F5 ##1200xl## 1-byte draw destination row
unsigned int newcol; // = $02F6/$02F7 ##1200xl## 2-byte draw destination column
unsigned char rowinc; // = $02F8 ##1200xl## 1-byte draw row increment
unsigned char colinc; // = $02F9 ##1200xl## 1-byte draw column increment
#endif
#endif
unsigned char char_; // = $02FA 1-byte internal character (naming changed due to do keyword conflict)
unsigned char atachr; // = $02FB ATASCII CHARACTER
unsigned char ch; // = $02FC GLOBAL VARIABLE FOR KEYBOARD
unsigned char fildat; // = $02FD RIGHT FILL DATA <DRAW>
unsigned char dspflg; // = $02FE DISPLAY FLAG DISPLAY CNTLS IF NON-ZERO
unsigned char ssflag; // = $02FF START/STOP FLAG FOR PAGING (CNTL 1). CLEARE
// --- Page 3 ---
dcb_t dcb; // = $0300-$030B DEVICE CONTROL BLOCK
unsigned int timer1; // = $030C/$030D INITIAL TIMER VALUE
#ifdef OSA
#ifdef OSA
unsigned char addcor; // = $030E ##old## ADDITION CORRECTION
#else
#else
unsigned char jmpers; // = $030E ##1200xl## 1-byte jumper options
#endif
#endif
unsigned char casflg; // = $030F CASSETTE MODE WHEN SET
unsigned int timer2; // = $0310/$0311 2-byte final baud rate timer value
unsigned char temp1; // = $0312 TEMPORARY STORAGE REGISTER
#ifdef OSA
#ifdef OSA
unsigned char _spare_5; // = $0313 unused
unsigned char temp2; // = $0314 ##old## TEMPORARY STORAGE REGISTER
#else
#else
unsigned char temp2; // = $0313 ##1200xl## 1-byte temporary
unsigned char ptimot; // = $0314 ##1200xl## 1-byte printer timeout
#endif
#endif
unsigned char temp3; // = $0315 TEMPORARY STORAGE REGISTER
unsigned char savio; // = $0316 SAVE SERIAL IN DATA PORT
unsigned char timflg; // = $0317 TIME OUT FLAG FOR BAUD RATE CORRECTION
unsigned char stackp; // = $0318 SIO STACK POINTER SAVE CELL
unsigned char tstat; // = $0319 TEMPORARY STATUS HOLDER
#ifdef OSA
#ifdef OSA
hatabs_t hatabs[12]; // = $031A-$033D handler address table
unsigned int zeropad; // = $033E/$033F zero padding
#else
#else
hatabs_t hatabs[11]; // = $031A-$033A handler address table
unsigned int zeropad; // = $033B/$033C zero padding
unsigned char pupbt1; // = $033D ##1200xl## 1-byte power-up validation byte 1
@ -598,9 +598,9 @@ struct __os {
iocb_t iocb[8]; // = $0340-$03BF 8 I/O Control Blocks
unsigned char prnbuf[40]; // = $03C0-$3E7 PRINTER BUFFER
#ifdef OSA
#ifdef OSA
unsigned char _spare_6[151]; // = $03E8-$047F unused
#else
#else
unsigned char superf; // = $03E8 ##1200xl## 1-byte editor super function flag
unsigned char ckey; // = $03E9 ##1200xl## 1-byte cassette boot request flag
unsigned char cassbt; // = $03EA ##1200xl## 1-byte cassette boot flag
@ -639,7 +639,7 @@ struct __basic {
void* starp; // = $8C/$8D ADDRESS FOR THE STRING AND ARRAY TABLE
void* runstk; // = $8E/$8F ADDRESS OF THE RUNTIME STACK
void* memtop; // = $90/$91 POINTER TO THE TOP OF BASIC MEMORY
unsigned char _internal_1[0xBA-0x91-1]; // INTERNAL DATA
unsigned int stopln; // = $BA/$BB LINE WHERE A PROGRAM WAS STOPPED

63
include/_maria.h Normal file
View File

@ -0,0 +1,63 @@
/*****************************************************************************/
/* */
/* _maria.h */
/* */
/* Atari 7800, Maria chip register hardware structures */
/* */
/* */
/* 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: */
/* */
/* 1. 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. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
/*
* MARIA registers
*/
struct __maria {
unsigned char bkgrnd;
unsigned char p0c1;
unsigned char p0c2;
unsigned char p0c3;
unsigned char wsync;
unsigned char p1c1;
unsigned char p1c2;
unsigned char p1c3;
unsigned char mstat;
unsigned char p2c1;
unsigned char p2c2;
unsigned char p2c3;
unsigned char dpph;
unsigned char p3c1;
unsigned char p3c2;
unsigned char p3c3;
unsigned char dppl;
unsigned char p4c1;
unsigned char p4c2;
unsigned char p4c3;
unsigned char chbase;
unsigned char p5c1;
unsigned char p5c2;
unsigned char p5c3;
unsigned char offset;
unsigned char p6c1;
unsigned char p6c2;
unsigned char p6c3;
unsigned char ctrl;
unsigned char p7c1;
unsigned char p7c2;
unsigned char p7c3;
};

View File

@ -131,7 +131,7 @@ struct __pokey_write {
#define SKCTL_KEYBOARD_SCANNING 0x02 /* Enable keyboard scanning circuit */
/* Fast pot scan
** The pot scan counter completes its sequence in two TV line times instead of
** The pot scan counter completes its sequence in two TV line times instead of
** one frame time (228 scan lines). Not as accurate as the normal pot scan
*/
#define SKCTL_FAST_POT_SCAN 0x04
@ -204,7 +204,7 @@ struct __pokey_read {
#define SKSTAT_DATA_READ_INGORING_SHIFTREG 0x10 /* Data can be read directly from the serial input port, ignoring the shift register. */
#define SKSTAT_KEYBOARD_OVERRUN 0x20 /* Keyboard over-run; Reset BITs 7, 6 and 5 (latches) to 1, using SKREST */
#define SKSTAT_INPUT_OVERRUN 0x40 /* Serial data input over-run. Reset latches as above. */
#define SKSTAT_INPUT_FRAMEERROR 0x80 /* Serial data input frame error caused by missing or extra bits. Reset latches as above. */
#define SKSTAT_INPUT_FRAMEERROR 0x80 /* Serial data input frame error caused by missing or extra bits. Reset latches as above. */
/* KBCODE, internal keyboard codes for Atari 8-bit computers,

View File

@ -180,7 +180,7 @@ unsigned char detect_c128 (void);
unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);
/* Set the speed of the C64 Chameleon cartridge, the following inputs
* are accepted:
* are accepted:
* SPEED_SLOW : 1 Mhz mode
* SPEED_1X : 1 Mhz mode
* SPEED_2X : 2 Mhz mode

View File

@ -159,11 +159,11 @@ extern struct {
unsigned day :5;
unsigned mon :4;
unsigned year :7;
} createdate; /* Current date: 0 */
} createdate; /* Current date: 0 */
struct {
unsigned char min;
unsigned char hour;
} createtime; /* Current time: 0 */
} createtime; /* Current time: 0 */
} _datetime;
/* The addresses of the static drivers */

67
include/atari7800.h Normal file
View File

@ -0,0 +1,67 @@
/*****************************************************************************/
/* */
/* Atari VCS 7800 TIA & RIOT registers addresses */
/* */
/* Karri Kaksonen (karri@sipo.fi), 2022 */
/* */
/* */
/*****************************************************************************/
#ifndef _ATARI7800_H
#define _ATARI7800_H
/* Check for errors */
#if !defined(__ATARI7800__)
# error This module may only be used when compiling for the Atari 7800!
#endif
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Color defines */
#define COLOR_BLACK 0x00
#define COLOR_GREY 0x01
#define COLOR_LIGHTGREY 0x02
#define COLOR_WHITE 0x03
/* TGI color defines (default palette) */
#define TGI_COLOR_BLACK COLOR_BLACK
#define TGI_COLOR_GREY COLOR_GREY
#define TGI_COLOR_LIGHTGREY COLOR_LIGHTGREY
#define TGI_COLOR_WHITE COLOR_WHITE
/* Masks for joy_read */
#define JOY_RIGHT_MASK 0x80
#define JOY_LEFT_MASK 0x40
#define JOY_DOWN_MASK 0x20
#define JOY_UP_MASK 0x10
#define JOY_BTN_1_MASK 0x01
#define JOY_BTN_2_MASK 0x02
#define JOY_BTN_A_MASK JOY_BTN_1_MASK
#define JOY_BTN_B_MASK JOY_BTN_2_MASK
#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
/* No support for dynamically loadable drivers */
#define DYN_DRV 0
extern unsigned char get_tv(void); /* get TV system */
#include <_tia.h>
#define TIA (*(struct __tia*)0x0000)
#include <_riot.h>
#define RIOT (*(struct __riot*)0x0280)
#include <_maria.h>
#define MARIA (*(struct __maria*)0x0020)
/* End of atari7800.h */
#endif

View File

@ -59,21 +59,21 @@ unsigned long __fastcall__ udiv32by16r16 (unsigned long rhs, unsigned lhs);
*/
int __fastcall__ imul8x8r16 (signed char lhs, signed char rhs);
/* Multiplicate two signed 8 bit to yield an signed 16 bit result */
/* Multiply two signed 8 bit to yield an signed 16 bit result */
long __fastcall__ imul16x16r32 (int lhs, int rhs);
/* Multiplicate two signed 16 bit to yield a signed 32 bit result */
/* Multiply two signed 16 bit to yield a signed 32 bit result */
unsigned __fastcall__ umul8x8r16 (unsigned char lhs, unsigned char rhs);
/* Multiplicate two unsigned 8 bit to yield an unsigned 16 bit result */
/* Multiply two unsigned 8 bit to yield an unsigned 16 bit result */
unsigned long __fastcall__ umul16x8r32 (unsigned lhs, unsigned char rhs);
/* Multiplicate an unsigned 16 bit by an unsigned 8 bit number yielding a 24
/* Multiply an unsigned 16 bit by an unsigned 8 bit number yielding a 24
** bit unsigned result that is extended to 32 bits for easier handling from C.
*/
unsigned long __fastcall__ umul16x16r32 (unsigned lhs, unsigned rhs);
/* Multiplicate two unsigned 16 bit to yield an unsigned 32 bit result */
/* Multiply two unsigned 16 bit to yield an unsigned 32 bit result */
unsigned int __fastcall__ mul20 (unsigned char value);
/* Multiply an 8 bit unsigned value by 20 and return the 16 bit unsigned

View File

@ -57,7 +57,9 @@
/* Character classification functions */
int __fastcall__ isalnum (int c);
int __fastcall__ isalpha (int c);
int __fastcall__ isascii (int c);
#if __CC65_STD__ >= __CC65_STD_CC65__
int __fastcall__ isascii (int c); /* non standard */
#endif
int __fastcall__ iscntrl (int c);
int __fastcall__ isdigit (int c);
int __fastcall__ isgraph (int c);
@ -75,7 +77,7 @@ int __fastcall__ toupper (int c); /* Always external */
int __fastcall__ tolower (int c); /* Always external */
#if __CC65_STD__ >= __CC65_STD_CC65__
unsigned char __fastcall__ toascii (unsigned char c);
unsigned char __fastcall__ toascii (unsigned char c); /* non standard */
/* Convert a target-specific character to ASCII. */
#endif

View File

@ -3,7 +3,7 @@
/* cx16.h */
/* */
/* CX16 system-specific definitions */
/* For prerelease 38 */
/* For prerelease 39 */
/* */
/* */
/* This software is provided "as-is", without any expressed or implied */
@ -169,11 +169,16 @@ enum {
};
/* Video modes for videomode() */
#define VIDEOMODE_40x30 0x00
#define VIDEOMODE_80x60 0x02
#define VIDEOMODE_40COL VIDEOMODE_40x30
#define VIDEOMODE_80x60 0x00
#define VIDEOMODE_80x30 0x01
#define VIDEOMODE_40x60 0x02
#define VIDEOMODE_40x30 0x03
#define VIDEOMODE_40x15 0x04
#define VIDEOMODE_20x30 0x05
#define VIDEOMODE_20x15 0x06
#define VIDEOMODE_80COL VIDEOMODE_80x60
#define VIDEOMODE_320x200 0x80
#define VIDEOMODE_40COL VIDEOMODE_40x30
#define VIDEOMODE_320x240 0x80
#define VIDEOMODE_SWAP (-1)
/* VERA's address increment/decrement numbers */
@ -221,6 +226,13 @@ enum {
/* Define hardware. */
#define RAM_BANK (*(unsigned char *)0x00)
#define ROM_BANK (*(unsigned char *)0x01)
#include <_6522.h>
#define VIA1 (*(volatile struct __6522 *)0x9F00)
#define VIA2 (*(volatile struct __6522 *)0x9F10)
/* A structure with the Video Enhanced Retro Adapter's external registers */
struct __vera {
unsigned short address; /* Address for data ports */
@ -271,12 +283,15 @@ struct __vera {
};
#define VERA (*(volatile struct __vera *)0x9F20)
#include <_6522.h>
#define VIA1 (*(volatile struct __6522 *)0x9F60)
#define VIA2 (*(volatile struct __6522 *)0x9F70)
#define RAM_BANK (VIA1.pra)
#define ROM_BANK (VIA1.prb)
/* Audio chip */
struct __ym2151 {
union {
unsigned char reg; /* Register number for data */
unsigned char status; /* Busy flag */
};
unsigned char data;
};
#define YM2151 (*(volatile struct __ym2151 *)0x9F40)
/* A structure with the x16emu's settings registers */
struct __emul {

View File

@ -39,7 +39,7 @@
** are declared here.
**
** To use the debugger, just call DbgInit in your application. Once it has
** been called, the debugger will catch any BRK opcode. Use the BREAK macro
** been called, the debugger will catch any BRK opcode. Use the BREAK macro
** defined below to insert breakpoints into your code.
**
** There are currently a lot of things that cannot be debugged, graphical
@ -121,4 +121,4 @@ void __fastcall__ DbgInit (unsigned unused);

View File

@ -84,7 +84,7 @@ extern int _errno;
int __fastcall__ _osmaperrno (unsigned char oserror);
/* Map an operating system specific error code (for example from _oserror)
/* Map an operating system specific error code (for example from _oserror)
** into one of the E... codes above. It is user callable.
*/

View File

@ -145,6 +145,8 @@
/* constants for the conio implementation */
#define COLOR_BLACK 0x03
#define COLOR_GRAY2 0x02
#define COLOR_GRAY1 0x01
#define COLOR_WHITE 0x00
#define CH_HLINE 1

View File

@ -12,7 +12,7 @@
void __fastcall__ CopyString(char *dest, const char *source);
char __fastcall__ CmpString(const char *dest, const char *source);
void __fastcall__ CopyFString(char len, char *dest, const char *source);
char __fastcall__ CmpFString(char len, char *dest, const char *source);
char __fastcall__ CmpFString(char len, char *dest, const char *source);
unsigned __fastcall__ CRC(const char *buffer, unsigned len);
void* __fastcall__ ClearRam(char *dest, unsigned len);

View File

@ -37,7 +37,6 @@
#define _LIMITS_H
#define CHAR_BIT 8
#define SCHAR_MIN ((signed char) 0x80)
@ -63,7 +62,9 @@
#define ULONG_MAX 4294967295UL
#if __CC65_STD__ >= __CC65_STD_CC65__
/* These defines that are platform dependent */
/* FILENAME_MAX in stdlib.h is defined as the same value as PATH_MAX */
#if defined(__APPLE2__)
# define PATH_MAX (64+1)
#elif defined(__ATARI__)
@ -77,7 +78,7 @@
#else
# define PATH_MAX (16+1)
#endif
#endif /* __CC65_STD__ >= __CC65_STD_CC65__ */
/* End of limits.h */
#endif

View File

@ -52,24 +52,25 @@
/* Color defines */
#define COLOR_BLACK 0x00
#define COLOR_RED 0x01
#define COLOR_PINK 0x02
#define COLOR_LIGHTGREY 0x03
#define COLOR_GREY 0x04
#define COLOR_DARKGREY 0x05
#define COLOR_BROWN 0x06
#define COLOR_PEACH 0x07
#define COLOR_YELLOW 0x08
#define COLOR_LIGHTGREEN 0x09
#define COLOR_GREEN 0x0A
#define COLOR_DARKBROWN 0x0B
#define COLOR_TRANSPARENT 0x00
#define COLOR_BLACK 0x01
#define COLOR_RED 0x02
#define COLOR_PINK 0x03
#define COLOR_LIGHTGREY 0x04
#define COLOR_GREY 0x05
#define COLOR_DARKGREY 0x06
#define COLOR_BROWN 0x07
#define COLOR_PEACH 0x08
#define COLOR_YELLOW 0x09
#define COLOR_LIGHTGREEN 0x0A
#define COLOR_GREEN 0x0B
#define COLOR_PURPLE 0x0C
#define COLOR_BLUE 0x0D
#define COLOR_LIGHTBLUE 0x0E
#define COLOR_WHITE 0x0F
/* TGI color defines (default palette) */
#define TGI_COLOR_TRANSPARENT COLOR_TRANSPARENT
#define TGI_COLOR_BLACK COLOR_BLACK
#define TGI_COLOR_RED COLOR_RED
#define TGI_COLOR_PINK COLOR_PINK

View File

@ -37,12 +37,21 @@
#define _STDIO_H
/* NULL pointer */
#ifndef _HAVE_NULL
#define NULL 0
#define _HAVE_NULL
#endif
#include <stddef.h>
#include <stdarg.h>
#include <limits.h>
/* size_t is needed */
#ifndef _HAVE_size_t
#define _HAVE_size_t
typedef unsigned size_t;
#endif
/* stdio.h should not define va_list, so we use an equivalent type in the
compiler namespace instead */
typedef unsigned char* __va_list;
/* Types */
typedef struct _FILE FILE;
@ -65,9 +74,24 @@ extern FILE* stderr;
#define SEEK_SET 2
#define TMP_MAX 256
#define FILENAME_MAX PATH_MAX
#define L_tmpnam FILENAME_MAX
/* These defines that are platform dependent */
/* FILENAME_MAX is defined as the same value as PATH_MAX in limits.h, but we
are not allowed to include limits.h here */
#if defined(__APPLE2__)
# define FILENAME_MAX (64+1)
#elif defined(__ATARI__)
# define FILENAME_MAX (63+1)
#elif defined(__CBM__)
# define FILENAME_MAX (255) /* should be 256+1, see libsrc/common/_cmd.s why it's not */
#elif defined(__LUNIX__)
# define FILENAME_MAX (80+1)
#elif defined(__TELESTRAT__)
# define FILENAME_MAX (50+1)
#else
# define FILENAME_MAX (16+1)
#endif
#define L_tmpnam FILENAME_MAX
/*****************************************************************************/
@ -107,17 +131,17 @@ int __fastcall__ rename (const char* oldname, const char* newname);
int snprintf (char* buf, size_t size, const char* format, ...);
int sprintf (char* buf, const char* format, ...);
int __fastcall__ ungetc (int c, FILE* f);
int __fastcall__ vfprintf (FILE* f, const char* format, va_list ap);
int __fastcall__ vprintf (const char* format, va_list ap);
int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, va_list ap);
int __fastcall__ vsprintf (char* buf, const char* format, va_list ap);
int __fastcall__ vfprintf (FILE* f, const char* format, __va_list ap);
int __fastcall__ vprintf (const char* format, __va_list ap);
int __fastcall__ vsnprintf (char* buf, size_t size, const char* format, __va_list ap);
int __fastcall__ vsprintf (char* buf, const char* format, __va_list ap);
int scanf (const char* format, ...);
int fscanf (FILE* f, const char* format, ...);
int sscanf (const char* s, const char* format, ...);
int __fastcall__ vscanf (const char* format, va_list ap);
int __fastcall__ vsscanf (const char* s, const char* format, va_list ap);
int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap);
int __fastcall__ vscanf (const char* format, __va_list ap);
int __fastcall__ vsscanf (const char* s, const char* format, __va_list ap);
int __fastcall__ vfscanf (FILE* f, const char* format, __va_list ap);
#if __CC65_STD__ == __CC65_STD_CC65__
FILE* __fastcall__ fdopen (int fd, const char* mode); /* Unix */

View File

@ -52,8 +52,8 @@ typedef unsigned size_t;
/* Those non-standard cc65 exit constants definitions are in addition
** to the EXIT_SUCCESS and EXIT_FAILURE constants, which should not be
** redefined
*/
** redefined
*/
#define EXIT_ASSERT 2
#define EXIT_ABORT 3

View File

@ -36,11 +36,17 @@
#ifndef _STRING_H
#define _STRING_H
/* NULL pointer */
#ifndef _HAVE_NULL
#define NULL 0
#define _HAVE_NULL
#endif
#include <stddef.h>
/* size_t is needed */
#ifndef _HAVE_size_t
#define _HAVE_size_t
typedef unsigned size_t;
#endif
char* __fastcall__ strcat (char* dest, const char* src);
char* __fastcall__ strchr (const char* s, int c);
@ -90,6 +96,5 @@ const char* __fastcall__ _stroserror (unsigned char errcode);
/* Map an operating system error number to an error message. */
/* End of string.h */
#endif

View File

@ -41,7 +41,7 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/*

View File

@ -43,6 +43,8 @@
# include <atari2600.h>
#elif defined(__ATARI5200__)
# include <atari5200.h>
#elif defined(__ATARI7800__)
# include <atari7800.h>
#elif defined(__ATMOS__)
# include <atmos.h>
#elif defined(__CBM__)

View File

@ -52,7 +52,6 @@ typedef unsigned size_t;
typedef unsigned long time_t;
typedef unsigned long clock_t;
typedef unsigned char clockid_t;
/* Structure for broken down time */
struct tm {
@ -67,22 +66,6 @@ struct tm {
int tm_isdst;
};
/* Structure for seconds and nanoseconds */
struct timespec {
time_t tv_sec;
long tv_nsec;
};
/* Timezone representation, default is UTC */
extern struct _timezone {
char daylight; /* True if daylight savings time active */
long timezone; /* Number of seconds behind UTC */
char tzname[5]; /* Name of timezone, e.g. CET */
char dstname[5]; /* Name when daylight true, e.g. CEST */
} _tz;
#if defined(__ATARI5200__)
# define CLOCKS_PER_SEC 60
#elif defined(__ATMOS__)
@ -102,12 +85,13 @@ extern struct _timezone {
# define CLOCKS_PER_SEC 135 /* FIXME */
#elif defined(__GEOS__)
# define CLOCKS_PER_SEC 1
#elif defined(__TELESTRAT__)
# define CLOCKS_PER_SEC 10
#elif defined(__ATARI__) || defined (__LYNX__)
/* Read the clock rate at runtime */
clock_t _clocks_per_sec (void);
# define CLOCKS_PER_SEC _clocks_per_sec()
#endif
#define CLK_TCK CLOCKS_PER_SEC
#define CLOCK_REALTIME 0
@ -123,12 +107,32 @@ size_t __fastcall__ strftime (char* buf, size_t bufsize, const char* format, con
time_t __fastcall__ time (time_t* t);
#if __CC65_STD__ >= __CC65_STD_CC65__
typedef unsigned char clockid_t;
/* Structure for seconds and nanoseconds */
struct timespec {
time_t tv_sec;
long tv_nsec;
};
/* Timezone representation, default is UTC */
extern struct _timezone {
char daylight; /* True if daylight savings time active */
long timezone; /* Number of seconds behind UTC */
char tzname[5]; /* Name of timezone, e.g. CET */
char dstname[5]; /* Name when daylight true, e.g. CEST */
} _tz;
#define CLK_TCK CLOCKS_PER_SEC
/* POSIX function prototypes */
int __fastcall__ clock_getres (clockid_t clock_id, struct timespec *res);
int __fastcall__ clock_gettime (clockid_t clock_id, struct timespec *tp);
int __fastcall__ clock_settime (clockid_t clock_id, const struct timespec *tp);
#endif
/* End of time.h */

View File

@ -21,6 +21,7 @@ TARGETS = apple2 \
atarixl \
atari2600 \
atari5200 \
atari7800 \
atmos \
creativision \
$(CBMS) \
@ -95,7 +96,6 @@ INSTALL = install
define INSTALL_recipe
$(if $(PREFIX),,$(error variable "PREFIX" must be set))
$(INSTALL) -d $(DESTDIR)$(datadir)/$(dir)
$(INSTALL) -m0644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir)

View File

@ -13,4 +13,4 @@ _textcolor := return1
_bgcolor := return0
_bordercolor := return0
_bordercolor := return0

View File

@ -18,7 +18,7 @@ typerr: lda #$4A ; "Incompatible file format"
; Cleanup name
oserr: jsr popname ; Preserves A
; Set __oserror
jmp __mappederrno
@ -129,7 +129,7 @@ setbuf: lda #$00 ; Low byte
.assert MLI::OPEN::PATHNAME = MLI::INFO::PATHNAME, error
; Lower file level to avoid program file
; being closed by C libary shutdown code
; being closed by C library shutdown code
ldx LEVEL
stx level
beq :+
@ -185,13 +185,13 @@ setbuf: lda #$00 ; Low byte
lda #$00 ; '\0'
beq :- ; Branch always
; Call loader stub after C libary shutdown
; Call loader stub after C library shutdown
: lda #<target
ldx #>target
sta done+1
stx done+2
; Initiate C libary shutdown
; Initiate C library shutdown
jmp _exit
.bss

View File

@ -2,7 +2,7 @@
; Oliver Schmidt, 10.9.2009
;
; Default ProDOS 8 I/O buffer management
;
;
.export iobuf_alloc, iobuf_free
.import _posix_memalign, _free

View File

@ -8,13 +8,13 @@
;
.export _mouse_def_callbacks
.include "apple2.inc"
; ------------------------------------------------------------------------
.bss
backup: .res 1
visible:.res 1

View File

@ -152,7 +152,7 @@ next: inc ptr1+1
sta xparam+1
sta jump+2
; Disable interrupts now because setting the slot number makes
; Disable interrupts now because setting the slot number makes
; the IRQ handler (maybe called due to some non-mouse IRQ) try
; calling the firmware which isn't correctly set up yet
sei
@ -167,7 +167,7 @@ next: inc ptr1+1
asl
asl
sta yparam+1
; The AppleMouse II Card needs the ROM switched in
; to be able to detect an Apple //e and use RDVBL
bit $C082
@ -175,7 +175,7 @@ next: inc ptr1+1
; Reset mouse hardware
ldx #INITMOUSE
jsr firmware
; Switch in LC bank 2 for R/O
bit $C080
@ -236,12 +236,12 @@ UNINSTALL:
SETBOX:
sta ptr1
stx ptr1+1
; Set x clamps
ldx #$00
ldy #MOUSE_BOX::MINX
jsr :+
; Set y clamps
ldx #$01
ldy #MOUSE_BOX::MINY
@ -257,7 +257,7 @@ SETBOX:
sta pos1_lo
iny
lda (ptr1),y
sta box,y
sta box,y
sta pos1_hi
; Skip one word
@ -267,11 +267,11 @@ SETBOX:
; Set high clamp
iny
lda (ptr1),y
sta box,y
sta box,y
sta pos2_lo
iny
lda (ptr1),y
sta box,y
sta box,y
sta pos2_hi
txa

View File

@ -57,7 +57,7 @@ extern char _cwd[FILENAME_MAX];
DIR* __fastcall__ opendir (register const char* name)
DIR* __fastcall__ opendir (register const char* name)
{
register DIR* dir;

View File

@ -111,4 +111,4 @@ errno: jmp __directerrno
; Set __oserror
oserr: jmp __mappederrno

View File

@ -63,7 +63,7 @@ L1: lda #<brk_handler ; Set the break vector to our routine
lda #$00
sta oldvec ; Clear the old vector
stx oldvec+1
@L9: rts
@L9: rts
.endproc

View File

@ -17,7 +17,7 @@ _cclearxy:
_cclear:
cmp #0 ; Is the length zero?
beq L9 ; Jump if done
sta tmp1
sta tmp1
L1: lda #0 ; Blank - screen code
jsr cputdirect ; Direct output
dec tmp1

View File

@ -12,7 +12,7 @@
.include "ctypetable.inc"
.export __ctypeidx
; The tables are readonly, put them into the rodata segment
.rodata

View File

@ -5,7 +5,7 @@
; void cvline (unsigned char length);
;
.include "atari.inc"
.export _cvlinexy, _cvline
.import gotoxy, putchar, setcursor
.importzp tmp1

View File

@ -137,7 +137,7 @@ _dio_open:
iny
lda #1
finish: sta (ptr2),y ; set default sector size
finish: sta (ptr2),y ; set default sector size
fini2: lda ptr2
ldx ptr2+1
rts

View File

@ -12,7 +12,7 @@
.proc _dio_query_sectsize
sta ptr1 ; handle
stx ptr1+1
stx ptr1+1
lda #0
sta __oserror

View File

@ -12,7 +12,7 @@
.ifdef __ATARIXL__
_doesclrscrafterexit = return1 ; the c65 runtime always clears the screen at program termination
.else
.else
_doesclrscrafterexit:
jsr __is_cmdline_dos ; currently (unless a DOS behaving differently is popping up)
eor #$01 ; we can get by with the inverse of __is_cmdline_dos

View File

@ -11,7 +11,7 @@
; Bit 2: bank control
; Bit 1: BASIC on/off
; Bit 0: OS RAM on/off
;
;
; Masks: %11100011 $E3 Bank 0
; %11100111 $E7 Bank 1
; %11101011 $EB Bank 2
@ -67,7 +67,7 @@
; Constants
BANK = $4000 ; bank window
STACK = $0100 ; stack location
STACK = $0100 ; stack location
PAGES = 256 ; 4 x 16k banks
@ -93,17 +93,17 @@ stacktest: sei
@2: sta $4000 ; restore
cli
rts
stacktest_end:
stacktest_end:
stackcopy: sei ; disable interrupts
@1: dex ; pre-decrement (full page x=0)
ldy #$FF ; this will be replaced STACK+3
sty $D301 ; set bank
sty $D301 ; set bank
lda $FF00,x ; address to copy from STACK+8,+9
ldy #$FF ; this will be replaced STACK+11
sty $D301
sty $D301
sta $FF00,x ; address to copy to STACK+16,+17
cpx #0
cpx #0
bne @1
ldy #$FF ; portb_save STACK+23
sty $D301
@ -122,7 +122,7 @@ stackcopy_byte: sei
sty $D301
cli
rts
stackcopy_byte_end:
stackcopy_byte_end:
.data
@ -186,14 +186,14 @@ setpage:
INSTALL:
lda $D301 ; save state of portb
sta portb_save
tay
tay
jsr install_test ; doesn't touch Y
sty STACK+13
lda $4000 ; test for extended memory
jsr STACK
bcs @1
bcs @1
lda #EM_ERR_OK
rts
@1: lda #EM_ERR_NO_DEVICE
@ -242,7 +242,7 @@ MAP: jsr setpage ; extract the bank/page
lda banks,x
sta STACK+3 ; set bank to copy from
; lda ptr1
; sta STACK+8
; sta STACK+8
lda ptr1+1
sta STACK+9 ; set copy from address
lda portb_save
@ -251,10 +251,10 @@ MAP: jsr setpage ; extract the bank/page
lda ptr2
sta STACK+16
lda ptr2+1
sta STACK+17 ; set copy to address
sta STACK+17 ; set copy to address
ldx #0 ; full page copy
jsr STACK ; do the copy!
jsr STACK ; do the copy!
; Return the memory window
@ -298,7 +298,7 @@ COMMIT: lda curpage ; Get the current page
sta STACK+3 ; set bank to copy from
sta STACK+23 ; set final portb restore
lda ptr1
sta STACK+8
sta STACK+8
lda ptr1+1
sta STACK+9 ; set copy from address
ldx curbank
@ -307,10 +307,10 @@ COMMIT: lda curpage ; Get the current page
;lda ptr2
;sta STACK+16
lda ptr2+1
sta STACK+17 ; set copy to address
sta STACK+17 ; set copy to address
ldx #0 ; full page copy
jsr STACK ; do the copy!
jsr STACK ; do the copy!
commit_done:
rts
@ -329,7 +329,7 @@ COPYFROM:
ldy #EM_COPY::OFFS
lda (ptr3),y
sta STACK+7 ; offset goes into BANK low
sta STACK+7 ; offset goes into BANK low
ldy #EM_COPY::PAGE
lda (ptr3),y
@ -357,9 +357,9 @@ COPYFROM:
add #>BANK ; add to BANK address
sta STACK+8 ; current page in bank
ldx curbank
lda banks,x
sta STACK+2 ; set bank in stack
lda portb_save
lda banks,x
sta STACK+2 ; set bank in stack
lda portb_save
sta STACK+10 ; set bank restore in stack
sta STACK+18 ; set final restore too
@ -399,7 +399,7 @@ copyfrom_copy:
bne @3
inc STACK+16
@3: jmp copyfrom_copy ; copy another byte
@3: jmp copyfrom_copy ; copy another byte
done:
rts
@ -418,7 +418,7 @@ COPYTO:
ldy #EM_COPY::OFFS
lda (ptr3),y
sta STACK+15 ; offset goes into BANK low
sta STACK+15 ; offset goes into BANK low
ldy #EM_COPY::PAGE
lda (ptr3),y
@ -446,9 +446,9 @@ COPYTO:
add #>BANK ; add to BANK address
sta STACK+16 ; current page in bank
ldx curbank
lda banks,x
sta STACK+10 ; set bank in stack
lda portb_save
lda banks,x
sta STACK+10 ; set bank in stack
lda portb_save
sta STACK+2 ; set bank restore in stack
sta STACK+18 ; set final restore too
@ -488,5 +488,5 @@ copyto_copy:
bne @3
inc STACK+8
@3: jmp copyto_copy ; copy another byte
@3: jmp copyto_copy ; copy another byte

View File

@ -74,7 +74,7 @@ prep:
jsr getcursor ; Get character at cursor position
cmp #mouse_txt_char ; "mouse" character
bne overwr ; no, probably program has overwritten it
lda backup ;
lda backup ;
jmp setcursor ; Draw character
overwr: sta backup
rts

View File

@ -10,7 +10,7 @@
.include "atari.inc"
__randomize:
__randomize:
ldx VCOUNT ; Use vertical line counter as high byte
lda RTCLOK+2 ; Use clock as low byte
jmp _srand ; Initialize generator

View File

@ -4,7 +4,7 @@
; unsigned char revers (unsigned char onoff);
;
.include "atari.inc"
.export _revers
.export _revflag

View File

@ -737,9 +737,9 @@ fn_cont:jsr get_fn_len
lda #0
sta ICBLH,x
jsr chk_CIO_buf
pla
pla
sta ICBLH,x
pla
pla
sta ICBLL,x
pla
tay
@ -756,7 +756,7 @@ chk_CIO_buf:
lda ICBAH,x
cmp #$c0
bcc @cont
@ret:
@ret:
.ifdef DEBUG
jsr CIO_buf_noti
.endif

Some files were not shown because too many files have changed in this diff Show More