Skip to content

Commit adafbc0

Browse files
authored
Initial support for a PET target (#109)
* Initial support for a PET target * Created user-definable symbol for RAM size to add support for 8k and 16k PETs * Added variables to the commodore linker file to be defined in the concrete targets specifying the start and end of the free zero page * Pushed zero page flag in clang.cfg down from commodore into concrete targets as all targets no longer share the same amount of free zero page * Added mention of PET support to README
1 parent 857294f commit adafbc0

File tree

15 files changed

+105
-4
lines changed

15 files changed

+105
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The LLVM-MOS compiler toolchain and platform libraries.
1111
- 8-KiB or 16-KiB standard cartridge
1212
- Commander X16
1313
- Commodore 64
14+
- Commodore PET
1415
- MEGA65
1516
- NES
1617
- NES-NROM
@@ -119,6 +120,7 @@ executables and libraries for that target.
119120
| Atari 8-bit Standard cartridge | `mos-atari8-stdcart` |
120121
| Commander X16 | `mos-cx16-clang` |
121122
| Commodore 64 | `mos-c64-clang` |
123+
| Commodore PET | `mos-pet-clang` |
122124
| MEGA65 | `mos-mega65-clang` |
123125
| NES-CNROM | `mos-nes-cnrom-clang` |
124126
| NES-MMC1 | `mos-nes-mmc1-clang` |

mos-platform/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ add_subdirectory(nes-mmc1)
6060
add_subdirectory(nes-mmc3)
6161
add_subdirectory(osi-c1p)
6262
add_subdirectory(dodo)
63+
add_subdirectory(pet)

mos-platform/c64/clang.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
-mlto-zp=110
12
-D__C64__

mos-platform/c64/link.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* Produces a PRG file with a SYS command to start the program.
66
*/
77

8+
__basic_zp_start = 0x0002;
9+
__basic_zp_end = 0x0090;
10+
811
MEMORY {
912
ram (rw) : ORIGIN = 0x0801, LENGTH = 0xC7FF
1013
}

mos-platform/commodore/clang.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
-mlto-zp=110
21
-D__CBM__

mos-platform/commodore/commodore.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
/* Provide imaginary (zero page) registers in the BASIC area. */
9-
__rc0 = 0x0002;
9+
__rc0 = __basic_zp_start;
1010
INCLUDE imag-regs.ld
11-
ASSERT(__rc31 == 0x0021, "Inconsistent zero page map.")
11+
ASSERT(__rc31 == (__rc0 + 0x1F), "Inconsistent zero page map.")
1212

13-
MEMORY { zp : ORIGIN = __rc31 + 1, LENGTH = 0x90 - (__rc31 + 1) }
13+
MEMORY { zp : ORIGIN = __rc31 + 1, LENGTH = __basic_zp_end - (__rc31 + 1) }
1414

1515
INPUT(basic-header.o)
1616

mos-platform/cx16/clang.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
-mlto-zp=110
12
-D__CX16__
23
-mcpu=mos65c02

mos-platform/cx16/link.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* Produces a PRG file with a SYS command to start the program.
66
*/
77

8+
__basic_zp_start = 0x0002;
9+
__basic_zp_end = 0x0090;
10+
811
MEMORY {
912
ram (rw) : ORIGIN = 0x0801, LENGTH = 0x96ff
1013
}

mos-platform/mega65/clang.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
-mlto-zp=110
12
-D__MEGA65__
23
-mcpu=mos65ce02

mos-platform/mega65/link.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Produces a PRG file with a SYS command to start the program.
44
*/
55

6+
__basic_zp_start = 0x0002;
7+
__basic_zp_end = 0x0090;
8+
69
MEMORY {
710
/*
811
* Allocate in $2001 - $7fff (bank 0)

0 commit comments

Comments
 (0)