mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-01-02 05:30:53 +00:00
Fixed tests.
This commit is contained in:
parent
f8191e8345
commit
ceb271d021
@ -14,13 +14,10 @@ signed word[512] align($100) sin;
|
||||
|
||||
signed word* sin2 = $1400;
|
||||
|
||||
kickasm {{
|
||||
.label pc_restore = *
|
||||
.pc = $1400
|
||||
kickasm(pc sin2) {{
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
}}
|
||||
|
||||
void main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label SPRITES_XPOS = $d000
|
||||
.label SPRITES_YPOS = $d001
|
||||
@ -35,8 +35,6 @@
|
||||
.label COSQ = SINQ+$40
|
||||
.label sx = 2
|
||||
.label sy = 3
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
sei
|
||||
jsr sprites_init
|
||||
|
@ -10609,6 +10609,9 @@ Removing instruction breturn:
|
||||
Removing instruction b1_from_sprites_init:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b13
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
@ -10616,9 +10619,11 @@ Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Fixing long branch [308] bne b1 to beq
|
||||
Fixing long branch [976] bne b2 to beq
|
||||
Fixing long branch [986] bne b1 to beq
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Fixing long branch [306] bne b1 to beq
|
||||
Fixing long branch [974] bne b2 to beq
|
||||
Fixing long branch [984] bne b1 to beq
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @33
|
||||
@ -11242,11 +11247,11 @@ reg byte a [ calculate_matrix::$34 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 85532
|
||||
Score: 85526
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label SPRITES_XPOS = $d000
|
||||
@ -11284,7 +11289,6 @@ Score: 85532
|
||||
.label sx = 2
|
||||
.label sy = 3
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @33
|
||||
//SEG4 kickasm(location (const byte*) mulf_sqr1#0) {{ .for(var i=0;i<$200;i++) { .if(i<=159) { .byte round((i*i)/256) } .if(i>159 && i<=351 ) { .byte round(((i-256)*(i-256))/256) } .if(i>351) { .byte round(((512-i)*(512-i))/256) } } }}
|
||||
//SEG5 kickasm(location (const byte*) mulf_sqr2#0) {{ .for(var i=0;i<$200;i++) { .if(i<=159) { .byte round((-i-1)*(-i-1)/256) } .if(i>159 && i<=351 ) { .byte round(((255-i)*(255-i))/256) } .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }}
|
||||
@ -11297,7 +11301,6 @@ bbegin:
|
||||
//SEG12 kickasm(location (const byte*) SINQ_LO#0) {{ { .var min = -$1000 .var max = $1000 .var ampl = max-min; .for(var i=0;i<$140;i++) { .var rad = i*2*PI/256; .byte <(min+(ampl/2)+(ampl/2)*sin(rad)) } } }}
|
||||
//SEG13 kickasm(location (const byte*) SINQ_HI#0) {{ { .var min = -$1000 .var max = $1000 .var ampl = max-min; .for(var i=0;i<$140;i++) { .var rad = i*2*PI/256; .byte >(min+(ampl/2)+(ampl/2)*sin(rad)) } } }}
|
||||
//SEG14 [11] call main
|
||||
jsr main
|
||||
//SEG15 [12] phi from @33 to @end [phi:@33->@end]
|
||||
//SEG16 @end
|
||||
//SEG17 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label xr = $f0
|
||||
.label yr = $f1
|
||||
@ -9,8 +9,6 @@
|
||||
.label PERSP_Z = $2400
|
||||
.label print_char_cursor = 4
|
||||
.label print_line_cursor = 2
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
sei
|
||||
jsr mulf_init
|
||||
|
@ -3483,10 +3483,15 @@ Removing instruction breturn:
|
||||
Removing instruction b1_from_mulf_init:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @27
|
||||
@ -3713,11 +3718,11 @@ reg byte a [ mulf_init::$10 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 3787
|
||||
Score: 3781
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label xr = $f0
|
||||
@ -3729,11 +3734,9 @@ Score: 3787
|
||||
.label print_char_cursor = 4
|
||||
.label print_line_cursor = 2
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @27
|
||||
//SEG4 kickasm(location (const signed byte*) PERSP_Z#0) {{ { .var d = 256.0 .var z0 = 5.0 .for(var z=0;z<$100;z++) { .if(z>127) { .byte round(d / (z0 - ((z - 256) / 64.0))); } else { .byte round(d / (z0 - (z / 64.0))); } } } }}
|
||||
//SEG5 [2] call main
|
||||
jsr main
|
||||
//SEG6 [3] phi from @27 to @end [phi:@27->@end]
|
||||
//SEG7 @end
|
||||
//SEG8 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label print_line_cursor = $400
|
||||
.label ap = $fd
|
||||
@ -7,8 +7,6 @@
|
||||
.label cp = $ff
|
||||
.label mulf_sqr1 = $2000
|
||||
.label mulf_sqr2 = $2200
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
.label at = 2
|
||||
.label at_3 = 5
|
||||
|
@ -2549,6 +2549,9 @@ Removing instruction breturn:
|
||||
Removing instruction b1_from_print_cls:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b3
|
||||
@ -2556,6 +2559,8 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @22
|
||||
@ -2697,11 +2702,11 @@ reg byte a [ fmul8::return#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 10542
|
||||
Score: 10536
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label print_line_cursor = $400
|
||||
@ -2711,13 +2716,11 @@ Score: 10542
|
||||
.label mulf_sqr1 = $2000
|
||||
.label mulf_sqr2 = $2200
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @22
|
||||
//SEG4 kickasm(location (const byte*) mulf_sqr1#0) {{ .for(var i=0;i<$200;i++) { .if(i<=159) { .byte round((i*i)/256) } .if(i>159 && i<=351 ) { .byte round(((i-256)*(i-256))/256) } .if(i>351) { .byte round(((512-i)*(512-i))/256) } } }}
|
||||
//SEG5 kickasm(location (const byte*) mulf_sqr2#0) {{ .for(var i=0;i<$200;i++) { .if(i<=159) { .byte round((-i-1)*(-i-1)/256) } .if(i>159 && i<=351 ) { .byte round(((255-i)*(255-i))/256) } .if(i>351) { .byte round(((i-511)*(i-511))/256) } } }}
|
||||
//SEG6 [3] call main
|
||||
//SEG7 [5] phi from @22 to main [phi:@22->main]
|
||||
jsr main
|
||||
//SEG8 [4] phi from @22 to @end [phi:@22->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label SPRITES_XPOS = $d000
|
||||
.label SPRITES_YPOS = $d001
|
||||
@ -22,8 +22,6 @@
|
||||
.label plex_free_next = 3
|
||||
.label plex_show_idx = 4
|
||||
.label plex_sprite_msb = 5
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
sei
|
||||
jsr init
|
||||
|
@ -3945,6 +3945,9 @@ Removing instruction breturn:
|
||||
Removing instruction plexSetScreen1:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to breturn in bne b8
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b7
|
||||
@ -3957,6 +3960,7 @@ Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction ldx m
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b8:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp breturn
|
||||
@ -4231,11 +4235,11 @@ reg byte a [ init::$6 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 63466
|
||||
Score: 63460
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label SPRITES_XPOS = $d000
|
||||
@ -4260,14 +4264,12 @@ Score: 63466
|
||||
.label plex_show_idx = 4
|
||||
.label plex_sprite_msb = 5
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @12
|
||||
//SEG4 kickasm(location (const byte*) YSIN#0) {{ .var min = 50 .var max = 250-21 .var ampl = max-min; .for(var i=0;i<256;i++) .byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256))) }}
|
||||
//SEG5 kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }}
|
||||
//SEG6 [3] phi from @12 to @15 [phi:@12->@15]
|
||||
//SEG7 @15
|
||||
//SEG8 [4] call main
|
||||
jsr main
|
||||
//SEG9 [5] phi from @15 to @end [phi:@15->@end]
|
||||
//SEG10 @end
|
||||
//SEG11 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label SPRITES_XPOS = $d000
|
||||
.label SPRITES_YPOS = $d001
|
||||
@ -14,8 +14,6 @@
|
||||
.label COS = $2000
|
||||
.label SPRITE = $3000
|
||||
.label SIN = COS+$40
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
sei
|
||||
jsr init
|
||||
|
@ -4160,6 +4160,9 @@ Removing instruction b4_from_b3:
|
||||
Removing instruction b8:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b4 in bne b12
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b7
|
||||
@ -4167,11 +4170,12 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b12:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b4
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [134] bne b7 to beq
|
||||
Fixing long branch [132] bne b7 to beq
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @13
|
||||
@ -4483,11 +4487,11 @@ reg byte a [ mulf_init::$6 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 34706
|
||||
Score: 34700
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label SPRITES_XPOS = $d000
|
||||
@ -4504,13 +4508,11 @@ Score: 34706
|
||||
.label SPRITE = $3000
|
||||
.label SIN = COS+$40
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @13
|
||||
//SEG4 kickasm(location (const byte*) COS#0) {{ { .var min = -$7fff .var max = $7fff .var ampl = max-min; .for(var i=0;i<$140;i++) { .var rad = i*2*PI/256; .byte >round(min+(ampl/2)+(ampl/2)*cos(rad)) } } }}
|
||||
//SEG5 @16
|
||||
//SEG6 kickasm(location (const byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) .for (var x=0;x<3; x++) .byte pic.getSinglecolorByte(x,y) }}
|
||||
//SEG7 [3] call main
|
||||
jsr main
|
||||
//SEG8 [4] phi from @16 to @end [phi:@16->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label RASTER = $d012
|
||||
.label BORDERCOL = $d020
|
||||
@ -21,8 +21,6 @@
|
||||
.const XSIN_SIZE = $200
|
||||
.label rem16u = 2
|
||||
.label xsin_idx = 2
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
.const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f
|
||||
sei
|
||||
|
@ -7903,6 +7903,9 @@ Removing instruction b6:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b7 in bne b16
|
||||
Skipping double jump to b7 in bne b16
|
||||
Skipping double jump to b3 in beq b15
|
||||
@ -7925,6 +7928,7 @@ Removing instruction lda #0
|
||||
Removing instruction lda #0
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b16:
|
||||
Removing instruction b15:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
@ -8414,11 +8418,11 @@ reg byte a [ divr16u::$2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 41407
|
||||
Score: 41401
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label RASTER = $d012
|
||||
@ -8442,13 +8446,11 @@ Score: 41407
|
||||
.label rem16u = 2
|
||||
.label xsin_idx = 2
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @25
|
||||
//SEG4 kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }}
|
||||
//SEG5 [2] phi from @25 to @28 [phi:@25->@28]
|
||||
//SEG6 @28
|
||||
//SEG7 [3] call main
|
||||
jsr main
|
||||
//SEG8 [4] phi from @28 to @end [phi:@28->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label BORDERCOL = $d020
|
||||
.label BGCOL = $d021
|
||||
@ -15,8 +15,6 @@
|
||||
.const DARK_GREY = $b
|
||||
.label SCREEN = $400
|
||||
.label LOGO = $2000
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
.const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f
|
||||
lda #WHITE
|
||||
|
@ -1305,8 +1305,13 @@ Removing instruction b10:
|
||||
Removing instruction b1_from_b10:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @4
|
||||
@ -1452,11 +1457,11 @@ zp ZP_WORD:4 [ fill::addr#2 fill::addr#0 fill::addr#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 3578
|
||||
Score: 3572
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label BORDERCOL = $d020
|
||||
@ -1474,13 +1479,11 @@ Score: 3578
|
||||
.label SCREEN = $400
|
||||
.label LOGO = $2000
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @4
|
||||
//SEG4 kickasm(location (const byte*) LOGO#0) {{ .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) .for (var x=0;x<40; x++) .for(var cp=0; cp<8; cp++) .byte logoPic.getMulticolorByte(x,cp+y*8) }}
|
||||
//SEG5 [2] phi from @4 to @6 [phi:@4->@6]
|
||||
//SEG6 @6
|
||||
//SEG7 [3] call main
|
||||
jsr main
|
||||
//SEG8 [4] phi from @6 to @end [phi:@6->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label PROCPORT_DDR = 0
|
||||
.const PROCPORT_DDR_MEMORY_MASK = 7
|
||||
@ -24,15 +24,6 @@
|
||||
.const SIN_SIZE = $200
|
||||
.label sin2 = $1400
|
||||
.label rem16u = 2
|
||||
bbegin:
|
||||
.label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
|
||||
jsr main
|
||||
main: {
|
||||
.const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6
|
||||
.const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f
|
||||
@ -789,3 +780,8 @@ fill: {
|
||||
bitmap_plot_bit: .fill $100, 0
|
||||
.align $100
|
||||
sin: .fill 2*$200, 0
|
||||
.pc = sin2 "Inline"
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
|
||||
|
@ -2,12 +2,9 @@
|
||||
[0] phi()
|
||||
to:@29
|
||||
@29: scope:[] from @begin
|
||||
kickasm {{ .label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
kickasm(location (const signed word*) sin2#0) {{ .for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
}}
|
||||
to:@32
|
||||
@32: scope:[] from @29
|
||||
|
@ -703,12 +703,9 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
|
||||
(word) SIN_SIZE#0 ← (word/signed word/dword/signed dword) 512
|
||||
(signed word[512]) sin#0 ← { fill( 512, 0) }
|
||||
(signed word*) sin2#0 ← ((signed word*)) (word/signed word/dword/signed dword) 5120
|
||||
kickasm {{ .label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
kickasm(location (signed word*) sin2#0) {{ .for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
}}
|
||||
to:@32
|
||||
main: scope:[main] from @32
|
||||
@ -2641,12 +2638,9 @@ FINAL CONTROL FLOW GRAPH
|
||||
[0] phi()
|
||||
to:@29
|
||||
@29: scope:[] from @begin
|
||||
kickasm {{ .label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
kickasm(location (const signed word*) sin2#0) {{ .for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
}}
|
||||
to:@32
|
||||
@32: scope:[] from @29
|
||||
@ -3766,14 +3760,7 @@ bbegin:
|
||||
jmp b29
|
||||
//SEG3 @29
|
||||
b29:
|
||||
//SEG4 kickasm {{ .label pc_restore = * .pc = $1400 .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } .pc = pc_restore }}
|
||||
.label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
|
||||
//SEG4 kickasm(location (const signed word*) sin2#0) {{ .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } }}
|
||||
//SEG5 [2] phi from @29 to @32 [phi:@29->@32]
|
||||
b32_from_b29:
|
||||
jmp b32
|
||||
@ -5447,6 +5434,11 @@ fill: {
|
||||
bitmap_plot_bit: .fill $100, 0
|
||||
.align $100
|
||||
sin: .fill 2*$200, 0
|
||||
.pc = sin2 "Inline"
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Equivalence Class zp ZP_BYTE:193 [ bitmap_init::$4 ] has ALU potential.
|
||||
@ -5928,14 +5920,7 @@ bbegin:
|
||||
jmp b29
|
||||
//SEG3 @29
|
||||
b29:
|
||||
//SEG4 kickasm {{ .label pc_restore = * .pc = $1400 .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } .pc = pc_restore }}
|
||||
.label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
|
||||
//SEG4 kickasm(location (const signed word*) sin2#0) {{ .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } }}
|
||||
//SEG5 [2] phi from @29 to @32 [phi:@29->@32]
|
||||
b32_from_b29:
|
||||
jmp b32
|
||||
@ -7381,6 +7366,11 @@ fill: {
|
||||
bitmap_plot_bit: .fill $100, 0
|
||||
.align $100
|
||||
sin: .fill 2*$200, 0
|
||||
.pc = sin2 "Inline"
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b29
|
||||
@ -7504,6 +7494,7 @@ Replacing label b1_from_b1 with b1
|
||||
Replacing label b1_from_b1 with b1
|
||||
Removing instruction b29:
|
||||
Removing instruction b32_from_b29:
|
||||
Removing instruction b32:
|
||||
Removing instruction bend_from_b32:
|
||||
Removing instruction vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
|
||||
Removing instruction vicSelectGfxBank1_toDd001:
|
||||
@ -7551,7 +7542,6 @@ Removing instruction b10_from_b1:
|
||||
Removing instruction b2_from_b10:
|
||||
Removing instruction b1_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction b32:
|
||||
Removing instruction bend:
|
||||
Removing instruction vicSelectGfxBank1:
|
||||
Removing instruction vicSelectGfxBank1_b1:
|
||||
@ -7627,6 +7617,9 @@ Removing instruction breturn:
|
||||
Removing instruction b1_from_fill:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b2 in bne b10
|
||||
Skipping double jump to b2 in bne b10
|
||||
Skipping double jump to b3 in beq b15
|
||||
@ -7645,6 +7638,7 @@ Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b10:
|
||||
Removing instruction b15:
|
||||
Removing instruction b10:
|
||||
@ -7653,8 +7647,8 @@ Removing unreachable instruction jmp b2
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction jmp b2
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [150] bcc b1 to bcs
|
||||
Fixing long branch [156] bcc b1 to bcs
|
||||
Fixing long branch [141] bcc b1 to bcs
|
||||
Fixing long branch [147] bcc b1 to bcs
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @29
|
||||
@ -8171,11 +8165,11 @@ reg byte a [ bitmap_init::$7 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 28381
|
||||
Score: 28375
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label PROCPORT_DDR = 0
|
||||
@ -8202,20 +8196,11 @@ Score: 28381
|
||||
.label sin2 = $1400
|
||||
.label rem16u = 2
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @29
|
||||
//SEG4 kickasm {{ .label pc_restore = * .pc = $1400 .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } .pc = pc_restore }}
|
||||
.label pc_restore = *
|
||||
.pc = $1400
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
.pc = pc_restore
|
||||
|
||||
//SEG4 kickasm(location (const signed word*) sin2#0) {{ .for(var i=0; i<512; i++) { .word sin(toRadians([i*360]/512))*320 } }}
|
||||
//SEG5 [2] phi from @29 to @32 [phi:@29->@32]
|
||||
//SEG6 @32
|
||||
//SEG7 [3] call main
|
||||
jsr main
|
||||
//SEG8 [4] phi from @32 to @end [phi:@32->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
@ -9437,4 +9422,9 @@ fill: {
|
||||
bitmap_plot_bit: .fill $100, 0
|
||||
.align $100
|
||||
sin: .fill 2*$200, 0
|
||||
.pc = sin2 "Inline"
|
||||
.for(var i=0; i<512; i++) {
|
||||
.word sin(toRadians([i*360]/512))*320
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label RASTER = $d012
|
||||
.label BORDERCOL = $d020
|
||||
@ -61,8 +61,6 @@
|
||||
.label current_piece_73 = 5
|
||||
.label current_piece_74 = 5
|
||||
.label current_piece_75 = 5
|
||||
bbegin:
|
||||
jsr main
|
||||
main: {
|
||||
.label key_event = $14
|
||||
.label render = $15
|
||||
|
@ -12249,6 +12249,9 @@ Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b3 in bne b17
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label breturn_from_b6 to b3
|
||||
@ -12274,6 +12277,7 @@ Removing instruction jmp b2
|
||||
Removing instruction jmp b3
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing instruction ldy ypos2 with TAY
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b17:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b3
|
||||
@ -13115,11 +13119,11 @@ reg byte a [ render_init::$5 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 416966
|
||||
Score: 416960
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
.label RASTER = $d012
|
||||
@ -13183,14 +13187,12 @@ Score: 416966
|
||||
.label current_piece_74 = 5
|
||||
.label current_piece_75 = 5
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @23
|
||||
//SEG4 kickasm(location (const byte*) CHARSET#0) {{ .var charset = LoadPicture("charset.png", List().add($000000, $ffffff, $523fa0, $77c1c9)) .for (var c=0; c<16; c++) .for (var y=0;y<8; y++) .byte charset.getMulticolorByte(c,y) }}
|
||||
//SEG5 [2] phi from @23 to @26 [phi:@23->@26]
|
||||
//SEG6 @26
|
||||
//SEG7 [3] call main
|
||||
//SEG8 [5] phi from @26 to main [phi:@26->main]
|
||||
jsr main
|
||||
//SEG9 [4] phi from @26 to @end [phi:@26->@end]
|
||||
//SEG10 @end
|
||||
//SEG11 main
|
||||
|
@ -1,10 +1,8 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
bbegin:
|
||||
.byte 1, 2, 3
|
||||
|
||||
jsr main
|
||||
main: {
|
||||
b2:
|
||||
inc $d020
|
||||
|
@ -167,6 +167,11 @@ Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
@ -178,22 +183,20 @@ FINAL SYMBOL TABLE
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 2852
|
||||
Score: 2846
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG1 Global Constants & labels
|
||||
//SEG2 @begin
|
||||
bbegin:
|
||||
//SEG3 @1
|
||||
//SEG4 kickasm {{ .byte 1, 2, 3 }}
|
||||
.byte 1, 2, 3
|
||||
|
||||
//SEG5 [2] call main
|
||||
//SEG6 [4] phi from @1 to main [phi:@1->main]
|
||||
jsr main
|
||||
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
|
||||
//SEG8 @end
|
||||
//SEG9 main
|
||||
|
Loading…
Reference in New Issue
Block a user