diff --git a/src/main/fragment/cache/fragment-cache-mos6502.asm b/src/main/fragment/cache/fragment-cache-mos6502.asm index 67a13793b..970ebc2be 100644 --- a/src/main/fragment/cache/fragment-cache-mos6502.asm +++ b/src/main/fragment/cache/fragment-cache-mos6502.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE 1573535dae +//KICKC FRAGMENT CACHE 1533d6e417 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} diff --git a/src/main/fragment/cache/fragment-cache-mos6502x.asm b/src/main/fragment/cache/fragment-cache-mos6502x.asm index 4c01065f0..ebc09096b 100644 --- a/src/main/fragment/cache/fragment-cache-mos6502x.asm +++ b/src/main/fragment/cache/fragment-cache-mos6502x.asm @@ -1,8 +1,26 @@ -//KICKC FRAGMENT CACHE 1573535dae +//KICKC FRAGMENT CACHE 1533d6e417 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} -//FRAGMENT pbuz1=pbuc1 +//FRAGMENT _deref_pbuc1=vbuc2 +lda #{c2} +sta {c1} +//FRAGMENT vbuz1=vbuz2 +lda {z2} +sta {z1} +//FRAGMENT vbuc1_eq_vbuz1_then_la1 +lda #{c1} +cmp {z1} +beq {la1} +//FRAGMENT _deref_qprc1=pprc2 +lda #<{c2} +sta {c1} +lda #>{c2} +sta {c1}+1 +//FRAGMENT _deref_pbuc1=vbuz1 +lda {z1} +sta {c1} +//FRAGMENT pvoz1=pvoc1 lda #<{c1} sta {z1} lda #>{c1} @@ -12,6 +30,1153 @@ lda #<{c1} sta {z1} lda #>{c1} sta {z1}+1 +//FRAGMENT pbuz1=pbuc1 +lda #<{c1} +sta {z1} +lda #>{c1} +sta {z1}+1 +//FRAGMENT vbuz1_lt_vbuc1_then_la1 +lda {z1} +cmp #{c1} +bcc {la1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +//FRAGMENT vbuz1=_inc_vbuz1 +inc {z1} +//FRAGMENT vbuc1_neq_vbuz1_then_la1 +lda #{c1} +cmp {z1} +bne {la1} +//FRAGMENT pbuz1=pbuz2 +lda {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vwuz1=pbuz2_bxor_vwuc1 +lda #<{c1} +eor {z2} +sta {z1} +lda #>{c1} +eor {z2}+1 +sta {z1}+1 +//FRAGMENT vbuz1=vbuz1_bxor_vbuc1 +lda #{c1} +eor {z1} +sta {z1} +//FRAGMENT pbuz1=pbuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT pbuz1_derefidx_vbuz2=vbuc1 +lda #{c1} +ldy {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuz2=vbuz3 +lda {z3} +ldy {z2} +sta ({z1}),y +//FRAGMENT vbuz1=vbuz1_plus_vbuc1 +lax {z1} +axs #-[{c1}] +stx {z1} +//FRAGMENT vbuz1=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +sta {z1} +//FRAGMENT vwuz1_le_0_then_la1 +lda {z1} +bne !+ +lda {z1}+1 +beq {la1} +!: +//FRAGMENT pbuz1=pbuz2_plus_vwuz3 +lda {z2} +clc +adc {z3} +sta {z1} +lda {z2}+1 +adc {z3}+1 +sta {z1}+1 +//FRAGMENT pbuz1_neq_pbuz2_then_la1 +lda {z1}+1 +cmp {z2}+1 +bne {la1} +lda {z1} +cmp {z2} +bne {la1} +//FRAGMENT _deref_pbuz1=vbuz2 +lda {z2} +ldy #0 +sta ({z1}),y +//FRAGMENT pbuz1=_inc_pbuz1 +inc {z1} +bne !+ +inc {z1}+1 +!: +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuc2 +lda #{c2} +and {c1} +sta {c1} +//FRAGMENT _deref_pduc1=vduc2 +lda #<{c2} +sta {c1} +lda #>{c2} +sta {c1}+1 +lda #<{c2}>>$10 +sta {c1}+2 +lda #>{c2}>>$10 +sta {c1}+3 +//FRAGMENT vbuz1=vbuz2_minus_vbuz3 +lda {z2} +sec +sbc {z3} +sta {z1} +//FRAGMENT vbuz1_neq_vbuc1_then_la1 +lda #{c1} +cmp {z1} +bne {la1} +//FRAGMENT vbuz1_gt_vbuz2_then_la1 +lda {z2} +cmp {z1} +bcc {la1} +//FRAGMENT vbuz1_eq_vbuz2_then_la1 +lda {z1} +cmp {z2} +beq {la1} +//FRAGMENT vbuz1=vbuz2_ror_1 +lda {z2} +lsr +sta {z1} +//FRAGMENT vbuz1=vbuz1_plus_vbuz2 +lda {z1} +clc +adc {z2} +sta {z1} +//FRAGMENT vbuz1_le_vbuz2_then_la1 +lda {z2} +cmp {z1} +bcs {la1} +//FRAGMENT vbuz1=vbuz2_ror_3 +lda {z2} +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuz1=vbuz2_rol_1 +lda {z2} +asl +sta {z1} +//FRAGMENT pbuz1=qbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuz1=vbuz2_band_vbuc1 +lda #{c1} +and {z2} +sta {z1} +//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuz3 +ldy {z2} +lda ({z1}),y +ldy {z3} +ora {c1},y +ldy {z2} +sta ({z1}),y +//FRAGMENT vbuz1=vbuz1_minus_vbuz2 +lda {z1} +sec +sbc {z2} +sta {z1} +//FRAGMENT vbuz1_neq_vbuz2_then_la1 +lda {z1} +cmp {z2} +bne {la1} +//FRAGMENT vbuz1_neq_0_then_la1 +lda {z1} +cmp #0 +bne {la1} +//FRAGMENT vbuz1=_deref_pbuz2 +ldy #0 +lda ({z2}),y +sta {z1} +//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuz3 +lda {z1} +ldy {z3} +eor ({z2}),y +sta {z1} +//FRAGMENT vbuz1=_neg_vbuz1 +lda {z1} +eor #$ff +clc +adc #$01 +sta {z1} +//FRAGMENT vbuz1=vbuaa +sta {z1} +//FRAGMENT vbuaa=vbuz1 +lda {z1} +//FRAGMENT vbuxx=vbuz1 +ldx {z1} +//FRAGMENT vbuc1_eq_vbuaa_then_la1 +cmp #{c1} +beq {la1} +//FRAGMENT vbuaa_lt_vbuc1_then_la1 +cmp #{c1} +bcc {la1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1 +ldy {z1} +lda {c1},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1 +ldy {z1} +ldx {c1},y +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1 +ldx {z1} +ldy {c1},x +//FRAGMENT vbuz1=pbuc1_derefidx_vbuaa +tay +lda {c1},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuaa +tay +lda {c1},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuaa +tay +ldx {c1},y +//FRAGMENT vbuyy=pbuc1_derefidx_vbuaa +tax +ldy {c1},x +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx +lda {c1},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy +lda {c1},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx +lda {c1},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy +lda {c1},y +//FRAGMENT pbuz1_derefidx_vbuaa=vbuc1 +tay +lda #{c1} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=vbuc1 +txa +tay +lda #{c1} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuc1 +lda #{c1} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=vbuz2 +txa +tay +lda {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuz2 +lda {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuz2=vbuxx +ldy {z2} +txa +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=vbuxx +txa +tay +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuxx +txa +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuz2=vbuyy +tya +ldy {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=vbuyy +stx $ff +tya +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuyy +tya +sta ({z1}),y +//FRAGMENT vbuxx=vbuxx_plus_vbuc1 +txa +axs #-[{c1}] +//FRAGMENT vbuyy=vbuyy_plus_vbuc1 +tya +clc +adc #{c1} +tay +//FRAGMENT vbuaa=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +//FRAGMENT vbuxx=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +tax +//FRAGMENT vbuyy=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +tay +//FRAGMENT _deref_pbuz1=vbuxx +txa +ldy #0 +sta ({z1}),y +//FRAGMENT _deref_pbuz1=vbuyy +tya +ldy #0 +sta ({z1}),y +//FRAGMENT vbuz1=vbuaa_minus_vbuz2 +sec +sbc {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_minus_vbuz2 +txa +sec +sbc {z2} +sta {z1} +//FRAGMENT vbuz1=vbuyy_minus_vbuz2 +tya +sec +sbc {z2} +sta {z1} +//FRAGMENT vbuaa=vbuz1_minus_vbuz2 +lda {z1} +sec +sbc {z2} +//FRAGMENT vbuaa=vbuaa_minus_vbuz1 +sec +sbc {z1} +//FRAGMENT vbuaa=vbuxx_minus_vbuz1 +txa +sec +sbc {z1} +//FRAGMENT vbuaa=vbuyy_minus_vbuz1 +tya +sec +sbc {z1} +//FRAGMENT vbuxx=vbuz1_minus_vbuz2 +lda {z1} +sec +sbc {z2} +tax +//FRAGMENT vbuxx=vbuaa_minus_vbuz1 +sec +sbc {z1} +tax +//FRAGMENT vbuxx=vbuxx_minus_vbuz1 +txa +sec +sbc {z1} +tax +//FRAGMENT vbuxx=vbuyy_minus_vbuz1 +tya +sec +sbc {z1} +tax +//FRAGMENT vbuyy=vbuz1_minus_vbuz2 +lda {z1} +sec +sbc {z2} +tay +//FRAGMENT vbuyy=vbuaa_minus_vbuz1 +sec +sbc {z1} +tay +//FRAGMENT vbuyy=vbuxx_minus_vbuz1 +txa +sec +sbc {z1} +tay +//FRAGMENT vbuyy=vbuyy_minus_vbuz1 +tya +sec +sbc {z1} +tay +//FRAGMENT vbuz1=vbuz2_minus_vbuaa +eor #$ff +sec +adc {z2} +sta {z1} +//FRAGMENT vbuz1=vbuaa_minus_vbuaa +lda #0 +sta {z1} +//FRAGMENT vbuz1=vbuxx_minus_vbuaa +sta $ff +txa +sec +sbc $ff +sta {z1} +//FRAGMENT vbuz1=vbuyy_minus_vbuaa +sta $ff +tya +sec +sbc $ff +sta {z1} +//FRAGMENT vbuaa=vbuz1_minus_vbuaa +eor #$ff +sec +adc {z1} +//FRAGMENT vbuaa=vbuaa_minus_vbuaa +lda #0 +//FRAGMENT vbuaa=vbuxx_minus_vbuaa +sta $ff +txa +sec +sbc $ff +//FRAGMENT vbuaa=vbuyy_minus_vbuaa +sta $ff +tya +sec +sbc $ff +//FRAGMENT vbuxx=vbuz1_minus_vbuaa +eor #$ff +sec +adc {z1} +tax +//FRAGMENT vbuxx=vbuaa_minus_vbuaa +lda #0 +tax +//FRAGMENT vbuxx=vbuxx_minus_vbuaa +sta $ff +txa +sec +sbc $ff +tax +//FRAGMENT vbuxx=vbuyy_minus_vbuaa +sta $ff +tya +sec +sbc $ff +tax +//FRAGMENT vbuyy=vbuz1_minus_vbuaa +eor #$ff +sec +adc {z1} +tay +//FRAGMENT vbuyy=vbuaa_minus_vbuaa +lda #0 +tay +//FRAGMENT vbuyy=vbuxx_minus_vbuaa +sta $ff +txa +sec +sbc $ff +tay +//FRAGMENT vbuyy=vbuyy_minus_vbuaa +sta $ff +tya +sec +sbc $ff +tay +//FRAGMENT vbuz1=vbuz2_minus_vbuxx +txa +eor #$ff +sec +adc {z2} +sta {z1} +//FRAGMENT vbuz1=vbuaa_minus_vbuxx +stx $ff +sec +sbc $ff +sta {z1} +//FRAGMENT vbuz1=vbuxx_minus_vbuxx +lda #0 +sta {z1} +//FRAGMENT vbuz1=vbuyy_minus_vbuxx +tya +stx $ff +sec +sbc $ff +sta {z1} +//FRAGMENT vbuaa=vbuz1_minus_vbuxx +txa +eor #$ff +sec +adc {z1} +//FRAGMENT vbuaa=vbuaa_minus_vbuxx +stx $ff +sec +sbc $ff +//FRAGMENT vbuaa=vbuxx_minus_vbuxx +lda #0 +//FRAGMENT vbuaa=vbuyy_minus_vbuxx +tya +stx $ff +sec +sbc $ff +//FRAGMENT vbuxx=vbuz1_minus_vbuxx +txa +eor #$ff +sec +adc {z1} +tax +//FRAGMENT vbuxx=vbuaa_minus_vbuxx +stx $ff +sec +sbc $ff +tax +//FRAGMENT vbuxx=vbuxx_minus_vbuxx +lda #0 +tax +//FRAGMENT vbuxx=vbuyy_minus_vbuxx +tya +stx $ff +sec +sbc $ff +tax +//FRAGMENT vbuyy=vbuz1_minus_vbuxx +txa +eor #$ff +sec +adc {z1} +tay +//FRAGMENT vbuyy=vbuaa_minus_vbuxx +stx $ff +sec +sbc $ff +tay +//FRAGMENT vbuyy=vbuxx_minus_vbuxx +lda #0 +tay +//FRAGMENT vbuyy=vbuyy_minus_vbuxx +tya +stx $ff +sec +sbc $ff +tay +//FRAGMENT vbuz1=vbuz2_minus_vbuyy +tya +eor #$ff +sec +adc {z2} +sta {z1} +//FRAGMENT vbuz1=vbuaa_minus_vbuyy +sty $ff +sec +sbc $ff +sta {z1} +//FRAGMENT vbuz1=vbuxx_minus_vbuyy +txa +sty $ff +sec +sbc $ff +sta {z1} +//FRAGMENT vbuz1=vbuyy_minus_vbuyy +lda #0 +sta {z1} +//FRAGMENT vbuaa=vbuz1_minus_vbuyy +tya +eor #$ff +sec +adc {z1} +//FRAGMENT vbuaa=vbuaa_minus_vbuyy +sty $ff +sec +sbc $ff +//FRAGMENT vbuaa=vbuxx_minus_vbuyy +txa +sty $ff +sec +sbc $ff +//FRAGMENT vbuaa=vbuyy_minus_vbuyy +lda #0 +//FRAGMENT vbuxx=vbuz1_minus_vbuyy +tya +eor #$ff +sec +adc {z1} +tax +//FRAGMENT vbuxx=vbuaa_minus_vbuyy +sty $ff +sec +sbc $ff +tax +//FRAGMENT vbuxx=vbuxx_minus_vbuyy +txa +sty $ff +sec +sbc $ff +tax +//FRAGMENT vbuxx=vbuyy_minus_vbuyy +lda #0 +tax +//FRAGMENT vbuyy=vbuz1_minus_vbuyy +tya +eor #$ff +sec +adc {z1} +tay +//FRAGMENT vbuyy=vbuaa_minus_vbuyy +sty $ff +sec +sbc $ff +tay +//FRAGMENT vbuyy=vbuxx_minus_vbuyy +txa +sty $ff +sec +sbc $ff +tay +//FRAGMENT vbuyy=vbuyy_minus_vbuyy +lda #0 +tay +//FRAGMENT vbuxx_neq_vbuc1_then_la1 +cpx #{c1} +bne {la1} +//FRAGMENT vbuxx_gt_vbuz1_then_la1 +txa +cmp {z1} +beq !+ +bcs {la1} +!: +//FRAGMENT vbuyy_gt_vbuz1_then_la1 +tya +cmp {z1} +beq !+ +bcs {la1} +!: +//FRAGMENT vbuz1_gt_vbuxx_then_la1 +cpx {z1} +bcc {la1} +//FRAGMENT vbuxx_eq_vbuz1_then_la1 +cpx {z1} +beq {la1} +//FRAGMENT vbuaa=vbuz1_ror_1 +lda {z1} +lsr +//FRAGMENT vbuxx=vbuz1_ror_1 +lda {z1} +lsr +tax +//FRAGMENT vbuyy=vbuz1_ror_1 +lda {z1} +lsr +tay +//FRAGMENT vbuz1=vbuxx_ror_1 +txa +lsr +sta {z1} +//FRAGMENT vbuaa=vbuxx_ror_1 +txa +lsr +//FRAGMENT vbuxx=vbuxx_ror_1 +txa +lsr +tax +//FRAGMENT vbuyy=vbuxx_ror_1 +txa +lsr +tay +//FRAGMENT vbuz1=vbuyy_ror_1 +tya +lsr +sta {z1} +//FRAGMENT vbuaa=vbuyy_ror_1 +tya +lsr +//FRAGMENT vbuxx=vbuyy_ror_1 +tya +lsr +tax +//FRAGMENT vbuyy=vbuyy_ror_1 +tya +lsr +tay +//FRAGMENT vbuz1=vbuz1_plus_vbuxx +txa +clc +adc {z1} +sta {z1} +//FRAGMENT vbuz1=vbuz1_plus_vbuyy +tya +clc +adc {z1} +sta {z1} +//FRAGMENT vbuxx=vbuxx_plus_vbuz1 +txa +clc +adc {z1} +tax +//FRAGMENT vbuxx=vbuxx_plus_vbuxx +txa +asl +tax +//FRAGMENT vbuxx=vbuxx_plus_vbuyy +txa +sty $ff +clc +adc $ff +tax +//FRAGMENT vbuyy=vbuyy_plus_vbuz1 +tya +clc +adc {z1} +tay +//FRAGMENT vbuyy=vbuyy_plus_vbuxx +txa +sty $ff +clc +adc $ff +tay +//FRAGMENT vbuyy=vbuyy_plus_vbuyy +tya +asl +tay +//FRAGMENT vbuxx_le_vbuz1_then_la1 +lda {z1} +stx $ff +cmp $ff +bcs {la1} +//FRAGMENT vbuyy_le_vbuz1_then_la1 +lda {z1} +sty $ff +cmp $ff +bcs {la1} +//FRAGMENT vbuz1_le_vbuxx_then_la1 +cpx {z1} +bcs {la1} +//FRAGMENT vbuaa=vbuz1_ror_3 +lda {z1} +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuz1_ror_3 +lda {z1} +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuz1_ror_3 +lda {z1} +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuxx_ror_3 +txa +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuaa=vbuxx_ror_3 +txa +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuxx_ror_3 +txa +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuxx_ror_3 +txa +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuyy_ror_3 +tya +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuaa=vbuyy_ror_3 +tya +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuyy_ror_3 +tya +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuyy_ror_3 +tya +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuaa_rol_1 +asl +sta {z1} +//FRAGMENT vbuz1=vbuxx_rol_1 +txa +asl +sta {z1} +//FRAGMENT vbuz1=vbuyy_rol_1 +tya +asl +sta {z1} +//FRAGMENT vbuaa=vbuz1_rol_1 +lda {z1} +asl +//FRAGMENT vbuaa=vbuaa_rol_1 +asl +//FRAGMENT vbuaa=vbuxx_rol_1 +txa +asl +//FRAGMENT vbuaa=vbuyy_rol_1 +tya +asl +//FRAGMENT vbuxx=vbuz1_rol_1 +lda {z1} +asl +tax +//FRAGMENT vbuxx=vbuaa_rol_1 +asl +tax +//FRAGMENT vbuxx=vbuxx_rol_1 +txa +asl +tax +//FRAGMENT vbuxx=vbuyy_rol_1 +tya +asl +tax +//FRAGMENT vbuyy=vbuz1_rol_1 +lda {z1} +asl +tay +//FRAGMENT vbuyy=vbuaa_rol_1 +asl +tay +//FRAGMENT vbuyy=vbuxx_rol_1 +txa +asl +tay +//FRAGMENT vbuyy=vbuyy_rol_1 +tya +asl +tay +//FRAGMENT pbuz1=qbuc1_derefidx_vbuaa +tay +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT pbuz1=qbuc1_derefidx_vbuxx +lda {c1},x +sta {z1} +lda {c1}+1,x +sta {z1}+1 +//FRAGMENT pbuz1=qbuc1_derefidx_vbuyy +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuaa=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +//FRAGMENT vbuxx=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +tax +//FRAGMENT vbuyy=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +tay +//FRAGMENT vbuz1=vbuxx_band_vbuc1 +lda #{c1} +sax {z1} +//FRAGMENT vbuaa=vbuxx_band_vbuc1 +txa +and #{c1} +//FRAGMENT vbuxx=vbuxx_band_vbuc1 +lda #{c1} +axs #0 +//FRAGMENT vbuyy=vbuxx_band_vbuc1 +txa +and #{c1} +tay +//FRAGMENT vbuz1=vbuyy_band_vbuc1 +tya +and #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuyy_band_vbuc1 +tya +and #{c1} +//FRAGMENT vbuxx=vbuyy_band_vbuc1 +ldx #{c1} +tya +axs #0 +//FRAGMENT vbuyy=vbuyy_band_vbuc1 +tya +and #{c1} +tay +//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuaa +ldy {z2} +tax +lda ({z1}),y +ora {c1},x +ldy {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuxx +ldy {z2} +lda ({z1}),y +ora {c1},x +ldy {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuyy +tya +ldy {z2} +tax +lda ({z1}),y +ora {c1},x +ldy {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuz2 +txa +tay +lda ({z1}),y +ldy {z2} +stx $ff +ora {c1},y +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuaa +tay +txa +ldx {c1},y +tay +lda ({z1}),y +sty $ff + +stx $ff +ora $ff +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuxx +txa +tay +lda ({z1}),y +stx $ff +ora {c1},x +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuyy +txa +ldx {c1},y +tay +lda ({z1}),y +sty $ff + +stx $ff +ora $ff +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuz2 +lda ({z1}),y +sty $ff + +ldy {z2} +ora {c1},y +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuaa +tax +lda ({z1}),y +sty $ff + +ora {c1},x +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuxx +lda ({z1}),y +sty $ff + +ora {c1},x +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuyy +lda ({z1}),y +sty $ff + +ora {c1},y +ldy $ff +sta ({z1}),y +//FRAGMENT vbuz1=vbuz1_minus_vbuxx +txa +eor #$ff +sec +adc {z1} +sta {z1} +//FRAGMENT vbuz1_neq_vbuxx_then_la1 +cpx {z1} +bne {la1} +//FRAGMENT vbuxx_neq_0_then_la1 +cpx #0 +bne {la1} +//FRAGMENT vbuxx_neq_vbuz1_then_la1 +cpx {z1} +bne {la1} +//FRAGMENT vbuaa=_deref_pbuz1 +ldy #0 +lda ({z1}),y +//FRAGMENT vbuxx=_deref_pbuz1 +ldy #0 +lda ({z1}),y +tax +//FRAGMENT vbuyy=_deref_pbuz1 +ldy #0 +lda ({z1}),y +tay +//FRAGMENT _deref_pbuz1=vbuaa +ldy #0 +sta ({z1}),y +//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuaa +tay +lda {z1} +eor ({z2}),y +sta {z1} +//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuxx +txa +tay +lda {z1} +eor ({z2}),y +sta {z1} +//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuyy +lda {z1} +eor ({z2}),y +sta {z1} +//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuz2 +ldy {z2} +eor ({z1}),y +//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuaa +tay +eor ({z1}),y +//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuxx +stx $ff +ldy $ff +eor ({z1}),y +//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuyy +eor ({z1}),y +//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuz2 +ldy {z2} +txa +eor ({z1}),y +tax +//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuaa +tay +txa +eor ({z1}),y +tax +//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuxx +txa +tay +eor ({z1}),y +tax +//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuyy +txa +eor ({z1}),y +tax +//FRAGMENT pbuz1_derefidx_vbuz2=vbuaa +ldy {z2} +sta ({z1}),y +//FRAGMENT vbuz1=vbuaa_band_vbuc1 +and #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuaa_band_vbuc1 +and #{c1} +//FRAGMENT vbuxx=vbuaa_band_vbuc1 +ldx #{c1} +axs #0 +//FRAGMENT vbuc1_neq_vbuaa_then_la1 +cmp #{c1} +bne {la1} +//FRAGMENT vbuaa=_neg_vbuaa +eor #$ff +clc +adc #$01 +//FRAGMENT vbuxx=_neg_vbuxx +dex +txa +eor #$ff +tax +//FRAGMENT vbuyy=_neg_vbuyy +dey +tya +eor #$ff +tay +//FRAGMENT vbuxx_lt_vbuc1_then_la1 +cpx #{c1} +bcc {la1} +//FRAGMENT vbuz1=vbuxx +stx {z1} +//FRAGMENT vbuxx=vbuc1 +ldx #{c1} +//FRAGMENT vbuxx=_inc_vbuxx +inx +//FRAGMENT vbuyy=vbuc1 +ldy #{c1} +//FRAGMENT vbuyy_lt_vbuc1_then_la1 +cpy #{c1} +bcc {la1} +//FRAGMENT vbuyy=_inc_vbuyy +iny +//FRAGMENT pbuz1_derefidx_vbuxx=vbuaa +stx $ff +ldy $ff +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuaa +sta ({z1}),y +//FRAGMENT vbuz1=vbuyy +sty {z1} +//FRAGMENT vbuc1_neq_vbuxx_then_la1 +cpx #{c1} +bne {la1} +//FRAGMENT vbuc1_neq_vbuyy_then_la1 +cpy #{c1} +bne {la1} +//FRAGMENT vbuyy=vbuaa_band_vbuc1 +and #{c1} +tay +//FRAGMENT vbuaa=vbuxx +txa +//FRAGMENT vbuaa=vbuyy +tya +//FRAGMENT vbuxx=vbuaa +tax +//FRAGMENT vbuxx=vbuyy +tya +tax +//FRAGMENT vbuyy=vbuz1 +ldy {z1} +//FRAGMENT vbuyy=vbuaa +tay +//FRAGMENT vbuyy=vbuxx +txa +tay +//FRAGMENT vbuc1_eq_vbuxx_then_la1 +cpx #{c1} +beq {la1} +//FRAGMENT vbuc1_eq_vbuyy_then_la1 +cpy #{c1} +beq {la1} +//FRAGMENT vbuaa=vbuc1 +lda #{c1} +//FRAGMENT vwuz1=pbuz1_bxor_vwuc1 +lda #<{c1} +eor {z1} +sta {z1} +lda #>{c1} +eor {z1}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vwuz1 +lda {z1} +clc +adc {z2} +sta {z1} +lda {z1}+1 +adc {z2}+1 +sta {z1}+1 //FRAGMENT vwsz1=vwsc1 lda #<{c1} sta {z1} @@ -43,17 +1208,6 @@ lda {z2} sta {z1} lda {z2}+1 sta {z1}+1 -//FRAGMENT vbuz1=_inc_vbuz1 -inc {z1} -//FRAGMENT vbuz1_neq_vbuc1_then_la1 -lda #{c1} -cmp {z1} -bne {la1} -//FRAGMENT pbuz1=pbuz2 -lda {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 //FRAGMENT vwsz1_lt_0_then_la1 lda {z1}+1 bmi {la1} @@ -65,29 +1219,12 @@ sta {z1} lda #0 sbc {z1}+1 sta {z1}+1 -//FRAGMENT _deref_pbuz1=vbuz2 -lda {z2} -ldy #0 -sta ({z1}),y -//FRAGMENT pbuz1=_inc_pbuz1 -inc {z1} -bne !+ -inc {z1}+1 -!: //FRAGMENT vbuz1=_hi_vwuz2 lda {z2}+1 sta {z1} //FRAGMENT vbuz1=_lo_vwuz2 lda {z2} sta {z1} -//FRAGMENT pbuz1=pbuz1_plus_vbuc1 -lda #{c1} -clc -adc {z1} -sta {z1} -bcc !+ -inc {z1}+1 -!: //FRAGMENT pbuz1_lt_pbuz2_then_la1 lda {z1}+1 cmp {z2}+1 @@ -104,28 +1241,6 @@ lsr lsr lsr sta {z1} -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -sta {z1} -//FRAGMENT vbuz1=vbuz2_band_vbuc1 -lda #{c1} -and {z2} -sta {z1} -//FRAGMENT vbuxx_neq_vbuc1_then_la1 -cpx #{c1} -bne {la1} -//FRAGMENT _deref_pbuz1=vbuaa -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=vbuxx -txa -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=vbuyy -tya -ldy #0 -sta ({z1}),y //FRAGMENT vbuaa=_hi_vwuz1 lda {z1}+1 //FRAGMENT vbuxx=_hi_vwuz1 @@ -204,84 +1319,15 @@ lsr lsr lsr tay -//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1 -ldy {z1} -lda {c1},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1 -ldy {z1} -ldx {c1},y -//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1 -ldx {z1} -ldy {c1},x -//FRAGMENT vbuz1=pbuc1_derefidx_vbuaa -tay -lda {c1},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuaa -tay -lda {c1},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuaa -tay -ldx {c1},y -//FRAGMENT vbuyy=pbuc1_derefidx_vbuaa -tax -ldy {c1},x -//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx -lda {c1},x -sta {z1} -//FRAGMENT vbuz1=vbuxx_band_vbuc1 -lda #{c1} -sax {z1} -//FRAGMENT vbuaa=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -//FRAGMENT vbuaa=vbuxx_band_vbuc1 -txa -and #{c1} -//FRAGMENT vbuxx=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -tax -//FRAGMENT vbuxx=vbuxx_band_vbuc1 -lda #{c1} -axs #0 -//FRAGMENT vbuyy=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -tay -//FRAGMENT vbuyy=vbuxx_band_vbuc1 -txa -and #{c1} -tay -//FRAGMENT vbuaa=vbuc1 -lda #{c1} -//FRAGMENT vbuxx=vbuc1 -ldx #{c1} -//FRAGMENT vbuyy=vbuc1 -ldy #{c1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx -lda {c1},x -//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy -lda {c1},y -//FRAGMENT vbuz1_lt_vbuc1_then_la1 -lda {z1} -cmp #{c1} -bcc {la1} //FRAGMENT pbuc1_derefidx_vbuz1=vbuc2 lda #{c2} ldy {z1} sta {c1},y -//FRAGMENT _deref_pbuc1=vbuc2 -lda #{c2} -sta {c1} //FRAGMENT vbuz1=vbuz1_plus_2 lda {z1} clc adc #2 sta {z1} -//FRAGMENT vbuaa_lt_vbuc1_then_la1 -cmp #{c1} -bcc {la1} //FRAGMENT pbuc1_derefidx_vbuaa=vbuc2 tay lda #{c2} @@ -295,12 +1341,6 @@ sta {c1},y //FRAGMENT vbuxx=vbuxx_plus_2 inx inx -//FRAGMENT vbuxx_lt_vbuc1_then_la1 -cpx #{c1} -bcc {la1} -//FRAGMENT vbuyy_lt_vbuc1_then_la1 -cpy #{c1} -bcc {la1} //FRAGMENT vbuyy=vbuyy_plus_2 iny iny @@ -323,9 +1363,6 @@ sta {z1} lax {z2} axs #-[{c1}] stx {z1} -//FRAGMENT vbuz1=vbuz2 -lda {z2} -sta {z1} //FRAGMENT vwuz1=vwuz1_plus_vwuz2 lda {z1} clc @@ -355,10 +1392,6 @@ ldy #0 lda ({z1}),y cmp #{c1} bne {la1} -//FRAGMENT vbuz1=_deref_pbuz2 -ldy #0 -lda ({z2}),y -sta {z1} //FRAGMENT vwuz1=vwuz1_minus_vwuc1 lda {z1} sec @@ -386,11 +1419,6 @@ asl {z1} rol {z1}+1 asl {z1} rol {z1}+1 -//FRAGMENT vbuz1=vbuz2_minus_vbuz3 -lda {z2} -sec -sbc {z3} -sta {z1} //FRAGMENT vbuz1=vbuz2_plus_vbuz3 lda {z2} clc @@ -458,10 +1486,6 @@ lda {z2} sta {z1} lda #0 sta {z1}+1 -//FRAGMENT vbuz1_neq_0_then_la1 -lda {z1} -cmp #0 -bne {la1} //FRAGMENT vbuz1=vbuz1_ror_1 lsr {z1} //FRAGMENT vbsaa=vbsz1 @@ -496,19 +1520,6 @@ adc #{c1} //FRAGMENT vbuxx=vbuc1_plus_vbuaa tax axs #-[{c1}] -//FRAGMENT vbuz1=vbuxx -stx {z1} -//FRAGMENT vbuaa=_deref_pbuz1 -ldy #0 -lda ({z1}),y -//FRAGMENT vbuxx=_deref_pbuz1 -ldy #0 -lda ({z1}),y -tax -//FRAGMENT vbuyy=_deref_pbuz1 -ldy #0 -lda ({z1}),y -tay //FRAGMENT vbuz1=vbuyy_ror_4 tya lsr @@ -536,325 +1547,6 @@ lsr lsr lsr tay -//FRAGMENT vbuz1=vbuyy_band_vbuc1 -tya -and #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuyy_band_vbuc1 -tya -and #{c1} -//FRAGMENT vbuxx=vbuyy_band_vbuc1 -ldx #{c1} -tya -axs #0 -//FRAGMENT vbuyy=vbuyy_band_vbuc1 -tya -and #{c1} -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy -lda {c1},y -sta {z1} -//FRAGMENT vbuaa=vbuz1 -lda {z1} -//FRAGMENT vbuxx=vbuz1 -ldx {z1} -//FRAGMENT vbuz1=vbuaa -sta {z1} -//FRAGMENT vbuz1=vbuaa_minus_vbuz2 -sec -sbc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_minus_vbuz2 -txa -sec -sbc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuyy_minus_vbuz2 -tya -sec -sbc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuz2_minus_vbuaa -eor #$ff -sec -adc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuaa_minus_vbuaa -lda #0 -sta {z1} -//FRAGMENT vbuz1=vbuxx_minus_vbuaa -sta $ff -txa -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuyy_minus_vbuaa -sta $ff -tya -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuz2_minus_vbuxx -txa -eor #$ff -sec -adc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuaa_minus_vbuxx -stx $ff -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuxx_minus_vbuxx -lda #0 -sta {z1} -//FRAGMENT vbuz1=vbuyy_minus_vbuxx -tya -stx $ff -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuz2_minus_vbuyy -tya -eor #$ff -sec -adc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuaa_minus_vbuyy -sty $ff -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuxx_minus_vbuyy -txa -sty $ff -sec -sbc $ff -sta {z1} -//FRAGMENT vbuz1=vbuyy_minus_vbuyy -lda #0 -sta {z1} -//FRAGMENT vbuaa=vbuz1_minus_vbuz2 -lda {z1} -sec -sbc {z2} -//FRAGMENT vbuaa=vbuaa_minus_vbuz1 -sec -sbc {z1} -//FRAGMENT vbuaa=vbuxx_minus_vbuz1 -txa -sec -sbc {z1} -//FRAGMENT vbuaa=vbuyy_minus_vbuz1 -tya -sec -sbc {z1} -//FRAGMENT vbuaa=vbuz1_minus_vbuaa -eor #$ff -sec -adc {z1} -//FRAGMENT vbuaa=vbuaa_minus_vbuaa -lda #0 -//FRAGMENT vbuaa=vbuxx_minus_vbuaa -sta $ff -txa -sec -sbc $ff -//FRAGMENT vbuaa=vbuyy_minus_vbuaa -sta $ff -tya -sec -sbc $ff -//FRAGMENT vbuaa=vbuz1_minus_vbuxx -txa -eor #$ff -sec -adc {z1} -//FRAGMENT vbuaa=vbuaa_minus_vbuxx -stx $ff -sec -sbc $ff -//FRAGMENT vbuaa=vbuxx_minus_vbuxx -lda #0 -//FRAGMENT vbuaa=vbuyy_minus_vbuxx -tya -stx $ff -sec -sbc $ff -//FRAGMENT vbuaa=vbuz1_minus_vbuyy -tya -eor #$ff -sec -adc {z1} -//FRAGMENT vbuaa=vbuaa_minus_vbuyy -sty $ff -sec -sbc $ff -//FRAGMENT vbuaa=vbuxx_minus_vbuyy -txa -sty $ff -sec -sbc $ff -//FRAGMENT vbuaa=vbuyy_minus_vbuyy -lda #0 -//FRAGMENT vbuxx=vbuz1_minus_vbuz2 -lda {z1} -sec -sbc {z2} -tax -//FRAGMENT vbuxx=vbuaa_minus_vbuz1 -sec -sbc {z1} -tax -//FRAGMENT vbuxx=vbuxx_minus_vbuz1 -txa -sec -sbc {z1} -tax -//FRAGMENT vbuxx=vbuyy_minus_vbuz1 -tya -sec -sbc {z1} -tax -//FRAGMENT vbuxx=vbuz1_minus_vbuaa -eor #$ff -sec -adc {z1} -tax -//FRAGMENT vbuxx=vbuaa_minus_vbuaa -lda #0 -tax -//FRAGMENT vbuxx=vbuxx_minus_vbuaa -sta $ff -txa -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuyy_minus_vbuaa -sta $ff -tya -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuz1_minus_vbuxx -txa -eor #$ff -sec -adc {z1} -tax -//FRAGMENT vbuxx=vbuaa_minus_vbuxx -stx $ff -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuxx_minus_vbuxx -lda #0 -tax -//FRAGMENT vbuxx=vbuyy_minus_vbuxx -tya -stx $ff -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuz1_minus_vbuyy -tya -eor #$ff -sec -adc {z1} -tax -//FRAGMENT vbuxx=vbuaa_minus_vbuyy -sty $ff -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuxx_minus_vbuyy -txa -sty $ff -sec -sbc $ff -tax -//FRAGMENT vbuxx=vbuyy_minus_vbuyy -lda #0 -tax -//FRAGMENT vbuyy=vbuz1_minus_vbuz2 -lda {z1} -sec -sbc {z2} -tay -//FRAGMENT vbuyy=vbuaa_minus_vbuz1 -sec -sbc {z1} -tay -//FRAGMENT vbuyy=vbuxx_minus_vbuz1 -txa -sec -sbc {z1} -tay -//FRAGMENT vbuyy=vbuyy_minus_vbuz1 -tya -sec -sbc {z1} -tay -//FRAGMENT vbuyy=vbuz1_minus_vbuaa -eor #$ff -sec -adc {z1} -tay -//FRAGMENT vbuyy=vbuaa_minus_vbuaa -lda #0 -tay -//FRAGMENT vbuyy=vbuxx_minus_vbuaa -sta $ff -txa -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuyy_minus_vbuaa -sta $ff -tya -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuz1_minus_vbuxx -txa -eor #$ff -sec -adc {z1} -tay -//FRAGMENT vbuyy=vbuaa_minus_vbuxx -stx $ff -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuxx_minus_vbuxx -lda #0 -tay -//FRAGMENT vbuyy=vbuyy_minus_vbuxx -tya -stx $ff -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuz1_minus_vbuyy -tya -eor #$ff -sec -adc {z1} -tay -//FRAGMENT vbuyy=vbuaa_minus_vbuyy -sty $ff -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuxx_minus_vbuyy -txa -sty $ff -sec -sbc $ff -tay -//FRAGMENT vbuyy=vbuyy_minus_vbuyy -lda #0 -tay //FRAGMENT vbuaa=vbuz1_plus_vbuz2 lda {z1} clc @@ -931,11 +1623,6 @@ sta {z1} txa clc adc {z1} -//FRAGMENT vbuxx=vbuxx_plus_vbuz1 -txa -clc -adc {z1} -tax //FRAGMENT vbuyy=vbuxx_plus_vbuz1 txa clc @@ -967,10 +1654,6 @@ sta {z1} //FRAGMENT vbuaa=vbuxx_plus_vbuxx txa asl -//FRAGMENT vbuxx=vbuxx_plus_vbuxx -txa -asl -tax //FRAGMENT vbuyy=vbuxx_plus_vbuxx txa asl @@ -986,12 +1669,6 @@ txa sty $ff clc adc $ff -//FRAGMENT vbuxx=vbuxx_plus_vbuyy -txa -sty $ff -clc -adc $ff -tax //FRAGMENT vbuyy=vbuxx_plus_vbuyy txa sty $ff @@ -1012,11 +1689,6 @@ tya clc adc {z1} tax -//FRAGMENT vbuyy=vbuyy_plus_vbuz1 -tya -clc -adc {z1} -tay //FRAGMENT vbuz1=vbuyy_plus_vbuaa sty $ff clc @@ -1053,12 +1725,6 @@ sty $ff clc adc $ff tax -//FRAGMENT vbuyy=vbuyy_plus_vbuxx -txa -sty $ff -clc -adc $ff -tay //FRAGMENT vbuz1=vbuyy_plus_vbuyy tya asl @@ -1070,10 +1736,6 @@ asl tya asl tax -//FRAGMENT vbuyy=vbuyy_plus_vbuyy -tya -asl -tay //FRAGMENT vbuxx_eq_0_then_la1 cpx #0 beq {la1} @@ -1201,14 +1863,6 @@ sta {z1}+1 //FRAGMENT vbsaa_lt_0_then_la1 cmp #0 bmi {la1} -//FRAGMENT vbuz1=vbuaa_band_vbuc1 -and #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuaa_band_vbuc1 -and #{c1} -//FRAGMENT vbuxx=vbuaa_band_vbuc1 -ldx #{c1} -axs #0 //FRAGMENT vbuaa_eq_0_then_la1 cmp #0 beq {la1} @@ -1252,50 +1906,19 @@ tya sta {z1} lda #0 sta {z1}+1 -//FRAGMENT vbuxx_neq_0_then_la1 -cpx #0 -bne {la1} //FRAGMENT vbsz1=vbsxx stx {z1} //FRAGMENT vbuyy_eq_0_then_la1 cpy #0 beq {la1} -//FRAGMENT vbuxx=vbuxx_ror_1 -txa -lsr -tax -//FRAGMENT vbuyy=vbuz1 -ldy {z1} //FRAGMENT vbuyy_neq_0_then_la1 cpy #0 bne {la1} -//FRAGMENT vbuyy=vbuyy_ror_1 -tya -lsr -tay //FRAGMENT vbuyy=_hi_vwuz1 ldy {z1}+1 -//FRAGMENT vbuyy=vbuaa_band_vbuc1 -and #{c1} -tay -//FRAGMENT vbuxx=_inc_vbuxx -inx -//FRAGMENT vbuyy=_inc_vbuyy -iny //FRAGMENT vbuyy_neq_vbuc1_then_la1 cpy #{c1} bne {la1} -//FRAGMENT vbuxx=vbuaa -tax -//FRAGMENT vbuxx=vbuyy -tya -tax -//FRAGMENT vbuaa=vbuyy -tya -//FRAGMENT vbuz1=vbuyy -sty {z1} -//FRAGMENT vbuaa=vbuxx -txa //FRAGMENT vbuaa=_dec_vbuaa sec sbc #1 @@ -1321,8 +1944,6 @@ tay //FRAGMENT vbsyy=vbsxx txa tay -//FRAGMENT vbuyy=vbuaa -tay //FRAGMENT vwuz1=vwuz1_sethi_vbuxx stx {z1}+1 //FRAGMENT vbuxx=vbuxx_minus_vbuc1 @@ -1391,10 +2012,6 @@ rol {z1}+1 dey bne !- !e: -//FRAGMENT vbuz1_eq_vbuz2_then_la1 -lda {z1} -cmp {z2} -beq {la1} //FRAGMENT pbuc1_derefidx_vbuz1=vbuz2 lda {z2} ldy {z1} @@ -1466,10 +2083,6 @@ bne {la1} //FRAGMENT vbuaa=pbuz1_derefidx_vbuz2 ldy {z2} lda ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=vbuaa -stx $ff -ldy $ff -sta ({z1}),y //FRAGMENT vbuc1_neq_pbuz1_derefidx_vbuaa_then_la1 tay lda ({z1}),y @@ -1494,22 +2107,6 @@ tay lda ({z1}),y //FRAGMENT vbuaa=pbuz1_derefidx_vbuyy lda ({z1}),y -//FRAGMENT _deref_pbuc1=vbuz1 -lda {z1} -sta {c1} -//FRAGMENT vbuz1_neq_vbuz2_then_la1 -lda {z1} -cmp {z2} -bne {la1} -//FRAGMENT vbuz1_gt_vbuz2_then_la1 -lda {z2} -cmp {z1} -bcc {la1} -//FRAGMENT vbuz1=vbuz1_minus_vbuz2 -lda {z1} -sec -sbc {z2} -sta {z1} //FRAGMENT _deref_pbuc1=vbuaa sta {c1} //FRAGMENT vbuz1_neq_vbuaa_then_la1 @@ -1523,39 +2120,18 @@ eor #$ff sec adc {z1} sta {z1} -//FRAGMENT vbuz1=vbuz1_minus_vbuxx -txa -eor #$ff -sec -adc {z1} -sta {z1} //FRAGMENT vbuz1=vbuz1_minus_vbuyy tya eor #$ff sec adc {z1} sta {z1} -//FRAGMENT vbuz1_neq_vbuxx_then_la1 -cpx {z1} -bne {la1} -//FRAGMENT vbuz1_gt_vbuxx_then_la1 -cpx {z1} -bcc {la1} //FRAGMENT vbuz1_neq_vbuyy_then_la1 cpy {z1} bne {la1} //FRAGMENT vbuz1_gt_vbuyy_then_la1 cpy {z1} bcc {la1} -//FRAGMENT vbuxx_neq_vbuz1_then_la1 -cpx {z1} -bne {la1} -//FRAGMENT vbuxx_gt_vbuz1_then_la1 -txa -cmp {z1} -beq !+ -bcs {la1} -!: //FRAGMENT vbuxx_neq_vbuyy_then_la1 stx $ff cpy $ff @@ -1568,12 +2144,6 @@ bcc {la1} //FRAGMENT vbuyy_neq_vbuz1_then_la1 cpy {z1} bne {la1} -//FRAGMENT vbuyy_gt_vbuz1_then_la1 -tya -cmp {z1} -beq !+ -bcs {la1} -!: //FRAGMENT vbuyy_neq_vbuxx_then_la1 stx $ff cpy $ff @@ -1582,9 +2152,6 @@ bne {la1} sty $ff cpx $ff bcc {la1} -//FRAGMENT vbuyy=vbuxx -txa -tay //FRAGMENT _deref_pbuc1=vbuxx stx {c1} //FRAGMENT _deref_pbuc1=vbuyy @@ -1606,11 +2173,6 @@ adc #1 lda #{c2} ora {c1} sta {c1} -//FRAGMENT _deref_qprc1=pprc2 -lda #<{c2} -sta {c1} -lda #>{c2} -sta {c1}+1 //FRAGMENT _deref_pbuc1=_inc__deref_pbuc1 inc {c1} //FRAGMENT _deref_pbuc1_lt_vbuc2_then_la1 @@ -1644,18 +2206,10 @@ sta {z1} lda {z2}+1 rol sta {z1}+1 -//FRAGMENT vbuz1=vbuz1_plus_vbuc1 -lax {z1} -axs #-[{c1}] -stx {z1} //FRAGMENT vbsz1=vbsz1_plus_vbsc1 lax {z1} axs #-[{c1}] stx {z1} -//FRAGMENT vbuc1_neq_vbuz1_then_la1 -lda #{c1} -cmp {z1} -bne {la1} //FRAGMENT _deref_pbuc1=_deref_pbuc2 lda {c2} sta {c1} @@ -1664,11 +2218,6 @@ ldy {z2} lda {c1},y ldy #0 sta ({z1}),y -//FRAGMENT vbuz1=vbuz1_plus_vbuz2 -lda {z1} -clc -adc {z2} -sta {z1} //FRAGMENT vwuz1=vwuz1_plus_vbuz2 lda {z2} clc @@ -1702,10 +2251,6 @@ sta {z1} lda {z2}+1 adc {z3}+1 sta {z1}+1 -//FRAGMENT vbuz1=vbuz2_rol_1 -lda {z2} -asl -sta {z1} //FRAGMENT pwuc1_derefidx_vbuz1=vwuz2 ldy {z1} lda {z2} @@ -1718,12 +2263,6 @@ lda #<{c2} sta {c1},y lda #>{c2} sta {c1}+1,y -//FRAGMENT pbuz1=qbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 //FRAGMENT pbuz1_derefidx_vbuc1=vbuc2 lda #{c2} ldy #{c1} @@ -1733,12 +2272,6 @@ lda {z2} lsr lsr sta {z1} -//FRAGMENT vbuz1=vbuz2_ror_3 -lda {z2} -lsr -lsr -lsr -sta {z1} //FRAGMENT vwuz1=pwuc1_derefidx_vbuz2 ldy {z2} lda {c1},y @@ -1800,10 +2333,6 @@ lda ({z1}),y cmp ({z3}),y beq {la1} -//FRAGMENT vbuc1_eq_vbuz1_then_la1 -lda #{c1} -cmp {z1} -beq {la1} //FRAGMENT vbuz1_gt_0_then_la1 lda {z1} bne {la1} @@ -1842,10 +2371,6 @@ lda {z2} sec sbc {c1} sta {z1} -//FRAGMENT vbuz1=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -sta {z1} //FRAGMENT vwuz1=_deref_pbuc1_word__deref_pbuc2 lda {c2} sta {z1} @@ -1867,14 +2392,6 @@ lda {c1},y //FRAGMENT vbsxx=pbsc1_derefidx_vbuz1 ldy {z1} ldx {c1},y -//FRAGMENT vbuxx=vbuxx_plus_vbuc1 -txa -axs #-[{c1}] -//FRAGMENT vbuyy=vbuyy_plus_vbuc1 -tya -clc -adc #{c1} -tay //FRAGMENT vbsxx=vbsxx_plus_vbsc1 txa axs #-[{c1}] @@ -1883,9 +2400,6 @@ tya clc adc #{c1} tay -//FRAGMENT vbuc1_neq_vbuaa_then_la1 -cmp #{c1} -bne {la1} //FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuxx lda {c1},x ldy #0 @@ -1894,11 +2408,6 @@ sta ({z1}),y lda {c1},y ldy #0 sta ({z1}),y -//FRAGMENT vbuz1=vbuz1_plus_vbuxx -txa -clc -adc {z1} -sta {z1} //FRAGMENT vwuz1=vwuz1_plus_vbuxx txa clc @@ -1930,47 +2439,6 @@ sta {z1} lda #>{c1} adc #0 sta {z1}+1 -//FRAGMENT vbuz1=vbuxx_rol_1 -txa -asl -sta {z1} -//FRAGMENT vbuz1=vbuyy_rol_1 -tya -asl -sta {z1} -//FRAGMENT vbuaa=vbuz1_rol_1 -lda {z1} -asl -//FRAGMENT vbuaa=vbuxx_rol_1 -txa -asl -//FRAGMENT vbuaa=vbuyy_rol_1 -tya -asl -//FRAGMENT vbuxx=vbuz1_rol_1 -lda {z1} -asl -tax -//FRAGMENT vbuxx=vbuxx_rol_1 -txa -asl -tax -//FRAGMENT vbuxx=vbuyy_rol_1 -tya -asl -tax -//FRAGMENT vbuyy=vbuz1_rol_1 -lda {z1} -asl -tay -//FRAGMENT vbuyy=vbuxx_rol_1 -txa -asl -tay -//FRAGMENT vbuyy=vbuyy_rol_1 -tya -asl -tay //FRAGMENT pwuc1_derefidx_vbuaa=vwuz1 tay lda {z1} @@ -1987,17 +2455,6 @@ lda {z1} sta {c1},y lda {z1}+1 sta {c1}+1,y -//FRAGMENT vbuz1=vbuaa_rol_1 -asl -sta {z1} -//FRAGMENT vbuaa=vbuaa_rol_1 -asl -//FRAGMENT vbuxx=vbuaa_rol_1 -asl -tax -//FRAGMENT vbuyy=vbuaa_rol_1 -asl -tay //FRAGMENT qbuc1_derefidx_vbuaa=pbuc2 tay lda #<{c2} @@ -2014,22 +2471,6 @@ lda #<{c2} sta {c1},y lda #>{c2} sta {c1}+1,y -//FRAGMENT pbuz1=qbuc1_derefidx_vbuaa -tay -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 -//FRAGMENT pbuz1=qbuc1_derefidx_vbuxx -lda {c1},x -sta {z1} -lda {c1}+1,x -sta {z1}+1 -//FRAGMENT pbuz1=qbuc1_derefidx_vbuyy -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 //FRAGMENT vbuz1=vbuaa_ror_2 lsr lsr @@ -2097,69 +2538,6 @@ tya lsr lsr tay -//FRAGMENT vbuaa=vbuz1_ror_3 -lda {z1} -lsr -lsr -lsr -//FRAGMENT vbuxx=vbuz1_ror_3 -lda {z1} -lsr -lsr -lsr -tax -//FRAGMENT vbuyy=vbuz1_ror_3 -lda {z1} -lsr -lsr -lsr -tay -//FRAGMENT vbuz1=vbuxx_ror_3 -txa -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuaa=vbuxx_ror_3 -txa -lsr -lsr -lsr -//FRAGMENT vbuxx=vbuxx_ror_3 -txa -lsr -lsr -lsr -tax -//FRAGMENT vbuyy=vbuxx_ror_3 -txa -lsr -lsr -lsr -tay -//FRAGMENT vbuz1=vbuyy_ror_3 -tya -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuaa=vbuyy_ror_3 -tya -lsr -lsr -lsr -//FRAGMENT vbuxx=vbuyy_ror_3 -tya -lsr -lsr -lsr -tax -//FRAGMENT vbuyy=vbuyy_ror_3 -tya -lsr -lsr -lsr -tay //FRAGMENT vwuz1=pwuc1_derefidx_vbuaa tay lda {c1},y @@ -2315,9 +2693,6 @@ lda ({z1}),y cmp ({z2}),y beq {la1} -//FRAGMENT vbuc1_eq_vbuaa_then_la1 -cmp #{c1} -beq {la1} //FRAGMENT vbuaa_gt_0_then_la1 cmp #0 bne {la1} @@ -2607,35 +2982,12 @@ tya sec sbc {c1} tay -//FRAGMENT vbuaa=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -//FRAGMENT vbuxx=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -tax -//FRAGMENT vbuyy=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -tay //FRAGMENT vbsyy=pbsc1_derefidx_vbuz1 ldx {z1} ldy {c1},x //FRAGMENT vbuxx_gt_0_then_la1 cpx #0 bne {la1} -//FRAGMENT vbuc1_eq_vbuxx_then_la1 -cpx #{c1} -beq {la1} -//FRAGMENT vbuc1_eq_vbuyy_then_la1 -cpy #{c1} -beq {la1} -//FRAGMENT vbuc1_neq_vbuxx_then_la1 -cpx #{c1} -bne {la1} -//FRAGMENT vbuc1_neq_vbuyy_then_la1 -cpy #{c1} -bne {la1} //FRAGMENT vbuz1=vbuyy_bor_vbuxx txa sty $ff @@ -3667,10 +4019,6 @@ sta {z1} lda #0 sbc {z2}+1 sta {z1}+1 -//FRAGMENT vbuz1=vbuz1_bxor_vbuc1 -lda #{c1} -eor {z1} -sta {z1} //FRAGMENT vbuz1=_byte_vwuz2 lda {z2} sta {z1} @@ -3827,6 +4175,26 @@ sta {c1},y lda {c2},x cmp #{c1} bne {la1} +//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3 +ldx {z1} +ldy {z3} +lda ({z2}),y +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuaa +ldx {z1} +tay +lda ({z2}),y +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuxx +txa +ldx {z1} +tay +lda ({z2}),y +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy +lda ({z2}),y +ldx {z1} +sta {c1},x //FRAGMENT vbuz1=vbuz2_plus_vbuc1 lax {z2} axs #-[{c1}] @@ -3967,9 +4335,6 @@ adc #1 clc adc #1 sta {z1} -//FRAGMENT vbuxx_eq_vbuz1_then_la1 -cpx {z1} -beq {la1} //FRAGMENT vwuz1=vwuz2_plus_vbuxx txa clc @@ -4181,13 +4546,6 @@ sta {z1} lda {z2}+1 adc {z3}+1 sta {z1}+1 -//FRAGMENT pbuz1_neq_pbuz2_then_la1 -lda {z1}+1 -cmp {z2}+1 -bne {la1} -lda {z1} -cmp {z2} -bne {la1} //FRAGMENT vwsz1=vbsc1_minus_vwsz2 NO_SYNTHESIS //FRAGMENT vwsz1=vwuc1_minus_vwsz2 @@ -4552,11 +4910,6 @@ sta {c1}+1 //FRAGMENT vbuz1=_deref_pbuc1 lda {c1} sta {z1} -//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3 -ldx {z1} -ldy {z3} -lda ({z2}),y -sta {c1},x //FRAGMENT vbuaa=_deref_pbuc1 lda {c1} //FRAGMENT vbuxx=_deref_pbuc1 @@ -4596,16 +4949,6 @@ sta {c1},y //FRAGMENT pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx lda {c2},x sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuxx -txa -ldx {z1} -tay -lda ({z2}),y -sta {c1},x -//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy -lda ({z2}),y -ldx {z1} -sta {c1},x //FRAGMENT pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuz2 ldy {z2} lda ({z1}),y @@ -4937,14 +5280,6 @@ ldy {z3} lda ({z2}),y asl sta {z1} -//FRAGMENT pbuz1_derefidx_vbuz2=vbuz3 -lda {z3} -ldy {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuz2=vbuc1 -lda #{c1} -ldy {z2} -sta ({z1}),y //FRAGMENT vwuz1=vwuz2_ror_1 lda {z2}+1 lsr @@ -5247,29 +5582,6 @@ tax lda ({z1}),y asl tay -//FRAGMENT pbuz1_derefidx_vbuxx=vbuz2 -txa -tay -lda {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=vbuz2 -lda {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuz2=vbuaa -ldy {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=vbuc1 -txa -tay -lda #{c1} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=vbuc1 -lda #{c1} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuaa=vbuc1 -tay -lda #{c1} -sta ({z1}),y //FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuaa tay sec @@ -5344,27 +5656,14 @@ sta {z1} //FRAGMENT vbuaa=vbuz1_bor_vbuyy tya ora {z1} -//FRAGMENT pbuz1_derefidx_vbuz2=vbuxx -ldy {z2} -txa -sta ({z1}),y //FRAGMENT vbuxx=vbuz1_bor_vbuyy tya ora {z1} tax -//FRAGMENT pbuz1_derefidx_vbuz2=vbuyy -tya -ldy {z2} -sta ({z1}),y //FRAGMENT vbuyy=vbuz1_bor_vbuyy tya ora {z1} tay -//FRAGMENT pbuz1_derefidx_vbuxx=vbuyy -stx $ff -tya -ldy $ff -sta ({z1}),y //FRAGMENT vbuz1_lt_vbuyy_then_la1 tya cmp {z1} @@ -5375,8 +5674,6 @@ bcs {la1} sty $ff cpx $ff bcc {la1} -//FRAGMENT pbuz1_derefidx_vbuyy=vbuaa -sta ({z1}),y //FRAGMENT vwuz1=vwuz1_plus_vbuc1 lda #{c1} clc @@ -5448,10 +5745,6 @@ lda {z2} sta {z1} lda #0 sta {z1}+1 -//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuc2 -lda #{c2} -and {c1} -sta {c1} //FRAGMENT vboz1=vbuz2_lt_vbuc1 lda {z2} cmp #{c1} @@ -5735,9 +6028,6 @@ ora $ff txa sty $ff ora $ff -//FRAGMENT pbuz1_derefidx_vbuyy=vbuxx -txa -sta ({z1}),y //FRAGMENT vbuxx=vbuxx_bor_vbuyy txa sty $ff @@ -5925,15 +6215,6 @@ sta {z1}+2 lda {z2}+3 sbc #>{c1}>>$10 sta {z1}+3 -//FRAGMENT _deref_pduc1=vduc2 -lda #<{c2} -sta {c1} -lda #>{c2} -sta {c1}+1 -lda #<{c2}>>$10 -sta {c1}+2 -lda #>{c2}>>$10 -sta {c1}+3 //FRAGMENT vbuz1=vbuc1_minus_vbuz2 lda #{c1} sec @@ -6026,10 +6307,6 @@ sta {z1} lda {z1}+1 sbc #0 sta {z1}+1 -//FRAGMENT vbuz1=vbuz2_ror_1 -lda {z2} -lsr -sta {z1} //FRAGMENT pwuz1=pwuz2_plus_vbuz3 lda {z3} clc @@ -6147,21 +6424,6 @@ eor #$ff sec adc #{c1} tay -//FRAGMENT pbuz1_derefidx_vbuxx=vbuxx -txa -tay -sta ({z1}),y -//FRAGMENT vbuaa=vbuz1_ror_1 -lda {z1} -lsr -//FRAGMENT vbuxx=vbuz1_ror_1 -lda {z1} -lsr -tax -//FRAGMENT vbuyy=vbuz1_ror_1 -lda {z1} -lsr -tay //FRAGMENT vbuz1=vbuaa_ror_1 lsr sta {z1} @@ -6173,28 +6435,6 @@ tax //FRAGMENT vbuyy=vbuaa_ror_1 lsr tay -//FRAGMENT vbuz1=vbuxx_ror_1 -txa -lsr -sta {z1} -//FRAGMENT vbuaa=vbuxx_ror_1 -txa -lsr -//FRAGMENT vbuyy=vbuxx_ror_1 -txa -lsr -tay -//FRAGMENT vbuz1=vbuyy_ror_1 -tya -lsr -sta {z1} -//FRAGMENT vbuaa=vbuyy_ror_1 -tya -lsr -//FRAGMENT vbuxx=vbuyy_ror_1 -tya -lsr -tax //FRAGMENT pwuz1=pwuz2_plus_vbuaa clc adc {z2} @@ -6458,11 +6698,6 @@ cmp #{c1} beq !+ bcs {la1} !: -//FRAGMENT vbuz1=vbuz1_plus_vbuyy -tya -clc -adc {z1} -sta {z1} //FRAGMENT vbuc1_ge_vbuaa_then_la1 cmp #{c1} bcc {la1} @@ -6573,11 +6808,6 @@ ora {z3} sta {z1} //FRAGMENT vbuyy=_hi_pbuz1 ldy {z1}+1 -//FRAGMENT pvoz1=pvoc1 -lda #<{c1} -sta {z1} -lda #>{c1} -sta {z1}+1 //FRAGMENT vwuz1_eq_0_then_la1 lda {z1} bne !+ @@ -6600,20 +6830,6 @@ bne {la1} lda {z1} cmp {z2} bne {la1} -//FRAGMENT vwuz1_le_0_then_la1 -lda {z1} -bne !+ -lda {z1}+1 -beq {la1} -!: -//FRAGMENT pbuz1=pbuz2_plus_vwuz3 -lda {z2} -clc -adc {z3} -sta {z1} -lda {z2}+1 -adc {z3}+1 -sta {z1}+1 //FRAGMENT vwuz1=vwuz2_band_vwuc1 lda {z2} and #<{c1} @@ -6647,14 +6863,6 @@ ldy #0 ora ({z1}),y ldy #0 sta ({z1}),y -//FRAGMENT pbuz1=pbuz2_plus_vwuz1 -lda {z1} -clc -adc {z2} -sta {z1} -lda {z1}+1 -adc {z2}+1 -sta {z1}+1 //FRAGMENT pbuz1=pbuz1_plus_vwuz2 lda {z1} clc @@ -7081,10 +7289,6 @@ lda {z1} eor #$ff clc adc #$01 -//FRAGMENT vbuaa=_neg_vbuaa -eor #$ff -clc -adc #$01 //FRAGMENT vbuaa=_neg_vbuxx dex txa @@ -7098,11 +7302,6 @@ inx eor #$ff tax inx -//FRAGMENT vbuxx=_neg_vbuxx -dex -txa -eor #$ff -tax //FRAGMENT vbuyy=_neg_vbuz1 lda {z1} eor #$ff @@ -7542,10 +7741,6 @@ inc {z1}+2 bne !+ inc {z1}+3 !: -//FRAGMENT vbuz1_le_vbuz2_then_la1 -lda {z2} -cmp {z1} -bcs {la1} //FRAGMENT pbuc1_derefidx_vbuz1_eq_vbuz2_then_la1 ldy {z1} lda {c1},y @@ -7888,16 +8083,6 @@ tya sec sbc #1 sta {z1} -//FRAGMENT vbuxx_le_vbuz1_then_la1 -lda {z1} -stx $ff -cmp $ff -bcs {la1} -//FRAGMENT vbuyy_le_vbuz1_then_la1 -lda {z1} -sty $ff -cmp $ff -bcs {la1} //FRAGMENT vbuz1_le_vbuaa_then_la1 cmp {z1} bcs {la1} @@ -7944,9 +8129,6 @@ bcs {la1} sty $ff cmp $ff bcs {la1} -//FRAGMENT vbuz1_le_vbuxx_then_la1 -cpx {z1} -bcs {la1} //FRAGMENT vbuyy_le_vbuxx_then_la1 sty $ff cpx $ff @@ -8094,9 +8276,6 @@ sta $ff tya ldy $ff sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=vbuyy -tya -sta ({z1}),y //FRAGMENT vwuz1=vwuz2_rol_7 lda {z2}+1 lsr @@ -11542,180 +11721,179 @@ sta {z1}+1 asl $ff rol {z1} rol {z1}+1 -//FRAGMENT vwuz1=pbuz2_bxor_vwuc1 -lda #<{c1} -eor {z2} -sta {z1} -lda #>{c1} -eor {z2}+1 -sta {z1}+1 -//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuz3 -ldy {z2} -lda ({z1}),y -ldy {z3} -ora {c1},y -ldy {z2} -sta ({z1}),y -//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuz3 -lda {z1} -ldy {z3} -eor ({z2}),y -sta {z1} -//FRAGMENT vbuz1=_neg_vbuz1 -lda {z1} -eor #$ff +//FRAGMENT vbsz1_eq_vbsc1_then_la1 +lda #{c1} +cmp {z1} +beq {la1} +//FRAGMENT vbsc1_eq_vbsz1_then_la1 +lda #{c1} +cmp {z1} +beq {la1} +//FRAGMENT pbuz1=pbuz2_plus_vbsz3 +lda {z3} +pha clc -adc #$01 +adc {z2} sta {z1} -//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuaa -ldy {z2} -tax -lda ({z1}),y -ora {c1},x -ldy {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuxx -ldy {z2} -lda ({z1}),y -ora {c1},x -ldy {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuyy -tya -ldy {z2} -tax -lda ({z1}),y -ora {c1},x -ldy {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuz2 -txa -tay -lda ({z1}),y -ldy {z2} -stx $ff -ora {c1},y -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuaa -tay -txa -ldx {c1},y -tay -lda ({z1}),y -sty $ff - -stx $ff -ora $ff -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuxx -txa -tay -lda ({z1}),y -stx $ff -ora {c1},x -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuyy -txa -ldx {c1},y -tay -lda ({z1}),y -sty $ff - -stx $ff -ora $ff -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuz2 -lda ({z1}),y -sty $ff - -ldy {z2} -ora {c1},y -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuaa -tax -lda ({z1}),y -sty $ff - -ora {c1},x -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuxx -lda ({z1}),y -sty $ff - -ora {c1},x -ldy $ff -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuyy -lda ({z1}),y -sty $ff - -ora {c1},y -ldy $ff -sta ({z1}),y -//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuaa -tay -lda {z1} -eor ({z2}),y -sta {z1} -//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuxx -txa -tay -lda {z1} -eor ({z2}),y -sta {z1} -//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuyy -lda {z1} -eor ({z2}),y -sta {z1} -//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuz2 -ldy {z2} -eor ({z1}),y -//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuaa -tay -eor ({z1}),y -//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuxx -stx $ff -ldy $ff -eor ({z1}),y -//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuyy -eor ({z1}),y -//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuz2 -ldy {z2} -txa -eor ({z1}),y -tax -//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuaa -tay -txa -eor ({z1}),y -tax -//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuxx -txa -tay -eor ({z1}),y -tax -//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuyy -txa -eor ({z1}),y -tax -//FRAGMENT vbuyy=_neg_vbuyy -dey -tya -eor #$ff -tay -//FRAGMENT vwuz1=pbuz1_bxor_vwuc1 -lda #<{c1} -eor {z1} -sta {z1} -lda #>{c1} -eor {z1}+1 +pla +ora #$7f +bmi !+ +lda #0 +!: +adc {z2}+1 sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_minus_vbuc1 +sec +lda {z2} +sbc #{c1} +sta {z1} +lda {z2}+1 +sbc #0 +sta {z1}+1 +//FRAGMENT vbuz1=_deref_pbuc1_band_vbuc2 +lda #{c2} +and {c1} +sta {z1} +//FRAGMENT pwsz1=pwsc1_plus_vwuz2 +lda {z2} +clc +adc #<{c1} +sta {z1} +lda {z2}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_plus_vwuc1 +lda {z2} +clc +adc #<{c1} +sta {z1} +lda {z2}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vbsaa_eq_vbsc1_then_la1 +cmp #{c1} +beq {la1} +//FRAGMENT vbsaa_neq_vbsc1_then_la1 +cmp #{c1} +bne {la1} +//FRAGMENT vbsaa=vbsz1_minus_vbsaa +eor #$ff +sec +adc {z1} +//FRAGMENT vbsaa=vbsxx_minus_vbsaa +sta $ff +txa +sec +sbc $ff +//FRAGMENT vbsaa=vbsyy_minus_vbsaa +sta $ff +tya +sec +sbc $ff +//FRAGMENT vbsyy=vbsz1_minus_vbsaa +eor #$ff +sec +adc {z1} +tay +//FRAGMENT vbsyy=vbsxx_minus_vbsaa +sta $ff +txa +sec +sbc $ff +tay +//FRAGMENT vbsyy=vbsyy_minus_vbsaa +sta $ff +tya +sec +sbc $ff +tay +//FRAGMENT vbsc1_eq_vbsaa_then_la1 +cmp #{c1} +beq {la1} +//FRAGMENT pbuz1=pbuz2_plus_vbsaa +pha +clc +adc {z2} +sta {z1} +pla +ora #$7f +bmi !+ +lda #0 +!: +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vbsxx +txa +pha +clc +adc {z2} +sta {z1} +pla +ora #$7f +bmi !+ +lda #0 +!: +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vbsyy +tya +pha +clc +adc {z2} +sta {z1} +pla +ora #$7f +bmi !+ +lda #0 +!: +adc {z2}+1 +sta {z1}+1 +//FRAGMENT vbsxx_eq_vbsc1_then_la1 +cpx #{c1} +beq {la1} +//FRAGMENT vbuaa=_deref_pbuc1_band_vbuc2 +lda #{c2} +and {c1} +//FRAGMENT vbuxx=_deref_pbuc1_band_vbuc2 +lda #{c2} +and {c1} +tax +//FRAGMENT vbuyy=_deref_pbuc1_band_vbuc2 +lda #{c2} +and {c1} +tay +//FRAGMENT vbsc1_eq_vbsxx_then_la1 +cpx #{c1} +beq {la1} +//FRAGMENT vbsc1_eq_vbsyy_then_la1 +cpy #{c1} +beq {la1} +//FRAGMENT pbuz1=pbuz1_plus_vbsxx +txa +pha +clc +adc {z1} +sta {z1} +pla +ora #$7f +bmi !+ +lda #0 +!: +adc {z1}+1 +sta {z1}+1 +//FRAGMENT pwsz1=pwsc1_plus_vwuz1 +clc +lda {z1} +adc #<{c1} +sta {z1} +lda {z1}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vwuz1=vwuz1_rol_2 +asl {z1} +rol {z1}+1 +asl {z1} +rol {z1}+1 //FRAGMENT vbsz1=vbsz2_plus_vbsc1 lax {z2} axs #-[{c1}] @@ -11982,23 +12160,6 @@ bpl {la1} //FRAGMENT vbsc1_neq_vbsaa_then_la1 cmp #{c1} bne {la1} -//FRAGMENT vbsyy=vbsz1_minus_vbsaa -eor #$ff -sec -adc {z1} -tay -//FRAGMENT vbsyy=vbsxx_minus_vbsaa -sta $ff -txa -sec -sbc $ff -tay -//FRAGMENT vbsyy=vbsyy_minus_vbsaa -sta $ff -tya -sec -sbc $ff -tay //FRAGMENT vbsyy_lt_0_then_la1 cpy #0 bmi {la1} @@ -12020,14 +12181,6 @@ sta {z1} bcc !+ inc {z1}+1 !: -//FRAGMENT pwsz1=pwsc1_plus_vwuz2 -lda {z2} -clc -adc #<{c1} -sta {z1} -lda {z2}+1 -adc #>{c1} -sta {z1}+1 //FRAGMENT vduz1_lt_vduc1_then_la1 lda {z1}+3 cmp #>{c1}>>$10 @@ -12176,14 +12329,6 @@ rol {z1}+2 rol {z1}+3 dey bne !- -//FRAGMENT pwsz1=pwsc1_plus_vwuz1 -clc -lda {z1} -adc #<{c1} -sta {z1} -lda {z1}+1 -adc #>{c1} -sta {z1}+1 //FRAGMENT vduz1=vduz1_rol_vbuxx cpx #0 beq !e+ @@ -12208,10 +12353,6 @@ ldx {z2} tay txa sta {c1},y -//FRAGMENT vbuz1=_deref_pbuc1_band_vbuc2 -lda #{c2} -and {c1} -sta {z1} //FRAGMENT _deref_pbuc1_lt_vbuz1_then_la1 lda {c1} cmp {z1} @@ -12303,17 +12444,6 @@ tya sta {c1},y lda #0 sta {c1}+1,y -//FRAGMENT vbuaa=_deref_pbuc1_band_vbuc2 -lda #{c2} -and {c1} -//FRAGMENT vbuxx=_deref_pbuc1_band_vbuc2 -lda #{c2} -and {c1} -tax -//FRAGMENT vbuyy=_deref_pbuc1_band_vbuc2 -lda #{c2} -and {c1} -tay //FRAGMENT _deref_pbuc1_lt_vbuaa_then_la1 ldy {c1} sta $ff @@ -13216,9 +13346,6 @@ ldy {z2} sec sbc {c1},y sta {z1} -//FRAGMENT vbsaa_neq_vbsc1_then_la1 -cmp #{c1} -bne {la1} //FRAGMENT vbsaa_gt_0_then_la1 cmp #0 beq !+ @@ -13856,15 +13983,6 @@ lda {z1} cmp #<{c1} bcc {la1} !: -//FRAGMENT vbsaa=vbsz1_minus_vbsaa -eor #$ff -sec -adc {z1} -//FRAGMENT vbsaa=vbsxx_minus_vbsaa -sta $ff -txa -sec -sbc $ff //FRAGMENT vbuz1=_deref_pbuc1_bxor_vbuc2 lda #{c2} eor {c1} @@ -13938,14 +14056,6 @@ bne {la1} lda {z1} cmp #<{c1} bne {la1} -//FRAGMENT vwuz1=vwuz2_plus_vwuc1 -lda {z2} -clc -adc #<{c1} -sta {z1} -lda {z2}+1 -adc #>{c1} -sta {z1}+1 //FRAGMENT vduz1=vduz2_sethi_vwuz3 lda {z2} sta {z1} @@ -17695,11 +17805,6 @@ tax //FRAGMENT vbuyy=_byte_pwuc1_derefidx_vbuyy lda {c1},y tay -//FRAGMENT pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuaa -ldx {z1} -tay -lda ({z2}),y -sta {c1},x //FRAGMENT vbuaa_le_vbuyy_then_la1 sta $ff cpy $ff diff --git a/src/main/fragment/mos6502-common/vwsm1=_deref_pwsz2_ror_2.asm b/src/main/fragment/mos6502-common/vwsm1=_deref_pwsz2_ror_2.asm new file mode 100644 index 000000000..5677c8813 --- /dev/null +++ b/src/main/fragment/mos6502-common/vwsm1=_deref_pwsz2_ror_2.asm @@ -0,0 +1,13 @@ +ldy #1 +lda ({z2}),y +cmp #$80 +ror +sta {m1}+1 +dey +lda ({z2}),y +ror +sta {m1} +lda {m1}+1 +cmp #$80 +ror {m1}+1 +ror {m1} diff --git a/src/main/fragment/mos6502-common/vwsz1=_deref_pwsz1_ror_2.asm b/src/main/fragment/mos6502-common/vwsz1=_deref_pwsz1_ror_2.asm new file mode 100644 index 000000000..286dbeff6 --- /dev/null +++ b/src/main/fragment/mos6502-common/vwsz1=_deref_pwsz1_ror_2.asm @@ -0,0 +1,15 @@ +ldy #0 +lda ({z1}),y +pha +iny +lda ({z1}),y +cmp #$80 +ror +sta {z1}+1 +pla +ror +sta {z1} +lda {z1}+1 +cmp #$80 +ror {z1}+1 +ror {z1} diff --git a/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsaa.asm b/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsaa.asm new file mode 100644 index 000000000..84a4bfc0e --- /dev/null +++ b/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsaa.asm @@ -0,0 +1,11 @@ +pha +clc +adc #<{c1} +sta {m1} +pla +ora #$7f +bmi !+ +lda #0 +!: +adc #>{c1} +sta {m1}+1 \ No newline at end of file diff --git a/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsm2.asm b/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsm2.asm new file mode 100644 index 000000000..9fe24b036 --- /dev/null +++ b/src/main/fragment/mos6502-common/vwum1=vwuc1_plus_vbsm2.asm @@ -0,0 +1,11 @@ +lda {m2} +clc +adc #<{c1} +sta {m1} +lda {m2} +ora #$7f +bmi !+ +lda #0 +!: +adc #>{c1} +sta {m1}+1 \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 7e86e1841..16f644a36 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -189,6 +189,11 @@ public class TestPrograms { @Test public void testPolygon() throws IOException, URISyntaxException { + compileAndCompare("complex/xy-scroller/xy-scroller.c"); + } + + @Test + public void testXyScroller() throws IOException, URISyntaxException { compileAndCompare("complex/polygon/polygon.c"); } diff --git a/src/test/kc/complex/xy-scroller/C64_Palette-c64wiki.gpl b/src/test/kc/complex/xy-scroller/C64_Palette-c64wiki.gpl new file mode 100644 index 000000000..a4b46ab6f --- /dev/null +++ b/src/test/kc/complex/xy-scroller/C64_Palette-c64wiki.gpl @@ -0,0 +1,20 @@ +GIMP Palette +Name: C64 Palette +Columns: 0 +# https://www.c64-wiki.com/wiki/Color + 0 0 0 Untitled +255 255 255 Untitled +136 0 0 Untitled +170 255 238 Untitled +204 68 204 Untitled + 0 204 85 Untitled + 0 0 170 Untitled +238 238 119 Untitled +221 136 85 Untitled +102 68 0 Untitled +255 119 119 Untitled + 51 51 51 Untitled +119 119 119 Untitled +170 255 102 Untitled + 0 136 255 Untitled +187 187 187 Untitled diff --git a/src/test/kc/complex/xy-scroller/circles_140x125.png b/src/test/kc/complex/xy-scroller/circles_140x125.png new file mode 100644 index 000000000..351ab3cb6 Binary files /dev/null and b/src/test/kc/complex/xy-scroller/circles_140x125.png differ diff --git a/src/test/kc/complex/xy-scroller/cml.png b/src/test/kc/complex/xy-scroller/cml.png new file mode 100644 index 000000000..a4fd85637 Binary files /dev/null and b/src/test/kc/complex/xy-scroller/cml.png differ diff --git a/src/test/kc/complex/xy-scroller/cml.xcf b/src/test/kc/complex/xy-scroller/cml.xcf new file mode 100644 index 000000000..ca5e0979d Binary files /dev/null and b/src/test/kc/complex/xy-scroller/cml.xcf differ diff --git a/src/test/kc/complex/xy-scroller/xy-scroller.c b/src/test/kc/complex/xy-scroller/xy-scroller.c index ba0649bc8..59b216db3 100644 --- a/src/test/kc/complex/xy-scroller/xy-scroller.c +++ b/src/test/kc/complex/xy-scroller/xy-scroller.c @@ -1,20 +1,13 @@ // A full-screen x/y-scroller -// The main screen is double-buffered with a shared charset. Most of the screen is expected to be empty (filled with char 0) -// While scrolling through the pixels on one screen the second screen is prepared. When needed a swap is made. -// At any time an object is being scrolled onto the screen. The object is fetched from an 8x8 char buffer. -// -// The scroll director orchestrates the movement of the main screen, rendering on the second screen from the buffer and the rendering of graphics in the buffer. -// In practice the scroll director calculates a number of frames ahead to identify the operations needed on each frame. It calculates ahead until it encounters the next "new buffer needed". +// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767] #include #include -#include -#include -// Dispaly screen #1 (double buffered) -char * const MAIN_SCREEN1 = 0x0400; -// Display screen #2 (double buffered) -char * const MAIN_SCREEN2 = 0x3800; +// Display screen #0 (double buffered) +char * const MAIN_SCREEN0 = 0x3800; +// Display screen #1 (double buffered) +char * const MAIN_SCREEN1 = 0x3c00; // Display charset char * const MAIN_CHARSET = 0x1000; @@ -27,37 +20,187 @@ char RENDER_BUFFER[8*8] = "********" " ****** " " ****** " - " ** "z -; + " ** "z; + +// The number of sinus values in the table +const unsigned int SINSIZE = 2048; + +// Sinus table [-399,399] +signed int SINTAB[SINSIZE] = kickasm(uses SINSIZE) {{ + .fillword SINSIZE, 399*sin(i*2*PI/SINSIZE) +}}; + +// 140x125 PETSCII art +export __address(0x4000) char PETSCII_ART[140*125] = kickasm(resource "cml.png") {{ + .var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; yMEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET); - memset(MAIN_SCREEN1, ' ', 1000); - - // positions to render to - char xpos=0, ypos=0; - while(xpos < 40 && ypos < 25) { - char *sc = MAIN_SCREEN1 + (unsigned int)ypos*40 + xpos; - char i=0; - for(char y=0; y<8; y++) { - for(char x=0; x<8; x++) { - char c=RENDER_BUFFER[i++]; - if(c!=' ' && xpos+x<40 && ypos+y<25) - sc[x] = c; - } - sc+=40; + // Stop the kernel IRQ + sei(); + // Clear screen + memset(MAIN_SCREEN0, ' ', 1000); + // Display initial screen + VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET); + // Find initial position + next_position(); + + for(;;) { + //VICII->BORDER_COLOR = RED; + + // The old coarse values x/y-positions + unsigned int x_pos_coarse_old = x_pos_coarse; + unsigned int y_pos_coarse_old = y_pos_coarse; + // Update the position + next_position(); + + // Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll + // Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none) + signed char y_movement = (signed char)(y_pos_coarse_old-y_pos_coarse); // will be -1/0/1 + signed char movement = 0; + if(y_movement==1) { + movement = -40; + } else if(y_movement==-1) { + movement = 40; } - xpos+=5; - ypos+=3; + signed char x_movement = (signed char)(x_pos_coarse_old-x_pos_coarse); // will be -1/0/1 + movement -= x_movement; + + // If coarse scrolling is needed execute it + if(movement) { + // Move chars from active screen to hidden screen - while applying any needed movement + char * screen_active = (screen?MAIN_SCREEN1:MAIN_SCREEN0) + movement; + char * screen_hidden = screen?MAIN_SCREEN0:MAIN_SCREEN1; + screencpy(screen_hidden, screen_active); + + // Update any new row if needed + if(y_movement==-1) { + // Update Bottom row + char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse+12); + char* scrn = screen_hidden+24*40; + for(char i=0;i<40;i++) + scrn[i] = petscii[i]; + } else if(y_movement==1) { + // Update Top row + char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12); + char* scrn = screen_hidden; + for(char i=0;i<40;i++) + scrn[i] = petscii[i]; + } + // Update any new column if needed + if(x_movement==-1) { + // Update Right column + char* petscii = petscii_ptr(x_pos_coarse+19, y_pos_coarse-12); + char* scrn = screen_hidden+39; + for(char i=0;i<25;i++) { + *scrn = *petscii; + scrn += 40; + petscii += 140; + } + } else if(x_movement==1) { + // Update Left column + char* petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12); + char* scrn = screen_hidden; + for(char i=0;i<25;i++) { + *scrn = *petscii; + scrn += 40; + petscii += 140; + } + } + + // Change current screen + screen ^=1; + + } + //VICII->BORDER_COLOR = BLACK; + + // Update the display - wait for the raster + while(VICII->RASTER!=0xfe) ; + while(VICII->RASTER!=0xff) ; + VICII->BORDER_COLOR = WHITE; + // Y-scroll fine + VICII->CONTROL1 = VICII->CONTROL1 & 0xf0 | (7-y_pos_fine); + // X-scroll fine + VICII->CONTROL2 = VICII->CONTROL2 & 0xf0 | (7-x_pos_fine); + // Display current screen + if(screen) { + VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET); + } else { + VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET); + } + VICII->BORDER_COLOR = BLACK; + } - // count the number of chars - unsigned int count = 0; - for(char *sc = MAIN_SCREEN1;sc=SINSIZE) x_sin_idx-=SINSIZE; + y_sin_idx++; if(y_sin_idx>=SINSIZE) y_sin_idx-=SINSIZE; + // Find the next point + x_pos = SINTAB[x_sin_idx]; + y_pos = SINTAB[y_sin_idx]; + // Find the unsigned fine/coarse scroll values + unsigned int x_pos_u = (unsigned int)x_pos + 400 + 20*8; + x_pos_fine = (unsigned char)x_pos_u & 7; + x_pos_coarse = x_pos_u/8; + unsigned int y_pos_u = (unsigned int)y_pos + 400 + 12*8; + y_pos_fine = (unsigned char)y_pos_u & 7; + y_pos_coarse = y_pos_u/8; } diff --git a/src/test/ref/complex/xy-scroller/xy-scroller.asm b/src/test/ref/complex/xy-scroller/xy-scroller.asm new file mode 100644 index 000000000..f1addb147 --- /dev/null +++ b/src/test/ref/complex/xy-scroller/xy-scroller.asm @@ -0,0 +1,797 @@ +// A full-screen x/y-scroller +// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767] +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + // The number of sinus values in the table + .const SINSIZE = $800 + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // Display screen #0 (double buffered) + .label MAIN_SCREEN0 = $3800 + // Display screen #1 (double buffered) + .label MAIN_SCREEN1 = $3c00 + // Display charset + .label MAIN_CHARSET = $1000 + // The current screen displayed (0/1) + .label screen = 2 + // Current index into the sinus + .label x_sin_idx = 9 + .label y_sin_idx = $b + // Current x/y-position (the center of the screen) + .label x_pos = $16 + .label y_pos = $18 + // The current scroll fine values [0-7] (converted to unsigned) + .label x_pos_fine = $1a + // The current scroll coarse values (converted to unsigned) + .label x_pos_coarse = $16 + .label y_pos_fine = $1b + .label y_pos_coarse = $18 +main: { + .const toD0181_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0182_return = (>(MAIN_SCREEN1&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0183_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .label __5 = $f + .label __9 = $d + .label __13 = 3 + .label __45 = $13 + .label __48 = $1b + .label x_pos_coarse_old = $d + .label y_pos_coarse_old = $f + .label y_movement = $11 + .label x_movement = $12 + .label screen_active = 3 + .label screen_hidden = 7 + .label petscii1 = 5 + .label scrn1 = $14 + .label petscii = 5 + .label petscii3 = 5 + .label scrn3 = 7 + .label petscii2 = 5 + .label scrn2 = 7 + // asm + sei + // memset(MAIN_SCREEN0, ' ', 1000) + // Clear screen + jsr memset + // VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET) + // Display initial screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // next_position() + // Find initial position + lda #SINSIZE/4 + sta.z y_sin_idx+1 + lda #<0 + sta.z x_sin_idx + sta.z x_sin_idx+1 + jsr next_position + lda #0 + sta.z screen + __b1: + // x_pos_coarse_old = x_pos_coarse + // The old coarse values x/y-positions + lda.z x_pos_coarse + sta.z x_pos_coarse_old + lda.z x_pos_coarse+1 + sta.z x_pos_coarse_old+1 + // y_pos_coarse_old = y_pos_coarse + lda.z y_pos_coarse + sta.z y_pos_coarse_old + lda.z y_pos_coarse+1 + sta.z y_pos_coarse_old+1 + // next_position() + // Update the position + jsr next_position + // y_pos_coarse_old-y_pos_coarse + lda.z __5 + sec + sbc.z y_pos_coarse + sta.z __5 + lda.z __5+1 + sbc.z y_pos_coarse+1 + sta.z __5+1 + // y_movement = (signed char)(y_pos_coarse_old-y_pos_coarse) + // Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll + // Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none) + lda.z __5 + sta.z y_movement + // if(y_movement==1) + lda #1 + cmp.z y_movement + beq __b20 + // if(y_movement==-1) + lda #-1 + cmp.z y_movement + bne __b19 + ldx #$28 + jmp __b2 + __b19: + ldx #0 + jmp __b2 + __b20: + ldx #-$28 + __b2: + // x_pos_coarse_old-x_pos_coarse + lda.z __9 + sec + sbc.z x_pos_coarse + sta.z __9 + lda.z __9+1 + sbc.z x_pos_coarse+1 + sta.z __9+1 + // x_movement = (signed char)(x_pos_coarse_old-x_pos_coarse) + lda.z __9 + sta.z x_movement + // movement -= x_movement + // will be -1/0/1 + txa + sec + sbc.z x_movement + tax + // if(movement) + cpx #0 + bne !__b21+ + jmp __b21 + !__b21: + // screen?MAIN_SCREEN1:MAIN_SCREEN0 + lda #0 + cmp.z screen + bne __b3 + lda #MAIN_SCREEN0 + sta.z __13+1 + jmp __b4 + __b3: + // screen?MAIN_SCREEN1:MAIN_SCREEN0 + lda #MAIN_SCREEN1 + sta.z __13+1 + __b4: + // screen_active = (screen?MAIN_SCREEN1:MAIN_SCREEN0) + movement + txa + pha + clc + adc.z screen_active + sta.z screen_active + pla + ora #$7f + bmi !+ + lda #0 + !: + adc.z screen_active+1 + sta.z screen_active+1 + // screen?MAIN_SCREEN0:MAIN_SCREEN1 + lda #0 + cmp.z screen + bne __b5 + lda #MAIN_SCREEN1 + sta.z screen_hidden+1 + jmp __b6 + __b5: + // screen?MAIN_SCREEN0:MAIN_SCREEN1 + lda #MAIN_SCREEN0 + sta.z screen_hidden+1 + __b6: + // screencpy(screen_hidden, screen_active) + jsr screencpy + // if(y_movement==-1) + // Update any new row if needed + lda #-1 + cmp.z y_movement + bne !__b7+ + jmp __b7 + !__b7: + // if(y_movement==1) + lda #1 + cmp.z y_movement + bne __b10 + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + ldy #0 + __b8: + // for(char i=0;i<40;i++) + cpy #$28 + bcs !__b9+ + jmp __b9 + !__b9: + __b10: + // if(x_movement==-1) + // Update any new column if needed + lda #-1 + cmp.z x_movement + bne !__b13+ + jmp __b13 + !__b13: + // if(x_movement==1) + lda #1 + cmp.z x_movement + bne __b16 + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + ldx #0 + __b14: + // for(char i=0;i<25;i++) + cpx #$19 + bcc __b15 + __b16: + // screen ^=1 + // Change current screen + lda #1 + eor.z screen + sta.z screen + __b21: + // Update the display - wait for the raster + // while(VICII->RASTER!=0xfe) + lda #$fe + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b21 + __b24: + // while(VICII->RASTER!=0xff) + lda #$ff + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b24 + // VICII->BORDER_COLOR = WHITE + lda #WHITE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // VICII->CONTROL1 & 0xf0 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta.z __45 + // 7-y_pos_fine + lda #7 + sec + sbc.z y_pos_fine + // VICII->CONTROL1 & 0xf0 | (7-y_pos_fine) + ora.z __45 + // VICII->CONTROL1 = VICII->CONTROL1 & 0xf0 | (7-y_pos_fine) + // Y-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->CONTROL2 & 0xf0 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + sta.z __48 + // 7-x_pos_fine + lda #7 + sec + sbc.z x_pos_fine + // VICII->CONTROL2 & 0xf0 | (7-x_pos_fine) + ora.z __48 + // VICII->CONTROL2 = VICII->CONTROL2 & 0xf0 | (7-x_pos_fine) + // X-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // if(screen) + // Display current screen + lda #0 + cmp.z screen + bne __b32 + // VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET) + lda #toD0183_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + __b26: + // VICII->BORDER_COLOR = BLACK + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + jmp __b1 + __b32: + // VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET) + lda #toD0182_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + __b15: + // *scrn = *petscii + ldy #0 + lda (petscii2),y + sta (scrn2),y + // scrn += 40 + lda #$28 + clc + adc.z scrn2 + sta.z scrn2 + bcc !+ + inc.z scrn2+1 + !: + // petscii += 140 + lda #$8c + clc + adc.z petscii2 + sta.z petscii2 + bcc !+ + inc.z petscii2+1 + !: + // for(char i=0;i<25;i++) + inx + jmp __b14 + __b13: + // petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + lda #$13 + clc + adc.z x_pos_coarse + sta.z petscii_ptr.row_x + lda #0 + adc.z x_pos_coarse+1 + sta.z petscii_ptr.row_x+1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + jsr petscii_ptr + // petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + // petscii = petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + // scrn = screen_hidden+39 + lda #$27 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + ldx #0 + __b17: + // for(char i=0;i<25;i++) + cpx #$19 + bcc __b18 + jmp __b16 + __b18: + // *scrn = *petscii + ldy #0 + lda (petscii3),y + sta (scrn3),y + // scrn += 40 + lda #$28 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // petscii += 140 + lda #$8c + clc + adc.z petscii3 + sta.z petscii3 + bcc !+ + inc.z petscii3+1 + !: + // for(char i=0;i<25;i++) + inx + jmp __b17 + __b9: + // scrn[i] = petscii[i] + lda (petscii),y + sta (screen_hidden),y + // for(char i=0;i<40;i++) + iny + jmp __b8 + __b7: + // petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + lda #$c + clc + adc.z y_pos_coarse + sta.z petscii_ptr.row_y + lda #0 + adc.z y_pos_coarse+1 + sta.z petscii_ptr.row_y+1 + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + // scrn = screen_hidden+24*40 + lda.z screen_hidden + clc + adc #<$18*$28 + sta.z scrn1 + lda.z screen_hidden+1 + adc #>$18*$28 + sta.z scrn1+1 + ldy #0 + __b11: + // for(char i=0;i<40;i++) + cpy #$28 + bcc __b12 + jmp __b10 + __b12: + // scrn[i] = petscii[i] + lda (petscii1),y + sta (scrn1),y + // for(char i=0;i<40;i++) + iny + jmp __b11 +} +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = MAIN_SCREEN0 + .label end = str+num + .label dst = 9 + lda #str + sta.z dst+1 + __b1: + // for(char* dst = str; dst!=end; dst++) + lda.z dst+1 + cmp #>end + bne __b2 + lda.z dst + cmp #=SINSIZE) + lda.z x_sin_idx+1 + cmp #>SINSIZE + bcc __b1 + bne !+ + lda.z x_sin_idx + cmp #SINSIZE + sta.z x_sin_idx+1 + __b1: + // y_sin_idx++; + inc.z y_sin_idx + bne !+ + inc.z y_sin_idx+1 + !: + // if(y_sin_idx>=SINSIZE) + lda.z y_sin_idx+1 + cmp #>SINSIZE + bcc __b2 + bne !+ + lda.z y_sin_idx + cmp #SINSIZE + sta.z y_sin_idx+1 + __b2: + // x_pos = SINTAB[x_sin_idx] + lda.z x_sin_idx + asl + sta.z __12 + lda.z x_sin_idx+1 + rol + sta.z __12+1 + clc + lda.z __18 + adc #SINTAB + sta.z __18+1 + // Find the next point + ldy #0 + lda (x_pos),y + pha + iny + lda (x_pos),y + sta.z x_pos+1 + pla + sta.z x_pos + // y_pos = SINTAB[y_sin_idx] + lda.z y_sin_idx + asl + sta.z __13 + lda.z y_sin_idx+1 + rol + sta.z __13+1 + clc + lda.z __19 + adc #SINTAB + sta.z __19+1 + ldy #0 + lda (y_pos),y + pha + iny + lda (y_pos),y + sta.z y_pos+1 + pla + sta.z y_pos + // (unsigned int)x_pos + 400 + // x_pos_u = (unsigned int)x_pos + 400 + 20*8 + clc + lda.z x_pos_u + adc #<$190+$14*8 + sta.z x_pos_u + lda.z x_pos_u+1 + adc #>$190+$14*8 + sta.z x_pos_u+1 + // (unsigned char)x_pos_u & 7 + lda.z x_pos_u + and #7 + sta.z x_pos_fine + // x_pos_u/8 + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + // (unsigned int)y_pos + 400 + // y_pos_u = (unsigned int)y_pos + 400 + 12*8 + clc + lda.z y_pos_u + adc #<$190+$c*8 + sta.z y_pos_u + lda.z y_pos_u+1 + adc #>$190+$c*8 + sta.z y_pos_u+1 + // (unsigned char)y_pos_u & 7 + lda.z y_pos_u + and #7 + sta.z y_pos_fine + // y_pos_u/8 + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + // } + rts +} +// Copy an entire screen (40x25 = 1000 chars) +// - dst - destination +// - src - source +// screencpy(byte* zp(7) dst, byte* zp(3) src) +screencpy: { + .label dst = 7 + .label src = 3 + .label src_250 = $26 + .label dst_250 = $1c + .label src_500 = $1e + .label dst_500 = $20 + .label src_750 = $22 + .label dst_750 = $24 + // src_250 = src+250 + lda #$fa + clc + adc.z src + sta.z src_250 + lda #0 + adc.z src+1 + sta.z src_250+1 + // dst_250 = dst+250 + lda #$fa + clc + adc.z dst + sta.z dst_250 + lda #0 + adc.z dst+1 + sta.z dst_250+1 + // src_500 = src+500 + lda.z src + clc + adc #<$1f4 + sta.z src_500 + lda.z src+1 + adc #>$1f4 + sta.z src_500+1 + // dst_500 = dst+500 + lda.z dst + clc + adc #<$1f4 + sta.z dst_500 + lda.z dst+1 + adc #>$1f4 + sta.z dst_500+1 + // src_750 = src+750 + lda.z src + clc + adc #<$2ee + sta.z src_750 + lda.z src+1 + adc #>$2ee + sta.z src_750+1 + // dst_750 = dst+750 + lda.z dst + clc + adc #<$2ee + sta.z dst_750 + lda.z dst+1 + adc #>$2ee + sta.z dst_750+1 + ldy #0 + __b1: + // for( char i=0;i<250;i++) + cpy #$fa + bcc __b2 + // } + rts + __b2: + // dst[i] = src[i] + lda (src),y + sta (dst),y + // dst_250[i] = src_250[i] + lda (src_250),y + sta (dst_250),y + // dst_500[i] = src_500[i] + lda (src_500),y + sta (dst_500),y + // dst_750[i] = src_750[i] + lda (src_750),y + sta (dst_750),y + // for( char i=0;i<250;i++) + iny + jmp __b1 +} +// Get a pointer to a specific x,y-position in the PETSCII art +// petscii_ptr(word zp(5) row_x, word zp($d) row_y) +petscii_ptr: { + .label __0 = $d + .label __1 = $d + .label row_x = 5 + .label row_y = $d + .label return = 5 + .label __3 = $26 + .label __4 = $26 + .label __5 = $26 + .label __6 = $d + // row_y * 140 + lda.z row_y + asl + sta.z __3 + lda.z row_y+1 + rol + sta.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + lda.z __4 + clc + adc.z row_y + sta.z __4 + lda.z __4+1 + adc.z row_y+1 + sta.z __4+1 + asl.z __5 + rol.z __5+1 + lda.z __6 + clc + adc.z __5 + sta.z __6 + lda.z __6+1 + adc.z __5+1 + sta.z __6+1 + asl.z __0 + rol.z __0+1 + asl.z __0 + rol.z __0+1 + // PETSCII_ART + row_y * 140 + clc + lda.z __1 + adc #PETSCII_ART + sta.z __1+1 + // PETSCII_ART + row_y * 140 + row_x + lda.z return + clc + adc.z __1 + sta.z return + lda.z return+1 + adc.z __1+1 + sta.z return+1 + // } + rts +} +// Sinus table [-399,399] +SINTAB: +.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE) + +.pc = $4000 "PETSCII_ART" +// 140x125 PETSCII art +PETSCII_ART: +.var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y> (byte) 3 + [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 + [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 + [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 + [125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7 + [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 + to:next_position::@return +next_position::@return: scope:[next_position] from next_position::@2 + [127] return + to:@return + +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +screencpy: scope:[screencpy] from main::@6 + [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa + [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa + [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 + [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 + [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee + [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee + to:screencpy::@1 +screencpy::@1: scope:[screencpy] from screencpy screencpy::@2 + [134] (byte) screencpy::i#2 ← phi( screencpy/(byte) 0 screencpy::@2/(byte) screencpy::i#1 ) + [135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 + to:screencpy::@return +screencpy::@return: scope:[screencpy] from screencpy::@1 + [136] return + to:@return +screencpy::@2: scope:[screencpy] from screencpy::@1 + [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) + [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) + [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) + [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) + [141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2 + to:screencpy::@1 + +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +petscii_ptr: scope:[petscii_ptr] from main::@13 main::@20 main::@22 main::@7 + [142] (word) petscii_ptr::row_x#4 ← phi( main::@7/(word) petscii_ptr::row_x#0 main::@13/(word) petscii_ptr::row_x#2 main::@20/(word) petscii_ptr::row_x#1 main::@22/(word) petscii_ptr::row_x#3 ) + [142] (word) petscii_ptr::row_y#4 ← phi( main::@7/(word) petscii_ptr::row_y#0 main::@13/(word) petscii_ptr::row_y#2 main::@20/(word) petscii_ptr::row_y#1 main::@22/(word) petscii_ptr::row_y#3 ) + [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 + [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 + [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 + [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 + [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 + [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 + [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 + to:petscii_ptr::@return +petscii_ptr::@return: scope:[petscii_ptr] from petscii_ptr + [150] return + to:@return diff --git a/src/test/ref/complex/xy-scroller/xy-scroller.log b/src/test/ref/complex/xy-scroller/xy-scroller.log new file mode 100644 index 000000000..323897d2a --- /dev/null +++ b/src/test/ref/complex/xy-scroller/xy-scroller.log @@ -0,0 +1,8343 @@ +Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx +Inlined call call sei +Inlined call (byte~) main::$2 ← call toD018 (const nomodify byte*) MAIN_SCREEN0 (const nomodify byte*) MAIN_CHARSET +Inlined call (byte~) main::$52 ← call toD018 (const nomodify byte*) MAIN_SCREEN1 (const nomodify byte*) MAIN_CHARSET +Inlined call (byte~) main::$51 ← call toD018 (const nomodify byte*) MAIN_SCREEN0 (const nomodify byte*) MAIN_CHARSET +Inlined call call __init + +CONTROL FLOW GRAPH SSA + +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +memset: scope:[memset] from main::@35 + (byte) memset::c#4 ← phi( main::@35/(byte) memset::c#0 ) + (void*) memset::str#3 ← phi( main::@35/(void*) memset::str#0 ) + (word) memset::num#1 ← phi( main::@35/(word) memset::num#0 ) + (bool~) memset::$0 ← (word) memset::num#1 > (number) 0 + (bool~) memset::$1 ← ! (bool~) memset::$0 + if((bool~) memset::$1) goto memset::@1 + to:memset::@2 +memset::@1: scope:[memset] from memset memset::@3 + (void*) memset::str#1 ← phi( memset/(void*) memset::str#3 memset::@3/(void*) memset::str#4 ) + (void*) memset::return#0 ← (void*) memset::str#1 + to:memset::@return +memset::@2: scope:[memset] from memset + (byte) memset::c#3 ← phi( memset/(byte) memset::c#4 ) + (word) memset::num#2 ← phi( memset/(word) memset::num#1 ) + (void*) memset::str#2 ← phi( memset/(void*) memset::str#3 ) + (byte*~) memset::$4 ← (byte*)(void*) memset::str#2 + (byte*~) memset::$2 ← (byte*~) memset::$4 + (word) memset::num#2 + (byte*) memset::end#0 ← (byte*~) memset::$2 + (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2 + to:memset::@3 +memset::@3: scope:[memset] from memset::@2 memset::@4 + (byte) memset::c#2 ← phi( memset::@2/(byte) memset::c#3 memset::@4/(byte) memset::c#1 ) + (void*) memset::str#4 ← phi( memset::@2/(void*) memset::str#2 memset::@4/(void*) memset::str#5 ) + (byte*) memset::end#1 ← phi( memset::@2/(byte*) memset::end#0 memset::@4/(byte*) memset::end#2 ) + (byte*) memset::dst#2 ← phi( memset::@2/(byte*) memset::dst#0 memset::@4/(byte*) memset::dst#1 ) + (bool~) memset::$3 ← (byte*) memset::dst#2 != (byte*) memset::end#1 + if((bool~) memset::$3) goto memset::@4 + to:memset::@1 +memset::@4: scope:[memset] from memset::@3 + (void*) memset::str#5 ← phi( memset::@3/(void*) memset::str#4 ) + (byte*) memset::end#2 ← phi( memset::@3/(byte*) memset::end#1 ) + (byte*) memset::dst#3 ← phi( memset::@3/(byte*) memset::dst#2 ) + (byte) memset::c#1 ← phi( memset::@3/(byte) memset::c#2 ) + *((byte*) memset::dst#3) ← (byte) memset::c#1 + (byte*) memset::dst#1 ← ++ (byte*) memset::dst#3 + to:memset::@3 +memset::@return: scope:[memset] from memset::@1 + (void*) memset::return#3 ← phi( memset::@1/(void*) memset::return#0 ) + (void*) memset::return#1 ← (void*) memset::return#3 + return + to:@return + +(void()) main() +main: scope:[main] from __start::@1 + (byte) screen#62 ← phi( __start::@1/(byte) screen#19 ) + (word) y_pos_coarse#53 ← phi( __start::@1/(word) y_pos_coarse#25 ) + (byte) y_pos_fine#52 ← phi( __start::@1/(byte) y_pos_fine#18 ) + (word) x_pos_coarse#57 ← phi( __start::@1/(word) x_pos_coarse#29 ) + (byte) x_pos_fine#52 ← phi( __start::@1/(byte) x_pos_fine#18 ) + (signed word) y_pos#31 ← phi( __start::@1/(signed word) y_pos#16 ) + (signed word) x_pos#31 ← phi( __start::@1/(signed word) x_pos#16 ) + (word) y_sin_idx#37 ← phi( __start::@1/(word) y_sin_idx#22 ) + (word) x_sin_idx#37 ← phi( __start::@1/(word) x_sin_idx#22 ) + to:main::sei1 +main::sei1: scope:[main] from main + (byte) screen#61 ← phi( main/(byte) screen#62 ) + (word) y_pos_coarse#50 ← phi( main/(word) y_pos_coarse#53 ) + (byte) y_pos_fine#44 ← phi( main/(byte) y_pos_fine#52 ) + (word) x_pos_coarse#54 ← phi( main/(word) x_pos_coarse#57 ) + (byte) x_pos_fine#44 ← phi( main/(byte) x_pos_fine#52 ) + (signed word) y_pos#28 ← phi( main/(signed word) y_pos#31 ) + (signed word) x_pos#28 ← phi( main/(signed word) x_pos#31 ) + (word) y_sin_idx#34 ← phi( main/(word) y_sin_idx#37 ) + (word) x_sin_idx#34 ← phi( main/(word) x_sin_idx#37 ) + asm { sei } + to:main::@35 +main::@35: scope:[main] from main::sei1 + (byte) screen#60 ← phi( main::sei1/(byte) screen#61 ) + (word) y_pos_coarse#45 ← phi( main::sei1/(word) y_pos_coarse#50 ) + (byte) y_pos_fine#36 ← phi( main::sei1/(byte) y_pos_fine#44 ) + (word) x_pos_coarse#49 ← phi( main::sei1/(word) x_pos_coarse#54 ) + (byte) x_pos_fine#36 ← phi( main::sei1/(byte) x_pos_fine#44 ) + (signed word) y_pos#25 ← phi( main::sei1/(signed word) y_pos#28 ) + (signed word) x_pos#25 ← phi( main::sei1/(signed word) x_pos#28 ) + (word) y_sin_idx#31 ← phi( main::sei1/(word) y_sin_idx#34 ) + (word) x_sin_idx#31 ← phi( main::sei1/(word) x_sin_idx#34 ) + (void*) memset::str#0 ← (void*)(const nomodify byte*) MAIN_SCREEN0 + (byte) memset::c#0 ← (byte) ' ' + (word) memset::num#0 ← (number) $3e8 + call memset + (void*) memset::return#2 ← (void*) memset::return#1 + to:main::@39 +main::@39: scope:[main] from main::@35 + (byte) screen#57 ← phi( main::@35/(byte) screen#60 ) + (word) y_pos_coarse#41 ← phi( main::@35/(word) y_pos_coarse#45 ) + (byte) y_pos_fine#27 ← phi( main::@35/(byte) y_pos_fine#36 ) + (word) x_pos_coarse#45 ← phi( main::@35/(word) x_pos_coarse#49 ) + (byte) x_pos_fine#27 ← phi( main::@35/(byte) x_pos_fine#36 ) + (signed word) y_pos#22 ← phi( main::@35/(signed word) y_pos#25 ) + (signed word) x_pos#22 ← phi( main::@35/(signed word) x_pos#25 ) + (word) y_sin_idx#28 ← phi( main::@35/(word) y_sin_idx#31 ) + (word) x_sin_idx#28 ← phi( main::@35/(word) x_sin_idx#31 ) + (byte*) main::toD0181_screen#0 ← (const nomodify byte*) MAIN_SCREEN0 + (byte*) main::toD0181_gfx#0 ← (const nomodify byte*) MAIN_CHARSET + to:main::toD0181 +main::toD0181: scope:[main] from main::@39 + (byte) screen#54 ← phi( main::@39/(byte) screen#57 ) + (word) y_pos_coarse#32 ← phi( main::@39/(word) y_pos_coarse#41 ) + (byte) y_pos_fine#22 ← phi( main::@39/(byte) y_pos_fine#27 ) + (word) x_pos_coarse#36 ← phi( main::@39/(word) x_pos_coarse#45 ) + (byte) x_pos_fine#22 ← phi( main::@39/(byte) x_pos_fine#27 ) + (signed word) y_pos#19 ← phi( main::@39/(signed word) y_pos#22 ) + (signed word) x_pos#19 ← phi( main::@39/(signed word) x_pos#22 ) + (word) y_sin_idx#25 ← phi( main::@39/(word) y_sin_idx#28 ) + (word) x_sin_idx#25 ← phi( main::@39/(word) x_sin_idx#28 ) + (byte*) main::toD0181_gfx#1 ← phi( main::@39/(byte*) main::toD0181_gfx#0 ) + (byte*) main::toD0181_screen#1 ← phi( main::@39/(byte*) main::toD0181_screen#0 ) + (word~) main::toD0181_$7 ← (word)(byte*) main::toD0181_screen#1 + (number~) main::toD0181_$0 ← (word~) main::toD0181_$7 & (number) $3fff + (number~) main::toD0181_$1 ← (number~) main::toD0181_$0 * (number) 4 + (number~) main::toD0181_$2 ← > (number~) main::toD0181_$1 + (byte~) main::toD0181_$3 ← > (word)(byte*) main::toD0181_gfx#1 + (number~) main::toD0181_$4 ← (byte~) main::toD0181_$3 / (number) 4 + (number~) main::toD0181_$5 ← (number~) main::toD0181_$4 & (number) $f + (number~) main::toD0181_$6 ← (number~) main::toD0181_$2 | (number~) main::toD0181_$5 + (byte) main::toD0181_return#0 ← (number~) main::toD0181_$6 + to:main::toD0181_@return +main::toD0181_@return: scope:[main] from main::toD0181 + (byte) screen#51 ← phi( main::toD0181/(byte) screen#54 ) + (word) y_pos_coarse#26 ← phi( main::toD0181/(word) y_pos_coarse#32 ) + (byte) y_pos_fine#19 ← phi( main::toD0181/(byte) y_pos_fine#22 ) + (word) x_pos_coarse#30 ← phi( main::toD0181/(word) x_pos_coarse#36 ) + (byte) x_pos_fine#19 ← phi( main::toD0181/(byte) x_pos_fine#22 ) + (signed word) y_pos#17 ← phi( main::toD0181/(signed word) y_pos#19 ) + (signed word) x_pos#17 ← phi( main::toD0181/(signed word) x_pos#19 ) + (word) y_sin_idx#23 ← phi( main::toD0181/(word) y_sin_idx#25 ) + (word) x_sin_idx#23 ← phi( main::toD0181/(word) x_sin_idx#25 ) + (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) + (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 + to:main::@36 +main::@36: scope:[main] from main::toD0181_@return + (byte) screen#46 ← phi( main::toD0181_@return/(byte) screen#51 ) + (word) y_pos_coarse#19 ← phi( main::toD0181_@return/(word) y_pos_coarse#26 ) + (byte) y_pos_fine#15 ← phi( main::toD0181_@return/(byte) y_pos_fine#19 ) + (word) x_pos_coarse#20 ← phi( main::toD0181_@return/(word) x_pos_coarse#30 ) + (byte) x_pos_fine#15 ← phi( main::toD0181_@return/(byte) x_pos_fine#19 ) + (signed word) y_pos#14 ← phi( main::toD0181_@return/(signed word) y_pos#17 ) + (signed word) x_pos#14 ← phi( main::toD0181_@return/(signed word) x_pos#17 ) + (word) y_sin_idx#18 ← phi( main::toD0181_@return/(word) y_sin_idx#23 ) + (word) x_sin_idx#18 ← phi( main::toD0181_@return/(word) x_sin_idx#23 ) + (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) + (byte~) main::$2 ← (byte) main::toD0181_return#3 + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (byte~) main::$2 + call next_position + to:main::@40 +main::@40: scope:[main] from main::@36 + (byte) screen#42 ← phi( main::@36/(byte) screen#46 ) + (word) y_pos_coarse#8 ← phi( main::@36/(word) y_pos_coarse#4 ) + (byte) y_pos_fine#8 ← phi( main::@36/(byte) y_pos_fine#4 ) + (word) x_pos_coarse#8 ← phi( main::@36/(word) x_pos_coarse#4 ) + (byte) x_pos_fine#8 ← phi( main::@36/(byte) x_pos_fine#4 ) + (signed word) y_pos#8 ← phi( main::@36/(signed word) y_pos#4 ) + (signed word) x_pos#8 ← phi( main::@36/(signed word) x_pos#4 ) + (word) y_sin_idx#9 ← phi( main::@36/(word) y_sin_idx#5 ) + (word) x_sin_idx#9 ← phi( main::@36/(word) x_sin_idx#5 ) + (word) x_sin_idx#0 ← (word) x_sin_idx#9 + (word) y_sin_idx#0 ← (word) y_sin_idx#9 + (signed word) x_pos#0 ← (signed word) x_pos#8 + (signed word) y_pos#0 ← (signed word) y_pos#8 + (byte) x_pos_fine#0 ← (byte) x_pos_fine#8 + (word) x_pos_coarse#0 ← (word) x_pos_coarse#8 + (byte) y_pos_fine#0 ← (byte) y_pos_fine#8 + (word) y_pos_coarse#0 ← (word) y_pos_coarse#8 + to:main::@1 +main::@1: scope:[main] from main::@31 main::@40 + (byte) screen#35 ← phi( main::@31/(byte) screen#41 main::@40/(byte) screen#42 ) + (byte) y_pos_fine#16 ← phi( main::@31/(byte) y_pos_fine#20 main::@40/(byte) y_pos_fine#0 ) + (byte) x_pos_fine#16 ← phi( main::@31/(byte) x_pos_fine#20 main::@40/(byte) x_pos_fine#0 ) + (signed word) y_pos#15 ← phi( main::@31/(signed word) y_pos#18 main::@40/(signed word) y_pos#0 ) + (signed word) x_pos#15 ← phi( main::@31/(signed word) x_pos#18 main::@40/(signed word) x_pos#0 ) + (word) y_sin_idx#19 ← phi( main::@31/(word) y_sin_idx#24 main::@40/(word) y_sin_idx#0 ) + (word) x_sin_idx#19 ← phi( main::@31/(word) x_sin_idx#24 main::@40/(word) x_sin_idx#0 ) + (word) y_pos_coarse#9 ← phi( main::@31/(word) y_pos_coarse#20 main::@40/(word) y_pos_coarse#0 ) + (word) x_pos_coarse#9 ← phi( main::@31/(word) x_pos_coarse#21 main::@40/(word) x_pos_coarse#0 ) + (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#9 + (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#9 + call next_position + to:main::@41 +main::@41: scope:[main] from main::@1 + (byte) screen#29 ← phi( main::@1/(byte) screen#35 ) + (word) main::x_pos_coarse_old#5 ← phi( main::@1/(word) main::x_pos_coarse_old#0 ) + (word) main::y_pos_coarse_old#1 ← phi( main::@1/(word) main::y_pos_coarse_old#0 ) + (word) y_pos_coarse#10 ← phi( main::@1/(word) y_pos_coarse#4 ) + (byte) y_pos_fine#9 ← phi( main::@1/(byte) y_pos_fine#4 ) + (word) x_pos_coarse#10 ← phi( main::@1/(word) x_pos_coarse#4 ) + (byte) x_pos_fine#9 ← phi( main::@1/(byte) x_pos_fine#4 ) + (signed word) y_pos#9 ← phi( main::@1/(signed word) y_pos#4 ) + (signed word) x_pos#9 ← phi( main::@1/(signed word) x_pos#4 ) + (word) y_sin_idx#10 ← phi( main::@1/(word) y_sin_idx#5 ) + (word) x_sin_idx#10 ← phi( main::@1/(word) x_sin_idx#5 ) + (word) x_sin_idx#1 ← (word) x_sin_idx#10 + (word) y_sin_idx#1 ← (word) y_sin_idx#10 + (signed word) x_pos#1 ← (signed word) x_pos#9 + (signed word) y_pos#1 ← (signed word) y_pos#9 + (byte) x_pos_fine#1 ← (byte) x_pos_fine#9 + (word) x_pos_coarse#1 ← (word) x_pos_coarse#10 + (byte) y_pos_fine#1 ← (byte) y_pos_fine#9 + (word) y_pos_coarse#1 ← (word) y_pos_coarse#10 + (word~) main::$5 ← (word) main::y_pos_coarse_old#1 - (word) y_pos_coarse#1 + (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 + (signed byte) main::movement#0 ← (signed byte) 0 + (bool~) main::$6 ← (signed byte) main::y_movement#0 == (number) 1 + if((bool~) main::$6) goto main::@2 + to:main::@32 +main::@2: scope:[main] from main::@41 + (signed word) y_pos#37 ← phi( main::@41/(signed word) y_pos#1 ) + (signed word) x_pos#37 ← phi( main::@41/(signed word) x_pos#1 ) + (word) y_sin_idx#43 ← phi( main::@41/(word) y_sin_idx#1 ) + (word) x_sin_idx#43 ← phi( main::@41/(word) x_sin_idx#1 ) + (word) y_pos_coarse#56 ← phi( main::@41/(word) y_pos_coarse#1 ) + (signed byte) main::y_movement#12 ← phi( main::@41/(signed byte) main::y_movement#0 ) + (byte) x_pos_fine#28 ← phi( main::@41/(byte) x_pos_fine#1 ) + (byte) y_pos_fine#28 ← phi( main::@41/(byte) y_pos_fine#1 ) + (byte) screen#20 ← phi( main::@41/(byte) screen#29 ) + (word) x_pos_coarse#22 ← phi( main::@41/(word) x_pos_coarse#1 ) + (word) main::x_pos_coarse_old#2 ← phi( main::@41/(word) main::x_pos_coarse_old#5 ) + (signed byte) main::movement#1 ← (number) -$28 + to:main::@3 +main::@32: scope:[main] from main::@41 + (signed word) y_pos#38 ← phi( main::@41/(signed word) y_pos#1 ) + (signed word) x_pos#38 ← phi( main::@41/(signed word) x_pos#1 ) + (word) y_sin_idx#44 ← phi( main::@41/(word) y_sin_idx#1 ) + (word) x_sin_idx#44 ← phi( main::@41/(word) x_sin_idx#1 ) + (word) y_pos_coarse#57 ← phi( main::@41/(word) y_pos_coarse#1 ) + (byte) x_pos_fine#29 ← phi( main::@41/(byte) x_pos_fine#1 ) + (byte) y_pos_fine#29 ← phi( main::@41/(byte) y_pos_fine#1 ) + (byte) screen#21 ← phi( main::@41/(byte) screen#29 ) + (signed byte) main::movement#6 ← phi( main::@41/(signed byte) main::movement#0 ) + (word) x_pos_coarse#23 ← phi( main::@41/(word) x_pos_coarse#1 ) + (word) main::x_pos_coarse_old#3 ← phi( main::@41/(word) main::x_pos_coarse_old#5 ) + (signed byte) main::y_movement#1 ← phi( main::@41/(signed byte) main::y_movement#0 ) + (bool~) main::$7 ← (signed byte) main::y_movement#1 == (number) -1 + (bool~) main::$8 ← ! (bool~) main::$7 + if((bool~) main::$8) goto main::@3 + to:main::@33 +main::@33: scope:[main] from main::@32 + (signed word) y_pos#39 ← phi( main::@32/(signed word) y_pos#38 ) + (signed word) x_pos#39 ← phi( main::@32/(signed word) x_pos#38 ) + (word) y_sin_idx#45 ← phi( main::@32/(word) y_sin_idx#44 ) + (word) x_sin_idx#45 ← phi( main::@32/(word) x_sin_idx#44 ) + (word) y_pos_coarse#58 ← phi( main::@32/(word) y_pos_coarse#57 ) + (signed byte) main::y_movement#13 ← phi( main::@32/(signed byte) main::y_movement#1 ) + (byte) x_pos_fine#30 ← phi( main::@32/(byte) x_pos_fine#29 ) + (byte) y_pos_fine#30 ← phi( main::@32/(byte) y_pos_fine#29 ) + (byte) screen#22 ← phi( main::@32/(byte) screen#21 ) + (word) x_pos_coarse#24 ← phi( main::@32/(word) x_pos_coarse#23 ) + (word) main::x_pos_coarse_old#4 ← phi( main::@32/(word) main::x_pos_coarse_old#3 ) + (signed byte) main::movement#2 ← (number) $28 + to:main::@3 +main::@3: scope:[main] from main::@2 main::@32 main::@33 + (signed word) y_pos#36 ← phi( main::@2/(signed word) y_pos#37 main::@32/(signed word) y_pos#38 main::@33/(signed word) y_pos#39 ) + (signed word) x_pos#36 ← phi( main::@2/(signed word) x_pos#37 main::@32/(signed word) x_pos#38 main::@33/(signed word) x_pos#39 ) + (word) y_sin_idx#42 ← phi( main::@2/(word) y_sin_idx#43 main::@32/(word) y_sin_idx#44 main::@33/(word) y_sin_idx#45 ) + (word) x_sin_idx#42 ← phi( main::@2/(word) x_sin_idx#43 main::@32/(word) x_sin_idx#44 main::@33/(word) x_sin_idx#45 ) + (word) y_pos_coarse#54 ← phi( main::@2/(word) y_pos_coarse#56 main::@32/(word) y_pos_coarse#57 main::@33/(word) y_pos_coarse#58 ) + (signed byte) main::y_movement#11 ← phi( main::@2/(signed byte) main::y_movement#12 main::@32/(signed byte) main::y_movement#1 main::@33/(signed byte) main::y_movement#13 ) + (byte) x_pos_fine#24 ← phi( main::@2/(byte) x_pos_fine#28 main::@32/(byte) x_pos_fine#29 main::@33/(byte) x_pos_fine#30 ) + (byte) y_pos_fine#24 ← phi( main::@2/(byte) y_pos_fine#28 main::@32/(byte) y_pos_fine#29 main::@33/(byte) y_pos_fine#30 ) + (byte) screen#12 ← phi( main::@2/(byte) screen#20 main::@32/(byte) screen#21 main::@33/(byte) screen#22 ) + (signed byte) main::movement#4 ← phi( main::@2/(signed byte) main::movement#1 main::@32/(signed byte) main::movement#6 main::@33/(signed byte) main::movement#2 ) + (word) x_pos_coarse#11 ← phi( main::@2/(word) x_pos_coarse#22 main::@32/(word) x_pos_coarse#23 main::@33/(word) x_pos_coarse#24 ) + (word) main::x_pos_coarse_old#1 ← phi( main::@2/(word) main::x_pos_coarse_old#2 main::@32/(word) main::x_pos_coarse_old#3 main::@33/(word) main::x_pos_coarse_old#4 ) + (word~) main::$9 ← (word) main::x_pos_coarse_old#1 - (word) x_pos_coarse#11 + (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 + (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 + (bool~) main::$56 ← (number) 0 != (signed byte) main::movement#3 + (bool~) main::$10 ← ! (bool~) main::$56 + if((bool~) main::$10) goto main::@26 + to:main::@34 +main::@34: scope:[main] from main::@3 + (signed word) y_pos#66 ← phi( main::@3/(signed word) y_pos#36 ) + (signed word) x_pos#66 ← phi( main::@3/(signed word) x_pos#36 ) + (word) y_sin_idx#72 ← phi( main::@3/(word) y_sin_idx#42 ) + (word) x_sin_idx#72 ← phi( main::@3/(word) x_sin_idx#42 ) + (byte) x_pos_fine#66 ← phi( main::@3/(byte) x_pos_fine#24 ) + (byte) y_pos_fine#66 ← phi( main::@3/(byte) y_pos_fine#24 ) + (signed byte) main::x_movement#19 ← phi( main::@3/(signed byte) main::x_movement#0 ) + (word) y_pos_coarse#51 ← phi( main::@3/(word) y_pos_coarse#54 ) + (word) x_pos_coarse#55 ← phi( main::@3/(word) x_pos_coarse#11 ) + (signed byte) main::y_movement#10 ← phi( main::@3/(signed byte) main::y_movement#11 ) + (signed byte) main::movement#9 ← phi( main::@3/(signed byte) main::movement#3 ) + (byte) screen#5 ← phi( main::@3/(byte) screen#12 ) + (bool~) main::$53 ← (number) 0 != (byte) screen#5 + if((bool~) main::$53) goto main::@4 + to:main::@5 +main::@4: scope:[main] from main::@34 + (signed word) y_pos#64 ← phi( main::@34/(signed word) y_pos#66 ) + (signed word) x_pos#64 ← phi( main::@34/(signed word) x_pos#66 ) + (word) y_sin_idx#70 ← phi( main::@34/(word) y_sin_idx#72 ) + (word) x_sin_idx#70 ← phi( main::@34/(word) x_sin_idx#72 ) + (byte) x_pos_fine#64 ← phi( main::@34/(byte) x_pos_fine#66 ) + (byte) y_pos_fine#64 ← phi( main::@34/(byte) y_pos_fine#66 ) + (signed byte) main::x_movement#17 ← phi( main::@34/(signed byte) main::x_movement#19 ) + (word) y_pos_coarse#46 ← phi( main::@34/(word) y_pos_coarse#51 ) + (word) x_pos_coarse#50 ← phi( main::@34/(word) x_pos_coarse#55 ) + (signed byte) main::y_movement#8 ← phi( main::@34/(signed byte) main::y_movement#10 ) + (byte) screen#13 ← phi( main::@34/(byte) screen#5 ) + (signed byte) main::movement#7 ← phi( main::@34/(signed byte) main::movement#9 ) + (byte*~) main::$12 ← (const nomodify byte*) MAIN_SCREEN1 + to:main::@6 +main::@5: scope:[main] from main::@34 + (signed word) y_pos#65 ← phi( main::@34/(signed word) y_pos#66 ) + (signed word) x_pos#65 ← phi( main::@34/(signed word) x_pos#66 ) + (word) y_sin_idx#71 ← phi( main::@34/(word) y_sin_idx#72 ) + (word) x_sin_idx#71 ← phi( main::@34/(word) x_sin_idx#72 ) + (byte) x_pos_fine#65 ← phi( main::@34/(byte) x_pos_fine#66 ) + (byte) y_pos_fine#65 ← phi( main::@34/(byte) y_pos_fine#66 ) + (signed byte) main::x_movement#18 ← phi( main::@34/(signed byte) main::x_movement#19 ) + (word) y_pos_coarse#47 ← phi( main::@34/(word) y_pos_coarse#51 ) + (word) x_pos_coarse#51 ← phi( main::@34/(word) x_pos_coarse#55 ) + (signed byte) main::y_movement#9 ← phi( main::@34/(signed byte) main::y_movement#10 ) + (byte) screen#14 ← phi( main::@34/(byte) screen#5 ) + (signed byte) main::movement#8 ← phi( main::@34/(signed byte) main::movement#9 ) + (byte*~) main::$11 ← (const nomodify byte*) MAIN_SCREEN0 + to:main::@6 +main::@6: scope:[main] from main::@4 main::@5 + (signed word) y_pos#63 ← phi( main::@4/(signed word) y_pos#64 main::@5/(signed word) y_pos#65 ) + (signed word) x_pos#63 ← phi( main::@4/(signed word) x_pos#64 main::@5/(signed word) x_pos#65 ) + (word) y_sin_idx#69 ← phi( main::@4/(word) y_sin_idx#70 main::@5/(word) y_sin_idx#71 ) + (word) x_sin_idx#69 ← phi( main::@4/(word) x_sin_idx#70 main::@5/(word) x_sin_idx#71 ) + (byte) x_pos_fine#63 ← phi( main::@4/(byte) x_pos_fine#64 main::@5/(byte) x_pos_fine#65 ) + (byte) y_pos_fine#63 ← phi( main::@4/(byte) y_pos_fine#64 main::@5/(byte) y_pos_fine#65 ) + (signed byte) main::x_movement#16 ← phi( main::@4/(signed byte) main::x_movement#17 main::@5/(signed byte) main::x_movement#18 ) + (word) y_pos_coarse#42 ← phi( main::@4/(word) y_pos_coarse#46 main::@5/(word) y_pos_coarse#47 ) + (word) x_pos_coarse#46 ← phi( main::@4/(word) x_pos_coarse#50 main::@5/(word) x_pos_coarse#51 ) + (signed byte) main::y_movement#7 ← phi( main::@4/(signed byte) main::y_movement#8 main::@5/(signed byte) main::y_movement#9 ) + (byte) screen#6 ← phi( main::@4/(byte) screen#13 main::@5/(byte) screen#14 ) + (signed byte) main::movement#5 ← phi( main::@4/(signed byte) main::movement#7 main::@5/(signed byte) main::movement#8 ) + (byte*~) main::$13 ← phi( main::@4/(byte*~) main::$12 main::@5/(byte*~) main::$11 ) + (byte*~) main::$14 ← (byte*~) main::$13 + (signed byte) main::movement#5 + (byte*) main::screen_active#0 ← (byte*~) main::$14 + (bool~) main::$54 ← (number) 0 != (byte) screen#6 + if((bool~) main::$54) goto main::@7 + to:main::@8 +main::@7: scope:[main] from main::@6 + (signed word) y_pos#61 ← phi( main::@6/(signed word) y_pos#63 ) + (signed word) x_pos#61 ← phi( main::@6/(signed word) x_pos#63 ) + (word) y_sin_idx#67 ← phi( main::@6/(word) y_sin_idx#69 ) + (word) x_sin_idx#67 ← phi( main::@6/(word) x_sin_idx#69 ) + (byte) x_pos_fine#61 ← phi( main::@6/(byte) x_pos_fine#63 ) + (byte) y_pos_fine#61 ← phi( main::@6/(byte) y_pos_fine#63 ) + (byte) screen#47 ← phi( main::@6/(byte) screen#6 ) + (signed byte) main::x_movement#14 ← phi( main::@6/(signed byte) main::x_movement#16 ) + (word) y_pos_coarse#33 ← phi( main::@6/(word) y_pos_coarse#42 ) + (word) x_pos_coarse#37 ← phi( main::@6/(word) x_pos_coarse#46 ) + (signed byte) main::y_movement#5 ← phi( main::@6/(signed byte) main::y_movement#7 ) + (byte*) main::screen_active#2 ← phi( main::@6/(byte*) main::screen_active#0 ) + (byte*~) main::$16 ← (const nomodify byte*) MAIN_SCREEN0 + to:main::@9 +main::@8: scope:[main] from main::@6 + (signed word) y_pos#62 ← phi( main::@6/(signed word) y_pos#63 ) + (signed word) x_pos#62 ← phi( main::@6/(signed word) x_pos#63 ) + (word) y_sin_idx#68 ← phi( main::@6/(word) y_sin_idx#69 ) + (word) x_sin_idx#68 ← phi( main::@6/(word) x_sin_idx#69 ) + (byte) x_pos_fine#62 ← phi( main::@6/(byte) x_pos_fine#63 ) + (byte) y_pos_fine#62 ← phi( main::@6/(byte) y_pos_fine#63 ) + (byte) screen#48 ← phi( main::@6/(byte) screen#6 ) + (signed byte) main::x_movement#15 ← phi( main::@6/(signed byte) main::x_movement#16 ) + (word) y_pos_coarse#34 ← phi( main::@6/(word) y_pos_coarse#42 ) + (word) x_pos_coarse#38 ← phi( main::@6/(word) x_pos_coarse#46 ) + (signed byte) main::y_movement#6 ← phi( main::@6/(signed byte) main::y_movement#7 ) + (byte*) main::screen_active#3 ← phi( main::@6/(byte*) main::screen_active#0 ) + (byte*~) main::$15 ← (const nomodify byte*) MAIN_SCREEN1 + to:main::@9 +main::@9: scope:[main] from main::@7 main::@8 + (signed word) y_pos#58 ← phi( main::@7/(signed word) y_pos#61 main::@8/(signed word) y_pos#62 ) + (signed word) x_pos#58 ← phi( main::@7/(signed word) x_pos#61 main::@8/(signed word) x_pos#62 ) + (word) y_sin_idx#64 ← phi( main::@7/(word) y_sin_idx#67 main::@8/(word) y_sin_idx#68 ) + (word) x_sin_idx#64 ← phi( main::@7/(word) x_sin_idx#67 main::@8/(word) x_sin_idx#68 ) + (byte) x_pos_fine#58 ← phi( main::@7/(byte) x_pos_fine#61 main::@8/(byte) x_pos_fine#62 ) + (byte) y_pos_fine#58 ← phi( main::@7/(byte) y_pos_fine#61 main::@8/(byte) y_pos_fine#62 ) + (byte) screen#43 ← phi( main::@7/(byte) screen#47 main::@8/(byte) screen#48 ) + (signed byte) main::x_movement#11 ← phi( main::@7/(signed byte) main::x_movement#14 main::@8/(signed byte) main::x_movement#15 ) + (word) y_pos_coarse#27 ← phi( main::@7/(word) y_pos_coarse#33 main::@8/(word) y_pos_coarse#34 ) + (word) x_pos_coarse#31 ← phi( main::@7/(word) x_pos_coarse#37 main::@8/(word) x_pos_coarse#38 ) + (signed byte) main::y_movement#4 ← phi( main::@7/(signed byte) main::y_movement#5 main::@8/(signed byte) main::y_movement#6 ) + (byte*) main::screen_active#1 ← phi( main::@7/(byte*) main::screen_active#2 main::@8/(byte*) main::screen_active#3 ) + (byte*~) main::$17 ← phi( main::@7/(byte*~) main::$16 main::@8/(byte*~) main::$15 ) + (byte*) main::screen_hidden#0 ← (byte*~) main::$17 + (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 + (byte*) screencpy::src#0 ← (byte*) main::screen_active#1 + call screencpy + to:main::@42 +main::@42: scope:[main] from main::@9 + (signed word) y_pos#53 ← phi( main::@9/(signed word) y_pos#58 ) + (signed word) x_pos#53 ← phi( main::@9/(signed word) x_pos#58 ) + (word) y_sin_idx#59 ← phi( main::@9/(word) y_sin_idx#64 ) + (word) x_sin_idx#59 ← phi( main::@9/(word) x_sin_idx#64 ) + (byte) x_pos_fine#53 ← phi( main::@9/(byte) x_pos_fine#58 ) + (byte) y_pos_fine#53 ← phi( main::@9/(byte) y_pos_fine#58 ) + (byte) screen#36 ← phi( main::@9/(byte) screen#43 ) + (signed byte) main::x_movement#6 ← phi( main::@9/(signed byte) main::x_movement#11 ) + (byte*) main::screen_hidden#9 ← phi( main::@9/(byte*) main::screen_hidden#0 ) + (word) y_pos_coarse#21 ← phi( main::@9/(word) y_pos_coarse#27 ) + (word) x_pos_coarse#25 ← phi( main::@9/(word) x_pos_coarse#31 ) + (signed byte) main::y_movement#2 ← phi( main::@9/(signed byte) main::y_movement#4 ) + (bool~) main::$19 ← (signed byte) main::y_movement#2 == (number) -1 + if((bool~) main::$19) goto main::@10 + to:main::@22 +main::@10: scope:[main] from main::@42 + (signed word) y_pos#59 ← phi( main::@42/(signed word) y_pos#53 ) + (signed word) x_pos#59 ← phi( main::@42/(signed word) x_pos#53 ) + (word) y_sin_idx#65 ← phi( main::@42/(word) y_sin_idx#59 ) + (word) x_sin_idx#65 ← phi( main::@42/(word) x_sin_idx#59 ) + (byte) x_pos_fine#59 ← phi( main::@42/(byte) x_pos_fine#53 ) + (byte) y_pos_fine#59 ← phi( main::@42/(byte) y_pos_fine#53 ) + (byte) screen#44 ← phi( main::@42/(byte) screen#36 ) + (signed byte) main::x_movement#12 ← phi( main::@42/(signed byte) main::x_movement#6 ) + (byte*) main::screen_hidden#5 ← phi( main::@42/(byte*) main::screen_hidden#9 ) + (word) y_pos_coarse#11 ← phi( main::@42/(word) y_pos_coarse#21 ) + (word) x_pos_coarse#12 ← phi( main::@42/(word) x_pos_coarse#25 ) + (number~) main::$26 ← (word) x_pos_coarse#12 - (number) $14 + (number~) main::$27 ← (word) y_pos_coarse#11 + (number) $c + (word) petscii_ptr::row_x#0 ← (number~) main::$26 + (word) petscii_ptr::row_y#0 ← (number~) main::$27 + call petscii_ptr + (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#5 + to:main::@43 +main::@43: scope:[main] from main::@10 + (signed word) y_pos#57 ← phi( main::@10/(signed word) y_pos#59 ) + (signed word) x_pos#57 ← phi( main::@10/(signed word) x_pos#59 ) + (word) y_sin_idx#63 ← phi( main::@10/(word) y_sin_idx#65 ) + (word) x_sin_idx#63 ← phi( main::@10/(word) x_sin_idx#65 ) + (byte) x_pos_fine#57 ← phi( main::@10/(byte) x_pos_fine#59 ) + (byte) y_pos_fine#57 ← phi( main::@10/(byte) y_pos_fine#59 ) + (byte) screen#40 ← phi( main::@10/(byte) screen#44 ) + (word) y_pos_coarse#38 ← phi( main::@10/(word) y_pos_coarse#11 ) + (word) x_pos_coarse#42 ← phi( main::@10/(word) x_pos_coarse#12 ) + (signed byte) main::x_movement#10 ← phi( main::@10/(signed byte) main::x_movement#12 ) + (byte*) main::screen_hidden#1 ← phi( main::@10/(byte*) main::screen_hidden#5 ) + (byte*) petscii_ptr::return#6 ← phi( main::@10/(byte*) petscii_ptr::return#0 ) + (byte*~) main::$28 ← (byte*) petscii_ptr::return#6 + (byte*) main::petscii1#0 ← (byte*~) main::$28 + (byte*~) main::$29 ← (byte*) main::screen_hidden#1 + (number) $18*(number) $28 + (byte*) main::scrn1#0 ← (byte*~) main::$29 + (byte) main::i1#0 ← (byte) 0 + to:main::@14 +main::@22: scope:[main] from main::@42 + (signed word) y_pos#50 ← phi( main::@42/(signed word) y_pos#53 ) + (signed word) x_pos#50 ← phi( main::@42/(signed word) x_pos#53 ) + (word) y_sin_idx#56 ← phi( main::@42/(word) y_sin_idx#59 ) + (word) x_sin_idx#56 ← phi( main::@42/(word) x_sin_idx#59 ) + (byte) x_pos_fine#47 ← phi( main::@42/(byte) x_pos_fine#53 ) + (byte) y_pos_fine#47 ← phi( main::@42/(byte) y_pos_fine#53 ) + (byte) screen#32 ← phi( main::@42/(byte) screen#36 ) + (byte*) main::screen_hidden#10 ← phi( main::@42/(byte*) main::screen_hidden#9 ) + (signed byte) main::x_movement#5 ← phi( main::@42/(signed byte) main::x_movement#6 ) + (word) y_pos_coarse#22 ← phi( main::@42/(word) y_pos_coarse#21 ) + (word) x_pos_coarse#26 ← phi( main::@42/(word) x_pos_coarse#25 ) + (signed byte) main::y_movement#3 ← phi( main::@42/(signed byte) main::y_movement#2 ) + (bool~) main::$20 ← (signed byte) main::y_movement#3 == (number) 1 + (bool~) main::$21 ← ! (bool~) main::$20 + if((bool~) main::$21) goto main::@13 + to:main::@23 +main::@23: scope:[main] from main::@22 + (signed word) y_pos#60 ← phi( main::@22/(signed word) y_pos#50 ) + (signed word) x_pos#60 ← phi( main::@22/(signed word) x_pos#50 ) + (word) y_sin_idx#66 ← phi( main::@22/(word) y_sin_idx#56 ) + (word) x_sin_idx#66 ← phi( main::@22/(word) x_sin_idx#56 ) + (byte) x_pos_fine#60 ← phi( main::@22/(byte) x_pos_fine#47 ) + (byte) y_pos_fine#60 ← phi( main::@22/(byte) y_pos_fine#47 ) + (byte) screen#45 ← phi( main::@22/(byte) screen#32 ) + (signed byte) main::x_movement#13 ← phi( main::@22/(signed byte) main::x_movement#5 ) + (byte*) main::screen_hidden#6 ← phi( main::@22/(byte*) main::screen_hidden#10 ) + (word) y_pos_coarse#12 ← phi( main::@22/(word) y_pos_coarse#22 ) + (word) x_pos_coarse#13 ← phi( main::@22/(word) x_pos_coarse#26 ) + (number~) main::$22 ← (word) x_pos_coarse#13 - (number) $14 + (number~) main::$23 ← (word) y_pos_coarse#12 - (number) $c + (word) petscii_ptr::row_x#1 ← (number~) main::$22 + (word) petscii_ptr::row_y#1 ← (number~) main::$23 + call petscii_ptr + (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#5 + to:main::@44 +main::@44: scope:[main] from main::@23 + (signed word) y_pos#55 ← phi( main::@23/(signed word) y_pos#60 ) + (signed word) x_pos#55 ← phi( main::@23/(signed word) x_pos#60 ) + (word) y_sin_idx#61 ← phi( main::@23/(word) y_sin_idx#66 ) + (word) x_sin_idx#61 ← phi( main::@23/(word) x_sin_idx#66 ) + (byte) x_pos_fine#55 ← phi( main::@23/(byte) x_pos_fine#60 ) + (byte) y_pos_fine#55 ← phi( main::@23/(byte) y_pos_fine#60 ) + (byte) screen#38 ← phi( main::@23/(byte) screen#45 ) + (word) y_pos_coarse#36 ← phi( main::@23/(word) y_pos_coarse#12 ) + (word) x_pos_coarse#40 ← phi( main::@23/(word) x_pos_coarse#13 ) + (signed byte) main::x_movement#8 ← phi( main::@23/(signed byte) main::x_movement#13 ) + (byte*) main::screen_hidden#2 ← phi( main::@23/(byte*) main::screen_hidden#6 ) + (byte*) petscii_ptr::return#7 ← phi( main::@23/(byte*) petscii_ptr::return#1 ) + (byte*~) main::$24 ← (byte*) petscii_ptr::return#7 + (byte*) main::petscii#0 ← (byte*~) main::$24 + (byte*) main::scrn#0 ← (byte*) main::screen_hidden#2 + (byte) main::i#0 ← (byte) 0 + to:main::@11 +main::@11: scope:[main] from main::@12 main::@44 + (signed word) y_pos#48 ← phi( main::@12/(signed word) y_pos#54 main::@44/(signed word) y_pos#55 ) + (signed word) x_pos#48 ← phi( main::@12/(signed word) x_pos#54 main::@44/(signed word) x_pos#55 ) + (word) y_sin_idx#54 ← phi( main::@12/(word) y_sin_idx#60 main::@44/(word) y_sin_idx#61 ) + (word) x_sin_idx#54 ← phi( main::@12/(word) x_sin_idx#60 main::@44/(word) x_sin_idx#61 ) + (byte) x_pos_fine#45 ← phi( main::@12/(byte) x_pos_fine#54 main::@44/(byte) x_pos_fine#55 ) + (byte) y_pos_fine#45 ← phi( main::@12/(byte) y_pos_fine#54 main::@44/(byte) y_pos_fine#55 ) + (byte) screen#30 ← phi( main::@12/(byte) screen#37 main::@44/(byte) screen#38 ) + (byte*) main::screen_hidden#13 ← phi( main::@12/(byte*) main::screen_hidden#15 main::@44/(byte*) main::screen_hidden#2 ) + (word) y_pos_coarse#28 ← phi( main::@12/(word) y_pos_coarse#35 main::@44/(word) y_pos_coarse#36 ) + (word) x_pos_coarse#32 ← phi( main::@12/(word) x_pos_coarse#39 main::@44/(word) x_pos_coarse#40 ) + (signed byte) main::x_movement#3 ← phi( main::@12/(signed byte) main::x_movement#7 main::@44/(signed byte) main::x_movement#8 ) + (byte*) main::scrn#2 ← phi( main::@12/(byte*) main::scrn#1 main::@44/(byte*) main::scrn#0 ) + (byte*) main::petscii#2 ← phi( main::@12/(byte*) main::petscii#1 main::@44/(byte*) main::petscii#0 ) + (byte) main::i#2 ← phi( main::@12/(byte) main::i#1 main::@44/(byte) main::i#0 ) + (bool~) main::$25 ← (byte) main::i#2 < (number) $28 + if((bool~) main::$25) goto main::@12 + to:main::@13 +main::@12: scope:[main] from main::@11 + (signed word) y_pos#54 ← phi( main::@11/(signed word) y_pos#48 ) + (signed word) x_pos#54 ← phi( main::@11/(signed word) x_pos#48 ) + (word) y_sin_idx#60 ← phi( main::@11/(word) y_sin_idx#54 ) + (word) x_sin_idx#60 ← phi( main::@11/(word) x_sin_idx#54 ) + (byte) x_pos_fine#54 ← phi( main::@11/(byte) x_pos_fine#45 ) + (byte) y_pos_fine#54 ← phi( main::@11/(byte) y_pos_fine#45 ) + (byte) screen#37 ← phi( main::@11/(byte) screen#30 ) + (byte*) main::screen_hidden#15 ← phi( main::@11/(byte*) main::screen_hidden#13 ) + (word) y_pos_coarse#35 ← phi( main::@11/(word) y_pos_coarse#28 ) + (word) x_pos_coarse#39 ← phi( main::@11/(word) x_pos_coarse#32 ) + (signed byte) main::x_movement#7 ← phi( main::@11/(signed byte) main::x_movement#3 ) + (byte*) main::scrn#1 ← phi( main::@11/(byte*) main::scrn#2 ) + (byte) main::i#3 ← phi( main::@11/(byte) main::i#2 ) + (byte*) main::petscii#1 ← phi( main::@11/(byte*) main::petscii#2 ) + *((byte*) main::scrn#1 + (byte) main::i#3) ← *((byte*) main::petscii#1 + (byte) main::i#3) + (byte) main::i#1 ← ++ (byte) main::i#3 + to:main::@11 +main::@13: scope:[main] from main::@11 main::@14 main::@22 + (signed word) y_pos#43 ← phi( main::@11/(signed word) y_pos#48 main::@14/(signed word) y_pos#49 main::@22/(signed word) y_pos#50 ) + (signed word) x_pos#43 ← phi( main::@11/(signed word) x_pos#48 main::@14/(signed word) x_pos#49 main::@22/(signed word) x_pos#50 ) + (word) y_sin_idx#49 ← phi( main::@11/(word) y_sin_idx#54 main::@14/(word) y_sin_idx#55 main::@22/(word) y_sin_idx#56 ) + (word) x_sin_idx#49 ← phi( main::@11/(word) x_sin_idx#54 main::@14/(word) x_sin_idx#55 main::@22/(word) x_sin_idx#56 ) + (byte) x_pos_fine#37 ← phi( main::@11/(byte) x_pos_fine#45 main::@14/(byte) x_pos_fine#46 main::@22/(byte) x_pos_fine#47 ) + (byte) y_pos_fine#37 ← phi( main::@11/(byte) y_pos_fine#45 main::@14/(byte) y_pos_fine#46 main::@22/(byte) y_pos_fine#47 ) + (byte) screen#23 ← phi( main::@11/(byte) screen#30 main::@14/(byte) screen#31 main::@22/(byte) screen#32 ) + (byte*) main::screen_hidden#11 ← phi( main::@11/(byte*) main::screen_hidden#13 main::@14/(byte*) main::screen_hidden#14 main::@22/(byte*) main::screen_hidden#10 ) + (word) y_pos_coarse#23 ← phi( main::@11/(word) y_pos_coarse#28 main::@14/(word) y_pos_coarse#29 main::@22/(word) y_pos_coarse#22 ) + (word) x_pos_coarse#27 ← phi( main::@11/(word) x_pos_coarse#32 main::@14/(word) x_pos_coarse#33 main::@22/(word) x_pos_coarse#26 ) + (signed byte) main::x_movement#1 ← phi( main::@11/(signed byte) main::x_movement#3 main::@14/(signed byte) main::x_movement#4 main::@22/(signed byte) main::x_movement#5 ) + (bool~) main::$31 ← (signed byte) main::x_movement#1 == (number) -1 + if((bool~) main::$31) goto main::@16 + to:main::@24 +main::@14: scope:[main] from main::@15 main::@43 + (signed word) y_pos#49 ← phi( main::@15/(signed word) y_pos#56 main::@43/(signed word) y_pos#57 ) + (signed word) x_pos#49 ← phi( main::@15/(signed word) x_pos#56 main::@43/(signed word) x_pos#57 ) + (word) y_sin_idx#55 ← phi( main::@15/(word) y_sin_idx#62 main::@43/(word) y_sin_idx#63 ) + (word) x_sin_idx#55 ← phi( main::@15/(word) x_sin_idx#62 main::@43/(word) x_sin_idx#63 ) + (byte) x_pos_fine#46 ← phi( main::@15/(byte) x_pos_fine#56 main::@43/(byte) x_pos_fine#57 ) + (byte) y_pos_fine#46 ← phi( main::@15/(byte) y_pos_fine#56 main::@43/(byte) y_pos_fine#57 ) + (byte) screen#31 ← phi( main::@15/(byte) screen#39 main::@43/(byte) screen#40 ) + (byte*) main::screen_hidden#14 ← phi( main::@15/(byte*) main::screen_hidden#16 main::@43/(byte*) main::screen_hidden#1 ) + (word) y_pos_coarse#29 ← phi( main::@15/(word) y_pos_coarse#37 main::@43/(word) y_pos_coarse#38 ) + (word) x_pos_coarse#33 ← phi( main::@15/(word) x_pos_coarse#41 main::@43/(word) x_pos_coarse#42 ) + (byte*) main::scrn1#2 ← phi( main::@15/(byte*) main::scrn1#1 main::@43/(byte*) main::scrn1#0 ) + (byte*) main::petscii1#2 ← phi( main::@15/(byte*) main::petscii1#1 main::@43/(byte*) main::petscii1#0 ) + (signed byte) main::x_movement#4 ← phi( main::@15/(signed byte) main::x_movement#9 main::@43/(signed byte) main::x_movement#10 ) + (byte) main::i1#2 ← phi( main::@15/(byte) main::i1#1 main::@43/(byte) main::i1#0 ) + (bool~) main::$30 ← (byte) main::i1#2 < (number) $28 + if((bool~) main::$30) goto main::@15 + to:main::@13 +main::@15: scope:[main] from main::@14 + (signed word) y_pos#56 ← phi( main::@14/(signed word) y_pos#49 ) + (signed word) x_pos#56 ← phi( main::@14/(signed word) x_pos#49 ) + (word) y_sin_idx#62 ← phi( main::@14/(word) y_sin_idx#55 ) + (word) x_sin_idx#62 ← phi( main::@14/(word) x_sin_idx#55 ) + (byte) x_pos_fine#56 ← phi( main::@14/(byte) x_pos_fine#46 ) + (byte) y_pos_fine#56 ← phi( main::@14/(byte) y_pos_fine#46 ) + (byte) screen#39 ← phi( main::@14/(byte) screen#31 ) + (byte*) main::screen_hidden#16 ← phi( main::@14/(byte*) main::screen_hidden#14 ) + (word) y_pos_coarse#37 ← phi( main::@14/(word) y_pos_coarse#29 ) + (word) x_pos_coarse#41 ← phi( main::@14/(word) x_pos_coarse#33 ) + (signed byte) main::x_movement#9 ← phi( main::@14/(signed byte) main::x_movement#4 ) + (byte*) main::scrn1#1 ← phi( main::@14/(byte*) main::scrn1#2 ) + (byte) main::i1#3 ← phi( main::@14/(byte) main::i1#2 ) + (byte*) main::petscii1#1 ← phi( main::@14/(byte*) main::petscii1#2 ) + *((byte*) main::scrn1#1 + (byte) main::i1#3) ← *((byte*) main::petscii1#1 + (byte) main::i1#3) + (byte) main::i1#1 ← ++ (byte) main::i1#3 + to:main::@14 +main::@16: scope:[main] from main::@13 + (signed word) y_pos#51 ← phi( main::@13/(signed word) y_pos#43 ) + (signed word) x_pos#51 ← phi( main::@13/(signed word) x_pos#43 ) + (word) y_sin_idx#57 ← phi( main::@13/(word) y_sin_idx#49 ) + (word) x_sin_idx#57 ← phi( main::@13/(word) x_sin_idx#49 ) + (byte) x_pos_fine#48 ← phi( main::@13/(byte) x_pos_fine#37 ) + (byte) y_pos_fine#48 ← phi( main::@13/(byte) y_pos_fine#37 ) + (byte) screen#33 ← phi( main::@13/(byte) screen#23 ) + (byte*) main::screen_hidden#7 ← phi( main::@13/(byte*) main::screen_hidden#11 ) + (word) y_pos_coarse#13 ← phi( main::@13/(word) y_pos_coarse#23 ) + (word) x_pos_coarse#14 ← phi( main::@13/(word) x_pos_coarse#27 ) + (number~) main::$38 ← (word) x_pos_coarse#14 + (number) $13 + (number~) main::$39 ← (word) y_pos_coarse#13 - (number) $c + (word) petscii_ptr::row_x#2 ← (number~) main::$38 + (word) petscii_ptr::row_y#2 ← (number~) main::$39 + call petscii_ptr + (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#5 + to:main::@45 +main::@45: scope:[main] from main::@16 + (signed word) y_pos#47 ← phi( main::@16/(signed word) y_pos#51 ) + (signed word) x_pos#47 ← phi( main::@16/(signed word) x_pos#51 ) + (word) y_sin_idx#53 ← phi( main::@16/(word) y_sin_idx#57 ) + (word) x_sin_idx#53 ← phi( main::@16/(word) x_sin_idx#57 ) + (word) y_pos_coarse#66 ← phi( main::@16/(word) y_pos_coarse#13 ) + (word) x_pos_coarse#66 ← phi( main::@16/(word) x_pos_coarse#14 ) + (byte) x_pos_fine#41 ← phi( main::@16/(byte) x_pos_fine#48 ) + (byte) y_pos_fine#41 ← phi( main::@16/(byte) y_pos_fine#48 ) + (byte) screen#27 ← phi( main::@16/(byte) screen#33 ) + (byte*) main::screen_hidden#3 ← phi( main::@16/(byte*) main::screen_hidden#7 ) + (byte*) petscii_ptr::return#8 ← phi( main::@16/(byte*) petscii_ptr::return#2 ) + (byte*~) main::$40 ← (byte*) petscii_ptr::return#8 + (byte*) main::petscii3#0 ← (byte*~) main::$40 + (byte*~) main::$41 ← (byte*) main::screen_hidden#3 + (number) $27 + (byte*) main::scrn3#0 ← (byte*~) main::$41 + (byte) main::i3#0 ← (byte) 0 + to:main::@20 +main::@24: scope:[main] from main::@13 + (signed word) y_pos#42 ← phi( main::@13/(signed word) y_pos#43 ) + (signed word) x_pos#42 ← phi( main::@13/(signed word) x_pos#43 ) + (word) y_sin_idx#48 ← phi( main::@13/(word) y_sin_idx#49 ) + (word) x_sin_idx#48 ← phi( main::@13/(word) x_sin_idx#49 ) + (byte) x_pos_fine#33 ← phi( main::@13/(byte) x_pos_fine#37 ) + (byte) y_pos_fine#33 ← phi( main::@13/(byte) y_pos_fine#37 ) + (byte*) main::screen_hidden#12 ← phi( main::@13/(byte*) main::screen_hidden#11 ) + (byte) screen#17 ← phi( main::@13/(byte) screen#23 ) + (word) y_pos_coarse#24 ← phi( main::@13/(word) y_pos_coarse#23 ) + (word) x_pos_coarse#28 ← phi( main::@13/(word) x_pos_coarse#27 ) + (signed byte) main::x_movement#2 ← phi( main::@13/(signed byte) main::x_movement#1 ) + (bool~) main::$32 ← (signed byte) main::x_movement#2 == (number) 1 + (bool~) main::$33 ← ! (bool~) main::$32 + if((bool~) main::$33) goto main::@19 + to:main::@25 +main::@25: scope:[main] from main::@24 + (signed word) y_pos#52 ← phi( main::@24/(signed word) y_pos#42 ) + (signed word) x_pos#52 ← phi( main::@24/(signed word) x_pos#42 ) + (word) y_sin_idx#58 ← phi( main::@24/(word) y_sin_idx#48 ) + (word) x_sin_idx#58 ← phi( main::@24/(word) x_sin_idx#48 ) + (byte) x_pos_fine#49 ← phi( main::@24/(byte) x_pos_fine#33 ) + (byte) y_pos_fine#49 ← phi( main::@24/(byte) y_pos_fine#33 ) + (byte) screen#34 ← phi( main::@24/(byte) screen#17 ) + (byte*) main::screen_hidden#8 ← phi( main::@24/(byte*) main::screen_hidden#12 ) + (word) y_pos_coarse#14 ← phi( main::@24/(word) y_pos_coarse#24 ) + (word) x_pos_coarse#15 ← phi( main::@24/(word) x_pos_coarse#28 ) + (number~) main::$34 ← (word) x_pos_coarse#15 - (number) $14 + (number~) main::$35 ← (word) y_pos_coarse#14 - (number) $c + (word) petscii_ptr::row_x#3 ← (number~) main::$34 + (word) petscii_ptr::row_y#3 ← (number~) main::$35 + call petscii_ptr + (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#5 + to:main::@46 +main::@46: scope:[main] from main::@25 + (signed word) y_pos#45 ← phi( main::@25/(signed word) y_pos#52 ) + (signed word) x_pos#45 ← phi( main::@25/(signed word) x_pos#52 ) + (word) y_sin_idx#51 ← phi( main::@25/(word) y_sin_idx#58 ) + (word) x_sin_idx#51 ← phi( main::@25/(word) x_sin_idx#58 ) + (word) y_pos_coarse#64 ← phi( main::@25/(word) y_pos_coarse#14 ) + (word) x_pos_coarse#64 ← phi( main::@25/(word) x_pos_coarse#15 ) + (byte) x_pos_fine#39 ← phi( main::@25/(byte) x_pos_fine#49 ) + (byte) y_pos_fine#39 ← phi( main::@25/(byte) y_pos_fine#49 ) + (byte) screen#25 ← phi( main::@25/(byte) screen#34 ) + (byte*) main::screen_hidden#4 ← phi( main::@25/(byte*) main::screen_hidden#8 ) + (byte*) petscii_ptr::return#9 ← phi( main::@25/(byte*) petscii_ptr::return#3 ) + (byte*~) main::$36 ← (byte*) petscii_ptr::return#9 + (byte*) main::petscii2#0 ← (byte*~) main::$36 + (byte*) main::scrn2#0 ← (byte*) main::screen_hidden#4 + (byte) main::i2#0 ← (byte) 0 + to:main::@17 +main::@17: scope:[main] from main::@18 main::@46 + (signed word) y_pos#40 ← phi( main::@18/(signed word) y_pos#44 main::@46/(signed word) y_pos#45 ) + (signed word) x_pos#40 ← phi( main::@18/(signed word) x_pos#44 main::@46/(signed word) x_pos#45 ) + (word) y_sin_idx#46 ← phi( main::@18/(word) y_sin_idx#50 main::@46/(word) y_sin_idx#51 ) + (word) x_sin_idx#46 ← phi( main::@18/(word) x_sin_idx#50 main::@46/(word) x_sin_idx#51 ) + (word) y_pos_coarse#61 ← phi( main::@18/(word) y_pos_coarse#63 main::@46/(word) y_pos_coarse#64 ) + (word) x_pos_coarse#61 ← phi( main::@18/(word) x_pos_coarse#63 main::@46/(word) x_pos_coarse#64 ) + (byte) x_pos_fine#31 ← phi( main::@18/(byte) x_pos_fine#38 main::@46/(byte) x_pos_fine#39 ) + (byte) y_pos_fine#31 ← phi( main::@18/(byte) y_pos_fine#38 main::@46/(byte) y_pos_fine#39 ) + (byte) screen#15 ← phi( main::@18/(byte) screen#24 main::@46/(byte) screen#25 ) + (byte*) main::scrn2#3 ← phi( main::@18/(byte*) main::scrn2#1 main::@46/(byte*) main::scrn2#0 ) + (byte*) main::petscii2#3 ← phi( main::@18/(byte*) main::petscii2#1 main::@46/(byte*) main::petscii2#0 ) + (byte) main::i2#2 ← phi( main::@18/(byte) main::i2#1 main::@46/(byte) main::i2#0 ) + (bool~) main::$37 ← (byte) main::i2#2 < (number) $19 + if((bool~) main::$37) goto main::@18 + to:main::@19 +main::@18: scope:[main] from main::@17 + (signed word) y_pos#44 ← phi( main::@17/(signed word) y_pos#40 ) + (signed word) x_pos#44 ← phi( main::@17/(signed word) x_pos#40 ) + (word) y_sin_idx#50 ← phi( main::@17/(word) y_sin_idx#46 ) + (word) x_sin_idx#50 ← phi( main::@17/(word) x_sin_idx#46 ) + (word) y_pos_coarse#63 ← phi( main::@17/(word) y_pos_coarse#61 ) + (word) x_pos_coarse#63 ← phi( main::@17/(word) x_pos_coarse#61 ) + (byte) x_pos_fine#38 ← phi( main::@17/(byte) x_pos_fine#31 ) + (byte) y_pos_fine#38 ← phi( main::@17/(byte) y_pos_fine#31 ) + (byte) screen#24 ← phi( main::@17/(byte) screen#15 ) + (byte) main::i2#3 ← phi( main::@17/(byte) main::i2#2 ) + (byte*) main::scrn2#2 ← phi( main::@17/(byte*) main::scrn2#3 ) + (byte*) main::petscii2#2 ← phi( main::@17/(byte*) main::petscii2#3 ) + *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) + (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (number) $28 + (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (number) $8c + (byte) main::i2#1 ← ++ (byte) main::i2#3 + to:main::@17 +main::@19: scope:[main] from main::@17 main::@20 main::@24 + (signed word) y_pos#35 ← phi( main::@17/(signed word) y_pos#40 main::@20/(signed word) y_pos#41 main::@24/(signed word) y_pos#42 ) + (signed word) x_pos#35 ← phi( main::@17/(signed word) x_pos#40 main::@20/(signed word) x_pos#41 main::@24/(signed word) x_pos#42 ) + (word) y_sin_idx#41 ← phi( main::@17/(word) y_sin_idx#46 main::@20/(word) y_sin_idx#47 main::@24/(word) y_sin_idx#48 ) + (word) x_sin_idx#41 ← phi( main::@17/(word) x_sin_idx#46 main::@20/(word) x_sin_idx#47 main::@24/(word) x_sin_idx#48 ) + (word) y_pos_coarse#60 ← phi( main::@17/(word) y_pos_coarse#61 main::@20/(word) y_pos_coarse#62 main::@24/(word) y_pos_coarse#24 ) + (word) x_pos_coarse#60 ← phi( main::@17/(word) x_pos_coarse#61 main::@20/(word) x_pos_coarse#62 main::@24/(word) x_pos_coarse#28 ) + (byte) x_pos_fine#23 ← phi( main::@17/(byte) x_pos_fine#31 main::@20/(byte) x_pos_fine#32 main::@24/(byte) x_pos_fine#33 ) + (byte) y_pos_fine#23 ← phi( main::@17/(byte) y_pos_fine#31 main::@20/(byte) y_pos_fine#32 main::@24/(byte) y_pos_fine#33 ) + (byte) screen#7 ← phi( main::@17/(byte) screen#15 main::@20/(byte) screen#16 main::@24/(byte) screen#17 ) + (byte) screen#0 ← (byte) screen#7 ^ (number) 1 + to:main::@26 +main::@20: scope:[main] from main::@21 main::@45 + (signed word) y_pos#41 ← phi( main::@21/(signed word) y_pos#46 main::@45/(signed word) y_pos#47 ) + (signed word) x_pos#41 ← phi( main::@21/(signed word) x_pos#46 main::@45/(signed word) x_pos#47 ) + (word) y_sin_idx#47 ← phi( main::@21/(word) y_sin_idx#52 main::@45/(word) y_sin_idx#53 ) + (word) x_sin_idx#47 ← phi( main::@21/(word) x_sin_idx#52 main::@45/(word) x_sin_idx#53 ) + (word) y_pos_coarse#62 ← phi( main::@21/(word) y_pos_coarse#65 main::@45/(word) y_pos_coarse#66 ) + (word) x_pos_coarse#62 ← phi( main::@21/(word) x_pos_coarse#65 main::@45/(word) x_pos_coarse#66 ) + (byte) x_pos_fine#32 ← phi( main::@21/(byte) x_pos_fine#40 main::@45/(byte) x_pos_fine#41 ) + (byte) y_pos_fine#32 ← phi( main::@21/(byte) y_pos_fine#40 main::@45/(byte) y_pos_fine#41 ) + (byte*) main::scrn3#3 ← phi( main::@21/(byte*) main::scrn3#1 main::@45/(byte*) main::scrn3#0 ) + (byte*) main::petscii3#3 ← phi( main::@21/(byte*) main::petscii3#1 main::@45/(byte*) main::petscii3#0 ) + (byte) screen#16 ← phi( main::@21/(byte) screen#26 main::@45/(byte) screen#27 ) + (byte) main::i3#2 ← phi( main::@21/(byte) main::i3#1 main::@45/(byte) main::i3#0 ) + (bool~) main::$42 ← (byte) main::i3#2 < (number) $19 + if((bool~) main::$42) goto main::@21 + to:main::@19 +main::@21: scope:[main] from main::@20 + (signed word) y_pos#46 ← phi( main::@20/(signed word) y_pos#41 ) + (signed word) x_pos#46 ← phi( main::@20/(signed word) x_pos#41 ) + (word) y_sin_idx#52 ← phi( main::@20/(word) y_sin_idx#47 ) + (word) x_sin_idx#52 ← phi( main::@20/(word) x_sin_idx#47 ) + (word) y_pos_coarse#65 ← phi( main::@20/(word) y_pos_coarse#62 ) + (word) x_pos_coarse#65 ← phi( main::@20/(word) x_pos_coarse#62 ) + (byte) x_pos_fine#40 ← phi( main::@20/(byte) x_pos_fine#32 ) + (byte) y_pos_fine#40 ← phi( main::@20/(byte) y_pos_fine#32 ) + (byte) screen#26 ← phi( main::@20/(byte) screen#16 ) + (byte) main::i3#3 ← phi( main::@20/(byte) main::i3#2 ) + (byte*) main::scrn3#2 ← phi( main::@20/(byte*) main::scrn3#3 ) + (byte*) main::petscii3#2 ← phi( main::@20/(byte*) main::petscii3#3 ) + *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) + (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (number) $28 + (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (number) $8c + (byte) main::i3#1 ← ++ (byte) main::i3#3 + to:main::@20 +main::@26: scope:[main] from main::@19 main::@26 main::@3 + (signed word) y_pos#34 ← phi( main::@19/(signed word) y_pos#35 main::@26/(signed word) y_pos#34 main::@3/(signed word) y_pos#36 ) + (signed word) x_pos#34 ← phi( main::@19/(signed word) x_pos#35 main::@26/(signed word) x_pos#34 main::@3/(signed word) x_pos#36 ) + (word) y_sin_idx#40 ← phi( main::@19/(word) y_sin_idx#41 main::@26/(word) y_sin_idx#40 main::@3/(word) y_sin_idx#42 ) + (word) x_sin_idx#40 ← phi( main::@19/(word) x_sin_idx#41 main::@26/(word) x_sin_idx#40 main::@3/(word) x_sin_idx#42 ) + (word) y_pos_coarse#59 ← phi( main::@19/(word) y_pos_coarse#60 main::@26/(word) y_pos_coarse#59 main::@3/(word) y_pos_coarse#54 ) + (word) x_pos_coarse#59 ← phi( main::@19/(word) x_pos_coarse#60 main::@26/(word) x_pos_coarse#59 main::@3/(word) x_pos_coarse#11 ) + (byte) screen#28 ← phi( main::@19/(byte) screen#0 main::@26/(byte) screen#28 main::@3/(byte) screen#12 ) + (byte) x_pos_fine#21 ← phi( main::@19/(byte) x_pos_fine#23 main::@26/(byte) x_pos_fine#21 main::@3/(byte) x_pos_fine#24 ) + (byte) y_pos_fine#21 ← phi( main::@19/(byte) y_pos_fine#23 main::@26/(byte) y_pos_fine#21 main::@3/(byte) y_pos_fine#24 ) + (bool~) main::$43 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe + if((bool~) main::$43) goto main::@26 + to:main::@27 +main::@27: scope:[main] from main::@26 main::@27 + (signed word) y_pos#33 ← phi( main::@26/(signed word) y_pos#34 main::@27/(signed word) y_pos#33 ) + (signed word) x_pos#33 ← phi( main::@26/(signed word) x_pos#34 main::@27/(signed word) x_pos#33 ) + (word) y_sin_idx#39 ← phi( main::@26/(word) y_sin_idx#40 main::@27/(word) y_sin_idx#39 ) + (word) x_sin_idx#39 ← phi( main::@26/(word) x_sin_idx#40 main::@27/(word) x_sin_idx#39 ) + (word) y_pos_coarse#55 ← phi( main::@26/(word) y_pos_coarse#59 main::@27/(word) y_pos_coarse#55 ) + (word) x_pos_coarse#58 ← phi( main::@26/(word) x_pos_coarse#59 main::@27/(word) x_pos_coarse#58 ) + (byte) screen#18 ← phi( main::@26/(byte) screen#28 main::@27/(byte) screen#18 ) + (byte) x_pos_fine#17 ← phi( main::@26/(byte) x_pos_fine#21 main::@27/(byte) x_pos_fine#17 ) + (byte) y_pos_fine#17 ← phi( main::@26/(byte) y_pos_fine#21 main::@27/(byte) y_pos_fine#17 ) + (bool~) main::$44 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff + if((bool~) main::$44) goto main::@27 + to:main::@28 +main::@28: scope:[main] from main::@27 + (signed word) y_pos#32 ← phi( main::@27/(signed word) y_pos#33 ) + (signed word) x_pos#32 ← phi( main::@27/(signed word) x_pos#33 ) + (word) y_sin_idx#38 ← phi( main::@27/(word) y_sin_idx#39 ) + (word) x_sin_idx#38 ← phi( main::@27/(word) x_sin_idx#39 ) + (word) y_pos_coarse#52 ← phi( main::@27/(word) y_pos_coarse#55 ) + (word) x_pos_coarse#56 ← phi( main::@27/(word) x_pos_coarse#58 ) + (byte) screen#8 ← phi( main::@27/(byte) screen#18 ) + (byte) x_pos_fine#10 ← phi( main::@27/(byte) x_pos_fine#17 ) + (byte) y_pos_fine#10 ← phi( main::@27/(byte) y_pos_fine#17 ) + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE + (number~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $f0 + (number~) main::$46 ← (number) 7 - (byte) y_pos_fine#10 + (number~) main::$47 ← (number~) main::$45 | (number~) main::$46 + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (number~) main::$47 + (number~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (number) $f0 + (number~) main::$49 ← (number) 7 - (byte) x_pos_fine#10 + (number~) main::$50 ← (number~) main::$48 | (number~) main::$49 + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (number~) main::$50 + (bool~) main::$55 ← (number) 0 != (byte) screen#8 + if((bool~) main::$55) goto main::@30 + to:main::@29 +main::@30: scope:[main] from main::@28 + (byte) screen#58 ← phi( main::@28/(byte) screen#8 ) + (byte) y_pos_fine#50 ← phi( main::@28/(byte) y_pos_fine#10 ) + (byte) x_pos_fine#50 ← phi( main::@28/(byte) x_pos_fine#10 ) + (signed word) y_pos#29 ← phi( main::@28/(signed word) y_pos#32 ) + (signed word) x_pos#29 ← phi( main::@28/(signed word) x_pos#32 ) + (word) y_sin_idx#35 ← phi( main::@28/(word) y_sin_idx#38 ) + (word) x_sin_idx#35 ← phi( main::@28/(word) x_sin_idx#38 ) + (word) y_pos_coarse#48 ← phi( main::@28/(word) y_pos_coarse#52 ) + (word) x_pos_coarse#52 ← phi( main::@28/(word) x_pos_coarse#56 ) + (byte*) main::toD0182_screen#0 ← (const nomodify byte*) MAIN_SCREEN1 + (byte*) main::toD0182_gfx#0 ← (const nomodify byte*) MAIN_CHARSET + to:main::toD0182 +main::toD0182: scope:[main] from main::@30 + (byte) screen#55 ← phi( main::@30/(byte) screen#58 ) + (byte) y_pos_fine#42 ← phi( main::@30/(byte) y_pos_fine#50 ) + (byte) x_pos_fine#42 ← phi( main::@30/(byte) x_pos_fine#50 ) + (signed word) y_pos#26 ← phi( main::@30/(signed word) y_pos#29 ) + (signed word) x_pos#26 ← phi( main::@30/(signed word) x_pos#29 ) + (word) y_sin_idx#32 ← phi( main::@30/(word) y_sin_idx#35 ) + (word) x_sin_idx#32 ← phi( main::@30/(word) x_sin_idx#35 ) + (word) y_pos_coarse#43 ← phi( main::@30/(word) y_pos_coarse#48 ) + (word) x_pos_coarse#47 ← phi( main::@30/(word) x_pos_coarse#52 ) + (byte*) main::toD0182_gfx#1 ← phi( main::@30/(byte*) main::toD0182_gfx#0 ) + (byte*) main::toD0182_screen#1 ← phi( main::@30/(byte*) main::toD0182_screen#0 ) + (word~) main::toD0182_$7 ← (word)(byte*) main::toD0182_screen#1 + (number~) main::toD0182_$0 ← (word~) main::toD0182_$7 & (number) $3fff + (number~) main::toD0182_$1 ← (number~) main::toD0182_$0 * (number) 4 + (number~) main::toD0182_$2 ← > (number~) main::toD0182_$1 + (byte~) main::toD0182_$3 ← > (word)(byte*) main::toD0182_gfx#1 + (number~) main::toD0182_$4 ← (byte~) main::toD0182_$3 / (number) 4 + (number~) main::toD0182_$5 ← (number~) main::toD0182_$4 & (number) $f + (number~) main::toD0182_$6 ← (number~) main::toD0182_$2 | (number~) main::toD0182_$5 + (byte) main::toD0182_return#0 ← (number~) main::toD0182_$6 + to:main::toD0182_@return +main::toD0182_@return: scope:[main] from main::toD0182 + (byte) screen#52 ← phi( main::toD0182/(byte) screen#55 ) + (byte) y_pos_fine#34 ← phi( main::toD0182/(byte) y_pos_fine#42 ) + (byte) x_pos_fine#34 ← phi( main::toD0182/(byte) x_pos_fine#42 ) + (signed word) y_pos#23 ← phi( main::toD0182/(signed word) y_pos#26 ) + (signed word) x_pos#23 ← phi( main::toD0182/(signed word) x_pos#26 ) + (word) y_sin_idx#29 ← phi( main::toD0182/(word) y_sin_idx#32 ) + (word) x_sin_idx#29 ← phi( main::toD0182/(word) x_sin_idx#32 ) + (word) y_pos_coarse#39 ← phi( main::toD0182/(word) y_pos_coarse#43 ) + (word) x_pos_coarse#43 ← phi( main::toD0182/(word) x_pos_coarse#47 ) + (byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 ) + (byte) main::toD0182_return#1 ← (byte) main::toD0182_return#2 + to:main::@37 +main::@37: scope:[main] from main::toD0182_@return + (byte) screen#49 ← phi( main::toD0182_@return/(byte) screen#52 ) + (byte) y_pos_fine#25 ← phi( main::toD0182_@return/(byte) y_pos_fine#34 ) + (byte) x_pos_fine#25 ← phi( main::toD0182_@return/(byte) x_pos_fine#34 ) + (signed word) y_pos#20 ← phi( main::toD0182_@return/(signed word) y_pos#23 ) + (signed word) x_pos#20 ← phi( main::toD0182_@return/(signed word) x_pos#23 ) + (word) y_sin_idx#26 ← phi( main::toD0182_@return/(word) y_sin_idx#29 ) + (word) x_sin_idx#26 ← phi( main::toD0182_@return/(word) x_sin_idx#29 ) + (word) y_pos_coarse#30 ← phi( main::toD0182_@return/(word) y_pos_coarse#39 ) + (word) x_pos_coarse#34 ← phi( main::toD0182_@return/(word) x_pos_coarse#43 ) + (byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 ) + (byte~) main::$52 ← (byte) main::toD0182_return#3 + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (byte~) main::$52 + to:main::@31 +main::@29: scope:[main] from main::@28 + (byte) screen#59 ← phi( main::@28/(byte) screen#8 ) + (byte) y_pos_fine#51 ← phi( main::@28/(byte) y_pos_fine#10 ) + (byte) x_pos_fine#51 ← phi( main::@28/(byte) x_pos_fine#10 ) + (signed word) y_pos#30 ← phi( main::@28/(signed word) y_pos#32 ) + (signed word) x_pos#30 ← phi( main::@28/(signed word) x_pos#32 ) + (word) y_sin_idx#36 ← phi( main::@28/(word) y_sin_idx#38 ) + (word) x_sin_idx#36 ← phi( main::@28/(word) x_sin_idx#38 ) + (word) y_pos_coarse#49 ← phi( main::@28/(word) y_pos_coarse#52 ) + (word) x_pos_coarse#53 ← phi( main::@28/(word) x_pos_coarse#56 ) + (byte*) main::toD0183_screen#0 ← (const nomodify byte*) MAIN_SCREEN0 + (byte*) main::toD0183_gfx#0 ← (const nomodify byte*) MAIN_CHARSET + to:main::toD0183 +main::toD0183: scope:[main] from main::@29 + (byte) screen#56 ← phi( main::@29/(byte) screen#59 ) + (byte) y_pos_fine#43 ← phi( main::@29/(byte) y_pos_fine#51 ) + (byte) x_pos_fine#43 ← phi( main::@29/(byte) x_pos_fine#51 ) + (signed word) y_pos#27 ← phi( main::@29/(signed word) y_pos#30 ) + (signed word) x_pos#27 ← phi( main::@29/(signed word) x_pos#30 ) + (word) y_sin_idx#33 ← phi( main::@29/(word) y_sin_idx#36 ) + (word) x_sin_idx#33 ← phi( main::@29/(word) x_sin_idx#36 ) + (word) y_pos_coarse#44 ← phi( main::@29/(word) y_pos_coarse#49 ) + (word) x_pos_coarse#48 ← phi( main::@29/(word) x_pos_coarse#53 ) + (byte*) main::toD0183_gfx#1 ← phi( main::@29/(byte*) main::toD0183_gfx#0 ) + (byte*) main::toD0183_screen#1 ← phi( main::@29/(byte*) main::toD0183_screen#0 ) + (word~) main::toD0183_$7 ← (word)(byte*) main::toD0183_screen#1 + (number~) main::toD0183_$0 ← (word~) main::toD0183_$7 & (number) $3fff + (number~) main::toD0183_$1 ← (number~) main::toD0183_$0 * (number) 4 + (number~) main::toD0183_$2 ← > (number~) main::toD0183_$1 + (byte~) main::toD0183_$3 ← > (word)(byte*) main::toD0183_gfx#1 + (number~) main::toD0183_$4 ← (byte~) main::toD0183_$3 / (number) 4 + (number~) main::toD0183_$5 ← (number~) main::toD0183_$4 & (number) $f + (number~) main::toD0183_$6 ← (number~) main::toD0183_$2 | (number~) main::toD0183_$5 + (byte) main::toD0183_return#0 ← (number~) main::toD0183_$6 + to:main::toD0183_@return +main::toD0183_@return: scope:[main] from main::toD0183 + (byte) screen#53 ← phi( main::toD0183/(byte) screen#56 ) + (byte) y_pos_fine#35 ← phi( main::toD0183/(byte) y_pos_fine#43 ) + (byte) x_pos_fine#35 ← phi( main::toD0183/(byte) x_pos_fine#43 ) + (signed word) y_pos#24 ← phi( main::toD0183/(signed word) y_pos#27 ) + (signed word) x_pos#24 ← phi( main::toD0183/(signed word) x_pos#27 ) + (word) y_sin_idx#30 ← phi( main::toD0183/(word) y_sin_idx#33 ) + (word) x_sin_idx#30 ← phi( main::toD0183/(word) x_sin_idx#33 ) + (word) y_pos_coarse#40 ← phi( main::toD0183/(word) y_pos_coarse#44 ) + (word) x_pos_coarse#44 ← phi( main::toD0183/(word) x_pos_coarse#48 ) + (byte) main::toD0183_return#2 ← phi( main::toD0183/(byte) main::toD0183_return#0 ) + (byte) main::toD0183_return#1 ← (byte) main::toD0183_return#2 + to:main::@38 +main::@38: scope:[main] from main::toD0183_@return + (byte) screen#50 ← phi( main::toD0183_@return/(byte) screen#53 ) + (byte) y_pos_fine#26 ← phi( main::toD0183_@return/(byte) y_pos_fine#35 ) + (byte) x_pos_fine#26 ← phi( main::toD0183_@return/(byte) x_pos_fine#35 ) + (signed word) y_pos#21 ← phi( main::toD0183_@return/(signed word) y_pos#24 ) + (signed word) x_pos#21 ← phi( main::toD0183_@return/(signed word) x_pos#24 ) + (word) y_sin_idx#27 ← phi( main::toD0183_@return/(word) y_sin_idx#30 ) + (word) x_sin_idx#27 ← phi( main::toD0183_@return/(word) x_sin_idx#30 ) + (word) y_pos_coarse#31 ← phi( main::toD0183_@return/(word) y_pos_coarse#40 ) + (word) x_pos_coarse#35 ← phi( main::toD0183_@return/(word) x_pos_coarse#44 ) + (byte) main::toD0183_return#3 ← phi( main::toD0183_@return/(byte) main::toD0183_return#1 ) + (byte~) main::$51 ← (byte) main::toD0183_return#3 + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (byte~) main::$51 + to:main::@31 +main::@31: scope:[main] from main::@37 main::@38 + (byte) screen#41 ← phi( main::@37/(byte) screen#49 main::@38/(byte) screen#50 ) + (byte) y_pos_fine#20 ← phi( main::@37/(byte) y_pos_fine#25 main::@38/(byte) y_pos_fine#26 ) + (byte) x_pos_fine#20 ← phi( main::@37/(byte) x_pos_fine#25 main::@38/(byte) x_pos_fine#26 ) + (signed word) y_pos#18 ← phi( main::@37/(signed word) y_pos#20 main::@38/(signed word) y_pos#21 ) + (signed word) x_pos#18 ← phi( main::@37/(signed word) x_pos#20 main::@38/(signed word) x_pos#21 ) + (word) y_sin_idx#24 ← phi( main::@37/(word) y_sin_idx#26 main::@38/(word) y_sin_idx#27 ) + (word) x_sin_idx#24 ← phi( main::@37/(word) x_sin_idx#26 main::@38/(word) x_sin_idx#27 ) + (word) y_pos_coarse#20 ← phi( main::@37/(word) y_pos_coarse#30 main::@38/(word) y_pos_coarse#31 ) + (word) x_pos_coarse#21 ← phi( main::@37/(word) x_pos_coarse#34 main::@38/(word) x_pos_coarse#35 ) + *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK + to:main::@1 +main::@return: scope:[main] from + (byte) screen#9 ← phi( ) + (word) y_pos_coarse#15 ← phi( ) + (byte) y_pos_fine#11 ← phi( ) + (word) x_pos_coarse#16 ← phi( ) + (byte) x_pos_fine#11 ← phi( ) + (signed word) y_pos#10 ← phi( ) + (signed word) x_pos#10 ← phi( ) + (word) y_sin_idx#11 ← phi( ) + (word) x_sin_idx#11 ← phi( ) + (word) x_sin_idx#2 ← (word) x_sin_idx#11 + (word) y_sin_idx#2 ← (word) y_sin_idx#11 + (signed word) x_pos#2 ← (signed word) x_pos#10 + (signed word) y_pos#2 ← (signed word) y_pos#10 + (byte) x_pos_fine#2 ← (byte) x_pos_fine#11 + (word) x_pos_coarse#2 ← (word) x_pos_coarse#16 + (byte) y_pos_fine#2 ← (byte) y_pos_fine#11 + (word) y_pos_coarse#2 ← (word) y_pos_coarse#15 + (byte) screen#1 ← (byte) screen#9 + return + to:@return + +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +petscii_ptr: scope:[petscii_ptr] from main::@10 main::@16 main::@23 main::@25 + (word) petscii_ptr::row_x#4 ← phi( main::@10/(word) petscii_ptr::row_x#0 main::@16/(word) petscii_ptr::row_x#2 main::@23/(word) petscii_ptr::row_x#1 main::@25/(word) petscii_ptr::row_x#3 ) + (word) petscii_ptr::row_y#4 ← phi( main::@10/(word) petscii_ptr::row_y#0 main::@16/(word) petscii_ptr::row_y#2 main::@23/(word) petscii_ptr::row_y#1 main::@25/(word) petscii_ptr::row_y#3 ) + (number~) petscii_ptr::$0 ← (word) petscii_ptr::row_y#4 * (number) $8c + (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (number~) petscii_ptr::$0 + (byte*~) petscii_ptr::$2 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 + (byte*) petscii_ptr::return#4 ← (byte*~) petscii_ptr::$2 + to:petscii_ptr::@return +petscii_ptr::@return: scope:[petscii_ptr] from petscii_ptr + (byte*) petscii_ptr::return#10 ← phi( petscii_ptr/(byte*) petscii_ptr::return#4 ) + (byte*) petscii_ptr::return#5 ← (byte*) petscii_ptr::return#10 + return + to:@return + +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +screencpy: scope:[screencpy] from main::@9 + (byte*) screencpy::dst#1 ← phi( main::@9/(byte*) screencpy::dst#0 ) + (byte*) screencpy::src#1 ← phi( main::@9/(byte*) screencpy::src#0 ) + (byte*~) screencpy::$0 ← (byte*) screencpy::src#1 + (number) $fa + (byte*) screencpy::src_250#0 ← (byte*~) screencpy::$0 + (byte*~) screencpy::$1 ← (byte*) screencpy::dst#1 + (number) $fa + (byte*) screencpy::dst_250#0 ← (byte*~) screencpy::$1 + (byte*~) screencpy::$2 ← (byte*) screencpy::src#1 + (number) $1f4 + (byte*) screencpy::src_500#0 ← (byte*~) screencpy::$2 + (byte*~) screencpy::$3 ← (byte*) screencpy::dst#1 + (number) $1f4 + (byte*) screencpy::dst_500#0 ← (byte*~) screencpy::$3 + (byte*~) screencpy::$4 ← (byte*) screencpy::src#1 + (number) $2ee + (byte*) screencpy::src_750#0 ← (byte*~) screencpy::$4 + (byte*~) screencpy::$5 ← (byte*) screencpy::dst#1 + (number) $2ee + (byte*) screencpy::dst_750#0 ← (byte*~) screencpy::$5 + (byte) screencpy::i#0 ← (byte) 0 + to:screencpy::@1 +screencpy::@1: scope:[screencpy] from screencpy screencpy::@2 + (byte*) screencpy::dst_750#2 ← phi( screencpy/(byte*) screencpy::dst_750#0 screencpy::@2/(byte*) screencpy::dst_750#1 ) + (byte*) screencpy::src_750#2 ← phi( screencpy/(byte*) screencpy::src_750#0 screencpy::@2/(byte*) screencpy::src_750#1 ) + (byte*) screencpy::dst_500#2 ← phi( screencpy/(byte*) screencpy::dst_500#0 screencpy::@2/(byte*) screencpy::dst_500#1 ) + (byte*) screencpy::src_500#2 ← phi( screencpy/(byte*) screencpy::src_500#0 screencpy::@2/(byte*) screencpy::src_500#1 ) + (byte*) screencpy::dst_250#2 ← phi( screencpy/(byte*) screencpy::dst_250#0 screencpy::@2/(byte*) screencpy::dst_250#1 ) + (byte*) screencpy::src_250#2 ← phi( screencpy/(byte*) screencpy::src_250#0 screencpy::@2/(byte*) screencpy::src_250#1 ) + (byte*) screencpy::dst#3 ← phi( screencpy/(byte*) screencpy::dst#1 screencpy::@2/(byte*) screencpy::dst#2 ) + (byte*) screencpy::src#3 ← phi( screencpy/(byte*) screencpy::src#1 screencpy::@2/(byte*) screencpy::src#2 ) + (byte) screencpy::i#2 ← phi( screencpy/(byte) screencpy::i#0 screencpy::@2/(byte) screencpy::i#1 ) + (bool~) screencpy::$6 ← (byte) screencpy::i#2 < (number) $fa + if((bool~) screencpy::$6) goto screencpy::@2 + to:screencpy::@return +screencpy::@2: scope:[screencpy] from screencpy::@1 + (byte*) screencpy::dst_750#1 ← phi( screencpy::@1/(byte*) screencpy::dst_750#2 ) + (byte*) screencpy::src_750#1 ← phi( screencpy::@1/(byte*) screencpy::src_750#2 ) + (byte*) screencpy::dst_500#1 ← phi( screencpy::@1/(byte*) screencpy::dst_500#2 ) + (byte*) screencpy::src_500#1 ← phi( screencpy::@1/(byte*) screencpy::src_500#2 ) + (byte*) screencpy::dst_250#1 ← phi( screencpy::@1/(byte*) screencpy::dst_250#2 ) + (byte*) screencpy::src_250#1 ← phi( screencpy::@1/(byte*) screencpy::src_250#2 ) + (byte*) screencpy::dst#2 ← phi( screencpy::@1/(byte*) screencpy::dst#3 ) + (byte) screencpy::i#3 ← phi( screencpy::@1/(byte) screencpy::i#2 ) + (byte*) screencpy::src#2 ← phi( screencpy::@1/(byte*) screencpy::src#3 ) + *((byte*) screencpy::dst#2 + (byte) screencpy::i#3) ← *((byte*) screencpy::src#2 + (byte) screencpy::i#3) + *((byte*) screencpy::dst_250#1 + (byte) screencpy::i#3) ← *((byte*) screencpy::src_250#1 + (byte) screencpy::i#3) + *((byte*) screencpy::dst_500#1 + (byte) screencpy::i#3) ← *((byte*) screencpy::src_500#1 + (byte) screencpy::i#3) + *((byte*) screencpy::dst_750#1 + (byte) screencpy::i#3) ← *((byte*) screencpy::src_750#1 + (byte) screencpy::i#3) + (byte) screencpy::i#1 ← ++ (byte) screencpy::i#3 + to:screencpy::@1 +screencpy::@return: scope:[screencpy] from screencpy::@1 + return + to:@return + +(void()) next_position() +next_position: scope:[next_position] from main::@1 main::@36 + (word) y_sin_idx#20 ← phi( main::@1/(word) y_sin_idx#19 main::@36/(word) y_sin_idx#18 ) + (word) x_sin_idx#12 ← phi( main::@1/(word) x_sin_idx#19 main::@36/(word) x_sin_idx#18 ) + (word) x_sin_idx#3 ← ++ (word) x_sin_idx#12 + (bool~) next_position::$0 ← (word) x_sin_idx#3 >= (const nomodify word) SINSIZE + (bool~) next_position::$1 ← ! (bool~) next_position::$0 + if((bool~) next_position::$1) goto next_position::@1 + to:next_position::@3 +next_position::@1: scope:[next_position] from next_position next_position::@3 + (word) x_sin_idx#20 ← phi( next_position/(word) x_sin_idx#3 next_position::@3/(word) x_sin_idx#4 ) + (word) y_sin_idx#12 ← phi( next_position/(word) y_sin_idx#20 next_position::@3/(word) y_sin_idx#21 ) + (word) y_sin_idx#3 ← ++ (word) y_sin_idx#12 + (bool~) next_position::$2 ← (word) y_sin_idx#3 >= (const nomodify word) SINSIZE + (bool~) next_position::$3 ← ! (bool~) next_position::$2 + if((bool~) next_position::$3) goto next_position::@2 + to:next_position::@4 +next_position::@3: scope:[next_position] from next_position + (word) y_sin_idx#21 ← phi( next_position/(word) y_sin_idx#20 ) + (word) x_sin_idx#13 ← phi( next_position/(word) x_sin_idx#3 ) + (word) x_sin_idx#4 ← (word) x_sin_idx#13 - (const nomodify word) SINSIZE + to:next_position::@1 +next_position::@2: scope:[next_position] from next_position::@1 next_position::@4 + (word) y_sin_idx#13 ← phi( next_position::@1/(word) y_sin_idx#3 next_position::@4/(word) y_sin_idx#4 ) + (word) x_sin_idx#14 ← phi( next_position::@1/(word) x_sin_idx#20 next_position::@4/(word) x_sin_idx#21 ) + (word~) next_position::$12 ← (word) x_sin_idx#14 * (const byte) SIZEOF_SIGNED_WORD + (signed word) x_pos#3 ← *((const signed word*) SINTAB + (word~) next_position::$12) + (word~) next_position::$13 ← (word) y_sin_idx#13 * (const byte) SIZEOF_SIGNED_WORD + (signed word) y_pos#3 ← *((const signed word*) SINTAB + (word~) next_position::$13) + (word~) next_position::$14 ← (word)(signed word) x_pos#3 + (number~) next_position::$4 ← (word~) next_position::$14 + (number) $190 + (number~) next_position::$5 ← (number~) next_position::$4 + (number) $14*(number) 8 + (word) next_position::x_pos_u#0 ← (number~) next_position::$5 + (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 + (number~) next_position::$6 ← (byte~) next_position::$15 & (number) 7 + (byte) x_pos_fine#3 ← (number~) next_position::$6 + (number~) next_position::$7 ← (word) next_position::x_pos_u#0 / (number) 8 + (word) x_pos_coarse#3 ← (number~) next_position::$7 + (word~) next_position::$16 ← (word)(signed word) y_pos#3 + (number~) next_position::$8 ← (word~) next_position::$16 + (number) $190 + (number~) next_position::$9 ← (number~) next_position::$8 + (number) $c*(number) 8 + (word) next_position::y_pos_u#0 ← (number~) next_position::$9 + (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 + (number~) next_position::$10 ← (byte~) next_position::$17 & (number) 7 + (byte) y_pos_fine#3 ← (number~) next_position::$10 + (number~) next_position::$11 ← (word) next_position::y_pos_u#0 / (number) 8 + (word) y_pos_coarse#3 ← (number~) next_position::$11 + to:next_position::@return +next_position::@4: scope:[next_position] from next_position::@1 + (word) x_sin_idx#21 ← phi( next_position::@1/(word) x_sin_idx#20 ) + (word) y_sin_idx#14 ← phi( next_position::@1/(word) y_sin_idx#3 ) + (word) y_sin_idx#4 ← (word) y_sin_idx#14 - (const nomodify word) SINSIZE + to:next_position::@2 +next_position::@return: scope:[next_position] from next_position::@2 + (word) y_pos_coarse#16 ← phi( next_position::@2/(word) y_pos_coarse#3 ) + (byte) y_pos_fine#12 ← phi( next_position::@2/(byte) y_pos_fine#3 ) + (word) x_pos_coarse#17 ← phi( next_position::@2/(word) x_pos_coarse#3 ) + (byte) x_pos_fine#12 ← phi( next_position::@2/(byte) x_pos_fine#3 ) + (signed word) y_pos#11 ← phi( next_position::@2/(signed word) y_pos#3 ) + (signed word) x_pos#11 ← phi( next_position::@2/(signed word) x_pos#3 ) + (word) y_sin_idx#15 ← phi( next_position::@2/(word) y_sin_idx#13 ) + (word) x_sin_idx#15 ← phi( next_position::@2/(word) x_sin_idx#14 ) + (word) x_sin_idx#5 ← (word) x_sin_idx#15 + (word) y_sin_idx#5 ← (word) y_sin_idx#15 + (signed word) x_pos#4 ← (signed word) x_pos#11 + (signed word) y_pos#4 ← (signed word) y_pos#11 + (byte) x_pos_fine#4 ← (byte) x_pos_fine#12 + (word) x_pos_coarse#4 ← (word) x_pos_coarse#17 + (byte) y_pos_fine#4 ← (byte) y_pos_fine#12 + (word) y_pos_coarse#4 ← (word) y_pos_coarse#16 + return + to:@return + +(void()) __start() +__start: scope:[__start] from + to:__start::__init1 +__start::__init1: scope:[__start] from __start + (word) x_sin_idx#6 ← (word) 0 + (word) y_sin_idx#6 ← (word)(const nomodify word) SINSIZE/(number) 4 + (signed word) x_pos#5 ← (signed word) 0 + (signed word) y_pos#5 ← (signed word) 0 + (byte) x_pos_fine#5 ← (byte) 0 + (byte) y_pos_fine#5 ← (byte) 0 + (word) x_pos_coarse#5 ← (word) 0 + (word) y_pos_coarse#5 ← (word) 0 + (byte) screen#2 ← (byte) 0 + to:__start::@1 +__start::@1: scope:[__start] from __start::__init1 + (byte) screen#19 ← phi( __start::__init1/(byte) screen#2 ) + (word) y_pos_coarse#25 ← phi( __start::__init1/(word) y_pos_coarse#5 ) + (byte) y_pos_fine#18 ← phi( __start::__init1/(byte) y_pos_fine#5 ) + (word) x_pos_coarse#29 ← phi( __start::__init1/(word) x_pos_coarse#5 ) + (byte) x_pos_fine#18 ← phi( __start::__init1/(byte) x_pos_fine#5 ) + (signed word) y_pos#16 ← phi( __start::__init1/(signed word) y_pos#5 ) + (signed word) x_pos#16 ← phi( __start::__init1/(signed word) x_pos#5 ) + (word) y_sin_idx#22 ← phi( __start::__init1/(word) y_sin_idx#6 ) + (word) x_sin_idx#22 ← phi( __start::__init1/(word) x_sin_idx#6 ) + call main + to:__start::@2 +__start::@2: scope:[__start] from __start::@1 + (byte) screen#10 ← phi( __start::@1/(byte) screen#1 ) + (word) y_pos_coarse#17 ← phi( __start::@1/(word) y_pos_coarse#2 ) + (byte) y_pos_fine#13 ← phi( __start::@1/(byte) y_pos_fine#2 ) + (word) x_pos_coarse#18 ← phi( __start::@1/(word) x_pos_coarse#2 ) + (byte) x_pos_fine#13 ← phi( __start::@1/(byte) x_pos_fine#2 ) + (signed word) y_pos#12 ← phi( __start::@1/(signed word) y_pos#2 ) + (signed word) x_pos#12 ← phi( __start::@1/(signed word) x_pos#2 ) + (word) y_sin_idx#16 ← phi( __start::@1/(word) y_sin_idx#2 ) + (word) x_sin_idx#16 ← phi( __start::@1/(word) x_sin_idx#2 ) + (word) x_sin_idx#7 ← (word) x_sin_idx#16 + (word) y_sin_idx#7 ← (word) y_sin_idx#16 + (signed word) x_pos#6 ← (signed word) x_pos#12 + (signed word) y_pos#6 ← (signed word) y_pos#12 + (byte) x_pos_fine#6 ← (byte) x_pos_fine#13 + (word) x_pos_coarse#6 ← (word) x_pos_coarse#18 + (byte) y_pos_fine#6 ← (byte) y_pos_fine#13 + (word) y_pos_coarse#6 ← (word) y_pos_coarse#17 + (byte) screen#3 ← (byte) screen#10 + to:__start::@return +__start::@return: scope:[__start] from __start::@2 + (byte) screen#11 ← phi( __start::@2/(byte) screen#3 ) + (word) y_pos_coarse#18 ← phi( __start::@2/(word) y_pos_coarse#6 ) + (word) x_pos_coarse#19 ← phi( __start::@2/(word) x_pos_coarse#6 ) + (byte) y_pos_fine#14 ← phi( __start::@2/(byte) y_pos_fine#6 ) + (byte) x_pos_fine#14 ← phi( __start::@2/(byte) x_pos_fine#6 ) + (signed word) y_pos#13 ← phi( __start::@2/(signed word) y_pos#6 ) + (signed word) x_pos#13 ← phi( __start::@2/(signed word) x_pos#6 ) + (word) y_sin_idx#17 ← phi( __start::@2/(word) y_sin_idx#7 ) + (word) x_sin_idx#17 ← phi( __start::@2/(word) x_sin_idx#7 ) + (word) x_sin_idx#8 ← (word) x_sin_idx#17 + (word) y_sin_idx#8 ← (word) y_sin_idx#17 + (signed word) x_pos#7 ← (signed word) x_pos#13 + (signed word) y_pos#7 ← (signed word) y_pos#13 + (byte) x_pos_fine#7 ← (byte) x_pos_fine#14 + (byte) y_pos_fine#7 ← (byte) y_pos_fine#14 + (word) x_pos_coarse#7 ← (word) x_pos_coarse#19 + (word) y_pos_coarse#7 ← (word) y_pos_coarse#18 + (byte) screen#4 ← (byte) screen#11 + return + to:@return + +SYMBOL TABLE SSA +(const nomodify byte) BLACK = (byte) 0 +(const nomodify byte*) MAIN_CHARSET = (byte*)(number) $1000 +(const nomodify byte*) MAIN_SCREEN0 = (byte*)(number) $3800 +(const nomodify byte*) MAIN_SCREEN1 = (byte*)(number) $3c00 +(byte) MOS6526_CIA::INTERRUPT +(byte) MOS6526_CIA::PORT_A +(byte) MOS6526_CIA::PORT_A_DDR +(byte) MOS6526_CIA::PORT_B +(byte) MOS6526_CIA::PORT_B_DDR +(byte) MOS6526_CIA::SERIAL_DATA +(word) MOS6526_CIA::TIMER_A +(byte) MOS6526_CIA::TIMER_A_CONTROL +(word) MOS6526_CIA::TIMER_B +(byte) MOS6526_CIA::TIMER_B_CONTROL +(byte) MOS6526_CIA::TOD_10THS +(byte) MOS6526_CIA::TOD_HOURS +(byte) MOS6526_CIA::TOD_MIN +(byte) MOS6526_CIA::TOD_SEC +(byte) MOS6569_VICII::BG_COLOR +(byte) MOS6569_VICII::BG_COLOR1 +(byte) MOS6569_VICII::BG_COLOR2 +(byte) MOS6569_VICII::BG_COLOR3 +(byte) MOS6569_VICII::BORDER_COLOR +(byte) MOS6569_VICII::CONTROL1 +(byte) MOS6569_VICII::CONTROL2 +(byte) MOS6569_VICII::IRQ_ENABLE +(byte) MOS6569_VICII::IRQ_STATUS +(byte) MOS6569_VICII::LIGHTPEN_X +(byte) MOS6569_VICII::LIGHTPEN_Y +(byte) MOS6569_VICII::MEMORY +(byte) MOS6569_VICII::RASTER +(byte) MOS6569_VICII::SPRITE0_COLOR +(byte) MOS6569_VICII::SPRITE0_X +(byte) MOS6569_VICII::SPRITE0_Y +(byte) MOS6569_VICII::SPRITE1_COLOR +(byte) MOS6569_VICII::SPRITE1_X +(byte) MOS6569_VICII::SPRITE1_Y +(byte) MOS6569_VICII::SPRITE2_COLOR +(byte) MOS6569_VICII::SPRITE2_X +(byte) MOS6569_VICII::SPRITE2_Y +(byte) MOS6569_VICII::SPRITE3_COLOR +(byte) MOS6569_VICII::SPRITE3_X +(byte) MOS6569_VICII::SPRITE3_Y +(byte) MOS6569_VICII::SPRITE4_COLOR +(byte) MOS6569_VICII::SPRITE4_X +(byte) MOS6569_VICII::SPRITE4_Y +(byte) MOS6569_VICII::SPRITE5_COLOR +(byte) MOS6569_VICII::SPRITE5_X +(byte) MOS6569_VICII::SPRITE5_Y +(byte) MOS6569_VICII::SPRITE6_COLOR +(byte) MOS6569_VICII::SPRITE6_X +(byte) MOS6569_VICII::SPRITE6_Y +(byte) MOS6569_VICII::SPRITE7_COLOR +(byte) MOS6569_VICII::SPRITE7_X +(byte) MOS6569_VICII::SPRITE7_Y +(byte) MOS6569_VICII::SPRITES_BG_COLLISION +(byte) MOS6569_VICII::SPRITES_COLLISION +(byte) MOS6569_VICII::SPRITES_ENABLE +(byte) MOS6569_VICII::SPRITES_EXPAND_X +(byte) MOS6569_VICII::SPRITES_EXPAND_Y +(byte) MOS6569_VICII::SPRITES_MC +(byte) MOS6569_VICII::SPRITES_MCOLOR1 +(byte) MOS6569_VICII::SPRITES_MCOLOR2 +(byte) MOS6569_VICII::SPRITES_PRIORITY +(byte) MOS6569_VICII::SPRITES_XMSB +(byte) MOS6581_SID::CH1_ATTACK_DECAY +(byte) MOS6581_SID::CH1_CONTROL +(word) MOS6581_SID::CH1_FREQ +(word) MOS6581_SID::CH1_PULSE_WIDTH +(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH2_ATTACK_DECAY +(byte) MOS6581_SID::CH2_CONTROL +(word) MOS6581_SID::CH2_FREQ +(word) MOS6581_SID::CH2_PULSE_WIDTH +(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH3_ATTACK_DECAY +(byte) MOS6581_SID::CH3_CONTROL +(byte) MOS6581_SID::CH3_ENV +(word) MOS6581_SID::CH3_FREQ +(byte) MOS6581_SID::CH3_OSC +(word) MOS6581_SID::CH3_PULSE_WIDTH +(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE +(byte) MOS6581_SID::FILTER_CUTOFF_HIGH +(byte) MOS6581_SID::FILTER_CUTOFF_LOW +(byte) MOS6581_SID::FILTER_SETUP +(byte) MOS6581_SID::POT_X +(byte) MOS6581_SID::POT_Y +(byte) MOS6581_SID::VOLUME_FILTER_MODE +(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20 +(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11 +(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16 +(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY = (byte) $18 +(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12 +(const byte*) PETSCII_ART[(number) $8c*(number) $7d] = kickasm {{ .var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y (number) 0 +Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8 +Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$0 ← (word~) main::toD0181_$7 & (number) $3fff +Adding number conversion cast (unumber) main::toD0181_$0 in (number~) main::toD0181_$0 ← (word~) main::toD0181_$7 & (unumber)(number) $3fff +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$1 ← (unumber~) main::toD0181_$0 * (number) 4 +Adding number conversion cast (unumber) main::toD0181_$1 in (number~) main::toD0181_$1 ← (unumber~) main::toD0181_$0 * (unumber)(number) 4 +Adding number conversion cast (unumber) main::toD0181_$2 in (number~) main::toD0181_$2 ← > (unumber~) main::toD0181_$1 +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$4 ← (byte~) main::toD0181_$3 / (number) 4 +Adding number conversion cast (unumber) main::toD0181_$4 in (number~) main::toD0181_$4 ← (byte~) main::toD0181_$3 / (unumber)(number) 4 +Adding number conversion cast (unumber) $f in (number~) main::toD0181_$5 ← (unumber~) main::toD0181_$4 & (number) $f +Adding number conversion cast (unumber) main::toD0181_$5 in (number~) main::toD0181_$5 ← (unumber~) main::toD0181_$4 & (unumber)(number) $f +Adding number conversion cast (unumber) main::toD0181_$6 in (number~) main::toD0181_$6 ← (unumber~) main::toD0181_$2 | (unumber~) main::toD0181_$5 +Adding number conversion cast (snumber) 1 in (bool~) main::$6 ← (signed byte) main::y_movement#0 == (number) 1 +Adding number conversion cast (snumber) -$28 in (signed byte) main::movement#1 ← (number) -$28 +Adding number conversion cast (snumber) -1 in (bool~) main::$7 ← (signed byte) main::y_movement#1 == (number) -1 +Adding number conversion cast (snumber) $28 in (signed byte) main::movement#2 ← (number) $28 +Adding number conversion cast (snumber) 0 in (bool~) main::$56 ← (number) 0 != (signed byte) main::movement#3 +Adding number conversion cast (unumber) 0 in (bool~) main::$53 ← (number) 0 != (byte) screen#5 +Adding number conversion cast (unumber) 0 in (bool~) main::$54 ← (number) 0 != (byte) screen#6 +Adding number conversion cast (snumber) -1 in (bool~) main::$19 ← (signed byte) main::y_movement#2 == (number) -1 +Adding number conversion cast (unumber) $14 in (number~) main::$26 ← (word) x_pos_coarse#12 - (number) $14 +Adding number conversion cast (unumber) main::$26 in (number~) main::$26 ← (word) x_pos_coarse#12 - (unumber)(number) $14 +Adding number conversion cast (unumber) $c in (number~) main::$27 ← (word) y_pos_coarse#11 + (number) $c +Adding number conversion cast (unumber) main::$27 in (number~) main::$27 ← (word) y_pos_coarse#11 + (unumber)(number) $c +Adding number conversion cast (unumber) $18*$28 in (byte*~) main::$29 ← (byte*) main::screen_hidden#1 + (number) $18*(number) $28 +Adding number conversion cast (snumber) 1 in (bool~) main::$20 ← (signed byte) main::y_movement#3 == (number) 1 +Adding number conversion cast (unumber) $14 in (number~) main::$22 ← (word) x_pos_coarse#13 - (number) $14 +Adding number conversion cast (unumber) main::$22 in (number~) main::$22 ← (word) x_pos_coarse#13 - (unumber)(number) $14 +Adding number conversion cast (unumber) $c in (number~) main::$23 ← (word) y_pos_coarse#12 - (number) $c +Adding number conversion cast (unumber) main::$23 in (number~) main::$23 ← (word) y_pos_coarse#12 - (unumber)(number) $c +Adding number conversion cast (unumber) $28 in (bool~) main::$25 ← (byte) main::i#2 < (number) $28 +Adding number conversion cast (snumber) -1 in (bool~) main::$31 ← (signed byte) main::x_movement#1 == (number) -1 +Adding number conversion cast (unumber) $28 in (bool~) main::$30 ← (byte) main::i1#2 < (number) $28 +Adding number conversion cast (unumber) $13 in (number~) main::$38 ← (word) x_pos_coarse#14 + (number) $13 +Adding number conversion cast (unumber) main::$38 in (number~) main::$38 ← (word) x_pos_coarse#14 + (unumber)(number) $13 +Adding number conversion cast (unumber) $c in (number~) main::$39 ← (word) y_pos_coarse#13 - (number) $c +Adding number conversion cast (unumber) main::$39 in (number~) main::$39 ← (word) y_pos_coarse#13 - (unumber)(number) $c +Adding number conversion cast (unumber) $27 in (byte*~) main::$41 ← (byte*) main::screen_hidden#3 + (number) $27 +Adding number conversion cast (snumber) 1 in (bool~) main::$32 ← (signed byte) main::x_movement#2 == (number) 1 +Adding number conversion cast (unumber) $14 in (number~) main::$34 ← (word) x_pos_coarse#15 - (number) $14 +Adding number conversion cast (unumber) main::$34 in (number~) main::$34 ← (word) x_pos_coarse#15 - (unumber)(number) $14 +Adding number conversion cast (unumber) $c in (number~) main::$35 ← (word) y_pos_coarse#14 - (number) $c +Adding number conversion cast (unumber) main::$35 in (number~) main::$35 ← (word) y_pos_coarse#14 - (unumber)(number) $c +Adding number conversion cast (unumber) $19 in (bool~) main::$37 ← (byte) main::i2#2 < (number) $19 +Adding number conversion cast (unumber) $28 in (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (number) $28 +Adding number conversion cast (unumber) $8c in (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (number) $8c +Adding number conversion cast (unumber) 1 in (byte) screen#0 ← (byte) screen#7 ^ (number) 1 +Adding number conversion cast (unumber) $19 in (bool~) main::$42 ← (byte) main::i3#2 < (number) $19 +Adding number conversion cast (unumber) $28 in (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (number) $28 +Adding number conversion cast (unumber) $8c in (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (number) $8c +Adding number conversion cast (unumber) $fe in (bool~) main::$43 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe +Adding number conversion cast (unumber) $ff in (bool~) main::$44 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff +Adding number conversion cast (unumber) $f0 in (number~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $f0 +Adding number conversion cast (unumber) main::$45 in (number~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (unumber)(number) $f0 +Adding number conversion cast (unumber) 7 in (number~) main::$46 ← (number) 7 - (byte) y_pos_fine#10 +Adding number conversion cast (unumber) main::$46 in (number~) main::$46 ← (unumber)(number) 7 - (byte) y_pos_fine#10 +Adding number conversion cast (unumber) main::$47 in (number~) main::$47 ← (unumber~) main::$45 | (unumber~) main::$46 +Adding number conversion cast (unumber) $f0 in (number~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (number) $f0 +Adding number conversion cast (unumber) main::$48 in (number~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (unumber)(number) $f0 +Adding number conversion cast (unumber) 7 in (number~) main::$49 ← (number) 7 - (byte) x_pos_fine#10 +Adding number conversion cast (unumber) main::$49 in (number~) main::$49 ← (unumber)(number) 7 - (byte) x_pos_fine#10 +Adding number conversion cast (unumber) main::$50 in (number~) main::$50 ← (unumber~) main::$48 | (unumber~) main::$49 +Adding number conversion cast (unumber) 0 in (bool~) main::$55 ← (number) 0 != (byte) screen#8 +Adding number conversion cast (unumber) $3fff in (number~) main::toD0182_$0 ← (word~) main::toD0182_$7 & (number) $3fff +Adding number conversion cast (unumber) main::toD0182_$0 in (number~) main::toD0182_$0 ← (word~) main::toD0182_$7 & (unumber)(number) $3fff +Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$1 ← (unumber~) main::toD0182_$0 * (number) 4 +Adding number conversion cast (unumber) main::toD0182_$1 in (number~) main::toD0182_$1 ← (unumber~) main::toD0182_$0 * (unumber)(number) 4 +Adding number conversion cast (unumber) main::toD0182_$2 in (number~) main::toD0182_$2 ← > (unumber~) main::toD0182_$1 +Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$4 ← (byte~) main::toD0182_$3 / (number) 4 +Adding number conversion cast (unumber) main::toD0182_$4 in (number~) main::toD0182_$4 ← (byte~) main::toD0182_$3 / (unumber)(number) 4 +Adding number conversion cast (unumber) $f in (number~) main::toD0182_$5 ← (unumber~) main::toD0182_$4 & (number) $f +Adding number conversion cast (unumber) main::toD0182_$5 in (number~) main::toD0182_$5 ← (unumber~) main::toD0182_$4 & (unumber)(number) $f +Adding number conversion cast (unumber) main::toD0182_$6 in (number~) main::toD0182_$6 ← (unumber~) main::toD0182_$2 | (unumber~) main::toD0182_$5 +Adding number conversion cast (unumber) $3fff in (number~) main::toD0183_$0 ← (word~) main::toD0183_$7 & (number) $3fff +Adding number conversion cast (unumber) main::toD0183_$0 in (number~) main::toD0183_$0 ← (word~) main::toD0183_$7 & (unumber)(number) $3fff +Adding number conversion cast (unumber) 4 in (number~) main::toD0183_$1 ← (unumber~) main::toD0183_$0 * (number) 4 +Adding number conversion cast (unumber) main::toD0183_$1 in (number~) main::toD0183_$1 ← (unumber~) main::toD0183_$0 * (unumber)(number) 4 +Adding number conversion cast (unumber) main::toD0183_$2 in (number~) main::toD0183_$2 ← > (unumber~) main::toD0183_$1 +Adding number conversion cast (unumber) 4 in (number~) main::toD0183_$4 ← (byte~) main::toD0183_$3 / (number) 4 +Adding number conversion cast (unumber) main::toD0183_$4 in (number~) main::toD0183_$4 ← (byte~) main::toD0183_$3 / (unumber)(number) 4 +Adding number conversion cast (unumber) $f in (number~) main::toD0183_$5 ← (unumber~) main::toD0183_$4 & (number) $f +Adding number conversion cast (unumber) main::toD0183_$5 in (number~) main::toD0183_$5 ← (unumber~) main::toD0183_$4 & (unumber)(number) $f +Adding number conversion cast (unumber) main::toD0183_$6 in (number~) main::toD0183_$6 ← (unumber~) main::toD0183_$2 | (unumber~) main::toD0183_$5 +Adding number conversion cast (unumber) $8c in (number~) petscii_ptr::$0 ← (word) petscii_ptr::row_y#4 * (number) $8c +Adding number conversion cast (unumber) petscii_ptr::$0 in (number~) petscii_ptr::$0 ← (word) petscii_ptr::row_y#4 * (unumber)(number) $8c +Adding number conversion cast (unumber) $fa in (byte*~) screencpy::$0 ← (byte*) screencpy::src#1 + (number) $fa +Adding number conversion cast (unumber) $fa in (byte*~) screencpy::$1 ← (byte*) screencpy::dst#1 + (number) $fa +Adding number conversion cast (unumber) $1f4 in (byte*~) screencpy::$2 ← (byte*) screencpy::src#1 + (number) $1f4 +Adding number conversion cast (unumber) $1f4 in (byte*~) screencpy::$3 ← (byte*) screencpy::dst#1 + (number) $1f4 +Adding number conversion cast (unumber) $2ee in (byte*~) screencpy::$4 ← (byte*) screencpy::src#1 + (number) $2ee +Adding number conversion cast (unumber) $2ee in (byte*~) screencpy::$5 ← (byte*) screencpy::dst#1 + (number) $2ee +Adding number conversion cast (unumber) $fa in (bool~) screencpy::$6 ← (byte) screencpy::i#2 < (number) $fa +Adding number conversion cast (unumber) $190 in (number~) next_position::$4 ← (word~) next_position::$14 + (number) $190 +Adding number conversion cast (unumber) next_position::$4 in (number~) next_position::$4 ← (word~) next_position::$14 + (unumber)(number) $190 +Adding number conversion cast (unumber) $14*8 in (number~) next_position::$5 ← (unumber~) next_position::$4 + (number) $14*(number) 8 +Adding number conversion cast (unumber) next_position::$5 in (number~) next_position::$5 ← (unumber~) next_position::$4 + (unumber)(number) $14*(number) 8 +Adding number conversion cast (unumber) 7 in (number~) next_position::$6 ← (byte~) next_position::$15 & (number) 7 +Adding number conversion cast (unumber) next_position::$6 in (number~) next_position::$6 ← (byte~) next_position::$15 & (unumber)(number) 7 +Adding number conversion cast (unumber) 8 in (number~) next_position::$7 ← (word) next_position::x_pos_u#0 / (number) 8 +Adding number conversion cast (unumber) next_position::$7 in (number~) next_position::$7 ← (word) next_position::x_pos_u#0 / (unumber)(number) 8 +Adding number conversion cast (unumber) $190 in (number~) next_position::$8 ← (word~) next_position::$16 + (number) $190 +Adding number conversion cast (unumber) next_position::$8 in (number~) next_position::$8 ← (word~) next_position::$16 + (unumber)(number) $190 +Adding number conversion cast (unumber) $c*8 in (number~) next_position::$9 ← (unumber~) next_position::$8 + (number) $c*(number) 8 +Adding number conversion cast (unumber) next_position::$9 in (number~) next_position::$9 ← (unumber~) next_position::$8 + (unumber)(number) $c*(number) 8 +Adding number conversion cast (unumber) 7 in (number~) next_position::$10 ← (byte~) next_position::$17 & (number) 7 +Adding number conversion cast (unumber) next_position::$10 in (number~) next_position::$10 ← (byte~) next_position::$17 & (unumber)(number) 7 +Adding number conversion cast (unumber) 8 in (number~) next_position::$11 ← (word) next_position::y_pos_u#0 / (number) 8 +Adding number conversion cast (unumber) next_position::$11 in (number~) next_position::$11 ← (word) next_position::y_pos_u#0 / (unumber)(number) 8 +Adding number conversion cast (unumber) 4 in (word) y_sin_idx#6 ← (word)(const nomodify word) SINSIZE/(number) 4 +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 +Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8 +Inlining cast (signed byte) main::movement#1 ← (snumber)(number) -$28 +Inlining cast (signed byte) main::movement#2 ← (snumber)(number) $28 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (struct MOS6569_VICII*) 53248 +Simplifying constant pointer cast (byte*) 14336 +Simplifying constant pointer cast (byte*) 15360 +Simplifying constant pointer cast (byte*) 4096 +Simplifying constant integer cast 0 +Simplifying constant integer cast $3e8 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast 1 +Simplifying constant integer cast -$28 +Simplifying constant integer cast -1 +Simplifying constant integer cast $28 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast -1 +Simplifying constant integer cast $14 +Simplifying constant integer cast $c +Simplifying constant integer cast 1 +Simplifying constant integer cast $14 +Simplifying constant integer cast $c +Simplifying constant integer cast $28 +Simplifying constant integer cast -1 +Simplifying constant integer cast $28 +Simplifying constant integer cast $13 +Simplifying constant integer cast $c +Simplifying constant integer cast $27 +Simplifying constant integer cast 1 +Simplifying constant integer cast $14 +Simplifying constant integer cast $c +Simplifying constant integer cast $19 +Simplifying constant integer cast $28 +Simplifying constant integer cast $8c +Simplifying constant integer cast 1 +Simplifying constant integer cast $19 +Simplifying constant integer cast $28 +Simplifying constant integer cast $8c +Simplifying constant integer cast $fe +Simplifying constant integer cast $ff +Simplifying constant integer cast $f0 +Simplifying constant integer cast 7 +Simplifying constant integer cast $f0 +Simplifying constant integer cast 7 +Simplifying constant integer cast 0 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast $8c +Simplifying constant integer cast $fa +Simplifying constant integer cast $fa +Simplifying constant integer cast $1f4 +Simplifying constant integer cast $1f4 +Simplifying constant integer cast $2ee +Simplifying constant integer cast $2ee +Simplifying constant integer cast $fa +Simplifying constant integer cast $190 +Simplifying constant integer cast 7 +Simplifying constant integer cast 8 +Simplifying constant integer cast $190 +Simplifying constant integer cast 7 +Simplifying constant integer cast 8 +Simplifying constant integer cast 4 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $3e8 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $f +Finalized signed number type (signed byte) 1 +Finalized signed number type (signed byte) -$28 +Finalized signed number type (signed byte) -1 +Finalized signed number type (signed byte) $28 +Finalized signed number type (signed byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized signed number type (signed byte) -1 +Finalized unsigned number type (byte) $14 +Finalized unsigned number type (byte) $c +Finalized signed number type (signed byte) 1 +Finalized unsigned number type (byte) $14 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $28 +Finalized signed number type (signed byte) -1 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $13 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $27 +Finalized signed number type (signed byte) 1 +Finalized unsigned number type (byte) $14 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $8c +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) $8c +Finalized unsigned number type (byte) $fe +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) $f0 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) $f0 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) $8c +Finalized unsigned number type (byte) $fa +Finalized unsigned number type (byte) $fa +Finalized unsigned number type (word) $1f4 +Finalized unsigned number type (word) $1f4 +Finalized unsigned number type (word) $2ee +Finalized unsigned number type (word) $2ee +Finalized unsigned number type (byte) $fa +Finalized unsigned number type (word) $190 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (word) $190 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 4 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to word in (unumber~) main::toD0181_$0 ← (word~) main::toD0181_$7 & (word) $3fff +Inferred type updated to word in (unumber~) main::toD0181_$1 ← (word~) main::toD0181_$0 * (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$2 ← > (word~) main::toD0181_$1 +Inferred type updated to byte in (unumber~) main::toD0181_$4 ← (byte~) main::toD0181_$3 / (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$5 ← (byte~) main::toD0181_$4 & (byte) $f +Inferred type updated to byte in (unumber~) main::toD0181_$6 ← (byte~) main::toD0181_$2 | (byte~) main::toD0181_$5 +Inferred type updated to word in (unumber~) main::$26 ← (word) x_pos_coarse#12 - (byte) $14 +Inferred type updated to word in (unumber~) main::$27 ← (word) y_pos_coarse#11 + (byte) $c +Inferred type updated to word in (unumber~) main::$22 ← (word) x_pos_coarse#13 - (byte) $14 +Inferred type updated to word in (unumber~) main::$23 ← (word) y_pos_coarse#12 - (byte) $c +Inferred type updated to word in (unumber~) main::$38 ← (word) x_pos_coarse#14 + (byte) $13 +Inferred type updated to word in (unumber~) main::$39 ← (word) y_pos_coarse#13 - (byte) $c +Inferred type updated to word in (unumber~) main::$34 ← (word) x_pos_coarse#15 - (byte) $14 +Inferred type updated to word in (unumber~) main::$35 ← (word) y_pos_coarse#14 - (byte) $c +Inferred type updated to byte in (unumber~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 +Inferred type updated to byte in (unumber~) main::$46 ← (byte) 7 - (byte) y_pos_fine#10 +Inferred type updated to byte in (unumber~) main::$47 ← (byte~) main::$45 | (byte~) main::$46 +Inferred type updated to byte in (unumber~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 +Inferred type updated to byte in (unumber~) main::$49 ← (byte) 7 - (byte) x_pos_fine#10 +Inferred type updated to byte in (unumber~) main::$50 ← (byte~) main::$48 | (byte~) main::$49 +Inferred type updated to word in (unumber~) main::toD0182_$0 ← (word~) main::toD0182_$7 & (word) $3fff +Inferred type updated to word in (unumber~) main::toD0182_$1 ← (word~) main::toD0182_$0 * (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0182_$2 ← > (word~) main::toD0182_$1 +Inferred type updated to byte in (unumber~) main::toD0182_$4 ← (byte~) main::toD0182_$3 / (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0182_$5 ← (byte~) main::toD0182_$4 & (byte) $f +Inferred type updated to byte in (unumber~) main::toD0182_$6 ← (byte~) main::toD0182_$2 | (byte~) main::toD0182_$5 +Inferred type updated to word in (unumber~) main::toD0183_$0 ← (word~) main::toD0183_$7 & (word) $3fff +Inferred type updated to word in (unumber~) main::toD0183_$1 ← (word~) main::toD0183_$0 * (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0183_$2 ← > (word~) main::toD0183_$1 +Inferred type updated to byte in (unumber~) main::toD0183_$4 ← (byte~) main::toD0183_$3 / (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0183_$5 ← (byte~) main::toD0183_$4 & (byte) $f +Inferred type updated to byte in (unumber~) main::toD0183_$6 ← (byte~) main::toD0183_$2 | (byte~) main::toD0183_$5 +Inferred type updated to word in (unumber~) petscii_ptr::$0 ← (word) petscii_ptr::row_y#4 * (byte) $8c +Inferred type updated to word in (unumber~) next_position::$4 ← (word~) next_position::$14 + (word) $190 +Inferred type updated to word in (unumber~) next_position::$5 ← (word~) next_position::$4 + (byte)(number) $14*(number) 8 +Inferred type updated to byte in (unumber~) next_position::$6 ← (byte~) next_position::$15 & (byte) 7 +Inferred type updated to word in (unumber~) next_position::$7 ← (word) next_position::x_pos_u#0 / (byte) 8 +Inferred type updated to word in (unumber~) next_position::$8 ← (word~) next_position::$16 + (word) $190 +Inferred type updated to word in (unumber~) next_position::$9 ← (word~) next_position::$8 + (byte)(number) $c*(number) 8 +Inferred type updated to byte in (unumber~) next_position::$10 ← (byte~) next_position::$17 & (byte) 7 +Inferred type updated to word in (unumber~) next_position::$11 ← (word) next_position::y_pos_u#0 / (byte) 8 +Inversing boolean not [2] (bool~) memset::$1 ← (word) memset::num#1 <= (byte) 0 from [1] (bool~) memset::$0 ← (word) memset::num#1 > (byte) 0 +Inversing boolean not [79] (bool~) main::$8 ← (signed byte) main::y_movement#1 != (signed byte) -1 from [78] (bool~) main::$7 ← (signed byte) main::y_movement#1 == (signed byte) -1 +Inversing boolean not [88] (bool~) main::$10 ← (signed byte) 0 == (signed byte) main::movement#3 from [87] (bool~) main::$56 ← (signed byte) 0 != (signed byte) main::movement#3 +Inversing boolean not [129] (bool~) main::$21 ← (signed byte) main::y_movement#3 != (signed byte) 1 from [128] (bool~) main::$20 ← (signed byte) main::y_movement#3 == (signed byte) 1 +Inversing boolean not [173] (bool~) main::$33 ← (signed byte) main::x_movement#2 != (signed byte) 1 from [172] (bool~) main::$32 ← (signed byte) main::x_movement#2 == (signed byte) 1 +Inversing boolean not [307] (bool~) next_position::$1 ← (word) x_sin_idx#3 < (const nomodify word) SINSIZE from [306] (bool~) next_position::$0 ← (word) x_sin_idx#3 >= (const nomodify word) SINSIZE +Inversing boolean not [312] (bool~) next_position::$3 ← (word) y_sin_idx#3 < (const nomodify word) SINSIZE from [311] (bool~) next_position::$2 ← (word) y_sin_idx#3 >= (const nomodify word) SINSIZE +Successful SSA optimization Pass2UnaryNotSimplification +Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1 +Alias memset::str#2 = memset::str#3 +Alias memset::num#1 = memset::num#2 +Alias memset::c#3 = memset::c#4 +Alias memset::end#0 = memset::$2 +Alias memset::c#1 = memset::c#2 +Alias memset::dst#2 = memset::dst#3 +Alias memset::end#1 = memset::end#2 +Alias memset::str#4 = memset::str#5 +Alias x_sin_idx#18 = x_sin_idx#34 x_sin_idx#37 x_sin_idx#31 x_sin_idx#28 x_sin_idx#25 x_sin_idx#23 +Alias y_sin_idx#18 = y_sin_idx#34 y_sin_idx#37 y_sin_idx#31 y_sin_idx#28 y_sin_idx#25 y_sin_idx#23 +Alias x_pos#14 = x_pos#28 x_pos#31 x_pos#25 x_pos#22 x_pos#19 x_pos#17 +Alias y_pos#14 = y_pos#28 y_pos#31 y_pos#25 y_pos#22 y_pos#19 y_pos#17 +Alias x_pos_fine#15 = x_pos_fine#44 x_pos_fine#52 x_pos_fine#36 x_pos_fine#27 x_pos_fine#22 x_pos_fine#19 +Alias x_pos_coarse#20 = x_pos_coarse#54 x_pos_coarse#57 x_pos_coarse#49 x_pos_coarse#45 x_pos_coarse#36 x_pos_coarse#30 +Alias y_pos_fine#15 = y_pos_fine#44 y_pos_fine#52 y_pos_fine#36 y_pos_fine#27 y_pos_fine#22 y_pos_fine#19 +Alias y_pos_coarse#19 = y_pos_coarse#50 y_pos_coarse#53 y_pos_coarse#45 y_pos_coarse#41 y_pos_coarse#32 y_pos_coarse#26 +Alias screen#42 = screen#61 screen#62 screen#60 screen#57 screen#54 screen#51 screen#46 +Alias main::toD0181_screen#0 = main::toD0181_screen#1 +Alias main::toD0181_gfx#0 = main::toD0181_gfx#1 +Alias main::toD0181_return#0 = main::toD0181_$6 main::toD0181_return#2 main::toD0181_return#1 main::toD0181_return#3 main::$2 +Alias x_sin_idx#0 = x_sin_idx#9 +Alias y_sin_idx#0 = y_sin_idx#9 +Alias x_pos#0 = x_pos#8 +Alias y_pos#0 = y_pos#8 +Alias x_pos_fine#0 = x_pos_fine#8 +Alias x_pos_coarse#0 = x_pos_coarse#8 +Alias y_pos_fine#0 = y_pos_fine#8 +Alias y_pos_coarse#0 = y_pos_coarse#8 +Alias main::y_pos_coarse_old#0 = main::y_pos_coarse_old#1 +Alias main::x_pos_coarse_old#0 = main::x_pos_coarse_old#5 main::x_pos_coarse_old#2 main::x_pos_coarse_old#3 main::x_pos_coarse_old#4 +Alias screen#20 = screen#29 screen#35 screen#21 screen#22 +Alias x_sin_idx#1 = x_sin_idx#10 x_sin_idx#43 x_sin_idx#44 x_sin_idx#45 +Alias y_sin_idx#1 = y_sin_idx#10 y_sin_idx#43 y_sin_idx#44 y_sin_idx#45 +Alias x_pos#1 = x_pos#9 x_pos#37 x_pos#38 x_pos#39 +Alias y_pos#1 = y_pos#9 y_pos#37 y_pos#38 y_pos#39 +Alias x_pos_fine#1 = x_pos_fine#9 x_pos_fine#28 x_pos_fine#29 x_pos_fine#30 +Alias x_pos_coarse#1 = x_pos_coarse#10 x_pos_coarse#22 x_pos_coarse#23 x_pos_coarse#24 +Alias y_pos_fine#1 = y_pos_fine#9 y_pos_fine#28 y_pos_fine#29 y_pos_fine#30 +Alias y_pos_coarse#1 = y_pos_coarse#10 y_pos_coarse#56 y_pos_coarse#57 y_pos_coarse#58 +Alias main::y_movement#0 = main::y_movement#12 main::y_movement#1 main::y_movement#13 +Alias main::movement#0 = main::movement#6 +Alias screen#12 = screen#5 screen#13 screen#14 +Alias main::movement#3 = main::movement#9 main::movement#7 main::movement#8 +Alias main::y_movement#10 = main::y_movement#11 main::y_movement#8 main::y_movement#9 +Alias x_pos_coarse#11 = x_pos_coarse#55 x_pos_coarse#50 x_pos_coarse#51 +Alias y_pos_coarse#46 = y_pos_coarse#51 y_pos_coarse#54 y_pos_coarse#47 +Alias main::x_movement#0 = main::x_movement#19 main::x_movement#17 main::x_movement#18 +Alias y_pos_fine#24 = y_pos_fine#66 y_pos_fine#64 y_pos_fine#65 +Alias x_pos_fine#24 = x_pos_fine#66 x_pos_fine#64 x_pos_fine#65 +Alias x_sin_idx#42 = x_sin_idx#72 x_sin_idx#70 x_sin_idx#71 +Alias y_sin_idx#42 = y_sin_idx#72 y_sin_idx#70 y_sin_idx#71 +Alias x_pos#36 = x_pos#66 x_pos#64 x_pos#65 +Alias y_pos#36 = y_pos#66 y_pos#64 y_pos#65 +Alias main::screen_active#0 = main::$14 main::screen_active#2 main::screen_active#3 +Alias main::y_movement#5 = main::y_movement#7 main::y_movement#6 +Alias x_pos_coarse#37 = x_pos_coarse#46 x_pos_coarse#38 +Alias y_pos_coarse#33 = y_pos_coarse#42 y_pos_coarse#34 +Alias main::x_movement#14 = main::x_movement#16 main::x_movement#15 +Alias screen#47 = screen#6 screen#48 +Alias y_pos_fine#61 = y_pos_fine#63 y_pos_fine#62 +Alias x_pos_fine#61 = x_pos_fine#63 x_pos_fine#62 +Alias x_sin_idx#67 = x_sin_idx#69 x_sin_idx#68 +Alias y_sin_idx#67 = y_sin_idx#69 y_sin_idx#68 +Alias x_pos#61 = x_pos#63 x_pos#62 +Alias y_pos#61 = y_pos#63 y_pos#62 +Alias main::screen_hidden#0 = main::$17 main::screen_hidden#9 main::screen_hidden#5 main::screen_hidden#1 main::screen_hidden#10 main::screen_hidden#6 main::screen_hidden#2 main::scrn#0 +Alias main::y_movement#2 = main::y_movement#4 main::y_movement#3 +Alias x_pos_coarse#12 = x_pos_coarse#25 x_pos_coarse#31 x_pos_coarse#42 x_pos_coarse#26 x_pos_coarse#13 x_pos_coarse#40 +Alias y_pos_coarse#11 = y_pos_coarse#21 y_pos_coarse#27 y_pos_coarse#38 y_pos_coarse#22 y_pos_coarse#12 y_pos_coarse#36 +Alias main::x_movement#10 = main::x_movement#6 main::x_movement#11 main::x_movement#12 main::x_movement#5 main::x_movement#13 main::x_movement#8 +Alias screen#32 = screen#36 screen#43 screen#44 screen#40 screen#45 screen#38 +Alias y_pos_fine#47 = y_pos_fine#53 y_pos_fine#58 y_pos_fine#59 y_pos_fine#57 y_pos_fine#60 y_pos_fine#55 +Alias x_pos_fine#47 = x_pos_fine#53 x_pos_fine#58 x_pos_fine#59 x_pos_fine#57 x_pos_fine#60 x_pos_fine#55 +Alias x_sin_idx#56 = x_sin_idx#59 x_sin_idx#64 x_sin_idx#65 x_sin_idx#63 x_sin_idx#66 x_sin_idx#61 +Alias y_sin_idx#56 = y_sin_idx#59 y_sin_idx#64 y_sin_idx#65 y_sin_idx#63 y_sin_idx#66 y_sin_idx#61 +Alias x_pos#50 = x_pos#53 x_pos#58 x_pos#59 x_pos#57 x_pos#60 x_pos#55 +Alias y_pos#50 = y_pos#53 y_pos#58 y_pos#59 y_pos#57 y_pos#60 y_pos#55 +Alias petscii_ptr::row_x#0 = main::$26 +Alias petscii_ptr::row_y#0 = main::$27 +Alias petscii_ptr::return#0 = petscii_ptr::return#6 +Alias main::petscii1#0 = main::$28 +Alias main::scrn1#0 = main::$29 +Alias petscii_ptr::row_x#1 = main::$22 +Alias petscii_ptr::row_y#1 = main::$23 +Alias petscii_ptr::return#1 = petscii_ptr::return#7 +Alias main::petscii#0 = main::$24 +Alias main::petscii#1 = main::petscii#2 +Alias main::i#2 = main::i#3 +Alias main::scrn#1 = main::scrn#2 +Alias main::x_movement#3 = main::x_movement#7 +Alias x_pos_coarse#32 = x_pos_coarse#39 +Alias y_pos_coarse#28 = y_pos_coarse#35 +Alias main::screen_hidden#13 = main::screen_hidden#15 +Alias screen#30 = screen#37 +Alias y_pos_fine#45 = y_pos_fine#54 +Alias x_pos_fine#45 = x_pos_fine#54 +Alias x_sin_idx#54 = x_sin_idx#60 +Alias y_sin_idx#54 = y_sin_idx#60 +Alias x_pos#48 = x_pos#54 +Alias y_pos#48 = y_pos#54 +Alias main::petscii1#1 = main::petscii1#2 +Alias main::i1#2 = main::i1#3 +Alias main::scrn1#1 = main::scrn1#2 +Alias main::x_movement#4 = main::x_movement#9 +Alias x_pos_coarse#33 = x_pos_coarse#41 +Alias y_pos_coarse#29 = y_pos_coarse#37 +Alias main::screen_hidden#14 = main::screen_hidden#16 +Alias screen#31 = screen#39 +Alias y_pos_fine#46 = y_pos_fine#56 +Alias x_pos_fine#46 = x_pos_fine#56 +Alias x_sin_idx#55 = x_sin_idx#62 +Alias y_sin_idx#55 = y_sin_idx#62 +Alias x_pos#49 = x_pos#56 +Alias y_pos#49 = y_pos#56 +Alias x_pos_coarse#14 = x_pos_coarse#27 x_pos_coarse#66 x_pos_coarse#28 x_pos_coarse#15 x_pos_coarse#64 +Alias y_pos_coarse#13 = y_pos_coarse#23 y_pos_coarse#66 y_pos_coarse#24 y_pos_coarse#14 y_pos_coarse#64 +Alias main::screen_hidden#11 = main::screen_hidden#7 main::screen_hidden#3 main::screen_hidden#12 main::screen_hidden#8 main::screen_hidden#4 main::scrn2#0 +Alias screen#17 = screen#33 screen#23 screen#27 screen#34 screen#25 +Alias y_pos_fine#33 = y_pos_fine#48 y_pos_fine#37 y_pos_fine#41 y_pos_fine#49 y_pos_fine#39 +Alias x_pos_fine#33 = x_pos_fine#48 x_pos_fine#37 x_pos_fine#41 x_pos_fine#49 x_pos_fine#39 +Alias x_sin_idx#48 = x_sin_idx#57 x_sin_idx#49 x_sin_idx#53 x_sin_idx#58 x_sin_idx#51 +Alias y_sin_idx#48 = y_sin_idx#57 y_sin_idx#49 y_sin_idx#53 y_sin_idx#58 y_sin_idx#51 +Alias x_pos#42 = x_pos#51 x_pos#43 x_pos#47 x_pos#52 x_pos#45 +Alias y_pos#42 = y_pos#51 y_pos#43 y_pos#47 y_pos#52 y_pos#45 +Alias petscii_ptr::row_x#2 = main::$38 +Alias petscii_ptr::row_y#2 = main::$39 +Alias petscii_ptr::return#2 = petscii_ptr::return#8 +Alias main::petscii3#0 = main::$40 +Alias main::scrn3#0 = main::$41 +Alias main::x_movement#1 = main::x_movement#2 +Alias petscii_ptr::row_x#3 = main::$34 +Alias petscii_ptr::row_y#3 = main::$35 +Alias petscii_ptr::return#3 = petscii_ptr::return#9 +Alias main::petscii2#0 = main::$36 +Alias main::petscii2#2 = main::petscii2#3 +Alias main::scrn2#2 = main::scrn2#3 +Alias main::i2#2 = main::i2#3 +Alias screen#15 = screen#24 +Alias y_pos_fine#31 = y_pos_fine#38 +Alias x_pos_fine#31 = x_pos_fine#38 +Alias x_pos_coarse#61 = x_pos_coarse#63 +Alias y_pos_coarse#61 = y_pos_coarse#63 +Alias x_sin_idx#46 = x_sin_idx#50 +Alias y_sin_idx#46 = y_sin_idx#50 +Alias x_pos#40 = x_pos#44 +Alias y_pos#40 = y_pos#44 +Alias main::petscii3#2 = main::petscii3#3 +Alias main::scrn3#2 = main::scrn3#3 +Alias main::i3#2 = main::i3#3 +Alias screen#16 = screen#26 +Alias y_pos_fine#32 = y_pos_fine#40 +Alias x_pos_fine#32 = x_pos_fine#40 +Alias x_pos_coarse#62 = x_pos_coarse#65 +Alias y_pos_coarse#62 = y_pos_coarse#65 +Alias x_sin_idx#47 = x_sin_idx#52 +Alias y_sin_idx#47 = y_sin_idx#52 +Alias x_pos#41 = x_pos#46 +Alias y_pos#41 = y_pos#46 +Alias y_pos_fine#10 = y_pos_fine#17 y_pos_fine#50 y_pos_fine#42 y_pos_fine#34 y_pos_fine#25 y_pos_fine#51 y_pos_fine#43 y_pos_fine#35 y_pos_fine#26 +Alias x_pos_fine#10 = x_pos_fine#17 x_pos_fine#50 x_pos_fine#42 x_pos_fine#34 x_pos_fine#25 x_pos_fine#51 x_pos_fine#43 x_pos_fine#35 x_pos_fine#26 +Alias screen#18 = screen#8 screen#58 screen#55 screen#52 screen#49 screen#59 screen#56 screen#53 screen#50 +Alias x_pos_coarse#34 = x_pos_coarse#56 x_pos_coarse#58 x_pos_coarse#52 x_pos_coarse#47 x_pos_coarse#43 x_pos_coarse#53 x_pos_coarse#48 x_pos_coarse#44 x_pos_coarse#35 +Alias y_pos_coarse#30 = y_pos_coarse#52 y_pos_coarse#55 y_pos_coarse#48 y_pos_coarse#43 y_pos_coarse#39 y_pos_coarse#49 y_pos_coarse#44 y_pos_coarse#40 y_pos_coarse#31 +Alias x_sin_idx#26 = x_sin_idx#38 x_sin_idx#39 x_sin_idx#35 x_sin_idx#32 x_sin_idx#29 x_sin_idx#36 x_sin_idx#33 x_sin_idx#30 x_sin_idx#27 +Alias y_sin_idx#26 = y_sin_idx#38 y_sin_idx#39 y_sin_idx#35 y_sin_idx#32 y_sin_idx#29 y_sin_idx#36 y_sin_idx#33 y_sin_idx#30 y_sin_idx#27 +Alias x_pos#20 = x_pos#32 x_pos#33 x_pos#29 x_pos#26 x_pos#23 x_pos#30 x_pos#27 x_pos#24 x_pos#21 +Alias y_pos#20 = y_pos#32 y_pos#33 y_pos#29 y_pos#26 y_pos#23 y_pos#30 y_pos#27 y_pos#24 y_pos#21 +Alias main::toD0182_screen#0 = main::toD0182_screen#1 +Alias main::toD0182_gfx#0 = main::toD0182_gfx#1 +Alias main::toD0182_return#0 = main::toD0182_$6 main::toD0182_return#2 main::toD0182_return#1 main::toD0182_return#3 main::$52 +Alias main::toD0183_screen#0 = main::toD0183_screen#1 +Alias main::toD0183_gfx#0 = main::toD0183_gfx#1 +Alias main::toD0183_return#0 = main::toD0183_$6 main::toD0183_return#2 main::toD0183_return#1 main::toD0183_return#3 main::$51 +Alias x_sin_idx#11 = x_sin_idx#2 +Alias y_sin_idx#11 = y_sin_idx#2 +Alias x_pos#10 = x_pos#2 +Alias y_pos#10 = y_pos#2 +Alias x_pos_fine#11 = x_pos_fine#2 +Alias x_pos_coarse#16 = x_pos_coarse#2 +Alias y_pos_fine#11 = y_pos_fine#2 +Alias y_pos_coarse#15 = y_pos_coarse#2 +Alias screen#1 = screen#9 +Alias petscii_ptr::return#10 = petscii_ptr::return#4 petscii_ptr::$2 petscii_ptr::return#5 +Alias screencpy::src_250#0 = screencpy::$0 +Alias screencpy::dst_250#0 = screencpy::$1 +Alias screencpy::src_500#0 = screencpy::$2 +Alias screencpy::dst_500#0 = screencpy::$3 +Alias screencpy::src_750#0 = screencpy::$4 +Alias screencpy::dst_750#0 = screencpy::$5 +Alias screencpy::src#2 = screencpy::src#3 +Alias screencpy::i#2 = screencpy::i#3 +Alias screencpy::dst#2 = screencpy::dst#3 +Alias screencpy::src_250#1 = screencpy::src_250#2 +Alias screencpy::dst_250#1 = screencpy::dst_250#2 +Alias screencpy::src_500#1 = screencpy::src_500#2 +Alias screencpy::dst_500#1 = screencpy::dst_500#2 +Alias screencpy::src_750#1 = screencpy::src_750#2 +Alias screencpy::dst_750#1 = screencpy::dst_750#2 +Alias x_sin_idx#13 = x_sin_idx#3 +Alias y_sin_idx#20 = y_sin_idx#21 +Alias next_position::x_pos_u#0 = next_position::$5 +Alias x_pos_fine#12 = x_pos_fine#3 next_position::$6 x_pos_fine#4 +Alias x_pos_coarse#17 = x_pos_coarse#3 next_position::$7 x_pos_coarse#4 +Alias next_position::y_pos_u#0 = next_position::$9 +Alias y_pos_fine#12 = y_pos_fine#3 next_position::$10 y_pos_fine#4 +Alias y_pos_coarse#16 = y_pos_coarse#3 next_position::$11 y_pos_coarse#4 +Alias y_sin_idx#14 = y_sin_idx#3 +Alias x_sin_idx#20 = x_sin_idx#21 +Alias x_sin_idx#14 = x_sin_idx#15 x_sin_idx#5 +Alias y_sin_idx#13 = y_sin_idx#15 y_sin_idx#5 +Alias x_pos#11 = x_pos#3 x_pos#4 +Alias y_pos#11 = y_pos#3 y_pos#4 +Alias x_sin_idx#22 = x_sin_idx#6 +Alias y_sin_idx#22 = y_sin_idx#6 +Alias x_pos#16 = x_pos#5 +Alias y_pos#16 = y_pos#5 +Alias x_pos_fine#18 = x_pos_fine#5 +Alias x_pos_coarse#29 = x_pos_coarse#5 +Alias y_pos_fine#18 = y_pos_fine#5 +Alias y_pos_coarse#25 = y_pos_coarse#5 +Alias screen#19 = screen#2 +Alias x_sin_idx#16 = x_sin_idx#7 x_sin_idx#17 x_sin_idx#8 +Alias y_sin_idx#16 = y_sin_idx#7 y_sin_idx#17 y_sin_idx#8 +Alias x_pos#12 = x_pos#6 x_pos#13 x_pos#7 +Alias y_pos#12 = y_pos#6 y_pos#13 y_pos#7 +Alias x_pos_fine#13 = x_pos_fine#6 x_pos_fine#14 x_pos_fine#7 +Alias x_pos_coarse#18 = x_pos_coarse#6 x_pos_coarse#19 x_pos_coarse#7 +Alias y_pos_fine#13 = y_pos_fine#6 y_pos_fine#14 y_pos_fine#7 +Alias y_pos_coarse#17 = y_pos_coarse#6 y_pos_coarse#18 y_pos_coarse#7 +Alias screen#10 = screen#3 screen#11 screen#4 +Successful SSA optimization Pass2AliasElimination +Alias main::x_pos_coarse_old#0 = main::x_pos_coarse_old#1 +Alias x_pos_coarse#1 = x_pos_coarse#11 x_pos_coarse#37 x_pos_coarse#12 +Alias screen#12 = screen#20 screen#47 screen#32 +Alias y_pos_fine#1 = y_pos_fine#24 y_pos_fine#61 y_pos_fine#47 +Alias x_pos_fine#1 = x_pos_fine#24 x_pos_fine#61 x_pos_fine#47 +Alias main::y_movement#0 = main::y_movement#10 main::y_movement#5 main::y_movement#2 +Alias y_pos_coarse#1 = y_pos_coarse#46 y_pos_coarse#33 y_pos_coarse#11 +Alias x_sin_idx#1 = x_sin_idx#42 x_sin_idx#67 x_sin_idx#56 +Alias y_sin_idx#1 = y_sin_idx#42 y_sin_idx#67 y_sin_idx#56 +Alias x_pos#1 = x_pos#36 x_pos#61 x_pos#50 +Alias y_pos#1 = y_pos#36 y_pos#61 y_pos#50 +Alias main::movement#3 = main::movement#5 +Alias main::x_movement#0 = main::x_movement#14 main::x_movement#10 +Alias main::screen_active#0 = main::screen_active#1 +Alias x_pos_coarse#21 = x_pos_coarse#34 +Alias y_pos_coarse#20 = y_pos_coarse#30 +Alias x_sin_idx#24 = x_sin_idx#26 +Alias y_sin_idx#24 = y_sin_idx#26 +Alias x_pos#18 = x_pos#20 +Alias y_pos#18 = y_pos#20 +Alias x_pos_fine#10 = x_pos_fine#20 +Alias y_pos_fine#10 = y_pos_fine#20 +Alias screen#18 = screen#41 +Alias y_sin_idx#12 = y_sin_idx#20 +Alias x_sin_idx#14 = x_sin_idx#20 +Successful SSA optimization Pass2AliasElimination +Identical Phi Values (word) memset::num#1 (word) memset::num#0 +Identical Phi Values (void*) memset::str#2 (void*) memset::str#0 +Identical Phi Values (byte) memset::c#3 (byte) memset::c#0 +Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0 +Identical Phi Values (void*) memset::str#4 (void*) memset::str#2 +Identical Phi Values (byte) memset::c#1 (byte) memset::c#3 +Identical Phi Values (word) x_sin_idx#18 (word) x_sin_idx#22 +Identical Phi Values (word) y_sin_idx#18 (word) y_sin_idx#22 +Identical Phi Values (signed word) x_pos#14 (signed word) x_pos#16 +Identical Phi Values (signed word) y_pos#14 (signed word) y_pos#16 +Identical Phi Values (byte) x_pos_fine#15 (byte) x_pos_fine#18 +Identical Phi Values (word) x_pos_coarse#20 (word) x_pos_coarse#29 +Identical Phi Values (byte) y_pos_fine#15 (byte) y_pos_fine#18 +Identical Phi Values (word) y_pos_coarse#19 (word) y_pos_coarse#25 +Identical Phi Values (byte) screen#42 (byte) screen#19 +Identical Phi Values (word) x_sin_idx#0 (word) x_sin_idx#14 +Identical Phi Values (word) y_sin_idx#0 (word) y_sin_idx#13 +Identical Phi Values (signed word) x_pos#0 (signed word) x_pos#11 +Identical Phi Values (signed word) y_pos#0 (signed word) y_pos#11 +Identical Phi Values (byte) x_pos_fine#0 (byte) x_pos_fine#12 +Identical Phi Values (word) x_pos_coarse#0 (word) x_pos_coarse#17 +Identical Phi Values (byte) y_pos_fine#0 (byte) y_pos_fine#12 +Identical Phi Values (word) y_pos_coarse#0 (word) y_pos_coarse#16 +Identical Phi Values (word) x_sin_idx#1 (word) x_sin_idx#14 +Identical Phi Values (word) y_sin_idx#1 (word) y_sin_idx#13 +Identical Phi Values (signed word) x_pos#1 (signed word) x_pos#11 +Identical Phi Values (signed word) y_pos#1 (signed word) y_pos#11 +Identical Phi Values (byte) x_pos_fine#1 (byte) x_pos_fine#12 +Identical Phi Values (word) x_pos_coarse#1 (word) x_pos_coarse#17 +Identical Phi Values (byte) y_pos_fine#1 (byte) y_pos_fine#12 +Identical Phi Values (word) y_pos_coarse#1 (word) y_pos_coarse#16 +Identical Phi Values (byte*) main::petscii#1 (byte*) main::petscii#0 +Identical Phi Values (byte*) main::scrn#1 (byte*) main::screen_hidden#0 +Identical Phi Values (signed byte) main::x_movement#3 (signed byte) main::x_movement#0 +Identical Phi Values (word) x_pos_coarse#32 (word) x_pos_coarse#1 +Identical Phi Values (word) y_pos_coarse#28 (word) y_pos_coarse#1 +Identical Phi Values (byte*) main::screen_hidden#13 (byte*) main::screen_hidden#0 +Identical Phi Values (byte) screen#30 (byte) screen#12 +Identical Phi Values (byte) y_pos_fine#45 (byte) y_pos_fine#1 +Identical Phi Values (byte) x_pos_fine#45 (byte) x_pos_fine#1 +Identical Phi Values (word) x_sin_idx#54 (word) x_sin_idx#1 +Identical Phi Values (word) y_sin_idx#54 (word) y_sin_idx#1 +Identical Phi Values (signed word) x_pos#48 (signed word) x_pos#1 +Identical Phi Values (signed word) y_pos#48 (signed word) y_pos#1 +Identical Phi Values (signed byte) main::x_movement#4 (signed byte) main::x_movement#0 +Identical Phi Values (byte*) main::petscii1#1 (byte*) main::petscii1#0 +Identical Phi Values (byte*) main::scrn1#1 (byte*) main::scrn1#0 +Identical Phi Values (word) x_pos_coarse#33 (word) x_pos_coarse#1 +Identical Phi Values (word) y_pos_coarse#29 (word) y_pos_coarse#1 +Identical Phi Values (byte*) main::screen_hidden#14 (byte*) main::screen_hidden#0 +Identical Phi Values (byte) screen#31 (byte) screen#12 +Identical Phi Values (byte) y_pos_fine#46 (byte) y_pos_fine#1 +Identical Phi Values (byte) x_pos_fine#46 (byte) x_pos_fine#1 +Identical Phi Values (word) x_sin_idx#55 (word) x_sin_idx#1 +Identical Phi Values (word) y_sin_idx#55 (word) y_sin_idx#1 +Identical Phi Values (signed word) x_pos#49 (signed word) x_pos#1 +Identical Phi Values (signed word) y_pos#49 (signed word) y_pos#1 +Identical Phi Values (byte) screen#15 (byte) screen#17 +Identical Phi Values (byte) y_pos_fine#31 (byte) y_pos_fine#33 +Identical Phi Values (byte) x_pos_fine#31 (byte) x_pos_fine#33 +Identical Phi Values (word) x_pos_coarse#61 (word) x_pos_coarse#14 +Identical Phi Values (word) y_pos_coarse#61 (word) y_pos_coarse#13 +Identical Phi Values (word) x_sin_idx#46 (word) x_sin_idx#48 +Identical Phi Values (word) y_sin_idx#46 (word) y_sin_idx#48 +Identical Phi Values (signed word) x_pos#40 (signed word) x_pos#42 +Identical Phi Values (signed word) y_pos#40 (signed word) y_pos#42 +Identical Phi Values (byte) screen#16 (byte) screen#17 +Identical Phi Values (byte) y_pos_fine#32 (byte) y_pos_fine#33 +Identical Phi Values (byte) x_pos_fine#32 (byte) x_pos_fine#33 +Identical Phi Values (word) x_pos_coarse#62 (word) x_pos_coarse#14 +Identical Phi Values (word) y_pos_coarse#62 (word) y_pos_coarse#13 +Identical Phi Values (word) x_sin_idx#47 (word) x_sin_idx#48 +Identical Phi Values (word) y_sin_idx#47 (word) y_sin_idx#48 +Identical Phi Values (signed word) x_pos#41 (signed word) x_pos#42 +Identical Phi Values (signed word) y_pos#41 (signed word) y_pos#42 +Identical Phi Values (byte) y_pos_fine#10 (byte) y_pos_fine#21 +Identical Phi Values (byte) x_pos_fine#10 (byte) x_pos_fine#21 +Identical Phi Values (byte) screen#18 (byte) screen#28 +Identical Phi Values (word) x_pos_coarse#21 (word) x_pos_coarse#59 +Identical Phi Values (word) y_pos_coarse#20 (word) y_pos_coarse#59 +Identical Phi Values (word) x_sin_idx#24 (word) x_sin_idx#40 +Identical Phi Values (word) y_sin_idx#24 (word) y_sin_idx#40 +Identical Phi Values (signed word) x_pos#18 (signed word) x_pos#34 +Identical Phi Values (signed word) y_pos#18 (signed word) y_pos#34 +Identical Phi Values (byte*) screencpy::src#1 (byte*) screencpy::src#0 +Identical Phi Values (byte*) screencpy::dst#1 (byte*) screencpy::dst#0 +Identical Phi Values (byte*) screencpy::src#2 (byte*) screencpy::src#1 +Identical Phi Values (byte*) screencpy::dst#2 (byte*) screencpy::dst#1 +Identical Phi Values (byte*) screencpy::src_250#1 (byte*) screencpy::src_250#0 +Identical Phi Values (byte*) screencpy::dst_250#1 (byte*) screencpy::dst_250#0 +Identical Phi Values (byte*) screencpy::src_500#1 (byte*) screencpy::src_500#0 +Identical Phi Values (byte*) screencpy::dst_500#1 (byte*) screencpy::dst_500#0 +Identical Phi Values (byte*) screencpy::src_750#1 (byte*) screencpy::src_750#0 +Identical Phi Values (byte*) screencpy::dst_750#1 (byte*) screencpy::dst_750#0 +Identical Phi Values (word) x_sin_idx#16 (word) x_sin_idx#11 +Identical Phi Values (word) y_sin_idx#16 (word) y_sin_idx#11 +Identical Phi Values (signed word) x_pos#12 (signed word) x_pos#10 +Identical Phi Values (signed word) y_pos#12 (signed word) y_pos#10 +Identical Phi Values (byte) x_pos_fine#13 (byte) x_pos_fine#11 +Identical Phi Values (word) x_pos_coarse#18 (word) x_pos_coarse#16 +Identical Phi Values (byte) y_pos_fine#13 (byte) y_pos_fine#11 +Identical Phi Values (word) y_pos_coarse#17 (word) y_pos_coarse#15 +Identical Phi Values (byte) screen#10 (byte) screen#1 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (void*) memset::return#0 (void*) memset::str#0 +Identical Phi Values (signed byte) main::x_movement#1 (signed byte) main::x_movement#0 +Identical Phi Values (word) x_pos_coarse#14 (word) x_pos_coarse#17 +Identical Phi Values (word) y_pos_coarse#13 (word) y_pos_coarse#16 +Identical Phi Values (byte*) main::screen_hidden#11 (byte*) main::screen_hidden#0 +Identical Phi Values (byte) screen#17 (byte) screen#12 +Identical Phi Values (byte) y_pos_fine#33 (byte) y_pos_fine#12 +Identical Phi Values (byte) x_pos_fine#33 (byte) x_pos_fine#12 +Identical Phi Values (word) x_sin_idx#48 (word) x_sin_idx#14 +Identical Phi Values (word) y_sin_idx#48 (word) y_sin_idx#13 +Identical Phi Values (signed word) x_pos#42 (signed word) x_pos#11 +Identical Phi Values (signed word) y_pos#42 (signed word) y_pos#11 +Identical Phi Values (byte) screen#7 (byte) screen#17 +Identical Phi Values (byte) y_pos_fine#23 (byte) y_pos_fine#33 +Identical Phi Values (byte) x_pos_fine#23 (byte) x_pos_fine#33 +Identical Phi Values (word) x_pos_coarse#60 (word) x_pos_coarse#14 +Identical Phi Values (word) y_pos_coarse#60 (word) y_pos_coarse#13 +Identical Phi Values (word) x_sin_idx#41 (word) x_sin_idx#48 +Identical Phi Values (word) y_sin_idx#41 (word) y_sin_idx#48 +Identical Phi Values (signed word) x_pos#35 (signed word) x_pos#42 +Identical Phi Values (signed word) y_pos#35 (signed word) y_pos#42 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (byte) y_pos_fine#21 (byte) y_pos_fine#12 +Identical Phi Values (byte) x_pos_fine#21 (byte) x_pos_fine#12 +Identical Phi Values (word) x_pos_coarse#59 (word) x_pos_coarse#17 +Identical Phi Values (word) y_pos_coarse#59 (word) y_pos_coarse#16 +Identical Phi Values (word) x_sin_idx#40 (word) x_sin_idx#14 +Identical Phi Values (word) y_sin_idx#40 (word) y_sin_idx#13 +Identical Phi Values (signed word) x_pos#34 (signed word) x_pos#11 +Identical Phi Values (signed word) y_pos#34 (signed word) y_pos#11 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (word) x_pos_coarse#9 (word) x_pos_coarse#17 +Identical Phi Values (word) y_pos_coarse#9 (word) y_pos_coarse#16 +Identical Phi Values (word) x_sin_idx#19 (word) x_sin_idx#14 +Identical Phi Values (word) y_sin_idx#19 (word) y_sin_idx#13 +Identical Phi Values (signed word) x_pos#15 (signed word) x_pos#11 +Identical Phi Values (signed word) y_pos#15 (signed word) y_pos#11 +Identical Phi Values (byte) x_pos_fine#16 (byte) x_pos_fine#12 +Identical Phi Values (byte) y_pos_fine#16 (byte) y_pos_fine#12 +Successful SSA optimization Pass2IdenticalPhiElimination +Simple Condition (bool~) memset::$1 [2] if((word) memset::num#0<=(byte) 0) goto memset::@1 +Simple Condition (bool~) memset::$3 [9] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@4 +Simple Condition (bool~) main::$6 [42] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2 +Simple Condition (bool~) main::$8 [45] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@3 +Simple Condition (bool~) main::$10 [52] if((signed byte) 0==(signed byte) main::movement#3) goto main::@26 +Simple Condition (bool~) main::$53 [54] if((byte) 0!=(byte) screen#12) goto main::@4 +Simple Condition (bool~) main::$54 [60] if((byte) 0!=(byte) screen#12) goto main::@7 +Simple Condition (bool~) main::$19 [68] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@10 +Simple Condition (bool~) main::$21 [77] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@13 +Simple Condition (bool~) main::$25 [86] if((byte) main::i#2<(byte) $28) goto main::@12 +Simple Condition (bool~) main::$31 [91] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@16 +Simple Condition (bool~) main::$30 [94] if((byte) main::i1#2<(byte) $28) goto main::@15 +Simple Condition (bool~) main::$33 [105] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@19 +Simple Condition (bool~) main::$37 [114] if((byte) main::i2#2<(byte) $19) goto main::@18 +Simple Condition (bool~) main::$42 [123] if((byte) main::i3#2<(byte) $19) goto main::@21 +Simple Condition (bool~) main::$43 [130] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@26 +Simple Condition (bool~) main::$44 [133] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@27 +Simple Condition (bool~) main::$55 [144] if((byte) 0!=(byte) screen#28) goto main::@30 +Simple Condition (bool~) screencpy::$6 [185] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 +Simple Condition (bool~) next_position::$1 [195] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 +Simple Condition (bool~) next_position::$3 [199] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 +Successful SSA optimization Pass2ConditionalJumpSimplification +Constant (const void*) memset::str#0 = (void*)MAIN_SCREEN0 +Constant (const byte) memset::c#0 = ' ' +Constant (const word) memset::num#0 = $3e8 +Constant (const byte*) main::toD0181_screen#0 = MAIN_SCREEN0 +Constant (const byte*) main::toD0181_gfx#0 = MAIN_CHARSET +Constant (const signed byte) main::movement#0 = 0 +Constant (const signed byte) main::movement#1 = -$28 +Constant (const signed byte) main::movement#2 = $28 +Constant (const byte*) main::$12 = MAIN_SCREEN1 +Constant (const byte*) main::$11 = MAIN_SCREEN0 +Constant (const byte*) main::$16 = MAIN_SCREEN0 +Constant (const byte*) main::$15 = MAIN_SCREEN1 +Constant (const byte) main::i1#0 = 0 +Constant (const byte) main::i#0 = 0 +Constant (const byte) main::i3#0 = 0 +Constant (const byte) main::i2#0 = 0 +Constant (const byte*) main::toD0182_screen#0 = MAIN_SCREEN1 +Constant (const byte*) main::toD0182_gfx#0 = MAIN_CHARSET +Constant (const byte*) main::toD0183_screen#0 = MAIN_SCREEN0 +Constant (const byte*) main::toD0183_gfx#0 = MAIN_CHARSET +Constant (const byte) screencpy::i#0 = 0 +Constant (const word) x_sin_idx#22 = 0 +Constant (const word) y_sin_idx#22 = (word)SINSIZE/4 +Constant (const signed word) x_pos#16 = 0 +Constant (const signed word) y_pos#16 = 0 +Constant (const byte) x_pos_fine#18 = 0 +Constant (const byte) y_pos_fine#18 = 0 +Constant (const word) x_pos_coarse#29 = 0 +Constant (const word) y_pos_coarse#25 = 0 +Constant (const byte) screen#19 = 0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) memset::$4 = (byte*)memset::str#0 +Constant (const byte*) memset::dst#0 = (byte*)memset::str#0 +Constant (const void*) memset::return#2 = memset::str#0 +Constant (const word) main::toD0181_$7 = (word)main::toD0181_screen#0 +Constant (const word) main::toD0182_$7 = (word)main::toD0182_screen#0 +Constant (const word) main::toD0183_$7 = (word)main::toD0183_screen#0 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (word)main::toD0181_gfx#0 in [26] (byte~) main::toD0181_$3 ← > (word)(const byte*) main::toD0181_gfx#0 +Constant value identified (word)main::toD0182_gfx#0 in [151] (byte~) main::toD0182_$3 ← > (word)(const byte*) main::toD0182_gfx#0 +Constant value identified (word)main::toD0183_gfx#0 in [162] (byte~) main::toD0183_$3 ← > (word)(const byte*) main::toD0183_gfx#0 +Successful SSA optimization Pass2ConstantValues +if() condition always false - eliminating [2] if((const word) memset::num#0<=(byte) 0) goto memset::@1 +Successful SSA optimization Pass2ConstantIfs +De-inlining pointer[w] to *(pointer+w) [203] (signed word) x_pos#11 ← *((const signed word*) SINTAB + (word~) next_position::$12) +De-inlining pointer[w] to *(pointer+w) [205] (signed word) y_pos#11 ← *((const signed word*) SINTAB + (word~) next_position::$13) +Successful SSA optimization Pass2DeInlineWordDerefIdx +Eliminating unused variable - keeping the phi block (word) x_sin_idx#11 +Eliminating unused variable - keeping the phi block (word) y_sin_idx#11 +Eliminating unused variable - keeping the phi block (signed word) x_pos#10 +Eliminating unused variable - keeping the phi block (signed word) y_pos#10 +Eliminating unused variable - keeping the phi block (byte) x_pos_fine#11 +Eliminating unused variable - keeping the phi block (word) x_pos_coarse#16 +Eliminating unused variable - keeping the phi block (byte) y_pos_fine#11 +Eliminating unused variable - keeping the phi block (word) y_pos_coarse#15 +Eliminating unused variable - keeping the phi block (byte) screen#1 +Eliminating unused constant (const void*) memset::return#2 +Eliminating unused constant (const signed word) x_pos#16 +Eliminating unused constant (const signed word) y_pos#16 +Eliminating unused constant (const byte) x_pos_fine#18 +Eliminating unused constant (const byte) y_pos_fine#18 +Eliminating unused constant (const word) x_pos_coarse#29 +Eliminating unused constant (const word) y_pos_coarse#25 +Successful SSA optimization PassNEliminateUnusedVars +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks +Removing unused procedure __start +Removing unused procedure block __start +Removing unused procedure block __start::__init1 +Removing unused procedure block __start::@1 +Removing unused procedure block __start::@2 +Removing unused procedure block __start::@return +Successful SSA optimization PassNEliminateEmptyStart +Simplifying constant integer cast (const nomodify word) SINSIZE/(byte) 4 +Successful SSA optimization PassNCastSimplification +Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memset::$4 + (const word) memset::num#0 +Constant right-side identified [8] (word~) main::toD0181_$0 ← (const word) main::toD0181_$7 & (word) $3fff +Constant right-side identified [11] (byte~) main::toD0181_$3 ← > (word)(const byte*) main::toD0181_gfx#0 +Constant right-side identified [98] (word~) main::toD0182_$0 ← (const word) main::toD0182_$7 & (word) $3fff +Constant right-side identified [101] (byte~) main::toD0182_$3 ← > (word)(const byte*) main::toD0182_gfx#0 +Constant right-side identified [106] (word~) main::toD0183_$0 ← (const word) main::toD0183_$7 & (word) $3fff +Constant right-side identified [109] (byte~) main::toD0183_$3 ← > (word)(const byte*) main::toD0183_gfx#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte*) memset::end#0 = memset::$4+memset::num#0 +Constant (const word) main::toD0181_$0 = main::toD0181_$7&$3fff +Constant (const byte) main::toD0181_$3 = >(word)main::toD0181_gfx#0 +Constant (const word) main::toD0182_$0 = main::toD0182_$7&$3fff +Constant (const byte) main::toD0182_$3 = >(word)main::toD0182_gfx#0 +Constant (const word) main::toD0183_$0 = main::toD0183_$7&$3fff +Constant (const byte) main::toD0183_$3 = >(word)main::toD0183_gfx#0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [7] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 * (byte) 4 +Constant right-side identified [9] (byte~) main::toD0181_$4 ← (const byte) main::toD0181_$3 / (byte) 4 +Constant right-side identified [95] (word~) main::toD0182_$1 ← (const word) main::toD0182_$0 * (byte) 4 +Constant right-side identified [97] (byte~) main::toD0182_$4 ← (const byte) main::toD0182_$3 / (byte) 4 +Constant right-side identified [101] (word~) main::toD0183_$1 ← (const word) main::toD0183_$0 * (byte) 4 +Constant right-side identified [103] (byte~) main::toD0183_$4 ← (const byte) main::toD0183_$3 / (byte) 4 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const word) main::toD0181_$1 = main::toD0181_$0*4 +Constant (const byte) main::toD0181_$4 = main::toD0181_$3/4 +Constant (const word) main::toD0182_$1 = main::toD0182_$0*4 +Constant (const byte) main::toD0182_$4 = main::toD0182_$3/4 +Constant (const word) main::toD0183_$1 = main::toD0183_$0*4 +Constant (const byte) main::toD0183_$4 = main::toD0183_$3/4 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [7] (byte~) main::toD0181_$2 ← > (const word) main::toD0181_$1 +Constant right-side identified [8] (byte~) main::toD0181_$5 ← (const byte) main::toD0181_$4 & (byte) $f +Constant right-side identified [93] (byte~) main::toD0182_$2 ← > (const word) main::toD0182_$1 +Constant right-side identified [94] (byte~) main::toD0182_$5 ← (const byte) main::toD0182_$4 & (byte) $f +Constant right-side identified [97] (byte~) main::toD0183_$2 ← > (const word) main::toD0183_$1 +Constant right-side identified [98] (byte~) main::toD0183_$5 ← (const byte) main::toD0183_$4 & (byte) $f +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_$2 = >main::toD0181_$1 +Constant (const byte) main::toD0181_$5 = main::toD0181_$4&$f +Constant (const byte) main::toD0182_$2 = >main::toD0182_$1 +Constant (const byte) main::toD0182_$5 = main::toD0182_$4&$f +Constant (const byte) main::toD0183_$2 = >main::toD0183_$1 +Constant (const byte) main::toD0183_$5 = main::toD0183_$4&$f +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [7] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$2 | (const byte) main::toD0181_$5 +Constant right-side identified [91] (byte) main::toD0182_return#0 ← (const byte) main::toD0182_$2 | (const byte) main::toD0182_$5 +Constant right-side identified [93] (byte) main::toD0183_return#0 ← (const byte) main::toD0183_$2 | (const byte) main::toD0183_$5 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_return#0 = main::toD0181_$2|main::toD0181_$5 +Constant (const byte) main::toD0182_return#0 = main::toD0182_$2|main::toD0182_$5 +Constant (const byte) main::toD0183_return#0 = main::toD0183_$2|main::toD0183_$5 +Successful SSA optimization Pass2ConstantIdentification +Rewriting multiplication to use shift and addition[94] (word~) petscii_ptr::$0 ← (word) petscii_ptr::row_y#4 * (byte) $8c +Rewriting multiplication to use shift [120] (word~) next_position::$12 ← (word) x_sin_idx#14 * (const byte) SIZEOF_SIGNED_WORD +Rewriting multiplication to use shift [123] (word~) next_position::$13 ← (word) y_sin_idx#13 * (const byte) SIZEOF_SIGNED_WORD +Rewriting division to use shift [131] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 / (byte) 8 +Rewriting division to use shift [137] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 / (byte) 8 +Successful SSA optimization Pass2MultiplyToShiftRewriting +Inlining constant with var siblings (const byte*) memset::dst#0 +Inlining constant with var siblings (const signed byte) main::movement#0 +Inlining constant with var siblings (const signed byte) main::movement#1 +Inlining constant with var siblings (const signed byte) main::movement#2 +Inlining constant with var siblings (const byte) main::i1#0 +Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte) main::i3#0 +Inlining constant with var siblings (const byte) main::i2#0 +Inlining constant with var siblings (const byte) screencpy::i#0 +Inlining constant with var siblings (const word) x_sin_idx#22 +Inlining constant with var siblings (const word) y_sin_idx#22 +Inlining constant with var siblings (const byte) screen#19 +Constant inlined main::toD0181_screen#0 = (const nomodify byte*) MAIN_SCREEN0 +Constant inlined main::toD0181_gfx#0 = (const nomodify byte*) MAIN_CHARSET +Constant inlined main::i3#0 = (byte) 0 +Constant inlined main::$12 = (const nomodify byte*) MAIN_SCREEN1 +Constant inlined main::toD0182_$4 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4 +Constant inlined main::toD0182_$5 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +Constant inlined main::$15 = (const nomodify byte*) MAIN_SCREEN1 +Constant inlined main::toD0182_$7 = (word)(const nomodify byte*) MAIN_SCREEN1 +Constant inlined main::toD0182_$0 = (word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff +Constant inlined screencpy::i#0 = (byte) 0 +Constant inlined main::toD0182_$1 = (word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff*(byte) 4 +Constant inlined main::toD0182_$2 = >(word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff*(byte) 4 +Constant inlined main::$11 = (const nomodify byte*) MAIN_SCREEN0 +Constant inlined main::toD0183_gfx#0 = (const nomodify byte*) MAIN_CHARSET +Constant inlined main::toD0182_$3 = >(word)(const nomodify byte*) MAIN_CHARSET +Constant inlined main::toD0183_$0 = (word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff +Constant inlined main::$16 = (const nomodify byte*) MAIN_SCREEN0 +Constant inlined memset::$4 = (byte*)(const void*) memset::str#0 +Constant inlined main::i1#0 = (byte) 0 +Constant inlined main::i#0 = (byte) 0 +Constant inlined main::i2#0 = (byte) 0 +Constant inlined main::toD0181_$7 = (word)(const nomodify byte*) MAIN_SCREEN0 +Constant inlined main::toD0182_gfx#0 = (const nomodify byte*) MAIN_CHARSET +Constant inlined main::toD0181_$2 = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4 +Constant inlined main::toD0183_$5 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +Constant inlined y_sin_idx#22 = (const nomodify word) SINSIZE/(byte) 4 +Constant inlined main::toD0181_$1 = (word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4 +Constant inlined main::toD0183_$7 = (word)(const nomodify byte*) MAIN_SCREEN0 +Constant inlined main::toD0181_$0 = (word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff +Constant inlined main::toD0183_$1 = (word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4 +Constant inlined screen#19 = (byte) 0 +Constant inlined main::toD0181_$5 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +Constant inlined main::toD0183_$2 = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4 +Constant inlined main::toD0183_screen#0 = (const nomodify byte*) MAIN_SCREEN0 +Constant inlined main::toD0183_$3 = >(word)(const nomodify byte*) MAIN_CHARSET +Constant inlined main::toD0181_$4 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4 +Constant inlined main::toD0181_$3 = >(word)(const nomodify byte*) MAIN_CHARSET +Constant inlined main::toD0183_$4 = >(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4 +Constant inlined main::movement#2 = (signed byte) $28 +Constant inlined main::movement#1 = (signed byte) -$28 +Constant inlined main::movement#0 = (signed byte) 0 +Constant inlined main::toD0182_screen#0 = (const nomodify byte*) MAIN_SCREEN1 +Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0 +Constant inlined x_sin_idx#22 = (word) 0 +Successful SSA optimization Pass2ConstantInlining +Consolidated constant in assignment next_position::x_pos_u#0 +Consolidated constant in assignment next_position::y_pos_u#0 +Successful SSA optimization Pass2ConstantAdditionElimination +Alias petscii_ptr::$0 = petscii_ptr::$7 +Alias next_position::$4 = next_position::$14 +Alias next_position::$8 = next_position::$16 +Successful SSA optimization Pass2AliasElimination +Eliminating unused constant (const byte) SIZEOF_SIGNED_WORD +Successful SSA optimization PassNEliminateUnusedVars +Added new block during phi lifting main::@47(between main::@26 and main::@26) +Added new block during phi lifting main::@48(between main::@3 and main::@26) +Added new block during phi lifting next_position::@5(between next_position and next_position::@1) +Added new block during phi lifting next_position::@6(between next_position::@1 and next_position::@2) +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@35 +Adding NOP phi() at start of main::@39 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::toD0181_@return +Adding NOP phi() at start of main::@40 +Adding NOP phi() at start of main::@33 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::@8 +Adding NOP phi() at start of main::@29 +Adding NOP phi() at start of main::toD0183 +Adding NOP phi() at start of main::toD0183_@return +Adding NOP phi() at start of main::@30 +Adding NOP phi() at start of main::toD0182 +Adding NOP phi() at start of main::toD0182_@return +Adding NOP phi() at start of main::@7 +Adding NOP phi() at start of main::@4 +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of memset +Adding NOP phi() at start of memset::@2 +Adding NOP phi() at start of memset::@1 +CALL GRAPH +Calls in [main] to memset:3 next_position:8 next_position:15 screencpy:35 petscii_ptr:42 petscii_ptr:53 petscii_ptr:97 petscii_ptr:119 + +Created 21 initial phi equivalence classes +Coalesced [13] x_sin_idx#73 ← x_sin_idx#14 +Coalesced [14] y_sin_idx#73 ← y_sin_idx#13 +Coalesced [40] petscii_ptr::row_y#7 ← petscii_ptr::row_y#1 +Coalesced [41] petscii_ptr::row_x#7 ← petscii_ptr::row_x#1 +Coalesced [51] petscii_ptr::row_y#8 ← petscii_ptr::row_y#3 +Coalesced [52] petscii_ptr::row_x#8 ← petscii_ptr::row_x#3 +Coalesced [56] main::petscii2#5 ← main::petscii2#0 +Coalesced [57] main::scrn2#5 ← main::screen_hidden#0 +Coalesced [61] screen#64 ← screen#0 +Coalesced [80] screen#63 ← screen#28 +Coalesced (already) [85] screen#65 ← screen#28 +Coalesced [90] main::i2#4 ← main::i2#1 +Coalesced [91] main::petscii2#4 ← main::petscii2#1 +Coalesced [92] main::scrn2#4 ← main::scrn2#1 +Coalesced [95] petscii_ptr::row_y#6 ← petscii_ptr::row_y#2 +Coalesced [96] petscii_ptr::row_x#6 ← petscii_ptr::row_x#2 +Coalesced [101] main::petscii3#5 ← main::petscii3#0 +Coalesced [102] main::scrn3#5 ← main::scrn3#0 +Coalesced [109] main::i3#4 ← main::i3#1 +Coalesced [110] main::petscii3#4 ← main::petscii3#1 +Coalesced [111] main::scrn3#4 ← main::scrn3#1 +Coalesced [114] main::i#4 ← main::i#1 +Coalesced [117] petscii_ptr::row_y#5 ← petscii_ptr::row_y#0 +Coalesced [118] petscii_ptr::row_x#5 ← petscii_ptr::row_x#0 +Coalesced [127] main::i1#4 ← main::i1#1 +Coalesced (already) [130] screen#66 ← screen#12 +Coalesced [140] memset::dst#4 ← memset::dst#1 +Coalesced [145] x_sin_idx#75 ← x_sin_idx#4 +Coalesced [150] y_sin_idx#75 ← y_sin_idx#4 +Coalesced [169] y_sin_idx#74 ← y_sin_idx#14 +Coalesced [170] x_sin_idx#74 ← x_sin_idx#13 +Coalesced [185] screencpy::i#4 ← screencpy::i#1 +Coalesced down to 17 phi equivalence classes +Culled Empty Block (label) main::@39 +Culled Empty Block (label) main::toD0181_@return +Culled Empty Block (label) main::@40 +Culled Empty Block (label) main::@5 +Culled Empty Block (label) main::@8 +Culled Empty Block (label) main::@29 +Culled Empty Block (label) main::toD0183_@return +Culled Empty Block (label) main::@30 +Culled Empty Block (label) main::toD0182_@return +Culled Empty Block (label) main::@47 +Culled Empty Block (label) main::@48 +Culled Empty Block (label) main::@2 +Culled Empty Block (label) memset::@2 +Culled Empty Block (label) memset::@1 +Culled Empty Block (label) next_position::@6 +Culled Empty Block (label) next_position::@5 +Renumbering block memset::@3 to memset::@1 +Renumbering block memset::@4 to memset::@2 +Renumbering block main::@3 to main::@2 +Renumbering block main::@4 to main::@3 +Renumbering block main::@6 to main::@4 +Renumbering block main::@7 to main::@5 +Renumbering block main::@9 to main::@6 +Renumbering block main::@10 to main::@7 +Renumbering block main::@11 to main::@8 +Renumbering block main::@12 to main::@9 +Renumbering block main::@13 to main::@10 +Renumbering block main::@14 to main::@11 +Renumbering block main::@15 to main::@12 +Renumbering block main::@16 to main::@13 +Renumbering block main::@17 to main::@14 +Renumbering block main::@18 to main::@15 +Renumbering block main::@19 to main::@16 +Renumbering block main::@20 to main::@17 +Renumbering block main::@21 to main::@18 +Renumbering block main::@22 to main::@19 +Renumbering block main::@23 to main::@20 +Renumbering block main::@24 to main::@21 +Renumbering block main::@25 to main::@22 +Renumbering block main::@26 to main::@23 +Renumbering block main::@27 to main::@24 +Renumbering block main::@28 to main::@25 +Renumbering block main::@31 to main::@26 +Renumbering block main::@32 to main::@27 +Renumbering block main::@33 to main::@28 +Renumbering block main::@34 to main::@29 +Renumbering block main::@35 to main::@30 +Renumbering block main::@36 to main::@31 +Renumbering block main::@37 to main::@32 +Renumbering block main::@38 to main::@33 +Renumbering block main::@41 to main::@34 +Renumbering block main::@42 to main::@35 +Renumbering block main::@43 to main::@36 +Renumbering block main::@44 to main::@37 +Renumbering block main::@45 to main::@38 +Renumbering block main::@46 to main::@39 +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@30 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::@28 +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::toD0183 +Adding NOP phi() at start of main::toD0182 +Adding NOP phi() at start of memset + +FINAL CONTROL FLOW GRAPH + +(void()) main() +main: scope:[main] from + [0] phi() + to:main::sei1 +main::sei1: scope:[main] from main + asm { sei } + to:main::@30 +main::@30: scope:[main] from main::sei1 + [2] phi() + [3] call memset + to:main::toD0181 +main::toD0181: scope:[main] from main::@30 + [4] phi() + to:main::@31 +main::@31: scope:[main] from main::toD0181 + [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0 + [6] call next_position + to:main::@1 +main::@1: scope:[main] from main::@26 main::@31 + [7] (byte) screen#12 ← phi( main::@26/(byte) screen#28 main::@31/(byte) 0 ) + [8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17 + [9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16 + [10] call next_position + to:main::@34 +main::@34: scope:[main] from main::@1 + [11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16 + [12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 + [13] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2 + to:main::@27 +main::@27: scope:[main] from main::@34 + [14] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@2 + to:main::@28 +main::@28: scope:[main] from main::@27 + [15] phi() + to:main::@2 +main::@2: scope:[main] from main::@27 main::@28 main::@34 + [16] (signed byte) main::movement#4 ← phi( main::@34/(signed byte) -$28 main::@27/(signed byte) 0 main::@28/(signed byte) $28 ) + [17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17 + [18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 + [19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 + [20] if((signed byte) 0==(signed byte) main::movement#3) goto main::@23 + to:main::@29 +main::@29: scope:[main] from main::@2 + [21] if((byte) 0!=(byte) screen#12) goto main::@3 + to:main::@4 +main::@3: scope:[main] from main::@29 + [22] phi() + to:main::@4 +main::@4: scope:[main] from main::@29 main::@3 + [23] (byte*~) main::$13 ← phi( main::@3/(const nomodify byte*) MAIN_SCREEN1 main::@29/(const nomodify byte*) MAIN_SCREEN0 ) + [24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3 + [25] if((byte) 0!=(byte) screen#12) goto main::@5 + to:main::@6 +main::@5: scope:[main] from main::@4 + [26] phi() + to:main::@6 +main::@6: scope:[main] from main::@4 main::@5 + [27] (byte*) main::screen_hidden#0 ← phi( main::@5/(const nomodify byte*) MAIN_SCREEN0 main::@4/(const nomodify byte*) MAIN_SCREEN1 ) + [28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 + [29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0 + [30] call screencpy + to:main::@35 +main::@35: scope:[main] from main::@6 + [31] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@7 + to:main::@19 +main::@19: scope:[main] from main::@35 + [32] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@10 + to:main::@20 +main::@20: scope:[main] from main::@19 + [33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14 + [34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c + [35] call petscii_ptr + [36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10 + to:main::@37 +main::@37: scope:[main] from main::@20 + [37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1 + to:main::@8 +main::@8: scope:[main] from main::@37 main::@9 + [38] (byte) main::i#2 ← phi( main::@9/(byte) main::i#1 main::@37/(byte) 0 ) + [39] if((byte) main::i#2<(byte) $28) goto main::@9 + to:main::@10 +main::@10: scope:[main] from main::@11 main::@19 main::@8 + [40] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@13 + to:main::@21 +main::@21: scope:[main] from main::@10 + [41] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@16 + to:main::@22 +main::@22: scope:[main] from main::@21 + [42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14 + [43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c + [44] call petscii_ptr + [45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10 + to:main::@39 +main::@39: scope:[main] from main::@22 + [46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3 + to:main::@14 +main::@14: scope:[main] from main::@15 main::@39 + [47] (byte*) main::scrn2#2 ← phi( main::@15/(byte*) main::scrn2#1 main::@39/(byte*) main::screen_hidden#0 ) + [47] (byte*) main::petscii2#2 ← phi( main::@15/(byte*) main::petscii2#1 main::@39/(byte*) main::petscii2#0 ) + [47] (byte) main::i2#2 ← phi( main::@15/(byte) main::i2#1 main::@39/(byte) 0 ) + [48] if((byte) main::i2#2<(byte) $19) goto main::@15 + to:main::@16 +main::@16: scope:[main] from main::@14 main::@17 main::@21 + [49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1 + to:main::@23 +main::@23: scope:[main] from main::@16 main::@2 main::@23 + [50] (byte) screen#28 ← phi( main::@16/(byte) screen#0 main::@23/(byte) screen#28 main::@2/(byte) screen#12 ) + [51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23 + to:main::@24 +main::@24: scope:[main] from main::@23 main::@24 + [52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24 + to:main::@25 +main::@25: scope:[main] from main::@24 + [53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE + [54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 + [55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12 + [56] (byte~) main::$47 ← (byte~) main::$45 | (byte~) main::$46 + [57] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (byte~) main::$47 + [58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 + [59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12 + [60] (byte~) main::$50 ← (byte~) main::$48 | (byte~) main::$49 + [61] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte~) main::$50 + [62] if((byte) 0!=(byte) screen#28) goto main::toD0182 + to:main::toD0183 +main::toD0183: scope:[main] from main::@25 + [63] phi() + to:main::@33 +main::@33: scope:[main] from main::toD0183 + [64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0 + to:main::@26 +main::@26: scope:[main] from main::@32 main::@33 + [65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK + to:main::@1 +main::toD0182: scope:[main] from main::@25 + [66] phi() + to:main::@32 +main::@32: scope:[main] from main::toD0182 + [67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0 + to:main::@26 +main::@15: scope:[main] from main::@14 + [68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) + [69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28 + [70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c + [71] (byte) main::i2#1 ← ++ (byte) main::i2#2 + to:main::@14 +main::@13: scope:[main] from main::@10 + [72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13 + [73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c + [74] call petscii_ptr + [75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10 + to:main::@38 +main::@38: scope:[main] from main::@13 + [76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2 + [77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27 + to:main::@17 +main::@17: scope:[main] from main::@18 main::@38 + [78] (byte*) main::scrn3#2 ← phi( main::@18/(byte*) main::scrn3#1 main::@38/(byte*) main::scrn3#0 ) + [78] (byte*) main::petscii3#2 ← phi( main::@18/(byte*) main::petscii3#1 main::@38/(byte*) main::petscii3#0 ) + [78] (byte) main::i3#2 ← phi( main::@18/(byte) main::i3#1 main::@38/(byte) 0 ) + [79] if((byte) main::i3#2<(byte) $19) goto main::@18 + to:main::@16 +main::@18: scope:[main] from main::@17 + [80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) + [81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28 + [82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c + [83] (byte) main::i3#1 ← ++ (byte) main::i3#2 + to:main::@17 +main::@9: scope:[main] from main::@8 + [84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2) + [85] (byte) main::i#1 ← ++ (byte) main::i#2 + to:main::@8 +main::@7: scope:[main] from main::@35 + [86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14 + [87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c + [88] call petscii_ptr + [89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10 + to:main::@36 +main::@36: scope:[main] from main::@7 + [90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0 + [91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28 + to:main::@11 +main::@11: scope:[main] from main::@12 main::@36 + [92] (byte) main::i1#2 ← phi( main::@12/(byte) main::i1#1 main::@36/(byte) 0 ) + [93] if((byte) main::i1#2<(byte) $28) goto main::@12 + to:main::@10 +main::@12: scope:[main] from main::@11 + [94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2) + [95] (byte) main::i1#1 ← ++ (byte) main::i1#2 + to:main::@11 + +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +memset: scope:[memset] from main::@30 + [96] phi() + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@2 + [97] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 ) + [98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [99] return + to:@return +memset::@2: scope:[memset] from memset::@1 + [100] *((byte*) memset::dst#2) ← (const byte) memset::c#0 + [101] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + to:memset::@1 + +(void()) next_position() +next_position: scope:[next_position] from main::@1 main::@31 + [102] (word) y_sin_idx#12 ← phi( main::@1/(word) y_sin_idx#13 main::@31/(const nomodify word) SINSIZE/(byte) 4 ) + [102] (word) x_sin_idx#12 ← phi( main::@1/(word) x_sin_idx#14 main::@31/(word) 0 ) + [103] (word) x_sin_idx#13 ← ++ (word) x_sin_idx#12 + [104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 + to:next_position::@3 +next_position::@3: scope:[next_position] from next_position + [105] (word) x_sin_idx#4 ← (word) x_sin_idx#13 - (const nomodify word) SINSIZE + to:next_position::@1 +next_position::@1: scope:[next_position] from next_position next_position::@3 + [106] (word) x_sin_idx#14 ← phi( next_position/(word) x_sin_idx#13 next_position::@3/(word) x_sin_idx#4 ) + [107] (word) y_sin_idx#14 ← ++ (word) y_sin_idx#12 + [108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 + to:next_position::@4 +next_position::@4: scope:[next_position] from next_position::@1 + [109] (word) y_sin_idx#4 ← (word) y_sin_idx#14 - (const nomodify word) SINSIZE + to:next_position::@2 +next_position::@2: scope:[next_position] from next_position::@1 next_position::@4 + [110] (word) y_sin_idx#13 ← phi( next_position::@1/(word) y_sin_idx#14 next_position::@4/(word) y_sin_idx#4 ) + [111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1 + [112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12 + [113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18) + [114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1 + [115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13 + [116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19) + [117] (word~) next_position::$4 ← (word)(signed word) x_pos#11 + [118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8 + [119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 + [120] (byte) x_pos_fine#12 ← (byte~) next_position::$15 & (byte) 7 + [121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3 + [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 + [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 + [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 + [125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7 + [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 + to:next_position::@return +next_position::@return: scope:[next_position] from next_position::@2 + [127] return + to:@return + +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +screencpy: scope:[screencpy] from main::@6 + [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa + [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa + [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 + [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 + [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee + [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee + to:screencpy::@1 +screencpy::@1: scope:[screencpy] from screencpy screencpy::@2 + [134] (byte) screencpy::i#2 ← phi( screencpy/(byte) 0 screencpy::@2/(byte) screencpy::i#1 ) + [135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 + to:screencpy::@return +screencpy::@return: scope:[screencpy] from screencpy::@1 + [136] return + to:@return +screencpy::@2: scope:[screencpy] from screencpy::@1 + [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) + [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) + [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) + [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) + [141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2 + to:screencpy::@1 + +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +petscii_ptr: scope:[petscii_ptr] from main::@13 main::@20 main::@22 main::@7 + [142] (word) petscii_ptr::row_x#4 ← phi( main::@7/(word) petscii_ptr::row_x#0 main::@13/(word) petscii_ptr::row_x#2 main::@20/(word) petscii_ptr::row_x#1 main::@22/(word) petscii_ptr::row_x#3 ) + [142] (word) petscii_ptr::row_y#4 ← phi( main::@7/(word) petscii_ptr::row_y#0 main::@13/(word) petscii_ptr::row_y#2 main::@20/(word) petscii_ptr::row_y#1 main::@22/(word) petscii_ptr::row_y#3 ) + [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 + [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 + [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 + [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 + [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 + [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 + [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 + to:petscii_ptr::@return +petscii_ptr::@return: scope:[petscii_ptr] from petscii_ptr + [150] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(byte) MOS6526_CIA::INTERRUPT +(byte) MOS6526_CIA::PORT_A +(byte) MOS6526_CIA::PORT_A_DDR +(byte) MOS6526_CIA::PORT_B +(byte) MOS6526_CIA::PORT_B_DDR +(byte) MOS6526_CIA::SERIAL_DATA +(word) MOS6526_CIA::TIMER_A +(byte) MOS6526_CIA::TIMER_A_CONTROL +(word) MOS6526_CIA::TIMER_B +(byte) MOS6526_CIA::TIMER_B_CONTROL +(byte) MOS6526_CIA::TOD_10THS +(byte) MOS6526_CIA::TOD_HOURS +(byte) MOS6526_CIA::TOD_MIN +(byte) MOS6526_CIA::TOD_SEC +(byte) MOS6569_VICII::BG_COLOR +(byte) MOS6569_VICII::BG_COLOR1 +(byte) MOS6569_VICII::BG_COLOR2 +(byte) MOS6569_VICII::BG_COLOR3 +(byte) MOS6569_VICII::BORDER_COLOR +(byte) MOS6569_VICII::CONTROL1 +(byte) MOS6569_VICII::CONTROL2 +(byte) MOS6569_VICII::IRQ_ENABLE +(byte) MOS6569_VICII::IRQ_STATUS +(byte) MOS6569_VICII::LIGHTPEN_X +(byte) MOS6569_VICII::LIGHTPEN_Y +(byte) MOS6569_VICII::MEMORY +(byte) MOS6569_VICII::RASTER +(byte) MOS6569_VICII::SPRITE0_COLOR +(byte) MOS6569_VICII::SPRITE0_X +(byte) MOS6569_VICII::SPRITE0_Y +(byte) MOS6569_VICII::SPRITE1_COLOR +(byte) MOS6569_VICII::SPRITE1_X +(byte) MOS6569_VICII::SPRITE1_Y +(byte) MOS6569_VICII::SPRITE2_COLOR +(byte) MOS6569_VICII::SPRITE2_X +(byte) MOS6569_VICII::SPRITE2_Y +(byte) MOS6569_VICII::SPRITE3_COLOR +(byte) MOS6569_VICII::SPRITE3_X +(byte) MOS6569_VICII::SPRITE3_Y +(byte) MOS6569_VICII::SPRITE4_COLOR +(byte) MOS6569_VICII::SPRITE4_X +(byte) MOS6569_VICII::SPRITE4_Y +(byte) MOS6569_VICII::SPRITE5_COLOR +(byte) MOS6569_VICII::SPRITE5_X +(byte) MOS6569_VICII::SPRITE5_Y +(byte) MOS6569_VICII::SPRITE6_COLOR +(byte) MOS6569_VICII::SPRITE6_X +(byte) MOS6569_VICII::SPRITE6_Y +(byte) MOS6569_VICII::SPRITE7_COLOR +(byte) MOS6569_VICII::SPRITE7_X +(byte) MOS6569_VICII::SPRITE7_Y +(byte) MOS6569_VICII::SPRITES_BG_COLLISION +(byte) MOS6569_VICII::SPRITES_COLLISION +(byte) MOS6569_VICII::SPRITES_ENABLE +(byte) MOS6569_VICII::SPRITES_EXPAND_X +(byte) MOS6569_VICII::SPRITES_EXPAND_Y +(byte) MOS6569_VICII::SPRITES_MC +(byte) MOS6569_VICII::SPRITES_MCOLOR1 +(byte) MOS6569_VICII::SPRITES_MCOLOR2 +(byte) MOS6569_VICII::SPRITES_PRIORITY +(byte) MOS6569_VICII::SPRITES_XMSB +(byte) MOS6581_SID::CH1_ATTACK_DECAY +(byte) MOS6581_SID::CH1_CONTROL +(word) MOS6581_SID::CH1_FREQ +(word) MOS6581_SID::CH1_PULSE_WIDTH +(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH2_ATTACK_DECAY +(byte) MOS6581_SID::CH2_CONTROL +(word) MOS6581_SID::CH2_FREQ +(word) MOS6581_SID::CH2_PULSE_WIDTH +(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH3_ATTACK_DECAY +(byte) MOS6581_SID::CH3_CONTROL +(byte) MOS6581_SID::CH3_ENV +(word) MOS6581_SID::CH3_FREQ +(byte) MOS6581_SID::CH3_OSC +(word) MOS6581_SID::CH3_PULSE_WIDTH +(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE +(byte) MOS6581_SID::FILTER_CUTOFF_HIGH +(byte) MOS6581_SID::FILTER_CUTOFF_LOW +(byte) MOS6581_SID::FILTER_SETUP +(byte) MOS6581_SID::POT_X +(byte) MOS6581_SID::POT_Y +(byte) MOS6581_SID::VOLUME_FILTER_MODE +(void()) main() +(byte*~) main::$13 11.0 +(byte~) main::$45 11.0 +(byte~) main::$46 22.0 +(byte~) main::$47 22.0 +(byte~) main::$48 11.0 +(byte~) main::$49 22.0 +(word~) main::$5 11.0 +(byte~) main::$50 22.0 +(word~) main::$9 11.0 +(byte) main::i +(byte) main::i#1 202.0 +(byte) main::i#2 168.33333333333331 +(byte) main::i1 +(byte) main::i1#1 202.0 +(byte) main::i1#2 168.33333333333331 +(byte) main::i2 +(byte) main::i2#1 202.0 +(byte) main::i2#2 60.599999999999994 +(byte) main::i3 +(byte) main::i3#1 202.0 +(byte) main::i3#2 60.599999999999994 +(signed byte) main::movement +(signed byte) main::movement#3 6.6000000000000005 +(signed byte) main::movement#4 3.6666666666666665 +(byte*) main::petscii +(byte*) main::petscii#0 22.4 +(byte*) main::petscii1 +(byte*) main::petscii1#0 18.666666666666664 +(byte*) main::petscii2 +(byte*) main::petscii2#0 22.0 +(byte*) main::petscii2#1 101.0 +(byte*) main::petscii2#2 78.5 +(byte*) main::petscii3 +(byte*) main::petscii3#0 11.0 +(byte*) main::petscii3#1 101.0 +(byte*) main::petscii3#2 78.5 +(byte*) main::screen_active +(byte*) main::screen_active#0 4.4 +(byte*) main::screen_hidden +(byte*) main::screen_hidden#0 3.9189189189189193 +(byte*) main::scrn +(byte*) main::scrn1 +(byte*) main::scrn1#0 22.4 +(byte*) main::scrn2 +(byte*) main::scrn2#1 67.33333333333333 +(byte*) main::scrn2#2 104.66666666666666 +(byte*) main::scrn3 +(byte*) main::scrn3#0 22.0 +(byte*) main::scrn3#1 67.33333333333333 +(byte*) main::scrn3#2 104.66666666666666 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(byte*) main::toD0181_screen +(byte*) main::toD0182_gfx +(byte) main::toD0182_return +(byte*) main::toD0182_screen +(byte*) main::toD0183_gfx +(byte) main::toD0183_return +(byte*) main::toD0183_screen +(signed byte) main::x_movement +(signed byte) main::x_movement#0 1.2571428571428571 +(word) main::x_pos_coarse_old +(word) main::x_pos_coarse_old#0 2.4444444444444446 +(signed byte) main::y_movement +(signed byte) main::y_movement#0 2.75 +(word) main::y_pos_coarse_old +(word) main::y_pos_coarse_old#0 11.0 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(byte) memset::c +(byte*) memset::dst +(byte*) memset::dst#1 202.0 +(byte*) memset::dst#2 134.66666666666666 +(byte*) memset::end +(word) memset::num +(void*) memset::return +(void*) memset::str +(void()) next_position() +(word~) next_position::$12 202.0 +(word~) next_position::$13 202.0 +(byte~) next_position::$15 202.0 +(byte~) next_position::$17 202.0 +(signed word*~) next_position::$18 202.0 +(signed word*~) next_position::$19 202.0 +(word~) next_position::$4 202.0 +(word~) next_position::$8 202.0 +(word) next_position::x_pos_u +(word) next_position::x_pos_u#0 67.33333333333333 +(word) next_position::y_pos_u +(word) next_position::y_pos_u#0 67.33333333333333 +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +(word~) petscii_ptr::$0 202.0 +(byte*~) petscii_ptr::$1 202.0 +(word~) petscii_ptr::$3 202.0 +(word~) petscii_ptr::$4 202.0 +(word~) petscii_ptr::$5 202.0 +(word~) petscii_ptr::$6 202.0 +(byte*) petscii_ptr::return +(byte*) petscii_ptr::return#0 22.0 +(byte*) petscii_ptr::return#1 22.0 +(byte*) petscii_ptr::return#10 24.166666666666664 +(byte*) petscii_ptr::return#2 22.0 +(byte*) petscii_ptr::return#3 22.0 +(word) petscii_ptr::row_x +(word) petscii_ptr::row_x#0 11.0 +(word) petscii_ptr::row_x#1 11.0 +(word) petscii_ptr::row_x#2 11.0 +(word) petscii_ptr::row_x#3 11.0 +(word) petscii_ptr::row_x#4 20.714285714285715 +(word) petscii_ptr::row_y +(word) petscii_ptr::row_y#0 22.0 +(word) petscii_ptr::row_y#1 22.0 +(word) petscii_ptr::row_y#2 22.0 +(word) petscii_ptr::row_y#3 22.0 +(word) petscii_ptr::row_y#4 86.75 +(byte) screen +(byte) screen#0 22.0 +(byte) screen#12 0.7857142857142857 +(byte) screen#28 13.666666666666666 +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +(byte*) screencpy::dst +(byte*) screencpy::dst#0 687.6666666666666 +(byte*) screencpy::dst_250 +(byte*) screencpy::dst_250#0 841.8333333333333 +(byte*) screencpy::dst_500 +(byte*) screencpy::dst_500#0 1010.2 +(byte*) screencpy::dst_750 +(byte*) screencpy::dst_750#0 1262.75 +(byte) screencpy::i +(byte) screencpy::i#1 20002.0 +(byte) screencpy::i#2 18335.166666666668 +(byte*) screencpy::src +(byte*) screencpy::src#0 736.7857142857143 +(byte*) screencpy::src_250 +(byte*) screencpy::src_250#0 777.076923076923 +(byte*) screencpy::src_500 +(byte*) screencpy::src_500#0 918.3636363636363 +(byte*) screencpy::src_750 +(byte*) screencpy::src_750#0 1122.4444444444443 +(signed word) x_pos +(signed word) x_pos#11 25.25 +(word) x_pos_coarse +(word) x_pos_coarse#17 1.7578947368421054 +(byte) x_pos_fine +(byte) x_pos_fine#12 1.3176470588235294 +(word) x_sin_idx +(word) x_sin_idx#12 112.0 +(word) x_sin_idx#13 202.0 +(word) x_sin_idx#14 2.803571428571429 +(word) x_sin_idx#4 202.0 +(signed word) y_pos +(signed word) y_pos#11 16.833333333333332 +(word) y_pos_coarse +(word) y_pos_coarse#16 1.8351648351648353 +(byte) y_pos_fine +(byte) y_pos_fine#12 1.473684210526316 +(word) y_sin_idx +(word) y_sin_idx#12 22.4 +(word) y_sin_idx#13 2.9074074074074074 +(word) y_sin_idx#14 202.0 +(word) y_sin_idx#4 202.0 + +Initial phi equivalence classes +[ screen#12 screen#28 screen#0 ] +[ main::movement#4 ] +[ main::$13 ] +[ main::i#2 main::i#1 ] +[ main::i2#2 main::i2#1 ] +[ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] +[ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] +[ main::i3#2 main::i3#1 ] +[ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] +[ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] +[ main::i1#2 main::i1#1 ] +[ memset::dst#2 memset::dst#1 ] +[ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] +[ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +[ screencpy::i#2 screencpy::i#1 ] +[ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] +[ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] +Added variable main::x_pos_coarse_old#0 to live range equivalence class [ main::x_pos_coarse_old#0 ] +Added variable main::y_pos_coarse_old#0 to live range equivalence class [ main::y_pos_coarse_old#0 ] +Added variable main::$5 to live range equivalence class [ main::$5 ] +Added variable main::y_movement#0 to live range equivalence class [ main::y_movement#0 ] +Added variable main::$9 to live range equivalence class [ main::$9 ] +Added variable main::x_movement#0 to live range equivalence class [ main::x_movement#0 ] +Added variable main::movement#3 to live range equivalence class [ main::movement#3 ] +Added variable main::screen_active#0 to live range equivalence class [ main::screen_active#0 ] +Added variable screencpy::dst#0 to live range equivalence class [ screencpy::dst#0 ] +Added variable screencpy::src#0 to live range equivalence class [ screencpy::src#0 ] +Added variable petscii_ptr::return#1 to live range equivalence class [ petscii_ptr::return#1 ] +Added variable main::petscii#0 to live range equivalence class [ main::petscii#0 ] +Added variable petscii_ptr::return#3 to live range equivalence class [ petscii_ptr::return#3 ] +Added variable main::$45 to live range equivalence class [ main::$45 ] +Added variable main::$46 to live range equivalence class [ main::$46 ] +Added variable main::$47 to live range equivalence class [ main::$47 ] +Added variable main::$48 to live range equivalence class [ main::$48 ] +Added variable main::$49 to live range equivalence class [ main::$49 ] +Added variable main::$50 to live range equivalence class [ main::$50 ] +Added variable petscii_ptr::return#2 to live range equivalence class [ petscii_ptr::return#2 ] +Added variable petscii_ptr::return#0 to live range equivalence class [ petscii_ptr::return#0 ] +Added variable main::petscii1#0 to live range equivalence class [ main::petscii1#0 ] +Added variable main::scrn1#0 to live range equivalence class [ main::scrn1#0 ] +Added variable next_position::$12 to live range equivalence class [ next_position::$12 ] +Added variable next_position::$18 to live range equivalence class [ next_position::$18 ] +Added variable x_pos#11 to live range equivalence class [ x_pos#11 ] +Added variable next_position::$13 to live range equivalence class [ next_position::$13 ] +Added variable next_position::$19 to live range equivalence class [ next_position::$19 ] +Added variable y_pos#11 to live range equivalence class [ y_pos#11 ] +Added variable next_position::$4 to live range equivalence class [ next_position::$4 ] +Added variable next_position::x_pos_u#0 to live range equivalence class [ next_position::x_pos_u#0 ] +Added variable next_position::$15 to live range equivalence class [ next_position::$15 ] +Added variable x_pos_fine#12 to live range equivalence class [ x_pos_fine#12 ] +Added variable x_pos_coarse#17 to live range equivalence class [ x_pos_coarse#17 ] +Added variable next_position::$8 to live range equivalence class [ next_position::$8 ] +Added variable next_position::y_pos_u#0 to live range equivalence class [ next_position::y_pos_u#0 ] +Added variable next_position::$17 to live range equivalence class [ next_position::$17 ] +Added variable y_pos_fine#12 to live range equivalence class [ y_pos_fine#12 ] +Added variable y_pos_coarse#16 to live range equivalence class [ y_pos_coarse#16 ] +Added variable screencpy::src_250#0 to live range equivalence class [ screencpy::src_250#0 ] +Added variable screencpy::dst_250#0 to live range equivalence class [ screencpy::dst_250#0 ] +Added variable screencpy::src_500#0 to live range equivalence class [ screencpy::src_500#0 ] +Added variable screencpy::dst_500#0 to live range equivalence class [ screencpy::dst_500#0 ] +Added variable screencpy::src_750#0 to live range equivalence class [ screencpy::src_750#0 ] +Added variable screencpy::dst_750#0 to live range equivalence class [ screencpy::dst_750#0 ] +Added variable petscii_ptr::$3 to live range equivalence class [ petscii_ptr::$3 ] +Added variable petscii_ptr::$4 to live range equivalence class [ petscii_ptr::$4 ] +Added variable petscii_ptr::$5 to live range equivalence class [ petscii_ptr::$5 ] +Added variable petscii_ptr::$6 to live range equivalence class [ petscii_ptr::$6 ] +Added variable petscii_ptr::$0 to live range equivalence class [ petscii_ptr::$0 ] +Added variable petscii_ptr::$1 to live range equivalence class [ petscii_ptr::$1 ] +Added variable petscii_ptr::return#10 to live range equivalence class [ petscii_ptr::return#10 ] +Complete equivalence classes +[ screen#12 screen#28 screen#0 ] +[ main::movement#4 ] +[ main::$13 ] +[ main::i#2 main::i#1 ] +[ main::i2#2 main::i2#1 ] +[ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] +[ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] +[ main::i3#2 main::i3#1 ] +[ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] +[ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] +[ main::i1#2 main::i1#1 ] +[ memset::dst#2 memset::dst#1 ] +[ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] +[ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +[ screencpy::i#2 screencpy::i#1 ] +[ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] +[ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] +[ main::x_pos_coarse_old#0 ] +[ main::y_pos_coarse_old#0 ] +[ main::$5 ] +[ main::y_movement#0 ] +[ main::$9 ] +[ main::x_movement#0 ] +[ main::movement#3 ] +[ main::screen_active#0 ] +[ screencpy::dst#0 ] +[ screencpy::src#0 ] +[ petscii_ptr::return#1 ] +[ main::petscii#0 ] +[ petscii_ptr::return#3 ] +[ main::$45 ] +[ main::$46 ] +[ main::$47 ] +[ main::$48 ] +[ main::$49 ] +[ main::$50 ] +[ petscii_ptr::return#2 ] +[ petscii_ptr::return#0 ] +[ main::petscii1#0 ] +[ main::scrn1#0 ] +[ next_position::$12 ] +[ next_position::$18 ] +[ x_pos#11 ] +[ next_position::$13 ] +[ next_position::$19 ] +[ y_pos#11 ] +[ next_position::$4 ] +[ next_position::x_pos_u#0 ] +[ next_position::$15 ] +[ x_pos_fine#12 ] +[ x_pos_coarse#17 ] +[ next_position::$8 ] +[ next_position::y_pos_u#0 ] +[ next_position::$17 ] +[ y_pos_fine#12 ] +[ y_pos_coarse#16 ] +[ screencpy::src_250#0 ] +[ screencpy::dst_250#0 ] +[ screencpy::src_500#0 ] +[ screencpy::dst_500#0 ] +[ screencpy::src_750#0 ] +[ screencpy::dst_750#0 ] +[ petscii_ptr::$3 ] +[ petscii_ptr::$4 ] +[ petscii_ptr::$5 ] +[ petscii_ptr::$6 ] +[ petscii_ptr::$0 ] +[ petscii_ptr::$1 ] +[ petscii_ptr::return#10 ] +Allocated zp[1]:2 [ screen#12 screen#28 screen#0 ] +Allocated zp[1]:3 [ main::movement#4 ] +Allocated zp[2]:4 [ main::$13 ] +Allocated zp[1]:6 [ main::i#2 main::i#1 ] +Allocated zp[1]:7 [ main::i2#2 main::i2#1 ] +Allocated zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] +Allocated zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] +Allocated zp[1]:12 [ main::i3#2 main::i3#1 ] +Allocated zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] +Allocated zp[2]:15 [ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] +Allocated zp[1]:17 [ main::i1#2 main::i1#1 ] +Allocated zp[2]:18 [ memset::dst#2 memset::dst#1 ] +Allocated zp[2]:20 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] +Allocated zp[2]:22 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +Allocated zp[1]:24 [ screencpy::i#2 screencpy::i#1 ] +Allocated zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] +Allocated zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] +Allocated zp[2]:29 [ main::x_pos_coarse_old#0 ] +Allocated zp[2]:31 [ main::y_pos_coarse_old#0 ] +Allocated zp[2]:33 [ main::$5 ] +Allocated zp[1]:35 [ main::y_movement#0 ] +Allocated zp[2]:36 [ main::$9 ] +Allocated zp[1]:38 [ main::x_movement#0 ] +Allocated zp[1]:39 [ main::movement#3 ] +Allocated zp[2]:40 [ main::screen_active#0 ] +Allocated zp[2]:42 [ screencpy::dst#0 ] +Allocated zp[2]:44 [ screencpy::src#0 ] +Allocated zp[2]:46 [ petscii_ptr::return#1 ] +Allocated zp[2]:48 [ main::petscii#0 ] +Allocated zp[2]:50 [ petscii_ptr::return#3 ] +Allocated zp[1]:52 [ main::$45 ] +Allocated zp[1]:53 [ main::$46 ] +Allocated zp[1]:54 [ main::$47 ] +Allocated zp[1]:55 [ main::$48 ] +Allocated zp[1]:56 [ main::$49 ] +Allocated zp[1]:57 [ main::$50 ] +Allocated zp[2]:58 [ petscii_ptr::return#2 ] +Allocated zp[2]:60 [ petscii_ptr::return#0 ] +Allocated zp[2]:62 [ main::petscii1#0 ] +Allocated zp[2]:64 [ main::scrn1#0 ] +Allocated zp[2]:66 [ next_position::$12 ] +Allocated zp[2]:68 [ next_position::$18 ] +Allocated zp[2]:70 [ x_pos#11 ] +Allocated zp[2]:72 [ next_position::$13 ] +Allocated zp[2]:74 [ next_position::$19 ] +Allocated zp[2]:76 [ y_pos#11 ] +Allocated zp[2]:78 [ next_position::$4 ] +Allocated zp[2]:80 [ next_position::x_pos_u#0 ] +Allocated zp[1]:82 [ next_position::$15 ] +Allocated zp[1]:83 [ x_pos_fine#12 ] +Allocated zp[2]:84 [ x_pos_coarse#17 ] +Allocated zp[2]:86 [ next_position::$8 ] +Allocated zp[2]:88 [ next_position::y_pos_u#0 ] +Allocated zp[1]:90 [ next_position::$17 ] +Allocated zp[1]:91 [ y_pos_fine#12 ] +Allocated zp[2]:92 [ y_pos_coarse#16 ] +Allocated zp[2]:94 [ screencpy::src_250#0 ] +Allocated zp[2]:96 [ screencpy::dst_250#0 ] +Allocated zp[2]:98 [ screencpy::src_500#0 ] +Allocated zp[2]:100 [ screencpy::dst_500#0 ] +Allocated zp[2]:102 [ screencpy::src_750#0 ] +Allocated zp[2]:104 [ screencpy::dst_750#0 ] +Allocated zp[2]:106 [ petscii_ptr::$3 ] +Allocated zp[2]:108 [ petscii_ptr::$4 ] +Allocated zp[2]:110 [ petscii_ptr::$5 ] +Allocated zp[2]:112 [ petscii_ptr::$6 ] +Allocated zp[2]:114 [ petscii_ptr::$0 ] +Allocated zp[2]:116 [ petscii_ptr::$1 ] +Allocated zp[2]:118 [ petscii_ptr::return#10 ] + +INITIAL ASM +Target platform is c64basic / MOS6502X + // File Comments +// A full-screen x/y-scroller +// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767] + // Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // Global Constants & labels + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + // The number of sinus values in the table + .const SINSIZE = $800 + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // Display screen #0 (double buffered) + .label MAIN_SCREEN0 = $3800 + // Display screen #1 (double buffered) + .label MAIN_SCREEN1 = $3c00 + // Display charset + .label MAIN_CHARSET = $1000 + // The current screen displayed (0/1) + .label screen = 2 + // Current index into the sinus + .label x_sin_idx = $14 + .label y_sin_idx = $16 + // Current x/y-position (the center of the screen) + .label x_pos = $46 + .label y_pos = $4c + // The current scroll fine values [0-7] (converted to unsigned) + .label x_pos_fine = $53 + // The current scroll coarse values (converted to unsigned) + .label x_pos_coarse = $54 + .label y_pos_fine = $5b + .label y_pos_coarse = $5c + // main +main: { + .const toD0181_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0182_return = (>(MAIN_SCREEN1&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0183_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .label __5 = $21 + .label __9 = $24 + .label __13 = 4 + .label __45 = $34 + .label __46 = $35 + .label __47 = $36 + .label __48 = $37 + .label __49 = $38 + .label __50 = $39 + .label x_pos_coarse_old = $1d + .label y_pos_coarse_old = $1f + .label y_movement = $23 + .label x_movement = $26 + // will be -1/0/1 + .label movement = $27 + .label screen_active = $28 + .label screen_hidden = $a + .label petscii1 = $3e + .label scrn1 = $40 + .label petscii = $30 + .label i = 6 + .label i1 = $11 + .label petscii3 = $d + .label scrn3 = $f + .label petscii2 = 8 + .label scrn2 = $a + .label i2 = 7 + .label i3 = $c + // will be -1/0/1 + .label movement_1 = 3 + jmp sei1 + // main::sei1 + sei1: + // asm { sei } + sei + // [2] phi from main::sei1 to main::@30 [phi:main::sei1->main::@30] + __b30_from_sei1: + jmp __b30 + // main::@30 + __b30: + // [3] call memset + // Clear screen + // [96] phi from main::@30 to memset [phi:main::@30->memset] + memset_from___b30: + jsr memset + // [4] phi from main::@30 to main::toD0181 [phi:main::@30->main::toD0181] + toD0181_from___b30: + jmp toD0181 + // main::toD0181 + toD0181: + jmp __b31 + // main::@31 + __b31: + // [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Display initial screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // [6] call next_position + // Find initial position + // [102] phi from main::@31 to next_position [phi:main::@31->next_position] + next_position_from___b31: + // [102] phi (word) y_sin_idx#12 = (const nomodify word) SINSIZE/(byte) 4 [phi:main::@31->next_position#0] -- vwuz1=vwuc1 + lda #SINSIZE/4 + sta.z y_sin_idx+1 + // [102] phi (word) x_sin_idx#12 = (word) 0 [phi:main::@31->next_position#1] -- vwuz1=vwuc1 + lda #<0 + sta.z x_sin_idx + lda #>0 + sta.z x_sin_idx+1 + jsr next_position + // [7] phi from main::@31 to main::@1 [phi:main::@31->main::@1] + __b1_from___b31: + // [7] phi (byte) screen#12 = (byte) 0 [phi:main::@31->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z screen + jmp __b1 + // main::@1 + __b1: + // [8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17 -- vwuz1=vwuz2 + // The old coarse values x/y-positions + lda.z x_pos_coarse + sta.z x_pos_coarse_old + lda.z x_pos_coarse+1 + sta.z x_pos_coarse_old+1 + // [9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16 -- vwuz1=vwuz2 + lda.z y_pos_coarse + sta.z y_pos_coarse_old + lda.z y_pos_coarse+1 + sta.z y_pos_coarse_old+1 + // [10] call next_position + // Update the position + // [102] phi from main::@1 to next_position [phi:main::@1->next_position] + next_position_from___b1: + // [102] phi (word) y_sin_idx#12 = (word) y_sin_idx#13 [phi:main::@1->next_position#0] -- register_copy + // [102] phi (word) x_sin_idx#12 = (word) x_sin_idx#14 [phi:main::@1->next_position#1] -- register_copy + jsr next_position + jmp __b34 + // main::@34 + __b34: + // [11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16 -- vwuz1=vwuz2_minus_vwuz3 + lda.z y_pos_coarse_old + sec + sbc.z y_pos_coarse + sta.z __5 + lda.z y_pos_coarse_old+1 + sbc.z y_pos_coarse+1 + sta.z __5+1 + // [12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 -- vbsz1=_sbyte_vwuz2 + // Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll + // Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none) + lda.z __5 + sta.z y_movement + // [13] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2 -- vbsz1_eq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + beq __b2_from___b34 + jmp __b27 + // main::@27 + __b27: + // [14] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@2 -- vbsz1_neq_vbsc1_then_la1 + lda #-1 + cmp.z y_movement + bne __b2_from___b27 + // [15] phi from main::@27 to main::@28 [phi:main::@27->main::@28] + __b28_from___b27: + jmp __b28 + // main::@28 + __b28: + // [16] phi from main::@28 to main::@2 [phi:main::@28->main::@2] + __b2_from___b28: + // [16] phi (signed byte) main::movement#4 = (signed byte) $28 [phi:main::@28->main::@2#0] -- vbsz1=vbsc1 + lda #$28 + sta.z movement_1 + jmp __b2 + // [16] phi from main::@27 to main::@2 [phi:main::@27->main::@2] + __b2_from___b27: + // [16] phi (signed byte) main::movement#4 = (signed byte) 0 [phi:main::@27->main::@2#0] -- vbsz1=vbsc1 + lda #0 + sta.z movement_1 + jmp __b2 + // [16] phi from main::@34 to main::@2 [phi:main::@34->main::@2] + __b2_from___b34: + // [16] phi (signed byte) main::movement#4 = (signed byte) -$28 [phi:main::@34->main::@2#0] -- vbsz1=vbsc1 + lda #-$28 + sta.z movement_1 + jmp __b2 + // main::@2 + __b2: + // [17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17 -- vwuz1=vwuz2_minus_vwuz3 + lda.z x_pos_coarse_old + sec + sbc.z x_pos_coarse + sta.z __9 + lda.z x_pos_coarse_old+1 + sbc.z x_pos_coarse+1 + sta.z __9+1 + // [18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 -- vbsz1=_sbyte_vwuz2 + lda.z __9 + sta.z x_movement + // [19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 -- vbsz1=vbsz2_minus_vbsz3 + // will be -1/0/1 + lda.z movement_1 + sec + sbc.z x_movement + sta.z movement + // [20] if((signed byte) 0==(signed byte) main::movement#3) goto main::@23 -- vbsc1_eq_vbsz1_then_la1 + lda #0 + cmp.z movement + beq __b23_from___b2 + jmp __b29 + // main::@29 + __b29: + // [21] if((byte) 0!=(byte) screen#12) goto main::@3 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b3_from___b29 + // [23] phi from main::@29 to main::@4 [phi:main::@29->main::@4] + __b4_from___b29: + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@29->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z __13+1 + jmp __b4 + // [22] phi from main::@29 to main::@3 [phi:main::@29->main::@3] + __b3_from___b29: + jmp __b3 + // main::@3 + __b3: + // [23] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + __b4_from___b3: + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@3->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z __13+1 + jmp __b4 + // main::@4 + __b4: + // [24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3 -- pbuz1=pbuz2_plus_vbsz3 + lda.z movement + pha + clc + adc.z __13 + sta.z screen_active + pla + ora #$7f + bmi !+ + lda #0 + !: + adc.z __13+1 + sta.z screen_active+1 + // [25] if((byte) 0!=(byte) screen#12) goto main::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b5_from___b4 + // [27] phi from main::@4 to main::@6 [phi:main::@4->main::@6] + __b6_from___b4: + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@4->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z screen_hidden+1 + jmp __b6 + // [26] phi from main::@4 to main::@5 [phi:main::@4->main::@5] + __b5_from___b4: + jmp __b5 + // main::@5 + __b5: + // [27] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + __b6_from___b5: + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@5->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z screen_hidden+1 + jmp __b6 + // main::@6 + __b6: + // [28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 -- pbuz1=pbuz2 + lda.z screen_hidden + sta.z screencpy.dst + lda.z screen_hidden+1 + sta.z screencpy.dst+1 + // [29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0 -- pbuz1=pbuz2 + lda.z screen_active + sta.z screencpy.src + lda.z screen_active+1 + sta.z screencpy.src+1 + // [30] call screencpy + jsr screencpy + jmp __b35 + // main::@35 + __b35: + // [31] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@7 -- vbsz1_eq_vbsc1_then_la1 + // Update any new row if needed + lda #-1 + cmp.z y_movement + beq __b7 + jmp __b19 + // main::@19 + __b19: + // [32] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@10 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + bne __b10 + jmp __b20 + // main::@20 + __b20: + // [33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [35] call petscii_ptr + // [142] phi from main::@20 to petscii_ptr [phi:main::@20->petscii_ptr] + petscii_ptr_from___b20: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#1 [phi:main::@20->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#1 [phi:main::@20->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_4 + sta.z petscii_ptr.return_1 + lda.z petscii_ptr.return_4+1 + sta.z petscii_ptr.return_1+1 + jmp __b37 + // main::@37 + __b37: + // [37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_1 + sta.z petscii + lda.z petscii_ptr.return_1+1 + sta.z petscii+1 + // [38] phi from main::@37 to main::@8 [phi:main::@37->main::@8] + __b8_from___b37: + // [38] phi (byte) main::i#2 = (byte) 0 [phi:main::@37->main::@8#0] -- vbuz1=vbuc1 + lda #0 + sta.z i + jmp __b8 + // main::@8 + __b8: + // [39] if((byte) main::i#2<(byte) $28) goto main::@9 -- vbuz1_lt_vbuc1_then_la1 + lda.z i + cmp #$28 + bcc __b9 + jmp __b10 + // main::@10 + __b10: + // [40] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@13 -- vbsz1_eq_vbsc1_then_la1 + // Update any new column if needed + lda #-1 + cmp.z x_movement + beq __b13 + jmp __b21 + // main::@21 + __b21: + // [41] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@16 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z x_movement + bne __b16 + jmp __b22 + // main::@22 + __b22: + // [42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [44] call petscii_ptr + // [142] phi from main::@22 to petscii_ptr [phi:main::@22->petscii_ptr] + petscii_ptr_from___b22: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#3 [phi:main::@22->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#3 [phi:main::@22->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_4 + sta.z petscii_ptr.return_3 + lda.z petscii_ptr.return_4+1 + sta.z petscii_ptr.return_3+1 + jmp __b39 + // main::@39 + __b39: + // [46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_3 + sta.z petscii2 + lda.z petscii_ptr.return_3+1 + sta.z petscii2+1 + // [47] phi from main::@39 to main::@14 [phi:main::@39->main::@14] + __b14_from___b39: + // [47] phi (byte*) main::scrn2#2 = (byte*) main::screen_hidden#0 [phi:main::@39->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#0 [phi:main::@39->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) 0 [phi:main::@39->main::@14#2] -- vbuz1=vbuc1 + lda #0 + sta.z i2 + jmp __b14 + // main::@14 + __b14: + // [48] if((byte) main::i2#2<(byte) $19) goto main::@15 -- vbuz1_lt_vbuc1_then_la1 + lda.z i2 + cmp #$19 + bcc __b15 + jmp __b16 + // main::@16 + __b16: + // [49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1 + // Change current screen + lda #1 + eor.z screen + sta.z screen + // [50] phi from main::@16 main::@2 main::@23 to main::@23 [phi:main::@16/main::@2/main::@23->main::@23] + __b23_from___b16: + __b23_from___b2: + __b23_from___b23: + // [50] phi (byte) screen#28 = (byte) screen#0 [phi:main::@16/main::@2/main::@23->main::@23#0] -- register_copy + jmp __b23 + // Update the display - wait for the raster + // main::@23 + __b23: + // [51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fe + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b23_from___b23 + jmp __b24 + // main::@24 + __b24: + // [52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$ff + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b24 + jmp __b25 + // main::@25 + __b25: + // [53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + lda #WHITE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta.z __45 + // [55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12 -- vbuz1=vbuc1_minus_vbuz2 + lda #7 + sec + sbc.z y_pos_fine + sta.z __46 + // [56] (byte~) main::$47 ← (byte~) main::$45 | (byte~) main::$46 -- vbuz1=vbuz2_bor_vbuz3 + lda.z __45 + ora.z __46 + sta.z __47 + // [57] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (byte~) main::$47 -- _deref_pbuc1=vbuz1 + // Y-scroll fine + lda.z __47 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // [58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + sta.z __48 + // [59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12 -- vbuz1=vbuc1_minus_vbuz2 + lda #7 + sec + sbc.z x_pos_fine + sta.z __49 + // [60] (byte~) main::$50 ← (byte~) main::$48 | (byte~) main::$49 -- vbuz1=vbuz2_bor_vbuz3 + lda.z __48 + ora.z __49 + sta.z __50 + // [61] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte~) main::$50 -- _deref_pbuc1=vbuz1 + // X-scroll fine + lda.z __50 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // [62] if((byte) 0!=(byte) screen#28) goto main::toD0182 -- vbuc1_neq_vbuz1_then_la1 + // Display current screen + lda #0 + cmp.z screen + bne toD0182_from___b25 + // [63] phi from main::@25 to main::toD0183 [phi:main::@25->main::toD0183] + toD0183_from___b25: + jmp toD0183 + // main::toD0183 + toD0183: + jmp __b33 + // main::@33 + __b33: + // [64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0183_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + // main::@26 + __b26: + // [65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [7] phi from main::@26 to main::@1 [phi:main::@26->main::@1] + __b1_from___b26: + // [7] phi (byte) screen#12 = (byte) screen#28 [phi:main::@26->main::@1#0] -- register_copy + jmp __b1 + // [66] phi from main::@25 to main::toD0182 [phi:main::@25->main::toD0182] + toD0182_from___b25: + jmp toD0182 + // main::toD0182 + toD0182: + jmp __b32 + // main::@32 + __b32: + // [67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0182_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + // main::@15 + __b15: + // [68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii2),y + ldy #0 + sta (scrn2),y + // [69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn2 + sta.z scrn2 + bcc !+ + inc.z scrn2+1 + !: + // [70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii2 + sta.z petscii2 + bcc !+ + inc.z petscii2+1 + !: + // [71] (byte) main::i2#1 ← ++ (byte) main::i2#2 -- vbuz1=_inc_vbuz1 + inc.z i2 + // [47] phi from main::@15 to main::@14 [phi:main::@15->main::@14] + __b14_from___b15: + // [47] phi (byte*) main::scrn2#2 = (byte*) main::scrn2#1 [phi:main::@15->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#1 [phi:main::@15->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) main::i2#1 [phi:main::@15->main::@14#2] -- register_copy + jmp __b14 + // main::@13 + __b13: + // [72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13 -- vwuz1=vwuz2_plus_vbuc1 + lda #$13 + clc + adc.z x_pos_coarse + sta.z petscii_ptr.row_x + lda #0 + adc.z x_pos_coarse+1 + sta.z petscii_ptr.row_x+1 + // [73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [74] call petscii_ptr + // [142] phi from main::@13 to petscii_ptr [phi:main::@13->petscii_ptr] + petscii_ptr_from___b13: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#2 [phi:main::@13->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#2 [phi:main::@13->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_4 + sta.z petscii_ptr.return_2 + lda.z petscii_ptr.return_4+1 + sta.z petscii_ptr.return_2+1 + jmp __b38 + // main::@38 + __b38: + // [76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_2 + sta.z petscii3 + lda.z petscii_ptr.return_2+1 + sta.z petscii3+1 + // [77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27 -- pbuz1=pbuz2_plus_vbuc1 + lda #$27 + clc + adc.z screen_hidden + sta.z scrn3 + lda #0 + adc.z screen_hidden+1 + sta.z scrn3+1 + // [78] phi from main::@38 to main::@17 [phi:main::@38->main::@17] + __b17_from___b38: + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#0 [phi:main::@38->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#0 [phi:main::@38->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) 0 [phi:main::@38->main::@17#2] -- vbuz1=vbuc1 + lda #0 + sta.z i3 + jmp __b17 + // main::@17 + __b17: + // [79] if((byte) main::i3#2<(byte) $19) goto main::@18 -- vbuz1_lt_vbuc1_then_la1 + lda.z i3 + cmp #$19 + bcc __b18 + jmp __b16 + // main::@18 + __b18: + // [80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii3),y + ldy #0 + sta (scrn3),y + // [81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // [82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii3 + sta.z petscii3 + bcc !+ + inc.z petscii3+1 + !: + // [83] (byte) main::i3#1 ← ++ (byte) main::i3#2 -- vbuz1=_inc_vbuz1 + inc.z i3 + // [78] phi from main::@18 to main::@17 [phi:main::@18->main::@17] + __b17_from___b18: + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#1 [phi:main::@18->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#1 [phi:main::@18->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) main::i3#1 [phi:main::@18->main::@17#2] -- register_copy + jmp __b17 + // main::@9 + __b9: + // [84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i + lda (petscii),y + sta (screen_hidden),y + // [85] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [38] phi from main::@9 to main::@8 [phi:main::@9->main::@8] + __b8_from___b9: + // [38] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@9->main::@8#0] -- register_copy + jmp __b8 + // main::@7 + __b7: + // [86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c -- vwuz1=vwuz2_plus_vbuc1 + lda #$c + clc + adc.z y_pos_coarse + sta.z petscii_ptr.row_y + lda #0 + adc.z y_pos_coarse+1 + sta.z petscii_ptr.row_y+1 + // [88] call petscii_ptr + // [142] phi from main::@7 to petscii_ptr [phi:main::@7->petscii_ptr] + petscii_ptr_from___b7: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#0 [phi:main::@7->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#0 [phi:main::@7->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10 -- pbuz1=pbuz2 + lda.z petscii_ptr.return_4 + sta.z petscii_ptr.return + lda.z petscii_ptr.return_4+1 + sta.z petscii_ptr.return+1 + jmp __b36 + // main::@36 + __b36: + // [90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0 -- pbuz1=pbuz2 + lda.z petscii_ptr.return + sta.z petscii1 + lda.z petscii_ptr.return+1 + sta.z petscii1+1 + // [91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz2_plus_vwuc1 + lda.z screen_hidden + clc + adc #<$18*$28 + sta.z scrn1 + lda.z screen_hidden+1 + adc #>$18*$28 + sta.z scrn1+1 + // [92] phi from main::@36 to main::@11 [phi:main::@36->main::@11] + __b11_from___b36: + // [92] phi (byte) main::i1#2 = (byte) 0 [phi:main::@36->main::@11#0] -- vbuz1=vbuc1 + lda #0 + sta.z i1 + jmp __b11 + // main::@11 + __b11: + // [93] if((byte) main::i1#2<(byte) $28) goto main::@12 -- vbuz1_lt_vbuc1_then_la1 + lda.z i1 + cmp #$28 + bcc __b12 + jmp __b10 + // main::@12 + __b12: + // [94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i1 + lda (petscii1),y + sta (scrn1),y + // [95] (byte) main::i1#1 ← ++ (byte) main::i1#2 -- vbuz1=_inc_vbuz1 + inc.z i1 + // [92] phi from main::@12 to main::@11 [phi:main::@12->main::@11] + __b11_from___b12: + // [92] phi (byte) main::i1#2 = (byte) main::i1#1 [phi:main::@12->main::@11#0] -- register_copy + jmp __b11 +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = MAIN_SCREEN0 + .label end = str+num + .label dst = $12 + // [97] phi from memset to memset::@1 [phi:memset->memset::@1] + __b1_from_memset: + // [97] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta.z dst+1 + jmp __b1 + // memset::@1 + __b1: + // [98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z dst+1 + cmp #>end + bne __b2 + lda.z dst + cmp #memset::@1] + __b1_from___b2: + // [97] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy + jmp __b1 +} + // next_position +// Update the x_pos, y_pos variables to reflect the next position on the curve +// The position represents the center of the screen +next_position: { + .label __4 = $4e + .label __8 = $56 + .label __12 = $42 + .label __13 = $48 + .label __15 = $52 + .label __17 = $5a + .label x_pos_u = $50 + .label y_pos_u = $58 + .label __18 = $44 + .label __19 = $4a + // [103] (word) x_sin_idx#13 ← ++ (word) x_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z x_sin_idx + bne !+ + inc.z x_sin_idx+1 + !: + // [104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 -- vwuz1_lt_vwuc1_then_la1 + lda.z x_sin_idx+1 + cmp #>SINSIZE + bcc __b1_from_next_position + bne !+ + lda.z x_sin_idx + cmp #SINSIZE + sta.z x_sin_idx+1 + // [106] phi from next_position next_position::@3 to next_position::@1 [phi:next_position/next_position::@3->next_position::@1] + __b1_from_next_position: + __b1_from___b3: + // [106] phi (word) x_sin_idx#14 = (word) x_sin_idx#13 [phi:next_position/next_position::@3->next_position::@1#0] -- register_copy + jmp __b1 + // next_position::@1 + __b1: + // [107] (word) y_sin_idx#14 ← ++ (word) y_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z y_sin_idx + bne !+ + inc.z y_sin_idx+1 + !: + // [108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 -- vwuz1_lt_vwuc1_then_la1 + lda.z y_sin_idx+1 + cmp #>SINSIZE + bcc __b2_from___b1 + bne !+ + lda.z y_sin_idx + cmp #SINSIZE + sta.z y_sin_idx+1 + // [110] phi from next_position::@1 next_position::@4 to next_position::@2 [phi:next_position::@1/next_position::@4->next_position::@2] + __b2_from___b1: + __b2_from___b4: + // [110] phi (word) y_sin_idx#13 = (word) y_sin_idx#14 [phi:next_position::@1/next_position::@4->next_position::@2#0] -- register_copy + jmp __b2 + // next_position::@2 + __b2: + // [111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z x_sin_idx + asl + sta.z __12 + lda.z x_sin_idx+1 + rol + sta.z __12+1 + // [112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12 -- pwsz1=pwsc1_plus_vwuz2 + lda.z __12 + clc + adc #SINTAB + sta.z __18+1 + // [113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18) -- vwsz1=_deref_pwsz2 + // Find the next point + ldy #0 + lda (__18),y + sta.z x_pos + iny + lda (__18),y + sta.z x_pos+1 + // [114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z y_sin_idx + asl + sta.z __13 + lda.z y_sin_idx+1 + rol + sta.z __13+1 + // [115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13 -- pwsz1=pwsc1_plus_vwuz2 + lda.z __13 + clc + adc #SINTAB + sta.z __19+1 + // [116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19) -- vwsz1=_deref_pwsz2 + ldy #0 + lda (__19),y + sta.z y_pos + iny + lda (__19),y + sta.z y_pos+1 + // [117] (word~) next_position::$4 ← (word)(signed word) x_pos#11 -- vwuz1=vwuz2 + lda.z x_pos + sta.z __4 + lda.z x_pos+1 + sta.z __4+1 + // [118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8 -- vwuz1=vwuz2_plus_vwuc1 + lda.z __4 + clc + adc #<$190+$14*8 + sta.z x_pos_u + lda.z __4+1 + adc #>$190+$14*8 + sta.z x_pos_u+1 + // [119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 -- vbuz1=_byte_vwuz2 + lda.z x_pos_u + sta.z __15 + // [120] (byte) x_pos_fine#12 ← (byte~) next_position::$15 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z __15 + sta.z x_pos_fine + // [121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3 -- vwuz1=vwuz2_ror_3 + lda.z x_pos_u+1 + lsr + sta.z x_pos_coarse+1 + lda.z x_pos_u + ror + sta.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + // [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 -- vwuz1=vwuz2 + lda.z y_pos + sta.z __8 + lda.z y_pos+1 + sta.z __8+1 + // [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 -- vwuz1=vwuz2_plus_vwuc1 + lda.z __8 + clc + adc #<$190+$c*8 + sta.z y_pos_u + lda.z __8+1 + adc #>$190+$c*8 + sta.z y_pos_u+1 + // [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 -- vbuz1=_byte_vwuz2 + lda.z y_pos_u + sta.z __17 + // [125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z __17 + sta.z y_pos_fine + // [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 -- vwuz1=vwuz2_ror_3 + lda.z y_pos_u+1 + lsr + sta.z y_pos_coarse+1 + lda.z y_pos_u + ror + sta.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + jmp __breturn + // next_position::@return + __breturn: + // [127] return + rts +} + // screencpy +// Copy an entire screen (40x25 = 1000 chars) +// - dst - destination +// - src - source +// screencpy(byte* zp($2a) dst, byte* zp($2c) src) +screencpy: { + .label dst = $2a + .label src = $2c + .label src_250 = $5e + .label dst_250 = $60 + .label src_500 = $62 + .label dst_500 = $64 + .label src_750 = $66 + .label dst_750 = $68 + .label i = $18 + // [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z src + sta.z src_250 + lda #0 + adc.z src+1 + sta.z src_250+1 + // [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z dst + sta.z dst_250 + lda #0 + adc.z dst+1 + sta.z dst_250+1 + // [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$1f4 + sta.z src_500 + lda.z src+1 + adc #>$1f4 + sta.z src_500+1 + // [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$1f4 + sta.z dst_500 + lda.z dst+1 + adc #>$1f4 + sta.z dst_500+1 + // [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$2ee + sta.z src_750 + lda.z src+1 + adc #>$2ee + sta.z src_750+1 + // [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$2ee + sta.z dst_750 + lda.z dst+1 + adc #>$2ee + sta.z dst_750+1 + // [134] phi from screencpy to screencpy::@1 [phi:screencpy->screencpy::@1] + __b1_from_screencpy: + // [134] phi (byte) screencpy::i#2 = (byte) 0 [phi:screencpy->screencpy::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z i + jmp __b1 + // screencpy::@1 + __b1: + // [135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z i + cmp #$fa + bcc __b2 + jmp __breturn + // screencpy::@return + __breturn: + // [136] return + rts + // screencpy::@2 + __b2: + // [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i + lda (src),y + sta (dst),y + // [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i + lda (src_250),y + sta (dst_250),y + // [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i + lda (src_500),y + sta (dst_500),y + // [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz2 + ldy.z i + lda (src_750),y + sta (dst_750),y + // [141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [134] phi from screencpy::@2 to screencpy::@1 [phi:screencpy::@2->screencpy::@1] + __b1_from___b2: + // [134] phi (byte) screencpy::i#2 = (byte) screencpy::i#1 [phi:screencpy::@2->screencpy::@1#0] -- register_copy + jmp __b1 +} + // petscii_ptr +// Get a pointer to a specific x,y-position in the PETSCII art +// petscii_ptr(word zp($1b) row_x, word zp($19) row_y) +petscii_ptr: { + .label __0 = $72 + .label __1 = $74 + .label row_x = $1b + .label row_y = $19 + .label return = $3c + .label return_1 = $2e + .label return_2 = $3a + .label return_3 = $32 + .label return_4 = $76 + .label __3 = $6a + .label __4 = $6c + .label __5 = $6e + .label __6 = $70 + // [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 -- vwuz1=vwuz2_rol_4 + lda.z row_y + asl + sta.z __3 + lda.z row_y+1 + rol + sta.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + // [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz2_plus_vwuz3 + lda.z __3 + clc + adc.z row_y + sta.z __4 + lda.z __3+1 + adc.z row_y+1 + sta.z __4+1 + // [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z __4 + asl + sta.z __5 + lda.z __4+1 + rol + sta.z __5+1 + // [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz2_plus_vwuz3 + lda.z __5 + clc + adc.z row_y + sta.z __6 + lda.z __5+1 + adc.z row_y+1 + sta.z __6+1 + // [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 -- vwuz1=vwuz2_rol_2 + lda.z __6 + asl + sta.z __0 + lda.z __6+1 + rol + sta.z __0+1 + asl.z __0 + rol.z __0+1 + // [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 -- pbuz1=pbuc1_plus_vwuz2 + lda.z __0 + clc + adc #PETSCII_ART + sta.z __1+1 + // [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 -- pbuz1=pbuz2_plus_vwuz3 + lda.z __1 + clc + adc.z row_x + sta.z return_4 + lda.z __1+1 + adc.z row_x+1 + sta.z return_4+1 + jmp __breturn + // petscii_ptr::@return + __breturn: + // [150] return + rts +} + // File Data +// Sinus table [-399,399] +SINTAB: +.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE) + +.pc = $4000 "PETSCII_ART" +// 140x125 PETSCII art +PETSCII_ART: +.var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y> (byte) 3 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 [ x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( next_position:6 [ x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:24 [ screencpy::i#2 screencpy::i#1 ] +Statement [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 [ petscii_ptr::row_x#4 petscii_ptr::$6 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 [ petscii_ptr::row_x#4 petscii_ptr::$0 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 [ petscii_ptr::row_x#4 petscii_ptr::$1 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 [ petscii_ptr::return#10 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17 [ screen#12 main::x_pos_coarse_old#0 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 main::x_pos_coarse_old#0 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16 [ screen#12 main::x_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 main::$5 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 main::x_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 main::$5 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 [ screen#12 main::x_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 main::x_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::movement#4 main::$9 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::movement#4 main::$9 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::movement#4 main::x_movement#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::movement#4 main::x_movement#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::movement#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::movement#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_active#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_active#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_active#0 main::screen_hidden#0 screencpy::dst#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_active#0 main::screen_hidden#0 screencpy::dst#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 screencpy::dst#0 screencpy::src#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 screencpy::dst#0 screencpy::src#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::row_x#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::row_x#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::row_x#1 petscii_ptr::row_y#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::row_x#1 petscii_ptr::row_y#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::return#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 petscii_ptr::return#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 main::petscii#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 main::petscii#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::row_x#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::row_x#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } ) always clobbers reg byte a +Statement [43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::row_x#3 petscii_ptr::row_y#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::row_x#3 petscii_ptr::row_y#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } ) always clobbers reg byte a +Statement [45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::return#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 petscii_ptr::return#3 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } ) always clobbers reg byte a +Statement [46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 main::petscii2#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 main::petscii2#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1 [ x_pos_coarse#17 y_pos_coarse#16 screen#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ x_pos_coarse#17 y_pos_coarse#16 screen#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$45 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$45 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$45 main::$46 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$45 main::$46 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$48 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$48 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$48 main::$49 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 main::$48 main::$49 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0 [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#28 x_pos_coarse#17 y_pos_coarse#16 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#2 main::scrn2#2 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#2 main::scrn2#2 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a reg byte y +Statement [69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#2 main::scrn2#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#2 main::scrn2#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#1 main::scrn2#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::i2#2 main::petscii2#1 main::scrn2#1 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#2 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#2 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } ) always clobbers reg byte a +Statement [73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#2 petscii_ptr::row_y#2 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#2 petscii_ptr::row_y#2 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } ) always clobbers reg byte a +Statement [75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::return#2 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::return#2 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } ) always clobbers reg byte a +Statement [76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii3#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii3#0 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::petscii3#0 main::scrn3#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::petscii3#0 main::scrn3#0 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#2 main::scrn3#2 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#2 main::scrn3#2 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a reg byte y +Statement [81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#2 main::scrn3#1 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#2 main::scrn3#1 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#1 main::scrn3#1 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 main::i3#2 main::petscii3#1 main::scrn3#1 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2) [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 main::petscii#0 main::i#2 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 main::petscii#0 main::i#2 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#0 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#0 petscii_ptr::row_y#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::row_x#0 petscii_ptr::row_y#0 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::return#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 petscii_ptr::return#0 x_sin_idx#14 y_sin_idx#13 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 main::scrn1#0 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 main::scrn1#0 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2) [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 main::scrn1#0 main::i1#2 x_sin_idx#14 y_sin_idx#13 ] ( [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 main::petscii1#0 main::scrn1#0 main::i1#2 x_sin_idx#14 y_sin_idx#13 ] { } ) always clobbers reg byte a +Statement [98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( memset:3 [ memset::dst#2 ] { } ) always clobbers reg byte a +Statement [100] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( memset:3 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement [104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 [ y_sin_idx#12 x_sin_idx#13 ] ( next_position:6 [ y_sin_idx#12 x_sin_idx#13 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 y_sin_idx#12 x_sin_idx#13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [105] (word) x_sin_idx#4 ← (word) x_sin_idx#13 - (const nomodify word) SINSIZE [ y_sin_idx#12 x_sin_idx#4 ] ( next_position:6 [ y_sin_idx#12 x_sin_idx#4 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 y_sin_idx#12 x_sin_idx#4 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 [ x_sin_idx#14 y_sin_idx#14 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#14 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#14 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [109] (word) y_sin_idx#4 ← (word) y_sin_idx#14 - (const nomodify word) SINSIZE [ x_sin_idx#14 y_sin_idx#4 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#4 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#4 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1 [ x_sin_idx#14 y_sin_idx#13 next_position::$12 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 next_position::$12 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 next_position::$12 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12 [ x_sin_idx#14 y_sin_idx#13 next_position::$18 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 next_position::$18 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 next_position::$18 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18) [ x_sin_idx#14 y_sin_idx#13 x_pos#11 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 x_pos#11 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a reg byte y +Statement [114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$13 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$13 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$19 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$19 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 x_pos#11 next_position::$19 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19) [ x_sin_idx#14 y_sin_idx#13 x_pos#11 y_pos#11 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 x_pos#11 y_pos#11 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 x_pos#11 y_pos#11 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a reg byte y +Statement [117] (word~) next_position::$4 ← (word)(signed word) x_pos#11 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::$4 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::$4 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::$4 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 next_position::$15 ] ( next_position:6 [ x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 next_position::$15 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_sin_idx#14 y_sin_idx#13 y_pos#11 next_position::x_pos_u#0 next_position::$15 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 y_pos#11 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::$8 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] ( next_position:6 [ x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 next_position::y_pos_u#0 next_position::$17 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 [ x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] ( next_position:6 [ x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { } next_position:10 [ screen#12 main::x_pos_coarse_old#0 main::y_pos_coarse_old#0 x_pos_coarse#17 y_pos_coarse#16 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 ] { { x_sin_idx#12 = x_sin_idx#14 } { y_sin_idx#12 = y_sin_idx#13 } } ) always clobbers reg byte a +Statement [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) [ screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] ( screencpy:30 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::y_movement#0 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 screencpy::dst#0 screencpy::src#0 screencpy::src_250#0 screencpy::dst_250#0 screencpy::src_500#0 screencpy::dst_500#0 screencpy::src_750#0 screencpy::dst_750#0 screencpy::i#2 ] { { screencpy::dst#0 = main::screen_hidden#0 } { screencpy::src#0 = main::screen_active#0 } } ) always clobbers reg byte a +Statement [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$3 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$4 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 [ petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_y#4 petscii_ptr::row_x#4 petscii_ptr::$5 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 [ petscii_ptr::row_x#4 petscii_ptr::$6 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$6 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 [ petscii_ptr::row_x#4 petscii_ptr::$0 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$0 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 [ petscii_ptr::row_x#4 petscii_ptr::$1 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::row_x#4 petscii_ptr::$1 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Statement [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 [ petscii_ptr::return#10 ] ( petscii_ptr:35 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#1 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#1 = petscii_ptr::row_x#4 } { petscii_ptr::return#1 = petscii_ptr::return#10 } } petscii_ptr:44 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#3 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#3 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#3 } } petscii_ptr:74 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#2 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#2 = petscii_ptr::row_x#4 } { petscii_ptr::return#10 = petscii_ptr::return#2 } } petscii_ptr:88 [ screen#12 x_pos_coarse#17 y_pos_coarse#16 main::x_movement#0 main::screen_hidden#0 y_pos_fine#12 x_pos_fine#12 x_sin_idx#14 y_sin_idx#13 petscii_ptr::return#10 ] { { petscii_ptr::row_y#0 = petscii_ptr::row_y#4 } { petscii_ptr::row_x#0 = petscii_ptr::row_x#4 } { petscii_ptr::return#0 = petscii_ptr::return#10 } } ) always clobbers reg byte a +Potential registers zp[1]:2 [ screen#12 screen#28 screen#0 ] : zp[1]:2 , reg byte x , +Potential registers zp[1]:3 [ main::movement#4 ] : zp[1]:3 , reg byte x , reg byte y , +Potential registers zp[2]:4 [ main::$13 ] : zp[2]:4 , +Potential registers zp[1]:6 [ main::i#2 main::i#1 ] : zp[1]:6 , reg byte x , reg byte y , +Potential registers zp[1]:7 [ main::i2#2 main::i2#1 ] : zp[1]:7 , reg byte x , +Potential registers zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] : zp[2]:8 , +Potential registers zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] : zp[2]:10 , +Potential registers zp[1]:12 [ main::i3#2 main::i3#1 ] : zp[1]:12 , reg byte x , +Potential registers zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] : zp[2]:13 , +Potential registers zp[2]:15 [ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] : zp[2]:15 , +Potential registers zp[1]:17 [ main::i1#2 main::i1#1 ] : zp[1]:17 , reg byte x , reg byte y , +Potential registers zp[2]:18 [ memset::dst#2 memset::dst#1 ] : zp[2]:18 , +Potential registers zp[2]:20 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] : zp[2]:20 , +Potential registers zp[2]:22 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] : zp[2]:22 , +Potential registers zp[1]:24 [ screencpy::i#2 screencpy::i#1 ] : zp[1]:24 , reg byte x , reg byte y , +Potential registers zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] : zp[2]:25 , +Potential registers zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] : zp[2]:27 , +Potential registers zp[2]:29 [ main::x_pos_coarse_old#0 ] : zp[2]:29 , +Potential registers zp[2]:31 [ main::y_pos_coarse_old#0 ] : zp[2]:31 , +Potential registers zp[2]:33 [ main::$5 ] : zp[2]:33 , +Potential registers zp[1]:35 [ main::y_movement#0 ] : zp[1]:35 , reg byte x , reg byte y , +Potential registers zp[2]:36 [ main::$9 ] : zp[2]:36 , +Potential registers zp[1]:38 [ main::x_movement#0 ] : zp[1]:38 , reg byte x , reg byte y , +Potential registers zp[1]:39 [ main::movement#3 ] : zp[1]:39 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:40 [ main::screen_active#0 ] : zp[2]:40 , +Potential registers zp[2]:42 [ screencpy::dst#0 ] : zp[2]:42 , +Potential registers zp[2]:44 [ screencpy::src#0 ] : zp[2]:44 , +Potential registers zp[2]:46 [ petscii_ptr::return#1 ] : zp[2]:46 , +Potential registers zp[2]:48 [ main::petscii#0 ] : zp[2]:48 , +Potential registers zp[2]:50 [ petscii_ptr::return#3 ] : zp[2]:50 , +Potential registers zp[1]:52 [ main::$45 ] : zp[1]:52 , reg byte x , reg byte y , +Potential registers zp[1]:53 [ main::$46 ] : zp[1]:53 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:54 [ main::$47 ] : zp[1]:54 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:55 [ main::$48 ] : zp[1]:55 , reg byte x , reg byte y , +Potential registers zp[1]:56 [ main::$49 ] : zp[1]:56 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:57 [ main::$50 ] : zp[1]:57 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:58 [ petscii_ptr::return#2 ] : zp[2]:58 , +Potential registers zp[2]:60 [ petscii_ptr::return#0 ] : zp[2]:60 , +Potential registers zp[2]:62 [ main::petscii1#0 ] : zp[2]:62 , +Potential registers zp[2]:64 [ main::scrn1#0 ] : zp[2]:64 , +Potential registers zp[2]:66 [ next_position::$12 ] : zp[2]:66 , +Potential registers zp[2]:68 [ next_position::$18 ] : zp[2]:68 , +Potential registers zp[2]:70 [ x_pos#11 ] : zp[2]:70 , +Potential registers zp[2]:72 [ next_position::$13 ] : zp[2]:72 , +Potential registers zp[2]:74 [ next_position::$19 ] : zp[2]:74 , +Potential registers zp[2]:76 [ y_pos#11 ] : zp[2]:76 , +Potential registers zp[2]:78 [ next_position::$4 ] : zp[2]:78 , +Potential registers zp[2]:80 [ next_position::x_pos_u#0 ] : zp[2]:80 , +Potential registers zp[1]:82 [ next_position::$15 ] : zp[1]:82 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:83 [ x_pos_fine#12 ] : zp[1]:83 , reg byte x , +Potential registers zp[2]:84 [ x_pos_coarse#17 ] : zp[2]:84 , +Potential registers zp[2]:86 [ next_position::$8 ] : zp[2]:86 , +Potential registers zp[2]:88 [ next_position::y_pos_u#0 ] : zp[2]:88 , +Potential registers zp[1]:90 [ next_position::$17 ] : zp[1]:90 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:91 [ y_pos_fine#12 ] : zp[1]:91 , reg byte x , +Potential registers zp[2]:92 [ y_pos_coarse#16 ] : zp[2]:92 , +Potential registers zp[2]:94 [ screencpy::src_250#0 ] : zp[2]:94 , +Potential registers zp[2]:96 [ screencpy::dst_250#0 ] : zp[2]:96 , +Potential registers zp[2]:98 [ screencpy::src_500#0 ] : zp[2]:98 , +Potential registers zp[2]:100 [ screencpy::dst_500#0 ] : zp[2]:100 , +Potential registers zp[2]:102 [ screencpy::src_750#0 ] : zp[2]:102 , +Potential registers zp[2]:104 [ screencpy::dst_750#0 ] : zp[2]:104 , +Potential registers zp[2]:106 [ petscii_ptr::$3 ] : zp[2]:106 , +Potential registers zp[2]:108 [ petscii_ptr::$4 ] : zp[2]:108 , +Potential registers zp[2]:110 [ petscii_ptr::$5 ] : zp[2]:110 , +Potential registers zp[2]:112 [ petscii_ptr::$6 ] : zp[2]:112 , +Potential registers zp[2]:114 [ petscii_ptr::$0 ] : zp[2]:114 , +Potential registers zp[2]:116 [ petscii_ptr::$1 ] : zp[2]:116 , +Potential registers zp[2]:118 [ petscii_ptr::return#10 ] : zp[2]:118 , + +REGISTER UPLIFT SCOPES +Uplift Scope [screencpy] 38,337.17: zp[1]:24 [ screencpy::i#2 screencpy::i#1 ] 1,262.75: zp[2]:104 [ screencpy::dst_750#0 ] 1,122.44: zp[2]:102 [ screencpy::src_750#0 ] 1,010.2: zp[2]:100 [ screencpy::dst_500#0 ] 918.36: zp[2]:98 [ screencpy::src_500#0 ] 841.83: zp[2]:96 [ screencpy::dst_250#0 ] 777.08: zp[2]:94 [ screencpy::src_250#0 ] 736.79: zp[2]:44 [ screencpy::src#0 ] 687.67: zp[2]:42 [ screencpy::dst#0 ] +Uplift Scope [main] 370.33: zp[1]:6 [ main::i#2 main::i#1 ] 370.33: zp[1]:17 [ main::i1#2 main::i1#1 ] 262.6: zp[1]:7 [ main::i2#2 main::i2#1 ] 262.6: zp[1]:12 [ main::i3#2 main::i3#1 ] 201.5: zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] 194: zp[2]:15 [ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] 190.5: zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] 175.92: zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] 22.4: zp[2]:48 [ main::petscii#0 ] 22.4: zp[2]:64 [ main::scrn1#0 ] 22: zp[1]:53 [ main::$46 ] 22: zp[1]:54 [ main::$47 ] 22: zp[1]:56 [ main::$49 ] 22: zp[1]:57 [ main::$50 ] 18.67: zp[2]:62 [ main::petscii1#0 ] 11: zp[2]:4 [ main::$13 ] 11: zp[2]:31 [ main::y_pos_coarse_old#0 ] 11: zp[2]:33 [ main::$5 ] 11: zp[2]:36 [ main::$9 ] 11: zp[1]:52 [ main::$45 ] 11: zp[1]:55 [ main::$48 ] 6.6: zp[1]:39 [ main::movement#3 ] 4.4: zp[2]:40 [ main::screen_active#0 ] 3.67: zp[1]:3 [ main::movement#4 ] 2.75: zp[1]:35 [ main::y_movement#0 ] 2.44: zp[2]:29 [ main::x_pos_coarse_old#0 ] 1.26: zp[1]:38 [ main::x_movement#0 ] +Uplift Scope [next_position] 202: zp[2]:66 [ next_position::$12 ] 202: zp[2]:68 [ next_position::$18 ] 202: zp[2]:72 [ next_position::$13 ] 202: zp[2]:74 [ next_position::$19 ] 202: zp[2]:78 [ next_position::$4 ] 202: zp[1]:82 [ next_position::$15 ] 202: zp[2]:86 [ next_position::$8 ] 202: zp[1]:90 [ next_position::$17 ] 67.33: zp[2]:80 [ next_position::x_pos_u#0 ] 67.33: zp[2]:88 [ next_position::y_pos_u#0 ] +Uplift Scope [petscii_ptr] 202: zp[2]:106 [ petscii_ptr::$3 ] 202: zp[2]:108 [ petscii_ptr::$4 ] 202: zp[2]:110 [ petscii_ptr::$5 ] 202: zp[2]:112 [ petscii_ptr::$6 ] 202: zp[2]:114 [ petscii_ptr::$0 ] 202: zp[2]:116 [ petscii_ptr::$1 ] 174.75: zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] 64.71: zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] 24.17: zp[2]:118 [ petscii_ptr::return#10 ] 22: zp[2]:46 [ petscii_ptr::return#1 ] 22: zp[2]:50 [ petscii_ptr::return#3 ] 22: zp[2]:58 [ petscii_ptr::return#2 ] 22: zp[2]:60 [ petscii_ptr::return#0 ] +Uplift Scope [] 518.8: zp[2]:20 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] 429.31: zp[2]:22 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] 36.45: zp[1]:2 [ screen#12 screen#28 screen#0 ] 25.25: zp[2]:70 [ x_pos#11 ] 16.83: zp[2]:76 [ y_pos#11 ] 1.84: zp[2]:92 [ y_pos_coarse#16 ] 1.76: zp[2]:84 [ x_pos_coarse#17 ] 1.47: zp[1]:91 [ y_pos_fine#12 ] 1.32: zp[1]:83 [ x_pos_fine#12 ] +Uplift Scope [memset] 336.67: zp[2]:18 [ memset::dst#2 memset::dst#1 ] +Uplift Scope [MOS6526_CIA] +Uplift Scope [MOS6569_VICII] +Uplift Scope [MOS6581_SID] + +Uplifting [screencpy] best 41409 combination reg byte y [ screencpy::i#2 screencpy::i#1 ] zp[2]:104 [ screencpy::dst_750#0 ] zp[2]:102 [ screencpy::src_750#0 ] zp[2]:100 [ screencpy::dst_500#0 ] zp[2]:98 [ screencpy::src_500#0 ] zp[2]:96 [ screencpy::dst_250#0 ] zp[2]:94 [ screencpy::src_250#0 ] zp[2]:44 [ screencpy::src#0 ] zp[2]:42 [ screencpy::dst#0 ] +Uplifting [main] best 37149 combination reg byte y [ main::i#2 main::i#1 ] reg byte y [ main::i1#2 main::i1#1 ] reg byte x [ main::i2#2 main::i2#1 ] reg byte x [ main::i3#2 main::i3#1 ] zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] zp[2]:15 [ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] zp[2]:48 [ main::petscii#0 ] zp[2]:64 [ main::scrn1#0 ] reg byte a [ main::$46 ] zp[1]:54 [ main::$47 ] zp[1]:56 [ main::$49 ] zp[1]:57 [ main::$50 ] zp[2]:62 [ main::petscii1#0 ] zp[2]:4 [ main::$13 ] zp[2]:31 [ main::y_pos_coarse_old#0 ] zp[2]:33 [ main::$5 ] zp[2]:36 [ main::$9 ] zp[1]:52 [ main::$45 ] zp[1]:55 [ main::$48 ] zp[1]:39 [ main::movement#3 ] zp[2]:40 [ main::screen_active#0 ] zp[1]:3 [ main::movement#4 ] zp[1]:35 [ main::y_movement#0 ] zp[2]:29 [ main::x_pos_coarse_old#0 ] zp[1]:38 [ main::x_movement#0 ] +Limited combination testing to 100 combinations of 8957952 possible. +Uplifting [next_position] best 37137 combination zp[2]:66 [ next_position::$12 ] zp[2]:68 [ next_position::$18 ] zp[2]:72 [ next_position::$13 ] zp[2]:74 [ next_position::$19 ] zp[2]:78 [ next_position::$4 ] reg byte a [ next_position::$15 ] zp[2]:86 [ next_position::$8 ] reg byte a [ next_position::$17 ] zp[2]:80 [ next_position::x_pos_u#0 ] zp[2]:88 [ next_position::y_pos_u#0 ] +Uplifting [petscii_ptr] best 37137 combination zp[2]:106 [ petscii_ptr::$3 ] zp[2]:108 [ petscii_ptr::$4 ] zp[2]:110 [ petscii_ptr::$5 ] zp[2]:112 [ petscii_ptr::$6 ] zp[2]:114 [ petscii_ptr::$0 ] zp[2]:116 [ petscii_ptr::$1 ] zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] zp[2]:118 [ petscii_ptr::return#10 ] zp[2]:46 [ petscii_ptr::return#1 ] zp[2]:50 [ petscii_ptr::return#3 ] zp[2]:58 [ petscii_ptr::return#2 ] zp[2]:60 [ petscii_ptr::return#0 ] +Uplifting [] best 37137 combination zp[2]:20 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] zp[2]:22 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] zp[1]:2 [ screen#12 screen#28 screen#0 ] zp[2]:70 [ x_pos#11 ] zp[2]:76 [ y_pos#11 ] zp[2]:92 [ y_pos_coarse#16 ] zp[2]:84 [ x_pos_coarse#17 ] zp[1]:91 [ y_pos_fine#12 ] zp[1]:83 [ x_pos_fine#12 ] +Uplifting [memset] best 37137 combination zp[2]:18 [ memset::dst#2 memset::dst#1 ] +Uplifting [MOS6526_CIA] best 37137 combination +Uplifting [MOS6569_VICII] best 37137 combination +Uplifting [MOS6581_SID] best 37137 combination +Attempting to uplift remaining variables inzp[1]:2 [ screen#12 screen#28 screen#0 ] +Uplifting [] best 37137 combination zp[1]:2 [ screen#12 screen#28 screen#0 ] +Attempting to uplift remaining variables inzp[1]:54 [ main::$47 ] +Uplifting [main] best 37077 combination reg byte a [ main::$47 ] +Attempting to uplift remaining variables inzp[1]:56 [ main::$49 ] +Uplifting [main] best 37017 combination reg byte a [ main::$49 ] +Attempting to uplift remaining variables inzp[1]:57 [ main::$50 ] +Uplifting [main] best 36957 combination reg byte a [ main::$50 ] +Attempting to uplift remaining variables inzp[1]:52 [ main::$45 ] +Uplifting [main] best 36957 combination zp[1]:52 [ main::$45 ] +Attempting to uplift remaining variables inzp[1]:55 [ main::$48 ] +Uplifting [main] best 36957 combination zp[1]:55 [ main::$48 ] +Attempting to uplift remaining variables inzp[1]:39 [ main::movement#3 ] +Uplifting [main] best 36907 combination reg byte x [ main::movement#3 ] +Attempting to uplift remaining variables inzp[1]:3 [ main::movement#4 ] +Uplifting [main] best 36807 combination reg byte x [ main::movement#4 ] +Attempting to uplift remaining variables inzp[1]:35 [ main::y_movement#0 ] +Uplifting [main] best 36807 combination zp[1]:35 [ main::y_movement#0 ] +Attempting to uplift remaining variables inzp[1]:91 [ y_pos_fine#12 ] +Uplifting [] best 36807 combination zp[1]:91 [ y_pos_fine#12 ] +Attempting to uplift remaining variables inzp[1]:83 [ x_pos_fine#12 ] +Uplifting [] best 36807 combination zp[1]:83 [ x_pos_fine#12 ] +Attempting to uplift remaining variables inzp[1]:38 [ main::x_movement#0 ] +Uplifting [main] best 36807 combination zp[1]:38 [ main::x_movement#0 ] +Coalescing zero page register [ zp[2]:4 [ main::$13 ] ] with [ zp[2]:40 [ main::screen_active#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 ] ] with [ zp[2]:50 [ petscii_ptr::return#3 ] ] - score: 1 +Coalescing zero page register [ zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 ] ] with [ zp[2]:15 [ main::scrn3#2 main::scrn3#1 main::scrn3#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:10 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 main::scrn3#2 main::scrn3#1 main::scrn3#0 ] ] with [ zp[2]:42 [ screencpy::dst#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 ] ] with [ zp[2]:58 [ petscii_ptr::return#2 ] ] - score: 1 +Coalescing zero page register [ zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 ] ] with [ zp[2]:112 [ petscii_ptr::$6 ] ] - score: 1 +Coalescing zero page register [ zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 ] ] with [ zp[2]:118 [ petscii_ptr::return#10 ] ] - score: 1 +Coalescing zero page register [ zp[2]:29 [ main::x_pos_coarse_old#0 ] ] with [ zp[2]:36 [ main::$9 ] ] - score: 1 +Coalescing zero page register [ zp[2]:31 [ main::y_pos_coarse_old#0 ] ] with [ zp[2]:33 [ main::$5 ] ] - score: 1 +Coalescing zero page register [ zp[2]:46 [ petscii_ptr::return#1 ] ] with [ zp[2]:48 [ main::petscii#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:60 [ petscii_ptr::return#0 ] ] with [ zp[2]:62 [ main::petscii1#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:66 [ next_position::$12 ] ] with [ zp[2]:68 [ next_position::$18 ] ] - score: 1 +Coalescing zero page register [ zp[2]:70 [ x_pos#11 ] ] with [ zp[2]:78 [ next_position::$4 ] ] - score: 1 +Coalescing zero page register [ zp[2]:72 [ next_position::$13 ] ] with [ zp[2]:74 [ next_position::$19 ] ] - score: 1 +Coalescing zero page register [ zp[2]:76 [ y_pos#11 ] ] with [ zp[2]:86 [ next_position::$8 ] ] - score: 1 +Coalescing zero page register [ zp[2]:80 [ next_position::x_pos_u#0 ] ] with [ zp[2]:84 [ x_pos_coarse#17 ] ] - score: 1 +Coalescing zero page register [ zp[2]:88 [ next_position::y_pos_u#0 ] ] with [ zp[2]:92 [ y_pos_coarse#16 ] ] - score: 1 +Coalescing zero page register [ zp[2]:106 [ petscii_ptr::$3 ] ] with [ zp[2]:108 [ petscii_ptr::$4 ] ] - score: 1 +Coalescing zero page register [ zp[2]:114 [ petscii_ptr::$0 ] ] with [ zp[2]:116 [ petscii_ptr::$1 ] ] - score: 1 +Coalescing zero page register [ zp[2]:4 [ main::$13 main::screen_active#0 ] ] with [ zp[2]:44 [ screencpy::src#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 ] ] with [ zp[2]:27 [ petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 ] ] - score: 1 +Coalescing zero page register [ zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 ] ] with [ zp[2]:114 [ petscii_ptr::$0 petscii_ptr::$1 ] ] - score: 1 +Coalescing zero page register [ zp[2]:66 [ next_position::$12 next_position::$18 ] ] with [ zp[2]:70 [ x_pos#11 next_position::$4 ] ] - score: 1 +Coalescing zero page register [ zp[2]:72 [ next_position::$13 next_position::$19 ] ] with [ zp[2]:76 [ y_pos#11 next_position::$8 ] ] - score: 1 +Coalescing zero page register [ zp[2]:106 [ petscii_ptr::$3 petscii_ptr::$4 ] ] with [ zp[2]:110 [ petscii_ptr::$5 ] ] - score: 1 +Coalescing zero page register [ zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 ] ] with [ zp[2]:13 [ main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 ] ] - score: 1 +Coalescing zero page register [ zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 ] ] with [ zp[2]:46 [ petscii_ptr::return#1 main::petscii#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:8 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 petscii_ptr::return#1 main::petscii#0 ] ] with [ zp[2]:60 [ petscii_ptr::return#0 main::petscii1#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:66 [ next_position::$12 next_position::$18 x_pos#11 next_position::$4 ] ] with [ zp[2]:80 [ next_position::x_pos_u#0 x_pos_coarse#17 ] ] - score: 1 +Coalescing zero page register [ zp[2]:72 [ next_position::$13 next_position::$19 y_pos#11 next_position::$8 ] ] with [ zp[2]:88 [ next_position::y_pos_u#0 y_pos_coarse#16 ] ] - score: 1 +Coalescing zero page register [ zp[2]:20 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 ] ] with [ zp[2]:18 [ memset::dst#2 memset::dst#1 ] ] +Coalescing zero page register [ zp[2]:29 [ main::x_pos_coarse_old#0 main::$9 ] ] with [ zp[2]:25 [ petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 petscii_ptr::$0 petscii_ptr::$1 ] ] +Coalescing zero page register [ zp[1]:91 [ y_pos_fine#12 ] ] with [ zp[1]:55 [ main::$48 ] ] +Coalescing zero page register [ zp[2]:106 [ petscii_ptr::$3 petscii_ptr::$4 petscii_ptr::$5 ] ] with [ zp[2]:94 [ screencpy::src_250#0 ] ] +Allocated (was zp[2]:4) zp[2]:3 [ main::$13 main::screen_active#0 screencpy::src#0 ] +Allocated (was zp[2]:8) zp[2]:5 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 petscii_ptr::return#1 main::petscii#0 petscii_ptr::return#0 main::petscii1#0 ] +Allocated (was zp[2]:10) zp[2]:7 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 main::scrn3#2 main::scrn3#1 main::scrn3#0 screencpy::dst#0 ] +Allocated (was zp[2]:20) zp[2]:9 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 memset::dst#2 memset::dst#1 ] +Allocated (was zp[2]:22) zp[2]:11 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +Allocated (was zp[2]:29) zp[2]:13 [ main::x_pos_coarse_old#0 main::$9 petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 petscii_ptr::$0 petscii_ptr::$1 ] +Allocated (was zp[2]:31) zp[2]:15 [ main::y_pos_coarse_old#0 main::$5 ] +Allocated (was zp[1]:35) zp[1]:17 [ main::y_movement#0 ] +Allocated (was zp[1]:38) zp[1]:18 [ main::x_movement#0 ] +Allocated (was zp[1]:52) zp[1]:19 [ main::$45 ] +Allocated (was zp[2]:64) zp[2]:20 [ main::scrn1#0 ] +Allocated (was zp[2]:66) zp[2]:22 [ next_position::$12 next_position::$18 x_pos#11 next_position::$4 next_position::x_pos_u#0 x_pos_coarse#17 ] +Allocated (was zp[2]:72) zp[2]:24 [ next_position::$13 next_position::$19 y_pos#11 next_position::$8 next_position::y_pos_u#0 y_pos_coarse#16 ] +Allocated (was zp[1]:83) zp[1]:26 [ x_pos_fine#12 ] +Allocated (was zp[1]:91) zp[1]:27 [ y_pos_fine#12 main::$48 ] +Allocated (was zp[2]:96) zp[2]:28 [ screencpy::dst_250#0 ] +Allocated (was zp[2]:98) zp[2]:30 [ screencpy::src_500#0 ] +Allocated (was zp[2]:100) zp[2]:32 [ screencpy::dst_500#0 ] +Allocated (was zp[2]:102) zp[2]:34 [ screencpy::src_750#0 ] +Allocated (was zp[2]:104) zp[2]:36 [ screencpy::dst_750#0 ] +Allocated (was zp[2]:106) zp[2]:38 [ petscii_ptr::$3 petscii_ptr::$4 petscii_ptr::$5 screencpy::src_250#0 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// A full-screen x/y-scroller +// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767] + // Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // Global Constants & labels + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + // The number of sinus values in the table + .const SINSIZE = $800 + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // Display screen #0 (double buffered) + .label MAIN_SCREEN0 = $3800 + // Display screen #1 (double buffered) + .label MAIN_SCREEN1 = $3c00 + // Display charset + .label MAIN_CHARSET = $1000 + // The current screen displayed (0/1) + .label screen = 2 + // Current index into the sinus + .label x_sin_idx = 9 + .label y_sin_idx = $b + // Current x/y-position (the center of the screen) + .label x_pos = $16 + .label y_pos = $18 + // The current scroll fine values [0-7] (converted to unsigned) + .label x_pos_fine = $1a + // The current scroll coarse values (converted to unsigned) + .label x_pos_coarse = $16 + .label y_pos_fine = $1b + .label y_pos_coarse = $18 + // main +main: { + .const toD0181_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0182_return = (>(MAIN_SCREEN1&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0183_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .label __5 = $f + .label __9 = $d + .label __13 = 3 + .label __45 = $13 + .label __48 = $1b + .label x_pos_coarse_old = $d + .label y_pos_coarse_old = $f + .label y_movement = $11 + .label x_movement = $12 + .label screen_active = 3 + .label screen_hidden = 7 + .label petscii1 = 5 + .label scrn1 = $14 + .label petscii = 5 + .label petscii3 = 5 + .label scrn3 = 7 + .label petscii2 = 5 + .label scrn2 = 7 + jmp sei1 + // main::sei1 + sei1: + // asm { sei } + sei + // [2] phi from main::sei1 to main::@30 [phi:main::sei1->main::@30] + __b30_from_sei1: + jmp __b30 + // main::@30 + __b30: + // [3] call memset + // Clear screen + // [96] phi from main::@30 to memset [phi:main::@30->memset] + memset_from___b30: + jsr memset + // [4] phi from main::@30 to main::toD0181 [phi:main::@30->main::toD0181] + toD0181_from___b30: + jmp toD0181 + // main::toD0181 + toD0181: + jmp __b31 + // main::@31 + __b31: + // [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Display initial screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // [6] call next_position + // Find initial position + // [102] phi from main::@31 to next_position [phi:main::@31->next_position] + next_position_from___b31: + // [102] phi (word) y_sin_idx#12 = (const nomodify word) SINSIZE/(byte) 4 [phi:main::@31->next_position#0] -- vwuz1=vwuc1 + lda #SINSIZE/4 + sta.z y_sin_idx+1 + // [102] phi (word) x_sin_idx#12 = (word) 0 [phi:main::@31->next_position#1] -- vwuz1=vwuc1 + lda #<0 + sta.z x_sin_idx + lda #>0 + sta.z x_sin_idx+1 + jsr next_position + // [7] phi from main::@31 to main::@1 [phi:main::@31->main::@1] + __b1_from___b31: + // [7] phi (byte) screen#12 = (byte) 0 [phi:main::@31->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z screen + jmp __b1 + // main::@1 + __b1: + // [8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17 -- vwuz1=vwuz2 + // The old coarse values x/y-positions + lda.z x_pos_coarse + sta.z x_pos_coarse_old + lda.z x_pos_coarse+1 + sta.z x_pos_coarse_old+1 + // [9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16 -- vwuz1=vwuz2 + lda.z y_pos_coarse + sta.z y_pos_coarse_old + lda.z y_pos_coarse+1 + sta.z y_pos_coarse_old+1 + // [10] call next_position + // Update the position + // [102] phi from main::@1 to next_position [phi:main::@1->next_position] + next_position_from___b1: + // [102] phi (word) y_sin_idx#12 = (word) y_sin_idx#13 [phi:main::@1->next_position#0] -- register_copy + // [102] phi (word) x_sin_idx#12 = (word) x_sin_idx#14 [phi:main::@1->next_position#1] -- register_copy + jsr next_position + jmp __b34 + // main::@34 + __b34: + // [11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16 -- vwuz1=vwuz1_minus_vwuz2 + lda.z __5 + sec + sbc.z y_pos_coarse + sta.z __5 + lda.z __5+1 + sbc.z y_pos_coarse+1 + sta.z __5+1 + // [12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 -- vbsz1=_sbyte_vwuz2 + // Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll + // Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none) + lda.z __5 + sta.z y_movement + // [13] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2 -- vbsz1_eq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + beq __b2_from___b34 + jmp __b27 + // main::@27 + __b27: + // [14] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@2 -- vbsz1_neq_vbsc1_then_la1 + lda #-1 + cmp.z y_movement + bne __b2_from___b27 + // [15] phi from main::@27 to main::@28 [phi:main::@27->main::@28] + __b28_from___b27: + jmp __b28 + // main::@28 + __b28: + // [16] phi from main::@28 to main::@2 [phi:main::@28->main::@2] + __b2_from___b28: + // [16] phi (signed byte) main::movement#4 = (signed byte) $28 [phi:main::@28->main::@2#0] -- vbsxx=vbsc1 + ldx #$28 + jmp __b2 + // [16] phi from main::@27 to main::@2 [phi:main::@27->main::@2] + __b2_from___b27: + // [16] phi (signed byte) main::movement#4 = (signed byte) 0 [phi:main::@27->main::@2#0] -- vbsxx=vbsc1 + ldx #0 + jmp __b2 + // [16] phi from main::@34 to main::@2 [phi:main::@34->main::@2] + __b2_from___b34: + // [16] phi (signed byte) main::movement#4 = (signed byte) -$28 [phi:main::@34->main::@2#0] -- vbsxx=vbsc1 + ldx #-$28 + jmp __b2 + // main::@2 + __b2: + // [17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17 -- vwuz1=vwuz1_minus_vwuz2 + lda.z __9 + sec + sbc.z x_pos_coarse + sta.z __9 + lda.z __9+1 + sbc.z x_pos_coarse+1 + sta.z __9+1 + // [18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 -- vbsz1=_sbyte_vwuz2 + lda.z __9 + sta.z x_movement + // [19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 -- vbsxx=vbsxx_minus_vbsz1 + // will be -1/0/1 + txa + sec + sbc.z x_movement + tax + // [20] if((signed byte) 0==(signed byte) main::movement#3) goto main::@23 -- vbsc1_eq_vbsxx_then_la1 + cpx #0 + beq __b23_from___b2 + jmp __b29 + // main::@29 + __b29: + // [21] if((byte) 0!=(byte) screen#12) goto main::@3 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b3_from___b29 + // [23] phi from main::@29 to main::@4 [phi:main::@29->main::@4] + __b4_from___b29: + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@29->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z __13+1 + jmp __b4 + // [22] phi from main::@29 to main::@3 [phi:main::@29->main::@3] + __b3_from___b29: + jmp __b3 + // main::@3 + __b3: + // [23] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + __b4_from___b3: + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@3->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z __13+1 + jmp __b4 + // main::@4 + __b4: + // [24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3 -- pbuz1=pbuz1_plus_vbsxx + txa + pha + clc + adc.z screen_active + sta.z screen_active + pla + ora #$7f + bmi !+ + lda #0 + !: + adc.z screen_active+1 + sta.z screen_active+1 + // [25] if((byte) 0!=(byte) screen#12) goto main::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b5_from___b4 + // [27] phi from main::@4 to main::@6 [phi:main::@4->main::@6] + __b6_from___b4: + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@4->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z screen_hidden+1 + jmp __b6 + // [26] phi from main::@4 to main::@5 [phi:main::@4->main::@5] + __b5_from___b4: + jmp __b5 + // main::@5 + __b5: + // [27] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + __b6_from___b5: + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@5->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z screen_hidden+1 + jmp __b6 + // main::@6 + __b6: + // [28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 + // [29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0 + // [30] call screencpy + jsr screencpy + jmp __b35 + // main::@35 + __b35: + // [31] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@7 -- vbsz1_eq_vbsc1_then_la1 + // Update any new row if needed + lda #-1 + cmp.z y_movement + beq __b7 + jmp __b19 + // main::@19 + __b19: + // [32] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@10 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + bne __b10 + jmp __b20 + // main::@20 + __b20: + // [33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [35] call petscii_ptr + // [142] phi from main::@20 to petscii_ptr [phi:main::@20->petscii_ptr] + petscii_ptr_from___b20: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#1 [phi:main::@20->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#1 [phi:main::@20->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10 + jmp __b37 + // main::@37 + __b37: + // [37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1 + // [38] phi from main::@37 to main::@8 [phi:main::@37->main::@8] + __b8_from___b37: + // [38] phi (byte) main::i#2 = (byte) 0 [phi:main::@37->main::@8#0] -- vbuyy=vbuc1 + ldy #0 + jmp __b8 + // main::@8 + __b8: + // [39] if((byte) main::i#2<(byte) $28) goto main::@9 -- vbuyy_lt_vbuc1_then_la1 + cpy #$28 + bcc __b9 + jmp __b10 + // main::@10 + __b10: + // [40] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@13 -- vbsz1_eq_vbsc1_then_la1 + // Update any new column if needed + lda #-1 + cmp.z x_movement + beq __b13 + jmp __b21 + // main::@21 + __b21: + // [41] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@16 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z x_movement + bne __b16 + jmp __b22 + // main::@22 + __b22: + // [42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [44] call petscii_ptr + // [142] phi from main::@22 to petscii_ptr [phi:main::@22->petscii_ptr] + petscii_ptr_from___b22: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#3 [phi:main::@22->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#3 [phi:main::@22->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10 + jmp __b39 + // main::@39 + __b39: + // [46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3 + // [47] phi from main::@39 to main::@14 [phi:main::@39->main::@14] + __b14_from___b39: + // [47] phi (byte*) main::scrn2#2 = (byte*) main::screen_hidden#0 [phi:main::@39->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#0 [phi:main::@39->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) 0 [phi:main::@39->main::@14#2] -- vbuxx=vbuc1 + ldx #0 + jmp __b14 + // main::@14 + __b14: + // [48] if((byte) main::i2#2<(byte) $19) goto main::@15 -- vbuxx_lt_vbuc1_then_la1 + cpx #$19 + bcc __b15 + jmp __b16 + // main::@16 + __b16: + // [49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1 + // Change current screen + lda #1 + eor.z screen + sta.z screen + // [50] phi from main::@16 main::@2 main::@23 to main::@23 [phi:main::@16/main::@2/main::@23->main::@23] + __b23_from___b16: + __b23_from___b2: + __b23_from___b23: + // [50] phi (byte) screen#28 = (byte) screen#0 [phi:main::@16/main::@2/main::@23->main::@23#0] -- register_copy + jmp __b23 + // Update the display - wait for the raster + // main::@23 + __b23: + // [51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fe + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b23_from___b23 + jmp __b24 + // main::@24 + __b24: + // [52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$ff + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b24 + jmp __b25 + // main::@25 + __b25: + // [53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + lda #WHITE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta.z __45 + // [55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12 -- vbuaa=vbuc1_minus_vbuz1 + lda #7 + sec + sbc.z y_pos_fine + // [56] (byte~) main::$47 ← (byte~) main::$45 | (byte~) main::$46 -- vbuaa=vbuz1_bor_vbuaa + ora.z __45 + // [57] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (byte~) main::$47 -- _deref_pbuc1=vbuaa + // Y-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // [58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + sta.z __48 + // [59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12 -- vbuaa=vbuc1_minus_vbuz1 + lda #7 + sec + sbc.z x_pos_fine + // [60] (byte~) main::$50 ← (byte~) main::$48 | (byte~) main::$49 -- vbuaa=vbuz1_bor_vbuaa + ora.z __48 + // [61] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte~) main::$50 -- _deref_pbuc1=vbuaa + // X-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // [62] if((byte) 0!=(byte) screen#28) goto main::toD0182 -- vbuc1_neq_vbuz1_then_la1 + // Display current screen + lda #0 + cmp.z screen + bne toD0182_from___b25 + // [63] phi from main::@25 to main::toD0183 [phi:main::@25->main::toD0183] + toD0183_from___b25: + jmp toD0183 + // main::toD0183 + toD0183: + jmp __b33 + // main::@33 + __b33: + // [64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0183_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + // main::@26 + __b26: + // [65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [7] phi from main::@26 to main::@1 [phi:main::@26->main::@1] + __b1_from___b26: + // [7] phi (byte) screen#12 = (byte) screen#28 [phi:main::@26->main::@1#0] -- register_copy + jmp __b1 + // [66] phi from main::@25 to main::toD0182 [phi:main::@25->main::toD0182] + toD0182_from___b25: + jmp toD0182 + // main::toD0182 + toD0182: + jmp __b32 + // main::@32 + __b32: + // [67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0182_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + // main::@15 + __b15: + // [68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii2),y + ldy #0 + sta (scrn2),y + // [69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn2 + sta.z scrn2 + bcc !+ + inc.z scrn2+1 + !: + // [70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii2 + sta.z petscii2 + bcc !+ + inc.z petscii2+1 + !: + // [71] (byte) main::i2#1 ← ++ (byte) main::i2#2 -- vbuxx=_inc_vbuxx + inx + // [47] phi from main::@15 to main::@14 [phi:main::@15->main::@14] + __b14_from___b15: + // [47] phi (byte*) main::scrn2#2 = (byte*) main::scrn2#1 [phi:main::@15->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#1 [phi:main::@15->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) main::i2#1 [phi:main::@15->main::@14#2] -- register_copy + jmp __b14 + // main::@13 + __b13: + // [72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13 -- vwuz1=vwuz2_plus_vbuc1 + lda #$13 + clc + adc.z x_pos_coarse + sta.z petscii_ptr.row_x + lda #0 + adc.z x_pos_coarse+1 + sta.z petscii_ptr.row_x+1 + // [73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [74] call petscii_ptr + // [142] phi from main::@13 to petscii_ptr [phi:main::@13->petscii_ptr] + petscii_ptr_from___b13: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#2 [phi:main::@13->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#2 [phi:main::@13->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10 + jmp __b38 + // main::@38 + __b38: + // [76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2 + // [77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27 -- pbuz1=pbuz1_plus_vbuc1 + lda #$27 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // [78] phi from main::@38 to main::@17 [phi:main::@38->main::@17] + __b17_from___b38: + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#0 [phi:main::@38->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#0 [phi:main::@38->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) 0 [phi:main::@38->main::@17#2] -- vbuxx=vbuc1 + ldx #0 + jmp __b17 + // main::@17 + __b17: + // [79] if((byte) main::i3#2<(byte) $19) goto main::@18 -- vbuxx_lt_vbuc1_then_la1 + cpx #$19 + bcc __b18 + jmp __b16 + // main::@18 + __b18: + // [80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii3),y + ldy #0 + sta (scrn3),y + // [81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // [82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii3 + sta.z petscii3 + bcc !+ + inc.z petscii3+1 + !: + // [83] (byte) main::i3#1 ← ++ (byte) main::i3#2 -- vbuxx=_inc_vbuxx + inx + // [78] phi from main::@18 to main::@17 [phi:main::@18->main::@17] + __b17_from___b18: + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#1 [phi:main::@18->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#1 [phi:main::@18->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) main::i3#1 [phi:main::@18->main::@17#2] -- register_copy + jmp __b17 + // main::@9 + __b9: + // [84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (petscii),y + sta (screen_hidden),y + // [85] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy + iny + // [38] phi from main::@9 to main::@8 [phi:main::@9->main::@8] + __b8_from___b9: + // [38] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@9->main::@8#0] -- register_copy + jmp __b8 + // main::@7 + __b7: + // [86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c -- vwuz1=vwuz2_plus_vbuc1 + lda #$c + clc + adc.z y_pos_coarse + sta.z petscii_ptr.row_y + lda #0 + adc.z y_pos_coarse+1 + sta.z petscii_ptr.row_y+1 + // [88] call petscii_ptr + // [142] phi from main::@7 to petscii_ptr [phi:main::@7->petscii_ptr] + petscii_ptr_from___b7: + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#0 [phi:main::@7->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#0 [phi:main::@7->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // [89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10 + jmp __b36 + // main::@36 + __b36: + // [90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0 + // [91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz2_plus_vwuc1 + lda.z screen_hidden + clc + adc #<$18*$28 + sta.z scrn1 + lda.z screen_hidden+1 + adc #>$18*$28 + sta.z scrn1+1 + // [92] phi from main::@36 to main::@11 [phi:main::@36->main::@11] + __b11_from___b36: + // [92] phi (byte) main::i1#2 = (byte) 0 [phi:main::@36->main::@11#0] -- vbuyy=vbuc1 + ldy #0 + jmp __b11 + // main::@11 + __b11: + // [93] if((byte) main::i1#2<(byte) $28) goto main::@12 -- vbuyy_lt_vbuc1_then_la1 + cpy #$28 + bcc __b12 + jmp __b10 + // main::@12 + __b12: + // [94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (petscii1),y + sta (scrn1),y + // [95] (byte) main::i1#1 ← ++ (byte) main::i1#2 -- vbuyy=_inc_vbuyy + iny + // [92] phi from main::@12 to main::@11 [phi:main::@12->main::@11] + __b11_from___b12: + // [92] phi (byte) main::i1#2 = (byte) main::i1#1 [phi:main::@12->main::@11#0] -- register_copy + jmp __b11 +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = MAIN_SCREEN0 + .label end = str+num + .label dst = 9 + // [97] phi from memset to memset::@1 [phi:memset->memset::@1] + __b1_from_memset: + // [97] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta.z dst+1 + jmp __b1 + // memset::@1 + __b1: + // [98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z dst+1 + cmp #>end + bne __b2 + lda.z dst + cmp #memset::@1] + __b1_from___b2: + // [97] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy + jmp __b1 +} + // next_position +// Update the x_pos, y_pos variables to reflect the next position on the curve +// The position represents the center of the screen +next_position: { + .label __4 = $16 + .label __8 = $18 + .label __12 = $16 + .label __13 = $18 + .label x_pos_u = $16 + .label y_pos_u = $18 + .label __18 = $16 + .label __19 = $18 + // [103] (word) x_sin_idx#13 ← ++ (word) x_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z x_sin_idx + bne !+ + inc.z x_sin_idx+1 + !: + // [104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 -- vwuz1_lt_vwuc1_then_la1 + lda.z x_sin_idx+1 + cmp #>SINSIZE + bcc __b1_from_next_position + bne !+ + lda.z x_sin_idx + cmp #SINSIZE + sta.z x_sin_idx+1 + // [106] phi from next_position next_position::@3 to next_position::@1 [phi:next_position/next_position::@3->next_position::@1] + __b1_from_next_position: + __b1_from___b3: + // [106] phi (word) x_sin_idx#14 = (word) x_sin_idx#13 [phi:next_position/next_position::@3->next_position::@1#0] -- register_copy + jmp __b1 + // next_position::@1 + __b1: + // [107] (word) y_sin_idx#14 ← ++ (word) y_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z y_sin_idx + bne !+ + inc.z y_sin_idx+1 + !: + // [108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 -- vwuz1_lt_vwuc1_then_la1 + lda.z y_sin_idx+1 + cmp #>SINSIZE + bcc __b2_from___b1 + bne !+ + lda.z y_sin_idx + cmp #SINSIZE + sta.z y_sin_idx+1 + // [110] phi from next_position::@1 next_position::@4 to next_position::@2 [phi:next_position::@1/next_position::@4->next_position::@2] + __b2_from___b1: + __b2_from___b4: + // [110] phi (word) y_sin_idx#13 = (word) y_sin_idx#14 [phi:next_position::@1/next_position::@4->next_position::@2#0] -- register_copy + jmp __b2 + // next_position::@2 + __b2: + // [111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z x_sin_idx + asl + sta.z __12 + lda.z x_sin_idx+1 + rol + sta.z __12+1 + // [112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12 -- pwsz1=pwsc1_plus_vwuz1 + clc + lda.z __18 + adc #SINTAB + sta.z __18+1 + // [113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18) -- vwsz1=_deref_pwsz1 + // Find the next point + ldy #0 + lda (x_pos),y + pha + iny + lda (x_pos),y + sta.z x_pos+1 + pla + sta.z x_pos + // [114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z y_sin_idx + asl + sta.z __13 + lda.z y_sin_idx+1 + rol + sta.z __13+1 + // [115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13 -- pwsz1=pwsc1_plus_vwuz1 + clc + lda.z __19 + adc #SINTAB + sta.z __19+1 + // [116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19) -- vwsz1=_deref_pwsz1 + ldy #0 + lda (y_pos),y + pha + iny + lda (y_pos),y + sta.z y_pos+1 + pla + sta.z y_pos + // [117] (word~) next_position::$4 ← (word)(signed word) x_pos#11 + // [118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8 -- vwuz1=vwuz1_plus_vwuc1 + clc + lda.z x_pos_u + adc #<$190+$14*8 + sta.z x_pos_u + lda.z x_pos_u+1 + adc #>$190+$14*8 + sta.z x_pos_u+1 + // [119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 -- vbuaa=_byte_vwuz1 + lda.z x_pos_u + // [120] (byte) x_pos_fine#12 ← (byte~) next_position::$15 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 + and #7 + sta.z x_pos_fine + // [121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3 -- vwuz1=vwuz1_ror_3 + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + // [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 + // [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 -- vwuz1=vwuz1_plus_vwuc1 + clc + lda.z y_pos_u + adc #<$190+$c*8 + sta.z y_pos_u + lda.z y_pos_u+1 + adc #>$190+$c*8 + sta.z y_pos_u+1 + // [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 -- vbuaa=_byte_vwuz1 + lda.z y_pos_u + // [125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 + and #7 + sta.z y_pos_fine + // [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 -- vwuz1=vwuz1_ror_3 + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + jmp __breturn + // next_position::@return + __breturn: + // [127] return + rts +} + // screencpy +// Copy an entire screen (40x25 = 1000 chars) +// - dst - destination +// - src - source +// screencpy(byte* zp(7) dst, byte* zp(3) src) +screencpy: { + .label dst = 7 + .label src = 3 + .label src_250 = $26 + .label dst_250 = $1c + .label src_500 = $1e + .label dst_500 = $20 + .label src_750 = $22 + .label dst_750 = $24 + // [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z src + sta.z src_250 + lda #0 + adc.z src+1 + sta.z src_250+1 + // [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z dst + sta.z dst_250 + lda #0 + adc.z dst+1 + sta.z dst_250+1 + // [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$1f4 + sta.z src_500 + lda.z src+1 + adc #>$1f4 + sta.z src_500+1 + // [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$1f4 + sta.z dst_500 + lda.z dst+1 + adc #>$1f4 + sta.z dst_500+1 + // [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$2ee + sta.z src_750 + lda.z src+1 + adc #>$2ee + sta.z src_750+1 + // [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$2ee + sta.z dst_750 + lda.z dst+1 + adc #>$2ee + sta.z dst_750+1 + // [134] phi from screencpy to screencpy::@1 [phi:screencpy->screencpy::@1] + __b1_from_screencpy: + // [134] phi (byte) screencpy::i#2 = (byte) 0 [phi:screencpy->screencpy::@1#0] -- vbuyy=vbuc1 + ldy #0 + jmp __b1 + // screencpy::@1 + __b1: + // [135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 -- vbuyy_lt_vbuc1_then_la1 + cpy #$fa + bcc __b2 + jmp __breturn + // screencpy::@return + __breturn: + // [136] return + rts + // screencpy::@2 + __b2: + // [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src),y + sta (dst),y + // [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_250),y + sta (dst_250),y + // [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_500),y + sta (dst_500),y + // [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_750),y + sta (dst_750),y + // [141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2 -- vbuyy=_inc_vbuyy + iny + // [134] phi from screencpy::@2 to screencpy::@1 [phi:screencpy::@2->screencpy::@1] + __b1_from___b2: + // [134] phi (byte) screencpy::i#2 = (byte) screencpy::i#1 [phi:screencpy::@2->screencpy::@1#0] -- register_copy + jmp __b1 +} + // petscii_ptr +// Get a pointer to a specific x,y-position in the PETSCII art +// petscii_ptr(word zp(5) row_x, word zp($d) row_y) +petscii_ptr: { + .label __0 = $d + .label __1 = $d + .label row_x = 5 + .label row_y = $d + .label return = 5 + .label __3 = $26 + .label __4 = $26 + .label __5 = $26 + .label __6 = $d + // [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 -- vwuz1=vwuz2_rol_4 + lda.z row_y + asl + sta.z __3 + lda.z row_y+1 + rol + sta.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + // [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz1_plus_vwuz2 + lda.z __4 + clc + adc.z row_y + sta.z __4 + lda.z __4+1 + adc.z row_y+1 + sta.z __4+1 + // [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __5 + rol.z __5+1 + // [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz2_plus_vwuz1 + lda.z __6 + clc + adc.z __5 + sta.z __6 + lda.z __6+1 + adc.z __5+1 + sta.z __6+1 + // [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 -- vwuz1=vwuz1_rol_2 + asl.z __0 + rol.z __0+1 + asl.z __0 + rol.z __0+1 + // [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z __1 + adc #PETSCII_ART + sta.z __1+1 + // [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 -- pbuz1=pbuz2_plus_vwuz1 + lda.z return + clc + adc.z __1 + sta.z return + lda.z return+1 + adc.z __1+1 + sta.z return+1 + jmp __breturn + // petscii_ptr::@return + __breturn: + // [150] return + rts +} + // File Data +// Sinus table [-399,399] +SINTAB: +.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE) + +.pc = $4000 "PETSCII_ART" +// 140x125 PETSCII art +PETSCII_ART: +.var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y0 +Removing instruction ldy #0 +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label __b3_from___b29 with __b3 +Replacing label __b5_from___b4 with __b5 +Replacing label __b23_from___b23 with __b23_from___b2 +Replacing label toD0182_from___b25 with __b32 +Replacing label __b1_from_next_position with __b1 +Replacing label __b1_from_next_position with __b1 +Replacing label __b2_from___b1 with __b2 +Replacing label __b2_from___b1 with __b2 +Removing instruction __b30_from_sei1: +Removing instruction toD0181_from___b30: +Removing instruction toD0181: +Removing instruction __b28_from___b27: +Removing instruction __b2_from___b28: +Removing instruction __b3_from___b29: +Removing instruction __b4_from___b3: +Removing instruction __b5_from___b4: +Removing instruction __b6_from___b5: +Removing instruction __b8_from___b37: +Removing instruction __b14_from___b39: +Removing instruction __b23_from___b16: +Removing instruction __b23_from___b23: +Removing instruction toD0183_from___b25: +Removing instruction toD0183: +Removing instruction toD0182_from___b25: +Removing instruction toD0182: +Removing instruction __b1_from_next_position: +Removing instruction __b1_from___b3: +Removing instruction __b2_from___b1: +Removing instruction __b2_from___b4: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction sei1: +Removing instruction __b30: +Removing instruction memset_from___b30: +Removing instruction __b31: +Removing instruction next_position_from___b31: +Removing instruction __b1_from___b31: +Removing instruction next_position_from___b1: +Removing instruction __b34: +Removing instruction __b27: +Removing instruction __b28: +Removing instruction __b29: +Removing instruction __b4_from___b29: +Removing instruction __b6_from___b4: +Removing instruction __b35: +Removing instruction __b19: +Removing instruction __b20: +Removing instruction petscii_ptr_from___b20: +Removing instruction __b37: +Removing instruction __b21: +Removing instruction __b22: +Removing instruction petscii_ptr_from___b22: +Removing instruction __b39: +Removing instruction __b23: +Removing instruction __b25: +Removing instruction __b33: +Removing instruction __b1_from___b26: +Removing instruction __b14_from___b15: +Removing instruction petscii_ptr_from___b13: +Removing instruction __b38: +Removing instruction __b17_from___b38: +Removing instruction __b17_from___b18: +Removing instruction __b8_from___b9: +Removing instruction petscii_ptr_from___b7: +Removing instruction __b36: +Removing instruction __b11_from___b36: +Removing instruction __b11_from___b12: +Removing instruction __b1_from_memset: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction __b3: +Removing instruction __b4: +Removing instruction __breturn: +Removing instruction __b1_from_screencpy: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction __breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Relabelling long label __b2_from___b27 to __b19 +Relabelling long label __b2_from___b34 to __b20 +Relabelling long label __b23_from___b2 to __b21 +Succesful ASM optimization Pass5RelabelLongLabels +Fixing long branch [128] beq __b21 to bne +Fixing long branch [175] beq __b7 to bne +Fixing long branch [199] bcc __b9 to bcs +Fixing long branch [206] beq __b13 to bne + +FINAL SYMBOL TABLE +(const nomodify byte) BLACK = (byte) 0 +(const nomodify byte*) MAIN_CHARSET = (byte*) 4096 +(const nomodify byte*) MAIN_SCREEN0 = (byte*) 14336 +(const nomodify byte*) MAIN_SCREEN1 = (byte*) 15360 +(byte) MOS6526_CIA::INTERRUPT +(byte) MOS6526_CIA::PORT_A +(byte) MOS6526_CIA::PORT_A_DDR +(byte) MOS6526_CIA::PORT_B +(byte) MOS6526_CIA::PORT_B_DDR +(byte) MOS6526_CIA::SERIAL_DATA +(word) MOS6526_CIA::TIMER_A +(byte) MOS6526_CIA::TIMER_A_CONTROL +(word) MOS6526_CIA::TIMER_B +(byte) MOS6526_CIA::TIMER_B_CONTROL +(byte) MOS6526_CIA::TOD_10THS +(byte) MOS6526_CIA::TOD_HOURS +(byte) MOS6526_CIA::TOD_MIN +(byte) MOS6526_CIA::TOD_SEC +(byte) MOS6569_VICII::BG_COLOR +(byte) MOS6569_VICII::BG_COLOR1 +(byte) MOS6569_VICII::BG_COLOR2 +(byte) MOS6569_VICII::BG_COLOR3 +(byte) MOS6569_VICII::BORDER_COLOR +(byte) MOS6569_VICII::CONTROL1 +(byte) MOS6569_VICII::CONTROL2 +(byte) MOS6569_VICII::IRQ_ENABLE +(byte) MOS6569_VICII::IRQ_STATUS +(byte) MOS6569_VICII::LIGHTPEN_X +(byte) MOS6569_VICII::LIGHTPEN_Y +(byte) MOS6569_VICII::MEMORY +(byte) MOS6569_VICII::RASTER +(byte) MOS6569_VICII::SPRITE0_COLOR +(byte) MOS6569_VICII::SPRITE0_X +(byte) MOS6569_VICII::SPRITE0_Y +(byte) MOS6569_VICII::SPRITE1_COLOR +(byte) MOS6569_VICII::SPRITE1_X +(byte) MOS6569_VICII::SPRITE1_Y +(byte) MOS6569_VICII::SPRITE2_COLOR +(byte) MOS6569_VICII::SPRITE2_X +(byte) MOS6569_VICII::SPRITE2_Y +(byte) MOS6569_VICII::SPRITE3_COLOR +(byte) MOS6569_VICII::SPRITE3_X +(byte) MOS6569_VICII::SPRITE3_Y +(byte) MOS6569_VICII::SPRITE4_COLOR +(byte) MOS6569_VICII::SPRITE4_X +(byte) MOS6569_VICII::SPRITE4_Y +(byte) MOS6569_VICII::SPRITE5_COLOR +(byte) MOS6569_VICII::SPRITE5_X +(byte) MOS6569_VICII::SPRITE5_Y +(byte) MOS6569_VICII::SPRITE6_COLOR +(byte) MOS6569_VICII::SPRITE6_X +(byte) MOS6569_VICII::SPRITE6_Y +(byte) MOS6569_VICII::SPRITE7_COLOR +(byte) MOS6569_VICII::SPRITE7_X +(byte) MOS6569_VICII::SPRITE7_Y +(byte) MOS6569_VICII::SPRITES_BG_COLLISION +(byte) MOS6569_VICII::SPRITES_COLLISION +(byte) MOS6569_VICII::SPRITES_ENABLE +(byte) MOS6569_VICII::SPRITES_EXPAND_X +(byte) MOS6569_VICII::SPRITES_EXPAND_Y +(byte) MOS6569_VICII::SPRITES_MC +(byte) MOS6569_VICII::SPRITES_MCOLOR1 +(byte) MOS6569_VICII::SPRITES_MCOLOR2 +(byte) MOS6569_VICII::SPRITES_PRIORITY +(byte) MOS6569_VICII::SPRITES_XMSB +(byte) MOS6581_SID::CH1_ATTACK_DECAY +(byte) MOS6581_SID::CH1_CONTROL +(word) MOS6581_SID::CH1_FREQ +(word) MOS6581_SID::CH1_PULSE_WIDTH +(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH2_ATTACK_DECAY +(byte) MOS6581_SID::CH2_CONTROL +(word) MOS6581_SID::CH2_FREQ +(word) MOS6581_SID::CH2_PULSE_WIDTH +(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE +(byte) MOS6581_SID::CH3_ATTACK_DECAY +(byte) MOS6581_SID::CH3_CONTROL +(byte) MOS6581_SID::CH3_ENV +(word) MOS6581_SID::CH3_FREQ +(byte) MOS6581_SID::CH3_OSC +(word) MOS6581_SID::CH3_PULSE_WIDTH +(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE +(byte) MOS6581_SID::FILTER_CUTOFF_HIGH +(byte) MOS6581_SID::FILTER_CUTOFF_LOW +(byte) MOS6581_SID::FILTER_SETUP +(byte) MOS6581_SID::POT_X +(byte) MOS6581_SID::POT_Y +(byte) MOS6581_SID::VOLUME_FILTER_MODE +(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20 +(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11 +(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16 +(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY = (byte) $18 +(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12 +(const byte*) PETSCII_ART[(number) $8c*(number) $7d] = kickasm {{ .var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(label) main::toD0182 +(byte*) main::toD0182_gfx +(byte) main::toD0182_return +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0182_screen +(label) main::toD0183 +(byte*) main::toD0183_gfx +(byte) main::toD0183_return +(const byte) main::toD0183_return#0 toD0183_return = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0183_screen +(signed byte) main::x_movement +(signed byte) main::x_movement#0 x_movement zp[1]:18 1.2571428571428571 +(word) main::x_pos_coarse_old +(word) main::x_pos_coarse_old#0 x_pos_coarse_old zp[2]:13 2.4444444444444446 +(signed byte) main::y_movement +(signed byte) main::y_movement#0 y_movement zp[1]:17 2.75 +(word) main::y_pos_coarse_old +(word) main::y_pos_coarse_old#0 y_pos_coarse_old zp[2]:15 11.0 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@2 +(label) memset::@return +(byte) memset::c +(const byte) memset::c#0 c = (byte) ' ' +(byte*) memset::dst +(byte*) memset::dst#1 dst zp[2]:9 202.0 +(byte*) memset::dst#2 dst zp[2]:9 134.66666666666666 +(byte*) memset::end +(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 +(word) memset::num +(const word) memset::num#0 num = (word) $3e8 +(void*) memset::return +(void*) memset::str +(const void*) memset::str#0 str = (void*)(const nomodify byte*) MAIN_SCREEN0 +(void()) next_position() +(word~) next_position::$12 zp[2]:22 202.0 +(word~) next_position::$13 zp[2]:24 202.0 +(byte~) next_position::$15 reg byte a 202.0 +(byte~) next_position::$17 reg byte a 202.0 +(signed word*~) next_position::$18 zp[2]:22 202.0 +(signed word*~) next_position::$19 zp[2]:24 202.0 +(word~) next_position::$4 zp[2]:22 202.0 +(word~) next_position::$8 zp[2]:24 202.0 +(label) next_position::@1 +(label) next_position::@2 +(label) next_position::@3 +(label) next_position::@4 +(label) next_position::@return +(word) next_position::x_pos_u +(word) next_position::x_pos_u#0 x_pos_u zp[2]:22 67.33333333333333 +(word) next_position::y_pos_u +(word) next_position::y_pos_u#0 y_pos_u zp[2]:24 67.33333333333333 +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +(word~) petscii_ptr::$0 zp[2]:13 202.0 +(byte*~) petscii_ptr::$1 zp[2]:13 202.0 +(word~) petscii_ptr::$3 zp[2]:38 202.0 +(word~) petscii_ptr::$4 zp[2]:38 202.0 +(word~) petscii_ptr::$5 zp[2]:38 202.0 +(word~) petscii_ptr::$6 zp[2]:13 202.0 +(label) petscii_ptr::@return +(byte*) petscii_ptr::return +(byte*) petscii_ptr::return#0 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#1 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#10 return zp[2]:5 24.166666666666664 +(byte*) petscii_ptr::return#2 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#3 return zp[2]:5 22.0 +(word) petscii_ptr::row_x +(word) petscii_ptr::row_x#0 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#1 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#2 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#3 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#4 row_x zp[2]:5 20.714285714285715 +(word) petscii_ptr::row_y +(word) petscii_ptr::row_y#0 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#1 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#2 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#3 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#4 row_y zp[2]:13 86.75 +(byte) screen +(byte) screen#0 screen zp[1]:2 22.0 +(byte) screen#12 screen zp[1]:2 0.7857142857142857 +(byte) screen#28 screen zp[1]:2 13.666666666666666 +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +(label) screencpy::@1 +(label) screencpy::@2 +(label) screencpy::@return +(byte*) screencpy::dst +(byte*) screencpy::dst#0 dst zp[2]:7 687.6666666666666 +(byte*) screencpy::dst_250 +(byte*) screencpy::dst_250#0 dst_250 zp[2]:28 841.8333333333333 +(byte*) screencpy::dst_500 +(byte*) screencpy::dst_500#0 dst_500 zp[2]:32 1010.2 +(byte*) screencpy::dst_750 +(byte*) screencpy::dst_750#0 dst_750 zp[2]:36 1262.75 +(byte) screencpy::i +(byte) screencpy::i#1 reg byte y 20002.0 +(byte) screencpy::i#2 reg byte y 18335.166666666668 +(byte*) screencpy::src +(byte*) screencpy::src#0 src zp[2]:3 736.7857142857143 +(byte*) screencpy::src_250 +(byte*) screencpy::src_250#0 src_250 zp[2]:38 777.076923076923 +(byte*) screencpy::src_500 +(byte*) screencpy::src_500#0 src_500 zp[2]:30 918.3636363636363 +(byte*) screencpy::src_750 +(byte*) screencpy::src_750#0 src_750 zp[2]:34 1122.4444444444443 +(signed word) x_pos +(signed word) x_pos#11 x_pos zp[2]:22 25.25 +(word) x_pos_coarse +(word) x_pos_coarse#17 x_pos_coarse zp[2]:22 1.7578947368421054 +(byte) x_pos_fine +(byte) x_pos_fine#12 x_pos_fine zp[1]:26 1.3176470588235294 +(word) x_sin_idx +(word) x_sin_idx#12 x_sin_idx zp[2]:9 112.0 +(word) x_sin_idx#13 x_sin_idx zp[2]:9 202.0 +(word) x_sin_idx#14 x_sin_idx zp[2]:9 2.803571428571429 +(word) x_sin_idx#4 x_sin_idx zp[2]:9 202.0 +(signed word) y_pos +(signed word) y_pos#11 y_pos zp[2]:24 16.833333333333332 +(word) y_pos_coarse +(word) y_pos_coarse#16 y_pos_coarse zp[2]:24 1.8351648351648353 +(byte) y_pos_fine +(byte) y_pos_fine#12 y_pos_fine zp[1]:27 1.473684210526316 +(word) y_sin_idx +(word) y_sin_idx#12 y_sin_idx zp[2]:11 22.4 +(word) y_sin_idx#13 y_sin_idx zp[2]:11 2.9074074074074074 +(word) y_sin_idx#14 y_sin_idx zp[2]:11 202.0 +(word) y_sin_idx#4 y_sin_idx zp[2]:11 202.0 + +zp[1]:2 [ screen#12 screen#28 screen#0 ] +reg byte x [ main::movement#4 ] +zp[2]:3 [ main::$13 main::screen_active#0 screencpy::src#0 ] +reg byte y [ main::i#2 main::i#1 ] +reg byte x [ main::i2#2 main::i2#1 ] +zp[2]:5 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 petscii_ptr::return#1 main::petscii#0 petscii_ptr::return#0 main::petscii1#0 ] +zp[2]:7 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 main::scrn3#2 main::scrn3#1 main::scrn3#0 screencpy::dst#0 ] +reg byte x [ main::i3#2 main::i3#1 ] +reg byte y [ main::i1#2 main::i1#1 ] +zp[2]:9 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 memset::dst#2 memset::dst#1 ] +zp[2]:11 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +reg byte y [ screencpy::i#2 screencpy::i#1 ] +zp[2]:13 [ main::x_pos_coarse_old#0 main::$9 petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 petscii_ptr::$0 petscii_ptr::$1 ] +zp[2]:15 [ main::y_pos_coarse_old#0 main::$5 ] +zp[1]:17 [ main::y_movement#0 ] +zp[1]:18 [ main::x_movement#0 ] +reg byte x [ main::movement#3 ] +zp[1]:19 [ main::$45 ] +reg byte a [ main::$46 ] +reg byte a [ main::$47 ] +reg byte a [ main::$49 ] +reg byte a [ main::$50 ] +zp[2]:20 [ main::scrn1#0 ] +zp[2]:22 [ next_position::$12 next_position::$18 x_pos#11 next_position::$4 next_position::x_pos_u#0 x_pos_coarse#17 ] +zp[2]:24 [ next_position::$13 next_position::$19 y_pos#11 next_position::$8 next_position::y_pos_u#0 y_pos_coarse#16 ] +reg byte a [ next_position::$15 ] +zp[1]:26 [ x_pos_fine#12 ] +reg byte a [ next_position::$17 ] +zp[1]:27 [ y_pos_fine#12 main::$48 ] +zp[2]:28 [ screencpy::dst_250#0 ] +zp[2]:30 [ screencpy::src_500#0 ] +zp[2]:32 [ screencpy::dst_500#0 ] +zp[2]:34 [ screencpy::src_750#0 ] +zp[2]:36 [ screencpy::dst_750#0 ] +zp[2]:38 [ petscii_ptr::$3 petscii_ptr::$4 petscii_ptr::$5 screencpy::src_250#0 ] + + +FINAL ASSEMBLER +Score: 31419 + + // File Comments +// A full-screen x/y-scroller +// World space is a 16-bit signed coordinate system [-32768, 32767] x [-32768, 32767] + // Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // Global Constants & labels + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + // The number of sinus values in the table + .const SINSIZE = $800 + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // Display screen #0 (double buffered) + .label MAIN_SCREEN0 = $3800 + // Display screen #1 (double buffered) + .label MAIN_SCREEN1 = $3c00 + // Display charset + .label MAIN_CHARSET = $1000 + // The current screen displayed (0/1) + .label screen = 2 + // Current index into the sinus + .label x_sin_idx = 9 + .label y_sin_idx = $b + // Current x/y-position (the center of the screen) + .label x_pos = $16 + .label y_pos = $18 + // The current scroll fine values [0-7] (converted to unsigned) + .label x_pos_fine = $1a + // The current scroll coarse values (converted to unsigned) + .label x_pos_coarse = $16 + .label y_pos_fine = $1b + .label y_pos_coarse = $18 + // main +main: { + .const toD0181_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0182_return = (>(MAIN_SCREEN1&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .const toD0183_return = (>(MAIN_SCREEN0&$3fff)*4)|(>MAIN_CHARSET)/4&$f + .label __5 = $f + .label __9 = $d + .label __13 = 3 + .label __45 = $13 + .label __48 = $1b + .label x_pos_coarse_old = $d + .label y_pos_coarse_old = $f + .label y_movement = $11 + .label x_movement = $12 + .label screen_active = 3 + .label screen_hidden = 7 + .label petscii1 = 5 + .label scrn1 = $14 + .label petscii = 5 + .label petscii3 = 5 + .label scrn3 = 7 + .label petscii2 = 5 + .label scrn2 = 7 + // main::sei1 + // asm + // asm { sei } + sei + // [2] phi from main::sei1 to main::@30 [phi:main::sei1->main::@30] + // main::@30 + // memset(MAIN_SCREEN0, ' ', 1000) + // [3] call memset + // Clear screen + // [96] phi from main::@30 to memset [phi:main::@30->memset] + jsr memset + // [4] phi from main::@30 to main::toD0181 [phi:main::@30->main::toD0181] + // main::toD0181 + // main::@31 + // VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET) + // [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Display initial screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // next_position() + // [6] call next_position + // Find initial position + // [102] phi from main::@31 to next_position [phi:main::@31->next_position] + // [102] phi (word) y_sin_idx#12 = (const nomodify word) SINSIZE/(byte) 4 [phi:main::@31->next_position#0] -- vwuz1=vwuc1 + lda #SINSIZE/4 + sta.z y_sin_idx+1 + // [102] phi (word) x_sin_idx#12 = (word) 0 [phi:main::@31->next_position#1] -- vwuz1=vwuc1 + lda #<0 + sta.z x_sin_idx + sta.z x_sin_idx+1 + jsr next_position + // [7] phi from main::@31 to main::@1 [phi:main::@31->main::@1] + // [7] phi (byte) screen#12 = (byte) 0 [phi:main::@31->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z screen + // main::@1 + __b1: + // x_pos_coarse_old = x_pos_coarse + // [8] (word) main::x_pos_coarse_old#0 ← (word) x_pos_coarse#17 -- vwuz1=vwuz2 + // The old coarse values x/y-positions + lda.z x_pos_coarse + sta.z x_pos_coarse_old + lda.z x_pos_coarse+1 + sta.z x_pos_coarse_old+1 + // y_pos_coarse_old = y_pos_coarse + // [9] (word) main::y_pos_coarse_old#0 ← (word) y_pos_coarse#16 -- vwuz1=vwuz2 + lda.z y_pos_coarse + sta.z y_pos_coarse_old + lda.z y_pos_coarse+1 + sta.z y_pos_coarse_old+1 + // next_position() + // [10] call next_position + // Update the position + // [102] phi from main::@1 to next_position [phi:main::@1->next_position] + // [102] phi (word) y_sin_idx#12 = (word) y_sin_idx#13 [phi:main::@1->next_position#0] -- register_copy + // [102] phi (word) x_sin_idx#12 = (word) x_sin_idx#14 [phi:main::@1->next_position#1] -- register_copy + jsr next_position + // main::@34 + // y_pos_coarse_old-y_pos_coarse + // [11] (word~) main::$5 ← (word) main::y_pos_coarse_old#0 - (word) y_pos_coarse#16 -- vwuz1=vwuz1_minus_vwuz2 + lda.z __5 + sec + sbc.z y_pos_coarse + sta.z __5 + lda.z __5+1 + sbc.z y_pos_coarse+1 + sta.z __5+1 + // y_movement = (signed char)(y_pos_coarse_old-y_pos_coarse) + // [12] (signed byte) main::y_movement#0 ← (signed byte)(word~) main::$5 -- vbsz1=_sbyte_vwuz2 + // Detect the need for coarse scrolling (moving chars on the entire screen) and the direction of the scroll + // Movement is the offset that the screen data should be moved (-40: down, 40: up, -1: right, 1: left, 0: none) + lda.z __5 + sta.z y_movement + // if(y_movement==1) + // [13] if((signed byte) main::y_movement#0==(signed byte) 1) goto main::@2 -- vbsz1_eq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + beq __b20 + // main::@27 + // if(y_movement==-1) + // [14] if((signed byte) main::y_movement#0!=(signed byte) -1) goto main::@2 -- vbsz1_neq_vbsc1_then_la1 + lda #-1 + cmp.z y_movement + bne __b19 + // [15] phi from main::@27 to main::@28 [phi:main::@27->main::@28] + // main::@28 + // [16] phi from main::@28 to main::@2 [phi:main::@28->main::@2] + // [16] phi (signed byte) main::movement#4 = (signed byte) $28 [phi:main::@28->main::@2#0] -- vbsxx=vbsc1 + ldx #$28 + jmp __b2 + // [16] phi from main::@27 to main::@2 [phi:main::@27->main::@2] + __b19: + // [16] phi (signed byte) main::movement#4 = (signed byte) 0 [phi:main::@27->main::@2#0] -- vbsxx=vbsc1 + ldx #0 + jmp __b2 + // [16] phi from main::@34 to main::@2 [phi:main::@34->main::@2] + __b20: + // [16] phi (signed byte) main::movement#4 = (signed byte) -$28 [phi:main::@34->main::@2#0] -- vbsxx=vbsc1 + ldx #-$28 + // main::@2 + __b2: + // x_pos_coarse_old-x_pos_coarse + // [17] (word~) main::$9 ← (word) main::x_pos_coarse_old#0 - (word) x_pos_coarse#17 -- vwuz1=vwuz1_minus_vwuz2 + lda.z __9 + sec + sbc.z x_pos_coarse + sta.z __9 + lda.z __9+1 + sbc.z x_pos_coarse+1 + sta.z __9+1 + // x_movement = (signed char)(x_pos_coarse_old-x_pos_coarse) + // [18] (signed byte) main::x_movement#0 ← (signed byte)(word~) main::$9 -- vbsz1=_sbyte_vwuz2 + lda.z __9 + sta.z x_movement + // movement -= x_movement + // [19] (signed byte) main::movement#3 ← (signed byte) main::movement#4 - (signed byte) main::x_movement#0 -- vbsxx=vbsxx_minus_vbsz1 + // will be -1/0/1 + txa + sec + sbc.z x_movement + tax + // if(movement) + // [20] if((signed byte) 0==(signed byte) main::movement#3) goto main::@23 -- vbsc1_eq_vbsxx_then_la1 + cpx #0 + bne !__b21+ + jmp __b21 + !__b21: + // main::@29 + // screen?MAIN_SCREEN1:MAIN_SCREEN0 + // [21] if((byte) 0!=(byte) screen#12) goto main::@3 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b3 + // [23] phi from main::@29 to main::@4 [phi:main::@29->main::@4] + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@29->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z __13+1 + jmp __b4 + // [22] phi from main::@29 to main::@3 [phi:main::@29->main::@3] + // main::@3 + __b3: + // screen?MAIN_SCREEN1:MAIN_SCREEN0 + // [23] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + // [23] phi (byte*~) main::$13 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@3->main::@4#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z __13+1 + // main::@4 + __b4: + // screen_active = (screen?MAIN_SCREEN1:MAIN_SCREEN0) + movement + // [24] (byte*) main::screen_active#0 ← (byte*~) main::$13 + (signed byte) main::movement#3 -- pbuz1=pbuz1_plus_vbsxx + txa + pha + clc + adc.z screen_active + sta.z screen_active + pla + ora #$7f + bmi !+ + lda #0 + !: + adc.z screen_active+1 + sta.z screen_active+1 + // screen?MAIN_SCREEN0:MAIN_SCREEN1 + // [25] if((byte) 0!=(byte) screen#12) goto main::@5 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z screen + bne __b5 + // [27] phi from main::@4 to main::@6 [phi:main::@4->main::@6] + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN1 [phi:main::@4->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN1 + sta.z screen_hidden+1 + jmp __b6 + // [26] phi from main::@4 to main::@5 [phi:main::@4->main::@5] + // main::@5 + __b5: + // screen?MAIN_SCREEN0:MAIN_SCREEN1 + // [27] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + // [27] phi (byte*) main::screen_hidden#0 = (const nomodify byte*) MAIN_SCREEN0 [phi:main::@5->main::@6#0] -- pbuz1=pbuc1 + lda #MAIN_SCREEN0 + sta.z screen_hidden+1 + // main::@6 + __b6: + // screencpy(screen_hidden, screen_active) + // [28] (byte*) screencpy::dst#0 ← (byte*) main::screen_hidden#0 + // [29] (byte*) screencpy::src#0 ← (byte*) main::screen_active#0 + // [30] call screencpy + jsr screencpy + // main::@35 + // if(y_movement==-1) + // [31] if((signed byte) main::y_movement#0==(signed byte) -1) goto main::@7 -- vbsz1_eq_vbsc1_then_la1 + // Update any new row if needed + lda #-1 + cmp.z y_movement + bne !__b7+ + jmp __b7 + !__b7: + // main::@19 + // if(y_movement==1) + // [32] if((signed byte) main::y_movement#0!=(signed byte) 1) goto main::@10 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z y_movement + bne __b10 + // main::@20 + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [33] (word) petscii_ptr::row_x#1 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [34] (word) petscii_ptr::row_y#1 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [35] call petscii_ptr + // [142] phi from main::@20 to petscii_ptr [phi:main::@20->petscii_ptr] + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#1 [phi:main::@20->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#1 [phi:main::@20->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [36] (byte*) petscii_ptr::return#1 ← (byte*) petscii_ptr::return#10 + // main::@37 + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [37] (byte*) main::petscii#0 ← (byte*) petscii_ptr::return#1 + // [38] phi from main::@37 to main::@8 [phi:main::@37->main::@8] + // [38] phi (byte) main::i#2 = (byte) 0 [phi:main::@37->main::@8#0] -- vbuyy=vbuc1 + ldy #0 + // main::@8 + __b8: + // for(char i=0;i<40;i++) + // [39] if((byte) main::i#2<(byte) $28) goto main::@9 -- vbuyy_lt_vbuc1_then_la1 + cpy #$28 + bcs !__b9+ + jmp __b9 + !__b9: + // main::@10 + __b10: + // if(x_movement==-1) + // [40] if((signed byte) main::x_movement#0==(signed byte) -1) goto main::@13 -- vbsz1_eq_vbsc1_then_la1 + // Update any new column if needed + lda #-1 + cmp.z x_movement + bne !__b13+ + jmp __b13 + !__b13: + // main::@21 + // if(x_movement==1) + // [41] if((signed byte) main::x_movement#0!=(signed byte) 1) goto main::@16 -- vbsz1_neq_vbsc1_then_la1 + lda #1 + cmp.z x_movement + bne __b16 + // main::@22 + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [42] (word) petscii_ptr::row_x#3 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [43] (word) petscii_ptr::row_y#3 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [44] call petscii_ptr + // [142] phi from main::@22 to petscii_ptr [phi:main::@22->petscii_ptr] + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#3 [phi:main::@22->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#3 [phi:main::@22->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [45] (byte*) petscii_ptr::return#3 ← (byte*) petscii_ptr::return#10 + // main::@39 + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse-12) + // [46] (byte*) main::petscii2#0 ← (byte*) petscii_ptr::return#3 + // [47] phi from main::@39 to main::@14 [phi:main::@39->main::@14] + // [47] phi (byte*) main::scrn2#2 = (byte*) main::screen_hidden#0 [phi:main::@39->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#0 [phi:main::@39->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) 0 [phi:main::@39->main::@14#2] -- vbuxx=vbuc1 + ldx #0 + // main::@14 + __b14: + // for(char i=0;i<25;i++) + // [48] if((byte) main::i2#2<(byte) $19) goto main::@15 -- vbuxx_lt_vbuc1_then_la1 + cpx #$19 + bcc __b15 + // main::@16 + __b16: + // screen ^=1 + // [49] (byte) screen#0 ← (byte) screen#12 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1 + // Change current screen + lda #1 + eor.z screen + sta.z screen + // [50] phi from main::@16 main::@2 main::@23 to main::@23 [phi:main::@16/main::@2/main::@23->main::@23] + __b21: + // [50] phi (byte) screen#28 = (byte) screen#0 [phi:main::@16/main::@2/main::@23->main::@23#0] -- register_copy + // Update the display - wait for the raster + // main::@23 + // while(VICII->RASTER!=0xfe) + // [51] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@23 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fe + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b21 + // main::@24 + __b24: + // while(VICII->RASTER!=0xff) + // [52] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@24 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$ff + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b24 + // main::@25 + // VICII->BORDER_COLOR = WHITE + // [53] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + lda #WHITE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // VICII->CONTROL1 & 0xf0 + // [54] (byte~) main::$45 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta.z __45 + // 7-y_pos_fine + // [55] (byte~) main::$46 ← (byte) 7 - (byte) y_pos_fine#12 -- vbuaa=vbuc1_minus_vbuz1 + lda #7 + sec + sbc.z y_pos_fine + // VICII->CONTROL1 & 0xf0 | (7-y_pos_fine) + // [56] (byte~) main::$47 ← (byte~) main::$45 | (byte~) main::$46 -- vbuaa=vbuz1_bor_vbuaa + ora.z __45 + // VICII->CONTROL1 = VICII->CONTROL1 & 0xf0 | (7-y_pos_fine) + // [57] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← (byte~) main::$47 -- _deref_pbuc1=vbuaa + // Y-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->CONTROL2 & 0xf0 + // [58] (byte~) main::$48 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) & (byte) $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + sta.z __48 + // 7-x_pos_fine + // [59] (byte~) main::$49 ← (byte) 7 - (byte) x_pos_fine#12 -- vbuaa=vbuc1_minus_vbuz1 + lda #7 + sec + sbc.z x_pos_fine + // VICII->CONTROL2 & 0xf0 | (7-x_pos_fine) + // [60] (byte~) main::$50 ← (byte~) main::$48 | (byte~) main::$49 -- vbuaa=vbuz1_bor_vbuaa + ora.z __48 + // VICII->CONTROL2 = VICII->CONTROL2 & 0xf0 | (7-x_pos_fine) + // [61] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte~) main::$50 -- _deref_pbuc1=vbuaa + // X-scroll fine + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // if(screen) + // [62] if((byte) 0!=(byte) screen#28) goto main::toD0182 -- vbuc1_neq_vbuz1_then_la1 + // Display current screen + lda #0 + cmp.z screen + bne __b32 + // [63] phi from main::@25 to main::toD0183 [phi:main::@25->main::toD0183] + // main::toD0183 + // main::@33 + // VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET) + // [64] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0183_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0183_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // main::@26 + __b26: + // VICII->BORDER_COLOR = BLACK + // [65] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [7] phi from main::@26 to main::@1 [phi:main::@26->main::@1] + // [7] phi (byte) screen#12 = (byte) screen#28 [phi:main::@26->main::@1#0] -- register_copy + jmp __b1 + // [66] phi from main::@25 to main::toD0182 [phi:main::@25->main::toD0182] + // main::toD0182 + // main::@32 + __b32: + // VICII->MEMORY = toD018(MAIN_SCREEN1, MAIN_CHARSET) + // [67] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_MEMORY) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0182_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + jmp __b26 + // main::@15 + __b15: + // *scrn = *petscii + // [68] *((byte*) main::scrn2#2) ← *((byte*) main::petscii2#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii2),y + sta (scrn2),y + // scrn += 40 + // [69] (byte*) main::scrn2#1 ← (byte*) main::scrn2#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn2 + sta.z scrn2 + bcc !+ + inc.z scrn2+1 + !: + // petscii += 140 + // [70] (byte*) main::petscii2#1 ← (byte*) main::petscii2#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii2 + sta.z petscii2 + bcc !+ + inc.z petscii2+1 + !: + // for(char i=0;i<25;i++) + // [71] (byte) main::i2#1 ← ++ (byte) main::i2#2 -- vbuxx=_inc_vbuxx + inx + // [47] phi from main::@15 to main::@14 [phi:main::@15->main::@14] + // [47] phi (byte*) main::scrn2#2 = (byte*) main::scrn2#1 [phi:main::@15->main::@14#0] -- register_copy + // [47] phi (byte*) main::petscii2#2 = (byte*) main::petscii2#1 [phi:main::@15->main::@14#1] -- register_copy + // [47] phi (byte) main::i2#2 = (byte) main::i2#1 [phi:main::@15->main::@14#2] -- register_copy + jmp __b14 + // main::@13 + __b13: + // petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + // [72] (word) petscii_ptr::row_x#2 ← (word) x_pos_coarse#17 + (byte) $13 -- vwuz1=vwuz2_plus_vbuc1 + lda #$13 + clc + adc.z x_pos_coarse + sta.z petscii_ptr.row_x + lda #0 + adc.z x_pos_coarse+1 + sta.z petscii_ptr.row_x+1 + // [73] (word) petscii_ptr::row_y#2 ← (word) y_pos_coarse#16 - (byte) $c -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z y_pos_coarse + sbc #$c + sta.z petscii_ptr.row_y + lda.z y_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_y+1 + // [74] call petscii_ptr + // [142] phi from main::@13 to petscii_ptr [phi:main::@13->petscii_ptr] + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#2 [phi:main::@13->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#2 [phi:main::@13->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + // [75] (byte*) petscii_ptr::return#2 ← (byte*) petscii_ptr::return#10 + // main::@38 + // petscii = petscii_ptr(x_pos_coarse+19, y_pos_coarse-12) + // [76] (byte*) main::petscii3#0 ← (byte*) petscii_ptr::return#2 + // scrn = screen_hidden+39 + // [77] (byte*) main::scrn3#0 ← (byte*) main::screen_hidden#0 + (byte) $27 -- pbuz1=pbuz1_plus_vbuc1 + lda #$27 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // [78] phi from main::@38 to main::@17 [phi:main::@38->main::@17] + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#0 [phi:main::@38->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#0 [phi:main::@38->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) 0 [phi:main::@38->main::@17#2] -- vbuxx=vbuc1 + ldx #0 + // main::@17 + __b17: + // for(char i=0;i<25;i++) + // [79] if((byte) main::i3#2<(byte) $19) goto main::@18 -- vbuxx_lt_vbuc1_then_la1 + cpx #$19 + bcc __b18 + jmp __b16 + // main::@18 + __b18: + // *scrn = *petscii + // [80] *((byte*) main::scrn3#2) ← *((byte*) main::petscii3#2) -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (petscii3),y + sta (scrn3),y + // scrn += 40 + // [81] (byte*) main::scrn3#1 ← (byte*) main::scrn3#2 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1 + lda #$28 + clc + adc.z scrn3 + sta.z scrn3 + bcc !+ + inc.z scrn3+1 + !: + // petscii += 140 + // [82] (byte*) main::petscii3#1 ← (byte*) main::petscii3#2 + (byte) $8c -- pbuz1=pbuz1_plus_vbuc1 + lda #$8c + clc + adc.z petscii3 + sta.z petscii3 + bcc !+ + inc.z petscii3+1 + !: + // for(char i=0;i<25;i++) + // [83] (byte) main::i3#1 ← ++ (byte) main::i3#2 -- vbuxx=_inc_vbuxx + inx + // [78] phi from main::@18 to main::@17 [phi:main::@18->main::@17] + // [78] phi (byte*) main::scrn3#2 = (byte*) main::scrn3#1 [phi:main::@18->main::@17#0] -- register_copy + // [78] phi (byte*) main::petscii3#2 = (byte*) main::petscii3#1 [phi:main::@18->main::@17#1] -- register_copy + // [78] phi (byte) main::i3#2 = (byte) main::i3#1 [phi:main::@18->main::@17#2] -- register_copy + jmp __b17 + // main::@9 + __b9: + // scrn[i] = petscii[i] + // [84] *((byte*) main::screen_hidden#0 + (byte) main::i#2) ← *((byte*) main::petscii#0 + (byte) main::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (petscii),y + sta (screen_hidden),y + // for(char i=0;i<40;i++) + // [85] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy + iny + // [38] phi from main::@9 to main::@8 [phi:main::@9->main::@8] + // [38] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@9->main::@8#0] -- register_copy + jmp __b8 + // main::@7 + __b7: + // petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + // [86] (word) petscii_ptr::row_x#0 ← (word) x_pos_coarse#17 - (byte) $14 -- vwuz1=vwuz2_minus_vbuc1 + sec + lda.z x_pos_coarse + sbc #$14 + sta.z petscii_ptr.row_x + lda.z x_pos_coarse+1 + sbc #0 + sta.z petscii_ptr.row_x+1 + // [87] (word) petscii_ptr::row_y#0 ← (word) y_pos_coarse#16 + (byte) $c -- vwuz1=vwuz2_plus_vbuc1 + lda #$c + clc + adc.z y_pos_coarse + sta.z petscii_ptr.row_y + lda #0 + adc.z y_pos_coarse+1 + sta.z petscii_ptr.row_y+1 + // [88] call petscii_ptr + // [142] phi from main::@7 to petscii_ptr [phi:main::@7->petscii_ptr] + // [142] phi (word) petscii_ptr::row_x#4 = (word) petscii_ptr::row_x#0 [phi:main::@7->petscii_ptr#0] -- register_copy + // [142] phi (word) petscii_ptr::row_y#4 = (word) petscii_ptr::row_y#0 [phi:main::@7->petscii_ptr#1] -- register_copy + jsr petscii_ptr + // petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + // [89] (byte*) petscii_ptr::return#0 ← (byte*) petscii_ptr::return#10 + // main::@36 + // petscii = petscii_ptr(x_pos_coarse-20, y_pos_coarse+12) + // [90] (byte*) main::petscii1#0 ← (byte*) petscii_ptr::return#0 + // scrn = screen_hidden+24*40 + // [91] (byte*) main::scrn1#0 ← (byte*) main::screen_hidden#0 + (word)(number) $18*(number) $28 -- pbuz1=pbuz2_plus_vwuc1 + lda.z screen_hidden + clc + adc #<$18*$28 + sta.z scrn1 + lda.z screen_hidden+1 + adc #>$18*$28 + sta.z scrn1+1 + // [92] phi from main::@36 to main::@11 [phi:main::@36->main::@11] + // [92] phi (byte) main::i1#2 = (byte) 0 [phi:main::@36->main::@11#0] -- vbuyy=vbuc1 + ldy #0 + // main::@11 + __b11: + // for(char i=0;i<40;i++) + // [93] if((byte) main::i1#2<(byte) $28) goto main::@12 -- vbuyy_lt_vbuc1_then_la1 + cpy #$28 + bcc __b12 + jmp __b10 + // main::@12 + __b12: + // scrn[i] = petscii[i] + // [94] *((byte*) main::scrn1#0 + (byte) main::i1#2) ← *((byte*) main::petscii1#0 + (byte) main::i1#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (petscii1),y + sta (scrn1),y + // for(char i=0;i<40;i++) + // [95] (byte) main::i1#1 ← ++ (byte) main::i1#2 -- vbuyy=_inc_vbuyy + iny + // [92] phi from main::@12 to main::@11 [phi:main::@12->main::@11] + // [92] phi (byte) main::i1#2 = (byte) main::i1#1 [phi:main::@12->main::@11#0] -- register_copy + jmp __b11 +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +memset: { + .const c = ' ' + .const num = $3e8 + .label str = MAIN_SCREEN0 + .label end = str+num + .label dst = 9 + // [97] phi from memset to memset::@1 [phi:memset->memset::@1] + // [97] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 + lda #str + sta.z dst+1 + // memset::@1 + __b1: + // for(char* dst = str; dst!=end; dst++) + // [98] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z dst+1 + cmp #>end + bne __b2 + lda.z dst + cmp #memset::@1] + // [97] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy + jmp __b1 +} + // next_position +// Update the x_pos, y_pos variables to reflect the next position on the curve +// The position represents the center of the screen +next_position: { + .label __4 = $16 + .label __8 = $18 + .label __12 = $16 + .label __13 = $18 + .label x_pos_u = $16 + .label y_pos_u = $18 + .label __18 = $16 + .label __19 = $18 + // x_sin_idx++; + // [103] (word) x_sin_idx#13 ← ++ (word) x_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z x_sin_idx + bne !+ + inc.z x_sin_idx+1 + !: + // if(x_sin_idx>=SINSIZE) + // [104] if((word) x_sin_idx#13<(const nomodify word) SINSIZE) goto next_position::@1 -- vwuz1_lt_vwuc1_then_la1 + lda.z x_sin_idx+1 + cmp #>SINSIZE + bcc __b1 + bne !+ + lda.z x_sin_idx + cmp #SINSIZE + sta.z x_sin_idx+1 + // [106] phi from next_position next_position::@3 to next_position::@1 [phi:next_position/next_position::@3->next_position::@1] + // [106] phi (word) x_sin_idx#14 = (word) x_sin_idx#13 [phi:next_position/next_position::@3->next_position::@1#0] -- register_copy + // next_position::@1 + __b1: + // y_sin_idx++; + // [107] (word) y_sin_idx#14 ← ++ (word) y_sin_idx#12 -- vwuz1=_inc_vwuz1 + inc.z y_sin_idx + bne !+ + inc.z y_sin_idx+1 + !: + // if(y_sin_idx>=SINSIZE) + // [108] if((word) y_sin_idx#14<(const nomodify word) SINSIZE) goto next_position::@2 -- vwuz1_lt_vwuc1_then_la1 + lda.z y_sin_idx+1 + cmp #>SINSIZE + bcc __b2 + bne !+ + lda.z y_sin_idx + cmp #SINSIZE + sta.z y_sin_idx+1 + // [110] phi from next_position::@1 next_position::@4 to next_position::@2 [phi:next_position::@1/next_position::@4->next_position::@2] + // [110] phi (word) y_sin_idx#13 = (word) y_sin_idx#14 [phi:next_position::@1/next_position::@4->next_position::@2#0] -- register_copy + // next_position::@2 + __b2: + // x_pos = SINTAB[x_sin_idx] + // [111] (word~) next_position::$12 ← (word) x_sin_idx#14 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z x_sin_idx + asl + sta.z __12 + lda.z x_sin_idx+1 + rol + sta.z __12+1 + // [112] (signed word*~) next_position::$18 ← (const signed word*) SINTAB + (word~) next_position::$12 -- pwsz1=pwsc1_plus_vwuz1 + clc + lda.z __18 + adc #SINTAB + sta.z __18+1 + // [113] (signed word) x_pos#11 ← *((signed word*~) next_position::$18) -- vwsz1=_deref_pwsz1 + // Find the next point + ldy #0 + lda (x_pos),y + pha + iny + lda (x_pos),y + sta.z x_pos+1 + pla + sta.z x_pos + // y_pos = SINTAB[y_sin_idx] + // [114] (word~) next_position::$13 ← (word) y_sin_idx#13 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z y_sin_idx + asl + sta.z __13 + lda.z y_sin_idx+1 + rol + sta.z __13+1 + // [115] (signed word*~) next_position::$19 ← (const signed word*) SINTAB + (word~) next_position::$13 -- pwsz1=pwsc1_plus_vwuz1 + clc + lda.z __19 + adc #SINTAB + sta.z __19+1 + // [116] (signed word) y_pos#11 ← *((signed word*~) next_position::$19) -- vwsz1=_deref_pwsz1 + ldy #0 + lda (y_pos),y + pha + iny + lda (y_pos),y + sta.z y_pos+1 + pla + sta.z y_pos + // (unsigned int)x_pos + 400 + // [117] (word~) next_position::$4 ← (word)(signed word) x_pos#11 + // x_pos_u = (unsigned int)x_pos + 400 + 20*8 + // [118] (word) next_position::x_pos_u#0 ← (word~) next_position::$4 + (word) $190+(byte)(number) $14*(number) 8 -- vwuz1=vwuz1_plus_vwuc1 + clc + lda.z x_pos_u + adc #<$190+$14*8 + sta.z x_pos_u + lda.z x_pos_u+1 + adc #>$190+$14*8 + sta.z x_pos_u+1 + // (unsigned char)x_pos_u & 7 + // [119] (byte~) next_position::$15 ← (byte)(word) next_position::x_pos_u#0 -- vbuaa=_byte_vwuz1 + lda.z x_pos_u + // [120] (byte) x_pos_fine#12 ← (byte~) next_position::$15 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 + and #7 + sta.z x_pos_fine + // x_pos_u/8 + // [121] (word) x_pos_coarse#17 ← (word) next_position::x_pos_u#0 >> (byte) 3 -- vwuz1=vwuz1_ror_3 + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + lsr.z x_pos_coarse+1 + ror.z x_pos_coarse + // (unsigned int)y_pos + 400 + // [122] (word~) next_position::$8 ← (word)(signed word) y_pos#11 + // y_pos_u = (unsigned int)y_pos + 400 + 12*8 + // [123] (word) next_position::y_pos_u#0 ← (word~) next_position::$8 + (word) $190+(byte)(number) $c*(number) 8 -- vwuz1=vwuz1_plus_vwuc1 + clc + lda.z y_pos_u + adc #<$190+$c*8 + sta.z y_pos_u + lda.z y_pos_u+1 + adc #>$190+$c*8 + sta.z y_pos_u+1 + // (unsigned char)y_pos_u & 7 + // [124] (byte~) next_position::$17 ← (byte)(word) next_position::y_pos_u#0 -- vbuaa=_byte_vwuz1 + lda.z y_pos_u + // [125] (byte) y_pos_fine#12 ← (byte~) next_position::$17 & (byte) 7 -- vbuz1=vbuaa_band_vbuc1 + and #7 + sta.z y_pos_fine + // y_pos_u/8 + // [126] (word) y_pos_coarse#16 ← (word) next_position::y_pos_u#0 >> (byte) 3 -- vwuz1=vwuz1_ror_3 + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + lsr.z y_pos_coarse+1 + ror.z y_pos_coarse + // next_position::@return + // } + // [127] return + rts +} + // screencpy +// Copy an entire screen (40x25 = 1000 chars) +// - dst - destination +// - src - source +// screencpy(byte* zp(7) dst, byte* zp(3) src) +screencpy: { + .label dst = 7 + .label src = 3 + .label src_250 = $26 + .label dst_250 = $1c + .label src_500 = $1e + .label dst_500 = $20 + .label src_750 = $22 + .label dst_750 = $24 + // src_250 = src+250 + // [128] (byte*) screencpy::src_250#0 ← (byte*) screencpy::src#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z src + sta.z src_250 + lda #0 + adc.z src+1 + sta.z src_250+1 + // dst_250 = dst+250 + // [129] (byte*) screencpy::dst_250#0 ← (byte*) screencpy::dst#0 + (byte) $fa -- pbuz1=pbuz2_plus_vbuc1 + lda #$fa + clc + adc.z dst + sta.z dst_250 + lda #0 + adc.z dst+1 + sta.z dst_250+1 + // src_500 = src+500 + // [130] (byte*) screencpy::src_500#0 ← (byte*) screencpy::src#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$1f4 + sta.z src_500 + lda.z src+1 + adc #>$1f4 + sta.z src_500+1 + // dst_500 = dst+500 + // [131] (byte*) screencpy::dst_500#0 ← (byte*) screencpy::dst#0 + (word) $1f4 -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$1f4 + sta.z dst_500 + lda.z dst+1 + adc #>$1f4 + sta.z dst_500+1 + // src_750 = src+750 + // [132] (byte*) screencpy::src_750#0 ← (byte*) screencpy::src#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z src + clc + adc #<$2ee + sta.z src_750 + lda.z src+1 + adc #>$2ee + sta.z src_750+1 + // dst_750 = dst+750 + // [133] (byte*) screencpy::dst_750#0 ← (byte*) screencpy::dst#0 + (word) $2ee -- pbuz1=pbuz2_plus_vwuc1 + lda.z dst + clc + adc #<$2ee + sta.z dst_750 + lda.z dst+1 + adc #>$2ee + sta.z dst_750+1 + // [134] phi from screencpy to screencpy::@1 [phi:screencpy->screencpy::@1] + // [134] phi (byte) screencpy::i#2 = (byte) 0 [phi:screencpy->screencpy::@1#0] -- vbuyy=vbuc1 + ldy #0 + // screencpy::@1 + __b1: + // for( char i=0;i<250;i++) + // [135] if((byte) screencpy::i#2<(byte) $fa) goto screencpy::@2 -- vbuyy_lt_vbuc1_then_la1 + cpy #$fa + bcc __b2 + // screencpy::@return + // } + // [136] return + rts + // screencpy::@2 + __b2: + // dst[i] = src[i] + // [137] *((byte*) screencpy::dst#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src),y + sta (dst),y + // dst_250[i] = src_250[i] + // [138] *((byte*) screencpy::dst_250#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_250#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_250),y + sta (dst_250),y + // dst_500[i] = src_500[i] + // [139] *((byte*) screencpy::dst_500#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_500#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_500),y + sta (dst_500),y + // dst_750[i] = src_750[i] + // [140] *((byte*) screencpy::dst_750#0 + (byte) screencpy::i#2) ← *((byte*) screencpy::src_750#0 + (byte) screencpy::i#2) -- pbuz1_derefidx_vbuyy=pbuz2_derefidx_vbuyy + lda (src_750),y + sta (dst_750),y + // for( char i=0;i<250;i++) + // [141] (byte) screencpy::i#1 ← ++ (byte) screencpy::i#2 -- vbuyy=_inc_vbuyy + iny + // [134] phi from screencpy::@2 to screencpy::@1 [phi:screencpy::@2->screencpy::@1] + // [134] phi (byte) screencpy::i#2 = (byte) screencpy::i#1 [phi:screencpy::@2->screencpy::@1#0] -- register_copy + jmp __b1 +} + // petscii_ptr +// Get a pointer to a specific x,y-position in the PETSCII art +// petscii_ptr(word zp(5) row_x, word zp($d) row_y) +petscii_ptr: { + .label __0 = $d + .label __1 = $d + .label row_x = 5 + .label row_y = $d + .label return = 5 + .label __3 = $26 + .label __4 = $26 + .label __5 = $26 + .label __6 = $d + // row_y * 140 + // [143] (word~) petscii_ptr::$3 ← (word) petscii_ptr::row_y#4 << (byte) 4 -- vwuz1=vwuz2_rol_4 + lda.z row_y + asl + sta.z __3 + lda.z row_y+1 + rol + sta.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + asl.z __3 + rol.z __3+1 + // [144] (word~) petscii_ptr::$4 ← (word~) petscii_ptr::$3 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz1_plus_vwuz2 + lda.z __4 + clc + adc.z row_y + sta.z __4 + lda.z __4+1 + adc.z row_y+1 + sta.z __4+1 + // [145] (word~) petscii_ptr::$5 ← (word~) petscii_ptr::$4 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __5 + rol.z __5+1 + // [146] (word~) petscii_ptr::$6 ← (word~) petscii_ptr::$5 + (word) petscii_ptr::row_y#4 -- vwuz1=vwuz2_plus_vwuz1 + lda.z __6 + clc + adc.z __5 + sta.z __6 + lda.z __6+1 + adc.z __5+1 + sta.z __6+1 + // [147] (word~) petscii_ptr::$0 ← (word~) petscii_ptr::$6 << (byte) 2 -- vwuz1=vwuz1_rol_2 + asl.z __0 + rol.z __0+1 + asl.z __0 + rol.z __0+1 + // PETSCII_ART + row_y * 140 + // [148] (byte*~) petscii_ptr::$1 ← (const byte*) PETSCII_ART + (word~) petscii_ptr::$0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z __1 + adc #PETSCII_ART + sta.z __1+1 + // PETSCII_ART + row_y * 140 + row_x + // [149] (byte*) petscii_ptr::return#10 ← (byte*~) petscii_ptr::$1 + (word) petscii_ptr::row_x#4 -- pbuz1=pbuz2_plus_vwuz1 + lda.z return + clc + adc.z __1 + sta.z return + lda.z return+1 + adc.z __1+1 + sta.z return+1 + // petscii_ptr::@return + // } + // [150] return + rts +} + // File Data +// Sinus table [-399,399] +SINTAB: +.fillword SINSIZE, 399*sin(i*2*PI/SINSIZE) + +.pc = $4000 "PETSCII_ART" +// 140x125 PETSCII art +PETSCII_ART: +.var petsciiPic = LoadPicture("cml.png") + .print "width: "+petsciiPic.width + " height: "+petsciiPic.height + .for (var y=0; y(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(label) main::toD0182 +(byte*) main::toD0182_gfx +(byte) main::toD0182_return +(const byte) main::toD0182_return#0 toD0182_return = >(word)(const nomodify byte*) MAIN_SCREEN1&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0182_screen +(label) main::toD0183 +(byte*) main::toD0183_gfx +(byte) main::toD0183_return +(const byte) main::toD0183_return#0 toD0183_return = >(word)(const nomodify byte*) MAIN_SCREEN0&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) MAIN_CHARSET/(byte) 4&(byte) $f +(byte*) main::toD0183_screen +(signed byte) main::x_movement +(signed byte) main::x_movement#0 x_movement zp[1]:18 1.2571428571428571 +(word) main::x_pos_coarse_old +(word) main::x_pos_coarse_old#0 x_pos_coarse_old zp[2]:13 2.4444444444444446 +(signed byte) main::y_movement +(signed byte) main::y_movement#0 y_movement zp[1]:17 2.75 +(word) main::y_pos_coarse_old +(word) main::y_pos_coarse_old#0 y_pos_coarse_old zp[2]:15 11.0 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@2 +(label) memset::@return +(byte) memset::c +(const byte) memset::c#0 c = (byte) ' ' +(byte*) memset::dst +(byte*) memset::dst#1 dst zp[2]:9 202.0 +(byte*) memset::dst#2 dst zp[2]:9 134.66666666666666 +(byte*) memset::end +(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 +(word) memset::num +(const word) memset::num#0 num = (word) $3e8 +(void*) memset::return +(void*) memset::str +(const void*) memset::str#0 str = (void*)(const nomodify byte*) MAIN_SCREEN0 +(void()) next_position() +(word~) next_position::$12 zp[2]:22 202.0 +(word~) next_position::$13 zp[2]:24 202.0 +(byte~) next_position::$15 reg byte a 202.0 +(byte~) next_position::$17 reg byte a 202.0 +(signed word*~) next_position::$18 zp[2]:22 202.0 +(signed word*~) next_position::$19 zp[2]:24 202.0 +(word~) next_position::$4 zp[2]:22 202.0 +(word~) next_position::$8 zp[2]:24 202.0 +(label) next_position::@1 +(label) next_position::@2 +(label) next_position::@3 +(label) next_position::@4 +(label) next_position::@return +(word) next_position::x_pos_u +(word) next_position::x_pos_u#0 x_pos_u zp[2]:22 67.33333333333333 +(word) next_position::y_pos_u +(word) next_position::y_pos_u#0 y_pos_u zp[2]:24 67.33333333333333 +(byte*()) petscii_ptr((word) petscii_ptr::row_x , (word) petscii_ptr::row_y) +(word~) petscii_ptr::$0 zp[2]:13 202.0 +(byte*~) petscii_ptr::$1 zp[2]:13 202.0 +(word~) petscii_ptr::$3 zp[2]:38 202.0 +(word~) petscii_ptr::$4 zp[2]:38 202.0 +(word~) petscii_ptr::$5 zp[2]:38 202.0 +(word~) petscii_ptr::$6 zp[2]:13 202.0 +(label) petscii_ptr::@return +(byte*) petscii_ptr::return +(byte*) petscii_ptr::return#0 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#1 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#10 return zp[2]:5 24.166666666666664 +(byte*) petscii_ptr::return#2 return zp[2]:5 22.0 +(byte*) petscii_ptr::return#3 return zp[2]:5 22.0 +(word) petscii_ptr::row_x +(word) petscii_ptr::row_x#0 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#1 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#2 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#3 row_x zp[2]:5 11.0 +(word) petscii_ptr::row_x#4 row_x zp[2]:5 20.714285714285715 +(word) petscii_ptr::row_y +(word) petscii_ptr::row_y#0 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#1 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#2 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#3 row_y zp[2]:13 22.0 +(word) petscii_ptr::row_y#4 row_y zp[2]:13 86.75 +(byte) screen +(byte) screen#0 screen zp[1]:2 22.0 +(byte) screen#12 screen zp[1]:2 0.7857142857142857 +(byte) screen#28 screen zp[1]:2 13.666666666666666 +(void()) screencpy((byte*) screencpy::dst , (byte*) screencpy::src) +(label) screencpy::@1 +(label) screencpy::@2 +(label) screencpy::@return +(byte*) screencpy::dst +(byte*) screencpy::dst#0 dst zp[2]:7 687.6666666666666 +(byte*) screencpy::dst_250 +(byte*) screencpy::dst_250#0 dst_250 zp[2]:28 841.8333333333333 +(byte*) screencpy::dst_500 +(byte*) screencpy::dst_500#0 dst_500 zp[2]:32 1010.2 +(byte*) screencpy::dst_750 +(byte*) screencpy::dst_750#0 dst_750 zp[2]:36 1262.75 +(byte) screencpy::i +(byte) screencpy::i#1 reg byte y 20002.0 +(byte) screencpy::i#2 reg byte y 18335.166666666668 +(byte*) screencpy::src +(byte*) screencpy::src#0 src zp[2]:3 736.7857142857143 +(byte*) screencpy::src_250 +(byte*) screencpy::src_250#0 src_250 zp[2]:38 777.076923076923 +(byte*) screencpy::src_500 +(byte*) screencpy::src_500#0 src_500 zp[2]:30 918.3636363636363 +(byte*) screencpy::src_750 +(byte*) screencpy::src_750#0 src_750 zp[2]:34 1122.4444444444443 +(signed word) x_pos +(signed word) x_pos#11 x_pos zp[2]:22 25.25 +(word) x_pos_coarse +(word) x_pos_coarse#17 x_pos_coarse zp[2]:22 1.7578947368421054 +(byte) x_pos_fine +(byte) x_pos_fine#12 x_pos_fine zp[1]:26 1.3176470588235294 +(word) x_sin_idx +(word) x_sin_idx#12 x_sin_idx zp[2]:9 112.0 +(word) x_sin_idx#13 x_sin_idx zp[2]:9 202.0 +(word) x_sin_idx#14 x_sin_idx zp[2]:9 2.803571428571429 +(word) x_sin_idx#4 x_sin_idx zp[2]:9 202.0 +(signed word) y_pos +(signed word) y_pos#11 y_pos zp[2]:24 16.833333333333332 +(word) y_pos_coarse +(word) y_pos_coarse#16 y_pos_coarse zp[2]:24 1.8351648351648353 +(byte) y_pos_fine +(byte) y_pos_fine#12 y_pos_fine zp[1]:27 1.473684210526316 +(word) y_sin_idx +(word) y_sin_idx#12 y_sin_idx zp[2]:11 22.4 +(word) y_sin_idx#13 y_sin_idx zp[2]:11 2.9074074074074074 +(word) y_sin_idx#14 y_sin_idx zp[2]:11 202.0 +(word) y_sin_idx#4 y_sin_idx zp[2]:11 202.0 + +zp[1]:2 [ screen#12 screen#28 screen#0 ] +reg byte x [ main::movement#4 ] +zp[2]:3 [ main::$13 main::screen_active#0 screencpy::src#0 ] +reg byte y [ main::i#2 main::i#1 ] +reg byte x [ main::i2#2 main::i2#1 ] +zp[2]:5 [ main::petscii2#2 main::petscii2#1 main::petscii2#0 petscii_ptr::return#3 petscii_ptr::row_x#4 petscii_ptr::row_x#0 petscii_ptr::row_x#2 petscii_ptr::row_x#1 petscii_ptr::row_x#3 petscii_ptr::return#10 main::petscii3#2 main::petscii3#1 main::petscii3#0 petscii_ptr::return#2 petscii_ptr::return#1 main::petscii#0 petscii_ptr::return#0 main::petscii1#0 ] +zp[2]:7 [ main::scrn2#2 main::scrn2#1 main::screen_hidden#0 main::scrn3#2 main::scrn3#1 main::scrn3#0 screencpy::dst#0 ] +reg byte x [ main::i3#2 main::i3#1 ] +reg byte y [ main::i1#2 main::i1#1 ] +zp[2]:9 [ x_sin_idx#12 x_sin_idx#14 x_sin_idx#13 x_sin_idx#4 memset::dst#2 memset::dst#1 ] +zp[2]:11 [ y_sin_idx#12 y_sin_idx#13 y_sin_idx#14 y_sin_idx#4 ] +reg byte y [ screencpy::i#2 screencpy::i#1 ] +zp[2]:13 [ main::x_pos_coarse_old#0 main::$9 petscii_ptr::row_y#4 petscii_ptr::row_y#0 petscii_ptr::row_y#2 petscii_ptr::row_y#1 petscii_ptr::row_y#3 petscii_ptr::$6 petscii_ptr::$0 petscii_ptr::$1 ] +zp[2]:15 [ main::y_pos_coarse_old#0 main::$5 ] +zp[1]:17 [ main::y_movement#0 ] +zp[1]:18 [ main::x_movement#0 ] +reg byte x [ main::movement#3 ] +zp[1]:19 [ main::$45 ] +reg byte a [ main::$46 ] +reg byte a [ main::$47 ] +reg byte a [ main::$49 ] +reg byte a [ main::$50 ] +zp[2]:20 [ main::scrn1#0 ] +zp[2]:22 [ next_position::$12 next_position::$18 x_pos#11 next_position::$4 next_position::x_pos_u#0 x_pos_coarse#17 ] +zp[2]:24 [ next_position::$13 next_position::$19 y_pos#11 next_position::$8 next_position::y_pos_u#0 y_pos_coarse#16 ] +reg byte a [ next_position::$15 ] +zp[1]:26 [ x_pos_fine#12 ] +reg byte a [ next_position::$17 ] +zp[1]:27 [ y_pos_fine#12 main::$48 ] +zp[2]:28 [ screencpy::dst_250#0 ] +zp[2]:30 [ screencpy::src_500#0 ] +zp[2]:32 [ screencpy::dst_500#0 ] +zp[2]:34 [ screencpy::src_750#0 ] +zp[2]:36 [ screencpy::dst_750#0 ] +zp[2]:38 [ petscii_ptr::$3 petscii_ptr::$4 petscii_ptr::$5 screencpy::src_250#0 ]