From 328781bf8a33991b23c82c5334b779fda0f28b15 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen Date: Tue, 1 Mar 2022 06:44:26 +0200 Subject: [PATCH 01/12] Add target atari7800 --- asminc/atari7800.inc | 8 +++ asminc/atari7800_maria.inc | 39 ++++++++++++ asminc/atari7800_riot.inc | 20 ++++++ asminc/atari7800_tia.inc | 69 +++++++++++++++++++++ cfg/atari7800.cfg | 50 +++++++++++++++ doc/atari7800.sgml | 122 +++++++++++++++++++++++++++++++++++++ include/_maria.h | 63 +++++++++++++++++++ include/atari7800.h | 105 +++++++++++++++++++++++++++++++ 8 files changed, 476 insertions(+) create mode 100644 asminc/atari7800.inc create mode 100644 asminc/atari7800_maria.inc create mode 100644 asminc/atari7800_riot.inc create mode 100644 asminc/atari7800_tia.inc create mode 100644 cfg/atari7800.cfg create mode 100644 doc/atari7800.sgml create mode 100644 include/_maria.h create mode 100644 include/atari7800.h diff --git a/asminc/atari7800.inc b/asminc/atari7800.inc new file mode 100644 index 000000000..a7625aa8a --- /dev/null +++ b/asminc/atari7800.inc @@ -0,0 +1,8 @@ +; 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" diff --git a/asminc/atari7800_maria.inc b/asminc/atari7800_maria.inc new file mode 100644 index 000000000..a8857812d --- /dev/null +++ b/asminc/atari7800_maria.inc @@ -0,0 +1,39 @@ +; Atari 7800 MARIA read / write registers +; + +; Read registers +BKGRND := $00 +P0C1 := $01 +P0C2 := $02 +P0C3 := $03 +MWSYNC := $04 +P1C1 := $05 +P1C2 := $06 +P1C3 := $07 +MSTAT := $08 +P2C1 := $09 +P2C2 := $0A +P2C3 := $0B +DPPH := $0C +P3C1 := $0D +P3C2 := $0E +P3C3 := $0F +DPPL := $10 +P4C1 := $11 +P4C2 := $12 +P4C3 := $13 +CHBASE := $14 +P5C1 := $15 +P5C2 := $16 +P5C3 := $17 +OFFSET := $18 +P6C1 := $19 +P6C2 := $1A +P6C3 := $1B +CTRL := $1C +P7C1 := $1D +P7C2 := $1E +P7C3 := $1F + +; Write registers + diff --git a/asminc/atari7800_riot.inc b/asminc/atari7800_riot.inc new file mode 100644 index 000000000..780e34df3 --- /dev/null +++ b/asminc/atari7800_riot.inc @@ -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 diff --git a/asminc/atari7800_tia.inc b/asminc/atari7800_tia.inc new file mode 100644 index 000000000..f4439e421 --- /dev/null +++ b/asminc/atari7800_tia.inc @@ -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 diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg new file mode 100644 index 000000000..a2aa7b36c --- /dev/null +++ b/cfg/atari7800.cfg @@ -0,0 +1,50 @@ +# Atari VCS 7800 linker configuration file for cc65 + +SYMBOLS { + __STACKSIZE__: type = weak, value = $0010; # 16 bytes stack +} + +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; + # "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 = $8000, size = $7f7a, type = ro, fill = yes, fillval = $ff; + # Encryption stuff + ROME: file = %O, start = $ff7a, size = $80, type = ro, fill = yes, fillval = $ff; + # Interrupt vectors + ROMV: file = %O, start = $fffa, size = $6, type = ro, fill = yes, fillval = $ff; +} + +SEGMENTS { + ZEROPAGE: load = ZP, type = zp; + STARTUP: load = ROM, 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 = ROM, 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__; +} diff --git a/doc/atari7800.sgml b/doc/atari7800.sgml new file mode 100644 index 000000000..95868bbd9 --- /dev/null +++ b/doc/atari7800.sgml @@ -0,0 +1,122 @@ + + +
+Atari 7800 specific information for cc65 +<author> +<url url="mailto:contact@florentflament.com" name="Florent Flament"><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 4K cartridge image. + +<sect>Memory layout<p> + +cc65 generated programs with the default setup can use RAM from +$0080 to $00FF - __STACKSIZE__, where __STACKSIZE__ is +the size of the system stack with a default value of 16 bytes. The +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 $00FF - + __STACKSIZE__ and growing downwards. + + <tag/Heap/ The C heap is located at $0080 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 & 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. + +</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> diff --git a/include/_maria.h b/include/_maria.h new file mode 100644 index 000000000..461119fda --- /dev/null +++ b/include/_maria.h @@ -0,0 +1,63 @@ +/*****************************************************************************/ +/* */ +/* _maria.h */ +/* */ +/* Atari 7800, Maria chip register hardware structures */ +/* */ +/* */ +/* This software is provided 'as-is', without any expressed or implied */ +/* warranty. In no event will the authors be held liable for any damages */ +/* arising from the use of this software. */ +/* */ +/* Permission is granted to anyone to use this software for any purpose, */ +/* including commercial applications, and to alter it and redistribute it */ +/* freely, subject to the following restrictions: */ +/* */ +/* 1. The origin of this software must not be misrepresented; you must not */ +/* claim that you wrote the original software. If you use this software */ +/* in a product, an acknowledgment in the product documentation would be */ +/* appreciated but is not required. */ +/* 2. Altered source versions must be plainly marked as such, and must not */ +/* be misrepresented as being the original software. */ +/* 3. This notice may not be removed or altered from any source */ +/* distribution. */ +/* */ +/*****************************************************************************/ + +/* + * MARIA registers + */ +struct __maria { + unsigned char bkgrnd; + unsigned char p0c1; + unsigned char p0c2; + unsigned char p0c3; + unsigned char wsync; + unsigned char p1c1; + unsigned char p1c2; + unsigned char p1c3; + unsigned char mstat; + unsigned char p2c1; + unsigned char p2c2; + unsigned char p2c3; + unsigned char dpph; + unsigned char p3c1; + unsigned char p3c2; + unsigned char p3c3; + unsigned char dppl; + unsigned char p4c1; + unsigned char p4c2; + unsigned char p4c3; + unsigned char chbase; + unsigned char p5c1; + unsigned char p5c2; + unsigned char p5c3; + unsigned char offset; + unsigned char p6c1; + unsigned char p6c2; + unsigned char p6c3; + unsigned char ctrl; + unsigned char p7c1; + unsigned char p7c2; + unsigned char p7c3; +}; diff --git a/include/atari7800.h b/include/atari7800.h new file mode 100644 index 000000000..378f8786a --- /dev/null +++ b/include/atari7800.h @@ -0,0 +1,105 @@ +/*****************************************************************************/ +/* */ +/* Atari VCS 7800 TIA & RIOT registers addresses */ +/* */ +/* Karri Kaksonen (karri@sipo.fi), 2022 */ +/* */ +/* */ +/*****************************************************************************/ + + + +#ifndef _ATARI7800_H +#define _ATARI7800_H + +/* Check for errors */ +#if !defined(__ATARI7800__) +# error This module may only be used when compiling for the Atari 7800! +#endif + +/*****************************************************************************/ +/* Data */ +/*****************************************************************************/ + + + +/* Color defines */ +#define COLOR_BLACK 0x00 +#define COLOR_WHITE 0x0F + +/* TGI color defines (default palette) */ +#define TGI_COLOR_BLACK COLOR_BLACK +#define TGI_COLOR_WHITE COLOR_WHITE + +/* Masks for joy_read */ +#define JOY_RIGHT_MASK 0x80 +#define JOY_LEFT_MASK 0x40 +#define JOY_DOWN_MASK 0x20 +#define JOY_UP_MASK 0x10 +#define JOY_BTN_1_MASK 0x01 +#define JOY_BTN_2_MASK 0x02 + +#define JOY_BTN_A_MASK JOY_BTN_1_MASK +#define JOY_BTN_B_MASK JOY_BTN_2_MASK + +#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK) +#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK) + +/* No support for dynamically loadable drivers */ +#define DYN_DRV 0 + +#include <_tia.h> +#define TIA (*(struct __tia*)0x0000) + +#include <_riot.h> +#define RIOT (*(struct __riot*)0x0280) + +#include <_maria.h> +#define MARIA (*(struct __maria*)0x0020) + +/* + * Alternative MARIA register definitions. + */ +#define BKGRND MARIA.bkgrnd +#define BACKGRND MARIA.bkgrnd +#define P0C1 MARIA.p0c1 +#define P0C2 MARIA.p0c2 +#define P0C3 MARIA.p0c3 +#define WSYNC MARIA.wsync +#define P1C1 MARIA.p1c1 +#define P1C2 MARIA.p1c2 +#define P1C3 MARIA.p1c3 +#define MSTAT MARIA.mstat +#define P2C1 MARIA.p2c1 +#define P2C2 MARIA.p2c2 +#define P2C3 MARIA.p2c3 +#define DPPH MARIA.dpph +#define DPH MARIA.dpph +#define P3C1 MARIA.p3c1 +#define P3C2 MARIA.p3c2 +#define P3C3 MARIA.p3c3 +#define DPPL MARIA.dppl +#define DPL MARIA.dppl +#define P4C1 MARIA.p4c1 +#define P4C2 MARIA.p4c2 +#define P4C3 MARIA.p4c3 +#define CHBASE MARIA.chbase +#define P5C1 MARIA.p5c1 +#define P5C2 MARIA.p5c2 +#define P5C3 MARIA.p5c3 +#define OFFSET MARIA.offset +#define P6C1 MARIA.p6c1 +#define P6C2 MARIA.p6c2 +#define P6C3 MARIA.p6c3 +#define CTRL MARIA.ctrl +#define P7C1 MARIA.p7c1 +#define P7C2 MARIA.p7c2 +#define P7C3 MARIA.p7c3 + +/* + * MSTAT register constants + */ +#define MSTAT_VBLANK 0x80 /* vblank is on when bit 7 is set */ + +/* End of atari7800.h */ +#endif From 3266e70de4431a8994d922d119009b56a0b73690 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 06:44:55 +0200 Subject: [PATCH 02/12] Add target atari7800 --- README.md | 1 + doc/ca65.sgml | 1 + doc/index.sgml | 3 +++ doc/ld65.sgml | 1 + include/target.h | 2 ++ libsrc/Makefile | 1 + src/ca65/main.c | 4 ++++ src/cc65/main.c | 4 ++++ src/common/target.c | 2 ++ src/common/target.h | 1 + targettest/Makefile | 4 ++++ 11 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 93b91aa80..009fca78b 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ including - the Atari 8-bit machines. - the Atari 2600 console. - the Atari 5200 console. +- the Atari 7800 console. - GEOS for the C64, C128 and Apple //e. - the Bit Corporation Gamate console. - the NEC PC-Engine (aka TurboGrafx-16) console. diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 8797f2c60..c0ebe3688 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -4763,6 +4763,7 @@ compiler, depending on the target system selected: <item><tt/__APPLE2ENH__/ - Target system is <tt/apple2enh/ <item><tt/__ATARI2600__/ - Target system is <tt/atari2600/ <item><tt/__ATARI5200__/ - Target system is <tt/atari5200/ +<item><tt/__ATARI7800__/ - Target system is <tt/atari7800/ <item><tt/__ATARI__/ - Target system is <tt/atari/ or <tt/atarixl/ <item><tt/__ATARIXL__/ - Target system is <tt/atarixl/ <item><tt/__ATMOS__/ - Target system is <tt/atmos/ diff --git a/doc/index.sgml b/doc/index.sgml index 3bb085bf6..bb3ad5357 100644 --- a/doc/index.sgml +++ b/doc/index.sgml @@ -124,6 +124,9 @@ <tag><htmlurl url="atari5200.html" name="atari5200.html"></tag> Topics specific to the Atari 5200 Game Console. + <tag><htmlurl url="atari7800.html" name="atari7800.html"></tag> + Topics specific to the Atari 7800 Game Console. + <tag><htmlurl url="atmos.html" name="atmos.html"></tag> Topics specific to the Oric Atmos. diff --git a/doc/ld65.sgml b/doc/ld65.sgml index 87c2cae51..307caeaa4 100644 --- a/doc/ld65.sgml +++ b/doc/ld65.sgml @@ -166,6 +166,7 @@ Here is a description of all of the command-line options: <item>apple2 <item>apple2enh <item>atari2600 + <item>atari7800 <item>atari <item>atarixl <item>atmos diff --git a/include/target.h b/include/target.h index af401ec35..7663a39dd 100644 --- a/include/target.h +++ b/include/target.h @@ -43,6 +43,8 @@ # include <atari2600.h> #elif defined(__ATARI5200__) # include <atari5200.h> +#elif defined(__ATARI7800__) +# include <atari7800.h> #elif defined(__ATMOS__) # include <atmos.h> #elif defined(__CBM__) diff --git a/libsrc/Makefile b/libsrc/Makefile index 60946b59f..177314bdf 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -21,6 +21,7 @@ TARGETS = apple2 \ atarixl \ atari2600 \ atari5200 \ + atari7800 \ atmos \ creativision \ $(CBMS) \ diff --git a/src/ca65/main.c b/src/ca65/main.c index 0eaf4ba6b..b1ef3a3db 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -212,6 +212,10 @@ static void SetSys (const char* Sys) NewSymbol ("__ATARI5200__", 1); break; + case TGT_ATARI7800: + NewSymbol ("__ATARI7800__", 1); + break; + case TGT_ATARI: NewSymbol ("__ATARI__", 1); break; diff --git a/src/cc65/main.c b/src/cc65/main.c index 0ed5af986..4a5729063 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -172,6 +172,10 @@ static void SetSys (const char* Sys) DefineNumericMacro ("__ATARI5200__", 1); break; + case TGT_ATARI7800: + DefineNumericMacro ("__ATARI7800__", 1); + break; + case TGT_ATARI: DefineNumericMacro ("__ATARI__", 1); break; diff --git a/src/common/target.c b/src/common/target.c index a35bf67a8..4a851034a 100644 --- a/src/common/target.c +++ b/src/common/target.c @@ -147,6 +147,7 @@ static const TargetEntry TargetMap[] = { { "atari", TGT_ATARI }, { "atari2600", TGT_ATARI2600 }, { "atari5200", TGT_ATARI5200 }, + { "atari7800", TGT_ATARI7800 }, { "atarixl", TGT_ATARIXL }, { "atmos", TGT_ATMOS }, { "bbc", TGT_BBC }, @@ -188,6 +189,7 @@ static const TargetProperties PropertyTable[TGT_COUNT] = { { "atari", CPU_6502, BINFMT_BINARY, CTAtari }, { "atari2600", CPU_6502, BINFMT_BINARY, CTNone }, { "atari5200", CPU_6502, BINFMT_BINARY, CTAtari }, + { "atari7800", CPU_6502, BINFMT_BINARY, CTNone }, { "atarixl", CPU_6502, BINFMT_BINARY, CTAtari }, { "vic20", CPU_6502, BINFMT_BINARY, CTPET }, { "c16", CPU_6502, BINFMT_BINARY, CTPET }, diff --git a/src/common/target.h b/src/common/target.h index 7f85713cf..7087048e2 100644 --- a/src/common/target.h +++ b/src/common/target.h @@ -57,6 +57,7 @@ typedef enum { TGT_ATARI, TGT_ATARI2600, TGT_ATARI5200, + TGT_ATARI7800, TGT_ATARIXL, TGT_VIC20, TGT_C16, diff --git a/targettest/Makefile b/targettest/Makefile index 806f6b445..0450bfd4e 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -673,6 +673,9 @@ EXELIST_atari2600 = \ EXELIST_atari5200 = \ minimal +EXELIST_atari7800 = \ + minimal + EXELIST_gamate = \ minimal @@ -728,6 +731,7 @@ TARGETS := \ atarixl \ atari2600 \ atari5200 \ + atari7800 \ atmos \ bbc \ c128 \ From 8c975dfb36c43a25443879f218ff102f0e86e354 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 07:03:29 +0200 Subject: [PATCH 03/12] Remove garbage --- include/atari7800.h | 50 +++++---------------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/include/atari7800.h b/include/atari7800.h index 378f8786a..4fdaacfcc 100644 --- a/include/atari7800.h +++ b/include/atari7800.h @@ -25,10 +25,14 @@ /* Color defines */ #define COLOR_BLACK 0x00 -#define COLOR_WHITE 0x0F +#define COLOR_GREY 0x01 +#define COLOR_LIGHTGREY 0x02 +#define COLOR_WHITE 0x03 /* TGI color defines (default palette) */ #define TGI_COLOR_BLACK COLOR_BLACK +#define TGI_COLOR_GREY COLOR_GREY +#define TGI_COLOR_LIGHTGREY COLOR_LIGHTGREY #define TGI_COLOR_WHITE COLOR_WHITE /* Masks for joy_read */ @@ -57,49 +61,5 @@ #include <_maria.h> #define MARIA (*(struct __maria*)0x0020) -/* - * Alternative MARIA register definitions. - */ -#define BKGRND MARIA.bkgrnd -#define BACKGRND MARIA.bkgrnd -#define P0C1 MARIA.p0c1 -#define P0C2 MARIA.p0c2 -#define P0C3 MARIA.p0c3 -#define WSYNC MARIA.wsync -#define P1C1 MARIA.p1c1 -#define P1C2 MARIA.p1c2 -#define P1C3 MARIA.p1c3 -#define MSTAT MARIA.mstat -#define P2C1 MARIA.p2c1 -#define P2C2 MARIA.p2c2 -#define P2C3 MARIA.p2c3 -#define DPPH MARIA.dpph -#define DPH MARIA.dpph -#define P3C1 MARIA.p3c1 -#define P3C2 MARIA.p3c2 -#define P3C3 MARIA.p3c3 -#define DPPL MARIA.dppl -#define DPL MARIA.dppl -#define P4C1 MARIA.p4c1 -#define P4C2 MARIA.p4c2 -#define P4C3 MARIA.p4c3 -#define CHBASE MARIA.chbase -#define P5C1 MARIA.p5c1 -#define P5C2 MARIA.p5c2 -#define P5C3 MARIA.p5c3 -#define OFFSET MARIA.offset -#define P6C1 MARIA.p6c1 -#define P6C2 MARIA.p6c2 -#define P6C3 MARIA.p6c3 -#define CTRL MARIA.ctrl -#define P7C1 MARIA.p7c1 -#define P7C2 MARIA.p7c2 -#define P7C3 MARIA.p7c3 - -/* - * MSTAT register constants - */ -#define MSTAT_VBLANK 0x80 /* vblank is on when bit 7 is set */ - /* End of atari7800.h */ #endif From d059682692cbb8c281334a1d94f7f5055b3b8264 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 07:37:07 +0200 Subject: [PATCH 04/12] Add crt0.s and ctype.s --- libsrc/atari7800/crt0.s | 71 ++++++++++++++++++++++++++++++++++++++++ libsrc/atari7800/ctype.s | 5 +++ 2 files changed, 76 insertions(+) create mode 100644 libsrc/atari7800/crt0.s create mode 100644 libsrc/atari7800/ctype.s diff --git a/libsrc/atari7800/crt0.s b/libsrc/atari7800/crt0.s new file mode 100644 index 000000000..3d53abfa8 --- /dev/null +++ b/libsrc/atari7800/crt0.s @@ -0,0 +1,71 @@ + .export _zonecounter + .export __STARTUP__ : absolute = 1 + .export _exit + .import __ROM_START__ + .import __RAM3_START__, __RAM3_SIZE__ + .import initlib, donelib + .import zerobss, copydata + .import push0, _main + .include "zeropage.inc" + +INPTCTRL = $01 +OFFSET = $38 +CTRL = $3c + + .segment "STARTUP" +start: + ; Startup sequence recommended by Atari. + ; See the 7800 standards document. + sei ; Initialize 6502 + cld + lda #$07 ; Lock machine in 7800 mode + sta INPTCTRL + lda #$7f ; DMA off + sta CTRL + ldx #0 ; OFFSET must always be 0 + stx OFFSET + stx INPTCTRL ; Make sure joysticks don't freeze + dex ; Stack pointer = $ff + txs + + ; Set up parameter stack + lda #<(__RAM3_START__ + __RAM3_SIZE__) + sta sp + lda #>(__RAM3_START__ + __RAM3_SIZE__) + sta sp+1 + + jsr copydata + jsr zerobss + jsr initlib + + ; Call main program (pass empty command line) + jsr push0 ; argc + jsr push0 ; argv + ldy #4 ; Argument size + jsr _main + +_exit: + jsr donelib + jmp start + +NMIHandler: + inc _zonecounter + rti + +IRQHandler: + rti + + .segment "DATA" +_zonecounter: + .byte 0 + + .segment "ENCRYPTION" + .res 126, $ff ; Reserved for encryption +Lfff8: .byte $ff ; Region verification (always $ff) +Lfff9: .byte $f7 ; Use last 4096 bytes only for encryption +;;;Lfff9: .byte <(((__ROM_START__/4096)<<4) | 7) + + .segment "VECTORS" + .word NMIHandler + .word start + .word IRQHandler diff --git a/libsrc/atari7800/ctype.s b/libsrc/atari7800/ctype.s new file mode 100644 index 000000000..1301965eb --- /dev/null +++ b/libsrc/atari7800/ctype.s @@ -0,0 +1,5 @@ +; Character specification table. +; +; uses the "common" definition + + .include "ctype_common.inc" From c293b299d8dcfb13589f6ea9a8a457019130dca8 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 07:44:47 +0200 Subject: [PATCH 05/12] Add segment ONCE --- cfg/atari7800.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index a2aa7b36c..cf663be3d 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -25,6 +25,7 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp; STARTUP: load = ROM, type = ro, define = yes; + ONCE: load = ROM, 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; From b861f6df8f62907fa86ca978372c10f142271670 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 09:28:06 +0200 Subject: [PATCH 06/12] Add exehdr --- libsrc/atari7800/exehdr.s | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 libsrc/atari7800/exehdr.s diff --git a/libsrc/atari7800/exehdr.s b/libsrc/atari7800/exehdr.s new file mode 100644 index 000000000..15ce7ea29 --- /dev/null +++ b/libsrc/atari7800/exehdr.s @@ -0,0 +1,39 @@ +; ------------------------------------------------------------------------ +; EXE header + .segment "EXEHDR" + .byte 3 ; version + .byte 'A','T','A','R','I','7','8','0','0',' ',' ',' ',' ',' ',' ',' ' + .byte 'G','a','m','e',' ','n','a','m','e',0,0,0,0,0,0,0 + .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + .byte 0,0,$80,0 ; Size + ; bit 0 - pokey at 4000 + ; bit 1 - supergame bank switched + ; bit 2 - supergame ram at $4000 + ; bit 3 - rom at $4000 + ; bit 4 - bank 6 at $4000 + ; bit 5 - supergame banked ram + ; bit 6 - pokey at $450 + ; bit 7 - mirror ram at $4000 + ; bit 8 - activision banking + ; bit 9 - absolute banking + ; bit 10 - pokey at $440 + ; bit 11 - ym2151 at $461/462 + ; bit 12 - souper + ; bit 13-15 - Special + ; 0 = Normal cart + .byte 0,0 ; 0 = Normal cart + .byte 1 ; 1 = Joystick, 2 = lightgun + .byte 0 ; No joystick 2 + .byte 0 ; bit0 = 0:NTSC,1:PAL bit1 = 0:component,1:composite + .byte 0 ; Save data peripheral - 1 byte (version 2) + ; 0 = None / unknown (default) + ; 1 = High Score Cart (HSC) + ; 2 = SaveKey + + .byte 0 ; 63 Expansion module + ; 0 = No expansion module (default on all currently released games) + ; 1 = Expansion module required + .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + .byte 0,0,0,0,0,0,0,0 + .byte 'A','C','T','U','A','L',' ','C','A','R','T',' ','D','A','T','A',' ','S','T','A','R','T','S',' ','H','E','R','E' From d679faaf2221cdc2336c0b207a736e878b3a3445 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Tue, 1 Mar 2022 09:28:15 +0200 Subject: [PATCH 07/12] Add exehdr --- cfg/atari7800.cfg | 26 ++++++++++++++++++++------ libsrc/atari7800/exehdr.s | 7 +++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index cf663be3d..8029ca674 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -2,6 +2,16 @@ SYMBOLS { __STACKSIZE__: type = weak, value = $0010; # 16 bytes stack + __EXEHDR__: type = import; + __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 = 69, type = export; + __MEMORY_INIT__: value = __MEMORY_TOP__ - __INIT_SIZE__, type = export; + __MEMORY_BOTTOM__: value = $8000, type = export; + __FREE_ROM_SIZE__: value = __MEMORY_INIT__ - __MEMORY_BOTTOM__, type = export; } MEMORY { @@ -10,27 +20,31 @@ MEMORY { 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 = $8000, size = $7f7a, type = ro, fill = yes, fillval = $ff; + 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 = $ff7a, size = $80, type = ro, fill = yes, fillval = $ff; + ROME: file = %O, start = __ENCRYPT_BOTTOM__, size = __ENCRYPT_SIZE__, type = ro, fill = yes, fillval = $ff; # Interrupt vectors - ROMV: file = %O, start = $fffa, size = $6, type = ro, fill = yes, fillval = $ff; + ROMV: file = %O, start = __VEC_BOTTOM__, size = __VEC_SIZE__, type = ro, fill = yes, fillval = $ff; } SEGMENTS { ZEROPAGE: load = ZP, type = zp; - STARTUP: load = ROM, type = ro, define = yes; - ONCE: load = ROM, type = ro, define = yes; + EXEHDR: load = HEADER, type = ro, define = 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 = ROM, type = ro, define = yes; + VECTORS: load = ROMV, type = ro, define = yes; ENCRYPTION: load = ROME, type = ro define = yes; } diff --git a/libsrc/atari7800/exehdr.s b/libsrc/atari7800/exehdr.s index 15ce7ea29..6f3023040 100644 --- a/libsrc/atari7800/exehdr.s +++ b/libsrc/atari7800/exehdr.s @@ -1,3 +1,10 @@ +; +; Karri Kaksonen, 2022 +; +; This header contains data for emulators +; + .export __EXEHDR__: absolute = 1 + ; ------------------------------------------------------------------------ ; EXE header .segment "EXEHDR" From cc9535e82f379ff5b5001072142d28737e7541aa Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Fri, 4 Mar 2022 20:21:20 +0200 Subject: [PATCH 08/12] Update docs --- doc/atari7800.sgml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/atari7800.sgml b/doc/atari7800.sgml index 95868bbd9..85f6e4f9f 100644 --- a/doc/atari7800.sgml +++ b/doc/atari7800.sgml @@ -3,7 +3,7 @@ <article> <title>Atari 7800 specific information for cc65 <author> -<url url="mailto:contact@florentflament.com" name="Florent Flament"><newline> +<url url="mailto:karri@sipo.fi" name="Karri Kaksonen"><newline> <abstract> An overview over the Atari 7800 runtime system as it is implemented @@ -24,23 +24,31 @@ comes with the cc65 C compiler. It describes the memory layout, Atari <sect>Binary format<p> The default binary output format generated by the linker for the Atari -7800 target is a 4K cartridge image. +7800 target is a 32K cartridge image. <sect>Memory layout<p> cc65 generated programs with the default setup can use RAM from -$0080 to $00FF - __STACKSIZE__, where __STACKSIZE__ is -the size of the system stack with a default value of 16 bytes. The +from $1800 to $203f. +The 4k RAM is then mapped to zero page area. +$2040 to $20ff is visible as zero page. +After that we have a vero small RAM area that is unused. +$2100 to $213f. +Then we mirror a second block from the RAM to become the hardware stack. +This would be from $2140 to $21ff. + +The C-stack starts at $2800 and it can grow down to $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 $00FF - + <tag/Stack/ The C runtime stack is located at $2800 - __STACKSIZE__ and growing downwards. - <tag/Heap/ The C heap is located at $0080 and grows upwards. + <tag/Heap/ The C heap is located at $2200 and grows upwards. </descrip><p> @@ -61,7 +69,7 @@ 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 & RIOT chips registers. +file allow access to the Atari 7800 TIA, MARIA & RIOT chips registers. <descrip> @@ -78,6 +86,11 @@ file allow access to the Atari 7800 TIA & RIOT chips registers. 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> @@ -91,6 +104,12 @@ There are no drivers for the Atari 7800. TBD +<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. + <sect>Other hints<p> One may write a custom linker configuration file to tune the memory From eb86bc33b94144c9001846c195622025edabebf0 Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Mon, 7 Mar 2022 08:48:59 +0200 Subject: [PATCH 09/12] Add CARTSIZE to cfg file for configuring the a78 header. Add descriptions of usage. --- cfg/atari7800.cfg | 11 ++++++++--- doc/atari7800.sgml | 30 +++++++++++++++++++++++------- libsrc/atari7800/exehdr.s | 4 ++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index 8029ca674..d7b166809 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -1,7 +1,12 @@ # Atari VCS 7800 linker configuration file for cc65 +# This cfg file adds the a78 header in front of the image +# If you want just the ROM you can mark the __EXEHDR__ as weak instead of import +# But for the most common use we add the a78 automatically as it +# contains info about what kind of cart the build supports SYMBOLS { - __STACKSIZE__: type = weak, value = $0010; # 16 bytes stack + __STACKSIZE__: type = weak, value = $0600; # C stack + __CARTSIZE__: type = weak, value = $c000; __EXEHDR__: type = import; __VEC_BOTTOM__: value = $fffa, type = export; __VEC_SIZE__: value = $6, type = export; @@ -21,7 +26,7 @@ MEMORY { 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; + 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: @@ -37,7 +42,7 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp; - EXEHDR: load = HEADER, type = ro, define = yes; + EXEHDR: load = HEADER, type = ro; STARTUP: load = ROMS, type = ro, define = yes; ONCE: load = ROMS, type = ro, define = yes; CODE: load = ROM, type = ro, define = yes; diff --git a/doc/atari7800.sgml b/doc/atari7800.sgml index 85f6e4f9f..b6551614c 100644 --- a/doc/atari7800.sgml +++ b/doc/atari7800.sgml @@ -24,7 +24,29 @@ comes with the cc65 C compiler. It describes the memory layout, Atari <sect>Binary format<p> The default binary output format generated by the linker for the Atari -7800 target is a 32K cartridge image. +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> @@ -104,12 +126,6 @@ There are no drivers for the Atari 7800. TBD -<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. - <sect>Other hints<p> One may write a custom linker configuration file to tune the memory diff --git a/libsrc/atari7800/exehdr.s b/libsrc/atari7800/exehdr.s index 6f3023040..618164cd4 100644 --- a/libsrc/atari7800/exehdr.s +++ b/libsrc/atari7800/exehdr.s @@ -4,7 +4,7 @@ ; This header contains data for emulators ; .export __EXEHDR__: absolute = 1 - + .import __CARTSIZE__ ; ------------------------------------------------------------------------ ; EXE header .segment "EXEHDR" @@ -12,7 +12,7 @@ .byte 'A','T','A','R','I','7','8','0','0',' ',' ',' ',' ',' ',' ',' ' .byte 'G','a','m','e',' ','n','a','m','e',0,0,0,0,0,0,0 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .byte 0,0,$80,0 ; Size + .byte 0,0,>__CARTSIZE__,0 ; Set the cart size in the cfg file ; bit 0 - pokey at 4000 ; bit 1 - supergame bank switched ; bit 2 - supergame ram at $4000 From 52d7991b9bf07997cd3b919a1829340ca7a6e62e Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Sun, 13 Mar 2022 12:32:13 +0200 Subject: [PATCH 10/12] Remove the EXEHDR from the default build --- cfg/atari7800.cfg | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index d7b166809..85abc24ee 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -1,13 +1,10 @@ # Atari VCS 7800 linker configuration file for cc65 -# This cfg file adds the a78 header in front of the image -# If you want just the ROM you can mark the __EXEHDR__ as weak instead of import -# But for the most common use we add the a78 automatically as it -# contains info about what kind of cart the build supports +# 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 = $c000; - __EXEHDR__: type = import; __VEC_BOTTOM__: value = $fffa, type = export; __VEC_SIZE__: value = $6, type = export; __ENCRYPT_BOTTOM__: value = $ff7a, type = export; @@ -42,9 +39,9 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp; - EXEHDR: load = HEADER, type = ro; - STARTUP: load = ROMS, type = ro, define = yes; - ONCE: load = ROMS, type = ro, define = yes; + 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; From 38b330482d57f5db92d74855267003ac08a114ce Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Sun, 13 Mar 2022 13:31:11 +0200 Subject: [PATCH 11/12] Make start of ROM depend on CARTSIZE --- cfg/atari7800.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index 85abc24ee..562dd3857 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -4,7 +4,7 @@ SYMBOLS { __STACKSIZE__: type = weak, value = $0600; # C stack - __CARTSIZE__: type = weak, value = $c000; + __CARTSIZE__: type = weak, value = $8000; __VEC_BOTTOM__: value = $fffa, type = export; __VEC_SIZE__: value = $6, type = export; __ENCRYPT_BOTTOM__: value = $ff7a, type = export; @@ -12,7 +12,7 @@ SYMBOLS { __MEMORY_TOP__: value = __ENCRYPT_BOTTOM__, type = export; __INIT_SIZE__: value = 69, type = export; __MEMORY_INIT__: value = __MEMORY_TOP__ - __INIT_SIZE__, type = export; - __MEMORY_BOTTOM__: value = $8000, type = export; + __MEMORY_BOTTOM__: value = $10000 - __CARTSIZE__, type = weak; __FREE_ROM_SIZE__: value = __MEMORY_INIT__ - __MEMORY_BOTTOM__, type = export; } From d12c2d68104f6ad5eca9214ebcad9af29e5abc9e Mon Sep 17 00:00:00 2001 From: Karri Kaksonen <karri@sipo.fi> Date: Sat, 19 Mar 2022 09:09:50 +0200 Subject: [PATCH 12/12] Fix offset for MARIA --- asminc/atari7800_maria.inc | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/asminc/atari7800_maria.inc b/asminc/atari7800_maria.inc index a8857812d..39624d21d 100644 --- a/asminc/atari7800_maria.inc +++ b/asminc/atari7800_maria.inc @@ -2,38 +2,38 @@ ; ; Read registers -BKGRND := $00 -P0C1 := $01 -P0C2 := $02 -P0C3 := $03 -MWSYNC := $04 -P1C1 := $05 -P1C2 := $06 -P1C3 := $07 -MSTAT := $08 -P2C1 := $09 -P2C2 := $0A -P2C3 := $0B -DPPH := $0C -P3C1 := $0D -P3C2 := $0E -P3C3 := $0F -DPPL := $10 -P4C1 := $11 -P4C2 := $12 -P4C3 := $13 -CHBASE := $14 -P5C1 := $15 -P5C2 := $16 -P5C3 := $17 -OFFSET := $18 -P6C1 := $19 -P6C2 := $1A -P6C3 := $1B -CTRL := $1C -P7C1 := $1D -P7C2 := $1E -P7C3 := $1F +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