Merge pull request #1 from cc65/master

Update
This commit is contained in:
Germán Luis Aracil Boned 2024-02-08 21:27:32 +01:00 committed by GitHub
commit 2e9f846ecd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1720 changed files with 148229 additions and 16926 deletions

15
.editorconfig Normal file
View File

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
guidelines = 80, 120
[*.{c,h}]
cpp_new_line_before_open_brace_block=same_line
cpp_new_line_before_open_brace_function=new_line
cpp_space_before_function_open_parenthesis=insert
cpp_new_line_before_else=false

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

@ -0,0 +1,34 @@
ifneq ($(shell echo),)
CMD_EXE = 1
endif
ifdef CMD_EXE
.PHONY: checkstyle
checkstyle:
$(info INFO: style checks require bash.)
else
.PHONY: checkstyle lineendings tabs lastline spaces noexec
checkstyle: lineendings tabs lastline spaces noexec
lineendings: lineendings.sh
@./lineendings.sh
tabs: tabs.sh
@./tabs.sh
lastline: lastline.sh
@./lastline.sh
spaces: spaces.sh
@./spaces.sh
noexec: noexec.sh
@./noexec.sh
endif

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/lineendings.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 -IUl $'\r'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found CR in the following files:" >&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 "test/" | 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 "test/" | 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

@ -0,0 +1,92 @@
name: Build Pull Request
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- 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
- name: Run the regression tests.
shell: bash
run: make test QUIET=1
- name: Test that the samples can be built.
run: make -C samples platforms
- name: Test that the targettest programs can be built.
run: make -C targettest platforms
- name: Build the document files.
shell: bash
run: make -j2 doc
- name: Upload a documents snapshot.
uses: actions/upload-artifact@v4
with:
name: docs
path: ./html
- name: Build 64-bit Windows versions of the tools.
run: |
make -C src clean
make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
build_windows:
name: Build and Test (Windows)
runs-on: windows-latest
steps:
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build app (x86 debug)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug -property:Platform=Win32
- name: Build app (x86 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release -property:Platform=Win32
- name: Build app (x64 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug -property:Platform=x64
- name: Build app (x64 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release -property:Platform=x64
- name: Build utils (MinGW)
shell: cmd
run: make -j2 util SHELL=cmd
- name: Build the platform libraries (make lib)
shell: cmd
run: make -j2 lib QUIET=1 SHELL=cmd
- name: Run the regression tests (make test)
shell: cmd
run: make test QUIET=1 SHELL=cmd

View File

@ -0,0 +1,157 @@
name: Snapshot Build
on:
push:
branches:
master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_windows:
name: Build (Windows)
if: github.repository == 'cc65/cc65'
runs-on: windows-latest
steps:
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build app (debug)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
build_linux:
name: Build, Test, and Snapshot (Linux)
if: github.repository == 'cc65/cc65'
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- 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
make -j2 util
- name: Build the platform libraries.
shell: bash
run: make -j2 lib QUIET=1
- name: Run the regression tests.
shell: bash
run: make test QUIET=1
- name: Test that the samples can be built.
shell: bash
run: make -j2 samples
- 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
- name: Build and package 64-bit Windows versions of the tools.
run: |
make -C src clean
make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
make 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-snapshot-win32.zip
- name: Upload a 32-bit Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-win32
path: cc65-snapshot-win32.zip
- name: Upload a 64-bit Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-win64
path: cc65-snapshot-win64.zip
- name: Get the online documents repo.
uses: actions/checkout@v4
with:
repository: cc65/doc
# this token will expire, if it does, generate a new one as decribed in https://github.com/cc65/cc65/issues/2065
# - apparently only a "classic" token works here
# - the token must exist in the cc65/cc65 repo
token: ${{ secrets.DOC_PAT }} # use secret token instead of default
path: doc.git
- name: Update the online documents.
run: |
cd doc.git
rm *.*
cp ../html/*.* .
git config user.name "cc65-github"
git config user.email "cc65.nomail@github.com"
git config push.default simple
git add -A
# prevent failure when there is nothing to commit
git diff-index --quiet HEAD || git commit -m "Updated from https://github.com/cc65/cc65/commit/${GITHUB_SHA}"
git push
- name: Package offline documents.
run: 7z a cc65-snapshot-docs.zip ./html/*.*
- name: Upload a Documents Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-docs
path: cc65-snapshot-docs.zip
# enter secrets under "repository secrets"
- name: Upload 32-bit Windows 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 }}
- name: Upload 64-bit Windows snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-win64.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
- name: Upload documents snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-docs.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
# TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io

View File

@ -0,0 +1,78 @@
name: Windows Test Scheduled
# Scheduled or manually dispatched because it's slower than the Linux test.
on:
schedule:
- cron: '0 0 */1 * *'
# every 1 days
workflow_dispatch:
# allow manual dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# don't run more than once at a time
jobs:
build_windows:
name: Build, Test (Windows MSVC)
runs-on: windows-latest
steps:
# This cache is used to remember the last build.
# If there are no changes and the last build was successful,
# the build and test steps will be omitted.
# If the last build failed, the full attempt will be repeated.
# Github Actions will retain the last build cache for up to 7 days.
- name: Create Cache
shell: bash
run: mkdir ~/.cache-sha
- name: Cache SHA
uses: actions/cache@v4
id: check-sha
with:
path: ~/.cache-sha
key: cache-sha-wintest-${{ github.sha }}
- name: Git Setup
if: steps.check-sha.outputs.cache-hit != 'true'
shell: bash
run: git config --global core.autocrlf input
- name: Checkout source
if: steps.check-sha.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Add msbuild to PATH
if: steps.check-sha.outputs.cache-hit != 'true'
uses: microsoft/setup-msbuild@v2
- name: Build app (MSVC debug)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (MSVC release)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
- name: Build utils (MinGW)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 util SHELL=cmd
- name: Build the platform libraries (make lib)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 lib QUIET=1 SHELL=cmd
- name: Run the regression tests (make test)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make test QUIET=1 SHELL=cmd
- name: Test that the samples can be built (make samples)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 samples SHELL=cmd

3
.gitignore vendored
View File

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

View File

@ -9,14 +9,14 @@ jobs:
- sudo apt-get update
- sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass
script:
- make bin USER_CFLAGS=-Werror
- make lib QUIET=1
- make -j2 bin USER_CFLAGS=-Werror
- make -j2 lib QUIET=1
- make test QUIET=1
- make samples
- make -j2 samples
- make -C src clean
- make bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
- make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
- make -C samples clean
- make doc zip
- make -j2 doc zip
after_success:
- make -f Makefile.travis

298
Contributing.md Normal file
View File

@ -0,0 +1,298 @@
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.
Also, before you put a lot of work into implementing something you want to contribute, please get in touch with one of the developers and ask if what you are going to do is actually wanted and has a chance of being merged. Perhaps someone else is already working on it, or perhaps what you have in mind is not how we'd expect it to be - talking to us before you start might save you a lot of work in those cases.
(''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.
* Sometimes when you make a PR, it may break completely unrelated tests. However, any PR is expected to merge cleanly with no failures. That means in practise that you are expected to fix/update the failing tests if required - for example this might be needed if you make changes to the compiler that changes the format of error- or warning messages. In that case you might have to update some reference files in the testbench. Obviously still check if that is actually the right thing to do ;)
# Codestyle rules
## All Sources
### Line endings
All files must only contain Unix style 'LF' line endings. Please configure your editors accordingly.
### 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```.
### Identifiers and Symbol names
The C Standard defines certain identifiers and symbol names, which we can not use
in our code. Since it is not always obvious which parts of the library code will
actually end up in a linked program, the following applies to ALL of the library.
Any non standard identifier/symbol/function that is exported from source files,
or appears in header files:
* must not be in the "_symbol" form in C, or "__symbol" form in assembly.
* must start with (at least) two (C Code) or three (assembly code) underscores, unless the symbol appears in a non standard header file.
This is likely more than the standard dictates us to do - but it is certainly
standard compliant - and easy to remember.
Also see the discussion in https://github.com/cc65/cc65/issues/1796
### 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 generally obey the C89 standard, with a few C99 things (this is a bit similar to what cc65 itself supports). The exceptions are:
* use stdint.h for variables that require a certain bit size
* In printf-style functions use the PRIX64 (and similar) macros to deal with 64bit values (from inttypes.h)
This list is not necessarily complete - if in doubt, please ask.
* We generally have a "no warnings" policy
* Warnings must not be hidden by using typecasts - fix the code instead
* 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.) This must be done in one of the following ways:
<pre>
lda #RETURN_VALUE
ldx #0 ; Promote char return value
</pre>
or, if the value is 0, you can use:
<pre>
lda #RETURN_VALUE
.assert RETURN_VALUE = 0
tax
</pre>
sometimes jumping to return0 could save a byte:
<pre>
.assert RETURN_VALUE = 0
jmp return 0
</pre>
* 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
## Compiler
* We need a way that makes it possible to feed arbitrary assembler code into the optimzer, so we can have proper tests for it
### Floating point support
The first step is implementing the datatype "float" as IEEE 754 floats. Help welcomed!
* WIP compiler/library changes are here: https://github.com/cc65/cc65/pull/1777
## Library
### name clashes in the library
see "Identifiers and Symbol names" above - not all identifiers have been checked
and renamed yet. The following is a list of those that still might need to be
fixed:
```
common
__argc libsrc/runtime/callmain.s libsrc/cbm610/mainargs.s libsrc/cx16/mainargs.s libsrc/plus4/mainargs.s libsrc/lynx/mainargs.s libsrc/c16/mainargs.s libsrc/geos-common/system/mainargs.s libsrc/sim6502/mainargs.s libsrc/c128/mainargs.s libsrc/vic20/mainargs.s libsrc/nes/mainargs.s libsrc/atari/getargs.s libsrc/apple2/mainargs.s libsrc/cbm510/mainargs.s libsrc/telestrat/mainargs.s libsrc/c64/mainargs.s libsrc/pet/mainargs.s libsrc/atmos/mainargs.s
__argv libsrc/runtime/callmain.s libsrc/cbm610/mainargs.s libsrc/cx16/mainargs.s libsrc/plus4/mainargs.s libsrc/lynx/mainargs.s libsrc/c16/mainargs.s libsrc/geos-common/system/mainargs.s libsrc/sim6502/mainargs.s libsrc/c128/mainargs.s libsrc/vic20/mainargs.s libsrc/nes/mainargs.s libsrc/atari/getargs.s libsrc/apple2/mainargs.s libsrc/cbm510/mainargs.s libsrc/telestrat/mainargs.s libsrc/c64/mainargs.s libsrc/pet/mainargs.s libsrc/atmos/mainargs.s
__cos libsrc/common/sincos.s
__ctypeidx libsrc/common/ctype.s libsrc/common/ctypemask.s libsrc/geos-common/system/ctype.s libsrc/atari/ctype.s libsrc/cbm/ctype.s libsrc/atmos/ctype.s asminc/ctype_common.inc
__cwd libsrc/common/getcwd.s libsrc/common/_cwd.s libsrc/atari/initcwd.s libsrc/apple2/initcwd.s libsrc/apple2/initcwd.s libsrc/telestrat/initcwd.s libsrc/cbm/initcwd.s
__cwd_buf_size libsrc/common/_cwd.s
__envcount libsrc/common/searchenv.s libsrc/common/_environ.s libsrc/common/putenv.s libsrc/common/getenv.s
__environ libsrc/common/searchenv.s libsrc/common/_environ.s libsrc/common/putenv.s libsrc/common/getenv.s
__envsize libsrc/common/_environ.s libsrc/common/putenv.s
__fdesc libsrc/common/_fdesc.s libsrc/common/fopen.s
__filetab libsrc/common/_fdesc.s libsrc/common/_file.s asminc/_file.inc
__fopen libsrc/common/fopen.s libsrc/common/_fopen.s
__printf libsrc/common/vsnprintf.s libsrc/common/_printf.s libsrc/common/vfprintf.s libsrc/conio/vcprintf.s libsrc/pce/_printf.s
__scanf libsrc/common/_scanf.inc libsrc/common/vsscanf.s libsrc/conio/vcscanf.s
__sin libsrc/common/sincos.s
__sys libsrc/common/_sys.s libsrc/apple2/_sys.s
__sys_oserrlist libsrc/common/stroserr.s libsrc/geos-common/system/oserrlist.s libsrc/atari/oserrlist.s libsrc/apple2/oserrlist.s libsrc/cbm/oserrlist.s libsrc/atmos/oserrlist.s
__syschdir libsrc/common/chdir.s libsrc/atari/syschdir.s libsrc/apple2/syschdir.s libsrc/telestrat/syschdir.s libsrc/cbm/syschdir.s
__sysmkdir libsrc/common/mkdir.s libsrc/atari/sysmkdir.s libsrc/apple2/sysmkdir.s libsrc/telestrat/sysmkdir.s
__sysremove libsrc/common/remove.s libsrc/geos-common/file/sysremove.s libsrc/atari/sysremove.s libsrc/atari/sysrmdir.s libsrc/apple2/sysremove.s libsrc/apple2/sysrmdir.s libsrc/telestrat/sysremove.s libsrc/cbm/sysremove.s
__sysrename libsrc/common/rename.s libsrc/geos-common/file/sysrename.s libsrc/atari/sysrename.s libsrc/apple2/sysrename.s libsrc/cbm/sysrename.s
__sysrmdir libsrc/common/rmdir.s libsrc/atari/sysrmdir.s libsrc/apple2/sysrmdir.s
__sysuname libsrc/common/uname.s libsrc/cbm610/sysuname.s libsrc/cx16/sysuname.s libsrc/plus4/sysuname.s libsrc/lynx/sysuname.s libsrc/c16/sysuname.s libsrc/geos-common/system/sysuname.s libsrc/c128/sysuname.s libsrc/creativision/sysuname.s libsrc/vic20/sysuname.s libsrc/nes/sysuname.s libsrc/atari/sysuname.s libsrc/apple2/sysuname.s libsrc/cbm510/sysuname.s libsrc/telestrat/sysuname.s libsrc/c64/sysuname.s libsrc/pet/sysuname.s libsrc/atari5200/sysuname.s libsrc/atmos/sysuname.s
apple2
__auxtype libsrc/apple2/open.s
__datetime libsrc/apple2/open.s
__dos_type libsrc/apple2/dioopen.s libsrc/apple2/curdevice.s libsrc/apple2/mainargs.s libsrc/apple2/settime.s libsrc/apple2/getdevice.s libsrc/apple2/dosdetect.s libsrc/apple2/irq.s libsrc/apple2/open.s libsrc/apple2/mli.s libsrc/apple2/getres.s
__filetype libsrc/apple2/open.s libsrc/apple2/exehdr.s
atari
__defdev libsrc/atari/posixdirent.s libsrc/atari/ucase_fn.s libsrc/atari/getdefdev.s
__dos_type libsrc/atari/getargs.s libsrc/atari/exec.s libsrc/atari/settime.s libsrc/atari/syschdir.s libsrc/atari/dosdetect.s libsrc/atari/is_cmdline_dos.s libsrc/atari/sysrmdir.s libsrc/atari/gettime.s libsrc/atari/lseek.s libsrc/atari/getres.s libsrc/atari/getdefdev.s
__do_oserror libsrc/atari/posixdirent.s libsrc/atari/do_oserr.s libsrc/atari/serref.s libsrc/atari/read.s libsrc/atari/write.s libsrc/atari/close.s
__getcolor libsrc/atari/setcolor.s
__getdefdev libsrc/atari/getdefdev.s
__graphics libsrc/atari/graphics.s
__inviocb libsrc/atari/serref.s libsrc/atari/ser/atrrdev.s libsrc/atari/inviocb.s libsrc/atari/read.s libsrc/atari/write.s libsrc/atari/lseek.s libsrc/atari/close.s
__is_cmdline_dos libsrc/atari/is_cmdline_dos.s libsrc/atari/doesclrscr.s
__rest_vecs libsrc/atari/savevec.s
__rwsetup libsrc/atari/rwcommon.s libsrc/atari/read.s libsrc/atari/write.s
__save_vecs libsrc/atari/savevec.s
__scroll libsrc/atari/scroll.s
__setcolor libsrc/atari/setcolor.s
__setcolor_low libsrc/atari/setcolor.s
__sio_call libsrc/atari/diowritev.s libsrc/atari/diopncls.s libsrc/atari/siocall.s libsrc/atari/diowrite.s libsrc/atari/dioread.s
cbm
__cbm_filetype libsrc/cbm/cbm_filetype.s asminc/cbm_filetype.in
__dirread libsrc/cbm/dir.inc libsrc/cbm/dir.s
__dirread1 libsrc/cbm/dir.inc libsrc/cbm/dir.s
lynx
__iodat libsrc/lynx/lynx-cart.s libsrc/lynx/bootldr.s libsrc/lynx/extzp.s libsrc/lynx/crt0.s libsrc/lynx/extzp.inc
__iodir libsrc/lynx/extzp.s libsrc/lynx/crt0.s libsrc/lynx/extzp.inc
__sprsys libsrc/lynx/tgi/lynx-160-102-16.s libsrc/lynx/extzp.s libsrc/lynx/crt0.s libsrc/lynx/extzp.inc
__viddma libsrc/lynx/tgi/lynx-160-102-16.s libsrc/lynx/extzp.s libsrc/lynx/crt0.s libsrc/lynx/extzp.inc
pce
__nmi libsrc/pce/irq.s libsrc/pce/crt0.s
```
## 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,17 +1,27 @@
.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 $@
lib:
lib libtest:
@$(MAKE) -C libsrc --no-print-directory $@
doc html info:
@ -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 $@
# runs regression tests, requires libtest target libraries
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,40 +1,63 @@
[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)
[![Build Status](https://api.travis-ci.org/cc65/cc65.svg?branch=master)](https://travis-ci.org/cc65/cc65/builds)
# 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.
a powerful macro assembler, a C compiler, linker, archiver and several
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.
Project founders:
The libraries are fairly portable, so creating a version for other 6502s
shouldn't be too much work.
* John R. Dunning: [original implementation](https://public.websites.umich.edu/~archive/atari/8bit/Languages/Cc65/) of the C compiler and runtime library, Atari hosted
* Ullrich von Bassewitz:
* move the code to modern systems
* rewrite most parts of the compiler
* complete rewrite of the runtime library
Core team members:
* [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 library, 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
* [Dave Plummer](https://github.com/davepl): KIM-1 target
* [rumbledethumps](https://github.com/rumbledethumps): Picocomputer 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 64bit Snapshot](https://sourceforge.net/projects/cc65/files/cc65-snapshot-win64.zip)
* [Windows 32bit 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

@ -28,8 +28,8 @@ HEAP_MIN_BLOCKSIZE = .sizeof (freeblock) ; Minimum size of an allocated block
HEAP_ADMIN_SPACE = .sizeof (usedblock) ; Additional space for used bock
; Variables
.global __heaporg
.global __heapptr
.global __heapend
.global __heapfirst
.global __heaplast
.global ___heaporg
.global ___heapptr
.global ___heapend
.global ___heapfirst
.global ___heaplast

View File

@ -15,6 +15,7 @@ PROMPT := $33 ; Used by GETLN
RNDL := $4E ; Random counter low
RNDH := $4F ; Random counter high
HIMEM := $73 ; Highest available memory address+1
CURLIN := $75 ; Current line number being executed
;-----------------------------------------------------------------------------
; Vectors

287
asminc/ascii_charmap.inc Normal file
View File

@ -0,0 +1,287 @@
;/*****************************************************************************/
;/* */
;/* ascii_charmap.inc */
;/* */
;/* No translations, encodings are stored as they were typed in the host. */
;/* */
;/* */
;/* 2019-09-07, Greg King */
;/* */
;/* 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 must not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
;/* ASCII */
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $07
.charmap $08, $08
.charmap $09, $09
.charmap $0A, $0A
.charmap $0B, $0B
.charmap $0C, $0C
.charmap $0D, $0D
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $11
.charmap $12, $12
.charmap $13, $13
.charmap $14, $14
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
.charmap $5B, $5B
.charmap $5C, $5C
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $5F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
;/* beyond ASCII */
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $C0
.charmap $C1, $C1
.charmap $C2, $C2
.charmap $C3, $C3
.charmap $C4, $C4
.charmap $C5, $C5
.charmap $C6, $C6
.charmap $C7, $C7
.charmap $C8, $C8
.charmap $C9, $C9
.charmap $CA, $CA
.charmap $CB, $CB
.charmap $CC, $CC
.charmap $CD, $CD
.charmap $CE, $CE
.charmap $CF, $CF
.charmap $D0, $D0
.charmap $D1, $D1
.charmap $D2, $D2
.charmap $D3, $D3
.charmap $D4, $D4
.charmap $D5, $D5
.charmap $D6, $D6
.charmap $D7, $D7
.charmap $D8, $D8
.charmap $D9, $D9
.charmap $DA, $DA
.charmap $DB, $DB
.charmap $DC, $DC
.charmap $DD, $DD
.charmap $DE, $DE
.charmap $DF, $DF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

View File

@ -924,7 +924,7 @@ KEY_QUESTIONMARK = KEY_SLASH | KEY_SHIFT
KEY_CLEAR = KEY_LESSTHAN | KEY_SHIFT
KEY_INSERT = KEY_GREATERTHAN | KEY_SHIFT
KEY_UP = KEY_UNDERLINE | KEY_CTRL
KEY_UP = KEY_DASH | KEY_CTRL
KEY_DOWN = KEY_EQUALS | KEY_CTRL
KEY_LEFT = KEY_PLUS | KEY_CTRL
KEY_RIGHT = KEY_ASTERISK | KEY_CTRL

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

@ -0,0 +1,301 @@
;/*****************************************************************************/
;/* */
;/* atari_atascii_charmap.inc */
;/* */
;/* Atari system standard string mapping ISO-8859-1 -> AtASCII */
;/* */
;/* */
;/* */
;/* C 2016 Christian Krueger */
;/* */
;/* */
;/* 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. */
;/* */
;/*****************************************************************************/
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $FD
.charmap $08, $08
.charmap $09, $7F
.charmap $0A, $9B
.charmap $0B, $0B
.charmap $0C, $7D
.charmap $0D, $0D
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $11
.charmap $12, $12
.charmap $13, $13
.charmap $14, $14
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
.charmap $5B, $5B
.charmap $5C, $5C
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $5F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $C0
.charmap $C1, $C1
.charmap $C2, $C2
.charmap $C3, $C3
.charmap $C4, $C4
.charmap $C5, $C5
.charmap $C6, $C6
.charmap $C7, $C7
.charmap $C8, $C8
.charmap $C9, $C9
.charmap $CA, $CA
.charmap $CB, $CB
.charmap $CC, $CC
.charmap $CD, $CD
.charmap $CE, $CE
.charmap $CF, $CF
.charmap $D0, $D0
.charmap $D1, $D1
.charmap $D2, $D2
.charmap $D3, $D3
.charmap $D4, $D4
.charmap $D5, $D5
.charmap $D6, $D6
.charmap $D7, $D7
.charmap $D8, $D8
.charmap $D9, $D9
.charmap $DA, $DA
.charmap $DB, $DB
.charmap $DC, $DC
.charmap $DD, $DD
.charmap $DE, $DE
.charmap $DF, $DF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

View File

@ -0,0 +1,303 @@
;/*****************************************************************************/
;/* */
;/* atari_screen_charmap.inc */
;/* */
;/* Atari system internal string mapping ISO-8859-1 -> Internal/Screen-Code */
;/* */
;/* */
;/* */
;/* C 2016 Christian Krueger */
;/* */
;/* */
;/* 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. */
;/* */
;/*****************************************************************************/
.charmap $00, $40
.charmap $01, $41
.charmap $02, $42
.charmap $03, $43
.charmap $04, $44
.charmap $05, $45
.charmap $06, $46
.charmap $07, $FD
.charmap $08, $48
.charmap $09, $7F
.charmap $0A, $DB
.charmap $0B, $4B
.charmap $0C, $7D
.charmap $0D, $4D
.charmap $0E, $4E
.charmap $0F, $4F
.charmap $10, $50
.charmap $11, $51
.charmap $12, $52
.charmap $13, $53
.charmap $14, $54
.charmap $15, $55
.charmap $16, $56
.charmap $17, $57
.charmap $18, $58
.charmap $19, $59
.charmap $1A, $5A
.charmap $1B, $5B
.charmap $1C, $5C
.charmap $1D, $5D
.charmap $1E, $5E
.charmap $1F, $5F
.charmap $20, $00
.charmap $21, $01
.charmap $22, $02
.charmap $23, $03
.charmap $24, $04
.charmap $25, $05
.charmap $26, $06
.charmap $27, $07
.charmap $28, $08
.charmap $29, $09
.charmap $2A, $0A
.charmap $2B, $0B
.charmap $2C, $0C
.charmap $2D, $0D
.charmap $2E, $0E
.charmap $2F, $0F
.charmap $30, $10
.charmap $31, $11
.charmap $32, $12
.charmap $33, $13
.charmap $34, $14
.charmap $35, $15
.charmap $36, $16
.charmap $37, $17
.charmap $38, $18
.charmap $39, $19
.charmap $3A, $1A
.charmap $3B, $1B
.charmap $3C, $1C
.charmap $3D, $1D
.charmap $3E, $1E
.charmap $3F, $1F
.charmap $40, $20
.charmap $41, $21
.charmap $42, $22
.charmap $43, $23
.charmap $44, $24
.charmap $45, $25
.charmap $46, $26
.charmap $47, $27
.charmap $48, $28
.charmap $49, $29
.charmap $4A, $2A
.charmap $4B, $2B
.charmap $4C, $2C
.charmap $4D, $2D
.charmap $4E, $2E
.charmap $4F, $2F
.charmap $50, $30
.charmap $51, $31
.charmap $52, $32
.charmap $53, $33
.charmap $54, $34
.charmap $55, $35
.charmap $56, $36
.charmap $57, $37
.charmap $58, $38
.charmap $59, $39
.charmap $5A, $3A
.charmap $5B, $3B
.charmap $5C, $3C
.charmap $5D, $3D
.charmap $5E, $3E
.charmap $5F, $3F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
.charmap $80, $C0
.charmap $81, $C1
.charmap $82, $C2
.charmap $83, $C3
.charmap $84, $C4
.charmap $85, $C5
.charmap $86, $C6
.charmap $87, $C7
.charmap $88, $C8
.charmap $89, $C9
.charmap $8A, $CA
.charmap $8B, $CB
.charmap $8C, $CC
.charmap $8D, $CD
.charmap $8E, $CE
.charmap $8F, $CF
.charmap $90, $D0
.charmap $91, $D1
.charmap $92, $D2
.charmap $93, $D3
.charmap $94, $D4
.charmap $95, $D5
.charmap $96, $D6
.charmap $97, $D7
.charmap $98, $D8
.charmap $99, $D9
.charmap $9A, $DA
.charmap $9B, $DB
.charmap $9C, $DC
.charmap $9D, $DD
.charmap $9E, $DE
.charmap $9F, $DF
.charmap $A0, $80
.charmap $A1, $81
.charmap $A2, $82
.charmap $A3, $83
.charmap $A4, $84
.charmap $A5, $85
.charmap $A6, $86
.charmap $A7, $87
.charmap $A8, $88
.charmap $A9, $89
.charmap $AA, $8A
.charmap $AB, $8B
.charmap $AC, $8C
.charmap $AD, $8D
.charmap $AE, $8E
.charmap $AF, $8F
.charmap $B0, $90
.charmap $B1, $91
.charmap $B2, $92
.charmap $B3, $93
.charmap $B4, $94
.charmap $B5, $95
.charmap $B6, $96
.charmap $B7, $97
.charmap $B8, $98
.charmap $B9, $99
.charmap $BA, $9A
.charmap $BB, $9B
.charmap $BC, $9C
.charmap $BD, $9D
.charmap $BE, $9E
.charmap $BF, $9F
.charmap $C0, $A0
.charmap $C1, $A1
.charmap $C2, $A2
.charmap $C3, $A3
.charmap $C4, $A4
.charmap $C5, $A5
.charmap $C6, $A6
.charmap $C7, $A7
.charmap $C8, $A8
.charmap $C9, $A9
.charmap $CA, $AA
.charmap $CB, $AB
.charmap $CC, $AC
.charmap $CD, $AD
.charmap $CE, $AE
.charmap $CF, $AF
.charmap $D0, $B0
.charmap $D1, $B1
.charmap $D2, $B2
.charmap $D3, $B3
.charmap $D4, $B4
.charmap $D5, $B5
.charmap $D6, $B6
.charmap $D7, $B7
.charmap $D8, $B8
.charmap $D9, $B9
.charmap $DA, $BA
.charmap $DB, $BB
.charmap $DC, $BC
.charmap $DD, $BD
.charmap $DE, $BE
.charmap $DF, $BF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

View File

@ -77,6 +77,8 @@ VIC_SPR_EXP_Y := $D017
VIC_SPR_EXP_X := $D01D
VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_COLL := $D01E
VIC_SPR_BG_COLL := $D01F
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026

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

@ -0,0 +1,291 @@
;/*****************************************************************************/
;/* */
;/* cbm_petscii_charmap.inc */
;/* */
;/* CBM system standard string mapping ISO-8859-1 -> PetSCII */
;/* */
;/* */
;/* 2019-03-10, Greg King */
;/* */
;/* 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 must not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $07
.charmap $08, $14
.charmap $09, $09
.charmap $0A, $0D
.charmap $0B, $11
.charmap $0C, $93
.charmap $0D, $0A
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $0B
.charmap $12, $12
.charmap $13, $13
.charmap $14, $08
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $C1
.charmap $42, $C2
.charmap $43, $C3
.charmap $44, $C4
.charmap $45, $C5
.charmap $46, $C6
.charmap $47, $C7
.charmap $48, $C8
.charmap $49, $C9
.charmap $4A, $CA
.charmap $4B, $CB
.charmap $4C, $CC
.charmap $4D, $CD
.charmap $4E, $CE
.charmap $4F, $CF
.charmap $50, $D0
.charmap $51, $D1
.charmap $52, $D2
.charmap $53, $D3
.charmap $54, $D4
.charmap $55, $D5
.charmap $56, $D6
.charmap $57, $D7
.charmap $58, $D8
.charmap $59, $D9
.charmap $5A, $DA
.charmap $5B, $5B
.charmap $5C, $BF
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $A4
.charmap $60, $AD
.charmap $61, $41
.charmap $62, $42
.charmap $63, $43
.charmap $64, $44
.charmap $65, $45
.charmap $66, $46
.charmap $67, $47
.charmap $68, $48
.charmap $69, $49
.charmap $6A, $4A
.charmap $6B, $4B
.charmap $6C, $4C
.charmap $6D, $4D
.charmap $6E, $4E
.charmap $6F, $4F
.charmap $70, $50
.charmap $71, $51
.charmap $72, $52
.charmap $73, $53
.charmap $74, $54
.charmap $75, $55
.charmap $76, $56
.charmap $77, $57
.charmap $78, $58
.charmap $79, $59
.charmap $7A, $5A
.charmap $7B, $B3
.charmap $7C, $DD
.charmap $7D, $AB
.charmap $7E, $B1
.charmap $7F, $DF
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $0C
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $60
.charmap $C1, $61
.charmap $C2, $62
.charmap $C3, $63
.charmap $C4, $64
.charmap $C5, $65
.charmap $C6, $66
.charmap $C7, $67
.charmap $C8, $68
.charmap $C9, $69
.charmap $CA, $6A
.charmap $CB, $6B
.charmap $CC, $6C
.charmap $CD, $6D
.charmap $CE, $6E
.charmap $CF, $6F
.charmap $D0, $70
.charmap $D1, $71
.charmap $D2, $72
.charmap $D3, $73
.charmap $D4, $74
.charmap $D5, $75
.charmap $D6, $76
.charmap $D7, $77
.charmap $D8, $78
.charmap $D9, $79
.charmap $DA, $7A
.charmap $DB, $7B
.charmap $DC, $7C
.charmap $DD, $7D
.charmap $DE, $7E
.charmap $DF, $7F
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

View File

@ -0,0 +1,305 @@
;/*****************************************************************************/
;/* */
;/* cbm_screen_charmap.inc */
;/* */
;/* c Copyright 2019, Gerhard W. Gruber (sparhawk@gmx.at) */
;/* */
;/* When using CBM mode, this include converts character literals */
;/* from ASCII to screen-code mapping, so you can write directly */
;/* to the screen memory. */
;/* */
;/* If this include is used, no additional macros are needed. */
;/* */
;/*****************************************************************************/
; Char $00 -> c + 128
.charmap $00, $80
; Char $01 ... $1A -> c + 128 + 64 control alphabet
.charmap $01, $C1
.charmap $02, $C2
.charmap $03, $C3
.charmap $04, $C4
.charmap $05, $C5
.charmap $06, $C6
.charmap $07, $C7
.charmap $08, $C8
.charmap $09, $C9
.charmap $0A, $CA
.charmap $0B, $CB
.charmap $0C, $CC
.charmap $0D, $CD
.charmap $0E, $CE
.charmap $0F, $CF
.charmap $10, $D0
.charmap $11, $D1
.charmap $12, $D2
.charmap $13, $D3
.charmap $14, $D4
.charmap $15, $D5
.charmap $16, $D6
.charmap $17, $D7
.charmap $18, $D8
.charmap $19, $D9
.charmap $1A, $DA
; Char $1B ... $1F -> c + 128
.charmap $1B, $9B
.charmap $1C, $9C
.charmap $1D, $9D
.charmap $1E, $9E
.charmap $1F, $9F
; Char $20 ... $3F -> c
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
; Char $40 -> c - 64
.charmap $40, $00
; Char $41 ... $5A -> c upper-case alphabet
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
; Char $5B ... $5F -> c - 64
.charmap $5B, $1B
.charmap $5C, $1C
.charmap $5D, $1D
.charmap $5E, $1E
.charmap $5F, $1F
; Char $60 -> c - 32
.charmap $60, $40
; Char $61 ... $7A -> c - 32 - 64 lower-case alphabet
.charmap $61, $01
.charmap $62, $02
.charmap $63, $03
.charmap $64, $04
.charmap $65, $05
.charmap $66, $06
.charmap $67, $07
.charmap $68, $08
.charmap $69, $09
.charmap $6A, $0A
.charmap $6B, $0B
.charmap $6C, $0C
.charmap $6D, $0D
.charmap $6E, $0E
.charmap $6F, $0F
.charmap $70, $10
.charmap $71, $11
.charmap $72, $12
.charmap $73, $13
.charmap $74, $14
.charmap $75, $15
.charmap $76, $16
.charmap $77, $17
.charmap $78, $18
.charmap $79, $19
.charmap $7A, $1A
; Char $7B ... $7F -> c - 32
.charmap $7B, $5B
.charmap $7C, $5C
.charmap $7D, $5D
.charmap $7E, $5E
.charmap $7F, $5F
; Char $80 -> c + 64
.charmap $80, $C0
; Char $81 ... $9A -> c control alphabet
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
; Char $9B ... $9F -> c + 64
.charmap $9B, $DB
.charmap $9C, $DC
.charmap $9D, $DD
.charmap $9E, $DE
.charmap $9F, $DF
; Char $A0 ... $BF -> c - 64
.charmap $A0, $60
.charmap $A1, $61
.charmap $A2, $62
.charmap $A3, $63
.charmap $A4, $64
.charmap $A5, $65
.charmap $A6, $66
.charmap $A7, $67
.charmap $A8, $68
.charmap $A9, $69
.charmap $AA, $6A
.charmap $AB, $6B
.charmap $AC, $6C
.charmap $AD, $6D
.charmap $AE, $6E
.charmap $AF, $6F
.charmap $B0, $70
.charmap $B1, $71
.charmap $B2, $72
.charmap $B3, $73
.charmap $B4, $74
.charmap $B5, $75
.charmap $B6, $76
.charmap $B7, $77
.charmap $B8, $78
.charmap $B9, $79
.charmap $BA, $7A
.charmap $BB, $7B
.charmap $BC, $7C
.charmap $BD, $7D
.charmap $BE, $7E
.charmap $BF, $7F
; Char $C0 ... $DF -> c - 128
.charmap $C0, $40
; Char $C1 ... $DA -> c - 128 - 64 lower-case alphabet
.charmap $C1, $01
.charmap $C2, $02
.charmap $C3, $03
.charmap $C4, $04
.charmap $C5, $05
.charmap $C6, $06
.charmap $C7, $07
.charmap $C8, $08
.charmap $C9, $09
.charmap $CA, $0A
.charmap $CB, $0B
.charmap $CC, $0C
.charmap $CD, $0D
.charmap $CE, $0E
.charmap $CF, $0F
.charmap $D0, $10
.charmap $D1, $11
.charmap $D2, $12
.charmap $D3, $13
.charmap $D4, $14
.charmap $D5, $15
.charmap $D6, $16
.charmap $D7, $17
.charmap $D8, $18
.charmap $D9, $19
.charmap $DA, $1A
; Char $DB ... $DF -> c - 128
.charmap $DB, $5B
.charmap $DC, $5C
.charmap $DD, $5D
.charmap $DE, $5E
.charmap $DF, $5F
; Char $E0 ... $FF -> c - 128
.charmap $E0, $60
.charmap $E1, $61
.charmap $E2, $62
.charmap $E3, $63
.charmap $E4, $64
.charmap $E5, $65
.charmap $E6, $66
.charmap $E7, $67
.charmap $E8, $68
.charmap $E9, $69
.charmap $EA, $6A
.charmap $EB, $6B
.charmap $EC, $6C
.charmap $ED, $6D
.charmap $EE, $6E
.charmap $EF, $6F
.charmap $F0, $70
.charmap $F1, $71
.charmap $F2, $72
.charmap $F3, $73
.charmap $F4, $74
.charmap $F5, $75
.charmap $F6, $76
.charmap $F7, $77
.charmap $F8, $78
.charmap $F9, $79
.charmap $FA, $7A
.charmap $FB, $7B
.charmap $FC, $7C
.charmap $FD, $7D
.charmap $FE, $7E
.charmap $FF, $7F

View File

@ -5,21 +5,21 @@
;** Screen
SCREEN_ROWS = 24
SCREEN_COLS = 32
SCREEN_PTR = $3A
CURSOR_X = $3C
CURSOR_Y = $3D
SCREEN_PTR := $3A
CURSOR_X := $3C
CURSOR_Y := $3D
;** VDP
VDP_DATA_R = $2000
VDP_STATUS_R = $2001
VDP_DATA_W = $3000
VDP_CONTROL_W = $3001
VDP_DATA_R := $2000
VDP_STATUS_R := $2001
VDP_DATA_W := $3000
VDP_CONTROL_W := $3001
;** PIA
PIA0_DATA = $1000
PIA0_STATUS = $1001
PIA1_DATA = $1002
PIA1_STATUS = $1003
PIA0_DATA := $1000
PIA0_STATUS := $1001
PIA1_DATA := $1002
PIA1_STATUS := $1003
;** General
CH_VLINE = 33
@ -30,11 +30,11 @@ CH_LLCORNER = 37
CH_LRCORNER = 38
;** I/O (Zero-page variables)
ZP_KEYBOARD = $10
ZP_JOY0_DIR = $11
ZP_JOY1_DIR = $13
ZP_JOY0_BUTTONS = $16
ZP_JOY1_BUTTONS = $17
ZP_KEYBOARD := $10
ZP_JOY0_DIR := $11
ZP_JOY1_DIR := $13
ZP_JOY0_BUTTONS := $16
ZP_JOY1_BUTTONS := $17
;** Joystick direction values (ZP_JOY0_DIR/ZP_JOY1_DIR)
JOY_N = $49
@ -54,8 +54,13 @@ JOY_WNW = $4C
JOY_NW = $4B
JOY_NNW = $4A
;** BIOS
BIOS_IRQ1_ADDR = $FF3F
BIOS_IRQ2_ADDR = $FF52
BIOS_NMI_RESET_ADDR = $F808
BIOS_WRITE_VDP_REG = $FE1F
;** BIOS routines
BIOS_NMI_RESET_ADDR := $F808
BIOS_PLAY_TUNE1 := $FBD6
BIOS_PLAY_SONG := $FBED
BIOS_PLAY_TUNE2 := $FCE6
BIOS_WRITE_VDP_REG := $FE1F
BIOS_QUIET_PSG := $FE54
BIOS_POKE_PSG := $FE77
BIOS_IRQ1_ADDR := $FF3F
BIOS_IRQ2_ADDR := $FF52

View File

@ -1,5 +1,5 @@
;
; CX16 r38 definitions
; CX16 r39 definitions
;
; ---------------------------------------------------------------------------
@ -10,8 +10,7 @@
WHITE
RED
CYAN
VIOLET
PURPLE = VIOLET
PURPLE
GREEN
BLUE
YELLOW
@ -84,7 +83,6 @@ LIGHTGREEN
LIGHTBLUE
GRAY3
PURPLE
VIOLET = PURPLE
CURS_LEFT
YELLOW
CYAN
@ -106,6 +104,10 @@ PI
; ---------------------------------------------------------------------------
; Zero page
; Banking registers
RAM_BANK := $00
ROM_BANK := $01
; GEOS and graphics pseudo-registers
.struct gREG
.org $02
@ -226,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
@ -236,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 := $0287 ; Status from previous I/O operation
IN_DEV := $028B ; Current input device number
OUT_DEV := $028C ; Current output device number
FNAM_LEN := $028F ; Length of filename
SECADR := $0291 ; Secondary address
DEVNUM := $0292 ; Device number
CURS_COLOR := $0373 ; Color under the cursor
CHARCOLOR := $0376 ; Cursor's color nybbles (high: background, low: foreground)
RVS := $0377 ; Reverse flag
@ -257,8 +258,8 @@ LLEN := $0386 ; Line length
NLINES := $0387 ; Number of screen lines
; BASIC
VARTAB := $03E2 ; Pointer to start of BASIC variables
MEMSIZE := $03EA ; Pointer to highest BASIC RAM location (+1)
VARTAB := $03E1 ; Pointer to start of BASIC variables
MEMSIZE := $0259 ; Pointer to highest BASIC RAM location (+1)
; ---------------------------------------------------------------------------
; Vector and other locations
@ -270,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
@ -498,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
ADDR .byte
.union
DATA .byte
STATUS .byte
.endunion
.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
@ -556,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

@ -7,7 +7,7 @@
;/* */
;/* */
;/* (C) 2002-2003 Ullrich von Bassewitz */
;/* Römerstrasse 52 */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
@ -75,7 +75,7 @@ EMD_API_VERSION = $02
;------------------------------------------------------------------------------
; Driver entry points
.global emd_install
.global emd_uninstall
.global emd_pagecount

View File

@ -1,13 +1,13 @@
;
;
; Ullrich von Bassewitz, 16.05.2000
;
; Variables and functions
.global __errno, __oserror
.global __osmaperrno
.global __seterrno
.global __directerrno, __mappederrno
.global ___errno, ___oserror
.global ___osmaperrno
.global ___seterrno
.global ___directerrno, ___mappederrno
; Error codes, must match the values in the C headers
.enum

View File

@ -31,10 +31,8 @@
; bgt - jump if unsigned greater
.macro bgt Arg
.local L
beq L
beq *+4
bcs Arg
L:
.endmacro
; ble - jump if unsigned less or equal

View File

@ -7,7 +7,7 @@
;/* */
;/* */
;/* (C) 2002-2006, Ullrich von Bassewitz */
;/* Römerstraße 52 */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */

31
asminc/kim1.inc Normal file
View File

@ -0,0 +1,31 @@
; ---------------------------------------------------------------------------
;
; KIM-1 definitions
;
; ---------------------------------------------------------------------------
RAMSTART := $0200 ; Entry point
; ---------------------------------------------------------------------------
; Monitor Functions
; ---------------------------------------------------------------------------
OUTCHR := $1EA0 ; Output character
INTCHR := $1E5A ; Input character without case conversion
DUMPT := $1800 ; Dump memory to tape
LOADT := $1873 ; Load memory from tape
START := $1C4F ; Enter KIM-1 monitor
SCANDS := $1F1F ; Scan 7-segment display
KEYIN := $1F40 ; Open up keyboard channel
GETKEY := $1F6A ; Return key from keyboard
; ---------------------------------------------------------------------------
; System Memory
; ---------------------------------------------------------------------------
SAL := $17F5 ; Tape load address low
SAH := $17F6 ; Tape load address high
EAL := $17F7 ; Tape address end low
EAH := $17F8 ; Tape address end high
ID := $17F9 ; Tape Identification number

View File

@ -81,8 +81,42 @@ MATHJ = $FC6F
; Suzy Misc
SPRCTL0 = $FC80
SPRCTL0 = $FC80
; Sprite bits-per-pixel definitions
BPP_MASK = %11000000 ; Mask for settings bits per pixel
BPP_1 = %00000000
BPP_2 = %01000000
BPP_3 = %10000000
BPP_4 = %11000000
; More sprite control 0 bit definitions
HFLIP = %00100000
VFLIP = %00010000
; Sprite types - redefined to reflect the reality caused by the shadow error
TYPE_SHADOW = %00000111
TYPE_XOR = %00000110
TYPE_NONCOLL = %00000101 ; Non-colliding
TYPE_NORMAL = %00000100
TYPE_BOUNDARY = %00000011
TYPE_BSHADOW = %00000010 ; Background shadow
TYPE_BACKNONCOLL = %00000001 ; Background non-colliding
TYPE_BACKGROUND = %00000000
SPRCTL1 = $FC81
LITERAL = %10000000
PACKED = %00000000
ALGO3 = %01000000 ; Broken, do not set this bit!
; Sprite reload mask definitions
RELOAD_MASK = %00110000
RENONE = %00000000 ; Reload nothing
REHV = %00010000 ; Reload hsize, vsize
REHVS = %00100000 ; Reload hsize, vsize, stretch
REHVST = %00110000 ; Reload hsize, vsize, stretch, tilt
; More sprite control 1 bit definitions
REUSEPAL = %00001000
SKIP = %00000100
DRAWUP = %00000010
DRAWLEFT = %00000001
SPRCOLL = $FC82
SPRINIT = $FC83
SUZYHREV = $FC88
@ -135,35 +169,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

@ -50,7 +50,6 @@ PET_2000 = $CA
PET_3000 = $FC
PET_4000 = $FD
;----------------------------------------------------------------------------
; Vector and other locations
@ -59,7 +58,25 @@ BRKVec := $0092
NMIVec := $0094
; ---------------------------------------------------------------------------
; I/O: 6522 VIA2
; I/O: 6520 PIA1
PIA1 := $E810 ; PIA1 base address
PIA1_PORTA := PIA1+$0 ; Port A (PA) and data direction register A (DDRA)
PIA1_PACTL := PIA1+$1 ; Port A control register (CRA)
PIA1_PORTB := PIA1+$2 ; Port B (PB) and data direction register B (DDRB)
PIA1_PBCTL := PIA1+$3 ; Port B control register (CRB)
; ---------------------------------------------------------------------------
; I/O: 6520 PIA2
PIA2 := $E820 ; PIA2 base address
PIA2_PORTA := PIA2+$0 ; Port A (PA) and data direction register A (DDRA)
PIA2_PACTL := PIA2+$1 ; Port A control register (CRA)
PIA2_PORTB := PIA2+$2 ; Port B (PB) and data direction register B (DDRB)
PIA2_PBCTL := PIA2+$3 ; Port B control register (CRB)
; ---------------------------------------------------------------------------
; I/O: 6522 VIA
VIA := $E840 ; VIA base address
VIA_PB := VIA+$0 ; Port register B

97
asminc/rp6502.inc Normal file
View File

@ -0,0 +1,97 @@
; Picocomputer 6502 general defines
; RIA UART
RIA_READY := $FFE0 ; TX=$80 RX=$40
RIA_TX := $FFE1
RIA_RX := $FFE2
; VSYNC from PIX VGA
RIA_VSYNC := $FFE3
; RIA XRAM portal 0
RIA_RW0 := $FFE4
RIA_STEP0 := $FFE5
RIA_ADDR0 := $FFE6
; RIA XRAM portal 1
RIA_RW1 := $FFE8
RIA_STEP1 := $FFE9
RIA_ADDR1 := $FFEA
; RIA OS fastcall
RIA_XSTACK := $FFEC
RIA_ERRNO := $FFED
RIA_OP := $FFEF
RIA_IRQ := $FFF0
RIA_SPIN := $FFF1
RIA_BUSY := $FFF2 ; Bit $80
RIA_A := $FFF4
RIA_X := $FFF6
RIA_SREG := $FFF8
; RIA OS operation numbers
RIA_OP_EXIT := $FF
RIA_OP_ZXSTACK := $00
RIA_OP_XREG := $01
RIA_OP_PHI2 := $02
RIA_OP_CODEPAGE := $03
RIA_OP_LRAND := $04
RIA_OP_STDIN_OPT := $05
RIA_OP_CLOCK_GETRES := $10
RIA_OP_CLOCK_GETTIME := $11
RIA_OP_CLOCK_SETTIME := $12
RIA_OP_CLOCK_GETTIMEZONE := $13
RIA_OP_OPEN := $14
RIA_OP_CLOSE := $15
RIA_OP_READ_XSTACK := $16
RIA_OP_READ_XRAM := $17
RIA_OP_WRITE_XSTACK := $18
RIA_OP_WRITE_XRAM := $19
RIA_OP_LSEEK := $1A
RIA_OP_UNLINK := $1B
RIA_OP_RENAME := $1C
; 6522 VIA
VIA := $FFD0 ; VIA base address
VIA_PB := VIA+$0 ; Port register B
VIA_PA1 := VIA+$1 ; Port register A
VIA_PRB := VIA+$0 ; *** Deprecated ***
VIA_PRA := VIA+$1 ; *** Deprecated ***
VIA_DDRB := VIA+$2 ; Data direction register B
VIA_DDRA := VIA+$3 ; Data direction register A
VIA_T1CL := VIA+$4 ; Timer 1, low byte
VIA_T1CH := VIA+$5 ; Timer 1, high byte
VIA_T1LL := VIA+$6 ; Timer 1 latch, low byte
VIA_T1LH := VIA+$7 ; Timer 1 latch, high byte
VIA_T2CL := VIA+$8 ; Timer 2, low byte
VIA_T2CH := VIA+$9 ; Timer 2, high byte
VIA_SR := VIA+$A ; Shift register
VIA_CR := VIA+$B ; Auxiliary control register
VIA_PCR := VIA+$C ; Peripheral control register
VIA_IFR := VIA+$D ; Interrupt flag register
VIA_IER := VIA+$E ; Interrupt enable register
VIA_PA2 := VIA+$F ; Port register A w/o handshake
; Values in ___oserror are the union of these FatFs errors and errno.inc
.enum
FR_OK = 32 ; Succeeded
FR_DISK_ERR ; A hard error occurred in the low level disk I/O layer
FR_INT_ERR ; Assertion failed
FR_NOT_READY ; The physical drive cannot work
FR_NO_FILE ; Could not find the file
FR_NO_PATH ; Could not find the path
FR_INVALID_NAME ; The path name format is invalid
FR_DENIED ; Access denied due to prohibited access or directory full
FR_EXIST ; Access denied due to prohibited access
FR_INVALID_OBJECT ; The file/directory object is invalid
FR_WRITE_PROTECTED ; The physical drive is write protected
FR_INVALID_DRIVE ; The logical drive number is invalid
FR_NOT_ENABLED ; The volume has no work area
FR_NO_FILESYSTEM ; There is no valid FAT volume
FR_MKFS_ABORTED ; The f_mkfs() aborted due to any problem
FR_TIMEOUT ; Could not get a grant to access the volume within defined period
FR_LOCKED ; The operation is rejected according to the file sharing policy
FR_NOT_ENOUGH_CORE ; LFN working buffer could not be allocated
FR_TOO_MANY_OPEN_FILES ; Number of open files > FF_FS_LOCK
FR_INVALID_PARAMETER ; Given parameter is invalid
.endenum

View File

@ -7,7 +7,7 @@
;* *
;* *
;*(C) 2003-2006, Ullrich von Bassewitz *
;* Römerstrasse 52 *
;* Roemerstrasse 52 *
;* D-70794 Filderstadt *
;*EMail: uz@cc65.org *
;* *

View File

@ -49,8 +49,8 @@ SIGCOUNT = 6 ; Number of signals
.global sigtable
; Function declarations
.global __sig_ign
.global __sig_dfl
.global ___sig_ign
.global ___sig_dfl
.global _signal
.global _raise

64
asminc/stat.inc Normal file
View File

@ -0,0 +1,64 @@
;****************************************************************************
;* *
;* stat.inc *
;* *
;* Stat struct *
;* *
;* *
;* *
;*(C) 2023 Colin Leroy-Mira <colin@colino.net> *
;* *
;* *
;*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. *
;* *
;****************************************************************************
.include "time.inc"
;------------------------------------------------------------------------------
; st_mode values
S_IFDIR = $01
S_IFREG = $02
;------------------------------------------------------------------------------
; struct stat
.struct stat
st_dev .dword
st_ino .dword
st_mode .byte
st_nlink .dword
st_uid .byte
st_gid .byte
st_size .dword
st_atim .tag timespec
st_ctim .tag timespec
st_mtim .tag timespec
.ifdef __APPLE2__
st_access .byte
st_type .byte
st_auxtype .word
st_storagetype .byte
st_blocks .word
st_mod_date .word
st_mod_time .word
st_create_date .word
st_create_time .word
.endif
.endstruct

46
asminc/statvfs.inc Normal file
View File

@ -0,0 +1,46 @@
;****************************************************************************
;* *
;* statvfs.inc *
;* *
;* Statvfs struct *
;* *
;* *
;* *
;*(C) 2023 Colin Leroy-Mira <colin@colino.net> *
;* *
;* *
;*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. *
;* *
;****************************************************************************
;------------------------------------------------------------------------------
; struct statvfs
.struct statvfs
f_bsize .dword
f_frsize .dword
f_blocks .dword
f_bfree .dword
f_bavail .dword
f_files .dword
f_ffree .dword
f_favail .dword
f_fsid .dword
f_flag .dword
f_namemax .dword
.endstruct

View File

@ -7,7 +7,7 @@
;* */
;* */
;* (C) 2003-2005, Ullrich von Bassewitz */
;* Römerstrasse 52 */
;* Roemerstrasse 52 */
;* D-70794 Filderstadt */
;* EMail: uz@cc65.org */
;* */
@ -44,7 +44,9 @@ EOF = -1
.if .defined(__APPLE2__)
FILENAME_MAX = 64+1
.elseif .defined(__ATARI__)
FILENAME_MAX = 12+1
FILENAME_MAX = 63+1
.elseif .defined(__CBM__)
FILENAME_MAX = 255
.elseif .defined(__LUNIX__)
FILENAME_MAX = 80+1
.elseif .defined(__TELESTRAT__)

186
asminc/sym1.inc Normal file
View File

@ -0,0 +1,186 @@
; ---------------------------------------------------------------------------
;
; SYM-1 definitions
;
; ---------------------------------------------------------------------------
RAMSTART := $0200 ; Entry point
; ---------------------------------------------------------------------------
; Monitor Functions
; ---------------------------------------------------------------------------
WARM := $8003 ; Monitor entry
SVNMI := $809B ; Save NMI entry
INBYTE := $81D9 ; Get two HEX characters and pack
ASCNIB := $8275 ; Test for carriage-return
INCCMP := $82B2 ; Increment pointer
CHKSAD := $82DD ; Compute checksum
OUTPC := $82EE ; Display program counter
OUTBYT := $82FA ; Print byte as two ASCII characters
OUTS2 := $8319 ; Print pointer
INSTAT := $8386 ; Determine if key is pressed
GETKEY := $88AF ; Get key (disregarding monitor login)
SCAND := $8906 ; Flash LED display (once)
KEYQ := $8923 ; Test for keypress
BEEP := $8972 ; Make a beep
CONFIG := $89A5 ; Configure I/O
OUTDSP := $89C1 ; Output to on-board LED display
INCHR := $8A1B ; Input character and convert to uppercase
OUTCHR := $8A47 ; Output character
INTCHR := $8A58 ; Input character without case conversion
DLYF := $8AE6 ; Delay 1 bit time
DLYH := $8AE9 ; Delay 1/2 bit time
RESET := $8B4A ; Hard reset
ACCESS := $8B86 ; Unlock lowest 4K memory
NACCES := $8B9C ; Lock lowest 4K memory
L8C78 := $8C78 ; Link to tape
DUMPT := $8E87 ; Dump memory to tape
LOADT := $8C78 ; Load memory from tape
TAPEMODE := $00FD ; Top bit on for high-speed
; ---------------------------------------------------------------------------
; System Memory
; ---------------------------------------------------------------------------
DISBUF := $A640 ; On-Board Display Buffer
DISBUF0 := $A640 ; Left-Most digit
DISBUF1 := $A641 ; Second digit
DISBUF2 := $A642 ; Third
DISBUF3 := $A643 ; Fourth
DISBUF4 := $A644 ; Fifth
DISBUF5 := $A645 ; Sixth and right-most digit
DISBUF6 := $A646 ; Not-used / right of display (shift buffer)
RDIG := $A645 ; Right-most digit (same as DISBUF5)
P3L := $A64A ; Parameter 3 (low-byte)
P3H := $A64B ; (high-byte)
P2L := $A64C ; Parameter 2
P2H := $A64D ;
P1L := $A64E ; Parameter 1
P1H := $A64F
PARNR := $A649 ; Number of Parameters Entered
PADBIT := $A650 ; Pad Bits for Carriage Return
SDBYT := $A651 ; Baud Rate for RS232 (01-4800,06-2400,10-1200,24-600,4C-300,D5-110)
ERCNT := $A652 ; Error Count (Max FF)
TECHO := $A653 ; Terminal Echo (bit-7=ECHO/NO, 6=CTL-O TOGGLE)
TOUTFL := $A654 ; Output Flags (bit-7=CRT IN, 6=TTY IN, 5=TTY OUT, 4=CRT OUT)
KSHFL := $A655 ; Keyboard Shift Flag
TV := $A656 ; Trace Velocity (0=Single Step)
LSTCOM := $A657 ; Last Monitor Command
MAXRC := $A658 ; Maximum Record Length for Memory Dump
; ---------------------------------------------------------------------------
; Register Followers
; ---------------------------------------------------------------------------
PCLR := $A659 ; Program Counter (low-byte)
PCHR := $A65A ; (high-byte)
SR := $A65B ; Stack Pointer
FR := $A65C ; Status Register Flags
AR := $A65D ; A Register
XR := $A65E ; X Register
YR := $A65F ; Y Register
; ---------------------------------------------------------------------------
; I/O Vectors (3 bytes each)
; ---------------------------------------------------------------------------
INVEC := $A660 ; Input Character
OUTVEC := $A663 ; Output Character
INSVEC := $A666 ; Input Status
URSVEC := $A669 ; Unrecognized Syntax
URCVEC := $A66C ; Unrecognized Command / Error
SCNVEC := $A66F ; Scan On-board Display
; ---------------------------------------------------------------------------
; Trace and Interrupt Vectors (2 bytes each)
; ---------------------------------------------------------------------------
EXEVEC := $A672 ; Exec and Alternate InVec
TRCVEC := $A674 ; Trace
UBRKVC := $A676 ; User Break after Monitor
UIRQVC := $A678 ; User non-break IRQ after Monitor
NMIVEC := $A67A ; Non-Maskable Interrupt
RSTVEC := $A67C ; Reset
IRQVEC := $A67E ; Interrupt Request
; ---------------------------------------------------------------------------
; I/O Registers
; ---------------------------------------------------------------------------
;
; 6532 (U27)
;
PADA := $A400 ; Keyboard / Display
P3DA := $A402 ; Serial I/O
DDPADA := $A401 ; Data-Direction Register for PADA
DDP3DA := $A403 ; Data-Direction Register for P3DA
WEDRTA := $A404 ; Write-Edge Detect Read Timer A
WEDRFA := $A405 ; Write-Edge Detect Read-Int Flags A
WEDRTB := $A406 ; Write-Edge Detect Read Timer B
WEDRFB := $A407 ; Write-Edge Detect Read-Int Flags B
TIM0001 := $A41C ; Timer / 1
TIM0008 := $A41D ; Timer / 8
TIM0064 := $A41E ; Timer / 64
TIM1024 := $A41F ; Timer / 1024
;
; 6522 (U25)
;
OR1A := $A001 ; Input / Output Register for 1A
DDR1A := $A003 ; Data-Direction Register for 1A
OR1B := $A000 ; Input / Output Register for 1B
DDR1B := $A002 ; Data-Direction Register for 1B
TIC1L := $A004 ;
TIC1H := $A005 ;
TIL1L := $A006 ;
TIL1H := $A007 ;
T2L1L := $A008 ;
T2C1L := $A008 ;
T2C1H := $A009 ;
SR1 := $A00A ;
ACR1 := $A00B ;
PCR1 := $A00C ;
IFR1 := $A00D ;
IER1 := $A00E ;
DR1A := $A00F ;
;
; 6522 (U28)
;
OR2A := $A801 ; Input / Output Register for 2A
DDR2A := $A803 ; Data-Direction Register for 2A
OR2B := $A800 ; Input / Output Register for 2B
DDR2B := $A802 ; Data-Direction Register for 2B
TIC2L := $A804 ;
TIC2H := $A805 ;
TIL2L := $A806 ;
TIL2H := $A807 ;
T2L2L := $A808 ;
T2C2L := $A808 ;
T2C2H := $A809 ;
SR2 := $A80A ;
ACR2 := $A80B ;
PCR2 := $A80C ;
IFR2 := $A80D ;
IER2 := $A80E ;
DR2A := $A80F ;
;
; 6522 (U29)
;
OR3A := $AC01 ; Write-Protect RAM, Debug On/Off, I/O-3A
DDR3A := $AC03 ; Data-Direction Register for 3A
OR3B := $AC00 ; Input / Output Register for 3B
DDR3B := $AC02 ; Data-Direction Register for 3B
TIC3L := $AC04 ;
TIC3H := $AC05 ;
TIL3L := $AC06 ;
TIL3H := $AC07 ;
T2L3L := $AC08 ;
T2C3L := $AC08 ;
T2C3H := $AC09 ;
SR3 := $AC0A ;
ACR3 := $AC0B ;
PCR3 := $AC0C ;
IFR3 := $AC0D ;
IER3 := $AC0E ;
DR3A := $AC0F ;

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
@ -48,33 +48,33 @@ TR7 := $13
DEFAFF := $14
IRQSVA := $21 ; Used to save A when a BRK call occurs
IRQSVX := $22 ; Used to save X when a BRK call occurs
IRQSVY := $23 ; Used to save Y when a BRK call occurs
IRQSVP := $24 ; Used to save P when a BRK call occurs
IRQSVA := $21 ; Used to save A when a BRK call occurs
IRQSVX := $22 ; Used to save X when a BRK call occurs
IRQSVY := $23 ; Used to save Y when a BRK call occurs
IRQSVP := $24 ; Used to save P when a BRK call occurs
ADSCR := $26
SCRNB := $28 ; Id of the current window
SCRNB := $28 ; Id of the current window
ADKBD := $2A ; Address ASCII conversion table
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
ADCLK := $40 ; Address for clock display
TIMEUS := $42
TIMEUD := $44
TIMEUD := $44 ; Counter clock (1/10 of a second)
HRSX := $46
HRSY := $47
XLPRBI := $48 ; Printer flag (b7)
XLPRBI := $48 ; Printer flag (b7)
HRSX40 := $49
HRSX6 := $4A
ADHRS := $4B ; Hires screen address (word)
ADHRS := $4B ; Hires screen address (word)
HRS1 := $4D
HRS2 := $4F
@ -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,19 +249,22 @@ 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
XMAINARGS = $2C ; Only available for Orix
XEDT = $2D ; Launch editor
XINSER = $2E
XGETARGV = $2E ; Only available for Orix
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,43 +272,82 @@ 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
XFSEEK = $3F ; Only in Orix
; 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
XMKDIR = $4B ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
XRM = $4D ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
XFWR = $4E ; Put a char on the first screen. Only available in TELEMON 3.x (bank 7 of Orix)
XGOKBD = $52
; Path Management
XGETCWD = $48 ; Get current CWD
XPUTCWD = $49 ; Chdir
; File management
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 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 ...)
; 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)
XFREE = $62 ; Only in TELEMON 3.x (bank 7 of Orix)
XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
XMALLOC = $5B ; Only in Orix
; RS232 primitives
XSDUMP = $5C ; RS232 input dump
XCONSO = $5D ; Swap screen into RS232 terminal
XSLOAD = $5E ; Read a file from RS232
XSSAVE = $5F ; Write a file to RS232
; Minitel primitives
XMLOAD = $60 ; Read a file from Minitel
XMSAVE = $61 ; Write a file to Minitel
XFREE = $62 ; Only in Orix
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 : 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
@ -323,8 +365,8 @@ XPING = $9D ; Send Ping sound to PSG
PWD_PTR = $00
; ---------------------------------------------------------------------------
;
BUFTRV := $100
;
BUFTRV := $100
; ---------------------------------------------------------------------------
@ -337,12 +379,12 @@ FLGTEL := $20D
KOROM := $20E ; Used to compute the size of all rom bank. The result is store here. The value is in KB
KORAM := $20F ; Used to compute the size of all ram bank. The result is store here. The value is in KB
; Time management
TIMED := $210
TIMED := $210 ; Clock (1/10 of seconds)
TIMES := $211
TIMEM := $212
TIMEH := $213
FLGCLK := $214
FLGCLK_FLAG := $215
FLGCLK_FLAG := $215
FLGCUR := $216 ; Cursor management flag
; screens position managements
@ -431,7 +473,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
@ -445,7 +487,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
@ -497,7 +539,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

@ -7,7 +7,7 @@
;/* */
;/* */
;/* (C) 2003 Ullrich von Bassewitz */
;/* Römerstrasse 52 */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
@ -33,7 +33,7 @@
; Struct utsname
; Struct utsname
.struct utsname
sysname .byte 17
nodename .byte 9

View File

@ -1,8 +1,7 @@
;
; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
; VIC-20 generic definitions. Stolen mostly from c64.inc -- Steve Schmidtke
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
@ -36,6 +35,8 @@ KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
RSSTAT := $297 ; RS-232 device driver status
; ---------------------------------------------------------------------------
; Screen size
@ -89,7 +90,7 @@ VIA1_T1LH := VIA1+$7 ; Timer 1 latch, high byte
VIA1_T2CL := VIA1+$8 ; Timer 2, low byte
VIA1_T2CH := VIA1+$9 ; Timer 2, high byte
VIA1_SR := VIA1+$A ; Shift register
VIA1_CR := VIA1+$B ; Auxiliary control register
VIA1_ACR := VIA1+$B ; Auxiliary control register
VIA1_PCR := VIA1+$C ; Peripheral control register
VIA1_IFR := VIA1+$D ; Interrupt flag register
VIA1_IER := VIA1+$E ; Interrupt enable register
@ -111,7 +112,7 @@ VIA2_T1LH := VIA2+$7 ; Timer 1 latch, high byte
VIA2_T2CL := VIA2+$8 ; Timer 2, low byte
VIA2_T2CH := VIA2+$9 ; Timer 2, high byte
VIA2_SR := VIA2+$A ; Shift register
VIA2_CR := VIA2+$B ; Auxiliary control register
VIA2_ACR := VIA2+$B ; Auxiliary control register
VIA2_PCR := VIA2+$C ; Peripheral control register
VIA2_IFR := VIA2+$D ; Interrupt flag register
VIA2_IER := VIA2+$E ; Interrupt enable register

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

View File

@ -27,7 +27,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro start = $4000;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -43,7 +43,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -22,7 +22,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -26,7 +26,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -27,7 +27,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro start = $4000;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -43,7 +43,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -22,7 +22,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -26,7 +26,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
LC: load = MAIN, run = LC, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

View File

@ -52,7 +52,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
AUTOSTRT: load = TRAILER, type = ro;
OVERLAY1: load = OVL1, type = ro, define = yes, optional = yes;

View File

@ -36,7 +36,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
}
FEATURES {

View File

@ -40,7 +40,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
AUTOSTRT: load = TRAILER, type = ro;
}

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

@ -54,7 +54,7 @@ SEGMENTS {
SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes;
SRPREPHDR: load = SRPREPHDR, type = ro;
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and MAIN, not zero initialized
SRPREP: load = SRPREPCHNK, type = rw, define = yes;
SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
@ -67,7 +67,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
AUTOSTRT: load = TRAILER, type = ro;
}

View File

@ -65,7 +65,7 @@ SEGMENTS {
SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes;
SRPREPHDR: load = SRPREPHDR, type = ro;
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and MAIN, not zero initialized
SRPREP: load = SRPREPCHNK, type = rw, define = yes;
SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM2, type = rw, define = yes, optional = yes;
@ -78,7 +78,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
AUTOSTRT: load = TRAILER, type = ro;

View File

@ -48,7 +48,7 @@ SEGMENTS {
EXTZP: load = ZP, type = zp, optional = yes;
SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and MAIN, not zero initialized
SRPREP: load = SRPREPCHNK, type = rw, define = yes;
SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM2, type = rw, define = yes, optional = yes;
@ -58,7 +58,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
SRPREPHDR: load = UNUSED, type = ro;
SRPREPTRL: load = UNUSED, type = ro;

View File

@ -52,7 +52,7 @@ SEGMENTS {
SYSCHKTRL: load = SYSCHKTRL, type = ro, optional = yes;
SRPREPHDR: load = SRPREPHDR, type = ro;
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and MAIN, not zero initialized
SRPREP: load = SRPREPCHNK, type = rw, define = yes;
SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM2, type = rw, define = yes, optional = yes;
@ -65,7 +65,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
AUTOSTRT: load = TRAILER, type = ro;
}

View File

@ -23,7 +23,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BASTAIL: load = MAIN, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

20
cfg/c128-asm.cfg Normal file
View File

@ -0,0 +1,20 @@
FEATURES {
STARTADDRESS: default = $1c01;
}
SYMBOLS {
__LOADADDR__: type = import;
}
MEMORY {
ZP: file = "", start = $0002, size = $00FE, define = yes;
LOADADDR: file = %O, start = %S - 2, size = $0002;
MAIN: file = %O, start = %S, size = $D000 - %S;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, optional = yes, define = yes;
}

View File

@ -44,7 +44,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
OVL1ADDR: load = OVL1ADDR, type = ro;

View File

@ -23,7 +23,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
}

View File

@ -11,10 +11,10 @@ SEGMENTS {
ZP: load = ZP, type = zp, optional = yes;
VECTORS: load = ROM, run = RAM, type = rw, define = yes;
DATA: load = ROM, run = RAM, type = rw, define = yes, start = $0204;
INIT: load = RAM, type = bss, optional = yes;
BSS: load = RAM, type = bss, define = yes;
ONCE: load = ROM, type = ro, optional = yes;
CODE: load = ROM, type = ro;
INIT: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
AUDIO: load = ROM, type = ro, optional = yes, start = $BF00;
SETUP: load = ROM, type = ro, start = $BFE8;

View File

@ -1,5 +1,3 @@
# Assembly configuration for R38
FEATURES {
STARTADDRESS: default = $0801;
}
@ -22,9 +20,11 @@ SEGMENTS {
EXEHDR: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
ONCE: load = MAIN, type = ro, optional = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
BSS: load = MAIN, type = bss, define = yes;
INIT: load = MAIN, type = bss, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
}
FEATURES {
CONDES: type = constructor,

View File

@ -16,8 +16,6 @@ MEMORY {
HEADER: file = %O, define = yes, start = %S, size = $000D;
MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __HEADER_LAST__;
BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __ONCE_RUN__ - __STACKSIZE__;
# BRAM00ADDR: file = "%O.00", start = __BANKRAMSTART__ - 2, size = $0002;
# BRAM00: file = "%O.00", start = __BANKRAMSTART__, size = __BANKRAMSIZE__;
BRAM01ADDR: file = "%O.01", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM01: file = "%O.01", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $01;
BRAM02ADDR: file = "%O.02", start = __BANKRAMSTART__ - 2, size = $0002;
@ -36,64 +34,62 @@ MEMORY {
BRAM08: file = "%O.08", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $08;
BRAM09ADDR: file = "%O.09", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM09: file = "%O.09", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $09;
BRAM0AADDR: file = "%O.0a", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0A: file = "%O.0a", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0A;
BRAM0BADDR: file = "%O.0b", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0B: file = "%O.0b", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0B;
BRAM0CADDR: file = "%O.0c", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0C: file = "%O.0c", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0C;
BRAM0DADDR: file = "%O.0d", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0D: file = "%O.0d", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0D;
BRAM0EADDR: file = "%O.0e", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0E: file = "%O.0e", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0E;
BRAM0FADDR: file = "%O.0f", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0F: file = "%O.0f", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0F;
BRAM0AADDR: file = "%O.0A", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0A: file = "%O.0A", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0A;
BRAM0BADDR: file = "%O.0B", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0B: file = "%O.0B", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0B;
BRAM0CADDR: file = "%O.0C", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0C: file = "%O.0C", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0C;
BRAM0DADDR: file = "%O.0D", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0D: file = "%O.0D", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0D;
BRAM0EADDR: file = "%O.0E", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0E: file = "%O.0E", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0E;
BRAM0FADDR: file = "%O.0F", start = __BANKRAMSTART__ - 2, size = $0002;
BRAM0F: file = "%O.0F", start = __BANKRAMSTART__, size = __BANKRAMSIZE__, bank = $0F;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
EXTZP: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = HEADER, type = ro;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro, optional = yes;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
# BRAM00ADDR: load = BRAM00ADDR, type = ro, optional = yes;
# BANKRAM00: load = BRAM00, type = rw, define = yes, optional = yes;
BRAM01ADDR: load = BRAM01ADDR, type = ro, optional = yes;
BANKRAM01: load = BRAM01, type = rw, define = yes, optional = yes;
BRAM02ADDR: load = BRAM02ADDR, type = ro, optional = yes;
BANKRAM02: load = BRAM02, type = rw, define = yes, optional = yes;
BRAM03ADDR: load = BRAM03ADDR, type = ro, optional = yes;
BANKRAM03: load = BRAM03, type = rw, define = yes, optional = yes;
BRAM04ADDR: load = BRAM04ADDR, type = ro, optional = yes;
BANKRAM04: load = BRAM04, type = rw, define = yes, optional = yes;
BRAM05ADDR: load = BRAM05ADDR, type = ro, optional = yes;
BANKRAM05: load = BRAM05, type = rw, define = yes, optional = yes;
BRAM06ADDR: load = BRAM06ADDR, type = ro, optional = yes;
BANKRAM06: load = BRAM06, type = rw, define = yes, optional = yes;
BRAM07ADDR: load = BRAM07ADDR, type = ro, optional = yes;
BANKRAM07: load = BRAM07, type = rw, define = yes, optional = yes;
BRAM08ADDR: load = BRAM08ADDR, type = ro, optional = yes;
BANKRAM08: load = BRAM08, type = rw, define = yes, optional = yes;
BRAM09ADDR: load = BRAM09ADDR, type = ro, optional = yes;
BANKRAM09: load = BRAM09, type = rw, define = yes, optional = yes;
BRAM0AADDR: load = BRAM0AADDR, type = ro, optional = yes;
BANKRAM0A: load = BRAM0A, type = rw, define = yes, optional = yes;
BRAM0BADDR: load = BRAM0BADDR, type = ro, optional = yes;
BANKRAM0B: load = BRAM0B, type = rw, define = yes, optional = yes;
BRAM0CADDR: load = BRAM0CADDR, type = ro, optional = yes;
BANKRAM0C: load = BRAM0C, type = rw, define = yes, optional = yes;
BRAM0DADDR: load = BRAM0DADDR, type = ro, optional = yes;
BANKRAM0D: load = BRAM0D, type = rw, define = yes, optional = yes;
BRAM0EADDR: load = BRAM0EADDR, type = ro, optional = yes;
BANKRAM0E: load = BRAM0E, type = rw, define = yes, optional = yes;
BRAM0FADDR: load = BRAM0FADDR, type = ro, optional = yes;
BANKRAM0F: load = BRAM0F, type = rw, define = yes, optional = yes;
INIT: load = MAIN, type = rw, optional = yes; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
BRAM01ADDR: load = BRAM01ADDR, type = ro, optional = yes;
BANKRAM01: load = BRAM01, type = rw, optional = yes, define = yes;
BRAM02ADDR: load = BRAM02ADDR, type = ro, optional = yes;
BANKRAM02: load = BRAM02, type = rw, optional = yes, define = yes;
BRAM03ADDR: load = BRAM03ADDR, type = ro, optional = yes;
BANKRAM03: load = BRAM03, type = rw, optional = yes, define = yes;
BRAM04ADDR: load = BRAM04ADDR, type = ro, optional = yes;
BANKRAM04: load = BRAM04, type = rw, optional = yes, define = yes;
BRAM05ADDR: load = BRAM05ADDR, type = ro, optional = yes;
BANKRAM05: load = BRAM05, type = rw, optional = yes, define = yes;
BRAM06ADDR: load = BRAM06ADDR, type = ro, optional = yes;
BANKRAM06: load = BRAM06, type = rw, optional = yes, define = yes;
BRAM07ADDR: load = BRAM07ADDR, type = ro, optional = yes;
BANKRAM07: load = BRAM07, type = rw, optional = yes, define = yes;
BRAM08ADDR: load = BRAM08ADDR, type = ro, optional = yes;
BANKRAM08: load = BRAM08, type = rw, optional = yes, define = yes;
BRAM09ADDR: load = BRAM09ADDR, type = ro, optional = yes;
BANKRAM09: load = BRAM09, type = rw, optional = yes, define = yes;
BRAM0AADDR: load = BRAM0AADDR, type = ro, optional = yes;
BANKRAM0A: load = BRAM0A, type = rw, optional = yes, define = yes;
BRAM0BADDR: load = BRAM0BADDR, type = ro, optional = yes;
BANKRAM0B: load = BRAM0B, type = rw, optional = yes, define = yes;
BRAM0CADDR: load = BRAM0CADDR, type = ro, optional = yes;
BANKRAM0C: load = BRAM0C, type = rw, optional = yes, define = yes;
BRAM0DADDR: load = BRAM0DADDR, type = ro, optional = yes;
BANKRAM0D: load = BRAM0D, type = rw, optional = yes, define = yes;
BRAM0EADDR: load = BRAM0EADDR, type = ro, optional = yes;
BANKRAM0E: load = BRAM0E, type = rw, optional = yes, define = yes;
BRAM0FADDR: load = BRAM0FADDR, type = ro, optional = yes;
BANKRAM0F: load = BRAM0F, type = rw, optional = yes, define = yes;
}
FEATURES {
CONDES: type = constructor,

View File

@ -16,17 +16,17 @@ MEMORY {
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
EXTZP: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = HEADER, type = ro;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
STARTUP: load = MAIN, type = ro, optional = yes;
LOWCODE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
INIT: load = MAIN, type = rw, optional = yes; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BSS: load = BSS, type = bss, define = yes;
}
FEATURES {
CONDES: type = constructor,

41
cfg/kim1-60k.cfg Normal file
View File

@ -0,0 +1,41 @@
# kim1-60k.cfg (4k)
#
# for expanded KIM-1
#
# ld65 --config kim1-60k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $2000;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00EE;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $E000 - %S - __STACKSIZE__;
MAINROM: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

41
cfg/kim1-mtu60k.cfg Normal file
View File

@ -0,0 +1,41 @@
# kim1-mtu60k.cfg (4k)
#
# for expanded KIM-1 w/ K-1008 Graphics and 60K RAM
#
# ld65 --config kim1-mtu60k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $2000;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00EE;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $E000 - %S - __STACKSIZE__;
MAINROM: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

41
cfg/kim1-mtuE000.cfg Normal file
View File

@ -0,0 +1,41 @@
# kim1-mtu60k.cfg (4k)
#
# for expanded KIM-1 w/ K-1008 Graphics and 60K RAM
#
# ld65 --config kim1-mtu60k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $E000;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00EE;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = $2000, size = $E000 - $2000 - __STACKSIZE__;
MAINROM: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

41
cfg/kim1.cfg Normal file
View File

@ -0,0 +1,41 @@
# kim1.cfg (4k)
#
# for unexpanded KIM-1
#
# ld65 --config kim1.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $0200;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00EE;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $1000 - %S - __STACKSIZE__;
MAINROM: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

View File

@ -5,16 +5,17 @@ SYMBOLS {
__BANK1BLOCKSIZE__: type = weak, value = $0000; # bank 1 block size
__EXEHDR__: type = import;
__BOOTLDR__: type = import;
__DEFDIR__: type = import;
__UPLOADER__: type = import;
__UPLOADERSIZE__: type = export, value = $61;
__HEADERSIZE__: type = export, value = 64;
}
MEMORY {
ZP: file = "", define = yes, start = $0000, size = $0100;
HEADER: file = %O, start = $0000, size = $0040;
HEADER: file = %O, start = $0000, size = __HEADERSIZE__;
BOOT: file = %O, start = $0200, size = __STARTOFDIRECTORY__;
DIR: file = %O, start = $0000, size = 8;
MAIN: file = %O, define = yes, start = $0200, size = $BD38 - __STACKSIZE__;
UPLDR: file = %O, define = yes, start = $BFDC, size = $005C;
DIR: file = %O, start = $0000, size = 16;
MAIN: file = %O, define = yes, start = $0200, size = $C038 - __UPLOADERSIZE__ - $200 - __STACKSIZE__;
UPLOAD: file = %O, define = yes, start = $C038 - __UPLOADERSIZE__, size = $0061;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
@ -30,8 +31,8 @@ SEGMENTS {
RODATA: load = MAIN, type = ro, define = yes;
DATA: load = MAIN, type = rw, define = yes;
BSS: load = MAIN, type = bss, define = yes;
UPCODE: load = UPLDR, type = ro, define = yes;
UPDATA: load = UPLDR, type = rw, define = yes;
UPCODE: load = UPLOAD, type = ro, define = yes;
UPDATA: load = UPLOAD, type = rw, define = yes;
}
FEATURES {
CONDES: type = constructor,

34
cfg/rp6502.cfg Normal file
View File

@ -0,0 +1,34 @@
SYMBOLS {
__STARTUP__: type = import;
__STACKSIZE__: type = weak, value = $0800;
}
MEMORY {
ZP: file = "", define = yes, start = $0000, size = $0100;
CPUSTACK: file = "", start = $0100, size = $0100;
RAM: file = %O, define = yes, start = $0200, size = $FD00 - __STACKSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
ONCE: load = RAM, type = ro, optional = yes;
CODE: load = RAM, type = ro;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, 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__;
}

46
cfg/sym1-32k.cfg Normal file
View File

@ -0,0 +1,46 @@
# sym1-32k.cfg (32k)
#
# for Sym-1 with 32kb RAM
#
# ld65 --config sym1-32k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $0200;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0200; # 512 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $8000 - %S - __STACKSIZE__;
MONROM: file = "", define = yes, start = $8000, size = $1000;
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 = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

46
cfg/sym1-4k.cfg Normal file
View File

@ -0,0 +1,46 @@
# sym1-4k.cfg (4k)
#
# for Sym-1 with 4kb RAM
#
# ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $0200;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $1000 - %S - __STACKSIZE__;
MONROM: file = "", define = yes, start = $8000, size = $1000;
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 = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

46
cfg/sym1.cfg Normal file
View File

@ -0,0 +1,46 @@
# sym1-4k.cfg (4k)
#
# for Sym-1 with 4kb RAM
#
# ld65 --config sym1-4k.cfg -o <prog>.bin <prog>.o
FEATURES {
STARTADDRESS: default = $0200;
CONDES: segment = STARTUP,
type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__;
CONDES: segment = STARTUP,
type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__: type = weak, value = $0080; # 128 byte program stack
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = %O, define = yes, start = $0000, size = $00F7;
CPUSTACK: file = "", define = yes, start = $0100, size = $0100;
RAM: file = %O, define = yes, start = %S, size = $1000 - %S - __STACKSIZE__;
MONROM: file = "", define = yes, start = $8000, size = $1000;
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 = $2000;
RAE2: file = "", define = yes, start = $E000, size = $1000;
TOP: file = "", define = yes, start = $F000, size = $1000;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, define = yes;
STARTUP: load = RAM, type = ro, define = yes;
CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro, define = yes;
ONCE: load = RAM, type = ro, define = yes;
DATA: load = RAM, type = rw, define = yes;
BSS: load = RAM, type = bss, define = yes;
}

View File

@ -1,3 +1,7 @@
FEATURES {
STARTADDRESS: default = $1000;
}
SYMBOLS {
__ORIXHDR__: type = import;
__STACKSIZE__: type = weak, value = $0800; # 2K stack
@ -7,7 +11,7 @@ SYMBOLS {
MEMORY {
ZP: file = "", define = yes, start = $00B0, size = $003A;
ORIXHDR: file = %O, type = ro, start = $0000, size = $001F;
MAIN: file = %O, define = yes, start = $0800, size = __RAMEND__ - __MAIN_START__;
MAIN: file = %O, define = yes, start = %S, size = __RAMEND__ - __MAIN_START__;
BSS: file = "", start = __ONCE_RUN__, size = __RAMEND__ - __STACKSIZE__ - __ONCE_RUN__;
}
SEGMENTS {
@ -18,7 +22,7 @@ SEGMENTS {
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw;
INIT: load = MAIN, type = rw; # uninitialized, but reserves output space
ONCE: load = MAIN, type = ro, define = yes;
BASTAIL: load = MAIN, type = ro, optional = yes;
BSS: load = BSS, type = bss, define = yes;

19
cfg/vic20-asm.cfg Normal file
View File

@ -0,0 +1,19 @@
FEATURES {
STARTADDRESS: default = $1001;
}
SYMBOLS {
__LOADADDR__: type = import;
}
MEMORY {
ZP: file = "", start = $0002, size = $001A, define = yes;
LOADADDR: file = %O, start = %S - 2, size = $0002;
MAIN: file = %O, start = %S, size = $0DF3 - %S;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
CODE: load = MAIN, type = ro;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
BSS: load = MAIN, type = bss, optional = yes, define = yes;
}

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

@ -33,7 +33,7 @@ more information.
The standard binary file format generated by the linker for the
Apple&nbsp;&rsqb;&lsqb; target is an <url name="AppleSingle"
url="http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf"> file.
url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file.
The default load address is &dollar;803.
<bf/AppleCommander 1.4.0/ or later (available at <url
@ -62,7 +62,7 @@ Special locations:
</descrip><p>
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
However while running module constructors/destructors the Language Card is disabled.
However while running module constructors the Language Card is disabled.
Enabling the Language Card allows to use it as additional memory for cc65
generated code. However code is never automatically placed there. Rather code
@ -73,7 +73,7 @@ system takes care of actually moving the code into the Language Card.
The amount of memory available in the Language Card for generated code depends
on the <ref id="link-configs" name="linker configuration"> parameters. There are
several usefull settings:
several useful settings:
<descrip>
@ -281,7 +281,7 @@ AppleCommander option to put LOADER.SYSTEM on a ProDOS 8 disk image is <tt/-p/.
If the cc65 program can be successfully linked as system program using the linker
configuration <ref id="apple-sys-cfg" name="apple2-system.cfg">, but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
the memory from &dollar;800 to &dollar;2000 can be added to the heap by calling
the memory from &dollar;800 to &dollar;1FFF can be added to the heap by calling
<tt/_heapadd ((void *) 0x0800, 0x1800);/ at the beginning of <tt/main()/.
@ -321,21 +321,39 @@ Programs containing Apple&nbsp;&rsqb;&lsqb; specific code may use the
<sect1>Apple&nbsp;&rsqb;&lsqb; specific functions<p>
The functions listed below are special for the Apple&nbsp;&rsqb;&lsqb;. See
the <url url="funcref.html" name="function reference"> for declaration and
The functions and variables listed below are special for the Apple&nbsp;&rsqb;&lsqb;.
See the <url url="funcref.html" name="function reference"> for declaration and
usage.
<itemize>
<item>_auxtype
<item>_dos_type
<item>_filetype
<item>_datetime
<item>beep
<item>get_ostype
<item>gmtime_dt
<item>mktime_dt
<item>rebootafterexit
<item>ser_apple2_slot
<item>tgi_apple2_mix
</itemize>
<sect1>Apple IIgs specific functions in accelerator.h<p>
In addition to those, the <tt/accelerator.h/ header file contains three functions
to help determine whether the program is running on a IIgs, and change the IIgs
CPU speed. See the <url url="funcref.html" name="function reference"> for declaration and
usage.
<itemize>
<item>detect_iigs
<item>get_iigs_speed
<item>set_iigs_speed
</itemize>
<sect1>Hardware access<p>
There's currently no support for direct hardware access. This does not mean
@ -370,7 +388,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>
@ -427,9 +445,14 @@ The names in the parentheses denote the symbols to be used for static linking of
<descrip>
<tag><tt/a2.ssc.ser (a2_ssc_ser)/</tag>
Driver for the Apple&nbsp;II Super Serial Card. Supports up to 19200 baud,
hardware flow control (RTS/CTS) and interrupt driven receives. Note
that because of the peculiarities of the 6551 chip transmits are not
Driver for the Apple&nbsp;II Super Serial Card.
The SSC is an extension card for the II, II+, IIe; the Apple //c and //c+ have
the same hardware and firmware integrated.
It supports up to 9600 baud, supports no flow control and hardware flow control
(RTS/CTS) and does interrupt driven receives. Speeds faster than 9600 baud
aren't reachable because the ROM and ProDOS IRQ handlers are too slow.
Software flow control (XON/XOFF) is not supported.
Note that because of the peculiarities of the 6551 chip transmits are not
interrupt driven, and the transceiver blocks if the receiver asserts
flow control because of a full buffer.
@ -438,6 +461,26 @@ The names in the parentheses denote the symbols to be used for static linking of
succeeds for all Apple&nbsp;II slots, but <tt/ser_open()/ fails with
<tt/SER_ERR_NO_DEVICE/ if there's no SSC firmware found in the selected slot.
In the Apple //c and //c+, slot 1 is the printer port, and slot 2 is the modem
port.
Never call <tt/ser_apple2_slot()/ after <tt/ser_open()/.
<tag><tt/a2.gs.ser (a2_gs_ser)/</tag>
Driver for the Apple&nbsp;IIgs serial ports (printer and modem).
It supports up to 9600 baud, supports no flow control and hardware flow control
(RTS/CTS) and does interrupt driven receives. Speeds faster than 9600 baud
aren't reachable because the ROM and ProDOS IRQ handlers are too slow.
Software flow control (XON/XOFF) is not supported.
Note that transmits are not interrupt driven, and the transceiver blocks if
the receiver asserts flow control because of a full buffer.
The driver defaults to opening the modem port. Calling <tt/ser_apple2_slot()/
prior to <tt/ser_open()/ allows to select the printer port (1) or the modem
port (0).
Never call <tt/ser_apple2_slot()/ after <tt/ser_open()/.
</descrip><p>
@ -544,6 +587,28 @@ program. See the discussion of the <tt/.CONDES/ feature in the <url
url="ca65.html" name="assembler manual">.
<sect1>ProDOS date/time manipulation<p>
<descrip>
The readdir and stat function return ProDOS timestamps in their file
creation/modification time attributes. You can convert them to more portable
time representations using either:
<tag/struct tm/
<tt/struct tm* __fastcall__ gmtime_dt (const struct datetime* dt);/
Converts a <tt/struct datetime/ into a <tt/struct tm/. Returns NULL in case
of error and sets errno.
<tag/time_t/
<tt/time_t __fastcall__ mktime_dt (const struct datetime* dt);/
Parses a <tt/struct datetime/ and returns a UNIX timestamp. Returns 0 on error and
sets errno.
</descrip>
<sect1>DIO<p>
<descrip>
@ -575,15 +640,13 @@ url="ca65.html" name="assembler manual">.
<tag>Explanation of File Types</tag>
ProDOS associates a file type and an auxiliary type with each file.
ProDOS 8 associates a file type and an auxiliary type with each file.
These type specifications are separate from the file's name, unlike
Windows which uses the file name's suffix (a.k.a.
extension) to specify the file type. For example, <tt/.exe/,
<tt/.doc/, or <tt/.bat/.
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
files require these types to be specified. And if they don't match
with the file being opened, the operation may fail.
The ProDOS 8 Machine-Language Interface (MLI) function for creating a
file require these types to be specified.
In contrast, the ISO C function <tt/fopen()/ and the POSIX function
<tt/open()/ have no parameter to specify either a file type or an
@ -605,9 +668,17 @@ url="ca65.html" name="assembler manual">.
The header file <tt/apple2_filetype.h/ also defines many values
that can be used to set these variables. It is included in
<tt/apple2.h/, which is in turn included in <tt/apple2enh.h/.
So it isn't necessary to include it directly. Just
include one of <tt/apple2.h/ or <tt/apple2enh.h/.
<tt/apple2.h/.
The global variable <tt/_datetime/ allows the file creation date/time
to be set before a call to <tt/fopen()/
or <tt/open()/ that creates the file. It is defined in <tt/apple2.h/:
<tscreen>
<verb>
extern struct datetime _datetime;
</verb>
</tscreen>
<tag>Example</tag>
@ -624,8 +695,8 @@ url="ca65.html" name="assembler manual">.
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return, line-feed pair (Windows).
The "sequential" text file terminology is in contrast to a
"random-access" text file which would
The 'sequential' text file terminology is in contrast to a
'random-access' text file which would
have a fixed-length, non-zero record length, so that the
file position of any individual record can be calculated.

View File

@ -21,7 +21,8 @@ as it comes with the cc65 C compiler. It describes the memory layout,
enhanced&nbsp;Apple&nbsp;//e specific header files, available drivers, and any
pitfalls specific to that platform.
Please note that enhanced&nbsp;Apple&nbsp;//e specific functions are just mentioned
Please note that this target requires a 65C02 or 65816 CPU,
enhanced&nbsp;Apple&nbsp;//e 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
@ -33,7 +34,7 @@ more information.
The standard binary file format generated by the linker for the
enhanced&nbsp;Apple&nbsp;//e target is an <url name="AppleSingle"
url="http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf"> file.
url="https://nulib.com/library/AppleSingle_AppleDouble.pdf"> file.
The default load address is &dollar;803.
<bf/AppleCommander 1.4.0/ or later (available at <url
@ -62,7 +63,7 @@ Special locations:
</descrip><p>
While running <tt/main()/ the Language Card bank 2 is enabled for read access.
However while running module constructors/destructors the Language Card is disabled.
However while running module constructors the Language Card is disabled.
Enabling the Language Card allows to use it as additional memory for cc65
generated code. However code is never automatically placed there. Rather code
@ -73,7 +74,7 @@ system takes care of actually moving the code into the Language Card.
The amount of memory available in the Language Card for generated code depends
on the <ref id="link-configs" name="linker configuration"> parameters. There are
several usefull settings:
several useful settings:
<descrip>
@ -281,7 +282,7 @@ AppleCommander option to put LOADER.SYSTEM on a ProDOS 8 disk image is <tt/-p/.
If the cc65 program can be successfully linked as system program using the linker
configuration <ref id="apple-sys-cfg" name="apple2enh-system.cfg">, but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
the memory from &dollar;800 to &dollar;2000 can be added to the heap by calling
the memory from &dollar;800 to &dollar;1FFF can be added to the heap by calling
<tt/_heapadd ((void *) 0x0800, 0x1800);/ at the beginning of <tt/main()/.
@ -321,15 +322,19 @@ Programs containing enhanced&nbsp;Apple&nbsp;//e specific code may use the
<sect1>Enhanced&nbsp;Apple&nbsp;//e specific functions<p>
The functions listed below are special for the enhanced&nbsp;Apple&nbsp;//e. See
the <url url="funcref.html" name="function reference"> for declaration and
The functions and variables listed below are special for the Apple&nbsp;&rsqb;&lsqb;.
See the <url url="funcref.html" name="function reference"> for declaration and
usage.
<itemize>
<item>_auxtype
<item>_dos_type
<item>_filetype
<item>_datetime
<item>beep
<item>get_ostype
<item>gmtime_dt
<item>mktime_dt
<item>rebootafterexit
<item>ser_apple2_slot
<item>tgi_apple2_mix
@ -338,6 +343,20 @@ usage.
</itemize>
<sect1>Apple IIgs specific functions in accelerator.h<p>
In addition to those, the <tt/accelerator.h/ header file contains three functions
to help determine whether the program is running on a IIgs, and change the IIgs
CPU speed. See the <url url="funcref.html" name="function reference"> for declaration and
usage.
<itemize>
<item>detect_iigs
<item>get_iigs_speed
<item>set_iigs_speed
</itemize>
<sect1>Hardware access<p>
There's currently no support for direct hardware access. This does not mean
@ -376,7 +395,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>
@ -427,9 +446,14 @@ The names in the parentheses denote the symbols to be used for static linking of
<descrip>
<tag><tt/a2e.ssc.ser (a2e_ssc_ser)/</tag>
Driver for the Apple&nbsp;II Super Serial Card. Supports up to 19200 baud,
hardware flow control (RTS/CTS) and interrupt driven receives. Note
that because of the peculiarities of the 6551 chip transmits are not
Driver for the Apple&nbsp;II Super Serial Card.
The SSC is an extension card for the II, II+, IIe; the Apple //c and //c+ have
the same hardware and firmware integrated.
It supports up to 9600 baud, supports no flow control and hardware flow control
(RTS/CTS) and does interrupt driven receives. Speeds faster than 9600 baud
aren't reachable because the ROM and ProDOS IRQ handlers are too slow.
Software flow control (XON/XOFF) is not supported.
Note that because of the peculiarities of the 6551 chip transmits are not
interrupt driven, and the transceiver blocks if the receiver asserts
flow control because of a full buffer.
@ -438,6 +462,26 @@ The names in the parentheses denote the symbols to be used for static linking of
succeeds for all Apple&nbsp;II slots, but <tt/ser_open()/ fails with
<tt/SER_ERR_NO_DEVICE/ if there's no SSC firmware found in the selected slot.
In the Apple //c and //c+, slot 1 is the printer port, and slot 2 is the modem
port.
Never call <tt/ser_apple2_slot()/ after <tt/ser_open()/.
<tag><tt/a2e.gs.ser (a2e_gs_ser)/</tag>
Driver for the Apple&nbsp;IIgs serial ports (printer and modem).
It supports up to 9600 baud, supports no flow control and hardware flow control
(RTS/CTS) and does interrupt driven receives. Speeds faster than 9600 baud
aren't reachable because the ROM and ProDOS IRQ handlers are too slow.
Software flow control (XON/XOFF) is not supported.
Note that transmits are not interrupt driven, and the transceiver blocks if
the receiver asserts flow control because of a full buffer.
The driver defaults to opening the modem port. Calling <tt/ser_apple2_slot()/
prior to <tt/ser_open()/ allows to select the printer port (1) or the modem
port (0).
Never call <tt/ser_apple2_slot()/ after <tt/ser_open()/.
</descrip><p>
@ -549,6 +593,28 @@ program. See the discussion of the <tt/.CONDES/ feature in the <url
url="ca65.html" name="assembler manual">.
<sect1>ProDOS date/time manipulation<p>
<descrip>
The readdir and stat function return ProDOS timestamps in their file
creation/modification time attributes. You can convert them to more portable
time representations using either:
<tag/struct tm/
<tt/struct tm* __fastcall__ gmtime_dt (const struct datetime* dt);/
Converts a <tt/struct datetime/ into a <tt/struct tm/. Returns -1 in case
of error and sets errno, 0 on success.
<tag/time_t/
<tt/time_t __fastcall__ mktime_dt (const struct datetime* dt);/
Parses a <tt/struct datetime/ and returns a UNIX timestamp. Returns 0 on error and
sets errno.
</descrip>
<sect1>DIO<p>
<descrip>
@ -580,22 +646,20 @@ url="ca65.html" name="assembler manual">.
<tag>Explanation of File Types</tag>
ProDOS associates a file type and an auxiliary type with each file.
ProDOS 8 associates a file type and an auxiliary type with each file.
These type specifications are separate from the file's name, unlike
Windows which uses the file name's suffix (a.k.a.
extension) to specify the file type. For example, <tt/.exe/,
<tt/.doc/, or <tt/.bat/.
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
files require these types to be specified. And if they don't match
with the file being opened, the operation may fail.
The ProDOS 8 Machine-Language Interface (MLI) function for creating a
file require these types to be specified.
In contrast, the ISO C function <tt/fopen()/ and the POSIX function
<tt/open()/ have no parameter to specify either a file type or an
auxiliary type. Therefore, some additional mechanism for specifying
the file types is needed.
<tag>Specifying the File Type and Auxiliary Type</tag>
<tag>Specifying the File Type, Auxiliary Type and creation date</tag>
There are two global variables provided that allow the file type
and auxiliary type to be specified before a call to <tt/fopen()/
@ -611,8 +675,16 @@ url="ca65.html" name="assembler manual">.
The header file <tt/apple2_filetype.h/ also defines many values
that can be used to set these variables. It is included in
<tt/apple2.h/, which is in turn included in <tt/apple2enh.h/.
So it isn't necessary to include it directly. Just
include one of <tt/apple2.h/ or <tt/apple2enh.h/.
The global variable <tt/_datetime/ allows the file creation date/time
to be set before a call to <tt/fopen()/
or <tt/open()/ that creates the file. It is defined in <tt/apple2.h/:
<tscreen>
<verb>
extern struct datetime _datetime;
</verb>
</tscreen>
<tag>Example</tag>
@ -629,8 +701,8 @@ url="ca65.html" name="assembler manual">.
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return, line-feed pair (Windows).
The "sequential" text file terminology is in contrast to a
"random-access" text file which would
The 'sequential' text file terminology is in contrast to a
'random-access' text file which would
have a fixed-length, non-zero record length, so that the
file position of any individual record can be calculated.

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
@ -131,7 +131,7 @@ With the default load address of &dollar;2400 this gives a usable memory range o
&lsqb;&dollar;2400-&dollar;CFFF&rsqb;.
Please note that the first load chunk (which checks the system
compatibilty and available memory) will always be loaded at
compatibility and available memory) will always be loaded at
&dollar;2E00, regardless of the specified start address. This address
can only be changed by a custom linker config file.
@ -305,7 +305,7 @@ The names are the usual ones you can find in system reference manuals. Example:
...
</verb></tscreen>
Please note that memory location 762/$2FA is called "<tt/char_/" while the orignal name "<tt/char/" conflicts with the C keyword.
Please note that memory location 762/$2FA is called "<tt/char_/" while the original name "<tt/char/" conflicts with the C keyword.
If you like to use the OS names and locations for the original Atari 800 operating system, please "<tt/#define OSA/" before including the
<tt/atari.h/ header file.
@ -332,6 +332,7 @@ See the <url url="funcref.html" name="function reference"> for declaration and u
<item>_scroll
<item>_setcolor
<item>_setcolor_low
<item>_sound
<item>waitvsync
</itemize>
@ -401,7 +402,7 @@ OS.sdlst = &amp;DisplayList;
...
</verb></tscreen>
Please inspect the <tt/_antic.h/ header file to detemine the supported
Please inspect the <tt/_antic.h/ header file to determine the supported
instruction names. Modifiers on instructions can be nested without need
for an order:
@ -410,7 +411,7 @@ for an order:
Please mind that ANTIC has memory alignment requirements for "player
missile graphics"-data, font data, display lists and screen memory. Creation
of a special linker configuration with appropriate aligned segments and
switching to that segment in the c-code is usually neccessary. A more memory
switching to that segment in the c-code is usually necessary. A more memory
hungry solution consists in using the "<tt/posix_memalign()/" function in
conjunction with copying your data to the allocated memory.
@ -442,19 +443,7 @@ package delivers the same feature.</em>
You can switch back to the ATASCII mapping by including
"<tt/atari_atascii_charmap.h/".
A final note: Since cc65 has currently some difficulties with string merging
under different mappings, defining remapped strings works only flawlessly
with static array initialization:
<tscreen><verb>
#include &lt;atari_screen_charmap.h&gt;
char pcScreenMappingString[] = "Hello Atari!";
#include &lt;atari_atascii_charmap.h&gt;
char pcAtasciiMappingString[] = "Hello Atari!";
</verb></tscreen>
delivers correct results, while
Example:
<tscreen><verb>
#include &lt;atari_screen_charmap.h&gt;
@ -464,8 +453,6 @@ char* pcScreenMappingString = "Hello Atari!";
char* pcAtasciiMappingString = "Hello Atari!";
</verb></tscreen>
does not.
<sect1>Keyboard codes<p>
For direct keyboard scanning in conjunction with e.g. the OS location "CH" (764/$2FC),
@ -675,9 +662,9 @@ The default callbacks definition (<tt/mouse_def_callbacks/) is an alias for the
<sect1>RS232 device drivers<p>
Currently there is one RS232 driver. It uses the R: device (therefore
an R: driver needs to be installed) and was tested with the 850
interface module.
Currently there is one RS232 driver. It supports up to 9600 baud, requires hardware flow control
(RTS/CTS) and uses the R: device (therefore an R: driver needs to be installed). It was tested
with the 850 interface module.
<table>
<tabular ca="rr">
@ -726,6 +713,11 @@ for sectors 1 to 3, regardless of the type of diskette.
The console I/O is speed optimized therefore support for XEP80 hardware
or f80.com software is missing. Of course you may use stdio.h functions.
<tt/cprintf/ targets a 40 character line. On a 20-column display this has
the unexpected effect of a blank line after your text. On such displays you can either
use for example <tt/gotoxy(20,0)/ to target the "next" line, or you can switch to <tt/write()/
function which does not have this side effect.
<sect>Technical details<label id="techdetail"><p>
@ -1141,8 +1133,8 @@ ld65: Error: Missing memory area assignment for segment 'MAINHDR'
</verb></tscreen>
The old "HEADER" memory description contained six bytes: &dollar;FFFF
and the first and last memory addess of the program. For the "system
check" load chunk this had to be split into two memory assigments. The
and the first and last memory address of the program. For the "system
check" load chunk this had to be split into two memory assignments The
"HEADER" now only contains the &dollar;FFFF. The main program's first
and last memory address were moved to a new segment, called "MAINHDR",
which in the new linker config file goes into its own memory area (also
@ -1170,7 +1162,7 @@ When using cl65, you can leave it out with this command line:
cl65 -Wl -D__SYSTEM_CHECK__=1 <arguments>
</verb></tscreen>
The value you assign to <tt/__SYSTEM_CHECK_/ doesn't matter. If the
The value you assign to <tt/__SYSTEM_CHECK__/ doesn't matter. If the
<tt/__SYSTEM_CHECK__/ symbol is defined, the load chunk won't be included.

View File

@ -30,7 +30,7 @@ information.
<sect>Binary format<p>
The standard binary output format generated by the linker for the Atari 5200 target
The binary output format generated by the linker for the Atari 5200 target
is a cartridge image. It is of course
possible to change this behaviour by using a modified startup file and linker
config.
@ -73,6 +73,17 @@ Special locations:
Programs containing Atari 5200 specific code may use the <tt/atari5200.h/ header file.
This also includes access to operating system locations (e.g. hardware shadow registers) by a structure called
"<tt/OS/".
The names are the usual ones you can find in system reference manuals. Example:
<tscreen><verb>
...
OS.sdmctl = 0x00; // screen off
OS.color4 = 14; // white frame
tics = OS.rtclok[1] // get ticks
...
</verb></tscreen>
<sect1>Atari 5200 specific functions<p>
@ -208,10 +219,58 @@ you cannot use any of the following functions (and a few others):
<sect>Other hints<p>
AtariROMMaker (<url url="https://www.wudsn.com/index.php/productions-atari800/tools/atarirommaker"> )
<sect1>CAR format<p>
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.
<sect1>Changing the splash screen<p>
The 5200 ROM displays a splash screen at startup with the name of the
game and the copyright year. The year information has a 'Year-2000'
problem, the first two digits are fixed in the ROM and are always "19".
<sect2>Changing the game name<p>
The runtime library provides a default game name which is "cc65
compiled". To change that, one has to link a file which puts data into
the "<tt/CARTNAME/" segment.
For reference, here's the default version used by the cc65 library:
<tscreen><verb>
.export __CART_NAME__: absolute = 1
.macpack atari
.segment "CARTNAME"
scrcode " cc"
.byte '6' + 32, '5' + 32 ; use playfield 1
scrcode " compiled"
</verb></tscreen>
'<tt/__CART_NAME__/' needs to be defined in order that the linker is
satisfied and doesn't try to include the version of the runtime library.
20 bytes are available in the <tt/CARTNAME/ segment (one line) for the
game/program name.
<sect2>Changing the copyright year / changing the cartridge type<p>
The century is hard-coded to 1900 by the ROM.
There are two digits which can be changed. For example "92" will give
"1992" on the screen.
The default used by the runtime library is
<tscreen><verb>
.export __CART_YEAR__: absolute = 1
.segment "CARTYEAR"
.byte '9' + 32,'8' + 32 ; "98", using playfield 1
</verb></tscreen>
If the second byte of the year in the <tt/CARTYEAR/ segment is 255,
the cartridge is seen as a 'diagnostic' cartridge, and the splash
screen and most of the other startup initializations are bypassed.
<sect>License<p>

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

@ -176,10 +176,11 @@ No mouse drivers are currently available for the Atmos.
<tag><tt/atmos-acia.ser (atmos_acia_ser)/</tag>
Driver for the Telestrat integrated serial controller and the Atmos with a
serial add-on.
Note that, because of the peculiarities of the 6551 chip, together with the
use of the NMI, transmits are not interrupt driven; and, the transceiver
blocks if the receiver asserts flow control because of a full buffer.
serial add-on. Supports up to 19200 baud, requires hardware flow control
(RTS/CTS) and does interrupt driven receives. Note that, because of the
peculiarities of the 6551 chip, together with the use of the NMI, transmits
are not interrupt driven; and, the transceiver blocks if the receiver
asserts flow control because of a full buffer.
</descrip><p>

View File

@ -324,9 +324,9 @@ The default drivers, <tt/mouse_stddrv (mouse_static_stddrv)/, point to <tt/c128-
<descrip>
<tag><tt/c128-swlink.ser (c128_swlink_ser)/</tag>
Driver for the SwiftLink cartridge. Supports up to 38400 BPS, hardware flow
control (RTS/CTS), and interrupt-driven receives. Note that, because of the
peculiarities of the 6551 chip, together with the use of the NMI, transmits
Driver for the SwiftLink cartridge. Supports up to 38400 baud, requires hardware
flow control (RTS/CTS) and does interrupt driven receives. Note that, because of
the peculiarities of the 6551 chip, together with the use of the NMI, transmits
are not interrupt driven; and, the transceiver blocks if the receiver asserts
flow control because of a full buffer.

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:
@ -410,9 +410,9 @@ The default drivers, <tt/mouse_stddrv (mouse_static_stddrv)/, point to <tt/c64-1
<descrip>
<tag><tt/c64-swlink.ser (c64_swlink_ser)/</tag>
Driver for the SwiftLink cartridge. Supports up to 38400 BPS, hardware flow
control (RTS/CTS), and interrupt-driven receives. Note that, because of the
peculiarities of the 6551 chip, together with the use of the NMI, transmits
Driver for the SwiftLink cartridge. Supports up to 38400 baud, requires hardware
flow control (RTS/CTS) and does interrupt driven receives. Note that, because of
the peculiarities of the 6551 chip, together with the use of the NMI, transmits
are not interrupt driven; and, the transceiver blocks if the receiver asserts
flow control because of a full buffer.

File diff suppressed because it is too large Load Diff

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