mirror of
https://github.com/irmen/prog8.git
synced 2025-02-16 22:30:46 +00:00
moved memcopy, memset, memsetw builtin functions to sys.*
This commit is contained in:
parent
025dde264a
commit
3d09d605e1
@ -27,7 +27,7 @@ graphics {
|
||||
}
|
||||
|
||||
sub clear_screen(ubyte pixelcolor, ubyte bgcolor) {
|
||||
memset(BITMAP_ADDRESS, 320*200/8, 0)
|
||||
sys.memset(BITMAP_ADDRESS, 320*200/8, 0)
|
||||
txt.fill_screen(pixelcolor << 4 | bgcolor, 0)
|
||||
}
|
||||
|
||||
|
@ -497,6 +497,80 @@ sys {
|
||||
}
|
||||
}
|
||||
|
||||
asmsub memcopy(uword source @R0, uword target @R1, uword count @AY) clobbers(A,X,Y) {
|
||||
%asm {{
|
||||
ldx cx16.r0
|
||||
stx P8ZP_SCRATCH_W1
|
||||
ldx cx16.r0+1
|
||||
stx P8ZP_SCRATCH_W1+1
|
||||
ldx cx16.r1
|
||||
stx P8ZP_SCRATCH_W2
|
||||
ldx cx16.r1+1
|
||||
stx P8ZP_SCRATCH_W2+1
|
||||
cpy #0
|
||||
bne _longcopy
|
||||
; copy <= 255
|
||||
tay
|
||||
|
||||
_remainder
|
||||
lda P8ZP_SCRATCH_W1
|
||||
bne +
|
||||
dec P8ZP_SCRATCH_W1+1
|
||||
+ dec P8ZP_SCRATCH_W1
|
||||
lda P8ZP_SCRATCH_W2
|
||||
bne +
|
||||
dec P8ZP_SCRATCH_W2+1
|
||||
+ dec P8ZP_SCRATCH_W2
|
||||
- lda (P8ZP_SCRATCH_W1), y
|
||||
sta (P8ZP_SCRATCH_W2), y
|
||||
dey
|
||||
bne -
|
||||
rts
|
||||
|
||||
_longcopy
|
||||
sta P8ZP_SCRATCH_B1 ; lsb(count) = remainder
|
||||
tya
|
||||
tax ; x = num pages (1+)
|
||||
ldy #0
|
||||
- lda (P8ZP_SCRATCH_W1),y ; copy a page at a time
|
||||
sta (P8ZP_SCRATCH_W2),y
|
||||
iny
|
||||
bne -
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
inc P8ZP_SCRATCH_W2+1
|
||||
dex
|
||||
bne -
|
||||
ldy P8ZP_SCRATCH_B1
|
||||
jmp _remainder
|
||||
}}
|
||||
}
|
||||
|
||||
asmsub memset(uword mem @R0, uword numbytes @R1, ubyte value @A) clobbers(A,X,Y) {
|
||||
%asm {{
|
||||
ldy cx16.r0
|
||||
sty P8ZP_SCRATCH_W1
|
||||
ldy cx16.r0+1
|
||||
sty P8ZP_SCRATCH_W1+1
|
||||
ldx cx16.r1
|
||||
ldy cx16.r1+1
|
||||
jmp prog8_lib.memset
|
||||
}}
|
||||
}
|
||||
|
||||
asmsub memsetw(uword mem @R0, uword numwords @R1, uword value @AY) clobbers(A,X,Y) {
|
||||
%asm {{
|
||||
ldx cx16.r0
|
||||
stx P8ZP_SCRATCH_W1
|
||||
ldx cx16.r0+1
|
||||
stx P8ZP_SCRATCH_W1+1
|
||||
ldx cx16.r1
|
||||
stx P8ZP_SCRATCH_W2
|
||||
ldx cx16.r1+1
|
||||
stx P8ZP_SCRATCH_W2+1
|
||||
jmp prog8_lib.memsetw
|
||||
}}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cx16 {
|
||||
|
@ -497,4 +497,32 @@ sys {
|
||||
}
|
||||
}
|
||||
|
||||
inline asmsub memcopy(uword source @R0, uword target @R1, uword count @AY) clobbers(A,X,Y) {
|
||||
%asm {{
|
||||
sta cx16.r2
|
||||
sty cx16.r2+1
|
||||
jsr cx16.memory_copy
|
||||
}}
|
||||
}
|
||||
|
||||
inline asmsub memset(uword mem @R0, uword numbytes @R1, ubyte value @A) clobbers(A,X,Y) {
|
||||
%asm {{
|
||||
jsr cx16.memory_fill
|
||||
}}
|
||||
}
|
||||
|
||||
asmsub memsetw(uword mem @R0, uword numwords @R1, uword value @AY) clobbers (A,X,Y) {
|
||||
%asm {{
|
||||
ldx cx16.r0
|
||||
stx P8ZP_SCRATCH_W1
|
||||
ldx cx16.r0+1
|
||||
stx P8ZP_SCRATCH_W1+1
|
||||
ldx cx16.r1
|
||||
stx P8ZP_SCRATCH_W2
|
||||
ldx cx16.r1+1
|
||||
stx P8ZP_SCRATCH_W2+1
|
||||
jmp prog8_lib.memsetw
|
||||
}}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ io_error:
|
||||
ubyte flen = string.length(filenameptr)
|
||||
filename[0] = 's'
|
||||
filename[1] = ':'
|
||||
memcopy(filenameptr, &filename+2, flen+1)
|
||||
sys.memcopy(filenameptr, &filename+2, flen+1)
|
||||
c64.SETNAM(flen+2, filename)
|
||||
c64.SETLFS(1, drivenumber, 15)
|
||||
void c64.OPEN()
|
||||
@ -453,9 +453,9 @@ io_error:
|
||||
ubyte flen_new = string.length(newfileptr)
|
||||
filename[0] = 'r'
|
||||
filename[1] = ':'
|
||||
memcopy(newfileptr, &filename+2, flen_new)
|
||||
sys.memcopy(newfileptr, &filename+2, flen_new)
|
||||
filename[flen_new+2] = '='
|
||||
memcopy(oldfileptr, &filename+3+flen_new, flen_old+1)
|
||||
sys.memcopy(oldfileptr, &filename+3+flen_new, flen_old+1)
|
||||
c64.SETNAM(3+flen_new+flen_old, filename)
|
||||
c64.SETLFS(1, drivenumber, 15)
|
||||
void c64.OPEN()
|
||||
|
@ -1096,111 +1096,3 @@ func_read_flags_stack .proc
|
||||
rts
|
||||
.pend
|
||||
|
||||
|
||||
func_memset .proc
|
||||
; note: clobbers A,Y
|
||||
txa
|
||||
pha
|
||||
lda _arg_address
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda _arg_address+1
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
ldx _arg_numbytes
|
||||
ldy _arg_numbytes+1
|
||||
lda _arg_bytevalue
|
||||
jsr memset
|
||||
pla
|
||||
tax
|
||||
rts
|
||||
_arg_address .word 0
|
||||
_arg_numbytes .word 0
|
||||
_arg_bytevalue .byte 0
|
||||
.pend
|
||||
|
||||
|
||||
func_memsetw .proc
|
||||
; note: clobbers A,Y
|
||||
txa
|
||||
pha
|
||||
lda _arg_address
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda _arg_address+1
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
lda _arg_numwords
|
||||
sta P8ZP_SCRATCH_W2
|
||||
lda _arg_numwords+1
|
||||
sta P8ZP_SCRATCH_W2+1
|
||||
lda _arg_wordvalue
|
||||
ldy _arg_wordvalue+1
|
||||
jsr memsetw
|
||||
pla
|
||||
tax
|
||||
rts
|
||||
_arg_address .word 0
|
||||
_arg_numwords .word 0
|
||||
_arg_wordvalue .word 0
|
||||
.pend
|
||||
|
||||
|
||||
func_memcopy .proc
|
||||
; memcopy of any number of bytes, note: clobbers A,Y
|
||||
stx P8ZP_SCRATCH_REG
|
||||
lda _arg_from
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda _arg_from+1
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
lda _arg_to
|
||||
sta P8ZP_SCRATCH_W2
|
||||
lda _arg_to+1
|
||||
sta P8ZP_SCRATCH_W2+1
|
||||
|
||||
ldy #0
|
||||
ldx _arg_numbytes+1
|
||||
beq _remain
|
||||
- lda (P8ZP_SCRATCH_W1),y ; move a page at a time
|
||||
sta (P8ZP_SCRATCH_W2),y
|
||||
iny
|
||||
bne -
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
inc P8ZP_SCRATCH_W2+1
|
||||
dex
|
||||
bne -
|
||||
_remain ldx _arg_numbytes
|
||||
beq _done
|
||||
- lda (P8ZP_SCRATCH_W1),y ; move the remaining bytes
|
||||
sta (P8ZP_SCRATCH_W2),y
|
||||
iny
|
||||
dex
|
||||
bne -
|
||||
|
||||
_done ldx P8ZP_SCRATCH_REG
|
||||
rts
|
||||
|
||||
_arg_from .word 0
|
||||
_arg_to .word 0
|
||||
_arg_numbytes .word 0
|
||||
.pend
|
||||
|
||||
|
||||
func_memcopy255 .proc
|
||||
; fast memcopy of up to 255 bytes, note: clobbers A,Y
|
||||
; note: also uses the _arg variables from regular func_memcopy
|
||||
stx P8ZP_SCRATCH_REG
|
||||
lda func_memcopy._arg_from
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda func_memcopy._arg_from+1
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
lda func_memcopy._arg_to
|
||||
sta P8ZP_SCRATCH_W2
|
||||
lda func_memcopy._arg_to+1
|
||||
sta P8ZP_SCRATCH_W2+1
|
||||
ldx func_memcopy._arg_numbytes
|
||||
ldy #0
|
||||
- lda (P8ZP_SCRATCH_W1), y
|
||||
sta (P8ZP_SCRATCH_W2), y
|
||||
iny
|
||||
dex
|
||||
bne -
|
||||
ldx P8ZP_SCRATCH_REG
|
||||
rts
|
||||
.pend
|
||||
|
@ -7,8 +7,6 @@ import prog8.ast.base.*
|
||||
import prog8.ast.expressions.*
|
||||
import prog8.ast.statements.*
|
||||
import prog8.compiler.AssemblyError
|
||||
import prog8.compiler.target.CompilationTarget
|
||||
import prog8.compiler.target.Cx16Target
|
||||
import prog8.compiler.target.c64.codegen.assignment.AsmAssignSource
|
||||
import prog8.compiler.target.c64.codegen.assignment.AsmAssignTarget
|
||||
import prog8.compiler.target.c64.codegen.assignment.AsmAssignment
|
||||
@ -60,6 +58,8 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
"ror2" -> funcRor2(fcall)
|
||||
"sort" -> funcSort(fcall)
|
||||
"reverse" -> funcReverse(fcall)
|
||||
"memory" -> funcMemory(fcall, discardResult, resultToStack)
|
||||
// TODO move all of the functions below to the sys module as well:
|
||||
"rsave" -> {
|
||||
// save cpu status flag and all registers A, X, Y.
|
||||
// see http://6502.org/tutorials/register_preservation.html
|
||||
@ -79,7 +79,6 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
"set_carry" -> asmgen.out(" sec")
|
||||
"clear_irqd" -> asmgen.out(" cli")
|
||||
"set_irqd" -> asmgen.out(" sei")
|
||||
"memcopy", "memset", "memsetw" -> funcMemSetCopy(fcall, func, sscope)
|
||||
"exit" -> {
|
||||
translateArguments(fcall.args, func, sscope)
|
||||
asmgen.out(" jmp prog8_lib.func_exit")
|
||||
@ -95,7 +94,6 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
else
|
||||
asmgen.out(" lda #<prog8_program_end | ldy #>prog8_program_end")
|
||||
}
|
||||
"memory" -> funcMemory(fcall, discardResult, resultToStack)
|
||||
else -> TODO("missing asmgen for builtin func ${func.name}")
|
||||
}
|
||||
}
|
||||
@ -129,61 +127,6 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
asmgen.slabs[name] = size
|
||||
}
|
||||
|
||||
private fun funcMemSetCopy(fcall: IFunctionCall, func: FSignature, scope: Subroutine?) {
|
||||
if(CompilationTarget.instance is Cx16Target) {
|
||||
when(func.name) {
|
||||
"memset" -> {
|
||||
if(scope==null)
|
||||
throw AssemblyError("cannot call memset() outside of a subroutine scope")
|
||||
// use the ROM function of the Cx16
|
||||
asmgen.assignExpressionToRegister(fcall.args[0], RegisterOrPair.R0)
|
||||
asmgen.assignExpressionToRegister(fcall.args[1], RegisterOrPair.R1)
|
||||
asmgen.assignExpressionToRegister(fcall.args[2], RegisterOrPair.A)
|
||||
asmgen.saveRegisterLocal(CpuRegister.X, scope)
|
||||
asmgen.out(" jsr cx16.memory_fill")
|
||||
asmgen.restoreRegisterLocal(CpuRegister.X)
|
||||
}
|
||||
"memcopy" -> {
|
||||
val count = fcall.args[2].constValue(program)?.number?.toInt()
|
||||
val countDt = fcall.args[2].inferType(program)
|
||||
if((count!=null && count <= 255) || countDt.istype(DataType.UBYTE) || countDt.istype(DataType.BYTE)) {
|
||||
// fast memcopy of up to 255
|
||||
translateArguments(fcall.args, func, scope)
|
||||
asmgen.out(" jsr prog8_lib.func_memcopy255")
|
||||
return
|
||||
}
|
||||
|
||||
if(scope==null)
|
||||
throw AssemblyError("cannot call memcopy() outside of a subroutine scope")
|
||||
|
||||
// use the ROM function of the Cx16
|
||||
asmgen.assignExpressionToRegister(fcall.args[0], RegisterOrPair.R0)
|
||||
asmgen.assignExpressionToRegister(fcall.args[1], RegisterOrPair.R1)
|
||||
asmgen.assignExpressionToRegister(fcall.args[2], RegisterOrPair.R2)
|
||||
asmgen.saveRegisterLocal(CpuRegister.X, scope)
|
||||
asmgen.out(" jsr cx16.memory_copy")
|
||||
asmgen.restoreRegisterLocal(CpuRegister.X)
|
||||
}
|
||||
"memsetw" -> {
|
||||
translateArguments(fcall.args, func, scope)
|
||||
asmgen.out(" jsr prog8_lib.func_memsetw")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(func.name=="memcopy") {
|
||||
val count = fcall.args[2].constValue(program)?.number?.toInt()
|
||||
val countDt = fcall.args[2].inferType(program)
|
||||
if((count!=null && count <= 255) || countDt.istype(DataType.UBYTE) || countDt.istype(DataType.BYTE)) {
|
||||
translateArguments(fcall.args, func, scope)
|
||||
asmgen.out(" jsr prog8_lib.func_memcopy255")
|
||||
return
|
||||
}
|
||||
}
|
||||
translateArguments(fcall.args, func, scope)
|
||||
asmgen.out(" jsr prog8_lib.func_${func.name}")
|
||||
}
|
||||
}
|
||||
|
||||
private fun funcSqrt16(fcall: IFunctionCall, func: FSignature, resultToStack: Boolean, scope: Subroutine?) {
|
||||
translateArguments(fcall.args, func, scope)
|
||||
if(resultToStack)
|
||||
|
@ -144,18 +144,7 @@ private val functionSignatures: List<FSignature> = listOf(
|
||||
FSignature("progend" , true, emptyList(), DataType.UWORD),
|
||||
FSignature("memory" , true, listOf(FParam("name", setOf(DataType.STR)), FParam("size", setOf(DataType.UWORD))), DataType.UWORD),
|
||||
FSignature("swap" , false, listOf(FParam("first", NumericDatatypes), FParam("second", NumericDatatypes)), null),
|
||||
FSignature("memcopy" , false, listOf(
|
||||
FParam("from", IterableDatatypes + DataType.UWORD),
|
||||
FParam("to", IterableDatatypes + DataType.UWORD),
|
||||
FParam("numbytes", setOf(DataType.UBYTE, DataType.UWORD))), null),
|
||||
FSignature("memset" , false, listOf(
|
||||
FParam("address", IterableDatatypes + DataType.UWORD),
|
||||
FParam("numbytes", setOf(DataType.UWORD)),
|
||||
FParam("bytevalue", ByteDatatypes)), null),
|
||||
FSignature("memsetw" , false, listOf(
|
||||
FParam("address", IterableDatatypes + DataType.UWORD),
|
||||
FParam("numwords", setOf(DataType.UWORD)),
|
||||
FParam("wordvalue", setOf(DataType.UWORD, DataType.WORD))), null)
|
||||
|
||||
)
|
||||
|
||||
val BuiltinFunctions = functionSignatures.associateBy { it.name }
|
||||
|
@ -55,7 +55,7 @@ Language features
|
||||
- Nested subroutines can access variables from outer scopes to avoids the overhead to pass everything via parameters
|
||||
- Variable data types include signed and unsigned bytes and words, arrays, strings and floats.
|
||||
- High-level code optimizations, such as const-folding, expression and statement simplifications/rewriting.
|
||||
- Many built-in functions, such as ``sin``, ``cos``, ``rnd``, ``abs``, ``min``, ``max``, ``sqrt``, ``msb``, ``rol``, ``ror``, ``swap``, ``memset``, ``memcopy``, ``substr``, ``sort`` and ``reverse`` (and others)
|
||||
- Many built-in functions, such as ``sin``, ``cos``, ``rnd``, ``abs``, ``min``, ``max``, ``sqrt``, ``msb``, ``rol``, ``ror``, ``swap``, ``sort`` and ``reverse``
|
||||
- Supports the sixteen 'virtual' 16-bit registers R0 .. R15 from the Commander X16, also on the C64.
|
||||
- If you only use standard kernel and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)!
|
||||
|
||||
@ -66,7 +66,7 @@ Code example
|
||||
This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
|
||||
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
%zeropage basicsafe1
|
||||
|
||||
main {
|
||||
ubyte[256] sieve
|
||||
@ -74,7 +74,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
|
||||
|
||||
sub start() {
|
||||
; clear the sieve, to reset starting situation on subsequent runs
|
||||
memset(sieve, 256, false)
|
||||
sys.memset(sieve, 256, false)
|
||||
; calculate primes
|
||||
txt.print("prime numbers up to 255:\n\n")
|
||||
ubyte amount=0
|
||||
|
@ -34,7 +34,9 @@ as ROM/kernal subroutine definitions, memory location constants, and utility sub
|
||||
Many of these definitions overlap for the C64 and Commander X16 targets so it is still possible
|
||||
to write programs that work on both targets without modifications.
|
||||
|
||||
``sys.target``
|
||||
sys (part of syslib)
|
||||
--------------------
|
||||
``target``
|
||||
A constant ubyte value designating the target machine that the program is compiled for.
|
||||
Notice that this is a compile-time constant value and is not determined on the
|
||||
system when the program is running.
|
||||
@ -43,6 +45,23 @@ to write programs that work on both targets without modifications.
|
||||
- 16 = compiled for CommanderX16 with 65C02 CPU
|
||||
- 64 = compiled for Commodore-64 with 6502/6510 CPU
|
||||
|
||||
``memcopy(from, to, numbytes)``
|
||||
Efficiently copy a number of bytes from a memory location to another.
|
||||
NOTE: 'to' must NOT overlap with 'from', unless it is *before* 'from'.
|
||||
Because this function imposes some overhead to handle the parameters,
|
||||
it is only faster if the number of bytes is larger than a certain threshold.
|
||||
Compare the generated code to see if it was beneficial or not.
|
||||
The most efficient will often be to write a specialized copy routine in assembly yourself!
|
||||
|
||||
``memset(address, numbytes, bytevalue)``
|
||||
Efficiently set a part of memory to the given (u)byte value.
|
||||
But the most efficient will always be to write a specialized fill routine in assembly yourself!
|
||||
Note that for clearing the screen, very fast specialized subroutines are
|
||||
available in the ``textio`` and ``graphics`` library modules.
|
||||
|
||||
``memsetw(address, numwords, wordvalue)``
|
||||
Efficiently set a part of memory to the given (u)word value.
|
||||
But the most efficient will always be to write a specialized fill routine in assembly yourself!
|
||||
|
||||
|
||||
conv
|
||||
|
@ -779,27 +779,6 @@ sort(array)
|
||||
Sorting strings alphabetically has to be programmed yourself if you need it.
|
||||
|
||||
|
||||
Strings and memory blocks
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
memcopy(from, to, numbytes)
|
||||
Efficiently copy a number of bytes from a memory location to another.
|
||||
NOTE: 'to' must NOT overlap with 'from', unless it is *before* 'from'.
|
||||
Because this function imposes some overhead to handle the parameters,
|
||||
it is only faster if the number of bytes is larger than a certain threshold.
|
||||
Compare the generated code to see if it was beneficial or not.
|
||||
The most efficient will often be to write a specialized copy routine in assembly yourself!
|
||||
|
||||
memset(address, numbytes, bytevalue)
|
||||
Efficiently set a part of memory to the given (u)byte value.
|
||||
But the most efficient will always be to write a specialized fill routine in assembly yourself!
|
||||
Note that for clearing the screen, very fast specialized subroutines are
|
||||
available in the ``textio`` and ``graphics`` library modules.
|
||||
|
||||
memsetw(address, numwords, wordvalue)
|
||||
Efficiently set a part of memory to the given (u)word value.
|
||||
But the most efficient will always be to write a specialized fill routine in assembly yourself!
|
||||
|
||||
|
||||
Miscellaneous
|
||||
^^^^^^^^^^^^^
|
||||
exit(returncode)
|
||||
|
@ -2,7 +2,7 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
- move all mem* builtins to the sys module. update docs.
|
||||
- move the other marked functions in builtinfunctionsasmgen to the sys module as well. update docs.
|
||||
- use (zp) addressing mode on 65c02 specific code rather than ldy#0 / lda (zp),y
|
||||
- optimize pointer access code @(pointer)? use a subroutine? macro? 65c02 vs 6502?
|
||||
- allow byte return type with single register for asmsubs, for instance string.compare
|
||||
|
@ -33,7 +33,7 @@ charset {
|
||||
set_irqd()
|
||||
ubyte bank = @($0001)
|
||||
@($0001) = bank & %11111011 ; enable CHAREN, so the character rom accessible at $d000
|
||||
memcopy($d000, CHARSET, 256*8*2) ; copy the charset to RAM
|
||||
sys.memcopy($d000, CHARSET, 256*8*2) ; copy the charset to RAM
|
||||
|
||||
@($0001) = bank ; reset previous memory banking
|
||||
clear_irqd()
|
||||
@ -79,7 +79,7 @@ charset {
|
||||
%00111100
|
||||
]
|
||||
|
||||
memcopy(smiley, CHARSET, len(smiley))
|
||||
sys.memcopy(smiley, CHARSET, len(smiley))
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ trader {
|
||||
ship.cash = savedata.cash
|
||||
ship.Max_cargo = savedata.max_cargo
|
||||
ship.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
||||
galaxy.travel_to(savedata.galaxy, savedata.planet)
|
||||
|
||||
planet.display(false)
|
||||
@ -131,7 +131,7 @@ trader {
|
||||
savedata.cash = ship.cash
|
||||
savedata.max_cargo = ship.Max_cargo
|
||||
savedata.fuel = ship.fuel
|
||||
memcopy(ship.cargohold, &savedata.cargo0, len(ship.cargohold))
|
||||
sys.memcopy(ship.cargohold, &savedata.cargo0, len(ship.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -303,7 +303,7 @@ ship {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -954,11 +954,11 @@ util {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader10 {
|
||||
ship10.cash = savedata.cash
|
||||
ship10.Max_cargo = savedata.max_cargo
|
||||
ship10.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship10.cargohold, len(ship10.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship10.cargohold, len(ship10.cargohold))
|
||||
galaxy10.travel_to(savedata.galaxy10, savedata.planet10)
|
||||
|
||||
planet10.display(false)
|
||||
@ -121,7 +121,7 @@ trader10 {
|
||||
savedata.cash = ship10.cash
|
||||
savedata.max_cargo = ship10.Max_cargo
|
||||
savedata.fuel = ship10.fuel
|
||||
memcopy(ship10.cargohold, &savedata.cargo0, len(ship10.cargohold))
|
||||
sys.memcopy(ship10.cargohold, &savedata.cargo0, len(ship10.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship10 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util10 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader2 {
|
||||
ship2.cash = savedata.cash
|
||||
ship2.Max_cargo = savedata.max_cargo
|
||||
ship2.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship2.cargohold, len(ship2.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship2.cargohold, len(ship2.cargohold))
|
||||
galaxy2.travel_to(savedata.galaxy2, savedata.planet2)
|
||||
|
||||
planet2.display(false)
|
||||
@ -121,7 +121,7 @@ trader2 {
|
||||
savedata.cash = ship2.cash
|
||||
savedata.max_cargo = ship2.Max_cargo
|
||||
savedata.fuel = ship2.fuel
|
||||
memcopy(ship2.cargohold, &savedata.cargo0, len(ship2.cargohold))
|
||||
sys.memcopy(ship2.cargohold, &savedata.cargo0, len(ship2.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship2 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util2 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader3 {
|
||||
ship3.cash = savedata.cash
|
||||
ship3.Max_cargo = savedata.max_cargo
|
||||
ship3.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship3.cargohold, len(ship3.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship3.cargohold, len(ship3.cargohold))
|
||||
galaxy3.travel_to(savedata.galaxy3, savedata.planet3)
|
||||
|
||||
planet3.display(false)
|
||||
@ -121,7 +121,7 @@ trader3 {
|
||||
savedata.cash = ship3.cash
|
||||
savedata.max_cargo = ship3.Max_cargo
|
||||
savedata.fuel = ship3.fuel
|
||||
memcopy(ship3.cargohold, &savedata.cargo0, len(ship3.cargohold))
|
||||
sys.memcopy(ship3.cargohold, &savedata.cargo0, len(ship3.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship3 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util3 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader4 {
|
||||
ship4.cash = savedata.cash
|
||||
ship4.Max_cargo = savedata.max_cargo
|
||||
ship4.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship4.cargohold, len(ship4.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship4.cargohold, len(ship4.cargohold))
|
||||
galaxy4.travel_to(savedata.galaxy4, savedata.planet4)
|
||||
|
||||
planet4.display(false)
|
||||
@ -121,7 +121,7 @@ trader4 {
|
||||
savedata.cash = ship4.cash
|
||||
savedata.max_cargo = ship4.Max_cargo
|
||||
savedata.fuel = ship4.fuel
|
||||
memcopy(ship4.cargohold, &savedata.cargo0, len(ship4.cargohold))
|
||||
sys.memcopy(ship4.cargohold, &savedata.cargo0, len(ship4.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship4 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util4 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader5 {
|
||||
ship5.cash = savedata.cash
|
||||
ship5.Max_cargo = savedata.max_cargo
|
||||
ship5.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship5.cargohold, len(ship5.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship5.cargohold, len(ship5.cargohold))
|
||||
galaxy5.travel_to(savedata.galaxy5, savedata.planet5)
|
||||
|
||||
planet5.display(false)
|
||||
@ -121,7 +121,7 @@ trader5 {
|
||||
savedata.cash = ship5.cash
|
||||
savedata.max_cargo = ship5.Max_cargo
|
||||
savedata.fuel = ship5.fuel
|
||||
memcopy(ship5.cargohold, &savedata.cargo0, len(ship5.cargohold))
|
||||
sys.memcopy(ship5.cargohold, &savedata.cargo0, len(ship5.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship5 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util5 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader6 {
|
||||
ship6.cash = savedata.cash
|
||||
ship6.Max_cargo = savedata.max_cargo
|
||||
ship6.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship6.cargohold, len(ship6.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship6.cargohold, len(ship6.cargohold))
|
||||
galaxy6.travel_to(savedata.galaxy6, savedata.planet6)
|
||||
|
||||
planet6.display(false)
|
||||
@ -121,7 +121,7 @@ trader6 {
|
||||
savedata.cash = ship6.cash
|
||||
savedata.max_cargo = ship6.Max_cargo
|
||||
savedata.fuel = ship6.fuel
|
||||
memcopy(ship6.cargohold, &savedata.cargo0, len(ship6.cargohold))
|
||||
sys.memcopy(ship6.cargohold, &savedata.cargo0, len(ship6.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship6 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util6 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader7 {
|
||||
ship7.cash = savedata.cash
|
||||
ship7.Max_cargo = savedata.max_cargo
|
||||
ship7.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship7.cargohold, len(ship7.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship7.cargohold, len(ship7.cargohold))
|
||||
galaxy7.travel_to(savedata.galaxy7, savedata.planet7)
|
||||
|
||||
planet7.display(false)
|
||||
@ -121,7 +121,7 @@ trader7 {
|
||||
savedata.cash = ship7.cash
|
||||
savedata.max_cargo = ship7.Max_cargo
|
||||
savedata.fuel = ship7.fuel
|
||||
memcopy(ship7.cargohold, &savedata.cargo0, len(ship7.cargohold))
|
||||
sys.memcopy(ship7.cargohold, &savedata.cargo0, len(ship7.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship7 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util7 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader8 {
|
||||
ship8.cash = savedata.cash
|
||||
ship8.Max_cargo = savedata.max_cargo
|
||||
ship8.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship8.cargohold, len(ship8.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship8.cargohold, len(ship8.cargohold))
|
||||
galaxy8.travel_to(savedata.galaxy8, savedata.planet8)
|
||||
|
||||
planet8.display(false)
|
||||
@ -121,7 +121,7 @@ trader8 {
|
||||
savedata.cash = ship8.cash
|
||||
savedata.max_cargo = ship8.Max_cargo
|
||||
savedata.fuel = ship8.fuel
|
||||
memcopy(ship8.cargohold, &savedata.cargo0, len(ship8.cargohold))
|
||||
sys.memcopy(ship8.cargohold, &savedata.cargo0, len(ship8.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship8 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util8 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -109,7 +109,7 @@ trader9 {
|
||||
ship9.cash = savedata.cash
|
||||
ship9.Max_cargo = savedata.max_cargo
|
||||
ship9.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship9.cargohold, len(ship9.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship9.cargohold, len(ship9.cargohold))
|
||||
galaxy9.travel_to(savedata.galaxy9, savedata.planet9)
|
||||
|
||||
planet9.display(false)
|
||||
@ -121,7 +121,7 @@ trader9 {
|
||||
savedata.cash = ship9.cash
|
||||
savedata.max_cargo = ship9.Max_cargo
|
||||
savedata.fuel = ship9.fuel
|
||||
memcopy(ship9.cargohold, &savedata.cargo0, len(ship9.cargohold))
|
||||
sys.memcopy(ship9.cargohold, &savedata.cargo0, len(ship9.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship9 {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
@ -944,11 +944,11 @@ util9 {
|
||||
return false
|
||||
}
|
||||
|
||||
sub print_right(ubyte width, uword string) {
|
||||
repeat width - string.length(string) {
|
||||
sub print_right(ubyte width, uword st) {
|
||||
repeat width - string.length(st) {
|
||||
txt.chrout(' ')
|
||||
}
|
||||
txt.print(string)
|
||||
txt.print(st)
|
||||
}
|
||||
|
||||
asmsub print_10s(uword value @AY) clobbers(A, X, Y) {
|
||||
|
@ -140,7 +140,7 @@ main {
|
||||
sub draw_lines_hiddenremoval() {
|
||||
; complex drawing routine that draws the ship model based on its faces,
|
||||
; where it uses the surface normals to determine visibility.
|
||||
memset(edgestodraw, shipdata.totalNumberOfEdges, true)
|
||||
sys.memset(edgestodraw, shipdata.totalNumberOfEdges, true)
|
||||
ubyte @zp edgeIdx = 0
|
||||
ubyte @zp pointIdx = 0
|
||||
ubyte faceNumber
|
||||
|
@ -10,7 +10,7 @@ main {
|
||||
ubyte candidate_prime = 2 ; is increased in the loop
|
||||
|
||||
sub start() {
|
||||
memset(sieve, 256, false) ; clear the sieve, to reset starting situation on subsequent runs
|
||||
sys.memset(sieve, 256, false) ; clear the sieve, to reset starting situation on subsequent runs
|
||||
|
||||
; calculate primes
|
||||
txt.print("prime numbers up to 255:\n\n")
|
||||
|
@ -199,7 +199,7 @@ waitkey:
|
||||
ubyte[boardHeight] complete_lines
|
||||
ubyte num_lines=0
|
||||
ubyte linepos
|
||||
memset(complete_lines, len(complete_lines), 0)
|
||||
sys.memset(complete_lines, len(complete_lines), 0)
|
||||
for linepos in boardOffsetY to boardOffsetY+boardHeight-1 {
|
||||
if blocklogic.isLineFull(linepos) {
|
||||
complete_lines[num_lines]=linepos
|
||||
@ -444,7 +444,7 @@ blocklogic {
|
||||
|
||||
sub newCurrentBlock(ubyte block) {
|
||||
currentBlockNum = block
|
||||
memcopy(blocks[block], currentBlock, len(currentBlock))
|
||||
sys.memcopy(blocks[block], currentBlock, len(currentBlock))
|
||||
}
|
||||
|
||||
sub rotateCW() {
|
||||
@ -467,11 +467,11 @@ blocklogic {
|
||||
rotated[13] = currentBlock[11]
|
||||
rotated[14] = currentBlock[7]
|
||||
rotated[15] = currentBlock[3]
|
||||
memcopy(rotated, currentBlock, len(currentBlock))
|
||||
sys.memcopy(rotated, currentBlock, len(currentBlock))
|
||||
}
|
||||
else if currentBlockNum!=3 {
|
||||
; rotate all blocks (except 3, the square) around their center square in a 3x3 matrix
|
||||
memset(rotated, len(rotated), 0)
|
||||
sys.memset(rotated, len(rotated), 0)
|
||||
rotated[0] = currentBlock[8]
|
||||
rotated[1] = currentBlock[4]
|
||||
rotated[2] = currentBlock[0]
|
||||
@ -481,7 +481,7 @@ blocklogic {
|
||||
rotated[8] = currentBlock[10]
|
||||
rotated[9] = currentBlock[6]
|
||||
rotated[10] = currentBlock[2]
|
||||
memcopy(rotated, currentBlock, len(currentBlock))
|
||||
sys.memcopy(rotated, currentBlock, len(currentBlock))
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,11 +505,11 @@ blocklogic {
|
||||
rotated[13] = currentBlock[4]
|
||||
rotated[14] = currentBlock[8]
|
||||
rotated[15] = currentBlock[12]
|
||||
memcopy(rotated, currentBlock, len(currentBlock))
|
||||
sys.memcopy(rotated, currentBlock, len(currentBlock))
|
||||
}
|
||||
else if currentBlockNum!=3 {
|
||||
; rotate all blocks (except 3, the square) around their center square in a 3x3 matrix
|
||||
memset(rotated, len(rotated), 0)
|
||||
sys.memset(rotated, len(rotated), 0)
|
||||
rotated[0] = currentBlock[2]
|
||||
rotated[1] = currentBlock[6]
|
||||
rotated[2] = currentBlock[10]
|
||||
@ -519,7 +519,7 @@ blocklogic {
|
||||
rotated[8] = currentBlock[0]
|
||||
rotated[9] = currentBlock[4]
|
||||
rotated[10] = currentBlock[8]
|
||||
memcopy(rotated, currentBlock, len(currentBlock))
|
||||
sys.memcopy(rotated, currentBlock, len(currentBlock))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,11 @@
|
||||
main {
|
||||
|
||||
sub start() {
|
||||
txt.print_ub(sys.target)
|
||||
sys.memset($0400+5*40, 40*20-1, '*')
|
||||
sys.memsetw($0400+40*10, 40*10/2, $2299)
|
||||
sys.memcopy($a000, $0400, 1000-3)
|
||||
sys.memset($0400+10*40, 14*40, 'a')
|
||||
sys.memcopy($0400+10*40, $0400, 3*40)
|
||||
}
|
||||
|
||||
sub start2 () {
|
||||
|
@ -109,7 +109,7 @@ trader {
|
||||
ship.cash = savedata.cash
|
||||
ship.Max_cargo = savedata.max_cargo
|
||||
ship.fuel = savedata.fuel
|
||||
memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
||||
sys.memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
||||
galaxy.travel_to(savedata.galaxy, savedata.planet)
|
||||
|
||||
planet.display(false)
|
||||
@ -121,7 +121,7 @@ trader {
|
||||
savedata.cash = ship.cash
|
||||
savedata.max_cargo = ship.Max_cargo
|
||||
savedata.fuel = ship.fuel
|
||||
memcopy(ship.cargohold, &savedata.cargo0, len(ship.cargohold))
|
||||
sys.memcopy(ship.cargohold, &savedata.cargo0, len(ship.cargohold))
|
||||
|
||||
txt.print("\nSaving universe...")
|
||||
diskio.delete(8, Savegame)
|
||||
@ -293,7 +293,7 @@ ship {
|
||||
ubyte[17] cargohold = 0
|
||||
|
||||
sub init() {
|
||||
memset(cargohold, len(cargohold), 0)
|
||||
sys.memset(cargohold, len(cargohold), 0)
|
||||
}
|
||||
|
||||
sub cargo_free() -> ubyte {
|
||||
|
@ -14,7 +14,7 @@
|
||||
<keywords keywords="&;->;@;\$;and;as;asmsub;break;clobbers;continue;do;downto;else;false;for;goto;if;if_cc;if_cs;if_eq;if_mi;if_ne;if_neg;if_nz;if_pl;if_pos;if_vc;if_vs;if_z;in;inline;not;or;repeat;return;romsub;step;sub;to;true;until;when;while;xor;~" ignore_case="false" />
|
||||
<keywords2 keywords="%address;%asm;%asmbinary;%asminclude;%breakpoint;%import;%launcher;%option;%output;%target;%zeropage;%zpreserved" />
|
||||
<keywords3 keywords="byte;const;float;str;struct;ubyte;uword;void;word;zp" />
|
||||
<keywords4 keywords="abs;acos;all;any;asin;atan;avg;ceil;clear_carry;clear_irqd;cos;cos16;cos16u;cos8;cos8u;deg;exit;floor;leftstr;len;ln;log2;lsb;lsl;lsr;max;memcopy;memory;memset;memsetw;min;mkword;msb;progend;rad;read_flags;reverse;rightstr;rnd;rndf;rndw;rol;rol2;ror;ror2;round;rrestore;rsave;set_carry;set_irqd;sgn;sin;sin16;sin16u;sin8;sin8u;sizeof;sort;sqrt;sqrt16;strcmp;strcopy;strfind;strlen;substr;sum;swap;tan;target" />
|
||||
<keywords4 keywords="abs;acos;all;any;asin;atan;avg;ceil;clear_carry;clear_irqd;cos;cos16;cos16u;cos8;cos8u;deg;exit;floor;len;ln;log2;lsb;lsl;lsr;max;memory;min;mkword;msb;progend;rad;read_flags;reverse;rnd;rndf;rndw;rol;rol2;ror;ror2;round;rrestore;rsave;set_carry;set_irqd;sgn;sin;sin16;sin16u;sin8;sin8u;sizeof;sort;sqrt;sqrt16;sum;swap;tan" />
|
||||
</highlighting>
|
||||
<extensionMap>
|
||||
<mapping ext="p8" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user