some tweaks to the configurable targets

This commit is contained in:
Irmen de Jong 2025-01-30 23:52:44 +01:00
parent 1a04a3eb3a
commit 9cdf53019c
7 changed files with 17 additions and 17 deletions

View File

@ -115,7 +115,7 @@ class ConfigFileTarget(
ProgramType.valueOf(props.getString("program")),
props.getInteger("load_address"),
props.getInteger("memtop"),
props.getInteger("startup_reserved"),
0u, // used only in a very specific error condition check in a certain scenario...
props.getInteger("bss_highram_start"),
props.getInteger("bss_highram_end"),
props.getInteger("bss_goldenram_start"),

View File

@ -42,21 +42,23 @@ In this case the compiler will not use one of the builtin machines configuration
This allows you to define and change your own target machine configuration, and maybe allow Prog8 to generate
programs for new machines or existing ones it doesn't yet know about.
The configuration file should be a "targetname.properties" file, which is basically a text file containing "key=value" lines.
The "targetname" filename base part will be taken as the name of the configured compilation target.
The configuration file should be a "properties" file (Java's ubiquitous configuration file format), which is basically a text file containing "key=value" lines.
The contents of the file is pretty extensive and it's easier to just look at some examples that are already included:
`target configuration examples <https://github.com/irmen/prog8/tree/master/examples/customtarget/>`_ .
Most of the things discussed in the :ref:`portingguide` can and must be configured properly in the target configuration file.
You also need to create some essential ``syslib`` library module for the configured target, because the Prog8
compiler won't have a built in library that can be used this time. The customtarget examples also show how to build
the essentials.
You also need to create some essential ``syslib`` library module for the configured target if its name does not match
one of the built in targets. This is because the compiler won't have a built in library that can be used this time.
The customtarget examples also show how to build the essentials.
The filename base part (the part before any suffix) of the target configuration file will be taken as the name of the compilation target.
If it matches one of the existing built-in compilation targets, the internal library files for that target will still be used,
if the user supplied library location doesn't contain a replacement library file for anything that might get imported.
The target configuration file also allows you to override the entire launcher assembly fragment that the compiler
usually puts at the start of the program (immediately after the setting of the program counter/load address and
the program start label). This allows you to have full control over exactly what code or data bytes appear at
the program's load address. But with great power comes great responsibility: you'll have to make sure you take
care of some very low level Prog8 internals if you want to support stuff like the `exit` builtin function.
care of some very low level Prog8 internals if you want to support stuff such as the ``exit`` builtin function.
Maybe the best thing is to look at the code generated by the compiler for an existing target and adapt that.

View File

@ -2,7 +2,6 @@ TODO
====
- Make some of the target machine config externally configurable (for 1 new target, the existing ones should stay as they are for the time being)
- Should there be some form of "CUSTOM" launchertype where the startup assembly code can also be configured in the target.properties?
- add paypal donation button as well?
- announce prog8 on the 6502.org site?
@ -64,6 +63,8 @@ IR/VM
Libraries
---------
- cx16 diskio (and fileselector example): provide a way to list only files and only directories (or both), using "@$:*=p" / "@$:*=d" DOS filtering
- make fileselector into a loadable library?
- Sorting module gnomesort_uw could be optimized more by fully rewriting it in asm? Shellshort seems consistently faster even if most of the words are already sorted.
- Add split-word array sorting routines to sorting module?
- add even more general raster irq routines to build some sort of "copper list" , like Oscar64 has?

View File

@ -5,7 +5,6 @@ program = CBMPRG
encoding = petscii
load_address = $0801
memtop = $cfe0
startup_reserved = 20
bss_highram_start = $c000
bss_highram_end = $cfdf
bss_goldenram_start = 0
@ -33,7 +32,7 @@ virtual_registers = $cfe0
# Where can we find the standard library (syslib.p8). You can still add more paths manually using -srcdirs
library = ./libraries/tinyc64
# if a custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# if a non-empty custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# and instead outputs whatever is specified here. (You can use \n here for newline and \ for line continuantions)
custom_launcher =

View File

@ -5,7 +5,6 @@ program = CBMPRG
encoding = petscii
load_address = $0801
memtop = $9f00
startup_reserved = 20
bss_highram_start = $a00
bss_highram_end = $bfff
bss_goldenram_start = $0400
@ -33,7 +32,7 @@ virtual_registers = $02
# Where can we find the standard library (syslib.p8). You can still add more paths manually using -srcdirs
library = ./libraries/tinycx16
# if a custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# if a non-empty custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# and instead outputs whatever is specified here. (You can use \n here for newline and \ for line continuantions)
custom_launcher =

View File

@ -5,7 +5,6 @@ program = CBMPRG
encoding = petscii
load_address = $0401
memtop = $8000
startup_reserved = 20
bss_highram_start = 0
bss_highram_end = 0
bss_goldenram_start = 0
@ -33,7 +32,7 @@ virtual_registers = $7fe0
# Where can we find the standard library (syslib.p8). You can still add more paths manually using -srcdirs
library = ./libraries/tinypet
# if a custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# if a non-empty custom launcher string is supplied, the compiler won't output ANY launcher / init code by itself,
# and instead outputs whatever is specified here. (You can use \n here for newline and \ for line continuantions)
custom_launcher =

View File

@ -9,9 +9,9 @@
; Functions in PETSCII mode and in ISO mode as well (no case folding in ISO mode!)
; Depends a lot on diskio routines, and uses the drive set in the diskio.drivenumber variable (usually just 8)
; should case folding be done in diskio already? -> no, it doesn't know if you are in iso mode or not.
; TODO use "@$:=p" instead of filtering manually for only dirs use @$:=d , but that needs a change in diskio...
; TODO is there a way to detect if iso charset mode is active (not really, except read the kernal variable...)
; Q: should case folding be done in diskio already? A: no, it doesn't know if you are in iso mode or not.
; TODO use "@$:*=p" instead of filtering manually for only dirs use @$:*=d , but that needs a change in diskio...
; TODO joystick control? mouse control?
; TODO keyboard typing; jump to the first entry that starts with that character? (but 'q' for quit stops working then, plus scrolling with pageup/down is already pretty fast)