Merge branch 'master' into c_sp
This commit is contained in:
13
.github/checks/Makefile
vendored
13
.github/checks/Makefile
vendored
@@ -5,14 +5,18 @@ endif
|
|||||||
|
|
||||||
ifdef CMD_EXE
|
ifdef CMD_EXE
|
||||||
|
|
||||||
.PHONY: checkstyle
|
.PHONY: checkstyle sorted
|
||||||
|
|
||||||
checkstyle:
|
checkstyle:
|
||||||
$(info INFO: style checks require bash.)
|
$(info INFO: style checks require bash.)
|
||||||
|
sorted:
|
||||||
|
$(info INFO: table checks require bash.)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
.PHONY: checkstyle lineendings tabs lastline spaces noexec
|
.PHONY: checkstyle lineendings tabs lastline spaces noexec sorted
|
||||||
|
|
||||||
|
all: checkstyle sorted
|
||||||
|
|
||||||
checkstyle: lineendings tabs lastline spaces noexec
|
checkstyle: lineendings tabs lastline spaces noexec
|
||||||
|
|
||||||
@@ -31,4 +35,9 @@ spaces: spaces.sh
|
|||||||
noexec: noexec.sh
|
noexec: noexec.sh
|
||||||
@./noexec.sh
|
@./noexec.sh
|
||||||
|
|
||||||
|
sorted: sorted.sh sorted_codeopt.sh sorted_opcodes.sh
|
||||||
|
@./sorted.sh
|
||||||
|
@./sorted_codeopt.sh
|
||||||
|
@./sorted_opcodes.sh
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
38
.github/checks/sorted.sh
vendored
Executable file
38
.github/checks/sorted.sh
vendored
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
OLDCWD=`pwd`
|
||||||
|
SCRIPT_PATH=`dirname $0`
|
||||||
|
|
||||||
|
CHECK_DIR=../../src
|
||||||
|
|
||||||
|
SORT_OPT="-u -c"
|
||||||
|
|
||||||
|
# $1: filename
|
||||||
|
function checkarray_quoted_name
|
||||||
|
{
|
||||||
|
CHECK_FILE="$1"
|
||||||
|
START="\\/\\* BEGIN SORTED.SH \\*\\/"
|
||||||
|
END="\\/\\* END SORTED.SH \\*\\/"
|
||||||
|
|
||||||
|
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \
|
||||||
|
sed -e 's:\(.*\) ##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp
|
||||||
|
|
||||||
|
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
|
||||||
|
echo "error: "$1" table is empty"
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
|
||||||
|
echo ""$1" tables OK"
|
||||||
|
else
|
||||||
|
echo "error: "$1" tables are not sorted."
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
rm -rf .a.tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for N in `grep -rl "BEGIN SORTED.SH" "$CHECK_DIR"`; do
|
||||||
|
checkarray_quoted_name $N
|
||||||
|
done
|
||||||
68
.github/checks/sorted_codeopt.sh
vendored
Executable file
68
.github/checks/sorted_codeopt.sh
vendored
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
OLDCWD=`pwd`
|
||||||
|
SCRIPT_PATH=`dirname $0`
|
||||||
|
|
||||||
|
CHECK_DIR=../../src
|
||||||
|
|
||||||
|
SORT_OPT="-u -c"
|
||||||
|
|
||||||
|
# $1: filename
|
||||||
|
function checkarray
|
||||||
|
{
|
||||||
|
CHECK_FILE="$1"
|
||||||
|
START="\\/\\* BEGIN DECL SORTED_CODEOPT.SH \\*\\/"
|
||||||
|
END="\\/\\* END DECL SORTED_CODEOPT.SH \\*\\/"
|
||||||
|
|
||||||
|
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \
|
||||||
|
sed -e 's:\(.*##\).*"\(.*\)",.*:\1\2:g' > .a.tmp
|
||||||
|
|
||||||
|
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
|
||||||
|
echo "error: "$1" table is empty"
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
|
||||||
|
echo ""$1" decls sorted."
|
||||||
|
else
|
||||||
|
echo "error: "$1" decls are not sorted."
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
START="\\/\\* BEGIN SORTED_CODEOPT.SH \\*\\/"
|
||||||
|
END="\\/\\* END SORTED_CODEOPT.SH \\*\\/"
|
||||||
|
|
||||||
|
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \
|
||||||
|
sed -e 's:\(.*##\).*&D\(.*\),.*:\1\2:g' > .b.tmp
|
||||||
|
|
||||||
|
if [[ -z $(grep '[^[:space:]]' .b.tmp) ]] ; then
|
||||||
|
echo "error: "$1" table is empty"
|
||||||
|
rm -rf .a.tmp .b.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if `LC_COLLATE=C sort $SORT_OPT .b.tmp`; then
|
||||||
|
echo ""$1" tables sorted."
|
||||||
|
else
|
||||||
|
echo "error: "$1" tables are not sorted."
|
||||||
|
rm -rf .a.tmp .b.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if cmp --silent -- .a.tmp .b.tmp; then
|
||||||
|
echo ""$1" tables OK"
|
||||||
|
else
|
||||||
|
echo "error: "$1" tables are different."
|
||||||
|
diff -y .a.tmp .b.tmp
|
||||||
|
rm -rf .a.tmp .b.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf .a.tmp .b.tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for N in `grep -rl "BEGIN DECL SORTED_CODEOPT.SH" "$CHECK_DIR"`; do
|
||||||
|
checkarray $N
|
||||||
|
done
|
||||||
40
.github/checks/sorted_opcodes.sh
vendored
Executable file
40
.github/checks/sorted_opcodes.sh
vendored
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
OLDCWD=`pwd`
|
||||||
|
SCRIPT_PATH=`dirname $0`
|
||||||
|
|
||||||
|
CHECK_DIR=../../src
|
||||||
|
|
||||||
|
SORT_OPT="-u -c"
|
||||||
|
|
||||||
|
# $1: filename
|
||||||
|
function checkarray_quoted_name
|
||||||
|
{
|
||||||
|
CHECK_FILE="$1"
|
||||||
|
START="\\/\\* BEGIN SORTED_OPCODES.SH \\*\\/"
|
||||||
|
END="\\/\\* END SORTED_OPCODES.SH \\*\\/"
|
||||||
|
|
||||||
|
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {print count,"##",$0}' "$CHECK_FILE" | \
|
||||||
|
sed 's:/\*.*::g' | \
|
||||||
|
grep '".*",' | \
|
||||||
|
sed -e 's:\(.*\) ##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp
|
||||||
|
|
||||||
|
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
|
||||||
|
echo "error: "$1" table is empty"
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
|
||||||
|
echo ""$1" tables OK"
|
||||||
|
else
|
||||||
|
echo "error: "$1" tables are not sorted."
|
||||||
|
rm -rf .a.tmp
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
rm -rf .a.tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
for N in `grep -rl "BEGIN SORTED_OPCODES.SH" "$CHECK_DIR"`; do
|
||||||
|
checkarray_quoted_name $N
|
||||||
|
done
|
||||||
|
|
||||||
3
.github/workflows/build-on-pull-request.yml
vendored
3
.github/workflows/build-on-pull-request.yml
vendored
@@ -24,6 +24,9 @@ jobs:
|
|||||||
- name: Do some simple style checks
|
- name: Do some simple style checks
|
||||||
shell: bash
|
shell: bash
|
||||||
run: make -j2 checkstyle
|
run: make -j2 checkstyle
|
||||||
|
- name: Check bsearch tables
|
||||||
|
shell: bash
|
||||||
|
run: make -j2 sorted
|
||||||
- name: Build the tools.
|
- name: Build the tools.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: make -j2 bin USER_CFLAGS=-Werror
|
run: make -j2 bin USER_CFLAGS=-Werror
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ jobs:
|
|||||||
- name: Do some simple style checks
|
- name: Do some simple style checks
|
||||||
shell: bash
|
shell: bash
|
||||||
run: make -j2 checkstyle
|
run: make -j2 checkstyle
|
||||||
|
- name: Check bsearch tables
|
||||||
|
shell: bash
|
||||||
|
run: make -j2 sorted
|
||||||
- name: Build the tools.
|
- name: Build the tools.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
7
Makefile
7
Makefile
@@ -41,7 +41,11 @@ util:
|
|||||||
|
|
||||||
# check the code style
|
# check the code style
|
||||||
checkstyle:
|
checkstyle:
|
||||||
@$(MAKE) -C .github/checks --no-print-directory $@
|
@$(MAKE) -C .github/checks --no-print-directory $@
|
||||||
|
|
||||||
|
# check bsearch tables
|
||||||
|
sorted:
|
||||||
|
@$(MAKE) -C .github/checks --no-print-directory $@
|
||||||
|
|
||||||
# runs regression tests, requires libtest target libraries
|
# runs regression tests, requires libtest target libraries
|
||||||
test:
|
test:
|
||||||
@@ -50,6 +54,7 @@ test:
|
|||||||
# GNU "check" target, which runs all tests
|
# GNU "check" target, which runs all tests
|
||||||
check:
|
check:
|
||||||
@$(MAKE) -C .github/checks checkstyle --no-print-directory
|
@$(MAKE) -C .github/checks checkstyle --no-print-directory
|
||||||
|
@$(MAKE) -C .github/checks sorted --no-print-directory
|
||||||
@$(MAKE) -C src test --no-print-directory
|
@$(MAKE) -C src test --no-print-directory
|
||||||
@$(MAKE) test
|
@$(MAKE) test
|
||||||
@$(MAKE) -C targettest platforms --no-print-directory
|
@$(MAKE) -C targettest platforms --no-print-directory
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ the [cc65 web site](https://cc65.github.io):
|
|||||||
| Dr. Jozo Dujmović | Picocomputer (RP6502) |
|
| Dr. Jozo Dujmović | Picocomputer (RP6502) |
|
||||||
| Watara | Watura/QuickShot Supervision |
|
| Watara | Watura/QuickShot Supervision |
|
||||||
| Synertek | SYM-1 |
|
| Synertek | SYM-1 |
|
||||||
|
| USSR | Agat-7/9 |
|
||||||
|
|
||||||
A generic configuration to adapt cc65 to new targets is also around.
|
A generic configuration to adapt cc65 to new targets is also around.
|
||||||
|
|
||||||
|
|||||||
39
asminc/agat.inc
Normal file
39
asminc/agat.inc
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
;-----------------------------------------------------------------------------
|
||||||
|
; Zero page stuff
|
||||||
|
|
||||||
|
WNDLFT := $20 ; Text window left
|
||||||
|
WNDWDTH := $21 ; Text window width
|
||||||
|
WNDTOP := $22 ; Text window top
|
||||||
|
WNDBTM := $23 ; Text window bottom+1
|
||||||
|
CH := $24 ; Cursor horizontal position
|
||||||
|
CV := $25 ; Cursor vertical position
|
||||||
|
BASL := $28 ; Text base address low
|
||||||
|
BASH := $29 ; Text base address high
|
||||||
|
CURSOR := $2D ; Cursor character
|
||||||
|
TATTR := $32 ; Text attributes
|
||||||
|
PROMPT := $33 ; Used by GETLN
|
||||||
|
VCOUT := $36 ; COUT Subroutine Vector
|
||||||
|
VCIN := $38 ; CIN Subroutine Vector
|
||||||
|
RNDL := $4E ; Random counter low
|
||||||
|
RNDH := $4F ; Random counter high
|
||||||
|
HIMEM := $73 ; Highest available memory address+1
|
||||||
|
|
||||||
|
;-----------------------------------------------------------------------------
|
||||||
|
; Vectors
|
||||||
|
|
||||||
|
DOSWARM := $03D0 ; DOS warmstart vector
|
||||||
|
BRKVec := $03F0 ; Break vector
|
||||||
|
SOFTEV := $03F2 ; Vector for warm start
|
||||||
|
PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
|
||||||
|
|
||||||
|
;-----------------------------------------------------------------------------
|
||||||
|
; Hardware
|
||||||
|
|
||||||
|
; Keyboard input
|
||||||
|
KBD := $C000 ; Read keyboard
|
||||||
|
KBDSTRB := $C010 ; Clear keyboard strobe
|
||||||
|
|
||||||
|
; Game controller
|
||||||
|
BUTN0 := $C061 ; Open-Apple Key
|
||||||
|
BUTN1 := $C062 ; Closed-Apple Key
|
||||||
44
cfg/agat.cfg
Normal file
44
cfg/agat.cfg
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Default configuration
|
||||||
|
|
||||||
|
FEATURES {
|
||||||
|
STARTADDRESS: default = $1903;
|
||||||
|
}
|
||||||
|
SYMBOLS {
|
||||||
|
__EXEHDR__: type = import;
|
||||||
|
__FILETYPE__: type = weak, value = $0006; # file type
|
||||||
|
__STACKSIZE__: type = weak, value = $0400; # 1k stack
|
||||||
|
__HIMEM__: type = weak, value = $C000; # Presumed RAM end
|
||||||
|
}
|
||||||
|
MEMORY {
|
||||||
|
ZP: file = "", define = yes, start = $0080, size = $001A;
|
||||||
|
HEADER: file = %O, start = %S - $003A, size = $003A;
|
||||||
|
MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - %S;
|
||||||
|
BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __STACKSIZE__ - __ONCE_RUN__;
|
||||||
|
}
|
||||||
|
SEGMENTS {
|
||||||
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
|
EXEHDR: load = HEADER, 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, optional = yes;
|
||||||
|
ONCE: load = MAIN, type = ro, define = yes;
|
||||||
|
BSS: load = BSS, 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__;
|
||||||
|
}
|
||||||
79
doc/agat.sgml
Normal file
79
doc/agat.sgml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<!doctype linuxdoc system>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<title>Agat-7/9 - specific information for cc65
|
||||||
|
|
||||||
|
<author><url url="https://sourceforge.net/u/olegodintsov/profile/" name="Oleg A. Odintsov">,<newline>
|
||||||
|
<url url="mailto:sintechs@gmail.com" name="Konstantin Fedorov">
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
An overview over the Agat-7 and Agat-9 and theirs interfaces to the cc65 C
|
||||||
|
compiler.
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
<!-- Table of contents -->
|
||||||
|
<toc>
|
||||||
|
|
||||||
|
<!-- Begin the document -->
|
||||||
|
|
||||||
|
<sect>Overview
|
||||||
|
|
||||||
|
<p>The Agat was a series of 8-bit computers produced in the Soviet Union from 1983 to 1993.
|
||||||
|
It was based on Apple II architecture with all electronic components made in the Soviet Union except for 6502 microprocessors supplied by UMC (UM6502A).
|
||||||
|
<p>If compared to Apple II, Agat had many improvements such as color text mode, additional graphic modes and flexible memory controller.
|
||||||
|
Agat-7 had an Apple II compatibility card called "Module 121", while Agat-9 had a built-in Apple II+ mode activated by soft-switch.
|
||||||
|
<p>All mass-produced Agat models were disk-based systems, 2K ROM contained only basic machine language monitor and disassembler.
|
||||||
|
Agat-7 had 140K floppy-drive based on Apple DISK II, while Agat-9 was supplied with 840K drive having its own sector format and controller.
|
||||||
|
|
||||||
|
<sect>Binary format<p>
|
||||||
|
|
||||||
|
The standard binary file format generated by the linker for the Agat target is
|
||||||
|
an AppleSingle file to be compatible with AppleCommander <url url="https://applecommander.github.io/">.
|
||||||
|
The default load address is $1903.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<sect>Platform-specific header files<p>
|
||||||
|
|
||||||
|
Programs containing Agat-specific code may use the <tt/agat.h/ or
|
||||||
|
<tt/agat.inc/ include files.
|
||||||
|
|
||||||
|
<sect>Usefull info<p>
|
||||||
|
|
||||||
|
<sect1>Emulation<p>
|
||||||
|
|
||||||
|
<enum>
|
||||||
|
<item> Oleg Odintsov's Agat Emulator - <url url="https://agatemulator.sourceforge.net/english.html">
|
||||||
|
<item> MAME - <url url="https://www.mamedev.org/">
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
<sect1>Links<p>
|
||||||
|
<enum>
|
||||||
|
<item> Most informative source on Agat (in russian) - <url url="https://agatcomp.ru">
|
||||||
|
<item> Wikipedia - <url url="https://en.wikipedia.org/wiki/Agat_(computer)">
|
||||||
|
<item> Controversial article on Agat from <url name="BYTE Magazine November 1984 Vol. 9, No. 12" url="https://archive.org/details/byte-magazine-1984-11/page/n135/mode/2up?view=theater">.
|
||||||
|
The author reviewed custom-build mockup Agat bearing little relation to even the early Agat systems.
|
||||||
|
</enum>
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
@@ -109,6 +109,9 @@
|
|||||||
|
|
||||||
<descrip>
|
<descrip>
|
||||||
|
|
||||||
|
<tag><htmlurl url="agat.html" name="agat.html"></tag>
|
||||||
|
Topics specific to the Agat machines.
|
||||||
|
|
||||||
<tag><htmlurl url="apple2.html" name="apple2.html"></tag>
|
<tag><htmlurl url="apple2.html" name="apple2.html"></tag>
|
||||||
Topics specific to the Apple ][.
|
Topics specific to the Apple ][.
|
||||||
|
|
||||||
|
|||||||
76
include/agat.h
Normal file
76
include/agat.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#ifndef _AGAT_H
|
||||||
|
#define _AGAT_H
|
||||||
|
|
||||||
|
/* Check for errors */
|
||||||
|
#if !defined(__AGAT__)
|
||||||
|
# error This module may only be used when compiling for the Agat!
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Data */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Color defines */
|
||||||
|
#define COLOR_BLACK 0x00
|
||||||
|
#define COLOR_RED 0x01
|
||||||
|
#define COLOR_GREEN 0x02
|
||||||
|
#define COLOR_YELLOW 0x03
|
||||||
|
#define COLOR_BLUE 0x04
|
||||||
|
#define COLOR_MAGENTA 0x05
|
||||||
|
#define COLOR_CYAN 0x06
|
||||||
|
#define COLOR_WHITE 0x07
|
||||||
|
|
||||||
|
/* Characters codes */
|
||||||
|
#define CH_CTRL_C 0x03
|
||||||
|
#define CH_ENTER 0x0D
|
||||||
|
#define CH_ESC 0x1B
|
||||||
|
#define CH_CURS_LEFT 0x08
|
||||||
|
#define CH_CURS_RIGHT 0x15
|
||||||
|
#define CH_CURS_UP 0x19
|
||||||
|
#define CH_CURS_DOWN 0x1A
|
||||||
|
#define CH_ESC 0x1B
|
||||||
|
#define CH_HLINE 0x1B
|
||||||
|
#define CH_VLINE 0x5C
|
||||||
|
#define CH_ULCORNER 0x10
|
||||||
|
#define CH_URCORNER 0x12
|
||||||
|
#define CH_LLCORNER 0x1D
|
||||||
|
#define CH_LRCORNER 0x1F
|
||||||
|
|
||||||
|
/* Masks for joy_read */
|
||||||
|
#define JOY_UP_MASK 0x10
|
||||||
|
#define JOY_DOWN_MASK 0x20
|
||||||
|
#define JOY_LEFT_MASK 0x04
|
||||||
|
#define JOY_RIGHT_MASK 0x08
|
||||||
|
#define JOY_BTN_1_MASK 0x40
|
||||||
|
#define JOY_BTN_2_MASK 0x80
|
||||||
|
|
||||||
|
/* Return codes for get_ostype */
|
||||||
|
#define AGAT_UNKNOWN 0x00
|
||||||
|
#define AGAT_7 0x10 /* Agat 7 */
|
||||||
|
#define AGAT_9 0x20 /* Agat 9 */
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Code */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
unsigned char get_ostype (void);
|
||||||
|
/* Get the machine type. Returns one of the AGAT_xxx codes. */
|
||||||
|
|
||||||
|
void rebootafterexit (void);
|
||||||
|
/* Reboot machine after program termination has completed. */
|
||||||
|
|
||||||
|
/* The following #defines will cause the matching functions calls in conio.h
|
||||||
|
** to be overlaid by macros with the same names, saving the function call
|
||||||
|
** overhead.
|
||||||
|
*/
|
||||||
|
#define _bgcolor(color) COLOR_BLACK
|
||||||
|
#define _bordercolor(color) COLOR_BLACK
|
||||||
|
|
||||||
|
/* End of agat.h */
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -37,6 +37,8 @@
|
|||||||
# include <apple2enh.h>
|
# include <apple2enh.h>
|
||||||
#elif defined(__APPLE2__)
|
#elif defined(__APPLE2__)
|
||||||
# include <apple2.h>
|
# include <apple2.h>
|
||||||
|
#elif defined(__AGAT__)
|
||||||
|
# include <agat.h>
|
||||||
#elif defined(__ATARI__)
|
#elif defined(__ATARI__)
|
||||||
# include <atari.h>
|
# include <atari.h>
|
||||||
#elif defined(__ATARI2600__)
|
#elif defined(__ATARI2600__)
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ CBMS = c128 \
|
|||||||
GEOS = geos-apple \
|
GEOS = geos-apple \
|
||||||
geos-cbm
|
geos-cbm
|
||||||
|
|
||||||
TARGETS = apple2 \
|
TARGETS = agat \
|
||||||
|
apple2 \
|
||||||
apple2enh \
|
apple2enh \
|
||||||
atari \
|
atari \
|
||||||
atarixl \
|
atarixl \
|
||||||
|
|||||||
23
libsrc/agat/_scrsize.s
Normal file
23
libsrc/agat/_scrsize.s
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export screensize
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
screensize:
|
||||||
|
lda WNDWDTH
|
||||||
|
bit TATTR
|
||||||
|
bmi t64
|
||||||
|
lsr
|
||||||
|
t64:
|
||||||
|
tax
|
||||||
|
lda WNDBTM
|
||||||
|
sec
|
||||||
|
sbc WNDTOP
|
||||||
|
tay
|
||||||
|
rts
|
||||||
113
libsrc/agat/break.s
Normal file
113
libsrc/agat/break.s
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 27.09.1998
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; void __fastcall__ set_brk (unsigned Addr);
|
||||||
|
; void reset_brk (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _set_brk, _reset_brk
|
||||||
|
.destructor _reset_brk
|
||||||
|
|
||||||
|
; Be sure to export the following variables absolute
|
||||||
|
.export _brk_a: abs, _brk_x: abs, _brk_y: abs
|
||||||
|
.export _brk_sr: abs, _brk_pc: abs
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_brk_a = $45
|
||||||
|
_brk_x = $46
|
||||||
|
_brk_y = $47
|
||||||
|
_brk_sr = $48
|
||||||
|
_brk_sp = $49
|
||||||
|
_brk_pc = $3A
|
||||||
|
|
||||||
|
.bss
|
||||||
|
oldvec: .res 2 ; Old vector
|
||||||
|
|
||||||
|
|
||||||
|
.data
|
||||||
|
uservec: jmp $FFFF ; Patched at runtime
|
||||||
|
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
; Set the break vector
|
||||||
|
.proc _set_brk
|
||||||
|
|
||||||
|
sta uservec+1
|
||||||
|
stx uservec+2 ; Set the user vector
|
||||||
|
|
||||||
|
lda oldvec
|
||||||
|
ora oldvec+1 ; Did we save the vector already?
|
||||||
|
bne L1 ; Jump if we installed the handler already
|
||||||
|
|
||||||
|
lda BRKVec
|
||||||
|
sta oldvec
|
||||||
|
lda BRKVec+1
|
||||||
|
sta oldvec+1 ; Save the old vector
|
||||||
|
|
||||||
|
L1: lda #<brk_handler ; Set the break vector to our routine
|
||||||
|
ldx #>brk_handler
|
||||||
|
sta BRKVec
|
||||||
|
stx BRKVec+1
|
||||||
|
rts
|
||||||
|
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
; Reset the break vector
|
||||||
|
.proc _reset_brk
|
||||||
|
|
||||||
|
lda oldvec
|
||||||
|
ldx oldvec+1
|
||||||
|
beq @L9 ; Jump if vector not installed
|
||||||
|
sta BRKVec
|
||||||
|
stx BRKVec+1
|
||||||
|
lda #$00
|
||||||
|
sta oldvec ; Clear the old vector
|
||||||
|
stx oldvec+1
|
||||||
|
@L9: rts
|
||||||
|
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Break handler, called if a break occurs
|
||||||
|
|
||||||
|
.proc brk_handler
|
||||||
|
|
||||||
|
sec
|
||||||
|
lda _brk_pc
|
||||||
|
sbc #$02 ; Point to start of brk
|
||||||
|
sta _brk_pc
|
||||||
|
lda _brk_pc+1
|
||||||
|
sbc #$00
|
||||||
|
sta _brk_pc+1
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda _brk_sp
|
||||||
|
adc #$04 ; Adjust stack pointer
|
||||||
|
sta _brk_sp
|
||||||
|
|
||||||
|
lda _brk_sr ; Clear brk
|
||||||
|
and #$EF
|
||||||
|
sta _brk_sr
|
||||||
|
|
||||||
|
jsr uservec ; Call the user's routine
|
||||||
|
|
||||||
|
lda _brk_pc+1
|
||||||
|
pha
|
||||||
|
lda _brk_pc
|
||||||
|
pha
|
||||||
|
lda _brk_sr
|
||||||
|
pha
|
||||||
|
|
||||||
|
ldx _brk_x
|
||||||
|
ldy _brk_y
|
||||||
|
lda _brk_a
|
||||||
|
|
||||||
|
rti ; Jump back...
|
||||||
|
|
||||||
|
.endproc
|
||||||
|
|
||||||
18
libsrc/agat/cclear.s
Normal file
18
libsrc/agat/cclear.s
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; void __fastcall__ cclear (unsigned char length);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _cclear
|
||||||
|
.import COUT
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_cclear:
|
||||||
|
sta ptr1
|
||||||
|
lda #$A0
|
||||||
|
next:
|
||||||
|
jsr COUT
|
||||||
|
dec ptr1
|
||||||
|
bne next
|
||||||
|
rts
|
||||||
23
libsrc/agat/cgetc.s
Normal file
23
libsrc/agat/cgetc.s
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; char cgetc (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _cgetc
|
||||||
|
.import cursor
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_cgetc:
|
||||||
|
lda #$DF ; _
|
||||||
|
bit cursor
|
||||||
|
bne hascur
|
||||||
|
lda #$00
|
||||||
|
hascur:
|
||||||
|
sta CURSOR
|
||||||
|
jsr j1
|
||||||
|
cmp #$A0
|
||||||
|
bpl :+
|
||||||
|
and #$7F
|
||||||
|
: rts
|
||||||
|
j1: jmp (VCIN)
|
||||||
33
libsrc/agat/chline.s
Normal file
33
libsrc/agat/chline.s
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 08.08.1998
|
||||||
|
; Colin Leroy-Mira, 26.05.2025
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
|
; void chline (unsigned char length);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _chlinexy, _chline, chlinedirect
|
||||||
|
.import gotoxy, putchar
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_chlinexy:
|
||||||
|
pha ; Save the length
|
||||||
|
jsr gotoxy ; Call this one, will pop params
|
||||||
|
pla ; Restore the length and run into _chline
|
||||||
|
|
||||||
|
_chline:
|
||||||
|
ldx #$1B ; horizontal line character
|
||||||
|
|
||||||
|
chlinedirect:
|
||||||
|
stx tmp1
|
||||||
|
cmp #$00 ; Is the length zero?
|
||||||
|
beq done ; Jump if done
|
||||||
|
sta tmp2
|
||||||
|
: lda tmp1 ; Screen code
|
||||||
|
jsr putchar ; Direct output
|
||||||
|
dec tmp2
|
||||||
|
bne :-
|
||||||
|
done: rts
|
||||||
|
|
||||||
10
libsrc/agat/clrscr.s
Normal file
10
libsrc/agat/clrscr.s
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
;
|
||||||
|
; Kevin Ruland
|
||||||
|
;
|
||||||
|
; void clrscr (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _clrscr
|
||||||
|
.import HOME
|
||||||
|
|
||||||
|
_clrscr := HOME
|
||||||
20
libsrc/agat/color.s
Normal file
20
libsrc/agat/color.s
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; unsigned char __fastcall__ textcolor (unsigned char color);
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
.export _textcolor
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
|
||||||
|
_textcolor:
|
||||||
|
ldx TATTR
|
||||||
|
eor TATTR
|
||||||
|
and #$07
|
||||||
|
eor TATTR
|
||||||
|
sta TATTR
|
||||||
|
txa
|
||||||
|
and #$0F
|
||||||
|
rts
|
||||||
14
libsrc/agat/cout.s
Normal file
14
libsrc/agat/cout.s
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; COUT routine
|
||||||
|
;
|
||||||
|
|
||||||
|
.export COUT
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
COUT:
|
||||||
|
cmp #$10
|
||||||
|
bpl out
|
||||||
|
ora #$80
|
||||||
|
out: jmp (VCOUT)
|
||||||
60
libsrc/agat/cputc.s
Normal file
60
libsrc/agat/cputc.s
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);
|
||||||
|
; void __fastcall__ cputc (char c);
|
||||||
|
;
|
||||||
|
|
||||||
|
.import COUT
|
||||||
|
.export _cputcxy, _cputc, newline, putchar,putchardirect
|
||||||
|
.import gotoxy, VTABZ
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_cputcxy:
|
||||||
|
pha
|
||||||
|
jsr gotoxy
|
||||||
|
pla
|
||||||
|
_cputc:
|
||||||
|
cmp #$0D ; Test for \r = carriage return
|
||||||
|
bne notleft
|
||||||
|
ldy #$00
|
||||||
|
sty CH
|
||||||
|
rts
|
||||||
|
notleft:
|
||||||
|
cmp #$0A ; Test for \n = line feed
|
||||||
|
beq newline
|
||||||
|
|
||||||
|
putchar:
|
||||||
|
ldy CH
|
||||||
|
sta (BASL),Y
|
||||||
|
iny
|
||||||
|
lda TATTR
|
||||||
|
bmi wch ; Skip if t64
|
||||||
|
sta (BASL),Y
|
||||||
|
iny
|
||||||
|
wch:
|
||||||
|
sty CH
|
||||||
|
cpy WNDWDTH
|
||||||
|
bcc noend
|
||||||
|
ldy #$00
|
||||||
|
sty CH
|
||||||
|
newline:
|
||||||
|
inc CV
|
||||||
|
lda CV
|
||||||
|
cmp WNDBTM
|
||||||
|
bcc :+
|
||||||
|
lda WNDTOP
|
||||||
|
sta CV
|
||||||
|
: jmp VTABZ
|
||||||
|
noend:
|
||||||
|
rts
|
||||||
|
|
||||||
|
putchardirect:
|
||||||
|
ldy CH
|
||||||
|
sta (BASL),Y
|
||||||
|
lda TATTR
|
||||||
|
bmi :+
|
||||||
|
iny
|
||||||
|
sta (BASL),Y
|
||||||
|
: rts
|
||||||
78
libsrc/agat/crt0.s
Normal file
78
libsrc/agat/crt0.s
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
;
|
||||||
|
; Startup code for cc65 (Agat version)
|
||||||
|
;
|
||||||
|
|
||||||
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
|
.export _exit
|
||||||
|
|
||||||
|
.import initlib, donelib
|
||||||
|
.import zerobss, callmain
|
||||||
|
.import __ONCE_LOAD__, __ONCE_SIZE__ ; Linker generated
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.segment "STARTUP"
|
||||||
|
jsr init
|
||||||
|
jsr zerobss
|
||||||
|
jsr callmain
|
||||||
|
_exit:
|
||||||
|
ldx #<exit
|
||||||
|
lda #>exit
|
||||||
|
jsr reset
|
||||||
|
jsr donelib
|
||||||
|
exit:
|
||||||
|
ldx #$02
|
||||||
|
: lda rvsave,x
|
||||||
|
sta SOFTEV,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
ldx #zpspace-1
|
||||||
|
: lda zpsave,x
|
||||||
|
sta sp,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
ldx #$FF
|
||||||
|
txs
|
||||||
|
jmp DOSWARM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.segment "ONCE"
|
||||||
|
|
||||||
|
init:
|
||||||
|
ldx #zpspace-1
|
||||||
|
: lda sp,x
|
||||||
|
sta zpsave,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
ldx #$02
|
||||||
|
: lda SOFTEV,x
|
||||||
|
sta rvsave,x
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
lda HIMEM
|
||||||
|
ldx HIMEM+1
|
||||||
|
sta sp
|
||||||
|
stx sp+1
|
||||||
|
ldx #<_exit
|
||||||
|
lda #>_exit
|
||||||
|
jsr reset
|
||||||
|
jmp initlib
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
reset:
|
||||||
|
stx SOFTEV
|
||||||
|
sta SOFTEV+1
|
||||||
|
eor #$A5
|
||||||
|
sta PWREDUP
|
||||||
|
rts
|
||||||
|
|
||||||
|
.segment "INIT"
|
||||||
|
zpsave: .res zpspace
|
||||||
|
rvsave: .res 3
|
||||||
29
libsrc/agat/cvline.s
Normal file
29
libsrc/agat/cvline.s
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 08.08.1998
|
||||||
|
; Colin Leroy-Mira, 26.05.2025
|
||||||
|
; Konstantin Fedorov, 12.06.2025
|
||||||
|
;
|
||||||
|
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
|
; void cvline (unsigned char length);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _cvlinexy, _cvline
|
||||||
|
.import gotoxy, putchardirect, newline
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_cvlinexy:
|
||||||
|
pha ; Save the length
|
||||||
|
jsr gotoxy ; Call this one, will pop params
|
||||||
|
pla ; Restore the length and run into _cvline
|
||||||
|
|
||||||
|
_cvline:
|
||||||
|
cmp #$00 ; Is the length zero?
|
||||||
|
beq done ; Jump if done
|
||||||
|
sta tmp2
|
||||||
|
: lda #$5C ; vertical line character
|
||||||
|
jsr putchardirect ; Write, no cursor advance
|
||||||
|
jsr newline ; Advance cursor to next line
|
||||||
|
dec tmp2
|
||||||
|
bne :-
|
||||||
|
done: rts
|
||||||
43
libsrc/agat/exehdr.s
Normal file
43
libsrc/agat/exehdr.s
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-06-10
|
||||||
|
;
|
||||||
|
; This module supplies an AppleSingle version 2 file header + entry with
|
||||||
|
; ID 11 according to https://tools.ietf.org/rfc/rfc1740.txt Appendix A.
|
||||||
|
;
|
||||||
|
; Agat target uses this header only for compatibility with Apple Commander
|
||||||
|
; because Agat's 140K disk filesystem is identical to Apple II DOS 3.3 and
|
||||||
|
; "ac.jar -as" option can be used to import binaries into disk images.
|
||||||
|
|
||||||
|
.export __EXEHDR__ : absolute = 1 ; Linker referenced
|
||||||
|
.import __FILETYPE__ ; Linker generated
|
||||||
|
.import __MAIN_START__, __MAIN_LAST__ ; Linker generated
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; Data Fork
|
||||||
|
ID01_LENGTH = __MAIN_LAST__ - __MAIN_START__
|
||||||
|
ID01_OFFSET = ID01 - START
|
||||||
|
|
||||||
|
; ProDOS File Info
|
||||||
|
ID11_LENGTH = ID01 - ID11
|
||||||
|
ID11_OFFSET = ID11 - START
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.segment "EXEHDR"
|
||||||
|
|
||||||
|
START: .byte $00, $05, $16, $00 ; Magic number
|
||||||
|
.byte $00, $02, $00, $00 ; Version number
|
||||||
|
.res 16 ; Filler
|
||||||
|
.byte 0, 2 ; Number of entries
|
||||||
|
.byte 0, 0, 0, 1 ; Entry ID 1 - Data Fork
|
||||||
|
.byte 0, 0, >ID01_OFFSET, <ID01_OFFSET ; Offset
|
||||||
|
.byte 0, 0, >ID01_LENGTH, <ID01_LENGTH ; Length
|
||||||
|
.byte 0, 0, 0, 11 ; Entry ID 11 - ProDOS File Info
|
||||||
|
.byte 0, 0, >ID11_OFFSET, <ID11_OFFSET ; Offset
|
||||||
|
.byte 0, 0, >ID11_LENGTH, <ID11_LENGTH ; Length
|
||||||
|
ID11: .byte 0, %11000011 ; Access - Destroy, Rename, Write, Read
|
||||||
|
.byte >__FILETYPE__, <__FILETYPE__ ; File Type
|
||||||
|
.byte 0, 0 ; Auxiliary Type high
|
||||||
|
.byte >__MAIN_START__, <__MAIN_START__ ; Auxiliary Type low
|
||||||
|
ID01:
|
||||||
28
libsrc/agat/gotoxy.s
Normal file
28
libsrc/agat/gotoxy.s
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 06.08.1998
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; void __fastcall__ gotoxy (unsigned char x, unsigned char y);
|
||||||
|
; void __fastcall__ gotox (unsigned char x);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export gotoxy, _gotoxy, _gotox
|
||||||
|
.import popa, VTABZ
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
gotoxy:
|
||||||
|
jsr popa ; Get Y
|
||||||
|
_gotoxy:
|
||||||
|
clc
|
||||||
|
adc WNDTOP
|
||||||
|
sta CV ; Store Y
|
||||||
|
jsr VTABZ
|
||||||
|
jsr popa ; Get X
|
||||||
|
_gotox:
|
||||||
|
bit TATTR
|
||||||
|
bmi t64
|
||||||
|
asl
|
||||||
|
t64:
|
||||||
|
sta CH ; Store X
|
||||||
|
rts
|
||||||
16
libsrc/agat/gotoy.s
Normal file
16
libsrc/agat/gotoy.s
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 06.08.1998
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; void __fastcall__ gotoy (unsigned char y);
|
||||||
|
;
|
||||||
|
|
||||||
|
.import VTABZ
|
||||||
|
.export _gotoy
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_gotoy:
|
||||||
|
clc
|
||||||
|
adc WNDTOP
|
||||||
|
sta CV
|
||||||
|
jmp VTABZ
|
||||||
15
libsrc/agat/home.s
Normal file
15
libsrc/agat/home.s
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; HOME routine
|
||||||
|
;
|
||||||
|
|
||||||
|
.export HOME
|
||||||
|
.import COUT
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
HOME:
|
||||||
|
lda #$8C
|
||||||
|
jmp COUT
|
||||||
|
rts
|
||||||
19
libsrc/agat/kbhit.s
Normal file
19
libsrc/agat/kbhit.s
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
;
|
||||||
|
; Kevin Ruland
|
||||||
|
; Ullrich von Bassewitz, 2005-03-25
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; unsigned char kbhit (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _kbhit
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_kbhit:
|
||||||
|
lda KBD ; Reading KBD checks for keypress
|
||||||
|
rol ; if high bit is set, key was pressed
|
||||||
|
lda #$00
|
||||||
|
tax
|
||||||
|
rol
|
||||||
|
rts
|
||||||
18
libsrc/agat/randomize.s
Normal file
18
libsrc/agat/randomize.s
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 07.11.2002
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; void _randomize (void);
|
||||||
|
; /* Initialize the random number generator */
|
||||||
|
;
|
||||||
|
|
||||||
|
.export __randomize
|
||||||
|
.import _srand
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
__randomize:
|
||||||
|
ldx RNDH ; Use random value supplied by ROM
|
||||||
|
lda RNDL
|
||||||
|
jmp _srand ; Initialize generator
|
||||||
|
|
||||||
38
libsrc/agat/revers.s
Normal file
38
libsrc/agat/revers.s
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 2005-03-28
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; unsigned char __fastcall__ revers (unsigned char onoff)
|
||||||
|
; unsigned char __fastcall__ flash (unsigned char onoff)
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _revers, _flash
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_revers:
|
||||||
|
tax
|
||||||
|
beq noinv
|
||||||
|
lda TATTR
|
||||||
|
and #$D7
|
||||||
|
sta TATTR
|
||||||
|
rts
|
||||||
|
noinv:
|
||||||
|
lda TATTR
|
||||||
|
ora #$20
|
||||||
|
sta TATTR
|
||||||
|
rts
|
||||||
|
|
||||||
|
_flash:
|
||||||
|
tax
|
||||||
|
beq noflash
|
||||||
|
lda TATTR
|
||||||
|
and #$DF
|
||||||
|
ora #$08
|
||||||
|
sta TATTR
|
||||||
|
rts
|
||||||
|
noflash:
|
||||||
|
lda TATTR
|
||||||
|
ora #$20
|
||||||
|
sta TATTR
|
||||||
|
rts
|
||||||
24
libsrc/agat/vtabz.s
Normal file
24
libsrc/agat/vtabz.s
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; VTABZ routine
|
||||||
|
;
|
||||||
|
|
||||||
|
.export VTABZ
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
VTABZ:
|
||||||
|
lda CV
|
||||||
|
ror
|
||||||
|
ror
|
||||||
|
ror
|
||||||
|
and #$C0
|
||||||
|
sta BASL
|
||||||
|
lda CV
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
eor BASH
|
||||||
|
and #$07
|
||||||
|
eor BASH
|
||||||
|
sta BASH
|
||||||
|
rts
|
||||||
19
libsrc/agat/wherex.s
Normal file
19
libsrc/agat/wherex.s
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
;
|
||||||
|
; Kevin Ruland
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; unsigned char wherex (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _wherex
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_wherex:
|
||||||
|
lda CH
|
||||||
|
bit TATTR
|
||||||
|
bmi t64
|
||||||
|
lsr
|
||||||
|
t64:
|
||||||
|
ldx #$00
|
||||||
|
rts
|
||||||
17
libsrc/agat/wherey.s
Normal file
17
libsrc/agat/wherey.s
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
;
|
||||||
|
; Kevin Ruland
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; unsigned char wherey (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _wherey
|
||||||
|
|
||||||
|
.include "agat.inc"
|
||||||
|
|
||||||
|
_wherey:
|
||||||
|
lda CV
|
||||||
|
sec
|
||||||
|
sbc WNDTOP
|
||||||
|
ldx #$00
|
||||||
|
rts
|
||||||
50
libsrc/agat/write.s
Normal file
50
libsrc/agat/write.s
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
;
|
||||||
|
; Oleg A. Odintsov, Moscow, 2024
|
||||||
|
;
|
||||||
|
; int __fastcall__ write (int fd, const void* buf, unsigned count);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _write
|
||||||
|
.import popax, popptr1
|
||||||
|
.import COUT
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
|
||||||
|
_write:
|
||||||
|
sta ptr2
|
||||||
|
stx ptr2+1
|
||||||
|
jsr popptr1
|
||||||
|
jsr popax
|
||||||
|
|
||||||
|
; Check for zero count
|
||||||
|
ora ptr2
|
||||||
|
beq done
|
||||||
|
|
||||||
|
; Get char from buf
|
||||||
|
next: ldy #$00
|
||||||
|
lda (ptr1),y
|
||||||
|
|
||||||
|
; Replace '\n' with '\r'
|
||||||
|
cmp #$0A
|
||||||
|
bne output
|
||||||
|
lda #$8D
|
||||||
|
|
||||||
|
; Set hi bit and write to device
|
||||||
|
output:
|
||||||
|
jsr COUT ; Preserves X and Y
|
||||||
|
|
||||||
|
; Increment pointer
|
||||||
|
inc ptr1
|
||||||
|
bne :+
|
||||||
|
inc ptr1+1
|
||||||
|
|
||||||
|
; Decrement count
|
||||||
|
: dec ptr2
|
||||||
|
bne next
|
||||||
|
dec ptr2+1
|
||||||
|
bpl next
|
||||||
|
|
||||||
|
; Return success
|
||||||
|
done: lda #$00
|
||||||
|
rts
|
||||||
|
|
||||||
@@ -158,6 +158,11 @@ DIRLIST = tutorial geos atari2600 atari5200 apple2 gamate lynx supervision sym1
|
|||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Lists of executables
|
# Lists of executables
|
||||||
|
EXELIST_agat = \
|
||||||
|
ascii \
|
||||||
|
checkversion \
|
||||||
|
hello \
|
||||||
|
sieve
|
||||||
|
|
||||||
EXELIST_apple2 = \
|
EXELIST_apple2 = \
|
||||||
ascii \
|
ascii \
|
||||||
@@ -390,6 +395,7 @@ all:
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# List of every supported platform
|
# List of every supported platform
|
||||||
TARGETS := \
|
TARGETS := \
|
||||||
|
agat \
|
||||||
apple2 \
|
apple2 \
|
||||||
apple2enh \
|
apple2enh \
|
||||||
atari \
|
atari \
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Workaround missing clock stuff */
|
/* Workaround missing clock stuff */
|
||||||
#ifdef __APPLE2__
|
#if defined(__APPLE2__) || defined(__AGAT__)
|
||||||
# define clock() 0
|
# define clock() 0
|
||||||
# define CLOCKS_PER_SEC 1
|
# define CLOCKS_PER_SEC 1
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab6502.Ins) / sizeof (InsTab6502.Ins[0]),
|
sizeof (InsTab6502.Ins) / sizeof (InsTab6502.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x080A26C, 0x20, 0, PutAll },
|
{ "AND", 0x080A26C, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -228,6 +229,7 @@ static const struct {
|
|||||||
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -239,6 +241,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab6502X.Ins) / sizeof (InsTab6502X.Ins[0]),
|
sizeof (InsTab6502X.Ins) / sizeof (InsTab6502X.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
||||||
{ "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */
|
{ "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */
|
||||||
{ "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X */
|
{ "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X */
|
||||||
@@ -314,6 +317,7 @@ static const struct {
|
|||||||
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -329,6 +333,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab6502DTV.Ins) / sizeof (InsTab6502DTV.Ins[0]),
|
sizeof (InsTab6502DTV.Ins) / sizeof (InsTab6502DTV.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A26C, 0x60, 0, PutAll },
|
||||||
{ "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */
|
{ "ALR", 0x0800000, 0x4B, 0, PutAll }, /* X */
|
||||||
{ "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X */
|
{ "ANC", 0x0800000, 0x0B, 0, PutAll }, /* X */
|
||||||
@@ -400,6 +405,7 @@ static const struct {
|
|||||||
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -411,6 +417,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab65SC02.Ins) / sizeof (InsTab65SC02.Ins[0]),
|
sizeof (InsTab65SC02.Ins) / sizeof (InsTab65SC02.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -477,6 +484,7 @@ static const struct {
|
|||||||
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -488,6 +496,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab65C02.Ins) / sizeof (InsTab65C02.Ins[0]),
|
sizeof (InsTab65C02.Ins) / sizeof (InsTab65C02.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -588,6 +597,7 @@ static const struct {
|
|||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll },
|
{ "TYA", 0x0000001, 0x98, 0, PutAll },
|
||||||
{ "WAI", 0x0000001, 0xcb, 0, PutAll }
|
{ "WAI", 0x0000001, 0xcb, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -599,6 +609,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab4510.Ins) / sizeof (InsTab4510.Ins[0]),
|
sizeof (InsTab4510.Ins) / sizeof (InsTab4510.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -732,6 +743,7 @@ static const struct {
|
|||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll },
|
{ "TYA", 0x0000001, 0x98, 0, PutAll },
|
||||||
{ "TYS", 0x0000001, 0x2b, 0, PutAll },
|
{ "TYS", 0x0000001, 0x2b, 0, PutAll },
|
||||||
{ "TZA", 0x0000001, 0x6b, 0, PutAll },
|
{ "TZA", 0x0000001, 0x6b, 0, PutAll },
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -743,6 +755,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTab65816.Ins) / sizeof (InsTab65816.Ins[0]),
|
sizeof (InsTab65816.Ins) / sizeof (InsTab65816.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x0b8f6fc, 0x60, 0, PutAll },
|
{ "ADC", 0x0b8f6fc, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x0b8f6fc, 0x20, 0, PutAll },
|
{ "AND", 0x0b8f6fc, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -843,6 +856,7 @@ static const struct {
|
|||||||
{ "WDM", 0x0800004, 0x42, 6, PutAll },
|
{ "WDM", 0x0800004, 0x42, 6, PutAll },
|
||||||
{ "XBA", 0x0000001, 0xeb, 0, PutAll },
|
{ "XBA", 0x0000001, 0xeb, 0, PutAll },
|
||||||
{ "XCE", 0x0000001, 0xfb, 0, PutAll }
|
{ "XCE", 0x0000001, 0xfb, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -854,6 +868,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTabSweet16.Ins) / sizeof (InsTabSweet16.Ins[0]),
|
sizeof (InsTabSweet16.Ins) / sizeof (InsTabSweet16.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADD", AMSW16_REG, 0xA0, 0, PutSweet16 },
|
{ "ADD", AMSW16_REG, 0xA0, 0, PutSweet16 },
|
||||||
{ "BC", AMSW16_BRA, 0x03, 0, PutSweet16Branch },
|
{ "BC", AMSW16_BRA, 0x03, 0, PutSweet16Branch },
|
||||||
{ "BK", AMSW16_IMP, 0x0A, 0, PutSweet16 },
|
{ "BK", AMSW16_IMP, 0x0A, 0, PutSweet16 },
|
||||||
@@ -880,6 +895,7 @@ static const struct {
|
|||||||
{ "STD", AMSW16_IND, 0x70, 0, PutSweet16 },
|
{ "STD", AMSW16_IND, 0x70, 0, PutSweet16 },
|
||||||
{ "STP", AMSW16_IND, 0x90, 0, PutSweet16 },
|
{ "STP", AMSW16_IND, 0x90, 0, PutSweet16 },
|
||||||
{ "SUB", AMSW16_REG, 0xB0, 0, PutSweet16 },
|
{ "SUB", AMSW16_REG, 0xB0, 0, PutSweet16 },
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -891,6 +907,7 @@ static const struct {
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
sizeof (InsTabHuC6280.Ins) / sizeof (InsTabHuC6280.Ins[0]),
|
sizeof (InsTabHuC6280.Ins) / sizeof (InsTabHuC6280.Ins[0]),
|
||||||
{
|
{
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
{ "ADC", 0x080A66C, 0x60, 0, PutAll },
|
||||||
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
{ "AND", 0x080A66C, 0x20, 0, PutAll },
|
||||||
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
{ "ASL", 0x000006e, 0x02, 1, PutAll },
|
||||||
@@ -1026,6 +1043,7 @@ static const struct {
|
|||||||
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
{ "TXA", 0x0000001, 0x8a, 0, PutAll },
|
||||||
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
{ "TXS", 0x0000001, 0x9a, 0, PutAll },
|
||||||
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
{ "TYA", 0x0000001, 0x98, 0, PutAll }
|
||||||
|
/* END SORTED.SH */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -350,6 +350,10 @@ static void SetSys (const char* Sys)
|
|||||||
NewSymbol ("__RP6502__", 1);
|
NewSymbol ("__RP6502__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TGT_AGAT:
|
||||||
|
NewSymbol ("__AGAT__", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
AbEnd ("Invalid target name: '%s'", Sys);
|
AbEnd ("Invalid target name: '%s'", Sys);
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ struct DotKeyword {
|
|||||||
const char* Key; /* MUST be first field */
|
const char* Key; /* MUST be first field */
|
||||||
token_t Tok;
|
token_t Tok;
|
||||||
} DotKeywords [] = {
|
} DotKeywords [] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ ".A16", TOK_A16 },
|
{ ".A16", TOK_A16 },
|
||||||
{ ".A8", TOK_A8 },
|
{ ".A8", TOK_A8 },
|
||||||
{ ".ADDR", TOK_ADDR },
|
{ ".ADDR", TOK_ADDR },
|
||||||
@@ -307,6 +308,7 @@ struct DotKeyword {
|
|||||||
{ ".XMATCH", TOK_XMATCH },
|
{ ".XMATCH", TOK_XMATCH },
|
||||||
{ ".XOR", TOK_BOOLXOR },
|
{ ".XOR", TOK_BOOLXOR },
|
||||||
{ ".ZEROPAGE", TOK_ZEROPAGE },
|
{ ".ZEROPAGE", TOK_ZEROPAGE },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ struct FuncInfo {
|
|||||||
*/
|
*/
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const FuncInfo FuncInfoTable[] = {
|
static const FuncInfo FuncInfoTable[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "addeq0sp", SLV_TOP | REG_AX, PSTATE_ALL | REG_AXY },
|
{ "addeq0sp", SLV_TOP | REG_AX, PSTATE_ALL | REG_AXY },
|
||||||
{ "addeqysp", SLV_IND | REG_AXY, PSTATE_ALL | REG_AXY },
|
{ "addeqysp", SLV_IND | REG_AXY, PSTATE_ALL | REG_AXY },
|
||||||
{ "addysp", REG_SP | REG_Y, PSTATE_ALL | REG_SP },
|
{ "addysp", REG_SP | REG_Y, PSTATE_ALL | REG_SP },
|
||||||
@@ -377,12 +378,14 @@ static const FuncInfo FuncInfoTable[] = {
|
|||||||
{ "tosxoreax", SLV_TOP | REG_EAX, PSTATE_ALL | REG_SP | REG_EAXY | REG_TMP1 },
|
{ "tosxoreax", SLV_TOP | REG_EAX, PSTATE_ALL | REG_SP | REG_EAXY | REG_TMP1 },
|
||||||
{ "tsteax", REG_EAX, PSTATE_ALL | REG_Y },
|
{ "tsteax", REG_EAX, PSTATE_ALL | REG_Y },
|
||||||
{ "utsteax", REG_EAX, PSTATE_ALL | REG_Y },
|
{ "utsteax", REG_EAX, PSTATE_ALL | REG_Y },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define FuncInfoCount (sizeof(FuncInfoTable) / sizeof(FuncInfoTable[0]))
|
#define FuncInfoCount (sizeof(FuncInfoTable) / sizeof(FuncInfoTable[0]))
|
||||||
|
|
||||||
/* Table with names of zero page locations used by the compiler */
|
/* Table with names of zero page locations used by the compiler */
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const ZPInfo ZPInfoTable[] = {
|
static const ZPInfo ZPInfoTable[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ 0, "c_sp", 2, REG_SP_LO, REG_SP },
|
{ 0, "c_sp", 2, REG_SP_LO, REG_SP },
|
||||||
{ 0, "c_sp+1", 1, REG_SP_HI, REG_SP },
|
{ 0, "c_sp+1", 1, REG_SP_HI, REG_SP },
|
||||||
{ 0, "ptr1", 2, REG_PTR1_LO, REG_PTR1 },
|
{ 0, "ptr1", 2, REG_PTR1_LO, REG_PTR1 },
|
||||||
@@ -400,6 +403,7 @@ static const ZPInfo ZPInfoTable[] = {
|
|||||||
{ 0, "tmp2", 1, REG_NONE, REG_NONE },
|
{ 0, "tmp2", 1, REG_NONE, REG_NONE },
|
||||||
{ 0, "tmp3", 1, REG_NONE, REG_NONE },
|
{ 0, "tmp3", 1, REG_NONE, REG_NONE },
|
||||||
{ 0, "tmp4", 1, REG_NONE, REG_NONE },
|
{ 0, "tmp4", 1, REG_NONE, REG_NONE },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define ZPInfoCount (sizeof(ZPInfoTable) / sizeof(ZPInfoTable[0]))
|
#define ZPInfoCount (sizeof(ZPInfoTable) / sizeof(ZPInfoTable[0]))
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ struct OptFunc {
|
|||||||
|
|
||||||
/* A list of all the function descriptions */
|
/* A list of all the function descriptions */
|
||||||
/* CAUTION: should be sorted by "name" */
|
/* CAUTION: should be sorted by "name" */
|
||||||
|
/* BEGIN DECL SORTED_CODEOPT.SH */
|
||||||
static OptFunc DOpt65C02BitOps = { Opt65C02BitOps, "Opt65C02BitOps", 66, 0, 0, 0, 0, 0 };
|
static OptFunc DOpt65C02BitOps = { Opt65C02BitOps, "Opt65C02BitOps", 66, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOpt65C02Ind = { Opt65C02Ind, "Opt65C02Ind", 100, 0, 0, 0, 0, 0 };
|
static OptFunc DOpt65C02Ind = { Opt65C02Ind, "Opt65C02Ind", 100, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOpt65C02Stores = { Opt65C02Stores, "Opt65C02Stores", 100, 0, 0, 0, 0, 0 };
|
static OptFunc DOpt65C02Stores = { Opt65C02Stores, "Opt65C02Stores", 100, 0, 0, 0, 0, 0 };
|
||||||
@@ -215,11 +216,13 @@ static OptFunc DOptTransfers3 = { OptTransfers3, "OptTransfers3", 65, 0,
|
|||||||
static OptFunc DOptTransfers4 = { OptTransfers4, "OptTransfers4", 65, 0, 0, 0, 0, 0 };
|
static OptFunc DOptTransfers4 = { OptTransfers4, "OptTransfers4", 65, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptUnusedLoads = { OptUnusedLoads, "OptUnusedLoads", 0, 0, 0, 0, 0, 0 };
|
static OptFunc DOptUnusedLoads = { OptUnusedLoads, "OptUnusedLoads", 0, 0, 0, 0, 0, 0 };
|
||||||
static OptFunc DOptUnusedStores = { OptUnusedStores, "OptUnusedStores", 0, 0, 0, 0, 0, 0 };
|
static OptFunc DOptUnusedStores = { OptUnusedStores, "OptUnusedStores", 0, 0, 0, 0, 0, 0 };
|
||||||
|
/* END DECL SORTED_CODEOPT.SH */
|
||||||
|
|
||||||
|
|
||||||
/* Table containing all the steps in alphabetical order */
|
/* Table containing all the steps in alphabetical order */
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static OptFunc* OptFuncs[] = {
|
static OptFunc* OptFuncs[] = {
|
||||||
|
/* BEGIN SORTED_CODEOPT.SH */
|
||||||
&DOpt65C02BitOps,
|
&DOpt65C02BitOps,
|
||||||
&DOpt65C02Ind,
|
&DOpt65C02Ind,
|
||||||
&DOpt65C02Stores,
|
&DOpt65C02Stores,
|
||||||
@@ -332,6 +335,7 @@ static OptFunc* OptFuncs[] = {
|
|||||||
&DOptTransfers4,
|
&DOptTransfers4,
|
||||||
&DOptUnusedLoads,
|
&DOptUnusedLoads,
|
||||||
&DOptUnusedStores,
|
&DOptUnusedStores,
|
||||||
|
/* END SORTED_CODEOPT.SH */
|
||||||
};
|
};
|
||||||
#define OPTFUNC_COUNT (sizeof(OptFuncs) / sizeof(OptFuncs[0]))
|
#define OPTFUNC_COUNT (sizeof(OptFuncs) / sizeof(OptFuncs[0]))
|
||||||
|
|
||||||
|
|||||||
@@ -1227,7 +1227,9 @@ static int CmpHarmless (const void* Key, const void* Entry)
|
|||||||
|
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const char* const Tab[] = {
|
static const char* const Tab[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
"_abs",
|
"_abs",
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
int HarmlessCall (const CodeEntry* E, int PushedBytes)
|
int HarmlessCall (const CodeEntry* E, int PushedBytes)
|
||||||
|
|||||||
@@ -1466,6 +1466,7 @@ static unsigned Opt_a_tosxor (StackOpData* D)
|
|||||||
|
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const OptFuncDesc FuncTable[] = {
|
static const OptFuncDesc FuncTable[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "___bzero", Opt___bzero, REG_NONE, OP_X_ZERO | OP_A_KNOWN },
|
{ "___bzero", Opt___bzero, REG_NONE, OP_X_ZERO | OP_A_KNOWN },
|
||||||
{ "staspidx", Opt_staspidx, REG_NONE, OP_NONE },
|
{ "staspidx", Opt_staspidx, REG_NONE, OP_NONE },
|
||||||
{ "staxspidx", Opt_staxspidx, REG_AX, OP_NONE },
|
{ "staxspidx", Opt_staxspidx, REG_AX, OP_NONE },
|
||||||
@@ -1486,10 +1487,12 @@ static const OptFuncDesc FuncTable[] = {
|
|||||||
{ "tosuleax", Opt_tosuleax, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
{ "tosuleax", Opt_tosuleax, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
||||||
{ "tosultax", Opt_tosultax, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
{ "tosultax", Opt_tosultax, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
||||||
{ "tosxorax", Opt_tosxorax, REG_NONE, OP_NONE },
|
{ "tosxorax", Opt_tosxorax, REG_NONE, OP_NONE },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const OptFuncDesc FuncRegATable[] = {
|
static const OptFuncDesc FuncRegATable[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "tosandax", Opt_a_tosand, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
{ "tosandax", Opt_a_tosand, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
||||||
{ "toseqax", Opt_a_toseq, REG_NONE, OP_NONE },
|
{ "toseqax", Opt_a_toseq, REG_NONE, OP_NONE },
|
||||||
{ "tosgeax", Opt_a_tosuge, REG_NONE, OP_NONE },
|
{ "tosgeax", Opt_a_tosuge, REG_NONE, OP_NONE },
|
||||||
@@ -1505,6 +1508,7 @@ static const OptFuncDesc FuncRegATable[] = {
|
|||||||
{ "tosuleax", Opt_a_tosule, REG_NONE, OP_NONE },
|
{ "tosuleax", Opt_a_tosule, REG_NONE, OP_NONE },
|
||||||
{ "tosultax", Opt_a_tosult, REG_NONE, OP_NONE },
|
{ "tosultax", Opt_a_tosult, REG_NONE, OP_NONE },
|
||||||
{ "tosxorax", Opt_a_tosxor, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
{ "tosxorax", Opt_a_tosxor, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FUNC_COUNT(Table) (sizeof(Table) / sizeof(Table[0]))
|
#define FUNC_COUNT(Table) (sizeof(Table) / sizeof(Table[0]))
|
||||||
|
|||||||
@@ -307,6 +307,10 @@ static void SetSys (const char* Sys)
|
|||||||
DefineNumericMacro ("__RP6502__", 1);
|
DefineNumericMacro ("__RP6502__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TGT_AGAT:
|
||||||
|
DefineNumericMacro ("__AGAT__", 1);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
AbEnd ("Unknown target system '%s'", Sys);
|
AbEnd ("Unknown target system '%s'", Sys);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@
|
|||||||
const OPCDesc OPCTable[OP65_COUNT] = {
|
const OPCDesc OPCTable[OP65_COUNT] = {
|
||||||
|
|
||||||
/* 65XX opcodes */
|
/* 65XX opcodes */
|
||||||
|
|
||||||
|
/* BEGIN SORTED_OPCODES.SH */
|
||||||
{ OP65_ADC, /* opcode */
|
{ OP65_ADC, /* opcode */
|
||||||
"adc", /* mnemonic */
|
"adc", /* mnemonic */
|
||||||
0, /* size */
|
0, /* size */
|
||||||
@@ -587,6 +589,7 @@ const OPCDesc OPCTable[OP65_COUNT] = {
|
|||||||
REG_Y, /* use */
|
REG_Y, /* use */
|
||||||
REG_A | PSTATE_ZN /* chg */
|
REG_A | PSTATE_ZN /* chg */
|
||||||
},
|
},
|
||||||
|
/* END SORTED_OPCODES.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ static const struct Pragma {
|
|||||||
const char* Key; /* Keyword */
|
const char* Key; /* Keyword */
|
||||||
pragma_t Tok; /* Token */
|
pragma_t Tok; /* Token */
|
||||||
} Pragmas[] = {
|
} Pragmas[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "align", PRAGMA_ALIGN },
|
{ "align", PRAGMA_ALIGN },
|
||||||
{ "allow-eager-inline", PRAGMA_ALLOW_EAGER_INLINE },
|
{ "allow-eager-inline", PRAGMA_ALLOW_EAGER_INLINE },
|
||||||
{ "allow_eager_inline", PRAGMA_ALLOW_EAGER_INLINE },
|
{ "allow_eager_inline", PRAGMA_ALLOW_EAGER_INLINE },
|
||||||
@@ -128,6 +129,7 @@ static const struct Pragma {
|
|||||||
{ "writable-strings", PRAGMA_WRITABLE_STRINGS },
|
{ "writable-strings", PRAGMA_WRITABLE_STRINGS },
|
||||||
{ "writable_strings", PRAGMA_WRITABLE_STRINGS },
|
{ "writable_strings", PRAGMA_WRITABLE_STRINGS },
|
||||||
{ "zpsym", PRAGMA_ZPSYM },
|
{ "zpsym", PRAGMA_ZPSYM },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define PRAGMA_COUNT (sizeof (Pragmas) / sizeof (Pragmas[0]))
|
#define PRAGMA_COUNT (sizeof (Pragmas) / sizeof (Pragmas[0]))
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ static const struct PPDType {
|
|||||||
const char* Tok; /* Token */
|
const char* Tok; /* Token */
|
||||||
ppdirective_t Type; /* Type */
|
ppdirective_t Type; /* Type */
|
||||||
} PPDTypes[] = {
|
} PPDTypes[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "define", PPD_DEFINE },
|
{ "define", PPD_DEFINE },
|
||||||
{ "elif", PPD_ELIF },
|
{ "elif", PPD_ELIF },
|
||||||
{ "else", PPD_ELSE },
|
{ "else", PPD_ELSE },
|
||||||
@@ -234,6 +235,7 @@ static const struct PPDType {
|
|||||||
{ "pragma", PPD_PRAGMA },
|
{ "pragma", PPD_PRAGMA },
|
||||||
{ "undef", PPD_UNDEF },
|
{ "undef", PPD_UNDEF },
|
||||||
{ "warning", PPD_WARNING },
|
{ "warning", PPD_WARNING },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Number of preprocessor directive types */
|
/* Number of preprocessor directive types */
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ static const struct Keyword {
|
|||||||
unsigned char Tok; /* The token */
|
unsigned char Tok; /* The token */
|
||||||
unsigned char Std; /* Token supported in which standards? */
|
unsigned char Std; /* Token supported in which standards? */
|
||||||
} Keywords [] = {
|
} Keywords [] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "_Pragma", TOK_PRAGMA, TT_C89 | TT_C99 | TT_CC65 }, /* !! */
|
{ "_Pragma", TOK_PRAGMA, TT_C89 | TT_C99 | TT_CC65 }, /* !! */
|
||||||
{ "_Static_assert", TOK_STATIC_ASSERT, TT_CC65 }, /* C11 */
|
{ "_Static_assert", TOK_STATIC_ASSERT, TT_CC65 }, /* C11 */
|
||||||
{ "__AX__", TOK_AX, TT_C89 | TT_C99 | TT_CC65 },
|
{ "__AX__", TOK_AX, TT_C89 | TT_C99 | TT_CC65 },
|
||||||
@@ -146,6 +147,7 @@ static const struct Keyword {
|
|||||||
{ "void", TOK_VOID, TT_C89 | TT_C99 | TT_CC65 },
|
{ "void", TOK_VOID, TT_C89 | TT_C99 | TT_CC65 },
|
||||||
{ "volatile", TOK_VOLATILE, TT_C89 | TT_C99 | TT_CC65 },
|
{ "volatile", TOK_VOLATILE, TT_C89 | TT_C99 | TT_CC65 },
|
||||||
{ "while", TOK_WHILE, TT_C89 | TT_C99 | TT_CC65 },
|
{ "while", TOK_WHILE, TT_C89 | TT_C99 | TT_CC65 },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define KEY_COUNT (sizeof (Keywords) / sizeof (Keywords [0]))
|
#define KEY_COUNT (sizeof (Keywords) / sizeof (Keywords [0]))
|
||||||
|
|
||||||
|
|||||||
@@ -85,11 +85,13 @@ static struct StdFuncDesc {
|
|||||||
const char* Name;
|
const char* Name;
|
||||||
void (*Handler) (FuncDesc*, ExprDesc*);
|
void (*Handler) (FuncDesc*, ExprDesc*);
|
||||||
} StdFuncs[] = {
|
} StdFuncs[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "memcpy", StdFunc_memcpy },
|
{ "memcpy", StdFunc_memcpy },
|
||||||
{ "memset", StdFunc_memset },
|
{ "memset", StdFunc_memset },
|
||||||
{ "strcmp", StdFunc_strcmp },
|
{ "strcmp", StdFunc_strcmp },
|
||||||
{ "strcpy", StdFunc_strcpy },
|
{ "strcpy", StdFunc_strcpy },
|
||||||
{ "strlen", StdFunc_strlen },
|
{ "strlen", StdFunc_strlen },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define FUNC_COUNT (sizeof (StdFuncs) / sizeof (StdFuncs[0]))
|
#define FUNC_COUNT (sizeof (StdFuncs) / sizeof (StdFuncs[0]))
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
/* CAUTION: table must be sorted for bsearch */
|
/* CAUTION: table must be sorted for bsearch */
|
||||||
static const FileId TypeTable[] = {
|
static const FileId TypeTable[] = {
|
||||||
/* Upper case stuff for obsolete operating systems */
|
/* Upper case stuff for obsolete operating systems */
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "A", FILETYPE_LIB },
|
{ "A", FILETYPE_LIB },
|
||||||
{ "A65", FILETYPE_ASM },
|
{ "A65", FILETYPE_ASM },
|
||||||
{ "ASM", FILETYPE_ASM },
|
{ "ASM", FILETYPE_ASM },
|
||||||
@@ -66,7 +67,6 @@ static const FileId TypeTable[] = {
|
|||||||
{ "S", FILETYPE_ASM },
|
{ "S", FILETYPE_ASM },
|
||||||
{ "SER", FILETYPE_O65 },
|
{ "SER", FILETYPE_O65 },
|
||||||
{ "TGI", FILETYPE_O65 },
|
{ "TGI", FILETYPE_O65 },
|
||||||
|
|
||||||
{ "a", FILETYPE_LIB },
|
{ "a", FILETYPE_LIB },
|
||||||
{ "a65", FILETYPE_ASM },
|
{ "a65", FILETYPE_ASM },
|
||||||
{ "asm", FILETYPE_ASM },
|
{ "asm", FILETYPE_ASM },
|
||||||
@@ -82,6 +82,7 @@ static const FileId TypeTable[] = {
|
|||||||
{ "s", FILETYPE_ASM },
|
{ "s", FILETYPE_ASM },
|
||||||
{ "ser", FILETYPE_O65 },
|
{ "ser", FILETYPE_O65 },
|
||||||
{ "tgi", FILETYPE_O65 },
|
{ "tgi", FILETYPE_O65 },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FILETYPE_COUNT (sizeof (TypeTable) / sizeof (TypeTable[0]))
|
#define FILETYPE_COUNT (sizeof (TypeTable) / sizeof (TypeTable[0]))
|
||||||
|
|||||||
@@ -156,15 +156,22 @@ char* MakeTmpFilename (const char *Directory, const char *Origin, const char* Ex
|
|||||||
{
|
{
|
||||||
char* Out;
|
char* Out;
|
||||||
size_t Len = 0;
|
size_t Len = 0;
|
||||||
|
static unsigned int Counter = 0;
|
||||||
|
|
||||||
/* Allocate template */
|
/* Allocate enough for the directory, ... */
|
||||||
if (Directory != NULL) {
|
if (Directory != NULL) {
|
||||||
Len = strlen (Directory);
|
Len = strlen (Directory);
|
||||||
}
|
}
|
||||||
Len += strlen (Origin) + strlen (".2147483648") + strlen (Ext) + 1;
|
|
||||||
|
/* ... plus the the original name, the maximum length of the PID, the
|
||||||
|
* maximum length of the counter, the extension, and the terminator.
|
||||||
|
*/
|
||||||
|
Len += strlen (Origin) + (strlen (".2147483648") * 2) + strlen (Ext) + 1;
|
||||||
Out = xmalloc (Len);
|
Out = xmalloc (Len);
|
||||||
|
|
||||||
snprintf (Out, Len, "%s%s.%u%s", (Directory != NULL ? Directory : ""),
|
snprintf (Out, Len, "%s%s.%u%u%s", (Directory != NULL ? Directory : ""),
|
||||||
FindName(Origin), getpid(), Ext);
|
FindName(Origin), getpid(), Counter, Ext);
|
||||||
|
Counter++;
|
||||||
|
|
||||||
return Out;
|
return Out;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,25 @@ static const unsigned char CTPET[256] = {
|
|||||||
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
|
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Translation table KOI8-R -> Agat-9 */
|
||||||
|
static unsigned char CTAgat[256] = {
|
||||||
|
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
|
||||||
|
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
|
||||||
|
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
|
||||||
|
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
|
||||||
|
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
|
||||||
|
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
|
||||||
|
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
|
||||||
|
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0xA0,
|
||||||
|
0x1B,0x5C,0x10,0x12,0x1D,0x1F,0x13,0x1C,0x11,0x1E,0x14,0xA0,0x02,0x5F,0xA0,0xA0,
|
||||||
|
0xA0,0xA0,0xA0,0xA0,0xA0,0x9E,0x04,0xA0,0x3C,0x3E,0xA0,0xA0,0x30,0x32,0xA0,0x2F,
|
||||||
|
0xA0,0xA0,0xA0,0x0F,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,
|
||||||
|
0xA0,0xA0,0xA0,0x9F,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,
|
||||||
|
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
|
||||||
|
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
|
||||||
|
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
|
||||||
|
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
|
||||||
|
};
|
||||||
|
|
||||||
/* One entry in the target map */
|
/* One entry in the target map */
|
||||||
typedef struct TargetEntry TargetEntry;
|
typedef struct TargetEntry TargetEntry;
|
||||||
@@ -143,6 +161,8 @@ struct TargetEntry {
|
|||||||
** CAUTION: must be alphabetically for bsearch().
|
** CAUTION: must be alphabetically for bsearch().
|
||||||
*/
|
*/
|
||||||
static const TargetEntry TargetMap[] = {
|
static const TargetEntry TargetMap[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
|
{ "agat", TGT_AGAT },
|
||||||
{ "apple2", TGT_APPLE2 },
|
{ "apple2", TGT_APPLE2 },
|
||||||
{ "apple2enh", TGT_APPLE2ENH },
|
{ "apple2enh", TGT_APPLE2ENH },
|
||||||
{ "atari", TGT_ATARI },
|
{ "atari", TGT_ATARI },
|
||||||
@@ -181,6 +201,7 @@ static const TargetEntry TargetMap[] = {
|
|||||||
{ "sym1", TGT_SYM1 },
|
{ "sym1", TGT_SYM1 },
|
||||||
{ "telestrat", TGT_TELESTRAT },
|
{ "telestrat", TGT_TELESTRAT },
|
||||||
{ "vic20", TGT_VIC20 },
|
{ "vic20", TGT_VIC20 },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
#define MAP_ENTRY_COUNT (sizeof (TargetMap) / sizeof (TargetMap[0]))
|
#define MAP_ENTRY_COUNT (sizeof (TargetMap) / sizeof (TargetMap[0]))
|
||||||
|
|
||||||
@@ -224,6 +245,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
|
|||||||
{ "sym1", CPU_6502, BINFMT_BINARY, CTNone },
|
{ "sym1", CPU_6502, BINFMT_BINARY, CTNone },
|
||||||
{ "kim1", CPU_6502, BINFMT_BINARY, CTNone },
|
{ "kim1", CPU_6502, BINFMT_BINARY, CTNone },
|
||||||
{ "rp6502", CPU_65C02, BINFMT_BINARY, CTNone },
|
{ "rp6502", CPU_65C02, BINFMT_BINARY, CTNone },
|
||||||
|
{ "agat", CPU_6502, BINFMT_BINARY, CTAgat },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Target system */
|
/* Target system */
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ typedef enum {
|
|||||||
TGT_SYM1,
|
TGT_SYM1,
|
||||||
TGT_KIM1,
|
TGT_KIM1,
|
||||||
TGT_RP6502,
|
TGT_RP6502,
|
||||||
|
TGT_AGAT,
|
||||||
TGT_COUNT /* Number of target systems */
|
TGT_COUNT /* Number of target systems */
|
||||||
} target_t;
|
} target_t;
|
||||||
|
|
||||||
|
|||||||
@@ -2531,6 +2531,7 @@ static void NextToken (InputData* D)
|
|||||||
const char Keyword[12];
|
const char Keyword[12];
|
||||||
Token Tok;
|
Token Tok;
|
||||||
} KeywordTable[] = {
|
} KeywordTable[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "abs", TOK_ABSOLUTE },
|
{ "abs", TOK_ABSOLUTE },
|
||||||
{ "addrsize", TOK_ADDRSIZE },
|
{ "addrsize", TOK_ADDRSIZE },
|
||||||
{ "auto", TOK_AUTO },
|
{ "auto", TOK_AUTO },
|
||||||
@@ -2579,6 +2580,7 @@ static void NextToken (InputData* D)
|
|||||||
{ "var", TOK_VAR },
|
{ "var", TOK_VAR },
|
||||||
{ "version", TOK_VERSION },
|
{ "version", TOK_VERSION },
|
||||||
{ "zp", TOK_ZEROPAGE },
|
{ "zp", TOK_ZEROPAGE },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,12 +64,14 @@ struct ConverterMapEntry {
|
|||||||
/* Converter table */
|
/* Converter table */
|
||||||
/* CAUTION: table must be alphabetically sorted for bsearch */
|
/* CAUTION: table must be alphabetically sorted for bsearch */
|
||||||
static const ConverterMapEntry ConverterMap[] = {
|
static const ConverterMapEntry ConverterMap[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "geos-bitmap", GenGeosBitmap },
|
{ "geos-bitmap", GenGeosBitmap },
|
||||||
{ "geos-icon", GenGeosIcon },
|
{ "geos-icon", GenGeosIcon },
|
||||||
{ "koala", GenKoala },
|
{ "koala", GenKoala },
|
||||||
{ "lynx-sprite", GenLynxSprite },
|
{ "lynx-sprite", GenLynxSprite },
|
||||||
{ "raw", GenRaw },
|
{ "raw", GenRaw },
|
||||||
{ "vic2-sprite", GenVic2Sprite },
|
{ "vic2-sprite", GenVic2Sprite },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,10 @@ static InputFormatDesc InputFormatTable[ifCount] = {
|
|||||||
/* CAUTION: table must be alphabetically sorted for bsearch */
|
/* CAUTION: table must be alphabetically sorted for bsearch */
|
||||||
static const FileId FormatTable[] = {
|
static const FileId FormatTable[] = {
|
||||||
/* Upper case stuff for obsolete operating systems */
|
/* Upper case stuff for obsolete operating systems */
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "PCX", ifPCX },
|
{ "PCX", ifPCX },
|
||||||
|
|
||||||
{ "pcx", ifPCX },
|
{ "pcx", ifPCX },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,19 +82,20 @@ static OutputFormatDesc OutputFormatTable[ofCount] = {
|
|||||||
/* CAUTION: table must be alphabetically sorted for bsearch */
|
/* CAUTION: table must be alphabetically sorted for bsearch */
|
||||||
static const FileId FormatTable[] = {
|
static const FileId FormatTable[] = {
|
||||||
/* Upper case stuff for obsolete operating systems */
|
/* Upper case stuff for obsolete operating systems */
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "A", ofAsm },
|
{ "A", ofAsm },
|
||||||
{ "ASM", ofAsm },
|
{ "ASM", ofAsm },
|
||||||
{ "BIN", ofBin },
|
{ "BIN", ofBin },
|
||||||
{ "C", ofC },
|
{ "C", ofC },
|
||||||
{ "INC", ofAsm },
|
{ "INC", ofAsm },
|
||||||
{ "S", ofAsm },
|
{ "S", ofAsm },
|
||||||
|
|
||||||
{ "a", ofAsm },
|
{ "a", ofAsm },
|
||||||
{ "asm", ofAsm },
|
{ "asm", ofAsm },
|
||||||
{ "bin", ofBin },
|
{ "bin", ofBin },
|
||||||
{ "c", ofC },
|
{ "c", ofC },
|
||||||
{ "inc", ofAsm },
|
{ "inc", ofAsm },
|
||||||
{ "s", ofAsm },
|
{ "s", ofAsm },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ struct PaletteMapEntry {
|
|||||||
/* Converter table */
|
/* Converter table */
|
||||||
/* CAUTION: table must be alphabetically sorted for bsearch */
|
/* CAUTION: table must be alphabetically sorted for bsearch */
|
||||||
static const PaletteMapEntry PaletteMap[] = {
|
static const PaletteMapEntry PaletteMap[] = {
|
||||||
|
/* BEGIN SORTED.SH */
|
||||||
{ "lynx-palette", GenLynxPalette },
|
{ "lynx-palette", GenLynxPalette },
|
||||||
|
/* END SORTED.SH */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user