Add CARTSIZE to cfg file for configuring the a78 header. Add descriptions of usage.

This commit is contained in:
Karri Kaksonen 2022-03-07 08:48:59 +02:00
parent cc9535e82f
commit eb86bc33b9
3 changed files with 33 additions and 12 deletions

View File

@ -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;

View File

@ -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

View File

@ -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