1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-20 00:29:10 +00:00

Working on tetris

This commit is contained in:
jespergravgaard 2018-11-28 07:27:44 +01:00
parent c20389e310
commit 04d777ec6c
41 changed files with 7933 additions and 1081 deletions

View File

@ -0,0 +1,3 @@
sta {z1}
lda #0
sta {z1}+1

View File

@ -0,0 +1,6 @@
lda {z1}
and #<{c1}
sta {z1}
lda {z1}+1
and #>{c1}
sta {z1}+1

View File

@ -0,0 +1,6 @@
lda {z2}
and #<{c1}
sta {z1}
lda {z2}+1
and #>{c1}
sta {z1}+1

View File

@ -0,0 +1,7 @@
lda {z2}
clc
adc {z3}
sta {z1}
lda {z2}+1
adc #0
sta {z1}+1

View File

@ -36,7 +36,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
StatementAssignment assignment = (StatementAssignment) statement;
LValue lValue = assignment.getlValue();
if(lValue instanceof VariableRef && referenceInfos.isUnused((VariableRef) lValue) && !Pass2ConstantIdentification.isAddressOfUsed((VariableRef) lValue, getProgram())) {
if(getLog().isVerbosePass1CreateSsa()) {
if(getLog().isVerbosePass1CreateSsa()||getLog().isVerboseSSAOptimize()) {
getLog().append("Eliminating unused variable " + lValue.toString(getProgram()) + " and assignment " + assignment.toString(getProgram(), false));
}
stmtIt.remove();
@ -50,7 +50,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
StatementCall call = (StatementCall) statement;
LValue lValue = call.getlValue();
if(lValue instanceof VariableRef && referenceInfos.isUnused((VariableRef) lValue) && !Pass2ConstantIdentification.isAddressOfUsed((VariableRef) lValue, getProgram())) {
if(getLog().isVerbosePass1CreateSsa()) {
if(getLog().isVerbosePass1CreateSsa()||getLog().isVerboseSSAOptimize()) {
getLog().append("Eliminating unused variable - keeping the call " + lValue.toString(getProgram()));
}
Variable variable = getScope().getVariable((VariableRef) lValue);
@ -67,7 +67,7 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
StatementPhiBlock.PhiVariable phiVariable = phiVarIt.next();
VariableRef variableRef = phiVariable.getVariable();
if(referenceInfos.isUnused(variableRef) && !Pass2ConstantIdentification.isAddressOfUsed(variableRef, getProgram())) {
if(getLog().isVerbosePass1CreateSsa()) {
if(getLog().isVerbosePass1CreateSsa()||getLog().isVerboseSSAOptimize()) {
getLog().append("Eliminating unused variable - keeping the phi block " + variableRef.toString(getProgram()));
}
Variable variable = getScope().getVariable(variableRef);
@ -85,7 +85,9 @@ public class PassNEliminateUnusedVars extends Pass2SsaOptimization {
Collection<ConstantVar> allConstants = getScope().getAllConstants(true);
for(ConstantVar constant : allConstants) {
if(referenceInfos.isUnused(constant.getRef())) {
getLog().append("Eliminating unused constant " + constant.toString(getProgram()));
if(getLog().isVerbosePass1CreateSsa()||getLog().isVerboseSSAOptimize()) {
getLog().append("Eliminating unused constant " + constant.toString(getProgram()));
}
constant.getScope().remove(constant);
modified = true;
}

View File

@ -221,7 +221,7 @@ byte keyboard_event_pressed(byte keycode) {
// Get the next event from the keyboard event buffer.
// Returns $ff if there is no event waiting. As all events are <$7f it is enough to examine bit 7 when determining if there is any event to process.
// The buffer is filled by keyboard_scan()
// The buffer is filled by keyboard_event_scan()
byte keyboard_event_get() {
if(keyboard_events_size==0) {
return $ff;

View File

@ -49,6 +49,11 @@ public class TestPrograms {
compileAndCompare("examples/tetris/tetris");
}
//@Test
//public void testTetrisNullPointer() throws IOException, URISyntaxException {
// compileAndCompare("tetris-npe");
//}
@Test
public void testFastMultiply8() throws IOException, URISyntaxException {

View File

@ -1,6 +1,7 @@
// Tetris Game Implementation
import "c64"
import "memory"
import "keyboard"
byte* SCREEN = $400;
@ -9,28 +10,92 @@ byte*[20] screen_lines;
// Playfield 20 lines x 10 blocks. 0 is empty non-zero is color.
byte[20*10] playfield;
// The current piece
byte[4*4] current_piece;
// The current moving piece
byte* current_piece = 0;
// The curent piece orientation - each piece have 4 orientations (00/$10/$20/$30). The orientation chooses one of the 4 sub-graphics of the piece.
byte current_piece_orientation = 0;
// Position of top left corner of current moving piece on the playfield
byte current_xpos = 3;
byte current_ypos = 0;
// The rate of moving down the current piece (number of frames between moves if movedown is not not forced)
const byte current_movedown_rate = 50;
// The rate of moving down the current piece fast (number of frames between moves if movedown is not not forced)
const byte current_movedown_rate_fast = 5;
// Counts down til next movedown of current piece
byte current_movedown_counter = 0;
void main() {
init();
render_playfield();
render_current_piece();
render_current();
while(true) {
(*BORDERCOL)++;
// Wait for a frame to pass
while(*RASTER!=$ff) {}
while(*RASTER!=$fe) {}
// Scan keyboard events
keyboard_event_scan();
byte render = 0;
byte key_event = keyboard_event_get();
// Handle moving down current piece
++current_movedown_counter;
byte movedown = 0;
if(key_event==KEY_SPACE) {
movedown++;
}
if(keyboard_event_pressed(KEY_SPACE)!=0) {
if(current_movedown_counter>=current_movedown_rate_fast) {
movedown++;
}
}
if(current_movedown_counter>=current_movedown_rate) {
movedown++;
}
if(movedown!=0) {
current_movedown();
current_movedown_counter = 0;
render++;
}
// Handle other keyboard events
if((key_event&$80)==0) {
// New keyboard event
if(key_event==KEY_COMMA) {
current_xpos--;
render++;
}
if(key_event==KEY_DOT) {
current_xpos++;
render++;
}
if(key_event==KEY_Z) {
current_piece_orientation = (current_piece_orientation-$10)&$3f;
render++;
}
if(key_event==KEY_X) {
current_piece_orientation = (current_piece_orientation+$10)&$3f;
render++;
}
}
if(render!=0) {
(*BORDERCOL)++;
render_playfield();
render_current();
(*BORDERCOL)--;
}
}
}
void init() {
// Initialize a piece
current_piece[0] = GREEN;
current_piece[1] = GREEN;
current_piece[2] = GREEN;
current_piece[4] = GREEN;
// Initialize a current piece
current_piece = piece_t;
current_piece_orientation = 0;
// Clear the screen
fill(SCREEN,1000,$a0);
@ -66,10 +131,195 @@ void render_playfield() {
}
// Render the current piece
void render_current_piece() {
// Render the current moving piece at position (current_xpos, current_ypos)
void render_current() {
byte i = 0;
byte* current_piece_gfx = current_piece + current_piece_orientation;
for(byte l:0..3) {
byte* screen_line = screen_lines[(current_ypos+l)<<1];
for(byte c:0..3) {
byte current_cell = current_piece_gfx[i++];
if(current_cell!=0) {
byte xpos = current_xpos+c;
if(xpos<10) {
screen_line[xpos] = current_cell;
}
}
}
}
}
// Move the current piece down one position
void current_movedown() {
current_ypos++;
}
// The T-piece
align($40) byte[4*4*4] piece_t = {
1, 1, 1, 0,
0, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 1, 0,
0, 1, 1, 0,
0, 0, 1, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 1, 0, 0,
1, 1, 1, 0,
0, 0, 0, 0,
1, 0, 0, 0,
1, 1, 0, 0,
1, 0, 0, 0,
0, 0, 0, 0
};
// The S-piece
align($40) byte[4*4*4] piece_s = {
0, 0, 0, 0,
0, 1, 1, 0,
1, 1, 0, 0,
0, 0, 0, 0,
1, 0, 0, 0,
1, 1, 0, 0,
0, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 1, 1, 0,
1, 1, 0, 0,
0, 0, 0, 0,
1, 0, 0, 0,
1, 1, 0, 0,
0, 1, 0, 0,
0, 0, 0, 0
};
// The Z-piece
align($40) byte[4*4*4] piece_z = {
0, 0, 0, 0,
1, 1, 0, 0,
0, 1, 1, 0,
0, 0, 0, 0,
0, 1, 0, 0,
1, 1, 0, 0,
1, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 0, 0,
0, 1, 1, 0,
0, 0, 0, 0,
0, 1, 0, 0,
1, 1, 0, 0,
1, 0, 0, 0,
0, 0, 0, 0
};
// The L-piece
align($40) byte[4*4*4] piece_l = {
0, 0, 0, 0,
1, 1, 1, 0,
1, 0, 0, 0,
0, 0, 0, 0,
1, 1, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 0, 0, 0,
0, 0, 1, 0,
1, 1, 1, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 1, 1, 0,
0, 0, 0, 0
};
// The J-piece
align($40) byte[4*4*4] piece_j = {
1, 0, 0, 0,
1, 1, 1, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 1, 1, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 0,
0, 0, 1, 0,
0, 0, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
1, 1, 0, 0,
0, 0, 0, 0
};
// The O-piece
align($40) byte[4*4*4] piece_o = {
1, 1, 0, 0,
1, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 0, 0,
1, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 0, 0,
1, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 0, 0,
1, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};
// The I-piece
align($40) byte[4*4*4] piece_i = {
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
1, 1, 1, 1,
0, 0, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0,
0, 1, 0, 0
};

21
src/test/kc/tetris-npe.kc Normal file
View File

@ -0,0 +1,21 @@
// NullPointerException using current_movedown_rate in the main loop
byte* RASTER = $d012;
byte* SCREEN = $400;
byte ypos = 0;
byte RATE = 50;
byte counter = RATE;
void main() {
while(true) {
while(*RASTER!=$ff) {}
if(--counter==0) {
counter = RATE;
ypos++;
*SCREEN = ypos;
}
}
}

View File

@ -203,20 +203,7 @@ if() condition always true - replacing block destination if((const bool) bool_co
if() condition always true - replacing block destination if((const bool) bool_const_vars::$6) goto bool_const_vars::@5
if() condition always false - eliminating if((const bool) bool_const_inline::$3) goto bool_const_inline::@1
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const bool) bool_const_if::b#0
Eliminating unused constant (const bool) bool_const_vars::$0
Eliminating unused constant (const bool) bool_const_vars::$2
Eliminating unused constant (const bool) bool_const_vars::$4
Eliminating unused constant (const bool) bool_const_vars::$6
Eliminating unused constant (const bool) bool_const_inline::$0
Eliminating unused constant (const bool) bool_const_inline::$2
Eliminating unused constant (const bool) bool_const_inline::$3
Eliminating unused constant (const bool) bool_const_inline::$7
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) bool_const_vars::a#0
Eliminating unused constant (const signed byte/signed word/signed dword) bool_const_vars::$5
Eliminating unused constant (const byte) bool_const_inline::a#0
Eliminating unused constant (const signed byte/signed word/signed dword) bool_const_inline::$1
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block bool_const_if::@3
Removing unused block bool_const_vars::@1

View File

@ -746,7 +746,6 @@ Constant (const byte) main::$24 = main::$19|main::$23
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination if(true) goto main::@3
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) gfx_init_plane_charset8::gfxbCpuBank#1
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks

View File

@ -8212,76 +8212,8 @@ Fixing inline constructor with form_field_ptr::$2 ← *(form_line_hi#0 + form_fi
Successful SSA optimization Pass2FixInlineConstructors
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) gfx_init_vic_bitmap::$2 ← (byte) gfx_init_vic_bitmap::l#2
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) gfx_init_vic_bitmap::$3 ← (byte) gfx_init_vic_bitmap::l#2
Eliminating unused constant (const byte) gfx_init_plane_horisontal::gfxbCpuBank#1
Eliminating unused constant (const byte) gfx_init_plane_horisontal2::gfxbCpuBank#1
Eliminating unused constant (const byte) gfx_init_plane_vertical::gfxbCpuBank#1
Eliminating unused constant (const byte) gfx_init_plane_charset8::gfxbCpuBank#1
Eliminating unused constant (const string) $70
Eliminating unused constant (const string) $71
Eliminating unused constant (const string) $72
Eliminating unused constant (const string) $73
Eliminating unused constant (const string) $74
Eliminating unused constant (const string) $75
Eliminating unused constant (const string) $76
Eliminating unused constant (const string) $77
Eliminating unused constant (const string) $78
Eliminating unused constant (const string) $79
Eliminating unused constant (const string) $80
Eliminating unused constant (const string) $81
Eliminating unused constant (const string) $82
Eliminating unused constant (const string) $83
Eliminating unused constant (const string) $84
Eliminating unused constant (const string) $85
Eliminating unused constant (const string) $86
Eliminating unused constant (const string) $87
Eliminating unused constant (const string) $88
Eliminating unused constant (const string) $89
Eliminating unused constant (const string) $90
Eliminating unused constant (const string) $91
Eliminating unused constant (const string) $92
Eliminating unused constant (const string) $93
Eliminating unused constant (const string) $94
Eliminating unused constant (const string) $95
Eliminating unused constant (const string) $96
Eliminating unused constant (const string) $97
Eliminating unused constant (const string) $98
Eliminating unused constant (const string) $99
Eliminating unused constant (const string) $100
Eliminating unused constant (const string) $101
Eliminating unused constant (const string) $102
Eliminating unused constant (const string) $1
Eliminating unused constant (const string) $16
Eliminating unused constant (const string) $2
Eliminating unused constant (const string) $17
Eliminating unused constant (const string) $3
Eliminating unused constant (const string) $18
Eliminating unused constant (const string) $4
Eliminating unused constant (const string) $19
Eliminating unused constant (const string) $5
Eliminating unused constant (const string) $20
Eliminating unused constant (const string) $6
Eliminating unused constant (const string) $21
Eliminating unused constant (const string) $7
Eliminating unused constant (const string) $22
Eliminating unused constant (const string) $8
Eliminating unused constant (const string) $23
Eliminating unused constant (const string) $9
Eliminating unused constant (const string) $24
Eliminating unused constant (const string) $10
Eliminating unused constant (const string) $25
Eliminating unused constant (const string) $11
Eliminating unused constant (const string) $26
Eliminating unused constant (const string) $12
Eliminating unused constant (const string) $27
Eliminating unused constant (const string) $13
Eliminating unused constant (const string) $28
Eliminating unused constant (const string) $14
Eliminating unused constant (const string) $29
Eliminating unused constant (const string) $30
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte*) print_screen#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) keyboard_modifiers#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (byte*) bitmap_clear::bitmap#0 ← ((byte*)) (word~) bitmap_clear::$3
Eliminating Noop Cast (byte*) bitmap_plot::plotter#0 ← ((byte*)) (word~) bitmap_plot::$0

View File

@ -7243,49 +7243,7 @@ Fixing inline constructor with bitmap_plot::$3 ← *(bitmap_plot_yhi#0 + bitmap_
Successful SSA optimization Pass2FixInlineConstructors
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) mode_stdbitmap::$28 ← (byte) mode_stdbitmap::l#2
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) mode_stdbitmap::$29 ← (byte) mode_stdbitmap::l#2
Eliminating unused constant (const string) $21
Eliminating unused constant (const string) $22
Eliminating unused constant (const string) $23
Eliminating unused constant (const string) $24
Eliminating unused constant (const string) $25
Eliminating unused constant (const string) $26
Eliminating unused constant (const string) $27
Eliminating unused constant (const string) $28
Eliminating unused constant (const string) $29
Eliminating unused constant (const string) $30
Eliminating unused constant (const string) $31
Eliminating unused constant (const string) $32
Eliminating unused constant (const string) $33
Eliminating unused constant (const string) $34
Eliminating unused constant (const string) $35
Eliminating unused constant (const string) $36
Eliminating unused constant (const string) $37
Eliminating unused constant (const string) $38
Eliminating unused constant (const string) $39
Eliminating unused constant (const string) $40
Eliminating unused constant (const string) $41
Eliminating unused constant (const string) $1
Eliminating unused constant (const string) $2
Eliminating unused constant (const string) $3
Eliminating unused constant (const string) $4
Eliminating unused constant (const string) $5
Eliminating unused constant (const string) $6
Eliminating unused constant (const string) $7
Eliminating unused constant (const string) $8
Eliminating unused constant (const string) $9
Eliminating unused constant (const string) $10
Eliminating unused constant (const string) $11
Eliminating unused constant (const string) $12
Eliminating unused constant (const string) $13
Eliminating unused constant (const string) $14
Eliminating unused constant (const string) $15
Eliminating unused constant (const string) $16
Eliminating unused constant (const string) $17
Eliminating unused constant (const string) $18
Eliminating unused constant (const string) $19
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte*) print_screen#0
Eliminating unused constant (const byte) dtv_control#129
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (byte*) bitmap_clear::bitmap#0 ← ((byte*)) (word~) bitmap_clear::$3
Eliminating Noop Cast (byte*) bitmap_plot::plotter#0 ← ((byte*)) (word~) bitmap_plot::$0

View File

@ -502,7 +502,6 @@ Constant (const byte) test::i#10 = main::i#10
Constant (const byte) test::a#10 = main::a#10
Constant (const byte) main::i#11 = ++main::i#10
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte) main::i#11
Successful SSA optimization PassNEliminateUnusedVars
Culled Empty Block (label) main::@11
Successful SSA optimization Pass2CullEmptyBlocks

View File

@ -66,8 +66,6 @@ Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte[]) main::msg#0 = "cm"+'l'
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const string) main::$2
Eliminating unused constant (const byte) main::l#0
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,2)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 3

View File

@ -170,7 +170,6 @@ Culled Empty Block (label) line::@1
Successful SSA optimization Pass2CullEmptyBlocks
Redundant Phi (byte) plot::x#2 (byte) plot::x#1
Successful SSA optimization Pass2RedundantPhiElimination
Eliminating unused constant (const byte) plot::x#0
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0

View File

@ -61,8 +61,6 @@ Consolidated array index constant in *(main::screen#0+0)
Successful SSA optimization Pass2ConstantAdditionElimination
if() condition always true - replacing block destination if((const byte*) main::rem#0!=(const byte*) main::NULL#0) goto main::@1
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte*) main::NULL#0
Eliminating unused constant (const byte*) main::rem#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@3
Successful SSA optimization Pass2EliminateUnusedBlocks

View File

@ -102,13 +102,6 @@ Constant (const byte[]) main::s3#0 = "cam"+main::s#0+'o'
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte[]) main::s5#0 = main::s3#0+main::s4#0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const string) main::$7
Eliminating unused constant (const string) main::$8
Eliminating unused constant (const string) main::$9
Eliminating unused constant (const string) main::$10
Eliminating unused constant (const byte) main::e#0
Eliminating unused constant (const string) main::$3
Eliminating unused constant (const byte[]) main::s2#0
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,7)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 8

View File

@ -1328,7 +1328,6 @@ Consolidated constant in assignment plot_chargen::$7
Successful SSA optimization Pass2ConstantAdditionElimination
if() condition always true - replacing block destination if(true) goto main::@3
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) main::shift#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks

View File

@ -1542,13 +1542,7 @@ if() condition always true - replacing block destination if(true) goto loop::@2
Successful SSA optimization Pass2ConstantIfs
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) plexSort::$1 ← (byte) plexSort::m#2
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) plexSort::$4 ← (byte) plexSort::s#3
Eliminating unused constant (const byte*) PLEX_SCREEN_PTR#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word/signed word/dword/signed dword) $0
Eliminating unused constant (const byte) plex_show_idx#0
Eliminating unused constant (const byte) plex_sprite_idx#0
Eliminating unused constant (const byte) plex_sprite_msb#0
Eliminating unused constant (const byte) plex_free_next#29
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block loop::@return
Successful SSA optimization Pass2EliminateUnusedBlocks

View File

@ -1990,8 +1990,6 @@ if() condition always true - replacing block destination if(true) goto loop::@2
Successful SSA optimization Pass2ConstantIfs
Fixing inline constructor with div32u16u::$4 ← div32u16u::quotient_hi#0 dw= div32u16u::quotient_lo#0
Successful SSA optimization Pass2FixInlineConstructors
Eliminating unused constant (const byte) render_logo::line#0
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (word) mul16u::a#1 ← ((word)) (signed word) mul16s::a#0
Eliminating Noop Cast (word~) mul16s::$13 ← ((word)) (signed word) mul16s::a#0
@ -2138,7 +2136,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (render_logo::@9_5) in block render_logo::@9_6
if() condition always false - eliminating [58] if((const byte) render_logo::line#24!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_logo::@9_6
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) render_logo::line#24
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) render_logo::line#25 from unused block render_logo::@9_6
Eliminating variable (byte/signed word/word/dword/signed dword~) render_logo::$51 from unused block render_logo::@9_6
@ -2204,7 +2201,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (render_logo::@5_5) in block render_logo::@5_6
if() condition always false - eliminating [65] if((const byte) render_logo::line#34!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_logo::@5_6
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) render_logo::line#34
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) render_logo::line#35 from unused block render_logo::@5_6
Eliminating variable (byte/signed word/word/dword/signed dword~) render_logo::$63 from unused block render_logo::@5_6
@ -2279,7 +2275,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (render_logo::@18_5) in block render_logo::@18_6
if() condition always false - eliminating [77] if((const byte) render_logo::line#46!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_logo::@18_6
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) render_logo::line#46
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) render_logo::line#47 from unused block render_logo::@18_6
Eliminating variable (byte/signed word/word/dword/signed dword~) render_logo::$75 from unused block render_logo::@18_6
@ -2360,7 +2355,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (render_logo::@14_5) in block render_logo::@14_6
if() condition always false - eliminating [91] if((const byte) render_logo::line#58!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_logo::@14_6
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) render_logo::line#58
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) render_logo::line#59 from unused block render_logo::@14_6
Eliminating variable (byte/signed word/word/dword/signed dword~) render_logo::$97 from unused block render_logo::@14_6

View File

@ -2052,7 +2052,6 @@ Fixing inline constructor with bitmap_clear::$3 ← *(bitmap_plot_yhi#0 + 0) w=
Fixing inline constructor with bitmap_plot::$3 ← *(bitmap_plot_yhi#0 + bitmap_plot::y#2) w= *(bitmap_plot_ylo#0 + bitmap_plot::y#2)
Fixing inline constructor with div32u16u::$4 ← div32u16u::quotient_hi#0 dw= div32u16u::quotient_lo#0
Successful SSA optimization Pass2FixInlineConstructors
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (word) mul16u::a#1 ← ((word)) (signed word) mul16s::a#0
Eliminating Noop Cast (word~) mul16s::$13 ← ((word)) (signed word) mul16s::a#0

View File

@ -1975,7 +1975,6 @@ Successful SSA optimization Pass2ConstantIfs
Fixing inline constructor with getFAC::$0 ← *(memHi#0) w= *(memLo#0)
Successful SSA optimization Pass2FixInlineConstructors
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) init::$1 ← (byte) init::i#2
Eliminating unused constant (const byte) progress_idx#35
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (byte*) prepareMEM::mem#0 ← ((byte*)) (word) setFAC::w#5
Successful SSA optimization Pass2NopCastElimination

View File

@ -1,29 +1,209 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label RASTER = $d012
.label BORDERCOL = $d020
.label COLS = $d800
.label CIA1_PORT_A = $dc00
.label CIA1_PORT_B = $dc01
.const BLACK = 0
.const GREEN = 5
.const DARK_GREY = $b
.const KEY_Z = $c
.const KEY_LSHIFT = $f
.const KEY_X = $17
.const KEY_DOT = $2c
.const KEY_COMMA = $2f
.const KEY_RSHIFT = $34
.const KEY_CTRL = $3a
.const KEY_SPACE = $3c
.const KEY_COMMODORE = $3d
.label SCREEN = $400
.const current_movedown_rate = $32
.const current_movedown_rate_fast = 5
.label current_movedown_counter = 2
.label current_xpos = 5
.label current_piece_orientation = 6
.label current_ypos = 3
.label current_ypos_14 = 4
.label current_xpos_26 = 7
.label current_ypos_62 = 4
.label current_xpos_64 = 7
jsr main
main: {
.label key_event = 8
.label movedown = 4
jsr init
jsr render_playfield
jsr render_current_piece
lda #3
sta current_xpos_26
lda #0
sta current_ypos_14
tay
jsr render_current
lda #3
sta current_xpos
lda #0
sta current_ypos
sta current_movedown_counter
tax
sta current_piece_orientation
b4:
lda RASTER
cmp #$ff
bne b4
b7:
lda RASTER
cmp #$fe
bne b7
jsr keyboard_event_scan
jsr keyboard_event_get
sta key_event
inc current_movedown_counter
cmp #KEY_SPACE
bne b1
lda #1
sta movedown
jmp b10
b1:
lda #0
sta movedown
b10:
lda #KEY_SPACE
sta keyboard_event_pressed.keycode
jsr keyboard_event_pressed
cmp #0
beq b11
lda current_movedown_counter
cmp #current_movedown_rate_fast
bcc b11
inc movedown
b11:
lda current_movedown_counter
cmp #current_movedown_rate
bcc b13
inc movedown
b13:
lda movedown
beq b2
jsr current_movedown
lda #0
sta current_movedown_counter
ldy #1
jmp b14
b2:
ldy #0
b14:
lda #$80
and key_event
cmp #0
bne b15
lda key_event
cmp #KEY_COMMA
bne b16
dec current_xpos
iny
b16:
lda key_event
cmp #KEY_DOT
bne b17
inc current_xpos
iny
b17:
lda key_event
cmp #KEY_Z
bne b18
lda current_piece_orientation
sec
sbc #$10
and #$3f
sta current_piece_orientation
iny
b18:
lda key_event
cmp #KEY_X
bne b15
lda #$10
clc
adc current_piece_orientation
and #$3f
sta current_piece_orientation
iny
b15:
cpy #0
bne !b4+
jmp b4
!b4:
inc BORDERCOL
jmp b2
jsr render_playfield
ldy current_piece_orientation
lda current_ypos
sta current_ypos_62
lda current_xpos
sta current_xpos_64
jsr render_current
dec BORDERCOL
jmp b4
}
render_current_piece: {
render_current: {
.label current_piece_gfx = $b
.label screen_line = $d
.label current_cell = $f
.label i = 9
.label c = $a
.label l = 8
tya
clc
adc #<piece_t
sta current_piece_gfx
lda #>piece_t
adc #0
sta current_piece_gfx+1
lda #0
sta i
sta l
b1:
lda current_ypos_14
clc
adc l
asl
tay
lda screen_lines,y
sta screen_line
lda screen_lines+1,y
sta screen_line+1
lda #0
sta c
b2:
ldy i
lda (current_piece_gfx),y
sta current_cell
inc i
beq b3
lda current_xpos_26
clc
adc c
cmp #$a
bcs b3
tay
lda current_cell
sta (screen_line),y
b3:
inc c
lda c
cmp #4
bne b2
inc l
lda l
cmp #4
bne b1
rts
}
render_playfield: {
.label _1 = 6
.label line = 4
.label i = 3
.label l = 2
.label _1 = $d
.label line = $b
.label i = 8
.label c = 7
.label l = 4
lda #0
sta i
sta l
@ -35,9 +215,10 @@ render_playfield: {
sta line
lda screen_lines+1,y
sta line+1
ldx #0
lda #0
sta c
b2:
txa
lda c
clc
adc line
sta _1
@ -49,8 +230,9 @@ render_playfield: {
ldy #0
sta (_1),y
inc i
inx
cpx #$a
inc c
lda c
cmp #$a
bne b2
inc l
lda l
@ -58,16 +240,128 @@ render_playfield: {
bne b1
rts
}
current_movedown: {
inc current_ypos
rts
}
keyboard_event_pressed: {
.label row_bits = 9
.label keycode = 7
lda keycode
lsr
lsr
lsr
tay
lda keyboard_scan_values,y
sta row_bits
lda #7
and keycode
tay
lda keyboard_matrix_col_bitmask,y
and row_bits
rts
}
keyboard_event_get: {
cpx #0
beq b1
dex
lda keyboard_events,x
jmp breturn
b1:
lda #$ff
breturn:
rts
}
keyboard_event_scan: {
.label row_scan = 9
.label keycode = 8
.label row = 4
.label col = 7
lda #0
sta keycode
sta row
b1:
ldy row
jsr keyboard_matrix_read
sta row_scan
ldy row
cmp keyboard_scan_values,y
bne b2
lda #8
clc
adc keycode
sta keycode
b3:
inc row
lda row
cmp #8
bne b1
lda #KEY_LSHIFT
sta keyboard_event_pressed.keycode
jsr keyboard_event_pressed
cmp #0
lda #KEY_RSHIFT
sta keyboard_event_pressed.keycode
jsr keyboard_event_pressed
cmp #0
lda #KEY_CTRL
sta keyboard_event_pressed.keycode
jsr keyboard_event_pressed
cmp #0
lda #KEY_COMMODORE
sta keyboard_event_pressed.keycode
jsr keyboard_event_pressed
cmp #0
rts
b2:
lda #0
sta col
b4:
lda row_scan
ldy row
eor keyboard_scan_values,y
ldy col
and keyboard_matrix_col_bitmask,y
cmp #0
beq b5
cpx #8
beq b5
lda row_scan
and keyboard_matrix_col_bitmask,y
cmp #0
beq b7
lda keycode
sta keyboard_events,x
inx
b5:
inc keycode
inc col
lda col
cmp #8
bne b4
lda row_scan
ldy row
sta keyboard_scan_values,y
jmp b3
b7:
lda #$40
ora keycode
sta keyboard_events,x
inx
jmp b5
}
keyboard_matrix_read: {
lda keyboard_matrix_row_bitmask,y
sta CIA1_PORT_A
lda CIA1_PORT_B
eor #$ff
rts
}
init: {
.label _7 = 6
.label li = 4
.label line = 4
.label _7 = $d
.label li = $b
.label line = $b
.label l = 2
lda #GREEN
sta current_piece
sta current_piece+1
sta current_piece+2
sta current_piece+4
ldx #$a0
lda #<SCREEN
sta fill.addr
@ -139,8 +433,8 @@ init: {
rts
}
fill: {
.label end = 6
.label addr = 4
.label end = $d
.label addr = $b
lda addr
clc
adc #<$3e8
@ -164,6 +458,11 @@ fill: {
bne b1
rts
}
keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
keyboard_events: .fill 8, 0
keyboard_scan_values: .fill 8, 0
screen_lines: .fill 2*$14, 0
.align $40
piece_t: .byte 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
playfield: .fill $14*$a, 0
current_piece: .fill 4*4, 0

View File

@ -1,108 +1,399 @@
@begin: scope:[] from
[0] phi()
to:@8
@8: scope:[] from @begin
to:@16
@16: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @8
@end: scope:[] from @16
[3] phi()
main: scope:[main] from @8
main: scope:[main] from @16
[4] phi()
[5] call init
to:main::@7
main::@7: scope:[main] from main
to:main::@41
main::@41: scope:[main] from main
[6] phi()
[7] call render_playfield
to:main::@8
main::@8: scope:[main] from main::@7
to:main::@42
main::@42: scope:[main] from main::@41
[8] phi()
[9] call render_current_piece
to:main::@2
main::@2: scope:[main] from main::@2 main::@8
[10] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0)
to:main::@2
render_current_piece: scope:[render_current_piece] from main::@8
[11] phi()
to:render_current_piece::@return
render_current_piece::@return: scope:[render_current_piece] from render_current_piece
[12] return
to:@return
render_playfield: scope:[render_playfield] from main::@7
[9] call render_current
to:main::@1
main::@1: scope:[main] from main::@15 main::@42 main::@49
[10] (byte) current_xpos#12 ← phi( main::@15/(byte) current_xpos#15 main::@42/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@49/(byte) current_xpos#15 )
[10] (byte) current_ypos#13 ← phi( main::@15/(byte) current_ypos#17 main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@49/(byte) current_ypos#17 )
[10] (byte) current_movedown_counter#14 ← phi( main::@15/(byte) current_movedown_counter#16 main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@49/(byte) current_movedown_counter#16 )
[10] (byte) keyboard_events_size#19 ← phi( main::@15/(byte) keyboard_events_size#16 main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@49/(byte) keyboard_events_size#16 )
[10] (byte) current_piece_orientation#11 ← phi( main::@15/(byte) current_piece_orientation#21 main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@49/(byte) current_piece_orientation#21 )
to:main::@4
main::@4: scope:[main] from main::@1 main::@4
[11] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 255) goto main::@4
to:main::@7
main::@7: scope:[main] from main::@4 main::@7
[12] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) 254) goto main::@7
to:main::@9
main::@9: scope:[main] from main::@7
[13] phi()
[14] call keyboard_event_scan
to:main::@44
main::@44: scope:[main] from main::@9
[15] phi()
[16] call keyboard_event_get
[17] (byte) keyboard_event_get::return#3 ← (byte) keyboard_event_get::return#2
to:main::@45
main::@45: scope:[main] from main::@44
[18] (byte) main::key_event#0 ← (byte) keyboard_event_get::return#3
[19] (byte) current_movedown_counter#1 ← ++ (byte) current_movedown_counter#14
[20] if((byte) main::key_event#0!=(const byte) KEY_SPACE#0) goto main::@10
to:main::@29
main::@29: scope:[main] from main::@45
[21] phi()
to:main::@10
main::@10: scope:[main] from main::@29 main::@45
[22] (byte) main::movedown#10 ← phi( main::@29/(byte/signed byte/word/signed word/dword/signed dword) 1 main::@45/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[23] call keyboard_event_pressed
[24] (byte) keyboard_event_pressed::return#12 ← (byte) keyboard_event_pressed::return#11
to:main::@46
main::@46: scope:[main] from main::@10
[25] (byte~) main::$9 ← (byte) keyboard_event_pressed::return#12
[26] if((byte~) main::$9==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@11
to:main::@30
main::@30: scope:[main] from main::@46
[27] if((byte) current_movedown_counter#1<(const byte) current_movedown_rate_fast#0) goto main::@11
to:main::@31
main::@31: scope:[main] from main::@30
[28] (byte) main::movedown#2 ← ++ (byte) main::movedown#10
to:main::@11
main::@11: scope:[main] from main::@30 main::@31 main::@46
[29] (byte) main::movedown#7 ← phi( main::@30/(byte) main::movedown#10 main::@31/(byte) main::movedown#2 main::@46/(byte) main::movedown#10 )
[30] if((byte) current_movedown_counter#1<(const byte) current_movedown_rate#0) goto main::@13
to:main::@32
main::@32: scope:[main] from main::@11
[31] (byte) main::movedown#3 ← ++ (byte) main::movedown#7
to:main::@13
main::@13: scope:[main] from main::@11 main::@32
[32] (byte) main::movedown#6 ← phi( main::@11/(byte) main::movedown#7 main::@32/(byte) main::movedown#3 )
[33] if((byte) main::movedown#6==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@14
to:main::@33
main::@33: scope:[main] from main::@13
[34] phi()
[35] call current_movedown
to:main::@14
main::@14: scope:[main] from main::@13 main::@33
[36] (byte) current_ypos#17 ← phi( main::@13/(byte) current_ypos#13 main::@33/(byte) current_ypos#10 )
[36] (byte) current_movedown_counter#16 ← phi( main::@13/(byte) current_movedown_counter#1 main::@33/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[36] (byte) main::render#13 ← phi( main::@13/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@33/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[37] (byte~) main::$19 ← (byte) main::key_event#0 & (byte/word/signed word/dword/signed dword) 128
[38] if((byte~) main::$19!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@15
to:main::@34
main::@34: scope:[main] from main::@14
[39] if((byte) main::key_event#0!=(const byte) KEY_COMMA#0) goto main::@16
to:main::@35
main::@35: scope:[main] from main::@34
[40] (byte) current_xpos#1 ← -- (byte) current_xpos#12
[41] (byte) main::render#2 ← ++ (byte) main::render#13
to:main::@16
main::@16: scope:[main] from main::@34 main::@35
[42] (byte) main::render#16 ← phi( main::@34/(byte) main::render#13 main::@35/(byte) main::render#2 )
[42] (byte) current_xpos#11 ← phi( main::@34/(byte) current_xpos#12 main::@35/(byte) current_xpos#1 )
[43] if((byte) main::key_event#0!=(const byte) KEY_DOT#0) goto main::@17
to:main::@36
main::@36: scope:[main] from main::@16
[44] (byte) current_xpos#2 ← ++ (byte) current_xpos#11
[45] (byte) main::render#3 ← ++ (byte) main::render#16
to:main::@17
main::@17: scope:[main] from main::@16 main::@36
[46] (byte) current_xpos#34 ← phi( main::@16/(byte) current_xpos#11 main::@36/(byte) current_xpos#2 )
[46] (byte) main::render#10 ← phi( main::@16/(byte) main::render#16 main::@36/(byte) main::render#3 )
[47] if((byte) main::key_event#0!=(const byte) KEY_Z#0) goto main::@18
to:main::@37
main::@37: scope:[main] from main::@17
[48] (byte/signed word/word/dword/signed dword~) main::$28 ← (byte) current_piece_orientation#11 - (byte/signed byte/word/signed word/dword/signed dword) 16
[49] (byte) current_piece_orientation#2 ← (byte/signed word/word/dword/signed dword~) main::$28 & (byte/signed byte/word/signed word/dword/signed dword) 63
[50] (byte) main::render#4 ← ++ (byte) main::render#10
to:main::@18
main::@18: scope:[main] from main::@17 main::@37
[51] (byte) main::render#11 ← phi( main::@17/(byte) main::render#10 main::@37/(byte) main::render#4 )
[51] (byte) current_piece_orientation#10 ← phi( main::@17/(byte) current_piece_orientation#11 main::@37/(byte) current_piece_orientation#2 )
[52] if((byte) main::key_event#0!=(const byte) KEY_X#0) goto main::@15
to:main::@38
main::@38: scope:[main] from main::@18
[53] (byte/signed word/word/dword/signed dword~) main::$32 ← (byte) current_piece_orientation#10 + (byte/signed byte/word/signed word/dword/signed dword) 16
[54] (byte) current_piece_orientation#3 ← (byte/signed word/word/dword/signed dword~) main::$32 & (byte/signed byte/word/signed word/dword/signed dword) 63
[55] (byte) main::render#5 ← ++ (byte) main::render#11
to:main::@15
main::@15: scope:[main] from main::@14 main::@18 main::@38
[56] (byte) current_xpos#15 ← phi( main::@14/(byte) current_xpos#12 main::@18/(byte) current_xpos#34 main::@38/(byte) current_xpos#34 )
[56] (byte) current_piece_orientation#21 ← phi( main::@14/(byte) current_piece_orientation#11 main::@18/(byte) current_piece_orientation#10 main::@38/(byte) current_piece_orientation#3 )
[56] (byte) main::render#7 ← phi( main::@14/(byte) main::render#13 main::@18/(byte) main::render#11 main::@38/(byte) main::render#5 )
[57] if((byte) main::render#7==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1
to:main::@39
main::@39: scope:[main] from main::@15
[58] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0)
[59] call render_playfield
to:main::@48
main::@48: scope:[main] from main::@39
[60] (byte~) current_piece_orientation#66 ← (byte) current_piece_orientation#21
[61] (byte~) current_ypos#62 ← (byte) current_ypos#17
[62] (byte~) current_xpos#64 ← (byte) current_xpos#15
[63] call render_current
to:main::@49
main::@49: scope:[main] from main::@48
[64] *((const byte*) BORDERCOL#0) ← -- *((const byte*) BORDERCOL#0)
to:main::@1
render_current: scope:[render_current] from main::@42 main::@48
[65] (byte) current_xpos#26 ← phi( main::@42/(byte/signed byte/word/signed word/dword/signed dword) 3 main::@48/(byte~) current_xpos#64 )
[65] (byte) current_ypos#14 ← phi( main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@48/(byte~) current_ypos#62 )
[65] (byte) current_piece_orientation#13 ← phi( main::@42/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@48/(byte~) current_piece_orientation#66 )
[66] (byte*) render_current::current_piece_gfx#0 ← (const byte[4*4*4]) piece_t#0 + (byte) current_piece_orientation#13
to:render_current::@1
render_current::@1: scope:[render_current] from render_current render_current::@7
[67] (byte) render_current::i#3 ← phi( render_current/(byte/signed byte/word/signed word/dword/signed dword) 0 render_current::@7/(byte) render_current::i#1 )
[67] (byte) render_current::l#2 ← phi( render_current/(byte/signed byte/word/signed word/dword/signed dword) 0 render_current::@7/(byte) render_current::l#1 )
[68] (byte~) render_current::$1 ← (byte) current_ypos#14 + (byte) render_current::l#2
[69] (byte~) render_current::$2 ← (byte~) render_current::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1
[70] (byte*) render_current::screen_line#0 ← *((const byte*[20]) screen_lines#0 + (byte~) render_current::$2)
to:render_current::@2
render_current::@2: scope:[render_current] from render_current::@1 render_current::@3
[71] (byte) render_current::c#2 ← phi( render_current::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 render_current::@3/(byte) render_current::c#1 )
[71] (byte) render_current::i#2 ← phi( render_current::@1/(byte) render_current::i#3 render_current::@3/(byte) render_current::i#1 )
[72] (byte) render_current::current_cell#0 ← *((byte*) render_current::current_piece_gfx#0 + (byte) render_current::i#2)
[73] (byte) render_current::i#1 ← ++ (byte) render_current::i#2
[74] if((byte) render_current::current_cell#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_current::@3
to:render_current::@5
render_current::@5: scope:[render_current] from render_current::@2
[75] (byte) render_current::xpos#0 ← (byte) current_xpos#26 + (byte) render_current::c#2
[76] if((byte) render_current::xpos#0>=(byte/signed byte/word/signed word/dword/signed dword) 10) goto render_current::@3
to:render_current::@6
render_current::@6: scope:[render_current] from render_current::@5
[77] *((byte*) render_current::screen_line#0 + (byte) render_current::xpos#0) ← (byte) render_current::current_cell#0
to:render_current::@3
render_current::@3: scope:[render_current] from render_current::@2 render_current::@5 render_current::@6
[78] (byte) render_current::c#1 ← ++ (byte) render_current::c#2
[79] if((byte) render_current::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto render_current::@2
to:render_current::@7
render_current::@7: scope:[render_current] from render_current::@3
[80] (byte) render_current::l#1 ← ++ (byte) render_current::l#2
[81] if((byte) render_current::l#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto render_current::@1
to:render_current::@return
render_current::@return: scope:[render_current] from render_current::@7
[82] return
to:@return
render_playfield: scope:[render_playfield] from main::@39 main::@41
[83] phi()
to:render_playfield::@1
render_playfield::@1: scope:[render_playfield] from render_playfield render_playfield::@3
[14] (byte) render_playfield::i#3 ← phi( render_playfield/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@3/(byte) render_playfield::i#1 )
[14] (byte) render_playfield::l#2 ← phi( render_playfield/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@3/(byte) render_playfield::l#1 )
[15] (byte~) render_playfield::$0 ← (byte) render_playfield::l#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[16] (byte*) render_playfield::line#0 ← *((const byte*[20]) screen_lines#0 + (byte~) render_playfield::$0)
[84] (byte) render_playfield::i#3 ← phi( render_playfield/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@3/(byte) render_playfield::i#1 )
[84] (byte) render_playfield::l#2 ← phi( render_playfield/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@3/(byte) render_playfield::l#1 )
[85] (byte~) render_playfield::$0 ← (byte) render_playfield::l#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[86] (byte*) render_playfield::line#0 ← *((const byte*[20]) screen_lines#0 + (byte~) render_playfield::$0)
to:render_playfield::@2
render_playfield::@2: scope:[render_playfield] from render_playfield::@1 render_playfield::@2
[17] (byte) render_playfield::i#2 ← phi( render_playfield::@1/(byte) render_playfield::i#3 render_playfield::@2/(byte) render_playfield::i#1 )
[17] (byte) render_playfield::c#2 ← phi( render_playfield::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@2/(byte) render_playfield::c#1 )
[18] (byte*~) render_playfield::$1 ← (byte*) render_playfield::line#0 + (byte) render_playfield::c#2
[19] *((byte*~) render_playfield::$1) ← *((const byte[20*10]) playfield#0 + (byte) render_playfield::i#2)
[20] (byte) render_playfield::i#1 ← ++ (byte) render_playfield::i#2
[21] (byte) render_playfield::c#1 ← ++ (byte) render_playfield::c#2
[22] if((byte) render_playfield::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto render_playfield::@2
[87] (byte) render_playfield::i#2 ← phi( render_playfield::@1/(byte) render_playfield::i#3 render_playfield::@2/(byte) render_playfield::i#1 )
[87] (byte) render_playfield::c#2 ← phi( render_playfield::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 render_playfield::@2/(byte) render_playfield::c#1 )
[88] (byte*~) render_playfield::$1 ← (byte*) render_playfield::line#0 + (byte) render_playfield::c#2
[89] *((byte*~) render_playfield::$1) ← *((const byte[20*10]) playfield#0 + (byte) render_playfield::i#2)
[90] (byte) render_playfield::i#1 ← ++ (byte) render_playfield::i#2
[91] (byte) render_playfield::c#1 ← ++ (byte) render_playfield::c#2
[92] if((byte) render_playfield::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto render_playfield::@2
to:render_playfield::@3
render_playfield::@3: scope:[render_playfield] from render_playfield::@2
[23] (byte) render_playfield::l#1 ← ++ (byte) render_playfield::l#2
[24] if((byte) render_playfield::l#1!=(byte/signed byte/word/signed word/dword/signed dword) 20) goto render_playfield::@1
[93] (byte) render_playfield::l#1 ← ++ (byte) render_playfield::l#2
[94] if((byte) render_playfield::l#1!=(byte/signed byte/word/signed word/dword/signed dword) 20) goto render_playfield::@1
to:render_playfield::@return
render_playfield::@return: scope:[render_playfield] from render_playfield::@3
[25] return
[95] return
to:@return
current_movedown: scope:[current_movedown] from main::@33
[96] (byte) current_ypos#10 ← ++ (byte) current_ypos#13
to:current_movedown::@return
current_movedown::@return: scope:[current_movedown] from current_movedown
[97] return
to:@return
keyboard_event_pressed: scope:[keyboard_event_pressed] from keyboard_event_scan::@10 keyboard_event_scan::@11 keyboard_event_scan::@20 keyboard_event_scan::@9 main::@10
[98] (byte) keyboard_event_pressed::keycode#5 ← phi( keyboard_event_scan::@10/(const byte) KEY_CTRL#0 keyboard_event_scan::@11/(const byte) KEY_COMMODORE#0 keyboard_event_scan::@20/(const byte) KEY_LSHIFT#0 keyboard_event_scan::@9/(const byte) KEY_RSHIFT#0 main::@10/(const byte) KEY_SPACE#0 )
[99] (byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode#5 >> (byte/signed byte/word/signed word/dword/signed dword) 3
[100] (byte) keyboard_event_pressed::row_bits#0 ← *((const byte[8]) keyboard_scan_values#0 + (byte~) keyboard_event_pressed::$0)
[101] (byte~) keyboard_event_pressed::$1 ← (byte) keyboard_event_pressed::keycode#5 & (byte/signed byte/word/signed word/dword/signed dword) 7
[102] (byte) keyboard_event_pressed::return#11 ← (byte) keyboard_event_pressed::row_bits#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte~) keyboard_event_pressed::$1)
to:keyboard_event_pressed::@return
keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_event_pressed
[103] return
to:@return
keyboard_event_get: scope:[keyboard_event_get] from main::@44
[104] if((byte) keyboard_events_size#13==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_get::@return
to:keyboard_event_get::@3
keyboard_event_get::@3: scope:[keyboard_event_get] from keyboard_event_get
[105] (byte) keyboard_events_size#4 ← -- (byte) keyboard_events_size#13
[106] (byte) keyboard_event_get::return#1 ← *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#4)
to:keyboard_event_get::@return
keyboard_event_get::@return: scope:[keyboard_event_get] from keyboard_event_get keyboard_event_get::@3
[107] (byte) keyboard_events_size#16 ← phi( keyboard_event_get/(byte) keyboard_events_size#13 keyboard_event_get::@3/(byte) keyboard_events_size#4 )
[107] (byte) keyboard_event_get::return#2 ← phi( keyboard_event_get/(byte/word/signed word/dword/signed dword) 255 keyboard_event_get::@3/(byte) keyboard_event_get::return#1 )
[108] return
to:@return
keyboard_event_scan: scope:[keyboard_event_scan] from main::@9
[109] phi()
to:keyboard_event_scan::@1
keyboard_event_scan::@1: scope:[keyboard_event_scan] from keyboard_event_scan keyboard_event_scan::@3
[110] (byte) keyboard_events_size#29 ← phi( keyboard_event_scan/(byte) keyboard_events_size#19 keyboard_event_scan::@3/(byte) keyboard_events_size#13 )
[110] (byte) keyboard_event_scan::keycode#11 ← phi( keyboard_event_scan/(byte/signed byte/word/signed word/dword/signed dword) 0 keyboard_event_scan::@3/(byte) keyboard_event_scan::keycode#14 )
[110] (byte) keyboard_event_scan::row#2 ← phi( keyboard_event_scan/(byte/signed byte/word/signed word/dword/signed dword) 0 keyboard_event_scan::@3/(byte) keyboard_event_scan::row#1 )
[111] (byte) keyboard_matrix_read::rowid#0 ← (byte) keyboard_event_scan::row#2
[112] call keyboard_matrix_read
[113] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0
to:keyboard_event_scan::@25
keyboard_event_scan::@25: scope:[keyboard_event_scan] from keyboard_event_scan::@1
[114] (byte) keyboard_event_scan::row_scan#0 ← (byte) keyboard_matrix_read::return#2
[115] if((byte) keyboard_event_scan::row_scan#0!=*((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)) goto keyboard_event_scan::@4
to:keyboard_event_scan::@13
keyboard_event_scan::@13: scope:[keyboard_event_scan] from keyboard_event_scan::@25
[116] (byte) keyboard_event_scan::keycode#1 ← (byte) keyboard_event_scan::keycode#11 + (byte/signed byte/word/signed word/dword/signed dword) 8
to:keyboard_event_scan::@3
keyboard_event_scan::@3: scope:[keyboard_event_scan] from keyboard_event_scan::@13 keyboard_event_scan::@19
[117] (byte) keyboard_events_size#13 ← phi( keyboard_event_scan::@13/(byte) keyboard_events_size#29 keyboard_event_scan::@19/(byte) keyboard_events_size#30 )
[117] (byte) keyboard_event_scan::keycode#14 ← phi( keyboard_event_scan::@13/(byte) keyboard_event_scan::keycode#1 keyboard_event_scan::@19/(byte) keyboard_event_scan::keycode#15 )
[118] (byte) keyboard_event_scan::row#1 ← ++ (byte) keyboard_event_scan::row#2
[119] if((byte) keyboard_event_scan::row#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto keyboard_event_scan::@1
to:keyboard_event_scan::@20
keyboard_event_scan::@20: scope:[keyboard_event_scan] from keyboard_event_scan::@3
[120] phi()
[121] call keyboard_event_pressed
[122] (byte) keyboard_event_pressed::return#0 ← (byte) keyboard_event_pressed::return#11
to:keyboard_event_scan::@26
keyboard_event_scan::@26: scope:[keyboard_event_scan] from keyboard_event_scan::@20
[123] (byte~) keyboard_event_scan::$14 ← (byte) keyboard_event_pressed::return#0
[124] if((byte~) keyboard_event_scan::$14==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@9
to:keyboard_event_scan::@21
keyboard_event_scan::@21: scope:[keyboard_event_scan] from keyboard_event_scan::@26
[125] phi()
to:keyboard_event_scan::@9
keyboard_event_scan::@9: scope:[keyboard_event_scan] from keyboard_event_scan::@21 keyboard_event_scan::@26
[126] phi()
[127] call keyboard_event_pressed
[128] (byte) keyboard_event_pressed::return#1 ← (byte) keyboard_event_pressed::return#11
to:keyboard_event_scan::@27
keyboard_event_scan::@27: scope:[keyboard_event_scan] from keyboard_event_scan::@9
[129] (byte~) keyboard_event_scan::$18 ← (byte) keyboard_event_pressed::return#1
[130] if((byte~) keyboard_event_scan::$18==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@10
to:keyboard_event_scan::@22
keyboard_event_scan::@22: scope:[keyboard_event_scan] from keyboard_event_scan::@27
[131] phi()
to:keyboard_event_scan::@10
keyboard_event_scan::@10: scope:[keyboard_event_scan] from keyboard_event_scan::@22 keyboard_event_scan::@27
[132] phi()
[133] call keyboard_event_pressed
[134] (byte) keyboard_event_pressed::return#2 ← (byte) keyboard_event_pressed::return#11
to:keyboard_event_scan::@28
keyboard_event_scan::@28: scope:[keyboard_event_scan] from keyboard_event_scan::@10
[135] (byte~) keyboard_event_scan::$22 ← (byte) keyboard_event_pressed::return#2
[136] if((byte~) keyboard_event_scan::$22==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@11
to:keyboard_event_scan::@23
keyboard_event_scan::@23: scope:[keyboard_event_scan] from keyboard_event_scan::@28
[137] phi()
to:keyboard_event_scan::@11
keyboard_event_scan::@11: scope:[keyboard_event_scan] from keyboard_event_scan::@23 keyboard_event_scan::@28
[138] phi()
[139] call keyboard_event_pressed
[140] (byte) keyboard_event_pressed::return#10 ← (byte) keyboard_event_pressed::return#11
to:keyboard_event_scan::@29
keyboard_event_scan::@29: scope:[keyboard_event_scan] from keyboard_event_scan::@11
[141] (byte~) keyboard_event_scan::$26 ← (byte) keyboard_event_pressed::return#10
[142] if((byte~) keyboard_event_scan::$26==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@return
to:keyboard_event_scan::@24
keyboard_event_scan::@24: scope:[keyboard_event_scan] from keyboard_event_scan::@29
[143] phi()
to:keyboard_event_scan::@return
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@24 keyboard_event_scan::@29
[144] return
to:@return
keyboard_event_scan::@4: scope:[keyboard_event_scan] from keyboard_event_scan::@25 keyboard_event_scan::@5
[145] (byte) keyboard_events_size#10 ← phi( keyboard_event_scan::@25/(byte) keyboard_events_size#29 keyboard_event_scan::@5/(byte) keyboard_events_size#30 )
[145] (byte) keyboard_event_scan::keycode#10 ← phi( keyboard_event_scan::@25/(byte) keyboard_event_scan::keycode#11 keyboard_event_scan::@5/(byte) keyboard_event_scan::keycode#15 )
[145] (byte) keyboard_event_scan::col#2 ← phi( keyboard_event_scan::@25/(byte/signed byte/word/signed word/dword/signed dword) 0 keyboard_event_scan::@5/(byte) keyboard_event_scan::col#1 )
[146] (byte~) keyboard_event_scan::$3 ← (byte) keyboard_event_scan::row_scan#0 ^ *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)
[147] (byte~) keyboard_event_scan::$4 ← (byte~) keyboard_event_scan::$3 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
[148] if((byte~) keyboard_event_scan::$4==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@5
to:keyboard_event_scan::@15
keyboard_event_scan::@15: scope:[keyboard_event_scan] from keyboard_event_scan::@4
[149] if((byte) keyboard_events_size#10==(byte/signed byte/word/signed word/dword/signed dword) 8) goto keyboard_event_scan::@5
to:keyboard_event_scan::@16
keyboard_event_scan::@16: scope:[keyboard_event_scan] from keyboard_event_scan::@15
[150] (byte) keyboard_event_scan::event_type#0 ← (byte) keyboard_event_scan::row_scan#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
[151] if((byte) keyboard_event_scan::event_type#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto keyboard_event_scan::@7
to:keyboard_event_scan::@17
keyboard_event_scan::@17: scope:[keyboard_event_scan] from keyboard_event_scan::@16
[152] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte) keyboard_event_scan::keycode#10
[153] (byte) keyboard_events_size#2 ← ++ (byte) keyboard_events_size#10
to:keyboard_event_scan::@5
keyboard_event_scan::@5: scope:[keyboard_event_scan] from keyboard_event_scan::@15 keyboard_event_scan::@17 keyboard_event_scan::@4 keyboard_event_scan::@7
[154] (byte) keyboard_events_size#30 ← phi( keyboard_event_scan::@17/(byte) keyboard_events_size#2 keyboard_event_scan::@4/(byte) keyboard_events_size#10 keyboard_event_scan::@15/(byte) keyboard_events_size#10 keyboard_event_scan::@7/(byte) keyboard_events_size#1 )
[155] (byte) keyboard_event_scan::keycode#15 ← ++ (byte) keyboard_event_scan::keycode#10
[156] (byte) keyboard_event_scan::col#1 ← ++ (byte) keyboard_event_scan::col#2
[157] if((byte) keyboard_event_scan::col#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto keyboard_event_scan::@4
to:keyboard_event_scan::@19
keyboard_event_scan::@19: scope:[keyboard_event_scan] from keyboard_event_scan::@5
[158] *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2) ← (byte) keyboard_event_scan::row_scan#0
to:keyboard_event_scan::@3
keyboard_event_scan::@7: scope:[keyboard_event_scan] from keyboard_event_scan::@16
[159] (byte/word/dword~) keyboard_event_scan::$11 ← (byte) keyboard_event_scan::keycode#10 | (byte/signed byte/word/signed word/dword/signed dword) 64
[160] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte/word/dword~) keyboard_event_scan::$11
[161] (byte) keyboard_events_size#1 ← ++ (byte) keyboard_events_size#10
to:keyboard_event_scan::@5
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_event_scan::@1
[162] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0)
[163] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[164] return
to:@return
init: scope:[init] from main
[26] *((const byte[4*4]) current_piece#0) ← (const byte) GREEN#0
[27] *((const byte[4*4]) current_piece#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) GREEN#0
[28] *((const byte[4*4]) current_piece#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const byte) GREEN#0
[29] *((const byte[4*4]) current_piece#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const byte) GREEN#0
[30] call fill
[165] phi()
[166] call fill
to:init::@7
init::@7: scope:[init] from init
[31] phi()
[32] call fill
[167] phi()
[168] call fill
to:init::@1
init::@1: scope:[init] from init::@1 init::@7
[33] (byte*) init::li#2 ← phi( init::@1/(byte*) init::li#1 init::@7/(const byte*) COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 15 )
[33] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@7/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[34] (byte~) init::$4 ← (byte) init::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[35] *((const byte*[20]) screen_lines#0 + (byte~) init::$4) ← (byte*) init::li#2
[36] (byte*) init::li#1 ← (byte*) init::li#2 + (byte/signed byte/word/signed word/dword/signed dword) 40
[37] (byte) init::i#1 ← ++ (byte) init::i#2
[38] if((byte) init::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 20) goto init::@1
[169] (byte*) init::li#2 ← phi( init::@1/(byte*) init::li#1 init::@7/(const byte*) COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 40+(byte/signed byte/word/signed word/dword/signed dword) 15 )
[169] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@7/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[170] (byte~) init::$4 ← (byte) init::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[171] *((const byte*[20]) screen_lines#0 + (byte~) init::$4) ← (byte*) init::li#2
[172] (byte*) init::li#1 ← (byte*) init::li#2 + (byte/signed byte/word/signed word/dword/signed dword) 40
[173] (byte) init::i#1 ← ++ (byte) init::i#2
[174] if((byte) init::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 20) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1 init::@5
[39] (byte) init::l#4 ← phi( init::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@5/(byte) init::l#1 )
[39] (byte*) init::line#4 ← phi( init::@1/(const byte*) COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 14 init::@5/(byte*) init::line#1 )
[175] (byte) init::l#4 ← phi( init::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@5/(byte) init::l#1 )
[175] (byte*) init::line#4 ← phi( init::@1/(const byte*) COLS#0+(byte/signed byte/word/signed word/dword/signed dword) 14 init::@5/(byte*) init::line#1 )
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[40] (byte) init::c#2 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(byte) init::c#1 )
[41] (byte*~) init::$7 ← (byte*) init::line#4 + (byte) init::c#2
[42] *((byte*~) init::$7) ← (const byte) DARK_GREY#0
[43] (byte) init::c#1 ← ++ (byte) init::c#2
[44] if((byte) init::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 12) goto init::@3
[176] (byte) init::c#2 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(byte) init::c#1 )
[177] (byte*~) init::$7 ← (byte*) init::line#4 + (byte) init::c#2
[178] *((byte*~) init::$7) ← (const byte) DARK_GREY#0
[179] (byte) init::c#1 ← ++ (byte) init::c#2
[180] if((byte) init::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 12) goto init::@3
to:init::@5
init::@5: scope:[init] from init::@3
[45] (byte*) init::line#1 ← (byte*) init::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40
[46] (byte) init::l#1 ← ++ (byte) init::l#4
[47] if((byte) init::l#1!=(byte/signed byte/word/signed word/dword/signed dword) 22) goto init::@2
[181] (byte*) init::line#1 ← (byte*) init::line#4 + (byte/signed byte/word/signed word/dword/signed dword) 40
[182] (byte) init::l#1 ← ++ (byte) init::l#4
[183] if((byte) init::l#1!=(byte/signed byte/word/signed word/dword/signed dword) 22) goto init::@2
to:init::@return
init::@return: scope:[init] from init::@5
[48] return
[184] return
to:@return
fill: scope:[fill] from init init::@7
[49] (byte) fill::val#3 ← phi( init/(byte/word/signed word/dword/signed dword) 160 init::@7/(const byte) BLACK#0 )
[49] (byte*) fill::addr#0 ← phi( init/(const byte*) SCREEN#0 init::@7/(const byte*) COLS#0 )
[50] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (word/signed word/dword/signed dword) 1000
[185] (byte) fill::val#3 ← phi( init/(byte/word/signed word/dword/signed dword) 160 init::@7/(const byte) BLACK#0 )
[185] (byte*) fill::addr#0 ← phi( init/(const byte*) SCREEN#0 init::@7/(const byte*) COLS#0 )
[186] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (word/signed word/dword/signed dword) 1000
to:fill::@1
fill::@1: scope:[fill] from fill fill::@1
[51] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@1/(byte*) fill::addr#1 )
[52] *((byte*) fill::addr#2) ← (byte) fill::val#3
[53] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2
[54] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1
[187] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@1/(byte*) fill::addr#1 )
[188] *((byte*) fill::addr#2) ← (byte) fill::val#3
[189] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2
[190] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1
to:fill::@return
fill::@return: scope:[fill] from fill::@1
[55] return
[191] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,94 @@
(label) @8
(label) @16
(label) @begin
(label) @end
(byte) BLACK
(const byte) BLACK#0 BLACK = (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) 53280
(byte*) CIA1_PORT_A
(const byte*) CIA1_PORT_A#0 CIA1_PORT_A = ((byte*))(word/dword/signed dword) 56320
(byte*) CIA1_PORT_B
(const byte*) CIA1_PORT_B#0 CIA1_PORT_B = ((byte*))(word/dword/signed dword) 56321
(byte*) COLS
(const byte*) COLS#0 COLS = ((byte*))(word/dword/signed dword) 55296
(byte) DARK_GREY
(const byte) DARK_GREY#0 DARK_GREY = (byte/signed byte/word/signed word/dword/signed dword) 11
(byte) GREEN
(const byte) GREEN#0 GREEN = (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) KEY_COMMA
(const byte) KEY_COMMA#0 KEY_COMMA = (byte/signed byte/word/signed word/dword/signed dword) 47
(byte) KEY_COMMODORE
(const byte) KEY_COMMODORE#0 KEY_COMMODORE = (byte/signed byte/word/signed word/dword/signed dword) 61
(byte) KEY_CTRL
(const byte) KEY_CTRL#0 KEY_CTRL = (byte/signed byte/word/signed word/dword/signed dword) 58
(byte) KEY_DOT
(const byte) KEY_DOT#0 KEY_DOT = (byte/signed byte/word/signed word/dword/signed dword) 44
(byte) KEY_LSHIFT
(const byte) KEY_LSHIFT#0 KEY_LSHIFT = (byte/signed byte/word/signed word/dword/signed dword) 15
(byte) KEY_MODIFIER_COMMODORE
(byte) KEY_MODIFIER_CTRL
(byte) KEY_MODIFIER_LSHIFT
(byte) KEY_MODIFIER_RSHIFT
(byte) KEY_RSHIFT
(const byte) KEY_RSHIFT#0 KEY_RSHIFT = (byte/signed byte/word/signed word/dword/signed dword) 52
(byte) KEY_SPACE
(const byte) KEY_SPACE#0 KEY_SPACE = (byte/signed byte/word/signed word/dword/signed dword) 60
(byte) KEY_X
(const byte) KEY_X#0 KEY_X = (byte/signed byte/word/signed word/dword/signed dword) 23
(byte) KEY_Z
(const byte) KEY_Z#0 KEY_Z = (byte/signed byte/word/signed word/dword/signed dword) 12
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) 53266
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte[4*4]) current_piece
(const byte[4*4]) current_piece#0 current_piece = { fill( 4*4, 0) }
(void()) current_movedown()
(label) current_movedown::@return
(byte) current_movedown_counter
(byte) current_movedown_counter#1 current_movedown_counter zp ZP_BYTE:2 26.933333333333334
(byte) current_movedown_counter#14 current_movedown_counter zp ZP_BYTE:2 23.666666666666664
(byte) current_movedown_counter#16 current_movedown_counter zp ZP_BYTE:2 7.344827586206897
(byte) current_movedown_rate
(const byte) current_movedown_rate#0 current_movedown_rate = (byte/signed byte/word/signed word/dword/signed dword) 50
(byte) current_movedown_rate_fast
(const byte) current_movedown_rate_fast#0 current_movedown_rate_fast = (byte/signed byte/word/signed word/dword/signed dword) 5
(byte*) current_piece
(byte) current_piece_orientation
(byte) current_piece_orientation#10 current_piece_orientation zp ZP_BYTE:6 202.0
(byte) current_piece_orientation#11 current_piece_orientation zp ZP_BYTE:6 10.921052631578949
(byte) current_piece_orientation#13 reg byte y 13.0
(byte) current_piece_orientation#2 current_piece_orientation zp ZP_BYTE:6 101.0
(byte) current_piece_orientation#21 current_piece_orientation zp ZP_BYTE:6 47.33333333333333
(byte) current_piece_orientation#3 current_piece_orientation zp ZP_BYTE:6 101.0
(byte~) current_piece_orientation#66 reg byte y 7.333333333333333
(byte) current_xpos
(byte) current_xpos#1 current_xpos zp ZP_BYTE:5 101.0
(byte) current_xpos#11 current_xpos zp ZP_BYTE:5 202.0
(byte) current_xpos#12 current_xpos zp ZP_BYTE:5 13.833333333333334
(byte) current_xpos#15 current_xpos zp ZP_BYTE:5 47.33333333333333
(byte) current_xpos#2 current_xpos zp ZP_BYTE:5 101.0
(byte) current_xpos#26 current_xpos#26 zp ZP_BYTE:7 59.529411764705884
(byte) current_xpos#34 current_xpos zp ZP_BYTE:5 40.4
(byte~) current_xpos#64 current_xpos#64 zp ZP_BYTE:7 22.0
(byte) current_ypos
(byte) current_ypos#10 current_ypos zp ZP_BYTE:3 34.33333333333333
(byte) current_ypos#13 current_ypos zp ZP_BYTE:3 8.6
(byte) current_ypos#14 current_ypos#14 zp ZP_BYTE:4 6.588235294117648
(byte) current_ypos#17 current_ypos zp ZP_BYTE:3 11.206896551724137
(byte~) current_ypos#62 current_ypos#62 zp ZP_BYTE:4 11.0
(void()) fill((byte*) fill::start , (word) fill::size , (byte) fill::val)
(label) fill::@1
(label) fill::@return
(byte*) fill::addr
(byte*) fill::addr#0 addr zp ZP_WORD:4 2.0
(byte*) fill::addr#1 addr zp ZP_WORD:4 16.5
(byte*) fill::addr#2 addr zp ZP_WORD:4 17.5
(byte*) fill::addr#0 addr zp ZP_WORD:11 2.0
(byte*) fill::addr#1 addr zp ZP_WORD:11 16.5
(byte*) fill::addr#2 addr zp ZP_WORD:11 17.5
(byte*) fill::end
(byte*) fill::end#0 end zp ZP_WORD:6 2.6
(byte*) fill::end#0 end zp ZP_WORD:13 2.6
(word) fill::size
(byte*) fill::start
(byte) fill::val
(byte) fill::val#3 reg byte x 1.8333333333333333
(void()) init()
(byte~) init::$4 reg byte a 22.0
(byte*~) init::$7 $7 zp ZP_WORD:6 202.0
(byte*~) init::$7 $7 zp ZP_WORD:13 202.0
(label) init::@1
(label) init::@2
(label) init::@3
@ -47,48 +105,260 @@
(byte) init::l#1 l zp ZP_BYTE:2 16.5
(byte) init::l#4 l zp ZP_BYTE:2 3.142857142857143
(byte*) init::li
(byte*) init::li#1 li zp ZP_WORD:4 7.333333333333333
(byte*) init::li#2 li zp ZP_WORD:4 11.0
(byte*) init::li#1 li zp ZP_WORD:11 7.333333333333333
(byte*) init::li#2 li zp ZP_WORD:11 11.0
(byte*) init::line
(byte*) init::line#1 line zp ZP_WORD:4 7.333333333333333
(byte*) init::line#4 line zp ZP_WORD:4 20.499999999999996
(byte*) init::line#1 line zp ZP_WORD:11 7.333333333333333
(byte*) init::line#4 line zp ZP_WORD:11 20.499999999999996
(byte()) keyboard_event_get()
(label) keyboard_event_get::@3
(label) keyboard_event_get::@return
(byte) keyboard_event_get::return
(byte) keyboard_event_get::return#1 reg byte a 4.0
(byte) keyboard_event_get::return#2 reg byte a 34.33333333333333
(byte) keyboard_event_get::return#3 reg byte a 202.0
(byte()) keyboard_event_pressed((byte) keyboard_event_pressed::keycode)
(byte~) keyboard_event_pressed::$0 reg byte a 4.0
(byte~) keyboard_event_pressed::$1 reg byte a 4.0
(label) keyboard_event_pressed::@return
(byte) keyboard_event_pressed::keycode
(byte) keyboard_event_pressed::keycode#5 keycode zp ZP_BYTE:7 1.3333333333333333
(byte) keyboard_event_pressed::return
(byte) keyboard_event_pressed::return#0 reg byte a 4.0
(byte) keyboard_event_pressed::return#1 reg byte a 4.0
(byte) keyboard_event_pressed::return#10 reg byte a 4.0
(byte) keyboard_event_pressed::return#11 reg byte a 15.857142857142861
(byte) keyboard_event_pressed::return#12 reg byte a 202.0
(byte) keyboard_event_pressed::return#2 reg byte a 4.0
(byte) keyboard_event_pressed::row_bits
(byte) keyboard_event_pressed::row_bits#0 row_bits zp ZP_BYTE:9 2.0
(void()) keyboard_event_scan()
(byte/word/dword~) keyboard_event_scan::$11 reg byte a 20002.0
(byte~) keyboard_event_scan::$14 reg byte a 4.0
(byte~) keyboard_event_scan::$18 reg byte a 4.0
(byte~) keyboard_event_scan::$22 reg byte a 4.0
(byte~) keyboard_event_scan::$26 reg byte a 4.0
(byte~) keyboard_event_scan::$3 reg byte a 20002.0
(byte~) keyboard_event_scan::$4 reg byte a 20002.0
(label) keyboard_event_scan::@1
(label) keyboard_event_scan::@10
(label) keyboard_event_scan::@11
(label) keyboard_event_scan::@13
(label) keyboard_event_scan::@15
(label) keyboard_event_scan::@16
(label) keyboard_event_scan::@17
(label) keyboard_event_scan::@19
(label) keyboard_event_scan::@20
(label) keyboard_event_scan::@21
(label) keyboard_event_scan::@22
(label) keyboard_event_scan::@23
(label) keyboard_event_scan::@24
(label) keyboard_event_scan::@25
(label) keyboard_event_scan::@26
(label) keyboard_event_scan::@27
(label) keyboard_event_scan::@28
(label) keyboard_event_scan::@29
(label) keyboard_event_scan::@3
(label) keyboard_event_scan::@4
(label) keyboard_event_scan::@5
(label) keyboard_event_scan::@7
(label) keyboard_event_scan::@9
(label) keyboard_event_scan::@return
(byte) keyboard_event_scan::col
(byte) keyboard_event_scan::col#1 col zp ZP_BYTE:7 15001.5
(byte) keyboard_event_scan::col#2 col zp ZP_BYTE:7 2857.4285714285716
(byte) keyboard_event_scan::event_type
(byte) keyboard_event_scan::event_type#0 reg byte a 20002.0
(byte) keyboard_event_scan::keycode
(byte) keyboard_event_scan::keycode#1 keycode zp ZP_BYTE:8 2002.0
(byte) keyboard_event_scan::keycode#10 keycode zp ZP_BYTE:8 3154.230769230769
(byte) keyboard_event_scan::keycode#11 keycode zp ZP_BYTE:8 500.5
(byte) keyboard_event_scan::keycode#14 keycode zp ZP_BYTE:8 1001.0
(byte) keyboard_event_scan::keycode#15 keycode zp ZP_BYTE:8 5250.75
(byte) keyboard_event_scan::row
(byte) keyboard_event_scan::row#1 row zp ZP_BYTE:4 1501.5
(byte) keyboard_event_scan::row#2 row zp ZP_BYTE:4 600.24
(byte) keyboard_event_scan::row_scan
(byte) keyboard_event_scan::row_scan#0 row_scan zp ZP_BYTE:9 1278.0555555555554
(byte[8]) keyboard_events
(const byte[8]) keyboard_events#0 keyboard_events = { fill( 8, 0) }
(byte) keyboard_events_size
(byte) keyboard_events_size#1 reg byte x 20002.0
(byte) keyboard_events_size#10 reg byte x 8100.9000000000015
(byte) keyboard_events_size#13 reg byte x 97.06451612903226
(byte) keyboard_events_size#16 reg byte x 2.2745098039215685
(byte) keyboard_events_size#19 reg byte x 22.799999999999997
(byte) keyboard_events_size#2 reg byte x 20002.0
(byte) keyboard_events_size#29 reg byte x 429.2857142857143
(byte) keyboard_events_size#30 reg byte x 10201.2
(byte) keyboard_events_size#4 reg byte x 3.0
(byte[8]) keyboard_matrix_col_bitmask
(const byte[8]) keyboard_matrix_col_bitmask#0 keyboard_matrix_col_bitmask = { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
(label) keyboard_matrix_read::@return
(byte) keyboard_matrix_read::return
(byte) keyboard_matrix_read::return#0 reg byte a 334.33333333333337
(byte) keyboard_matrix_read::return#2 reg byte a 2002.0
(byte) keyboard_matrix_read::row_pressed_bits
(byte) keyboard_matrix_read::rowid
(byte) keyboard_matrix_read::rowid#0 reg byte y 1003.0
(byte[8]) keyboard_matrix_row_bitmask
(const byte[8]) keyboard_matrix_row_bitmask#0 keyboard_matrix_row_bitmask = { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte) keyboard_modifiers
(byte[8]) keyboard_scan_values
(const byte[8]) keyboard_scan_values#0 keyboard_scan_values = { fill( 8, 0) }
(void()) main()
(label) main::@2
(byte~) main::$19 reg byte a 202.0
(byte/signed word/word/dword/signed dword~) main::$28 reg byte a 202.0
(byte/signed word/word/dword/signed dword~) main::$32 reg byte a 202.0
(byte~) main::$9 reg byte a 202.0
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@13
(label) main::@14
(label) main::@15
(label) main::@16
(label) main::@17
(label) main::@18
(label) main::@29
(label) main::@30
(label) main::@31
(label) main::@32
(label) main::@33
(label) main::@34
(label) main::@35
(label) main::@36
(label) main::@37
(label) main::@38
(label) main::@39
(label) main::@4
(label) main::@41
(label) main::@42
(label) main::@44
(label) main::@45
(label) main::@46
(label) main::@48
(label) main::@49
(label) main::@7
(label) main::@8
(label) main::@9
(byte) main::key_event
(byte) main::key_event#0 key_event zp ZP_BYTE:8 20.794117647058826
(byte) main::movedown
(byte) main::movedown#10 movedown zp ZP_BYTE:4 50.5
(byte) main::movedown#2 movedown zp ZP_BYTE:4 202.0
(byte) main::movedown#3 movedown zp ZP_BYTE:4 202.0
(byte) main::movedown#6 movedown zp ZP_BYTE:4 303.0
(byte) main::movedown#7 movedown zp ZP_BYTE:4 252.5
(byte) main::render
(byte) main::render#10 reg byte y 101.0
(byte) main::render#11 reg byte y 101.0
(byte) main::render#13 reg byte y 60.599999999999994
(byte) main::render#16 reg byte y 134.66666666666666
(byte) main::render#2 reg byte y 202.0
(byte) main::render#3 reg byte y 202.0
(byte) main::render#4 reg byte y 202.0
(byte) main::render#5 reg byte y 202.0
(byte) main::render#7 reg byte y 404.0
(byte[4*4*4]) piece_t
(const byte[4*4*4]) piece_t#0 piece_t = { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 }
(byte[20*10]) playfield
(const byte[20*10]) playfield#0 playfield = { fill( 20*10, 0) }
(void()) render_current_piece()
(label) render_current_piece::@return
(void()) render_current()
(byte~) render_current::$1 reg byte a 202.0
(byte~) render_current::$2 reg byte a 202.0
(label) render_current::@1
(label) render_current::@2
(label) render_current::@3
(label) render_current::@5
(label) render_current::@6
(label) render_current::@7
(label) render_current::@return
(byte) render_current::c
(byte) render_current::c#1 c zp ZP_BYTE:10 1501.5
(byte) render_current::c#2 c zp ZP_BYTE:10 429.0
(byte) render_current::current_cell
(byte) render_current::current_cell#0 current_cell zp ZP_BYTE:15 600.5999999999999
(byte*) render_current::current_piece_gfx
(byte*) render_current::current_piece_gfx#0 current_piece_gfx zp ZP_WORD:11 62.6875
(byte) render_current::i
(byte) render_current::i#1 i zp ZP_BYTE:9 233.66666666666669
(byte) render_current::i#2 i zp ZP_BYTE:9 1552.0
(byte) render_current::i#3 i zp ZP_BYTE:9 50.5
(byte) render_current::l
(byte) render_current::l#1 l zp ZP_BYTE:8 151.5
(byte) render_current::l#2 l zp ZP_BYTE:8 23.307692307692307
(byte*) render_current::screen_line
(byte*) render_current::screen_line#0 screen_line zp ZP_WORD:13 110.19999999999999
(byte) render_current::xpos
(byte) render_current::xpos#0 reg byte a 1501.5
(void()) render_playfield()
(byte~) render_playfield::$0 reg byte a 22.0
(byte*~) render_playfield::$1 $1 zp ZP_WORD:6 202.0
(byte~) render_playfield::$0 reg byte a 202.0
(byte*~) render_playfield::$1 $1 zp ZP_WORD:13 2002.0
(label) render_playfield::@1
(label) render_playfield::@2
(label) render_playfield::@3
(label) render_playfield::@return
(byte) render_playfield::c
(byte) render_playfield::c#1 reg byte x 151.5
(byte) render_playfield::c#2 reg byte x 75.75
(byte) render_playfield::c#1 c zp ZP_BYTE:7 1501.5
(byte) render_playfield::c#2 c zp ZP_BYTE:7 750.75
(byte) render_playfield::i
(byte) render_playfield::i#1 i zp ZP_BYTE:3 42.599999999999994
(byte) render_playfield::i#2 i zp ZP_BYTE:3 104.66666666666666
(byte) render_playfield::i#3 i zp ZP_BYTE:3 7.333333333333333
(byte) render_playfield::i#1 i zp ZP_BYTE:8 420.59999999999997
(byte) render_playfield::i#2 i zp ZP_BYTE:8 1034.6666666666667
(byte) render_playfield::i#3 i zp ZP_BYTE:8 67.33333333333333
(byte) render_playfield::l
(byte) render_playfield::l#1 l zp ZP_BYTE:2 16.5
(byte) render_playfield::l#2 l zp ZP_BYTE:2 3.666666666666667
(byte) render_playfield::l#1 l zp ZP_BYTE:4 151.5
(byte) render_playfield::l#2 l zp ZP_BYTE:4 33.666666666666664
(byte*) render_playfield::line
(byte*) render_playfield::line#0 line zp ZP_WORD:4 16.0
(byte*) render_playfield::line#0 line zp ZP_WORD:11 157.42857142857142
(byte*[20]) screen_lines
(const byte*[20]) screen_lines#0 screen_lines = { fill( 20, 0) }
zp ZP_BYTE:2 [ render_playfield::l#2 render_playfield::l#1 init::l#4 init::l#1 ]
reg byte x [ render_playfield::c#2 render_playfield::c#1 ]
zp ZP_BYTE:3 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ]
zp ZP_BYTE:2 [ current_movedown_counter#14 current_movedown_counter#16 current_movedown_counter#1 init::l#4 init::l#1 ]
zp ZP_BYTE:3 [ current_ypos#13 current_ypos#17 current_ypos#10 ]
zp ZP_BYTE:4 [ main::movedown#6 main::movedown#7 main::movedown#10 main::movedown#2 main::movedown#3 current_ypos#14 current_ypos#62 render_playfield::l#2 render_playfield::l#1 keyboard_event_scan::row#2 keyboard_event_scan::row#1 ]
zp ZP_BYTE:5 [ current_xpos#34 current_xpos#11 current_xpos#12 current_xpos#15 current_xpos#1 current_xpos#2 ]
zp ZP_BYTE:6 [ current_piece_orientation#10 current_piece_orientation#11 current_piece_orientation#21 current_piece_orientation#2 current_piece_orientation#3 ]
reg byte y [ main::render#7 main::render#11 main::render#10 main::render#16 main::render#13 main::render#2 main::render#3 main::render#4 main::render#5 ]
reg byte y [ current_piece_orientation#13 current_piece_orientation#66 ]
zp ZP_BYTE:7 [ current_xpos#26 current_xpos#64 render_playfield::c#2 render_playfield::c#1 keyboard_event_pressed::keycode#5 keyboard_event_scan::col#2 keyboard_event_scan::col#1 ]
zp ZP_BYTE:8 [ render_current::l#2 render_current::l#1 render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 keyboard_event_scan::keycode#15 main::key_event#0 ]
zp ZP_BYTE:9 [ render_current::i#2 render_current::i#3 render_current::i#1 keyboard_event_pressed::row_bits#0 keyboard_event_scan::row_scan#0 ]
zp ZP_BYTE:10 [ render_current::c#2 render_current::c#1 ]
reg byte a [ keyboard_event_get::return#2 keyboard_event_get::return#1 ]
reg byte x [ keyboard_events_size#10 keyboard_events_size#29 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#30 keyboard_events_size#2 keyboard_events_size#1 ]
reg byte x [ init::i#2 init::i#1 ]
zp ZP_WORD:4 [ init::li#2 init::li#1 init::line#4 init::line#1 fill::addr#2 fill::addr#0 fill::addr#1 render_playfield::line#0 ]
zp ZP_WORD:11 [ init::li#2 init::li#1 init::line#4 init::line#1 fill::addr#2 fill::addr#0 fill::addr#1 render_current::current_piece_gfx#0 render_playfield::line#0 ]
reg byte x [ init::c#2 init::c#1 ]
reg byte x [ fill::val#3 ]
reg byte a [ keyboard_event_get::return#3 ]
reg byte a [ keyboard_event_pressed::return#12 ]
reg byte a [ main::$9 ]
reg byte a [ main::$19 ]
reg byte a [ main::$28 ]
reg byte a [ main::$32 ]
reg byte a [ render_current::$1 ]
reg byte a [ render_current::$2 ]
zp ZP_WORD:13 [ render_current::screen_line#0 render_playfield::$1 init::$7 fill::end#0 ]
zp ZP_BYTE:15 [ render_current::current_cell#0 ]
reg byte a [ render_current::xpos#0 ]
reg byte a [ render_playfield::$0 ]
zp ZP_WORD:6 [ render_playfield::$1 init::$7 fill::end#0 ]
reg byte a [ keyboard_event_pressed::$0 ]
reg byte a [ keyboard_event_pressed::$1 ]
reg byte a [ keyboard_event_pressed::return#11 ]
reg byte y [ keyboard_matrix_read::rowid#0 ]
reg byte a [ keyboard_matrix_read::return#2 ]
reg byte a [ keyboard_event_pressed::return#0 ]
reg byte a [ keyboard_event_scan::$14 ]
reg byte a [ keyboard_event_pressed::return#1 ]
reg byte a [ keyboard_event_scan::$18 ]
reg byte a [ keyboard_event_pressed::return#2 ]
reg byte a [ keyboard_event_scan::$22 ]
reg byte a [ keyboard_event_pressed::return#10 ]
reg byte a [ keyboard_event_scan::$26 ]
reg byte a [ keyboard_event_scan::$3 ]
reg byte a [ keyboard_event_scan::$4 ]
reg byte a [ keyboard_event_scan::event_type#0 ]
reg byte a [ keyboard_event_scan::$11 ]
reg byte a [ keyboard_matrix_read::return#0 ]
reg byte a [ init::$4 ]

View File

@ -188,8 +188,6 @@ Removing PHI-reference to removed block (main::toUpper1) in block main::toUpper1
if() condition always true - replacing block destination if((const bool) main::toUpper1_bo#0) goto main::toUpper1_@2
if() condition always false - eliminating if((const bool) main::toUpper2_bo#0) goto main::toUpper2_@2
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const bool) main::toUpper1_bo#0
Eliminating unused constant (const bool) main::toUpper2_bo#0
Successful SSA optimization PassNEliminateUnusedVars
Removing PHI-reference to removed block (main::toUpper2_@2) in block main::toUpper2_@1
Removing unused block main::toUpper2_@2
@ -201,7 +199,6 @@ Successful SSA optimization Pass2CullEmptyBlocks
Redundant Phi (byte) main::toUpper1_return#0 (const byte) main::toUpper1_res#1
Redundant Phi (byte) main::toUpper2_return#0 (const byte) main::toUpper2_ch#0
Successful SSA optimization Pass2RedundantPhiElimination
Eliminating unused constant (const byte) main::toUpper2_res#1
Successful SSA optimization PassNEliminateUnusedVars
Culled Empty Block (label) main::toUpper1_@1
Culled Empty Block (label) main::toUpper2_@1

View File

@ -337,7 +337,6 @@ Fixing inline constructor with main::$5 ← main::line2_xpos#0 w= 0
Successful SSA optimization Pass2FixInlineConstructors
Inferred type updated to word/signed word/dword/signed dword in (word~) main::$4 ← (const byte) main::line1_xpos#0 w= (byte/signed byte/word/signed word/dword/signed dword) 0
Inferred type updated to word/signed word/dword/signed dword in (word~) main::$5 ← (const byte) main::line2_xpos#0 w= (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused constant (const byte*) cur_line#15
Successful SSA optimization PassNEliminateUnusedVars
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@3

View File

@ -1493,10 +1493,6 @@ Successful SSA optimization Pass2ConstantIfs
Fixing inline constructor with bitmap_clear::$3 ← *(bitmap_plot_yhi#0 + 0) w= *(bitmap_plot_ylo#0 + 0)
Fixing inline constructor with bitmap_plot::$3 ← *(bitmap_plot_yhi#0 + bitmap_plot::y#0) w= *(bitmap_plot_ylo#0 + bitmap_plot::y#0)
Successful SSA optimization Pass2FixInlineConstructors
Eliminating unused constant (const word) divr16s::dividendu#0
Eliminating unused constant (const word) divr16s::remu#0
Eliminating unused constant (const word) divr16s::divisoru#0
Eliminating unused constant (const bool) divr16s::$0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (word) divr16s::remu#1 ← ((word)) (signed word~) divr16s::$7
Eliminating Noop Cast (word) divr16s::remu#2 ← ((word)) (signed word) divr16s::rem#0

View File

@ -1275,7 +1275,6 @@ Fixing inline constructor with lin16u_gen::$9 ← lin16u_gen::stepi#0 dw= lin16u
Fixing inline constructor with lin16u_gen::$10 ← lin16u_gen::min#3 dw= 0
Successful SSA optimization Pass2FixInlineConstructors
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value divr16u::i#1 ← ++ divr16u::i#2 to ++
Resolved ranged comparison value if(divr16u::i#1!=rangelast(0,15)) goto divr16u::@1 to (byte/signed byte/word/signed word/dword/signed dword) 16

View File

@ -110,9 +110,6 @@ Consolidated array index constant in assignment *(SCREEN#0+9 + main::$1)
Successful SSA optimization Pass2ConstantAdditionElimination
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::i#2
Inferred type updated to byte in (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) main::i#2
Eliminating unused constant (const string) $2
Eliminating unused constant (const string) $3
Eliminating unused constant (const string) $0
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,3)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 4

View File

@ -1480,7 +1480,6 @@ Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0
Successful SSA optimization Pass2ConstantIdentification
Fixing inline constructor with div32u16u::$4 ← div32u16u::quotient_hi#0 dw= div32u16u::quotient_lo#0
Successful SSA optimization Pass2FixInlineConstructors
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (signed word) sin16s::sinx#0 ← ((signed word)) (word) sin16s::usinx#1
Eliminating Noop Cast (signed word~) sin16s::$20 ← ((signed word)) (word) sin16s::usinx#1

View File

@ -1936,7 +1936,6 @@ Successful SSA optimization Pass2ConstantIdentification
Fixing inline constructor with div32u16u::$4 ← div32u16u::quotient_hi#0 dw= div32u16u::quotient_lo#0
Successful SSA optimization Pass2FixInlineConstructors
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (signed word) sin16s::sinx#0 ← ((signed word)) (word) sin16s::usinx#1
Eliminating Noop Cast (signed word~) sin16s::$20 ← ((signed word)) (word) sin16s::usinx#1

View File

@ -2113,7 +2113,6 @@ Constant (const word) divr16u::divisor#2 = div32u16u::divisor#0
Successful SSA optimization Pass2ConstantIdentification
Fixing inline constructor with div32u16u::$4 ← div32u16u::quotient_hi#0 dw= div32u16u::quotient_lo#0
Successful SSA optimization Pass2FixInlineConstructors
Eliminating unused constant (const word) rem16u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (signed word) sin16s::sinx#0 ← ((signed word)) (word) sin16s::usinx#1
Eliminating Noop Cast (signed word~) sin16s::$20 ← ((signed word)) (word) sin16s::usinx#1

View File

@ -3003,18 +3003,8 @@ Constant (const word) divr16s::remu#1 = ((word))divr16s::$7
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating if((const bool) divr16s::$1) goto divr16s::@1
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) div8s::dividendu#0
Eliminating unused constant (const byte) div8s::divisoru#0
Eliminating unused constant (const word) divr16s::dividendu#0
Eliminating unused constant (const word) divr16s::remu#0
Eliminating unused constant (const word) divr16s::divisoru#0
Eliminating unused constant (const bool) divr16s::$1
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word) rem16u#0
Eliminating unused constant (const signed byte) rem8s#0
Eliminating unused constant (const signed word) rem16s#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) rem8u#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating Noop Cast (word) print_word::w#0 ← ((word)) (signed word) print_sword::w#6
Eliminating Noop Cast (byte) print_byte::b#0 ← ((byte)) (signed byte) print_sbyte::b#7

View File

@ -217,7 +217,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@2_10) in block main::@2_11
if() condition always false - eliminating [17] if((const byte) main::line#22!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@2_11
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) main::line#22
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) main::line#23 from unused block main::@2_11
Eliminating variable (byte/signed word/word/dword/signed dword~) main::$24 from unused block main::@2_11
@ -476,7 +475,6 @@ Successful SSA optimization Pass2ConstantAdditionElimination
Removing PHI-reference to removed block (main::@3_2) in block main::@1_1
if() condition always false - eliminating [124] if((const byte) main::x#24!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@1_1
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) main::x#24
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) main::x#25 from unused block main::@1_1
Eliminating variable (byte) main::x#26 from unused block main::@3_1

View File

@ -371,7 +371,6 @@ Successful SSA optimization Pass2ConstantIdentification
Removing PHI-reference to removed block (main::@2_24) in block main::@2_25
if() condition always false - eliminating [31] if((const byte) main::line#50!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_25
Successful SSA optimization Pass2ConstantIfs
Eliminating unused constant (const byte) main::line#50
Successful SSA optimization PassNEliminateUnusedVars
Eliminating variable (byte) main::line#51 from unused block main::@2_25
Eliminating variable (byte/signed word/word/dword/signed dword~) main::$52 from unused block main::@2_25

View File

@ -450,12 +450,8 @@ Removing unused block main::@3_26
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@2_1
Successful SSA optimization Pass2CullEmptyBlocks
Eliminating unused constant (const byte) main::line#53
Eliminating unused constant (const byte*) main::$53
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const word/signed word/dword/signed dword) main::$52
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) main::line#51
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte) main::x#0
Inlining constant with different constant siblings (const byte) main::line#0

View File

@ -142,9 +142,7 @@ Constant (const byte) b#11 = ++b#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) b#2 = ++b#11
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte) s::return#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const byte) s::return#1
Successful SSA optimization PassNEliminateUnusedVars
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,100)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 101

View File

@ -84,7 +84,6 @@ Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@1
Successful SSA optimization Pass2CullEmptyBlocks
Eliminating unused constant (const byte) main::line#0
Successful SSA optimization PassNEliminateUnusedVars
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1