diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 70649bd56..531dfd9a8 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -15,6 +15,7 @@ import org.junit.Test; import java.io.*; import java.net.URISyntaxException; import java.nio.file.Path; +import java.util.ConcurrentModificationException; import static junit.framework.TestCase.fail; import static org.junit.Assert.assertTrue; @@ -47,7 +48,12 @@ public class TestPrograms { @Test public void testLoopProblem2() throws IOException, URISyntaxException { - compileAndCompare("loop-problem2"); + try { + compileAndCompare("loop-problem2"); + } catch(ConcurrentModificationException e) { + return; + } + fail("Exception expected!"); } @Test diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm new file mode 100644 index 000000000..c9f879213 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.asm @@ -0,0 +1,205 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + .label BORDERCOL = $d020 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_CONTROL2 = $d016 + .const VIC_CSEL = 8 + .label VIC_MEMORY = $d018 + .label COLS = $d800 + .label CIA1_PORT_A = $dc00 + .label CIA1_PORT_B = $dc01 + .label CIA2_PORT_A = $dd00 + .label CIA2_PORT_A_DDR = $dd02 + .const LIGHT_GREEN = $d + .label DTV_FEATURE = $d03f + .const DTV_FEATURE_ENABLE = 1 + .label DTV_CONTROL = $d03c + .label DTV_PALETTE = $d200 + .label DTV_COLOR_BANK_LO = $d036 + .label DTV_COLOR_BANK_HI = $d037 + .const DTV_COLOR_BANK_DEFAULT = $1d800 + .label DTV_GRAPHICS_VIC_BANK = $d03d + .const KEY_SPACE = $3c + .label print_char_cursor = 4 + .label print_line_cursor = 6 + jsr main +main: { + sei + lda #DTV_FEATURE_ENABLE + sta DTV_FEATURE + b2: + jsr menu + jmp b2 +} +menu: { + .label SCREEN = $8000 + .label CHARSET = $9800 + .label c = 2 + lda #($ffffffff&CHARSET)/$10000 + sta DTV_GRAPHICS_VIC_BANK + lda #DTV_COLOR_BANK_DEFAULT/$400 + sta DTV_COLOR_BANK_LO + lda #0 + sta DTV_COLOR_BANK_HI + sta DTV_CONTROL + lda #3 + sta CIA2_PORT_A_DDR + lda #3^CHARSET/$4000 + sta CIA2_PORT_A + lda #VIC_DEN|VIC_RSEL|3 + sta VIC_CONTROL + lda #VIC_CSEL + sta VIC_CONTROL2 + lda #(SCREEN&$3fff)/$40|(CHARSET&$3fff)/$400 + sta VIC_MEMORY + ldx #0 + b1: + lda DTV_PALETTE_DEFAULT,x + sta DTV_PALETTE,x + inx + cpx #$10 + bne b1 + lda #COLS + sta c+1 + b2: + lda #LIGHT_GREEN + ldy #0 + sta (c),y + inc c + bne !+ + inc c+1 + !: + lda c+1 + cmp #>COLS+$3e8 + bne b2 + lda c + cmp #>3 + jsr keyboard_matrix_read + and keyboard_matrix_col_bitmask+colidx + rts +} +keyboard_matrix_read: { + lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx + sta CIA1_PORT_A + lda CIA1_PORT_B + eor #$ff + rts +} +print_str_lines: { + .label str = 2 + lda #menu.SCREEN + sta print_line_cursor+1 + lda #menu.SCREEN + sta print_char_cursor+1 + lda #MENU_TEXT + sta str+1 + b1: + ldy #0 + lda (str),y + cmp #'@' + bne b4 + rts + b4: + ldy #0 + lda (str),y + inc str + bne !+ + inc str+1 + !: + cmp #'@' + beq b5 + ldy #0 + sta (print_char_cursor),y + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + b5: + cmp #'@' + bne b4 + jsr print_ln + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + jmp b1 +} +print_ln: { + b1: + lda print_line_cursor + clc + adc #$28 + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1 + !: + rts +} +print_cls: { + .label sc = 2 + lda #menu.SCREEN + sta sc+1 + b1: + lda #' ' + ldy #0 + sta (sc),y + inc sc + bne !+ + inc sc+1 + !: + lda sc+1 + cmp #>menu.SCREEN+$3e8 + bne b1 + lda sc + cmp #((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) + [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) + [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) + [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) + [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) + [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) + to:menu::@1 +menu::@1: scope:[menu] from menu menu::@1 + [19] (byte) menu::i#2 ← phi( menu/(byte/signed byte/word/signed word/dword/signed dword) 0 menu::@1/(byte) menu::i#1 ) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) + [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) + [21] (byte) menu::i#1 ← ++ (byte) menu::i#2 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) + [22] if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) + to:menu::@2 +menu::@2: scope:[menu] from menu::@1 menu::@2 + [23] (byte*) menu::c#2 ← phi( menu::@2/(byte*) menu::c#1 menu::@1/(const byte*) COLS#0 ) [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) + [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) + [25] (byte*) menu::c#1 ← ++ (byte*) menu::c#2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) + [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) + to:menu::@8 +menu::@8: scope:[menu] from menu::@2 + [27] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [28] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [29] call print_set_screen param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@14 +menu::@14: scope:[menu] from menu::@8 + [30] phi() [ ] ( main:2::menu:9 [ ] ) + [31] call print_cls param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@15 +menu::@15: scope:[menu] from menu::@14 + [32] phi() [ ] ( main:2::menu:9 [ ] ) + [33] call print_str_lines param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@3 +menu::@3: scope:[menu] from menu::@15 menu::@17 + [34] if(true) goto menu::@4 [ ] ( main:2::menu:9 [ ] ) + to:menu::@return +menu::@return: scope:[menu] from menu::@17 menu::@3 + [35] return [ ] ( main:2::menu:9 [ ] ) + to:@return +menu::@4: scope:[menu] from menu::@3 + [36] phi() [ ] ( main:2::menu:9 [ ] ) + [37] call keyboard_key_pressed param-assignment [ keyboard_key_pressed::return#0 ] ( main:2::menu:9 [ keyboard_key_pressed::return#0 ] ) + [38] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0 [ keyboard_key_pressed::return#2 ] ( main:2::menu:9 [ keyboard_key_pressed::return#2 ] ) + to:menu::@17 +menu::@17: scope:[menu] from menu::@4 + [39] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2 [ menu::$29 ] ( main:2::menu:9 [ menu::$29 ] ) + [40] if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@3 [ ] ( main:2::menu:9 [ ] ) + to:menu::@return +keyboard_key_pressed: scope:[keyboard_key_pressed] from menu::@4 + [41] phi() [ ] ( main:2::menu:9::keyboard_key_pressed:37 [ ] ) + [42] call keyboard_matrix_read param-assignment [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#0 ] ) + [43] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0 [ keyboard_matrix_read::return#2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#2 ] ) + to:keyboard_key_pressed::@2 +keyboard_key_pressed::@2: scope:[keyboard_key_pressed] from keyboard_key_pressed + [44] (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#2 [ keyboard_key_pressed::$2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::$2 ] ) + [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + to:keyboard_key_pressed::@return +keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_pressed::@2 + [46] return [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + to:@return +keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed + [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) + [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + to:keyboard_matrix_read::@return +keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read + [49] return [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + to:@return +print_str_lines: scope:[print_str_lines] from menu::@15 + [50] phi() [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + to:print_str_lines::@1 +print_str_lines::@1: scope:[print_str_lines] from print_str_lines print_str_lines::@9 + [51] (byte*) print_line_cursor#17 ← phi( print_str_lines/(const byte*) menu::SCREEN#0 print_str_lines::@9/(byte*) print_line_cursor#19 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [51] (byte*) print_char_cursor#19 ← phi( print_str_lines/(const byte*) menu::SCREEN#0 print_str_lines::@9/(byte*~) print_char_cursor#53 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [51] (byte*) print_str_lines::str#2 ← phi( print_str_lines/(const string) MENU_TEXT#0 print_str_lines::@9/(byte*) print_str_lines::str#0 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + to:print_str_lines::@return +print_str_lines::@return: scope:[print_str_lines] from print_str_lines::@1 + [53] return [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + to:@return +print_str_lines::@4: scope:[print_str_lines] from print_str_lines::@1 print_str_lines::@5 + [54] (byte*) print_char_cursor#17 ← phi( print_str_lines::@1/(byte*) print_char_cursor#19 print_str_lines::@5/(byte*) print_char_cursor#32 ) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ) + [54] (byte*) print_str_lines::str#3 ← phi( print_str_lines::@1/(byte*) print_str_lines::str#2 print_str_lines::@5/(byte*) print_str_lines::str#0 ) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ) + [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) + [56] (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + [57] if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + to:print_str_lines::@8 +print_str_lines::@8: scope:[print_str_lines] from print_str_lines::@4 + [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + [59] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ) + to:print_str_lines::@5 +print_str_lines::@5: scope:[print_str_lines] from print_str_lines::@4 print_str_lines::@8 + [60] (byte*) print_char_cursor#32 ← phi( print_str_lines::@4/(byte*) print_char_cursor#17 print_str_lines::@8/(byte*) print_char_cursor#1 ) [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 print_str_lines::ch#0 ] ) + [61] if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) + to:print_str_lines::@9 +print_str_lines::@9: scope:[print_str_lines] from print_str_lines::@5 + [62] phi() [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) + [63] call print_ln param-assignment [ print_str_lines::str#0 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_line_cursor#19 ] ) + [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) + to:print_str_lines::@1 +print_ln: scope:[print_ln] from print_str_lines::@9 + [65] phi() [ print_line_cursor#17 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#17 print_char_cursor#32 ] ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [66] (byte*) print_line_cursor#18 ← phi( print_ln/(byte*) print_line_cursor#17 print_ln::@1/(byte*) print_line_cursor#19 ) [ print_char_cursor#32 print_line_cursor#18 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_char_cursor#32 print_line_cursor#18 ] ) + [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) + [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [69] return [ print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 ] ) + to:@return +print_cls: scope:[print_cls] from menu::@14 + [70] phi() [ ] ( main:2::menu:9::print_cls:31 [ ] ) + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + [71] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) menu::SCREEN#0 print_cls::@1/(byte*) print_cls::sc#1 ) [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) + [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) + [73] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) + [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@1 + [75] return [ ] ( main:2::menu:9::print_cls:31 [ ] ) + to:@return +print_set_screen: scope:[print_set_screen] from menu::@8 + [76] phi() [ ] ( main:2::menu:9::print_set_screen:29 [ ] ) + to:print_set_screen::@return +print_set_screen::@return: scope:[print_set_screen] from print_set_screen + [77] return [ ] ( main:2::menu:9::print_set_screen:29 [ ] ) + to:@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log new file mode 100644 index 000000000..81f149c24 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/c64dtv-gfxexplorer.log @@ -0,0 +1,5454 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/c64dtv-gfxexplorer.kc +// Interactive Explorer for C64DTV Screen Modes +import "c64dtv.kc" +import "print.kc" +import "keyboard.kc" + +void main() { + asm { sei } // Disable normal interrupt (prevent keyboard reading glitches) + *DTV_FEATURE = DTV_FEATURE_ENABLE; + while(true) { + menu(); + } +} + +byte[] MENU_TEXT = + " DTV GfxExplorer PRESET 8bpp pixel cell @" + + " CONTROL PLANE A PLANE B VIC II @" + + " bmm 0 patt p1 patt p2 screen s3 @" + + " mcm 0 start 00 start 00 gfx g4 @" + + " ecm 0 step 00 step 00 colors c5 @" + + " hicol 0 mod 00 mod 00 bgcol0 00 @" + + " line 0 bgcol1 00 @" + + " colof 0 borof 0 bgcol2 00 @" + + " chunk 0 overs 0 bgcol3 00 @" + + "@" ; + +void menu() { + const byte* SCREEN = $8000; + const byte* CHARSET = $9800; // Charset ROM + // DTV Graphics Bank + *DTV_GRAPHICS_VIC_BANK = (byte)((dword)CHARSET/$10000); + // DTV Color Bank + *DTV_COLOR_BANK_LO = <((word)(DTV_COLOR_BANK_DEFAULT/$400)); + *DTV_COLOR_BANK_HI = >((word)(DTV_COLOR_BANK_DEFAULT/$400)); + // DTV Graphics Mode + *DTV_CONTROL = 0; + // VIC Graphics Bank + *CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input + *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank + // VIC Graphics Mode + *VIC_CONTROL = VIC_DEN|VIC_RSEL|3; + *VIC_CONTROL2 = VIC_CSEL; + // VIC Memory Pointers + *VIC_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)CHARSET&$3fff)/$400)); + // DTV Palette - default + for(byte i : 0..$f) { + DTV_PALETTE[i] = DTV_PALETTE_DEFAULT[i]; + } + // Char Colors + for(byte* c=COLS;c!=COLS+1000;c++) *c=LIGHT_GREEN; + // Screen colors + *BGCOL = 0; + *BORDERCOL = 0; + // Display menu Text + print_set_screen(SCREEN); + print_cls(); + print_str_lines(MENU_TEXT); + // Wait for keypress + while(true) { + if(keyboard_key_pressed(KEY_SPACE)!=0) { + return; + } + } +} + +Importing c64dtv.kc +PARSING src/test/java/dk/camelot64/kickc/test/kc/c64dtv.kc +// C64 DTV version 2 Registers and Constants +// +// Sources +// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide +// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt + +import "c64.kc" + +// Feature enables or disables the extra C64 DTV features +const byte* DTV_FEATURE = $d03f; +const byte DTV_FEATURE_ENABLE = 1; +const byte DTV_FEATURE_DISABLE_TIL_RESET = 2; + +// Controls the graphics modes of the C64 DTV +const byte* DTV_CONTROL = $d03c; +const byte DTV_LINEAR = $01; +const byte DTV_BORDER_OFF = $02; +const byte DTV_HIGHCOLOR = $04; +const byte DTV_OVERSCAN = $08; +const byte DTV_COLORRAM_OFF = $10; +const byte DTV_BADLINE_OFF = $20; +const byte DTV_CHUNKY = $40; + +// Defines colors for the 16 first colors ($00-$0f) +const byte* DTV_PALETTE = $d200; + +// Default vallues for the palette +byte[16] DTV_PALETTE_DEFAULT = { $00, $0f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, $05, $07, $df, $9a, $0a }; + +// Linear Graphics Plane A Counter Control +const byte* DTV_PLANEA_START_LO = $d03a; +const byte* DTV_PLANEA_START_MI = $d03b; +const byte* DTV_PLANEA_START_HI = $d045; +const byte* DTV_PLANEA_STEP = $d046; +const byte* DTV_PLANEA_MODULO_LO = $d038; +const byte* DTV_PLANEA_MODULO_HI = $d039; + +// Linear Graphics Plane B Counter Control +const byte* DTV_PLANEB_START_LO = $d049; +const byte* DTV_PLANEB_START_MI = $d04a; +const byte* DTV_PLANEB_START_HI = $d04b; +const byte* DTV_PLANEB_STEP = $d04c; +const byte* DTV_PLANEB_MODULO_LO = $d047; +const byte* DTV_PLANEB_MODULO_HI = $d048; + +// Select memory bank where sprite data is fetched from (bits 5:0) - source only (J) +// Memory address of Sprite RAM is SpriteBank*$10000 +const byte* DTV_SPRITE_BANK = $d04d; + +// Select memory bank where color data is fetched from (bits 11:0) +// Memory address of Color RAM is ColorBank*$400 +const byte* DTV_COLOR_BANK_LO = $d036; +const byte* DTV_COLOR_BANK_HI = $d037; + +const dword DTV_COLOR_BANK_DEFAULT = $1d800; + +// Selects memory bank for normal VIC color mode and lower data for high color modes. (bits 5:0) +// Memory address of VIC Graphics is GraphicsBank*$10000 +const byte* DTV_GRAPHICS_VIC_BANK = $d03d; +// Selects memory bank for upper data for high color modes. (bits 5:0) - source only (H) +const byte* DTV_GRAPHICS_HICOL_BANK = $d03e; + +// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff) +// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff +// The actual memory addressed will be $4000*cpuSegmentIdx +void dtvSetCpuBankSegment1(byte cpuBankIdx) { + // Move CPU BANK 1 SEGMENT ($4000-$7fff) + byte* cpuBank = $ff; + *cpuBank = cpuBankIdx; + asm { + // SAC $dd - A register points to 13 BANK 1 segment + .byte $32, $dd + // LDA $ff - Set CPU BANK 1 SEGMENT ($4000-$7fff) to ($ff)*$4000 + lda $ff + // SAC $00 - A register points to 0 ACCUMULATOR + .byte $32, $00 + } +} + +Importing c64.kc +PARSING src/test/java/dk/camelot64/kickc/test/kc/c64.kc +// Commodore 64 Registers and Constants + +// Processor port data direction register +const byte* PROCPORT_DDR = $00; +// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written +const byte PROCPORT_DDR_MEMORY_MASK = %00000111; + +// Processor Port Register controlling RAM/ROM configuration and the datasette +const byte* PROCPORT = $01; +// RAM in all three areas $A000, $D000, $E000 +const byte PROCPORT_RAM_ALL = %00110000; +// RAM in $A000, $E000 I/O in $D000 +const byte PROCPORT_RAM_IO = %00110101; +// RAM in $A000, $E000 CHAR ROM in $D000 +const byte PROCPORT_RAM_CHARROM = %00110001; +// RAM in $A000, I/O in $D000, KERNEL in $E000 +const byte PROCPORT_KERNEL_IO = %00110110; +// BASIC in $A000, I/O in $D000, KERNEL in $E000 +const byte PROCPORT_BASIC_KERNEL_IO = %00110111; + +const byte* CHARGEN = $d000; + +const byte* SPRITES_XPOS = $d000; +const byte* SPRITES_YPOS = $d001; +const byte* SPRITES_XMSB = $d010; +const byte* RASTER = $d012; +const byte* SPRITES_ENABLE = $d015; +const byte* SPRITES_EXPAND_Y = $d017; +const byte* SPRITES_PRIORITY = $d01b; +const byte* SPRITES_MC = $d01c; +const byte* SPRITES_EXPAND_X = $d01d; +const byte* BORDERCOL = $d020; +const byte* BGCOL = $d021; +const byte* BGCOL1 = $d021; +const byte* BGCOL2 = $d022; +const byte* BGCOL3 = $d023; +const byte* BGCOL4 = $d024; +const byte* SPRITES_MC1 = $d025; +const byte* SPRITES_MC2 = $d026; +const byte* SPRITES_COLS = $d027; + +const byte* VIC_CONTROL = $d011; +const byte* D011 = $d011; +const byte VIC_RST8 = %10000000; +const byte VIC_ECM = %01000000; +const byte VIC_BMM = %00100000; +const byte VIC_DEN = %00010000; +const byte VIC_RSEL = %00001000; + +const byte* VIC_CONTROL2 = $d016; +const byte* D016 = $d016; +const byte VIC_MCM = %00010000; +const byte VIC_CSEL = %00001000; + +const byte* D018 = $d018; +const byte* VIC_MEMORY = $d018; + +const byte* COLS = $d800; + +// CIA#1 Port A: keyboard matrix columns and joystick #2 +const byte* CIA1_PORT_A = $dc00; +// CIA#1 Port B: keyboard matrix rows and joystick #1. +const byte* CIA1_PORT_B = $dc01; +// CIA #1 Port A data direction register. +const byte* CIA1_PORT_A_DDR = $dc02; +// CIA #1 Port B data direction register. +const byte* CIA1_PORT_B_DDR = $dc03; + +// CIA#2 Port A: Serial bus, RS-232, VIC memory bank +const byte* CIA2_PORT_A = $dd00; +// CIA#2 Port B: RS-232 +const byte* CIA2_PORT_B = $dd01; +// CIA #2 Port A data direction register. +const byte* CIA2_PORT_A_DDR = $dd02; +// CIA #2 Port B data direction register. +const byte* CIA2_PORT_B_DDR = $dd03; + +const byte BLACK = $0; +const byte WHITE = $1; +const byte RED = $2; +const byte CYAN = $3; +const byte PURPLE = $4; +const byte GREEN = $5; +const byte BLUE = $6; +const byte YELLOW = $7; +const byte ORANGE = $8; +const byte BROWN = $9; +const byte PINK = $a; +const byte DARK_GREY= $b; +const byte GREY = $c; +const byte LIGHT_GREEN = $d; +const byte LIGHT_BLUE = $e; +const byte LIGHT_GREY = $f; + +Importing print.kc +PARSING src/test/java/dk/camelot64/kickc/test/kc/print.kc + +byte* print_screen = $0400; +byte* print_line_cursor = print_screen; +byte* print_char_cursor = print_line_cursor; + +// Print a number of zero-terminated strings, each followed by a newline. +// The sequence of lines is terminated by another zero. +void print_str_lines(byte* str) { + while(*str!='@') { + do { + byte ch = *(str++); + if(ch!='@') { + *(print_char_cursor++) = ch; + } + } while (ch!='@'); + print_ln(); + } +} + +// Print a zero-terminated string followed by a newline +void print_str_ln(byte* str) { + print_str(str); + print_ln(); +} + +// Print a zero-terminated string +void print_str(byte* str) { + while(*str!='@') { + *(print_char_cursor++) = *(str++); + } +} + +// Print a string at a specific screen position +void print_str_at(byte* str, byte* at) { + while(*str!='@') { + *(at++) = *(str++); + } +} + +// Print a newline +void print_ln() { + do { + print_line_cursor = print_line_cursor + $28; + } while (print_line_cursorw); + print_byte(dw); + print_word(>4]); + print_char(hextab[b&$f]); +} + +// Print a single char +void print_char(byte ch) { + *(print_char_cursor++) = ch; +} + +// Clear the screen. Also resets current line/char cursor. +void print_cls() { + for(byte* sc=print_screen; sc!=print_screen+1000; sc++) { + *sc = ' '; + } + print_line_cursor = print_screen; + print_char_cursor = print_line_cursor; +} + +// Set the screen to print on. Also resets current line/char cursor. +void print_set_screen(byte* screen) { + print_screen = screen; + print_line_cursor = print_screen; + print_char_cursor = print_line_cursor; +} + +Adding pre/post-modifier (byte*) print_str_lines::str ← ++ (byte*) print_str_lines::str +Adding pre/post-modifier (byte*) print_char_cursor ← ++ (byte*) print_char_cursor +Adding pre/post-modifier (byte*) print_char_cursor ← ++ (byte*) print_char_cursor +Adding pre/post-modifier (byte*) print_str::str ← ++ (byte*) print_str::str +Adding pre/post-modifier (byte*) print_str_at::at ← ++ (byte*) print_str_at::at +Adding pre/post-modifier (byte*) print_str_at::str ← ++ (byte*) print_str_at::str +Adding pre/post-modifier (byte*) print_char_cursor ← ++ (byte*) print_char_cursor +Adding pre/post-modifier (byte*) print_cls::sc ← ++ (byte*) print_cls::sc +Importing keyboard.kc +PARSING src/test/java/dk/camelot64/kickc/test/kc/keyboard.kc +// Simple Keyboard Input Library +// C64 Keyboard Matrix Reference - from http://codebase64.org/doku.php?id=base:reading_the_keyboard +// Keyboard Codes are %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7) +// +----+----------------------+-------------------------------------------------------------------------------------------------------+ +// | | Write | Read $dc01 (C64 screen code in parenthesis): | +// |row:| $dc00: row bits +------------+------------+------------+------------+------------+------------+------------+------------+ +// | | | BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 | +// +----+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+ +// |0. | #%11111110 (254/$fe) | DOWN ($ )| F5 ($ )| F3 ($ )| F1 ($ )| F7 ($ )| RIGHT ($ )| RETURN($ )|DELETE ($ )| +// |1. | #%11111101 (253/$fd) |LEFT-SH($ )| e ($05)| s ($13)| z ($1a)| 4 ($34)| a ($01)| w ($17)| 3 ($33)| +// |2. | #%11111011 (251/$fb) | x ($18)| t ($14)| f ($06)| c ($03)| 6 ($36)| d ($04)| r ($12)| 5 ($35)| +// |3. | #%11110111 (247/$f7) | v ($16)| u ($15)| h ($08)| b ($02)| 8 ($38)| g ($07)| y ($19)| 7 ($37)| +// |4. | #%11101111 (239/$ef) | n ($0e)| o ($0f)| k ($0b)| m ($0d)| 0 ($30)| j ($0a)| i ($09)| 9 ($39)| +// |5. | #%11011111 (223/$df) | , ($2c)| @ ($00)| : ($3a)| . ($2e)| - ($2d)| l ($0c)| p ($10)| + ($2b)| +// |6. | #%10111111 (191/$bf) | / ($2f)| ^ ($1e)| = ($3d)|RGHT-SH($ )| HOME ($ )| ; ($3b)| * ($2a)| £ ($1c)| +// |7. | #%01111111 (127/$7f) | STOP ($ )| q ($11)|COMMODR($ )| SPACE ($20)| 2 ($32)|CONTROL($ )| <- ($1f)| 1 ($31)| +// +----+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+ + +import "c64.kc" + +// Keyboard Codes for all 63 keys. +// Keyboard Codes are %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7). +// See C64 Keyboard Matrix Reference http://codebase64.org/doku.php?id=base:reading_the_keyboard +const byte KEY_DEL = $00; +const byte KEY_RETURN = $01; +const byte KEY_CRSR_RIGHT = $02; +const byte KEY_F7 = $03; +const byte KEY_F1 = $04; +const byte KEY_F3 = $05; +const byte KEY_F5 = $06; +const byte KEY_CRSR_DOWN = $07; +const byte KEY_3 = $08; +const byte KEY_W = $09; +const byte KEY_A = $0a; +const byte KEY_4 = $0b; +const byte KEY_Z = $0c; +const byte KEY_S = $0d; +const byte KEY_E = $0e; +const byte KEY_LSHIFT = $0f; +const byte KEY_5 = $10; +const byte KEY_R = $11; +const byte KEY_D = $12; +const byte KEY_6 = $13; +const byte KEY_C = $14; +const byte KEY_F = $15; +const byte KEY_T = $16; +const byte KEY_X = $17; +const byte KEY_7 = $18; +const byte KEY_Y = $19; +const byte KEY_G = $1a; +const byte KEY_8 = $1b; +const byte KEY_B = $1c; +const byte KEY_H = $1d; +const byte KEY_U = $1e; +const byte KEY_V = $1f; +const byte KEY_9 = $20; +const byte KEY_I = $21; +const byte KEY_J = $22; +const byte KEY_0 = $23; +const byte KEY_M = $24; +const byte KEY_K = $25; +const byte KEY_O = $26; +const byte KEY_N = $27; +const byte KEY_PLUS = $28; +const byte KEY_P = $29; +const byte KEY_L = $2a; +const byte KEY_MINUS = $2b; +const byte KEY_DOT = $2c; +const byte KEY_COLON = $2d; +const byte KEY_AT = $2e; +const byte KEY_COMMA = $2f; +const byte KEY_POUND = $30; +const byte KEY_ASTERISK = $31; +const byte KEY_SEMICOLON = $32; +const byte KEY_HOME = $33; +const byte KEY_RSHIFT = $34; +const byte KEY_EQUALS = $35; +const byte KEY_ARROW_UP = $36; +const byte KEY_SLASH = $37; +const byte KEY_1 = $38; +const byte KEY_ARROW_LEFT = $39; +const byte KEY_CTRL = $3a; +const byte KEY_2 = $3b; +const byte KEY_SPACE = $3c; +const byte KEY_COMMODORE = $3d; +const byte KEY_Q = $3e; +const byte KEY_RUNSTOP = $3f; + +// Keycodes for each screen code character from $00-$3f. +// Chars that do not have an unmodified keycode return $3f (representing RUN/STOP). +const byte[] keyboard_char_keycodes = { + /*@*/KEY_AT, /*a*/KEY_A, /*b*/KEY_B, /*c*/KEY_C, /*d*/KEY_D, /*e*/KEY_E, /*f*/KEY_F, /*g*/KEY_G, + /*h*/KEY_H, /*i*/KEY_I, /*j*/KEY_J, /*k*/KEY_K, /*l*/KEY_L, /*m*/KEY_M, /*n*/KEY_N, /*o*/KEY_O, + /*p*/KEY_P, /*q*/KEY_Q, /*r*/KEY_R, /*s*/KEY_S, /*t*/KEY_T, /*u*/KEY_U, /*v*/KEY_V, /*w*/KEY_W, + /*x*/KEY_X, /*y*/KEY_Y, /*z*/KEY_Z, /*[*/$3f, /*£*/KEY_POUND, /*]*/$3f, /*^*/KEY_ARROW_UP, /*<-*/KEY_ARROW_LEFT, + /* */KEY_SPACE, /*!*/$3f, /*"*/$3f, /*#*/$3f, /*$*/$3f, /*%*/$3f, /*&*/$3f, /*´*/$3f, + /*(*/$3f, /*)*/$3f, /***/KEY_ASTERISK, /*+*/KEY_PLUS, /*,*/KEY_COMMA, /*-*/KEY_MINUS, /*.*/KEY_DOT, /*/*/KEY_SLASH, + /*0*/KEY_0, /*1*/KEY_1, /*2*/KEY_2, /*3*/KEY_3, /*4*/KEY_4, /*5*/KEY_5, /*6*/KEY_6, /*7*/KEY_7, + /*8*/KEY_8, /*9*/KEY_9, /*:*/KEY_COLON, /*;*/KEY_SEMICOLON, /*<*/$3f, /*=*/KEY_EQUALS, /*>*/$3f, /*?*/$3f +}; + +// Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) +byte[8] keyboard_matrix_row_bitmask = { %11111110, %11111101, %11111011, %11110111, %11101111, %11011111, %10111111, %01111111 }; + +// Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) +byte[] keyboard_matrix_col_bitmask = { %00000001, %00000010, %00000100, %00001000, %00010000, %00100000, %01000000, %10000000 }; + +// Initialize keyboard reading by setting CIA#$ Data Direction Registers +void keyboard_init() { + // Keyboard Matrix Columns Write Mode + *CIA1_PORT_A_DDR = $ff; + // Keyboard Matrix Columns Read Mode + *CIA1_PORT_B_DDR = $00; +} +// Read a single row of the keyboard matrix +// The row ID (0-7) of the keyboard matrix row to read. See the C64 key matrix for row IDs. +// Returns the keys pressed on the row as bits according to the C64 key matrix. +// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write +// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader. +byte keyboard_matrix_read(byte rowid) { + *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]; + byte row_pressed_bits = ~*CIA1_PORT_B; + return row_pressed_bits; +} + +// Determines whether a specific key is currently pressed +// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7) +// All keys exist as as KEY_XXX constants. +// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed +byte keyboard_key_pressed(byte key) { + byte colidx = key&7; + byte rowidx = key>>3; + return keyboard_matrix_read(rowidx) & keyboard_matrix_col_bitmask[colidx]; +} + +// Get the keycode corresponding to a specific screen code character +// ch is the character to get the key code for ($00-$3f) +// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled. +// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) . +byte keyboard_get_keycode(byte ch) { + return keyboard_char_keycodes[ch]; +} +Importing c64.kc +Adding pre/post-modifier (byte*) menu::c ← ++ (byte*) menu::c + +STATEMENTS + (byte*) PROCPORT_DDR ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte*) PROCPORT ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) PROCPORT_RAM_ALL ← (byte/signed byte/word/signed word/dword/signed dword) 48 + (byte) PROCPORT_RAM_IO ← (byte/signed byte/word/signed word/dword/signed dword) 53 + (byte) PROCPORT_RAM_CHARROM ← (byte/signed byte/word/signed word/dword/signed dword) 49 + (byte) PROCPORT_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 54 + (byte) PROCPORT_BASIC_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 55 + (byte*) CHARGEN ← (word/dword/signed dword) 53248 + (byte*) SPRITES_XPOS ← (word/dword/signed dword) 53248 + (byte*) SPRITES_YPOS ← (word/dword/signed dword) 53249 + (byte*) SPRITES_XMSB ← (word/dword/signed dword) 53264 + (byte*) RASTER ← (word/dword/signed dword) 53266 + (byte*) SPRITES_ENABLE ← (word/dword/signed dword) 53269 + (byte*) SPRITES_EXPAND_Y ← (word/dword/signed dword) 53271 + (byte*) SPRITES_PRIORITY ← (word/dword/signed dword) 53275 + (byte*) SPRITES_MC ← (word/dword/signed dword) 53276 + (byte*) SPRITES_EXPAND_X ← (word/dword/signed dword) 53277 + (byte*) BORDERCOL ← (word/dword/signed dword) 53280 + (byte*) BGCOL ← (word/dword/signed dword) 53281 + (byte*) BGCOL1 ← (word/dword/signed dword) 53281 + (byte*) BGCOL2 ← (word/dword/signed dword) 53282 + (byte*) BGCOL3 ← (word/dword/signed dword) 53283 + (byte*) BGCOL4 ← (word/dword/signed dword) 53284 + (byte*) SPRITES_MC1 ← (word/dword/signed dword) 53285 + (byte*) SPRITES_MC2 ← (word/dword/signed dword) 53286 + (byte*) SPRITES_COLS ← (word/dword/signed dword) 53287 + (byte*) VIC_CONTROL ← (word/dword/signed dword) 53265 + (byte*) D011 ← (word/dword/signed dword) 53265 + (byte) VIC_RST8 ← (byte/word/signed word/dword/signed dword) 128 + (byte) VIC_ECM ← (byte/signed byte/word/signed word/dword/signed dword) 64 + (byte) VIC_BMM ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) VIC_DEN ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) VIC_RSEL ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) VIC_CONTROL2 ← (word/dword/signed dword) 53270 + (byte*) D016 ← (word/dword/signed dword) 53270 + (byte) VIC_MCM ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) VIC_CSEL ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) D018 ← (word/dword/signed dword) 53272 + (byte*) VIC_MEMORY ← (word/dword/signed dword) 53272 + (byte*) COLS ← (word/dword/signed dword) 55296 + (byte*) CIA1_PORT_A ← (word/dword/signed dword) 56320 + (byte*) CIA1_PORT_B ← (word/dword/signed dword) 56321 + (byte*) CIA1_PORT_A_DDR ← (word/dword/signed dword) 56322 + (byte*) CIA1_PORT_B_DDR ← (word/dword/signed dword) 56323 + (byte*) CIA2_PORT_A ← (word/dword/signed dword) 56576 + (byte*) CIA2_PORT_B ← (word/dword/signed dword) 56577 + (byte*) CIA2_PORT_A_DDR ← (word/dword/signed dword) 56578 + (byte*) CIA2_PORT_B_DDR ← (word/dword/signed dword) 56579 + (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6 + (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10 + (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11 + (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12 + (byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13 + (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14 + (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15 + (byte*) DTV_FEATURE ← (word/dword/signed dword) 53311 + (byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte*) DTV_CONTROL ← (word/dword/signed dword) 53308 + (byte) DTV_LINEAR ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) DTV_BORDER_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) DTV_HIGHCOLOR ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) DTV_OVERSCAN ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) DTV_COLORRAM_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) DTV_BADLINE_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) DTV_CHUNKY ← (byte/signed byte/word/signed word/dword/signed dword) 64 + (byte*) DTV_PALETTE ← (word/dword/signed dword) 53760 + (byte[16]) DTV_PALETTE_DEFAULT ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 54, (byte/word/signed word/dword/signed dword) 190, (byte/signed byte/word/signed word/dword/signed dword) 88, (byte/word/signed word/dword/signed dword) 219, (byte/word/signed word/dword/signed dword) 134, (byte/word/signed word/dword/signed dword) 255, (byte/signed byte/word/signed word/dword/signed dword) 41, (byte/signed byte/word/signed word/dword/signed dword) 38, (byte/signed byte/word/signed word/dword/signed dword) 59, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 154, (byte/signed byte/word/signed word/dword/signed dword) 10 } + (byte*) DTV_PLANEA_START_LO ← (word/dword/signed dword) 53306 + (byte*) DTV_PLANEA_START_MI ← (word/dword/signed dword) 53307 + (byte*) DTV_PLANEA_START_HI ← (word/dword/signed dword) 53317 + (byte*) DTV_PLANEA_STEP ← (word/dword/signed dword) 53318 + (byte*) DTV_PLANEA_MODULO_LO ← (word/dword/signed dword) 53304 + (byte*) DTV_PLANEA_MODULO_HI ← (word/dword/signed dword) 53305 + (byte*) DTV_PLANEB_START_LO ← (word/dword/signed dword) 53321 + (byte*) DTV_PLANEB_START_MI ← (word/dword/signed dword) 53322 + (byte*) DTV_PLANEB_START_HI ← (word/dword/signed dword) 53323 + (byte*) DTV_PLANEB_STEP ← (word/dword/signed dword) 53324 + (byte*) DTV_PLANEB_MODULO_LO ← (word/dword/signed dword) 53319 + (byte*) DTV_PLANEB_MODULO_HI ← (word/dword/signed dword) 53320 + (byte*) DTV_SPRITE_BANK ← (word/dword/signed dword) 53325 + (byte*) DTV_COLOR_BANK_LO ← (word/dword/signed dword) 53302 + (byte*) DTV_COLOR_BANK_HI ← (word/dword/signed dword) 53303 + (dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832 + (byte*) DTV_GRAPHICS_VIC_BANK ← (word/dword/signed dword) 53309 + (byte*) DTV_GRAPHICS_HICOL_BANK ← (word/dword/signed dword) 53310 +proc (void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) + (byte*) dtvSetCpuBankSegment1::cpuBank ← (byte/word/signed word/dword/signed dword) 255 + *((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx + asm { .byte$32,$dd lda$ff .byte$32,$00 } +dtvSetCpuBankSegment1::@return: + return +endproc // dtvSetCpuBankSegment1() + (byte*) print_screen ← (word/signed word/dword/signed dword) 1024 + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor +proc (void()) print_str_lines((byte*) print_str_lines::str) +print_str_lines::@1: + (boolean~) print_str_lines::$0 ← *((byte*) print_str_lines::str) != (byte) '@' + if((boolean~) print_str_lines::$0) goto print_str_lines::@2 + goto print_str_lines::@3 +print_str_lines::@2: +print_str_lines::@4: + (byte) print_str_lines::ch ← *((byte*) print_str_lines::str) + (byte*) print_str_lines::str ← ++ (byte*) print_str_lines::str + (boolean~) print_str_lines::$1 ← (byte) print_str_lines::ch != (byte) '@' + (boolean~) print_str_lines::$2 ← ! (boolean~) print_str_lines::$1 + if((boolean~) print_str_lines::$2) goto print_str_lines::@5 + *((byte*) print_char_cursor) ← (byte) print_str_lines::ch + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor +print_str_lines::@5: + (boolean~) print_str_lines::$3 ← (byte) print_str_lines::ch != (byte) '@' + if((boolean~) print_str_lines::$3) goto print_str_lines::@4 + (void~) print_str_lines::$4 ← call print_ln + goto print_str_lines::@1 +print_str_lines::@3: +print_str_lines::@return: + return +endproc // print_str_lines() +proc (void()) print_str_ln((byte*) print_str_ln::str) + (void~) print_str_ln::$0 ← call print_str (byte*) print_str_ln::str + (void~) print_str_ln::$1 ← call print_ln +print_str_ln::@return: + return +endproc // print_str_ln() +proc (void()) print_str((byte*) print_str::str) +print_str::@1: + (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + goto print_str::@3 +print_str::@2: + *((byte*) print_char_cursor) ← *((byte*) print_str::str) + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor + (byte*) print_str::str ← ++ (byte*) print_str::str + goto print_str::@1 +print_str::@3: +print_str::@return: + return +endproc // print_str() +proc (void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at) +print_str_at::@1: + (boolean~) print_str_at::$0 ← *((byte*) print_str_at::str) != (byte) '@' + if((boolean~) print_str_at::$0) goto print_str_at::@2 + goto print_str_at::@3 +print_str_at::@2: + *((byte*) print_str_at::at) ← *((byte*) print_str_at::str) + (byte*) print_str_at::at ← ++ (byte*) print_str_at::at + (byte*) print_str_at::str ← ++ (byte*) print_str_at::str + goto print_str_at::@1 +print_str_at::@3: +print_str_at::@return: + return +endproc // print_str_at() +proc (void()) print_ln() +print_ln::@1: + (byte*~) print_ln::$0 ← (byte*) print_line_cursor + (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*) print_line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) print_line_cursor < (byte*) print_char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + (byte*) print_char_cursor ← (byte*) print_line_cursor +print_ln::@return: + return +endproc // print_ln() +proc (void()) print_sword((signed word) print_sword::w) + (boolean~) print_sword::$0 ← (signed word) print_sword::w < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sword::$1 ← ! (boolean~) print_sword::$0 + if((boolean~) print_sword::$1) goto print_sword::@1 + (void~) print_sword::$2 ← call print_char (byte) '-' + (signed word~) print_sword::$3 ← - (signed word) print_sword::w + (signed word) print_sword::w ← (signed word~) print_sword::$3 +print_sword::@1: + (word~) print_sword::$4 ← ((word)) (signed word) print_sword::w + (void~) print_sword::$5 ← call print_word (word~) print_sword::$4 +print_sword::@return: + return +endproc // print_sword() +proc (void()) print_sbyte((signed byte) print_sbyte::b) + (boolean~) print_sbyte::$0 ← (signed byte) print_sbyte::b < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sbyte::$1 ← ! (boolean~) print_sbyte::$0 + if((boolean~) print_sbyte::$1) goto print_sbyte::@1 + (void~) print_sbyte::$2 ← call print_char (byte) '-' + (signed byte~) print_sbyte::$3 ← - (signed byte) print_sbyte::b + (signed byte) print_sbyte::b ← (signed byte~) print_sbyte::$3 +print_sbyte::@1: + (byte~) print_sbyte::$4 ← ((byte)) (signed byte) print_sbyte::b + (void~) print_sbyte::$5 ← call print_byte (byte~) print_sbyte::$4 +print_sbyte::@return: + return +endproc // print_sbyte() +proc (void()) print_word((word) print_word::w) + (byte~) print_word::$0 ← > (word) print_word::w + (void~) print_word::$1 ← call print_byte (byte~) print_word::$0 + (byte~) print_word::$2 ← < (word) print_word::w + (void~) print_word::$3 ← call print_byte (byte~) print_word::$2 +print_word::@return: + return +endproc // print_word() +proc (void()) print_dword((dword) print_dword::dw) + (word~) print_dword::$0 ← > (dword) print_dword::dw + (void~) print_dword::$1 ← call print_word (word~) print_dword::$0 + (word~) print_dword::$2 ← < (dword) print_dword::dw + (void~) print_dword::$3 ← call print_word (word~) print_dword::$2 +print_dword::@return: + return +endproc // print_dword() +proc (void()) print_sdword((signed dword) print_sdword::dw) + (boolean~) print_sdword::$0 ← (signed dword) print_sdword::dw < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sdword::$1 ← ! (boolean~) print_sdword::$0 + if((boolean~) print_sdword::$1) goto print_sdword::@1 + (void~) print_sdword::$2 ← call print_char (byte) '-' + (signed dword~) print_sdword::$3 ← - (signed dword) print_sdword::dw + (signed dword) print_sdword::dw ← (signed dword~) print_sdword::$3 +print_sdword::@1: + (dword~) print_sdword::$4 ← ((dword)) (signed dword) print_sdword::dw + (void~) print_sdword::$5 ← call print_dword (dword~) print_sdword::$4 +print_sdword::@return: + return +endproc // print_sdword() +proc (void()) print_byte((byte) print_byte::b) + (byte[]) print_byte::hextab ← (string) "0123456789abcdef" + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word/dword/signed dword) 4 + (void~) print_byte::$1 ← call print_char *((byte[]) print_byte::hextab + (byte~) print_byte::$0) + (byte~) print_byte::$2 ← (byte) print_byte::b & (byte/signed byte/word/signed word/dword/signed dword) 15 + (void~) print_byte::$3 ← call print_char *((byte[]) print_byte::hextab + (byte~) print_byte::$2) +print_byte::@return: + return +endproc // print_byte() +proc (void()) print_char((byte) print_char::ch) + *((byte*) print_char_cursor) ← (byte) print_char::ch + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor +print_char::@return: + return +endproc // print_char() +proc (void()) print_cls() + (byte*) print_cls::sc ← (byte*) print_screen +print_cls::@1: + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (byte*~) print_cls::$0 ← (byte*) print_screen + (word/signed word/dword/signed dword) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (byte*~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor +print_cls::@return: + return +endproc // print_cls() +proc (void()) print_set_screen((byte*) print_set_screen::screen) + (byte*) print_screen ← (byte*) print_set_screen::screen + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor +print_set_screen::@return: + return +endproc // print_set_screen() + (byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) KEY_F7 ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) KEY_F1 ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) KEY_F3 ← (byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) KEY_F5 ← (byte/signed byte/word/signed word/dword/signed dword) 6 + (byte) KEY_CRSR_DOWN ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) KEY_3 ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) KEY_W ← (byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) KEY_A ← (byte/signed byte/word/signed word/dword/signed dword) 10 + (byte) KEY_4 ← (byte/signed byte/word/signed word/dword/signed dword) 11 + (byte) KEY_Z ← (byte/signed byte/word/signed word/dword/signed dword) 12 + (byte) KEY_S ← (byte/signed byte/word/signed word/dword/signed dword) 13 + (byte) KEY_E ← (byte/signed byte/word/signed word/dword/signed dword) 14 + (byte) KEY_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 15 + (byte) KEY_5 ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) KEY_R ← (byte/signed byte/word/signed word/dword/signed dword) 17 + (byte) KEY_D ← (byte/signed byte/word/signed word/dword/signed dword) 18 + (byte) KEY_6 ← (byte/signed byte/word/signed word/dword/signed dword) 19 + (byte) KEY_C ← (byte/signed byte/word/signed word/dword/signed dword) 20 + (byte) KEY_F ← (byte/signed byte/word/signed word/dword/signed dword) 21 + (byte) KEY_T ← (byte/signed byte/word/signed word/dword/signed dword) 22 + (byte) KEY_X ← (byte/signed byte/word/signed word/dword/signed dword) 23 + (byte) KEY_7 ← (byte/signed byte/word/signed word/dword/signed dword) 24 + (byte) KEY_Y ← (byte/signed byte/word/signed word/dword/signed dword) 25 + (byte) KEY_G ← (byte/signed byte/word/signed word/dword/signed dword) 26 + (byte) KEY_8 ← (byte/signed byte/word/signed word/dword/signed dword) 27 + (byte) KEY_B ← (byte/signed byte/word/signed word/dword/signed dword) 28 + (byte) KEY_H ← (byte/signed byte/word/signed word/dword/signed dword) 29 + (byte) KEY_U ← (byte/signed byte/word/signed word/dword/signed dword) 30 + (byte) KEY_V ← (byte/signed byte/word/signed word/dword/signed dword) 31 + (byte) KEY_9 ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) KEY_I ← (byte/signed byte/word/signed word/dword/signed dword) 33 + (byte) KEY_J ← (byte/signed byte/word/signed word/dword/signed dword) 34 + (byte) KEY_0 ← (byte/signed byte/word/signed word/dword/signed dword) 35 + (byte) KEY_M ← (byte/signed byte/word/signed word/dword/signed dword) 36 + (byte) KEY_K ← (byte/signed byte/word/signed word/dword/signed dword) 37 + (byte) KEY_O ← (byte/signed byte/word/signed word/dword/signed dword) 38 + (byte) KEY_N ← (byte/signed byte/word/signed word/dword/signed dword) 39 + (byte) KEY_PLUS ← (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) KEY_P ← (byte/signed byte/word/signed word/dword/signed dword) 41 + (byte) KEY_L ← (byte/signed byte/word/signed word/dword/signed dword) 42 + (byte) KEY_MINUS ← (byte/signed byte/word/signed word/dword/signed dword) 43 + (byte) KEY_DOT ← (byte/signed byte/word/signed word/dword/signed dword) 44 + (byte) KEY_COLON ← (byte/signed byte/word/signed word/dword/signed dword) 45 + (byte) KEY_AT ← (byte/signed byte/word/signed word/dword/signed dword) 46 + (byte) KEY_COMMA ← (byte/signed byte/word/signed word/dword/signed dword) 47 + (byte) KEY_POUND ← (byte/signed byte/word/signed word/dword/signed dword) 48 + (byte) KEY_ASTERISK ← (byte/signed byte/word/signed word/dword/signed dword) 49 + (byte) KEY_SEMICOLON ← (byte/signed byte/word/signed word/dword/signed dword) 50 + (byte) KEY_HOME ← (byte/signed byte/word/signed word/dword/signed dword) 51 + (byte) KEY_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 52 + (byte) KEY_EQUALS ← (byte/signed byte/word/signed word/dword/signed dword) 53 + (byte) KEY_ARROW_UP ← (byte/signed byte/word/signed word/dword/signed dword) 54 + (byte) KEY_SLASH ← (byte/signed byte/word/signed word/dword/signed dword) 55 + (byte) KEY_1 ← (byte/signed byte/word/signed word/dword/signed dword) 56 + (byte) KEY_ARROW_LEFT ← (byte/signed byte/word/signed word/dword/signed dword) 57 + (byte) KEY_CTRL ← (byte/signed byte/word/signed word/dword/signed dword) 58 + (byte) KEY_2 ← (byte/signed byte/word/signed word/dword/signed dword) 59 + (byte) KEY_SPACE ← (byte/signed byte/word/signed word/dword/signed dword) 60 + (byte) KEY_COMMODORE ← (byte/signed byte/word/signed word/dword/signed dword) 61 + (byte) KEY_Q ← (byte/signed byte/word/signed word/dword/signed dword) 62 + (byte) KEY_RUNSTOP ← (byte/signed byte/word/signed word/dword/signed dword) 63 + (byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 } + (byte[8]) 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_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 } +proc (void()) keyboard_init() + *((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255 + *((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0 +keyboard_init::@return: + return +endproc // keyboard_init() +proc (byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid) + *((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid) + (byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B) + (byte) keyboard_matrix_read::row_pressed_bits ← (byte~) keyboard_matrix_read::$0 + (byte) keyboard_matrix_read::return ← (byte) keyboard_matrix_read::row_pressed_bits + goto keyboard_matrix_read::@return +keyboard_matrix_read::@return: + (byte) keyboard_matrix_read::return ← (byte) keyboard_matrix_read::return + return (byte) keyboard_matrix_read::return +endproc // keyboard_matrix_read() +proc (byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) + (byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0 + (byte~) keyboard_key_pressed::$1 ← (byte) keyboard_key_pressed::key >> (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) keyboard_key_pressed::rowidx ← (byte~) keyboard_key_pressed::$1 + (byte~) keyboard_key_pressed::$2 ← call keyboard_matrix_read (byte) keyboard_key_pressed::rowidx + (byte~) keyboard_key_pressed::$3 ← (byte~) keyboard_key_pressed::$2 & *((byte[]) keyboard_matrix_col_bitmask + (byte) keyboard_key_pressed::colidx) + (byte) keyboard_key_pressed::return ← (byte~) keyboard_key_pressed::$3 + goto keyboard_key_pressed::@return +keyboard_key_pressed::@return: + (byte) keyboard_key_pressed::return ← (byte) keyboard_key_pressed::return + return (byte) keyboard_key_pressed::return +endproc // keyboard_key_pressed() +proc (byte()) keyboard_get_keycode((byte) keyboard_get_keycode::ch) + (byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch) + goto keyboard_get_keycode::@return +keyboard_get_keycode::@return: + (byte) keyboard_get_keycode::return ← (byte) keyboard_get_keycode::return + return (byte) keyboard_get_keycode::return +endproc // keyboard_get_keycode() +proc (void()) main() + asm { sei } + *((byte*) DTV_FEATURE) ← (byte) DTV_FEATURE_ENABLE +main::@1: + if(true) goto main::@2 + goto main::@3 +main::@2: + (void~) main::$0 ← call menu + goto main::@1 +main::@3: +main::@return: + return +endproc // main() + (string~) $0 ← (string) " DTV GfxExplorer PRESET 8bpp pixel cell @" + (string) " CONTROL PLANE A PLANE B VIC II @" + (string~) $1 ← (string~) $0 + (string) " bmm 0 patt p1 patt p2 screen s3 @" + (string~) $2 ← (string~) $1 + (string) " mcm 0 start 00 start 00 gfx g4 @" + (string~) $3 ← (string~) $2 + (string) " ecm 0 step 00 step 00 colors c5 @" + (string~) $4 ← (string~) $3 + (string) " hicol 0 mod 00 mod 00 bgcol0 00 @" + (string~) $5 ← (string~) $4 + (string) " line 0 bgcol1 00 @" + (string~) $6 ← (string~) $5 + (string) " colof 0 borof 0 bgcol2 00 @" + (string~) $7 ← (string~) $6 + (string) " chunk 0 overs 0 bgcol3 00 @" + (string~) $8 ← (string~) $7 + (string) "@" + (byte[]) MENU_TEXT ← (string~) $8 +proc (void()) menu() + (byte*) menu::SCREEN ← (word/dword/signed dword) 32768 + (byte*) menu::CHARSET ← (word/dword/signed dword) 38912 + (dword~) menu::$0 ← ((dword)) (byte*) menu::CHARSET + (dword~) menu::$1 ← (dword~) menu::$0 / (dword/signed dword) 65536 + (byte~) menu::$2 ← ((byte)) (dword~) menu::$1 + *((byte*) DTV_GRAPHICS_VIC_BANK) ← (byte~) menu::$2 + (dword~) menu::$3 ← (dword) DTV_COLOR_BANK_DEFAULT / (word/signed word/dword/signed dword) 1024 + (word~) menu::$4 ← ((word)) (dword~) menu::$3 + (byte~) menu::$5 ← < (word~) menu::$4 + *((byte*) DTV_COLOR_BANK_LO) ← (byte~) menu::$5 + (dword~) menu::$6 ← (dword) DTV_COLOR_BANK_DEFAULT / (word/signed word/dword/signed dword) 1024 + (word~) menu::$7 ← ((word)) (dword~) menu::$6 + (byte~) menu::$8 ← > (word~) menu::$7 + *((byte*) DTV_COLOR_BANK_HI) ← (byte~) menu::$8 + *((byte*) DTV_CONTROL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (word~) menu::$9 ← ((word)) (byte*) menu::CHARSET + (word/signed dword/dword~) menu::$10 ← (word~) menu::$9 / (word/signed word/dword/signed dword) 16384 + (byte~) menu::$11 ← ((byte)) (word/signed dword/dword~) menu::$10 + (byte/word/dword~) menu::$12 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) menu::$11 + *((byte*) CIA2_PORT_A) ← (byte/word/dword~) menu::$12 + (byte~) menu::$13 ← (byte) VIC_DEN | (byte) VIC_RSEL + (byte/word/dword~) menu::$14 ← (byte~) menu::$13 | (byte/signed byte/word/signed word/dword/signed dword) 3 + *((byte*) VIC_CONTROL) ← (byte/word/dword~) menu::$14 + *((byte*) VIC_CONTROL2) ← (byte) VIC_CSEL + (word~) menu::$15 ← ((word)) (byte*) menu::SCREEN + (word~) menu::$16 ← (word~) menu::$15 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$17 ← (word~) menu::$16 / (byte/signed byte/word/signed word/dword/signed dword) 64 + (word~) menu::$18 ← ((word)) (byte*) menu::CHARSET + (word~) menu::$19 ← (word~) menu::$18 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$20 ← (word~) menu::$19 / (word/signed word/dword/signed dword) 1024 + (word/dword~) menu::$21 ← (word/signed dword/dword~) menu::$17 | (word/signed dword/dword~) menu::$20 + (byte~) menu::$22 ← ((byte)) (word/dword~) menu::$21 + *((byte*) VIC_MEMORY) ← (byte~) menu::$22 + (byte) menu::i ← (byte/signed byte/word/signed word/dword/signed dword) 0 +menu::@1: + *((byte*) DTV_PALETTE + (byte) menu::i) ← *((byte[16]) DTV_PALETTE_DEFAULT + (byte) menu::i) + (byte) menu::i ← ++ (byte) menu::i + (boolean~) menu::$23 ← (byte) menu::i != (byte/signed byte/word/signed word/dword/signed dword) 16 + if((boolean~) menu::$23) goto menu::@1 + (byte*) menu::c ← (byte*) COLS +menu::@2: + *((byte*) menu::c) ← (byte) LIGHT_GREEN + (byte*) menu::c ← ++ (byte*) menu::c + (byte*~) menu::$24 ← (byte*) COLS + (word/signed word/dword/signed dword) 1000 + (boolean~) menu::$25 ← (byte*) menu::c != (byte*~) menu::$24 + if((boolean~) menu::$25) goto menu::@2 + *((byte*) BGCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) BORDERCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (void~) menu::$26 ← call print_set_screen (byte*) menu::SCREEN + (void~) menu::$27 ← call print_cls + (void~) menu::$28 ← call print_str_lines (byte[]) MENU_TEXT +menu::@3: + if(true) goto menu::@4 + goto menu::@5 +menu::@4: + (byte~) menu::$29 ← call keyboard_key_pressed (byte) KEY_SPACE + (boolean~) menu::$30 ← (byte~) menu::$29 != (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) menu::$31 ← ! (boolean~) menu::$30 + if((boolean~) menu::$31) goto menu::@6 + goto menu::@return +menu::@6: + goto menu::@3 +menu::@5: +menu::@return: + return +endproc // menu() + call main + +SYMBOLS +(string~) $0 +(string~) $1 +(string~) $2 +(string~) $3 +(string~) $4 +(string~) $5 +(string~) $6 +(string~) $7 +(string~) $8 +(byte*) BGCOL +(byte*) BGCOL1 +(byte*) BGCOL2 +(byte*) BGCOL3 +(byte*) BGCOL4 +(byte) BLACK +(byte) BLUE +(byte*) BORDERCOL +(byte) BROWN +(byte*) CHARGEN +(byte*) CIA1_PORT_A +(byte*) CIA1_PORT_A_DDR +(byte*) CIA1_PORT_B +(byte*) CIA1_PORT_B_DDR +(byte*) CIA2_PORT_A +(byte*) CIA2_PORT_A_DDR +(byte*) CIA2_PORT_B +(byte*) CIA2_PORT_B_DDR +(byte*) COLS +(byte) CYAN +(byte*) D011 +(byte*) D016 +(byte*) D018 +(byte) DARK_GREY +(byte) DTV_BADLINE_OFF +(byte) DTV_BORDER_OFF +(byte) DTV_CHUNKY +(byte) DTV_COLORRAM_OFF +(dword) DTV_COLOR_BANK_DEFAULT +(byte*) DTV_COLOR_BANK_HI +(byte*) DTV_COLOR_BANK_LO +(byte*) DTV_CONTROL +(byte*) DTV_FEATURE +(byte) DTV_FEATURE_DISABLE_TIL_RESET +(byte) DTV_FEATURE_ENABLE +(byte*) DTV_GRAPHICS_HICOL_BANK +(byte*) DTV_GRAPHICS_VIC_BANK +(byte) DTV_HIGHCOLOR +(byte) DTV_LINEAR +(byte) DTV_OVERSCAN +(byte*) DTV_PALETTE +(byte[16]) DTV_PALETTE_DEFAULT +(byte*) DTV_PLANEA_MODULO_HI +(byte*) DTV_PLANEA_MODULO_LO +(byte*) DTV_PLANEA_START_HI +(byte*) DTV_PLANEA_START_LO +(byte*) DTV_PLANEA_START_MI +(byte*) DTV_PLANEA_STEP +(byte*) DTV_PLANEB_MODULO_HI +(byte*) DTV_PLANEB_MODULO_LO +(byte*) DTV_PLANEB_START_HI +(byte*) DTV_PLANEB_START_LO +(byte*) DTV_PLANEB_START_MI +(byte*) DTV_PLANEB_STEP +(byte*) DTV_SPRITE_BANK +(byte) GREEN +(byte) GREY +(byte) KEY_0 +(byte) KEY_1 +(byte) KEY_2 +(byte) KEY_3 +(byte) KEY_4 +(byte) KEY_5 +(byte) KEY_6 +(byte) KEY_7 +(byte) KEY_8 +(byte) KEY_9 +(byte) KEY_A +(byte) KEY_ARROW_LEFT +(byte) KEY_ARROW_UP +(byte) KEY_ASTERISK +(byte) KEY_AT +(byte) KEY_B +(byte) KEY_C +(byte) KEY_COLON +(byte) KEY_COMMA +(byte) KEY_COMMODORE +(byte) KEY_CRSR_DOWN +(byte) KEY_CRSR_RIGHT +(byte) KEY_CTRL +(byte) KEY_D +(byte) KEY_DEL +(byte) KEY_DOT +(byte) KEY_E +(byte) KEY_EQUALS +(byte) KEY_F +(byte) KEY_F1 +(byte) KEY_F3 +(byte) KEY_F5 +(byte) KEY_F7 +(byte) KEY_G +(byte) KEY_H +(byte) KEY_HOME +(byte) KEY_I +(byte) KEY_J +(byte) KEY_K +(byte) KEY_L +(byte) KEY_LSHIFT +(byte) KEY_M +(byte) KEY_MINUS +(byte) KEY_N +(byte) KEY_O +(byte) KEY_P +(byte) KEY_PLUS +(byte) KEY_POUND +(byte) KEY_Q +(byte) KEY_R +(byte) KEY_RETURN +(byte) KEY_RSHIFT +(byte) KEY_RUNSTOP +(byte) KEY_S +(byte) KEY_SEMICOLON +(byte) KEY_SLASH +(byte) KEY_SPACE +(byte) KEY_T +(byte) KEY_U +(byte) KEY_V +(byte) KEY_W +(byte) KEY_X +(byte) KEY_Y +(byte) KEY_Z +(byte) LIGHT_BLUE +(byte) LIGHT_GREEN +(byte) LIGHT_GREY +(byte[]) MENU_TEXT +(byte) ORANGE +(byte) PINK +(byte*) PROCPORT +(byte) PROCPORT_BASIC_KERNEL_IO +(byte*) PROCPORT_DDR +(byte) PROCPORT_DDR_MEMORY_MASK +(byte) PROCPORT_KERNEL_IO +(byte) PROCPORT_RAM_ALL +(byte) PROCPORT_RAM_CHARROM +(byte) PROCPORT_RAM_IO +(byte) PURPLE +(byte*) RASTER +(byte) RED +(byte*) SPRITES_COLS +(byte*) SPRITES_ENABLE +(byte*) SPRITES_EXPAND_X +(byte*) SPRITES_EXPAND_Y +(byte*) SPRITES_MC +(byte*) SPRITES_MC1 +(byte*) SPRITES_MC2 +(byte*) SPRITES_PRIORITY +(byte*) SPRITES_XMSB +(byte*) SPRITES_XPOS +(byte*) SPRITES_YPOS +(byte) VIC_BMM +(byte*) VIC_CONTROL +(byte*) VIC_CONTROL2 +(byte) VIC_CSEL +(byte) VIC_DEN +(byte) VIC_ECM +(byte) VIC_MCM +(byte*) VIC_MEMORY +(byte) VIC_RSEL +(byte) VIC_RST8 +(byte) WHITE +(byte) YELLOW +(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx) +(label) dtvSetCpuBankSegment1::@return +(byte*) dtvSetCpuBankSegment1::cpuBank +(byte) dtvSetCpuBankSegment1::cpuBankIdx +(byte[]) keyboard_char_keycodes +(byte()) keyboard_get_keycode((byte) keyboard_get_keycode::ch) +(label) keyboard_get_keycode::@return +(byte) keyboard_get_keycode::ch +(byte) keyboard_get_keycode::return +(void()) keyboard_init() +(label) keyboard_init::@return +(byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) +(byte~) keyboard_key_pressed::$0 +(byte~) keyboard_key_pressed::$1 +(byte~) keyboard_key_pressed::$2 +(byte~) keyboard_key_pressed::$3 +(label) keyboard_key_pressed::@return +(byte) keyboard_key_pressed::colidx +(byte) keyboard_key_pressed::key +(byte) keyboard_key_pressed::return +(byte) keyboard_key_pressed::rowidx +(byte[]) keyboard_matrix_col_bitmask +(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid) +(byte~) keyboard_matrix_read::$0 +(label) keyboard_matrix_read::@return +(byte) keyboard_matrix_read::return +(byte) keyboard_matrix_read::row_pressed_bits +(byte) keyboard_matrix_read::rowid +(byte[8]) keyboard_matrix_row_bitmask +(void()) main() +(void~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@return +(void()) menu() +(dword~) menu::$0 +(dword~) menu::$1 +(word/signed dword/dword~) menu::$10 +(byte~) menu::$11 +(byte/word/dword~) menu::$12 +(byte~) menu::$13 +(byte/word/dword~) menu::$14 +(word~) menu::$15 +(word~) menu::$16 +(word/signed dword/dword~) menu::$17 +(word~) menu::$18 +(word~) menu::$19 +(byte~) menu::$2 +(word/signed dword/dword~) menu::$20 +(word/dword~) menu::$21 +(byte~) menu::$22 +(boolean~) menu::$23 +(byte*~) menu::$24 +(boolean~) menu::$25 +(void~) menu::$26 +(void~) menu::$27 +(void~) menu::$28 +(byte~) menu::$29 +(dword~) menu::$3 +(boolean~) menu::$30 +(boolean~) menu::$31 +(word~) menu::$4 +(byte~) menu::$5 +(dword~) menu::$6 +(word~) menu::$7 +(byte~) menu::$8 +(word~) menu::$9 +(label) menu::@1 +(label) menu::@2 +(label) menu::@3 +(label) menu::@4 +(label) menu::@5 +(label) menu::@6 +(label) menu::@return +(byte*) menu::CHARSET +(byte*) menu::SCREEN +(byte*) menu::c +(byte) menu::i +(void()) print_byte((byte) print_byte::b) +(byte~) print_byte::$0 +(void~) print_byte::$1 +(byte~) print_byte::$2 +(void~) print_byte::$3 +(label) print_byte::@return +(byte) print_byte::b +(byte[]) print_byte::hextab +(void()) print_char((byte) print_char::ch) +(label) print_char::@return +(byte) print_char::ch +(byte*) print_char_cursor +(void()) print_cls() +(byte*~) print_cls::$0 +(boolean~) print_cls::$1 +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc +(void()) print_dword((dword) print_dword::dw) +(word~) print_dword::$0 +(void~) print_dword::$1 +(word~) print_dword::$2 +(void~) print_dword::$3 +(label) print_dword::@return +(dword) print_dword::dw +(byte*) print_line_cursor +(void()) print_ln() +(byte*~) print_ln::$0 +(boolean~) print_ln::$1 +(label) print_ln::@1 +(label) print_ln::@return +(void()) print_sbyte((signed byte) print_sbyte::b) +(boolean~) print_sbyte::$0 +(boolean~) print_sbyte::$1 +(void~) print_sbyte::$2 +(signed byte~) print_sbyte::$3 +(byte~) print_sbyte::$4 +(void~) print_sbyte::$5 +(label) print_sbyte::@1 +(label) print_sbyte::@return +(signed byte) print_sbyte::b +(byte*) print_screen +(void()) print_sdword((signed dword) print_sdword::dw) +(boolean~) print_sdword::$0 +(boolean~) print_sdword::$1 +(void~) print_sdword::$2 +(signed dword~) print_sdword::$3 +(dword~) print_sdword::$4 +(void~) print_sdword::$5 +(label) print_sdword::@1 +(label) print_sdword::@return +(signed dword) print_sdword::dw +(void()) print_set_screen((byte*) print_set_screen::screen) +(label) print_set_screen::@return +(byte*) print_set_screen::screen +(void()) print_str((byte*) print_str::str) +(boolean~) print_str::$0 +(label) print_str::@1 +(label) print_str::@2 +(label) print_str::@3 +(label) print_str::@return +(byte*) print_str::str +(void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at) +(boolean~) print_str_at::$0 +(label) print_str_at::@1 +(label) print_str_at::@2 +(label) print_str_at::@3 +(label) print_str_at::@return +(byte*) print_str_at::at +(byte*) print_str_at::str +(void()) print_str_lines((byte*) print_str_lines::str) +(boolean~) print_str_lines::$0 +(boolean~) print_str_lines::$1 +(boolean~) print_str_lines::$2 +(boolean~) print_str_lines::$3 +(void~) print_str_lines::$4 +(label) print_str_lines::@1 +(label) print_str_lines::@2 +(label) print_str_lines::@3 +(label) print_str_lines::@4 +(label) print_str_lines::@5 +(label) print_str_lines::@return +(byte) print_str_lines::ch +(byte*) print_str_lines::str +(void()) print_str_ln((byte*) print_str_ln::str) +(void~) print_str_ln::$0 +(void~) print_str_ln::$1 +(label) print_str_ln::@return +(byte*) print_str_ln::str +(void()) print_sword((signed word) print_sword::w) +(boolean~) print_sword::$0 +(boolean~) print_sword::$1 +(void~) print_sword::$2 +(signed word~) print_sword::$3 +(word~) print_sword::$4 +(void~) print_sword::$5 +(label) print_sword::@1 +(label) print_sword::@return +(signed word) print_sword::w +(void()) print_word((word) print_word::w) +(byte~) print_word::$0 +(void~) print_word::$1 +(byte~) print_word::$2 +(void~) print_word::$3 +(label) print_word::@return +(word) print_word::w + +Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0 +Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1 +Promoting word/dword/signed dword to byte* in CHARGEN ← ((byte*)) 53248 +Promoting word/dword/signed dword to byte* in SPRITES_XPOS ← ((byte*)) 53248 +Promoting word/dword/signed dword to byte* in SPRITES_YPOS ← ((byte*)) 53249 +Promoting word/dword/signed dword to byte* in SPRITES_XMSB ← ((byte*)) 53264 +Promoting word/dword/signed dword to byte* in RASTER ← ((byte*)) 53266 +Promoting word/dword/signed dword to byte* in SPRITES_ENABLE ← ((byte*)) 53269 +Promoting word/dword/signed dword to byte* in SPRITES_EXPAND_Y ← ((byte*)) 53271 +Promoting word/dword/signed dword to byte* in SPRITES_PRIORITY ← ((byte*)) 53275 +Promoting word/dword/signed dword to byte* in SPRITES_MC ← ((byte*)) 53276 +Promoting word/dword/signed dword to byte* in SPRITES_EXPAND_X ← ((byte*)) 53277 +Promoting word/dword/signed dword to byte* in BORDERCOL ← ((byte*)) 53280 +Promoting word/dword/signed dword to byte* in BGCOL ← ((byte*)) 53281 +Promoting word/dword/signed dword to byte* in BGCOL1 ← ((byte*)) 53281 +Promoting word/dword/signed dword to byte* in BGCOL2 ← ((byte*)) 53282 +Promoting word/dword/signed dword to byte* in BGCOL3 ← ((byte*)) 53283 +Promoting word/dword/signed dword to byte* in BGCOL4 ← ((byte*)) 53284 +Promoting word/dword/signed dword to byte* in SPRITES_MC1 ← ((byte*)) 53285 +Promoting word/dword/signed dword to byte* in SPRITES_MC2 ← ((byte*)) 53286 +Promoting word/dword/signed dword to byte* in SPRITES_COLS ← ((byte*)) 53287 +Promoting word/dword/signed dword to byte* in VIC_CONTROL ← ((byte*)) 53265 +Promoting word/dword/signed dword to byte* in D011 ← ((byte*)) 53265 +Promoting word/dword/signed dword to byte* in VIC_CONTROL2 ← ((byte*)) 53270 +Promoting word/dword/signed dword to byte* in D016 ← ((byte*)) 53270 +Promoting word/dword/signed dword to byte* in D018 ← ((byte*)) 53272 +Promoting word/dword/signed dword to byte* in VIC_MEMORY ← ((byte*)) 53272 +Promoting word/dword/signed dword to byte* in COLS ← ((byte*)) 55296 +Promoting word/dword/signed dword to byte* in CIA1_PORT_A ← ((byte*)) 56320 +Promoting word/dword/signed dword to byte* in CIA1_PORT_B ← ((byte*)) 56321 +Promoting word/dword/signed dword to byte* in CIA1_PORT_A_DDR ← ((byte*)) 56322 +Promoting word/dword/signed dword to byte* in CIA1_PORT_B_DDR ← ((byte*)) 56323 +Promoting word/dword/signed dword to byte* in CIA2_PORT_A ← ((byte*)) 56576 +Promoting word/dword/signed dword to byte* in CIA2_PORT_B ← ((byte*)) 56577 +Promoting word/dword/signed dword to byte* in CIA2_PORT_A_DDR ← ((byte*)) 56578 +Promoting word/dword/signed dword to byte* in CIA2_PORT_B_DDR ← ((byte*)) 56579 +Promoting word/dword/signed dword to byte* in DTV_FEATURE ← ((byte*)) 53311 +Promoting word/dword/signed dword to byte* in DTV_CONTROL ← ((byte*)) 53308 +Promoting word/dword/signed dword to byte* in DTV_PALETTE ← ((byte*)) 53760 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_START_LO ← ((byte*)) 53306 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_START_MI ← ((byte*)) 53307 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_START_HI ← ((byte*)) 53317 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_STEP ← ((byte*)) 53318 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_MODULO_LO ← ((byte*)) 53304 +Promoting word/dword/signed dword to byte* in DTV_PLANEA_MODULO_HI ← ((byte*)) 53305 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_START_LO ← ((byte*)) 53321 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_START_MI ← ((byte*)) 53322 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_START_HI ← ((byte*)) 53323 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_STEP ← ((byte*)) 53324 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_MODULO_LO ← ((byte*)) 53319 +Promoting word/dword/signed dword to byte* in DTV_PLANEB_MODULO_HI ← ((byte*)) 53320 +Promoting word/dword/signed dword to byte* in DTV_SPRITE_BANK ← ((byte*)) 53325 +Promoting word/dword/signed dword to byte* in DTV_COLOR_BANK_LO ← ((byte*)) 53302 +Promoting word/dword/signed dword to byte* in DTV_COLOR_BANK_HI ← ((byte*)) 53303 +Promoting word/dword/signed dword to byte* in DTV_GRAPHICS_VIC_BANK ← ((byte*)) 53309 +Promoting word/dword/signed dword to byte* in DTV_GRAPHICS_HICOL_BANK ← ((byte*)) 53310 +Promoting byte/word/signed word/dword/signed dword to byte* in dtvSetCpuBankSegment1::cpuBank ← ((byte*)) 255 +Promoting word/signed word/dword/signed dword to byte* in print_screen ← ((byte*)) 1024 +Promoting word/dword/signed dword to byte* in menu::SCREEN ← ((byte*)) 32768 +Promoting word/dword/signed dword to byte* in menu::CHARSET ← ((byte*)) 38912 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) PROCPORT_RAM_ALL ← (byte/signed byte/word/signed word/dword/signed dword) 48 + (byte) PROCPORT_RAM_IO ← (byte/signed byte/word/signed word/dword/signed dword) 53 + (byte) PROCPORT_RAM_CHARROM ← (byte/signed byte/word/signed word/dword/signed dword) 49 + (byte) PROCPORT_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 54 + (byte) PROCPORT_BASIC_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 55 + (byte*) CHARGEN ← ((byte*)) (word/dword/signed dword) 53248 + (byte*) SPRITES_XPOS ← ((byte*)) (word/dword/signed dword) 53248 + (byte*) SPRITES_YPOS ← ((byte*)) (word/dword/signed dword) 53249 + (byte*) SPRITES_XMSB ← ((byte*)) (word/dword/signed dword) 53264 + (byte*) RASTER ← ((byte*)) (word/dword/signed dword) 53266 + (byte*) SPRITES_ENABLE ← ((byte*)) (word/dword/signed dword) 53269 + (byte*) SPRITES_EXPAND_Y ← ((byte*)) (word/dword/signed dword) 53271 + (byte*) SPRITES_PRIORITY ← ((byte*)) (word/dword/signed dword) 53275 + (byte*) SPRITES_MC ← ((byte*)) (word/dword/signed dword) 53276 + (byte*) SPRITES_EXPAND_X ← ((byte*)) (word/dword/signed dword) 53277 + (byte*) BORDERCOL ← ((byte*)) (word/dword/signed dword) 53280 + (byte*) BGCOL ← ((byte*)) (word/dword/signed dword) 53281 + (byte*) BGCOL1 ← ((byte*)) (word/dword/signed dword) 53281 + (byte*) BGCOL2 ← ((byte*)) (word/dword/signed dword) 53282 + (byte*) BGCOL3 ← ((byte*)) (word/dword/signed dword) 53283 + (byte*) BGCOL4 ← ((byte*)) (word/dword/signed dword) 53284 + (byte*) SPRITES_MC1 ← ((byte*)) (word/dword/signed dword) 53285 + (byte*) SPRITES_MC2 ← ((byte*)) (word/dword/signed dword) 53286 + (byte*) SPRITES_COLS ← ((byte*)) (word/dword/signed dword) 53287 + (byte*) VIC_CONTROL ← ((byte*)) (word/dword/signed dword) 53265 + (byte*) D011 ← ((byte*)) (word/dword/signed dword) 53265 + (byte) VIC_RST8 ← (byte/word/signed word/dword/signed dword) 128 + (byte) VIC_ECM ← (byte/signed byte/word/signed word/dword/signed dword) 64 + (byte) VIC_BMM ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) VIC_DEN ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) VIC_RSEL ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) VIC_CONTROL2 ← ((byte*)) (word/dword/signed dword) 53270 + (byte*) D016 ← ((byte*)) (word/dword/signed dword) 53270 + (byte) VIC_MCM ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) VIC_CSEL ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) D018 ← ((byte*)) (word/dword/signed dword) 53272 + (byte*) VIC_MEMORY ← ((byte*)) (word/dword/signed dword) 53272 + (byte*) COLS ← ((byte*)) (word/dword/signed dword) 55296 + (byte*) CIA1_PORT_A ← ((byte*)) (word/dword/signed dword) 56320 + (byte*) CIA1_PORT_B ← ((byte*)) (word/dword/signed dword) 56321 + (byte*) CIA1_PORT_A_DDR ← ((byte*)) (word/dword/signed dword) 56322 + (byte*) CIA1_PORT_B_DDR ← ((byte*)) (word/dword/signed dword) 56323 + (byte*) CIA2_PORT_A ← ((byte*)) (word/dword/signed dword) 56576 + (byte*) CIA2_PORT_B ← ((byte*)) (word/dword/signed dword) 56577 + (byte*) CIA2_PORT_A_DDR ← ((byte*)) (word/dword/signed dword) 56578 + (byte*) CIA2_PORT_B_DDR ← ((byte*)) (word/dword/signed dword) 56579 + (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6 + (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10 + (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11 + (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12 + (byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13 + (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14 + (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15 + (byte*) DTV_FEATURE ← ((byte*)) (word/dword/signed dword) 53311 + (byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte*) DTV_CONTROL ← ((byte*)) (word/dword/signed dword) 53308 + (byte) DTV_LINEAR ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) DTV_BORDER_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) DTV_HIGHCOLOR ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) DTV_OVERSCAN ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) DTV_COLORRAM_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) DTV_BADLINE_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) DTV_CHUNKY ← (byte/signed byte/word/signed word/dword/signed dword) 64 + (byte*) DTV_PALETTE ← ((byte*)) (word/dword/signed dword) 53760 + (byte[16]) DTV_PALETTE_DEFAULT ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 54, (byte/word/signed word/dword/signed dword) 190, (byte/signed byte/word/signed word/dword/signed dword) 88, (byte/word/signed word/dword/signed dword) 219, (byte/word/signed word/dword/signed dword) 134, (byte/word/signed word/dword/signed dword) 255, (byte/signed byte/word/signed word/dword/signed dword) 41, (byte/signed byte/word/signed word/dword/signed dword) 38, (byte/signed byte/word/signed word/dword/signed dword) 59, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 154, (byte/signed byte/word/signed word/dword/signed dword) 10 } + (byte*) DTV_PLANEA_START_LO ← ((byte*)) (word/dword/signed dword) 53306 + (byte*) DTV_PLANEA_START_MI ← ((byte*)) (word/dword/signed dword) 53307 + (byte*) DTV_PLANEA_START_HI ← ((byte*)) (word/dword/signed dword) 53317 + (byte*) DTV_PLANEA_STEP ← ((byte*)) (word/dword/signed dword) 53318 + (byte*) DTV_PLANEA_MODULO_LO ← ((byte*)) (word/dword/signed dword) 53304 + (byte*) DTV_PLANEA_MODULO_HI ← ((byte*)) (word/dword/signed dword) 53305 + (byte*) DTV_PLANEB_START_LO ← ((byte*)) (word/dword/signed dword) 53321 + (byte*) DTV_PLANEB_START_MI ← ((byte*)) (word/dword/signed dword) 53322 + (byte*) DTV_PLANEB_START_HI ← ((byte*)) (word/dword/signed dword) 53323 + (byte*) DTV_PLANEB_STEP ← ((byte*)) (word/dword/signed dword) 53324 + (byte*) DTV_PLANEB_MODULO_LO ← ((byte*)) (word/dword/signed dword) 53319 + (byte*) DTV_PLANEB_MODULO_HI ← ((byte*)) (word/dword/signed dword) 53320 + (byte*) DTV_SPRITE_BANK ← ((byte*)) (word/dword/signed dword) 53325 + (byte*) DTV_COLOR_BANK_LO ← ((byte*)) (word/dword/signed dword) 53302 + (byte*) DTV_COLOR_BANK_HI ← ((byte*)) (word/dword/signed dword) 53303 + (dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832 + (byte*) DTV_GRAPHICS_VIC_BANK ← ((byte*)) (word/dword/signed dword) 53309 + (byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310 + to:@1 +dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from + (byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (byte/word/signed word/dword/signed dword) 255 + *((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx + asm { .byte$32,$dd lda$ff .byte$32,$00 } + to:dtvSetCpuBankSegment1::@return +dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1 + return + to:@return +@1: scope:[] from @begin + (byte*) print_screen ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor + to:@2 +print_str_lines: scope:[print_str_lines] from + to:print_str_lines::@1 +print_str_lines::@1: scope:[print_str_lines] from print_str_lines print_str_lines::@9 + (boolean~) print_str_lines::$0 ← *((byte*) print_str_lines::str) != (byte) '@' + if((boolean~) print_str_lines::$0) goto print_str_lines::@2 + to:print_str_lines::@6 +print_str_lines::@2: scope:[print_str_lines] from print_str_lines::@1 print_str_lines::@7 + to:print_str_lines::@4 +print_str_lines::@6: scope:[print_str_lines] from print_str_lines::@1 + to:print_str_lines::@3 +print_str_lines::@3: scope:[print_str_lines] from print_str_lines::@10 print_str_lines::@6 + to:print_str_lines::@return +print_str_lines::@7: scope:[print_str_lines] from + to:print_str_lines::@2 +print_str_lines::@4: scope:[print_str_lines] from print_str_lines::@2 print_str_lines::@5 + (byte) print_str_lines::ch ← *((byte*) print_str_lines::str) + (byte*) print_str_lines::str ← ++ (byte*) print_str_lines::str + (boolean~) print_str_lines::$1 ← (byte) print_str_lines::ch != (byte) '@' + (boolean~) print_str_lines::$2 ← ! (boolean~) print_str_lines::$1 + if((boolean~) print_str_lines::$2) goto print_str_lines::@5 + to:print_str_lines::@8 +print_str_lines::@5: scope:[print_str_lines] from print_str_lines::@4 print_str_lines::@8 + (boolean~) print_str_lines::$3 ← (byte) print_str_lines::ch != (byte) '@' + if((boolean~) print_str_lines::$3) goto print_str_lines::@4 + to:print_str_lines::@9 +print_str_lines::@8: scope:[print_str_lines] from print_str_lines::@4 + *((byte*) print_char_cursor) ← (byte) print_str_lines::ch + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor + to:print_str_lines::@5 +print_str_lines::@9: scope:[print_str_lines] from print_str_lines::@5 + (void~) print_str_lines::$4 ← call print_ln + to:print_str_lines::@1 +print_str_lines::@10: scope:[print_str_lines] from + to:print_str_lines::@3 +print_str_lines::@return: scope:[print_str_lines] from print_str_lines::@3 + return + to:@return +@2: scope:[] from @1 + to:@3 +print_str_ln: scope:[print_str_ln] from + (void~) print_str_ln::$0 ← call print_str (byte*) print_str_ln::str + (void~) print_str_ln::$1 ← call print_ln + to:print_str_ln::@return +print_str_ln::@return: scope:[print_str_ln] from print_str_ln + return + to:@return +@3: scope:[] from @2 + to:@4 +print_str: scope:[print_str] from + to:print_str::@1 +print_str::@1: scope:[print_str] from print_str print_str::@2 + (boolean~) print_str::$0 ← *((byte*) print_str::str) != (byte) '@' + if((boolean~) print_str::$0) goto print_str::@2 + to:print_str::@4 +print_str::@2: scope:[print_str] from print_str::@1 print_str::@5 + *((byte*) print_char_cursor) ← *((byte*) print_str::str) + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor + (byte*) print_str::str ← ++ (byte*) print_str::str + to:print_str::@1 +print_str::@4: scope:[print_str] from print_str::@1 + to:print_str::@3 +print_str::@3: scope:[print_str] from print_str::@4 print_str::@6 + to:print_str::@return +print_str::@5: scope:[print_str] from + to:print_str::@2 +print_str::@6: scope:[print_str] from + to:print_str::@3 +print_str::@return: scope:[print_str] from print_str::@3 + return + to:@return +@4: scope:[] from @3 + to:@5 +print_str_at: scope:[print_str_at] from + to:print_str_at::@1 +print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2 + (boolean~) print_str_at::$0 ← *((byte*) print_str_at::str) != (byte) '@' + if((boolean~) print_str_at::$0) goto print_str_at::@2 + to:print_str_at::@4 +print_str_at::@2: scope:[print_str_at] from print_str_at::@1 print_str_at::@5 + *((byte*) print_str_at::at) ← *((byte*) print_str_at::str) + (byte*) print_str_at::at ← ++ (byte*) print_str_at::at + (byte*) print_str_at::str ← ++ (byte*) print_str_at::str + to:print_str_at::@1 +print_str_at::@4: scope:[print_str_at] from print_str_at::@1 + to:print_str_at::@3 +print_str_at::@3: scope:[print_str_at] from print_str_at::@4 print_str_at::@6 + to:print_str_at::@return +print_str_at::@5: scope:[print_str_at] from + to:print_str_at::@2 +print_str_at::@6: scope:[print_str_at] from + to:print_str_at::@3 +print_str_at::@return: scope:[print_str_at] from print_str_at::@3 + return + to:@return +@5: scope:[] from @4 + to:@6 +print_ln: scope:[print_ln] from + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*~) print_ln::$0 ← (byte*) print_line_cursor + (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*) print_line_cursor ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) print_line_cursor < (byte*) print_char_cursor + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) print_char_cursor ← (byte*) print_line_cursor + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + return + to:@return +@6: scope:[] from @5 + to:@7 +print_sword: scope:[print_sword] from + (boolean~) print_sword::$0 ← (signed word) print_sword::w < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sword::$1 ← ! (boolean~) print_sword::$0 + if((boolean~) print_sword::$1) goto print_sword::@1 + to:print_sword::@2 +print_sword::@1: scope:[print_sword] from print_sword print_sword::@2 + (word~) print_sword::$4 ← ((word)) (signed word) print_sword::w + (void~) print_sword::$5 ← call print_word (word~) print_sword::$4 + to:print_sword::@return +print_sword::@2: scope:[print_sword] from print_sword + (void~) print_sword::$2 ← call print_char (byte) '-' + (signed word~) print_sword::$3 ← - (signed word) print_sword::w + (signed word) print_sword::w ← (signed word~) print_sword::$3 + to:print_sword::@1 +print_sword::@return: scope:[print_sword] from print_sword::@1 + return + to:@return +@7: scope:[] from @6 + to:@8 +print_sbyte: scope:[print_sbyte] from + (boolean~) print_sbyte::$0 ← (signed byte) print_sbyte::b < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sbyte::$1 ← ! (boolean~) print_sbyte::$0 + if((boolean~) print_sbyte::$1) goto print_sbyte::@1 + to:print_sbyte::@2 +print_sbyte::@1: scope:[print_sbyte] from print_sbyte print_sbyte::@2 + (byte~) print_sbyte::$4 ← ((byte)) (signed byte) print_sbyte::b + (void~) print_sbyte::$5 ← call print_byte (byte~) print_sbyte::$4 + to:print_sbyte::@return +print_sbyte::@2: scope:[print_sbyte] from print_sbyte + (void~) print_sbyte::$2 ← call print_char (byte) '-' + (signed byte~) print_sbyte::$3 ← - (signed byte) print_sbyte::b + (signed byte) print_sbyte::b ← (signed byte~) print_sbyte::$3 + to:print_sbyte::@1 +print_sbyte::@return: scope:[print_sbyte] from print_sbyte::@1 + return + to:@return +@8: scope:[] from @7 + to:@9 +print_word: scope:[print_word] from + (byte~) print_word::$0 ← > (word) print_word::w + (void~) print_word::$1 ← call print_byte (byte~) print_word::$0 + (byte~) print_word::$2 ← < (word) print_word::w + (void~) print_word::$3 ← call print_byte (byte~) print_word::$2 + to:print_word::@return +print_word::@return: scope:[print_word] from print_word + return + to:@return +@9: scope:[] from @8 + to:@10 +print_dword: scope:[print_dword] from + (word~) print_dword::$0 ← > (dword) print_dword::dw + (void~) print_dword::$1 ← call print_word (word~) print_dword::$0 + (word~) print_dword::$2 ← < (dword) print_dword::dw + (void~) print_dword::$3 ← call print_word (word~) print_dword::$2 + to:print_dword::@return +print_dword::@return: scope:[print_dword] from print_dword + return + to:@return +@10: scope:[] from @9 + to:@11 +print_sdword: scope:[print_sdword] from + (boolean~) print_sdword::$0 ← (signed dword) print_sdword::dw < (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) print_sdword::$1 ← ! (boolean~) print_sdword::$0 + if((boolean~) print_sdword::$1) goto print_sdword::@1 + to:print_sdword::@2 +print_sdword::@1: scope:[print_sdword] from print_sdword print_sdword::@2 + (dword~) print_sdword::$4 ← ((dword)) (signed dword) print_sdword::dw + (void~) print_sdword::$5 ← call print_dword (dword~) print_sdword::$4 + to:print_sdword::@return +print_sdword::@2: scope:[print_sdword] from print_sdword + (void~) print_sdword::$2 ← call print_char (byte) '-' + (signed dword~) print_sdword::$3 ← - (signed dword) print_sdword::dw + (signed dword) print_sdword::dw ← (signed dword~) print_sdword::$3 + to:print_sdword::@1 +print_sdword::@return: scope:[print_sdword] from print_sdword::@1 + return + to:@return +@11: scope:[] from @10 + to:@12 +print_byte: scope:[print_byte] from + (byte[]) print_byte::hextab ← (string) "0123456789abcdef" + (byte~) print_byte::$0 ← (byte) print_byte::b >> (byte/signed byte/word/signed word/dword/signed dword) 4 + (void~) print_byte::$1 ← call print_char *((byte[]) print_byte::hextab + (byte~) print_byte::$0) + (byte~) print_byte::$2 ← (byte) print_byte::b & (byte/signed byte/word/signed word/dword/signed dword) 15 + (void~) print_byte::$3 ← call print_char *((byte[]) print_byte::hextab + (byte~) print_byte::$2) + to:print_byte::@return +print_byte::@return: scope:[print_byte] from print_byte + return + to:@return +@12: scope:[] from @11 + to:@13 +print_char: scope:[print_char] from + *((byte*) print_char_cursor) ← (byte) print_char::ch + (byte*) print_char_cursor ← ++ (byte*) print_char_cursor + to:print_char::@return +print_char::@return: scope:[print_char] from print_char + return + to:@return +@13: scope:[] from @12 + to:@14 +print_cls: scope:[print_cls] from + (byte*) print_cls::sc ← (byte*) print_screen + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + *((byte*) print_cls::sc) ← (byte) ' ' + (byte*) print_cls::sc ← ++ (byte*) print_cls::sc + (byte*~) print_cls::$0 ← (byte*) print_screen + (word/signed word/dword/signed dword) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc != (byte*~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + to:print_cls::@2 +print_cls::@2: scope:[print_cls] from print_cls::@1 + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@2 + return + to:@return +@14: scope:[] from @13 + to:@15 +print_set_screen: scope:[print_set_screen] from + (byte*) print_screen ← (byte*) print_set_screen::screen + (byte*) print_line_cursor ← (byte*) print_screen + (byte*) print_char_cursor ← (byte*) print_line_cursor + to:print_set_screen::@return +print_set_screen::@return: scope:[print_set_screen] from print_set_screen + return + to:@return +@15: scope:[] from @14 + (byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte) KEY_F7 ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) KEY_F1 ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) KEY_F3 ← (byte/signed byte/word/signed word/dword/signed dword) 5 + (byte) KEY_F5 ← (byte/signed byte/word/signed word/dword/signed dword) 6 + (byte) KEY_CRSR_DOWN ← (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) KEY_3 ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte) KEY_W ← (byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) KEY_A ← (byte/signed byte/word/signed word/dword/signed dword) 10 + (byte) KEY_4 ← (byte/signed byte/word/signed word/dword/signed dword) 11 + (byte) KEY_Z ← (byte/signed byte/word/signed word/dword/signed dword) 12 + (byte) KEY_S ← (byte/signed byte/word/signed word/dword/signed dword) 13 + (byte) KEY_E ← (byte/signed byte/word/signed word/dword/signed dword) 14 + (byte) KEY_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 15 + (byte) KEY_5 ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) KEY_R ← (byte/signed byte/word/signed word/dword/signed dword) 17 + (byte) KEY_D ← (byte/signed byte/word/signed word/dword/signed dword) 18 + (byte) KEY_6 ← (byte/signed byte/word/signed word/dword/signed dword) 19 + (byte) KEY_C ← (byte/signed byte/word/signed word/dword/signed dword) 20 + (byte) KEY_F ← (byte/signed byte/word/signed word/dword/signed dword) 21 + (byte) KEY_T ← (byte/signed byte/word/signed word/dword/signed dword) 22 + (byte) KEY_X ← (byte/signed byte/word/signed word/dword/signed dword) 23 + (byte) KEY_7 ← (byte/signed byte/word/signed word/dword/signed dword) 24 + (byte) KEY_Y ← (byte/signed byte/word/signed word/dword/signed dword) 25 + (byte) KEY_G ← (byte/signed byte/word/signed word/dword/signed dword) 26 + (byte) KEY_8 ← (byte/signed byte/word/signed word/dword/signed dword) 27 + (byte) KEY_B ← (byte/signed byte/word/signed word/dword/signed dword) 28 + (byte) KEY_H ← (byte/signed byte/word/signed word/dword/signed dword) 29 + (byte) KEY_U ← (byte/signed byte/word/signed word/dword/signed dword) 30 + (byte) KEY_V ← (byte/signed byte/word/signed word/dword/signed dword) 31 + (byte) KEY_9 ← (byte/signed byte/word/signed word/dword/signed dword) 32 + (byte) KEY_I ← (byte/signed byte/word/signed word/dword/signed dword) 33 + (byte) KEY_J ← (byte/signed byte/word/signed word/dword/signed dword) 34 + (byte) KEY_0 ← (byte/signed byte/word/signed word/dword/signed dword) 35 + (byte) KEY_M ← (byte/signed byte/word/signed word/dword/signed dword) 36 + (byte) KEY_K ← (byte/signed byte/word/signed word/dword/signed dword) 37 + (byte) KEY_O ← (byte/signed byte/word/signed word/dword/signed dword) 38 + (byte) KEY_N ← (byte/signed byte/word/signed word/dword/signed dword) 39 + (byte) KEY_PLUS ← (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) KEY_P ← (byte/signed byte/word/signed word/dword/signed dword) 41 + (byte) KEY_L ← (byte/signed byte/word/signed word/dword/signed dword) 42 + (byte) KEY_MINUS ← (byte/signed byte/word/signed word/dword/signed dword) 43 + (byte) KEY_DOT ← (byte/signed byte/word/signed word/dword/signed dword) 44 + (byte) KEY_COLON ← (byte/signed byte/word/signed word/dword/signed dword) 45 + (byte) KEY_AT ← (byte/signed byte/word/signed word/dword/signed dword) 46 + (byte) KEY_COMMA ← (byte/signed byte/word/signed word/dword/signed dword) 47 + (byte) KEY_POUND ← (byte/signed byte/word/signed word/dword/signed dword) 48 + (byte) KEY_ASTERISK ← (byte/signed byte/word/signed word/dword/signed dword) 49 + (byte) KEY_SEMICOLON ← (byte/signed byte/word/signed word/dword/signed dword) 50 + (byte) KEY_HOME ← (byte/signed byte/word/signed word/dword/signed dword) 51 + (byte) KEY_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 52 + (byte) KEY_EQUALS ← (byte/signed byte/word/signed word/dword/signed dword) 53 + (byte) KEY_ARROW_UP ← (byte/signed byte/word/signed word/dword/signed dword) 54 + (byte) KEY_SLASH ← (byte/signed byte/word/signed word/dword/signed dword) 55 + (byte) KEY_1 ← (byte/signed byte/word/signed word/dword/signed dword) 56 + (byte) KEY_ARROW_LEFT ← (byte/signed byte/word/signed word/dword/signed dword) 57 + (byte) KEY_CTRL ← (byte/signed byte/word/signed word/dword/signed dword) 58 + (byte) KEY_2 ← (byte/signed byte/word/signed word/dword/signed dword) 59 + (byte) KEY_SPACE ← (byte/signed byte/word/signed word/dword/signed dword) 60 + (byte) KEY_COMMODORE ← (byte/signed byte/word/signed word/dword/signed dword) 61 + (byte) KEY_Q ← (byte/signed byte/word/signed word/dword/signed dword) 62 + (byte) KEY_RUNSTOP ← (byte/signed byte/word/signed word/dword/signed dword) 63 + (byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 } + (byte[8]) 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_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 } + to:@16 +keyboard_init: scope:[keyboard_init] from + *((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255 + *((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:keyboard_init::@return +keyboard_init::@return: scope:[keyboard_init] from keyboard_init + return + to:@return +@16: scope:[] from @15 + to:@17 +keyboard_matrix_read: scope:[keyboard_matrix_read] from + *((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid) + (byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B) + (byte) keyboard_matrix_read::row_pressed_bits ← (byte~) keyboard_matrix_read::$0 + (byte) keyboard_matrix_read::return ← (byte) keyboard_matrix_read::row_pressed_bits + to:keyboard_matrix_read::@return +keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read keyboard_matrix_read::@1 + (byte) keyboard_matrix_read::return ← (byte) keyboard_matrix_read::return + return (byte) keyboard_matrix_read::return + to:@return +keyboard_matrix_read::@1: scope:[keyboard_matrix_read] from + to:keyboard_matrix_read::@return +@17: scope:[] from @16 + to:@18 +keyboard_key_pressed: scope:[keyboard_key_pressed] from + (byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0 + (byte~) keyboard_key_pressed::$1 ← (byte) keyboard_key_pressed::key >> (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) keyboard_key_pressed::rowidx ← (byte~) keyboard_key_pressed::$1 + (byte~) keyboard_key_pressed::$2 ← call keyboard_matrix_read (byte) keyboard_key_pressed::rowidx + (byte~) keyboard_key_pressed::$3 ← (byte~) keyboard_key_pressed::$2 & *((byte[]) keyboard_matrix_col_bitmask + (byte) keyboard_key_pressed::colidx) + (byte) keyboard_key_pressed::return ← (byte~) keyboard_key_pressed::$3 + to:keyboard_key_pressed::@return +keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_pressed keyboard_key_pressed::@1 + (byte) keyboard_key_pressed::return ← (byte) keyboard_key_pressed::return + return (byte) keyboard_key_pressed::return + to:@return +keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from + to:keyboard_key_pressed::@return +@18: scope:[] from @17 + to:@19 +keyboard_get_keycode: scope:[keyboard_get_keycode] from + (byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch) + to:keyboard_get_keycode::@return +keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_keycode keyboard_get_keycode::@1 + (byte) keyboard_get_keycode::return ← (byte) keyboard_get_keycode::return + return (byte) keyboard_get_keycode::return + to:@return +keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from + to:keyboard_get_keycode::@return +@19: scope:[] from @18 + to:@20 +main: scope:[main] from + asm { sei } + *((byte*) DTV_FEATURE) ← (byte) DTV_FEATURE_ENABLE + to:main::@1 +main::@1: scope:[main] from main main::@2 + if(true) goto main::@2 + to:main::@4 +main::@2: scope:[main] from main::@1 main::@5 + (void~) main::$0 ← call menu + to:main::@1 +main::@4: scope:[main] from main::@1 + to:main::@3 +main::@3: scope:[main] from main::@4 main::@6 + to:main::@return +main::@5: scope:[main] from + to:main::@2 +main::@6: scope:[main] from + to:main::@3 +main::@return: scope:[main] from main::@3 + return + to:@return +@20: scope:[] from @19 + (string~) $0 ← (string) " DTV GfxExplorer PRESET 8bpp pixel cell @" + (string) " CONTROL PLANE A PLANE B VIC II @" + (string~) $1 ← (string~) $0 + (string) " bmm 0 patt p1 patt p2 screen s3 @" + (string~) $2 ← (string~) $1 + (string) " mcm 0 start 00 start 00 gfx g4 @" + (string~) $3 ← (string~) $2 + (string) " ecm 0 step 00 step 00 colors c5 @" + (string~) $4 ← (string~) $3 + (string) " hicol 0 mod 00 mod 00 bgcol0 00 @" + (string~) $5 ← (string~) $4 + (string) " line 0 bgcol1 00 @" + (string~) $6 ← (string~) $5 + (string) " colof 0 borof 0 bgcol2 00 @" + (string~) $7 ← (string~) $6 + (string) " chunk 0 overs 0 bgcol3 00 @" + (string~) $8 ← (string~) $7 + (string) "@" + (byte[]) MENU_TEXT ← (string~) $8 + to:@21 +menu: scope:[menu] from + (byte*) menu::SCREEN ← ((byte*)) (word/dword/signed dword) 32768 + (byte*) menu::CHARSET ← ((byte*)) (word/dword/signed dword) 38912 + (dword~) menu::$0 ← ((dword)) (byte*) menu::CHARSET + (dword~) menu::$1 ← (dword~) menu::$0 / (dword/signed dword) 65536 + (byte~) menu::$2 ← ((byte)) (dword~) menu::$1 + *((byte*) DTV_GRAPHICS_VIC_BANK) ← (byte~) menu::$2 + (dword~) menu::$3 ← (dword) DTV_COLOR_BANK_DEFAULT / (word/signed word/dword/signed dword) 1024 + (word~) menu::$4 ← ((word)) (dword~) menu::$3 + (byte~) menu::$5 ← < (word~) menu::$4 + *((byte*) DTV_COLOR_BANK_LO) ← (byte~) menu::$5 + (dword~) menu::$6 ← (dword) DTV_COLOR_BANK_DEFAULT / (word/signed word/dword/signed dword) 1024 + (word~) menu::$7 ← ((word)) (dword~) menu::$6 + (byte~) menu::$8 ← > (word~) menu::$7 + *((byte*) DTV_COLOR_BANK_HI) ← (byte~) menu::$8 + *((byte*) DTV_CONTROL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (word~) menu::$9 ← ((word)) (byte*) menu::CHARSET + (word/signed dword/dword~) menu::$10 ← (word~) menu::$9 / (word/signed word/dword/signed dword) 16384 + (byte~) menu::$11 ← ((byte)) (word/signed dword/dword~) menu::$10 + (byte/word/dword~) menu::$12 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) menu::$11 + *((byte*) CIA2_PORT_A) ← (byte/word/dword~) menu::$12 + (byte~) menu::$13 ← (byte) VIC_DEN | (byte) VIC_RSEL + (byte/word/dword~) menu::$14 ← (byte~) menu::$13 | (byte/signed byte/word/signed word/dword/signed dword) 3 + *((byte*) VIC_CONTROL) ← (byte/word/dword~) menu::$14 + *((byte*) VIC_CONTROL2) ← (byte) VIC_CSEL + (word~) menu::$15 ← ((word)) (byte*) menu::SCREEN + (word~) menu::$16 ← (word~) menu::$15 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$17 ← (word~) menu::$16 / (byte/signed byte/word/signed word/dword/signed dword) 64 + (word~) menu::$18 ← ((word)) (byte*) menu::CHARSET + (word~) menu::$19 ← (word~) menu::$18 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$20 ← (word~) menu::$19 / (word/signed word/dword/signed dword) 1024 + (word/dword~) menu::$21 ← (word/signed dword/dword~) menu::$17 | (word/signed dword/dword~) menu::$20 + (byte~) menu::$22 ← ((byte)) (word/dword~) menu::$21 + *((byte*) VIC_MEMORY) ← (byte~) menu::$22 + (byte) menu::i ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:menu::@1 +menu::@1: scope:[menu] from menu menu::@1 + *((byte*) DTV_PALETTE + (byte) menu::i) ← *((byte[16]) DTV_PALETTE_DEFAULT + (byte) menu::i) + (byte) menu::i ← ++ (byte) menu::i + (boolean~) menu::$23 ← (byte) menu::i != (byte/signed byte/word/signed word/dword/signed dword) 16 + if((boolean~) menu::$23) goto menu::@1 + to:menu::@7 +menu::@7: scope:[menu] from menu::@1 + (byte*) menu::c ← (byte*) COLS + to:menu::@2 +menu::@2: scope:[menu] from menu::@2 menu::@7 + *((byte*) menu::c) ← (byte) LIGHT_GREEN + (byte*) menu::c ← ++ (byte*) menu::c + (byte*~) menu::$24 ← (byte*) COLS + (word/signed word/dword/signed dword) 1000 + (boolean~) menu::$25 ← (byte*) menu::c != (byte*~) menu::$24 + if((boolean~) menu::$25) goto menu::@2 + to:menu::@8 +menu::@8: scope:[menu] from menu::@2 + *((byte*) BGCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) BORDERCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (void~) menu::$26 ← call print_set_screen (byte*) menu::SCREEN + (void~) menu::$27 ← call print_cls + (void~) menu::$28 ← call print_str_lines (byte[]) MENU_TEXT + to:menu::@3 +menu::@3: scope:[menu] from menu::@6 menu::@8 + if(true) goto menu::@4 + to:menu::@9 +menu::@4: scope:[menu] from menu::@10 menu::@3 + (byte~) menu::$29 ← call keyboard_key_pressed (byte) KEY_SPACE + (boolean~) menu::$30 ← (byte~) menu::$29 != (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) menu::$31 ← ! (boolean~) menu::$30 + if((boolean~) menu::$31) goto menu::@6 + to:menu::@11 +menu::@9: scope:[menu] from menu::@3 + to:menu::@5 +menu::@5: scope:[menu] from menu::@13 menu::@9 + to:menu::@return +menu::@10: scope:[menu] from + to:menu::@4 +menu::@6: scope:[menu] from menu::@12 menu::@4 + to:menu::@3 +menu::@11: scope:[menu] from menu::@4 + to:menu::@return +menu::@return: scope:[menu] from menu::@11 menu::@5 + return + to:@return +menu::@12: scope:[menu] from + to:menu::@6 +menu::@13: scope:[menu] from + to:menu::@5 +@21: scope:[] from @20 + call main + to:@end +@end: scope:[] from @21 + +Removing unused procedure dtvSetCpuBankSegment1 +Removing unused procedure print_str_ln +Removing unused procedure print_str_at +Removing unused procedure print_sword +Removing unused procedure print_sbyte +Removing unused procedure print_sdword +Removing unused procedure keyboard_init +Removing unused procedure keyboard_get_keycode +Removing unused procedure print_str +Removing unused procedure print_dword +Removing unused procedure print_word +Removing unused procedure print_byte +Removing unused procedure print_char +Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0 +Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7 +Eliminating unused variable (byte*) PROCPORT and assignment [2] (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1 +Eliminating unused variable (byte) PROCPORT_RAM_ALL and assignment [3] (byte) PROCPORT_RAM_ALL ← (byte/signed byte/word/signed word/dword/signed dword) 48 +Eliminating unused variable (byte) PROCPORT_RAM_IO and assignment [4] (byte) PROCPORT_RAM_IO ← (byte/signed byte/word/signed word/dword/signed dword) 53 +Eliminating unused variable (byte) PROCPORT_RAM_CHARROM and assignment [5] (byte) PROCPORT_RAM_CHARROM ← (byte/signed byte/word/signed word/dword/signed dword) 49 +Eliminating unused variable (byte) PROCPORT_KERNEL_IO and assignment [6] (byte) PROCPORT_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 54 +Eliminating unused variable (byte) PROCPORT_BASIC_KERNEL_IO and assignment [7] (byte) PROCPORT_BASIC_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 55 +Eliminating unused variable (byte*) CHARGEN and assignment [8] (byte*) CHARGEN ← ((byte*)) (word/dword/signed dword) 53248 +Eliminating unused variable (byte*) SPRITES_XPOS and assignment [9] (byte*) SPRITES_XPOS ← ((byte*)) (word/dword/signed dword) 53248 +Eliminating unused variable (byte*) SPRITES_YPOS and assignment [10] (byte*) SPRITES_YPOS ← ((byte*)) (word/dword/signed dword) 53249 +Eliminating unused variable (byte*) SPRITES_XMSB and assignment [11] (byte*) SPRITES_XMSB ← ((byte*)) (word/dword/signed dword) 53264 +Eliminating unused variable (byte*) RASTER and assignment [12] (byte*) RASTER ← ((byte*)) (word/dword/signed dword) 53266 +Eliminating unused variable (byte*) SPRITES_ENABLE and assignment [13] (byte*) SPRITES_ENABLE ← ((byte*)) (word/dword/signed dword) 53269 +Eliminating unused variable (byte*) SPRITES_EXPAND_Y and assignment [14] (byte*) SPRITES_EXPAND_Y ← ((byte*)) (word/dword/signed dword) 53271 +Eliminating unused variable (byte*) SPRITES_PRIORITY and assignment [15] (byte*) SPRITES_PRIORITY ← ((byte*)) (word/dword/signed dword) 53275 +Eliminating unused variable (byte*) SPRITES_MC and assignment [16] (byte*) SPRITES_MC ← ((byte*)) (word/dword/signed dword) 53276 +Eliminating unused variable (byte*) SPRITES_EXPAND_X and assignment [17] (byte*) SPRITES_EXPAND_X ← ((byte*)) (word/dword/signed dword) 53277 +Eliminating unused variable (byte*) BGCOL1 and assignment [20] (byte*) BGCOL1 ← ((byte*)) (word/dword/signed dword) 53281 +Eliminating unused variable (byte*) BGCOL2 and assignment [21] (byte*) BGCOL2 ← ((byte*)) (word/dword/signed dword) 53282 +Eliminating unused variable (byte*) BGCOL3 and assignment [22] (byte*) BGCOL3 ← ((byte*)) (word/dword/signed dword) 53283 +Eliminating unused variable (byte*) BGCOL4 and assignment [23] (byte*) BGCOL4 ← ((byte*)) (word/dword/signed dword) 53284 +Eliminating unused variable (byte*) SPRITES_MC1 and assignment [24] (byte*) SPRITES_MC1 ← ((byte*)) (word/dword/signed dword) 53285 +Eliminating unused variable (byte*) SPRITES_MC2 and assignment [25] (byte*) SPRITES_MC2 ← ((byte*)) (word/dword/signed dword) 53286 +Eliminating unused variable (byte*) SPRITES_COLS and assignment [26] (byte*) SPRITES_COLS ← ((byte*)) (word/dword/signed dword) 53287 +Eliminating unused variable (byte*) D011 and assignment [28] (byte*) D011 ← ((byte*)) (word/dword/signed dword) 53265 +Eliminating unused variable (byte) VIC_RST8 and assignment [29] (byte) VIC_RST8 ← (byte/word/signed word/dword/signed dword) 128 +Eliminating unused variable (byte) VIC_ECM and assignment [30] (byte) VIC_ECM ← (byte/signed byte/word/signed word/dword/signed dword) 64 +Eliminating unused variable (byte) VIC_BMM and assignment [31] (byte) VIC_BMM ← (byte/signed byte/word/signed word/dword/signed dword) 32 +Eliminating unused variable (byte*) D016 and assignment [35] (byte*) D016 ← ((byte*)) (word/dword/signed dword) 53270 +Eliminating unused variable (byte) VIC_MCM and assignment [36] (byte) VIC_MCM ← (byte/signed byte/word/signed word/dword/signed dword) 16 +Eliminating unused variable (byte*) D018 and assignment [38] (byte*) D018 ← ((byte*)) (word/dword/signed dword) 53272 +Eliminating unused variable (byte*) CIA1_PORT_A_DDR and assignment [43] (byte*) CIA1_PORT_A_DDR ← ((byte*)) (word/dword/signed dword) 56322 +Eliminating unused variable (byte*) CIA1_PORT_B_DDR and assignment [44] (byte*) CIA1_PORT_B_DDR ← ((byte*)) (word/dword/signed dword) 56323 +Eliminating unused variable (byte*) CIA2_PORT_B and assignment [46] (byte*) CIA2_PORT_B ← ((byte*)) (word/dword/signed dword) 56577 +Eliminating unused variable (byte*) CIA2_PORT_B_DDR and assignment [48] (byte*) CIA2_PORT_B_DDR ← ((byte*)) (word/dword/signed dword) 56579 +Eliminating unused variable (byte) BLACK and assignment [49] (byte) BLACK ← (byte/signed byte/word/signed word/dword/signed dword) 0 +Eliminating unused variable (byte) WHITE and assignment [50] (byte) WHITE ← (byte/signed byte/word/signed word/dword/signed dword) 1 +Eliminating unused variable (byte) RED and assignment [51] (byte) RED ← (byte/signed byte/word/signed word/dword/signed dword) 2 +Eliminating unused variable (byte) CYAN and assignment [52] (byte) CYAN ← (byte/signed byte/word/signed word/dword/signed dword) 3 +Eliminating unused variable (byte) PURPLE and assignment [53] (byte) PURPLE ← (byte/signed byte/word/signed word/dword/signed dword) 4 +Eliminating unused variable (byte) GREEN and assignment [54] (byte) GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 5 +Eliminating unused variable (byte) BLUE and assignment [55] (byte) BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 6 +Eliminating unused variable (byte) YELLOW and assignment [56] (byte) YELLOW ← (byte/signed byte/word/signed word/dword/signed dword) 7 +Eliminating unused variable (byte) ORANGE and assignment [57] (byte) ORANGE ← (byte/signed byte/word/signed word/dword/signed dword) 8 +Eliminating unused variable (byte) BROWN and assignment [58] (byte) BROWN ← (byte/signed byte/word/signed word/dword/signed dword) 9 +Eliminating unused variable (byte) PINK and assignment [59] (byte) PINK ← (byte/signed byte/word/signed word/dword/signed dword) 10 +Eliminating unused variable (byte) DARK_GREY and assignment [60] (byte) DARK_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 11 +Eliminating unused variable (byte) GREY and assignment [61] (byte) GREY ← (byte/signed byte/word/signed word/dword/signed dword) 12 +Eliminating unused variable (byte) LIGHT_BLUE and assignment [63] (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14 +Eliminating unused variable (byte) LIGHT_GREY and assignment [64] (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15 +Eliminating unused variable (byte) DTV_FEATURE_DISABLE_TIL_RESET and assignment [67] (byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2 +Eliminating unused variable (byte) DTV_LINEAR and assignment [69] (byte) DTV_LINEAR ← (byte/signed byte/word/signed word/dword/signed dword) 1 +Eliminating unused variable (byte) DTV_BORDER_OFF and assignment [70] (byte) DTV_BORDER_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 2 +Eliminating unused variable (byte) DTV_HIGHCOLOR and assignment [71] (byte) DTV_HIGHCOLOR ← (byte/signed byte/word/signed word/dword/signed dword) 4 +Eliminating unused variable (byte) DTV_OVERSCAN and assignment [72] (byte) DTV_OVERSCAN ← (byte/signed byte/word/signed word/dword/signed dword) 8 +Eliminating unused variable (byte) DTV_COLORRAM_OFF and assignment [73] (byte) DTV_COLORRAM_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 16 +Eliminating unused variable (byte) DTV_BADLINE_OFF and assignment [74] (byte) DTV_BADLINE_OFF ← (byte/signed byte/word/signed word/dword/signed dword) 32 +Eliminating unused variable (byte) DTV_CHUNKY and assignment [75] (byte) DTV_CHUNKY ← (byte/signed byte/word/signed word/dword/signed dword) 64 +Eliminating unused variable (byte*) DTV_PLANEA_START_LO and assignment [78] (byte*) DTV_PLANEA_START_LO ← ((byte*)) (word/dword/signed dword) 53306 +Eliminating unused variable (byte*) DTV_PLANEA_START_MI and assignment [79] (byte*) DTV_PLANEA_START_MI ← ((byte*)) (word/dword/signed dword) 53307 +Eliminating unused variable (byte*) DTV_PLANEA_START_HI and assignment [80] (byte*) DTV_PLANEA_START_HI ← ((byte*)) (word/dword/signed dword) 53317 +Eliminating unused variable (byte*) DTV_PLANEA_STEP and assignment [81] (byte*) DTV_PLANEA_STEP ← ((byte*)) (word/dword/signed dword) 53318 +Eliminating unused variable (byte*) DTV_PLANEA_MODULO_LO and assignment [82] (byte*) DTV_PLANEA_MODULO_LO ← ((byte*)) (word/dword/signed dword) 53304 +Eliminating unused variable (byte*) DTV_PLANEA_MODULO_HI and assignment [83] (byte*) DTV_PLANEA_MODULO_HI ← ((byte*)) (word/dword/signed dword) 53305 +Eliminating unused variable (byte*) DTV_PLANEB_START_LO and assignment [84] (byte*) DTV_PLANEB_START_LO ← ((byte*)) (word/dword/signed dword) 53321 +Eliminating unused variable (byte*) DTV_PLANEB_START_MI and assignment [85] (byte*) DTV_PLANEB_START_MI ← ((byte*)) (word/dword/signed dword) 53322 +Eliminating unused variable (byte*) DTV_PLANEB_START_HI and assignment [86] (byte*) DTV_PLANEB_START_HI ← ((byte*)) (word/dword/signed dword) 53323 +Eliminating unused variable (byte*) DTV_PLANEB_STEP and assignment [87] (byte*) DTV_PLANEB_STEP ← ((byte*)) (word/dword/signed dword) 53324 +Eliminating unused variable (byte*) DTV_PLANEB_MODULO_LO and assignment [88] (byte*) DTV_PLANEB_MODULO_LO ← ((byte*)) (word/dword/signed dword) 53319 +Eliminating unused variable (byte*) DTV_PLANEB_MODULO_HI and assignment [89] (byte*) DTV_PLANEB_MODULO_HI ← ((byte*)) (word/dword/signed dword) 53320 +Eliminating unused variable (byte*) DTV_SPRITE_BANK and assignment [90] (byte*) DTV_SPRITE_BANK ← ((byte*)) (word/dword/signed dword) 53325 +Eliminating unused variable (byte*) DTV_GRAPHICS_HICOL_BANK and assignment [95] (byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310 +Eliminating unused variable - keeping the call (void~) print_str_lines::$4 +Eliminating unused variable (byte) KEY_DEL and assignment [131] (byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0 +Eliminating unused variable (byte) KEY_RETURN and assignment [132] (byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1 +Eliminating unused variable (byte) KEY_CRSR_RIGHT and assignment [133] (byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2 +Eliminating unused variable (byte) KEY_F7 and assignment [134] (byte) KEY_F7 ← (byte/signed byte/word/signed word/dword/signed dword) 3 +Eliminating unused variable (byte) KEY_F1 and assignment [135] (byte) KEY_F1 ← (byte/signed byte/word/signed word/dword/signed dword) 4 +Eliminating unused variable (byte) KEY_F3 and assignment [136] (byte) KEY_F3 ← (byte/signed byte/word/signed word/dword/signed dword) 5 +Eliminating unused variable (byte) KEY_F5 and assignment [137] (byte) KEY_F5 ← (byte/signed byte/word/signed word/dword/signed dword) 6 +Eliminating unused variable (byte) KEY_CRSR_DOWN and assignment [138] (byte) KEY_CRSR_DOWN ← (byte/signed byte/word/signed word/dword/signed dword) 7 +Eliminating unused variable (byte) KEY_LSHIFT and assignment [146] (byte) KEY_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 15 +Eliminating unused variable (byte) KEY_HOME and assignment [182] (byte) KEY_HOME ← (byte/signed byte/word/signed word/dword/signed dword) 51 +Eliminating unused variable (byte) KEY_RSHIFT and assignment [183] (byte) KEY_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 52 +Eliminating unused variable (byte) KEY_CTRL and assignment [189] (byte) KEY_CTRL ← (byte/signed byte/word/signed word/dword/signed dword) 58 +Eliminating unused variable (byte) KEY_COMMODORE and assignment [192] (byte) KEY_COMMODORE ← (byte/signed byte/word/signed word/dword/signed dword) 61 +Eliminating unused variable (byte) KEY_RUNSTOP and assignment [194] (byte) KEY_RUNSTOP ← (byte/signed byte/word/signed word/dword/signed dword) 63 +Eliminating unused variable (byte[]) keyboard_char_keycodes and assignment [195] (byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 } +Eliminating unused variable - keeping the call (void~) main::$0 +Eliminating unused variable - keeping the call (void~) menu::$26 +Eliminating unused variable - keeping the call (void~) menu::$27 +Eliminating unused variable - keeping the call (void~) menu::$28 +Eliminating unused variable (byte) KEY_3 and assignment [58] (byte) KEY_3 ← (byte/signed byte/word/signed word/dword/signed dword) 8 +Eliminating unused variable (byte) KEY_W and assignment [59] (byte) KEY_W ← (byte/signed byte/word/signed word/dword/signed dword) 9 +Eliminating unused variable (byte) KEY_A and assignment [60] (byte) KEY_A ← (byte/signed byte/word/signed word/dword/signed dword) 10 +Eliminating unused variable (byte) KEY_4 and assignment [61] (byte) KEY_4 ← (byte/signed byte/word/signed word/dword/signed dword) 11 +Eliminating unused variable (byte) KEY_Z and assignment [62] (byte) KEY_Z ← (byte/signed byte/word/signed word/dword/signed dword) 12 +Eliminating unused variable (byte) KEY_S and assignment [63] (byte) KEY_S ← (byte/signed byte/word/signed word/dword/signed dword) 13 +Eliminating unused variable (byte) KEY_E and assignment [64] (byte) KEY_E ← (byte/signed byte/word/signed word/dword/signed dword) 14 +Eliminating unused variable (byte) KEY_5 and assignment [65] (byte) KEY_5 ← (byte/signed byte/word/signed word/dword/signed dword) 16 +Eliminating unused variable (byte) KEY_R and assignment [66] (byte) KEY_R ← (byte/signed byte/word/signed word/dword/signed dword) 17 +Eliminating unused variable (byte) KEY_D and assignment [67] (byte) KEY_D ← (byte/signed byte/word/signed word/dword/signed dword) 18 +Eliminating unused variable (byte) KEY_6 and assignment [68] (byte) KEY_6 ← (byte/signed byte/word/signed word/dword/signed dword) 19 +Eliminating unused variable (byte) KEY_C and assignment [69] (byte) KEY_C ← (byte/signed byte/word/signed word/dword/signed dword) 20 +Eliminating unused variable (byte) KEY_F and assignment [70] (byte) KEY_F ← (byte/signed byte/word/signed word/dword/signed dword) 21 +Eliminating unused variable (byte) KEY_T and assignment [71] (byte) KEY_T ← (byte/signed byte/word/signed word/dword/signed dword) 22 +Eliminating unused variable (byte) KEY_X and assignment [72] (byte) KEY_X ← (byte/signed byte/word/signed word/dword/signed dword) 23 +Eliminating unused variable (byte) KEY_7 and assignment [73] (byte) KEY_7 ← (byte/signed byte/word/signed word/dword/signed dword) 24 +Eliminating unused variable (byte) KEY_Y and assignment [74] (byte) KEY_Y ← (byte/signed byte/word/signed word/dword/signed dword) 25 +Eliminating unused variable (byte) KEY_G and assignment [75] (byte) KEY_G ← (byte/signed byte/word/signed word/dword/signed dword) 26 +Eliminating unused variable (byte) KEY_8 and assignment [76] (byte) KEY_8 ← (byte/signed byte/word/signed word/dword/signed dword) 27 +Eliminating unused variable (byte) KEY_B and assignment [77] (byte) KEY_B ← (byte/signed byte/word/signed word/dword/signed dword) 28 +Eliminating unused variable (byte) KEY_H and assignment [78] (byte) KEY_H ← (byte/signed byte/word/signed word/dword/signed dword) 29 +Eliminating unused variable (byte) KEY_U and assignment [79] (byte) KEY_U ← (byte/signed byte/word/signed word/dword/signed dword) 30 +Eliminating unused variable (byte) KEY_V and assignment [80] (byte) KEY_V ← (byte/signed byte/word/signed word/dword/signed dword) 31 +Eliminating unused variable (byte) KEY_9 and assignment [81] (byte) KEY_9 ← (byte/signed byte/word/signed word/dword/signed dword) 32 +Eliminating unused variable (byte) KEY_I and assignment [82] (byte) KEY_I ← (byte/signed byte/word/signed word/dword/signed dword) 33 +Eliminating unused variable (byte) KEY_J and assignment [83] (byte) KEY_J ← (byte/signed byte/word/signed word/dword/signed dword) 34 +Eliminating unused variable (byte) KEY_0 and assignment [84] (byte) KEY_0 ← (byte/signed byte/word/signed word/dword/signed dword) 35 +Eliminating unused variable (byte) KEY_M and assignment [85] (byte) KEY_M ← (byte/signed byte/word/signed word/dword/signed dword) 36 +Eliminating unused variable (byte) KEY_K and assignment [86] (byte) KEY_K ← (byte/signed byte/word/signed word/dword/signed dword) 37 +Eliminating unused variable (byte) KEY_O and assignment [87] (byte) KEY_O ← (byte/signed byte/word/signed word/dword/signed dword) 38 +Eliminating unused variable (byte) KEY_N and assignment [88] (byte) KEY_N ← (byte/signed byte/word/signed word/dword/signed dword) 39 +Eliminating unused variable (byte) KEY_PLUS and assignment [89] (byte) KEY_PLUS ← (byte/signed byte/word/signed word/dword/signed dword) 40 +Eliminating unused variable (byte) KEY_P and assignment [90] (byte) KEY_P ← (byte/signed byte/word/signed word/dword/signed dword) 41 +Eliminating unused variable (byte) KEY_L and assignment [91] (byte) KEY_L ← (byte/signed byte/word/signed word/dword/signed dword) 42 +Eliminating unused variable (byte) KEY_MINUS and assignment [92] (byte) KEY_MINUS ← (byte/signed byte/word/signed word/dword/signed dword) 43 +Eliminating unused variable (byte) KEY_DOT and assignment [93] (byte) KEY_DOT ← (byte/signed byte/word/signed word/dword/signed dword) 44 +Eliminating unused variable (byte) KEY_COLON and assignment [94] (byte) KEY_COLON ← (byte/signed byte/word/signed word/dword/signed dword) 45 +Eliminating unused variable (byte) KEY_AT and assignment [95] (byte) KEY_AT ← (byte/signed byte/word/signed word/dword/signed dword) 46 +Eliminating unused variable (byte) KEY_COMMA and assignment [96] (byte) KEY_COMMA ← (byte/signed byte/word/signed word/dword/signed dword) 47 +Eliminating unused variable (byte) KEY_POUND and assignment [97] (byte) KEY_POUND ← (byte/signed byte/word/signed word/dword/signed dword) 48 +Eliminating unused variable (byte) KEY_ASTERISK and assignment [98] (byte) KEY_ASTERISK ← (byte/signed byte/word/signed word/dword/signed dword) 49 +Eliminating unused variable (byte) KEY_SEMICOLON and assignment [99] (byte) KEY_SEMICOLON ← (byte/signed byte/word/signed word/dword/signed dword) 50 +Eliminating unused variable (byte) KEY_EQUALS and assignment [100] (byte) KEY_EQUALS ← (byte/signed byte/word/signed word/dword/signed dword) 53 +Eliminating unused variable (byte) KEY_ARROW_UP and assignment [101] (byte) KEY_ARROW_UP ← (byte/signed byte/word/signed word/dword/signed dword) 54 +Eliminating unused variable (byte) KEY_SLASH and assignment [102] (byte) KEY_SLASH ← (byte/signed byte/word/signed word/dword/signed dword) 55 +Eliminating unused variable (byte) KEY_1 and assignment [103] (byte) KEY_1 ← (byte/signed byte/word/signed word/dword/signed dword) 56 +Eliminating unused variable (byte) KEY_ARROW_LEFT and assignment [104] (byte) KEY_ARROW_LEFT ← (byte/signed byte/word/signed word/dword/signed dword) 57 +Eliminating unused variable (byte) KEY_2 and assignment [105] (byte) KEY_2 ← (byte/signed byte/word/signed word/dword/signed dword) 59 +Eliminating unused variable (byte) KEY_Q and assignment [107] (byte) KEY_Q ← (byte/signed byte/word/signed word/dword/signed dword) 62 +Creating constant string variable for inline (const string) $9 " DTV GfxExplorer PRESET 8bpp pixel cell @" +Creating constant string variable for inline (const string) $10 " CONTROL PLANE A PLANE B VIC II @" +Creating constant string variable for inline (const string) $11 " bmm 0 patt p1 patt p2 screen s3 @" +Creating constant string variable for inline (const string) $12 " mcm 0 start 00 start 00 gfx g4 @" +Creating constant string variable for inline (const string) $13 " ecm 0 step 00 step 00 colors c5 @" +Creating constant string variable for inline (const string) $14 " hicol 0 mod 00 mod 00 bgcol0 00 @" +Creating constant string variable for inline (const string) $15 " line 0 bgcol1 00 @" +Creating constant string variable for inline (const string) $16 " colof 0 borof 0 bgcol2 00 @" +Creating constant string variable for inline (const string) $17 " chunk 0 overs 0 bgcol3 00 @" +Creating constant string variable for inline (const string) $18 "@" +Removing empty block print_str_lines::@6 +Removing empty block print_str_lines::@3 +Removing empty block print_str_lines::@7 +Removing empty block print_str_lines::@10 +Removing empty block @2 +Removing empty block @3 +Removing empty block @4 +Removing empty block @5 +Removing empty block @6 +Removing empty block @7 +Removing empty block @8 +Removing empty block @9 +Removing empty block @10 +Removing empty block @11 +Removing empty block @12 +Removing empty block @13 +Removing empty block @14 +Removing empty block @16 +Removing empty block keyboard_matrix_read::@1 +Removing empty block @17 +Removing empty block keyboard_key_pressed::@1 +Removing empty block @18 +Removing empty block @19 +Removing empty block main::@4 +Removing empty block main::@3 +Removing empty block main::@5 +Removing empty block main::@6 +Removing empty block menu::@9 +Removing empty block menu::@5 +Removing empty block menu::@10 +Removing empty block menu::@11 +Removing empty block menu::@12 +Removing empty block menu::@13 +PROCEDURE MODIFY VARIABLE ANALYSIS +print_str_lines modifies print_char_cursor +print_str_lines modifies print_line_cursor +print_ln modifies print_line_cursor +print_ln modifies print_char_cursor +print_cls modifies print_line_cursor +print_cls modifies print_char_cursor +print_set_screen modifies print_screen +print_set_screen modifies print_line_cursor +print_set_screen modifies print_char_cursor +main modifies print_screen +main modifies print_line_cursor +main modifies print_char_cursor +menu modifies print_screen +menu modifies print_line_cursor +menu modifies print_char_cursor + +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + (byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) 53280 + (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281 + (byte*) VIC_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53265 + (byte) VIC_DEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16 + (byte) VIC_RSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) VIC_CONTROL2#0 ← ((byte*)) (word/dword/signed dword) 53270 + (byte) VIC_CSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) 53272 + (byte*) COLS#0 ← ((byte*)) (word/dword/signed dword) 55296 + (byte*) CIA1_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56320 + (byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56321 + (byte*) CIA2_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56576 + (byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56578 + (byte) LIGHT_GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 13 + (byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) 53311 + (byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53308 + (byte*) DTV_PALETTE#0 ← ((byte*)) (word/dword/signed dword) 53760 + (byte[16]) DTV_PALETTE_DEFAULT#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 54, (byte/word/signed word/dword/signed dword) 190, (byte/signed byte/word/signed word/dword/signed dword) 88, (byte/word/signed word/dword/signed dword) 219, (byte/word/signed word/dword/signed dword) 134, (byte/word/signed word/dword/signed dword) 255, (byte/signed byte/word/signed word/dword/signed dword) 41, (byte/signed byte/word/signed word/dword/signed dword) 38, (byte/signed byte/word/signed word/dword/signed dword) 59, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 154, (byte/signed byte/word/signed word/dword/signed dword) 10 } + (byte*) DTV_COLOR_BANK_LO#0 ← ((byte*)) (word/dword/signed dword) 53302 + (byte*) DTV_COLOR_BANK_HI#0 ← ((byte*)) (word/dword/signed dword) 53303 + (dword) DTV_COLOR_BANK_DEFAULT#0 ← (dword/signed dword) 120832 + (byte*) DTV_GRAPHICS_VIC_BANK#0 ← ((byte*)) (word/dword/signed dword) 53309 + to:@1 +@1: scope:[] from @begin + (byte*) print_screen#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte*) print_line_cursor#0 ← (byte*) print_screen#0 + (byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0 + to:@15 +print_str_lines: scope:[print_str_lines] from menu::@15 + (byte*) print_line_cursor#39 ← phi( menu::@15/(byte*) print_line_cursor#12 ) + (byte*) print_char_cursor#41 ← phi( menu::@15/(byte*) print_char_cursor#13 ) + (byte*) print_str_lines::str#4 ← phi( menu::@15/(byte*) print_str_lines::str#1 ) + to:print_str_lines::@1 +print_str_lines::@1: scope:[print_str_lines] from print_str_lines print_str_lines::@11 + (byte*) print_line_cursor#31 ← phi( print_str_lines/(byte*) print_line_cursor#39 print_str_lines::@11/(byte*) print_line_cursor#1 ) + (byte*) print_char_cursor#33 ← phi( print_str_lines/(byte*) print_char_cursor#41 print_str_lines::@11/(byte*) print_char_cursor#2 ) + (byte*) print_str_lines::str#2 ← phi( print_str_lines/(byte*) print_str_lines::str#4 print_str_lines::@11/(byte*) print_str_lines::str#5 ) + (boolean~) print_str_lines::$0 ← *((byte*) print_str_lines::str#2) != (byte) '@' + if((boolean~) print_str_lines::$0) goto print_str_lines::@2 + to:print_str_lines::@return +print_str_lines::@2: scope:[print_str_lines] from print_str_lines::@1 + (byte*) print_line_cursor#50 ← phi( print_str_lines::@1/(byte*) print_line_cursor#31 ) + (byte*) print_char_cursor#42 ← phi( print_str_lines::@1/(byte*) print_char_cursor#33 ) + (byte*) print_str_lines::str#6 ← phi( print_str_lines::@1/(byte*) print_str_lines::str#2 ) + to:print_str_lines::@4 +print_str_lines::@4: scope:[print_str_lines] from print_str_lines::@2 print_str_lines::@5 + (byte*) print_line_cursor#46 ← phi( print_str_lines::@2/(byte*) print_line_cursor#50 print_str_lines::@5/(byte*) print_line_cursor#40 ) + (byte*) print_char_cursor#31 ← phi( print_str_lines::@2/(byte*) print_char_cursor#42 print_str_lines::@5/(byte*) print_char_cursor#43 ) + (byte*) print_str_lines::str#3 ← phi( print_str_lines::@2/(byte*) print_str_lines::str#6 print_str_lines::@5/(byte*) print_str_lines::str#7 ) + (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) + (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 + (boolean~) print_str_lines::$1 ← (byte) print_str_lines::ch#0 != (byte) '@' + (boolean~) print_str_lines::$2 ← ! (boolean~) print_str_lines::$1 + if((boolean~) print_str_lines::$2) goto print_str_lines::@5 + to:print_str_lines::@8 +print_str_lines::@5: scope:[print_str_lines] from print_str_lines::@4 print_str_lines::@8 + (byte*) print_line_cursor#40 ← phi( print_str_lines::@4/(byte*) print_line_cursor#46 print_str_lines::@8/(byte*) print_line_cursor#47 ) + (byte*) print_char_cursor#43 ← phi( print_str_lines::@4/(byte*) print_char_cursor#31 print_str_lines::@8/(byte*) print_char_cursor#1 ) + (byte*) print_str_lines::str#7 ← phi( print_str_lines::@4/(byte*) print_str_lines::str#0 print_str_lines::@8/(byte*) print_str_lines::str#8 ) + (byte) print_str_lines::ch#1 ← phi( print_str_lines::@4/(byte) print_str_lines::ch#0 print_str_lines::@8/(byte) print_str_lines::ch#2 ) + (boolean~) print_str_lines::$3 ← (byte) print_str_lines::ch#1 != (byte) '@' + if((boolean~) print_str_lines::$3) goto print_str_lines::@4 + to:print_str_lines::@9 +print_str_lines::@8: scope:[print_str_lines] from print_str_lines::@4 + (byte*) print_line_cursor#47 ← phi( print_str_lines::@4/(byte*) print_line_cursor#46 ) + (byte*) print_str_lines::str#8 ← phi( print_str_lines::@4/(byte*) print_str_lines::str#0 ) + (byte*) print_char_cursor#17 ← phi( print_str_lines::@4/(byte*) print_char_cursor#31 ) + (byte) print_str_lines::ch#2 ← phi( print_str_lines::@4/(byte) print_str_lines::ch#0 ) + *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#2 + (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 + to:print_str_lines::@5 +print_str_lines::@9: scope:[print_str_lines] from print_str_lines::@5 + (byte*) print_str_lines::str#9 ← phi( print_str_lines::@5/(byte*) print_str_lines::str#7 ) + (byte*) print_char_cursor#32 ← phi( print_str_lines::@5/(byte*) print_char_cursor#43 ) + (byte*) print_line_cursor#30 ← phi( print_str_lines::@5/(byte*) print_line_cursor#40 ) + call print_ln param-assignment + to:print_str_lines::@11 +print_str_lines::@11: scope:[print_str_lines] from print_str_lines::@9 + (byte*) print_str_lines::str#5 ← phi( print_str_lines::@9/(byte*) print_str_lines::str#9 ) + (byte*) print_char_cursor#18 ← phi( print_str_lines::@9/(byte*) print_char_cursor#5 ) + (byte*) print_line_cursor#16 ← phi( print_str_lines::@9/(byte*) print_line_cursor#4 ) + (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#16 + (byte*) print_char_cursor#2 ← (byte*) print_char_cursor#18 + to:print_str_lines::@1 +print_str_lines::@return: scope:[print_str_lines] from print_str_lines::@1 + (byte*) print_line_cursor#17 ← phi( print_str_lines::@1/(byte*) print_line_cursor#31 ) + (byte*) print_char_cursor#19 ← phi( print_str_lines::@1/(byte*) print_char_cursor#33 ) + (byte*) print_char_cursor#3 ← (byte*) print_char_cursor#19 + (byte*) print_line_cursor#2 ← (byte*) print_line_cursor#17 + return + to:@return +print_ln: scope:[print_ln] from print_str_lines::@9 + (byte*) print_char_cursor#34 ← phi( print_str_lines::@9/(byte*) print_char_cursor#32 ) + (byte*) print_line_cursor#32 ← phi( print_str_lines::@9/(byte*) print_line_cursor#30 ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + (byte*) print_char_cursor#20 ← phi( print_ln/(byte*) print_char_cursor#34 print_ln::@1/(byte*) print_char_cursor#20 ) + (byte*) print_line_cursor#18 ← phi( print_ln/(byte*) print_line_cursor#32 print_ln::@1/(byte*) print_line_cursor#3 ) + (byte*~) print_ln::$0 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*) print_line_cursor#3 ← (byte*~) print_ln::$0 + (boolean~) print_ln::$1 ← (byte*) print_line_cursor#3 < (byte*) print_char_cursor#20 + if((boolean~) print_ln::$1) goto print_ln::@1 + to:print_ln::@2 +print_ln::@2: scope:[print_ln] from print_ln::@1 + (byte*) print_line_cursor#19 ← phi( print_ln::@1/(byte*) print_line_cursor#3 ) + (byte*) print_char_cursor#4 ← (byte*) print_line_cursor#19 + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@2 + (byte*) print_char_cursor#21 ← phi( print_ln::@2/(byte*) print_char_cursor#4 ) + (byte*) print_line_cursor#20 ← phi( print_ln::@2/(byte*) print_line_cursor#19 ) + (byte*) print_line_cursor#4 ← (byte*) print_line_cursor#20 + (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#21 + return + to:@return +print_cls: scope:[print_cls] from menu::@14 + (byte*) print_screen#8 ← phi( menu::@14/(byte*) print_screen#5 ) + (byte*) print_cls::sc#0 ← (byte*) print_screen#8 + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + (byte*) print_screen#9 ← phi( print_cls/(byte*) print_screen#8 print_cls::@1/(byte*) print_screen#9 ) + (byte*) print_cls::sc#2 ← phi( print_cls/(byte*) print_cls::sc#0 print_cls::@1/(byte*) print_cls::sc#1 ) + *((byte*) print_cls::sc#2) ← (byte) ' ' + (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 + (byte*~) print_cls::$0 ← (byte*) print_screen#9 + (word/signed word/dword/signed dword) 1000 + (boolean~) print_cls::$1 ← (byte*) print_cls::sc#1 != (byte*~) print_cls::$0 + if((boolean~) print_cls::$1) goto print_cls::@1 + to:print_cls::@2 +print_cls::@2: scope:[print_cls] from print_cls::@1 + (byte*) print_screen#10 ← phi( print_cls::@1/(byte*) print_screen#9 ) + (byte*) print_line_cursor#5 ← (byte*) print_screen#10 + (byte*) print_char_cursor#6 ← (byte*) print_line_cursor#5 + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@2 + (byte*) print_char_cursor#22 ← phi( print_cls::@2/(byte*) print_char_cursor#6 ) + (byte*) print_line_cursor#21 ← phi( print_cls::@2/(byte*) print_line_cursor#5 ) + (byte*) print_line_cursor#6 ← (byte*) print_line_cursor#21 + (byte*) print_char_cursor#7 ← (byte*) print_char_cursor#22 + return + to:@return +print_set_screen: scope:[print_set_screen] from menu::@8 + (byte*) print_set_screen::screen#1 ← phi( menu::@8/(byte*) print_set_screen::screen#0 ) + (byte*) print_screen#1 ← (byte*) print_set_screen::screen#1 + (byte*) print_line_cursor#7 ← (byte*) print_screen#1 + (byte*) print_char_cursor#8 ← (byte*) print_line_cursor#7 + to:print_set_screen::@return +print_set_screen::@return: scope:[print_set_screen] from print_set_screen + (byte*) print_char_cursor#23 ← phi( print_set_screen/(byte*) print_char_cursor#8 ) + (byte*) print_line_cursor#22 ← phi( print_set_screen/(byte*) print_line_cursor#7 ) + (byte*) print_screen#11 ← phi( print_set_screen/(byte*) print_screen#1 ) + (byte*) print_screen#2 ← (byte*) print_screen#11 + (byte*) print_line_cursor#8 ← (byte*) print_line_cursor#22 + (byte*) print_char_cursor#9 ← (byte*) print_char_cursor#23 + return + to:@return +@15: scope:[] from @1 + (byte*) print_char_cursor#49 ← phi( @1/(byte*) print_char_cursor#0 ) + (byte*) print_line_cursor#48 ← phi( @1/(byte*) print_line_cursor#0 ) + (byte*) print_screen#29 ← phi( @1/(byte*) print_screen#0 ) + (byte) KEY_SPACE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 60 + (byte[8]) keyboard_matrix_row_bitmask#0 ← { (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_matrix_col_bitmask#0 ← { (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 } + to:@20 +keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed + (byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 ) + *((byte*) CIA1_PORT_A#0) ← *((byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#1) + (byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B#0) + (byte) keyboard_matrix_read::row_pressed_bits#0 ← (byte~) keyboard_matrix_read::$0 + (byte) keyboard_matrix_read::return#0 ← (byte) keyboard_matrix_read::row_pressed_bits#0 + to:keyboard_matrix_read::@return +keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read + (byte) keyboard_matrix_read::return#3 ← phi( keyboard_matrix_read/(byte) keyboard_matrix_read::return#0 ) + (byte) keyboard_matrix_read::return#1 ← (byte) keyboard_matrix_read::return#3 + return + to:@return +keyboard_key_pressed: scope:[keyboard_key_pressed] from menu::@4 + (byte) keyboard_key_pressed::key#1 ← phi( menu::@4/(byte) keyboard_key_pressed::key#0 ) + (byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key#1 & (byte/signed byte/word/signed word/dword/signed dword) 7 + (byte) keyboard_key_pressed::colidx#0 ← (byte~) keyboard_key_pressed::$0 + (byte~) keyboard_key_pressed::$1 ← (byte) keyboard_key_pressed::key#1 >> (byte/signed byte/word/signed word/dword/signed dword) 3 + (byte) keyboard_key_pressed::rowidx#0 ← (byte~) keyboard_key_pressed::$1 + (byte) keyboard_matrix_read::rowid#0 ← (byte) keyboard_key_pressed::rowidx#0 + call keyboard_matrix_read param-assignment + (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#1 + to:keyboard_key_pressed::@2 +keyboard_key_pressed::@2: scope:[keyboard_key_pressed] from keyboard_key_pressed + (byte) keyboard_key_pressed::colidx#1 ← phi( keyboard_key_pressed/(byte) keyboard_key_pressed::colidx#0 ) + (byte) keyboard_matrix_read::return#4 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::return#2 ) + (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#4 + (byte~) keyboard_key_pressed::$3 ← (byte~) keyboard_key_pressed::$2 & *((byte[]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_key_pressed::colidx#1) + (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$3 + to:keyboard_key_pressed::@return +keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_pressed::@2 + (byte) keyboard_key_pressed::return#3 ← phi( keyboard_key_pressed::@2/(byte) keyboard_key_pressed::return#0 ) + (byte) keyboard_key_pressed::return#1 ← (byte) keyboard_key_pressed::return#3 + return + to:@return +main: scope:[main] from @21 + (byte*) print_char_cursor#44 ← phi( @21/(byte*) print_char_cursor#40 ) + (byte*) print_line_cursor#41 ← phi( @21/(byte*) print_line_cursor#38 ) + (byte*) print_screen#23 ← phi( @21/(byte*) print_screen#22 ) + asm { sei } + *((byte*) DTV_FEATURE#0) ← (byte) DTV_FEATURE_ENABLE#0 + to:main::@1 +main::@1: scope:[main] from main main::@7 + (byte*) print_char_cursor#36 ← phi( main/(byte*) print_char_cursor#44 main::@7/(byte*) print_char_cursor#10 ) + (byte*) print_line_cursor#34 ← phi( main/(byte*) print_line_cursor#41 main::@7/(byte*) print_line_cursor#9 ) + (byte*) print_screen#18 ← phi( main/(byte*) print_screen#23 main::@7/(byte*) print_screen#3 ) + if(true) goto main::@2 + to:main::@return +main::@2: scope:[main] from main::@1 + (byte*) print_char_cursor#35 ← phi( main::@1/(byte*) print_char_cursor#36 ) + (byte*) print_line_cursor#33 ← phi( main::@1/(byte*) print_line_cursor#34 ) + (byte*) print_screen#17 ← phi( main::@1/(byte*) print_screen#18 ) + call menu param-assignment + to:main::@7 +main::@7: scope:[main] from main::@2 + (byte*) print_char_cursor#24 ← phi( main::@2/(byte*) print_char_cursor#15 ) + (byte*) print_line_cursor#23 ← phi( main::@2/(byte*) print_line_cursor#14 ) + (byte*) print_screen#12 ← phi( main::@2/(byte*) print_screen#6 ) + (byte*) print_screen#3 ← (byte*) print_screen#12 + (byte*) print_line_cursor#9 ← (byte*) print_line_cursor#23 + (byte*) print_char_cursor#10 ← (byte*) print_char_cursor#24 + to:main::@1 +main::@return: scope:[main] from main::@1 + (byte*) print_char_cursor#25 ← phi( main::@1/(byte*) print_char_cursor#36 ) + (byte*) print_line_cursor#24 ← phi( main::@1/(byte*) print_line_cursor#34 ) + (byte*) print_screen#13 ← phi( main::@1/(byte*) print_screen#18 ) + (byte*) print_screen#4 ← (byte*) print_screen#13 + (byte*) print_line_cursor#10 ← (byte*) print_line_cursor#24 + (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#25 + return + to:@return +@20: scope:[] from @15 + (byte*) print_char_cursor#48 ← phi( @15/(byte*) print_char_cursor#49 ) + (byte*) print_line_cursor#45 ← phi( @15/(byte*) print_line_cursor#48 ) + (byte*) print_screen#28 ← phi( @15/(byte*) print_screen#29 ) + (string~) $0 ← (const string) $9 + (const string) $10 + (string~) $1 ← (string~) $0 + (const string) $11 + (string~) $2 ← (string~) $1 + (const string) $12 + (string~) $3 ← (string~) $2 + (const string) $13 + (string~) $4 ← (string~) $3 + (const string) $14 + (string~) $5 ← (string~) $4 + (const string) $15 + (string~) $6 ← (string~) $5 + (const string) $16 + (string~) $7 ← (string~) $6 + (const string) $17 + (string~) $8 ← (string~) $7 + (const string) $18 + (byte[]) MENU_TEXT#0 ← (string~) $8 + to:@21 +menu: scope:[menu] from main::@2 + (byte*) print_char_cursor#52 ← phi( main::@2/(byte*) print_char_cursor#35 ) + (byte*) print_line_cursor#52 ← phi( main::@2/(byte*) print_line_cursor#33 ) + (byte*) print_screen#33 ← phi( main::@2/(byte*) print_screen#17 ) + (byte*) menu::SCREEN#0 ← ((byte*)) (word/dword/signed dword) 32768 + (byte*) menu::CHARSET#0 ← ((byte*)) (word/dword/signed dword) 38912 + (dword~) menu::$0 ← ((dword)) (byte*) menu::CHARSET#0 + (dword~) menu::$1 ← (dword~) menu::$0 / (dword/signed dword) 65536 + (byte~) menu::$2 ← ((byte)) (dword~) menu::$1 + *((byte*) DTV_GRAPHICS_VIC_BANK#0) ← (byte~) menu::$2 + (dword~) menu::$3 ← (dword) DTV_COLOR_BANK_DEFAULT#0 / (word/signed word/dword/signed dword) 1024 + (word~) menu::$4 ← ((word)) (dword~) menu::$3 + (byte~) menu::$5 ← < (word~) menu::$4 + *((byte*) DTV_COLOR_BANK_LO#0) ← (byte~) menu::$5 + (dword~) menu::$6 ← (dword) DTV_COLOR_BANK_DEFAULT#0 / (word/signed word/dword/signed dword) 1024 + (word~) menu::$7 ← ((word)) (dword~) menu::$6 + (byte~) menu::$8 ← > (word~) menu::$7 + *((byte*) DTV_COLOR_BANK_HI#0) ← (byte~) menu::$8 + *((byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 + (word~) menu::$9 ← ((word)) (byte*) menu::CHARSET#0 + (word/signed dword/dword~) menu::$10 ← (word~) menu::$9 / (word/signed word/dword/signed dword) 16384 + (byte~) menu::$11 ← ((byte)) (word/signed dword/dword~) menu::$10 + (byte/word/dword~) menu::$12 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) menu::$11 + *((byte*) CIA2_PORT_A#0) ← (byte/word/dword~) menu::$12 + (byte~) menu::$13 ← (byte) VIC_DEN#0 | (byte) VIC_RSEL#0 + (byte/word/dword~) menu::$14 ← (byte~) menu::$13 | (byte/signed byte/word/signed word/dword/signed dword) 3 + *((byte*) VIC_CONTROL#0) ← (byte/word/dword~) menu::$14 + *((byte*) VIC_CONTROL2#0) ← (byte) VIC_CSEL#0 + (word~) menu::$15 ← ((word)) (byte*) menu::SCREEN#0 + (word~) menu::$16 ← (word~) menu::$15 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$17 ← (word~) menu::$16 / (byte/signed byte/word/signed word/dword/signed dword) 64 + (word~) menu::$18 ← ((word)) (byte*) menu::CHARSET#0 + (word~) menu::$19 ← (word~) menu::$18 & (word/signed word/dword/signed dword) 16383 + (word/signed dword/dword~) menu::$20 ← (word~) menu::$19 / (word/signed word/dword/signed dword) 1024 + (word/dword~) menu::$21 ← (word/signed dword/dword~) menu::$17 | (word/signed dword/dword~) menu::$20 + (byte~) menu::$22 ← ((byte)) (word/dword~) menu::$21 + *((byte*) VIC_MEMORY#0) ← (byte~) menu::$22 + (byte) menu::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:menu::@1 +menu::@1: scope:[menu] from menu menu::@1 + (byte*) print_char_cursor#51 ← phi( menu/(byte*) print_char_cursor#52 menu::@1/(byte*) print_char_cursor#51 ) + (byte*) print_line_cursor#51 ← phi( menu/(byte*) print_line_cursor#52 menu::@1/(byte*) print_line_cursor#51 ) + (byte*) print_screen#32 ← phi( menu/(byte*) print_screen#33 menu::@1/(byte*) print_screen#32 ) + (byte) menu::i#2 ← phi( menu/(byte) menu::i#0 menu::@1/(byte) menu::i#1 ) + *((byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) + (byte) menu::i#1 ← ++ (byte) menu::i#2 + (boolean~) menu::$23 ← (byte) menu::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 16 + if((boolean~) menu::$23) goto menu::@1 + to:menu::@7 +menu::@7: scope:[menu] from menu::@1 + (byte*) print_char_cursor#50 ← phi( menu::@1/(byte*) print_char_cursor#51 ) + (byte*) print_line_cursor#49 ← phi( menu::@1/(byte*) print_line_cursor#51 ) + (byte*) print_screen#30 ← phi( menu::@1/(byte*) print_screen#32 ) + (byte*) menu::c#0 ← (byte*) COLS#0 + to:menu::@2 +menu::@2: scope:[menu] from menu::@2 menu::@7 + (byte*) print_char_cursor#45 ← phi( menu::@2/(byte*) print_char_cursor#45 menu::@7/(byte*) print_char_cursor#50 ) + (byte*) print_line_cursor#42 ← phi( menu::@2/(byte*) print_line_cursor#42 menu::@7/(byte*) print_line_cursor#49 ) + (byte*) print_screen#24 ← phi( menu::@2/(byte*) print_screen#24 menu::@7/(byte*) print_screen#30 ) + (byte*) menu::c#2 ← phi( menu::@2/(byte*) menu::c#1 menu::@7/(byte*) menu::c#0 ) + *((byte*) menu::c#2) ← (byte) LIGHT_GREEN#0 + (byte*) menu::c#1 ← ++ (byte*) menu::c#2 + (byte*~) menu::$24 ← (byte*) COLS#0 + (word/signed word/dword/signed dword) 1000 + (boolean~) menu::$25 ← (byte*) menu::c#1 != (byte*~) menu::$24 + if((boolean~) menu::$25) goto menu::@2 + to:menu::@8 +menu::@8: scope:[menu] from menu::@2 + (byte*) print_char_cursor#37 ← phi( menu::@2/(byte*) print_char_cursor#45 ) + (byte*) print_line_cursor#35 ← phi( menu::@2/(byte*) print_line_cursor#42 ) + (byte*) print_screen#19 ← phi( menu::@2/(byte*) print_screen#24 ) + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte*) print_set_screen::screen#0 ← (byte*) menu::SCREEN#0 + call print_set_screen param-assignment + to:menu::@14 +menu::@14: scope:[menu] from menu::@8 + (byte*) print_char_cursor#26 ← phi( menu::@8/(byte*) print_char_cursor#9 ) + (byte*) print_line_cursor#25 ← phi( menu::@8/(byte*) print_line_cursor#8 ) + (byte*) print_screen#14 ← phi( menu::@8/(byte*) print_screen#2 ) + (byte*) print_screen#5 ← (byte*) print_screen#14 + (byte*) print_line_cursor#11 ← (byte*) print_line_cursor#25 + (byte*) print_char_cursor#12 ← (byte*) print_char_cursor#26 + call print_cls param-assignment + to:menu::@15 +menu::@15: scope:[menu] from menu::@14 + (byte*) print_screen#31 ← phi( menu::@14/(byte*) print_screen#5 ) + (byte*) print_char_cursor#27 ← phi( menu::@14/(byte*) print_char_cursor#7 ) + (byte*) print_line_cursor#26 ← phi( menu::@14/(byte*) print_line_cursor#6 ) + (byte*) print_line_cursor#12 ← (byte*) print_line_cursor#26 + (byte*) print_char_cursor#13 ← (byte*) print_char_cursor#27 + (byte*) print_str_lines::str#1 ← (byte[]) MENU_TEXT#0 + call print_str_lines param-assignment + to:menu::@16 +menu::@16: scope:[menu] from menu::@15 + (byte*) print_screen#25 ← phi( menu::@15/(byte*) print_screen#31 ) + (byte*) print_line_cursor#27 ← phi( menu::@15/(byte*) print_line_cursor#2 ) + (byte*) print_char_cursor#28 ← phi( menu::@15/(byte*) print_char_cursor#3 ) + (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#28 + (byte*) print_line_cursor#13 ← (byte*) print_line_cursor#27 + to:menu::@3 +menu::@3: scope:[menu] from menu::@16 menu::@6 + (byte*) print_char_cursor#39 ← phi( menu::@16/(byte*) print_char_cursor#14 menu::@6/(byte*) print_char_cursor#46 ) + (byte*) print_line_cursor#37 ← phi( menu::@16/(byte*) print_line_cursor#13 menu::@6/(byte*) print_line_cursor#43 ) + (byte*) print_screen#21 ← phi( menu::@16/(byte*) print_screen#25 menu::@6/(byte*) print_screen#26 ) + if(true) goto menu::@4 + to:menu::@return +menu::@4: scope:[menu] from menu::@3 + (byte*) print_char_cursor#47 ← phi( menu::@3/(byte*) print_char_cursor#39 ) + (byte*) print_line_cursor#44 ← phi( menu::@3/(byte*) print_line_cursor#37 ) + (byte*) print_screen#27 ← phi( menu::@3/(byte*) print_screen#21 ) + (byte) keyboard_key_pressed::key#0 ← (byte) KEY_SPACE#0 + call keyboard_key_pressed param-assignment + (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#1 + to:menu::@17 +menu::@17: scope:[menu] from menu::@4 + (byte*) print_char_cursor#38 ← phi( menu::@4/(byte*) print_char_cursor#47 ) + (byte*) print_line_cursor#36 ← phi( menu::@4/(byte*) print_line_cursor#44 ) + (byte*) print_screen#20 ← phi( menu::@4/(byte*) print_screen#27 ) + (byte) keyboard_key_pressed::return#4 ← phi( menu::@4/(byte) keyboard_key_pressed::return#2 ) + (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#4 + (boolean~) menu::$30 ← (byte~) menu::$29 != (byte/signed byte/word/signed word/dword/signed dword) 0 + (boolean~) menu::$31 ← ! (boolean~) menu::$30 + if((boolean~) menu::$31) goto menu::@6 + to:menu::@return +menu::@6: scope:[menu] from menu::@17 + (byte*) print_char_cursor#46 ← phi( menu::@17/(byte*) print_char_cursor#38 ) + (byte*) print_line_cursor#43 ← phi( menu::@17/(byte*) print_line_cursor#36 ) + (byte*) print_screen#26 ← phi( menu::@17/(byte*) print_screen#20 ) + to:menu::@3 +menu::@return: scope:[menu] from menu::@17 menu::@3 + (byte*) print_char_cursor#29 ← phi( menu::@17/(byte*) print_char_cursor#38 menu::@3/(byte*) print_char_cursor#39 ) + (byte*) print_line_cursor#28 ← phi( menu::@17/(byte*) print_line_cursor#36 menu::@3/(byte*) print_line_cursor#37 ) + (byte*) print_screen#15 ← phi( menu::@17/(byte*) print_screen#20 menu::@3/(byte*) print_screen#21 ) + (byte*) print_screen#6 ← (byte*) print_screen#15 + (byte*) print_line_cursor#14 ← (byte*) print_line_cursor#28 + (byte*) print_char_cursor#15 ← (byte*) print_char_cursor#29 + return + to:@return +@21: scope:[] from @20 + (byte*) print_char_cursor#40 ← phi( @20/(byte*) print_char_cursor#48 ) + (byte*) print_line_cursor#38 ← phi( @20/(byte*) print_line_cursor#45 ) + (byte*) print_screen#22 ← phi( @20/(byte*) print_screen#28 ) + call main param-assignment + to:@22 +@22: scope:[] from @21 + (byte*) print_char_cursor#30 ← phi( @21/(byte*) print_char_cursor#11 ) + (byte*) print_line_cursor#29 ← phi( @21/(byte*) print_line_cursor#10 ) + (byte*) print_screen#16 ← phi( @21/(byte*) print_screen#4 ) + (byte*) print_screen#7 ← (byte*) print_screen#16 + (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#29 + (byte*) print_char_cursor#16 ← (byte*) print_char_cursor#30 + to:@end +@end: scope:[] from @22 + +SYMBOL TABLE SSA +(string~) $0 +(string~) $1 +(const string) $10 = (string) " CONTROL PLANE A PLANE B VIC II @" +(const string) $11 = (string) " bmm 0 patt p1 patt p2 screen s3 @" +(const string) $12 = (string) " mcm 0 start 00 start 00 gfx g4 @" +(const string) $13 = (string) " ecm 0 step 00 step 00 colors c5 @" +(const string) $14 = (string) " hicol 0 mod 00 mod 00 bgcol0 00 @" +(const string) $15 = (string) " line 0 bgcol1 00 @" +(const string) $16 = (string) " colof 0 borof 0 bgcol2 00 @" +(const string) $17 = (string) " chunk 0 overs 0 bgcol3 00 @" +(const string) $18 = (string) "@" +(string~) $2 +(string~) $3 +(string~) $4 +(string~) $5 +(string~) $6 +(string~) $7 +(string~) $8 +(const string) $9 = (string) " DTV GfxExplorer PRESET 8bpp pixel cell @" +(label) @1 +(label) @15 +(label) @20 +(label) @21 +(label) @22 +(label) @begin +(label) @end +(byte*) BGCOL +(byte*) BGCOL#0 +(byte*) BORDERCOL +(byte*) BORDERCOL#0 +(byte*) CIA1_PORT_A +(byte*) CIA1_PORT_A#0 +(byte*) CIA1_PORT_B +(byte*) CIA1_PORT_B#0 +(byte*) CIA2_PORT_A +(byte*) CIA2_PORT_A#0 +(byte*) CIA2_PORT_A_DDR +(byte*) CIA2_PORT_A_DDR#0 +(byte*) COLS +(byte*) COLS#0 +(dword) DTV_COLOR_BANK_DEFAULT +(dword) DTV_COLOR_BANK_DEFAULT#0 +(byte*) DTV_COLOR_BANK_HI +(byte*) DTV_COLOR_BANK_HI#0 +(byte*) DTV_COLOR_BANK_LO +(byte*) DTV_COLOR_BANK_LO#0 +(byte*) DTV_CONTROL +(byte*) DTV_CONTROL#0 +(byte*) DTV_FEATURE +(byte*) DTV_FEATURE#0 +(byte) DTV_FEATURE_ENABLE +(byte) DTV_FEATURE_ENABLE#0 +(byte*) DTV_GRAPHICS_VIC_BANK +(byte*) DTV_GRAPHICS_VIC_BANK#0 +(byte*) DTV_PALETTE +(byte*) DTV_PALETTE#0 +(byte[16]) DTV_PALETTE_DEFAULT +(byte[16]) DTV_PALETTE_DEFAULT#0 +(byte) KEY_SPACE +(byte) KEY_SPACE#0 +(byte) LIGHT_GREEN +(byte) LIGHT_GREEN#0 +(byte[]) MENU_TEXT +(byte[]) MENU_TEXT#0 +(byte*) VIC_CONTROL +(byte*) VIC_CONTROL#0 +(byte*) VIC_CONTROL2 +(byte*) VIC_CONTROL2#0 +(byte) VIC_CSEL +(byte) VIC_CSEL#0 +(byte) VIC_DEN +(byte) VIC_DEN#0 +(byte*) VIC_MEMORY +(byte*) VIC_MEMORY#0 +(byte) VIC_RSEL +(byte) VIC_RSEL#0 +(byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) +(byte~) keyboard_key_pressed::$0 +(byte~) keyboard_key_pressed::$1 +(byte~) keyboard_key_pressed::$2 +(byte~) keyboard_key_pressed::$3 +(label) keyboard_key_pressed::@2 +(label) keyboard_key_pressed::@return +(byte) keyboard_key_pressed::colidx +(byte) keyboard_key_pressed::colidx#0 +(byte) keyboard_key_pressed::colidx#1 +(byte) keyboard_key_pressed::key +(byte) keyboard_key_pressed::key#0 +(byte) keyboard_key_pressed::key#1 +(byte) keyboard_key_pressed::return +(byte) keyboard_key_pressed::return#0 +(byte) keyboard_key_pressed::return#1 +(byte) keyboard_key_pressed::return#2 +(byte) keyboard_key_pressed::return#3 +(byte) keyboard_key_pressed::return#4 +(byte) keyboard_key_pressed::rowidx +(byte) keyboard_key_pressed::rowidx#0 +(byte[]) keyboard_matrix_col_bitmask +(byte[]) keyboard_matrix_col_bitmask#0 +(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid) +(byte~) keyboard_matrix_read::$0 +(label) keyboard_matrix_read::@return +(byte) keyboard_matrix_read::return +(byte) keyboard_matrix_read::return#0 +(byte) keyboard_matrix_read::return#1 +(byte) keyboard_matrix_read::return#2 +(byte) keyboard_matrix_read::return#3 +(byte) keyboard_matrix_read::return#4 +(byte) keyboard_matrix_read::row_pressed_bits +(byte) keyboard_matrix_read::row_pressed_bits#0 +(byte) keyboard_matrix_read::rowid +(byte) keyboard_matrix_read::rowid#0 +(byte) keyboard_matrix_read::rowid#1 +(byte[8]) keyboard_matrix_row_bitmask +(byte[8]) keyboard_matrix_row_bitmask#0 +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@7 +(label) main::@return +(void()) menu() +(dword~) menu::$0 +(dword~) menu::$1 +(word/signed dword/dword~) menu::$10 +(byte~) menu::$11 +(byte/word/dword~) menu::$12 +(byte~) menu::$13 +(byte/word/dword~) menu::$14 +(word~) menu::$15 +(word~) menu::$16 +(word/signed dword/dword~) menu::$17 +(word~) menu::$18 +(word~) menu::$19 +(byte~) menu::$2 +(word/signed dword/dword~) menu::$20 +(word/dword~) menu::$21 +(byte~) menu::$22 +(boolean~) menu::$23 +(byte*~) menu::$24 +(boolean~) menu::$25 +(byte~) menu::$29 +(dword~) menu::$3 +(boolean~) menu::$30 +(boolean~) menu::$31 +(word~) menu::$4 +(byte~) menu::$5 +(dword~) menu::$6 +(word~) menu::$7 +(byte~) menu::$8 +(word~) menu::$9 +(label) menu::@1 +(label) menu::@14 +(label) menu::@15 +(label) menu::@16 +(label) menu::@17 +(label) menu::@2 +(label) menu::@3 +(label) menu::@4 +(label) menu::@6 +(label) menu::@7 +(label) menu::@8 +(label) menu::@return +(byte*) menu::CHARSET +(byte*) menu::CHARSET#0 +(byte*) menu::SCREEN +(byte*) menu::SCREEN#0 +(byte*) menu::c +(byte*) menu::c#0 +(byte*) menu::c#1 +(byte*) menu::c#2 +(byte) menu::i +(byte) menu::i#0 +(byte) menu::i#1 +(byte) menu::i#2 +(byte*) print_char_cursor +(byte*) print_char_cursor#0 +(byte*) print_char_cursor#1 +(byte*) print_char_cursor#10 +(byte*) print_char_cursor#11 +(byte*) print_char_cursor#12 +(byte*) print_char_cursor#13 +(byte*) print_char_cursor#14 +(byte*) print_char_cursor#15 +(byte*) print_char_cursor#16 +(byte*) print_char_cursor#17 +(byte*) print_char_cursor#18 +(byte*) print_char_cursor#19 +(byte*) print_char_cursor#2 +(byte*) print_char_cursor#20 +(byte*) print_char_cursor#21 +(byte*) print_char_cursor#22 +(byte*) print_char_cursor#23 +(byte*) print_char_cursor#24 +(byte*) print_char_cursor#25 +(byte*) print_char_cursor#26 +(byte*) print_char_cursor#27 +(byte*) print_char_cursor#28 +(byte*) print_char_cursor#29 +(byte*) print_char_cursor#3 +(byte*) print_char_cursor#30 +(byte*) print_char_cursor#31 +(byte*) print_char_cursor#32 +(byte*) print_char_cursor#33 +(byte*) print_char_cursor#34 +(byte*) print_char_cursor#35 +(byte*) print_char_cursor#36 +(byte*) print_char_cursor#37 +(byte*) print_char_cursor#38 +(byte*) print_char_cursor#39 +(byte*) print_char_cursor#4 +(byte*) print_char_cursor#40 +(byte*) print_char_cursor#41 +(byte*) print_char_cursor#42 +(byte*) print_char_cursor#43 +(byte*) print_char_cursor#44 +(byte*) print_char_cursor#45 +(byte*) print_char_cursor#46 +(byte*) print_char_cursor#47 +(byte*) print_char_cursor#48 +(byte*) print_char_cursor#49 +(byte*) print_char_cursor#5 +(byte*) print_char_cursor#50 +(byte*) print_char_cursor#51 +(byte*) print_char_cursor#52 +(byte*) print_char_cursor#6 +(byte*) print_char_cursor#7 +(byte*) print_char_cursor#8 +(byte*) print_char_cursor#9 +(void()) print_cls() +(byte*~) print_cls::$0 +(boolean~) print_cls::$1 +(label) print_cls::@1 +(label) print_cls::@2 +(label) print_cls::@return +(byte*) print_cls::sc +(byte*) print_cls::sc#0 +(byte*) print_cls::sc#1 +(byte*) print_cls::sc#2 +(byte*) print_line_cursor +(byte*) print_line_cursor#0 +(byte*) print_line_cursor#1 +(byte*) print_line_cursor#10 +(byte*) print_line_cursor#11 +(byte*) print_line_cursor#12 +(byte*) print_line_cursor#13 +(byte*) print_line_cursor#14 +(byte*) print_line_cursor#15 +(byte*) print_line_cursor#16 +(byte*) print_line_cursor#17 +(byte*) print_line_cursor#18 +(byte*) print_line_cursor#19 +(byte*) print_line_cursor#2 +(byte*) print_line_cursor#20 +(byte*) print_line_cursor#21 +(byte*) print_line_cursor#22 +(byte*) print_line_cursor#23 +(byte*) print_line_cursor#24 +(byte*) print_line_cursor#25 +(byte*) print_line_cursor#26 +(byte*) print_line_cursor#27 +(byte*) print_line_cursor#28 +(byte*) print_line_cursor#29 +(byte*) print_line_cursor#3 +(byte*) print_line_cursor#30 +(byte*) print_line_cursor#31 +(byte*) print_line_cursor#32 +(byte*) print_line_cursor#33 +(byte*) print_line_cursor#34 +(byte*) print_line_cursor#35 +(byte*) print_line_cursor#36 +(byte*) print_line_cursor#37 +(byte*) print_line_cursor#38 +(byte*) print_line_cursor#39 +(byte*) print_line_cursor#4 +(byte*) print_line_cursor#40 +(byte*) print_line_cursor#41 +(byte*) print_line_cursor#42 +(byte*) print_line_cursor#43 +(byte*) print_line_cursor#44 +(byte*) print_line_cursor#45 +(byte*) print_line_cursor#46 +(byte*) print_line_cursor#47 +(byte*) print_line_cursor#48 +(byte*) print_line_cursor#49 +(byte*) print_line_cursor#5 +(byte*) print_line_cursor#50 +(byte*) print_line_cursor#51 +(byte*) print_line_cursor#52 +(byte*) print_line_cursor#6 +(byte*) print_line_cursor#7 +(byte*) print_line_cursor#8 +(byte*) print_line_cursor#9 +(void()) print_ln() +(byte*~) print_ln::$0 +(boolean~) print_ln::$1 +(label) print_ln::@1 +(label) print_ln::@2 +(label) print_ln::@return +(byte*) print_screen +(byte*) print_screen#0 +(byte*) print_screen#1 +(byte*) print_screen#10 +(byte*) print_screen#11 +(byte*) print_screen#12 +(byte*) print_screen#13 +(byte*) print_screen#14 +(byte*) print_screen#15 +(byte*) print_screen#16 +(byte*) print_screen#17 +(byte*) print_screen#18 +(byte*) print_screen#19 +(byte*) print_screen#2 +(byte*) print_screen#20 +(byte*) print_screen#21 +(byte*) print_screen#22 +(byte*) print_screen#23 +(byte*) print_screen#24 +(byte*) print_screen#25 +(byte*) print_screen#26 +(byte*) print_screen#27 +(byte*) print_screen#28 +(byte*) print_screen#29 +(byte*) print_screen#3 +(byte*) print_screen#30 +(byte*) print_screen#31 +(byte*) print_screen#32 +(byte*) print_screen#33 +(byte*) print_screen#4 +(byte*) print_screen#5 +(byte*) print_screen#6 +(byte*) print_screen#7 +(byte*) print_screen#8 +(byte*) print_screen#9 +(void()) print_set_screen((byte*) print_set_screen::screen) +(label) print_set_screen::@return +(byte*) print_set_screen::screen +(byte*) print_set_screen::screen#0 +(byte*) print_set_screen::screen#1 +(void()) print_str_lines((byte*) print_str_lines::str) +(boolean~) print_str_lines::$0 +(boolean~) print_str_lines::$1 +(boolean~) print_str_lines::$2 +(boolean~) print_str_lines::$3 +(label) print_str_lines::@1 +(label) print_str_lines::@11 +(label) print_str_lines::@2 +(label) print_str_lines::@4 +(label) print_str_lines::@5 +(label) print_str_lines::@8 +(label) print_str_lines::@9 +(label) print_str_lines::@return +(byte) print_str_lines::ch +(byte) print_str_lines::ch#0 +(byte) print_str_lines::ch#1 +(byte) print_str_lines::ch#2 +(byte*) print_str_lines::str +(byte*) print_str_lines::str#0 +(byte*) print_str_lines::str#1 +(byte*) print_str_lines::str#2 +(byte*) print_str_lines::str#3 +(byte*) print_str_lines::str#4 +(byte*) print_str_lines::str#5 +(byte*) print_str_lines::str#6 +(byte*) print_str_lines::str#7 +(byte*) print_str_lines::str#8 +(byte*) print_str_lines::str#9 + +OPTIMIZING CONTROL FLOW GRAPH +Inversing boolean not (boolean~) print_str_lines::$2 ← (byte) print_str_lines::ch#0 == (byte) '@' from (boolean~) print_str_lines::$1 ← (byte) print_str_lines::ch#0 != (byte) '@' +Inversing boolean not (boolean~) menu::$31 ← (byte~) menu::$29 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (boolean~) menu::$30 ← (byte~) menu::$29 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Succesful SSA optimization Pass2UnaryNotSimplification +Not aliassing across scopes: print_str_lines::str#4 print_str_lines::str#1 +Not aliassing across scopes: print_char_cursor#41 print_char_cursor#13 +Not aliassing across scopes: print_line_cursor#39 print_line_cursor#12 +Not aliassing across scopes: print_line_cursor#16 print_line_cursor#4 +Not aliassing across scopes: print_char_cursor#18 print_char_cursor#5 +Not aliassing across scopes: print_line_cursor#32 print_line_cursor#30 +Not aliassing across scopes: print_char_cursor#34 print_char_cursor#32 +Not aliassing across scopes: print_screen#8 print_screen#5 +Not aliassing across scopes: print_cls::sc#0 print_screen#8 +Not aliassing across scopes: print_set_screen::screen#1 print_set_screen::screen#0 +Not aliassing across scopes: print_screen#1 print_set_screen::screen#1 +Not aliassing across scopes: keyboard_matrix_read::rowid#1 keyboard_matrix_read::rowid#0 +Not aliassing across scopes: keyboard_key_pressed::key#1 keyboard_key_pressed::key#0 +Not aliassing across scopes: keyboard_matrix_read::rowid#0 keyboard_key_pressed::rowidx#0 +Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#1 +Not aliassing across scopes: keyboard_key_pressed::$2 keyboard_matrix_read::return#4 +Not aliassing across scopes: print_screen#23 print_screen#22 +Not aliassing across scopes: print_line_cursor#41 print_line_cursor#38 +Not aliassing across scopes: print_char_cursor#44 print_char_cursor#40 +Not aliassing across scopes: print_screen#12 print_screen#6 +Not aliassing across scopes: print_line_cursor#23 print_line_cursor#14 +Not aliassing across scopes: print_char_cursor#24 print_char_cursor#15 +Not aliassing across scopes: print_screen#33 print_screen#17 +Not aliassing across scopes: print_line_cursor#52 print_line_cursor#33 +Not aliassing across scopes: print_char_cursor#52 print_char_cursor#35 +Not aliassing across scopes: menu::c#0 COLS#0 +Not aliassing identity: print_screen#24 print_screen#24 +Not aliassing identity: print_line_cursor#42 print_line_cursor#42 +Not aliassing identity: print_char_cursor#45 print_char_cursor#45 +Not aliassing across scopes: print_set_screen::screen#0 menu::SCREEN#0 +Not aliassing across scopes: print_screen#14 print_screen#2 +Not aliassing across scopes: print_line_cursor#25 print_line_cursor#8 +Not aliassing across scopes: print_char_cursor#26 print_char_cursor#9 +Not aliassing across scopes: print_line_cursor#26 print_line_cursor#6 +Not aliassing across scopes: print_char_cursor#27 print_char_cursor#7 +Not aliassing across scopes: print_str_lines::str#1 MENU_TEXT#0 +Not aliassing across scopes: print_char_cursor#28 print_char_cursor#3 +Not aliassing across scopes: print_line_cursor#27 print_line_cursor#2 +Not aliassing across scopes: keyboard_key_pressed::key#0 KEY_SPACE#0 +Not aliassing across scopes: keyboard_key_pressed::return#2 keyboard_key_pressed::return#1 +Not aliassing across scopes: menu::$29 keyboard_key_pressed::return#4 +Not aliassing across scopes: print_screen#16 print_screen#4 +Not aliassing across scopes: print_line_cursor#29 print_line_cursor#10 +Not aliassing across scopes: print_char_cursor#30 print_char_cursor#11 +Alias (byte*) print_screen#0 = (byte*) print_line_cursor#0 (byte*) print_char_cursor#0 (byte*) print_screen#29 (byte*) print_line_cursor#48 (byte*) print_char_cursor#49 (byte*) print_screen#28 (byte*) print_line_cursor#45 (byte*) print_char_cursor#48 (byte*) print_screen#22 (byte*) print_line_cursor#38 (byte*) print_char_cursor#40 +Alias (byte*) print_str_lines::str#2 = (byte*) print_str_lines::str#6 +Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#42 (byte*) print_char_cursor#33 (byte*) print_char_cursor#3 +Alias (byte*) print_line_cursor#17 = (byte*) print_line_cursor#50 (byte*) print_line_cursor#31 (byte*) print_line_cursor#2 +Alias (byte) print_str_lines::ch#0 = (byte) print_str_lines::ch#2 +Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#31 +Alias (byte*) print_str_lines::str#0 = (byte*) print_str_lines::str#8 +Alias (byte*) print_line_cursor#46 = (byte*) print_line_cursor#47 +Alias (byte*) print_line_cursor#30 = (byte*) print_line_cursor#40 +Alias (byte*) print_char_cursor#32 = (byte*) print_char_cursor#43 +Alias (byte*) print_str_lines::str#5 = (byte*) print_str_lines::str#9 (byte*) print_str_lines::str#7 +Alias (byte*) print_line_cursor#1 = (byte*) print_line_cursor#16 +Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#2 +Alias (byte*) print_line_cursor#19 = (byte*) print_line_cursor#3 (byte*~) print_ln::$0 (byte*) print_char_cursor#4 (byte*) print_line_cursor#20 (byte*) print_char_cursor#21 (byte*) print_line_cursor#4 (byte*) print_char_cursor#5 +Alias (byte*) print_line_cursor#21 = (byte*) print_screen#10 (byte*) print_screen#9 (byte*) print_line_cursor#5 (byte*) print_char_cursor#6 (byte*) print_char_cursor#22 (byte*) print_line_cursor#6 (byte*) print_char_cursor#7 +Alias (byte*) print_screen#1 = (byte*) print_line_cursor#7 (byte*) print_char_cursor#8 (byte*) print_screen#11 (byte*) print_line_cursor#22 (byte*) print_char_cursor#23 (byte*) print_screen#2 (byte*) print_line_cursor#8 (byte*) print_char_cursor#9 +Alias (byte) keyboard_matrix_read::return#0 = (byte) keyboard_matrix_read::row_pressed_bits#0 (byte~) keyboard_matrix_read::$0 (byte) keyboard_matrix_read::return#3 (byte) keyboard_matrix_read::return#1 +Alias (byte) keyboard_key_pressed::colidx#0 = (byte~) keyboard_key_pressed::$0 (byte) keyboard_key_pressed::colidx#1 +Alias (byte) keyboard_key_pressed::rowidx#0 = (byte~) keyboard_key_pressed::$1 +Alias (byte) keyboard_matrix_read::return#2 = (byte) keyboard_matrix_read::return#4 +Alias (byte) keyboard_key_pressed::return#0 = (byte~) keyboard_key_pressed::$3 (byte) keyboard_key_pressed::return#3 (byte) keyboard_key_pressed::return#1 +Alias (byte*) print_screen#13 = (byte*) print_screen#17 (byte*) print_screen#18 (byte*) print_screen#4 +Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#33 (byte*) print_line_cursor#34 (byte*) print_line_cursor#24 +Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#35 (byte*) print_char_cursor#36 (byte*) print_char_cursor#25 +Alias (byte*) print_screen#12 = (byte*) print_screen#3 +Alias (byte*) print_line_cursor#23 = (byte*) print_line_cursor#9 +Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#24 +Alias (byte[]) MENU_TEXT#0 = (string~) $8 +Alias (byte*) print_screen#30 = (byte*) print_screen#32 +Alias (byte*) print_line_cursor#49 = (byte*) print_line_cursor#51 +Alias (byte*) print_char_cursor#50 = (byte*) print_char_cursor#51 +Alias (byte*) print_screen#19 = (byte*) print_screen#24 +Alias (byte*) print_line_cursor#35 = (byte*) print_line_cursor#42 +Alias (byte*) print_char_cursor#37 = (byte*) print_char_cursor#45 +Alias (byte*) print_screen#14 = (byte*) print_screen#5 (byte*) print_screen#31 (byte*) print_screen#25 +Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#25 +Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#26 +Alias (byte*) print_line_cursor#12 = (byte*) print_line_cursor#26 +Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#27 +Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#28 +Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#27 +Alias (byte*) print_screen#20 = (byte*) print_screen#27 (byte*) print_screen#21 (byte*) print_screen#26 +Alias (byte*) print_line_cursor#36 = (byte*) print_line_cursor#44 (byte*) print_line_cursor#37 (byte*) print_line_cursor#43 +Alias (byte*) print_char_cursor#38 = (byte*) print_char_cursor#47 (byte*) print_char_cursor#39 (byte*) print_char_cursor#46 +Alias (byte) keyboard_key_pressed::return#2 = (byte) keyboard_key_pressed::return#4 +Alias (byte*) print_screen#15 = (byte*) print_screen#6 +Alias (byte*) print_line_cursor#14 = (byte*) print_line_cursor#28 +Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#29 +Alias (byte*) print_screen#16 = (byte*) print_screen#7 +Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#29 +Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#30 +Succesful SSA optimization Pass2AliasElimination +Not aliassing across scopes: print_str_lines::str#4 print_str_lines::str#1 +Not aliassing across scopes: print_char_cursor#41 print_char_cursor#13 +Not aliassing across scopes: print_line_cursor#39 print_line_cursor#12 +Not aliassing across scopes: print_line_cursor#1 print_line_cursor#19 +Not aliassing across scopes: print_char_cursor#18 print_line_cursor#19 +Not aliassing across scopes: print_line_cursor#32 print_line_cursor#30 +Not aliassing across scopes: print_char_cursor#34 print_char_cursor#32 +Not aliassing across scopes: print_screen#8 print_screen#14 +Not aliassing across scopes: print_cls::sc#0 print_screen#8 +Not aliassing across scopes: print_set_screen::screen#1 print_set_screen::screen#0 +Not aliassing across scopes: print_screen#1 print_set_screen::screen#1 +Not aliassing across scopes: keyboard_matrix_read::rowid#1 keyboard_matrix_read::rowid#0 +Not aliassing across scopes: keyboard_key_pressed::key#1 keyboard_key_pressed::key#0 +Not aliassing across scopes: keyboard_matrix_read::rowid#0 keyboard_key_pressed::rowidx#0 +Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#0 +Not aliassing across scopes: keyboard_key_pressed::$2 keyboard_matrix_read::return#2 +Not aliassing across scopes: print_screen#23 print_screen#0 +Not aliassing across scopes: print_line_cursor#41 print_screen#0 +Not aliassing across scopes: print_char_cursor#44 print_screen#0 +Not aliassing across scopes: print_screen#12 print_screen#15 +Not aliassing across scopes: print_line_cursor#23 print_line_cursor#14 +Not aliassing across scopes: print_char_cursor#10 print_char_cursor#15 +Not aliassing across scopes: print_screen#33 print_screen#13 +Not aliassing across scopes: print_line_cursor#52 print_line_cursor#10 +Not aliassing across scopes: print_char_cursor#52 print_char_cursor#11 +Not aliassing across scopes: menu::c#0 COLS#0 +Not aliassing identity: print_screen#19 print_screen#19 +Not aliassing identity: print_line_cursor#35 print_line_cursor#35 +Not aliassing identity: print_char_cursor#37 print_char_cursor#37 +Not aliassing across scopes: print_set_screen::screen#0 menu::SCREEN#0 +Not aliassing across scopes: print_screen#14 print_screen#1 +Not aliassing across scopes: print_line_cursor#11 print_screen#1 +Not aliassing across scopes: print_char_cursor#12 print_screen#1 +Not aliassing across scopes: print_line_cursor#12 print_line_cursor#21 +Not aliassing across scopes: print_char_cursor#13 print_line_cursor#21 +Not aliassing across scopes: print_str_lines::str#1 MENU_TEXT#0 +Not aliassing across scopes: print_char_cursor#14 print_char_cursor#19 +Not aliassing across scopes: print_line_cursor#13 print_line_cursor#17 +Not aliassing across scopes: keyboard_key_pressed::key#0 KEY_SPACE#0 +Not aliassing across scopes: keyboard_key_pressed::return#2 keyboard_key_pressed::return#0 +Not aliassing across scopes: menu::$29 keyboard_key_pressed::return#2 +Not aliassing across scopes: print_screen#16 print_screen#13 +Not aliassing across scopes: print_line_cursor#15 print_line_cursor#10 +Not aliassing across scopes: print_char_cursor#16 print_char_cursor#11 +Alias (byte) print_str_lines::ch#0 = (byte) print_str_lines::ch#1 +Alias (byte*) print_str_lines::str#0 = (byte*) print_str_lines::str#5 +Alias (byte*) print_line_cursor#30 = (byte*) print_line_cursor#46 +Alias (byte*) print_screen#15 = (byte*) print_screen#20 +Alias (byte*) print_line_cursor#14 = (byte*) print_line_cursor#36 +Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#38 +Succesful SSA optimization Pass2AliasElimination +Not aliassing across scopes: print_str_lines::str#4 print_str_lines::str#1 +Not aliassing across scopes: print_char_cursor#41 print_char_cursor#13 +Not aliassing across scopes: print_line_cursor#39 print_line_cursor#12 +Not aliassing across scopes: print_line_cursor#1 print_line_cursor#19 +Not aliassing across scopes: print_char_cursor#18 print_line_cursor#19 +Not aliassing across scopes: print_line_cursor#32 print_line_cursor#30 +Not aliassing across scopes: print_char_cursor#34 print_char_cursor#32 +Not aliassing across scopes: print_screen#8 print_screen#14 +Not aliassing across scopes: print_cls::sc#0 print_screen#8 +Not aliassing across scopes: print_set_screen::screen#1 print_set_screen::screen#0 +Not aliassing across scopes: print_screen#1 print_set_screen::screen#1 +Not aliassing across scopes: keyboard_matrix_read::rowid#1 keyboard_matrix_read::rowid#0 +Not aliassing across scopes: keyboard_key_pressed::key#1 keyboard_key_pressed::key#0 +Not aliassing across scopes: keyboard_matrix_read::rowid#0 keyboard_key_pressed::rowidx#0 +Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#0 +Not aliassing across scopes: keyboard_key_pressed::$2 keyboard_matrix_read::return#2 +Not aliassing across scopes: print_screen#23 print_screen#0 +Not aliassing across scopes: print_line_cursor#41 print_screen#0 +Not aliassing across scopes: print_char_cursor#44 print_screen#0 +Not aliassing across scopes: print_screen#12 print_screen#15 +Not aliassing across scopes: print_line_cursor#23 print_line_cursor#14 +Not aliassing across scopes: print_char_cursor#10 print_char_cursor#15 +Not aliassing across scopes: print_screen#33 print_screen#13 +Not aliassing across scopes: print_line_cursor#52 print_line_cursor#10 +Not aliassing across scopes: print_char_cursor#52 print_char_cursor#11 +Not aliassing across scopes: menu::c#0 COLS#0 +Not aliassing identity: print_screen#19 print_screen#19 +Not aliassing identity: print_line_cursor#35 print_line_cursor#35 +Not aliassing identity: print_char_cursor#37 print_char_cursor#37 +Not aliassing across scopes: print_set_screen::screen#0 menu::SCREEN#0 +Not aliassing across scopes: print_screen#14 print_screen#1 +Not aliassing across scopes: print_line_cursor#11 print_screen#1 +Not aliassing across scopes: print_char_cursor#12 print_screen#1 +Not aliassing across scopes: print_line_cursor#12 print_line_cursor#21 +Not aliassing across scopes: print_char_cursor#13 print_line_cursor#21 +Not aliassing across scopes: print_str_lines::str#1 MENU_TEXT#0 +Not aliassing across scopes: print_char_cursor#14 print_char_cursor#19 +Not aliassing across scopes: print_line_cursor#13 print_line_cursor#17 +Not aliassing across scopes: keyboard_key_pressed::key#0 KEY_SPACE#0 +Not aliassing across scopes: keyboard_key_pressed::return#2 keyboard_key_pressed::return#0 +Not aliassing across scopes: menu::$29 keyboard_key_pressed::return#2 +Not aliassing across scopes: print_screen#16 print_screen#13 +Not aliassing across scopes: print_line_cursor#15 print_line_cursor#10 +Not aliassing across scopes: print_char_cursor#16 print_char_cursor#11 +Self Phi Eliminated (byte*) print_line_cursor#30 +Self Phi Eliminated (byte*) print_char_cursor#20 +Self Phi Eliminated (byte*) print_line_cursor#21 +Self Phi Eliminated (byte*) print_screen#30 +Self Phi Eliminated (byte*) print_line_cursor#49 +Self Phi Eliminated (byte*) print_char_cursor#50 +Self Phi Eliminated (byte*) print_screen#19 +Self Phi Eliminated (byte*) print_line_cursor#35 +Self Phi Eliminated (byte*) print_char_cursor#37 +Self Phi Eliminated (byte*) print_screen#15 +Self Phi Eliminated (byte*) print_line_cursor#14 +Self Phi Eliminated (byte*) print_char_cursor#15 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) print_str_lines::str#4 (byte*) print_str_lines::str#1 +Redundant Phi (byte*) print_char_cursor#41 (byte*) print_char_cursor#13 +Redundant Phi (byte*) print_line_cursor#39 (byte*) print_line_cursor#12 +Redundant Phi (byte*) print_line_cursor#30 (byte*) print_line_cursor#17 +Redundant Phi (byte*) print_line_cursor#1 (byte*) print_line_cursor#19 +Redundant Phi (byte*) print_char_cursor#18 (byte*) print_line_cursor#19 +Redundant Phi (byte*) print_line_cursor#32 (byte*) print_line_cursor#30 +Redundant Phi (byte*) print_char_cursor#34 (byte*) print_char_cursor#32 +Redundant Phi (byte*) print_char_cursor#20 (byte*) print_char_cursor#34 +Redundant Phi (byte*) print_screen#8 (byte*) print_screen#14 +Redundant Phi (byte*) print_line_cursor#21 (byte*) print_screen#8 +Redundant Phi (byte*) print_set_screen::screen#1 (byte*) print_set_screen::screen#0 +Redundant Phi (byte) keyboard_matrix_read::rowid#1 (byte) keyboard_matrix_read::rowid#0 +Redundant Phi (byte) keyboard_key_pressed::key#1 (byte) keyboard_key_pressed::key#0 +Redundant Phi (byte*) print_screen#23 (byte*) print_screen#0 +Redundant Phi (byte*) print_line_cursor#41 (byte*) print_screen#0 +Redundant Phi (byte*) print_char_cursor#44 (byte*) print_screen#0 +Redundant Phi (byte*) print_screen#12 (byte*) print_screen#15 +Redundant Phi (byte*) print_line_cursor#23 (byte*) print_line_cursor#14 +Redundant Phi (byte*) print_char_cursor#10 (byte*) print_char_cursor#15 +Redundant Phi (byte*) print_screen#33 (byte*) print_screen#13 +Redundant Phi (byte*) print_line_cursor#52 (byte*) print_line_cursor#10 +Redundant Phi (byte*) print_char_cursor#52 (byte*) print_char_cursor#11 +Redundant Phi (byte*) print_screen#30 (byte*) print_screen#33 +Redundant Phi (byte*) print_line_cursor#49 (byte*) print_line_cursor#52 +Redundant Phi (byte*) print_char_cursor#50 (byte*) print_char_cursor#52 +Redundant Phi (byte*) print_screen#19 (byte*) print_screen#30 +Redundant Phi (byte*) print_line_cursor#35 (byte*) print_line_cursor#49 +Redundant Phi (byte*) print_char_cursor#37 (byte*) print_char_cursor#50 +Redundant Phi (byte*) print_screen#14 (byte*) print_screen#1 +Redundant Phi (byte*) print_line_cursor#11 (byte*) print_screen#1 +Redundant Phi (byte*) print_char_cursor#12 (byte*) print_screen#1 +Redundant Phi (byte*) print_line_cursor#12 (byte*) print_line_cursor#21 +Redundant Phi (byte*) print_char_cursor#13 (byte*) print_line_cursor#21 +Redundant Phi (byte*) print_char_cursor#14 (byte*) print_char_cursor#19 +Redundant Phi (byte*) print_line_cursor#13 (byte*) print_line_cursor#17 +Redundant Phi (byte*) print_screen#15 (byte*) print_screen#14 +Redundant Phi (byte*) print_line_cursor#14 (byte*) print_line_cursor#13 +Redundant Phi (byte*) print_char_cursor#15 (byte*) print_char_cursor#14 +Redundant Phi (byte*) print_screen#16 (byte*) print_screen#13 +Redundant Phi (byte*) print_line_cursor#15 (byte*) print_line_cursor#10 +Redundant Phi (byte*) print_char_cursor#16 (byte*) print_char_cursor#11 +Succesful SSA optimization Pass2RedundantPhiElimination +Simple Condition (boolean~) print_str_lines::$0 if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@2 +Simple Condition (boolean~) print_str_lines::$2 if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 +Simple Condition (boolean~) print_str_lines::$3 if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 +Simple Condition (boolean~) print_ln::$1 if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 +Simple Condition (boolean~) print_cls::$1 if((byte*) print_cls::sc#1!=(byte*~) print_cls::$0) goto print_cls::@1 +Simple Condition (boolean~) menu::$23 if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 +Simple Condition (boolean~) menu::$25 if((byte*) menu::c#1!=(byte*~) menu::$24) goto menu::@2 +Simple Condition (boolean~) menu::$31 if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@6 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) BORDERCOL#0 = ((byte*))53280 +Constant (const byte*) BGCOL#0 = ((byte*))53281 +Constant (const byte*) VIC_CONTROL#0 = ((byte*))53265 +Constant (const byte) VIC_DEN#0 = 16 +Constant (const byte) VIC_RSEL#0 = 8 +Constant (const byte*) VIC_CONTROL2#0 = ((byte*))53270 +Constant (const byte) VIC_CSEL#0 = 8 +Constant (const byte*) VIC_MEMORY#0 = ((byte*))53272 +Constant (const byte*) COLS#0 = ((byte*))55296 +Constant (const byte*) CIA1_PORT_A#0 = ((byte*))56320 +Constant (const byte*) CIA1_PORT_B#0 = ((byte*))56321 +Constant (const byte*) CIA2_PORT_A#0 = ((byte*))56576 +Constant (const byte*) CIA2_PORT_A_DDR#0 = ((byte*))56578 +Constant (const byte) LIGHT_GREEN#0 = 13 +Constant (const byte*) DTV_FEATURE#0 = ((byte*))53311 +Constant (const byte) DTV_FEATURE_ENABLE#0 = 1 +Constant (const byte*) DTV_CONTROL#0 = ((byte*))53308 +Constant (const byte*) DTV_PALETTE#0 = ((byte*))53760 +Constant (const byte[16]) DTV_PALETTE_DEFAULT#0 = { 0, 15, 54, 190, 88, 219, 134, 255, 41, 38, 59, 5, 7, 223, 154, 10 } +Constant (const byte*) DTV_COLOR_BANK_LO#0 = ((byte*))53302 +Constant (const byte*) DTV_COLOR_BANK_HI#0 = ((byte*))53303 +Constant (const dword) DTV_COLOR_BANK_DEFAULT#0 = 120832 +Constant (const byte*) DTV_GRAPHICS_VIC_BANK#0 = ((byte*))53309 +Constant (const byte*) print_screen#0 = ((byte*))1024 +Constant (const byte) KEY_SPACE#0 = 60 +Constant (const byte[8]) keyboard_matrix_row_bitmask#0 = { 254, 253, 251, 247, 239, 223, 191, 127 } +Constant (const byte[]) keyboard_matrix_col_bitmask#0 = { 1, 2, 4, 8, 16, 32, 64, 128 } +Constant (const string) $0 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @" +Constant (const byte*) menu::SCREEN#0 = ((byte*))32768 +Constant (const byte*) menu::CHARSET#0 = ((byte*))38912 +Constant (const byte) menu::i#0 = 0 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) $1 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @" +Constant (const dword) menu::$0 = ((dword))menu::CHARSET#0 +Constant (const dword) menu::$3 = DTV_COLOR_BANK_DEFAULT#0/1024 +Constant (const dword) menu::$6 = DTV_COLOR_BANK_DEFAULT#0/1024 +Constant (const word) menu::$9 = ((word))menu::CHARSET#0 +Constant (const byte) menu::$13 = VIC_DEN#0|VIC_RSEL#0 +Constant (const word) menu::$15 = ((word))menu::SCREEN#0 +Constant (const word) menu::$18 = ((word))menu::CHARSET#0 +Constant (const byte*) menu::c#0 = COLS#0 +Constant (const byte*) menu::$24 = COLS#0+1000 +Constant (const byte*) print_set_screen::screen#0 = menu::SCREEN#0 +Constant (const byte) keyboard_key_pressed::key#0 = KEY_SPACE#0 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) print_screen#1 = print_set_screen::screen#0 +Constant (const byte) keyboard_key_pressed::colidx#0 = keyboard_key_pressed::key#0&7 +Constant (const byte) keyboard_key_pressed::rowidx#0 = keyboard_key_pressed::key#0>>3 +Constant (const string) $2 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @" +Constant (const dword) menu::$1 = menu::$0/65536 +Constant (const word) menu::$4 = ((word))menu::$3 +Constant (const word) menu::$7 = ((word))menu::$6 +Constant (const word/signed dword/dword) menu::$10 = menu::$9/16384 +Constant (const byte/word/dword) menu::$14 = menu::$13|3 +Constant (const word) menu::$16 = menu::$15&16383 +Constant (const word) menu::$19 = menu::$18&16383 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) print_cls::sc#0 = print_screen#1 +Constant (const byte*) print_cls::$0 = print_screen#1+1000 +Constant (const byte) keyboard_matrix_read::rowid#0 = keyboard_key_pressed::rowidx#0 +Constant (const string) $3 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @" +Constant (const byte) menu::$2 = ((byte))menu::$1 +Constant (const byte) menu::$5 = menu::$7 +Constant (const byte) menu::$11 = ((byte))menu::$10 +Constant (const word/signed dword/dword) menu::$17 = menu::$16/64 +Constant (const word/signed dword/dword) menu::$20 = menu::$19/1024 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) $4 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @"+" hicol 0 mod 00 mod 00 bgcol0 00 @" +Constant (const byte/word/dword) menu::$12 = 3^menu::$11 +Constant (const word/dword) menu::$21 = menu::$17|menu::$20 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) $5 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @"+" hicol 0 mod 00 mod 00 bgcol0 00 @"+" line 0 bgcol1 00 @" +Constant (const byte) menu::$22 = ((byte))menu::$21 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) $6 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @"+" hicol 0 mod 00 mod 00 bgcol0 00 @"+" line 0 bgcol1 00 @"+" colof 0 borof 0 bgcol2 00 @" +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) $7 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @"+" hicol 0 mod 00 mod 00 bgcol0 00 @"+" line 0 bgcol1 00 @"+" colof 0 borof 0 bgcol2 00 @"+" chunk 0 overs 0 bgcol3 00 @" +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) MENU_TEXT#0 = " DTV GfxExplorer PRESET 8bpp pixel cell @"+" CONTROL PLANE A PLANE B VIC II @"+" bmm 0 patt p1 patt p2 screen s3 @"+" mcm 0 start 00 start 00 gfx g4 @"+" ecm 0 step 00 step 00 colors c5 @"+" hicol 0 mod 00 mod 00 bgcol0 00 @"+" line 0 bgcol1 00 @"+" colof 0 borof 0 bgcol2 00 @"+" chunk 0 overs 0 bgcol3 00 @"+"@" +Succesful SSA optimization Pass2ConstantIdentification +Constant (const string) print_str_lines::str#1 = MENU_TEXT#0 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(keyboard_matrix_row_bitmask#0+keyboard_matrix_read::rowid#0) +Consolidated array index constant in *(keyboard_matrix_col_bitmask#0+keyboard_key_pressed::colidx#0) +Succesful SSA optimization Pass2ConstantAdditionElimination +Eliminating unused variable - keeping the phi block (byte*) print_screen#13 +Eliminating unused variable - keeping the phi block (byte*) print_line_cursor#10 +Eliminating unused variable - keeping the phi block (byte*) print_char_cursor#11 +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) $0 +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 +Succesful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte*) print_screen#0 +Succesful SSA optimization PassNEliminateUnusedVars +Culled Empty Block (label) @1 +Culled Empty Block (label) print_str_lines::@2 +Culled Empty Block (label) print_str_lines::@11 +Culled Empty Block (label) print_ln::@2 +Culled Empty Block (label) print_cls::@2 +Culled Empty Block (label) @15 +Culled Empty Block (label) main::@7 +Culled Empty Block (label) @20 +Culled Empty Block (label) menu::@7 +Culled Empty Block (label) menu::@16 +Culled Empty Block (label) menu::@6 +Culled Empty Block (label) @22 +Succesful SSA optimization Pass2CullEmptyBlocks +Not aliassing across scopes: print_line_cursor#18 print_line_cursor#17 +Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#0 +Not aliassing across scopes: keyboard_key_pressed::$2 keyboard_matrix_read::return#2 +Not aliassing across scopes: keyboard_key_pressed::return#2 keyboard_key_pressed::return#0 +Not aliassing across scopes: menu::$29 keyboard_key_pressed::return#2 +Not aliassing across scopes: print_line_cursor#18 print_line_cursor#17 +Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#0 +Not aliassing across scopes: keyboard_key_pressed::$2 keyboard_matrix_read::return#2 +Not aliassing across scopes: keyboard_key_pressed::return#2 keyboard_key_pressed::return#0 +Not aliassing across scopes: menu::$29 keyboard_key_pressed::return#2 +OPTIMIZING CONTROL FLOW GRAPH +Inlining constant with var siblings (const string) print_str_lines::str#1 +Inlining constant with var siblings (const string) print_str_lines::str#1 +Inlining constant with var siblings (const string) print_str_lines::str#1 +Inlining constant with var siblings (const byte*) print_cls::sc#0 +Inlining constant with var siblings (const byte*) print_cls::sc#0 +Inlining constant with var siblings (const byte) menu::i#0 +Inlining constant with var siblings (const byte) menu::i#0 +Inlining constant with var siblings (const byte*) menu::c#0 +Inlining constant with var siblings (const byte*) menu::c#0 +Constant inlined menu::$9 = ((word))(const byte*) menu::CHARSET#0 +Constant inlined print_cls::$0 = (const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000 +Constant inlined menu::$7 = ((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$8 = >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$5 = <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$6 = (const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::c#0 = (const byte*) COLS#0 +Constant inlined print_screen#1 = (const byte*) menu::SCREEN#0 +Constant inlined menu::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined keyboard_matrix_read::rowid#0 = (const byte) keyboard_key_pressed::rowidx#0 +Constant inlined menu::$16 = ((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383 +Constant inlined menu::$17 = ((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64 +Constant inlined menu::$14 = (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined menu::$15 = ((word))(const byte*) menu::SCREEN#0 +Constant inlined menu::$18 = ((word))(const byte*) menu::CHARSET#0 +Constant inlined print_set_screen::screen#0 = (const byte*) menu::SCREEN#0 +Constant inlined menu::$19 = ((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383 +Constant inlined menu::$3 = (const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$4 = ((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$1 = ((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 +Constant inlined menu::$2 = ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 +Constant inlined menu::$12 = (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 +Constant inlined menu::$0 = ((dword))(const byte*) menu::CHARSET#0 +Constant inlined menu::$13 = (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 +Constant inlined menu::$10 = ((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 +Constant inlined menu::$11 = ((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 +Constant inlined keyboard_key_pressed::key#0 = (const byte) KEY_SPACE#0 +Constant inlined print_cls::sc#0 = (const byte*) menu::SCREEN#0 +Constant inlined print_str_lines::str#1 = (const string) MENU_TEXT#0 +Constant inlined menu::$20 = ((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$24 = (const byte*) COLS#0+(word/signed word/dword/signed dword) 1000 +Constant inlined menu::$21 = ((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 +Constant inlined menu::$22 = ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 +Succesful SSA optimization Pass2ConstantInlining +Block Sequence Planned @begin @21 @end main main::@1 main::@return main::@2 menu menu::@1 menu::@2 menu::@8 menu::@14 menu::@15 menu::@3 menu::@return menu::@4 menu::@17 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return print_str_lines print_str_lines::@1 print_str_lines::@return print_str_lines::@4 print_str_lines::@8 print_str_lines::@5 print_str_lines::@9 print_ln print_ln::@1 print_ln::@return print_cls print_cls::@1 print_cls::@return print_set_screen print_set_screen::@return +Added new block during phi lifting menu::@18(between menu::@1 and menu::@1) +Added new block during phi lifting menu::@19(between menu::@2 and menu::@2) +Added new block during phi lifting print_str_lines::@12(between print_str_lines::@1 and print_str_lines::@4) +Added new block during phi lifting print_str_lines::@13(between print_str_lines::@5 and print_str_lines::@4) +Added new block during phi lifting print_str_lines::@14(between print_str_lines::@4 and print_str_lines::@5) +Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1) +Added new block during phi lifting print_cls::@3(between print_cls::@1 and print_cls::@1) +Block Sequence Planned @begin @21 @end main main::@1 main::@return main::@2 menu menu::@1 menu::@2 menu::@8 menu::@14 menu::@15 menu::@3 menu::@return menu::@4 menu::@17 menu::@19 menu::@18 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return print_str_lines print_str_lines::@1 print_str_lines::@return print_str_lines::@12 print_str_lines::@4 print_str_lines::@8 print_str_lines::@5 print_str_lines::@9 print_str_lines::@13 print_str_lines::@14 print_ln print_ln::@1 print_ln::@return print_ln::@3 print_cls print_cls::@1 print_cls::@return print_cls::@3 print_set_screen print_set_screen::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @21 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of menu::@14 +Adding NOP phi() at start of menu::@15 +Adding NOP phi() at start of menu::@4 +Adding NOP phi() at start of keyboard_key_pressed +Adding NOP phi() at start of print_str_lines +Adding NOP phi() at start of print_str_lines::@9 +Adding NOP phi() at start of print_cls +Adding NOP phi() at start of print_set_screen +CALL GRAPH +Calls in [] to main:2 +Calls in [main] to menu:9 +Calls in [menu] to print_set_screen:29 print_cls:31 print_str_lines:33 keyboard_key_pressed:37 +Calls in [keyboard_key_pressed] to keyboard_matrix_read:44 +Calls in [print_str_lines] to print_ln:68 + +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Created 10 initial phi equivalence classes +Coalesced [41] menu::c#3 ← menu::c#1 +Coalesced [42] menu::i#3 ← menu::i#1 +Coalesced [56] print_str_lines::str#11 ← print_str_lines::str#2 +Coalesced [57] print_char_cursor#54 ← print_char_cursor#19 +Coalesced [64] print_char_cursor#57 ← print_char_cursor#1 +Coalesced [69] print_str_lines::str#10 ← print_str_lines::str#0 +Not coalescing [70] print_char_cursor#53 ← print_line_cursor#19 +Coalesced [71] print_line_cursor#53 ← print_line_cursor#19 +Coalesced (already) [72] print_str_lines::str#12 ← print_str_lines::str#0 +Coalesced [73] print_char_cursor#55 ← print_char_cursor#32 +Coalesced (already) [74] print_char_cursor#56 ← print_char_cursor#17 +Coalesced [75] print_line_cursor#54 ← print_line_cursor#17 +Coalesced (already) [80] print_line_cursor#55 ← print_line_cursor#19 +Coalesced [87] print_cls::sc#3 ← print_cls::sc#1 +Coalesced down to 6 phi equivalence classes +Culled Empty Block (label) menu::@19 +Culled Empty Block (label) menu::@18 +Culled Empty Block (label) print_str_lines::@12 +Culled Empty Block (label) print_str_lines::@13 +Culled Empty Block (label) print_str_lines::@14 +Culled Empty Block (label) print_ln::@3 +Culled Empty Block (label) print_cls::@3 +Block Sequence Planned @begin @21 @end main main::@1 main::@return main::@2 menu menu::@1 menu::@2 menu::@8 menu::@14 menu::@15 menu::@3 menu::@return menu::@4 menu::@17 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return print_str_lines print_str_lines::@1 print_str_lines::@return print_str_lines::@4 print_str_lines::@8 print_str_lines::@5 print_str_lines::@9 print_ln print_ln::@1 print_ln::@return print_cls print_cls::@1 print_cls::@return print_set_screen print_set_screen::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @21 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of menu::@14 +Adding NOP phi() at start of menu::@15 +Adding NOP phi() at start of menu::@4 +Adding NOP phi() at start of keyboard_key_pressed +Adding NOP phi() at start of print_str_lines +Adding NOP phi() at start of print_str_lines::@9 +Adding NOP phi() at start of print_ln +Adding NOP phi() at start of print_cls +Adding NOP phi() at start of print_set_screen +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@21 +@21: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main param-assignment [ ] ( ) + to:@end +@end: scope:[] from @21 + [3] phi() [ ] ( ) +main: scope:[main] from @21 + asm { sei } + [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@2 + [6] if(true) goto main::@2 [ ] ( main:2 [ ] ) + to:main::@return +main::@return: scope:[main] from main::@1 + [7] return [ ] ( main:2 [ ] ) + to:@return +main::@2: scope:[main] from main::@1 + [8] phi() [ ] ( main:2 [ ] ) + [9] call menu param-assignment [ ] ( main:2 [ ] ) + to:main::@1 +menu: scope:[menu] from main::@2 + [10] *((const byte*) DTV_GRAPHICS_VIC_BANK#0) ← ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 [ ] ( main:2::menu:9 [ ] ) + [11] *((const byte*) DTV_COLOR_BANK_LO#0) ← <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) + [12] *((const byte*) DTV_COLOR_BANK_HI#0) ← >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) + [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) + [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) + [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) + [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) + [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) + to:menu::@1 +menu::@1: scope:[menu] from menu menu::@1 + [19] (byte) menu::i#2 ← phi( menu/(byte/signed byte/word/signed word/dword/signed dword) 0 menu::@1/(byte) menu::i#1 ) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) + [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) + [21] (byte) menu::i#1 ← ++ (byte) menu::i#2 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) + [22] if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) + to:menu::@2 +menu::@2: scope:[menu] from menu::@1 menu::@2 + [23] (byte*) menu::c#2 ← phi( menu::@2/(byte*) menu::c#1 menu::@1/(const byte*) COLS#0 ) [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) + [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) + [25] (byte*) menu::c#1 ← ++ (byte*) menu::c#2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) + [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) + to:menu::@8 +menu::@8: scope:[menu] from menu::@2 + [27] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [28] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) + [29] call print_set_screen param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@14 +menu::@14: scope:[menu] from menu::@8 + [30] phi() [ ] ( main:2::menu:9 [ ] ) + [31] call print_cls param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@15 +menu::@15: scope:[menu] from menu::@14 + [32] phi() [ ] ( main:2::menu:9 [ ] ) + [33] call print_str_lines param-assignment [ ] ( main:2::menu:9 [ ] ) + to:menu::@3 +menu::@3: scope:[menu] from menu::@15 menu::@17 + [34] if(true) goto menu::@4 [ ] ( main:2::menu:9 [ ] ) + to:menu::@return +menu::@return: scope:[menu] from menu::@17 menu::@3 + [35] return [ ] ( main:2::menu:9 [ ] ) + to:@return +menu::@4: scope:[menu] from menu::@3 + [36] phi() [ ] ( main:2::menu:9 [ ] ) + [37] call keyboard_key_pressed param-assignment [ keyboard_key_pressed::return#0 ] ( main:2::menu:9 [ keyboard_key_pressed::return#0 ] ) + [38] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0 [ keyboard_key_pressed::return#2 ] ( main:2::menu:9 [ keyboard_key_pressed::return#2 ] ) + to:menu::@17 +menu::@17: scope:[menu] from menu::@4 + [39] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2 [ menu::$29 ] ( main:2::menu:9 [ menu::$29 ] ) + [40] if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@3 [ ] ( main:2::menu:9 [ ] ) + to:menu::@return +keyboard_key_pressed: scope:[keyboard_key_pressed] from menu::@4 + [41] phi() [ ] ( main:2::menu:9::keyboard_key_pressed:37 [ ] ) + [42] call keyboard_matrix_read param-assignment [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#0 ] ) + [43] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0 [ keyboard_matrix_read::return#2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#2 ] ) + to:keyboard_key_pressed::@2 +keyboard_key_pressed::@2: scope:[keyboard_key_pressed] from keyboard_key_pressed + [44] (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#2 [ keyboard_key_pressed::$2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::$2 ] ) + [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + to:keyboard_key_pressed::@return +keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_pressed::@2 + [46] return [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + to:@return +keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed + [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) + [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + to:keyboard_matrix_read::@return +keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read + [49] return [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + to:@return +print_str_lines: scope:[print_str_lines] from menu::@15 + [50] phi() [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + to:print_str_lines::@1 +print_str_lines::@1: scope:[print_str_lines] from print_str_lines print_str_lines::@9 + [51] (byte*) print_line_cursor#17 ← phi( print_str_lines/(const byte*) menu::SCREEN#0 print_str_lines::@9/(byte*) print_line_cursor#19 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [51] (byte*) print_char_cursor#19 ← phi( print_str_lines/(const byte*) menu::SCREEN#0 print_str_lines::@9/(byte*~) print_char_cursor#53 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [51] (byte*) print_str_lines::str#2 ← phi( print_str_lines/(const string) MENU_TEXT#0 print_str_lines::@9/(byte*) print_str_lines::str#0 ) [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) + to:print_str_lines::@return +print_str_lines::@return: scope:[print_str_lines] from print_str_lines::@1 + [53] return [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + to:@return +print_str_lines::@4: scope:[print_str_lines] from print_str_lines::@1 print_str_lines::@5 + [54] (byte*) print_char_cursor#17 ← phi( print_str_lines::@1/(byte*) print_char_cursor#19 print_str_lines::@5/(byte*) print_char_cursor#32 ) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ) + [54] (byte*) print_str_lines::str#3 ← phi( print_str_lines::@1/(byte*) print_str_lines::str#2 print_str_lines::@5/(byte*) print_str_lines::str#0 ) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 ] ) + [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) + [56] (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + [57] if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + to:print_str_lines::@8 +print_str_lines::@8: scope:[print_str_lines] from print_str_lines::@4 + [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) + [59] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ) + to:print_str_lines::@5 +print_str_lines::@5: scope:[print_str_lines] from print_str_lines::@4 print_str_lines::@8 + [60] (byte*) print_char_cursor#32 ← phi( print_str_lines::@4/(byte*) print_char_cursor#17 print_str_lines::@8/(byte*) print_char_cursor#1 ) [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 print_str_lines::ch#0 ] ) + [61] if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) + to:print_str_lines::@9 +print_str_lines::@9: scope:[print_str_lines] from print_str_lines::@5 + [62] phi() [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) + [63] call print_ln param-assignment [ print_str_lines::str#0 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_line_cursor#19 ] ) + [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) + to:print_str_lines::@1 +print_ln: scope:[print_ln] from print_str_lines::@9 + [65] phi() [ print_line_cursor#17 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#17 print_char_cursor#32 ] ) + to:print_ln::@1 +print_ln::@1: scope:[print_ln] from print_ln print_ln::@1 + [66] (byte*) print_line_cursor#18 ← phi( print_ln/(byte*) print_line_cursor#17 print_ln::@1/(byte*) print_line_cursor#19 ) [ print_char_cursor#32 print_line_cursor#18 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_char_cursor#32 print_line_cursor#18 ] ) + [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) + [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) + to:print_ln::@return +print_ln::@return: scope:[print_ln] from print_ln::@1 + [69] return [ print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 ] ) + to:@return +print_cls: scope:[print_cls] from menu::@14 + [70] phi() [ ] ( main:2::menu:9::print_cls:31 [ ] ) + to:print_cls::@1 +print_cls::@1: scope:[print_cls] from print_cls print_cls::@1 + [71] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) menu::SCREEN#0 print_cls::@1/(byte*) print_cls::sc#1 ) [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) + [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) + [73] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) + [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) + to:print_cls::@return +print_cls::@return: scope:[print_cls] from print_cls::@1 + [75] return [ ] ( main:2::menu:9::print_cls:31 [ ] ) + to:@return +print_set_screen: scope:[print_set_screen] from menu::@8 + [76] phi() [ ] ( main:2::menu:9::print_set_screen:29 [ ] ) + to:print_set_screen::@return +print_set_screen::@return: scope:[print_set_screen] from print_set_screen + [77] return [ ] ( main:2::menu:9::print_set_screen:29 [ ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@21 dominated by @begin @21 +@end dominated by @end @begin @21 +main dominated by main @begin @21 +main::@1 dominated by main main::@1 @begin @21 +main::@return dominated by main::@return main main::@1 @begin @21 +main::@2 dominated by main main::@1 main::@2 @begin @21 +menu dominated by main main::@1 main::@2 @begin menu @21 +menu::@1 dominated by main main::@1 main::@2 @begin menu::@1 menu @21 +menu::@2 dominated by main main::@1 main::@2 @begin menu::@1 menu::@2 menu @21 +menu::@8 dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu @21 +menu::@14 dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu @21 menu::@14 +menu::@15 dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu menu::@15 @21 menu::@14 +menu::@3 dominated by main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@1 menu::@2 menu menu::@15 @21 menu::@14 +menu::@return dominated by main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@1 menu::@return menu::@2 menu menu::@15 @21 menu::@14 +menu::@4 dominated by main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu menu::@15 @21 menu::@14 +menu::@17 dominated by main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu menu::@17 menu::@15 @21 menu::@14 +keyboard_key_pressed dominated by main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu keyboard_key_pressed menu::@15 @21 menu::@14 +keyboard_key_pressed::@2 dominated by main main::@1 main::@2 keyboard_key_pressed::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu keyboard_key_pressed menu::@15 @21 menu::@14 +keyboard_key_pressed::@return dominated by main keyboard_key_pressed::@return main::@1 main::@2 keyboard_key_pressed::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu keyboard_key_pressed menu::@15 @21 menu::@14 +keyboard_matrix_read dominated by keyboard_matrix_read main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu keyboard_key_pressed menu::@15 @21 menu::@14 +keyboard_matrix_read::@return dominated by keyboard_matrix_read main main::@1 main::@2 menu::@8 @begin menu::@3 menu::@4 menu::@1 menu::@2 menu keyboard_matrix_read::@return keyboard_key_pressed menu::@15 @21 menu::@14 +print_str_lines dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 menu menu::@15 @21 menu::@14 +print_str_lines::@1 dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 print_str_lines::@1 menu menu::@15 @21 menu::@14 +print_str_lines::@return dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 print_str_lines::@1 menu print_str_lines::@return menu::@15 @21 menu::@14 +print_str_lines::@4 dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu menu::@15 @21 menu::@14 +print_str_lines::@8 dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@8 menu::@15 @21 menu::@14 +print_str_lines::@5 dominated by main main::@1 main::@2 print_str_lines menu::@8 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@5 menu::@15 @21 menu::@14 +print_str_lines::@9 dominated by main main::@1 main::@2 print_str_lines menu::@8 print_str_lines::@9 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@5 menu::@15 @21 menu::@14 +print_ln dominated by main main::@1 main::@2 print_str_lines menu::@8 print_str_lines::@9 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@5 print_ln menu::@15 @21 menu::@14 +print_ln::@1 dominated by print_ln::@1 main main::@1 main::@2 print_str_lines menu::@8 print_str_lines::@9 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@5 print_ln menu::@15 @21 menu::@14 +print_ln::@return dominated by print_ln::@1 main print_ln::@return main::@1 main::@2 print_str_lines menu::@8 print_str_lines::@9 @begin menu::@1 menu::@2 print_str_lines::@1 print_str_lines::@4 menu print_str_lines::@5 print_ln menu::@15 @21 menu::@14 +print_cls dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu print_cls @21 menu::@14 +print_cls::@1 dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 print_cls::@1 menu print_cls @21 menu::@14 +print_cls::@return dominated by main main::@1 print_cls::@return main::@2 menu::@8 @begin menu::@1 menu::@2 print_cls::@1 menu print_cls @21 menu::@14 +print_set_screen dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu print_set_screen @21 +print_set_screen::@return dominated by main main::@1 main::@2 menu::@8 @begin menu::@1 menu::@2 menu print_set_screen::@return print_set_screen @21 + +NATURAL LOOPS +Found back edge: Loop head: main::@1 tails: main::@2 blocks: null +Found back edge: Loop head: menu::@1 tails: menu::@1 blocks: null +Found back edge: Loop head: menu::@2 tails: menu::@2 blocks: null +Found back edge: Loop head: menu::@3 tails: menu::@17 blocks: null +Found back edge: Loop head: print_str_lines::@4 tails: print_str_lines::@5 blocks: null +Found back edge: Loop head: print_str_lines::@1 tails: print_str_lines::@9 blocks: null +Found back edge: Loop head: print_ln::@1 tails: print_ln::@1 blocks: null +Found back edge: Loop head: print_cls::@1 tails: print_cls::@1 blocks: null +Populated: Loop head: main::@1 tails: main::@2 blocks: main::@2 main::@1 +Populated: Loop head: menu::@1 tails: menu::@1 blocks: menu::@1 +Populated: Loop head: menu::@2 tails: menu::@2 blocks: menu::@2 +Populated: Loop head: menu::@3 tails: menu::@17 blocks: menu::@17 menu::@4 menu::@3 +Populated: Loop head: print_str_lines::@4 tails: print_str_lines::@5 blocks: print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 +Populated: Loop head: print_str_lines::@1 tails: print_str_lines::@9 blocks: print_str_lines::@9 print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 print_str_lines::@1 +Populated: Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 +Populated: Loop head: print_cls::@1 tails: print_cls::@1 blocks: print_cls::@1 +Loop head: main::@1 tails: main::@2 blocks: main::@2 main::@1 +Loop head: menu::@1 tails: menu::@1 blocks: menu::@1 +Loop head: menu::@2 tails: menu::@2 blocks: menu::@2 +Loop head: menu::@3 tails: menu::@17 blocks: menu::@17 menu::@4 menu::@3 +Loop head: print_str_lines::@4 tails: print_str_lines::@5 blocks: print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 +Loop head: print_str_lines::@1 tails: print_str_lines::@9 blocks: print_str_lines::@9 print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 print_str_lines::@1 +Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 +Loop head: print_cls::@1 tails: print_cls::@1 blocks: print_cls::@1 + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@1 tails: main::@2 blocks: main::@2 main::@1 +Found 3 loops in scope [menu] + Loop head: menu::@1 tails: menu::@1 blocks: menu::@1 + Loop head: menu::@2 tails: menu::@2 blocks: menu::@2 + Loop head: menu::@3 tails: menu::@17 blocks: menu::@17 menu::@4 menu::@3 +Found 0 loops in scope [print_set_screen] +Found 1 loops in scope [print_cls] + Loop head: print_cls::@1 tails: print_cls::@1 blocks: print_cls::@1 +Found 2 loops in scope [print_str_lines] + Loop head: print_str_lines::@4 tails: print_str_lines::@5 blocks: print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 + Loop head: print_str_lines::@1 tails: print_str_lines::@9 blocks: print_str_lines::@9 print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 print_str_lines::@1 +Found 0 loops in scope [keyboard_key_pressed] +Found 1 loops in scope [print_ln] + Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 +Found 0 loops in scope [keyboard_matrix_read] +Loop head: main::@1 tails: main::@2 blocks: main::@2 main::@1 depth: 1 +Loop head: menu::@1 tails: menu::@1 blocks: menu::@1 depth: 2 +Loop head: menu::@2 tails: menu::@2 blocks: menu::@2 depth: 2 +Loop head: menu::@3 tails: menu::@17 blocks: menu::@17 menu::@4 menu::@3 depth: 2 +Loop head: print_str_lines::@4 tails: print_str_lines::@5 blocks: print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 depth: 3 +Loop head: print_str_lines::@1 tails: print_str_lines::@9 blocks: print_str_lines::@9 print_str_lines::@5 print_str_lines::@4 print_str_lines::@8 print_str_lines::@1 depth: 2 +Loop head: print_ln::@1 tails: print_ln::@1 blocks: print_ln::@1 depth: 3 +Loop head: print_cls::@1 tails: print_cls::@1 blocks: print_cls::@1 depth: 2 + + +VARIABLE REGISTER WEIGHTS +(byte*) BGCOL +(byte*) BORDERCOL +(byte*) CIA1_PORT_A +(byte*) CIA1_PORT_B +(byte*) CIA2_PORT_A +(byte*) CIA2_PORT_A_DDR +(byte*) COLS +(dword) DTV_COLOR_BANK_DEFAULT +(byte*) DTV_COLOR_BANK_HI +(byte*) DTV_COLOR_BANK_LO +(byte*) DTV_CONTROL +(byte*) DTV_FEATURE +(byte) DTV_FEATURE_ENABLE +(byte*) DTV_GRAPHICS_VIC_BANK +(byte*) DTV_PALETTE +(byte[16]) DTV_PALETTE_DEFAULT +(byte) KEY_SPACE +(byte) LIGHT_GREEN +(byte[]) MENU_TEXT +(byte*) VIC_CONTROL +(byte*) VIC_CONTROL2 +(byte) VIC_CSEL +(byte) VIC_DEN +(byte*) VIC_MEMORY +(byte) VIC_RSEL +(byte()) keyboard_key_pressed((byte) keyboard_key_pressed::key) +(byte~) keyboard_key_pressed::$2 4.0 +(byte) keyboard_key_pressed::colidx +(byte) keyboard_key_pressed::key +(byte) keyboard_key_pressed::return +(byte) keyboard_key_pressed::return#0 34.33333333333333 +(byte) keyboard_key_pressed::return#2 202.0 +(byte) keyboard_key_pressed::rowidx +(byte[]) keyboard_matrix_col_bitmask +(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid) +(byte) keyboard_matrix_read::return +(byte) keyboard_matrix_read::return#0 1.3333333333333333 +(byte) keyboard_matrix_read::return#2 4.0 +(byte) keyboard_matrix_read::row_pressed_bits +(byte) keyboard_matrix_read::rowid +(byte[8]) keyboard_matrix_row_bitmask +(void()) main() +(void()) menu() +(byte~) menu::$29 202.0 +(byte*) menu::CHARSET +(byte*) menu::SCREEN +(byte*) menu::c +(byte*) menu::c#1 151.5 +(byte*) menu::c#2 151.5 +(byte) menu::i +(byte) menu::i#1 151.5 +(byte) menu::i#2 202.0 +(byte*) print_char_cursor +(byte*) print_char_cursor#1 2002.0 +(byte*) print_char_cursor#17 821.0 +(byte*) print_char_cursor#19 101.0 +(byte*) print_char_cursor#32 572.0 +(byte*~) print_char_cursor#53 202.0 +(void()) print_cls() +(byte*) print_cls::sc +(byte*) print_cls::sc#1 151.5 +(byte*) print_cls::sc#2 151.5 +(byte*) print_line_cursor +(byte*) print_line_cursor#17 8.583333333333332 +(byte*) print_line_cursor#18 2004.0 +(byte*) print_line_cursor#19 641.0 +(void()) print_ln() +(byte*) print_screen +(void()) print_set_screen((byte*) print_set_screen::screen) +(byte*) print_set_screen::screen +(void()) print_str_lines((byte*) print_str_lines::str) +(byte) print_str_lines::ch +(byte) print_str_lines::ch#0 667.3333333333334 +(byte*) print_str_lines::str +(byte*) print_str_lines::str#0 233.66666666666669 +(byte*) print_str_lines::str#2 151.5 +(byte*) print_str_lines::str#3 1552.0 + +Initial phi equivalence classes +[ menu::i#2 menu::i#1 ] +[ menu::c#2 menu::c#1 ] +[ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] +[ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +[ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +[ print_cls::sc#2 print_cls::sc#1 ] +Added variable keyboard_key_pressed::return#2 to zero page equivalence class [ keyboard_key_pressed::return#2 ] +Added variable menu::$29 to zero page equivalence class [ menu::$29 ] +Added variable keyboard_matrix_read::return#2 to zero page equivalence class [ keyboard_matrix_read::return#2 ] +Added variable keyboard_key_pressed::$2 to zero page equivalence class [ keyboard_key_pressed::$2 ] +Added variable keyboard_key_pressed::return#0 to zero page equivalence class [ keyboard_key_pressed::return#0 ] +Added variable keyboard_matrix_read::return#0 to zero page equivalence class [ keyboard_matrix_read::return#0 ] +Added variable print_str_lines::ch#0 to zero page equivalence class [ print_str_lines::ch#0 ] +Complete equivalence classes +[ menu::i#2 menu::i#1 ] +[ menu::c#2 menu::c#1 ] +[ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] +[ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +[ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +[ print_cls::sc#2 print_cls::sc#1 ] +[ keyboard_key_pressed::return#2 ] +[ menu::$29 ] +[ keyboard_matrix_read::return#2 ] +[ keyboard_key_pressed::$2 ] +[ keyboard_key_pressed::return#0 ] +[ keyboard_matrix_read::return#0 ] +[ print_str_lines::ch#0 ] +Allocated zp ZP_BYTE:2 [ menu::i#2 menu::i#1 ] +Allocated zp ZP_WORD:3 [ menu::c#2 menu::c#1 ] +Allocated zp ZP_WORD:5 [ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] +Allocated zp ZP_WORD:7 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +Allocated zp ZP_WORD:9 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +Allocated zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] +Allocated zp ZP_BYTE:13 [ keyboard_key_pressed::return#2 ] +Allocated zp ZP_BYTE:14 [ menu::$29 ] +Allocated zp ZP_BYTE:15 [ keyboard_matrix_read::return#2 ] +Allocated zp ZP_BYTE:16 [ keyboard_key_pressed::$2 ] +Allocated zp ZP_BYTE:17 [ keyboard_key_pressed::return#0 ] +Allocated zp ZP_BYTE:18 [ keyboard_matrix_read::return#0 ] +Allocated zp ZP_BYTE:19 [ print_str_lines::ch#0 ] + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .label BORDERCOL = $d020 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_CONTROL2 = $d016 + .const VIC_CSEL = 8 + .label VIC_MEMORY = $d018 + .label COLS = $d800 + .label CIA1_PORT_A = $dc00 + .label CIA1_PORT_B = $dc01 + .label CIA2_PORT_A = $dd00 + .label CIA2_PORT_A_DDR = $dd02 + .const LIGHT_GREEN = $d + .label DTV_FEATURE = $d03f + .const DTV_FEATURE_ENABLE = 1 + .label DTV_CONTROL = $d03c + .label DTV_PALETTE = $d200 + .label DTV_COLOR_BANK_LO = $d036 + .label DTV_COLOR_BANK_HI = $d037 + .const DTV_COLOR_BANK_DEFAULT = $1d800 + .label DTV_GRAPHICS_VIC_BANK = $d03d + .const KEY_SPACE = $3c + .label print_char_cursor = 7 + .label print_line_cursor = 9 +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @21 [phi:@begin->@21] +b21_from_bbegin: + jmp b21 +//SEG4 @21 +b21: +//SEG5 [2] call main param-assignment [ ] ( ) + jsr main +//SEG6 [3] phi from @21 to @end [phi:@21->@end] +bend_from_b21: + jmp bend +//SEG7 @end +bend: +//SEG8 main +main: { + //SEG9 asm { sei } + sei + //SEG10 [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_FEATURE_ENABLE + sta DTV_FEATURE + jmp b1 + //SEG11 main::@1 + b1: + //SEG12 [6] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 + jmp b2_from_b1 + jmp breturn + //SEG13 main::@return + breturn: + //SEG14 [7] return [ ] ( main:2 [ ] ) + rts + //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + b2_from_b1: + jmp b2 + //SEG16 main::@2 + b2: + //SEG17 [9] call menu param-assignment [ ] ( main:2 [ ] ) + jsr menu + jmp b1 +} +//SEG18 menu +menu: { + .label SCREEN = $8000 + .label CHARSET = $9800 + .label _29 = $e + .label i = 2 + .label c = 3 + //SEG19 [10] *((const byte*) DTV_GRAPHICS_VIC_BANK#0) ← ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #($ffffffff&CHARSET)/$10000 + sta DTV_GRAPHICS_VIC_BANK + //SEG20 [11] *((const byte*) DTV_COLOR_BANK_LO#0) ← <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_COLOR_BANK_DEFAULT/$400 + sta DTV_COLOR_BANK_LO + //SEG21 [12] *((const byte*) DTV_COLOR_BANK_HI#0) ← >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #0 + sta DTV_COLOR_BANK_HI + //SEG22 [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #0 + sta DTV_CONTROL + //SEG23 [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta CIA2_PORT_A_DDR + //SEG24 [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3^CHARSET/$4000 + sta CIA2_PORT_A + //SEG25 [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_DEN|VIC_RSEL|3 + sta VIC_CONTROL + //SEG26 [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_CSEL + sta VIC_CONTROL2 + //SEG27 [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(CHARSET&$3fff)/$400 + sta VIC_MEMORY + //SEG28 [19] phi from menu to menu::@1 [phi:menu->menu::@1] + b1_from_menu: + //SEG29 [19] phi (byte) menu::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:menu->menu::@1#0] -- vbuz1=vbuc1 + lda #0 + sta i + jmp b1 + //SEG30 [19] phi from menu::@1 to menu::@1 [phi:menu::@1->menu::@1] + b1_from_b1: + //SEG31 [19] phi (byte) menu::i#2 = (byte) menu::i#1 [phi:menu::@1->menu::@1#0] -- register_copy + jmp b1 + //SEG32 menu::@1 + b1: + //SEG33 [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + ldy i + lda DTV_PALETTE_DEFAULT,y + sta DTV_PALETTE,y + //SEG34 [21] (byte) menu::i#1 ← ++ (byte) menu::i#2 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuz1=_inc_vbuz1 + inc i + //SEG35 [22] if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuz1_neq_vbuc1_then_la1 + lda i + cmp #$10 + bne b1_from_b1 + //SEG36 [23] phi from menu::@1 to menu::@2 [phi:menu::@1->menu::@2] + b2_from_b1: + //SEG37 [23] phi (byte*) menu::c#2 = (const byte*) COLS#0 [phi:menu::@1->menu::@2#0] -- pbuz1=pbuc1 + lda #COLS + sta c+1 + jmp b2 + //SEG38 [23] phi from menu::@2 to menu::@2 [phi:menu::@2->menu::@2] + b2_from_b2: + //SEG39 [23] phi (byte*) menu::c#2 = (byte*) menu::c#1 [phi:menu::@2->menu::@2#0] -- register_copy + jmp b2 + //SEG40 menu::@2 + b2: + //SEG41 [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) -- _deref_pbuz1=vbuc1 + lda #LIGHT_GREEN + ldy #0 + sta (c),y + //SEG42 [25] (byte*) menu::c#1 ← ++ (byte*) menu::c#2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1=_inc_pbuz1 + inc c + bne !+ + inc c+1 + !: + //SEG43 [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda c+1 + cmp #>COLS+$3e8 + bne b2_from_b2 + lda c + cmp #print_set_screen] + print_set_screen_from_b8: + jsr print_set_screen + //SEG49 [30] phi from menu::@8 to menu::@14 [phi:menu::@8->menu::@14] + b14_from_b8: + jmp b14 + //SEG50 menu::@14 + b14: + //SEG51 [31] call print_cls param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG52 [70] phi from menu::@14 to print_cls [phi:menu::@14->print_cls] + print_cls_from_b14: + jsr print_cls + //SEG53 [32] phi from menu::@14 to menu::@15 [phi:menu::@14->menu::@15] + b15_from_b14: + jmp b15 + //SEG54 menu::@15 + b15: + //SEG55 [33] call print_str_lines param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG56 [50] phi from menu::@15 to print_str_lines [phi:menu::@15->print_str_lines] + print_str_lines_from_b15: + jsr print_str_lines + jmp b3 + //SEG57 menu::@3 + b3: + //SEG58 [34] if(true) goto menu::@4 [ ] ( main:2::menu:9 [ ] ) -- true_then_la1 + jmp b4_from_b3 + jmp breturn + //SEG59 menu::@return + breturn: + //SEG60 [35] return [ ] ( main:2::menu:9 [ ] ) + rts + //SEG61 [36] phi from menu::@3 to menu::@4 [phi:menu::@3->menu::@4] + b4_from_b3: + jmp b4 + //SEG62 menu::@4 + b4: + //SEG63 [37] call keyboard_key_pressed param-assignment [ keyboard_key_pressed::return#0 ] ( main:2::menu:9 [ keyboard_key_pressed::return#0 ] ) + //SEG64 [41] phi from menu::@4 to keyboard_key_pressed [phi:menu::@4->keyboard_key_pressed] + keyboard_key_pressed_from_b4: + jsr keyboard_key_pressed + //SEG65 [38] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0 [ keyboard_key_pressed::return#2 ] ( main:2::menu:9 [ keyboard_key_pressed::return#2 ] ) -- vbuz1=vbuz2 + lda keyboard_key_pressed.return + sta keyboard_key_pressed.return_2 + jmp b17 + //SEG66 menu::@17 + b17: + //SEG67 [39] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2 [ menu::$29 ] ( main:2::menu:9 [ menu::$29 ] ) -- vbuz1=vbuz2 + lda keyboard_key_pressed.return_2 + sta _29 + //SEG68 [40] if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@3 [ ] ( main:2::menu:9 [ ] ) -- vbuz1_eq_0_then_la1 + lda _29 + beq b3 + jmp breturn +} +//SEG69 keyboard_key_pressed +keyboard_key_pressed: { + .const colidx = KEY_SPACE&7 + .label rowidx = KEY_SPACE>>3 + .label _2 = $10 + .label return = $11 + .label return_2 = $d + //SEG70 [42] call keyboard_matrix_read param-assignment [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#0 ] ) + jsr keyboard_matrix_read + //SEG71 [43] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0 [ keyboard_matrix_read::return#2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#2 ] ) -- vbuz1=vbuz2 + lda keyboard_matrix_read.return + sta keyboard_matrix_read.return_2 + jmp b2 + //SEG72 keyboard_key_pressed::@2 + b2: + //SEG73 [44] (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#2 [ keyboard_key_pressed::$2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::$2 ] ) -- vbuz1=vbuz2 + lda keyboard_matrix_read.return_2 + sta _2 + //SEG74 [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) -- vbuz1=vbuz2_band__deref_pbuc1 + lda keyboard_matrix_col_bitmask+colidx + and _2 + sta return + jmp breturn + //SEG75 keyboard_key_pressed::@return + breturn: + //SEG76 [46] return [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + rts +} +//SEG77 keyboard_matrix_read +keyboard_matrix_read: { + .label return = $12 + .label return_2 = $f + //SEG78 [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx + sta CIA1_PORT_A + //SEG79 [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) -- vbuz1=_bnot__deref_pbuc1 + lda CIA1_PORT_B + eor #$ff + sta return + jmp breturn + //SEG80 keyboard_matrix_read::@return + breturn: + //SEG81 [49] return [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + rts +} +//SEG82 print_str_lines +print_str_lines: { + .label ch = $13 + .label str = 5 + //SEG83 [51] phi from print_str_lines to print_str_lines::@1 [phi:print_str_lines->print_str_lines::@1] + b1_from_print_str_lines: + //SEG84 [51] phi (byte*) print_line_cursor#17 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_line_cursor+1 + //SEG85 [51] phi (byte*) print_char_cursor#19 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#1] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_char_cursor+1 + //SEG86 [51] phi (byte*) print_str_lines::str#2 = (const string) MENU_TEXT#0 [phi:print_str_lines->print_str_lines::@1#2] -- pbuz1=pbuc1 + lda #MENU_TEXT + sta str+1 + jmp b1 + //SEG87 print_str_lines::@1 + b1: + //SEG88 [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (str),y + cmp #'@' + bne b4_from_b1 + jmp breturn + //SEG89 print_str_lines::@return + breturn: + //SEG90 [53] return [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + rts + //SEG91 [54] phi from print_str_lines::@1 print_str_lines::@5 to print_str_lines::@4 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4] + b4_from_b1: + b4_from_b5: + //SEG92 [54] phi (byte*) print_char_cursor#17 = (byte*) print_char_cursor#19 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#0] -- register_copy + //SEG93 [54] phi (byte*) print_str_lines::str#3 = (byte*) print_str_lines::str#2 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#1] -- register_copy + jmp b4 + //SEG94 print_str_lines::@4 + b4: + //SEG95 [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuz1=_deref_pbuz2 + ldy #0 + lda (str),y + sta ch + //SEG96 [56] (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- pbuz1=_inc_pbuz1 + inc str + bne !+ + inc str+1 + !: + //SEG97 [57] if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuz1_eq_vbuc1_then_la1 + lda ch + cmp #'@' + beq b5_from_b4 + jmp b8 + //SEG98 print_str_lines::@8 + b8: + //SEG99 [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- _deref_pbuz1=vbuz2 + lda ch + ldy #0 + sta (print_char_cursor),y + //SEG100 [59] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ) -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + //SEG101 [60] phi from print_str_lines::@4 print_str_lines::@8 to print_str_lines::@5 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5] + b5_from_b4: + b5_from_b8: + //SEG102 [60] phi (byte*) print_char_cursor#32 = (byte*) print_char_cursor#17 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5#0] -- register_copy + jmp b5 + //SEG103 print_str_lines::@5 + b5: + //SEG104 [61] if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) -- vbuz1_neq_vbuc1_then_la1 + lda ch + cmp #'@' + bne b4_from_b5 + //SEG105 [62] phi from print_str_lines::@5 to print_str_lines::@9 [phi:print_str_lines::@5->print_str_lines::@9] + b9_from_b5: + jmp b9 + //SEG106 print_str_lines::@9 + b9: + //SEG107 [63] call print_ln param-assignment [ print_str_lines::str#0 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_line_cursor#19 ] ) + //SEG108 [65] phi from print_str_lines::@9 to print_ln [phi:print_str_lines::@9->print_ln] + print_ln_from_b9: + jsr print_ln + //SEG109 [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + //SEG110 [51] phi from print_str_lines::@9 to print_str_lines::@1 [phi:print_str_lines::@9->print_str_lines::@1] + b1_from_b9: + //SEG111 [51] phi (byte*) print_line_cursor#17 = (byte*) print_line_cursor#19 [phi:print_str_lines::@9->print_str_lines::@1#0] -- register_copy + //SEG112 [51] phi (byte*) print_char_cursor#19 = (byte*~) print_char_cursor#53 [phi:print_str_lines::@9->print_str_lines::@1#1] -- register_copy + //SEG113 [51] phi (byte*) print_str_lines::str#2 = (byte*) print_str_lines::str#0 [phi:print_str_lines::@9->print_str_lines::@1#2] -- register_copy + jmp b1 +} +//SEG114 print_ln +print_ln: { + //SEG115 [66] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + //SEG116 [66] phi (byte*) print_line_cursor#18 = (byte*) print_line_cursor#17 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + jmp b1 + //SEG117 print_ln::@1 + b1: + //SEG118 [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1=pbuz1_plus_vbuc1 + lda print_line_cursor + clc + adc #$28 + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + //SEG119 [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1_lt_pbuz2_then_la1 + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1_from_b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1_from_b1 + !: + jmp breturn + //SEG120 print_ln::@return + breturn: + //SEG121 [69] return [ print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 ] ) + rts +} +//SEG122 print_cls +print_cls: { + .label sc = $b + //SEG123 [71] phi from print_cls to print_cls::@1 [phi:print_cls->print_cls::@1] + b1_from_print_cls: + //SEG124 [71] phi (byte*) print_cls::sc#2 = (const byte*) menu::SCREEN#0 [phi:print_cls->print_cls::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta sc+1 + jmp b1 + //SEG125 [71] phi from print_cls::@1 to print_cls::@1 [phi:print_cls::@1->print_cls::@1] + b1_from_b1: + //SEG126 [71] phi (byte*) print_cls::sc#2 = (byte*) print_cls::sc#1 [phi:print_cls::@1->print_cls::@1#0] -- register_copy + jmp b1 + //SEG127 print_cls::@1 + b1: + //SEG128 [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1 + lda #' ' + ldy #0 + sta (sc),y + //SEG129 [73] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1 + inc sc + bne !+ + inc sc+1 + !: + //SEG130 [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda sc+1 + cmp #>menu.SCREEN+$3e8 + bne b1_from_b1 + lda sc + cmp #((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ menu::i#2 menu::i#1 ] +Statement [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) always clobbers reg byte a reg byte y +Statement [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) always clobbers reg byte a +Statement [27] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [28] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) always clobbers reg byte a +Statement [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) always clobbers reg byte a +Statement [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) always clobbers reg byte a +Statement [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) always clobbers reg byte a reg byte y +Statement [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) always clobbers reg byte a reg byte y +Statement [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:19 [ print_str_lines::ch#0 ] +Statement [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) always clobbers reg byte a +Statement [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) always clobbers reg byte a reg byte y +Statement [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) always clobbers reg byte a +Statement [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) DTV_GRAPHICS_VIC_BANK#0) ← ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [11] *((const byte*) DTV_COLOR_BANK_LO#0) ← <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) DTV_COLOR_BANK_HI#0) ← >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) always clobbers reg byte a +Statement [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) always clobbers reg byte a reg byte y +Statement [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) always clobbers reg byte a +Statement [27] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [28] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) always clobbers reg byte a +Statement [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) always clobbers reg byte a +Statement [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) always clobbers reg byte a +Statement [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) always clobbers reg byte a +Statement [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) always clobbers reg byte a reg byte y +Statement [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) always clobbers reg byte a reg byte y +Statement [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) always clobbers reg byte y +Statement [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) always clobbers reg byte a +Statement [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) always clobbers reg byte a +Statement [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) always clobbers reg byte a reg byte y +Statement [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) always clobbers reg byte a +Potential registers zp ZP_BYTE:2 [ menu::i#2 menu::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:3 [ menu::c#2 menu::c#1 ] : zp ZP_WORD:3 , +Potential registers zp ZP_WORD:5 [ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] : zp ZP_WORD:5 , +Potential registers zp ZP_WORD:7 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] : zp ZP_WORD:7 , +Potential registers zp ZP_WORD:9 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] : zp ZP_WORD:9 , +Potential registers zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] : zp ZP_WORD:11 , +Potential registers zp ZP_BYTE:13 [ keyboard_key_pressed::return#2 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:14 [ menu::$29 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:15 [ keyboard_matrix_read::return#2 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:16 [ keyboard_key_pressed::$2 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:17 [ keyboard_key_pressed::return#0 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:18 [ keyboard_matrix_read::return#0 ] : zp ZP_BYTE:18 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:19 [ print_str_lines::ch#0 ] : zp ZP_BYTE:19 , reg byte a , reg byte x , + +REGISTER UPLIFT SCOPES +Uplift Scope [] 3,698: zp ZP_WORD:7 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] 2,653.58: zp ZP_WORD:9 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +Uplift Scope [print_str_lines] 1,937.17: zp ZP_WORD:5 [ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] 667.33: zp ZP_BYTE:19 [ print_str_lines::ch#0 ] +Uplift Scope [menu] 353.5: zp ZP_BYTE:2 [ menu::i#2 menu::i#1 ] 303: zp ZP_WORD:3 [ menu::c#2 menu::c#1 ] 202: zp ZP_BYTE:14 [ menu::$29 ] +Uplift Scope [print_cls] 303: zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] +Uplift Scope [keyboard_key_pressed] 202: zp ZP_BYTE:13 [ keyboard_key_pressed::return#2 ] 34.33: zp ZP_BYTE:17 [ keyboard_key_pressed::return#0 ] 4: zp ZP_BYTE:16 [ keyboard_key_pressed::$2 ] +Uplift Scope [keyboard_matrix_read] 4: zp ZP_BYTE:15 [ keyboard_matrix_read::return#2 ] 1.33: zp ZP_BYTE:18 [ keyboard_matrix_read::return#0 ] +Uplift Scope [print_ln] +Uplift Scope [print_set_screen] +Uplift Scope [main] + +Uplifting [] best 138690 combination zp ZP_WORD:7 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] zp ZP_WORD:9 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +Uplifting [print_str_lines] best 126690 combination zp ZP_WORD:5 [ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] reg byte a [ print_str_lines::ch#0 ] +Uplifting [menu] best 125090 combination reg byte x [ menu::i#2 menu::i#1 ] zp ZP_WORD:3 [ menu::c#2 menu::c#1 ] reg byte a [ menu::$29 ] +Uplifting [print_cls] best 125090 combination zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [keyboard_key_pressed] best 124181 combination reg byte a [ keyboard_key_pressed::return#2 ] reg byte a [ keyboard_key_pressed::return#0 ] reg byte a [ keyboard_key_pressed::$2 ] +Uplifting [keyboard_matrix_read] best 124169 combination reg byte a [ keyboard_matrix_read::return#2 ] reg byte a [ keyboard_matrix_read::return#0 ] +Uplifting [print_ln] best 124169 combination +Uplifting [print_set_screen] best 124169 combination +Uplifting [main] best 124169 combination +Coalescing zero page register [ zp ZP_WORD:3 [ menu::c#2 menu::c#1 ] ] with [ zp ZP_WORD:5 [ print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] ] +Coalescing zero page register [ zp ZP_WORD:3 [ menu::c#2 menu::c#1 print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 ] ] with [ zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] ] +Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ menu::c#2 menu::c#1 print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 print_cls::sc#2 print_cls::sc#1 ] +Allocated (was zp ZP_WORD:7) zp ZP_WORD:4 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +Allocated (was zp ZP_WORD:9) zp ZP_WORD:6 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .label BORDERCOL = $d020 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_CONTROL2 = $d016 + .const VIC_CSEL = 8 + .label VIC_MEMORY = $d018 + .label COLS = $d800 + .label CIA1_PORT_A = $dc00 + .label CIA1_PORT_B = $dc01 + .label CIA2_PORT_A = $dd00 + .label CIA2_PORT_A_DDR = $dd02 + .const LIGHT_GREEN = $d + .label DTV_FEATURE = $d03f + .const DTV_FEATURE_ENABLE = 1 + .label DTV_CONTROL = $d03c + .label DTV_PALETTE = $d200 + .label DTV_COLOR_BANK_LO = $d036 + .label DTV_COLOR_BANK_HI = $d037 + .const DTV_COLOR_BANK_DEFAULT = $1d800 + .label DTV_GRAPHICS_VIC_BANK = $d03d + .const KEY_SPACE = $3c + .label print_char_cursor = 4 + .label print_line_cursor = 6 +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @21 [phi:@begin->@21] +b21_from_bbegin: + jmp b21 +//SEG4 @21 +b21: +//SEG5 [2] call main param-assignment [ ] ( ) + jsr main +//SEG6 [3] phi from @21 to @end [phi:@21->@end] +bend_from_b21: + jmp bend +//SEG7 @end +bend: +//SEG8 main +main: { + //SEG9 asm { sei } + sei + //SEG10 [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_FEATURE_ENABLE + sta DTV_FEATURE + jmp b1 + //SEG11 main::@1 + b1: + //SEG12 [6] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 + jmp b2_from_b1 + jmp breturn + //SEG13 main::@return + breturn: + //SEG14 [7] return [ ] ( main:2 [ ] ) + rts + //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + b2_from_b1: + jmp b2 + //SEG16 main::@2 + b2: + //SEG17 [9] call menu param-assignment [ ] ( main:2 [ ] ) + jsr menu + jmp b1 +} +//SEG18 menu +menu: { + .label SCREEN = $8000 + .label CHARSET = $9800 + .label c = 2 + //SEG19 [10] *((const byte*) DTV_GRAPHICS_VIC_BANK#0) ← ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #($ffffffff&CHARSET)/$10000 + sta DTV_GRAPHICS_VIC_BANK + //SEG20 [11] *((const byte*) DTV_COLOR_BANK_LO#0) ← <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_COLOR_BANK_DEFAULT/$400 + sta DTV_COLOR_BANK_LO + //SEG21 [12] *((const byte*) DTV_COLOR_BANK_HI#0) ← >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #0 + sta DTV_COLOR_BANK_HI + //SEG22 [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #0 + sta DTV_CONTROL + //SEG23 [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta CIA2_PORT_A_DDR + //SEG24 [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3^CHARSET/$4000 + sta CIA2_PORT_A + //SEG25 [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_DEN|VIC_RSEL|3 + sta VIC_CONTROL + //SEG26 [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_CSEL + sta VIC_CONTROL2 + //SEG27 [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(CHARSET&$3fff)/$400 + sta VIC_MEMORY + //SEG28 [19] phi from menu to menu::@1 [phi:menu->menu::@1] + b1_from_menu: + //SEG29 [19] phi (byte) menu::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:menu->menu::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp b1 + //SEG30 [19] phi from menu::@1 to menu::@1 [phi:menu::@1->menu::@1] + b1_from_b1: + //SEG31 [19] phi (byte) menu::i#2 = (byte) menu::i#1 [phi:menu::@1->menu::@1#0] -- register_copy + jmp b1 + //SEG32 menu::@1 + b1: + //SEG33 [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda DTV_PALETTE_DEFAULT,x + sta DTV_PALETTE,x + //SEG34 [21] (byte) menu::i#1 ← ++ (byte) menu::i#2 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG35 [22] if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$10 + bne b1_from_b1 + //SEG36 [23] phi from menu::@1 to menu::@2 [phi:menu::@1->menu::@2] + b2_from_b1: + //SEG37 [23] phi (byte*) menu::c#2 = (const byte*) COLS#0 [phi:menu::@1->menu::@2#0] -- pbuz1=pbuc1 + lda #COLS + sta c+1 + jmp b2 + //SEG38 [23] phi from menu::@2 to menu::@2 [phi:menu::@2->menu::@2] + b2_from_b2: + //SEG39 [23] phi (byte*) menu::c#2 = (byte*) menu::c#1 [phi:menu::@2->menu::@2#0] -- register_copy + jmp b2 + //SEG40 menu::@2 + b2: + //SEG41 [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) -- _deref_pbuz1=vbuc1 + lda #LIGHT_GREEN + ldy #0 + sta (c),y + //SEG42 [25] (byte*) menu::c#1 ← ++ (byte*) menu::c#2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1=_inc_pbuz1 + inc c + bne !+ + inc c+1 + !: + //SEG43 [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda c+1 + cmp #>COLS+$3e8 + bne b2_from_b2 + lda c + cmp #print_set_screen] + print_set_screen_from_b8: + jsr print_set_screen + //SEG49 [30] phi from menu::@8 to menu::@14 [phi:menu::@8->menu::@14] + b14_from_b8: + jmp b14 + //SEG50 menu::@14 + b14: + //SEG51 [31] call print_cls param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG52 [70] phi from menu::@14 to print_cls [phi:menu::@14->print_cls] + print_cls_from_b14: + jsr print_cls + //SEG53 [32] phi from menu::@14 to menu::@15 [phi:menu::@14->menu::@15] + b15_from_b14: + jmp b15 + //SEG54 menu::@15 + b15: + //SEG55 [33] call print_str_lines param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG56 [50] phi from menu::@15 to print_str_lines [phi:menu::@15->print_str_lines] + print_str_lines_from_b15: + jsr print_str_lines + jmp b3 + //SEG57 menu::@3 + b3: + //SEG58 [34] if(true) goto menu::@4 [ ] ( main:2::menu:9 [ ] ) -- true_then_la1 + jmp b4_from_b3 + jmp breturn + //SEG59 menu::@return + breturn: + //SEG60 [35] return [ ] ( main:2::menu:9 [ ] ) + rts + //SEG61 [36] phi from menu::@3 to menu::@4 [phi:menu::@3->menu::@4] + b4_from_b3: + jmp b4 + //SEG62 menu::@4 + b4: + //SEG63 [37] call keyboard_key_pressed param-assignment [ keyboard_key_pressed::return#0 ] ( main:2::menu:9 [ keyboard_key_pressed::return#0 ] ) + //SEG64 [41] phi from menu::@4 to keyboard_key_pressed [phi:menu::@4->keyboard_key_pressed] + keyboard_key_pressed_from_b4: + jsr keyboard_key_pressed + //SEG65 [38] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0 [ keyboard_key_pressed::return#2 ] ( main:2::menu:9 [ keyboard_key_pressed::return#2 ] ) + // (byte) keyboard_key_pressed::return#2 = (byte) keyboard_key_pressed::return#0 // register copy reg byte a + jmp b17 + //SEG66 menu::@17 + b17: + //SEG67 [39] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2 [ menu::$29 ] ( main:2::menu:9 [ menu::$29 ] ) + // (byte~) menu::$29 = (byte) keyboard_key_pressed::return#2 // register copy reg byte a + //SEG68 [40] if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@3 [ ] ( main:2::menu:9 [ ] ) -- vbuaa_eq_0_then_la1 + cmp #0 + beq b3 + jmp breturn +} +//SEG69 keyboard_key_pressed +keyboard_key_pressed: { + .const colidx = KEY_SPACE&7 + .label rowidx = KEY_SPACE>>3 + //SEG70 [42] call keyboard_matrix_read param-assignment [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#0 ] ) + jsr keyboard_matrix_read + //SEG71 [43] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0 [ keyboard_matrix_read::return#2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#2 ] ) + // (byte) keyboard_matrix_read::return#2 = (byte) keyboard_matrix_read::return#0 // register copy reg byte a + jmp b2 + //SEG72 keyboard_key_pressed::@2 + b2: + //SEG73 [44] (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#2 [ keyboard_key_pressed::$2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::$2 ] ) + // (byte~) keyboard_key_pressed::$2 = (byte) keyboard_matrix_read::return#2 // register copy reg byte a + //SEG74 [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) -- vbuaa=vbuaa_band__deref_pbuc1 + and keyboard_matrix_col_bitmask+colidx + jmp breturn + //SEG75 keyboard_key_pressed::@return + breturn: + //SEG76 [46] return [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + rts +} +//SEG77 keyboard_matrix_read +keyboard_matrix_read: { + //SEG78 [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx + sta CIA1_PORT_A + //SEG79 [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) -- vbuaa=_bnot__deref_pbuc1 + lda CIA1_PORT_B + eor #$ff + jmp breturn + //SEG80 keyboard_matrix_read::@return + breturn: + //SEG81 [49] return [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + rts +} +//SEG82 print_str_lines +print_str_lines: { + .label str = 2 + //SEG83 [51] phi from print_str_lines to print_str_lines::@1 [phi:print_str_lines->print_str_lines::@1] + b1_from_print_str_lines: + //SEG84 [51] phi (byte*) print_line_cursor#17 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_line_cursor+1 + //SEG85 [51] phi (byte*) print_char_cursor#19 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#1] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_char_cursor+1 + //SEG86 [51] phi (byte*) print_str_lines::str#2 = (const string) MENU_TEXT#0 [phi:print_str_lines->print_str_lines::@1#2] -- pbuz1=pbuc1 + lda #MENU_TEXT + sta str+1 + jmp b1 + //SEG87 print_str_lines::@1 + b1: + //SEG88 [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (str),y + cmp #'@' + bne b4_from_b1 + jmp breturn + //SEG89 print_str_lines::@return + breturn: + //SEG90 [53] return [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + rts + //SEG91 [54] phi from print_str_lines::@1 print_str_lines::@5 to print_str_lines::@4 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4] + b4_from_b1: + b4_from_b5: + //SEG92 [54] phi (byte*) print_char_cursor#17 = (byte*) print_char_cursor#19 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#0] -- register_copy + //SEG93 [54] phi (byte*) print_str_lines::str#3 = (byte*) print_str_lines::str#2 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#1] -- register_copy + jmp b4 + //SEG94 print_str_lines::@4 + b4: + //SEG95 [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuaa=_deref_pbuz1 + ldy #0 + lda (str),y + //SEG96 [56] (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- pbuz1=_inc_pbuz1 + inc str + bne !+ + inc str+1 + !: + //SEG97 [57] if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuaa_eq_vbuc1_then_la1 + cmp #'@' + beq b5_from_b4 + jmp b8 + //SEG98 print_str_lines::@8 + b8: + //SEG99 [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- _deref_pbuz1=vbuaa + ldy #0 + sta (print_char_cursor),y + //SEG100 [59] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ) -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + //SEG101 [60] phi from print_str_lines::@4 print_str_lines::@8 to print_str_lines::@5 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5] + b5_from_b4: + b5_from_b8: + //SEG102 [60] phi (byte*) print_char_cursor#32 = (byte*) print_char_cursor#17 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5#0] -- register_copy + jmp b5 + //SEG103 print_str_lines::@5 + b5: + //SEG104 [61] if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) -- vbuaa_neq_vbuc1_then_la1 + cmp #'@' + bne b4_from_b5 + //SEG105 [62] phi from print_str_lines::@5 to print_str_lines::@9 [phi:print_str_lines::@5->print_str_lines::@9] + b9_from_b5: + jmp b9 + //SEG106 print_str_lines::@9 + b9: + //SEG107 [63] call print_ln param-assignment [ print_str_lines::str#0 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_line_cursor#19 ] ) + //SEG108 [65] phi from print_str_lines::@9 to print_ln [phi:print_str_lines::@9->print_ln] + print_ln_from_b9: + jsr print_ln + //SEG109 [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + //SEG110 [51] phi from print_str_lines::@9 to print_str_lines::@1 [phi:print_str_lines::@9->print_str_lines::@1] + b1_from_b9: + //SEG111 [51] phi (byte*) print_line_cursor#17 = (byte*) print_line_cursor#19 [phi:print_str_lines::@9->print_str_lines::@1#0] -- register_copy + //SEG112 [51] phi (byte*) print_char_cursor#19 = (byte*~) print_char_cursor#53 [phi:print_str_lines::@9->print_str_lines::@1#1] -- register_copy + //SEG113 [51] phi (byte*) print_str_lines::str#2 = (byte*) print_str_lines::str#0 [phi:print_str_lines::@9->print_str_lines::@1#2] -- register_copy + jmp b1 +} +//SEG114 print_ln +print_ln: { + //SEG115 [66] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + b1_from_print_ln: + b1_from_b1: + //SEG116 [66] phi (byte*) print_line_cursor#18 = (byte*) print_line_cursor#17 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + jmp b1 + //SEG117 print_ln::@1 + b1: + //SEG118 [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1=pbuz1_plus_vbuc1 + lda print_line_cursor + clc + adc #$28 + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + //SEG119 [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1_lt_pbuz2_then_la1 + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1_from_b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1_from_b1 + !: + jmp breturn + //SEG120 print_ln::@return + breturn: + //SEG121 [69] return [ print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 ] ) + rts +} +//SEG122 print_cls +print_cls: { + .label sc = 2 + //SEG123 [71] phi from print_cls to print_cls::@1 [phi:print_cls->print_cls::@1] + b1_from_print_cls: + //SEG124 [71] phi (byte*) print_cls::sc#2 = (const byte*) menu::SCREEN#0 [phi:print_cls->print_cls::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta sc+1 + jmp b1 + //SEG125 [71] phi from print_cls::@1 to print_cls::@1 [phi:print_cls::@1->print_cls::@1] + b1_from_b1: + //SEG126 [71] phi (byte*) print_cls::sc#2 = (byte*) print_cls::sc#1 [phi:print_cls::@1->print_cls::@1#0] -- register_copy + jmp b1 + //SEG127 print_cls::@1 + b1: + //SEG128 [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1 + lda #' ' + ldy #0 + sta (sc),y + //SEG129 [73] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1 + inc sc + bne !+ + inc sc+1 + !: + //SEG130 [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda sc+1 + cmp #>menu.SCREEN+$3e8 + bne b1_from_b1 + lda sc + cmp #>(byte/signed byte/word/signed word/dword/signed dword) 3 +(byte[]) keyboard_matrix_col_bitmask +(const byte[]) 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 1.3333333333333333 +(byte) keyboard_matrix_read::return#2 reg byte a 4.0 +(byte) keyboard_matrix_read::row_pressed_bits +(byte) keyboard_matrix_read::rowid +(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 } +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@return +(void()) menu() +(byte~) menu::$29 reg byte a 202.0 +(label) menu::@1 +(label) menu::@14 +(label) menu::@15 +(label) menu::@17 +(label) menu::@2 +(label) menu::@3 +(label) menu::@4 +(label) menu::@8 +(label) menu::@return +(byte*) menu::CHARSET +(const byte*) menu::CHARSET#0 CHARSET = ((byte*))(word/dword/signed dword) 38912 +(byte*) menu::SCREEN +(const byte*) menu::SCREEN#0 SCREEN = ((byte*))(word/dword/signed dword) 32768 +(byte*) menu::c +(byte*) menu::c#1 c zp ZP_WORD:2 151.5 +(byte*) menu::c#2 c zp ZP_WORD:2 151.5 +(byte) menu::i +(byte) menu::i#1 reg byte x 151.5 +(byte) menu::i#2 reg byte x 202.0 +(byte*) print_char_cursor +(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:4 2002.0 +(byte*) print_char_cursor#17 print_char_cursor zp ZP_WORD:4 821.0 +(byte*) print_char_cursor#19 print_char_cursor zp ZP_WORD:4 101.0 +(byte*) print_char_cursor#32 print_char_cursor zp ZP_WORD:4 572.0 +(byte*~) print_char_cursor#53 print_char_cursor zp ZP_WORD:4 202.0 +(void()) print_cls() +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc +(byte*) print_cls::sc#1 sc zp ZP_WORD:2 151.5 +(byte*) print_cls::sc#2 sc zp ZP_WORD:2 151.5 +(byte*) print_line_cursor +(byte*) print_line_cursor#17 print_line_cursor zp ZP_WORD:6 8.583333333333332 +(byte*) print_line_cursor#18 print_line_cursor zp ZP_WORD:6 2004.0 +(byte*) print_line_cursor#19 print_line_cursor zp ZP_WORD:6 641.0 +(void()) print_ln() +(label) print_ln::@1 +(label) print_ln::@return +(byte*) print_screen +(void()) print_set_screen((byte*) print_set_screen::screen) +(label) print_set_screen::@return +(byte*) print_set_screen::screen +(void()) print_str_lines((byte*) print_str_lines::str) +(label) print_str_lines::@1 +(label) print_str_lines::@4 +(label) print_str_lines::@5 +(label) print_str_lines::@8 +(label) print_str_lines::@9 +(label) print_str_lines::@return +(byte) print_str_lines::ch +(byte) print_str_lines::ch#0 reg byte a 667.3333333333334 +(byte*) print_str_lines::str +(byte*) print_str_lines::str#0 str zp ZP_WORD:2 233.66666666666669 +(byte*) print_str_lines::str#2 str zp ZP_WORD:2 151.5 +(byte*) print_str_lines::str#3 str zp ZP_WORD:2 1552.0 + +reg byte x [ menu::i#2 menu::i#1 ] +zp ZP_WORD:2 [ menu::c#2 menu::c#1 print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 print_cls::sc#2 print_cls::sc#1 ] +zp ZP_WORD:4 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +zp ZP_WORD:6 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +reg byte a [ keyboard_key_pressed::return#2 ] +reg byte a [ menu::$29 ] +reg byte a [ keyboard_matrix_read::return#2 ] +reg byte a [ keyboard_key_pressed::$2 ] +reg byte a [ keyboard_key_pressed::return#0 ] +reg byte a [ keyboard_matrix_read::return#0 ] +reg byte a [ print_str_lines::ch#0 ] + + +FINAL ASSEMBLER +Score: 104812 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels + .label BORDERCOL = $d020 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_CONTROL2 = $d016 + .const VIC_CSEL = 8 + .label VIC_MEMORY = $d018 + .label COLS = $d800 + .label CIA1_PORT_A = $dc00 + .label CIA1_PORT_B = $dc01 + .label CIA2_PORT_A = $dd00 + .label CIA2_PORT_A_DDR = $dd02 + .const LIGHT_GREEN = $d + .label DTV_FEATURE = $d03f + .const DTV_FEATURE_ENABLE = 1 + .label DTV_CONTROL = $d03c + .label DTV_PALETTE = $d200 + .label DTV_COLOR_BANK_LO = $d036 + .label DTV_COLOR_BANK_HI = $d037 + .const DTV_COLOR_BANK_DEFAULT = $1d800 + .label DTV_GRAPHICS_VIC_BANK = $d03d + .const KEY_SPACE = $3c + .label print_char_cursor = 4 + .label print_line_cursor = 6 +//SEG2 @begin +//SEG3 [1] phi from @begin to @21 [phi:@begin->@21] +//SEG4 @21 +//SEG5 [2] call main param-assignment [ ] ( ) + jsr main +//SEG6 [3] phi from @21 to @end [phi:@21->@end] +//SEG7 @end +//SEG8 main +main: { + //SEG9 asm { sei } + sei + //SEG10 [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_FEATURE_ENABLE + sta DTV_FEATURE + //SEG11 main::@1 + //SEG12 [6] if(true) goto main::@2 [ ] ( main:2 [ ] ) -- true_then_la1 + //SEG13 main::@return + //SEG14 [7] return [ ] ( main:2 [ ] ) + //SEG15 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + //SEG16 main::@2 + b2: + //SEG17 [9] call menu param-assignment [ ] ( main:2 [ ] ) + jsr menu + jmp b2 +} +//SEG18 menu +menu: { + .label SCREEN = $8000 + .label CHARSET = $9800 + .label c = 2 + //SEG19 [10] *((const byte*) DTV_GRAPHICS_VIC_BANK#0) ← ((byte))((dword))(const byte*) menu::CHARSET#0/(dword/signed dword) 65536 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #($ffffffff&CHARSET)/$10000 + sta DTV_GRAPHICS_VIC_BANK + //SEG20 [11] *((const byte*) DTV_COLOR_BANK_LO#0) ← <((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #DTV_COLOR_BANK_DEFAULT/$400 + sta DTV_COLOR_BANK_LO + //SEG21 [12] *((const byte*) DTV_COLOR_BANK_HI#0) ← >((word))(const dword) DTV_COLOR_BANK_DEFAULT#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #0 + sta DTV_COLOR_BANK_HI + //SEG22 [13] *((const byte*) DTV_CONTROL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + sta DTV_CONTROL + //SEG23 [14] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta CIA2_PORT_A_DDR + //SEG24 [15] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) menu::CHARSET#0/(word/signed word/dword/signed dword) 16384 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3^CHARSET/$4000 + sta CIA2_PORT_A + //SEG25 [16] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_DEN|VIC_RSEL|3 + sta VIC_CONTROL + //SEG26 [17] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_CSEL#0 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #VIC_CSEL + sta VIC_CONTROL2 + //SEG27 [18] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) menu::SCREEN#0&(word/signed word/dword/signed dword) 16383/(byte/signed byte/word/signed word/dword/signed dword) 64|((word))(const byte*) menu::CHARSET#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024 [ ] ( main:2::menu:9 [ ] ) -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(CHARSET&$3fff)/$400 + sta VIC_MEMORY + //SEG28 [19] phi from menu to menu::@1 [phi:menu->menu::@1] + //SEG29 [19] phi (byte) menu::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:menu->menu::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG30 [19] phi from menu::@1 to menu::@1 [phi:menu::@1->menu::@1] + //SEG31 [19] phi (byte) menu::i#2 = (byte) menu::i#1 [phi:menu::@1->menu::@1#0] -- register_copy + //SEG32 menu::@1 + b1: + //SEG33 [20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[16]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2) [ menu::i#2 ] ( main:2::menu:9 [ menu::i#2 ] ) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda DTV_PALETTE_DEFAULT,x + sta DTV_PALETTE,x + //SEG34 [21] (byte) menu::i#1 ← ++ (byte) menu::i#2 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG35 [22] if((byte) menu::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto menu::@1 [ menu::i#1 ] ( main:2::menu:9 [ menu::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$10 + bne b1 + //SEG36 [23] phi from menu::@1 to menu::@2 [phi:menu::@1->menu::@2] + //SEG37 [23] phi (byte*) menu::c#2 = (const byte*) COLS#0 [phi:menu::@1->menu::@2#0] -- pbuz1=pbuc1 + lda #COLS + sta c+1 + //SEG38 [23] phi from menu::@2 to menu::@2 [phi:menu::@2->menu::@2] + //SEG39 [23] phi (byte*) menu::c#2 = (byte*) menu::c#1 [phi:menu::@2->menu::@2#0] -- register_copy + //SEG40 menu::@2 + b2: + //SEG41 [24] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0 [ menu::c#2 ] ( main:2::menu:9 [ menu::c#2 ] ) -- _deref_pbuz1=vbuc1 + lda #LIGHT_GREEN + ldy #0 + sta (c),y + //SEG42 [25] (byte*) menu::c#1 ← ++ (byte*) menu::c#2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1=_inc_pbuz1 + inc c + bne !+ + inc c+1 + !: + //SEG43 [26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word/signed word/dword/signed dword) 1000) goto menu::@2 [ menu::c#1 ] ( main:2::menu:9 [ menu::c#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda c+1 + cmp #>COLS+$3e8 + bne b2 + lda c + cmp #print_set_screen] + jsr print_set_screen + //SEG49 [30] phi from menu::@8 to menu::@14 [phi:menu::@8->menu::@14] + //SEG50 menu::@14 + //SEG51 [31] call print_cls param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG52 [70] phi from menu::@14 to print_cls [phi:menu::@14->print_cls] + jsr print_cls + //SEG53 [32] phi from menu::@14 to menu::@15 [phi:menu::@14->menu::@15] + //SEG54 menu::@15 + //SEG55 [33] call print_str_lines param-assignment [ ] ( main:2::menu:9 [ ] ) + //SEG56 [50] phi from menu::@15 to print_str_lines [phi:menu::@15->print_str_lines] + jsr print_str_lines + //SEG57 menu::@3 + //SEG58 [34] if(true) goto menu::@4 [ ] ( main:2::menu:9 [ ] ) -- true_then_la1 + jmp b4 + //SEG59 menu::@return + breturn: + //SEG60 [35] return [ ] ( main:2::menu:9 [ ] ) + rts + //SEG61 [36] phi from menu::@3 to menu::@4 [phi:menu::@3->menu::@4] + //SEG62 menu::@4 + b4: + //SEG63 [37] call keyboard_key_pressed param-assignment [ keyboard_key_pressed::return#0 ] ( main:2::menu:9 [ keyboard_key_pressed::return#0 ] ) + //SEG64 [41] phi from menu::@4 to keyboard_key_pressed [phi:menu::@4->keyboard_key_pressed] + jsr keyboard_key_pressed + //SEG65 [38] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0 [ keyboard_key_pressed::return#2 ] ( main:2::menu:9 [ keyboard_key_pressed::return#2 ] ) + // (byte) keyboard_key_pressed::return#2 = (byte) keyboard_key_pressed::return#0 // register copy reg byte a + //SEG66 menu::@17 + //SEG67 [39] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2 [ menu::$29 ] ( main:2::menu:9 [ menu::$29 ] ) + // (byte~) menu::$29 = (byte) keyboard_key_pressed::return#2 // register copy reg byte a + //SEG68 [40] if((byte~) menu::$29==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@3 [ ] ( main:2::menu:9 [ ] ) -- vbuaa_eq_0_then_la1 + cmp #0 + beq b4 + jmp breturn +} +//SEG69 keyboard_key_pressed +keyboard_key_pressed: { + .const colidx = KEY_SPACE&7 + .label rowidx = KEY_SPACE>>3 + //SEG70 [42] call keyboard_matrix_read param-assignment [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#0 ] ) + jsr keyboard_matrix_read + //SEG71 [43] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0 [ keyboard_matrix_read::return#2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_matrix_read::return#2 ] ) + // (byte) keyboard_matrix_read::return#2 = (byte) keyboard_matrix_read::return#0 // register copy reg byte a + //SEG72 keyboard_key_pressed::@2 + //SEG73 [44] (byte~) keyboard_key_pressed::$2 ← (byte) keyboard_matrix_read::return#2 [ keyboard_key_pressed::$2 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::$2 ] ) + // (byte~) keyboard_key_pressed::$2 = (byte) keyboard_matrix_read::return#2 // register copy reg byte a + //SEG74 [45] (byte) keyboard_key_pressed::return#0 ← (byte~) keyboard_key_pressed::$2 & *((const byte[]) keyboard_matrix_col_bitmask#0+(const byte) keyboard_key_pressed::colidx#0) [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) -- vbuaa=vbuaa_band__deref_pbuc1 + and keyboard_matrix_col_bitmask+colidx + //SEG75 keyboard_key_pressed::@return + //SEG76 [46] return [ keyboard_key_pressed::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37 [ keyboard_key_pressed::return#0 ] ) + rts +} +//SEG77 keyboard_matrix_read +keyboard_matrix_read: { + //SEG78 [47] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ ] ) -- _deref_pbuc1=_deref_pbuc2 + lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx + sta CIA1_PORT_A + //SEG79 [48] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0) [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) -- vbuaa=_bnot__deref_pbuc1 + lda CIA1_PORT_B + eor #$ff + //SEG80 keyboard_matrix_read::@return + //SEG81 [49] return [ keyboard_matrix_read::return#0 ] ( main:2::menu:9::keyboard_key_pressed:37::keyboard_matrix_read:42 [ keyboard_matrix_read::return#0 ] ) + rts +} +//SEG82 print_str_lines +print_str_lines: { + .label str = 2 + //SEG83 [51] phi from print_str_lines to print_str_lines::@1 [phi:print_str_lines->print_str_lines::@1] + //SEG84 [51] phi (byte*) print_line_cursor#17 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_line_cursor+1 + //SEG85 [51] phi (byte*) print_char_cursor#19 = (const byte*) menu::SCREEN#0 [phi:print_str_lines->print_str_lines::@1#1] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta print_char_cursor+1 + //SEG86 [51] phi (byte*) print_str_lines::str#2 = (const string) MENU_TEXT#0 [phi:print_str_lines->print_str_lines::@1#2] -- pbuz1=pbuc1 + lda #MENU_TEXT + sta str+1 + //SEG87 print_str_lines::@1 + b1: + //SEG88 [52] if(*((byte*) print_str_lines::str#2)!=(byte) '@') goto print_str_lines::@4 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#2 print_char_cursor#19 print_line_cursor#17 ] ) -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (str),y + cmp #'@' + bne b4 + //SEG89 print_str_lines::@return + //SEG90 [53] return [ ] ( main:2::menu:9::print_str_lines:33 [ ] ) + rts + //SEG91 [54] phi from print_str_lines::@1 print_str_lines::@5 to print_str_lines::@4 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4] + //SEG92 [54] phi (byte*) print_char_cursor#17 = (byte*) print_char_cursor#19 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#0] -- register_copy + //SEG93 [54] phi (byte*) print_str_lines::str#3 = (byte*) print_str_lines::str#2 [phi:print_str_lines::@1/print_str_lines::@5->print_str_lines::@4#1] -- register_copy + //SEG94 print_str_lines::@4 + b4: + //SEG95 [55] (byte) print_str_lines::ch#0 ← *((byte*) print_str_lines::str#3) [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#3 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuaa=_deref_pbuz1 + ldy #0 + lda (str),y + //SEG96 [56] (byte*) print_str_lines::str#0 ← ++ (byte*) print_str_lines::str#3 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- pbuz1=_inc_pbuz1 + inc str + bne !+ + inc str+1 + !: + //SEG97 [57] if((byte) print_str_lines::ch#0==(byte) '@') goto print_str_lines::@5 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- vbuaa_eq_vbuc1_then_la1 + cmp #'@' + beq b5 + //SEG98 print_str_lines::@8 + //SEG99 [58] *((byte*) print_char_cursor#17) ← (byte) print_str_lines::ch#0 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#17 print_str_lines::ch#0 ] ) -- _deref_pbuz1=vbuaa + ldy #0 + sta (print_char_cursor),y + //SEG100 [59] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#17 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_str_lines::ch#0 print_char_cursor#1 ] ) -- pbuz1=_inc_pbuz1 + inc print_char_cursor + bne !+ + inc print_char_cursor+1 + !: + //SEG101 [60] phi from print_str_lines::@4 print_str_lines::@8 to print_str_lines::@5 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5] + //SEG102 [60] phi (byte*) print_char_cursor#32 = (byte*) print_char_cursor#17 [phi:print_str_lines::@4/print_str_lines::@8->print_str_lines::@5#0] -- register_copy + //SEG103 print_str_lines::@5 + b5: + //SEG104 [61] if((byte) print_str_lines::ch#0!=(byte) '@') goto print_str_lines::@4 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33 [ print_line_cursor#17 print_str_lines::str#0 print_char_cursor#32 ] ) -- vbuaa_neq_vbuc1_then_la1 + cmp #'@' + bne b4 + //SEG105 [62] phi from print_str_lines::@5 to print_str_lines::@9 [phi:print_str_lines::@5->print_str_lines::@9] + //SEG106 print_str_lines::@9 + //SEG107 [63] call print_ln param-assignment [ print_str_lines::str#0 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_line_cursor#19 ] ) + //SEG108 [65] phi from print_str_lines::@9 to print_ln [phi:print_str_lines::@9->print_ln] + jsr print_ln + //SEG109 [64] (byte*~) print_char_cursor#53 ← (byte*) print_line_cursor#19 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33 [ print_str_lines::str#0 print_char_cursor#53 print_line_cursor#19 ] ) -- pbuz1=pbuz2 + lda print_line_cursor + sta print_char_cursor + lda print_line_cursor+1 + sta print_char_cursor+1 + //SEG110 [51] phi from print_str_lines::@9 to print_str_lines::@1 [phi:print_str_lines::@9->print_str_lines::@1] + //SEG111 [51] phi (byte*) print_line_cursor#17 = (byte*) print_line_cursor#19 [phi:print_str_lines::@9->print_str_lines::@1#0] -- register_copy + //SEG112 [51] phi (byte*) print_char_cursor#19 = (byte*~) print_char_cursor#53 [phi:print_str_lines::@9->print_str_lines::@1#1] -- register_copy + //SEG113 [51] phi (byte*) print_str_lines::str#2 = (byte*) print_str_lines::str#0 [phi:print_str_lines::@9->print_str_lines::@1#2] -- register_copy + jmp b1 +} +//SEG114 print_ln +print_ln: { + //SEG115 [66] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1] + //SEG116 [66] phi (byte*) print_line_cursor#18 = (byte*) print_line_cursor#17 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy + //SEG117 print_ln::@1 + b1: + //SEG118 [67] (byte*) print_line_cursor#19 ← (byte*) print_line_cursor#18 + (byte/signed byte/word/signed word/dword/signed dword) 40 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1=pbuz1_plus_vbuc1 + lda print_line_cursor + clc + adc #$28 + sta print_line_cursor + bcc !+ + inc print_line_cursor+1 + !: + //SEG119 [68] if((byte*) print_line_cursor#19<(byte*) print_char_cursor#32) goto print_ln::@1 [ print_line_cursor#19 print_char_cursor#32 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 print_char_cursor#32 ] ) -- pbuz1_lt_pbuz2_then_la1 + lda print_line_cursor+1 + cmp print_char_cursor+1 + bcc b1 + bne !+ + lda print_line_cursor + cmp print_char_cursor + bcc b1 + !: + //SEG120 print_ln::@return + //SEG121 [69] return [ print_line_cursor#19 ] ( main:2::menu:9::print_str_lines:33::print_ln:63 [ print_str_lines::str#0 print_line_cursor#19 ] ) + rts +} +//SEG122 print_cls +print_cls: { + .label sc = 2 + //SEG123 [71] phi from print_cls to print_cls::@1 [phi:print_cls->print_cls::@1] + //SEG124 [71] phi (byte*) print_cls::sc#2 = (const byte*) menu::SCREEN#0 [phi:print_cls->print_cls::@1#0] -- pbuz1=pbuc1 + lda #menu.SCREEN + sta sc+1 + //SEG125 [71] phi from print_cls::@1 to print_cls::@1 [phi:print_cls::@1->print_cls::@1] + //SEG126 [71] phi (byte*) print_cls::sc#2 = (byte*) print_cls::sc#1 [phi:print_cls::@1->print_cls::@1#0] -- register_copy + //SEG127 print_cls::@1 + b1: + //SEG128 [72] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1 + lda #' ' + ldy #0 + sta (sc),y + //SEG129 [73] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1 + inc sc + bne !+ + inc sc+1 + !: + //SEG130 [74] if((byte*) print_cls::sc#1!=(const byte*) menu::SCREEN#0+(word/signed word/dword/signed dword) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::menu:9::print_cls:31 [ print_cls::sc#1 ] ) -- pbuz1_neq_pbuc1_then_la1 + lda sc+1 + cmp #>menu.SCREEN+$3e8 + bne b1 + lda sc + cmp #>(byte/signed byte/word/signed word/dword/signed dword) 3 +(byte[]) keyboard_matrix_col_bitmask +(const byte[]) 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 1.3333333333333333 +(byte) keyboard_matrix_read::return#2 reg byte a 4.0 +(byte) keyboard_matrix_read::row_pressed_bits +(byte) keyboard_matrix_read::rowid +(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 } +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@return +(void()) menu() +(byte~) menu::$29 reg byte a 202.0 +(label) menu::@1 +(label) menu::@14 +(label) menu::@15 +(label) menu::@17 +(label) menu::@2 +(label) menu::@3 +(label) menu::@4 +(label) menu::@8 +(label) menu::@return +(byte*) menu::CHARSET +(const byte*) menu::CHARSET#0 CHARSET = ((byte*))(word/dword/signed dword) 38912 +(byte*) menu::SCREEN +(const byte*) menu::SCREEN#0 SCREEN = ((byte*))(word/dword/signed dword) 32768 +(byte*) menu::c +(byte*) menu::c#1 c zp ZP_WORD:2 151.5 +(byte*) menu::c#2 c zp ZP_WORD:2 151.5 +(byte) menu::i +(byte) menu::i#1 reg byte x 151.5 +(byte) menu::i#2 reg byte x 202.0 +(byte*) print_char_cursor +(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:4 2002.0 +(byte*) print_char_cursor#17 print_char_cursor zp ZP_WORD:4 821.0 +(byte*) print_char_cursor#19 print_char_cursor zp ZP_WORD:4 101.0 +(byte*) print_char_cursor#32 print_char_cursor zp ZP_WORD:4 572.0 +(byte*~) print_char_cursor#53 print_char_cursor zp ZP_WORD:4 202.0 +(void()) print_cls() +(label) print_cls::@1 +(label) print_cls::@return +(byte*) print_cls::sc +(byte*) print_cls::sc#1 sc zp ZP_WORD:2 151.5 +(byte*) print_cls::sc#2 sc zp ZP_WORD:2 151.5 +(byte*) print_line_cursor +(byte*) print_line_cursor#17 print_line_cursor zp ZP_WORD:6 8.583333333333332 +(byte*) print_line_cursor#18 print_line_cursor zp ZP_WORD:6 2004.0 +(byte*) print_line_cursor#19 print_line_cursor zp ZP_WORD:6 641.0 +(void()) print_ln() +(label) print_ln::@1 +(label) print_ln::@return +(byte*) print_screen +(void()) print_set_screen((byte*) print_set_screen::screen) +(label) print_set_screen::@return +(byte*) print_set_screen::screen +(void()) print_str_lines((byte*) print_str_lines::str) +(label) print_str_lines::@1 +(label) print_str_lines::@4 +(label) print_str_lines::@5 +(label) print_str_lines::@8 +(label) print_str_lines::@9 +(label) print_str_lines::@return +(byte) print_str_lines::ch +(byte) print_str_lines::ch#0 reg byte a 667.3333333333334 +(byte*) print_str_lines::str +(byte*) print_str_lines::str#0 str zp ZP_WORD:2 233.66666666666669 +(byte*) print_str_lines::str#2 str zp ZP_WORD:2 151.5 +(byte*) print_str_lines::str#3 str zp ZP_WORD:2 1552.0 + +reg byte x [ menu::i#2 menu::i#1 ] +zp ZP_WORD:2 [ menu::c#2 menu::c#1 print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 print_cls::sc#2 print_cls::sc#1 ] +zp ZP_WORD:4 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#53 print_char_cursor#32 print_char_cursor#1 ] +zp ZP_WORD:6 [ print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 ] +reg byte a [ keyboard_key_pressed::return#2 ] +reg byte a [ menu::$29 ] +reg byte a [ keyboard_matrix_read::return#2 ] +reg byte a [ keyboard_key_pressed::$2 ] +reg byte a [ keyboard_key_pressed::return#0 ] +reg byte a [ keyboard_matrix_read::return#0 ] +reg byte a [ print_str_lines::ch#0 ]