1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-07-03 20:29:34 +00:00
kickc/src/test/ref/c64dtv-8bppchunkystretch.log

3285 lines
155 KiB
Plaintext
Raw Normal View History

Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank
Identified constant variable (byte*) DTV_BLITTER_ALU
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
2018-08-22 22:24:32 +00:00
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) PROCPORT_DDR#0 ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) PROCPORT_DDR_MEMORY_MASK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
(byte*) PROCPORT#0 ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) PROCPORT_RAM_ALL#0 ← (byte/signed byte/word/signed word/dword/signed dword) $30
(byte) PROCPORT_RAM_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) $35
(byte) PROCPORT_RAM_CHARROM#0 ← (byte/signed byte/word/signed word/dword/signed dword) $31
(byte) PROCPORT_KERNEL_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) $36
(byte) PROCPORT_BASIC_KERNEL_IO#0 ← (byte/signed byte/word/signed word/dword/signed dword) $37
(byte*) CHARGEN#0 ← ((byte*)) (word/dword/signed dword) $d000
(word) SPRITE_PTRS#0 ← (word/signed word/dword/signed dword) $3f8
(byte*) SPRITES_XPOS#0 ← ((byte*)) (word/dword/signed dword) $d000
(byte*) SPRITES_YPOS#0 ← ((byte*)) (word/dword/signed dword) $d001
(byte*) SPRITES_XMSB#0 ← ((byte*)) (word/dword/signed dword) $d010
(byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) $d012
(byte*) SPRITES_ENABLE#0 ← ((byte*)) (word/dword/signed dword) $d015
(byte*) SPRITES_EXPAND_Y#0 ← ((byte*)) (word/dword/signed dword) $d017
(byte*) SPRITES_PRIORITY#0 ← ((byte*)) (word/dword/signed dword) $d01b
(byte*) SPRITES_MC#0 ← ((byte*)) (word/dword/signed dword) $d01c
(byte*) SPRITES_EXPAND_X#0 ← ((byte*)) (word/dword/signed dword) $d01d
(byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) $d020
(byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) $d021
(byte*) BGCOL1#0 ← ((byte*)) (word/dword/signed dword) $d021
(byte*) BGCOL2#0 ← ((byte*)) (word/dword/signed dword) $d022
(byte*) BGCOL3#0 ← ((byte*)) (word/dword/signed dword) $d023
(byte*) BGCOL4#0 ← ((byte*)) (word/dword/signed dword) $d024
(byte*) SPRITES_MC1#0 ← ((byte*)) (word/dword/signed dword) $d025
(byte*) SPRITES_MC2#0 ← ((byte*)) (word/dword/signed dword) $d026
(byte*) SPRITES_COLS#0 ← ((byte*)) (word/dword/signed dword) $d027
(byte*) VIC_CONTROL#0 ← ((byte*)) (word/dword/signed dword) $d011
(byte*) D011#0 ← ((byte*)) (word/dword/signed dword) $d011
(byte) VIC_RST8#0 ← (byte/word/signed word/dword/signed dword) $80
(byte) VIC_ECM#0 ← (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) VIC_BMM#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) VIC_DEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) VIC_RSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) VIC_CONTROL2#0 ← ((byte*)) (word/dword/signed dword) $d016
(byte*) D016#0 ← ((byte*)) (word/dword/signed dword) $d016
(byte) VIC_MCM#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) VIC_CSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) D018#0 ← ((byte*)) (word/dword/signed dword) $d018
(byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) $d018
(byte*) LIGHTPEN_X#0 ← ((byte*)) (word/dword/signed dword) $d013
(byte*) LIGHTPEN_Y#0 ← ((byte*)) (word/dword/signed dword) $d014
(byte*) IRQ_STATUS#0 ← ((byte*)) (word/dword/signed dword) $d019
(byte*) IRQ_ENABLE#0 ← ((byte*)) (word/dword/signed dword) $d01a
(byte) IRQ_RASTER#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) IRQ_COLLISION_BG#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) IRQ_COLLISION_SPRITE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) IRQ_LIGHTPEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) COLS#0 ← ((byte*)) (word/dword/signed dword) $d800
(byte*) CIA1_PORT_A#0 ← ((byte*)) (word/dword/signed dword) $dc00
(byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) $dc01
(byte*) CIA1_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) $dc02
(byte*) CIA1_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) $dc03
(byte*) CIA1_INTERRUPT#0 ← ((byte*)) (word/dword/signed dword) $dc0d
(byte) CIA_INTERRUPT_CLEAR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $7f
(byte*) CIA2_PORT_A#0 ← ((byte*)) (word/dword/signed dword) $dd00
(byte*) CIA2_PORT_B#0 ← ((byte*)) (word/dword/signed dword) $dd01
(byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) $dd02
(byte*) CIA2_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) $dd03
(byte*) CIA2_INTERRUPT#0 ← ((byte*)) (word/dword/signed dword) $dd0d
(void()**) KERNEL_IRQ#0 ← ((void()**)) (word/signed word/dword/signed dword) $314
(void()**) HARDWARE_IRQ#0 ← ((void()**)) (word/dword/signed dword) $fffe
(byte) BLACK#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) WHITE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) RED#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) CYAN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) PURPLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) BLUE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6
(byte) YELLOW#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) ORANGE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) BROWN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 9
(byte) PINK#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a
(byte) DARK_GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) $b
(byte) GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) $c
(byte) LIGHT_GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) $d
(byte) LIGHT_BLUE#0 ← (byte/signed byte/word/signed word/dword/signed dword) $e
(byte) LIGHT_GREY#0 ← (byte/signed byte/word/signed word/dword/signed dword) $f
to:@4
@4: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) $d03f
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_FEATURE_DISABLE_TIL_RESET#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) $d03c
(byte) DTV_LINEAR#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BORDER_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_HIGHCOLOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_OVERSCAN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_COLORRAM_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) DTV_BADLINE_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_CHUNKY#0 ← (byte/signed byte/word/signed word/dword/signed dword) $40
(byte*) DTV_PALETTE#0 ← ((byte*)) (word/dword/signed dword) $d200
(byte[$10]) DTV_PALETTE_DEFAULT#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) $f, (byte/signed byte/word/signed word/dword/signed dword) $36, (byte/word/signed word/dword/signed dword) $be, (byte/signed byte/word/signed word/dword/signed dword) $58, (byte/word/signed word/dword/signed dword) $db, (byte/word/signed word/dword/signed dword) $86, (byte/word/signed word/dword/signed dword) $ff, (byte/signed byte/word/signed word/dword/signed dword) $29, (byte/signed byte/word/signed word/dword/signed dword) $26, (byte/signed byte/word/signed word/dword/signed dword) $3b, (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) $df, (byte/word/signed word/dword/signed dword) $9a, (byte/signed byte/word/signed word/dword/signed dword) $a }
(byte*) DTV_PLANEA_START_LO#0 ← ((byte*)) (word/dword/signed dword) $d03a
(byte*) DTV_PLANEA_START_MI#0 ← ((byte*)) (word/dword/signed dword) $d03b
(byte*) DTV_PLANEA_START_HI#0 ← ((byte*)) (word/dword/signed dword) $d045
(byte*) DTV_PLANEA_STEP#0 ← ((byte*)) (word/dword/signed dword) $d046
(byte*) DTV_PLANEA_MODULO_LO#0 ← ((byte*)) (word/dword/signed dword) $d038
(byte*) DTV_PLANEA_MODULO_HI#0 ← ((byte*)) (word/dword/signed dword) $d039
(byte*) DTV_PLANEB_START_LO#0 ← ((byte*)) (word/dword/signed dword) $d049
(byte*) DTV_PLANEB_START_MI#0 ← ((byte*)) (word/dword/signed dword) $d04a
(byte*) DTV_PLANEB_START_HI#0 ← ((byte*)) (word/dword/signed dword) $d04b
(byte*) DTV_PLANEB_STEP#0 ← ((byte*)) (word/dword/signed dword) $d04c
(byte*) DTV_PLANEB_MODULO_LO#0 ← ((byte*)) (word/dword/signed dword) $d047
(byte*) DTV_PLANEB_MODULO_HI#0 ← ((byte*)) (word/dword/signed dword) $d048
(byte*) DTV_SPRITE_BANK#0 ← ((byte*)) (word/dword/signed dword) $d04d
(byte*) DTV_COLOR_BANK_LO#0 ← ((byte*)) (word/dword/signed dword) $d036
(byte*) DTV_COLOR_BANK_HI#0 ← ((byte*)) (word/dword/signed dword) $d037
(dword) DTV_COLOR_BANK_DEFAULT#0 ← (dword/signed dword) $1d800
(byte*) DTV_GRAPHICS_VIC_BANK#0 ← ((byte*)) (word/dword/signed dword) $d03d
(byte*) DTV_GRAPHICS_HICOL_BANK#0 ← ((byte*)) (word/dword/signed dword) $d03e
to:@5
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 )
(byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (byte/word/signed word/dword/signed dword) $ff
*((byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3
asm { .byte$32,$dd lda$ff .byte$32,$00 }
to:dtvSetCpuBankSegment1::@return
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@5: scope:[] from @4
(byte*) DTV_BLITTER_SRCA_LO#0 ← ((byte*)) (word/dword/signed dword) $d320
(byte*) DTV_BLITTER_SRCA_MI#0 ← ((byte*)) (word/dword/signed dword) $d321
(byte*) DTV_BLITTER_SRCA_HI#0 ← ((byte*)) (word/dword/signed dword) $d322
(byte*) DTV_BLITTER_SRCA_MOD_LO#0 ← ((byte*)) (word/dword/signed dword) $d323
(byte*) DTV_BLITTER_SRCA_MOD_HI#0 ← ((byte*)) (word/dword/signed dword) $d324
(byte*) DTV_BLITTER_SRCA_LIN_LO#0 ← ((byte*)) (word/dword/signed dword) $d325
(byte*) DTV_BLITTER_SRCA_LIN_HI#0 ← ((byte*)) (word/dword/signed dword) $d326
(byte*) DTV_BLITTER_SRCA_STEP#0 ← ((byte*)) (word/dword/signed dword) $d327
(byte*) DTV_BLITTER_SRCB_LO#0 ← ((byte*)) (word/dword/signed dword) $d328
(byte*) DTV_BLITTER_SRCB_MI#0 ← ((byte*)) (word/dword/signed dword) $d329
(byte*) DTV_BLITTER_SRCB_HI#0 ← ((byte*)) (word/dword/signed dword) $d32a
(byte*) DTV_BLITTER_SRCB_MOD_LO#0 ← ((byte*)) (word/dword/signed dword) $d32b
(byte*) DTV_BLITTER_SRCB_MOD_HI#0 ← ((byte*)) (word/dword/signed dword) $d32c
(byte*) DTV_BLITTER_SRCB_LIN_LO#0 ← ((byte*)) (word/dword/signed dword) $d32d
(byte*) DTV_BLITTER_SRCB_LIN_HI#0 ← ((byte*)) (word/dword/signed dword) $d32e
(byte*) DTV_BLITTER_SRCB_STEP#0 ← ((byte*)) (word/dword/signed dword) $d32f
(byte*) DTV_BLITTER_DEST_LO#0 ← ((byte*)) (word/dword/signed dword) $d330
(byte*) DTV_BLITTER_DEST_MI#0 ← ((byte*)) (word/dword/signed dword) $d331
(byte*) DTV_BLITTER_DEST_HI#0 ← ((byte*)) (word/dword/signed dword) $d332
(byte*) DTV_BLITTER_DEST_MOD_LO#0 ← ((byte*)) (word/dword/signed dword) $d333
(byte*) DTV_BLITTER_DEST_MOD_HI#0 ← ((byte*)) (word/dword/signed dword) $d334
(byte*) DTV_BLITTER_DEST_LIN_LO#0 ← ((byte*)) (word/dword/signed dword) $d335
(byte*) DTV_BLITTER_DEST_LIN_HI#0 ← ((byte*)) (word/dword/signed dword) $d336
(byte*) DTV_BLITTER_DEST_STEP#0 ← ((byte*)) (word/dword/signed dword) $d337
(byte*) DTV_BLITTER_LEN_LO#0 ← ((byte*)) (word/dword/signed dword) $d338
(byte*) DTV_BLITTER_LEN_HI#0 ← ((byte*)) (word/dword/signed dword) $d339
(byte*) DTV_BLITTER_CONTROL#0 ← ((byte*)) (word/dword/signed dword) $d33a
(byte) DTV_BLIT_FORCE_START#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_SRCA_FWD#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_BLIT_SRCB_FWD#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BLIT_DEST_FWD#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_VIC_IRQ#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) DTV_BLIT_CIA_IRQ#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_BLIT_VBLANK#0 ← (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) DTV_BLIT_IRQ_EN#0 ← (byte/word/signed word/dword/signed dword) $80
(byte*) DTV_BLITTER_TRANSPARANCY#0 ← ((byte*)) (word/dword/signed dword) $d33b
(byte) DTV_BLIT_DISABLE_B#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_WRITE_TRANSPARENT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_BLIT_WRITE_NONTRANSPARENT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BLIT_TRANSPARANCY_NONE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte*) DTV_BLITTER_ALU#0 ← ((byte*)) (word/dword/signed dword) $d33e
(byte) DTV_BLIT_SHIFT0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) DTV_BLIT_SHIFT1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_SHIFT2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_BLIT_SHIFT3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) DTV_BLIT_SHIFT4#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BLIT_SHIFT5#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) DTV_BLIT_SHIFT6#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6
(byte) DTV_BLIT_SHIFT7#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) DTV_BLIT_AND#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) DTV_BLIT_NAND#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_NOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) DTV_BLIT_OR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $18
(byte) DTV_BLIT_XOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20
(byte) DTV_BLIT_XNOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) $28
(byte) DTV_BLIT_ADD#0 ← (byte/signed byte/word/signed word/dword/signed dword) $30
(byte) DTV_BLIT_SUB#0 ← (byte/signed byte/word/signed word/dword/signed dword) $38
(byte*) DTV_BLITTER_CONTROL2#0 ← ((byte*)) (word/dword/signed dword) $d33f
(byte) DTV_BLIT_CLEAR_IRQ#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_SRCA_CONT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) DTV_BLIT_SRCB_CONT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BLIT_DEST_CONT#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_STATUS_BUSY#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_STATUS_IRQ#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) CHUNKY#0 ← ((byte*)) (word/dword/signed dword) $8000
to:@7
main: scope:[main] from @7
asm { sei }
*((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0
*((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0
call gfx_init_chunky
to:main::@17
main::@17: scope:[main] from main
*((byte*) DTV_FEATURE#0) ← (byte) DTV_FEATURE_ENABLE#0
(byte~) main::$1 ← (byte) DTV_HIGHCOLOR#0 | (byte) DTV_LINEAR#0
(byte~) main::$2 ← (byte~) main::$1 | (byte) DTV_COLORRAM_OFF#0
(byte~) main::$3 ← (byte~) main::$2 | (byte) DTV_CHUNKY#0
(byte~) main::$4 ← (byte~) main::$3 | (byte) DTV_BADLINE_OFF#0
*((byte*) DTV_CONTROL#0) ← (byte~) main::$4
(byte~) main::$5 ← (byte) VIC_DEN#0 | (byte) VIC_ECM#0
(byte~) main::$6 ← (byte~) main::$5 | (byte) VIC_RSEL#0
(byte/word/dword~) main::$7 ← (byte~) main::$6 | (byte/signed byte/word/signed word/dword/signed dword) 3
*((byte*) VIC_CONTROL#0) ← (byte/word/dword~) main::$7
(byte~) main::$8 ← (byte) VIC_MCM#0 | (byte) VIC_CSEL#0
*((byte*) VIC_CONTROL2#0) ← (byte~) main::$8
(byte~) main::$9 ← < (byte*) CHUNKY#0
*((byte*) DTV_PLANEB_START_LO#0) ← (byte~) main::$9
(byte~) main::$10 ← > (byte*) CHUNKY#0
*((byte*) DTV_PLANEB_START_MI#0) ← (byte~) main::$10
*((byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
*((byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8
*((byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
*((byte*) DTV_PLANEB_MODULO_HI#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~) main::$11 ← ((word)) (byte*) CHUNKY#0
(word/signed dword/dword~) main::$12 ← (word~) main::$11 / (word/signed word/dword/signed dword) $4000
(byte~) main::$13 ← ((byte)) (word/signed dword/dword~) main::$12
(byte/word/dword~) main::$14 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) main::$13
*((byte*) CIA2_PORT_A#0) ← (byte/word/dword~) main::$14
(word~) main::$15 ← ((word)) (byte*) CHUNKY#0
(word~) main::$16 ← (word~) main::$15 & (word/signed word/dword/signed dword) $3fff
(word~) main::$17 ← (word~) main::$16 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte~) main::$18 ← ((byte)) (word~) main::$17
(word~) main::$19 ← ((word)) (byte*) CHUNKY#0
(word~) main::$20 ← (word~) main::$19 & (word/signed word/dword/signed dword) $3fff
(byte~) main::$21 ← > (word~) main::$20
(byte~) main::$22 ← (byte~) main::$21 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) main::$23 ← (byte~) main::$18 | (byte~) main::$22
*((byte*) VIC_MEMORY#0) ← (byte~) main::$23
(byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@6
main::@6: scope:[main] from main::@17 main::@6
(byte) main::j#2 ← phi( main::@17/(byte) main::j#0 main::@6/(byte) main::j#1 )
*((byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2
(byte) main::j#1 ← (byte) main::j#2 + rangenext(0,$f)
(bool~) main::$24 ← (byte) main::j#1 != rangelast(0,$f)
if((bool~) main::$24) goto main::@6
to:main::@1
main::@1: scope:[main] from main::@11 main::@6
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
(byte~) main::$25 ← (byte) VIC_DEN#0 | (byte) VIC_ECM#0
(byte~) main::$26 ← (byte~) main::$25 | (byte) VIC_RSEL#0
(byte/word/dword~) main::$27 ← (byte~) main::$26 | (byte/signed byte/word/signed word/dword/signed dword) 3
*((byte*) VIC_CONTROL#0) ← (byte/word/dword~) main::$27
*((byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::rst#0 ← (byte/signed byte/word/signed word/dword/signed dword) $42
to:main::@8
main::@8: scope:[main] from main::@2 main::@9
(byte) main::rst#2 ← phi( main::@2/(byte) main::rst#0 main::@9/(byte) main::rst#3 )
2018-04-28 06:41:05 +00:00
(bool~) main::$28 ← *((byte*) RASTER#0) != (byte) main::rst#2
if((bool~) main::$28) goto main::@9
to:main::@10
main::@9: scope:[main] from main::@8
(byte) main::rst#3 ← phi( main::@8/(byte) main::rst#2 )
to:main::@8
main::@10: scope:[main] from main::@8
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
to:main::@11
main::@11: scope:[main] from main::@10 main::@11
(byte) main::rst#1 ← *((byte*) RASTER#0)
(byte~) main::$29 ← (byte) VIC_DEN#0 | (byte) VIC_ECM#0
(byte~) main::$30 ← (byte~) main::$29 | (byte) VIC_RSEL#0
(byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7
(byte~) main::$32 ← (byte~) main::$30 | (byte~) main::$31
*((byte*) VIC_CONTROL#0) ← (byte~) main::$32
(byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4
*((byte*) BORDERCOL#0) ← (byte~) main::$33
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
(bool~) main::$34 ← (byte) main::rst#1 != (byte/word/signed word/dword/signed dword) $f2
if((bool~) main::$34) goto main::@11
to:main::@1
main::@return: scope:[main] from main::@1
return
to:@return
gfx_init_chunky: scope:[gfx_init_chunky] from main
(byte*~) gfx_init_chunky::$0 ← (byte*) CHUNKY#0 / (word/signed word/dword/signed dword) $4000
(byte~) gfx_init_chunky::$1 ← ((byte)) (byte*~) gfx_init_chunky::$0
(byte) gfx_init_chunky::gfxbCpuBank#0 ← (byte~) gfx_init_chunky::$1
(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 ← (byte) gfx_init_chunky::gfxbCpuBank#0
call dtvSetCpuBankSegment1
to:gfx_init_chunky::@7
gfx_init_chunky::@7: scope:[gfx_init_chunky] from gfx_init_chunky
(byte) gfx_init_chunky::gfxbCpuBank#3 ← phi( gfx_init_chunky/(byte) gfx_init_chunky::gfxbCpuBank#0 )
(byte) gfx_init_chunky::gfxbCpuBank#1 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#3
(byte*) gfx_init_chunky::gfxb#0 ← ((byte*)) (word/signed word/dword/signed dword) $4000
(byte) gfx_init_chunky::y#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:gfx_init_chunky::@1
gfx_init_chunky::@1: scope:[gfx_init_chunky] from gfx_init_chunky::@5 gfx_init_chunky::@7
(byte) gfx_init_chunky::gfxbCpuBank#7 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::gfxbCpuBank#9 gfx_init_chunky::@7/(byte) gfx_init_chunky::gfxbCpuBank#1 )
(byte) gfx_init_chunky::y#6 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::y#1 gfx_init_chunky::@7/(byte) gfx_init_chunky::y#0 )
(byte*) gfx_init_chunky::gfxb#5 ← phi( gfx_init_chunky::@5/(byte*) gfx_init_chunky::gfxb#6 gfx_init_chunky::@7/(byte*) gfx_init_chunky::gfxb#0 )
(word) gfx_init_chunky::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:gfx_init_chunky::@2
gfx_init_chunky::@2: scope:[gfx_init_chunky] from gfx_init_chunky::@1 gfx_init_chunky::@3
(byte) gfx_init_chunky::gfxbCpuBank#6 ← phi( gfx_init_chunky::@1/(byte) gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::@3/(byte) gfx_init_chunky::gfxbCpuBank#8 )
(byte) gfx_init_chunky::y#4 ← phi( gfx_init_chunky::@1/(byte) gfx_init_chunky::y#6 gfx_init_chunky::@3/(byte) gfx_init_chunky::y#2 )
(word) gfx_init_chunky::x#3 ← phi( gfx_init_chunky::@1/(word) gfx_init_chunky::x#0 gfx_init_chunky::@3/(word) gfx_init_chunky::x#1 )
(byte*) gfx_init_chunky::gfxb#3 ← phi( gfx_init_chunky::@1/(byte*) gfx_init_chunky::gfxb#5 gfx_init_chunky::@3/(byte*) gfx_init_chunky::gfxb#1 )
(bool~) gfx_init_chunky::$6 ← (byte*) gfx_init_chunky::gfxb#3 == (word/dword/signed dword) $8000
(bool~) gfx_init_chunky::$7 ← ! (bool~) gfx_init_chunky::$6
if((bool~) gfx_init_chunky::$7) goto gfx_init_chunky::@3
to:gfx_init_chunky::@4
gfx_init_chunky::@3: scope:[gfx_init_chunky] from gfx_init_chunky::@2 gfx_init_chunky::@8
(byte) gfx_init_chunky::gfxbCpuBank#8 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::gfxbCpuBank#6 gfx_init_chunky::@8/(byte) gfx_init_chunky::gfxbCpuBank#2 )
(byte*) gfx_init_chunky::gfxb#4 ← phi( gfx_init_chunky::@2/(byte*) gfx_init_chunky::gfxb#3 gfx_init_chunky::@8/(byte*) gfx_init_chunky::gfxb#2 )
(byte) gfx_init_chunky::y#2 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::y#4 gfx_init_chunky::@8/(byte) gfx_init_chunky::y#5 )
(word) gfx_init_chunky::x#2 ← phi( gfx_init_chunky::@2/(word) gfx_init_chunky::x#3 gfx_init_chunky::@8/(word) gfx_init_chunky::x#4 )
(word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#2
(byte~) gfx_init_chunky::$10 ← ((byte)) (word~) gfx_init_chunky::$9
(byte) gfx_init_chunky::c#0 ← (byte~) gfx_init_chunky::$10
*((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0
(byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4
(word) gfx_init_chunky::x#1 ← (word) gfx_init_chunky::x#2 + rangenext(0,$13f)
(bool~) gfx_init_chunky::$11 ← (word) gfx_init_chunky::x#1 != rangelast(0,$13f)
if((bool~) gfx_init_chunky::$11) goto gfx_init_chunky::@2
to:gfx_init_chunky::@5
gfx_init_chunky::@4: scope:[gfx_init_chunky] from gfx_init_chunky::@2
(byte) gfx_init_chunky::y#7 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::y#4 )
(word) gfx_init_chunky::x#5 ← phi( gfx_init_chunky::@2/(word) gfx_init_chunky::x#3 )
(byte) gfx_init_chunky::gfxbCpuBank#4 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::gfxbCpuBank#6 )
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4
call dtvSetCpuBankSegment1
to:gfx_init_chunky::@8
gfx_init_chunky::@8: scope:[gfx_init_chunky] from gfx_init_chunky::@4
(byte) gfx_init_chunky::y#5 ← phi( gfx_init_chunky::@4/(byte) gfx_init_chunky::y#7 )
(word) gfx_init_chunky::x#4 ← phi( gfx_init_chunky::@4/(word) gfx_init_chunky::x#5 )
(byte) gfx_init_chunky::gfxbCpuBank#5 ← phi( gfx_init_chunky::@4/(byte) gfx_init_chunky::gfxbCpuBank#4 )
(byte) gfx_init_chunky::gfxbCpuBank#2 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#5
(byte*) gfx_init_chunky::gfxb#2 ← ((byte*)) (word/signed word/dword/signed dword) $4000
to:gfx_init_chunky::@3
gfx_init_chunky::@5: scope:[gfx_init_chunky] from gfx_init_chunky::@3
(byte) gfx_init_chunky::gfxbCpuBank#9 ← phi( gfx_init_chunky::@3/(byte) gfx_init_chunky::gfxbCpuBank#8 )
(byte*) gfx_init_chunky::gfxb#6 ← phi( gfx_init_chunky::@3/(byte*) gfx_init_chunky::gfxb#1 )
(byte) gfx_init_chunky::y#3 ← phi( gfx_init_chunky::@3/(byte) gfx_init_chunky::y#2 )
(byte) gfx_init_chunky::y#1 ← (byte) gfx_init_chunky::y#3 + rangenext(0,$32)
(bool~) gfx_init_chunky::$12 ← (byte) gfx_init_chunky::y#1 != rangelast(0,$32)
if((bool~) gfx_init_chunky::$12) goto gfx_init_chunky::@1
to:gfx_init_chunky::@6
gfx_init_chunky::@6: scope:[gfx_init_chunky] from gfx_init_chunky::@5
(byte/signed byte/word/signed word/dword/signed dword~) gfx_init_chunky::$3 ← (word/signed word/dword/signed dword) $4000 / (word/signed word/dword/signed dword) $4000
(byte~) gfx_init_chunky::$4 ← ((byte)) (byte/signed byte/word/signed word/dword/signed dword~) gfx_init_chunky::$3
(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← (byte~) gfx_init_chunky::$4
call dtvSetCpuBankSegment1
to:gfx_init_chunky::@9
gfx_init_chunky::@9: scope:[gfx_init_chunky] from gfx_init_chunky::@6
to:gfx_init_chunky::@return
gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@9
return
to:@return
@7: scope:[] from @5
call main
to:@8
@8: scope:[] from @7
to:@end
@end: scope:[] from @8
SYMBOL TABLE SSA
(label) @4
(label) @5
(label) @7
(label) @8
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL#0
(byte*) BGCOL1
(byte*) BGCOL1#0
(byte*) BGCOL2
(byte*) BGCOL2#0
(byte*) BGCOL3
(byte*) BGCOL3#0
(byte*) BGCOL4
(byte*) BGCOL4#0
(byte) BLACK
(byte) BLACK#0
(byte) BLUE
(byte) BLUE#0
(byte*) BORDERCOL
(byte*) BORDERCOL#0
(byte) BROWN
(byte) BROWN#0
(byte*) CHARGEN
(byte*) CHARGEN#0
(byte*) CHUNKY
(byte*) CHUNKY#0
(byte*) CIA1_INTERRUPT
(byte*) CIA1_INTERRUPT#0
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A#0
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_A_DDR#0
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B#0
(byte*) CIA1_PORT_B_DDR
(byte*) CIA1_PORT_B_DDR#0
(byte*) CIA2_INTERRUPT
(byte*) CIA2_INTERRUPT#0
(byte*) CIA2_PORT_A
(byte*) CIA2_PORT_A#0
(byte*) CIA2_PORT_A_DDR
(byte*) CIA2_PORT_A_DDR#0
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B#0
(byte*) CIA2_PORT_B_DDR
(byte*) CIA2_PORT_B_DDR#0
(byte) CIA_INTERRUPT_CLEAR
(byte) CIA_INTERRUPT_CLEAR#0
(byte*) COLS
(byte*) COLS#0
(byte) CYAN
(byte) CYAN#0
(byte*) D011
(byte*) D011#0
(byte*) D016
(byte*) D016#0
(byte*) D018
(byte*) D018#0
(byte) DARK_GREY
(byte) DARK_GREY#0
(byte) DTV_BADLINE_OFF
(byte) DTV_BADLINE_OFF#0
(byte*) DTV_BLITTER_ALU
(byte*) DTV_BLITTER_ALU#0
(byte*) DTV_BLITTER_CONTROL
(byte*) DTV_BLITTER_CONTROL#0
(byte*) DTV_BLITTER_CONTROL2
(byte*) DTV_BLITTER_CONTROL2#0
(byte*) DTV_BLITTER_DEST_HI
(byte*) DTV_BLITTER_DEST_HI#0
(byte*) DTV_BLITTER_DEST_LIN_HI
(byte*) DTV_BLITTER_DEST_LIN_HI#0
(byte*) DTV_BLITTER_DEST_LIN_LO
(byte*) DTV_BLITTER_DEST_LIN_LO#0
(byte*) DTV_BLITTER_DEST_LO
(byte*) DTV_BLITTER_DEST_LO#0
(byte*) DTV_BLITTER_DEST_MI
(byte*) DTV_BLITTER_DEST_MI#0
(byte*) DTV_BLITTER_DEST_MOD_HI
(byte*) DTV_BLITTER_DEST_MOD_HI#0
(byte*) DTV_BLITTER_DEST_MOD_LO
(byte*) DTV_BLITTER_DEST_MOD_LO#0
(byte*) DTV_BLITTER_DEST_STEP
(byte*) DTV_BLITTER_DEST_STEP#0
(byte*) DTV_BLITTER_LEN_HI
(byte*) DTV_BLITTER_LEN_HI#0
(byte*) DTV_BLITTER_LEN_LO
(byte*) DTV_BLITTER_LEN_LO#0
(byte*) DTV_BLITTER_SRCA_HI
(byte*) DTV_BLITTER_SRCA_HI#0
(byte*) DTV_BLITTER_SRCA_LIN_HI
(byte*) DTV_BLITTER_SRCA_LIN_HI#0
(byte*) DTV_BLITTER_SRCA_LIN_LO
(byte*) DTV_BLITTER_SRCA_LIN_LO#0
(byte*) DTV_BLITTER_SRCA_LO
(byte*) DTV_BLITTER_SRCA_LO#0
(byte*) DTV_BLITTER_SRCA_MI
(byte*) DTV_BLITTER_SRCA_MI#0
(byte*) DTV_BLITTER_SRCA_MOD_HI
(byte*) DTV_BLITTER_SRCA_MOD_HI#0
(byte*) DTV_BLITTER_SRCA_MOD_LO
(byte*) DTV_BLITTER_SRCA_MOD_LO#0
(byte*) DTV_BLITTER_SRCA_STEP
(byte*) DTV_BLITTER_SRCA_STEP#0
(byte*) DTV_BLITTER_SRCB_HI
(byte*) DTV_BLITTER_SRCB_HI#0
(byte*) DTV_BLITTER_SRCB_LIN_HI
(byte*) DTV_BLITTER_SRCB_LIN_HI#0
(byte*) DTV_BLITTER_SRCB_LIN_LO
(byte*) DTV_BLITTER_SRCB_LIN_LO#0
(byte*) DTV_BLITTER_SRCB_LO
(byte*) DTV_BLITTER_SRCB_LO#0
(byte*) DTV_BLITTER_SRCB_MI
(byte*) DTV_BLITTER_SRCB_MI#0
(byte*) DTV_BLITTER_SRCB_MOD_HI
(byte*) DTV_BLITTER_SRCB_MOD_HI#0
(byte*) DTV_BLITTER_SRCB_MOD_LO
(byte*) DTV_BLITTER_SRCB_MOD_LO#0
(byte*) DTV_BLITTER_SRCB_STEP
(byte*) DTV_BLITTER_SRCB_STEP#0
(byte*) DTV_BLITTER_TRANSPARANCY
(byte*) DTV_BLITTER_TRANSPARANCY#0
(byte) DTV_BLIT_ADD
(byte) DTV_BLIT_ADD#0
(byte) DTV_BLIT_AND
(byte) DTV_BLIT_AND#0
(byte) DTV_BLIT_CIA_IRQ
(byte) DTV_BLIT_CIA_IRQ#0
(byte) DTV_BLIT_CLEAR_IRQ
(byte) DTV_BLIT_CLEAR_IRQ#0
(byte) DTV_BLIT_DEST_CONT
(byte) DTV_BLIT_DEST_CONT#0
(byte) DTV_BLIT_DEST_FWD
(byte) DTV_BLIT_DEST_FWD#0
(byte) DTV_BLIT_DISABLE_B
(byte) DTV_BLIT_DISABLE_B#0
(byte) DTV_BLIT_FORCE_START
(byte) DTV_BLIT_FORCE_START#0
(byte) DTV_BLIT_IRQ_EN
(byte) DTV_BLIT_IRQ_EN#0
(byte) DTV_BLIT_NAND
(byte) DTV_BLIT_NAND#0
(byte) DTV_BLIT_NOR
(byte) DTV_BLIT_NOR#0
(byte) DTV_BLIT_OR
(byte) DTV_BLIT_OR#0
(byte) DTV_BLIT_SHIFT0
(byte) DTV_BLIT_SHIFT0#0
(byte) DTV_BLIT_SHIFT1
(byte) DTV_BLIT_SHIFT1#0
(byte) DTV_BLIT_SHIFT2
(byte) DTV_BLIT_SHIFT2#0
(byte) DTV_BLIT_SHIFT3
(byte) DTV_BLIT_SHIFT3#0
(byte) DTV_BLIT_SHIFT4
(byte) DTV_BLIT_SHIFT4#0
(byte) DTV_BLIT_SHIFT5
(byte) DTV_BLIT_SHIFT5#0
(byte) DTV_BLIT_SHIFT6
(byte) DTV_BLIT_SHIFT6#0
(byte) DTV_BLIT_SHIFT7
(byte) DTV_BLIT_SHIFT7#0
(byte) DTV_BLIT_SRCA_CONT
(byte) DTV_BLIT_SRCA_CONT#0
(byte) DTV_BLIT_SRCA_FWD
(byte) DTV_BLIT_SRCA_FWD#0
(byte) DTV_BLIT_SRCB_CONT
(byte) DTV_BLIT_SRCB_CONT#0
(byte) DTV_BLIT_SRCB_FWD
(byte) DTV_BLIT_SRCB_FWD#0
(byte) DTV_BLIT_STATUS_BUSY
(byte) DTV_BLIT_STATUS_BUSY#0
(byte) DTV_BLIT_STATUS_IRQ
(byte) DTV_BLIT_STATUS_IRQ#0
(byte) DTV_BLIT_SUB
(byte) DTV_BLIT_SUB#0
(byte) DTV_BLIT_TRANSPARANCY_NONE
(byte) DTV_BLIT_TRANSPARANCY_NONE#0
(byte) DTV_BLIT_VBLANK
(byte) DTV_BLIT_VBLANK#0
(byte) DTV_BLIT_VIC_IRQ
(byte) DTV_BLIT_VIC_IRQ#0
(byte) DTV_BLIT_WRITE_NONTRANSPARENT
(byte) DTV_BLIT_WRITE_NONTRANSPARENT#0
(byte) DTV_BLIT_WRITE_TRANSPARENT
(byte) DTV_BLIT_WRITE_TRANSPARENT#0
(byte) DTV_BLIT_XNOR
(byte) DTV_BLIT_XNOR#0
(byte) DTV_BLIT_XOR
(byte) DTV_BLIT_XOR#0
(byte) DTV_BORDER_OFF
(byte) DTV_BORDER_OFF#0
(byte) DTV_CHUNKY
(byte) DTV_CHUNKY#0
(byte) DTV_COLORRAM_OFF
(byte) DTV_COLORRAM_OFF#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_DISABLE_TIL_RESET
(byte) DTV_FEATURE_DISABLE_TIL_RESET#0
(byte) DTV_FEATURE_ENABLE
(byte) DTV_FEATURE_ENABLE#0
(byte*) DTV_GRAPHICS_HICOL_BANK
(byte*) DTV_GRAPHICS_HICOL_BANK#0
(byte*) DTV_GRAPHICS_VIC_BANK
(byte*) DTV_GRAPHICS_VIC_BANK#0
(byte) DTV_HIGHCOLOR
(byte) DTV_HIGHCOLOR#0
(byte) DTV_LINEAR
(byte) DTV_LINEAR#0
(byte) DTV_OVERSCAN
(byte) DTV_OVERSCAN#0
(byte*) DTV_PALETTE
(byte*) DTV_PALETTE#0
(byte[$10]) DTV_PALETTE_DEFAULT
(byte[$10]) DTV_PALETTE_DEFAULT#0
(byte*) DTV_PLANEA_MODULO_HI
(byte*) DTV_PLANEA_MODULO_HI#0
(byte*) DTV_PLANEA_MODULO_LO
(byte*) DTV_PLANEA_MODULO_LO#0
(byte*) DTV_PLANEA_START_HI
(byte*) DTV_PLANEA_START_HI#0
(byte*) DTV_PLANEA_START_LO
(byte*) DTV_PLANEA_START_LO#0
(byte*) DTV_PLANEA_START_MI
(byte*) DTV_PLANEA_START_MI#0
(byte*) DTV_PLANEA_STEP
(byte*) DTV_PLANEA_STEP#0
(byte*) DTV_PLANEB_MODULO_HI
(byte*) DTV_PLANEB_MODULO_HI#0
(byte*) DTV_PLANEB_MODULO_LO
(byte*) DTV_PLANEB_MODULO_LO#0
(byte*) DTV_PLANEB_START_HI
(byte*) DTV_PLANEB_START_HI#0
(byte*) DTV_PLANEB_START_LO
(byte*) DTV_PLANEB_START_LO#0
(byte*) DTV_PLANEB_START_MI
(byte*) DTV_PLANEB_START_MI#0
(byte*) DTV_PLANEB_STEP
(byte*) DTV_PLANEB_STEP#0
(byte*) DTV_SPRITE_BANK
(byte*) DTV_SPRITE_BANK#0
(byte) GREEN
(byte) GREEN#0
(byte) GREY
(byte) GREY#0
(void()**) HARDWARE_IRQ
(void()**) HARDWARE_IRQ#0
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_BG#0
(byte) IRQ_COLLISION_SPRITE
(byte) IRQ_COLLISION_SPRITE#0
(byte*) IRQ_ENABLE
(byte*) IRQ_ENABLE#0
(byte) IRQ_LIGHTPEN
(byte) IRQ_LIGHTPEN#0
(byte) IRQ_RASTER
(byte) IRQ_RASTER#0
(byte*) IRQ_STATUS
(byte*) IRQ_STATUS#0
(void()**) KERNEL_IRQ
(void()**) KERNEL_IRQ#0
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_X#0
(byte*) LIGHTPEN_Y
(byte*) LIGHTPEN_Y#0
(byte) LIGHT_BLUE
(byte) LIGHT_BLUE#0
(byte) LIGHT_GREEN
(byte) LIGHT_GREEN#0
(byte) LIGHT_GREY
(byte) LIGHT_GREY#0
(byte) ORANGE
(byte) ORANGE#0
(byte) PINK
(byte) PINK#0
(byte*) PROCPORT
(byte*) PROCPORT#0
(byte) PROCPORT_BASIC_KERNEL_IO
(byte) PROCPORT_BASIC_KERNEL_IO#0
(byte*) PROCPORT_DDR
(byte*) PROCPORT_DDR#0
(byte) PROCPORT_DDR_MEMORY_MASK
(byte) PROCPORT_DDR_MEMORY_MASK#0
(byte) PROCPORT_KERNEL_IO
(byte) PROCPORT_KERNEL_IO#0
(byte) PROCPORT_RAM_ALL
(byte) PROCPORT_RAM_ALL#0
(byte) PROCPORT_RAM_CHARROM
(byte) PROCPORT_RAM_CHARROM#0
(byte) PROCPORT_RAM_IO
(byte) PROCPORT_RAM_IO#0
(byte) PURPLE
(byte) PURPLE#0
(byte*) RASTER
(byte*) RASTER#0
(byte) RED
(byte) RED#0
(byte*) SPRITES_COLS
(byte*) SPRITES_COLS#0
(byte*) SPRITES_ENABLE
(byte*) SPRITES_ENABLE#0
(byte*) SPRITES_EXPAND_X
(byte*) SPRITES_EXPAND_X#0
(byte*) SPRITES_EXPAND_Y
(byte*) SPRITES_EXPAND_Y#0
(byte*) SPRITES_MC
(byte*) SPRITES_MC#0
(byte*) SPRITES_MC1
(byte*) SPRITES_MC1#0
(byte*) SPRITES_MC2
(byte*) SPRITES_MC2#0
(byte*) SPRITES_PRIORITY
(byte*) SPRITES_PRIORITY#0
(byte*) SPRITES_XMSB
(byte*) SPRITES_XMSB#0
(byte*) SPRITES_XPOS
(byte*) SPRITES_XPOS#0
(byte*) SPRITES_YPOS
(byte*) SPRITES_YPOS#0
(word) SPRITE_PTRS
(word) SPRITE_PTRS#0
(byte) VIC_BMM
(byte) VIC_BMM#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_ECM
(byte) VIC_ECM#0
(byte) VIC_MCM
(byte) VIC_MCM#0
(byte*) VIC_MEMORY
(byte*) VIC_MEMORY#0
(byte) VIC_RSEL
(byte) VIC_RSEL#0
(byte) VIC_RST8
(byte) VIC_RST8#0
(byte) WHITE
(byte) WHITE#0
(byte) YELLOW
(byte) YELLOW#0
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(label) dtvSetCpuBankSegment1::@return
(byte*) dtvSetCpuBankSegment1::cpuBank
(byte*) dtvSetCpuBankSegment1::cpuBank#0
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#0
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1
(byte) dtvSetCpuBankSegment1::cpuBankIdx#2
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3
(void()) gfx_init_chunky()
(byte*~) gfx_init_chunky::$0
(byte~) gfx_init_chunky::$1
(byte~) gfx_init_chunky::$10
(bool~) gfx_init_chunky::$11
(bool~) gfx_init_chunky::$12
(byte/signed byte/word/signed word/dword/signed dword~) gfx_init_chunky::$3
(byte~) gfx_init_chunky::$4
(bool~) gfx_init_chunky::$6
(bool~) gfx_init_chunky::$7
(word~) gfx_init_chunky::$9
(label) gfx_init_chunky::@1
(label) gfx_init_chunky::@2
(label) gfx_init_chunky::@3
(label) gfx_init_chunky::@4
(label) gfx_init_chunky::@5
(label) gfx_init_chunky::@6
(label) gfx_init_chunky::@7
(label) gfx_init_chunky::@8
(label) gfx_init_chunky::@9
(label) gfx_init_chunky::@return
(byte) gfx_init_chunky::c
(byte) gfx_init_chunky::c#0
(byte*) gfx_init_chunky::gfxb
(byte*) gfx_init_chunky::gfxb#0
(byte*) gfx_init_chunky::gfxb#1
(byte*) gfx_init_chunky::gfxb#2
(byte*) gfx_init_chunky::gfxb#3
(byte*) gfx_init_chunky::gfxb#4
(byte*) gfx_init_chunky::gfxb#5
(byte*) gfx_init_chunky::gfxb#6
(byte) gfx_init_chunky::gfxbCpuBank
(byte) gfx_init_chunky::gfxbCpuBank#0
(byte) gfx_init_chunky::gfxbCpuBank#1
(byte) gfx_init_chunky::gfxbCpuBank#2
(byte) gfx_init_chunky::gfxbCpuBank#3
(byte) gfx_init_chunky::gfxbCpuBank#4
(byte) gfx_init_chunky::gfxbCpuBank#5
(byte) gfx_init_chunky::gfxbCpuBank#6
(byte) gfx_init_chunky::gfxbCpuBank#7
(byte) gfx_init_chunky::gfxbCpuBank#8
(byte) gfx_init_chunky::gfxbCpuBank#9
(word) gfx_init_chunky::x
(word) gfx_init_chunky::x#0
(word) gfx_init_chunky::x#1
(word) gfx_init_chunky::x#2
(word) gfx_init_chunky::x#3
(word) gfx_init_chunky::x#4
(word) gfx_init_chunky::x#5
(byte) gfx_init_chunky::y
(byte) gfx_init_chunky::y#0
(byte) gfx_init_chunky::y#1
(byte) gfx_init_chunky::y#2
(byte) gfx_init_chunky::y#3
(byte) gfx_init_chunky::y#4
(byte) gfx_init_chunky::y#5
(byte) gfx_init_chunky::y#6
(byte) gfx_init_chunky::y#7
(void()) main()
(byte~) main::$1
(byte~) main::$10
(word~) main::$11
(word/signed dword/dword~) main::$12
(byte~) main::$13
(byte/word/dword~) main::$14
(word~) main::$15
(word~) main::$16
(word~) main::$17
(byte~) main::$18
(word~) main::$19
(byte~) main::$2
(word~) main::$20
(byte~) main::$21
(byte~) main::$22
(byte~) main::$23
2018-04-28 06:41:05 +00:00
(bool~) main::$24
(byte~) main::$25
(byte~) main::$26
(byte/word/dword~) main::$27
2018-04-28 06:41:05 +00:00
(bool~) main::$28
(byte~) main::$29
(byte~) main::$3
(byte~) main::$30
(byte~) main::$31
(byte~) main::$32
(byte~) main::$33
2018-04-28 06:41:05 +00:00
(bool~) main::$34
(byte~) main::$4
(byte~) main::$5
(byte~) main::$6
(byte/word/dword~) main::$7
(byte~) main::$8
(byte~) main::$9
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@17
(label) main::@2
(label) main::@6
(label) main::@8
(label) main::@9
(label) main::@return
(byte) main::j
(byte) main::j#0
(byte) main::j#1
(byte) main::j#2
(byte) main::rst
(byte) main::rst#0
(byte) main::rst#1
(byte) main::rst#2
(byte) main::rst#3
Culled Empty Block (label) gfx_init_chunky::@9
Culled Empty Block (label) @8
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not [264] (bool~) gfx_init_chunky::$7 ← (byte*) gfx_init_chunky::gfxb#3 != (word/dword/signed dword) $8000 from [263] (bool~) gfx_init_chunky::$6 ← (byte*) gfx_init_chunky::gfxb#3 == (word/dword/signed dword) $8000
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte) main::rst#2 = (byte) main::rst#3
Alias (byte) gfx_init_chunky::gfxbCpuBank#0 = (byte~) gfx_init_chunky::$1 (byte) gfx_init_chunky::gfxbCpuBank#3
Alias (byte) gfx_init_chunky::c#0 = (byte~) gfx_init_chunky::$10
Alias (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#6 (byte) gfx_init_chunky::gfxbCpuBank#5
Alias (word) gfx_init_chunky::x#3 = (word) gfx_init_chunky::x#5 (word) gfx_init_chunky::x#4
Alias (byte) gfx_init_chunky::y#4 = (byte) gfx_init_chunky::y#7 (byte) gfx_init_chunky::y#5
Alias (byte) gfx_init_chunky::y#2 = (byte) gfx_init_chunky::y#3
Alias (byte*) gfx_init_chunky::gfxb#1 = (byte*) gfx_init_chunky::gfxb#6
Alias (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#9
Alias (byte) dtvSetCpuBankSegment1::cpuBankIdx#2 = (byte~) gfx_init_chunky::$4
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2AliasElimination
Alias (word) gfx_init_chunky::x#2 = (word) gfx_init_chunky::x#3
Alias (byte) gfx_init_chunky::y#2 = (byte) gfx_init_chunky::y#4
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte) main::rst#2
Self Phi Eliminated (byte) gfx_init_chunky::y#2
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte) main::rst#2 (byte) main::rst#0
Redundant Phi (byte) gfx_init_chunky::y#2 (byte) gfx_init_chunky::y#6
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2RedundantPhiElimination
Simple Condition (bool~) main::$24 [225] if((byte) main::j#1!=rangelast(0,$f)) goto main::@6
Simple Condition (bool~) main::$28 [236] if(*((byte*) RASTER#0)!=(byte) main::rst#0) goto main::@9
Simple Condition (bool~) main::$34 [249] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@11
Simple Condition (bool~) gfx_init_chunky::$7 [265] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3
Simple Condition (bool~) gfx_init_chunky::$11 [274] if((word) gfx_init_chunky::x#1!=rangelast(0,$13f)) goto gfx_init_chunky::@2
Simple Condition (bool~) gfx_init_chunky::$12 [284] if((byte) gfx_init_chunky::y#1!=rangelast(0,$32)) goto gfx_init_chunky::@1
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0
Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7
Constant (const byte*) PROCPORT#0 = ((byte*))1
Constant (const byte) PROCPORT_RAM_ALL#0 = $30
Constant (const byte) PROCPORT_RAM_IO#0 = $35
Constant (const byte) PROCPORT_RAM_CHARROM#0 = $31
Constant (const byte) PROCPORT_KERNEL_IO#0 = $36
Constant (const byte) PROCPORT_BASIC_KERNEL_IO#0 = $37
Constant (const byte*) CHARGEN#0 = ((byte*))$d000
Constant (const word) SPRITE_PTRS#0 = $3f8
Constant (const byte*) SPRITES_XPOS#0 = ((byte*))$d000
Constant (const byte*) SPRITES_YPOS#0 = ((byte*))$d001
Constant (const byte*) SPRITES_XMSB#0 = ((byte*))$d010
Constant (const byte*) RASTER#0 = ((byte*))$d012
Constant (const byte*) SPRITES_ENABLE#0 = ((byte*))$d015
Constant (const byte*) SPRITES_EXPAND_Y#0 = ((byte*))$d017
Constant (const byte*) SPRITES_PRIORITY#0 = ((byte*))$d01b
Constant (const byte*) SPRITES_MC#0 = ((byte*))$d01c
Constant (const byte*) SPRITES_EXPAND_X#0 = ((byte*))$d01d
Constant (const byte*) BORDERCOL#0 = ((byte*))$d020
Constant (const byte*) BGCOL#0 = ((byte*))$d021
Constant (const byte*) BGCOL1#0 = ((byte*))$d021
Constant (const byte*) BGCOL2#0 = ((byte*))$d022
Constant (const byte*) BGCOL3#0 = ((byte*))$d023
Constant (const byte*) BGCOL4#0 = ((byte*))$d024
Constant (const byte*) SPRITES_MC1#0 = ((byte*))$d025
Constant (const byte*) SPRITES_MC2#0 = ((byte*))$d026
Constant (const byte*) SPRITES_COLS#0 = ((byte*))$d027
Constant (const byte*) VIC_CONTROL#0 = ((byte*))$d011
Constant (const byte*) D011#0 = ((byte*))$d011
Constant (const byte) VIC_RST8#0 = $80
Constant (const byte) VIC_ECM#0 = $40
Constant (const byte) VIC_BMM#0 = $20
Constant (const byte) VIC_DEN#0 = $10
Constant (const byte) VIC_RSEL#0 = 8
Constant (const byte*) VIC_CONTROL2#0 = ((byte*))$d016
Constant (const byte*) D016#0 = ((byte*))$d016
Constant (const byte) VIC_MCM#0 = $10
Constant (const byte) VIC_CSEL#0 = 8
Constant (const byte*) D018#0 = ((byte*))$d018
Constant (const byte*) VIC_MEMORY#0 = ((byte*))$d018
Constant (const byte*) LIGHTPEN_X#0 = ((byte*))$d013
Constant (const byte*) LIGHTPEN_Y#0 = ((byte*))$d014
Constant (const byte*) IRQ_STATUS#0 = ((byte*))$d019
Constant (const byte*) IRQ_ENABLE#0 = ((byte*))$d01a
Constant (const byte) IRQ_RASTER#0 = 1
Constant (const byte) IRQ_COLLISION_BG#0 = 2
Constant (const byte) IRQ_COLLISION_SPRITE#0 = 4
Constant (const byte) IRQ_LIGHTPEN#0 = 8
Constant (const byte*) COLS#0 = ((byte*))$d800
Constant (const byte*) CIA1_PORT_A#0 = ((byte*))$dc00
Constant (const byte*) CIA1_PORT_B#0 = ((byte*))$dc01
Constant (const byte*) CIA1_PORT_A_DDR#0 = ((byte*))$dc02
Constant (const byte*) CIA1_PORT_B_DDR#0 = ((byte*))$dc03
Constant (const byte*) CIA1_INTERRUPT#0 = ((byte*))$dc0d
Constant (const byte) CIA_INTERRUPT_CLEAR#0 = $7f
Constant (const byte*) CIA2_PORT_A#0 = ((byte*))$dd00
Constant (const byte*) CIA2_PORT_B#0 = ((byte*))$dd01
Constant (const byte*) CIA2_PORT_A_DDR#0 = ((byte*))$dd02
Constant (const byte*) CIA2_PORT_B_DDR#0 = ((byte*))$dd03
Constant (const byte*) CIA2_INTERRUPT#0 = ((byte*))$dd0d
Constant (const void()**) KERNEL_IRQ#0 = ((void()**))$314
Constant (const void()**) HARDWARE_IRQ#0 = ((void()**))$fffe
Constant (const byte) BLACK#0 = 0
Constant (const byte) WHITE#0 = 1
Constant (const byte) RED#0 = 2
Constant (const byte) CYAN#0 = 3
Constant (const byte) PURPLE#0 = 4
Constant (const byte) GREEN#0 = 5
Constant (const byte) BLUE#0 = 6
Constant (const byte) YELLOW#0 = 7
Constant (const byte) ORANGE#0 = 8
Constant (const byte) BROWN#0 = 9
Constant (const byte) PINK#0 = $a
Constant (const byte) DARK_GREY#0 = $b
Constant (const byte) GREY#0 = $c
Constant (const byte) LIGHT_GREEN#0 = $d
Constant (const byte) LIGHT_BLUE#0 = $e
Constant (const byte) LIGHT_GREY#0 = $f
Constant (const byte*) DTV_FEATURE#0 = ((byte*))$d03f
Constant (const byte) DTV_FEATURE_ENABLE#0 = 1
Constant (const byte) DTV_FEATURE_DISABLE_TIL_RESET#0 = 2
Constant (const byte*) DTV_CONTROL#0 = ((byte*))$d03c
Constant (const byte) DTV_LINEAR#0 = 1
Constant (const byte) DTV_BORDER_OFF#0 = 2
Constant (const byte) DTV_HIGHCOLOR#0 = 4
Constant (const byte) DTV_OVERSCAN#0 = 8
Constant (const byte) DTV_COLORRAM_OFF#0 = $10
Constant (const byte) DTV_BADLINE_OFF#0 = $20
Constant (const byte) DTV_CHUNKY#0 = $40
Constant (const byte*) DTV_PALETTE#0 = ((byte*))$d200
Constant (const byte[$10]) DTV_PALETTE_DEFAULT#0 = { 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a }
Constant (const byte*) DTV_PLANEA_START_LO#0 = ((byte*))$d03a
Constant (const byte*) DTV_PLANEA_START_MI#0 = ((byte*))$d03b
Constant (const byte*) DTV_PLANEA_START_HI#0 = ((byte*))$d045
Constant (const byte*) DTV_PLANEA_STEP#0 = ((byte*))$d046
Constant (const byte*) DTV_PLANEA_MODULO_LO#0 = ((byte*))$d038
Constant (const byte*) DTV_PLANEA_MODULO_HI#0 = ((byte*))$d039
Constant (const byte*) DTV_PLANEB_START_LO#0 = ((byte*))$d049
Constant (const byte*) DTV_PLANEB_START_MI#0 = ((byte*))$d04a
Constant (const byte*) DTV_PLANEB_START_HI#0 = ((byte*))$d04b
Constant (const byte*) DTV_PLANEB_STEP#0 = ((byte*))$d04c
Constant (const byte*) DTV_PLANEB_MODULO_LO#0 = ((byte*))$d047
Constant (const byte*) DTV_PLANEB_MODULO_HI#0 = ((byte*))$d048
Constant (const byte*) DTV_SPRITE_BANK#0 = ((byte*))$d04d
Constant (const byte*) DTV_COLOR_BANK_LO#0 = ((byte*))$d036
Constant (const byte*) DTV_COLOR_BANK_HI#0 = ((byte*))$d037
Constant (const dword) DTV_COLOR_BANK_DEFAULT#0 = $1d800
Constant (const byte*) DTV_GRAPHICS_VIC_BANK#0 = ((byte*))$d03d
Constant (const byte*) DTV_GRAPHICS_HICOL_BANK#0 = ((byte*))$d03e
Constant (const byte*) dtvSetCpuBankSegment1::cpuBank#0 = ((byte*))$ff
Constant (const byte*) DTV_BLITTER_SRCA_LO#0 = ((byte*))$d320
Constant (const byte*) DTV_BLITTER_SRCA_MI#0 = ((byte*))$d321
Constant (const byte*) DTV_BLITTER_SRCA_HI#0 = ((byte*))$d322
Constant (const byte*) DTV_BLITTER_SRCA_MOD_LO#0 = ((byte*))$d323
Constant (const byte*) DTV_BLITTER_SRCA_MOD_HI#0 = ((byte*))$d324
Constant (const byte*) DTV_BLITTER_SRCA_LIN_LO#0 = ((byte*))$d325
Constant (const byte*) DTV_BLITTER_SRCA_LIN_HI#0 = ((byte*))$d326
Constant (const byte*) DTV_BLITTER_SRCA_STEP#0 = ((byte*))$d327
Constant (const byte*) DTV_BLITTER_SRCB_LO#0 = ((byte*))$d328
Constant (const byte*) DTV_BLITTER_SRCB_MI#0 = ((byte*))$d329
Constant (const byte*) DTV_BLITTER_SRCB_HI#0 = ((byte*))$d32a
Constant (const byte*) DTV_BLITTER_SRCB_MOD_LO#0 = ((byte*))$d32b
Constant (const byte*) DTV_BLITTER_SRCB_MOD_HI#0 = ((byte*))$d32c
Constant (const byte*) DTV_BLITTER_SRCB_LIN_LO#0 = ((byte*))$d32d
Constant (const byte*) DTV_BLITTER_SRCB_LIN_HI#0 = ((byte*))$d32e
Constant (const byte*) DTV_BLITTER_SRCB_STEP#0 = ((byte*))$d32f
Constant (const byte*) DTV_BLITTER_DEST_LO#0 = ((byte*))$d330
Constant (const byte*) DTV_BLITTER_DEST_MI#0 = ((byte*))$d331
Constant (const byte*) DTV_BLITTER_DEST_HI#0 = ((byte*))$d332
Constant (const byte*) DTV_BLITTER_DEST_MOD_LO#0 = ((byte*))$d333
Constant (const byte*) DTV_BLITTER_DEST_MOD_HI#0 = ((byte*))$d334
Constant (const byte*) DTV_BLITTER_DEST_LIN_LO#0 = ((byte*))$d335
Constant (const byte*) DTV_BLITTER_DEST_LIN_HI#0 = ((byte*))$d336
Constant (const byte*) DTV_BLITTER_DEST_STEP#0 = ((byte*))$d337
Constant (const byte*) DTV_BLITTER_LEN_LO#0 = ((byte*))$d338
Constant (const byte*) DTV_BLITTER_LEN_HI#0 = ((byte*))$d339
Constant (const byte*) DTV_BLITTER_CONTROL#0 = ((byte*))$d33a
Constant (const byte) DTV_BLIT_FORCE_START#0 = 1
Constant (const byte) DTV_BLIT_SRCA_FWD#0 = 2
Constant (const byte) DTV_BLIT_SRCB_FWD#0 = 4
Constant (const byte) DTV_BLIT_DEST_FWD#0 = 8
Constant (const byte) DTV_BLIT_VIC_IRQ#0 = $10
Constant (const byte) DTV_BLIT_CIA_IRQ#0 = $20
Constant (const byte) DTV_BLIT_VBLANK#0 = $40
Constant (const byte) DTV_BLIT_IRQ_EN#0 = $80
Constant (const byte*) DTV_BLITTER_TRANSPARANCY#0 = ((byte*))$d33b
Constant (const byte) DTV_BLIT_DISABLE_B#0 = 1
Constant (const byte) DTV_BLIT_WRITE_TRANSPARENT#0 = 2
Constant (const byte) DTV_BLIT_WRITE_NONTRANSPARENT#0 = 4
Constant (const byte) DTV_BLIT_TRANSPARANCY_NONE#0 = 0
Constant (const byte*) DTV_BLITTER_ALU#0 = ((byte*))$d33e
Constant (const byte) DTV_BLIT_SHIFT0#0 = 0
Constant (const byte) DTV_BLIT_SHIFT1#0 = 1
Constant (const byte) DTV_BLIT_SHIFT2#0 = 2
Constant (const byte) DTV_BLIT_SHIFT3#0 = 3
Constant (const byte) DTV_BLIT_SHIFT4#0 = 4
Constant (const byte) DTV_BLIT_SHIFT5#0 = 5
Constant (const byte) DTV_BLIT_SHIFT6#0 = 6
Constant (const byte) DTV_BLIT_SHIFT7#0 = 7
Constant (const byte) DTV_BLIT_AND#0 = 0
Constant (const byte) DTV_BLIT_NAND#0 = 8
Constant (const byte) DTV_BLIT_NOR#0 = $10
Constant (const byte) DTV_BLIT_OR#0 = $18
Constant (const byte) DTV_BLIT_XOR#0 = $20
Constant (const byte) DTV_BLIT_XNOR#0 = $28
Constant (const byte) DTV_BLIT_ADD#0 = $30
Constant (const byte) DTV_BLIT_SUB#0 = $38
Constant (const byte*) DTV_BLITTER_CONTROL2#0 = ((byte*))$d33f
Constant (const byte) DTV_BLIT_CLEAR_IRQ#0 = 1
Constant (const byte) DTV_BLIT_SRCA_CONT#0 = 2
Constant (const byte) DTV_BLIT_SRCB_CONT#0 = 4
Constant (const byte) DTV_BLIT_DEST_CONT#0 = 8
Constant (const byte) DTV_BLIT_STATUS_BUSY#0 = 1
Constant (const byte) DTV_BLIT_STATUS_IRQ#0 = 2
Constant (const byte*) CHUNKY#0 = ((byte*))$8000
Constant (const byte) main::j#0 = 0
Constant (const byte) main::rst#0 = $42
Constant (const byte*) gfx_init_chunky::gfxb#0 = ((byte*))$4000
Constant (const byte) gfx_init_chunky::y#0 = 0
Constant (const word) gfx_init_chunky::x#0 = 0
Constant (const byte*) gfx_init_chunky::gfxb#2 = ((byte*))$4000
Constant (const byte/signed byte/word/signed word/dword/signed dword) gfx_init_chunky::$3 = $4000/$4000
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$1 = DTV_HIGHCOLOR#0|DTV_LINEAR#0
Constant (const byte) main::$5 = VIC_DEN#0|VIC_ECM#0
Constant (const byte) main::$8 = VIC_MCM#0|VIC_CSEL#0
Constant (const byte) main::$9 = <CHUNKY#0
Constant (const byte) main::$10 = >CHUNKY#0
Constant (const word) main::$11 = ((word))CHUNKY#0
Constant (const word) main::$15 = ((word))CHUNKY#0
Constant (const word) main::$19 = ((word))CHUNKY#0
Constant (const byte) main::$25 = VIC_DEN#0|VIC_ECM#0
Constant (const byte) main::$29 = VIC_DEN#0|VIC_ECM#0
Constant (const byte*) gfx_init_chunky::$0 = CHUNKY#0/$4000
Constant (const byte) dtvSetCpuBankSegment1::cpuBankIdx#2 = ((byte))gfx_init_chunky::$3
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$2 = main::$1|DTV_COLORRAM_OFF#0
Constant (const byte) main::$6 = main::$5|VIC_RSEL#0
Constant (const word/signed dword/dword) main::$12 = main::$11/$4000
Constant (const word) main::$16 = main::$15&$3fff
Constant (const word) main::$20 = main::$19&$3fff
Constant (const byte) main::$26 = main::$25|VIC_RSEL#0
Constant (const byte) main::$30 = main::$29|VIC_RSEL#0
Constant (const byte) gfx_init_chunky::gfxbCpuBank#0 = ((byte))gfx_init_chunky::$0
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$3 = main::$2|DTV_CHUNKY#0
Constant (const byte/word/dword) main::$7 = main::$6|3
Constant (const byte) main::$13 = ((byte))main::$12
Constant (const word) main::$17 = main::$16>>6
Constant (const byte) main::$21 = >main::$20
Constant (const byte/word/dword) main::$27 = main::$26|3
Constant (const byte) dtvSetCpuBankSegment1::cpuBankIdx#0 = gfx_init_chunky::gfxbCpuBank#0
Constant (const byte) gfx_init_chunky::gfxbCpuBank#1 = ++gfx_init_chunky::gfxbCpuBank#0
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$4 = main::$3|DTV_BADLINE_OFF#0
Constant (const byte/word/dword) main::$14 = 3^main::$13
Constant (const byte) main::$18 = ((byte))main::$17
Constant (const byte) main::$22 = main::$21>>2
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$23 = main::$18|main::$22
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [25] if(true) goto main::@2
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIfs
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2EliminateUnusedBlocks
Resolved ranged next value main::j#1 ← ++ main::j#2 to ++
Resolved ranged comparison value if(main::j#1!=rangelast(0,$f)) goto main::@6 to (byte/signed byte/word/signed word/dword/signed dword) $10
Resolved ranged next value gfx_init_chunky::x#1 ← ++ gfx_init_chunky::x#2 to ++
Resolved ranged comparison value if(gfx_init_chunky::x#1!=rangelast(0,$13f)) goto gfx_init_chunky::@2 to (word/signed word/dword/signed dword) $140
Resolved ranged next value gfx_init_chunky::y#1 ← ++ gfx_init_chunky::y#6 to ++
Resolved ranged comparison value if(gfx_init_chunky::y#1!=rangelast(0,$32)) goto gfx_init_chunky::@1 to (byte/signed byte/word/signed word/dword/signed dword) $33
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@9
Culled Empty Block (label) gfx_init_chunky::@7
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2CullEmptyBlocks
Inlining constant with var siblings (const byte) dtvSetCpuBankSegment1::cpuBankIdx#2
Inlining constant with var siblings (const byte) dtvSetCpuBankSegment1::cpuBankIdx#0
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::rst#0
Inlining constant with var siblings (const byte*) gfx_init_chunky::gfxb#0
Inlining constant with var siblings (const byte) gfx_init_chunky::y#0
Inlining constant with var siblings (const word) gfx_init_chunky::x#0
Inlining constant with var siblings (const byte*) gfx_init_chunky::gfxb#2
Inlining constant with var siblings (const byte) gfx_init_chunky::gfxbCpuBank#0
Inlining constant with var siblings (const byte) gfx_init_chunky::gfxbCpuBank#1
Constant inlined dtvSetCpuBankSegment1::cpuBankIdx#0 = ((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::rst#0 = (byte/signed byte/word/signed word/dword/signed dword) $42
Constant inlined dtvSetCpuBankSegment1::cpuBankIdx#2 = ((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000
Constant inlined main::$12 = ((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::$13 = ((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::$14 = (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined gfx_init_chunky::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$15 = ((word))(const byte*) CHUNKY#0
Constant inlined gfx_init_chunky::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$30 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0
Constant inlined main::$10 = >(const byte*) CHUNKY#0
Constant inlined main::$11 = ((word))(const byte*) CHUNKY#0
Constant inlined main::$16 = ((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff
Constant inlined main::$17 = ((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined main::$18 = ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6
Constant inlined main::$19 = ((word))(const byte*) CHUNKY#0
Constant inlined main::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$23 = ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined gfx_init_chunky::gfxbCpuBank#1 = ++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::$25 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0
Constant inlined main::$26 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0
Constant inlined gfx_init_chunky::gfxb#2 = ((byte*))(word/signed word/dword/signed dword) $4000
Constant inlined main::$20 = ((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff
Constant inlined gfx_init_chunky::gfxb#0 = ((byte*))(word/signed word/dword/signed dword) $4000
Constant inlined main::$21 = >((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff
Constant inlined main::$22 = >((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined gfx_init_chunky::gfxbCpuBank#0 = ((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::$1 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0
Constant inlined main::$27 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined main::$2 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0
Constant inlined main::$29 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0
Constant inlined main::$5 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0
Constant inlined main::$6 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0
Constant inlined main::$3 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0
Constant inlined main::$4 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0
Constant inlined gfx_init_chunky::$0 = (const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
Constant inlined main::$9 = <(const byte*) CHUNKY#0
Constant inlined main::$7 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined gfx_init_chunky::$3 = (word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000
Constant inlined main::$8 = (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@18(between main::@6 and main::@6)
Added new block during phi lifting gfx_init_chunky::@10(between gfx_init_chunky::@5 and gfx_init_chunky::@1)
Added new block during phi lifting gfx_init_chunky::@11(between gfx_init_chunky::@3 and gfx_init_chunky::@2)
Added new block during phi lifting gfx_init_chunky::@12(between gfx_init_chunky::@2 and gfx_init_chunky::@3)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @7
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init_chunky
Adding NOP phi() at start of gfx_init_chunky::@6
CALL GRAPH
Calls in [] to main:2
Calls in [main] to gfx_init_chunky:7
Calls in [gfx_init_chunky] to dtvSetCpuBankSegment1:40 dtvSetCpuBankSegment1:48 dtvSetCpuBankSegment1:61
Created 10 initial phi equivalence classes
Coalesced [38] main::j#3 ← main::j#1
Coalesced [42] gfx_init_chunky::gfxb#8 ← gfx_init_chunky::gfxb#5
Coalesced [43] gfx_init_chunky::gfxbCpuBank#11 ← gfx_init_chunky::gfxbCpuBank#7
Coalesced [47] dtvSetCpuBankSegment1::cpuBankIdx#4 ← dtvSetCpuBankSegment1::cpuBankIdx#1
Coalesced [50] gfx_init_chunky::gfxbCpuBank#14 ← gfx_init_chunky::gfxbCpuBank#2
Coalesced [63] gfx_init_chunky::gfxb#7 ← gfx_init_chunky::gfxb#1
Coalesced [64] gfx_init_chunky::y#8 ← gfx_init_chunky::y#1
Coalesced [65] gfx_init_chunky::gfxbCpuBank#10 ← gfx_init_chunky::gfxbCpuBank#8
Coalesced (already) [66] gfx_init_chunky::gfxb#9 ← gfx_init_chunky::gfxb#1
Coalesced [67] gfx_init_chunky::x#6 ← gfx_init_chunky::x#1
Coalesced (already) [68] gfx_init_chunky::gfxbCpuBank#12 ← gfx_init_chunky::gfxbCpuBank#8
Coalesced [69] gfx_init_chunky::gfxb#10 ← gfx_init_chunky::gfxb#3
Coalesced (already) [70] gfx_init_chunky::gfxbCpuBank#13 ← gfx_init_chunky::gfxbCpuBank#4
Coalesced down to 6 phi equivalence classes
Culled Empty Block (label) main::@18
Culled Empty Block (label) gfx_init_chunky::@10
Culled Empty Block (label) gfx_init_chunky::@11
Culled Empty Block (label) gfx_init_chunky::@12
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @7
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init_chunky
Adding NOP phi() at start of gfx_init_chunky::@6
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
2018-11-11 20:51:36 +00:00
[0] phi()
to:@7
@7: scope:[] from @begin
2018-11-11 20:51:36 +00:00
[1] phi()
[2] call main
to:@end
@end: scope:[] from @7
2018-11-11 20:51:36 +00:00
[3] phi()
main: scope:[main] from @7
asm { sei }
2018-11-11 20:51:36 +00:00
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
[7] call gfx_init_chunky
to:main::@17
main::@17: scope:[main] from main
2018-11-11 20:51:36 +00:00
[8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0
[9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0
[10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
[12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0
[13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0
[14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8
[16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3
[19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000
[20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2
to:main::@6
main::@6: scope:[main] from main::@17 main::@6
[21] (byte) main::j#2 ← phi( main::@17/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@6/(byte) main::j#1 )
2018-11-11 20:51:36 +00:00
[22] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2
[23] (byte) main::j#1 ← ++ (byte) main::j#2
[24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@6
to:main::@2
main::@2: scope:[main] from main::@11 main::@6
asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
2018-11-11 20:51:36 +00:00
[26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@8
main::@8: scope:[main] from main::@2 main::@8
[28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8
to:main::@10
main::@10: scope:[main] from main::@8
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
to:main::@11
main::@11: scope:[main] from main::@10 main::@11
2018-11-11 20:51:36 +00:00
[30] (byte) main::rst#1 ← *((const byte*) RASTER#0)
[31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7
[32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31
[33] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$32
[34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4
[35] *((const byte*) BORDERCOL#0) ← (byte~) main::$33
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
[37] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@11
to:main::@2
gfx_init_chunky: scope:[gfx_init_chunky] from main
2018-11-11 20:51:36 +00:00
[38] phi()
[39] call dtvSetCpuBankSegment1
to:gfx_init_chunky::@1
gfx_init_chunky::@1: scope:[gfx_init_chunky] from gfx_init_chunky gfx_init_chunky::@5
[40] (byte) gfx_init_chunky::gfxbCpuBank#7 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky/++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 )
2018-11-11 20:51:36 +00:00
[40] (byte) gfx_init_chunky::y#6 ← phi( gfx_init_chunky::@5/(byte) gfx_init_chunky::y#1 gfx_init_chunky/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[40] (byte*) gfx_init_chunky::gfxb#5 ← phi( gfx_init_chunky::@5/(byte*) gfx_init_chunky::gfxb#1 gfx_init_chunky/((byte*))(word/signed word/dword/signed dword) $4000 )
to:gfx_init_chunky::@2
gfx_init_chunky::@2: scope:[gfx_init_chunky] from gfx_init_chunky::@1 gfx_init_chunky::@3
2018-11-11 20:51:36 +00:00
[41] (byte) gfx_init_chunky::gfxbCpuBank#4 ← phi( gfx_init_chunky::@1/(byte) gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::@3/(byte) gfx_init_chunky::gfxbCpuBank#8 )
[41] (word) gfx_init_chunky::x#2 ← phi( gfx_init_chunky::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gfx_init_chunky::@3/(word) gfx_init_chunky::x#1 )
[41] (byte*) gfx_init_chunky::gfxb#3 ← phi( gfx_init_chunky::@1/(byte*) gfx_init_chunky::gfxb#5 gfx_init_chunky::@3/(byte*) gfx_init_chunky::gfxb#1 )
[42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3
to:gfx_init_chunky::@4
gfx_init_chunky::@4: scope:[gfx_init_chunky] from gfx_init_chunky::@2
2018-11-11 20:51:36 +00:00
[43] (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4
[44] call dtvSetCpuBankSegment1
to:gfx_init_chunky::@8
gfx_init_chunky::@8: scope:[gfx_init_chunky] from gfx_init_chunky::@4
2018-11-11 20:51:36 +00:00
[45] (byte) gfx_init_chunky::gfxbCpuBank#2 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#4
to:gfx_init_chunky::@3
gfx_init_chunky::@3: scope:[gfx_init_chunky] from gfx_init_chunky::@2 gfx_init_chunky::@8
2018-11-11 20:51:36 +00:00
[46] (byte) gfx_init_chunky::gfxbCpuBank#8 ← phi( gfx_init_chunky::@2/(byte) gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::@8/(byte) gfx_init_chunky::gfxbCpuBank#2 )
[46] (byte*) gfx_init_chunky::gfxb#4 ← phi( gfx_init_chunky::@2/(byte*) gfx_init_chunky::gfxb#3 gfx_init_chunky::@8/((byte*))(word/signed word/dword/signed dword) $4000 )
[47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6
[48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9
2018-11-11 20:51:36 +00:00
[49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0
[50] (byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4
[51] (word) gfx_init_chunky::x#1 ← ++ (word) gfx_init_chunky::x#2
[52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2
to:gfx_init_chunky::@5
gfx_init_chunky::@5: scope:[gfx_init_chunky] from gfx_init_chunky::@3
2018-11-11 20:51:36 +00:00
[53] (byte) gfx_init_chunky::y#1 ← ++ (byte) gfx_init_chunky::y#6
[54] if((byte) gfx_init_chunky::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $33) goto gfx_init_chunky::@1
to:gfx_init_chunky::@6
gfx_init_chunky::@6: scope:[gfx_init_chunky] from gfx_init_chunky::@5
2018-11-11 20:51:36 +00:00
[55] phi()
[56] call dtvSetCpuBankSegment1
to:gfx_init_chunky::@return
gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@6
2018-11-11 20:51:36 +00:00
[57] return
to:@return
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6
[58] (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 )
2018-11-11 20:51:36 +00:00
[59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3
asm { .byte$32,$dd lda$ff .byte$32,$00 }
to:dtvSetCpuBankSegment1::@return
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
2018-11-11 20:51:36 +00:00
[61] return
to:@return
VARIABLE REGISTER WEIGHTS
(byte*) BGCOL
(byte*) BGCOL1
(byte*) BGCOL2
(byte*) BGCOL3
(byte*) BGCOL4
(byte) BLACK
(byte) BLUE
(byte*) BORDERCOL
(byte) BROWN
(byte*) CHARGEN
(byte*) CHUNKY
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B_DDR
(byte*) CIA2_INTERRUPT
(byte*) CIA2_PORT_A
(byte*) CIA2_PORT_A_DDR
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B_DDR
(byte) CIA_INTERRUPT_CLEAR
(byte*) COLS
(byte) CYAN
(byte*) D011
(byte*) D016
(byte*) D018
(byte) DARK_GREY
(byte) DTV_BADLINE_OFF
(byte*) DTV_BLITTER_ALU
(byte*) DTV_BLITTER_CONTROL
(byte*) DTV_BLITTER_CONTROL2
(byte*) DTV_BLITTER_DEST_HI
(byte*) DTV_BLITTER_DEST_LIN_HI
(byte*) DTV_BLITTER_DEST_LIN_LO
(byte*) DTV_BLITTER_DEST_LO
(byte*) DTV_BLITTER_DEST_MI
(byte*) DTV_BLITTER_DEST_MOD_HI
(byte*) DTV_BLITTER_DEST_MOD_LO
(byte*) DTV_BLITTER_DEST_STEP
(byte*) DTV_BLITTER_LEN_HI
(byte*) DTV_BLITTER_LEN_LO
(byte*) DTV_BLITTER_SRCA_HI
(byte*) DTV_BLITTER_SRCA_LIN_HI
(byte*) DTV_BLITTER_SRCA_LIN_LO
(byte*) DTV_BLITTER_SRCA_LO
(byte*) DTV_BLITTER_SRCA_MI
(byte*) DTV_BLITTER_SRCA_MOD_HI
(byte*) DTV_BLITTER_SRCA_MOD_LO
(byte*) DTV_BLITTER_SRCA_STEP
(byte*) DTV_BLITTER_SRCB_HI
(byte*) DTV_BLITTER_SRCB_LIN_HI
(byte*) DTV_BLITTER_SRCB_LIN_LO
(byte*) DTV_BLITTER_SRCB_LO
(byte*) DTV_BLITTER_SRCB_MI
(byte*) DTV_BLITTER_SRCB_MOD_HI
(byte*) DTV_BLITTER_SRCB_MOD_LO
(byte*) DTV_BLITTER_SRCB_STEP
(byte*) DTV_BLITTER_TRANSPARANCY
(byte) DTV_BLIT_ADD
(byte) DTV_BLIT_AND
(byte) DTV_BLIT_CIA_IRQ
(byte) DTV_BLIT_CLEAR_IRQ
(byte) DTV_BLIT_DEST_CONT
(byte) DTV_BLIT_DEST_FWD
(byte) DTV_BLIT_DISABLE_B
(byte) DTV_BLIT_FORCE_START
(byte) DTV_BLIT_IRQ_EN
(byte) DTV_BLIT_NAND
(byte) DTV_BLIT_NOR
(byte) DTV_BLIT_OR
(byte) DTV_BLIT_SHIFT0
(byte) DTV_BLIT_SHIFT1
(byte) DTV_BLIT_SHIFT2
(byte) DTV_BLIT_SHIFT3
(byte) DTV_BLIT_SHIFT4
(byte) DTV_BLIT_SHIFT5
(byte) DTV_BLIT_SHIFT6
(byte) DTV_BLIT_SHIFT7
(byte) DTV_BLIT_SRCA_CONT
(byte) DTV_BLIT_SRCA_FWD
(byte) DTV_BLIT_SRCB_CONT
(byte) DTV_BLIT_SRCB_FWD
(byte) DTV_BLIT_STATUS_BUSY
(byte) DTV_BLIT_STATUS_IRQ
(byte) DTV_BLIT_SUB
(byte) DTV_BLIT_TRANSPARANCY_NONE
(byte) DTV_BLIT_VBLANK
(byte) DTV_BLIT_VIC_IRQ
(byte) DTV_BLIT_WRITE_NONTRANSPARENT
(byte) DTV_BLIT_WRITE_TRANSPARENT
(byte) DTV_BLIT_XNOR
(byte) DTV_BLIT_XOR
(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[$10]) 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
(void()**) HARDWARE_IRQ
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_SPRITE
(byte*) IRQ_ENABLE
(byte) IRQ_LIGHTPEN
(byte) IRQ_RASTER
(byte*) IRQ_STATUS
(void()**) KERNEL_IRQ
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_Y
(byte) LIGHT_BLUE
(byte) LIGHT_GREEN
(byte) LIGHT_GREY
(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
(word) SPRITE_PTRS
(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)
(byte*) dtvSetCpuBankSegment1::cpuBank
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 202.0
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 103.0
(void()) gfx_init_chunky()
(word~) gfx_init_chunky::$9 202.0
(byte) gfx_init_chunky::c
(byte) gfx_init_chunky::c#0 202.0
(byte*) gfx_init_chunky::gfxb
(byte*) gfx_init_chunky::gfxb#1 42.599999999999994
(byte*) gfx_init_chunky::gfxb#3 157.0
(byte*) gfx_init_chunky::gfxb#4 75.75
(byte*) gfx_init_chunky::gfxb#5 22.0
(byte) gfx_init_chunky::gfxbCpuBank
(byte) gfx_init_chunky::gfxbCpuBank#2 202.0
(byte) gfx_init_chunky::gfxbCpuBank#4 103.75
(byte) gfx_init_chunky::gfxbCpuBank#7 22.0
(byte) gfx_init_chunky::gfxbCpuBank#8 34.888888888888886
(word) gfx_init_chunky::x
(word) gfx_init_chunky::x#1 151.5
(word) gfx_init_chunky::x#2 30.299999999999997
(byte) gfx_init_chunky::y
(byte) gfx_init_chunky::y#1 16.5
(byte) gfx_init_chunky::y#6 9.461538461538462
(void()) main()
(byte~) main::$31 202.0
(byte~) main::$32 202.0
(byte~) main::$33 202.0
(byte) main::j
(byte) main::j#1 16.5
(byte) main::j#2 22.0
(byte) main::rst
(byte) main::rst#1 57.714285714285715
Initial phi equivalence classes
[ main::j#2 main::j#1 ]
[ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
[ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
[ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
[ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
[ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Added variable main::rst#1 to zero page equivalence class [ main::rst#1 ]
Added variable main::$31 to zero page equivalence class [ main::$31 ]
Added variable main::$32 to zero page equivalence class [ main::$32 ]
Added variable main::$33 to zero page equivalence class [ main::$33 ]
Added variable gfx_init_chunky::$9 to zero page equivalence class [ gfx_init_chunky::$9 ]
Added variable gfx_init_chunky::c#0 to zero page equivalence class [ gfx_init_chunky::c#0 ]
Complete equivalence classes
[ main::j#2 main::j#1 ]
[ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
[ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
[ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
[ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
[ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
[ main::rst#1 ]
[ main::$31 ]
[ main::$32 ]
[ main::$33 ]
[ gfx_init_chunky::$9 ]
[ gfx_init_chunky::c#0 ]
Allocated zp ZP_BYTE:2 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Allocated zp ZP_WORD:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
Allocated zp ZP_BYTE:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
Allocated zp ZP_WORD:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
Allocated zp ZP_BYTE:9 [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Allocated zp ZP_BYTE:10 [ main::rst#1 ]
Allocated zp ZP_BYTE:11 [ main::$31 ]
Allocated zp ZP_BYTE:12 [ main::$32 ]
Allocated zp ZP_BYTE:13 [ main::$33 ]
Allocated zp ZP_WORD:14 [ gfx_init_chunky::$9 ]
Allocated zp ZP_BYTE:16 [ gfx_init_chunky::c#0 ]
INITIAL ASM
//SEG0 File Comments
2019-02-17 23:12:29 +00:00
// C64DTV 8bpp charmode stretcher
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
2019-02-17 23:12:29 +00:00
// Processor port data direction register
.label PROCPORT_DDR = 0
2019-02-17 23:12:29 +00:00
// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
.const PROCPORT_DDR_MEMORY_MASK = 7
2019-02-17 23:12:29 +00:00
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
2019-02-17 23:12:29 +00:00
// RAM in $A000, $E000 I/O in $D000
.const PROCPORT_RAM_IO = $35
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_ECM = $40
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_CONTROL2 = $d016
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
2019-02-17 23:12:29 +00:00
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
2019-02-17 23:12:29 +00:00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
2019-02-17 23:12:29 +00:00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
2019-02-17 23:12:29 +00:00
// Controls the graphics modes of the C64 DTV
.label DTV_CONTROL = $d03c
.const DTV_LINEAR = 1
.const DTV_HIGHCOLOR = 4
.const DTV_COLORRAM_OFF = $10
.const DTV_BADLINE_OFF = $20
.const DTV_CHUNKY = $40
2019-02-17 23:12:29 +00:00
// Defines colors for the 16 first colors ($00-$0f)
.label DTV_PALETTE = $d200
2019-02-17 23:12:29 +00:00
// Linear Graphics Plane B Counter Control
.label DTV_PLANEB_START_LO = $d049
.label DTV_PLANEB_START_MI = $d04a
.label DTV_PLANEB_START_HI = $d04b
.label DTV_PLANEB_STEP = $d04c
.label DTV_PLANEB_MODULO_LO = $d047
.label DTV_PLANEB_MODULO_HI = $d048
2019-02-17 23:12:29 +00:00
// Plane with all pixels
.label CHUNKY = $8000
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @7 [phi:@begin->@7]
b7_from_bbegin:
jmp b7
//SEG5 @7
b7:
//SEG6 [2] call main
jsr main
//SEG7 [3] phi from @7 to @end [phi:@7->@end]
bend_from_b7:
jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
.label _31 = $b
.label _32 = $c
.label _33 = $d
.label j = 2
.label rst = $a
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Disable normal interrupt (prevent keyboard reading glitches and allows to hide basic/kernal)
// Disable kernal & basic
lda #PROCPORT_DDR_MEMORY_MASK
sta PROCPORT_DDR
//SEG12 [6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
//SEG13 [7] call gfx_init_chunky
//SEG14 [38] phi from main to gfx_init_chunky [phi:main->gfx_init_chunky]
gfx_init_chunky_from_main:
jsr gfx_init_chunky
jmp b17
//SEG15 main::@17
b17:
//SEG16 [8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Enable DTV extended modes
lda #DTV_FEATURE_ENABLE
sta DTV_FEATURE
//SEG17 [9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// 8BPP Pixel Cell Mode
lda #DTV_HIGHCOLOR|DTV_LINEAR|DTV_COLORRAM_OFF|DTV_CHUNKY|DTV_BADLINE_OFF
sta DTV_CONTROL
//SEG18 [10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG19 [11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2
lda #VIC_MCM|VIC_CSEL
sta VIC_CONTROL2
//SEG20 [12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Plane B: CHUNKY
lda #<CHUNKY
sta DTV_PLANEB_START_LO
//SEG21 [13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
lda #>CHUNKY
sta DTV_PLANEB_START_MI
//SEG22 [14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_START_HI
//SEG23 [15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- _deref_pbuc1=vbuc2
lda #8
sta DTV_PLANEB_STEP
//SEG24 [16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_LO
//SEG25 [17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
//SEG26 [18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
//SEG27 [19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
//SEG28 [20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank
// VIC memory
lda #(CHUNKY&$3fff)>>6|(0)>>2
sta VIC_MEMORY
//SEG29 [21] phi from main::@17 to main::@6 [phi:main::@17->main::@6]
b6_from_b17:
//SEG30 [21] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@17->main::@6#0] -- vbuz1=vbuc1
lda #0
sta j
jmp b6
2019-02-17 23:12:29 +00:00
// DTV Palette - Grey Tones
//SEG31 [21] phi from main::@6 to main::@6 [phi:main::@6->main::@6]
b6_from_b6:
//SEG32 [21] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@6#0] -- register_copy
jmp b6
//SEG33 main::@6
b6:
//SEG34 [22] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuz1=vbuz1
ldy j
tya
sta DTV_PALETTE,y
//SEG35 [23] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuz1=_inc_vbuz1
inc j
//SEG36 [24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@6 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp j
bne b6_from_b6
jmp b2
//SEG37 main::@2
b2:
//SEG38 asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
2019-02-17 23:12:29 +00:00
// Stabilize Raster
ldx #$ff
rff:
cpx RASTER
bne rff
stabilize:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cpx RASTER
beq eat+0
eat:
inx
cpx #8
bne stabilize
//SEG39 [26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG40 [27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
jmp b8
//SEG41 main::@8
b8:
//SEG42 [28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$42
cmp RASTER
bne b8
jmp b10
//SEG43 main::@10
b10:
//SEG44 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
jmp b11
//SEG45 main::@11
b11:
//SEG46 [30] (byte) main::rst#1 ← *((const byte*) RASTER#0) -- vbuz1=_deref_pbuc1
lda RASTER
sta rst
//SEG47 [31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1
lda #7
and rst
sta _31
//SEG48 [32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31 -- vbuz1=vbuc1_bor_vbuz2
lda #VIC_DEN|VIC_ECM|VIC_RSEL
ora _31
sta _32
//SEG49 [33] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$32 -- _deref_pbuc1=vbuz1
lda _32
sta VIC_CONTROL
//SEG50 [34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuz1=vbuz2_rol_4
lda rst
asl
asl
asl
asl
sta _33
//SEG51 [35] *((const byte*) BORDERCOL#0) ← (byte~) main::$33 -- _deref_pbuc1=vbuz1
lda _33
sta BORDERCOL
//SEG52 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
//SEG53 [37] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@11 -- vbuz1_neq_vbuc1_then_la1
lda #$f2
cmp rst
bne b11
jmp b2
}
//SEG54 gfx_init_chunky
2019-02-17 23:12:29 +00:00
// Initialize Plane with 8bpp chunky
gfx_init_chunky: {
.label _9 = $e
.label c = $10
.label gfxb = 7
.label x = 4
.label gfxbCpuBank = 6
.label y = 3
//SEG55 [39] call dtvSetCpuBankSegment1
//SEG56 [58] phi from gfx_init_chunky to dtvSetCpuBankSegment1 [phi:gfx_init_chunky->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_gfx_init_chunky:
//SEG57 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->dtvSetCpuBankSegment1#0] -- vbuz1=vbuc1
lda #$ff&CHUNKY/$4000
sta dtvSetCpuBankSegment1.cpuBankIdx
jsr dtvSetCpuBankSegment1
//SEG58 [40] phi from gfx_init_chunky to gfx_init_chunky::@1 [phi:gfx_init_chunky->gfx_init_chunky::@1]
b1_from_gfx_init_chunky:
//SEG59 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = ++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#0] -- vbuz1=vbuc1
lda #($ff&CHUNKY/$4000)+1
sta gfxbCpuBank
//SEG60 [40] phi (byte) gfx_init_chunky::y#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky->gfx_init_chunky::@1#1] -- vbuz1=vbuc1
lda #0
sta y
//SEG61 [40] phi (byte*) gfx_init_chunky::gfxb#5 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#2] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
jmp b1
//SEG62 [40] phi from gfx_init_chunky::@5 to gfx_init_chunky::@1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1]
b1_from_b5:
//SEG63 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#0] -- register_copy
//SEG64 [40] phi (byte) gfx_init_chunky::y#6 = (byte) gfx_init_chunky::y#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#1] -- register_copy
//SEG65 [40] phi (byte*) gfx_init_chunky::gfxb#5 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#2] -- register_copy
jmp b1
//SEG66 gfx_init_chunky::@1
b1:
//SEG67 [41] phi from gfx_init_chunky::@1 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2]
b2_from_b1:
//SEG68 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#7 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#0] -- register_copy
//SEG69 [41] phi (word) gfx_init_chunky::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#1] -- vwuz1=vbuc1
lda #0
sta x
lda #0
sta x+1
//SEG70 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#5 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#2] -- register_copy
jmp b2
//SEG71 [41] phi from gfx_init_chunky::@3 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2]
b2_from_b3:
//SEG72 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#0] -- register_copy
//SEG73 [41] phi (word) gfx_init_chunky::x#2 = (word) gfx_init_chunky::x#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#1] -- register_copy
//SEG74 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#2] -- register_copy
jmp b2
//SEG75 gfx_init_chunky::@2
b2:
//SEG76 [42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3 -- pbuz1_neq_vwuc1_then_la1
lda gfxb+1
cmp #>$8000
bne b3_from_b2
lda gfxb
cmp #<$8000
bne b3_from_b2
jmp b4
//SEG77 gfx_init_chunky::@4
b4:
//SEG78 [43] (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuz1=vbuz2
lda gfxbCpuBank
sta dtvSetCpuBankSegment1.cpuBankIdx
//SEG79 [44] call dtvSetCpuBankSegment1
//SEG80 [58] phi from gfx_init_chunky::@4 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_b4:
//SEG81 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1#0] -- register_copy
jsr dtvSetCpuBankSegment1
jmp b8
//SEG82 gfx_init_chunky::@8
b8:
//SEG83 [45] (byte) gfx_init_chunky::gfxbCpuBank#2 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuz1=_inc_vbuz1
inc gfxbCpuBank
//SEG84 [46] phi from gfx_init_chunky::@8 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3]
b3_from_b8:
//SEG85 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#2 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#0] -- register_copy
//SEG86 [46] phi (byte*) gfx_init_chunky::gfxb#4 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#1] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
jmp b3
//SEG87 [46] phi from gfx_init_chunky::@2 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3]
b3_from_b2:
//SEG88 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#4 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#0] -- register_copy
//SEG89 [46] phi (byte*) gfx_init_chunky::gfxb#4 = (byte*) gfx_init_chunky::gfxb#3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#1] -- register_copy
jmp b3
//SEG90 gfx_init_chunky::@3
b3:
//SEG91 [47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6 -- vwuz1=vwuz2_plus_vbuz3
lda y
clc
adc x
sta _9
lda #0
adc x+1
sta _9+1
//SEG92 [48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9 -- vbuz1=_byte_vwuz2
lda _9
sta c
//SEG93 [49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0 -- _deref_pbuz1=vbuz2
lda c
ldy #0
sta (gfxb),y
//SEG94 [50] (byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4 -- pbuz1=_inc_pbuz1
inc gfxb
bne !+
inc gfxb+1
!:
//SEG95 [51] (word) gfx_init_chunky::x#1 ← ++ (word) gfx_init_chunky::x#2 -- vwuz1=_inc_vwuz1
inc x
bne !+
inc x+1
!:
//SEG96 [52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2 -- vwuz1_neq_vwuc1_then_la1
lda x+1
cmp #>$140
bne b2_from_b3
lda x
cmp #<$140
bne b2_from_b3
jmp b5
//SEG97 gfx_init_chunky::@5
b5:
//SEG98 [53] (byte) gfx_init_chunky::y#1 ← ++ (byte) gfx_init_chunky::y#6 -- vbuz1=_inc_vbuz1
inc y
//SEG99 [54] if((byte) gfx_init_chunky::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $33) goto gfx_init_chunky::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$33
cmp y
bne b1_from_b5
//SEG100 [55] phi from gfx_init_chunky::@5 to gfx_init_chunky::@6 [phi:gfx_init_chunky::@5->gfx_init_chunky::@6]
b6_from_b5:
jmp b6
//SEG101 gfx_init_chunky::@6
b6:
//SEG102 [56] call dtvSetCpuBankSegment1
//SEG103 [58] phi from gfx_init_chunky::@6 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_b6:
//SEG104 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1#0] -- vbuz1=vbuc1
lda #$4000/$4000
sta dtvSetCpuBankSegment1.cpuBankIdx
jsr dtvSetCpuBankSegment1
jmp breturn
//SEG105 gfx_init_chunky::@return
breturn:
//SEG106 [57] return
rts
}
//SEG107 dtvSetCpuBankSegment1
2019-02-17 23:12:29 +00:00
// 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
// dtvSetCpuBankSegment1(byte zeropage(9) cpuBankIdx)
dtvSetCpuBankSegment1: {
2019-02-17 23:12:29 +00:00
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
.label cpuBankIdx = 9
//SEG108 [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuz1
lda cpuBankIdx
sta cpuBank
//SEG109 asm { .byte$32,$dd lda$ff .byte$32,$00 }
.byte $32, $dd
lda $ff
.byte $32, $00
jmp breturn
//SEG110 dtvSetCpuBankSegment1::@return
breturn:
//SEG111 [61] return
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31 [ main::rst#1 main::$32 ] ( main:2 [ main::rst#1 main::$32 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ main::rst#1 ]
Statement [34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ main::rst#1 main::$33 ] ( main:2 [ main::rst#1 main::$33 ] ) always clobbers reg byte a
Statement [42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#3 gfx_init_chunky::x#2 gfx_init_chunky::gfxbCpuBank#4 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#3 gfx_init_chunky::x#2 gfx_init_chunky::gfxbCpuBank#4 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
Statement [47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::$9 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::$9 ] ) always clobbers reg byte a
Statement [48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::c#0 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::c#0 ] ) always clobbers reg byte a
Statement [49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 ] ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
Statement [52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#1 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#1 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#1 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#1 ] ) always clobbers reg byte a
Statement asm { .byte$32,$dd lda$ff .byte$32,$00 } always clobbers reg byte a
Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7 [ main::rst#1 main::$31 ] ( main:2 [ main::rst#1 main::$31 ] ) always clobbers reg byte a
Statement [32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31 [ main::rst#1 main::$32 ] ( main:2 [ main::rst#1 main::$32 ] ) always clobbers reg byte a
Statement [34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ main::rst#1 main::$33 ] ( main:2 [ main::rst#1 main::$33 ] ) always clobbers reg byte a
Statement [42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#3 gfx_init_chunky::x#2 gfx_init_chunky::gfxbCpuBank#4 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#3 gfx_init_chunky::x#2 gfx_init_chunky::gfxbCpuBank#4 ] ) always clobbers reg byte a
Statement [47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::$9 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::$9 ] ) always clobbers reg byte a
Statement [48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::c#0 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 gfx_init_chunky::c#0 ] ) always clobbers reg byte a
Statement [49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#2 gfx_init_chunky::gfxb#4 ] ) always clobbers reg byte y
Statement [52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#1 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#1 ] ( main:2::gfx_init_chunky:7 [ gfx_init_chunky::y#6 gfx_init_chunky::gfxb#1 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::x#1 ] ) always clobbers reg byte a
Statement asm { .byte$32,$dd lda$ff .byte$32,$00 } always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::j#2 main::j#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ] : zp ZP_BYTE:3 , reg byte x ,
Potential registers zp ZP_WORD:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ] : zp ZP_BYTE:6 , reg byte x ,
Potential registers zp ZP_WORD:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ] : zp ZP_WORD:7 ,
Potential registers zp ZP_BYTE:9 [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ] : zp ZP_BYTE:9 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 [ main::rst#1 ] : zp ZP_BYTE:10 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 [ main::$31 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 [ main::$32 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 [ main::$33 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:14 [ gfx_init_chunky::$9 ] : zp ZP_WORD:14 ,
Potential registers zp ZP_BYTE:16 [ gfx_init_chunky::c#0 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [gfx_init_chunky] 362.64: zp ZP_BYTE:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ] 297.35: zp ZP_WORD:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ] 202: zp ZP_WORD:14 [ gfx_init_chunky::$9 ] 202: zp ZP_BYTE:16 [ gfx_init_chunky::c#0 ] 181.8: zp ZP_WORD:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ] 25.96: zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplift Scope [main] 202: zp ZP_BYTE:11 [ main::$31 ] 202: zp ZP_BYTE:12 [ main::$32 ] 202: zp ZP_BYTE:13 [ main::$33 ] 57.71: zp ZP_BYTE:10 [ main::rst#1 ] 38.5: zp ZP_BYTE:2 [ main::j#2 main::j#1 ]
Uplift Scope [dtvSetCpuBankSegment1] 305: zp ZP_BYTE:9 [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Uplift Scope []
Uplifting [gfx_init_chunky] best 25250 combination reg byte x [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ] zp ZP_WORD:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ] zp ZP_WORD:14 [ gfx_init_chunky::$9 ] reg byte a [ gfx_init_chunky::c#0 ] zp ZP_WORD:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ] zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplifting [main] best 22650 combination reg byte a [ main::$31 ] reg byte a [ main::$32 ] reg byte a [ main::$33 ] reg byte x [ main::rst#1 ] zp ZP_BYTE:2 [ main::j#2 main::j#1 ]
Limited combination testing to 100 combinations of 768 possible.
Uplifting [dtvSetCpuBankSegment1] best 22541 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Uplifting [] best 22541 combination
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::j#2 main::j#1 ]
Uplifting [main] best 22421 combination reg byte x [ main::j#2 main::j#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplifting [gfx_init_chunky] best 22421 combination zp ZP_BYTE:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Allocated (was zp ZP_WORD:4) zp ZP_WORD:3 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
Allocated (was zp ZP_WORD:7) zp ZP_WORD:5 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
Allocated (was zp ZP_WORD:14) zp ZP_WORD:7 [ gfx_init_chunky::$9 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
2019-02-17 23:12:29 +00:00
// C64DTV 8bpp charmode stretcher
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
2019-02-17 23:12:29 +00:00
// Processor port data direction register
.label PROCPORT_DDR = 0
2019-02-17 23:12:29 +00:00
// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
.const PROCPORT_DDR_MEMORY_MASK = 7
2019-02-17 23:12:29 +00:00
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
2019-02-17 23:12:29 +00:00
// RAM in $A000, $E000 I/O in $D000
.const PROCPORT_RAM_IO = $35
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_ECM = $40
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_CONTROL2 = $d016
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
2019-02-17 23:12:29 +00:00
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
2019-02-17 23:12:29 +00:00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
2019-02-17 23:12:29 +00:00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
2019-02-17 23:12:29 +00:00
// Controls the graphics modes of the C64 DTV
.label DTV_CONTROL = $d03c
.const DTV_LINEAR = 1
.const DTV_HIGHCOLOR = 4
.const DTV_COLORRAM_OFF = $10
.const DTV_BADLINE_OFF = $20
.const DTV_CHUNKY = $40
2019-02-17 23:12:29 +00:00
// Defines colors for the 16 first colors ($00-$0f)
.label DTV_PALETTE = $d200
2019-02-17 23:12:29 +00:00
// Linear Graphics Plane B Counter Control
.label DTV_PLANEB_START_LO = $d049
.label DTV_PLANEB_START_MI = $d04a
.label DTV_PLANEB_START_HI = $d04b
.label DTV_PLANEB_STEP = $d04c
.label DTV_PLANEB_MODULO_LO = $d047
.label DTV_PLANEB_MODULO_HI = $d048
2019-02-17 23:12:29 +00:00
// Plane with all pixels
.label CHUNKY = $8000
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @7 [phi:@begin->@7]
b7_from_bbegin:
jmp b7
//SEG5 @7
b7:
//SEG6 [2] call main
jsr main
//SEG7 [3] phi from @7 to @end [phi:@7->@end]
bend_from_b7:
jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Disable normal interrupt (prevent keyboard reading glitches and allows to hide basic/kernal)
// Disable kernal & basic
lda #PROCPORT_DDR_MEMORY_MASK
sta PROCPORT_DDR
//SEG12 [6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
//SEG13 [7] call gfx_init_chunky
//SEG14 [38] phi from main to gfx_init_chunky [phi:main->gfx_init_chunky]
gfx_init_chunky_from_main:
jsr gfx_init_chunky
jmp b17
//SEG15 main::@17
b17:
//SEG16 [8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Enable DTV extended modes
lda #DTV_FEATURE_ENABLE
sta DTV_FEATURE
//SEG17 [9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// 8BPP Pixel Cell Mode
lda #DTV_HIGHCOLOR|DTV_LINEAR|DTV_COLORRAM_OFF|DTV_CHUNKY|DTV_BADLINE_OFF
sta DTV_CONTROL
//SEG18 [10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG19 [11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2
lda #VIC_MCM|VIC_CSEL
sta VIC_CONTROL2
//SEG20 [12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Plane B: CHUNKY
lda #<CHUNKY
sta DTV_PLANEB_START_LO
//SEG21 [13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
lda #>CHUNKY
sta DTV_PLANEB_START_MI
//SEG22 [14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_START_HI
//SEG23 [15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- _deref_pbuc1=vbuc2
lda #8
sta DTV_PLANEB_STEP
//SEG24 [16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_LO
//SEG25 [17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
//SEG26 [18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
//SEG27 [19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
//SEG28 [20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank
// VIC memory
lda #(CHUNKY&$3fff)>>6|(0)>>2
sta VIC_MEMORY
//SEG29 [21] phi from main::@17 to main::@6 [phi:main::@17->main::@6]
b6_from_b17:
//SEG30 [21] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@17->main::@6#0] -- vbuxx=vbuc1
ldx #0
jmp b6
2019-02-17 23:12:29 +00:00
// DTV Palette - Grey Tones
//SEG31 [21] phi from main::@6 to main::@6 [phi:main::@6->main::@6]
b6_from_b6:
//SEG32 [21] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@6#0] -- register_copy
jmp b6
//SEG33 main::@6
b6:
//SEG34 [22] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuxx
txa
sta DTV_PALETTE,x
//SEG35 [23] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuxx=_inc_vbuxx
inx
//SEG36 [24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@6 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b6_from_b6
jmp b2
//SEG37 main::@2
b2:
//SEG38 asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
2019-02-17 23:12:29 +00:00
// Stabilize Raster
ldx #$ff
rff:
cpx RASTER
bne rff
stabilize:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cpx RASTER
beq eat+0
eat:
inx
cpx #8
bne stabilize
//SEG39 [26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG40 [27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
jmp b8
//SEG41 main::@8
b8:
//SEG42 [28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$42
cmp RASTER
bne b8
jmp b10
//SEG43 main::@10
b10:
//SEG44 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
jmp b11
//SEG45 main::@11
b11:
//SEG46 [30] (byte) main::rst#1 ← *((const byte*) RASTER#0) -- vbuxx=_deref_pbuc1
ldx RASTER
//SEG47 [31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuaa=vbuxx_band_vbuc1
txa
and #7
//SEG48 [32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31 -- vbuaa=vbuc1_bor_vbuaa
ora #VIC_DEN|VIC_ECM|VIC_RSEL
//SEG49 [33] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$32 -- _deref_pbuc1=vbuaa
sta VIC_CONTROL
//SEG50 [34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_rol_4
txa
asl
asl
asl
asl
//SEG51 [35] *((const byte*) BORDERCOL#0) ← (byte~) main::$33 -- _deref_pbuc1=vbuaa
sta BORDERCOL
//SEG52 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
//SEG53 [37] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@11 -- vbuxx_neq_vbuc1_then_la1
cpx #$f2
bne b11
jmp b2
}
//SEG54 gfx_init_chunky
2019-02-17 23:12:29 +00:00
// Initialize Plane with 8bpp chunky
gfx_init_chunky: {
.label _9 = 7
.label gfxb = 5
.label x = 3
.label y = 2
//SEG55 [39] call dtvSetCpuBankSegment1
//SEG56 [58] phi from gfx_init_chunky to dtvSetCpuBankSegment1 [phi:gfx_init_chunky->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_gfx_init_chunky:
//SEG57 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->dtvSetCpuBankSegment1#0] -- vbuaa=vbuc1
lda #$ff&CHUNKY/$4000
jsr dtvSetCpuBankSegment1
//SEG58 [40] phi from gfx_init_chunky to gfx_init_chunky::@1 [phi:gfx_init_chunky->gfx_init_chunky::@1]
b1_from_gfx_init_chunky:
//SEG59 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = ++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#0] -- vbuxx=vbuc1
ldx #($ff&CHUNKY/$4000)+1
//SEG60 [40] phi (byte) gfx_init_chunky::y#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky->gfx_init_chunky::@1#1] -- vbuz1=vbuc1
lda #0
sta y
//SEG61 [40] phi (byte*) gfx_init_chunky::gfxb#5 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#2] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
jmp b1
//SEG62 [40] phi from gfx_init_chunky::@5 to gfx_init_chunky::@1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1]
b1_from_b5:
//SEG63 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#0] -- register_copy
//SEG64 [40] phi (byte) gfx_init_chunky::y#6 = (byte) gfx_init_chunky::y#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#1] -- register_copy
//SEG65 [40] phi (byte*) gfx_init_chunky::gfxb#5 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#2] -- register_copy
jmp b1
//SEG66 gfx_init_chunky::@1
b1:
//SEG67 [41] phi from gfx_init_chunky::@1 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2]
b2_from_b1:
//SEG68 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#7 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#0] -- register_copy
//SEG69 [41] phi (word) gfx_init_chunky::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#1] -- vwuz1=vbuc1
lda #0
sta x
lda #0
sta x+1
//SEG70 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#5 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#2] -- register_copy
jmp b2
//SEG71 [41] phi from gfx_init_chunky::@3 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2]
b2_from_b3:
//SEG72 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#0] -- register_copy
//SEG73 [41] phi (word) gfx_init_chunky::x#2 = (word) gfx_init_chunky::x#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#1] -- register_copy
//SEG74 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#2] -- register_copy
jmp b2
//SEG75 gfx_init_chunky::@2
b2:
//SEG76 [42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3 -- pbuz1_neq_vwuc1_then_la1
lda gfxb+1
cmp #>$8000
bne b3_from_b2
lda gfxb
cmp #<$8000
bne b3_from_b2
jmp b4
//SEG77 gfx_init_chunky::@4
b4:
//SEG78 [43] (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuaa=vbuxx
txa
//SEG79 [44] call dtvSetCpuBankSegment1
//SEG80 [58] phi from gfx_init_chunky::@4 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_b4:
//SEG81 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1#0] -- register_copy
jsr dtvSetCpuBankSegment1
jmp b8
//SEG82 gfx_init_chunky::@8
b8:
//SEG83 [45] (byte) gfx_init_chunky::gfxbCpuBank#2 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuxx=_inc_vbuxx
inx
//SEG84 [46] phi from gfx_init_chunky::@8 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3]
b3_from_b8:
//SEG85 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#2 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#0] -- register_copy
//SEG86 [46] phi (byte*) gfx_init_chunky::gfxb#4 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#1] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
jmp b3
//SEG87 [46] phi from gfx_init_chunky::@2 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3]
b3_from_b2:
//SEG88 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#4 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#0] -- register_copy
//SEG89 [46] phi (byte*) gfx_init_chunky::gfxb#4 = (byte*) gfx_init_chunky::gfxb#3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#1] -- register_copy
jmp b3
//SEG90 gfx_init_chunky::@3
b3:
//SEG91 [47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6 -- vwuz1=vwuz2_plus_vbuz3
lda y
clc
adc x
sta _9
lda #0
adc x+1
sta _9+1
//SEG92 [48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9 -- vbuaa=_byte_vwuz1
lda _9
//SEG93 [49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0 -- _deref_pbuz1=vbuaa
ldy #0
sta (gfxb),y
//SEG94 [50] (byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4 -- pbuz1=_inc_pbuz1
inc gfxb
bne !+
inc gfxb+1
!:
//SEG95 [51] (word) gfx_init_chunky::x#1 ← ++ (word) gfx_init_chunky::x#2 -- vwuz1=_inc_vwuz1
inc x
bne !+
inc x+1
!:
//SEG96 [52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2 -- vwuz1_neq_vwuc1_then_la1
lda x+1
cmp #>$140
bne b2_from_b3
lda x
cmp #<$140
bne b2_from_b3
jmp b5
//SEG97 gfx_init_chunky::@5
b5:
//SEG98 [53] (byte) gfx_init_chunky::y#1 ← ++ (byte) gfx_init_chunky::y#6 -- vbuz1=_inc_vbuz1
inc y
//SEG99 [54] if((byte) gfx_init_chunky::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $33) goto gfx_init_chunky::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$33
cmp y
bne b1_from_b5
//SEG100 [55] phi from gfx_init_chunky::@5 to gfx_init_chunky::@6 [phi:gfx_init_chunky::@5->gfx_init_chunky::@6]
b6_from_b5:
jmp b6
//SEG101 gfx_init_chunky::@6
b6:
//SEG102 [56] call dtvSetCpuBankSegment1
//SEG103 [58] phi from gfx_init_chunky::@6 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1]
dtvSetCpuBankSegment1_from_b6:
//SEG104 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1#0] -- vbuaa=vbuc1
lda #$4000/$4000
jsr dtvSetCpuBankSegment1
jmp breturn
//SEG105 gfx_init_chunky::@return
breturn:
//SEG106 [57] return
rts
}
//SEG107 dtvSetCpuBankSegment1
2019-02-17 23:12:29 +00:00
// 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
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
2019-02-17 23:12:29 +00:00
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
//SEG108 [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa
sta cpuBank
//SEG109 asm { .byte$32,$dd lda$ff .byte$32,$00 }
.byte $32, $dd
lda $ff
.byte $32, $00
jmp breturn
//SEG110 dtvSetCpuBankSegment1::@return
breturn:
//SEG111 [61] return
rts
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b7
Removing instruction jmp bend
Removing instruction jmp b17
Removing instruction jmp b6
Removing instruction jmp b2
Removing instruction jmp b8
Removing instruction jmp b10
Removing instruction jmp b11
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b8
Removing instruction jmp b3
Removing instruction jmp b5
Removing instruction jmp b6
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b6_from_b6 with b6
Replacing label b3_from_b2 with b3
Replacing label b3_from_b2 with b3
Replacing label b2_from_b3 with b2
Replacing label b2_from_b3 with b2
Replacing label b1_from_b5 with b1
Removing instruction b7_from_bbegin:
Removing instruction b7:
Removing instruction bend_from_b7:
Removing instruction b6_from_b6:
Removing instruction b1_from_b5:
Removing instruction b2_from_b1:
Removing instruction b2_from_b3:
Removing instruction b3_from_b2:
Removing instruction b6_from_b5:
Removing instruction dtvSetCpuBankSegment1_from_b6:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction gfx_init_chunky_from_main:
Removing instruction b17:
Removing instruction b6_from_b17:
Removing instruction b10:
Removing instruction dtvSetCpuBankSegment1_from_gfx_init_chunky:
Removing instruction b1_from_gfx_init_chunky:
Removing instruction b4:
Removing instruction dtvSetCpuBankSegment1_from_b4:
Removing instruction b8:
Removing instruction b3_from_b8:
Removing instruction b5:
Removing instruction b6:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b6
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @7
(label) @begin
(label) @end
(byte*) BGCOL
(byte*) BGCOL1
(byte*) BGCOL2
(byte*) BGCOL3
(byte*) BGCOL4
(byte) BLACK
(byte) BLUE
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) $d020
(byte) BROWN
(byte*) CHARGEN
(byte*) CHUNKY
(const byte*) CHUNKY#0 CHUNKY = ((byte*))(word/dword/signed dword) $8000
(byte*) CIA1_INTERRUPT
(byte*) CIA1_PORT_A
(byte*) CIA1_PORT_A_DDR
(byte*) CIA1_PORT_B
(byte*) CIA1_PORT_B_DDR
(byte*) CIA2_INTERRUPT
(byte*) CIA2_PORT_A
(const byte*) CIA2_PORT_A#0 CIA2_PORT_A = ((byte*))(word/dword/signed dword) $dd00
(byte*) CIA2_PORT_A_DDR
(const byte*) CIA2_PORT_A_DDR#0 CIA2_PORT_A_DDR = ((byte*))(word/dword/signed dword) $dd02
(byte*) CIA2_PORT_B
(byte*) CIA2_PORT_B_DDR
(byte) CIA_INTERRUPT_CLEAR
(byte*) COLS
(byte) CYAN
(byte*) D011
(byte*) D016
(byte*) D018
(byte) DARK_GREY
(byte) DTV_BADLINE_OFF
(const byte) DTV_BADLINE_OFF#0 DTV_BADLINE_OFF = (byte/signed byte/word/signed word/dword/signed dword) $20
(byte*) DTV_BLITTER_ALU
(byte*) DTV_BLITTER_CONTROL
(byte*) DTV_BLITTER_CONTROL2
(byte*) DTV_BLITTER_DEST_HI
(byte*) DTV_BLITTER_DEST_LIN_HI
(byte*) DTV_BLITTER_DEST_LIN_LO
(byte*) DTV_BLITTER_DEST_LO
(byte*) DTV_BLITTER_DEST_MI
(byte*) DTV_BLITTER_DEST_MOD_HI
(byte*) DTV_BLITTER_DEST_MOD_LO
(byte*) DTV_BLITTER_DEST_STEP
(byte*) DTV_BLITTER_LEN_HI
(byte*) DTV_BLITTER_LEN_LO
(byte*) DTV_BLITTER_SRCA_HI
(byte*) DTV_BLITTER_SRCA_LIN_HI
(byte*) DTV_BLITTER_SRCA_LIN_LO
(byte*) DTV_BLITTER_SRCA_LO
(byte*) DTV_BLITTER_SRCA_MI
(byte*) DTV_BLITTER_SRCA_MOD_HI
(byte*) DTV_BLITTER_SRCA_MOD_LO
(byte*) DTV_BLITTER_SRCA_STEP
(byte*) DTV_BLITTER_SRCB_HI
(byte*) DTV_BLITTER_SRCB_LIN_HI
(byte*) DTV_BLITTER_SRCB_LIN_LO
(byte*) DTV_BLITTER_SRCB_LO
(byte*) DTV_BLITTER_SRCB_MI
(byte*) DTV_BLITTER_SRCB_MOD_HI
(byte*) DTV_BLITTER_SRCB_MOD_LO
(byte*) DTV_BLITTER_SRCB_STEP
(byte*) DTV_BLITTER_TRANSPARANCY
(byte) DTV_BLIT_ADD
(byte) DTV_BLIT_AND
(byte) DTV_BLIT_CIA_IRQ
(byte) DTV_BLIT_CLEAR_IRQ
(byte) DTV_BLIT_DEST_CONT
(byte) DTV_BLIT_DEST_FWD
(byte) DTV_BLIT_DISABLE_B
(byte) DTV_BLIT_FORCE_START
(byte) DTV_BLIT_IRQ_EN
(byte) DTV_BLIT_NAND
(byte) DTV_BLIT_NOR
(byte) DTV_BLIT_OR
(byte) DTV_BLIT_SHIFT0
(byte) DTV_BLIT_SHIFT1
(byte) DTV_BLIT_SHIFT2
(byte) DTV_BLIT_SHIFT3
(byte) DTV_BLIT_SHIFT4
(byte) DTV_BLIT_SHIFT5
(byte) DTV_BLIT_SHIFT6
(byte) DTV_BLIT_SHIFT7
(byte) DTV_BLIT_SRCA_CONT
(byte) DTV_BLIT_SRCA_FWD
(byte) DTV_BLIT_SRCB_CONT
(byte) DTV_BLIT_SRCB_FWD
(byte) DTV_BLIT_STATUS_BUSY
(byte) DTV_BLIT_STATUS_IRQ
(byte) DTV_BLIT_SUB
(byte) DTV_BLIT_TRANSPARANCY_NONE
(byte) DTV_BLIT_VBLANK
(byte) DTV_BLIT_VIC_IRQ
(byte) DTV_BLIT_WRITE_NONTRANSPARENT
(byte) DTV_BLIT_WRITE_TRANSPARENT
(byte) DTV_BLIT_XNOR
(byte) DTV_BLIT_XOR
(byte) DTV_BORDER_OFF
(byte) DTV_CHUNKY
(const byte) DTV_CHUNKY#0 DTV_CHUNKY = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) DTV_COLORRAM_OFF
(const byte) DTV_COLORRAM_OFF#0 DTV_COLORRAM_OFF = (byte/signed byte/word/signed word/dword/signed dword) $10
(dword) DTV_COLOR_BANK_DEFAULT
(byte*) DTV_COLOR_BANK_HI
(byte*) DTV_COLOR_BANK_LO
(byte*) DTV_CONTROL
(const byte*) DTV_CONTROL#0 DTV_CONTROL = ((byte*))(word/dword/signed dword) $d03c
(byte*) DTV_FEATURE
(const byte*) DTV_FEATURE#0 DTV_FEATURE = ((byte*))(word/dword/signed dword) $d03f
(byte) DTV_FEATURE_DISABLE_TIL_RESET
(byte) DTV_FEATURE_ENABLE
(const byte) DTV_FEATURE_ENABLE#0 DTV_FEATURE_ENABLE = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_GRAPHICS_HICOL_BANK
(byte*) DTV_GRAPHICS_VIC_BANK
(byte) DTV_HIGHCOLOR
(const byte) DTV_HIGHCOLOR#0 DTV_HIGHCOLOR = (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_LINEAR
(const byte) DTV_LINEAR#0 DTV_LINEAR = (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_OVERSCAN
(byte*) DTV_PALETTE
(const byte*) DTV_PALETTE#0 DTV_PALETTE = ((byte*))(word/dword/signed dword) $d200
(byte[$10]) 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
(const byte*) DTV_PLANEB_MODULO_HI#0 DTV_PLANEB_MODULO_HI = ((byte*))(word/dword/signed dword) $d048
(byte*) DTV_PLANEB_MODULO_LO
(const byte*) DTV_PLANEB_MODULO_LO#0 DTV_PLANEB_MODULO_LO = ((byte*))(word/dword/signed dword) $d047
(byte*) DTV_PLANEB_START_HI
(const byte*) DTV_PLANEB_START_HI#0 DTV_PLANEB_START_HI = ((byte*))(word/dword/signed dword) $d04b
(byte*) DTV_PLANEB_START_LO
(const byte*) DTV_PLANEB_START_LO#0 DTV_PLANEB_START_LO = ((byte*))(word/dword/signed dword) $d049
(byte*) DTV_PLANEB_START_MI
(const byte*) DTV_PLANEB_START_MI#0 DTV_PLANEB_START_MI = ((byte*))(word/dword/signed dword) $d04a
(byte*) DTV_PLANEB_STEP
(const byte*) DTV_PLANEB_STEP#0 DTV_PLANEB_STEP = ((byte*))(word/dword/signed dword) $d04c
(byte*) DTV_SPRITE_BANK
(byte) GREEN
(byte) GREY
(void()**) HARDWARE_IRQ
(byte) IRQ_COLLISION_BG
(byte) IRQ_COLLISION_SPRITE
(byte*) IRQ_ENABLE
(byte) IRQ_LIGHTPEN
(byte) IRQ_RASTER
(byte*) IRQ_STATUS
(void()**) KERNEL_IRQ
(byte*) LIGHTPEN_X
(byte*) LIGHTPEN_Y
(byte) LIGHT_BLUE
(byte) LIGHT_GREEN
(byte) LIGHT_GREY
(byte) ORANGE
(byte) PINK
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(byte) PROCPORT_BASIC_KERNEL_IO
(byte*) PROCPORT_DDR
(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0
(byte) PROCPORT_DDR_MEMORY_MASK
(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) PROCPORT_KERNEL_IO
(byte) PROCPORT_RAM_ALL
(byte) PROCPORT_RAM_CHARROM
(byte) PROCPORT_RAM_IO
(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte/signed byte/word/signed word/dword/signed dword) $35
(byte) PURPLE
(byte*) RASTER
(const byte*) RASTER#0 RASTER = ((byte*))(word/dword/signed dword) $d012
(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
(word) SPRITE_PTRS
(byte) VIC_BMM
(byte*) VIC_CONTROL
(const byte*) VIC_CONTROL#0 VIC_CONTROL = ((byte*))(word/dword/signed dword) $d011
(byte*) VIC_CONTROL2
(const byte*) VIC_CONTROL2#0 VIC_CONTROL2 = ((byte*))(word/dword/signed dword) $d016
(byte) VIC_CSEL
(const byte) VIC_CSEL#0 VIC_CSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) VIC_DEN
(const byte) VIC_DEN#0 VIC_DEN = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte) VIC_ECM
(const byte) VIC_ECM#0 VIC_ECM = (byte/signed byte/word/signed word/dword/signed dword) $40
(byte) VIC_MCM
(const byte) VIC_MCM#0 VIC_MCM = (byte/signed byte/word/signed word/dword/signed dword) $10
(byte*) VIC_MEMORY
(const byte*) VIC_MEMORY#0 VIC_MEMORY = ((byte*))(word/dword/signed dword) $d018
(byte) VIC_RSEL
(const byte) VIC_RSEL#0 VIC_RSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) VIC_RST8
(byte) WHITE
(byte) YELLOW
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(label) dtvSetCpuBankSegment1::@return
(byte*) dtvSetCpuBankSegment1::cpuBank
(const byte*) dtvSetCpuBankSegment1::cpuBank#0 cpuBank = ((byte*))(byte/word/signed word/dword/signed dword) $ff
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 reg byte a 202.0
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 reg byte a 103.0
(void()) gfx_init_chunky()
(word~) gfx_init_chunky::$9 $9 zp ZP_WORD:7 202.0
(label) gfx_init_chunky::@1
(label) gfx_init_chunky::@2
(label) gfx_init_chunky::@3
(label) gfx_init_chunky::@4
(label) gfx_init_chunky::@5
(label) gfx_init_chunky::@6
(label) gfx_init_chunky::@8
(label) gfx_init_chunky::@return
(byte) gfx_init_chunky::c
(byte) gfx_init_chunky::c#0 reg byte a 202.0
(byte*) gfx_init_chunky::gfxb
(byte*) gfx_init_chunky::gfxb#1 gfxb zp ZP_WORD:5 42.599999999999994
(byte*) gfx_init_chunky::gfxb#3 gfxb zp ZP_WORD:5 157.0
(byte*) gfx_init_chunky::gfxb#4 gfxb zp ZP_WORD:5 75.75
(byte*) gfx_init_chunky::gfxb#5 gfxb zp ZP_WORD:5 22.0
(byte) gfx_init_chunky::gfxbCpuBank
(byte) gfx_init_chunky::gfxbCpuBank#2 reg byte x 202.0
(byte) gfx_init_chunky::gfxbCpuBank#4 reg byte x 103.75
(byte) gfx_init_chunky::gfxbCpuBank#7 reg byte x 22.0
(byte) gfx_init_chunky::gfxbCpuBank#8 reg byte x 34.888888888888886
(word) gfx_init_chunky::x
(word) gfx_init_chunky::x#1 x zp ZP_WORD:3 151.5
(word) gfx_init_chunky::x#2 x zp ZP_WORD:3 30.299999999999997
(byte) gfx_init_chunky::y
(byte) gfx_init_chunky::y#1 y zp ZP_BYTE:2 16.5
(byte) gfx_init_chunky::y#6 y zp ZP_BYTE:2 9.461538461538462
(void()) main()
(byte~) main::$31 reg byte a 202.0
(byte~) main::$32 reg byte a 202.0
(byte~) main::$33 reg byte a 202.0
(label) main::@10
(label) main::@11
(label) main::@17
(label) main::@2
(label) main::@6
(label) main::@8
(byte) main::j
(byte) main::j#1 reg byte x 16.5
(byte) main::j#2 reg byte x 22.0
(byte) main::rst
(byte) main::rst#1 reg byte x 57.714285714285715
reg byte x [ main::j#2 main::j#1 ]
zp ZP_BYTE:2 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
zp ZP_WORD:3 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ]
reg byte x [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ]
zp ZP_WORD:5 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ]
reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
reg byte x [ main::rst#1 ]
reg byte a [ main::$31 ]
reg byte a [ main::$32 ]
reg byte a [ main::$33 ]
zp ZP_WORD:7 [ gfx_init_chunky::$9 ]
reg byte a [ gfx_init_chunky::c#0 ]
FINAL ASSEMBLER
Score: 19882
//SEG0 File Comments
2019-02-17 23:12:29 +00:00
// C64DTV 8bpp charmode stretcher
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
2019-02-17 23:12:29 +00:00
// Processor port data direction register
.label PROCPORT_DDR = 0
2019-02-17 23:12:29 +00:00
// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
.const PROCPORT_DDR_MEMORY_MASK = 7
2019-02-17 23:12:29 +00:00
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
2019-02-17 23:12:29 +00:00
// RAM in $A000, $E000 I/O in $D000
.const PROCPORT_RAM_IO = $35
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_ECM = $40
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_CONTROL2 = $d016
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
2019-02-17 23:12:29 +00:00
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
2019-02-17 23:12:29 +00:00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
2019-02-17 23:12:29 +00:00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
2019-02-17 23:12:29 +00:00
// Controls the graphics modes of the C64 DTV
.label DTV_CONTROL = $d03c
.const DTV_LINEAR = 1
.const DTV_HIGHCOLOR = 4
.const DTV_COLORRAM_OFF = $10
.const DTV_BADLINE_OFF = $20
.const DTV_CHUNKY = $40
2019-02-17 23:12:29 +00:00
// Defines colors for the 16 first colors ($00-$0f)
.label DTV_PALETTE = $d200
2019-02-17 23:12:29 +00:00
// Linear Graphics Plane B Counter Control
.label DTV_PLANEB_START_LO = $d049
.label DTV_PLANEB_START_MI = $d04a
.label DTV_PLANEB_START_HI = $d04b
.label DTV_PLANEB_STEP = $d04c
.label DTV_PLANEB_MODULO_LO = $d047
.label DTV_PLANEB_MODULO_HI = $d048
2019-02-17 23:12:29 +00:00
// Plane with all pixels
.label CHUNKY = $8000
//SEG3 @begin
//SEG4 [1] phi from @begin to @7 [phi:@begin->@7]
//SEG5 @7
//SEG6 [2] call main
//SEG7 [3] phi from @7 to @end [phi:@7->@end]
//SEG8 @end
//SEG9 main
main: {
//SEG10 asm { sei }
sei
//SEG11 [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Disable normal interrupt (prevent keyboard reading glitches and allows to hide basic/kernal)
// Disable kernal & basic
lda #PROCPORT_DDR_MEMORY_MASK
sta PROCPORT_DDR
//SEG12 [6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
//SEG13 [7] call gfx_init_chunky
//SEG14 [38] phi from main to gfx_init_chunky [phi:main->gfx_init_chunky]
jsr gfx_init_chunky
//SEG15 main::@17
//SEG16 [8] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Enable DTV extended modes
lda #DTV_FEATURE_ENABLE
sta DTV_FEATURE
//SEG17 [9] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_COLORRAM_OFF#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_BADLINE_OFF#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// 8BPP Pixel Cell Mode
lda #DTV_HIGHCOLOR|DTV_LINEAR|DTV_COLORRAM_OFF|DTV_CHUNKY|DTV_BADLINE_OFF
sta DTV_CONTROL
//SEG18 [10] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG19 [11] *((const byte*) VIC_CONTROL2#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -- _deref_pbuc1=vbuc2
lda #VIC_MCM|VIC_CSEL
sta VIC_CONTROL2
//SEG20 [12] *((const byte*) DTV_PLANEB_START_LO#0) ← <(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Plane B: CHUNKY
lda #<CHUNKY
sta DTV_PLANEB_START_LO
//SEG21 [13] *((const byte*) DTV_PLANEB_START_MI#0) ← >(const byte*) CHUNKY#0 -- _deref_pbuc1=vbuc2
lda #>CHUNKY
sta DTV_PLANEB_START_MI
//SEG22 [14] *((const byte*) DTV_PLANEB_START_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_START_HI
//SEG23 [15] *((const byte*) DTV_PLANEB_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- _deref_pbuc1=vbuc2
lda #8
sta DTV_PLANEB_STEP
//SEG24 [16] *((const byte*) DTV_PLANEB_MODULO_LO#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_LO
//SEG25 [17] *((const byte*) DTV_PLANEB_MODULO_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
sta DTV_PLANEB_MODULO_HI
//SEG26 [18] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
//SEG27 [19] *((const byte*) CIA2_PORT_A#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3^((byte))((word))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
//SEG28 [20] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 6|>((word))(const byte*) CHUNKY#0&(word/signed word/dword/signed dword) $3fff>>(byte/signed byte/word/signed word/dword/signed dword) 2 -- _deref_pbuc1=vbuc2
2019-02-17 23:12:29 +00:00
// Set VIC Bank
// VIC memory
lda #(CHUNKY&$3fff)>>6|(0)>>2
sta VIC_MEMORY
//SEG29 [21] phi from main::@17 to main::@6 [phi:main::@17->main::@6]
//SEG30 [21] phi (byte) main::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@17->main::@6#0] -- vbuxx=vbuc1
ldx #0
2019-02-17 23:12:29 +00:00
// DTV Palette - Grey Tones
//SEG31 [21] phi from main::@6 to main::@6 [phi:main::@6->main::@6]
//SEG32 [21] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@6->main::@6#0] -- register_copy
//SEG33 main::@6
b6:
//SEG34 [22] *((const byte*) DTV_PALETTE#0 + (byte) main::j#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuxx
txa
sta DTV_PALETTE,x
//SEG35 [23] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuxx=_inc_vbuxx
inx
//SEG36 [24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto main::@6 -- vbuxx_neq_vbuc1_then_la1
cpx #$10
bne b6
//SEG37 main::@2
b2:
//SEG38 asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize }
2019-02-17 23:12:29 +00:00
// Stabilize Raster
ldx #$ff
rff:
cpx RASTER
bne rff
stabilize:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cpx RASTER
beq eat+0
eat:
inx
cpx #8
bne stabilize
//SEG39 [26] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2
lda #VIC_DEN|VIC_ECM|VIC_RSEL|3
sta VIC_CONTROL
//SEG40 [27] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
//SEG41 main::@8
b8:
//SEG42 [28] if(*((const byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $42) goto main::@8 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$42
cmp RASTER
bne b8
//SEG43 main::@10
//SEG44 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
//SEG45 main::@11
b11:
//SEG46 [30] (byte) main::rst#1 ← *((const byte*) RASTER#0) -- vbuxx=_deref_pbuc1
ldx RASTER
//SEG47 [31] (byte~) main::$31 ← (byte) main::rst#1 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuaa=vbuxx_band_vbuc1
txa
and #7
//SEG48 [32] (byte~) main::$32 ← (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0 | (byte~) main::$31 -- vbuaa=vbuc1_bor_vbuaa
ora #VIC_DEN|VIC_ECM|VIC_RSEL
//SEG49 [33] *((const byte*) VIC_CONTROL#0) ← (byte~) main::$32 -- _deref_pbuc1=vbuaa
sta VIC_CONTROL
//SEG50 [34] (byte~) main::$33 ← (byte) main::rst#1 << (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_rol_4
txa
asl
asl
asl
asl
//SEG51 [35] *((const byte*) BORDERCOL#0) ← (byte~) main::$33 -- _deref_pbuc1=vbuaa
sta BORDERCOL
//SEG52 asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
//SEG53 [37] if((byte) main::rst#1!=(byte/word/signed word/dword/signed dword) $f2) goto main::@11 -- vbuxx_neq_vbuc1_then_la1
cpx #$f2
bne b11
jmp b2
}
//SEG54 gfx_init_chunky
2019-02-17 23:12:29 +00:00
// Initialize Plane with 8bpp chunky
gfx_init_chunky: {
.label _9 = 7
.label gfxb = 5
.label x = 3
.label y = 2
//SEG55 [39] call dtvSetCpuBankSegment1
//SEG56 [58] phi from gfx_init_chunky to dtvSetCpuBankSegment1 [phi:gfx_init_chunky->dtvSetCpuBankSegment1]
//SEG57 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->dtvSetCpuBankSegment1#0] -- vbuaa=vbuc1
lda #$ff&CHUNKY/$4000
jsr dtvSetCpuBankSegment1
//SEG58 [40] phi from gfx_init_chunky to gfx_init_chunky::@1 [phi:gfx_init_chunky->gfx_init_chunky::@1]
//SEG59 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = ++((byte))(const byte*) CHUNKY#0/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#0] -- vbuxx=vbuc1
ldx #($ff&CHUNKY/$4000)+1
//SEG60 [40] phi (byte) gfx_init_chunky::y#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky->gfx_init_chunky::@1#1] -- vbuz1=vbuc1
lda #0
sta y
//SEG61 [40] phi (byte*) gfx_init_chunky::gfxb#5 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky->gfx_init_chunky::@1#2] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
//SEG62 [40] phi from gfx_init_chunky::@5 to gfx_init_chunky::@1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1]
//SEG63 [40] phi (byte) gfx_init_chunky::gfxbCpuBank#7 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#0] -- register_copy
//SEG64 [40] phi (byte) gfx_init_chunky::y#6 = (byte) gfx_init_chunky::y#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#1] -- register_copy
//SEG65 [40] phi (byte*) gfx_init_chunky::gfxb#5 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@5->gfx_init_chunky::@1#2] -- register_copy
//SEG66 gfx_init_chunky::@1
b1:
//SEG67 [41] phi from gfx_init_chunky::@1 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2]
//SEG68 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#7 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#0] -- register_copy
//SEG69 [41] phi (word) gfx_init_chunky::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#1] -- vwuz1=vbuc1
lda #0
sta x
sta x+1
//SEG70 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#5 [phi:gfx_init_chunky::@1->gfx_init_chunky::@2#2] -- register_copy
//SEG71 [41] phi from gfx_init_chunky::@3 to gfx_init_chunky::@2 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2]
//SEG72 [41] phi (byte) gfx_init_chunky::gfxbCpuBank#4 = (byte) gfx_init_chunky::gfxbCpuBank#8 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#0] -- register_copy
//SEG73 [41] phi (word) gfx_init_chunky::x#2 = (word) gfx_init_chunky::x#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#1] -- register_copy
//SEG74 [41] phi (byte*) gfx_init_chunky::gfxb#3 = (byte*) gfx_init_chunky::gfxb#1 [phi:gfx_init_chunky::@3->gfx_init_chunky::@2#2] -- register_copy
//SEG75 gfx_init_chunky::@2
b2:
//SEG76 [42] if((byte*) gfx_init_chunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_chunky::@3 -- pbuz1_neq_vwuc1_then_la1
lda gfxb+1
cmp #>$8000
bne b3
lda gfxb
cmp #<$8000
bne b3
//SEG77 gfx_init_chunky::@4
//SEG78 [43] (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 ← (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuaa=vbuxx
txa
//SEG79 [44] call dtvSetCpuBankSegment1
//SEG80 [58] phi from gfx_init_chunky::@4 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1]
//SEG81 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = (byte) dtvSetCpuBankSegment1::cpuBankIdx#1 [phi:gfx_init_chunky::@4->dtvSetCpuBankSegment1#0] -- register_copy
jsr dtvSetCpuBankSegment1
//SEG82 gfx_init_chunky::@8
//SEG83 [45] (byte) gfx_init_chunky::gfxbCpuBank#2 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#4 -- vbuxx=_inc_vbuxx
inx
//SEG84 [46] phi from gfx_init_chunky::@8 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3]
//SEG85 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#2 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#0] -- register_copy
//SEG86 [46] phi (byte*) gfx_init_chunky::gfxb#4 = ((byte*))(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@8->gfx_init_chunky::@3#1] -- pbuz1=pbuc1
lda #<$4000
sta gfxb
lda #>$4000
sta gfxb+1
//SEG87 [46] phi from gfx_init_chunky::@2 to gfx_init_chunky::@3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3]
//SEG88 [46] phi (byte) gfx_init_chunky::gfxbCpuBank#8 = (byte) gfx_init_chunky::gfxbCpuBank#4 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#0] -- register_copy
//SEG89 [46] phi (byte*) gfx_init_chunky::gfxb#4 = (byte*) gfx_init_chunky::gfxb#3 [phi:gfx_init_chunky::@2->gfx_init_chunky::@3#1] -- register_copy
//SEG90 gfx_init_chunky::@3
b3:
//SEG91 [47] (word~) gfx_init_chunky::$9 ← (word) gfx_init_chunky::x#2 + (byte) gfx_init_chunky::y#6 -- vwuz1=vwuz2_plus_vbuz3
lda y
clc
adc x
sta _9
lda #0
adc x+1
sta _9+1
//SEG92 [48] (byte) gfx_init_chunky::c#0 ← ((byte)) (word~) gfx_init_chunky::$9 -- vbuaa=_byte_vwuz1
lda _9
//SEG93 [49] *((byte*) gfx_init_chunky::gfxb#4) ← (byte) gfx_init_chunky::c#0 -- _deref_pbuz1=vbuaa
ldy #0
sta (gfxb),y
//SEG94 [50] (byte*) gfx_init_chunky::gfxb#1 ← ++ (byte*) gfx_init_chunky::gfxb#4 -- pbuz1=_inc_pbuz1
inc gfxb
bne !+
inc gfxb+1
!:
//SEG95 [51] (word) gfx_init_chunky::x#1 ← ++ (word) gfx_init_chunky::x#2 -- vwuz1=_inc_vwuz1
inc x
bne !+
inc x+1
!:
//SEG96 [52] if((word) gfx_init_chunky::x#1!=(word/signed word/dword/signed dword) $140) goto gfx_init_chunky::@2 -- vwuz1_neq_vwuc1_then_la1
lda x+1
cmp #>$140
bne b2
lda x
cmp #<$140
bne b2
//SEG97 gfx_init_chunky::@5
//SEG98 [53] (byte) gfx_init_chunky::y#1 ← ++ (byte) gfx_init_chunky::y#6 -- vbuz1=_inc_vbuz1
inc y
//SEG99 [54] if((byte) gfx_init_chunky::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $33) goto gfx_init_chunky::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$33
cmp y
bne b1
//SEG100 [55] phi from gfx_init_chunky::@5 to gfx_init_chunky::@6 [phi:gfx_init_chunky::@5->gfx_init_chunky::@6]
//SEG101 gfx_init_chunky::@6
//SEG102 [56] call dtvSetCpuBankSegment1
//SEG103 [58] phi from gfx_init_chunky::@6 to dtvSetCpuBankSegment1 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1]
//SEG104 [58] phi (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 = ((byte))(word/signed word/dword/signed dword) $4000/(word/signed word/dword/signed dword) $4000 [phi:gfx_init_chunky::@6->dtvSetCpuBankSegment1#0] -- vbuaa=vbuc1
lda #$4000/$4000
jsr dtvSetCpuBankSegment1
//SEG105 gfx_init_chunky::@return
//SEG106 [57] return
rts
}
//SEG107 dtvSetCpuBankSegment1
2019-02-17 23:12:29 +00:00
// 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
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
2019-02-17 23:12:29 +00:00
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
//SEG108 [59] *((const byte*) dtvSetCpuBankSegment1::cpuBank#0) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx#3 -- _deref_pbuc1=vbuaa
sta cpuBank
//SEG109 asm { .byte$32,$dd lda$ff .byte$32,$00 }
.byte $32, $dd
lda $ff
.byte $32, $00
//SEG110 dtvSetCpuBankSegment1::@return
//SEG111 [61] return
rts
}