fixed float zp problem on C64, added more zp locations to block list

This commit is contained in:
Irmen de Jong 2020-09-22 01:05:07 +02:00
parent af39502450
commit df995f7bc9
3 changed files with 3 additions and 5 deletions

View File

@ -179,7 +179,7 @@ private fun optimizeAst(programAst: Program, errors: ErrorReporter) {
// keep optimizing expressions and statements until no more steps remain
val optsDone1 = programAst.simplifyExpressions()
val optsDone2 = programAst.optimizeStatements(errors)
programAst.constantFold(errors) // because simplified statements and expressions could give rise to more constants that can be folded away:
programAst.constantFold(errors) // because simplified statements and expressions could give rise to more constants that can be folded away
errors.handle()
if (optsDone1 + optsDone2 == 0)
break

View File

@ -147,7 +147,7 @@ internal object C64MachineDefinition: IMachineDefinition {
if (options.zeropage == ZeropageType.FLOATSAFE) {
// remove the zero page locations used for floating point operations from the free list
free.removeAll(listOf(
0x12, 0x26, 0x27, 0x28, 0x29, 0x2a,
0x10, 0x11, 0x12, 0x26, 0x27, 0x28, 0x29, 0x2a,
0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60,
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72,

View File

@ -1,9 +1,7 @@
%target c64
%import floats
%import graphics
; TODO FIX OUTPUT when Optimizer is enabled (it's ok when compiling without optimization)
%zeropage floatsafe
main {