mirror of
https://github.com/irmen/prog8.git
synced 2024-12-23 09:32:43 +00:00
-target option is now required; c64 no longer the default
This commit is contained in:
parent
bfaad1388c
commit
9314c346da
@ -48,7 +48,7 @@ private fun compileMain(args: Array<String>): Boolean {
|
||||
val quietAssembler by cli.option(ArgType.Boolean, fullName = "quietasm", description = "don't print assembler output results")
|
||||
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
||||
val sourceDirs by cli.option(ArgType.String, fullName="srcdirs", description = "list of extra paths, separated with ${File.pathSeparator}, to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
||||
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler (one of '${C64Target.NAME}', '${C128Target.NAME}', '${Cx16Target.NAME}', '${AtariTarget.NAME}', '${VMTarget.NAME}')").default(C64Target.NAME)
|
||||
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler (one of '${C64Target.NAME}', '${C128Target.NAME}', '${Cx16Target.NAME}', '${AtariTarget.NAME}', '${VMTarget.NAME}')").required()
|
||||
val startVm by cli.option(ArgType.Boolean, fullName = "vm", description = "load and run a .p8ir IR source file in the VM")
|
||||
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watch for file changes)")
|
||||
val varsHigh by cli.option(ArgType.Boolean, fullName = "varshigh", description = "put uninitialized variables in high memory area instead of at the end of the program")
|
||||
|
@ -32,6 +32,7 @@ class ModuleImporter(private val program: Program,
|
||||
val programPath = path.resolve(normalizedFilePath)
|
||||
if(programPath.exists()) {
|
||||
println("Compiling program ${Path("").absolute().relativize(programPath)}")
|
||||
println("Compiler target: $compilationTargetName")
|
||||
val source = SourceCode.File(programPath)
|
||||
return Ok(importModule(source))
|
||||
}
|
||||
|
@ -109,10 +109,9 @@ One or more .p8 module files
|
||||
Prints short command line usage information.
|
||||
|
||||
``-target <compilation target>``
|
||||
Sets the target output of the compiler.
|
||||
Sets the target output of the compiler. This option is required.
|
||||
``c64`` = Commodore 64, ``c128`` = Commodore 128, ``cx16`` = Commander X16, ``atari`` = Atari 800 XL,
|
||||
``virtual`` = builtin virtual machine.
|
||||
Default = ``c64``.
|
||||
|
||||
``-srcdirs <pathlist>``
|
||||
Specify a list of extra paths (separated with ':'), to search in for imported modules.
|
||||
@ -292,11 +291,11 @@ Examples
|
||||
|
||||
A couple of example programs can be found in the 'examples' directory of the source tree.
|
||||
Make sure you have installed the :ref:`requirements`. Then, for instance,
|
||||
to compile and run the rasterbars example program, use this command::
|
||||
to compile and run the Commodore 64 rasterbars example program, use this command::
|
||||
|
||||
$ java -jar prog8compiler.jar -emu examples/rasterbars.p8
|
||||
$ java -jar prog8compiler.jar -target c64 -emu examples/rasterbars.p8
|
||||
|
||||
or::
|
||||
|
||||
$ ./p8compile.sh -emu examples/rasterbars.p8
|
||||
$ ./p8compile.sh -target c64 -emu examples/rasterbars.p8
|
||||
|
||||
|
@ -47,8 +47,12 @@ sys (part of syslib)
|
||||
system when the program is running.
|
||||
The following return values are currently defined:
|
||||
|
||||
- 16 = compiled for Commander X16 with 65C02 CPU
|
||||
- 64 = compiled for Commodore 64 with 6502/6510 CPU
|
||||
- 8 = Atari 8 bits
|
||||
- 16 = Commander X16
|
||||
- 64 = Commodore 64
|
||||
- 128 = Commodore 128
|
||||
- 255 = Virtual machine
|
||||
|
||||
|
||||
``exit (returncode)``
|
||||
Immediately stops the program and exits it, with the returncode in the A register.
|
||||
|
@ -23,6 +23,7 @@ Details of several important ones and how to convert version 8 code can be found
|
||||
- added gfx2.fill() flood fill routine
|
||||
- added @split storage class for (u)word arrays to store them as split lsb/msb arrays which is more efficient (but doesn't yet support all array operations)
|
||||
- added -splitarrays command line option and '%option splitarrays' to treat all word arrays as tagged with @split
|
||||
- the -target option is now required, c64 is no longer a default.
|
||||
|
||||
|
||||
``cx16diskio`` is now just ``diskio``
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import string
|
||||
|
||||
; Animal guessing game where the computer gets smarter every time.
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
const ubyte database_size = 100
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import math
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
%option no_sysinit
|
||||
|
||||
; The "Byte Sieve" test. https://en.wikipedia.org/wiki/Byte_Sieve
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
|
@ -3,7 +3,7 @@
|
||||
%import test_stack
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import graphics
|
||||
%import math
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import math
|
||||
%import cx16logo
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
sub start() {
|
@ -4,6 +4,8 @@
|
||||
%import test_stack
|
||||
%option no_sysinit
|
||||
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
diskio.set_drive(8)
|
||||
|
@ -2,7 +2,7 @@
|
||||
%zeropage basicsafe
|
||||
|
||||
; This example computes the first 20 values of the Fibonacci sequence.
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import test_stack
|
||||
%import math
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import syslib
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
; NOTE: this will take an eternity to draw on a real c64. A CommanderX16 is a bit faster.
|
||||
; even in Vice in warp mode (700% speed on my machine) it's slow, but you can see progress
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
const uword width = 320
|
||||
|
@ -3,7 +3,7 @@
|
||||
%import test_stack
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
const uword width = 30
|
||||
|
@ -6,7 +6,7 @@
|
||||
; This program shows a depth-first maze generation algorithm (1 possible path from start to finish),
|
||||
; and a depth-first maze solver algorithm, both using a stack to store the path taken.
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
|
@ -4,7 +4,7 @@
|
||||
%zeropage basicsafe
|
||||
|
||||
; The classic number guessing game.
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
|
||||
main {
|
||||
|
@ -1,8 +1,7 @@
|
||||
%import textio
|
||||
; %import test_stack
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import floats
|
||||
%zeropage floatsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
const uword screenwidth = txt.DEFAULT_WIDTH
|
||||
|
@ -6,7 +6,7 @@ main {
|
||||
str name1 = "name1"
|
||||
str name2 = "name2"
|
||||
|
||||
uword[] names = [name1, name2, "name3"]
|
||||
uword[] @split names = [name1, name2, "name3"]
|
||||
|
||||
uword ww
|
||||
; for ww in names {
|
||||
@ -22,12 +22,12 @@ main {
|
||||
names[idx]--
|
||||
txt.print_uw(names[1])
|
||||
|
||||
; names = [1111,2222,3333]
|
||||
; for ww in names {
|
||||
; txt.print_uw(ww)
|
||||
; txt.spc()
|
||||
; }
|
||||
; txt.nl()
|
||||
names = [1111,2222,3333]
|
||||
for ww in names {
|
||||
txt.print_uw(ww)
|
||||
txt.spc()
|
||||
}
|
||||
txt.nl()
|
||||
txt.print("end.")
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
; Prog8 adaptation of the Text-Elite galaxy system trading simulation engine.
|
||||
; Original C-version obtained from: http://www.elitehomepage.org/text/index.htm
|
||||
|
||||
; Note: this program is compatible with C64 and CX16.
|
||||
; Note: this program can be compiled for multiple target systems.
|
||||
|
||||
main {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user