1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added missing fragments. Working on scroller.

This commit is contained in:
jespergravgaard 2020-07-14 20:14:57 +02:00
parent ed84cda8ea
commit f82800dd67
16 changed files with 11403 additions and 1290 deletions

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 1573535dae
//KICKC FRAGMENT CACHE 1533d6e417
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
ldy #1
lda ({z2}),y
cmp #$80
ror
sta {m1}+1
dey
lda ({z2}),y
ror
sta {m1}
lda {m1}+1
cmp #$80
ror {m1}+1
ror {m1}

View File

@ -0,0 +1,15 @@
ldy #0
lda ({z1}),y
pha
iny
lda ({z1}),y
cmp #$80
ror
sta {z1}+1
pla
ror
sta {z1}
lda {z1}+1
cmp #$80
ror {z1}+1
ror {z1}

View File

@ -0,0 +1,11 @@
pha
clc
adc #<{c1}
sta {m1}
pla
ora #$7f
bmi !+
lda #0
!:
adc #>{c1}
sta {m1}+1

View File

@ -0,0 +1,11 @@
lda {m2}
clc
adc #<{c1}
sta {m1}
lda {m2}
ora #$7f
bmi !+
lda #0
!:
adc #>{c1}
sta {m1}+1

View File

@ -189,6 +189,11 @@ public class TestPrograms {
@Test
public void testPolygon() throws IOException, URISyntaxException {
compileAndCompare("complex/xy-scroller/xy-scroller.c");
}
@Test
public void testXyScroller() throws IOException, URISyntaxException {
compileAndCompare("complex/polygon/polygon.c");
}

View File

@ -0,0 +1,20 @@
GIMP Palette
Name: C64 Palette
Columns: 0
# https://www.c64-wiki.com/wiki/Color
0 0 0 Untitled
255 255 255 Untitled
136 0 0 Untitled
170 255 238 Untitled
204 68 204 Untitled
0 204 85 Untitled
0 0 170 Untitled
238 238 119 Untitled
221 136 85 Untitled
102 68 0 Untitled
255 119 119 Untitled
51 51 51 Untitled
119 119 119 Untitled
170 255 102 Untitled
0 136 255 Untitled
187 187 187 Untitled

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

View File

@ -1,20 +1,13 @@
// A full-screen x/y-scroller
// The main screen is double-buffered with a shared charset. Most of the screen is expected to be empty (filled with char 0)
// While scrolling through the pixels on one screen the second screen is prepared. When needed a swap is made.
// At any time an object is being scrolled onto the screen. The object is fetched from an 8x8 char buffer.
//
// The scroll director orchestrates the movement of the main screen, rendering on the second screen from the buffer and the rendering of graphics in the buffer.
// In practice the scroll director calculates a number of frames ahead to identify the operations needed on each frame. It calculates ahead until it encounters the next "new buffer needed".
// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767]
#include <c64.h>
#include <string.h>
#include <conio.h>
#include <stdio.h>
// Dispaly screen #1 (double buffered)
char * const MAIN_SCREEN1 = 0x0400;
// Display screen #2 (double buffered)
char * const MAIN_SCREEN2 = 0x3800;
// Display screen #0 (double buffered)
char * const MAIN_SCREEN0 = 0x3800;
// Display screen #1 (double buffered)
char * const MAIN_SCREEN1 = 0x3c00;
// Display charset
char * const MAIN_CHARSET = 0x1000;
@ -27,37 +20,187 @@ char RENDER_BUFFER[8*8] =
"********"
" ****** "
" ****** "
" ** "z
;
" ** "z;
// The number of sinus values in the table
const unsigned int SINSIZE = 2048;
// Sinus table [-399,399]
signed int SINTAB[SINSIZE] = kickasm(uses SINSIZE) {{
.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE)
}};
// 140x125 PETSCII art
export __address(0x4000) char PETSCII_ART[140*125] = kickasm(resource "cml.png") {{
.var petsciiPic = LoadPicture("cml.png")
.print "width: "+petsciiPic.width + " height: "+petsciiPic.height
.for (var y=0; y<petsciiPic.height; y++)
.for (var x=0; x<petsciiPic.width; x++)
.byte petsciiPic.getPixel(x,y)==0?' ':$a0;
}};
// Current index into the sinus
unsigned int x_sin_idx = 0;
unsigned int y_sin_idx = SINSIZE/4;
// Current x/y-position (the center of the screen)
signed int x_pos;
signed int y_pos;
// The current scroll fine values [0-7] (converted to unsigned)
unsigned char x_pos_fine;
unsigned char y_pos_fine;
// The current scroll coarse values (converted to unsigned)
unsigned int x_pos_coarse;
unsigned int y_pos_coarse;
// The current screen displayed (0/1)
char screen = 0;
void main() {
VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET);
memset(MAIN_SCREEN1, ' ', 1000);
// positions to render to
char xpos=0, ypos=0;
while(xpos < 40 && ypos < 25) {
char *sc = MAIN_SCREEN1 + (unsigned int)ypos*40 + xpos;
char i=0;
for(char y=0; y<8; y++) {
for(char x=0; x<8; x++) {
char c=RENDER_BUFFER[i++];
if(c!=' ' && xpos+x<40 && ypos+y<25)
sc[x] = c;
}
sc+=40;
// Stop the kernel IRQ
sei();
// Clear screen
memset(MAIN_SCREEN0, ' ', 1000);
// Display initial screen
VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET);
// Find initial position
next_position();
for(;;) {
//VICII->BORDER_COLOR = RED;
// The old coarse values x/y-positions
unsigned int x_pos_coarse_old = x_pos_coarse;
unsigned int y_pos_coarse_old = y_pos_coarse;
// Update the position
next_position();
// Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll
// Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none)
signed char y_movement = (signed char)(y_pos_coarse_old-y_pos_coarse); // will be -1/0/1
signed char movement = 0;
if(y_movement==1) {
movement = -40;
} else if(y_movement==-1) {
movement = 40;
}
xpos+=5;
ypos+=3;
signed char x_movement = (signed char)(x_pos_coarse_old-x_pos_coarse); // will be -1/0/1
movement -= x_movement;
// If coarse scrolling is needed execute it
if(movement) {
// Move chars from active screen to hidden screen - while applying any needed movement
char * screen_active = (screen?MAIN_SCREEN1:MAIN_SCREEN0) + movement;
char * screen_hidden = screen?MAIN_SCREEN0:MAIN_SCREEN1;
screencpy(screen_hidden, screen_active);
// Update any new row if needed
if(y_movement==-1) {
// Update Bottom row
char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse+12);
char* scrn = screen_hidden+24*40;
for(char i=0;i<40;i++)
scrn[i] = petscii[i];
} else if(y_movement==1) {
// Update Top row
char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12);
char* scrn = screen_hidden;
for(char i=0;i<40;i++)
scrn[i] = petscii[i];
}
// Update any new column if needed
if(x_movement==-1) {
// Update Right column
char* petscii = petscii_ptr(x_pos_coarse+19, y_pos_coarse-12);
char* scrn = screen_hidden+39;
for(char i=0;i<25;i++) {
*scrn = *petscii;
scrn += 40;
petscii += 140;
}
} else if(x_movement==1) {
// Update Left column
char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12);
char* scrn = screen_hidden;
for(char i=0;i<25;i++) {
*scrn = *petscii;
scrn += 40;
petscii += 140;
}
}
// Change current screen
screen ^=1;
}
//VICII->BORDER_COLOR = BLACK;
// Update the display - wait for the raster
while(VICII->RASTER!=0xfe) ;
while(VICII->RASTER!=0xff) ;
VICII->BORDER_COLOR = WHITE;
// Y-scroll fine
VICII->CONTROL1 = VICII->CONTROL1 & 0xf0 | (7-y_pos_fine);
// X-scroll fine
VICII->CONTROL2 = VICII->CONTROL2 & 0xf0 | (7-x_pos_fine);
// Display current screen
if(screen) {
VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET);
} else {
VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET);
}
VICII->BORDER_COLOR = BLACK;
}
// count the number of chars
unsigned int count = 0;
for(char *sc = MAIN_SCREEN1;sc<MAIN_SCREEN1+1000;sc++)
if(*sc!=' ') count++;
gotoxy(0,0);
printf("%u",count);
}
// Get a pointer to a specific x,y-position in the PETSCII art
char* petscii_ptr(unsigned int row_x, unsigned int row_y) {
return PETSCII_ART + row_y * 140 + row_x;
}
// Copy an entire screen (40x25 = 1000 chars)
// - dst - destination
// - src - source
void screencpy( char* dst, char* src) {
char* src_250 = src+250;
char* dst_250 = dst+250;
char* src_500 = src+500;
char* dst_500 = dst+500;
char* src_750 = src+750;
char* dst_750 = dst+750;
for( char i=0;i<250;i++) {
dst[i] = src[i];
dst_250[i] = src_250[i];
dst_500[i] = src_500[i];
dst_750[i] = src_750[i];
}
}
inline void sei() {
asm { sei }
}
inline void breakpoint() {
kickasm {{ .break }}
}
// Update the x_pos, y_pos variables to reflect the next position on the curve
// The position represents the center of the screen
void next_position() {
// Move forward along the curve
x_sin_idx++; if(x_sin_idx>=SINSIZE) x_sin_idx-=SINSIZE;
y_sin_idx++; if(y_sin_idx>=SINSIZE) y_sin_idx-=SINSIZE;
// Find the next point
x_pos = SINTAB[x_sin_idx];
y_pos = SINTAB[y_sin_idx];
// Find the unsigned fine/coarse scroll values
unsigned int x_pos_u = (unsigned int)x_pos + 400 + 20*8;
x_pos_fine = (unsigned char)x_pos_u & 7;
x_pos_coarse = x_pos_u/8;
unsigned int y_pos_u = (unsigned int)y_pos + 400 + 12*8;
y_pos_fine = (unsigned char)y_pos_u & 7;
y_pos_coarse = y_pos_u/8;
}

View File

@ -0,0 +1,797 @@
// A full-screen x/y-scroller
// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767]
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// The colors of the C64
.const BLACK = 0
.const WHITE = 1
// The number of sinus values in the table
.const SINSIZE = $800
.const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Display screen #0 (double buffered)
.label MAIN_SCREEN0 = $3800
// Display screen #1 (double buffered)
.label MAIN_SCREEN1 = $3c00
// Display charset
.label MAIN_CHARSET = $1000
// The current screen displayed (0/1)
.label screen = 2
// Current index into the sinus
.label x_sin_idx = 9
.label y_sin_idx = $b
// Current x/y-position (the center of the screen)
.label x_pos = $16
.label y_pos = $18
// The current scroll fine values [0-7] (converted to unsigned)
.label x_pos_fine = $1a
// The current scroll coarse values (converted to unsigned)
.label x_pos_coarse = $16
.label y_pos_fine = $1b
.label y_pos_coarse = $18
main: {
.const toD0181_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f
.const toD0182_return = (>(MAIN_SCREEN1&$3fff)*4)|(>MAIN_CHARSET)/4&$f
.const toD0183_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f
.label __5 = $f
.label __9 = $d
.label __13 = 3
.label __45 = $13
.label __48 = $1b
.label x_pos_coarse_old = $d
.label y_pos_coarse_old = $f
.label y_movement = $11
.label x_movement = $12
.label screen_active = 3
.label screen_hidden = 7
.label petscii1 = 5
.label scrn1 = $14
.label petscii = 5
.label petscii3 = 5
.label scrn3 = 7
.label petscii2 = 5
.label scrn2 = 7
// asm
sei
// memset(MAIN_SCREEN0, ' ', 1000)
// Clear screen
jsr memset
// VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET)
// Display initial screen
lda #toD0181_return
sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY
// next_position()
// Find initial position
lda #<SINSIZE/4
sta.z y_sin_idx
lda #>SINSIZE/4
sta.z y_sin_idx+1
lda #<0
sta.z x_sin_idx
sta.z x_sin_idx+1
jsr next_position
lda #0
sta.z screen
__b1:
// x_pos_coarse_old = x_pos_coarse
// The old coarse values x/y-positions
lda.z x_pos_coarse
sta.z x_pos_coarse_old
lda.z x_pos_coarse+1
sta.z x_pos_coarse_old+1
// y_pos_coarse_old = y_pos_coarse
lda.z y_pos_coarse
sta.z y_pos_coarse_old
lda.z y_pos_coarse+1
sta.z y_pos_coarse_old+1
// next_position()
// Update the position
jsr next_position
// y_pos_coarse_old-y_pos_coarse
lda.z __5
sec
sbc.z y_pos_coarse
sta.z __5
lda.z __5+1
sbc.z y_pos_coarse+1
sta.z __5+1
// y_movement = (signed char)(y_pos_coarse_old-y_pos_coarse)
// Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll
// Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none)
lda.z __5
sta.z y_movement
// if(y_movement==1)
lda #1
cmp.z y_movement
beq __b20
// if(y_movement==-1)
lda #-1
cmp.z y_movement
bne __b19
ldx #$28
jmp __b2
__b19:
ldx #0
jmp __b2
__b20:
ldx #-$28
__b2:
// x_pos_coarse_old-x_pos_coarse
lda.z __9
sec
sbc.z x_pos_coarse
sta.z __9
lda.z __9+1
sbc.z x_pos_coarse+1
sta.z __9+1
// x_movement = (signed char)(x_pos_coarse_old-x_pos_coarse)
lda.z __9
sta.z x_movement
// movement -= x_movement
// will be -1/0/1
txa
sec
sbc.z x_movement
tax
// if(movement)
cpx #0
bne !__b21+
jmp __b21
!__b21:
// screen?MAIN_SCREEN1:MAIN_SCREEN0
lda #0
cmp.z screen
bne __b3
lda #<MAIN_SCREEN0
sta.z __13
lda #>MAIN_SCREEN0
sta.z __13+1
jmp __b4
__b3:
// screen?MAIN_SCREEN1:MAIN_SCREEN0
lda #<MAIN_SCREEN1
sta.z __13
lda #>MAIN_SCREEN1
sta.z __13+1
__b4:
// screen_active = (screen?MAIN_SCREEN1:MAIN_SCREEN0) + movement
txa
pha
clc
adc.z screen_active
sta.z screen_active
pla
ora #$7f
bmi !+
lda #0
!:
adc.z screen_active+1
sta.z screen_active+1
// screen?MAIN_SCREEN0:MAIN_SCREEN1
lda #0
cmp.z screen
bne __b5
lda #<MAIN_SCREEN1
sta.z screen_hidden
lda #>MAIN_SCREEN1
sta.z screen_hidden+1
jmp __b6
__b5:
// screen?MAIN_SCREEN0:MAIN_SCREEN1
lda #<MAIN_SCREEN0
sta.z screen_hidden
lda #>MAIN_SCREEN0
sta.z screen_hidden+1
__b6:
// screencpy(screen_hidden, screen_active)
jsr screencpy
// if(y_movement==-1)
// Update any new row if needed
lda #-1
cmp.z y_movement
bne !__b7+
jmp __b7
!__b7:
// if(y_movement==1)
lda #1
cmp.z y_movement
bne __b10
// petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
sec
lda.z x_pos_coarse
sbc #$14
sta.z petscii_ptr.row_x
lda.z x_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_x+1
sec
lda.z y_pos_coarse
sbc #$c
sta.z petscii_ptr.row_y
lda.z y_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_y+1
jsr petscii_ptr
// petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
// petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
ldy #0
__b8:
// for(char i=0;i<40;i++)
cpy #$28
bcs !__b9+
jmp __b9
!__b9:
__b10:
// if(x_movement==-1)
// Update any new column if needed
lda #-1
cmp.z x_movement
bne !__b13+
jmp __b13
!__b13:
// if(x_movement==1)
lda #1
cmp.z x_movement
bne __b16
// petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
sec
lda.z x_pos_coarse
sbc #$14
sta.z petscii_ptr.row_x
lda.z x_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_x+1
sec
lda.z y_pos_coarse
sbc #$c
sta.z petscii_ptr.row_y
lda.z y_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_y+1
jsr petscii_ptr
// petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
// petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12)
ldx #0
__b14:
// for(char i=0;i<25;i++)
cpx #$19
bcc __b15
__b16:
// screen ^=1
// Change current screen
lda #1
eor.z screen
sta.z screen
__b21:
// Update the display - wait for the raster
// while(VICII->RASTER!=0xfe)
lda #$fe
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b21
__b24:
// while(VICII->RASTER!=0xff)
lda #$ff
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b24
// VICII->BORDER_COLOR = WHITE
lda #WHITE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->CONTROL1 & 0xf0
lda #$f0
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta.z __45
// 7-y_pos_fine
lda #7
sec
sbc.z y_pos_fine
// VICII->CONTROL1 & 0xf0 | (7-y_pos_fine)
ora.z __45
// VICII->CONTROL1 = VICII->CONTROL1 & 0xf0 | (7-y_pos_fine)
// Y-scroll fine
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->CONTROL2 & 0xf0
lda #$f0
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
sta.z __48
// 7-x_pos_fine
lda #7
sec
sbc.z x_pos_fine
// VICII->CONTROL2 & 0xf0 | (7-x_pos_fine)
ora.z __48
// VICII->CONTROL2 = VICII->CONTROL2 & 0xf0 | (7-x_pos_fine)
// X-scroll fine
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// if(screen)
// Display current screen
lda #0
cmp.z screen
bne __b32
// VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET)
lda #toD0183_return
sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY
__b26:
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
__b32:
// VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET)
lda #toD0182_return
sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY
jmp __b26
__b15:
// *scrn = *petscii
ldy #0
lda (petscii2),y
sta (scrn2),y
// scrn += 40
lda #$28
clc
adc.z scrn2
sta.z scrn2
bcc !+
inc.z scrn2+1
!:
// petscii += 140
lda #$8c
clc
adc.z petscii2
sta.z petscii2
bcc !+
inc.z petscii2+1
!:
// for(char i=0;i<25;i++)
inx
jmp __b14
__b13:
// petscii_ptr(x_pos_coarse+19, y_pos_coarse-12)
lda #$13
clc
adc.z x_pos_coarse
sta.z petscii_ptr.row_x
lda #0
adc.z x_pos_coarse+1
sta.z petscii_ptr.row_x+1
sec
lda.z y_pos_coarse
sbc #$c
sta.z petscii_ptr.row_y
lda.z y_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_y+1
jsr petscii_ptr
// petscii_ptr(x_pos_coarse+19, y_pos_coarse-12)
// petscii = petscii_ptr(x_pos_coarse+19, y_pos_coarse-12)
// scrn = screen_hidden+39
lda #$27
clc
adc.z scrn3
sta.z scrn3
bcc !+
inc.z scrn3+1
!:
ldx #0
__b17:
// for(char i=0;i<25;i++)
cpx #$19
bcc __b18
jmp __b16
__b18:
// *scrn = *petscii
ldy #0
lda (petscii3),y
sta (scrn3),y
// scrn += 40
lda #$28
clc
adc.z scrn3
sta.z scrn3
bcc !+
inc.z scrn3+1
!:
// petscii += 140
lda #$8c
clc
adc.z petscii3
sta.z petscii3
bcc !+
inc.z petscii3+1
!:
// for(char i=0;i<25;i++)
inx
jmp __b17
__b9:
// scrn[i] = petscii[i]
lda (petscii),y
sta (screen_hidden),y
// for(char i=0;i<40;i++)
iny
jmp __b8
__b7:
// petscii_ptr(x_pos_coarse-20, y_pos_coarse+12)
sec
lda.z x_pos_coarse
sbc #$14
sta.z petscii_ptr.row_x
lda.z x_pos_coarse+1
sbc #0
sta.z petscii_ptr.row_x+1
lda #$c
clc
adc.z y_pos_coarse
sta.z petscii_ptr.row_y
lda #0
adc.z y_pos_coarse+1
sta.z petscii_ptr.row_y+1
jsr petscii_ptr
// petscii_ptr(x_pos_coarse-20, y_pos_coarse+12)
// petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse+12)
// scrn = screen_hidden+24*40
lda.z screen_hidden
clc
adc #<$18*$28
sta.z scrn1
lda.z screen_hidden+1
adc #>$18*$28
sta.z scrn1+1
ldy #0
__b11:
// for(char i=0;i<40;i++)
cpy #$28
bcc __b12
jmp __b10
__b12:
// scrn[i] = petscii[i]
lda (petscii1),y
sta (scrn1),y
// for(char i=0;i<40;i++)
iny
jmp __b11
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
memset: {
.const c = ' '
.const num = $3e8
.label str = MAIN_SCREEN0
.label end = str+num
.label dst = 9
lda #<str
sta.z dst
lda #>str
sta.z dst+1
__b1:
// for(char* dst = str; dst!=end; dst++)
lda.z dst+1
cmp #>end
bne __b2
lda.z dst
cmp #<end
bne __b2
// }
rts
__b2:
// *dst = c
lda #c
ldy #0
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
inc.z dst
bne !+
inc.z dst+1
!:
jmp __b1
}
// Update the x_pos, y_pos variables to reflect the next position on the curve
// The position represents the center of the screen
next_position: {
.label __4 = $16
.label __8 = $18
.label __12 = $16
.label __13 = $18
.label x_pos_u = $16
.label y_pos_u = $18
.label __18 = $16
.label __19 = $18
// x_sin_idx++;
inc.z x_sin_idx
bne !+
inc.z x_sin_idx+1
!:
// if(x_sin_idx>=SINSIZE)
lda.z x_sin_idx+1
cmp #>SINSIZE
bcc __b1
bne !+
lda.z x_sin_idx
cmp #<SINSIZE
bcc __b1
!:
// x_sin_idx-=SINSIZE
lda.z x_sin_idx
sec
sbc #<SINSIZE
sta.z x_sin_idx
lda.z x_sin_idx+1
sbc #>SINSIZE
sta.z x_sin_idx+1
__b1:
// y_sin_idx++;
inc.z y_sin_idx
bne !+
inc.z y_sin_idx+1
!:
// if(y_sin_idx>=SINSIZE)
lda.z y_sin_idx+1
cmp #>SINSIZE
bcc __b2
bne !+
lda.z y_sin_idx
cmp #<SINSIZE
bcc __b2
!:
// y_sin_idx-=SINSIZE
lda.z y_sin_idx
sec
sbc #<SINSIZE
sta.z y_sin_idx
lda.z y_sin_idx+1
sbc #>SINSIZE
sta.z y_sin_idx+1
__b2:
// x_pos = SINTAB[x_sin_idx]
lda.z x_sin_idx
asl
sta.z __12
lda.z x_sin_idx+1
rol
sta.z __12+1
clc
lda.z __18
adc #<SINTAB
sta.z __18
lda.z __18+1
adc #>SINTAB
sta.z __18+1
// Find the next point
ldy #0
lda (x_pos),y
pha
iny
lda (x_pos),y
sta.z x_pos+1
pla
sta.z x_pos
// y_pos = SINTAB[y_sin_idx]
lda.z y_sin_idx
asl
sta.z __13
lda.z y_sin_idx+1
rol
sta.z __13+1
clc
lda.z __19
adc #<SINTAB
sta.z __19
lda.z __19+1
adc #>SINTAB
sta.z __19+1
ldy #0
lda (y_pos),y
pha
iny
lda (y_pos),y
sta.z y_pos+1
pla
sta.z y_pos
// (unsigned int)x_pos + 400
// x_pos_u = (unsigned int)x_pos + 400 + 20*8
clc
lda.z x_pos_u
adc #<$190+$14*8
sta.z x_pos_u
lda.z x_pos_u+1
adc #>$190+$14*8
sta.z x_pos_u+1
// (unsigned char)x_pos_u & 7
lda.z x_pos_u
and #7
sta.z x_pos_fine
// x_pos_u/8
lsr.z x_pos_coarse+1
ror.z x_pos_coarse
lsr.z x_pos_coarse+1
ror.z x_pos_coarse
lsr.z x_pos_coarse+1
ror.z x_pos_coarse
// (unsigned int)y_pos + 400
// y_pos_u = (unsigned int)y_pos + 400 + 12*8
clc
lda.z y_pos_u
adc #<$190+$c*8
sta.z y_pos_u
lda.z y_pos_u+1
adc #>$190+$c*8
sta.z y_pos_u+1
// (unsigned char)y_pos_u & 7
lda.z y_pos_u
and #7
sta.z y_pos_fine
// y_pos_u/8
lsr.z y_pos_coarse+1
ror.z y_pos_coarse
lsr.z y_pos_coarse+1
ror.z y_pos_coarse
lsr.z y_pos_coarse+1
ror.z y_pos_coarse
// }
rts
}
// Copy an entire screen (40x25 = 1000 chars)
// - dst - destination
// - src - source
// screencpy(byte* zp(7) dst, byte* zp(3) src)
screencpy: {
.label dst = 7
.label src = 3
.label src_250 = $26
.label dst_250 = $1c
.label src_500 = $1e
.label dst_500 = $20
.label src_750 = $22
.label dst_750 = $24
// src_250 = src+250
lda #$fa
clc
adc.z src
sta.z src_250
lda #0
adc.z src+1
sta.z src_250+1
// dst_250 = dst+250
lda #$fa
clc
adc.z dst
sta.z dst_250
lda #0
adc.z dst+1
sta.z dst_250+1
// src_500 = src+500
lda.z src
clc
adc #<$1f4
sta.z src_500
lda.z src+1
adc #>$1f4
sta.z src_500+1
// dst_500 = dst+500
lda.z dst
clc
adc #<$1f4
sta.z dst_500
lda.z dst+1
adc #>$1f4
sta.z dst_500+1
// src_750 = src+750
lda.z src
clc
adc #<$2ee
sta.z src_750
lda.z src+1
adc #>$2ee
sta.z src_750+1
// dst_750 = dst+750
lda.z dst
clc
adc #<$2ee
sta.z dst_750
lda.z dst+1
adc #>$2ee
sta.z dst_750+1
ldy #0
__b1:
// for( char i=0;i<250;i++)
cpy #$fa
bcc __b2
// }
rts
__b2:
// dst[i] = src[i]
lda (src),y
sta (dst),y
// dst_250[i] = src_250[i]
lda (src_250),y
sta (dst_250),y
// dst_500[i] = src_500[i]
lda (src_500),y
sta (dst_500),y
// dst_750[i] = src_750[i]
lda (src_750),y
sta (dst_750),y
// for( char i=0;i<250;i++)
iny
jmp __b1
}
// Get a pointer to a specific x,y-position in the PETSCII art
// petscii_ptr(word zp(5) row_x, word zp($d) row_y)
petscii_ptr: {
.label __0 = $d
.label __1 = $d
.label row_x = 5
.label row_y = $d
.label return = 5
.label __3 = $26
.label __4 = $26
.label __5 = $26
.label __6 = $d
// row_y * 140
lda.z row_y
asl
sta.z __3
lda.z row_y+1
rol
sta.z __3+1
asl.z __3
rol.z __3+1
asl.z __3
rol.z __3+1
asl.z __3
rol.z __3+1
lda.z __4
clc
adc.z row_y
sta.z __4
lda.z __4+1
adc.z row_y+1
sta.z __4+1
asl.z __5
rol.z __5+1
lda.z __6
clc
adc.z __5
sta.z __6
lda.z __6+1
adc.z __5+1
sta.z __6+1
asl.z __0
rol.z __0+1
asl.z __0
rol.z __0+1
// PETSCII_ART + row_y * 140
clc
lda.z __1
adc #<PETSCII_ART
sta.z __1
lda.z __1+1
adc #>PETSCII_ART
sta.z __1+1
// PETSCII_ART + row_y * 140 + row_x
lda.z return
clc
adc.z __1
sta.z return
lda.z return+1
adc.z __1+1
sta.z return+1
// }
rts
}
// Sinus table [-399,399]
SINTAB:
.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE)
.pc = $4000 "PETSCII_ART"
// 140x125 PETSCII art
PETSCII_ART:
.var petsciiPic = LoadPicture("cml.png")
.print "width: "+petsciiPic.width + " height: "+petsciiPic.height
.for (var y=0; y<petsciiPic.height; y++)
.for (var x=0; x<petsciiPic.width; x++)
.byte petsciiPic.getPixel(x,y)==0?' ':$a0;

View File

@ -0,0 +1,287 @@
(void()) main()
main: scope:[main] from
[0] phi()
to:main::sei1
main::sei1: scope:[main] from main
asm { sei }
to:main::@30
main::@30: scope:[main] from main::sei1
[2] phi()
[3] call memset
to:main::toD0181
main::toD0181: scope:[main] from main::@30
[4] phi()
to:main::@31
main::@31: scope:[main] from main::toD0181
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0
[6] call next_position
to:main::@1
main::@1: scope:[main] from main::@26 main::@31
[7] (byte) screen#12 ← phi( main::@26/(byte) screen#28 main::@31/(byte) 0 )
[8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17
[9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16
[10] call next_position
to:main::@34
main::@34: scope:[main] from main::@1
[11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16
[12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5
[13] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2
to:main::@27
main::@27: scope:[main] from main::@34
[14] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@2
to:main::@28
main::@28: scope:[main] from main::@27
[15] phi()
to:main::@2
main::@2: scope:[main] from main::@27 main::@28 main::@34
[16] (signed byte) main::movement#4 ← phi( main::@34/(signed byte) -$28 main::@27/(signed byte) 0 main::@28/(signed byte) $28 )
[17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17
[18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9
[19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0
[20] if((signed byte) 0==(signed byte) main::movement#3) goto main::@23
to:main::@29
main::@29: scope:[main] from main::@2
[21] if((byte) 0!=(byte) screen#12) goto main::@3
to:main::@4
main::@3: scope:[main] from main::@29
[22] phi()
to:main::@4
main::@4: scope:[main] from main::@29 main::@3
[23] (byte*~) main::$13 ← phi( main::@3/(const nomodify byte*) MAIN_SCREEN1 main::@29/(const nomodify byte*) MAIN_SCREEN0 )
[24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3
[25] if((byte) 0!=(byte) screen#12) goto main::@5
to:main::@6
main::@5: scope:[main] from main::@4
[26] phi()
to:main::@6
main::@6: scope:[main] from main::@4 main::@5
[27] (byte*) main::screen_hidden#0 ← phi( main::@5/(const nomodify byte*) MAIN_SCREEN0 main::@4/(const nomodify byte*) MAIN_SCREEN1 )
[28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0
[29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0
[30] call screencpy
to:main::@35
main::@35: scope:[main] from main::@6
[31] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@7
to:main::@19
main::@19: scope:[main] from main::@35
[32] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@10
to:main::@20
main::@20: scope:[main] from main::@19
[33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14
[34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c
[35] call petscii_ptr
[36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10
to:main::@37
main::@37: scope:[main] from main::@20
[37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1
to:main::@8
main::@8: scope:[main] from main::@37 main::@9
[38] (byte) main::i#2 ← phi( main::@9/(byte) main::i#1 main::@37/(byte) 0 )
[39] if((byte) main::i#2<(byte) $28) goto main::@9
to:main::@10
main::@10: scope:[main] from main::@11 main::@19 main::@8
[40] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@13
to:main::@21
main::@21: scope:[main] from main::@10
[41] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@16
to:main::@22
main::@22: scope:[main] from main::@21
[42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14
[43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c
[44] call petscii_ptr
[45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10
to:main::@39
main::@39: scope:[main] from main::@22
[46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3
to:main::@14
main::@14: scope:[main] from main::@15 main::@39
[47] (byte*) main::scrn2#2 ← phi( main::@15/(byte*) main::scrn2#1 main::@39/(byte*) main::screen_hidden#0 )
[47] (byte*) main::petscii2#2 ← phi( main::@15/(byte*) main::petscii2#1 main::@39/(byte*) main::petscii2#0 )
[47] (byte) main::i2#2 ← phi( main::@15/(byte) main::i2#1 main::@39/(byte) 0 )
[48] if((byte) main::i2#2<(byte) $19) goto main::@15
to:main::@16
main::@16: scope:[main] from main::@14 main::@17 main::@21
[49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1
to:main::@23
main::@23: scope:[main] from main::@16 main::@2 main::@23
[50] (byte) screen#28 ← phi( main::@16/(byte) screen#0 main::@23/(byte) screen#28 main::@2/(byte) screen#12 )
[51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23
to:main::@24
main::@24: scope:[main] from main::@23 main::@24
[52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24
to:main::@25
main::@25: scope:[main] from main::@24
[53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0
[55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12
[56] (byte~) main::$47 ← (byte~) main::$45 | (byte~) main::$46
[57] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (byte~) main::$47
[58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0
[59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12
[60] (byte~) main::$50 ← (byte~) main::$48 | (byte~) main::$49
[61] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte~) main::$50
[62] if((byte) 0!=(byte) screen#28) goto main::toD0182
to:main::toD0183
main::toD0183: scope:[main] from main::@25
[63] phi()
to:main::@33
main::@33: scope:[main] from main::toD0183
[64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0
to:main::@26
main::@26: scope:[main] from main::@32 main::@33
[65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:main::@1
main::toD0182: scope:[main] from main::@25
[66] phi()
to:main::@32
main::@32: scope:[main] from main::toD0182
[67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0
to:main::@26
main::@15: scope:[main] from main::@14
[68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2)
[69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28
[70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c
[71] (byte) main::i2#1 ← ++ (byte) main::i2#2
to:main::@14
main::@13: scope:[main] from main::@10
[72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13
[73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c
[74] call petscii_ptr
[75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10
to:main::@38
main::@38: scope:[main] from main::@13
[76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2
[77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27
to:main::@17
main::@17: scope:[main] from main::@18 main::@38
[78] (byte*) main::scrn3#2 ← phi( main::@18/(byte*) main::scrn3#1 main::@38/(byte*) main::scrn3#0 )
[78] (byte*) main::petscii3#2 ← phi( main::@18/(byte*) main::petscii3#1 main::@38/(byte*) main::petscii3#0 )
[78] (byte) main::i3#2 ← phi( main::@18/(byte) main::i3#1 main::@38/(byte) 0 )
[79] if((byte) main::i3#2<(byte) $19) goto main::@18
to:main::@16
main::@18: scope:[main] from main::@17
[80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2)
[81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28
[82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c
[83] (byte) main::i3#1 ← ++ (byte) main::i3#2
to:main::@17
main::@9: scope:[main] from main::@8
[84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2)
[85] (byte) main::i#1 ← ++ (byte) main::i#2
to:main::@8
main::@7: scope:[main] from main::@35
[86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14
[87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c
[88] call petscii_ptr
[89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10
to:main::@36
main::@36: scope:[main] from main::@7
[90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0
[91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28
to:main::@11
main::@11: scope:[main] from main::@12 main::@36
[92] (byte) main::i1#2 ← phi( main::@12/(byte) main::i1#1 main::@36/(byte) 0 )
[93] if((byte) main::i1#2<(byte) $28) goto main::@12
to:main::@10
main::@12: scope:[main] from main::@11
[94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2)
[95] (byte) main::i1#1 ← ++ (byte) main::i1#2
to:main::@11
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
memset: scope:[memset] from main::@30
[96] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@2
[97] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
[98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[99] return
to:@return
memset::@2: scope:[memset] from memset::@1
[100] *((byte*) memset::dst#2) ← (const byte) memset::c#0
[101] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
to:memset::@1
(void()) next_position()
next_position: scope:[next_position] from main::@1 main::@31
[102] (word) y_sin_idx#12 ← phi( main::@1/(word) y_sin_idx#13 main::@31/(const nomodify word) SINSIZE/(byte) 4 )
[102] (word) x_sin_idx#12 ← phi( main::@1/(word) x_sin_idx#14 main::@31/(word) 0 )
[103] (word) x_sin_idx#13 ← ++ (word) x_sin_idx#12
[104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1
to:next_position::@3
next_position::@3: scope:[next_position] from next_position
[105] (word) x_sin_idx#4 ← (word) x_sin_idx#13 - (const nomodify word) SINSIZE
to:next_position::@1
next_position::@1: scope:[next_position] from next_position next_position::@3
[106] (word) x_sin_idx#14 ← phi( next_position/(word) x_sin_idx#13 next_position::@3/(word) x_sin_idx#4 )
[107] (word) y_sin_idx#14 ← ++ (word) y_sin_idx#12
[108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2
to:next_position::@4
next_position::@4: scope:[next_position] from next_position::@1
[109] (word) y_sin_idx#4 ← (word) y_sin_idx#14 - (const nomodify word) SINSIZE
to:next_position::@2
next_position::@2: scope:[next_position] from next_position::@1 next_position::@4
[110] (word) y_sin_idx#13 ← phi( next_position::@1/(word) y_sin_idx#14 next_position::@4/(word) y_sin_idx#4 )
[111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1
[112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12
[113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18)
[114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1
[115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13
[116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19)
[117] (word~) next_position::$4 ← (word)(signed word) x_pos#11
[118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8
[119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0
[120] (byte) x_pos_fine#12 ← (byte~) next_position::$15 & (byte) 7
[121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3
[122] (word~) next_position::$8 ← (word)(signed word) y_pos#11
[123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8
[124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0
[125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7
[126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3
to:next_position::@return
next_position::@return: scope:[next_position] from next_position::@2
[127] return
to:@return
(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src)
screencpy: scope:[screencpy] from main::@6
[128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa
[129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa
[130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4
[131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4
[132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee
[133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee
to:screencpy::@1
screencpy::@1: scope:[screencpy] from screencpy screencpy::@2
[134] (byte) screencpy::i#2 ← phi( screencpy/(byte) 0 screencpy::@2/(byte) screencpy::i#1 )
[135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2
to:screencpy::@return
screencpy::@return: scope:[screencpy] from screencpy::@1
[136] return
to:@return
screencpy::@2: scope:[screencpy] from screencpy::@1
[137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2)
[138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2)
[139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2)
[140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2)
[141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2
to:screencpy::@1
(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y)
petscii_ptr: scope:[petscii_ptr] from main::@13 main::@20 main::@22 main::@7
[142] (word) petscii_ptr::row_x#4 ← phi( main::@7/(word) petscii_ptr::row_x#0 main::@13/(word) petscii_ptr::row_x#2 main::@20/(word) petscii_ptr::row_x#1 main::@22/(word) petscii_ptr::row_x#3 )
[142] (word) petscii_ptr::row_y#4 ← phi( main::@7/(word) petscii_ptr::row_y#0 main::@13/(word) petscii_ptr::row_y#2 main::@20/(word) petscii_ptr::row_y#1 main::@22/(word) petscii_ptr::row_y#3 )
[143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4
[144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4
[145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1
[146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4
[147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2
[148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0
[149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4
to:petscii_ptr::@return
petscii_ptr::@return: scope:[petscii_ptr] from petscii_ptr
[150] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,363 @@
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) MAIN_CHARSET = (byte*) 4096
(const nomodify byte*) MAIN_SCREEN0 = (byte*) 14336
(const nomodify byte*) MAIN_SCREEN1 = (byte*) 15360
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY = (byte) $18
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte*) PETSCII_ART[(number) $8c*(number) $7d] = kickasm {{ .var petsciiPic = LoadPicture("cml.png")
.print "width: "+petsciiPic.width + " height: "+petsciiPic.height
.for (var y=0; y<petsciiPic.height; y++)
.for (var x=0; x<petsciiPic.width; x++)
.byte petsciiPic.getPixel(x,y)==0?' ':$a0;
}}
(const nomodify word) SINSIZE = (word) $800
(const signed word*) SINTAB[(const nomodify word) SINSIZE] = kickasm( uses SINSIZE) {{ .fillword SINSIZE, 399*sin(i*2*PI/SINSIZE)
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) WHITE = (byte) 1
(void()) main()
(byte*~) main::$13 zp[2]:3 11.0
(byte~) main::$45 zp[1]:19 11.0
(byte~) main::$46 reg byte a 22.0
(byte~) main::$47 reg byte a 22.0
(byte~) main::$48 zp[1]:27 11.0
(byte~) main::$49 reg byte a 22.0
(word~) main::$5 zp[2]:15 11.0
(byte~) main::$50 reg byte a 22.0
(word~) main::$9 zp[2]:13 11.0
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@16
(label) main::@17
(label) main::@18
(label) main::@19
(label) main::@2
(label) main::@20
(label) main::@21
(label) main::@22
(label) main::@23
(label) main::@24
(label) main::@25
(label) main::@26
(label) main::@27
(label) main::@28
(label) main::@29
(label) main::@3
(label) main::@30
(label) main::@31
(label) main::@32
(label) main::@33
(label) main::@34
(label) main::@35
(label) main::@36
(label) main::@37
(label) main::@38
(label) main::@39
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(byte) main::i
(byte) main::i#1 reg byte y 202.0
(byte) main::i#2 reg byte y 168.33333333333331
(byte) main::i1
(byte) main::i1#1 reg byte y 202.0
(byte) main::i1#2 reg byte y 168.33333333333331
(byte) main::i2
(byte) main::i2#1 reg byte x 202.0
(byte) main::i2#2 reg byte x 60.599999999999994
(byte) main::i3
(byte) main::i3#1 reg byte x 202.0
(byte) main::i3#2 reg byte x 60.599999999999994
(signed byte) main::movement
(signed byte) main::movement#3 reg byte x 6.6000000000000005
(signed byte) main::movement#4 reg byte x 3.6666666666666665
(byte*) main::petscii
(byte*) main::petscii#0 petscii zp[2]:5 22.4
(byte*) main::petscii1
(byte*) main::petscii1#0 petscii1 zp[2]:5 18.666666666666664
(byte*) main::petscii2
(byte*) main::petscii2#0 petscii2 zp[2]:5 22.0
(byte*) main::petscii2#1 petscii2 zp[2]:5 101.0
(byte*) main::petscii2#2 petscii2 zp[2]:5 78.5
(byte*) main::petscii3
(byte*) main::petscii3#0 petscii3 zp[2]:5 11.0
(byte*) main::petscii3#1 petscii3 zp[2]:5 101.0
(byte*) main::petscii3#2 petscii3 zp[2]:5 78.5
(byte*) main::screen_active
(byte*) main::screen_active#0 screen_active zp[2]:3 4.4
(byte*) main::screen_hidden
(byte*) main::screen_hidden#0 screen_hidden zp[2]:7 3.9189189189189193
(byte*) main::scrn
(byte*) main::scrn1
(byte*) main::scrn1#0 scrn1 zp[2]:20 22.4
(byte*) main::scrn2
(byte*) main::scrn2#1 scrn2 zp[2]:7 67.33333333333333
(byte*) main::scrn2#2 scrn2 zp[2]:7 104.66666666666666
(byte*) main::scrn3
(byte*) main::scrn3#0 scrn3 zp[2]:7 22.0
(byte*) main::scrn3#1 scrn3 zp[2]:7 67.33333333333333
(byte*) main::scrn3#2 scrn3 zp[2]:7 104.66666666666666
(label) main::sei1
(label) main::toD0181
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(label) main::toD0182
(byte*) main::toD0182_gfx
(byte) main::toD0182_return
(const byte) main::toD0182_return#0 toD0182_return = >(word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f
(byte*) main::toD0182_screen
(label) main::toD0183
(byte*) main::toD0183_gfx
(byte) main::toD0183_return
(const byte) main::toD0183_return#0 toD0183_return = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f
(byte*) main::toD0183_screen
(signed byte) main::x_movement
(signed byte) main::x_movement#0 x_movement zp[1]:18 1.2571428571428571
(word) main::x_pos_coarse_old
(word) main::x_pos_coarse_old#0 x_pos_coarse_old zp[2]:13 2.4444444444444446
(signed byte) main::y_movement
(signed byte) main::y_movement#0 y_movement zp[1]:17 2.75
(word) main::y_pos_coarse_old
(word) main::y_pos_coarse_old#0 y_pos_coarse_old zp[2]:15 11.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(label) memset::@1
(label) memset::@2
(label) memset::@return
(byte) memset::c
(const byte) memset::c#0 c = (byte) ' '
(byte*) memset::dst
(byte*) memset::dst#1 dst zp[2]:9 202.0
(byte*) memset::dst#2 dst zp[2]:9 134.66666666666666
(byte*) memset::end
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
(word) memset::num
(const word) memset::num#0 num = (word) $3e8
(void*) memset::return
(void*) memset::str
(const void*) memset::str#0 str = (void*)(const nomodify byte*) MAIN_SCREEN0
(void()) next_position()
(word~) next_position::$12 zp[2]:22 202.0
(word~) next_position::$13 zp[2]:24 202.0
(byte~) next_position::$15 reg byte a 202.0
(byte~) next_position::$17 reg byte a 202.0
(signed word*~) next_position::$18 zp[2]:22 202.0
(signed word*~) next_position::$19 zp[2]:24 202.0
(word~) next_position::$4 zp[2]:22 202.0
(word~) next_position::$8 zp[2]:24 202.0
(label) next_position::@1
(label) next_position::@2
(label) next_position::@3
(label) next_position::@4
(label) next_position::@return
(word) next_position::x_pos_u
(word) next_position::x_pos_u#0 x_pos_u zp[2]:22 67.33333333333333
(word) next_position::y_pos_u
(word) next_position::y_pos_u#0 y_pos_u zp[2]:24 67.33333333333333
(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y)
(word~) petscii_ptr::$0 zp[2]:13 202.0
(byte*~) petscii_ptr::$1 zp[2]:13 202.0
(word~) petscii_ptr::$3 zp[2]:38 202.0
(word~) petscii_ptr::$4 zp[2]:38 202.0
(word~) petscii_ptr::$5 zp[2]:38 202.0
(word~) petscii_ptr::$6 zp[2]:13 202.0
(label) petscii_ptr::@return
(byte*) petscii_ptr::return
(byte*) petscii_ptr::return#0 return zp[2]:5 22.0
(byte*) petscii_ptr::return#1 return zp[2]:5 22.0
(byte*) petscii_ptr::return#10 return zp[2]:5 24.166666666666664
(byte*) petscii_ptr::return#2 return zp[2]:5 22.0
(byte*) petscii_ptr::return#3 return zp[2]:5 22.0
(word) petscii_ptr::row_x
(word) petscii_ptr::row_x#0 row_x zp[2]:5 11.0
(word) petscii_ptr::row_x#1 row_x zp[2]:5 11.0
(word) petscii_ptr::row_x#2 row_x zp[2]:5 11.0
(word) petscii_ptr::row_x#3 row_x zp[2]:5 11.0
(word) petscii_ptr::row_x#4 row_x zp[2]:5 20.714285714285715
(word) petscii_ptr::row_y
(word) petscii_ptr::row_y#0 row_y zp[2]:13 22.0
(word) petscii_ptr::row_y#1 row_y zp[2]:13 22.0
(word) petscii_ptr::row_y#2 row_y zp[2]:13 22.0
(word) petscii_ptr::row_y#3 row_y zp[2]:13 22.0
(word) petscii_ptr::row_y#4 row_y zp[2]:13 86.75
(byte) screen
(byte) screen#0 screen zp[1]:2 22.0
(byte) screen#12 screen zp[1]:2 0.7857142857142857
(byte) screen#28 screen zp[1]:2 13.666666666666666
(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src)
(label) screencpy::@1
(label) screencpy::@2
(label) screencpy::@return
(byte*) screencpy::dst
(byte*) screencpy::dst#0 dst zp[2]:7 687.6666666666666
(byte*) screencpy::dst_250
(byte*) screencpy::dst_250#0 dst_250 zp[2]:28 841.8333333333333
(byte*) screencpy::dst_500
(byte*) screencpy::dst_500#0 dst_500 zp[2]:32 1010.2
(byte*) screencpy::dst_750
(byte*) screencpy::dst_750#0 dst_750 zp[2]:36 1262.75
(byte) screencpy::i
(byte) screencpy::i#1 reg byte y 20002.0
(byte) screencpy::i#2 reg byte y 18335.166666666668
(byte*) screencpy::src
(byte*) screencpy::src#0 src zp[2]:3 736.7857142857143
(byte*) screencpy::src_250
(byte*) screencpy::src_250#0 src_250 zp[2]:38 777.076923076923
(byte*) screencpy::src_500
(byte*) screencpy::src_500#0 src_500 zp[2]:30 918.3636363636363
(byte*) screencpy::src_750
(byte*) screencpy::src_750#0 src_750 zp[2]:34 1122.4444444444443
(signed word) x_pos
(signed word) x_pos#11 x_pos zp[2]:22 25.25
(word) x_pos_coarse
(word) x_pos_coarse#17 x_pos_coarse zp[2]:22 1.7578947368421054
(byte) x_pos_fine
(byte) x_pos_fine#12 x_pos_fine zp[1]:26 1.3176470588235294
(word) x_sin_idx
(word) x_sin_idx#12 x_sin_idx zp[2]:9 112.0
(word) x_sin_idx#13 x_sin_idx zp[2]:9 202.0
(word) x_sin_idx#14 x_sin_idx zp[2]:9 2.803571428571429
(word) x_sin_idx#4 x_sin_idx zp[2]:9 202.0
(signed word) y_pos
(signed word) y_pos#11 y_pos zp[2]:24 16.833333333333332
(word) y_pos_coarse
(word) y_pos_coarse#16 y_pos_coarse zp[2]:24 1.8351648351648353
(byte) y_pos_fine
(byte) y_pos_fine#12 y_pos_fine zp[1]:27 1.473684210526316
(word) y_sin_idx
(word) y_sin_idx#12 y_sin_idx zp[2]:11 22.4
(word) y_sin_idx#13 y_sin_idx zp[2]:11 2.9074074074074074
(word) y_sin_idx#14 y_sin_idx zp[2]:11 202.0
(word) y_sin_idx#4 y_sin_idx zp[2]:11 202.0
zp[1]:2 [ screen#12 screen#28 screen#0 ]
reg byte x [ main::movement#4 ]
zp[2]:3 [ main::$13 main::screen_active#0 screencpy::src#0 ]
reg byte y [ main::i#2 main::i#1 ]
reg byte x [ main::i2#2 main::i2#1 ]
zp[2]:5 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 petscii_ptr::return#1 main::petscii#0 petscii_ptr::return#0 main::petscii1#0 ]
zp[2]:7 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 main::scrn3#2 main::scrn3#1 main::scrn3#0 screencpy::dst#0 ]
reg byte x [ main::i3#2 main::i3#1 ]
reg byte y [ main::i1#2 main::i1#1 ]
zp[2]:9 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 memset::dst#2 memset::dst#1 ]
zp[2]:11 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ]
reg byte y [ screencpy::i#2 screencpy::i#1 ]
zp[2]:13 [ main::x_pos_coarse_old#0 main::$9 petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 petscii_ptr::$0 petscii_ptr::$1 ]
zp[2]:15 [ main::y_pos_coarse_old#0 main::$5 ]
zp[1]:17 [ main::y_movement#0 ]
zp[1]:18 [ main::x_movement#0 ]
reg byte x [ main::movement#3 ]
zp[1]:19 [ main::$45 ]
reg byte a [ main::$46 ]
reg byte a [ main::$47 ]
reg byte a [ main::$49 ]
reg byte a [ main::$50 ]
zp[2]:20 [ main::scrn1#0 ]
zp[2]:22 [ next_position::$12 next_position::$18 x_pos#11 next_position::$4 next_position::x_pos_u#0 x_pos_coarse#17 ]
zp[2]:24 [ next_position::$13 next_position::$19 y_pos#11 next_position::$8 next_position::y_pos_u#0 y_pos_coarse#16 ]
reg byte a [ next_position::$15 ]
zp[1]:26 [ x_pos_fine#12 ]
reg byte a [ next_position::$17 ]
zp[1]:27 [ y_pos_fine#12 main::$48 ]
zp[2]:28 [ screencpy::dst_250#0 ]
zp[2]:30 [ screencpy::src_500#0 ]
zp[2]:32 [ screencpy::dst_500#0 ]
zp[2]:34 [ screencpy::src_750#0 ]
zp[2]:36 [ screencpy::dst_750#0 ]
zp[2]:38 [ petscii_ptr::$3 petscii_ptr::$4 petscii_ptr::$5 screencpy::src_250#0 ]