allocate even more c64 zeropage locations for floats

This commit is contained in:
Irmen de Jong 2021-03-09 21:47:36 +01:00
parent 2431ed811a
commit 6c60ea9cac
3 changed files with 10 additions and 5 deletions

View File

@ -39,8 +39,8 @@ graphics {
swap(x1, x2)
swap(y1, y2)
}
word @zp dx = x2-x1 as word
word @zp dy = y2-y1
word @zp dx = (x2-x1) as word
word @zp dy = (y2-y1) as word
if dx==0 {
vertical_line(x1, y1, abs(dy)+1 as ubyte)

View File

@ -109,6 +109,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(
0x22, 0x23, 0x24, 0x25,
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,

View File

@ -1,6 +1,8 @@
%import graphics
%target c64
%import floats
%import graphics
%import test_stack
%zeropage floatsafe
main {
sub start() {
@ -10,7 +12,9 @@ main {
uword xx
ubyte yy
graphics.line(150,50,150,50)
graphics.line(160,100,160,80)
graphics.line(160,80,180,81)
graphics.line(180,81,177,103)
for yy in 0 to 199-60 step 16 {