updated tests

This commit is contained in:
jespergravgaard 2023-05-19 11:06:44 +02:00
parent 18f6923e4f
commit ce28c50d34
10 changed files with 4418 additions and 1384 deletions

View File

@ -1657,6 +1657,11 @@ public class TestProgramsFast extends TestPrograms {
*/
@Test
public void testBitmapCircleStandalone() throws IOException {
compileAndCompare("bitmap-circle-standalone.c");
}
@Test
public void testBitmapCircle2() throws IOException {
compileAndCompare("bitmap-circle-2.c");

View File

@ -0,0 +1,72 @@
// Plots a circle on a bitmap using Bresenham's Circle algorithm
// Coded by Richard-William Loerakker
// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac
byte* const SCREEN = (byte*)$400;
byte* const BITMAP = (byte*)$2000;
byte* const COLORS = (byte*)$d800;
byte bitmask[] = { 128, 64, 32, 16, 8, 4, 2, 1 };
char* const D011 = (char*)0xd011;
char* const VICII_MEMORY = (char*)0xd018;
char* const BORDER_COLOR = (char*)0xd020;
const char VICII_BMM = %00100000;
const char VICII_DEN = %00010000;
const char VICII_RSEL = %00001000;
const char BLUE = 0x6;
void main() {
fill(BITMAP,40*25*8,0);
fill(SCREEN,40*25,$16);
*BORDER_COLOR = BLUE;
*D011 = VICII_BMM|VICII_DEN|VICII_RSEL|3;
*VICII_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)BITMAP&$3fff)/$400));
circle(100,100,50);
do {} while (true);
}
void circle(int xc, int yc, int r) {
int x = 0;
int y = r;
int p = 3-(r << 1);
for(int x = 0; x <= y; x ++) {
if(p < 0) {
p = p + (x << 2) + 6;
} else {
y=y-1;
p = p + ((x-y) << 2) + 10;
}
plot(xc+x,yc-y);
plot(xc-x,yc-y);
plot(xc+x,yc+y);
plot(xc-x,yc+y);
plot(xc+y,yc-x);
plot(xc-y,yc-x);
plot(xc+y,yc+x);
plot(xc-y,yc+x);
}
}
void plot(int x, int y) {
byte* location = BITMAP;
location += x & $fff8;
location += (char)y & 7;
location += ((y >> 3) * 320);
(*location) = (*location) | bitmask[x & 7];
}
// Fill some memory with a value
void fill(byte* start, int size, byte val) {
byte* end = start + size;
for(byte* addr = start; addr!=end; addr++) {
*addr = val;
}
}

View File

@ -0,0 +1,435 @@
// Plots a circle on a bitmap using Bresenham's Circle algorithm
// Coded by Richard-William Loerakker
// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac
// Commodore 64 PRG executable file
.file [name="bitmap-circle-standalone.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.const VICII_BMM = $20
.const VICII_DEN = $10
.const VICII_RSEL = 8
.const BLUE = 6
.label SCREEN = $400
.label BITMAP = $2000
.label D011 = $d011
.label VICII_MEMORY = $d018
.label BORDER_COLOR = $d020
.segment Code
main: {
// fill(BITMAP,40*25*8,0)
ldx #0
lda #<$28*$19*8
sta.z fill.size
lda #>$28*$19*8
sta.z fill.size+1
lda #<BITMAP
sta.z fill.addr
lda #>BITMAP
sta.z fill.addr+1
jsr fill
// fill(SCREEN,40*25,$16)
ldx #$16
lda #<$28*$19
sta.z fill.size
lda #>$28*$19
sta.z fill.size+1
lda #<SCREEN
sta.z fill.addr
lda #>SCREEN
sta.z fill.addr+1
jsr fill
// *BORDER_COLOR = BLUE
lda #BLUE
sta BORDER_COLOR
// *D011 = VICII_BMM|VICII_DEN|VICII_RSEL|3
lda #VICII_BMM|VICII_DEN|VICII_RSEL|3
sta D011
// *VICII_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)BITMAP&$3fff)/$400))
lda #(SCREEN&$3fff)/$40|(BITMAP&$3fff)/$400
sta VICII_MEMORY
// circle(100,100,50)
jsr circle
__b1:
jmp __b1
}
// Fill some memory with a value
// void fill(char *start, __zp($e) int size, __register(X) char val)
fill: {
.label end = $e
.label addr = $c
.label size = $e
// byte* end = start + size
clc
lda.z end
adc.z addr
sta.z end
lda.z end+1
adc.z addr+1
sta.z end+1
__b1:
// for(byte* addr = start; addr!=end; addr++)
lda.z addr+1
cmp.z end+1
bne __b2
lda.z addr
cmp.z end
bne __b2
// }
rts
__b2:
// *addr = val
txa
ldy #0
sta (addr),y
// for(byte* addr = start; addr!=end; addr++)
inc.z addr
bne !+
inc.z addr+1
!:
jmp __b1
}
// void circle(int xc, int yc, int r)
circle: {
.const xc = $64
.const yc = $64
.const r = $32
.label __5 = 8
.label __6 = 8
.label __7 = $a
.label __9 = 6
.label __10 = $a
.label p = $a
.label y = $c
.label x1 = $e
lda #<3-(r<<1)
sta.z p
lda #>3-(r<<1)
sta.z p+1
lda #<r
sta.z y
lda #>r
sta.z y+1
lda #<0
sta.z x1
sta.z x1+1
__b1:
// for(int x = 0; x <= y; x ++)
lda.z y
cmp.z x1
lda.z y+1
sbc.z x1+1
bvc !+
eor #$80
!:
bpl __b2
// }
rts
__b2:
// if(p < 0)
lda.z p+1
bpl !__b3+
jmp __b3
!__b3:
// y=y-1
sec
lda.z y
sbc #1
sta.z y
bcs !+
dec.z y+1
!:
// x-y
lda.z x1
sec
sbc.z y
sta.z __5
lda.z x1+1
sbc.z y+1
sta.z __5+1
// (x-y) << 2
asl.z __6
rol.z __6+1
asl.z __6
rol.z __6+1
// p + ((x-y) << 2)
clc
lda.z __7
adc.z __6
sta.z __7
lda.z __7+1
adc.z __6+1
sta.z __7+1
// p = p + ((x-y) << 2) + 10
lda.z p
clc
adc #<$a
sta.z p
lda.z p+1
adc #>$a
sta.z p+1
__b4:
// plot(xc+x,yc-y)
clc
lda.z x1
adc #<xc
sta.z plot.x
lda.z x1+1
adc #>xc
sta.z plot.x+1
lda #<yc
sec
sbc.z y
sta.z plot.y
lda #>yc
sbc.z y+1
sta.z plot.y+1
jsr plot
// plot(xc-x,yc-y)
lda #<xc
sec
sbc.z x1
sta.z plot.x
lda #>xc
sbc.z x1+1
sta.z plot.x+1
lda #<yc
sec
sbc.z y
sta.z plot.y
lda #>yc
sbc.z y+1
sta.z plot.y+1
jsr plot
// plot(xc+x,yc+y)
clc
lda.z x1
adc #<xc
sta.z plot.x
lda.z x1+1
adc #>xc
sta.z plot.x+1
clc
lda.z y
adc #<yc
sta.z plot.y
lda.z y+1
adc #>yc
sta.z plot.y+1
jsr plot
// plot(xc-x,yc+y)
lda #<xc
sec
sbc.z x1
sta.z plot.x
lda #>xc
sbc.z x1+1
sta.z plot.x+1
clc
lda.z y
adc #<yc
sta.z plot.y
lda.z y+1
adc #>yc
sta.z plot.y+1
jsr plot
// plot(xc+y,yc-x)
clc
lda.z y
adc #<xc
sta.z plot.x
lda.z y+1
adc #>xc
sta.z plot.x+1
lda #<yc
sec
sbc.z x1
sta.z plot.y
lda #>yc
sbc.z x1+1
sta.z plot.y+1
jsr plot
// plot(xc-y,yc-x)
lda #<xc
sec
sbc.z y
sta.z plot.x
lda #>xc
sbc.z y+1
sta.z plot.x+1
lda #<yc
sec
sbc.z x1
sta.z plot.y
lda #>yc
sbc.z x1+1
sta.z plot.y+1
jsr plot
// plot(xc+y,yc+x)
clc
lda.z y
adc #<xc
sta.z plot.x
lda.z y+1
adc #>xc
sta.z plot.x+1
clc
lda.z x1
adc #<yc
sta.z plot.y
lda.z x1+1
adc #>yc
sta.z plot.y+1
jsr plot
// plot(xc-y,yc+x)
lda #<xc
sec
sbc.z y
sta.z plot.x
lda #>xc
sbc.z y+1
sta.z plot.x+1
clc
lda.z x1
adc #<yc
sta.z plot.y
lda.z x1+1
adc #>yc
sta.z plot.y+1
jsr plot
// for(int x = 0; x <= y; x ++)
inc.z x1
bne !+
inc.z x1+1
!:
jmp __b1
__b3:
// x << 2
lda.z x1
asl
sta.z __9
lda.z x1+1
rol
sta.z __9+1
asl.z __9
rol.z __9+1
// p + (x << 2)
clc
lda.z __10
adc.z __9
sta.z __10
lda.z __10+1
adc.z __9+1
sta.z __10+1
// p = p + (x << 2) + 6
lda.z p
clc
adc #<6
sta.z p
lda.z p+1
adc #>6
sta.z p+1
jmp __b4
}
// void plot(__zp(8) int x, __zp(6) int y)
plot: {
.label __0 = 4
.label __2 = 6
.label __3 = 2
.label x = 8
.label y = 6
.label location = 4
.label __7 = 2
.label __8 = 2
// x & $fff8
lda.z x
and #<$fff8
sta.z __0
lda.z x+1
and #>$fff8
sta.z __0+1
// location += x & $fff8
lda #<BITMAP
clc
adc.z location
sta.z location
lda #>BITMAP
adc.z location+1
sta.z location+1
// (char)y & 7
lda.z y
and #7
// location += (char)y & 7
clc
adc.z location
sta.z location
bcc !+
inc.z location+1
!:
// y >> 3
lda.z __2+1
cmp #$80
ror.z __2+1
ror.z __2
lda.z __2+1
cmp #$80
ror.z __2+1
ror.z __2
lda.z __2+1
cmp #$80
ror.z __2+1
ror.z __2
// (y >> 3) * 320
lda.z __2
asl
sta.z __7
lda.z __2+1
rol
sta.z __7+1
asl.z __7
rol.z __7+1
clc
lda.z __8
adc.z __2
sta.z __8
lda.z __8+1
adc.z __2+1
sta.z __8+1
lda.z __3+1
sta.z $ff
lda.z __3
sta.z __3+1
lda #0
sta.z __3
lsr.z $ff
ror.z __3+1
ror.z __3
lsr.z $ff
ror.z __3+1
ror.z __3
// location += ((y >> 3) * 320)
clc
lda.z location
adc.z __3
sta.z location
lda.z location+1
adc.z __3+1
sta.z location+1
// x & 7
lda #7
and.z x
// (*location) | bitmask[x & 7]
tay
lda bitmask,y
ldy #0
ora (location),y
// (*location) = (*location) | bitmask[x & 7]
sta (location),y
// }
rts
}
.segment Data
bitmask: .byte $80, $40, $20, $10, 8, 4, 2, 1

View File

@ -0,0 +1,134 @@
void main()
main: scope:[main] from
[0] phi()
[1] call fill
to:main::@2
main::@2: scope:[main] from main
[2] phi()
[3] call fill
to:main::@3
main::@3: scope:[main] from main::@2
[4] *BORDER_COLOR = BLUE
[5] *D011 = VICII_BMM|VICII_DEN|VICII_RSEL|3
[6] *VICII_MEMORY = (char)(unsigned int)SCREEN&$3fff/$40|(unsigned int)BITMAP&$3fff/$400
[7] call circle
to:main::@1
main::@1: scope:[main] from main::@1 main::@3
[8] phi()
to:main::@1
void fill(char *start , int size , char val)
fill: scope:[fill] from main main::@2
[9] fill::val#4 = phi( main/0, main::@2/$16 )
[9] fill::size#2 = phi( main/(int)$28*$19*8, main::@2/(int)$28*$19 )
[9] fill::addr#0 = phi( main/BITMAP, main::@2/SCREEN )
[10] fill::end#0 = fill::addr#0 + fill::size#2
to:fill::@1
fill::@1: scope:[fill] from fill fill::@2
[11] fill::addr#2 = phi( fill/fill::addr#0, fill::@2/fill::addr#1 )
[12] if(fill::addr#2!=fill::end#0) goto fill::@2
to:fill::@return
fill::@return: scope:[fill] from fill::@1
[13] return
to:@return
fill::@2: scope:[fill] from fill::@1
[14] *fill::addr#2 = fill::val#4
[15] fill::addr#1 = ++ fill::addr#2
to:fill::@1
void circle(int xc , int yc , int r)
circle: scope:[circle] from main::@3
[16] phi()
to:circle::@1
circle::@1: scope:[circle] from circle circle::@13
[17] circle::p#3 = phi( circle/3-circle::r#0<<1, circle::@13/circle::p#10 )
[17] circle::y#13 = phi( circle/circle::r#0, circle::@13/circle::y#10 )
[17] circle::x1#10 = phi( circle/0, circle::@13/circle::x1#1 )
[18] if(circle::x1#10<=circle::y#13) goto circle::@2
to:circle::@return
circle::@return: scope:[circle] from circle::@1
[19] return
to:@return
circle::@2: scope:[circle] from circle::@1
[20] if(circle::p#3<0) goto circle::@3
to:circle::@5
circle::@5: scope:[circle] from circle::@2
[21] circle::y#1 = circle::y#13 - 1
[22] circle::$5 = circle::x1#10 - circle::y#1
[23] circle::$6 = circle::$5 << 2
[24] circle::$7 = circle::p#3 + circle::$6
[25] circle::p#2 = circle::$7 + $a
to:circle::@4
circle::@4: scope:[circle] from circle::@3 circle::@5
[26] circle::p#10 = phi( circle::@3/circle::p#1, circle::@5/circle::p#2 )
[26] circle::y#10 = phi( circle::@3/circle::y#13, circle::@5/circle::y#1 )
[27] plot::x#0 = circle::xc#0 + circle::x1#10
[28] plot::y#0 = circle::yc#0 - circle::y#10
[29] call plot
to:circle::@6
circle::@6: scope:[circle] from circle::@4
[30] plot::x#1 = circle::xc#0 - circle::x1#10
[31] plot::y#1 = circle::yc#0 - circle::y#10
[32] call plot
to:circle::@7
circle::@7: scope:[circle] from circle::@6
[33] plot::x#2 = circle::xc#0 + circle::x1#10
[34] plot::y#2 = circle::yc#0 + circle::y#10
[35] call plot
to:circle::@8
circle::@8: scope:[circle] from circle::@7
[36] plot::x#3 = circle::xc#0 - circle::x1#10
[37] plot::y#3 = circle::yc#0 + circle::y#10
[38] call plot
to:circle::@9
circle::@9: scope:[circle] from circle::@8
[39] plot::x#4 = circle::xc#0 + circle::y#10
[40] plot::y#4 = circle::yc#0 - circle::x1#10
[41] call plot
to:circle::@10
circle::@10: scope:[circle] from circle::@9
[42] plot::x#5 = circle::xc#0 - circle::y#10
[43] plot::y#5 = circle::yc#0 - circle::x1#10
[44] call plot
to:circle::@11
circle::@11: scope:[circle] from circle::@10
[45] plot::x#6 = circle::xc#0 + circle::y#10
[46] plot::y#6 = circle::yc#0 + circle::x1#10
[47] call plot
to:circle::@12
circle::@12: scope:[circle] from circle::@11
[48] plot::x#7 = circle::xc#0 - circle::y#10
[49] plot::y#7 = circle::yc#0 + circle::x1#10
[50] call plot
to:circle::@13
circle::@13: scope:[circle] from circle::@12
[51] circle::x1#1 = ++ circle::x1#10
to:circle::@1
circle::@3: scope:[circle] from circle::@2
[52] circle::$9 = circle::x1#10 << 2
[53] circle::$10 = circle::p#3 + circle::$9
[54] circle::p#1 = circle::$10 + 6
to:circle::@4
void plot(int x , int y)
plot: scope:[plot] from circle::@10 circle::@11 circle::@12 circle::@4 circle::@6 circle::@7 circle::@8 circle::@9
[55] plot::y#8 = phi( circle::@10/plot::y#5, circle::@11/plot::y#6, circle::@12/plot::y#7, circle::@4/plot::y#0, circle::@6/plot::y#1, circle::@7/plot::y#2, circle::@8/plot::y#3, circle::@9/plot::y#4 )
[55] plot::x#8 = phi( circle::@10/plot::x#5, circle::@11/plot::x#6, circle::@12/plot::x#7, circle::@4/plot::x#0, circle::@6/plot::x#1, circle::@7/plot::x#2, circle::@8/plot::x#3, circle::@9/plot::x#4 )
[56] plot::$0 = plot::x#8 & $fff8
[57] plot::location#1 = BITMAP + plot::$0
[58] plot::$6 = (char)plot::y#8
[59] plot::$1 = plot::$6 & 7
[60] plot::location#2 = plot::location#1 + plot::$1
[61] plot::$2 = plot::y#8 >> 3
[62] plot::$7 = plot::$2 << 2
[63] plot::$8 = plot::$7 + plot::$2
[64] plot::$3 = plot::$8 << 6
[65] plot::location#3 = plot::location#2 + plot::$3
[66] plot::$4 = plot::x#8 & 7
[67] plot::$5 = *plot::location#3 | bitmask[plot::$4]
[68] *plot::location#3 = plot::$5
to:plot::@return
plot::@return: scope:[plot] from plot
[69] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,94 @@
__constant char * const BITMAP = (char *) 8192
__constant const char BLUE = 6
__constant char * const BORDER_COLOR = (char *) 53280
__constant char * const D011 = (char *) 53265
__constant char * const SCREEN = (char *) 1024
__constant const char VICII_BMM = $20
__constant const char VICII_DEN = $10
__constant char * const VICII_MEMORY = (char *) 53272
__constant const char VICII_RSEL = 8
__constant char bitmask[] = { $80, $40, $20, $10, 8, 4, 2, 1 }
void circle(int xc , int yc , int r)
int circle::$10 // zp[2]:10 202.0
int circle::$5 // zp[2]:8 202.0
int circle::$6 // zp[2]:8 202.0
int circle::$7 // zp[2]:10 202.0
int circle::$9 // zp[2]:6 202.0
int circle::p
int circle::p#1 // p zp[2]:10 202.0
int circle::p#10 // p zp[2]:10 11.653846153846153
int circle::p#2 // p zp[2]:10 202.0
int circle::p#3 // p zp[2]:10 57.714285714285715
int circle::r
__constant int circle::r#0 = $32 // r
int circle::x1
int circle::x1#1 // x1 zp[2]:14 202.0
int circle::x1#10 // x1 zp[2]:14 36.47222222222223
int circle::xc
__constant int circle::xc#0 = $64 // xc
int circle::y
int circle::y#1 // y zp[2]:12 60.599999999999994
int circle::y#10 // y zp[2]:12 42.73076923076923
int circle::y#13 // y zp[2]:12 67.33333333333333
int circle::yc
__constant int circle::yc#0 = $64 // yc
void fill(char *start , int size , char val)
char *fill::addr
char *fill::addr#0 // addr zp[2]:12 11.0
char *fill::addr#1 // addr zp[2]:12 202.0
char *fill::addr#2 // addr zp[2]:12 138.33333333333331
char *fill::end
char *fill::end#0 // end zp[2]:14 22.4
int fill::size
int fill::size#2 // size zp[2]:14 11.0
char *fill::start
char fill::val
char fill::val#4 // reg byte x 16.833333333333332
void main()
void plot(int x , int y)
int plot::$0 // zp[2]:4 2002.0
char plot::$1 // reg byte a 2002.0
int plot::$2 // zp[2]:6 1501.5
int plot::$3 // zp[2]:2 2002.0
signed char plot::$4 // reg byte a 2002.0
char plot::$5 // reg byte a 2002.0
char plot::$6 // reg byte a 2002.0
int plot::$7 // zp[2]:2 2002.0
int plot::$8 // zp[2]:2 2002.0
char *plot::location
char *plot::location#1 // location zp[2]:4 667.3333333333334
char *plot::location#2 // location zp[2]:4 400.4
char *plot::location#3 // location zp[2]:4 1001.0
int plot::x
int plot::x#0 // x zp[2]:8 101.0
int plot::x#1 // x zp[2]:8 101.0
int plot::x#2 // x zp[2]:8 101.0
int plot::x#3 // x zp[2]:8 101.0
int plot::x#4 // x zp[2]:8 101.0
int plot::x#5 // x zp[2]:8 101.0
int plot::x#6 // x zp[2]:8 101.0
int plot::x#7 // x zp[2]:8 101.0
int plot::x#8 // x zp[2]:8 255.45454545454544
int plot::y
int plot::y#0 // y zp[2]:6 202.0
int plot::y#1 // y zp[2]:6 202.0
int plot::y#2 // y zp[2]:6 202.0
int plot::y#3 // y zp[2]:6 202.0
int plot::y#4 // y zp[2]:6 202.0
int plot::y#5 // y zp[2]:6 202.0
int plot::y#6 // y zp[2]:6 202.0
int plot::y#7 // y zp[2]:6 202.0
int plot::y#8 // y zp[2]:6 301.5
reg byte x [ fill::val#4 ]
zp[2]:14 [ circle::x1#10 circle::x1#1 fill::size#2 fill::end#0 ]
zp[2]:12 [ circle::y#13 circle::y#10 circle::y#1 fill::addr#2 fill::addr#0 fill::addr#1 ]
zp[2]:10 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 circle::$7 circle::$10 ]
zp[2]:8 [ circle::$5 circle::$6 plot::x#8 plot::x#5 plot::x#6 plot::x#7 plot::x#0 plot::x#1 plot::x#2 plot::x#3 plot::x#4 ]
zp[2]:6 [ circle::$9 plot::y#8 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::$2 ]
zp[2]:4 [ plot::$0 plot::location#1 plot::location#2 plot::location#3 ]
reg byte a [ plot::$6 ]
reg byte a [ plot::$1 ]
zp[2]:2 [ plot::$7 plot::$8 plot::$3 ]
reg byte a [ plot::$4 ]
reg byte a [ plot::$5 ]

View File

@ -216,9 +216,9 @@
// Pointer to the music play routine
.label musicPlay = INTRO_MUSIC+6
// Is the pacman eating sound enabled
.label pacman_ch1_enabled = $6e
.label pacman_ch1_enabled = $66
// Index into the eating sound
.label pacman_ch1_idx = $66
.label pacman_ch1_idx = $5e
// Pointer to the tile to render in the logic code
.label logic_tile_ptr = $1a
// The x-column of the tile to render
@ -226,16 +226,16 @@
// The y-fine of the tile to render
.label logic_tile_yfine = $1d
// The ID*4 of the left tile to render
.label logic_tile_left_idx = $4d
.label logic_tile_left_idx = $4c
// The ID*4 of the right tile to render
.label logic_tile_right_idx = $4e
.label logic_tile_right_idx = $4d
// Variables used by the logic-code renderer and restorer
.label left_render_index_xcol = $4f
.label left_canvas = $51
.label left_ypos_inc_offset = $53
.label rigt_render_index_xcol = $54
.label rigt_canvas = $56
.label rigt_ypos_inc_offset = $58
.label left_render_index_xcol = $4e
.label left_canvas = $50
.label left_ypos_inc_offset = $52
.label rigt_render_index_xcol = $53
.label rigt_canvas = $55
.label rigt_ypos_inc_offset = $57
// The high-byte of the start-address of the canvas currently being rendered to
.label canvas_base_hi = $20
// The offset used for bobs_restore - used to achieve double buffering
@ -249,7 +249,7 @@
.label bottom_sprites_color = $18
.label bottom_sprites_mc = $19
// The number of pills left
.label pill_count = $59
.label pill_count = $58
// 1 When pacman wins
.label pacman_wins = $1f
// The number of pacman lives left
@ -259,19 +259,19 @@
// 0: intro, 1: game
.label phase = $3d
// The double buffer frame (0=BANK_1, 1=BANK_2)
.label frame = $6d
.label frame = $65
// The animation frame IDX (within the current direction) [0-3]
.label anim_frame_idx = $68
.label anim_frame_idx = $60
// Pacman x fine position (0-99).
.label pacman_xfine = $47
// Pacman y fine position (0-70).
.label pacman_yfine = $48
// The pacman movement current direction
.label pacman_direction = $34
.label pacman_direction = $35
// Pacman movement substep (0: on tile, 1: between tiles).
.label pacman_substep = $2c
// Mode determining ghost target mode. 0: chase, 1: scatter
.label ghosts_mode = $67
.label ghosts_mode = $5f
// Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase )
.label ghosts_mode_count = $2b
// Ghost 1 x fine position (0-99).
@ -279,11 +279,11 @@
// Ghost 1 y fine position (0-70).
.label ghost1_yfine = $3c
// Ghost 1 movement current direction
.label ghost1_direction = $35
.label ghost1_direction = $36
// Ghost 1 movement substep (0: on tile, 1: between tiles).
.label ghost1_substep = $2d
// Ghost 1 movement should be reversed (0: normal, 1: reverse direction)
.label ghost1_reverse = $69
.label ghost1_reverse = $61
// Ghost 1 respawn timer
.label ghost1_respawn = $26
// Ghost 2 x fine position (0-99).
@ -291,11 +291,11 @@
// Ghost 2 y fine position (0-70).
.label ghost2_yfine = $3f
// Ghost 2 movement current direction
.label ghost2_direction = $36
.label ghost2_direction = $37
// Ghost 2 movement substep (0: on tile, 1: between tiles).
.label ghost2_substep = $2e
// Ghost 2 movement should be reversed (0: normal, 1: reverse direction)
.label ghost2_reverse = $6a
.label ghost2_reverse = $62
// Ghost 2 respawn timer
.label ghost2_respawn = $28
// Ghost 3 x fine position (0-99).
@ -307,7 +307,7 @@
// Ghost 3 movement substep (0: on tile, 1: between tiles).
.label ghost3_substep = $2f
// Ghost 3 movement should be reversed (0: normal, 1: reverse direction)
.label ghost3_reverse = $6b
.label ghost3_reverse = $63
// Ghost 3 respawn timer
.label ghost3_respawn = $29
// Ghost 4 x fine position (0-99).
@ -319,11 +319,11 @@
// Ghost 4 movement substep (0: on tile, 1: between tiles).
.label ghost4_substep = $30
// Ghost 4 movement should be reversed (0: normal, 1: reverse direction)
.label ghost4_reverse = $6c
.label ghost4_reverse = $64
// Ghost 4 respawn timer
.label ghost4_respawn = $2a
// Game logic sub-step [0-7]. Each frame a different sub-step is animated
.label game_logic_substep = $5c
.label game_logic_substep = $5a
// 1 when the game is playable and characters should move around
.label game_playable = $41
.segment Code
@ -646,21 +646,21 @@ main: {
game_logic: {
.label __67 = $45
.label __71 = $45
.label __210 = $5d
.label ghost_frame_idx = $49
.label pacman_xtile = $5b
.label __210 = $22
.label ghost_frame_idx = $4a
.label pacman_xtile = $49
.label ytiles = $45
.label ghost4_xtile = $5e
.label ghost4_ytile = $5f
.label ghost4_xtile = $33
.label ghost4_ytile = $34
.label target_ytile = $27
.label ghost3_xtile = $60
.label ghost3_ytile = $61
.label ghost3_xtile = $5b
.label ghost3_ytile = $34
.label target_ytile1 = $27
.label ghost2_xtile = $62
.label ghost2_ytile = $63
.label ghost2_xtile = $5c
.label ghost2_ytile = $34
.label target_ytile2 = $27
.label ghost1_xtile = $64
.label ghost1_ytile = $65
.label ghost1_xtile = $5d
.label ghost1_ytile = $34
.label target_ytile3 = $27
// if(game_playable==0)
lda.z game_playable
@ -1347,8 +1347,6 @@ game_logic: {
// choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost4_xtile
lda.z ghost4_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
@ -1518,8 +1516,6 @@ game_logic: {
// choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost3_xtile
lda.z ghost3_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
@ -1690,8 +1686,6 @@ game_logic: {
// choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost2_xtile
lda.z ghost2_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
@ -1863,8 +1857,6 @@ game_logic: {
// choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile )
sty.z choose_direction.open_directions
ldy.z ghost1_xtile
lda.z ghost1_ytile
sta.z choose_direction.ghost_ytile
jsr choose_direction
// choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile )
lda.z choose_direction.return
@ -2853,13 +2845,13 @@ level_tile_directions: {
}
// Choose the open direction that brings the ghost closest to the target
// Uses Manhattan distance calculation
// __zp($33) char choose_direction(__zp($4a) char open_directions, __register(Y) char ghost_xtile, __zp($37) char ghost_ytile, __register(X) char target_xtile, __zp($27) char target_ytile)
// __zp($33) char choose_direction(__zp($49) char open_directions, __register(Y) char ghost_xtile, __zp($34) char ghost_ytile, __register(X) char target_xtile, __zp($27) char target_ytile)
choose_direction: {
.label open_directions = $4a
.label ghost_ytile = $37
.label open_directions = $49
.label ghost_ytile = $34
.label target_ytile = $27
.label xdiff = $4c
.label ydiff = $4b
.label xdiff = $4b
.label ydiff = $34
.label dist_left = $22
.label return = $33
.label direction = $33
@ -2871,7 +2863,7 @@ choose_direction: {
sbc.z $ff
sta.z xdiff
// char ydiff = ghost_ytile-target_ytile
lda.z ghost_ytile
lda.z ydiff
sec
sbc.z target_ytile
sta.z ydiff
@ -2976,12 +2968,12 @@ choose_direction: {
jmp __b2
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(__zp($6f) void *str, char c, __zp(5) unsigned int num)
// void * memset(__zp($b) void *str, char c, __zp(5) unsigned int num)
memset: {
.label end = 5
.label dst = $b
.label num = 5
.label str = $6f
.label str = $b
// if(num>0)
lda.z num
bne !+
@ -2996,10 +2988,6 @@ memset: {
lda.z end+1
adc.z str+1
sta.z end+1
lda.z str
sta.z dst
lda.z str+1
sta.z dst+1
__b2:
// for(char* dst = str; dst!=end; dst++)
lda.z dst+1

File diff suppressed because it is too large Load Diff

View File

@ -808,7 +808,7 @@ __constant char WIN_GFX_CRUNCHED[] = kickasm( uses WIN_GFX) {{ .modify B2() {
}}
__constant const char YELLOW = 7
void __start()
__loadstore volatile char anim_frame_idx // zp[1]:104 0.9019607843137255
__loadstore volatile char anim_frame_idx // zp[1]:96 0.9019607843137255
__constant char bobs_bob_id[NUM_BOBS] = { 0, 0, 0, 0, 0 }
__constant char bobs_restore[NUM_BOBS*SIZE_BOB_RESTORE*2] = { fill( NUM_BOBS*SIZE_BOB_RESTORE*2, 0) }
__loadstore volatile char bobs_restore_base // zp[1]:33 1070.0
@ -851,17 +851,17 @@ char choose_direction::ghost_xtile#2 // reg byte y 5.5
char choose_direction::ghost_xtile#3 // reg byte y 5.5
char choose_direction::ghost_xtile#4 // reg byte y 145.0
char choose_direction::ghost_ytile
char choose_direction::ghost_ytile#0 // ghost_ytile zp[1]:55 7.333333333333333
char choose_direction::ghost_ytile#1 // ghost_ytile zp[1]:55 7.333333333333333
char choose_direction::ghost_ytile#2 // ghost_ytile zp[1]:55 7.333333333333333
char choose_direction::ghost_ytile#3 // ghost_ytile zp[1]:55 7.333333333333333
char choose_direction::ghost_ytile#4 // ghost_ytile zp[1]:55 72.5
char choose_direction::ghost_ytile#0 // ghost_ytile zp[1]:52 7.333333333333333
char choose_direction::ghost_ytile#1 // ghost_ytile zp[1]:52 7.333333333333333
char choose_direction::ghost_ytile#2 // ghost_ytile zp[1]:52 7.333333333333333
char choose_direction::ghost_ytile#3 // ghost_ytile zp[1]:52 7.333333333333333
char choose_direction::ghost_ytile#4 // ghost_ytile zp[1]:52 72.5
char choose_direction::open_directions
char choose_direction::open_directions#0 // open_directions zp[1]:74 4.4
char choose_direction::open_directions#1 // open_directions zp[1]:74 4.4
char choose_direction::open_directions#10 // open_directions zp[1]:74 19.478260869565215
char choose_direction::open_directions#2 // open_directions zp[1]:74 4.4
char choose_direction::open_directions#3 // open_directions zp[1]:74 4.4
char choose_direction::open_directions#0 // open_directions zp[1]:73 4.4
char choose_direction::open_directions#1 // open_directions zp[1]:73 4.4
char choose_direction::open_directions#10 // open_directions zp[1]:73 19.478260869565215
char choose_direction::open_directions#2 // open_directions zp[1]:73 4.4
char choose_direction::open_directions#3 // open_directions zp[1]:73 4.4
char choose_direction::return
char choose_direction::return#0 // reg byte a 22.0
char choose_direction::return#1 // reg byte a 22.0
@ -881,9 +881,9 @@ char choose_direction::target_ytile#2 // target_ytile zp[1]:39 22.0
char choose_direction::target_ytile#3 // target_ytile zp[1]:39 22.0
char choose_direction::target_ytile#4 // target_ytile zp[1]:39 72.5
char choose_direction::xdiff
char choose_direction::xdiff#0 // xdiff zp[1]:76 21.041666666666664
char choose_direction::xdiff#0 // xdiff zp[1]:75 21.041666666666664
char choose_direction::ydiff
char choose_direction::ydiff#0 // ydiff zp[1]:75 21.956521739130434
char choose_direction::ydiff#0 // ydiff zp[1]:52 21.956521739130434
void done_run()
char done_run::$8 // reg byte a 2000002.0
char *done_run::gfx
@ -904,7 +904,7 @@ char done_run::xcol#2 // xcol zp[1]:20 118182.18181818182
char done_run::ypos
char done_run::ypos#1 // ypos zp[1]:16 2000002.0
char done_run::ypos#2 // ypos zp[1]:16 500000.5
__loadstore volatile char frame // zp[1]:109 0.5
__loadstore volatile char frame // zp[1]:101 0.5
void game_logic()
char game_logic::$119 // reg byte a 22.0
char game_logic::$14 // reg byte x 22.0
@ -921,7 +921,7 @@ char game_logic::$20 // reg byte a 22.0
char game_logic::$200 // reg byte a 22.0
char game_logic::$204 // reg byte a 22.0
char game_logic::$21 // reg byte a 22.0
char game_logic::$210 // zp[1]:93 2.588235294117647
char game_logic::$210 // zp[1]:34 2.588235294117647
char game_logic::$220 // reg byte x 11.0
char game_logic::$223 // reg byte x 11.0
char game_logic::$226 // reg byte x 11.0
@ -969,31 +969,31 @@ char game_logic::do_reverse#4 // reg byte a 11.0
char game_logic::ghost1_bob_xfine
char game_logic::ghost1_bob_xfine#0 // reg byte y 5.5
char game_logic::ghost1_xtile
char game_logic::ghost1_xtile#0 // ghost1_xtile zp[1]:100 2.357142857142857
char game_logic::ghost1_xtile#0 // ghost1_xtile zp[1]:93 2.357142857142857
char game_logic::ghost1_ytile
char game_logic::ghost1_ytile#0 // ghost1_ytile zp[1]:101 2.357142857142857
char game_logic::ghost1_ytile#0 // ghost1_ytile zp[1]:52 2.357142857142857
char game_logic::ghost2_bob_xfine
char game_logic::ghost2_bob_xfine#0 // reg byte y 5.5
char game_logic::ghost2_xtile
char game_logic::ghost2_xtile#0 // ghost2_xtile zp[1]:98 2.357142857142857
char game_logic::ghost2_xtile#0 // ghost2_xtile zp[1]:92 2.357142857142857
char game_logic::ghost2_ytile
char game_logic::ghost2_ytile#0 // ghost2_ytile zp[1]:99 2.357142857142857
char game_logic::ghost2_ytile#0 // ghost2_ytile zp[1]:52 2.357142857142857
char game_logic::ghost3_bob_xfine
char game_logic::ghost3_bob_xfine#0 // reg byte y 5.5
char game_logic::ghost3_xtile
char game_logic::ghost3_xtile#0 // ghost3_xtile zp[1]:96 2.357142857142857
char game_logic::ghost3_xtile#0 // ghost3_xtile zp[1]:91 2.357142857142857
char game_logic::ghost3_ytile
char game_logic::ghost3_ytile#0 // ghost3_ytile zp[1]:97 2.357142857142857
char game_logic::ghost3_ytile#0 // ghost3_ytile zp[1]:52 2.357142857142857
char game_logic::ghost4_bob_xfine
char game_logic::ghost4_bob_xfine#0 // reg byte y 5.5
char game_logic::ghost4_xtile
char game_logic::ghost4_xtile#0 // ghost4_xtile zp[1]:94 2.357142857142857
char game_logic::ghost4_xtile#0 // ghost4_xtile zp[1]:51 2.357142857142857
char game_logic::ghost4_ytile
char game_logic::ghost4_ytile#0 // ghost4_ytile zp[1]:95 2.357142857142857
char game_logic::ghost4_ytile#0 // ghost4_ytile zp[1]:52 2.357142857142857
char game_logic::ghost_frame_idx
char game_logic::ghost_frame_idx#0 // ghost_frame_idx zp[1]:73 16.5
char game_logic::ghost_frame_idx#1 // ghost_frame_idx zp[1]:73 22.0
char game_logic::ghost_frame_idx#2 // ghost_frame_idx zp[1]:73 1.9999999999999998
char game_logic::ghost_frame_idx#0 // ghost_frame_idx zp[1]:74 16.5
char game_logic::ghost_frame_idx#1 // ghost_frame_idx zp[1]:74 22.0
char game_logic::ghost_frame_idx#2 // ghost_frame_idx zp[1]:74 1.9999999999999998
char game_logic::joy_directions
char game_logic::joy_directions#0 // reg byte a 16.5
char game_logic::new_direction
@ -1015,7 +1015,7 @@ char game_logic::open_directions4#0 // reg byte x 3.666666666666667
char game_logic::pacman_bob_xfine
char game_logic::pacman_bob_xfine#0 // reg byte y 5.5
char game_logic::pacman_xtile
char game_logic::pacman_xtile#0 // pacman_xtile zp[1]:91 6.769230769230768
char game_logic::pacman_xtile#0 // pacman_xtile zp[1]:73 6.769230769230768
char game_logic::pacman_xtile1
char game_logic::pacman_xtile1#0 // reg byte x 11.0
char game_logic::pacman_ytile
@ -1050,7 +1050,7 @@ char game_logic::tile_id
char game_logic::tile_id#0 // reg byte x 16.5
char *game_logic::ytiles
char *game_logic::ytiles#0 // ytiles zp[2]:69 5.5
__loadstore volatile char game_logic_substep // zp[1]:92 2.947368421052632
__loadstore volatile char game_logic_substep // zp[1]:90 2.947368421052632
__loadstore volatile char game_playable // zp[1]:65 69.48275862068965
void gameplay_run()
unsigned int gameplay_run::$4 // zp[2]:9 2002.0
@ -1063,32 +1063,32 @@ char gameplay_run::i1#2 // reg byte x 133334.66666666666
char gameplay_run::i2
char gameplay_run::i2#1 // reg byte x 200002.0
char gameplay_run::i2#2 // reg byte x 133334.66666666666
__loadstore volatile char ghost1_direction // zp[1]:53 122.24096385542168
__loadstore volatile char ghost1_direction // zp[1]:54 122.24096385542168
__loadstore volatile char ghost1_respawn // zp[1]:38 271.8378378378378
__loadstore volatile char ghost1_reverse // zp[1]:105 0.7291666666666666
__loadstore volatile char ghost1_reverse // zp[1]:97 0.7291666666666666
__loadstore volatile char ghost1_substep // zp[1]:45 223.51111111111112
__loadstore volatile char ghost1_xfine // zp[1]:59 84.55
__loadstore volatile char ghost1_yfine // zp[1]:60 82.13008130081302
__loadstore volatile char ghost2_direction // zp[1]:54 110.28260869565217
__loadstore volatile char ghost2_direction // zp[1]:55 110.28260869565217
__loadstore volatile char ghost2_respawn // zp[1]:40 264.6842105263158
__loadstore volatile char ghost2_reverse // zp[1]:106 0.7142857142857143
__loadstore volatile char ghost2_reverse // zp[1]:98 0.7142857142857143
__loadstore volatile char ghost2_substep // zp[1]:46 218.65217391304347
__loadstore volatile char ghost2_xfine // zp[1]:62 76.28571428571428
__loadstore volatile char ghost2_yfine // zp[1]:63 74.27941176470588
__loadstore volatile char ghost3_direction // zp[1]:56 100.45544554455446
__loadstore volatile char ghost3_respawn // zp[1]:41 257.8974358974359
__loadstore volatile char ghost3_reverse // zp[1]:107 0.7
__loadstore volatile char ghost3_reverse // zp[1]:99 0.7
__loadstore volatile char ghost3_substep // zp[1]:47 214.0
__loadstore volatile char ghost3_xfine // zp[1]:64 69.4931506849315
__loadstore volatile char ghost3_yfine // zp[1]:66 67.7986577181208
__loadstore volatile char ghost4_direction // zp[1]:57 92.23636363636363
__loadstore volatile char ghost4_respawn // zp[1]:42 251.45000000000002
__loadstore volatile char ghost4_reverse // zp[1]:108 0.6862745098039216
__loadstore volatile char ghost4_reverse // zp[1]:100 0.6862745098039216
__loadstore volatile char ghost4_substep // zp[1]:48 209.54166666666666
__loadstore volatile char ghost4_xfine // zp[1]:67 63.81132075471698
__loadstore volatile char ghost4_yfine // zp[1]:68 62.358024691358025
__constant char ghost_frames[] = { 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 }
__loadstore volatile char ghosts_mode // zp[1]:103 1.1044776119402984
__loadstore volatile char ghosts_mode // zp[1]:95 1.1044776119402984
__loadstore volatile char ghosts_mode_count // zp[1]:43 234.93023255813955
void init_bobs_restore()
__constant char *init_bobs_restore::CANVAS_HIDDEN = (char *) 59904
@ -1193,9 +1193,9 @@ char joyfire::return#0 // reg byte a 2000002.0
char joyfire::return#1 // reg byte a 20002.0
char joyfire::return#4 // reg byte a 252500.5
void joyinit()
__loadstore char * volatile left_canvas // zp[2]:81 20.0
__loadstore char * volatile left_render_index_xcol // zp[2]:79 20.0
__loadstore volatile char left_ypos_inc_offset // zp[1]:83 20.0
__loadstore char * volatile left_canvas // zp[2]:80 20.0
__loadstore char * volatile left_render_index_xcol // zp[2]:78 20.0
__loadstore volatile char left_ypos_inc_offset // zp[1]:82 20.0
unsigned int level_show()
unsigned int level_show::count
unsigned int level_show::count#1 // count zp[2]:9 2.0000002E7
@ -1272,9 +1272,9 @@ char level_tile_get::ytile#3 // reg byte a 1.0000001E7
char level_tile_get::ytile#4 // reg byte a 8.0000002E7
char *level_tile_get::ytiles
char *level_tile_get::ytiles#0 // ytiles zp[2]:13 2.00000002E8
__loadstore volatile char logic_tile_left_idx // zp[1]:77 20.0
__loadstore volatile char logic_tile_left_idx // zp[1]:76 20.0
__loadstore volatile char * volatile logic_tile_ptr // zp[2]:26 10250.0
__loadstore volatile char logic_tile_right_idx // zp[1]:78 20.0
__loadstore volatile char logic_tile_right_idx // zp[1]:77 20.0
__loadstore volatile char logic_tile_xcol // zp[1]:28 10250.0
__loadstore volatile char logic_tile_yfine // zp[1]:29 10250.0
void main()
@ -1305,7 +1305,7 @@ unsigned int memset::num
unsigned int memset::num#5 // num zp[2]:5 1001.0
void *memset::return
void *memset::str
void *memset::str#6 // str zp[2]:111
void *memset::str#6 // str zp[2]:11
void merge_code(char *dest_code , char *raster_code , char *logic_code)
char merge_code::$5 // reg byte y 100001.0
__constant const char merge_code::LOGIC_END = $ff
@ -1354,9 +1354,9 @@ char *merge_code::raster_code#4 // raster_code zp[2]:11 37501.5
__constant void (* const musicInit)() = (void (*)())INTRO_MUSIC
__constant void (* const musicPlay)() = (void (*)())INTRO_MUSIC+6
__loadstore volatile char music_play_next // zp[1]:21 69506.875
__loadstore volatile char pacman_ch1_enabled // zp[1]:110 0.08254716981132076
__loadstore volatile char pacman_ch1_idx // zp[1]:102 1.9428571428571428
__loadstore volatile char pacman_direction // zp[1]:52 132.92105263157893
__loadstore volatile char pacman_ch1_enabled // zp[1]:102 0.08254716981132076
__loadstore volatile char pacman_ch1_idx // zp[1]:94 1.9428571428571428
__loadstore volatile char pacman_direction // zp[1]:53 132.92105263157893
__constant char pacman_frames[] = { 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c }
__loadstore volatile char pacman_lives // zp[1]:35 656.4415584415585
void pacman_sound_init()
@ -1366,7 +1366,7 @@ __loadstore volatile char pacman_wins // zp[1]:31 2040.32
__loadstore volatile char pacman_xfine // zp[1]:71 47.719626168224295
__loadstore volatile char pacman_yfine // zp[1]:72 46.21818181818182
__loadstore volatile char phase // zp[1]:61 78.03703703703704
__loadstore volatile unsigned int pill_count // zp[2]:89 14.191780821917808
__loadstore volatile unsigned int pill_count // zp[2]:88 14.191780821917808
void render(char xcol , char ypos , char pixels)
char render::$1 // reg byte x 1.0000001E7
char render::$2 // reg byte a 2.0000002E7
@ -1443,9 +1443,9 @@ char render_tiles::ypos_inc_offset#1 // reg byte x 1.000000000001E12
char render_tiles::ypos_inc_offset#2 // reg byte x 5.714428571435714E11
char render_tiles::ytile
char render_tiles::ytile#0 // ytile zp[1]:16 1.375000025E7
__loadstore char * volatile rigt_canvas // zp[2]:86 20.0
__loadstore char * volatile rigt_render_index_xcol // zp[2]:84 20.0
__loadstore volatile char rigt_ypos_inc_offset // zp[1]:88 20.0
__loadstore char * volatile rigt_canvas // zp[2]:85 20.0
__loadstore char * volatile rigt_render_index_xcol // zp[2]:83 20.0
__loadstore volatile char rigt_ypos_inc_offset // zp[1]:87 20.0
__loadstore volatile char side_sprites_color // zp[1]:22 11040.0
__loadstore volatile char side_sprites_mc // zp[1]:23 11040.0
void spawn_all()
@ -1493,7 +1493,7 @@ char splash_show::ypos#2 // ypos zp[1]:16 50000.5
__loadstore volatile char top_sprites_color // zp[1]:30 3403.666666666667
__loadstore volatile char top_sprites_mc // zp[1]:58 92.0
zp[1]:73 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ]
zp[1]:74 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ]
reg byte a [ game_logic::do_reverse#4 ]
reg byte x [ game_logic::target_xtile#3 game_logic::target_xtile#2 ]
zp[1]:39 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 game_logic::target_ytile2#3 game_logic::target_ytile2#2 game_logic::target_ytile3#3 game_logic::target_ytile3#2 ]
@ -1513,13 +1513,9 @@ reg byte a [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level
reg byte a [ level_tile_directions::return#2 level_tile_directions::return#0 ]
reg byte y [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ]
reg byte x [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ]
zp[1]:55 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ]
zp[1]:74 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ]
zp[1]:52 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 game_logic::ghost1_ytile#0 choose_direction::ydiff#0 ]
reg byte y [ choose_direction::dist_min#6 choose_direction::dist_up#0 ]
reg byte x [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ]
zp[1]:34 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ]
zp[1]:51 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ]
zp[2]:111 [ memset::str#6 ]
reg byte x [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ]
reg byte x [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ]
reg byte x [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ]
@ -1539,19 +1535,19 @@ reg byte x [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xti
reg byte a [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ]
reg byte a [ level_tile_get::return#2 level_tile_get::return#0 ]
reg byte x [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ]
zp[1]:110 [ pacman_ch1_enabled ]
zp[1]:102 [ pacman_ch1_idx ]
zp[1]:102 [ pacman_ch1_enabled ]
zp[1]:94 [ pacman_ch1_idx ]
zp[2]:26 [ logic_tile_ptr ]
zp[1]:28 [ logic_tile_xcol ]
zp[1]:29 [ logic_tile_yfine ]
zp[1]:77 [ logic_tile_left_idx ]
zp[1]:78 [ logic_tile_right_idx ]
zp[2]:79 [ left_render_index_xcol ]
zp[2]:81 [ left_canvas ]
zp[1]:83 [ left_ypos_inc_offset ]
zp[2]:84 [ rigt_render_index_xcol ]
zp[2]:86 [ rigt_canvas ]
zp[1]:88 [ rigt_ypos_inc_offset ]
zp[1]:76 [ logic_tile_left_idx ]
zp[1]:77 [ logic_tile_right_idx ]
zp[2]:78 [ left_render_index_xcol ]
zp[2]:80 [ left_canvas ]
zp[1]:82 [ left_ypos_inc_offset ]
zp[2]:83 [ rigt_render_index_xcol ]
zp[2]:85 [ rigt_canvas ]
zp[1]:87 [ rigt_ypos_inc_offset ]
zp[1]:32 [ canvas_base_hi ]
zp[1]:33 [ bobs_restore_base ]
zp[1]:30 [ top_sprites_color ]
@ -1560,44 +1556,44 @@ zp[1]:22 [ side_sprites_color ]
zp[1]:23 [ side_sprites_mc ]
zp[1]:24 [ bottom_sprites_color ]
zp[1]:25 [ bottom_sprites_mc ]
zp[2]:89 [ pill_count ]
zp[2]:88 [ pill_count ]
zp[1]:31 [ pacman_wins ]
zp[1]:35 [ pacman_lives ]
zp[1]:21 [ music_play_next ]
zp[1]:61 [ phase ]
zp[1]:109 [ frame ]
zp[1]:104 [ anim_frame_idx ]
zp[1]:101 [ frame ]
zp[1]:96 [ anim_frame_idx ]
zp[1]:71 [ pacman_xfine ]
zp[1]:72 [ pacman_yfine ]
zp[1]:52 [ pacman_direction ]
zp[1]:53 [ pacman_direction ]
zp[1]:44 [ pacman_substep ]
zp[1]:103 [ ghosts_mode ]
zp[1]:95 [ ghosts_mode ]
zp[1]:43 [ ghosts_mode_count ]
zp[1]:59 [ ghost1_xfine ]
zp[1]:60 [ ghost1_yfine ]
zp[1]:53 [ ghost1_direction ]
zp[1]:54 [ ghost1_direction ]
zp[1]:45 [ ghost1_substep ]
zp[1]:105 [ ghost1_reverse ]
zp[1]:97 [ ghost1_reverse ]
zp[1]:38 [ ghost1_respawn ]
zp[1]:62 [ ghost2_xfine ]
zp[1]:63 [ ghost2_yfine ]
zp[1]:54 [ ghost2_direction ]
zp[1]:55 [ ghost2_direction ]
zp[1]:46 [ ghost2_substep ]
zp[1]:106 [ ghost2_reverse ]
zp[1]:98 [ ghost2_reverse ]
zp[1]:40 [ ghost2_respawn ]
zp[1]:64 [ ghost3_xfine ]
zp[1]:66 [ ghost3_yfine ]
zp[1]:56 [ ghost3_direction ]
zp[1]:47 [ ghost3_substep ]
zp[1]:107 [ ghost3_reverse ]
zp[1]:99 [ ghost3_reverse ]
zp[1]:41 [ ghost3_respawn ]
zp[1]:67 [ ghost4_xfine ]
zp[1]:68 [ ghost4_yfine ]
zp[1]:57 [ ghost4_direction ]
zp[1]:48 [ ghost4_substep ]
zp[1]:108 [ ghost4_reverse ]
zp[1]:100 [ ghost4_reverse ]
zp[1]:42 [ ghost4_respawn ]
zp[1]:92 [ game_logic_substep ]
zp[1]:90 [ game_logic_substep ]
zp[1]:65 [ game_playable ]
reg byte a [ irq_screen_top::$1 ]
reg byte a [ irq_screen_top::$2 ]
@ -1635,9 +1631,9 @@ reg byte x [ game_logic::$44 ]
reg byte x [ game_logic::$45 ]
reg byte a [ game_logic::$46 ]
reg byte a [ game_logic::$47 ]
zp[1]:91 [ game_logic::pacman_xtile#0 ]
zp[1]:73 [ game_logic::pacman_xtile#0 choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ]
reg byte a [ game_logic::pacman_ytile#0 ]
zp[1]:93 [ game_logic::$210 ]
zp[1]:34 [ game_logic::$210 choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ]
zp[2]:69 [ game_logic::ytiles#0 game_logic::$67 game_logic::$71 ]
reg byte x [ game_logic::tile_id#0 ]
reg byte a [ game_logic::$65 ]
@ -1655,32 +1651,28 @@ reg byte a [ game_logic::$69 ]
reg byte a [ game_logic::$70 ]
reg byte a [ game_logic::$72 ]
reg byte x [ game_logic::$220 ]
zp[1]:94 [ game_logic::ghost4_xtile#0 ]
zp[1]:95 [ game_logic::ghost4_ytile#0 ]
zp[1]:51 [ game_logic::ghost4_xtile#0 choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ]
reg byte a [ level_tile_directions::return#3 ]
reg byte a [ game_logic::open_directions#0 ]
reg byte y [ game_logic::open_directions#1 ]
reg byte a [ choose_direction::return#0 ]
reg byte a [ game_logic::$119 ]
reg byte x [ game_logic::$223 ]
zp[1]:96 [ game_logic::ghost3_xtile#0 ]
zp[1]:97 [ game_logic::ghost3_ytile#0 ]
zp[1]:91 [ game_logic::ghost3_xtile#0 ]
reg byte a [ level_tile_directions::return#10 ]
reg byte a [ game_logic::open_directions1#0 ]
reg byte y [ game_logic::open_directions1#1 ]
reg byte a [ choose_direction::return#1 ]
reg byte a [ game_logic::$140 ]
reg byte x [ game_logic::$226 ]
zp[1]:98 [ game_logic::ghost2_xtile#0 ]
zp[1]:99 [ game_logic::ghost2_ytile#0 ]
zp[1]:92 [ game_logic::ghost2_xtile#0 ]
reg byte a [ level_tile_directions::return#11 ]
reg byte a [ game_logic::open_directions2#0 ]
reg byte y [ game_logic::open_directions2#1 ]
reg byte a [ choose_direction::return#2 ]
reg byte a [ game_logic::$161 ]
reg byte x [ game_logic::$229 ]
zp[1]:100 [ game_logic::ghost1_xtile#0 ]
zp[1]:101 [ game_logic::ghost1_ytile#0 ]
zp[1]:93 [ game_logic::ghost1_xtile#0 ]
reg byte a [ level_tile_directions::return#12 ]
reg byte a [ game_logic::open_directions3#0 ]
reg byte y [ game_logic::open_directions3#1 ]
@ -1707,8 +1699,7 @@ reg byte a [ done_run::$8 ]
reg byte x [ done_run::pixels#0 ]
reg byte a [ level_tile_directions::$5 ]
zp[2]:49 [ level_tile_directions::ytiles#0 ]
zp[1]:76 [ choose_direction::xdiff#0 ]
zp[1]:75 [ choose_direction::ydiff#0 ]
zp[1]:75 [ choose_direction::xdiff#0 ]
reg byte a [ choose_direction::$2 ]
reg byte a [ choose_direction::$4 ]
reg byte a [ choose_direction::$6 ]
@ -1743,7 +1734,7 @@ reg byte a [ level_tile_get::$5 ]
reg byte a [ render_tiles::$0 ]
zp[2]:13 [ render_tiles::tile_left_pixels#0 level_tile_get::ytiles#0 render::render_index_xcol#0 init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ]
reg byte a [ render_tiles::$2 ]
zp[2]:11 [ render_tiles::tile_right_pixels#0 splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::dst#2 memset::dst#4 memset::dst#1 ]
zp[2]:11 [ render_tiles::tile_right_pixels#0 splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ]
reg byte x [ render_tiles::$4 ]
reg byte a [ render_tiles::$5 ]
zp[2]:17 [ render_tiles::render_index_xcol#0 ]

View File

@ -3957,17 +3957,17 @@ Eliminating unused variable memset::return#2 and assignment [51] memset::return#
Eliminating unused variable memcpy::return#2 and assignment [55] memcpy::return#2 = memcpy::destination#6
Eliminating unused variable memcpy::return#3 and assignment [59] memcpy::return#3 = memcpy::destination#6
Eliminating unused variable memcpy::return#4 and assignment [61] memcpy::return#4 = memcpy::destination#6
Eliminating unused variable plexPrepareFrame::$21 and assignment [242] plexPrepareFrame::$21 = plexPrepareFrame::$25
Eliminating unused variable plexPrepareFrame::$22 and assignment [245] plexPrepareFrame::$22 = plexPrepareFrame::$26 + OFFSET_STRUCT_BUCKETSPRITE_PLEX_ID
Eliminating unused variable plexPrepareFrame::$23 and assignment [259] plexPrepareFrame::$23 = plexPrepareFrame::$27
Eliminating unused variable plexPrepareFrame::$24 and assignment [262] plexPrepareFrame::$24 = plexPrepareFrame::$28
Eliminating unused variable memcpy::return#5 and assignment [293] memcpy::return#5 = memcpy::destination#6
Eliminating unused variable memcpy::return#6 and assignment [295] memcpy::return#6 = memcpy::destination#6
Eliminating unused variable memset::return#3 and assignment [303] memset::return#3 = memset::str#6
Eliminating unused variable memset::return#4 and assignment [307] memset::return#4 = memset::str#6
Eliminating unused variable memset::return#5 and assignment [309] memset::return#5 = memset::str#6
Eliminating unused variable memcpy::return#7 and assignment [317] memcpy::return#7 = memcpy::destination#6
Eliminating unused variable memset::return#6 and assignment [343] memset::return#6 = memset::str#6
Eliminating unused variable plexPrepareFrame::$21 and assignment [244] plexPrepareFrame::$21 = plexPrepareFrame::$25
Eliminating unused variable plexPrepareFrame::$22 and assignment [247] plexPrepareFrame::$22 = plexPrepareFrame::$26 + OFFSET_STRUCT_BUCKETSPRITE_PLEX_ID
Eliminating unused variable plexPrepareFrame::$23 and assignment [261] plexPrepareFrame::$23 = plexPrepareFrame::$27
Eliminating unused variable plexPrepareFrame::$24 and assignment [264] plexPrepareFrame::$24 = plexPrepareFrame::$28
Eliminating unused variable memcpy::return#5 and assignment [296] memcpy::return#5 = memcpy::destination#6
Eliminating unused variable memcpy::return#6 and assignment [298] memcpy::return#6 = memcpy::destination#6
Eliminating unused variable memset::return#3 and assignment [306] memset::return#3 = memset::str#6
Eliminating unused variable memset::return#4 and assignment [310] memset::return#4 = memset::str#6
Eliminating unused variable memset::return#5 and assignment [312] memset::return#5 = memset::str#6
Eliminating unused variable memcpy::return#7 and assignment [320] memcpy::return#7 = memcpy::destination#6
Eliminating unused variable memset::return#6 and assignment [346] memset::return#6 = memset::str#6
Eliminating unused constant OFFSET_STRUCT_MOS6526_CIA_PORT_A
Eliminating unused constant OFFSET_STRUCT_MOS6569_VICII_SPRITE0_X
Eliminating unused constant OFFSET_STRUCT_BUCKETSPRITE_YPOS
@ -3992,50 +3992,50 @@ Alias candidate removed (volatile)plex_real_sprite_idx = plexBucketShow::$1
Alias candidate removed (volatile)vsp_fine_scroll = irq_swing_plex::$6
Alias candidate removed (volatile)vsp_scroll = irq_swing_plex::$16
Simple Condition part1_loop::$2 [87] if(0==sparkler_active) goto part1_loop::@10
Simple Condition flipper_fix_colors::$0 [188] if(irq_flipper_top_line>$2e) goto flipper_fix_colors::@6
Simple Condition plexPrepareFrame::$7 [221] if(plexPrepareFrame::s#1!=$ff) goto plexPrepareFrame::@19
Simple Condition part2_loop::$21 [365] if(0!=p2_logo_revealing) goto part2_loop::@13
Simple Condition part2_loop::$6 [368] if(0==p2_logo_revealing) goto part2_loop::@14
Simple Condition part2_loop::$10 [371] if(0==p2_logo_swinging) goto part2_loop::@15
Simple Condition part2_loop::$13 [375] if(0==p2_plex_scroller_moving) goto part2_loop::@16
Condition not simple part1_loop::$3 [565] if(part1_loop::$3) goto part1_loop::@3
Condition not simple part1_loop::$3 [95] if(part1_loop::$3) goto part1_loop::@3
Introduced intermediate condition variable part1_loop::$11 = demo_frame_count
Simple Condition part1_loop::$3 [565] if(part1_loop::$11>(unsigned int)9*$32-3) goto part1_loop::@3
Simple Condition flipper_fix_colors::$1 [566] if(irq_flipper_top_line<$f6) goto flipper_fix_colors::@1
Simple Condition plexPrepareFrame::$8 [567] if(plexPrepareFrame::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexPrepareFrame::s#1]]) goto plexPrepareFrame::@5
Simple Condition part2_loop::$2 [568] if(0==p2_logo_reveal_done) goto part2_loop::@3
Condition not simple part2_loop::$7 [569] if(part2_loop::$7) goto part2_loop::@8
Simple Condition part1_loop::$3 [95] if(part1_loop::$11>(unsigned int)9*$32-3) goto part1_loop::@3
Simple Condition flipper_fix_colors::$0 [189] if(irq_flipper_top_line>$2e) goto flipper_fix_colors::@6
Simple Condition flipper_fix_colors::$1 [204] if(irq_flipper_top_line<$f6) goto flipper_fix_colors::@1
Simple Condition plexPrepareFrame::$7 [223] if(plexPrepareFrame::s#1!=$ff) goto plexPrepareFrame::@19
Simple Condition plexPrepareFrame::$8 [259] if(plexPrepareFrame::nxt_y#0<PLEX_YPOS[PLEX_SORTED_IDX[plexPrepareFrame::s#1]]) goto plexPrepareFrame::@5
Simple Condition part2_loop::$21 [368] if(0!=p2_logo_revealing) goto part2_loop::@13
Simple Condition part2_loop::$6 [371] if(0==p2_logo_revealing) goto part2_loop::@14
Simple Condition part2_loop::$10 [374] if(0==p2_logo_swinging) goto part2_loop::@15
Simple Condition part2_loop::$13 [378] if(0==p2_plex_scroller_moving) goto part2_loop::@16
Simple Condition part2_loop::$2 [382] if(0==p2_logo_reveal_done) goto part2_loop::@3
Condition not simple part2_loop::$7 [383] if(part2_loop::$7) goto part2_loop::@8
Introduced intermediate condition variable part2_loop::$23 = demo_frame_count
Simple Condition part2_loop::$7 [569] if(part2_loop::$23>(unsigned int)$12*$32+$19) goto part2_loop::@8
Simple Condition part2_loop::$22 [571] if(0!=p2_logo_reveal_done) goto part2_loop::@9
Condition not simple part2_loop::$14 [572] if(part2_loop::$14) goto part2_loop::@10
Simple Condition part2_loop::$7 [383] if(part2_loop::$23>(unsigned int)$12*$32+$19) goto part2_loop::@8
Simple Condition part2_loop::$22 [385] if(0!=p2_logo_reveal_done) goto part2_loop::@9
Condition not simple part2_loop::$14 [386] if(part2_loop::$14) goto part2_loop::@10
Introduced intermediate condition variable part2_loop::$24 = demo_frame_count
Simple Condition part2_loop::$14 [572] if(part2_loop::$24>(unsigned int)$1a*$32) goto part2_loop::@10
Simple Condition part2_loop::$14 [386] if(part2_loop::$24>(unsigned int)$1a*$32) goto part2_loop::@10
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [87] if(0!=sparkler_active) goto part1_loop::@4
Negating conditional jump and destination [188] if(irq_flipper_top_line<=$2e) goto flipper_fix_colors::@return
Negating conditional jump and destination [221] if(plexPrepareFrame::s#1==$ff) goto plexPrepareFrame::@6
Negating conditional jump and destination [365] if(0==p2_logo_revealing) goto part2_loop::@4
Negating conditional jump and destination [368] if(0!=p2_logo_revealing) goto part2_loop::@5
Negating conditional jump and destination [371] if(0!=p2_logo_swinging) goto part2_loop::@6
Negating conditional jump and destination [375] if(0!=p2_plex_scroller_moving) goto part2_loop::@7
Negating conditional jump and destination [565] if(part1_loop::$11<=(unsigned int)9*$32-3) goto part1_loop::@4
Negating conditional jump and destination [569] if(part2_loop::$23<=(unsigned int)$12*$32+$19) goto part2_loop::@5
Negating conditional jump and destination [571] if(0==p2_logo_reveal_done) goto part2_loop::@6
Negating conditional jump and destination [572] if(part2_loop::$24<=(unsigned int)$1a*$32) goto part2_loop::@7
Negating conditional jump and destination [95] if(part1_loop::$11<=(unsigned int)9*$32-3) goto part1_loop::@4
Negating conditional jump and destination [189] if(irq_flipper_top_line<=$2e) goto flipper_fix_colors::@return
Negating conditional jump and destination [223] if(plexPrepareFrame::s#1==$ff) goto plexPrepareFrame::@6
Negating conditional jump and destination [368] if(0==p2_logo_revealing) goto part2_loop::@4
Negating conditional jump and destination [371] if(0!=p2_logo_revealing) goto part2_loop::@5
Negating conditional jump and destination [374] if(0!=p2_logo_swinging) goto part2_loop::@6
Negating conditional jump and destination [378] if(0!=p2_plex_scroller_moving) goto part2_loop::@7
Negating conditional jump and destination [383] if(part2_loop::$23<=(unsigned int)$12*$32+$19) goto part2_loop::@5
Negating conditional jump and destination [385] if(0==p2_logo_reveal_done) goto part2_loop::@6
Negating conditional jump and destination [386] if(part2_loop::$24<=(unsigned int)$1a*$32) goto part2_loop::@7
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [76] part1_run::toSpritePtr1_$0 = part1_run::toSpritePtr1_$1 / $40
Constant right-side identified [109] irq_part1_top::toDd001_$0 = byte1 (unsigned int)irq_part1_top::toDd001_gfx#0
Constant right-side identified [113] irq_part1_top::toD0181_$0 = irq_part1_top::toD0181_$7 & $3fff
Constant right-side identified [116] irq_part1_top::toD0181_$3 = byte1 (unsigned int)irq_part1_top::toD0181_gfx#0
Constant right-side identified [156] irq_flipper_bottom::toD0181_$0 = irq_flipper_bottom::toD0181_$7 & $3fff
Constant right-side identified [159] irq_flipper_bottom::toD0181_$3 = byte1 (unsigned int)irq_flipper_bottom::toD0181_gfx#0
Constant right-side identified [315] part2_init::toSpritePtr1_$0 = part2_init::toSpritePtr1_$1 / $40
Constant right-side identified [333] part2_run::toDd001_$0 = byte1 (unsigned int)part2_run::toDd001_gfx#0
Constant right-side identified [337] part2_run::toD0181_$0 = part2_run::toD0181_$7 & $3fff
Constant right-side identified [340] part2_run::toD0181_$3 = byte1 (unsigned int)part2_run::toD0181_gfx#0
Constant right-side identified [400] plex_scroller_move::toSpritePtr1_$0 = plex_scroller_move::toSpritePtr1_$1 / $40
Constant right-side identified [519] sparkler_anim::toSpritePtr1_$0 = sparkler_anim::toSpritePtr1_$1 / $40
Constant right-side identified [110] irq_part1_top::toDd001_$0 = byte1 (unsigned int)irq_part1_top::toDd001_gfx#0
Constant right-side identified [114] irq_part1_top::toD0181_$0 = irq_part1_top::toD0181_$7 & $3fff
Constant right-side identified [117] irq_part1_top::toD0181_$3 = byte1 (unsigned int)irq_part1_top::toD0181_gfx#0
Constant right-side identified [157] irq_flipper_bottom::toD0181_$0 = irq_flipper_bottom::toD0181_$7 & $3fff
Constant right-side identified [160] irq_flipper_bottom::toD0181_$3 = byte1 (unsigned int)irq_flipper_bottom::toD0181_gfx#0
Constant right-side identified [318] part2_init::toSpritePtr1_$0 = part2_init::toSpritePtr1_$1 / $40
Constant right-side identified [336] part2_run::toDd001_$0 = byte1 (unsigned int)part2_run::toDd001_gfx#0
Constant right-side identified [340] part2_run::toD0181_$0 = part2_run::toD0181_$7 & $3fff
Constant right-side identified [343] part2_run::toD0181_$3 = byte1 (unsigned int)part2_run::toD0181_gfx#0
Constant right-side identified [408] plex_scroller_move::toSpritePtr1_$0 = plex_scroller_move::toSpritePtr1_$1 / $40
Constant right-side identified [527] sparkler_anim::toSpritePtr1_$0 = sparkler_anim::toSpritePtr1_$1 / $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant part1_run::toSpritePtr1_$0 = part1_run::toSpritePtr1_$1/$40
Constant irq_part1_top::toDd001_$0 = byte1 (unsigned int)irq_part1_top::toDd001_gfx#0
@ -4055,7 +4055,7 @@ Constant part2_init::toSpritePtr1_return#0 = (char)part2_init::toSpritePtr1_$0
Constant plex_scroller_move::toSpritePtr1_return#0 = (char)plex_scroller_move::toSpritePtr1_$0
Constant sparkler_anim::toSpritePtr1_return#0 = (char)sparkler_anim::toSpritePtr1_$0
Successful SSA optimization Pass2ConstantIdentification
Rewriting conditional comparison [188] if(irq_flipper_top_line<=$2e) goto flipper_fix_colors::@return
Rewriting conditional comparison [189] if(irq_flipper_top_line<=$2e) goto flipper_fix_colors::@return
Adding number conversion cast (unumber) 8*9*8 in
Adding number conversion cast (unumber) $130 in
Adding number conversion cast (unumber) $30 in
@ -4077,15 +4077,15 @@ Alias candidate removed (volatile)irq_flipper_bottom_line = irq_flipper_bottom::
Alias candidate removed (volatile)plex_real_sprite_idx = plexBucketShow::$1
Alias candidate removed (volatile)vsp_fine_scroll = irq_swing_plex::$6
Alias candidate removed (volatile)vsp_scroll = irq_swing_plex::$16
Constant right-side identified [106] irq_part1_top::toDd001_$1 = irq_part1_top::toDd001_$0 / $40
Constant right-side identified [109] irq_part1_top::toD0181_$1 = irq_part1_top::toD0181_$0 * 4
Constant right-side identified [111] irq_part1_top::toD0181_$4 = irq_part1_top::toD0181_$3 / 4
Constant right-side identified [150] irq_flipper_bottom::toD0181_$1 = irq_flipper_bottom::toD0181_$0 * 4
Constant right-side identified [152] irq_flipper_bottom::toD0181_$4 = irq_flipper_bottom::toD0181_$3 / 4
Constant right-side identified [303] part2_init::$17 = part2_init::toSpritePtr1_return#0 + ' '
Constant right-side identified [319] part2_run::toDd001_$1 = part2_run::toDd001_$0 / $40
Constant right-side identified [322] part2_run::toD0181_$1 = part2_run::toD0181_$0 * 4
Constant right-side identified [324] part2_run::toD0181_$4 = part2_run::toD0181_$3 / 4
Constant right-side identified [107] irq_part1_top::toDd001_$1 = irq_part1_top::toDd001_$0 / $40
Constant right-side identified [110] irq_part1_top::toD0181_$1 = irq_part1_top::toD0181_$0 * 4
Constant right-side identified [112] irq_part1_top::toD0181_$4 = irq_part1_top::toD0181_$3 / 4
Constant right-side identified [151] irq_flipper_bottom::toD0181_$1 = irq_flipper_bottom::toD0181_$0 * 4
Constant right-side identified [153] irq_flipper_bottom::toD0181_$4 = irq_flipper_bottom::toD0181_$3 / 4
Constant right-side identified [306] part2_init::$17 = part2_init::toSpritePtr1_return#0 + ' '
Constant right-side identified [322] part2_run::toDd001_$1 = part2_run::toDd001_$0 / $40
Constant right-side identified [325] part2_run::toD0181_$1 = part2_run::toD0181_$0 * 4
Constant right-side identified [327] part2_run::toD0181_$4 = part2_run::toD0181_$3 / 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant irq_part1_top::toDd001_$1 = irq_part1_top::toDd001_$0/$40
Constant irq_part1_top::toD0181_$1 = irq_part1_top::toD0181_$0*4
@ -4103,14 +4103,14 @@ Alias candidate removed (volatile)irq_flipper_bottom_line = irq_flipper_bottom::
Alias candidate removed (volatile)plex_real_sprite_idx = plexBucketShow::$1
Alias candidate removed (volatile)vsp_fine_scroll = irq_swing_plex::$6
Alias candidate removed (volatile)vsp_scroll = irq_swing_plex::$16
Constant right-side identified [106] irq_part1_top::toDd001_return#0 = 3 ^ irq_part1_top::toDd001_$1
Constant right-side identified [108] irq_part1_top::toD0181_$2 = byte1 irq_part1_top::toD0181_$1
Constant right-side identified [109] irq_part1_top::toD0181_$5 = irq_part1_top::toD0181_$4 & $f
Constant right-side identified [147] irq_flipper_bottom::toD0181_$2 = byte1 irq_flipper_bottom::toD0181_$1
Constant right-side identified [148] irq_flipper_bottom::toD0181_$5 = irq_flipper_bottom::toD0181_$4 & $f
Constant right-side identified [313] part2_run::toDd001_return#0 = 3 ^ part2_run::toDd001_$1
Constant right-side identified [315] part2_run::toD0181_$2 = byte1 part2_run::toD0181_$1
Constant right-side identified [316] part2_run::toD0181_$5 = part2_run::toD0181_$4 & $f
Constant right-side identified [107] irq_part1_top::toDd001_return#0 = 3 ^ irq_part1_top::toDd001_$1
Constant right-side identified [109] irq_part1_top::toD0181_$2 = byte1 irq_part1_top::toD0181_$1
Constant right-side identified [110] irq_part1_top::toD0181_$5 = irq_part1_top::toD0181_$4 & $f
Constant right-side identified [148] irq_flipper_bottom::toD0181_$2 = byte1 irq_flipper_bottom::toD0181_$1
Constant right-side identified [149] irq_flipper_bottom::toD0181_$5 = irq_flipper_bottom::toD0181_$4 & $f
Constant right-side identified [316] part2_run::toDd001_return#0 = 3 ^ part2_run::toDd001_$1
Constant right-side identified [318] part2_run::toD0181_$2 = byte1 part2_run::toD0181_$1
Constant right-side identified [319] part2_run::toD0181_$5 = part2_run::toD0181_$4 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant irq_part1_top::toDd001_return#0 = 3^irq_part1_top::toDd001_$1
Constant irq_part1_top::toD0181_$2 = byte1 irq_part1_top::toD0181_$1
@ -4126,8 +4126,8 @@ Simplifying constant evaluating to zero irq_part1_top::toD0181_$4&$f in
Simplifying constant evaluating to zero 3^part2_run::toDd001_$1 in
Simplifying constant evaluating to zero part2_run::toD0181_$4&$f in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero irq_part1_top::toD0181_$2 in [110] irq_part1_top::toD0181_return#0 = irq_part1_top::toD0181_$2 | irq_part1_top::toD0181_$5
Simplifying expression containing zero part2_run::toD0181_$2 in [317] part2_run::toD0181_return#0 = part2_run::toD0181_$2 | part2_run::toD0181_$5
Simplifying expression containing zero irq_part1_top::toD0181_$2 in [111] irq_part1_top::toD0181_return#0 = irq_part1_top::toD0181_$2 | irq_part1_top::toD0181_$5
Simplifying expression containing zero part2_run::toD0181_$2 in [320] part2_run::toD0181_return#0 = part2_run::toD0181_$2 | part2_run::toD0181_$5
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant irq_part1_top::toDd001_$1
Eliminating unused constant irq_part1_top::toD0181_$4
@ -4152,7 +4152,7 @@ Alias candidate removed (volatile)irq_flipper_bottom_line = irq_flipper_bottom::
Alias candidate removed (volatile)plex_real_sprite_idx = plexBucketShow::$1
Alias candidate removed (volatile)vsp_fine_scroll = irq_swing_plex::$6
Alias candidate removed (volatile)vsp_scroll = irq_swing_plex::$16
Constant right-side identified [144] irq_flipper_bottom::toD0181_return#0 = irq_flipper_bottom::toD0181_$2 | irq_flipper_bottom::toD0181_$5
Constant right-side identified [145] irq_flipper_bottom::toD0181_return#0 = irq_flipper_bottom::toD0181_$2 | irq_flipper_bottom::toD0181_$5
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant irq_part1_top::toD0181_return#0 = irq_part1_top::toD0181_$2
Constant irq_flipper_bottom::toD0181_return#0 = irq_flipper_bottom::toD0181_$2|irq_flipper_bottom::toD0181_$5
@ -4169,24 +4169,24 @@ Inlining Noop Cast [2] memcpy::dst#0 = (char *)memcpy::destination#6 keeping mem
Inlining Noop Cast [3] memcpy::$2 = (char *)memcpy::source#6 keeping memcpy::source#6
Inlining Noop Cast [13] memset::$4 = (char *)memset::str#6 keeping memset::str#6
Inlining Noop Cast [15] memset::dst#0 = (char *)memset::str#6 keeping memset::str#6
Inlining Noop Cast [213] plexPrepareFrame::$25 = (char *)plexPrepareFrame::sprite#4 keeping plexPrepareFrame::sprite#4
Inlining Noop Cast [215] plexPrepareFrame::$26 = (char *)plexPrepareFrame::sprite#4 keeping plexPrepareFrame::sprite#4
Inlining Noop Cast [228] plexPrepareFrame::$27 = (char *)plexPrepareFrame::sprite#3 keeping plexPrepareFrame::sprite#3
Inlining Noop Cast [230] plexPrepareFrame::$28 = (char *)plexPrepareFrame::sprite#3 keeping plexPrepareFrame::sprite#3
Inlining Noop Cast [236] plexBucketShow::bucket_ptr#0 = (char *)plexBucketShow::bucket#2 keeping plexBucketShow::bucket#2
Inlining Noop Cast [215] plexPrepareFrame::$25 = (char *)plexPrepareFrame::sprite#4 keeping plexPrepareFrame::sprite#4
Inlining Noop Cast [217] plexPrepareFrame::$26 = (char *)plexPrepareFrame::sprite#4 keeping plexPrepareFrame::sprite#4
Inlining Noop Cast [230] plexPrepareFrame::$27 = (char *)plexPrepareFrame::sprite#3 keeping plexPrepareFrame::sprite#3
Inlining Noop Cast [232] plexPrepareFrame::$28 = (char *)plexPrepareFrame::sprite#3 keeping plexPrepareFrame::sprite#3
Inlining Noop Cast [239] plexBucketShow::bucket_ptr#0 = (char *)plexBucketShow::bucket#2 keeping plexBucketShow::bucket#2
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [149] irq_flipper_bottom::$12 = irq_flipper_idx * SIZEOF_UNSIGNED_INT
Rewriting division to use shift [168] flipper_fix_colors::$5 = flipper_fix_colors::$4 / 8
Rewriting multiplication to use shift and addition[172] flipper_fix_colors::offset#0 = flipper_fix_colors::$12 * $28
Rewriting multiplication to use shift [237] plexBucketShow::real_idx#0 = plex_real_sprite_idx * 2
Rewriting division to use shift [244] plexBucketShow::real_idx#1 = plexBucketShow::real_idx#4 / 2
Rewriting multiplication to use shift [251] plexBucketShow::real_idx#3 = plexBucketShow::real_idx#2 * 2
Rewriting division to use shift [255] plexBucketShow::$1 = plexBucketShow::real_idx#8 / 2
Rewriting multiplication to use shift [400] irq_swing_plex::$26 = irq_swing_plex::$27 * SIZEOF_UNSIGNED_INT
Rewriting division to use shift [407] irq_swing_plex::$7 = irq_swing_plex::scroll#0 / 8
Rewriting multiplication to use shift [434] update_frame_plex_id_offset::$0 = update_frame_plex_id_offset::plex_frame_id#0 * SIZEOF_UNSIGNED_INT
Rewriting multiplication to use shift [442] vsp_update_screen::x_offset8 = vsp_update_screen::$5 * 8
Rewriting division to use shift [475] sparkler_anim::$3 = sparkler_idx / 2
Rewriting multiplication to use shift [150] irq_flipper_bottom::$12 = irq_flipper_idx * SIZEOF_UNSIGNED_INT
Rewriting division to use shift [169] flipper_fix_colors::$5 = flipper_fix_colors::$4 / 8
Rewriting multiplication to use shift and addition[173] flipper_fix_colors::offset#0 = flipper_fix_colors::$12 * $28
Rewriting multiplication to use shift [240] plexBucketShow::real_idx#0 = plex_real_sprite_idx * 2
Rewriting division to use shift [247] plexBucketShow::real_idx#1 = plexBucketShow::real_idx#4 / 2
Rewriting multiplication to use shift [254] plexBucketShow::real_idx#3 = plexBucketShow::real_idx#2 * 2
Rewriting division to use shift [258] plexBucketShow::$1 = plexBucketShow::real_idx#8 / 2
Rewriting multiplication to use shift [407] irq_swing_plex::$26 = irq_swing_plex::$27 * SIZEOF_UNSIGNED_INT
Rewriting division to use shift [414] irq_swing_plex::$7 = irq_swing_plex::scroll#0 / 8
Rewriting multiplication to use shift [441] update_frame_plex_id_offset::$0 = update_frame_plex_id_offset::plex_frame_id#0 * SIZEOF_UNSIGNED_INT
Rewriting multiplication to use shift [449] vsp_update_screen::x_offset8 = vsp_update_screen::$5 * 8
Rewriting division to use shift [482] sparkler_anim::$3 = sparkler_idx / 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings memcpy::destination#0
Inlining constant with var siblings memcpy::source#0
@ -4389,10 +4389,18 @@ Finalized unsigned number type (char) 8
Finalized unsigned number type (unsigned int) $400
Finalized unsigned number type (char) $e
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) $20
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) $12
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) $19
Finalized unsigned number type (char) $1a
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 8
@ -4404,14 +4412,6 @@ Finalized unsigned number type (char) 5
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) $10
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) $12
Finalized unsigned number type (char) $32
Finalized unsigned number type (char) $19
Finalized unsigned number type (char) $1a
Finalized unsigned number type (char) $32
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying constant integer cast $20-1
Simplifying constant integer cast 8*9