From 03a25b8915a0496157640f2eb6eba9df37bc59be Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sun, 28 Mar 2021 08:58:48 +0200 Subject: [PATCH] Updated test data. Added borderline pacman example. --- .../cache/fragment-cache-csg65ce02.asm | 2 +- .../cache/fragment-cache-mega45gs02.asm | 235 +- .../fragment/cache/fragment-cache-mos6502.asm | 2 +- .../cache/fragment-cache-mos6502x.asm | 2764 +- .../cache/fragment-cache-rom6502x.asm | 2 +- .../cache/fragment-cache-wdc65c02.asm | 363 +- .../vwum1=vwuc1_minus__deref_pwuc2.asm | 7 + .../dk/camelot64/kickc/test/TestPrograms.java | 5 + .../kc/complex/borderline_pacman/byteboozer.c | 18 + .../kc/complex/borderline_pacman/byteboozer.h | 6 + .../borderline_pacman/byteboozer_decrunch.asm | 182 + .../complex/borderline_pacman/code-merger.c | 95 + .../borderline_pacman/pacman-2chn-simpler.prg | Bin 0 -> 1799 bytes .../complex/borderline_pacman/pacman-bobs.ase | Bin 0 -> 1701 bytes .../complex/borderline_pacman/pacman-bobs.c | 63 + .../complex/borderline_pacman/pacman-bobs.png | Bin 0 -> 1080 bytes .../pacman-gameover.aseprite | Bin 0 -> 914 bytes .../borderline_pacman/pacman-gameover.c | 12 + .../borderline_pacman/pacman-gameover.png | Bin 0 -> 978 bytes .../borderline_pacman/pacman-logic-code.c | 367 + .../borderline_pacman/pacman-logic-data.c | 66 + .../borderline_pacman/pacman-raster-code.c | 121 + .../complex/borderline_pacman/pacman-render.c | 150 + .../borderline_pacman/pacman-sounds-test.c | 30 + .../complex/borderline_pacman/pacman-sounds.c | 37 + .../borderline_pacman/pacman-splash.ase | Bin 0 -> 8425 bytes .../complex/borderline_pacman/pacman-splash.c | 25 + .../borderline_pacman/pacman-splash.png | Bin 0 -> 2687 bytes .../borderline_pacman/pacman-tiled.ase | Bin 0 -> 1671 bytes .../borderline_pacman/pacman-tiled.png | Bin 0 -> 1162 bytes .../complex/borderline_pacman/pacman-tiles.c | 94 + .../borderline_pacman/pacman-win.aseprite | Bin 0 -> 994 bytes .../kc/complex/borderline_pacman/pacman-win.c | 12 + .../complex/borderline_pacman/pacman-win.png | Bin 0 -> 1059 bytes .../kc/complex/borderline_pacman/pacman.c | 1361 + .../kc/complex/borderline_pacman/pacman.ld | 7 + .../borderline_pacman/test-code-merger.c | 96 + .../kc/complex/borderline_pacman/test-music.c | 41 + .../ref/complex/borderline_pacman/pacman.asm | 4848 +++ .../ref/complex/borderline_pacman/pacman.cfg | 2012 + .../ref/complex/borderline_pacman/pacman.log | 31554 ++++++++++++++++ .../ref/complex/borderline_pacman/pacman.sym | 1741 + src/test/ref/cordic-atan2-16-ref.asm | 14 +- src/test/ref/cordic-atan2-16-ref.log | 42 +- src/test/ref/cordic-atan2-16.asm | 14 +- src/test/ref/cordic-atan2-16.log | 42 +- src/test/ref/cordic-atan2-clear.log | 28 +- src/test/ref/examples/mega65/dypp65.asm | 38 +- src/test/ref/examples/mega65/dypp65.cfg | 20 +- src/test/ref/examples/mega65/dypp65.log | 208 +- src/test/ref/inline-pointer-1.asm | 14 +- src/test/ref/inline-pointer-1.log | 58 +- src/test/ref/inline-pointer-1.sym | 8 +- src/test/ref/inline-word.log | 5 +- src/test/ref/plasma-center.log | 34 +- src/test/ref/screen-center-angle.log | 27 +- src/test/ref/screen-show-spiral-buckets.log | 34 +- src/test/ref/screen-show-spiral.log | 34 +- 58 files changed, 44962 insertions(+), 1976 deletions(-) create mode 100644 src/main/fragment/mos6502-common/vwum1=vwuc1_minus__deref_pwuc2.asm create mode 100644 src/test/kc/complex/borderline_pacman/byteboozer.c create mode 100644 src/test/kc/complex/borderline_pacman/byteboozer.h create mode 100644 src/test/kc/complex/borderline_pacman/byteboozer_decrunch.asm create mode 100644 src/test/kc/complex/borderline_pacman/code-merger.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-2chn-simpler.prg create mode 100644 src/test/kc/complex/borderline_pacman/pacman-bobs.ase create mode 100644 src/test/kc/complex/borderline_pacman/pacman-bobs.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-bobs.png create mode 100644 src/test/kc/complex/borderline_pacman/pacman-gameover.aseprite create mode 100644 src/test/kc/complex/borderline_pacman/pacman-gameover.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-gameover.png create mode 100644 src/test/kc/complex/borderline_pacman/pacman-logic-code.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-logic-data.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-raster-code.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-render.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-sounds-test.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-sounds.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-splash.ase create mode 100644 src/test/kc/complex/borderline_pacman/pacman-splash.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-splash.png create mode 100644 src/test/kc/complex/borderline_pacman/pacman-tiled.ase create mode 100644 src/test/kc/complex/borderline_pacman/pacman-tiled.png create mode 100644 src/test/kc/complex/borderline_pacman/pacman-tiles.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-win.aseprite create mode 100644 src/test/kc/complex/borderline_pacman/pacman-win.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman-win.png create mode 100644 src/test/kc/complex/borderline_pacman/pacman.c create mode 100644 src/test/kc/complex/borderline_pacman/pacman.ld create mode 100644 src/test/kc/complex/borderline_pacman/test-code-merger.c create mode 100644 src/test/kc/complex/borderline_pacman/test-music.c create mode 100644 src/test/ref/complex/borderline_pacman/pacman.asm create mode 100644 src/test/ref/complex/borderline_pacman/pacman.cfg create mode 100644 src/test/ref/complex/borderline_pacman/pacman.log create mode 100644 src/test/ref/complex/borderline_pacman/pacman.sym diff --git a/src/main/fragment/cache/fragment-cache-csg65ce02.asm b/src/main/fragment/cache/fragment-cache-csg65ce02.asm index bbca180d4..68b30666c 100644 --- a/src/main/fragment/cache/fragment-cache-csg65ce02.asm +++ b/src/main/fragment/cache/fragment-cache-csg65ce02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} diff --git a/src/main/fragment/cache/fragment-cache-mega45gs02.asm b/src/main/fragment/cache/fragment-cache-mega45gs02.asm index d916d6ebf..15c27df3e 100644 --- a/src/main/fragment/cache/fragment-cache-mega45gs02.asm +++ b/src/main/fragment/cache/fragment-cache-mega45gs02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //FRAGMENT _deref_pbuc1=vbuc2 lda #{c2} sta {c1} @@ -1398,11 +1398,153 @@ asw {z1} asw {z1} asw {z1} asw {z1} +//FRAGMENT _deref_pbuc1=_inc__deref_pbuc1 +inc {c1} //FRAGMENT vwuz1=vbuc1 lda #<{c1} sta {z1} lda #>{c1} sta {z1}+1 +//FRAGMENT _deref_pbuc1_eq_vbuz1_then_la1 +lda {c1} +cmp {z1} +beq {la1} +//FRAGMENT _deref_pbuc1=_dec__deref_pbuc1 +dec {c1} +//FRAGMENT pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 +ldx {z1} +inc {c1},x +//FRAGMENT vwuz1=vwuc1 +lda #<{c1} +sta {z1} +lda #>{c1} +sta {z1}+1 +//FRAGMENT vbuz1=_lo_vwuz2 +lda {z2} +sta {z1} +//FRAGMENT vbuz1=_hi_vwuz2 +lda {z2}+1 +sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuz3 +lda {z2} +ora {z3} +sta {z1} +//FRAGMENT _deref_pwuc1=vwuc2 +lda #<{c2} +sta {c1} +lda #>{c2} +sta {c1}+1 +//FRAGMENT _deref_qbuc1=pbuc2 +lda #<{c2} +sta {c1} +lda #>{c2} +sta {c1}+1 +//FRAGMENT _deref_pbuc1_eq_vbuaa_then_la1 +cmp {c1} +beq {la1} +//FRAGMENT pbuc1_derefidx_vbuaa=_inc_pbuc1_derefidx_vbuaa +tax +inc {c1},x +//FRAGMENT pbuc1_derefidx_vbuxx=_inc_pbuc1_derefidx_vbuxx +inc {c1},x +//FRAGMENT vbuaa=_lo_vwuz1 +lda {z1} +//FRAGMENT vbuxx=_lo_vwuz1 +ldx {z1} +//FRAGMENT vbuaa=_hi_vwuz1 +lda {z1}+1 +//FRAGMENT vbuxx=_hi_vwuz1 +ldx {z1}+1 +//FRAGMENT vbuz1=vbuxx_bor_vbuz2 +txa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuyy_bor_vbuz2 +tya +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuzz_bor_vbuz2 +tza +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuaa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_bor_vbuaa +stx $ff +ora $ff +sta {z1} +//FRAGMENT vbuz1=vbuyy_bor_vbuaa +sty $ff +ora $ff +sta {z1} +//FRAGMENT vbuz1=vbuzz_bor_vbuaa +tay +tza +sty $ff +ora $ff +sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuxx +txa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_bor_vbuxx +stx {z1} +//FRAGMENT vbuyy=_lo_vwuz1 +ldy {z1} +//FRAGMENT vbuzz=_lo_vwuz1 +ldz {z1} +//FRAGMENT vbuyy=_hi_vwuz1 +ldy {z1}+1 +//FRAGMENT vbuzz=_hi_vwuz1 +ldz {z1}+1 +//FRAGMENT vbuz1=vbuz2_bor_vbuyy +tya +ora {z2} +sta {z1} +//FRAGMENT pbuc1_derefidx_vbuyy=_inc_pbuc1_derefidx_vbuyy +lda {c1},y +inc +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuzz=_inc_pbuc1_derefidx_vbuzz +tza +tax +inc {c1},x +//FRAGMENT _deref_pbuc1_eq_vbuxx_then_la1 +cpx {c1} +beq {la1} +//FRAGMENT _deref_pbuc1_eq_vbuyy_then_la1 +cpy {c1} +beq {la1} +//FRAGMENT _deref_pbuc1_eq_vbuzz_then_la1 +cpz {c1} +beq {la1} +//FRAGMENT vbuaa=vbuz1_bor_vbuaa +ora {z1} +//FRAGMENT vbuxx=vbuz1_bor_vbuaa +ora {z1} +tax +//FRAGMENT vbuyy=vbuz1_bor_vbuaa +ora {z1} +tay +//FRAGMENT vbuzz=vbuz1_bor_vbuaa +ora {z1} +taz +//FRAGMENT vbuz1=vbuz2_bor_vbuzz +tza +ora {z2} +sta {z1} +//FRAGMENT vbuaa=vbuxx_bor_vbuaa +stx $ff +ora $ff +//FRAGMENT vbuaa=vbuyy_bor_vbuaa +sty $ff +ora $ff +//FRAGMENT vbuaa=vbuzz_bor_vbuaa +tay +tza +sty $ff +ora $ff //FRAGMENT vduz1=vduc1 lda #<{c1} sta {z1} @@ -1456,16 +1598,6 @@ lda {z2} sta {z1} lda {z2}+1 sta {z1}+1 -//FRAGMENT vbuz1=_lo_vwuz2 -lda {z2} -sta {z1} -//FRAGMENT vbuz1=_hi_vwuz2 -lda {z2}+1 -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuz3 -lda {z2} -ora {z3} -sta {z1} //FRAGMENT vduz1=vduz2_ror_4 lda {z2}+3 lsr @@ -2052,49 +2184,6 @@ dey bne !- !e: taz -//FRAGMENT vbuaa=_lo_vwuz1 -lda {z1} -//FRAGMENT vbuxx=_lo_vwuz1 -ldx {z1} -//FRAGMENT vbuaa=_hi_vwuz1 -lda {z1}+1 -//FRAGMENT vbuxx=_hi_vwuz1 -ldx {z1}+1 -//FRAGMENT vbuz1=vbuxx_bor_vbuz2 -txa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuz2 -tya -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuzz_bor_vbuz2 -tza -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuaa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_bor_vbuaa -stx $ff -ora $ff -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuaa -sty $ff -ora $ff -sta {z1} -//FRAGMENT vbuz1=vbuzz_bor_vbuaa -tay -tza -sty $ff -ora $ff -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuxx -txa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_bor_vbuxx -stx {z1} //FRAGMENT vbuaa=_hi__word_vduz1 lda {z1}+1 //FRAGMENT vbuxx=_hi__word_vduz1 @@ -2159,20 +2248,6 @@ tay tza ora {z1} taz -//FRAGMENT vbuaa=vbuz1_bor_vbuaa -ora {z1} -//FRAGMENT vbuxx=vbuz1_bor_vbuaa -ora {z1} -tax -//FRAGMENT vbuyy=vbuz1_bor_vbuaa -ora {z1} -tay -//FRAGMENT vbuzz=vbuz1_bor_vbuaa -ora {z1} -taz -//FRAGMENT vbuaa=vbuxx_bor_vbuaa -stx $ff -ora $ff //FRAGMENT vbuxx=vbuxx_bor_vbuaa stx $ff ora $ff @@ -2185,9 +2260,6 @@ tay stx $ff ora $ff taz -//FRAGMENT vbuaa=vbuyy_bor_vbuaa -sty $ff -ora $ff //FRAGMENT vbuxx=vbuyy_bor_vbuaa sty $ff ora $ff @@ -2200,11 +2272,6 @@ tay sty $ff ora $ff taz -//FRAGMENT vbuaa=vbuzz_bor_vbuaa -tay -tza -sty $ff -ora $ff //FRAGMENT vbuxx=vbuzz_bor_vbuaa tax tza @@ -2238,18 +2305,6 @@ tay txa ora {z1} taz -//FRAGMENT vbuyy=_lo_vwuz1 -ldy {z1} -//FRAGMENT vbuzz=_lo_vwuz1 -ldz {z1} -//FRAGMENT vbuyy=_hi_vwuz1 -ldy {z1}+1 -//FRAGMENT vbuzz=_hi_vwuz1 -ldz {z1}+1 -//FRAGMENT vbuz1=vbuz2_bor_vbuyy -tya -ora {z2} -sta {z1} //FRAGMENT vbuyy=_hi__word_vduz1 ldy {z1}+1 //FRAGMENT vbuzz=_hi__word_vduz1 @@ -2276,10 +2331,6 @@ tza tax tya sta {c1},x -//FRAGMENT vbuz1=vbuz2_bor_vbuzz -tza -ora {z2} -sta {z1} //FRAGMENT vbuyy=vbuaa tay //FRAGMENT vbuzz=vbuaa diff --git a/src/main/fragment/cache/fragment-cache-mos6502.asm b/src/main/fragment/cache/fragment-cache-mos6502.asm index 8ec78f979..5740ffe3c 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 fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //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 d720981ec..61bde1032 100644 --- a/src/main/fragment/cache/fragment-cache-mos6502x.asm +++ b/src/main/fragment/cache/fragment-cache-mos6502x.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} @@ -5618,496 +5618,10 @@ sta {z1} lda {c1}+1 adc #>{c2} sta {z1}+1 -//FRAGMENT vwuz1=vbuz2_word_vbuc1 -lda {z2} -ldy #{c1} -sta {z1}+1 -sty {z1} -//FRAGMENT vbuz1=vbuz2_minus__deref_pbuz3 -lda {z2} -sec -ldy #0 -sbc ({z3}),y -sta {z1} -//FRAGMENT vbsz1=_inc_vbsz1 -inc {z1} -//FRAGMENT vbsz1_neq_vbsc1_then_la1 -lda #{c1} -cmp {z1} +//FRAGMENT 0_neq__deref_pbuc1_then_la1 +lda {c1} +cmp #0 bne {la1} -//FRAGMENT vbuz1=pbuz2_derefidx_vbuz3_rol_4 -ldy {z3} -lda ({z2}),y -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuz1=pbuz2_derefidx_vbuz3_rol_1 -ldy {z3} -lda ({z2}),y -asl -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuz3 -lda {z2} -ora {z3} -sta {z1} -//FRAGMENT vwuz1=vwuz2_ror_1 -lda {z2}+1 -lsr -sta {z1}+1 -lda {z2} -ror -sta {z1} -//FRAGMENT vwuz1=_neg_vwuz1 -sec -lda #0 -sbc {z1} -sta {z1} -lda #0 -sbc {z1}+1 -sta {z1}+1 -//FRAGMENT vwsz1=vwsz1_ror_1 -lda {z1}+1 -cmp #$80 -ror {z1}+1 -ror {z1} -//FRAGMENT vwsz1=vwsz1_minus_vwsz2 -lda {z1} -sec -sbc {z2} -sta {z1} -lda {z1}+1 -sbc {z2}+1 -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuz2 -ldy {z2} -sec -lda {z1} -sbc {c1},y -sta {z1} -lda {z1}+1 -sbc {c1}+1,y -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_plus_pwuc1_derefidx_vbuz2 -ldy {z2} -clc -lda {z1} -adc {c1},y -sta {z1} -lda {z1}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT vwsz1=vwsz1_ror_2 -lda {z1}+1 -cmp #$80 -ror {z1}+1 -ror {z1} -lda {z1}+1 -cmp #$80 -ror {z1}+1 -ror {z1} -//FRAGMENT vbuz1=vbuz1_minus_2 -dec {z1} -dec {z1} -//FRAGMENT vwuz1=vbuaa_word_vbuc1 -ldy #{c1} -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuxx_word_vbuc1 -ldy #{c1} -txa -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuyy_word_vbuc1 -tya -ldy #{c1} -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vwuz1_plus_vbuaa -clc -adc {z1} -sta {z1} -bcc !+ -inc {z1}+1 -!: -//FRAGMENT vbuz1=vbuxx_minus__deref_pbuz2 -txa -sec -ldy #0 -sbc ({z2}),y -sta {z1} -//FRAGMENT vbuaa=vbuz1_minus__deref_pbuz2 -lda {z1} -sec -ldy #0 -sbc ({z2}),y -//FRAGMENT vbuaa=vbuxx_minus__deref_pbuz1 -txa -sec -ldy #0 -sbc ({z1}),y -//FRAGMENT vbuxx=vbuz1_minus__deref_pbuz2 -lda {z1} -sec -ldy #0 -sbc ({z2}),y -tax -//FRAGMENT vbuxx=vbuxx_minus__deref_pbuz1 -txa -sec -ldy #0 -sbc ({z1}),y -tax -//FRAGMENT vbuyy=vbuz1_minus__deref_pbuz2 -lda {z1} -sec -ldy #0 -sbc ({z2}),y -tay -//FRAGMENT vbuyy=vbuxx_minus__deref_pbuz1 -txa -sec -ldy #0 -sbc ({z1}),y -tay -//FRAGMENT vbsxx_neq_vbsc1_then_la1 -cpx #{c1} -bne {la1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuz2_rol_4 -ldy {z2} -lda ({z1}),y -asl -asl -asl -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuz2_rol_4 -ldy {z2} -lda ({z1}),y -asl -asl -asl -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuz2_rol_4 -ldy {z2} -lda ({z1}),y -asl -asl -asl -asl -tay -//FRAGMENT vbuz1=pbuz2_derefidx_vbuaa_rol_4 -tay -lda ({z2}),y -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuaa_rol_4 -tay -lda ({z1}),y -asl -asl -asl -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuaa_rol_4 -tay -lda ({z1}),y -asl -asl -asl -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuaa_rol_4 -tay -lda ({z1}),y -asl -asl -asl -asl -tay -//FRAGMENT vbuz1=pbuz2_derefidx_vbuxx_rol_4 -txa -tay -lda ({z2}),y -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuxx_rol_4 -txa -tay -lda ({z1}),y -asl -asl -asl -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuxx_rol_4 -txa -tay -lda ({z1}),y -asl -asl -asl -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuxx_rol_4 -txa -tay -lda ({z1}),y -asl -asl -asl -asl -tay -//FRAGMENT vbuz1=pbuz2_derefidx_vbuyy_rol_4 -lda ({z2}),y -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuyy_rol_4 -lda ({z1}),y -asl -asl -asl -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuyy_rol_4 -lda ({z1}),y -asl -asl -asl -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuyy_rol_4 -lda ({z1}),y -asl -asl -asl -asl -tay -//FRAGMENT vbuaa=pbuz1_derefidx_vbuz2_rol_1 -ldy {z2} -lda ({z1}),y -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuz2_rol_1 -ldy {z2} -lda ({z1}),y -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuz2_rol_1 -ldy {z2} -lda ({z1}),y -asl -tay -//FRAGMENT vbuz1=pbuz2_derefidx_vbuxx_rol_1 -txa -tay -lda ({z2}),y -asl -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuxx_rol_1 -txa -tay -lda ({z1}),y -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuxx_rol_1 -txa -tay -lda ({z1}),y -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuxx_rol_1 -txa -tay -lda ({z1}),y -asl -tay -//FRAGMENT vbuz1=pbuz2_derefidx_vbuyy_rol_1 -lda ({z2}),y -asl -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_vbuyy_rol_1 -lda ({z1}),y -asl -//FRAGMENT vbuxx=pbuz1_derefidx_vbuyy_rol_1 -lda ({z1}),y -asl -tax -//FRAGMENT vbuyy=pbuz1_derefidx_vbuyy_rol_1 -lda ({z1}),y -asl -tay -//FRAGMENT vbuz1=vbuxx_bor_vbuz2 -txa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuz2 -tya -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuaa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_bor_vbuaa -stx $ff -ora $ff -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuaa -sty $ff -ora $ff -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuxx -txa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_bor_vbuxx -stx {z1} -//FRAGMENT pbuz1_derefidx_vbuxx=vbuz2 -txa -tay -lda {z2} -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuyy=vbuz2 -lda {z2} -sta ({z1}),y -//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuaa -tay -sec -lda {z1} -sbc {c1},y -sta {z1} -lda {z1}+1 -sbc {c1}+1,y -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuxx -sec -lda {z1} -sbc {c1},x -sta {z1} -lda {z1}+1 -sbc {c1}+1,x -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuyy -sec -lda {z1} -sbc {c1},y -sta {z1} -lda {z1}+1 -sbc {c1}+1,y -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_plus_pwuc1_derefidx_vbuaa -tay -clc -lda {z1} -adc {c1},y -sta {z1} -lda {z1}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_plus_pwuc1_derefidx_vbuxx -clc -lda {z1} -adc {c1},x -sta {z1} -lda {z1}+1 -adc {c1}+1,x -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_plus_pwuc1_derefidx_vbuyy -clc -lda {z1} -adc {c1},y -sta {z1} -lda {z1}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT vbuz1_lt_vbuaa_then_la1 -cmp {z1} -beq !+ -bcs {la1} -!: -//FRAGMENT vbuxx=vbuxx_minus_2 -dex -dex -//FRAGMENT vbuyy=vbuyy_minus_2 -dey -dey -//FRAGMENT vbuz1=vbuz2_bor_vbuyy -tya -ora {z2} -sta {z1} -//FRAGMENT vbuaa=vbuz1_bor_vbuz2 -lda {z1} -ora {z2} -//FRAGMENT vbuaa=vbuz1_bor_vbuaa -ora {z1} -//FRAGMENT vbuaa=vbuz1_bor_vbuxx -txa -ora {z1} -//FRAGMENT vbuaa=vbuz1_bor_vbuyy -tya -ora {z1} -//FRAGMENT vbuxx=vbuz1_bor_vbuz2 -lda {z1} -ora {z2} -tax -//FRAGMENT vbuxx=vbuz1_bor_vbuaa -ora {z1} -tax -//FRAGMENT vbuxx=vbuz1_bor_vbuxx -txa -ora {z1} -tax -//FRAGMENT vbuxx=vbuz1_bor_vbuyy -tya -ora {z1} -tax -//FRAGMENT vbuyy=vbuz1_bor_vbuz2 -lda {z1} -ora {z2} -tay -//FRAGMENT vbuyy=vbuz1_bor_vbuaa -ora {z1} -tay -//FRAGMENT vbuyy=vbuz1_bor_vbuxx -txa -ora {z1} -tay -//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 -cpy {z1} -beq !+ -bcs {la1} -!: -//FRAGMENT vbuxx_lt_vbuyy_then_la1 -sty $ff -cpx $ff -bcc {la1} -//FRAGMENT pbuz1_derefidx_vbuyy=vbuaa -sta ({z1}),y -//FRAGMENT vbuaa=vbuyy_bor_vbuaa -sty $ff -ora $ff -//FRAGMENT vwuz1=vwuz1_plus_vbuc1 -lda #{c1} -clc -adc {z1} -sta {z1} -bcc !+ -inc {z1}+1 -!: //FRAGMENT vbuz1_eq_vbuxx_then_la1 cpx {z1} beq {la1} @@ -6274,6 +5788,10 @@ asl asl asl sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuz3 +lda {z2} +ora {z3} +sta {z1} //FRAGMENT vbuz1=vbuaa_rol_4 asl asl @@ -6371,6 +5889,47 @@ asl asl asl tay +//FRAGMENT vbuz1=vbuz2_bor_vbuxx +txa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuyy +tya +ora {z2} +sta {z1} +//FRAGMENT vbuaa=vbuz1_bor_vbuz2 +lda {z1} +ora {z2} +//FRAGMENT vbuaa=vbuz1_bor_vbuxx +txa +ora {z1} +//FRAGMENT vbuaa=vbuz1_bor_vbuyy +tya +ora {z1} +//FRAGMENT vbuxx=vbuz1_bor_vbuz2 +lda {z1} +ora {z2} +tax +//FRAGMENT vbuxx=vbuz1_bor_vbuxx +txa +ora {z1} +tax +//FRAGMENT vbuxx=vbuz1_bor_vbuyy +tya +ora {z1} +tax +//FRAGMENT vbuyy=vbuz1_bor_vbuz2 +lda {z1} +ora {z2} +tay +//FRAGMENT vbuyy=vbuz1_bor_vbuxx +txa +ora {z1} +tay +//FRAGMENT vbuyy=vbuz1_bor_vbuyy +tya +ora {z1} +tay //FRAGMENT vbuz1=vbuaa_bor_vbuz2 ora {z2} sta {z1} @@ -6412,16 +5971,36 @@ tay sty $ff ora $ff tay +//FRAGMENT vbuz1=vbuxx_bor_vbuz2 +txa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_bor_vbuxx +stx {z1} +//FRAGMENT pbuz1_derefidx_vbuxx=vbuz2 +txa +tay +lda {z2} +sta ({z1}),y +//FRAGMENT pbuz1_derefidx_vbuyy=vbuz2 +lda {z2} +sta ({z1}),y //FRAGMENT vbuz1=vbuxx_bor_vbuyy txa sty $ff ora $ff sta {z1} +//FRAGMENT vbuz1=vbuyy_bor_vbuz2 +tya +ora {z2} +sta {z1} //FRAGMENT vbuz1=vbuyy_bor_vbuxx txa sty $ff ora $ff sta {z1} +//FRAGMENT pbuz1_derefidx_vbuyy=vbuaa +sta ({z1}),y //FRAGMENT vbuaa=vbuxx_bor_vbuz1 txa ora {z1} @@ -6452,6 +6031,11 @@ tax tya ora {z1} tax +//FRAGMENT pbuz1_derefidx_vbuxx=vbuyy +stx $ff +tya +ldy $ff +sta ({z1}),y //FRAGMENT vbuyy=vbuxx_bor_vbuz1 txa ora {z1} @@ -6664,6 +6248,14 @@ tay tya ora #{c1} tay +//FRAGMENT vwuz1=vwuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: //FRAGMENT vwuz1_gt_vbuc1_then_la1 lda {z1}+1 bne {la1} @@ -6831,9 +6423,28 @@ lda #{c1} ldy #0 and ({z1}),y tay +//FRAGMENT vbuz1=vbuz2_bor_vbuaa +ora {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_bor_vbuaa +stx $ff +ora $ff +sta {z1} +//FRAGMENT vbuz1=vbuyy_bor_vbuaa +sty $ff +ora $ff +sta {z1} +//FRAGMENT vbuaa=vbuz1_bor_vbuaa +ora {z1} //FRAGMENT vbuaa=vbuxx_bor_vbuaa stx $ff ora $ff +//FRAGMENT vbuaa=vbuyy_bor_vbuaa +sty $ff +ora $ff +//FRAGMENT vbuxx=vbuz1_bor_vbuaa +ora {z1} +tax //FRAGMENT vbuxx=vbuxx_bor_vbuaa stx $ff ora $ff @@ -6842,6 +6453,9 @@ tax sty $ff ora $ff tax +//FRAGMENT vbuyy=vbuz1_bor_vbuaa +ora {z1} +tay //FRAGMENT vbuyy=vbuxx_bor_vbuaa stx $ff ora $ff @@ -6878,6 +6492,19 @@ sta {z1}+2 lda {z2}+3 sbc #>{c1}>>$10 sta {z1}+3 +//FRAGMENT vbuz1=pbuz2_derefidx_vbuz3_rol_4 +ldy {z3} +lda ({z2}),y +asl +asl +asl +asl +sta {z1} +//FRAGMENT vbuz1=pbuz2_derefidx_vbuz3_rol_1 +ldy {z3} +lda ({z2}),y +asl +sta {z1} //FRAGMENT _deref_pduc1=vduc2 lda #<{c2} sta {c1} @@ -6934,6 +6561,13 @@ sta {z1} lda {z2}+1 sbc #>{c1} sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_ror_1 +lda {z2}+1 +lsr +sta {z1}+1 +lda {z2} +ror +sta {z1} //FRAGMENT vbuz1_gt_0_then_la1 lda {z1} bne {la1} @@ -6997,6 +6631,174 @@ sta {z1} lda {z2}+1 adc #0 sta {z1}+1 +//FRAGMENT vbuaa=pbuz1_derefidx_vbuz2_rol_4 +ldy {z2} +lda ({z1}),y +asl +asl +asl +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuz2_rol_4 +ldy {z2} +lda ({z1}),y +asl +asl +asl +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuz2_rol_4 +ldy {z2} +lda ({z1}),y +asl +asl +asl +asl +tay +//FRAGMENT vbuz1=pbuz2_derefidx_vbuaa_rol_4 +tay +lda ({z2}),y +asl +asl +asl +asl +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuaa_rol_4 +tay +lda ({z1}),y +asl +asl +asl +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuaa_rol_4 +tay +lda ({z1}),y +asl +asl +asl +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuaa_rol_4 +tay +lda ({z1}),y +asl +asl +asl +asl +tay +//FRAGMENT vbuz1=pbuz2_derefidx_vbuxx_rol_4 +txa +tay +lda ({z2}),y +asl +asl +asl +asl +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuxx_rol_4 +txa +tay +lda ({z1}),y +asl +asl +asl +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuxx_rol_4 +txa +tay +lda ({z1}),y +asl +asl +asl +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuxx_rol_4 +txa +tay +lda ({z1}),y +asl +asl +asl +asl +tay +//FRAGMENT vbuz1=pbuz2_derefidx_vbuyy_rol_4 +lda ({z2}),y +asl +asl +asl +asl +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuyy_rol_4 +lda ({z1}),y +asl +asl +asl +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuyy_rol_4 +lda ({z1}),y +asl +asl +asl +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuyy_rol_4 +lda ({z1}),y +asl +asl +asl +asl +tay +//FRAGMENT vbuaa=pbuz1_derefidx_vbuz2_rol_1 +ldy {z2} +lda ({z1}),y +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuz2_rol_1 +ldy {z2} +lda ({z1}),y +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuz2_rol_1 +ldy {z2} +lda ({z1}),y +asl +tay +//FRAGMENT vbuz1=pbuz2_derefidx_vbuxx_rol_1 +txa +tay +lda ({z2}),y +asl +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuxx_rol_1 +txa +tay +lda ({z1}),y +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuxx_rol_1 +txa +tay +lda ({z1}),y +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuxx_rol_1 +txa +tay +lda ({z1}),y +asl +tay +//FRAGMENT vbuz1=pbuz2_derefidx_vbuyy_rol_1 +lda ({z2}),y +asl +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuyy_rol_1 +lda ({z1}),y +asl +//FRAGMENT vbuxx=pbuz1_derefidx_vbuyy_rol_1 +lda ({z1}),y +asl +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuyy_rol_1 +lda ({z1}),y +asl +tay //FRAGMENT vbuz1=vbuc1_minus_vbuaa eor #$ff sec @@ -7063,6 +6865,13 @@ tay txa tay sta ({z1}),y +//FRAGMENT vwuz1=vwuz1_plus_vbuaa +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: //FRAGMENT vbuaa_gt_0_then_la1 cmp #0 bne {la1} @@ -7242,6 +7051,14 @@ bne {la1} lda {z1} cmp {z2} bne {la1} +//FRAGMENT vwuz1=_neg_vwuz1 +sec +lda #0 +sbc {z1} +sta {z1} +lda #0 +sbc {z1}+1 +sta {z1}+1 //FRAGMENT vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2 ldy {z2} lda {c1},y @@ -7353,300 +7170,6 @@ bne {la1} lda {c1},y cmp #0 bne {la1} -//FRAGMENT pbuz1=pbuz2_minus_vwuz3 -lda {z2} -sec -sbc {z3} -sta {z1} -lda {z2}+1 -sbc {z3}+1 -sta {z1}+1 -//FRAGMENT pwuz1=qwuz2_derefidx_vbuz3 -ldy {z3} -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT vbuz1_le_0_then_la1 -lda {z1} -cmp #0 -beq {la1} -//FRAGMENT vwuz1_eq_vwuc1_then_la1 -lda {z1} -cmp #<{c1} -bne !+ -lda {z1}+1 -cmp #>{c1} -beq {la1} -!: -//FRAGMENT _deref_pbuc1=_dec__deref_pbuc1 -dec {c1} -//FRAGMENT vwuz1=pwuz2_derefidx_vbuz3 -ldy {z3} -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT _deref_pbuz1_gt_vbuz2_then_la1 -ldy #0 -lda ({z1}),y -cmp {z2} -beq !+ -bcs {la1} -!: -//FRAGMENT vbuz1=_neg_vbuz2 -lda {z2} -eor #$ff -clc -adc #$01 -sta {z1} -//FRAGMENT pbuz1_derefidx_(_deref_pbuz2)=_inc_pbuz1_derefidx_(_deref_pbuz2) -ldy #0 -lda ({z2}),y -tay -lda ({z1}),y -clc -adc #1 -sta ({z1}),y -//FRAGMENT vwuz1=_deref_pbuz2_rol_1 -ldy #0 -lda ({z2}),y -asl -sta {z1} -lda #0 -rol -sta {z1}+1 -//FRAGMENT qwuz1=qwuz2_plus_vwuz3 -lda {z2} -clc -adc {z3} -sta {z1} -lda {z2}+1 -adc {z3}+1 -sta {z1}+1 -//FRAGMENT _deref_qwuz1=pwuz2 -ldy #0 -lda {z2} -sta ({z1}),y -iny -lda {z2}+1 -sta ({z1}),y -//FRAGMENT vwuz1_neq_vbuc1_then_la1 -NO_SYNTHESIS -//FRAGMENT vwuz1_neq_vbsc1_then_la1 -NO_SYNTHESIS -//FRAGMENT pwuz1=_deref_qwuz2 -ldy #0 -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT vwuz1=pbuz2_minus_pbuz3 -lda {z2} -sec -sbc {z3} -sta {z1} -lda {z2}+1 -sbc {z3}+1 -sta {z1}+1 -//FRAGMENT pwuz1_derefidx_vbuz2=vwuz3 -ldy {z2} -lda {z3} -sta ({z1}),y -iny -lda {z3}+1 -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuz2=_inc_pbuz1_derefidx_vbuz2 -ldy {z2} -lda ({z1}),y -clc -adc #1 -sta ({z1}),y -//FRAGMENT vwuz1=pwuz2_minus_pwuz3 -lda {z2} -sec -sbc {z3} -sta {z1} -lda {z2}+1 -sbc {z3}+1 -sta {z1}+1 -//FRAGMENT pwuz1=qwuz2_derefidx_vbuaa -tay -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT pwuz1=qwuz2_derefidx_vbuxx -txa -tay -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT pwuz1=qwuz2_derefidx_vbuyy -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT vbuaa_le_0_then_la1 -cmp #0 -beq {la1} -//FRAGMENT vwuz1=pwuz2_derefidx_vbuaa -tay -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT vwuz1=pwuz2_derefidx_vbuxx -txa -tay -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT vwuz1=pwuz2_derefidx_vbuyy -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT _deref_pbuz1_gt_vbuxx_then_la1 -ldy #0 -lda ({z1}),y -sta $ff -cpx $ff -bcc {la1} -//FRAGMENT vbuz1=_neg_vbuaa -eor #$ff -clc -adc #$01 -sta {z1} -//FRAGMENT vbuz1=_neg_vbuxx -dex -txa -eor #$ff -sta {z1} -//FRAGMENT vbuaa=_neg_vbuz1 -lda {z1} -eor #$ff -clc -adc #$01 -//FRAGMENT vbuaa=_neg_vbuaa -eor #$ff -clc -adc #$01 -//FRAGMENT vbuaa=_neg_vbuxx -dex -txa -eor #$ff -//FRAGMENT vbuxx=_neg_vbuz1 -lda {z1} -eor #$ff -tax -inx -//FRAGMENT vbuxx=_neg_vbuaa -eor #$ff -tax -inx -//FRAGMENT vbuxx=_neg_vbuxx -dex -txa -eor #$ff -tax -//FRAGMENT vbuyy=_neg_vbuz1 -lda {z1} -eor #$ff -tay -iny -//FRAGMENT vbuyy=_neg_vbuaa -eor #$ff -tay -iny -//FRAGMENT vbuyy=_neg_vbuxx -txa -eor #$ff -tay -iny -//FRAGMENT pwuz1_derefidx_vbuaa=vwuz2 -tay -lda {z2} -sta ({z1}),y -iny -lda {z2}+1 -sta ({z1}),y -//FRAGMENT pwuz1_derefidx_vbuxx=vwuz2 -txa -tay -lda {z2} -sta ({z1}),y -iny -lda {z2}+1 -sta ({z1}),y -//FRAGMENT pwuz1_derefidx_vbuyy=vwuz2 -lda {z2} -sta ({z1}),y -iny -lda {z2}+1 -sta ({z1}),y -//FRAGMENT pbuz1_derefidx_vbuxx=_inc_pbuz1_derefidx_vbuxx -txa -tay -lda ({z1}),y -clc -adc #1 -sta ({z1}),y -//FRAGMENT vbuxx_le_0_then_la1 -cpx #0 -beq {la1} -//FRAGMENT pbuz1=pbuz2_minus_vwuz1 -lda {z2} -sec -sbc {z1} -sta {z1} -lda {z2}+1 -sbc {z1}+1 -sta {z1}+1 -//FRAGMENT vwuz1=_deref_pbuz1_rol_1 -ldy #0 -lda ({z1}),y -asl -sta {z1} -lda #0 -rol -sta {z1}+1 -//FRAGMENT qwuz1=qwuz2_plus_vwuz1 -lda {z1} -clc -adc {z2} -sta {z1} -lda {z1}+1 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT pwuz1=_deref_qwuz1 -ldy #0 -lda ({z1}),y -pha -iny -lda ({z1}),y -sta {z1}+1 -pla -sta {z1} -//FRAGMENT vwuz1=pwuz1_minus_pwuz2 -lda {z1} -sec -sbc {z2} -sta {z1} -lda {z1}+1 -sbc {z2}+1 -sta {z1}+1 //FRAGMENT vbuyy_gt_0_then_la1 cpy #0 bne {la1} @@ -7655,10 +7178,6 @@ tay lda {c1},y ldy {z2} sta ({z1}),y -//FRAGMENT 0_neq__deref_pbuc1_then_la1 -lda {c1} -cmp #0 -bne {la1} //FRAGMENT vbuyy=pbuc1_derefidx_vbuxx ldy {c1},x //FRAGMENT vduz1=_inc_vduz1 @@ -7678,6 +7197,8 @@ beq {la1} //FRAGMENT vbsz1=_sbyte_vwuz2 lda {z2} sta {z1} +//FRAGMENT vbsz1=_inc_vbsz1 +inc {z1} //FRAGMENT vbsz1=vbsz2_minus_vbsz3 lda {z2} sec @@ -7793,6 +7314,11 @@ beq {la1} //FRAGMENT vbuaa_neq_vbuz1_then_la1 cmp {z1} bne {la1} +//FRAGMENT vbuz1_lt_vbuaa_then_la1 +cmp {z1} +beq !+ +bcs {la1} +!: //FRAGMENT vbsaa=_sbyte_vwuz1 lda {z1} //FRAGMENT vbsxx=_sbyte_vwuz1 @@ -7971,6 +7497,11 @@ inx ldy {z1} //FRAGMENT vbsyy=_inc_vbsyy iny +//FRAGMENT vbuz1_lt_vbuyy_then_la1 +cpy {z1} +beq !+ +bcs {la1} +!: //FRAGMENT vbuaa_lt_vbuxx_then_la1 stx $ff cmp $ff @@ -7980,6 +7511,10 @@ tax sty $ff cpx $ff bcc {la1} +//FRAGMENT vbuxx_lt_vbuyy_then_la1 +sty $ff +cpx $ff +bcc {la1} //FRAGMENT vbuyy_lt_vbuaa_then_la1 sta $ff cpy $ff @@ -8119,6 +7654,8 @@ sta {z1}+2 lda #>{c1}>>$10 adc #0 sta {z1}+3 +//FRAGMENT _deref_pbuc1=_dec__deref_pbuc1 +dec {c1} //FRAGMENT pbuz1_derefidx_vbuaa=vbuz2 tay lda {z2} @@ -8622,66 +8159,6 @@ tya lsr lsr tay -//FRAGMENT vwuz1=vbuz2_word_vbuz3 -lda {z2} -sta {z1}+1 -lda {z3} -sta {z1} -//FRAGMENT vwuz1=vbuaa_word_vbuz2 -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=vbuxx_word_vbuz2 -txa -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=vbuyy_word_vbuz2 -tya -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=vbuz2_word_vbuaa -tay -lda {z2} -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuaa_word_vbuaa -tay -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuxx_word_vbuaa -tay -txa -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuyy_word_vbuaa -tax -tya -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=vbuz2_word_vbuxx -lda {z2} -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=vbuaa_word_vbuxx -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=vbuyy_word_vbuxx -tya -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=vbuz2_word_vbuyy -lda {z2} -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuaa_word_vbuyy -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=vbuxx_word_vbuyy -txa -sta {z1}+1 -sty {z1} //FRAGMENT _deref_qbuc1=pbuc2 lda #<{c2} sta {c1} @@ -10922,6 +10399,10 @@ bne {la1} lda {z1} cmp #<{c1} bne {la1} +//FRAGMENT vwuz1_neq_vbuc1_then_la1 +NO_SYNTHESIS +//FRAGMENT vwuz1_neq_vbsc1_then_la1 +NO_SYNTHESIS //FRAGMENT _deref_pbuc1_lt_vbuc2_then_la1 lda {c1} cmp #{c2} @@ -12458,6 +11939,12 @@ bne !- !e: //FRAGMENT isr_rom_sys_c64_entry +//FRAGMENT pbuz1_derefidx_vbuz2=_inc_pbuz1_derefidx_vbuz2 +ldy {z2} +lda ({z1}),y +clc +adc #1 +sta ({z1}),y //FRAGMENT isr_rom_sys_c64_exit jmp $ea31 //FRAGMENT vwsz1_neq_vwsc1_then_la1 @@ -12681,6 +12168,34 @@ tay lda {c1} ldy #0 sta ({z1}),y +//FRAGMENT vwuz1=pwuz2_derefidx_vbuz3 +ldy {z3} +lda ({z2}),y +sta {z1} +iny +lda ({z2}),y +sta {z1}+1 +//FRAGMENT vwuz1=pwuz2_derefidx_vbuaa +tay +lda ({z2}),y +sta {z1} +iny +lda ({z2}),y +sta {z1}+1 +//FRAGMENT vwuz1=pwuz2_derefidx_vbuxx +txa +tay +lda ({z2}),y +sta {z1} +iny +lda ({z2}),y +sta {z1}+1 +//FRAGMENT vwuz1=pwuz2_derefidx_vbuyy +lda ({z2}),y +sta {z1} +iny +lda ({z2}),y +sta {z1}+1 //FRAGMENT vbsz1=vbsz1_minus_vbsxx txa eor #$ff @@ -13183,6 +12698,10 @@ asl {z1} rol {z1}+1 rol {z1}+2 rol {z1}+3 +//FRAGMENT vbsz1_neq_vbsc1_then_la1 +lda #{c1} +cmp {z1} +bne {la1} //FRAGMENT vbsz1_gt_0_then_la1 lda {z1} cmp #0 @@ -13243,6 +12762,15 @@ cmp #0 beq !+ bpl {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 @@ -14000,6 +13528,9 @@ tay sec sbc {c1},y tay +//FRAGMENT vbsxx_neq_vbsc1_then_la1 +cpx #{c1} +bne {la1} //FRAGMENT vbsyy_neq_0_then_la1 cpy #0 bne {la1} @@ -14316,6 +13847,829 @@ sta $ff txa sec sbc $ff +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_vbuz3 +lda {z3} +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT pbuz1=pbuc1_plus_pwuc2_derefidx_vbuz2 +ldy {z2} +clc +lda #<{c1} +adc {c2},y +sta {z1} +lda #>{c1} +adc {c2}+1,y +sta {z1}+1 +//FRAGMENT pbuc1_derefidx_vbuz1_ge_vbuc2_then_la1 +ldy {z1} +lda {c1},y +cmp #{c2} +bcs {la1} +//FRAGMENT pbuc1_derefidx_vbuz1_lt_vbuc2_then_la1 +ldy {z1} +lda {c1},y +cmp #{c2} +bcc {la1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz1 +ldy {z1} +lda {c1},y +sta {z1} +//FRAGMENT vbuz1=vbuz2_band_vbuz3 +lda {z2} +and {z3} +sta {z1} +//FRAGMENT vbuz1=vbuz1_band_vbuz2 +lda {z1} +and {z2} +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuz3 +ldy {z2} +lda {c1},y +ldy {z3} +clc +adc {c2},y +sta {z1} +//FRAGMENT vbuz1_le_0_then_la1 +lda {z1} +cmp #0 +beq {la1} +//FRAGMENT vbuz1=vbuz1_minus_2 +dec {z1} +dec {z1} +//FRAGMENT pbuz1=qbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT pwuz1=pwuz2_plus_vwuz3 +lda {z2} +clc +adc {z3} +sta {z1} +lda {z2}+1 +adc {z3}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus__deref_pwuz3 +ldy #0 +clc +lda {z2} +adc ({z3}),y +sta {z1} +iny +lda {z2}+1 +adc ({z3}),y +sta {z1}+1 +//FRAGMENT vwuz1=vbuz2_word_vbuz3 +lda {z2} +sta {z1}+1 +lda {z3} +sta {z1} +//FRAGMENT vwuz1=pbuz2_derefidx_vbuc1_word__deref_pbuz2 +ldy #{c1} +lda ({z2}),y +sta {z1}+1 +ldy #0 +lda ({z2}),y +sta {z1} +//FRAGMENT pbuz1=pbuz1_plus_pbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT vbuz1=pbuz2_derefidx_vbuz3_bor_pbuz4_derefidx_vbuz3 +ldy {z3} +lda ({z2}),y +ora ({z4}),y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_vbuz2 +lda {c1},x +clc +adc {z2} +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_vbuz2 +lda {c1},y +clc +adc {z2} +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_vbuz2 +lda {z2} +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_vbuz1 +lda {c1},x +clc +adc {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_vbuz1 +lda {c1},y +clc +adc {z1} +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_vbuz2 +lda {z2} +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_vbuz1 +lda {c1},x +clc +adc {z1} +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_vbuz1 +lda {c1},y +clc +adc {z1} +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_vbuz2 +lda {z2} +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_vbuz1 +lda {c1},x +clc +adc {z1} +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_vbuz1 +lda {c1},y +clc +adc {z1} +tay +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_vbuaa +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_vbuaa +clc +adc {c1},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_vbuaa +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_vbuaa +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa +clc +adc {c1},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_vbuaa +clc +adc {c1},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_vbuaa +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_vbuaa +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_vbuaa +clc +adc {c1},y +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_vbuaa +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_vbuaa +clc +adc {c1},x +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_vbuaa +clc +adc {c1},y +tay +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_vbuxx +ldy {z2} +txa +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_vbuxx +txa +clc +adc {c1},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_vbuxx +txa +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_vbuxx +ldy {z1} +txa +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_vbuxx +txa +clc +adc {c1},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_vbuxx +txa +clc +adc {c1},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_vbuxx +txa +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_vbuxx +txa +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_vbuxx +txa +clc +adc {c1},y +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_vbuxx +ldy {z1} +txa +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_vbuxx +txa +clc +adc {c1},x +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_vbuxx +txa +clc +adc {c1},y +tay +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_vbuyy +tya +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_vbuyy +tya +clc +adc {c1},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_vbuyy +tya +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_vbuyy +tya +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_vbuyy +tya +clc +adc {c1},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_vbuyy +tya +clc +adc {c1},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_vbuyy +ldx {z1} +tya +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_vbuyy +tya +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_vbuyy +tya +clc +adc {c1},y +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_vbuyy +tya +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_vbuyy +tya +clc +adc {c1},x +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_vbuyy +tya +clc +adc {c1},y +tay +//FRAGMENT pbuz1=pbuc1_plus_pwuc2_derefidx_vbuaa +tay +clc +lda #<{c1} +adc {c2},y +sta {z1} +lda #>{c1} +adc {c2}+1,y +sta {z1}+1 +//FRAGMENT pbuz1=pbuc1_plus_pwuc2_derefidx_vbuxx +txa +tay +clc +lda #<{c1} +adc {c2},y +sta {z1} +lda #>{c1} +adc {c2}+1,y +sta {z1}+1 +//FRAGMENT pbuz1=pbuc1_plus_pwuc2_derefidx_vbuyy +clc +lda #<{c1} +adc {c2},y +sta {z1} +lda #>{c1} +adc {c2}+1,y +sta {z1}+1 +//FRAGMENT pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 +lda {c1},x +cmp #{c2} +bcs {la1} +//FRAGMENT pbuc1_derefidx_vbuyy_ge_vbuc2_then_la1 +lda {c1},y +cmp #{c2} +bcs {la1} +//FRAGMENT pbuc1_derefidx_vbuxx_lt_vbuc2_then_la1 +lda {c1},x +cmp #{c2} +bcc {la1} +//FRAGMENT pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 +lda {c1},y +cmp #{c2} +bcc {la1} +//FRAGMENT vbuz1=vbuaa_band_vbuz2 +and {z2} +sta {z1} +//FRAGMENT vbuz1=vbuxx_band_vbuz2 +lda {z2} +sax {z1} +//FRAGMENT vbuz1=vbuyy_band_vbuz2 +tya +and {z2} +sta {z1} +//FRAGMENT vbuz1=vbuz2_band_vbuxx +lda {z2} +sax {z1} +//FRAGMENT vbuz1=vbuaa_band_vbuxx +sax {z1} +//FRAGMENT vbuz1=vbuz1_band_vbuxx +lda {z1} +sax {z1} +//FRAGMENT vbuz1=vbuz1_band_vbuyy +tya +and {z1} +sta {z1} +//FRAGMENT pbuc1_derefidx_vbuyy=_byte_vwuz1 +lda {z1} +sta {c1},y +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuxx +lda {c2},x +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuyy +lda {c2},y +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz2 +lda {c1},x +ldy {z2} +clc +adc {c2},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx +lda {c1},x +clc +adc {c2},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy +lda {c1},x +clc +adc {c2},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz2 +lda {c1},y +ldy {z2} +clc +adc {c2},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx +lda {c1},y +clc +adc {c2},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy +lda {c1},y +clc +adc {c2},y +sta {z1} +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 +ldy {z1} +lda {c1},y +ldy {z2} +clc +adc {c2},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx +lda {c2},x +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy +lda {c2},y +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 +lda {c1},x +ldy {z1} +clc +adc {c2},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx +lda {c1},x +clc +adc {c2},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy +lda {c1},x +clc +adc {c2},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 +lda {c1},y +ldy {z1} +clc +adc {c2},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx +lda {c1},y +clc +adc {c2},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy +lda {c1},y +clc +adc {c2},y +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 +ldx {z1} +lda {c1},x +ldx {z2} +clc +adc {c2},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx +lda {c2},x +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy +lda {c2},y +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 +lda {c1},x +ldx {z1} +clc +adc {c2},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx +lda {c1},x +clc +adc {c2},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy +lda {c1},x +clc +adc {c2},y +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 +lda {c1},y +ldx {z1} +clc +adc {c2},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx +lda {c1},y +clc +adc {c2},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy +lda {c1},y +clc +adc {c2},y +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 +ldy {z1} +lda {c1},y +ldy {z2} +clc +adc {c2},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx +lda {c2},x +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy +lda {c2},y +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 +lda {c1},x +ldy {z1} +clc +adc {c2},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx +lda {c1},x +clc +adc {c2},x +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy +lda {c1},x +clc +adc {c2},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 +lda {c1},y +ldy {z1} +clc +adc {c2},y +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx +lda {c1},y +clc +adc {c2},x +tay +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy +lda {c1},y +clc +adc {c2},y +tay +//FRAGMENT vbuxx_le_0_then_la1 +cpx #0 +beq {la1} +//FRAGMENT vbuaa_eq_vbuz1_then_la1 +cmp {z1} +beq {la1} +//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_plus_pbuc1_derefidx_vbuz2 +ldy {z2} +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuz1=vbuaa_plus_pbuc1_derefidx_vbuxx +clc +adc {c1},x +sta {z1} +//FRAGMENT vbuz1=vbuaa_plus_pbuc1_derefidx_vbuyy +clc +adc {c1},y +sta {z1} +//FRAGMENT vbuaa=vbuaa_plus_pbuc1_derefidx_vbuz1 +ldy {z1} +clc +adc {c1},y +//FRAGMENT vbuaa=vbuaa_plus_pbuc1_derefidx_vbuxx +clc +adc {c1},x +//FRAGMENT vbuaa=vbuaa_plus_pbuc1_derefidx_vbuyy +clc +adc {c1},y +//FRAGMENT vbuxx=vbuaa_plus_pbuc1_derefidx_vbuz1 +ldx {z1} +clc +adc {c1},x +tax +//FRAGMENT vbuxx=vbuaa_plus_pbuc1_derefidx_vbuxx +clc +adc {c1},x +tax +//FRAGMENT vbuxx=vbuaa_plus_pbuc1_derefidx_vbuyy +clc +adc {c1},y +tax +//FRAGMENT vbuyy=vbuaa_plus_pbuc1_derefidx_vbuz1 +ldy {z1} +clc +adc {c1},y +tay +//FRAGMENT vbuyy=vbuaa_plus_pbuc1_derefidx_vbuxx +clc +adc {c1},x +tay +//FRAGMENT vbuyy=vbuaa_plus_pbuc1_derefidx_vbuyy +clc +adc {c1},y +tay +//FRAGMENT vwuz1=vbuz2_word_vbuaa +ldy {z2} +sty {z1}+1 +sta {z1} +//FRAGMENT pbuz1=pbuz1_plus_pbuc1_derefidx_vbuxx +lda {c1},x +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT pbuz1=pbuz1_plus_pbuc1_derefidx_vbuyy +lda {c1},y +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT vbuz1=pbuz2_derefidx_vbuaa_bor_pbuz3_derefidx_vbuaa +tay +lda ({z2}),y +ora ({z3}),y +sta {z1} +//FRAGMENT vbuz1=pbuz2_derefidx_vbuxx_bor_pbuz3_derefidx_vbuxx +txa +tay +lda ({z2}),y +ora ({z3}),y +sta {z1} +//FRAGMENT vbuz1=pbuz2_derefidx_vbuyy_bor_pbuz3_derefidx_vbuyy +lda ({z2}),y +ora ({z3}),y +sta {z1} +//FRAGMENT vbuaa=pbuz1_derefidx_vbuz2_bor_pbuz3_derefidx_vbuz2 +ldy {z2} +lda ({z1}),y +ora ({z3}),y +//FRAGMENT vbuaa=pbuz1_derefidx_vbuaa_bor_pbuz2_derefidx_vbuaa +tay +lda ({z1}),y +ora ({z2}),y +//FRAGMENT vbuaa=pbuz1_derefidx_vbuxx_bor_pbuz2_derefidx_vbuxx +txa +tay +lda ({z1}),y +ora ({z2}),y +//FRAGMENT vbuaa=pbuz1_derefidx_vbuyy_bor_pbuz2_derefidx_vbuyy +lda ({z1}),y +ora ({z2}),y +//FRAGMENT vbuxx=pbuz1_derefidx_vbuz2_bor_pbuz3_derefidx_vbuz2 +ldy {z2} +lda ({z1}),y +ora ({z3}),y +tax +//FRAGMENT vbuxx=pbuz1_derefidx_vbuaa_bor_pbuz2_derefidx_vbuaa +tay +lda ({z1}),y +ora ({z2}),y +tax +//FRAGMENT vbuxx=pbuz1_derefidx_vbuxx_bor_pbuz2_derefidx_vbuxx +txa +tay +lda ({z1}),y +ora ({z2}),y +tax +//FRAGMENT vbuxx=pbuz1_derefidx_vbuyy_bor_pbuz2_derefidx_vbuyy +lda ({z1}),y +ora ({z2}),y +tax +//FRAGMENT vbuyy=pbuz1_derefidx_vbuz2_bor_pbuz3_derefidx_vbuz2 +ldy {z2} +lda ({z1}),y +ora ({z3}),y +tay +//FRAGMENT vbuyy=pbuz1_derefidx_vbuaa_bor_pbuz2_derefidx_vbuaa +tay +lda ({z1}),y +ora ({z2}),y +tay +//FRAGMENT vbuyy=pbuz1_derefidx_vbuxx_bor_pbuz2_derefidx_vbuxx +txa +tay +lda ({z1}),y +ora ({z2}),y +tay +//FRAGMENT vbuyy=pbuz1_derefidx_vbuyy_bor_pbuz2_derefidx_vbuyy +lda ({z1}),y +ora ({z2}),y +tay +//FRAGMENT vwuz1=vbuz2_word_vbuxx +lda {z2} +sta {z1}+1 +stx {z1} +//FRAGMENT vwuz1=vbuz2_word_vbuyy +lda {z2} +sta {z1}+1 +sty {z1} +//FRAGMENT vbuxx=vbuyy_minus_1 +tya +tax +dex +//FRAGMENT vbuxx=vbuxx_minus_2 +dex +dex +//FRAGMENT vbuaa=vbuxx_minus_1 +txa +sec +sbc #1 +//FRAGMENT vbuyy=vbuxx_minus_1 +txa +tay +dey +//FRAGMENT vwuz1=vbuxx_word_vbuaa +stx {z1}+1 +sta {z1} +//FRAGMENT vwuz1=vbuyy_word_vbuaa +sty {z1}+1 +sta {z1} +//FRAGMENT vbuaa=vbuyy_minus_1 +tya +sec +sbc #1 +//FRAGMENT vbuaa=vbuz1_band_vbuz2 +lda {z1} +and {z2} +//FRAGMENT vbuxx=vbuz1_band_vbuz2 +lda {z1} +and {z2} +tax +//FRAGMENT vbuyy=vbuz1_band_vbuz2 +lda {z1} +and {z2} +tay +//FRAGMENT vbuaa=vbuaa_band_vbuz1 +and {z1} +//FRAGMENT vbuaa=vbuxx_band_vbuz1 +txa +and {z1} +//FRAGMENT vbuaa=vbuyy_band_vbuz1 +tya +and {z1} +//FRAGMENT vbuaa=vbuaa_band_vbuxx +stx $ff +and $ff +//FRAGMENT vbuaa=vbuaa_band_vbuyy +sty $ff +and $ff +//FRAGMENT pbuz1=pbuz2_plus__deref_pwuz1 +ldy #0 +clc +lda ({z1}),y +adc {z2} +pha +iny +lda ({z1}),y +adc {z2}+1 +sta {z1}+1 +pla +sta {z1} +//FRAGMENT pwuz1=pwuz2_plus_vwuz1 +lda {z1} +clc +adc {z2} +sta {z1} +lda {z1}+1 +adc {z2}+1 +sta {z1}+1 //FRAGMENT vbuz1=_deref_pbuc1_bxor_vbuc2 lda #{c2} eor {c1} @@ -14444,85 +14798,6 @@ lda {c1}+2 sta {z1}+2 lda {c1}+3 sta {z1}+3 -//FRAGMENT vwuz1=pbuc1_derefidx_vbuz2_word_vbuz3 -ldy {z2} -lda {c1},y -sta {z1}+1 -lda {z3} -sta {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuaa_word_vbuz2 -tay -lda {c1},y -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuxx_word_vbuz2 -lda {c1},x -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuyy_word_vbuz2 -lda {c1},y -sta {z1}+1 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuz2_word_vbuaa -ldx {z2} -tay -lda {c1},x -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuaa_word_vbuaa -tay -lda {c1},y -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuxx_word_vbuaa -tay -lda {c1},x -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuyy_word_vbuaa -tax -lda {c1},y -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuz2_word_vbuxx -ldy {z2} -lda {c1},y -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuaa_word_vbuxx -tay -lda {c1},y -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuxx_word_vbuxx -lda {c1},x -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuyy_word_vbuxx -lda {c1},y -sta {z1}+1 -stx {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuz2_word_vbuyy -ldx {z2} -lda {c1},x -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuaa_word_vbuyy -tax -lda {c1},x -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuxx_word_vbuyy -lda {c1},x -sta {z1}+1 -sty {z1} -//FRAGMENT vwuz1=pbuc1_derefidx_vbuyy_word_vbuyy -lda {c1},y -sta {z1}+1 -sty {z1} //FRAGMENT _deref_(_deref_qwuc1)=_deref_(_deref_qwuc2) ldy {c2} sty $fe @@ -14760,18 +15035,12 @@ sta ({z1}),y lda {z2} ora {z3}+1 sta {z1} +//FRAGMENT vbuyy=vbuyy_minus_2 +dey +dey //FRAGMENT vbuz1=vbuz1_bor_vbuaa ora {z1} sta {z1} -//FRAGMENT pbuz1_ge_pbuc1_then_la1 -lda {z1}+1 -cmp #>{c1} -bcc !+ -bne {la1} -lda {z1} -cmp #<{c1} -bcs {la1} -!: //FRAGMENT vbuz1=_deref_pbuc1_ror_1 lda {c1} lsr @@ -14786,6 +15055,15 @@ cmp {z1} beq {la1} !: bcc {la1} +//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuz2 +ldy {z2} +sec +lda {z1} +sbc {c1},y +sta {z1} +lda {z1}+1 +sbc {c1}+1,y +sta {z1}+1 //FRAGMENT _deref_(_deref_qbuc1)=pbuc2_derefidx_vbuz1 ldy {z1} lda {c2},y @@ -14839,6 +15117,22 @@ cmp {z1} beq {la1} !: bcc {la1} +//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuxx +sec +lda {z1} +sbc {c1},x +sta {z1} +lda {z1}+1 +sbc {c1}+1,x +sta {z1}+1 +//FRAGMENT vwuz1=vwuz1_minus_pwuc1_derefidx_vbuyy +sec +lda {z1} +sbc {c1},y +sta {z1} +lda {z1}+1 +sbc {c1}+1,y +sta {z1}+1 //FRAGMENT _deref_(_deref_qbuc1)=pbuc2_derefidx_vbuaa tay lda {c2},y @@ -15218,14 +15512,14 @@ tay lda {c2},y ldy {z1} sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuaa=pbuc2_derefidx_(_deref_pbuz1) -tax +//FRAGMENT pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1) ldy #0 lda ({z1}),y tay lda {c2},y sta {c1},x -//FRAGMENT pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1) +//FRAGMENT pbuc1_derefidx_vbuaa=pbuc2_derefidx_(_deref_pbuz1) +tax ldy #0 lda ({z1}),y tay @@ -15239,6 +15533,43 @@ lda ({z1}),y tay lda {c2},y sta {c1},x +//FRAGMENT qssz1=qssc1_plus_vwsz2 +lda #<{c1} +clc +adc {z2} +sta {z1} +lda #>{c1} +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pssz1=_deref_qssz2 +ldy #0 +lda ({z2}),y +sta {z1} +iny +lda ({z2}),y +sta {z1}+1 +//FRAGMENT _deref_pbuz1=pbuz2_derefidx_vbuc1 +ldy #{c1} +lda ({z2}),y +ldy #0 +sta ({z1}),y +//FRAGMENT qssz1=qssc1_plus_vwsz1 +lda #<{c1} +clc +adc {z1} +sta {z1} +lda #>{c1} +adc {z1}+1 +sta {z1}+1 +//FRAGMENT pssz1=_deref_qssz1 +ldy #0 +lda ({z1}),y +pha +iny +lda ({z1}),y +sta {z1}+1 +pla +sta {z1} //FRAGMENT vboz1=vboc1 lda #{c1} sta {z1} @@ -15260,12 +15591,6 @@ tax stx $ff cpy $ff bne {la1} -//FRAGMENT vwuz1=_deref_pbuz2_word__deref_pbuz3 -ldy #0 -lda ({z3}),y -sta {z1} -lda ({z2}),y -sta {z1}+1 //FRAGMENT vbuz1=vbuz2_minus_2 lda {z2} sec @@ -15732,54 +16057,68 @@ tay lda {c1},x //FRAGMENT vbsaa=pbsc1_derefidx_vbuyy lda {c1},y +//FRAGMENT vbuz1=_neg_vbuz2 +lda {z2} +eor #$ff +clc +adc #$01 +sta {z1} +//FRAGMENT vbuz1=_neg_vbuaa +eor #$ff +clc +adc #$01 +sta {z1} +//FRAGMENT vbuz1=_neg_vbuxx +dex +txa +eor #$ff +sta {z1} //FRAGMENT vbuz1=_neg_vbuyy dey tya eor #$ff sta {z1} +//FRAGMENT vbuaa=_neg_vbuz1 +lda {z1} +eor #$ff +clc +adc #$01 +//FRAGMENT vbuaa=_neg_vbuxx +dex +txa +eor #$ff //FRAGMENT vbuaa=_neg_vbuyy dey tya eor #$ff +//FRAGMENT vbuxx=_neg_vbuz1 +lda {z1} +eor #$ff +tax +inx +//FRAGMENT vbuxx=_neg_vbuaa +eor #$ff +tax +inx //FRAGMENT vbuxx=_neg_vbuyy tya eor #$ff tax inx -//FRAGMENT vbuz1=vbuz2_band_vbuz3 -lda {z2} -and {z3} -sta {z1} -//FRAGMENT vbuz1=vbuaa_band_vbuz2 -and {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_band_vbuz2 -lda {z2} -sax {z1} -//FRAGMENT vbuz1=vbuyy_band_vbuz2 -tya -and {z2} -sta {z1} -//FRAGMENT vbuz1=vbuz2_band_vbuxx -lda {z2} -sax {z1} -//FRAGMENT vbuz1=vbuaa_band_vbuxx -sax {z1} -//FRAGMENT vbuaa=vbuz1_band_vbuz2 +//FRAGMENT vbuyy=_neg_vbuz1 lda {z1} -and {z2} -//FRAGMENT vbuaa=vbuaa_band_vbuz1 -and {z1} -//FRAGMENT vbuaa=vbuxx_band_vbuz1 +eor #$ff +tay +iny +//FRAGMENT vbuyy=_neg_vbuaa +eor #$ff +tay +iny +//FRAGMENT vbuyy=_neg_vbuxx txa -and {z1} -//FRAGMENT vbuaa=vbuyy_band_vbuz1 -tya -and {z1} -//FRAGMENT vbuxx=vbuz1_band_vbuz2 -lda {z1} -and {z2} -tax +eor #$ff +tay +iny //FRAGMENT vbuxx=vbuaa_band_vbuz1 ldx {z1} axs #0 @@ -15790,10 +16129,6 @@ axs #0 ldx {z1} tya axs #0 -//FRAGMENT vbuyy=vbuz1_band_vbuz2 -lda {z1} -and {z2} -tay //FRAGMENT vbuyy=vbuaa_band_vbuz1 and {z1} tay @@ -15805,6 +16140,14 @@ tay tya and {z1} tay +//FRAGMENT vwuz1_eq_vwuc1_then_la1 +lda {z1} +cmp #<{c1} +bne !+ +lda {z1}+1 +cmp #>{c1} +beq {la1} +!: //FRAGMENT vdsz1=vdsz2_rol_4 lda {z2} sta {z1} @@ -15903,6 +16246,15 @@ sta {z1} lda {z1}+1 adc #0 sta {z1}+1 +//FRAGMENT vwsz1=vwsz1_ror_2 +lda {z1}+1 +cmp #$80 +ror {z1}+1 +ror {z1} +lda {z1}+1 +cmp #$80 +ror {z1}+1 +ror {z1} //FRAGMENT vwsz1=vwsc1_plus_vwsz1 clc lda {z1} @@ -16298,15 +16650,6 @@ iny lda {z1}+1 adc ({z2}),y sta {z1}+1 -//FRAGMENT pssz1=_deref_qssz1 -ldy #0 -lda ({z1}),y -pha -iny -lda ({z1}),y -sta {z1}+1 -pla -sta {z1} //FRAGMENT _deref_pbuz1_eq__deref_pbuz2_then_la1 ldy #0 lda ({z1}),y @@ -16474,13 +16817,6 @@ lda {z1} ldy {z2} ora {c1},y sta {z1} -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuz3 -ldy {z2} -lda {c1},y -ldy {z3} -clc -adc {c2},y -sta {z1} //FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc1_derefidx_vbuz3 ldy {z2} lda {c1},y @@ -16522,26 +16858,6 @@ tax tya ora {c1},y tay -//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 -ldy {z1} -lda {c1},y -ldy {z2} -clc -adc {c2},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 -ldx {z1} -lda {c1},x -ldx {z2} -clc -adc {c2},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 -ldy {z1} -lda {c1},y -ldy {z2} -clc -adc {c2},y -tay //FRAGMENT vbuz1=pbuc1_derefidx_vbuaa_plus_pbuc2_derefidx_vbuz2 tay lda {c1},y @@ -16569,75 +16885,6 @@ ldy {z1} clc adc {c2},y tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz2 -lda {c1},x -ldy {z2} -clc -adc {c2},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 -lda {c1},x -ldy {z1} -clc -adc {c2},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 -lda {c1},x -ldx {z1} -clc -adc {c2},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuz1 -lda {c1},x -ldy {z1} -clc -adc {c2},y -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz2 -lda {c1},y -ldy {z2} -clc -adc {c2},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 -lda {c1},y -ldy {z1} -clc -adc {c2},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 -lda {c1},y -ldx {z1} -clc -adc {c2},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuz1 -lda {c1},y -ldy {z1} -clc -adc {c2},y -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuxx -lda {c2},x -ldy {z2} -clc -adc {c1},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx -lda {c2},x -ldy {z1} -clc -adc {c1},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx -lda {c2},x -ldx {z1} -clc -adc {c1},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuxx -lda {c2},x -ldy {z1} -clc -adc {c1},y -tay //FRAGMENT vbuz1=pbuc1_derefidx_vbuaa_plus_pbuc2_derefidx_vbuxx tay lda {c1},y @@ -16661,67 +16908,6 @@ lda {c1},y clc adc {c2},x tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx -lda {c1},x -clc -adc {c2},x -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx -lda {c1},x -clc -adc {c2},x -//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx -lda {c1},x -clc -adc {c2},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuxx -lda {c1},x -clc -adc {c2},x -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx -lda {c1},y -clc -adc {c2},x -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx -lda {c1},y -clc -adc {c2},x -//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx -lda {c1},y -clc -adc {c2},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx -lda {c1},y -clc -adc {c2},x -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuyy -lda {c2},y -ldy {z2} -clc -adc {c1},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy -lda {c2},y -ldy {z1} -clc -adc {c1},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy -lda {c2},y -ldx {z1} -clc -adc {c1},x -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuyy -lda {c2},y -ldy {z1} -clc -adc {c1},y -tay //FRAGMENT vbuz1=pbuc1_derefidx_vbuaa_plus_pbuc2_derefidx_vbuyy tax lda {c1},x @@ -16745,44 +16931,6 @@ lda {c1},x clc adc {c2},y tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy -lda {c1},x -clc -adc {c2},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy -lda {c1},x -clc -adc {c2},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy -lda {c1},x -clc -adc {c2},y -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx_plus_pbuc2_derefidx_vbuyy -lda {c1},x -clc -adc {c2},y -tay -//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy -lda {c1},y -clc -adc {c2},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy -lda {c1},y -clc -adc {c2},y -//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy -lda {c1},y -clc -adc {c2},y -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuyy -lda {c1},y -clc -adc {c2},y -tay //FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc1_derefidx_vbuz2 ldy {z1} lda {c1},y @@ -17191,193 +17339,6 @@ lda {c1},y clc adc {c2},y tay -//FRAGMENT vbuz1=pbuz2_derefidx_(pbuz3_derefidx_vbuz4)_plus_pbuz5_derefidx_(pbuz6_derefidx_vbuz4) -ldy {z4} -lda ({z6}),y -sta $ff -lda ({z3}),y -tay -lda ({z2}),y -ldy $ff -clc -adc ({z5}),y -sta {z1} -//FRAGMENT vbuz1=vbuz1_bor_pbuc1_derefidx_vbuaa -tay -lda {c1},y -ora {z1} -sta {z1} -//FRAGMENT vbuxx=vbuxx_bor_pbuc1_derefidx_vbuaa -tay -txa -ora {c1},y -tax -//FRAGMENT vbuyy=vbuyy_bor_pbuc1_derefidx_vbuaa -tax -tya -ora {c1},x -tay -//FRAGMENT vbuaa=pbuz1_derefidx_(pbuz2_derefidx_vbuz3)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuz3) -ldy {z3} -lda ({z5}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z4}),y -//FRAGMENT vbuxx=pbuz1_derefidx_(pbuz2_derefidx_vbuz3)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuz3) -ldy {z3} -lda ({z5}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z4}),y -tax -//FRAGMENT vbuyy=pbuz1_derefidx_(pbuz2_derefidx_vbuz3)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuz3) -ldy {z3} -lda ({z5}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z4}),y -tay -//FRAGMENT vbuz1=pbuz2_derefidx_(pbuz3_derefidx_vbuaa)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuaa) -tay -lda ({z5}),y -sta $ff -lda ({z3}),y -tay -lda ({z2}),y -ldy $ff -clc -adc ({z4}),y -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_(pbuz2_derefidx_vbuaa)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuaa) -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -//FRAGMENT vbuxx=pbuz1_derefidx_(pbuz2_derefidx_vbuaa)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuaa) -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tax -//FRAGMENT vbuyy=pbuz1_derefidx_(pbuz2_derefidx_vbuaa)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuaa) -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tay -//FRAGMENT vbuz1=pbuz2_derefidx_(pbuz3_derefidx_vbuxx)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuxx) -txa -tay -lda ({z5}),y -sta $ff -lda ({z3}),y -tay -lda ({z2}),y -ldy $ff -clc -adc ({z4}),y -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_(pbuz2_derefidx_vbuxx)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuxx) -txa -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -//FRAGMENT vbuxx=pbuz1_derefidx_(pbuz2_derefidx_vbuxx)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuxx) -txa -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tax -//FRAGMENT vbuyy=pbuz1_derefidx_(pbuz2_derefidx_vbuxx)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuxx) -txa -tay -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tay -//FRAGMENT vbuz1=pbuz2_derefidx_(pbuz3_derefidx_vbuyy)_plus_pbuz4_derefidx_(pbuz5_derefidx_vbuyy) -lda ({z5}),y -sta $ff -lda ({z3}),y -tay -lda ({z2}),y -ldy $ff -clc -adc ({z4}),y -sta {z1} -//FRAGMENT vbuaa=pbuz1_derefidx_(pbuz2_derefidx_vbuyy)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuyy) -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -//FRAGMENT vbuxx=pbuz1_derefidx_(pbuz2_derefidx_vbuyy)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuyy) -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tax -//FRAGMENT vbuyy=pbuz1_derefidx_(pbuz2_derefidx_vbuyy)_plus_pbuz3_derefidx_(pbuz4_derefidx_vbuyy) -lda ({z4}),y -sta $ff -lda ({z2}),y -tay -lda ({z1}),y -ldy $ff -clc -adc ({z3}),y -tay //FRAGMENT _deref_pbuc1=_deref_(_deref_qbuc2) ldy {c2} sty $fe @@ -17899,6 +17860,21 @@ iny lda ({z2}),y sbc ({z3}),y sta {z1}+1 +//FRAGMENT vbuz1=vbuz1_bor_pbuc1_derefidx_vbuaa +tay +lda {c1},y +ora {z1} +sta {z1} +//FRAGMENT vbuxx=vbuxx_bor_pbuc1_derefidx_vbuaa +tay +txa +ora {c1},y +tax +//FRAGMENT vbuyy=vbuyy_bor_pbuc1_derefidx_vbuaa +tax +tya +ora {c1},x +tay //FRAGMENT vduz1=vduz2_plus_vwuz3 lda {z2} clc @@ -18020,6 +17996,14 @@ lda #0 !: adc #>{c1} sta {z1}+1 +//FRAGMENT vwsz1=vwsz1_minus_vwsz2 +lda {z1} +sec +sbc {z2} +sta {z1} +lda {z1}+1 +sbc {z2}+1 +sta {z1}+1 //FRAGMENT vbuaa_gt_vbuz1_then_la1 cmp {z1} beq !+ @@ -18238,6 +18222,14 @@ sta {c1},x //FRAGMENT pbsc1_derefidx_vbuyy=vbsc2 lda #{c2} sta {c1},y +//FRAGMENT _deref_pwuc1=_deref_pwuc1_plus_vwuc2 +lda #<{c2} +clc +adc {c1} +sta {c1} +lda #>{c2} +adc {c1}+1 +sta {c1}+1 //FRAGMENT vbuz1=vbuz2_plus__deref_pbuc1 lda {c1} clc @@ -18986,31 +18978,3 @@ bmi !+ lda #0 !: sta {z1}+1 -//FRAGMENT qssz1=qssc1_plus_vwsz2 -lda #<{c1} -clc -adc {z2} -sta {z1} -lda #>{c1} -adc {z2}+1 -sta {z1}+1 -//FRAGMENT pssz1=_deref_qssz2 -ldy #0 -lda ({z2}),y -sta {z1} -iny -lda ({z2}),y -sta {z1}+1 -//FRAGMENT _deref_pbuz1=pbuz2_derefidx_vbuc1 -ldy #{c1} -lda ({z2}),y -ldy #0 -sta ({z1}),y -//FRAGMENT qssz1=qssc1_plus_vwsz1 -lda #<{c1} -clc -adc {z1} -sta {z1} -lda #>{c1} -adc {z1}+1 -sta {z1}+1 diff --git a/src/main/fragment/cache/fragment-cache-rom6502x.asm b/src/main/fragment/cache/fragment-cache-rom6502x.asm index 04c9a87f1..9e43c5892 100644 --- a/src/main/fragment/cache/fragment-cache-rom6502x.asm +++ b/src/main/fragment/cache/fragment-cache-rom6502x.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //FRAGMENT _deref_pbuc1=_inc__deref_pbuc1 inc {c1} //FRAGMENT isr_hardware_all_entry diff --git a/src/main/fragment/cache/fragment-cache-wdc65c02.asm b/src/main/fragment/cache/fragment-cache-wdc65c02.asm index 07dafba49..9aecf16be 100644 --- a/src/main/fragment/cache/fragment-cache-wdc65c02.asm +++ b/src/main/fragment/cache/fragment-cache-wdc65c02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE fdb40b9db fdb40d86d +//KICKC FRAGMENT CACHE f0802c8e6 f0802e789 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} @@ -2969,6 +2969,166 @@ sta {z1}+3 //FRAGMENT vbuz1=vbuaa_bor_vbuz1 ora {z1} sta {z1} +//FRAGMENT _deref_pssc1=_deref_pssc2_memcpy_vbuc3 +ldy #{c3} +!: +lda {c2}-1,y +sta {c1}-1,y +dey +bne !- +//FRAGMENT vduz1=vwsc1 +NO_SYNTHESIS +//FRAGMENT _deref_pwuc1=vbuc2 +lda #0 +sta {c1}+1 +lda #<{c2} +sta {c1} +//FRAGMENT vwuz1=vwuz2_bor_vbuz3 +lda {z3} +ora {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_ror_5 +lda {z2}+1 +lsr +sta {z1}+1 +lda {z2} +ror +sta {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +//FRAGMENT vwuz1=vwuz2_rol_3 +lda {z2} +asl +sta {z1} +lda {z2}+1 +rol +sta {z1}+1 +asl {z1} +rol {z1}+1 +asl {z1} +rol {z1}+1 +//FRAGMENT vbuz1=_byte_vwuz2 +lda {z2} +sta {z1} +//FRAGMENT vwuz1=vwuz2_band_vwuc1 +lda {z2} +and #<{c1} +sta {z1} +lda {z2}+1 +and #>{c1} +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vwuc1 +clc +lda {z2} +adc #<{c1} +sta {z1} +lda {z2}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT pbuz1_neq_vwuc1_then_la1 +lda {z1}+1 +cmp #>{c1} +bne {la1} +lda {z1} +cmp #<{c1} +bne {la1} +//FRAGMENT _deref_pbuz1=vbuc1 +lda #{c1} +ldy #0 +sta ({z1}),y +//FRAGMENT 0_neq__deref_pbuz1_then_la1 +ldy #0 +lda ({z1}),y +cmp #0 +bne {la1} +//FRAGMENT vwuz1=vwuz2_bor_vbuxx +txa +ora {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_bor_vbuyy +tya +ora {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vwuz1=_word_vbuaa +sta {z1} +lda #0 +sta {z1}+1 +//FRAGMENT vbuaa=_byte_vwuz1 +lda {z1} +//FRAGMENT vbuxx=_byte_vwuz1 +lda {z1} +tax +//FRAGMENT vbuyy=_byte_vwuz1 +lda {z1} +tay +//FRAGMENT vduz1=vduz2_plus_vduz1 +lda {z1} +clc +adc {z2} +sta {z1} +lda {z1}+1 +adc {z2}+1 +sta {z1}+1 +lda {z1}+2 +adc {z2}+2 +sta {z1}+2 +lda {z1}+3 +adc {z2}+3 +sta {z1}+3 +//FRAGMENT pbuz1=pbuz1_plus_vwuc1 +clc +lda {z1} +adc #<{c1} +sta {z1} +lda {z1}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vwuz1=vwuz1_rol_8 +lda {z1} +sta {z1}+1 +lda #0 +sta {z1} +//FRAGMENT vwuz1=vwuz1_bor_vbuxx +txa +ora {z1} +sta {z1} +//FRAGMENT vwuz1=vwuz1_rol_3 +asl {z1} +rol {z1}+1 +asl {z1} +rol {z1}+1 +asl {z1} +rol {z1}+1 +//FRAGMENT vwuz1=vwuz1_band_vwuc1 +lda {z1} +and #<{c1} +sta {z1} +lda {z1}+1 +and #>{c1} +sta {z1}+1 +//FRAGMENT vwuz1=vwuz1_ror_5 +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} +lsr {z1}+1 +ror {z1} //FRAGMENT vbuz1=_deref_pbuc1_band__deref_pbuc2 lda {c1} and {c2} @@ -2986,10 +3146,6 @@ sta {z1} lda {z2}+1 adc #0 sta {z1}+1 -//FRAGMENT _deref_pbuz1=vbuc1 -lda #{c1} -ldy #0 -sta ({z1}),y //FRAGMENT vbuz1=pbuz2_derefidx_vbuz3 ldy {z3} lda ({z2}),y @@ -3017,10 +3173,6 @@ tay //FRAGMENT pbuc1_derefidx_vbuaa=vbuaa tax sta {c1},x -//FRAGMENT vwuz1=_word_vbuaa -sta {z1} -lda #0 -sta {z1}+1 //FRAGMENT vbuz1_lt_vbuaa_then_la1 cmp {z1} beq !+ @@ -3162,6 +3314,84 @@ cpy {z1} beq !+ bcs {la1} !: +//FRAGMENT isr_rom_sys_cx16_entry + +//FRAGMENT vwuz1_neq_vbuc1_then_la1 +NO_SYNTHESIS +//FRAGMENT vbuz1_lt_vbuc1_then_la1 +lda {z1} +cmp #{c1} +bcc {la1} +//FRAGMENT isr_rom_sys_cx16_exit +jmp $e034 +//FRAGMENT _deref_pwuc1=_deref_pwuz1 +ldy #0 +lda ({z1}),y +sta {c1} +iny +lda ({z1}),y +sta {c1}+1 +//FRAGMENT pbuz1=pbuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT vwuz1=vwuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT vwuz1_lt_vbuc1_then_la1 +lda {z1}+1 +bne !+ +lda {z1} +cmp #{c1} +bcc {la1} +!: +//FRAGMENT vwuz1=vwuz1_minus_vbuc1 +sec +lda {z1} +sbc #{c1} +sta {z1} +lda {z1}+1 +sbc #0 +sta {z1}+1 +//FRAGMENT _deref_qprc1=pprc2 +lda #<{c2} +sta {c1} +lda #>{c2} +sta {c1}+1 +//FRAGMENT _deref_pwuc1=_deref_pwuc1_plus_vbuc2 +NO_SYNTHESIS +//FRAGMENT _deref_pwuc1=_deref_pwuc1_plus_vbsc2 +NO_SYNTHESIS +//FRAGMENT _deref_pwuc1=_deref_pwuc1_plus_vwuc2 +lda #<{c2} +clc +adc {c1} +sta {c1} +lda #>{c2} +adc {c1}+1 +sta {c1}+1 +//FRAGMENT pbuz1_neq_pbuz2_then_la1 +lda {z1}+1 +cmp {z2}+1 +bne {la1} +lda {z1} +cmp {z2} +bne {la1} +//FRAGMENT vbuaa_lt_vbuc1_then_la1 +cmp #{c1} +bcc {la1} +//FRAGMENT vbuxx_lt_vbuc1_then_la1 +cpx #{c1} +bcc {la1} //FRAGMENT vbuz1=vbuz2_plus_1 lda {z2} inc @@ -3215,8 +3445,6 @@ lda #<{c1} sta {z1} lda #>{c1} sta {z1}+1 -//FRAGMENT isr_rom_sys_cx16_entry - //FRAGMENT vwsz1=vwsz1_plus_vwsz2 lda {z1} clc @@ -3263,13 +3491,6 @@ ldy {c1}+1 sty $ff ldy #0 sta ($fe),y -//FRAGMENT isr_rom_sys_cx16_exit -jmp $e034 -//FRAGMENT _deref_qprc1=pprc2 -lda #<{c2} -sta {c1} -lda #>{c2} -sta {c1}+1 //FRAGMENT vbuz1=_deref_(_deref_qbuc1) ldy {c1} sty $fe @@ -3826,48 +4047,6 @@ sta {z1}+2 lda {z2}+3 adc #0 sta {z1}+3 -//FRAGMENT vwuz1=vwuz2_bor_vbuz3 -lda {z3} -ora {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -//FRAGMENT vwuz1=vwuz2_ror_5 -lda {z2}+1 -lsr -sta {z1}+1 -lda {z2} -ror -sta {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -//FRAGMENT vwuz1=vwuz2_rol_3 -lda {z2} -asl -sta {z1} -lda {z2}+1 -rol -sta {z1}+1 -asl {z1} -rol {z1}+1 -asl {z1} -rol {z1}+1 -//FRAGMENT vbuz1=_byte_vwuz2 -lda {z2} -sta {z1} -//FRAGMENT vwuz1=vwuz2_band_vwuc1 -lda {z2} -and #<{c1} -sta {z1} -lda {z2}+1 -and #>{c1} -sta {z1}+1 //FRAGMENT vwuz1=vwuz2_plus_vwuc1 clc lda {z2} @@ -3890,10 +4069,6 @@ sta {z1}+2 lda {z1}+3 adc #0 sta {z1}+3 -//FRAGMENT vbuz1_lt_vbuc1_then_la1 -lda {z1} -cmp #{c1} -bcc {la1} //FRAGMENT vbuz1=_byte_vduz2 lda {z2} sta {z1} @@ -3938,29 +4113,6 @@ sta {z1}+2 lda {z1}+3 sbc {z2}+3 sta {z1}+3 -//FRAGMENT vwuz1=vwuz2_bor_vbuxx -txa -ora {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -//FRAGMENT vwuz1=vwuz2_bor_vbuyy -tya -ora {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -//FRAGMENT vbuaa=_byte_vwuz1 -lda {z1} -//FRAGMENT vbuxx=_byte_vwuz1 -lda {z1} -tax -//FRAGMENT vbuyy=_byte_vwuz1 -lda {z1} -tay -//FRAGMENT vbuaa_lt_vbuc1_then_la1 -cmp #{c1} -bcc {la1} //FRAGMENT vbuaa=_byte_vduz1 lda {z1} //FRAGMENT vbuxx=_byte_vduz1 @@ -4040,46 +4192,9 @@ lda {c1}+2,y sta {z1}+2 lda {c1}+3,y sta {z1}+3 -//FRAGMENT vbuxx_lt_vbuc1_then_la1 -cpx #{c1} -bcc {la1} //FRAGMENT vbuyy_ge_vbuz1_then_la1 cpy {z1} bcs {la1} -//FRAGMENT vwuz1=vwuz1_rol_8 -lda {z1} -sta {z1}+1 -lda #0 -sta {z1} -//FRAGMENT vwuz1=vwuz1_bor_vbuxx -txa -ora {z1} -sta {z1} -//FRAGMENT vwuz1=vwuz1_rol_3 -asl {z1} -rol {z1}+1 -asl {z1} -rol {z1}+1 -asl {z1} -rol {z1}+1 -//FRAGMENT vwuz1=vwuz1_band_vwuc1 -lda {z1} -and #<{c1} -sta {z1} -lda {z1}+1 -and #>{c1} -sta {z1}+1 -//FRAGMENT vwuz1=vwuz1_ror_5 -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} -lsr {z1}+1 -ror {z1} //FRAGMENT isr_rom_min_cx16_entry //FRAGMENT vbuz1_ge_vbuc1_then_la1 diff --git a/src/main/fragment/mos6502-common/vwum1=vwuc1_minus__deref_pwuc2.asm b/src/main/fragment/mos6502-common/vwum1=vwuc1_minus__deref_pwuc2.asm new file mode 100644 index 000000000..ee45954b2 --- /dev/null +++ b/src/main/fragment/mos6502-common/vwum1=vwuc1_minus__deref_pwuc2.asm @@ -0,0 +1,7 @@ +sec +lda #<{c1} +sbc {c2} +sta {m1} +lda #>{c1} +sbc {c2}+1 +sta {m1}+1 diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 14d79682c..b095679b1 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -49,6 +49,11 @@ public class TestPrograms { assertError("problem-arraysize-decl.c", "BAR is not constant or is not defined"); } + @Test + public void testComplexBorderlinePacman() throws IOException, URISyntaxException { + compileAndCompare("complex/borderline_pacman/pacman.c"); + } + @Test public void testComplexNew30YearsLowResolution() throws IOException, URISyntaxException { compileAndCompare("complex/new_30_years_low_resolution/new_30_years_low_resolution.c"); diff --git a/src/test/kc/complex/borderline_pacman/byteboozer.c b/src/test/kc/complex/borderline_pacman/byteboozer.c new file mode 100644 index 000000000..fb2de1d1f --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/byteboozer.c @@ -0,0 +1,18 @@ +// ByteBoozer decruncher +// https://github.com/p-a/kickass-cruncher-plugins + +// Decrunch crunched data using ByteBoozer +// - crunched: Pointer to the start of the crunched data +void byteboozer_decrunch(char* crunched) { + asm { + ldy crunched + ldx crunched+1 + jsr b2.Decrunch + } +} + +// The byteboozer decruncher +export char BYTEBOOZER[] = kickasm(resource "byteboozer_decrunch.asm") {{ + .const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" +}}; \ No newline at end of file diff --git a/src/test/kc/complex/borderline_pacman/byteboozer.h b/src/test/kc/complex/borderline_pacman/byteboozer.h new file mode 100644 index 000000000..7fabd299e --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/byteboozer.h @@ -0,0 +1,6 @@ +// ByteBoozer decruncher +// https://github.com/p-a/kickass-cruncher-plugins + +// Decrunch crunched data using ByteBoozer +// - crunched: Pointer to the start of the crunched data +void byteboozer_decrunch(char* crunched); diff --git a/src/test/kc/complex/borderline_pacman/byteboozer_decrunch.asm b/src/test/kc/complex/borderline_pacman/byteboozer_decrunch.asm new file mode 100644 index 000000000..a5ae4daca --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/byteboozer_decrunch.asm @@ -0,0 +1,182 @@ +// ByteBoozer Decruncher /HCL May.2003 +// B2 Decruncher December 2014 + +.importonce +.filenamespace b2 + +// You must set .const B2_ZP_BASE prior the import of this file +.if (B2_ZP_BASE > $ff) { + .error "B2_ZP_BASE must be in zeropage. Was $" + toHexString(B2_ZP_BASE,4) +} + + +.label zp_base = B2_ZP_BASE +.label bits = zp_base +.label put = zp_base + 2 + +.macro @B2_DECRUNCH(addr) { + ldy #addr + jsr b2.Decrunch +} + +.macro GetNextBit() { + asl bits + bne DgEnd + jsr GetNewBits +DgEnd: +} + +.macro GetLen() { + lda #1 +GlLoop: + :GetNextBit() + bcc GlEnd + :GetNextBit() + rol + bpl GlLoop +GlEnd: +} + +Decrunch: + sty Get1+1 + sty Get2+1 + sty Get3+1 + stx Get1+2 + stx Get2+2 + stx Get3+2 + + ldx #0 + jsr GetNewBits + sty put-1,x + cpx #2 + bcc *-7 + lda #$80 + sta bits +DLoop: + :GetNextBit() + bcs Match +Literal: + // Literal run.. get length. + :GetLen() + sta LLen+1 + + ldy #0 +LLoop: +Get3: + lda $feed,x + inx + bne *+5 + jsr GnbInc +L1: sta (put),y + iny +LLen: + cpy #0 + bne LLoop + + clc + tya + adc put + sta put + bcc *+4 + inc put+1 + + iny + beq DLoop + + // Has to continue with a match.. + +Match: + // Match.. get length. + :GetLen() + sta MLen+1 + + // Length 255 -> EOF + cmp #$ff + beq End + + // Get num bits + cmp #2 + lda #0 + rol + :GetNextBit() + rol + :GetNextBit() + rol + tay + lda Tab,y + beq M8 + + // Get bits < 8 +M_1: + :GetNextBit() + rol + bcs M_1 + bmi MShort +M8: + // Get byte + eor #$ff + tay +Get2: + lda $feed,x + inx + bne *+5 + jsr GnbInc + jmp Mdone +MShort: + ldy #$ff +Mdone: + //clc + adc put + sta MLda+1 + tya + adc put+1 + sta MLda+2 + + ldy #$ff +MLoop: + iny +MLda: + lda $beef,y + sta (put),y +MLen: + cpy #0 + bne MLoop + + //sec + tya + adc put + sta put + bcc *+4 + inc put+1 + + jmp DLoop + +End: + rts + +GetNewBits: +Get1: + ldy $feed,x + sty bits + rol bits + inx + bne GnbEnd +GnbInc: + inc Get1+2 + inc Get2+2 + inc Get3+2 +GnbEnd: + rts + +Tab: + // Short offsets + .byte %11011111 // 3 + .byte %11111011 // 6 + .byte %00000000 // 8 + .byte %10000000 // 10 + // Long offsets + .byte %11101111 // 4 + .byte %11111101 // 7 + .byte %10000000 // 10 + .byte %11110000 // 13 diff --git a/src/test/kc/complex/borderline_pacman/code-merger.c b/src/test/kc/complex/borderline_pacman/code-merger.c new file mode 100644 index 000000000..ee59066ff --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/code-merger.c @@ -0,0 +1,95 @@ +// Cycle-based code merger +// Usable for merging unrolled cycle-exact logic code into an unrolled cycle-exact raster code. + + +// Merge unrolled cycle-exact logic code into an unrolled cycle-exact raster code. +// The logic-code is merged into the raster code ensuring cycle-exact execution. If a logic-code block does not fit within the remaining cycle-budget of a raster-slot then NOPs/BIT $EA are used to reach the cycle-budget. +// If the logic-code runs out before the raster-code ends then the remaining raster-slots are filled with NOP/BIT$EA. +// If the raster-code runs out before the logic-code then the rest of the logic-code is added at the end. +// An RTS is added at the very end. +// +// Parameters: +// - dest_code: Address where the merged code is placed +// - raster_code: The unrolled raster code blocks with information about cycles to be filled. Format is decribed below. +// - logic_code: The unrolled logic code with information about cycles spent. Format is decribed below. +// +// Format of unrolled raster code. +// A number of blocks that have the following structure: +// * 0xff +// * : some bytes of code. any number of bytes are allowed. +// 0xff : signals the end of a block. +// : If is 00 then this is the last block of the unrolled raster code. +// If is non-zero it means that cycles must be spent here (the cycle budget of the slot). The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed. +// +// Format of unrolled logic code. +// A number of blocks that has the following structure: +// * 0xff +// : If is 00 then this is the last block of the unrolled logic code. No more bytes are used. +// If is non-zero it holds the number of cycles used by the block of code. +// * : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by +// 0xff : signals the end of a block. +void merge_code(char* dest_code, char* raster_code, char * logic_code) { + + // Cycle-count signalling the last block of the logic-code + const char LOGIC_EXIT = 0x00; + // Value signalling the end of a block of the logic-code + const char LOGIC_END = 0xff; + // Cycle-count signalling the last block of the raster-code + const char RASTER_EXIT = 0x00; + // Value signalling the end of a block of the raster-code + const char RASTER_END = 0xff; + + for(;;) { + // Output raster code until meeting RASTER_END signalling the end of a block + while(*raster_code!=RASTER_END) *dest_code++ = *raster_code++; + // move past the end marker (RASTER_END) + raster_code++; + // Find the number of cycles + char cycle_budget = *raster_code++; + if(cycle_budget==RASTER_EXIT) + // This is the end of the raster code. + break; + // Fit the cycle budget with logic-code + while(cycle_budget>0) { + // Find the number of logic code cycles + char logic_cycles = *logic_code; + // Check if logic code exists and fits the cycle-budget (ensure that it does not leave a single cycle in the budget) + if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget)) { + // Skip the cycle count + logic_code++; + // Fill in the logic-code + while(*logic_code!=LOGIC_END) *dest_code++ = *logic_code++; + // move past the end marker (LOGIC_END) + logic_code++; + // Reduce the cycle budget + cycle_budget -= logic_cycles; + // Move to the next logic block + continue; + } + // No more logic-code or not enough room in the budget + break; + } + // Fit the cycle budget with NOPs + while(cycle_budget>0) { + if(cycle_budget==3) { + *dest_code++ = 0x24; // BIT $EA + *dest_code++ = 0xEA; + cycle_budget -= 3; + } else { + *dest_code++ = 0xEA; // NOP + cycle_budget -= 2; + } + } + } + // No more raster code - fill in the rest of the logic code + while(*logic_code!=LOGIC_EXIT) { + // Skip the cycle count + logic_code++; + // Fill in the logic-code + while(*logic_code!=LOGIC_END) *dest_code++ = *logic_code++; + // move past the end marker (LOGIC_END) + logic_code++; + } + // And add an RTS + *dest_code++ = 0x60; // RTS +} diff --git a/src/test/kc/complex/borderline_pacman/pacman-2chn-simpler.prg b/src/test/kc/complex/borderline_pacman/pacman-2chn-simpler.prg new file mode 100644 index 0000000000000000000000000000000000000000..ce427523a4bdcfc1d798f9d1c47d7743d9702c49 GIT binary patch literal 1799 zcmZuweQZ-z6ublSQ9>te^AqBNuJzoOMMJoG@1Bo) z&hK~5x$hB<|I5P@nj|gLl6P3+XKqqC2;vkKZ&5h}ZnJosCe`8$6+1!f z0x~sAVv%(9|$yrw+30`z*UTo8gR7i6vT`*#zo^vTn}Cko+Nao23WLAuUoxn+@l5 z=*#J49Y{vFd=$~;2UMEFR;5lrZtP%sfu=iwtCum*nNca$3{iTq5CF*s$)e;3zQx1u zXv>h?qKv4`*|74IeZ&Y;)u0$L&;fk973Cu3FIHr-#Q)ryEaD~?sO4$*T1gF9=VWR- zNE-k{t&r*mcSNd%v>H;~fMls&#+P~pq&61e0Lcc)60*xB%4zuL+uU8)_GD@R+{#v5 zlc`^*IMj?^i*nL)jg#A0gvoJ|1~NOwE51}$Zm|S z2Mm&1V8jI&#~0er>swm(E-ic0)mR^09H4l!2D+%HhnM6A$O>+P2$M%R!{()d0)M_u zZUVO|SIeOH6e`GjmKgAS8Tig4-yP;d0CxoYn{q)+S8QTMHn8F1N14@FtgI)CQibDn zt4sp#@KgrP+yTXiB`ccg7Qp*)EBLWm8E>_`f${DocxC(>9<+RS3ip^bT?>}_zQjGe%UVXlY8l1M6m~@(klK+eg?S^|TjDyGa z=XZ-Y@n>Q`a5BJl)qhJ}SsJ#qxO6(5UavP8j7F2Gs%pi`RjaDa7VGMo+B%!v;jCZl zdakkA{lfZI>V2^@xM@q@_Wqsk4h|joWb})#$G<N68uIj_+=_9K70m`0nc$y+3*{_5V5EXUZKvG&DGL1n*u~;gVh*@Xq*PCVyCk=*RG-wT4$(zJzA)^R*ij2R8j4INo(L_Frj{`s={p)q& z3=MsA?mAk~URep1QKe;Xi6oFzr#G0YP*s=6M0A6{-Q#Z;Jeg=%AW^QvOFO&*%^V6x z5~H?ggYDQTmq3viwMQH6Wy9VW5lG~*Oizr)L4a6$+$(rvzW7GL{{)P>=(BZYjMdLP z4$u?Z9N#2tioG1~7P@1hcu)vr!f}7(c(kWyf}w@|v5pvuC>7dc-gvvfWx|ZrgUX@s zi73ZaV!HxDH%9dc+hY8ynQ$K-M)_W0TiF+SLQ&?Z(_Ajf?0f=SKnTUU;~}8~^Zg-K gRJ6-~;t`h+h;_yN<-KEBF9)>a2*Xj2u#WNl3lyHOV*mgE literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-bobs.ase b/src/test/kc/complex/borderline_pacman/pacman-bobs.ase new file mode 100644 index 0000000000000000000000000000000000000000..8da5328c93aa38c1279b3e0f67ac50add2f20ed2 GIT binary patch literal 1701 zcmcJPeN0nV7>6&L&cC)UV{tmAbh=H)GNmB6LR+Sbc7tg*4Kz$D^J5})LhuXe=dzig z&a_cc1c4e{SE0~umcpRWCY!MYg=z@xT9D4s(qg|xOR2ZF?cED%WdAPNNzQXm&OLd5 z&wFxnWiKJfpRxqx8uAH3LJ|-J>4*7zz~0;@vIv2L|HF6(%0{La&!;Yi`b%LhAy62PkBqq#zq;t9Tb^xpn~P`@J5B1u}tkj?aM{ zT`F*6O&Kt+bUkoK-rK-5Dg~I6a}1dJ)px*MWeuf?x+~;001(1UhprI1Uz|0QnFO$q);f5C~}yl{}Y3dJ*_+fC91v`D{c>JQ-iKAf^Q)%F>O1={sDhWx` zn4yzN)z*shcqCYeT4M6;Q=#dy2F~a%8Ifb$7zwl6n+|j_8(pzS>)gQ`{3+W;E%D~4 zT#SvV1LiQpiF$mxVc}36>Z0xt38*xJiJqfOQ=Kp}3~Cl#fy;T;+HRq87OgO2ot|hY zW`Pvv$0{!WO}RDr<$OxkD~gd}&n$XROJsHH+Age5s`haE%cKM!%b_1Awk0<@zmKg% zRe}5Hk8x{_sc?6`{;?vSLmd&dT4Qyt;Dj=K*n+w-bx@6odd5SKH*D89yK-sg ze9oPiCB~8*J=bc;SFTss^9-x!n#gIy^3h_4$}bs`4hh9ks9zIux%oA4_e%WfCNHN#u2V@f$*aVALIuL8+ ze;SX(UC|bgv%l7UJ(w38ITII0>wk!sF?1i`^?p^6H(EZJ&MIYZHE1$KwTeC=Bd7_# z(HAsNjP(&4OT@0@M`o%0SrSj^;HA*Flw3FY5WVe!o=1CMMKoR`Itm$wA8av@xhuWS zPG&LFy~i7|^ymf*f!RV4p*@^o#=DI5Jlh}K#-ojQN3=w>bCaoRzlxz~ThcMbmJ|l} zT;h9en#$cY-!|GnxPO@8=eE&&!|2@}da2%Dar!+r;gEUI6w0Sx?lSgtnXr28!jk0H zg(Yvn9k-!B=f-`ZwqEYoMQ)A1PCj^p+sk9~c54jxg=JVr3!A_*tD;wW1tywi+)Rz> z1*S3Vw#nV#wijJ@lX=Abjf`1t#{l=EZ*<}(^>j1-j1(0y+)Q*Z>}QsZA zk|a%NS)Xo3M;{!LT1As7?FRQ_Q)ePgJbQFhu9EvH9DOy1UF--C4gVCv9%?HZVk=ks zDS=A(PMHr%sD1d%!^m3OYG(5FN7EgG+rt<$xz9cAJKo}|=#Y-m1vS2_mxaD8aeHvH z&`2fALirKY<6Kr{JfFQHUn2LVi(Rz>qTC=SA>3zin zoWrqBr7FO4w(P`cw=-B-VzqRioyPDTJVvvY(A4;?U+Dvq{={?zkvTeNcI%w-d4*>` Pk^lZo{f&^Fcs%nTB5^ba literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-bobs.c b/src/test/kc/complex/borderline_pacman/pacman-bobs.c new file mode 100644 index 000000000..0f4bc232e --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-bobs.c @@ -0,0 +1,63 @@ +// BOB data: One table per bob byte (left/right, mask/pixels = 4 tables). The index into the table is the bob_id + row*BOB_ROW_SIZE. +char BOB_GRAPHICS_CRUNCHED[] = kickasm(resource "pacman-bobs.png", uses BOB_MASK_LEFT) {{ + .modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } +}}; + + + + diff --git a/src/test/kc/complex/borderline_pacman/pacman-bobs.png b/src/test/kc/complex/borderline_pacman/pacman-bobs.png new file mode 100644 index 0000000000000000000000000000000000000000..1163ac804257cc5ddbd886e66dd6314eef97d209 GIT binary patch literal 1080 zcmV-81jqY{P)002k`1^@s6aoGOC00001b5ch_0Itp) z=>Px&@<~KNRCt{2n=x)wF%X8m2#KpuuY^!KQgMe|fi6WvPC%4`jw__&4A3Ejl$u*m zrwY}CT@%|g_RQMz=Ks3Q?!WfD%=5nQ>3Mf^wtq}1rH?=E(;+u!`^15A-|jDu{(ipy z%*qqUUv}lR^Tes@-=&luYaeJe;@dCps_(ZZl21H(o<7fQDD8ZXb^c}bT?VBAS`#bf zxj8F(SCHPEHlxQcZ(wVN8<6Oo@a%@m>HR4g{RxZ8a09N^K&#MuP3HZ0N>|VwBn0`x z{HZ1AsR0RTBj%r9?QKa~Xi*MJ1K5liy2%7OHr-?|MqSHPUS5nC%@&Z;)HYJTfB ztS%w2;jx@HtJ|=80}`-d*f57>Zo_OH*zogpKthnO=B*{D*nmW<5nIx-%7OHr->MC> zSHK)qp5Lksn@I?4cr2&Qsy1xafCOw9He6%5+b~-PHhf$MBm{X@-b#Yh z9?6$BW)AXwdHM(c{O~=c^lzK2^b(;rKg#gFV1gztErhbR1J1TFjPJ{a%^u13YLnjc-fUQXUodPKHY~yXiD=j` zY`BJ51Hy)3!yI72M!<%7m^I*R8^icMY}ovfe6Kd?J@3Va&GrSuhGD}T%&!4q!?58R z<_!oNh7H$%1sek!u4CSSvuzCHuWiF>`-0!RzCQZHgzj^-u1#|CoOJwr z-qP`-*WZi!zTnw5hP*EuR@)am+s2UhX~XI_qNCej^!lZ!H(+!dj9$MKbqgk<+hFwi zxu~yz(QPn#{Zh>K1<$rI!P21y1521W)3h7=%102T&DkRXEq5Yhq&0qy_wkriw!E6@TlAZAwp zTZv?y5s)pZzycKkYC#4685m48DuLwwb45V1!_w$K$Q+>CK?GP5C<7Fh2Z<^m>jx@l zU}x}2tV}IZFl=RFU|>}MiU7fXAR7WeK~pj3?Mz?4BL+OJ)iT#SbaseY=N(wPgE5?m zH^^jCYvuX+(%T;&>00>;AFrH0xolhR?|W{GyI+5PeRk=)9qx<0GVAIqtNvg8RU2D= z+*<0b;>-VEt*dQ+AAfP`)4b(v{THXIe(!ylY_dzcyZd2siEHLRIXk!XYgXd5d+h#e zeyR1e4qy9Qhy8U`@9nwMFTPOg<(?*dr2Wh89QFD8ndFViuRY)MJ+QiLt?~1&V+qM! z-;!gUx8!elobj9K5mVu%w}t)JWVYPdl%2S@|JLapCXstuoiyYx?Uj{chS^pVg1<(spge6_#L|A@JA z#zW;-(W}=7uDN(8{9|IT@YC>bx8MHsu@m^5p?h=Ii?0{v)ugN}%0KgDan#*==N~xD z=H5N+R_(UfDenmAeqaXKNY0BCko!#_(&%39| zw((~@&6x%5E^HV1W_d06&CT#`?d<<6KI~qWCGUFw^xmJ#roG?%X_Y^`4rP%GR^R=FD>EGfdxU)Kr{%bgwj}cjhnI`JazspHtB4;={)1l zf?s!U-#eW@ZSBpkvDY{8zqP!=cl6XVgX1^@s6bUI-a00001b5ch_0Itp) z=>Px&j7da6RCt{2oIP&aKoEtW0t2dj3)cdKAYD}X0P1vwbSZ@R1PN5Q%N5l50I8hL z2n4A1EnK^b3+9F4kfWJh?lL5?Ut`GHpIPp_*_~b53jn`SD9oJ4^XI5~SBdQ?6h?&< z#%6U709fDL0RRriR{+3%w*&y3p1(HA7l9OJ2?YRD0-!J`n9Yhps6JB|Qcw$&EmmQM z#BQl1Wd$kB3b}Ihr3j=jE0|NH;$70#3WbreS>6B5KVm2=NMRIkYqY)o(fR$u%PoNR zDU+-pyS0)@{I5?x0Th80MuH}c*7tvepb15T4*%up44|FFYXY0}Db}|StHx&z-dj&A zZ+&l-mv(7*+wW>q*46q9wMoOEYtyVj7Orfi9tgzO`R!h#km8i=c zgyWioK(u91z9t}rVxespLfawISz?YHy<_c53S0jr_L;>}KacL*A@rh9`T~VF34vHh z=dq%fHkq0e^5HR>T6X+Tyf&n=HMMYK`?s(JBj=XoM=g-hC?Jgi#;T^3i?vm*-m!VwP^Vws;8fpjRZLPKLkpsBf7UIx2YF6U zhdLScyyb{DkF!qvykp~vAnlWO$gPzZ+UI@OOV0JE1tOioBGi#{3$32iCS8-Hja9qA zIz69V<+QDp*H&+SHuOD+m-d#_SB{KYAYLpX4SmF^_2a##0os2%&5N+mJ-F4EWvfN# z9aJp2au4gEW)cFiqN_!&laA1KJ(JuXYx8fa!)=Qr$Jlb>4T3z(;NgPBq~GQ(%$LwN zwdH>)vG59NvA(%00x66Z<}_N4BuTlA-tU%p11Xm#LdoZ!n*aa+07*qoM6N<$f)FO( A!T=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } +}}; + diff --git a/src/test/kc/complex/borderline_pacman/pacman-logic-data.c b/src/test/kc/complex/borderline_pacman/pacman-logic-data.c new file mode 100644 index 000000000..26a35f1a6 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-logic-data.c @@ -0,0 +1,66 @@ +// The number of bobs rendered +const char NUM_BOBS = 5; +// The size of the BOB restore structure +const char SIZE_BOB_RESTORE = 18; + +// The BOB x column position (0-24) (a column is 8 pixels) +char bobs_xcol[NUM_BOBS] = { 10, 10, 10, 10, 10, }; +// The BOB y fine position (0-99). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. +char bobs_yfine[NUM_BOBS] = { 45, 45, 45, 45, 45, }; +// The BOB ID in the BOB data tables +char bobs_bob_id[NUM_BOBS] = { 0, 0, 0, 0, 0, }; +// The BOB restore data: 18 bytes per BOB. Doubled for double-buffering. +// char * left_canvas; +// char left_ypos_inc_offset; +// char * right_canvas; +// char right_ypos_inc_offset; +// char[12] restore_pixels; +__align(0x100) char bobs_restore[NUM_BOBS*SIZE_BOB_RESTORE*2]; + +// Pointer to the tile to render in the logic code +volatile char* logic_tile_ptr; +// The x-column of the tile to render +volatile char logic_tile_xcol; +// The y-fine of the tile to render +volatile char logic_tile_yfine; +// The ID*4 of the left tile to render +volatile char logic_tile_left_idx; +// The ID*4 of the right tile to render +volatile char logic_tile_right_idx; + +// Initialize bobs_restore with data to prevent crash on the first call +void init_bobs_restore() { + char * CANVAS_HIDDEN = 0xea00; + char * bob_restore = bobs_restore; + for(char bob=0;bobCANVAS_HIDDEN; + bob_restore[3] = CANVAS_HIDDEN; + bob_restore += SIZE_BOB_RESTORE; + } + + // Also set the logic tile to something sane + logic_tile_ptr = LEVEL_TILES + 64*18 + 12 ; + logic_tile_xcol = 12; + logic_tile_yfine = 35; +} + +// Variables used by the logic-code renderer and restorer +char * volatile left_render_index_xcol; +char * volatile left_canvas; +volatile char left_ypos_inc_offset; +char * volatile rigt_render_index_xcol; +char * volatile rigt_canvas; +volatile char rigt_ypos_inc_offset; +// The high-byte of the start-address of the canvas currently being rendered to +volatile char canvas_base_hi; +// The offset used for bobs_restore - used to achieve double buffering +volatile char bobs_restore_base; + +// Empty logic-code to be merged into the raster-code for testing +char LOGIC_CODE_EMPTY[] = kickasm {{ + .byte 00 // end of logic code +}}; \ No newline at end of file diff --git a/src/test/kc/complex/borderline_pacman/pacman-raster-code.c b/src/test/kc/complex/borderline_pacman/pacman-raster-code.c new file mode 100644 index 000000000..89adf7a67 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-raster-code.c @@ -0,0 +1,121 @@ +// Raster-code for displaying 9 sprites on the entire screen - with open side borders +// The uncrunched code will be merged with logic code using code-merger.c +// The unmerged raster-code is identical for both buffers! + +char RASTER_CODE_CRUNCHED[] = kickasm(uses VICII_CONTROL2, uses BORDER_COLOR, uses RASTER_CODE_UNMERGED, uses side_sprites_color, uses side_sprites_mc, uses bottom_sprites_color, uses bottom_sprites_mc) {{ + .macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } +}}; diff --git a/src/test/kc/complex/borderline_pacman/pacman-render.c b/src/test/kc/complex/borderline_pacman/pacman-render.c new file mode 100644 index 000000000..2cea5e1ca --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-render.c @@ -0,0 +1,150 @@ +// Address of the first pixel each x column +char* RENDER_XCOLS[26] = { + 0x0000, 0x0001, 0x0002, + 0x0400, 0x0401, 0x0402, + 0x0800, 0x0801, 0x0802, + 0x0c00, 0x0c01, 0x0c02, + 0x1000, 0x1001, 0x1002, + 0x1400, 0x1401, 0x1402, + 0x1800, 0x1801, 0x1802, + 0x1c00, 0x1c01, 0x1c02, + 0x0000, 0x0000 +}; + +// Offset for each y-position from the first pixel of an X column +unsigned int RENDER_YPOS[149] = { + 0x000+0, 0x000+0, + 0x000+0, 0x000+6, 0x000+12, 0x000+18, 0x000+24, 0x000+30, 0x000+36, 0x000+42, 0x000+48, 0x000+54, 0x000+60, + 0x040+3, 0x040+9, 0x040+15, 0x040+21, 0x040+27, 0x040+33, 0x040+39, 0x040+45, 0x040+51, 0x040+57, + 0x080+0, 0x080+6, 0x080+12, 0x080+18, 0x080+24, 0x080+30, 0x080+36, 0x080+42, 0x080+48, 0x080+54, 0x080+60, + 0x0c0+3, 0x0c0+9, 0x0c0+15, 0x0c0+21, 0x0c0+27, 0x0c0+33, 0x0c0+39, 0x0c0+45, 0x0c0+51, 0x0c0+57, + 0x100+0, 0x100+6, 0x100+12, 0x100+18, 0x100+24, 0x100+30, 0x100+36, 0x100+42, 0x100+48, 0x100+54, 0x100+60, + 0x140+3, 0x140+9, 0x140+15, 0x140+21, 0x140+27, 0x140+33, 0x140+39, 0x140+45, 0x140+51, 0x140+57, + 0x180+0, 0x180+6, 0x180+12, 0x180+18, 0x180+24, 0x180+30, 0x180+36, 0x180+42, 0x180+48, 0x180+54, 0x180+60, + 0x1c0+3, 0x1c0+9, 0x1c0+15, 0x1c0+21, 0x1c0+27, 0x1c0+33, 0x1c0+39, 0x1c0+45, 0x1c0+51, 0x1c0+57, + 0x200+0, 0x200+6, 0x200+12, 0x200+18, 0x200+24, 0x200+30, 0x200+36, 0x200+42, 0x200+48, 0x200+54, 0x200+60, + 0x240+3, 0x240+9, 0x240+15, 0x240+21, 0x240+27, 0x240+33, 0x240+39, 0x240+45, 0x240+51, 0x240+57, + 0x280+0, 0x280+6, 0x280+12, 0x280+18, 0x280+24, 0x280+30, 0x280+36, 0x280+42, 0x280+48, 0x280+54, 0x280+60, + 0x2c0+3, 0x2c0+9, 0x2c0+15, 0x2c0+21, 0x2c0+27, 0x2c0+33, 0x2c0+39, 0x2c0+45, 0x2c0+51, 0x2c0+57, + 0x300+0, 0x300+6, 0x300+12, 0x300+18, 0x300+24, 0x300+30, 0x300+36, 0x300+42, 0x300+48, 0x300+54, 0x300+60, + 0x340+3, 0x340+9, 0x340+15, 0x340+21, 0x340+27, 0x340+33, 0x340+39, 0x340+45, 0x340+51, 0x340+57, +}; + +// Offset for each y-position from the first pixel of an X column in sprite#9 +unsigned int RENDER_YPOS_9TH[149] = { + 0x000+3, 0x000+3, + 0x000+3, 0x000+9, 0x000+15, 0x000+21, 0x000+27, 0x000+33, 0x000+39, 0x000+45, 0x000+51, 0x000+57, + 0x040+0, 0x040+6, 0x040+12, 0x040+18, 0x040+24, 0x040+30, 0x040+36, 0x040+42, 0x040+48, 0x040+54, 0x040+60, + 0x080+3, 0x080+9, 0x080+15, 0x080+21, 0x080+27, 0x080+33, 0x080+39, 0x080+45, 0x080+51, 0x080+57, + 0x0c0+0, 0x0c0+6, 0x0c0+12, 0x0c0+18, 0x0c0+24, 0x0c0+30, 0x0c0+36, 0x0c0+42, 0x0c0+48, 0x0c0+54, 0x0c0+60, + 0x100+3, 0x100+9, 0x100+15, 0x100+21, 0x100+27, 0x100+33, 0x100+39, 0x100+45, 0x100+51, 0x100+57, + 0x140+0, 0x140+6, 0x140+12, 0x140+18, 0x140+24, 0x140+30, 0x140+36, 0x140+42, 0x140+48, 0x140+54, 0x140+60, + 0x180+3, 0x180+9, 0x180+15, 0x180+21, 0x180+27, 0x180+33, 0x180+39, 0x180+45, 0x180+51, 0x180+57, + 0x1c0+0, 0x1c0+6, 0x1c0+12, 0x1c0+18, 0x1c0+24, 0x1c0+30, 0x1c0+36, 0x1c0+42, 0x1c0+48, 0x1c0+54, 0x1c0+60, + 0x200+3, 0x200+9, 0x200+15, 0x200+21, 0x200+27, 0x200+33, 0x200+39, 0x200+45, 0x200+51, 0x200+57, + 0x240+0, 0x240+6, 0x240+12, 0x240+18, 0x240+24, 0x240+30, 0x240+36, 0x240+42, 0x240+48, 0x240+54, 0x240+60, + 0x280+3, 0x280+9, 0x280+15, 0x280+21, 0x280+27, 0x280+33, 0x280+39, 0x280+45, 0x280+51, 0x280+57, + 0x2c0+0, 0x2c0+6, 0x2c0+12, 0x2c0+18, 0x2c0+24, 0x2c0+30, 0x2c0+36, 0x2c0+42, 0x2c0+48, 0x2c0+54, 0x2c0+60, + 0x300+3, 0x300+9, 0x300+15, 0x300+21, 0x300+27, 0x300+33, 0x300+39, 0x300+45, 0x300+51, 0x300+57, + 0x340+0, 0x340+6, 0x340+12, 0x340+18, 0x340+24, 0x340+30, 0x340+36, 0x340+42, 0x340+48, 0x340+54, 0x340+60, +}; + +// Increment for each y-position from the first pixel of an X column +__align(0x20) char RENDER_YPOS_INC[160] = { + 0, 0, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, +}; + +const char RENDER_OFFSET_CANVAS_LO = 0x00; +const char RENDER_OFFSET_CANVAS_HI = 0x50; +const char RENDER_OFFSET_YPOS_INC = 0xa0; + +// Initialize the RENDER_INDEX table from sub-tables +void init_render_index() { + char* render_index = RENDER_INDEX; + for(char x_col=0;x_col<26;x_col++) { + unsigned int * render_ypos_table = RENDER_YPOS; + char ypos_inc_offset = 0; + if(x_col>=24) { + // Special column in sprite#9 + render_ypos_table = RENDER_YPOS_9TH; + ypos_inc_offset = 11; + } + char * render_index_xcol = render_index; + char * canvas_xcol = RENDER_XCOLS[x_col]; + for(char y_pos=0;y_pos<148;y_pos+=2) { + char * canvas = canvas_xcol + render_ypos_table[(unsigned int)y_pos]; + render_index_xcol[RENDER_OFFSET_CANVAS_LO] = canvas; + render_index_xcol[RENDER_OFFSET_YPOS_INC] = ypos_inc_offset; + ypos_inc_offset += 2; + if(ypos_inc_offset>=23) ypos_inc_offset-=21; // Keep ypos_inc_index as low as possible + render_index_xcol++; + } + render_index += 0x100; + } + // Fix the first entry of the inc_offset in the last column (set it to point to 0,0,6,6...) + (RENDER_INDEX+24*0x100)[RENDER_OFFSET_YPOS_INC] = 0; + (RENDER_INDEX+25*0x100)[RENDER_OFFSET_YPOS_INC] = 0; +} + +// Render graphic pixels into the 9 all-border sprites +// - xcol: x column (0-24). The x-column represents 8 bits of data, 4 mc pixels, 16 on-screen pixels (due to x-expanded sprites) +// - ypos: y position (0-145). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. +// - pixels: The pixel data to set +void render(char xcol, char ypos, char pixels) { + char ytile = ypos/4; + char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + unsigned int canvas_offset = { render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + char * canvas1 = SPRITES_1 + canvas_offset; + char * canvas2 = SPRITES_2 + canvas_offset; + char ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + // Move the last few y-pixels + char ypix = ypos&3; + for(char i=0;iRENDER_INDEX) + xcol, ytile*2 }; + unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + char * canvas1 = SPRITES_1 + canvas_offset; + char * canvas2 = SPRITES_2 + canvas_offset; + char ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + for(char y=0;y<4;y++) { + char pixels = tile_left_pixels[y] | tile_right_pixels[y]; + *canvas1 = pixels; + *canvas2 = pixels; + canvas1 += RENDER_YPOS_INC[ypos_inc_offset]; + canvas2 += RENDER_YPOS_INC[ypos_inc_offset]; + ypos_inc_offset++; + } +} diff --git a/src/test/kc/complex/borderline_pacman/pacman-sounds-test.c b/src/test/kc/complex/borderline_pacman/pacman-sounds-test.c new file mode 100644 index 000000000..690d5aac9 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-sounds-test.c @@ -0,0 +1,30 @@ +// Sound effects for pacman + +#pragma target(c64) +#pragma emulator("C64Debugger") +#include +#include +#include <6502.h> + +#include "pacman-sounds.c" + +void main() { + + // Prevent Interrupt + SEI(); + + pacman_sound_init(); + pacman_ch1_enabled = 1; + + for(;;) { + // Wait for raster + while(VICII->RASTER!=0xfe) ; + VICII->BORDER_COLOR = WHITE; + pacman_sound_play(); + VICII->BORDER_COLOR = BLUE; + while(VICII->RASTER!=0x10) ; + if(kbhit()) + pacman_ch1_enabled = 1; + } + +} diff --git a/src/test/kc/complex/borderline_pacman/pacman-sounds.c b/src/test/kc/complex/borderline_pacman/pacman-sounds.c new file mode 100644 index 000000000..a8a7fbea8 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-sounds.c @@ -0,0 +1,37 @@ +// Sound effects for pacman + +#include + +void pacman_sound_init() { + // Set master volume + SID->VOLUME_FILTER_MODE = 0x0f; + + // Channel 1 is Pacman eating sound + SID->CH1_FREQ = 0; + SID->CH1_PULSE_WIDTH = 0; + SID->CH1_CONTROL = 0; + SID->CH1_ATTACK_DECAY = 0; + SID->CH1_SUSTAIN_RELEASE = 0xf0; + +} + +// Pacman eating sound +char PACMAN_CH1_FREQ_HI[] = {0x23, 0x1d, 0x1a, 0x17, 0x15, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x1a, 0x1c, 0x1d, 0x20, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, }; +char PACMAN_CH1_CONTROL[] = {0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, }; + +// Is the pacman eating sound enabled +volatile char pacman_ch1_enabled = 0; +// Index into the eating sound +volatile char pacman_ch1_idx = 0; + +void pacman_sound_play() { + if(pacman_ch1_enabled) { + // Play the entire sound - and then reset and disable it + *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx]; + SID->CH1_CONTROL = PACMAN_CH1_CONTROL[pacman_ch1_idx]; + if(++pacman_ch1_idx==sizeof(PACMAN_CH1_FREQ_HI)) { + pacman_ch1_idx = 0; + pacman_ch1_enabled = 0; + } + } +} diff --git a/src/test/kc/complex/borderline_pacman/pacman-splash.ase b/src/test/kc/complex/borderline_pacman/pacman-splash.ase new file mode 100644 index 0000000000000000000000000000000000000000..1fa0ea1b73324d44c58bf00c9a7decb1b84b2225 GIT binary patch literal 8425 zcmeHrc~BEs+ixQZ>IjMoN)&J#aX`lrjBEnVh~Nf_LXa$=vP5awA#AcJGl?^b=F*mH@559bgln0sw$F^8eSd3Q$?-1QsK|{~N~|#O>_VlJ8NMAOUoc zzxt-{A^$C0G}6}HwCeAkmH&3-dvhKD=8*#ck}XUSORT6v>`mKj#Jb);g4hFlQW4w0 z30dfO`3bRZzX6D?x_BP3Cr_S4Y-D64V($!IUua)^j@W{Nf_Y0Mz~Y6xECfelAQ2Gv zh;PI(;uUd;_(Pl_o)9;P55xg78X2m$FmjXX_X+-G5SPFb;P|;HpOB46|B_7rphWuS z7ya{|ULXsI%op?a_+_12d+5!I7VMKCEQ!Sak~qr)g~FbS8qAwVOb3SBkyzkTv@ zYruq%5g1=9#|>@`1%sO75C3y?5iZ8tnD#dA82!mn#V*z}BXMQda_ZB8Q~$s7KP04d zLQc2pLj}^G4jnbDefa-uy5w}+pB?ljjY>7M52z18$eZzhdLqcERQvFCN@n``#(W)P zU|BZi%~iDpNKp9>2@60Ff}H=4-^#sXoV6CK)GRo(j58gq_rZzP+Gc}CH(j}v$6HV2 z&p=;`&b;m(ahSac8AV8knhoLyRL))>@tnp3Mxlxv>o~M$L+sp;Jg3|XniQywBm z@av!cTLU>c`C-Hw)3x)LQ(0qr5;w555qz_+4GZ- z58P5pz_*9)Dvg(r%FExqU%SLulOWBUiV&8$$k)H3egGJK{5a`na_3UVaT zpUFCmrIpH~>9|f+__8Py-N2FGqRJQMl6Rsrkj!igA(3e08zGC}*(#FggFl-z~HfB5$b@0Ndf#cR%!u|o6rgCgETg&T?`1;7}Uh8Cja@?`r~A5 z4{K4C3JjbtnLx>J{F0GE+(Kyw&NreXO(fN6trlrbYhJZlK~0&jzPC3^fO_x#mS94n zVN?IoM*LIgNIH@G!=Sc*{npw3)FaXR*%bief>f`kGHhp+nqJAryf5a^uMS4+ig8@b ziDf6RyaTTh2l!=CXW@tj_l@*1r5Z*T-6M9)W1YCk! zK&YOD&e+``jYhS}&3|sqh0)XYgGa*puPy#$=Kvd7do4PgJIEi8B>Ag&WQ=OVz+`Kf zqt*7Y_dyy)r=sG2Q&=>5EO+s}3bJ7pqt|cH2^^P@OXx>(m>hEGRvzVu;*~!KUyP3BpU$QLJmn#)F>gEkqrKFr46cU z*v-ZOW`n2$D{^Dv_(C*A0B{<=XL|eTpSV?OnUC)f@rkc)5fj!Mv6BXV$tBcp4e@LW z1p<+^NOFqVx{&|P#zNNuU6tC`qaRG9@gi0DtdZ_ae|5#I8Sn{NiPh|l4wI=gj~4XZ zguRm7SOMzz{kN3)fa42e|4amX(2Jft9Jbj8HF>w1CG6IQKwWtm;Or9Z(Tu*k0#bQ? ztJ?Mo_<0-2;w3tvdT{;m;f8qIx!pa2=q1AYrp7Hsme;`7T93W5@|)40mO?6DL&nc6 z5e8{kzUe_HIJuA<6-v|q`&XZS^31GQdIIA_Pm4*>fX}X$Xx44Dp4_t!pSX+$9ka^8 zv{)l9?gB{2`?30&`drGo18CZ`fiVHb2z_7_MFY8#fMj$bUsY%J-i@h z@7+dDYS!suG5Mc2^br)w4fiI3k0;jf6Tt(7P>b+OviYkIy@}7jd}l$WpRK6&U5#Yg zhBQ!c=yF5FLD2^~$Y+(e`E?N!;jeY&2Cf<5YU6 zKQ^v}Sxa*Q3Se3}o4O16h+ndL<$^rI_VRow$*dPWHiLo4HtDW&*4v=&pu!u*Jy7_j zcJ!En4nMr%RVrj->aM=F0ta^U~coJ_F zzEfa^l`t4{u{ET((uW{XX=5yW7)cC4dx&bHJBeoLWUsg3tzY|+D?uJ;7%toQg9j%( zR9r#W4F}{-70iYpIQkj z*5Hv+?C$R{Yu(vJm2padKv{P_?tfvRfd9lmd5!`2&8yU6^J%+$hQO$t4PPu!|v{>7RkbwP1)!(5!|fi(yNodJxPvpISV`SNu5M7aP+9;Hsl zlqhc21Xjd?9=@;I8r&NCqe`Fmwo7fDg=+9LsT1rkBrthVzkAWol-CDhdasw(okkW_ zz5}+0@2qGE(tt@M|EC;N!p+(K>mmLuHCIiSh+TgDb-mo6T`|`8$T9e4R_-)WWZldv zO-rqy-Z&;c;0o6YxwDuzLDv>!DfJ=N zc}(@A8~Mt+87Mh)9ot;#&veqSDoCk)nrjjDBmHOItxZ5FP(h;SPJ@eacv}bm$GxLuofchq;~5V_v1RuoPYa&2%W1L9s91__5`40YBSy z|3zEem^)yd+_*|79CNB}J5$lyi5Ar&+~sA!6V-94q1IM8b<i0@Yd$?xL}Qd?eAF2 z_ozf>R3{ChKG^xdk(l2zOFp6$Cg!?$)hhLkiT7G*5%|OnC0{mP^9nM_!mFC+9)*U` z`6;Y=Yf%AfZNOOvm>2{=Q*(IP?3^dbN_nf7Iy3+S68< zHtxvc{Adp&52u=P>Q4^`xtI2Nwe>~6^_4p{y>f}x7vyU>Jvv2@u2^=f{Zrs#K>G>r zqMZ^;XhOfw=ov^iJ)fMsr16J^G`&NMn41EcmYwN)hE6~mRqu<|J8KvXMe!7$s=Y`M zfLX{X(tV7isj}0X!Vr81WwWLlwN%YD?Fr;3Hde!^M$`hu?@ZC1_j%HNbw7d=f2MW&9_BOy(D%&)v*ZDaNuKL>vK z;a|L=nM<6bmZ?l2OAa_~k?Mv_M`g=2NedH0p686o`1zL3);OMUQf z_DKvF1>P;esE@8IA(g03A6^;5BJW4`_S)f;8=l>9yjW&bd`#5bL;0+hNVe3Tj0^V< zgIriBS>K>`gPYi4Kq$_W&8;Y{dE~LK5EfwOOQUeg$y0p{iaOPpD#HGLjH*Dpil;+v zf>ry5`QyT1N4GWZoGA7^WL#Vp$W)XiD^bvhc@l_)NeBUngx#U1UX=Ar#jpxd40-L- zNjEx3hclqZqqRc5K;cR_Jz@YqRpRZV-43Mrs5ZDDu<#8rtuId=Uso0;}SZ{*eKu>ghDRZua zsU?}0%1eKh#JSGMQAFc@La%KT8o`&$&)66hr?cG*Tdg5W+E42LUH|AJ=l`Sr$vc+z z!F<({*nIa5cmH6F^nGZo{D;QnBHjB})S{Okn#$a5yRGob8J8nlGGDE5J};{boL4B; z0eL&-%UiY#$qNb$yjxUS&MDi|JT;*v`ek0+%Jh0)Mr!MeOCFe4tqsE37~$j94RM#_ zZ(5q=BIRaW_mw`pG*5m3wioSxR)*Q>F5duJQRJ34RoPXe))Hr^6Z%OvE$ZX8c63o7 zMx7MY$)4MazekrIhigO6<%+uZby3KluwAt=l?6lCKV+9klh(1W@Fu7mA*_B=e0$h& z_hZg`$RDv?>w_HcsY(>3EIrr#)Tnk2*RNN{HZW9dx^FkUv&=|w<8$|L9`U%bbk)cW z`Bz_2Uo#8SVFa%&vu96ty_}F0vnwo5FkrjteOSrS7Hn(-Md&P{P#)u>;H08#rwD)2 z2WKeNrg#VofjUHF?XZ&H8L^niq^G>{w*-7lz`MMH9q^U`*k101A%Ns`P+0S*^~6(9 zOL40os!NLqhg@0t1S`Md2l>gDa2EBw_|xXZVDUwLD%)4=rq@sm7P3CCJ;lJ>*Ej70!dU9R6KOXkX zo~xbB^*1};PZS1?e!WyDNjMMD^;5ox`>wUICgQdT>rUAs%Gzp5?m54Ibq~Cw$3peY zg7o^E+mc#mU!bdUkHbdK7Y`m9MO{T8D2pI)*K&Gr8?4P~dNqh@v>sgl!Opi%fckKt zNNBz>G4t_9RO2g`5DmtVx4o#BIp=-Ppi}pBaTDR=C4uI*x&$&xLo^Hi2$Nq>W#~M%(w%e&ao*lm2>Cs#1dPNFC)8l!> z!wGob_^m)m;{~#Pm!!nFO3kW#RuOE!LaPjjT%ZbX#PQB#T+pJzfFV>u>QSguU;X`c z3P_RJuqAiN#@`YCATq~SoXw3(a}^>4@Kq7gd4jM=qhdj-K`I~YeuO`xoE{0WA|`Q# zxw_$k(DR-=_(Xk?S%#}*!t9y9H}7&$tZu>%6W*QWlE0a)P;};bf9s{=fYqMaiDVGi zx1i$m@a-I}gsUCOW%$HBn*DPLbXOBFGjrQ<-HW1!gdDO}g7y~CI(X3j{R#EYJ}q)|g5H99 zH5s@bq!IAIt)+@L`WF)Yi`u%&xE5HSBKta{p^iJFX3t{4|5o}<+3(FuX@RN)|VP{p)1x!n<58-Ce ztJ(UBOt9^Y8^PIv>gP6=_rNm?%+?zF+kwVGWrbC>TDES#Ro zyU*9!-4ZP}e(9roGrE4QII7CGZ-D|&6Wm_0vZf*}2OW#7=d+^oEm{gIumS_?fLA%_ zI3JI~m!_60>EX1NG01)VO*@M>Q#vKcO9!cGKHt(Y+@@~qhU-2>Iz%pR>fDQJ=UT8_ zo8jPL{qo%g2X5J$sMfCy8L$Lb;6^yj?RyvHneIN`^sZWu0FI#Fp^XjMI?mTl#A5lU zEpvvjBNeXD)Cye@A8aVC$l{1U<+*uiho62^HV(Nmsw2d-kG6akfnPwsw<01)TpbA7 z(m^+A0~Ms#4(Ii;a{0QCcZDlEyJUw83a8wqjM5hwdmKKZ&u^5R6w8Q{sgd&q4Gzjf zU+8TO@-y1{E+Q{C7{M#2XP|hAxeC>DUPZU#z~fy@|2t9YA?N>zDEs!U0uY&|;r(wi z4Ny~CZ~WlB<8+RZ>XJyxmsVfqv4`f;k#>Xmxg`mkvk{(LbTYRuzGv#5R0_)n5V~B| z=^*BQ{&Y;ymyEw4Ek9~MXD#frI+68tN-WyNt9}*MX)32`hJ}8YYncmjt?*1a#f&YE zv=Nauej3h`*E&=`BAhnaC~ZBG4QAJiEnhdGC9~;4jyNI0vBL92q=0!cJz)nw80}*# zSHMOzBEMSxrMpHgn4S$%Wt1W8Bd=`MTJ3j7phKxD@TJf}CBDzU#fZ{f>mwwx#Co;^ zqkM-;9+3FCUys}G$PQlA%cmwQouSC|6F5Z0rJk<{>D5?L-zd&lE7+6Y@UeJhS7$#)9&Y1R^!^UCx`i= z_t-PnLw5Zm)-hV2InMtShqr>!H^12-8;OXpK$L;YRbdstp#mpf}R{Bda#f5_du zQow(=9~0qU=_&eZO~~XuJH3KgVOgUyhA*zkmGu-AxOZY(Y@>DRd(c$V)v2L8^mR~% z-yjRU3K|5b@F}qYSqk>PEyAv5X6sxzUK+{q6T#0|Jwk1KFJZtwN*W#KAyk2<3DSId zCZ0XLxz2_?|5N1&IkuxPjAJtZx@O+4C(TO79eM+v*Mh>6p#+>n@5x;eVdb{i82Pyo zEXg)Q>hX9%|2chA!nWyl(?4#u@&u@1p&A4C5h_4{T;=&H_l7F9!0k10KXL}w<{ubE zZSmg#4=y&UCixfCZOOMo!;!laPa|*_kwE;s&qTD5JGhN9UeU(C>h)T$)7`To5Fk`r zn#@*T1i3Co<=I0hmu-rj zuiv6M&YNx*nnfQAzo|vRfSR_Pjvi7=#zsC}3Th$*>_l<$xaJBL8()NUimsCBl zE^hyD5c)!{hL?Oz`9cv8}*hs?_>%O6jcqy(rC_Ee$!(cPq713 zBMS-K(uvKCGA^%t`P8DrC1LwQ)-`8>t`v>WnwI1luq8}6f8j&V)HACmUkTl(*%@U- z;pzj;6B7q&rlWWbz8WtNmb6VMkFn>XURJG9*ZgfSKZ11}eyHeU%UPNI4u2X_MOVU< z(iClY(A%hbdv)5elS}+}aqv?7?uY&Yl#AV|nH!+^piT%-8UHT+n3Li&d5yoV@U zbJorbjxt1~drZ&!(w1;}nUQV~h)kT2>yrlm^lb-^U0{3cVH^#tdu zMWs53dRjKp%TKM$MydiK%~oRZy(%C{=LEg*Ku28tmOA}EURDy|y;9J9UW=Pl99K8` z^Q>-#B?ZB@0qz0zwWlHe`#do$gPBWrWr5Za#{QDDK=_T(g7#%gKr)`065g$COr-N! zVVw^=jbW0+wvXi;fb5}Ja$MbL`K$}?j2Rgay*~X=En^6q=EXEO;Y&NHm7v}e8wosm zX}Y>4-zDhy>SNwGj6g=od?TmxSjd|Ixp&HsK<*<0r3NP)cJ@w9dX76KfxO5X-=V}x zFSbBF{%(sewZe$4GoxVjHE4Y=4nRfvKbmWHiGt72aXrEeedq}IdZ9S*72{Gs;!d8_ z=MCi=$QGvbLq7SbgM5$ux&e_-i6dC`a?WP@xN~T_gMaGF-F5YujJ~hCq$srh*!~n= znXW5dI;-S6Sw~mzs~Pb7Ry8W%mwM^O7ltdpMRWb=N6x!HJ|vDcwxO9DB6`_jD*9u$ z*M4Sj$Hq*~!IuN6AF4@mX(`AHm4^)oK`Ytd7~TQ4kLnEb&&ed*ENL#biQqHCer{&9 z`Qxfz>YMObU<1YSSGitG2j)z(vLhj_$3!#|0(Mi7htN5oNfe-T>ldP(yKga`Y z3nkDfQY#c9wL&WRmY>m;9j?4Mj(uCax4!QiuKR&^hgMYT`W8J5QK?JZ3WGeBz&&0o h7B?~wL(@Tug+eNb6bpt!tm#GhjSx~S^!W*V{tI8){Ez?u literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-splash.c b/src/test/kc/complex/borderline_pacman/pacman-splash.c new file mode 100644 index 000000000..72c27f578 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-splash.c @@ -0,0 +1,25 @@ +// Splash screen 25 xcol * 147 ypos bytes +char SPLASH_CRUNCHED[] = kickasm(resource "pacman-splash.png", uses SPLASH) {{ + .modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } +}}; diff --git a/src/test/kc/complex/borderline_pacman/pacman-splash.png b/src/test/kc/complex/borderline_pacman/pacman-splash.png new file mode 100644 index 0000000000000000000000000000000000000000..b18f3e73db802ccf1f881664f6a24055a279b7eb GIT binary patch literal 2687 zcmV-_3V`*AP)Px+kYM*?nY;`D*|GL5^D&0DzuZj6j}V zZp_omP3vNSg>hsmb+M?%dbzn*&x@1h)60!Y8K`;G7BM#;?R(eGw^n^o^FN9G;r#5@ z7-P)U>0|Kk4{u+MF~)3P?>>Cby&-#jZ6nQBj z2+|4*z_VvzeU+>6WF)Ejvd-m*;#x$<)_SATa1>$$bQn+Gh;Zb@UD01MIS*spf)R{(J+T~^o#Lgo>yzM?;FhWhFLeX3` zpVN!XK?_6H^ddcb4`T$gST@AOhMY)ncmMezCN*{jV%*a|y?XbFKw@F+{`co+x90rp z)_ni=$$bCzNtC%;DX#I>o(1XkVT?p+V-xB{v}nL`_D=3%S#NQ*pBA$VF8};~*4&SbQ4g#5Mp(Sp)HD)J}SYJ4G^dLK<}t{5Dk$5&?D$#0gwO!0U!Yc0ziTzW6WQ73=tb}+iNf& z2TLM1em=$k8-O^IE|xDC8aR~MrRx~ff1V)Er!{=wW;g$4QUk-qt33aVX$xicz)<<${ zC80ha05#aY-W4r!=eBnQr+K*^BsK_wNWdJ_w6o%9UaMeN5ENAd&;!{GQ=G(NN{xl7 z05CeNXkH4~U=zTEmG}$ayBoF9E?QBUPHz&wPkTMFZPds-bo3D z>Ot6N^HOK1FwF~kg%f*NyeB=k&;r0*P#bPedN^4T3{7t7A$1LfVh;jO0a{Zc0CuPe zHBk)GK@U(HXz?so?uW5yUkCs!ftJjdQ3;9Y z==|(9yHMySQhRwH04mi(O+>!}pkq=KM$~nYXs{yZkl$G10L%p?+&xF?aQ3VR!I3_o zXSAnz{p(I7E8p-MU@c7cq*M3nxmjLZxkdL2^bB_&x_dqLqyvxu)4X74 zYWH5?K>#r6kodp&hkr}{w~rPP{lk0G!Kz3_tB3xE_oRbW5fezv{_&o4Ff_G;74e>Q z021Im>0mLqr;&s{OVXGKB$NpNYlXB>h@*VKNJv86W1q252tWdo2Z8qhy+ZL8{*Zw) z^OY3{!~uFn@|N42NItxyP@|9l^h9V}5fTXnmOwD01x6yYO3ppB;h4JV9pV5>C3T+L zi7`4SLjcg4((!We&;}gX07fP@;O^!vw*a(8<1M$zE*1b_2UgMnU;u#tkU;#NbO4q_ z?DgiN_oM@`7F6Do4!}~u7zBU>5C{MXAP@i&kOt`htQB@FRtOB@!BSBPHA%gP8i1OF z-iaRi?2_71IEm&}D=7e-K{*jL*RW%d4i<~+MPi$xQk$iWfd>H#$3Muy9}eU^NH!J= zfDwp!2k!4wb`<6k1z;|?_Qqy5`=iV7sj7=RJL7z7MWs<945p}R9%xhdi8>m6pX zz}VQg5%@hA%6dpHt@E>6nLyB;0;7@>j63bSeZ7;ArNv01U}V~D1C0ay$0AOIv7ULa2|H|FW(rgbqE2kLc4bVs2yoTRi;FE{t( zYyG@9zon)bLnAMnpH^C0d6d+v^nT{5_aC1(A3p!{`z3jO)PwkoFS)Q_En2l)+V&y71^moaFDK&I0q0}%cX?@g6rzKaXkLK$1(OmreVlIAunS38Z zWl#F3Xg)-Zu99YVs|N#}qx)FO!`s*W|H56ZZas)G@rRsx_*BE_rN!tE#SyB5euTyE~WX#IOLNMrga)5F_W$6L^87Vd71DK=vw@gD9qDPz@qV70ms zlI}@uVU={5T6eb&6Hd(8S+WNSg%qzDO^*?SJFC_^J(MvwDEAp^Pde9NLIzxWokn{; zpVIP{-jhbX&h`7bnRKzR-#kpqhng~~9$IBCBZ=hD#gZem-a)`MsZCU>Kn6<#Vb zR}7^dWl3l@UfNg#e-9`5xO&bBGcl%vmGl(UmY#ydi}-mgMJToEwIzO6%J&S<*B`&P z_=|>q@M2aVBS-tX-6YMa$)yNIigvx$Ahuc_``&h`eth12-tNEeVvru9R zO}VJzT=`lXNXcGv&GbvXNNGLhJVx%Etl0Nex>zmxrCLFV{+J?neQRph^<2+VnvWej taOdLzRx|c`#hf? z@AvonJkQYp2pam@54sGMLt&5~1VOpr{%eIme!e6$7hM0x3IzV1-~6Xt{ei(ka0iA> zTRve|1Y&wv$e)?{PgJHu3W6xGAm~`)YCu7Y3GlOZO2G6lHvz7XJqg%u-tWt&EeFip z00ExgyBjbyH5E`S76Xge3VGu-u9QDj>&mdF*iL0H1+t1xf2=VWY z5wrz9{5=1veJop8!N}cQkUey9bMV&gmYC73WgjNZWf-#>Us|y5p>wc6mQ+%Cft>Po z+LtIq<0?y|D3kHZ2;D4`>lY5)|0qu)XE${bh{8)$58~FQE{9Z!(jp9#kNUaPcP>L4 z3pTXduVZ?pQHdfbeRU;$b@wquI$|8DP9kDpSYpMQ2H^p@ifj}%Un6p;Cg)M)moq3r zaueZS-(ng9#P zR-#h%M4oVvVi|;KCbLncZQX7!Q;_WqOUm?X2>UYiida}X2^FP0u-9gN1&A@lM?~MG zzB*B`L+9g9bXxijYN<8IM-%f%)M$J(C*tM{`j!U=?=;kUx1L*Y4zNft-7wQubMf&! zepBStX*6VvxMj9C-!yW~UdKE6{25PteMTMNC`}$!FDuJC;-fj+m--I{{K{b@cEju* zTh#T@zc1PU&l(P6Z^p!0{ziTRVWvLNxa-ofjpgO2)?SYWaP}P5l2yHx`i>LAo-gQU z=w@@N!Le`ZU42K2uqVs0c>Ok(xm4hW8gInHK;lNBygZH%VqG!Bb|xgNZFA1=?nG4K zs+>;x4y-Dt6G2^mIaY;YvxV{`7O}XGCCeyuvnVw?297NL8HeA2OXJ>77&!f`bUBQ? zKkW;I6OAq<9tk74Pn$Cge0i>%A=t>-BWD<}3xU1YPcesYvP+_8jw-AU=bfZKeaeKh zXoje-2n}FHGOKICdBLalIy-muo3vPZ({tR%|A&MA@qrbvqO`Al6S|=SQ1E)%Ch}}r zG+^&~Y|q&P0m;6xzYYIeLDU}<5h-w5@44#yT*77< zFWAgUgflJKu%iNtwv_7mWbMQiPVqz{GxB(bI=l%BiUtk1dB|w*GAlFi>ur`O@-=wM zGT>J2#8W`$_pH1{g{0L*xehg0%MMZ6{z~+gKsrA2RAE@-siAEBT&FkFp!AZN_$p4f z6w@z-`Ii&j@yU%gZiIePg=?vmNLzn{jf-{MrmPe834#&Ve47~Sk)+`c`+H5Edzft8 zqgN7$bro#V2W)$T3IA|QH6ksJ(S=^#MlT$%2yDg{Jeez=C Mh=V&X`0k}Y0Ccz$2LJ#7 literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-tiled.png b/src/test/kc/complex/borderline_pacman/pacman-tiled.png new file mode 100644 index 0000000000000000000000000000000000000000..dc1d49793a25b715fc6a9b50ce639dccc2d26433 GIT binary patch literal 1162 zcmeAS@N?(olHy`uVBq!ia0vp^CxCbg2OE&QCXyxuq!^2X+?^QKos)UVz`)|->Eakt zG3V`F$Gpd8B5VmeKO}C_o51|VYx8N&U9YD;V_;3Q-Ch{Z6`-o5IlE@biucjI6B>0- zPnlnDJ8_@x=}!?2`FHQ%x2t-8SoQDk-|wCO-~WB(xcuI72Dh^K|Ak+Kdy})m8QzCS zzy7_n$>GpD&QG7O_dk8UUVfW)?)GcHznj41MaXZmc*?UdnY?aZbN^vWa#WV-xfB774_|5oBs|~R-Sc8?Y`M!7^xDeE zCFAPxU`GW<`4-KW%?=E;0)D>oELK_D^u)fT#OiPa++jZ%Xer^j_T%a%2d6@L6?gfT ziC3idYjLQYQ1Ag-#bCq{Jjqd^f#=Ya6afx}W&>487N(Hdll7VnCPh6CXKiFDzBF@^ z}iN>jN|0gnleGbZscF{TJCQvo_uvPJWxf`9{CqL&c|%MSbM`G2PU zR6rQBJvCBJSMJ7~5~VG2=|IQ606MHzfMWswp($S+6%Jgk6?mOwX!JVCkpW1ng6LX- zWlQ*(7{35*vEyLDW!cta$y-Q3=X+NZ~wl1yiw=tb+fHz`hroto4*zUeRN~*nc30dCw4{jthx3h z)KMXEdy~vs7AfV7YifV4EbB;0i)r9 zPV^N)|R`^xrxrz0>dGW(kU6xDayytzZs-I@&>=j#1A56b}f6nH;^IrS~ zO3nLFBERHo)V_<7>fbvG=3MhxDzw#%fN6o9|StFWX)HrS#RU+8JxZzwiJ0 z+4Z}joBhAF*Se+w1bk v@W6OUznMIP+X7%_&W)Vr{(f#l;9qvu_iA}>WP);lg$skHtDnm{r-UW|kB<>x literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-tiles.c b/src/test/kc/complex/borderline_pacman/pacman-tiles.c new file mode 100644 index 000000000..c3c830115 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-tiles.c @@ -0,0 +1,94 @@ +// The level represented as 4x4 px tiles. Each byte is the ID of a tile from the tile set. +// The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). +// The level data is organized as 37 rows of 50 tile IDs. + +char LEVEL_TILES_CRUNCHED[] = kickasm(resource "pacman-tiled.png", uses LEVEL_TILES) {{ + .modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } +}}; diff --git a/src/test/kc/complex/borderline_pacman/pacman-win.aseprite b/src/test/kc/complex/borderline_pacman/pacman-win.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..07bf3cf3d00c4cd526f76e3de499a4174bf468e2 GIT binary patch literal 994 zcmaFF%)szqDI>!P21y1521W)3h7=%102T&DkRSsK5Yhr90qy_wkriw!E6@TlAZAwp zTZv?y5s)pZ0CNFQ3o7`}z+kFT2_*NQD*}=omPY?U<^bIeBEXVB8KAH{NK^q?KTtUX zJA+SRWonUv;Z-IE237^22oU@SvLOHzG!=8+&T#ZQV!-2CEpyF7XNQ<|-hs6{7{i$i zgO(nAHUIzq$6Mwe?A|}a^Rd;o_&Ft!)7~$=T2)Y6xA(8$ullQ}FaLIR|9v;>tjMZ* zle#VY*It`;?eDM0UwAK1J3)No3(ApJ$bjE9e&TzU zo5p{H^HaO6d3XQft?cp|*ZlTsRa-sM+x$J``Ny2U&2Kd?*4Z52_$z(?_rC0}pSk2; zSx5AQxaIZUedT?Y{h9My|E&6g-={NTu5R`)+qY(!)(?rNU28e#dfxaG{a=2nyZQaa zH6d3ozxf>cWJclKwdGgqSmj^U?wQ435?`2Pq1~S~cSTwH=RnocyEp$fUJWa|yYBue zsR+JUIk)p_@BS!%vY53$^7-n$KUUmWFKTzkZrV-uyPKIl>qdXST9fi9aH{*(dWGGm z>b4za|D-)zdpf^)drs{dvCV%EtPBRq_}z)yC(PVc_BBkg|h*1nn9Y3V&X z*jL$vetbA5dG)6keXGl^+8ru7H1D+6TG7(KS-Gj%CoAv8R-2_Q&JMa>ks^2ZV~$_U lM%z_af1OXNS@3Vkz5b}R?g3Ad|Hl9AliB%`Q9kU&HvskZmt6n= literal 0 HcmV?d00001 diff --git a/src/test/kc/complex/borderline_pacman/pacman-win.c b/src/test/kc/complex/borderline_pacman/pacman-win.c new file mode 100644 index 000000000..d04027f29 --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/pacman-win.c @@ -0,0 +1,12 @@ +// Victory graphics 25 xcol * 25 ypos bytes +char WIN_GFX_CRUNCHED[] = kickasm(resource "pacman-win.png", uses WIN_GFX) {{ + .modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } +}}; diff --git a/src/test/kc/complex/borderline_pacman/pacman-win.png b/src/test/kc/complex/borderline_pacman/pacman-win.png new file mode 100644 index 0000000000000000000000000000000000000000..6d8ad32e511e4a31a472b094806b4a8c45feb766 GIT binary patch literal 1059 zcmV+;1l;?HP)X1^@s6bUI-a00001b5ch_0Itp) z=>Px&-AP12RCt{2TRTo8K@cq@Bw}tsYzd*wOvC}4aRssskU0S>2b*yPXB=Q7HbW~* zj(rPaN4tStjHhOv>(kxCEc8o|neLkIu736Fo)aSaOBEHL953tdt>4#^pS}NQ+~1xN z5z%ScVO3OoED!+@m^h3|kcv^@^5TJrh-T-%h=^$Zy3QhxXlrUOiNVCG1gRJWm>9XR zSoRZxLnrB3kf*5xsTd{L1FSZWp?=bHFfqKS1gRJ$*rTkR{gCHiqBR7vp%SFxQ^V^y zxIGiC5~N}jcz(MfqIfRiP0FpP1gRJmm?#a>s#(??MtTkgB*>3%lh$ukc9ZSAV7aB_ zM9PIx8QwMX%C)Z5q1@bh^o{|wljA_1V`f|{lzXJ&gv3d@Okz-7+MDc1u-vZ2$Rj6G zPe*fSAX(Oa-dewGudUUg+}wKfjzMcDlV&ZnVtL3TXa|DmR)7{_9aw6qCGTu3iPg8oKX=hB@oDr=0^6K?^ z?^tr5f5`D@Xb6}297GNvw~H$+p9otWewVi4wSEYx3F$GpUV~F=olD8}o{xCXQ6$0y ziB8zsuT)Iwf!y%#o`a^Q{?BhWEfOFCu_s~cn>x-&-`prA*Lpr8iD9jB$xy6V6-$fl zQroA%dx4D?+uCoj+_te5FxlyQFB9 z;kE42lPs2Ln|rlctNBq>k5OQ`Nn!^n;t&}KBJ0`GVmBK+?H)f$fTQyJ>hM~u&x_0+ zg!XQF{`%NEHq?J;SSmF`=}|(H8_mPIbKV(B?Mp!~AVH+Et*+90BJRDlsmbr#q}H)_ zEcxADX~7CeYRIIG)3T|C(xVmLur*4cRH9`6#X}(v$KNPi zL~~nhd}ZM=K+|I`xtABQjo-*Qeyf2!jF%{l?sol?38H +#include <6502.h> +#include +#include "byteboozer.h" +#include "code-merger.c" +#include "pacman-sounds.c" + +// Graphics Bank 1 +// Address of the sprites +char * const BANK_1 = 0x4000; +// Address of the sprites +char * const SPRITES_1 = 0x6000; +// Use sprite pointers on all screens (0x43f8, 0x47f8, ...) +char * const SCREENS_1 = 0x4000; +// Graphics Bank 2 +// Address of the sprites +char * const BANK_2 = 0xc000; +// Address of the sprites +char * const SPRITES_2 = 0xe000; +// Use sprite pointers on all screens (0x43f8, 0x47f8, ...) +char * const SCREENS_2 = 0xc000; + +// The location where the logic code will be located before merging +char * const LOGIC_CODE_UNMERGED = 0xe000; +// The location where the screen raster code will be located before merging +char * const RASTER_CODE_UNMERGED = 0x6000; +// The location where the screen raster code will be located when running +char * const RASTER_CODE = 0x8000; + +// Address of the (decrunched) splash screen +char * const SPLASH = 0x4000; +// Address for the victory graphics +char * const WIN_GFX = 0xa700; +// Address for the gameover graphics +char * const GAMEOVER_GFX = 0xa700; + +// Address used by (decrunched) tiles +char * const LEVEL_TILES = 0x4800; +char * const TILES_LEFT = LEVEL_TILES+0x0a00; +char * const TILES_RIGHT = LEVEL_TILES+0x0a80; +char * const TILES_TYPE = LEVEL_TILES+0x0b00; + +// The different tile types in TILES_TYPE +enum TILE_TYPE { + EMPTY=0, + PILL=1, + POWERUP=2, + WALL=4 +}; + +// Address used for table containing available directions for all tiles +// TABLE LEVEL_TILES_DIRECTIONS[64*37] +// The level data is organized as 37 rows of 64 bytes. Each row is 50 bytes containing DIRECTION bits plus 14 unused bytes to achieve 64-byte alignment. +char * const LEVEL_TILES_DIRECTIONS = 0x3e00; + +// Address of the (decrunched) splash screen +const char BOB_ROW_SIZE = 0x80; +char * const BOB_MASK_LEFT = 0x5400; +char * const BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6; +char * const BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*12; +char * const BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*18; + +// Tables pointing to the graphics. +// Each page represents one X column (1 byte wide, 4 MC pixels) +// On each page: +// - 0xNN00-0xNN4A : low-byte of the graphics for (X-column, Y-fine) +// - 0xNN50-0xNN9A : high-byte of the graphics for (X-column, Y-fine) +// - 0xNNA0-0xNNEA : index into RENDER_YPOS_INC for incrementing the y-pos. +char * const RENDER_INDEX = 0xb600; + +#include "pacman-render.c" +#include "pacman-logic-data.c" + +// Sprite settings used for the top/side/bottom sprites. +// Used for achieving single-color sprites on the splash and multi-color sprites in the game +volatile char top_sprites_color; +volatile char top_sprites_mc; +volatile char side_sprites_color; +volatile char side_sprites_mc; +volatile char bottom_sprites_color; +volatile char bottom_sprites_mc; + +#pragma data_seg(Init) +#include "pacman-tiles.c" +#include "pacman-bobs.c" +#include "pacman-splash.c" +#include "pacman-win.c" +#include "pacman-gameover.c" +#include "pacman-logic-code.c" +#include "pacman-raster-code.c" +#pragma data_seg(Data) + +// Upper memory location used during decrunching +char * const INTRO_MUSIC_CRUNCHED_UPPER = 0xa700; +// Size of the crunched music +const unsigned int INTRO_MUSIC_CRUNCHED_SIZE = 0x0600; + +// Address of the music during run-time +char* const INTRO_MUSIC = 0x3000; +// Pointer to the music init routine +void()* const musicInit = (void()*) INTRO_MUSIC+0x00; +// Pointer to the music play routine +void()* const musicPlay = (void()*) INTRO_MUSIC+0x06; + +#pragma data_seg(Init) +// SID tune +// Pacmania Shaun Southern https://csdb.dk/sid/?id=53795 +// Relocated using ./sidreloc-1.0/sidreloc -p30 c64src/borderline/Pacmania.sid c64src/borderline/Pacmania_3000.sid +char INTRO_MUSIC_CRUNCHED[] = kickasm(resource "pacman-2chn-simpler.prg", uses INTRO_MUSIC) {{ + .modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } +}}; +#pragma data_seg(Data) + +void main() { + // Show the splash screen + splash_run(); + for(;;) { + // Run the gameplay + gameplay_run(); + // Show victory or game over image + done_run(); + } +} + +// Show Victory or Game Over Image +// Returns when the user clicks the joystick button +void done_run() { + // Stop the game play + game_playable = 0; + // Set phase to intro + phase = 0; + // Stop any sound + for(char i=0;i<0x2f;i++) + ((char*)SID)[i] = 0; + // Move the bobs to the center to avoid interference while rendering the level + for(char i=0;i<4;i++) { + bobs_xcol[i] = 10; + bobs_yfine[i] = 45; + bobs_bob_id[i] = 0; + } + // Init music + asm { lda #0 } + (*musicInit)(); + if(pacman_wins) { + // decrunch win graphics + byteboozer_decrunch(WIN_GFX_CRUNCHED); + } else { + // decrunch game over graphics + byteboozer_decrunch(GAMEOVER_GFX_CRUNCHED); + } + // Show the win graphics + char * gfx = WIN_GFX; + for(char xcol=0;xcol<25;xcol++) { + for(char ypos=0;ypos<25;ypos++) { + // Render 8px x 1px + char pixels = *gfx++; + render(xcol, ypos, pixels); + } + } + + // Wait for fire + music_play_next = 0; + while(!joyfire()) { + // While playing music + if(music_play_next) { + //VICII->BG_COLOR=1; + (*musicPlay)(); + //VICII->BG_COLOR=0; + music_play_next = 0; + } + } + +} + +// Initializes all data for the splash and shows the splash. +// Returns when the splash is complete and the user clicks the joystidk #2 button +void splash_run() { + // Stop kernel IRQ + SEI(); + // Disable CIA 1 Timer IRQ + CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR; + // Disable kernal & basic & IO + *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK; + *PROCPORT = PROCPORT_RAM_ALL; + // Reset memory to avoid crashes + memset(0x4000, 0, 0xc00); + // Decrunch raster code + byteboozer_decrunch(RASTER_CODE_CRUNCHED); + // Decrunch logic code + byteboozer_decrunch(LOGIC_CODE_CRUNCHED); + // Merge the raster with the logic-code + merge_code(RASTER_CODE, RASTER_CODE_UNMERGED, LOGIC_CODE_UNMERGED); + // Clear the graphics banks + memset(BANK_1+0x2000, 0x00, 0x1fff); + memset(BANK_2, 0x00, 0x3fff); + // Initialize the renderer tables + init_render_index(); + // decrunch splash screen + byteboozer_decrunch(SPLASH_CRUNCHED); + // Show the splash screen + splash_show(); + // Clear the graphics bank + memset(BANK_1, 0x00, 0x1fff); + // Initialize bobs_restore to "safe" values + init_bobs_restore(); + // decrunch bobs graphics tables + byteboozer_decrunch(BOB_GRAPHICS_CRUNCHED); + // Set sprite pointers on all screens (in both graphics banks) + init_sprite_pointers(); + // Move the crunched music to upper memory before decrunching it + memcpy(INTRO_MUSIC_CRUNCHED_UPPER, INTRO_MUSIC_CRUNCHED, INTRO_MUSIC_CRUNCHED_SIZE); + // zero-fill the entire Init segment + //memset(LEVEL_TILES_CRUNCHED, 0, INTRO_MUSIC_CRUNCHED+INTRO_MUSIC_CRUNCHED_SIZE-LEVEL_TILES_CRUNCHED); + // decrunch intro music + byteboozer_decrunch(INTRO_MUSIC_CRUNCHED_UPPER); + // Zero-fill the upper memory + memset(INTRO_MUSIC_CRUNCHED_UPPER, 0, INTRO_MUSIC_CRUNCHED_SIZE); + + // Disable kernal & basic - enable IO + *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK; + *PROCPORT = PROCPORT_RAM_IO; + + // Sprite positions + unsigned int sprites_xpos[] = { 0x1e7, 0x13f, 0x10f, 0x0df, 0x0af, 0x07f, 0x04f, 0x01f } ; + char msb = 0; + for(char i=0;i<8;i++) { + SPRITES_YPOS[i*2] = 7; + unsigned int xpos = sprites_xpos[i]; + SPRITES_XPOS[i*2] = (char)xpos; + msb /= 2; + if((>xpos)) msb |=0x80; + } + + // Set initial graphics bank + CIA2->PORT_A = toDd00(SCREENS_1); + // Set initial render/restore buffer + canvas_base_hi = >SPRITES_2; + bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE; + + // Select first screen + VICII->MEMORY = toD018(SCREENS_1, SCREENS_1); + + VICII->SPRITES_XMSB = msb; + VICII->SPRITES_ENABLE = 0xff; + VICII->SPRITES_EXPAND_X = 0xff; + VICII->BORDER_COLOR = BLACK; + VICII->BG_COLOR = BLACK; + + VICII->SPRITES_MCOLOR1 = BLUE; + VICII->SPRITES_MCOLOR2 = RED; + + // On the splash screen sprites all sprites are SC - except sprite #0,1 on the top/bottom of the screen + top_sprites_mc = 0x03; + side_sprites_mc = 0x00; + bottom_sprites_mc = 0x03;; + // On the splash top/bottom sc-sprites are yellow and side-sprites are blue + top_sprites_color = YELLOW; + side_sprites_color = BLUE; + bottom_sprites_color = YELLOW; + + // Set the initial top colors/MC + VICII->SPRITES_MC = top_sprites_mc; + // Set initial Sprite Color + for(char i=0;i<8;i++) + SPRITES_COLOR[i] = top_sprites_color; + + // Set VICII CONTROL2 ($d016) to 8 to allow ASL, LSR to be used for opening the border + VICII->CONTROL2 = 0x08; + + // Move the bobs to the center to avoid interference while rendering the level + for(char i=0;i<4;i++) { + bobs_xcol[i] = 10; + bobs_yfine[i] = 45; + bobs_bob_id[i] = 0; + } + + // Disable SID CH#3 + asm { + lda #1 + sta INTRO_MUSIC+$69 + } + // Init music + asm { lda #0 } + (*musicInit)(); + + // Set phase to intro + phase = 0; + + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + // Set an illegal mode to prevent any character graphics + VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM; + // Wait for line 0xfa (lower border) + while(VICII->RASTER!=0xfa) ; + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) ; + VICII->RASTER = IRQ_SCREEN_TOP_LINE; + *HARDWARE_IRQ = &irq_screen_top; + // Enable Raster Interrupt + VICII->IRQ_ENABLE = IRQ_RASTER; + // Acknowledge any timer IRQ + asm { lda CIA1_INTERRUPT } + // Acknowledge any VIC IRQ + *IRQ_STATUS = 0x0f; + // Start the IRQ again + CLI(); + + // Prepare for joystick control + joyinit(); + + // Wait for fire + music_play_next = 0; + while(!joyfire()) { + // While playing music + if(music_play_next) { + //VICII->BG_COLOR=1; + (*musicPlay)(); + //VICII->BG_COLOR=0; + music_play_next = 0; + } + } +} + +// Initialize all data for gameplay and runs the game. +// Exits when the user has won or lost +void gameplay_run() { + + // Turn off raster during transition + SEI(); + + // Stop any sound + for(char i=0;i<0x2f;i++) + ((char*)SID)[i] = 0; + + // Pacman has not won yet + pacman_wins = 0; + // Pacman has 3 lives + pacman_lives = 3; + + // During transition all sprites are black + VICII->SPRITES_MCOLOR1 = BLACK; + VICII->SPRITES_MCOLOR2 = BLACK; + for(char i=0;i<8;i++) + SPRITES_COLOR[i] = BLACK; + + // decrunch level tiles + byteboozer_decrunch(LEVEL_TILES_CRUNCHED); + // Initialize tile directions + init_level_tile_directions(); + // Set sprite pointers on all screens (in both graphics banks) + init_sprite_pointers(); + + // Show the level + pill_count = level_show(); + + // During gameplay all sprites are MC. + top_sprites_mc = 0xff; + side_sprites_mc = 0xff; + bottom_sprites_mc = 0xff; + // During gameplay all sprites are yellow + top_sprites_color = YELLOW; + side_sprites_color = YELLOW; + bottom_sprites_color = YELLOW; + // Set the initial top colors/MC + VICII->SPRITES_MC = top_sprites_mc; + // Set initial Sprite Color + for(char i=0;i<8;i++) + SPRITES_COLOR[i] = top_sprites_color; + // Set sprite MC-colors for the game + VICII->SPRITES_MCOLOR1 = BLUE; + VICII->SPRITES_MCOLOR2 = RED; + + // Set phase to game + phase = 1; + // Spawn pacman and all ghosts + spawn_all(); + // Initialize the game sound + pacman_sound_init(); + // Start the game play + game_playable = 1; + + // Turn on raster after transition + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM; + // Wait at least one frames for DEN to take effect + while(VICII->RASTER!=0xfb) ; + while(VICII->RASTER!=0xfa) ; + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) ; + VICII->RASTER = IRQ_SCREEN_TOP_LINE; + *HARDWARE_IRQ = &irq_screen_top; + // Enable Raster Interrupt + VICII->IRQ_ENABLE = IRQ_RASTER; + // Acknowledge any timer IRQ + asm { lda CIA1_INTERRUPT } + // Acknowledge any VIC IRQ + *IRQ_STATUS = 0x0f; + // Start the IRQ again + CLI(); + + // Wait for the player to wins or looses + for(;;) + if(pacman_wins || pacman_lives==0) + return; + +} + + +// The number of pills left +volatile unsigned int pill_count; + +// 1 When pacman wins +volatile char pacman_wins = 0; + +// The number of pacman lives left +volatile char pacman_lives = 3; + +// Signal for playing th next music frame during the intro +volatile char music_play_next = 0; + +// Prepare for joystick control +void joyinit() { + // Joystick Read Mode + CIA1->PORT_A_DDR = 0x00; +} + +// Return 1 if joy #2 fire is pressed +char joyfire() { + if( (CIA1->PORT_A & 0x10) == 0 ) { + return 1; + } else { + return 0; + } +} + +// Initialize keyboard for reading +void kbinit() { + // Keyboard Matrix Columns Write Mode + CIA1->PORT_A_DDR = 0xff; + // Keyboard Matrix Columns Read Mode + CIA1->PORT_B_DDR = 0x00; +} + +// Return true if there's a key waiting, return false if not +unsigned char kbhit (void) { + // Write 00 (all columns) + CIA1->PORT_A = 0; + // Read 00 (all rows) + return ~CIA1->PORT_B; +} + +// Show the splash screen +void splash_show() { + // Show splash screen + char * splash = SPLASH; + for(char xcol=0;xcol<25;xcol++) { + for(char ypos=0;ypos<147;ypos++) { + // Render 8px x 1px + char pixels = *splash++; + render(xcol, ypos, pixels); + } + } +} + +// Show the level by rendering all tiles +// Returns the number of pills on the level +unsigned int level_show() { + unsigned int count = 0; + char * level = LEVEL_TILES; + for(char ytile=0;ytile<37;ytile++) { + for(char xcol=0, xtile=0; xcol<25; xcol++) { + char tile_left = level[xtile++]; + if(TILES_TYPE[tile_left]==PILL) count++; + char tile_right = level[xtile++]; + if(TILES_TYPE[tile_right]==PILL) count++; + render_tiles(xcol, ytile, tile_left, tile_right); + } + level += 0x40; + } + return count; +} + +// Offset of the LEVEL_TILE data within the LEVEL_TILE data (each row is 64 bytes of data) +unsigned int LEVEL_YTILE_OFFSET[37] = { + 0x0000, 0x0040, 0x0080, 0x00c0, + 0x0100, 0x0140, 0x0180, 0x01c0, + 0x0200, 0x0240, 0x0280, 0x02c0, + 0x0300, 0x0340, 0x0380, 0x03c0, + 0x0400, 0x0440, 0x0480, 0x04c0, + 0x0500, 0x0540, 0x0580, 0x05c0, + 0x0600, 0x0640, 0x0680, 0x06c0, + 0x0700, 0x0740, 0x0780, 0x07c0, + 0x0800, 0x0840, 0x0880, 0x08c0, + 0x0900 +}; + +// Get the level tile at a given (xtile, ytile) position +// Returns the TILE ID +// If xtile of ytile is outside the legal range the empty tile (0) is returned +char level_tile_get(char xtile, char ytile) { + if(xtile>49 || ytile>36) return 0; + char* ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile]; + return ytiles[xtile]; +} + +// Get the open directions at a given (xtile, ytile) position +// Returns the open DIRECTIONs as bits +// If xtile of ytile is outside the legal range the empty tile (0) is returned +char level_tile_directions(char xtile, char ytile) { + if(xtile>49 || ytile>36) return 0; + char* ytiles = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile]; + return ytiles[xtile]; +} + +// Initialize the LEVEL_TILES_DIRECTIONS table with bits representing all open (non-blocked) movement directions from a tile +void init_level_tile_directions() { + char * directions = LEVEL_TILES_DIRECTIONS; + for(char ytile=0;ytile<37;ytile++) { + for(char xtile=0; xtile<50; xtile++) { + char open_directions = 0; + if(TILES_TYPE[level_tile_get(xtile-1, ytile)]!=WALL) open_directions |= LEFT; + if(TILES_TYPE[level_tile_get(xtile+1, ytile)]!=WALL) open_directions |= RIGHT; + if(TILES_TYPE[level_tile_get(xtile, ytile-1)]!=WALL) open_directions |= UP; + if(TILES_TYPE[level_tile_get(xtile, ytile+1)]!=WALL) open_directions |= DOWN; + directions[xtile] = open_directions; + } + directions += 0x40; + } +} + +// Initialize sprite pointers on all screens (in both graphics banks) +void init_sprite_pointers() { + const char SPRITE_ID_0 = (SPRITES_1&0x3fff)/0x40; + char sprites_id[] = { 0x00, 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10 }; + char * sprites_ptr_1 = SCREENS_1+OFFSET_SPRITE_PTRS; + char * sprites_ptr_2 = SCREENS_2+OFFSET_SPRITE_PTRS; + for(char screen=0;screen<14;screen++) { + for(char sprite=0; sprite<8; sprite++) { + char sprite_id = SPRITE_ID_0 + screen + sprites_id[sprite]; + sprites_ptr_1[sprite] = sprite_id; + sprites_ptr_2[sprite] = sprite_id; + } + sprites_ptr_1 += 0x400; + sprites_ptr_2 += 0x400; + } +} + + +// 0: intro, 1: game +volatile char phase = 0; + +// The double buffer frame (0=BANK_1, 1=BANK_2) +volatile char frame = 0; + +// The raster line for irq_screen_top() +const char IRQ_SCREEN_TOP_LINE = 0x05; + +// Interrupt Routine at Screen Top +__interrupt void irq_screen_top() { + kickasm(uses HARDWARE_IRQ, uses RASTER, uses IRQ_STATUS, uses IRQ_RASTER, uses VICII_CONTROL1, uses VICII_RSEL, uses VICII_MEMORY, clobbers "AX") {{ + // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} + asm { + // Call the screen raster code + jsr RASTER_CODE + } + // Move sprites back to the top + VICII->SPRITE0_Y =7; + VICII->SPRITE1_Y =7; + VICII->SPRITE2_Y =7; + VICII->SPRITE3_Y =7; + VICII->SPRITE4_Y =7; + VICII->SPRITE5_Y =7; + VICII->SPRITE6_Y =7; + VICII->SPRITE7_Y =7; + // Select first screen (graphics bank not important since layout in the banks is identical) + VICII->MEMORY = toD018(SCREENS_1, SCREENS_1); + + // Set the top sprites color/MC + VICII->SPRITES_MC = top_sprites_mc; + VICII->SPRITE0_COLOR = top_sprites_color; + VICII->SPRITE1_COLOR = top_sprites_color; + + // Move to next frame + frame = (frame+1) & 1; + if(frame) { + // Change graphics bank + CIA2->PORT_A = toDd00(SCREENS_2); + // Set the next canvas base address + canvas_base_hi = >SPRITES_1; + bobs_restore_base = 0; + } else { + // Change graphics bank + CIA2->PORT_A = toDd00(SCREENS_1); + // Set the next canvas base address + canvas_base_hi = >SPRITES_2; + bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE; + } + + if(phase==0) { + // intro phase + // Play intro music + music_play_next = 1; + } else { + // Game phase + // Perform game logic + game_logic(); + // Play sounds + pacman_sound_play(); + } + + // Acknowledge the IRQ + VICII->IRQ_STATUS = IRQ_RASTER; + // Trigger IRQ at screen top again + VICII->RASTER = IRQ_SCREEN_TOP_LINE; + *HARDWARE_IRQ = &irq_screen_top; +} + +// Movement directions. +// Each active direction is also a bit enabling efficient storage of potential directions from a tile +// The directions are also used as indices into the animation frames for the BOBs. +// The directions are also arranged so they match the C64 joystick #2 CIA#1 PORT A bits shifted twice. +enum DIRECTION { + STOP=0, + UP=4, + DOWN=8, + LEFT=16, + RIGHT=32 +}; + +// Used to choose a single direction when presented with multiple potential directions. +// Used to eliminate diagonal joy directions and convert them to a single direction +// Priority: (4)up, (8)down, (16)left, (32)right +__align(0x40) char DIRECTION_SINGLE[0x40] = { + 0x00, 0x00, 0x00, 0x00, // 00 + 0x04, 0x04, 0x04, 0x04, // 04 + 0x08, 0x08, 0x08, 0x08, // 08 + 0x04, 0x04, 0x04, 0x04, // 0c: 4 wins + 0x10, 0x10, 0x10, 0x10, // 10 + 0x04, 0x04, 0x04, 0x04, // 14: 4 wins + 0x08, 0x08, 0x08, 0x08, // 18: 8 wins + 0x04, 0x04, 0x04, 0x04, // 1c: 4 wins + 0x20, 0x20, 0x20, 0x20, // 20 + 0x04, 0x04, 0x04, 0x04, // 24: 4 wins + 0x08, 0x08, 0x08, 0x08, // 28: 8 wins + 0x04, 0x04, 0x04, 0x04, // 2c: 4 wins + 0x10, 0x10, 0x10, 0x10, // 30: 10 wins + 0x04, 0x04, 0x04, 0x04, // 34: 4 wins + 0x08, 0x08, 0x08, 0x08, // 38: 8 wins + 0x04, 0x04, 0x04, 0x04, // 3c: 4 wins +}; + +// Used to eliminate a single direction (the one that the ghost came from) +// The value DIRECTION_ELIMINATE[current_direction] is ANDed onto the open directions to remove the current direction +__align(0x40) char DIRECTION_ELIMINATE[0x21] = { + 0xff, 0x00, 0x00, 0x00, // 00 + 0xf7, 0x00, 0x00, 0x00, // 04: Moving Up - eliminate Down from the open directions + 0xfb, 0x00, 0x00, 0x00, // 08: Moving Down - eliminate Up from the open directions + 0x00, 0x00, 0x00, 0x00, // 0c + 0xdf, 0x00, 0x00, 0x00, // 10: Moving Left - eliminate Right from the open directions + 0x00, 0x00, 0x00, 0x00, // 14 + 0x00, 0x00, 0x00, 0x08, // 18 + 0x00, 0x00, 0x00, 0x00, // 1c + 0xef // 20 Moving Right - eliminate Left from the open directions +}; + +// Used to reverse direction direction (when a ghost changes between chase and scatter) +__align(0x40) char DIRECTION_REVERSE[0x21] = { + 0x00, 0x00, 0x00, 0x00, // 00 + 0x08, 0x00, 0x00, 0x00, // 04: Moving Up + 0x04, 0x00, 0x00, 0x00, // 08: Moving Down + 0x00, 0x00, 0x00, 0x00, // 0c + 0x20, 0x00, 0x00, 0x00, // 10: Moving Left + 0x00, 0x00, 0x00, 0x00, // 14 + 0x00, 0x00, 0x00, 0x08, // 18 + 0x00, 0x00, 0x00, 0x00, // 1c + 0x10 // 20 Moving Right +}; + + +// The animation frames for pacman. The index into this is DIRECTION + anim_frame_idx. + __align(0x40) char pacman_frames[] = { + 8, 8, 8, 8, // 0: Stop + 8, 24, 20, 24, // 4: Up + 8, 32, 28, 32, // 8: Down + 0, 0, 0, 0, // Unused + 8, 4, 0, 4, // 16: Left + 0, 0, 0, 0, // Unused + 0, 0, 0, 0, // Unused + 0, 0, 0, 0, // Unused + 8, 12, 16, 12, // 32: Right +}; + +// The animation frames for ghost. The index into thos is DIRECTION + anim_frame_idx. +__align(0x80) char ghost_frames[] = { + 0, 0, 0, 0, // 00: Stop RED + 60, 64, 60, 64, // 04: Up RED + 52, 56, 52, 56, // 08: Down RED + 0, 0, 0, 0, // 0c: Unused RED + 44, 48, 44, 48, // 10: Left RED + 0, 0, 0, 0, // 14 Unused RED + 0, 0, 0, 0, // 18 Unused RED + 0, 0, 0, 0, // 1c Unused RED + 36, 40, 36, 40, // 20: Right RED + 0, 0, 0, 0, // 24 Unused RED + 0, 0, 0, 0, // 28 Unused RED + 0, 0, 0, 0, // 2c Unused RED + 0, 0, 0, 0, // 30 Unused RED + 0, 0, 0, 0, // 34 Unused RED + 0, 0, 0, 0, // 38 Unused RED + 0, 0, 0, 0, // 3c Unused RED + 0, 0, 0, 0, // 40: Stop BLUE + 92, 96, 92, 96, // 44: Up BLUE + 84, 88, 84, 88, // 48: Down BLUE + 0, 0, 0, 0, // 4c Unused BLUE + 76, 80, 76, 80, // 50: Left BLUE + 0, 0, 0, 0, // 54 Unused BLUE + 0, 0, 0, 0, // 58 Unused BLUE + 0, 0, 0, 0, // 5c Unused BLUE + 68, 72, 68, 72, // 60: Right BLUE +}; + +// The animation frame IDX (within the current direction) [0-3] +volatile char anim_frame_idx = 0; + +// Pacman x fine position (0-99). +volatile char pacman_xfine = 45; +// Pacman y fine position (0-70). +volatile char pacman_yfine = 35; +// The pacman movement current direction +volatile enum DIRECTION pacman_direction = STOP; +// Pacman movement substep (0: on tile, 1: between tiles). +volatile char pacman_substep = 0; + +// Ghost target modes +// See https://gameinternals.com/understanding-pac-man-ghost-behavior +enum GHOSTS_MODE { + CHASE=0, + SCATTER=1, + FRIGHTENED=2 +}; + +// Mode determining ghost target mode. 0: chase, 1: scatter +volatile enum GHOSTS_MODE ghosts_mode = 1; + +// Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase ) +volatile char ghosts_mode_count = 0; + +// Ghost 1 x fine position (0-99). +volatile char ghost1_xfine = 45; +// Ghost 1 y fine position (0-70). +volatile char ghost1_yfine = 35; +// Ghost 1 movement current direction +volatile enum DIRECTION ghost1_direction = STOP; +// Ghost 1 movement substep (0: on tile, 1: between tiles). +volatile char ghost1_substep = 0; +// Ghost 1 movement should be reversed (0: normal, 1: reverse direction) +volatile char ghost1_reverse = 0; +// Ghost 1 respawn timer +volatile char ghost1_respawn = 0; + +// Ghost 2 x fine position (0-99). +volatile char ghost2_xfine = 45; +// Ghost 2 y fine position (0-70). +volatile char ghost2_yfine = 35; +// Ghost 2 movement current direction +volatile enum DIRECTION ghost2_direction = STOP; +// Ghost 2 movement substep (0: on tile, 1: between tiles). +volatile char ghost2_substep = 0; +// Ghost 2 movement should be reversed (0: normal, 1: reverse direction) +volatile char ghost2_reverse = 0; +// Ghost 2 respawn timer +volatile char ghost2_respawn = 0; + +// Ghost 3 x fine position (0-99). +volatile char ghost3_xfine = 45; +// Ghost 3 y fine position (0-70). +volatile char ghost3_yfine = 35; +// Ghost 3 movement current direction +volatile enum DIRECTION ghost3_direction = STOP; +// Ghost 3 movement substep (0: on tile, 1: between tiles). +volatile char ghost3_substep = 0; +// Ghost 3 movement should be reversed (0: normal, 1: reverse direction) +volatile char ghost3_reverse = 0; +// Ghost 3 respawn timer +volatile char ghost3_respawn = 0; + +// Ghost 4 x fine position (0-99). +volatile char ghost4_xfine = 45; +// Ghost 4 y fine position (0-70). +volatile char ghost4_yfine = 35; +// Ghost 4 movement current direction +volatile enum DIRECTION ghost4_direction = STOP; +// Ghost 4 movement substep (0: on tile, 1: between tiles). +volatile char ghost4_substep = 0; +// Ghost 4 movement should be reversed (0: normal, 1: reverse direction) +volatile char ghost4_reverse = 0; +// Ghost 4 respawn timer +volatile char ghost4_respawn = 0; + +// Game logic sub-step [0-7]. Each frame a different sub-step is animated +volatile char game_logic_substep = 0; + +// 1 when the game is playable and characters should move around +volatile char game_playable = 0; + +// Perform game logic such as moving pacman and ghosts +void game_logic() { + + // Exit if game is not playable + if(game_playable==0) return; + + // Move to next sub-step + game_logic_substep = (game_logic_substep+1)&7; + + if(game_logic_substep==0) { + // Animate pacman + // Move pacman in the current direction (unless he is stopped) + if(pacman_direction==RIGHT) { + ++pacman_xfine; + } else if(pacman_direction==DOWN) { + ++pacman_yfine; + } else if(pacman_direction==LEFT) { + --pacman_xfine; + } else if(pacman_direction==UP) { + --pacman_yfine; + } + if(pacman_substep==0 && pacman_direction!=STOP) { + // Pacman was on a tile and is moving, so he is now between tiles + pacman_substep = 1; + // Enable the eating sound whenever pacman is moving + pacman_ch1_enabled = 1; + // Teleport if we are in the magic positions + if(pacman_xfine==1) { + pacman_xfine = 97; + } else if(pacman_xfine==97) { + pacman_xfine = 1; + } + } else { + // Pacman is on a (new) tile + pacman_substep = 0; + // Examine open directions from the new tile to determine next action + char pacman_xtile = pacman_xfine/2; + char pacman_ytile = pacman_yfine/2; + char open_directions = level_tile_directions(pacman_xtile, pacman_ytile); + // Read joystick#2 - arrange bits to match DIRECTION + char joy_directions = ((CIA1->PORT_A & 0x0f)^0x0f)*4; + if(joy_directions!=0) { + char new_direction = DIRECTION_SINGLE[joy_directions&open_directions]; + if(new_direction!=0) + pacman_direction = new_direction; + } + // Stop pacman if the current direction is no longer open + pacman_direction &= open_directions; + } + + } else if(game_logic_substep==1) { + // Ghost spawn timer + if(ghost1_respawn) { + if(--ghost1_respawn==0) { + // Spawn ghost 1 + ghost1_direction = DOWN; ghost1_xfine = 96; ghost1_yfine = 2; ghost1_substep = 0; + } + } else { + // Ghost 1 animation + // Move in the current direction (unless he is stopped) + if(ghost1_direction==RIGHT) { + ++ghost1_xfine; + } else if(ghost1_direction==DOWN) { + ++ghost1_yfine; + } else if(ghost1_direction==LEFT) { + --ghost1_xfine; + } else if(ghost1_direction==UP) { + --ghost1_yfine; + } + if(ghost1_substep==0 && ghost1_direction!=STOP) { + // Ghost was on a tile and is moving, so he is now between tiles + ghost1_substep = 1; + // Teleport if we are in the magic positions + if(ghost1_xfine==1) { + ghost1_xfine = 97; + } else if(ghost1_xfine==97) { + ghost1_xfine = 1; + } + } else { + // Ghost is on a tile + ghost1_substep = 0; + if(ghost1_reverse) { + // If we are changing between scatter & chase then reverse the direction + ghost1_direction = DIRECTION_REVERSE[ghost1_direction]; + ghost1_reverse = 0; + } else { + // Examine open directions from the new tile to determine next action + char ghost1_xtile = ghost1_xfine/2; + char ghost1_ytile = ghost1_yfine/2; + char open_directions = level_tile_directions(ghost1_xtile, ghost1_ytile); + // Eliminate the direction ghost came from + open_directions &= DIRECTION_ELIMINATE[ghost1_direction]; + if(ghosts_mode==FRIGHTENED) { + // Choose a random direction between the open directions + ghost1_direction = DIRECTION_SINGLE[open_directions]; + } else { + char target_xtile; + char target_ytile; + if(ghosts_mode==SCATTER) { + target_xtile = 2; + target_ytile = 2; + } else { + // "Blinky" Choose the direction bringine me closer to pacman. https://gameinternals.com/understanding-pac-man-ghost-behavior + target_xtile = pacman_xfine/2; + target_ytile = pacman_yfine/2; + } + ghost1_direction = choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ); + } + } + } + } + } else if(game_logic_substep==2) { + // Ghost spawn timer + if(ghost2_respawn) { + if(--ghost2_respawn==0) { + // Spawn ghost + ghost2_direction = LEFT; ghost2_xfine = 96; ghost2_yfine = 70; ghost2_substep = 0; + } + } else { + // Move in the current direction (unless he is stopped) + if(ghost2_direction==RIGHT) { + ++ghost2_xfine; + } else if(ghost2_direction==DOWN) { + ++ghost2_yfine; + } else if(ghost2_direction==LEFT) { + --ghost2_xfine; + } else if(ghost2_direction==UP) { + --ghost2_yfine; + } + if(ghost2_substep==0 && ghost2_direction!=STOP) { + // Ghost was on a tile and is moving, so he is now between tiles + ghost2_substep = 1; + // Teleport if we are in the magic positions + if(ghost2_xfine==1) { + ghost2_xfine = 97; + } else if(ghost2_xfine==97) { + ghost2_xfine = 1; + } + } else { + // Ghost is on a tile + ghost2_substep = 0; + if(ghost2_reverse) { + // If we are changing between scatter & chase then reverse the direction + ghost2_direction = DIRECTION_REVERSE[ghost2_direction]; + ghost2_reverse = 0; + } else { + // Examine open directions from the new tile to determine next action + char ghost2_xtile = ghost2_xfine/2; + char ghost2_ytile = ghost2_yfine/2; + char open_directions = level_tile_directions(ghost2_xtile, ghost2_ytile); + // Eliminate the direction ghost came from + open_directions &= DIRECTION_ELIMINATE[ghost2_direction]; + if(ghosts_mode==FRIGHTENED) { + // Choose a random direction between the open directions + ghost2_direction = DIRECTION_SINGLE[open_directions]; + } else { + char target_xtile; + char target_ytile; + if(ghosts_mode==SCATTER) { + target_xtile = 2; + target_ytile = 2; + } else { + // "Blinky" Choose the direction bringine me closer to pacman. https://gameinternals.com/understanding-pac-man-ghost-behavior + target_xtile = pacman_xfine/2; + target_ytile = pacman_yfine/2; + } + ghost2_direction = choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ); + } + } + } + } + } else if(game_logic_substep==4) { + // Ghost spawn timer + if(ghost3_respawn) { + if(--ghost3_respawn==0) { + // Spawn ghost + ghost3_direction = UP; ghost3_xfine = 2; ghost3_yfine = 70; ghost3_substep = 0; + } + } else { + // Move in the current direction (unless he is stopped) + if(ghost3_direction==RIGHT) { + ++ghost3_xfine; + } else if(ghost3_direction==DOWN) { + ++ghost3_yfine; + } else if(ghost3_direction==LEFT) { + --ghost3_xfine; + } else if(ghost3_direction==UP) { + --ghost3_yfine; + } + if(ghost3_substep==0 && ghost3_direction!=STOP) { + // Ghost was on a tile and is moving, so he is now between tiles + ghost3_substep = 1; + // Teleport if we are in the magic positions + if(ghost3_xfine==1) { + ghost3_xfine = 97; + } else if(ghost3_xfine==97) { + ghost3_xfine = 1; + } + } else { + // Ghost is on a tile + ghost3_substep = 0; + if(ghost3_reverse) { + // If we are changing between scatter & chase then reverse the direction + ghost3_direction = DIRECTION_REVERSE[ghost3_direction]; + ghost3_reverse = 0; + } else { + // Examine open directions from the new tile to determine next action + char ghost3_xtile = ghost3_xfine/2; + char ghost3_ytile = ghost3_yfine/2; + char open_directions = level_tile_directions(ghost3_xtile, ghost3_ytile); + // Eliminate the direction ghost came from + open_directions &= DIRECTION_ELIMINATE[ghost3_direction]; + if(ghosts_mode==FRIGHTENED) { + // Choose a random direction between the open directions + ghost3_direction = DIRECTION_SINGLE[open_directions]; + } else { + char target_xtile; + char target_ytile; + if(ghosts_mode==SCATTER) { + target_xtile = 2; + target_ytile = 2; + } else { + // "Blinky" Choose the direction bringine me closer to pacman. https://gameinternals.com/understanding-pac-man-ghost-behavior + target_xtile = pacman_xfine/2; + target_ytile = pacman_yfine/2; + } + ghost3_direction = choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ); + } + } + } + } + } else if(game_logic_substep==5) { + // Ghost spawn timer + if(ghost4_respawn) { + if(--ghost4_respawn==0) { + // Spawn ghost + ghost4_direction = RIGHT; ghost4_xfine = 2; ghost4_yfine = 2; ghost4_substep = 0; + } + } else { + // Move in the current direction (unless he is stopped) + if(ghost4_direction==RIGHT) { + ++ghost4_xfine; + } else if(ghost4_direction==DOWN) { + ++ghost4_yfine; + } else if(ghost4_direction==LEFT) { + --ghost4_xfine; + } else if(ghost4_direction==UP) { + --ghost4_yfine; + } + if(ghost4_substep==0 && ghost4_direction!=STOP) { + // Ghost was on a tile and is moving, so he is now between tiles + ghost4_substep = 1; + // Teleport if we are in the magic positions + if(ghost4_xfine==1) { + ghost4_xfine = 97; + } else if(ghost4_xfine==97) { + ghost4_xfine = 1; + } + } else { + // Ghost is on a tile + ghost4_substep = 0; + if(ghost4_reverse) { + // If we are changing between scatter & chase then reverse the direction + ghost4_direction = DIRECTION_REVERSE[ghost4_direction]; + ghost4_reverse = 0; + } else { + // Examine open directions from the new tile to determine next action + char ghost4_xtile = ghost4_xfine/2; + char ghost4_ytile = ghost4_yfine/2; + char open_directions = level_tile_directions(ghost4_xtile, ghost4_ytile); + // Eliminate the direction ghost came from + open_directions &= DIRECTION_ELIMINATE[ghost4_direction]; + if(ghosts_mode==FRIGHTENED) { + // Choose a random direction between the open directions + ghost4_direction = DIRECTION_SINGLE[open_directions]; + } else { + char target_xtile; + char target_ytile; + if(ghosts_mode==SCATTER) { + target_xtile = 2; + target_ytile = 2; + } else { + // "Blinky" Choose the direction bringine me closer to pacman. https://gameinternals.com/understanding-pac-man-ghost-behavior + target_xtile = pacman_xfine/2; + target_ytile = pacman_yfine/2; + } + ghost4_direction = choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ); + } + } + } + } + } else if(game_logic_substep==6) { + // Update ghosts mode + ghosts_mode_count++; + char do_reverse = 0; + if(ghosts_mode==SCATTER) { + if(ghosts_mode_count>50) { + ghosts_mode = CHASE; + ghosts_mode_count = 0; + do_reverse = 1; + } + } else if(ghosts_mode==CHASE) { + if(ghosts_mode_count>150) { + ghosts_mode = SCATTER; + ghosts_mode_count = 0; + do_reverse = 1; + } + } else if(ghosts_mode==FRIGHTENED) { + // Frightened mode + if(ghosts_mode_count>50) { + ghosts_mode = CHASE; + ghosts_mode_count = 0; + do_reverse = 1; + } + } + + // Reverse direction for all ghosts if needed + if(do_reverse) { + ghost1_reverse = 1; + ghost2_reverse = 1; + ghost3_reverse = 1; + ghost4_reverse = 1; + } + + // Examine if pacman is on a pill tile - and handle it + char pacman_xtile = pacman_xfine/2; + char pacman_ytile = pacman_yfine/2; + char* ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile]; + char tile_id = ytiles[pacman_xtile]; + if(TILES_TYPE[tile_id]==PILL) { + // Empty the tile + ytiles[pacman_xtile] = EMPTY; + // Ask the logic code renderer to update the tile + logic_tile_xcol = pacman_xtile/2; + logic_tile_ptr = ytiles + (pacman_xtile & 0xfe); + logic_tile_yfine = pacman_ytile*2; + // Decrease the number of pills + if(--pill_count==0) + pacman_wins = 1;; + } else if(TILES_TYPE[tile_id]==POWERUP) { + // Empty the tile + ytiles[pacman_xtile] = EMPTY; + // Ask the logic code renderer to update the tile + logic_tile_xcol = pacman_xtile/2; + logic_tile_ptr = ytiles + (pacman_xtile & 0xfe); + logic_tile_yfine = pacman_ytile*2; + // Start power-up mode + ghosts_mode = FRIGHTENED; + ghosts_mode_count = 0; + } + + // Check if anyone dies + if(ABS[pacman_xfine-ghost1_xfine]<2 && ABS[pacman_yfine-ghost1_yfine]<2) { + if(ghosts_mode==FRIGHTENED) { + // ghost dies + ghost1_direction = STOP; ghost1_xfine = 50; ghost1_yfine = 35; ghost1_substep = 0; ghost1_respawn = 50; + } else { + // pacman dies + pacman_lives--; + spawn_all(); + } + } else if(ABS[pacman_xfine-ghost2_xfine]<2 && ABS[pacman_yfine-ghost2_yfine]<2) { + if(ghosts_mode==FRIGHTENED) { + ghost2_direction = STOP; ghost2_xfine = 50; ghost2_yfine = 35; ghost2_substep = 0; ghost2_respawn = 50; + } else { + // pacman dies + pacman_lives--; + spawn_all(); + } + } else if(ABS[pacman_xfine-ghost3_xfine]<2 && ABS[pacman_yfine-ghost3_yfine]<2) { + if(ghosts_mode==FRIGHTENED) { + ghost3_direction = STOP; ghost3_xfine = 50; ghost3_yfine = 35; ghost3_substep = 0; ghost3_respawn = 50; + } else { + // pacman dies + pacman_lives--; + spawn_all(); + } + } else if(ABS[pacman_xfine-ghost4_xfine]<2 && ABS[pacman_yfine-ghost4_yfine]<2) { + if(ghosts_mode==FRIGHTENED) { + ghost4_direction = STOP; ghost4_xfine = 50; ghost4_yfine = 35; ghost4_substep = 0; ghost4_respawn = 50; + } else { + // pacman dies + pacman_lives--; + spawn_all(); + } + } + } else if(game_logic_substep==3 || game_logic_substep==7) { + // Update animation and bobs + + anim_frame_idx = (anim_frame_idx+1) & 3; + + char pacman_bob_xfine = pacman_xfine-1; + bobs_xcol[0] = pacman_bob_xfine/4; + bobs_yfine[0] = pacman_yfine-1; + bobs_bob_id[0] = pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3); + + char ghost_frame_idx = anim_frame_idx; + if(ghosts_mode==FRIGHTENED) + ghost_frame_idx |= 0x40; + + char ghost1_bob_xfine = ghost1_xfine-1; + bobs_xcol[1] = ghost1_bob_xfine/4; + bobs_yfine[1] = ghost1_yfine-1; + bobs_bob_id[1] = ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3); + + char ghost2_bob_xfine = ghost2_xfine-1; + bobs_xcol[2] = ghost2_bob_xfine/4; + bobs_yfine[2] = ghost2_yfine-1; + bobs_bob_id[2] = ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3); + + char ghost3_bob_xfine = ghost3_xfine-1; + bobs_xcol[3] = ghost3_bob_xfine/4; + bobs_yfine[3] = ghost3_yfine-1; + bobs_bob_id[3] = ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3); + + char ghost4_bob_xfine = ghost4_xfine-1; + bobs_xcol[4] = ghost4_bob_xfine/4; + bobs_yfine[4] = ghost4_yfine-1; + bobs_bob_id[4] = ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3); + } + +} + +// Lookup the absolute value of a signed number +// PRE_ and POST_ are used to ensure lookup of ABS-1,y works for y=0 and ABS+1,y works for y=0xff +export __align(0x100) char ABS_PRE[1] = { 1 }; +export char ABS[0x100] = kickasm {{ + .for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } +}}; +export char ABS_POST[1] = { 0 }; + +// Choose the open direction that brings the ghost closest to the target +// Uses Manhattan distance calculation +char choose_direction( char open_directions, char ghost_xtile, char ghost_ytile, char target_xtile, char target_ytile ) { + char xdiff = ghost_xtile-target_xtile; + char ydiff = ghost_ytile-target_ytile; + char direction = STOP; + char dist_min = 0xff; + if(open_directions&UP) { + char dist_up = ABS[xdiff] + ABS[ydiff-1]; + if(dist_up +#include "code-merger.c" + +void main() { + merge_code(DEST_CODE, RASTER_CODE, LOGIC_CODE); +} + +// Unrolled raster code. +// The format is a bunch of blocks with the following structure: +// * $ff +// * : some bytes of code. any number of bytes are allowed. +// $ff : signals the end of a block. +// : if is 00 then this is the end of the unrolled raster code. +// If is non-zero it means that cycles must be spent here. The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed. +char RASTER_CODE[] = kickasm {{ + .macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + lda #0 + sta $d020 + RASTER_CYCLES(10) + lda #1 + sta $d020 + RASTER_CYCLES(20) + lda #2 + sta $d020 + RASTER_CYCLES(20) + lda #3 + sta $d020 + RASTER_CYCLES(0) // End of raster code +}}; + +// Unrolled logic code. +// The format is a bunch of blocks with the following structure: +// * $ff +// : if is 00 then this is the end of the unrolled logic code. +// If is non-zero it holds the number of cycles used by the block of code. +// * : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by +// $ff : signals the end of a block. +char LOGIC_CODE[] = kickasm {{ + .macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + LOGIC_BEGIN(2) + clc + LOGIC_END() + LOGIC_BEGIN(8) + lda #4 + adc $fc + sta $fc + LOGIC_END() + LOGIC_BEGIN(8) + lda #0 + adc $fd + sta $fd + LOGIC_END() + LOGIC_BEGIN(8) + lda #0 + sta $fa + sta $fb + LOGIC_END() + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + LOGIC_BEGIN(9) + lda ($fc),y + sta $fa + sta $fb + LOGIC_END() + LOGIC_BEGIN(9) + lda ($fc),y + sta $fa + sta $fb + LOGIC_END() + LOGIC_BEGIN(9) + lda ($fc),y + sta $fa + sta $fb + LOGIC_END() + LOGIC_BEGIN(9) + lda ($fc),y + sta $fa + sta $fb + LOGIC_END() + LOGIC_BEGIN(0) // end of logic code +}}; + +// The destination code +char DEST_CODE[1000]; + diff --git a/src/test/kc/complex/borderline_pacman/test-music.c b/src/test/kc/complex/borderline_pacman/test-music.c new file mode 100644 index 000000000..2b77d210b --- /dev/null +++ b/src/test/kc/complex/borderline_pacman/test-music.c @@ -0,0 +1,41 @@ +// Test the music player + +#pragma target(c64) +#pragma emulator("C64Debugger") +#include +#include <6502.h> + + +// SID tune +__address(0x3000) char INTRO_MUSIC[] = kickasm(resource "pacman-2chn-simpler.prg") {{ + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) +}}; + +// Pointer to the music init routine +void()* const musicInit = (void()*) INTRO_MUSIC+0x00; +// Pointer to the music play routine +void()* const musicPlay = (void()*) INTRO_MUSIC+0x06; + + +void main() { + + asm { + // Disable SID CH3 + //lda #1 + //sta INTRO_MUSIC+$69 + } + + asm { lda #0 } + (*musicInit)(); + + for(;;) { + while(VICII->RASTER!=0xfe) ; + (*musicPlay)(); + } + +} + + + + diff --git a/src/test/ref/complex/borderline_pacman/pacman.asm b/src/test/ref/complex/borderline_pacman/pacman.asm new file mode 100644 index 000000000..31a5f13ce --- /dev/null +++ b/src/test/ref/complex/borderline_pacman/pacman.asm @@ -0,0 +1,4848 @@ +// Camelot Borderline Entry +// Pacman made with 9 sprites in in the borders + // Commodore 64 PRG executable file +.plugin "se.triad.kickass.CruncherPlugins" +.file [name="pacman.prg", type="prg", segments="Program", modify="B2exe", _jmpAdress=__start] +.segmentdef Program [segments="Code, Data, Init"] +.segmentdef Code [start=$810] +.segmentdef Data [startAfter="Code"] +.segmentdef Init [startAfter="Data"] + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The offset of the sprite pointers from the screen start address + .const OFFSET_SPRITE_PTRS = $3f8 + .const VICII_RST8 = $80 + .const VICII_ECM = $40 + .const VICII_BMM = $20 + .const VICII_DEN = $10 + .const VICII_RSEL = 8 + // Bits for the VICII IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // RAM in all three areas 0xA000, 0xD000, 0xE000 + .const PROCPORT_RAM_ALL = 0 + // RAM in 0xA000, 0xE000 I/O in 0xD000 + .const PROCPORT_RAM_IO = 5 + // The colors of the C64 + .const BLACK = 0 + .const RED = 2 + .const BLUE = 6 + .const YELLOW = 7 + .const EMPTY = 0 + .const PILL = 1 + .const POWERUP = 2 + .const WALL = 4 + // Address of the (decrunched) splash screen + .const BOB_ROW_SIZE = $80 + .const RENDER_OFFSET_CANVAS_LO = 0 + .const RENDER_OFFSET_CANVAS_HI = $50 + .const RENDER_OFFSET_YPOS_INC = $a0 + // The number of bobs rendered + .const NUM_BOBS = 5 + // The size of the BOB restore structure + .const SIZE_BOB_RESTORE = $12 + // Size of the crunched music + .const INTRO_MUSIC_CRUNCHED_SIZE = $600 + // The raster line for irq_screen_top() + .const IRQ_SCREEN_TOP_LINE = 5 + .const STOP = 0 + .const UP = 4 + .const DOWN = 8 + .const LEFT = $10 + .const RIGHT = $20 + .const CHASE = 0 + .const SCATTER = 1 + .const FRIGHTENED = 2 + .const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 + .const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 + .const OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 + .const OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 + .const OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 + .const OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 + .const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 + .const SIZEOF_BYTE = 1 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_COLOR = $d027 + .label RASTER = $d012 + .label BORDER_COLOR = $d020 + .label VICII_CONTROL1 = $d011 + .label VICII_CONTROL2 = $d016 + .label VICII_MEMORY = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // Channel 1 Frequency High byte + .label SID_CH1_FREQ_HI = $d401 + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // The SID MOS 6581/8580 + .label SID = $d400 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // The CIA#1: keyboard matrix, joystick #1/#2 + .label CIA1 = $dc00 + // The CIA#2: Serial bus, RS-232, VIC memory bank + .label CIA2 = $dd00 + // CIA#1 Interrupt for reading in ASM + .label CIA1_INTERRUPT = $dc0d + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // Graphics Bank 1 + // Address of the sprites + .label BANK_1 = $4000 + // Address of the sprites + .label SPRITES_1 = $6000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_1 = $4000 + // Graphics Bank 2 + // Address of the sprites + .label BANK_2 = $c000 + // Address of the sprites + .label SPRITES_2 = $e000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_2 = $c000 + // The location where the logic code will be located before merging + .label LOGIC_CODE_UNMERGED = $e000 + // The location where the screen raster code will be located before merging + .label RASTER_CODE_UNMERGED = $6000 + // The location where the screen raster code will be located when running + .label RASTER_CODE = $8000 + // Address of the (decrunched) splash screen + .label SPLASH = $4000 + // Address for the victory graphics + .label WIN_GFX = $a700 + // Address for the gameover graphics + .label GAMEOVER_GFX = $a700 + // Address used by (decrunched) tiles + .label LEVEL_TILES = $4800 + .label TILES_LEFT = LEVEL_TILES+$a00 + .label TILES_RIGHT = LEVEL_TILES+$a80 + .label TILES_TYPE = LEVEL_TILES+$b00 + // Address used for table containing available directions for all tiles + // TABLE LEVEL_TILES_DIRECTIONS[64*37] + // The level data is organized as 37 rows of 64 bytes. Each row is 50 bytes containing DIRECTION bits plus 14 unused bytes to achieve 64-byte alignment. + .label LEVEL_TILES_DIRECTIONS = $3e00 + .label BOB_MASK_LEFT = $5400 + .label BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 + .label BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c + .label BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 + // Tables pointing to the graphics. + // Each page represents one X column (1 byte wide, 4 MC pixels) + // On each page: + // - 0xNN00-0xNN4A : low-byte of the graphics for (X-column, Y-fine) + // - 0xNN50-0xNN9A : high-byte of the graphics for (X-column, Y-fine) + // - 0xNNA0-0xNNEA : index into RENDER_YPOS_INC for incrementing the y-pos. + .label RENDER_INDEX = $b600 + // Upper memory location used during decrunching + .label INTRO_MUSIC_CRUNCHED_UPPER = $a700 + // Address of the music during run-time + .label INTRO_MUSIC = $3000 + // Pointer to the music init routine + .label musicInit = INTRO_MUSIC + // Pointer to the music play routine + .label musicPlay = INTRO_MUSIC+6 + // Is the pacman eating sound enabled + .label pacman_ch1_enabled = $d + // Index into the eating sound + .label pacman_ch1_idx = $e + // Pointer to the tile to render in the logic code + .label logic_tile_ptr = $f + // The x-column of the tile to render + .label logic_tile_xcol = $11 + // The y-fine of the tile to render + .label logic_tile_yfine = $12 + // The ID*4 of the left tile to render + .label logic_tile_left_idx = $13 + // The ID*4 of the right tile to render + .label logic_tile_right_idx = $14 + // Variables used by the logic-code renderer and restorer + .label left_render_index_xcol = $15 + .label left_canvas = $17 + .label left_ypos_inc_offset = $19 + .label rigt_render_index_xcol = $1a + .label rigt_canvas = $1c + .label rigt_ypos_inc_offset = $1e + // The high-byte of the start-address of the canvas currently being rendered to + .label canvas_base_hi = $1f + // The offset used for bobs_restore - used to achieve double buffering + .label bobs_restore_base = $20 + // Sprite settings used for the top/side/bottom sprites. + // Used for achieving single-color sprites on the splash and multi-color sprites in the game + .label top_sprites_color = $21 + .label top_sprites_mc = $22 + .label side_sprites_color = $23 + .label side_sprites_mc = $24 + .label bottom_sprites_color = $25 + .label bottom_sprites_mc = $26 + // The number of pills left + .label pill_count = $27 + // 1 When pacman wins + .label pacman_wins = $29 + // The number of pacman lives left + .label pacman_lives = $2a + // Signal for playing th next music frame during the intro + .label music_play_next = $2b + // 0: intro, 1: game + .label phase = $2c + // The double buffer frame (0=BANK_1, 1=BANK_2) + .label frame = $2d + // The animation frame IDX (within the current direction) [0-3] + .label anim_frame_idx = $2e + // Pacman x fine position (0-99). + .label pacman_xfine = $2f + // Pacman y fine position (0-70). + .label pacman_yfine = $30 + // The pacman movement current direction + .label pacman_direction = $31 + // Pacman movement substep (0: on tile, 1: between tiles). + .label pacman_substep = $32 + // Mode determining ghost target mode. 0: chase, 1: scatter + .label ghosts_mode = $33 + // Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase ) + .label ghosts_mode_count = $34 + // Ghost 1 x fine position (0-99). + .label ghost1_xfine = $35 + // Ghost 1 y fine position (0-70). + .label ghost1_yfine = $36 + // Ghost 1 movement current direction + .label ghost1_direction = $37 + // Ghost 1 movement substep (0: on tile, 1: between tiles). + .label ghost1_substep = $38 + // Ghost 1 movement should be reversed (0: normal, 1: reverse direction) + .label ghost1_reverse = $39 + // Ghost 1 respawn timer + .label ghost1_respawn = $3a + // Ghost 2 x fine position (0-99). + .label ghost2_xfine = $3b + // Ghost 2 y fine position (0-70). + .label ghost2_yfine = $3c + // Ghost 2 movement current direction + .label ghost2_direction = $3d + // Ghost 2 movement substep (0: on tile, 1: between tiles). + .label ghost2_substep = $3e + // Ghost 2 movement should be reversed (0: normal, 1: reverse direction) + .label ghost2_reverse = $3f + // Ghost 2 respawn timer + .label ghost2_respawn = $40 + // Ghost 3 x fine position (0-99). + .label ghost3_xfine = $41 + // Ghost 3 y fine position (0-70). + .label ghost3_yfine = $42 + // Ghost 3 movement current direction + .label ghost3_direction = $43 + // Ghost 3 movement substep (0: on tile, 1: between tiles). + .label ghost3_substep = $44 + // Ghost 3 movement should be reversed (0: normal, 1: reverse direction) + .label ghost3_reverse = $45 + // Ghost 3 respawn timer + .label ghost3_respawn = $46 + // Ghost 4 x fine position (0-99). + .label ghost4_xfine = $47 + // Ghost 4 y fine position (0-70). + .label ghost4_yfine = $48 + // Ghost 4 movement current direction + .label ghost4_direction = $49 + // Ghost 4 movement substep (0: on tile, 1: between tiles). + .label ghost4_substep = $4a + // Ghost 4 movement should be reversed (0: normal, 1: reverse direction) + .label ghost4_reverse = $4b + // Ghost 4 respawn timer + .label ghost4_respawn = $4c + // Game logic sub-step [0-7]. Each frame a different sub-step is animated + .label game_logic_substep = $4d + // 1 when the game is playable and characters should move around + .label game_playable = $4e +.segment Code +__start: { + // pacman_ch1_enabled = 0 + lda #0 + sta.z pacman_ch1_enabled + // pacman_ch1_idx = 0 + sta.z pacman_ch1_idx + // logic_tile_ptr + sta.z logic_tile_ptr + sta.z logic_tile_ptr+1 + // logic_tile_xcol + sta.z logic_tile_xcol + // logic_tile_yfine + sta.z logic_tile_yfine + // logic_tile_left_idx + sta.z logic_tile_left_idx + // logic_tile_right_idx + sta.z logic_tile_right_idx + // left_render_index_xcol + sta.z left_render_index_xcol + sta.z left_render_index_xcol+1 + // left_canvas + sta.z left_canvas + sta.z left_canvas+1 + // left_ypos_inc_offset + sta.z left_ypos_inc_offset + // rigt_render_index_xcol + sta.z rigt_render_index_xcol + sta.z rigt_render_index_xcol+1 + // rigt_canvas + sta.z rigt_canvas + sta.z rigt_canvas+1 + // rigt_ypos_inc_offset + sta.z rigt_ypos_inc_offset + // canvas_base_hi + sta.z canvas_base_hi + // bobs_restore_base + sta.z bobs_restore_base + // top_sprites_color + sta.z top_sprites_color + // top_sprites_mc + sta.z top_sprites_mc + // side_sprites_color + sta.z side_sprites_color + // side_sprites_mc + sta.z side_sprites_mc + // bottom_sprites_color + sta.z bottom_sprites_color + // bottom_sprites_mc + sta.z bottom_sprites_mc + // pill_count + sta.z pill_count + sta.z pill_count+1 + // pacman_wins = 0 + sta.z pacman_wins + // pacman_lives = 3 + lda #3 + sta.z pacman_lives + // music_play_next = 0 + lda #0 + sta.z music_play_next + // phase = 0 + sta.z phase + // frame = 0 + sta.z frame + // anim_frame_idx = 0 + sta.z anim_frame_idx + // pacman_xfine = 45 + lda #$2d + sta.z pacman_xfine + // pacman_yfine = 35 + lda #$23 + sta.z pacman_yfine + // pacman_direction = STOP + lda #STOP + sta.z pacman_direction + // pacman_substep = 0 + lda #0 + sta.z pacman_substep + // ghosts_mode = 1 + lda #1 + sta.z ghosts_mode + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + // ghost1_xfine = 45 + lda #$2d + sta.z ghost1_xfine + // ghost1_yfine = 35 + lda #$23 + sta.z ghost1_yfine + // ghost1_direction = STOP + lda #STOP + sta.z ghost1_direction + // ghost1_substep = 0 + lda #0 + sta.z ghost1_substep + // ghost1_reverse = 0 + sta.z ghost1_reverse + // ghost1_respawn = 0 + sta.z ghost1_respawn + // ghost2_xfine = 45 + lda #$2d + sta.z ghost2_xfine + // ghost2_yfine = 35 + lda #$23 + sta.z ghost2_yfine + // ghost2_direction = STOP + lda #STOP + sta.z ghost2_direction + // ghost2_substep = 0 + lda #0 + sta.z ghost2_substep + // ghost2_reverse = 0 + sta.z ghost2_reverse + // ghost2_respawn = 0 + sta.z ghost2_respawn + // ghost3_xfine = 45 + lda #$2d + sta.z ghost3_xfine + // ghost3_yfine = 35 + lda #$23 + sta.z ghost3_yfine + // ghost3_direction = STOP + lda #STOP + sta.z ghost3_direction + // ghost3_substep = 0 + lda #0 + sta.z ghost3_substep + // ghost3_reverse = 0 + sta.z ghost3_reverse + // ghost3_respawn = 0 + sta.z ghost3_respawn + // ghost4_xfine = 45 + lda #$2d + sta.z ghost4_xfine + // ghost4_yfine = 35 + lda #$23 + sta.z ghost4_yfine + // ghost4_direction = STOP + lda #STOP + sta.z ghost4_direction + // ghost4_substep = 0 + lda #0 + sta.z ghost4_substep + // ghost4_reverse = 0 + sta.z ghost4_reverse + // ghost4_respawn = 0 + sta.z ghost4_respawn + // game_logic_substep = 0 + sta.z game_logic_substep + // game_playable = 0 + sta.z game_playable + jsr main + rts +} +// Interrupt Routine at Screen Top +irq_screen_top: { + .const toDd001_return = 0 + .const toDd002_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + sta rega+1 + stx regx+1 + sty regy+1 + // kickasm + // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + + // asm + jsr RASTER_CODE + // VICII->SPRITE0_Y =7 + // Move sprites back to the top + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y + // VICII->SPRITE1_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y + // VICII->SPRITE2_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y + // VICII->SPRITE3_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y + // VICII->SPRITE4_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y + // VICII->SPRITE5_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y + // VICII->SPRITE6_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y + // VICII->SPRITE7_Y =7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y + // VICII->MEMORY = toD018(SCREENS_1, SCREENS_1) + // Select first screen (graphics bank not important since layout in the banks is identical) + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // VICII->SPRITES_MC = top_sprites_mc + // Set the top sprites color/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // VICII->SPRITE0_COLOR = top_sprites_color + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR + // VICII->SPRITE1_COLOR = top_sprites_color + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR + // frame+1 + lda.z frame + clc + adc #1 + // (frame+1) & 1 + and #1 + // frame = (frame+1) & 1 + // Move to next frame + sta.z frame + // if(frame) + bne __b6 + // CIA2->PORT_A = toDd00(SCREENS_1) + // Change graphics bank + lda #toDd002_return + sta CIA2 + // canvas_base_hi = >SPRITES_2 + // Set the next canvas base address + lda #>SPRITES_2 + sta.z canvas_base_hi + // bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + __b1: + // if(phase==0) + lda.z phase + beq __b2 + // game_logic() + // Game phase + // Perform game logic + jsr game_logic + // pacman_sound_play() + // Play sounds + jsr pacman_sound_play + __b3: + // VICII->IRQ_STATUS = IRQ_RASTER + // Acknowledge the IRQ + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + // Trigger IRQ at screen top again + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // } + rega: + lda #0 + regx: + ldx #0 + regy: + ldy #0 + rti + __b2: + // music_play_next = 1 + // intro phase + // Play intro music + lda #1 + sta.z music_play_next + jmp __b3 + __b6: + // CIA2->PORT_A = toDd00(SCREENS_2) + // Change graphics bank + lda #toDd001_return + sta CIA2 + // canvas_base_hi = >SPRITES_1 + // Set the next canvas base address + lda #>SPRITES_1 + sta.z canvas_base_hi + // bobs_restore_base = 0 + lda #0 + sta.z bobs_restore_base + jmp __b1 +} +main: { + // splash_run() + // Show the splash screen + jsr splash_run + __b1: + // gameplay_run() + // Run the gameplay + jsr gameplay_run + // done_run() + // Show victory or game over image + jsr done_run + jmp __b1 +} +// Perform game logic such as moving pacman and ghosts +game_logic: { + .label __67 = $51 + .label __71 = $51 + .label __210 = $50 + .label ghost_frame_idx = 2 + .label pacman_xtile = $4f + .label ytiles = $51 + .label ghost4_xtile = $53 + .label ghost4_ytile = 4 + .label target_ytile = 3 + .label ghost3_xtile = $54 + .label ghost3_ytile = 4 + .label target_ytile1 = 3 + .label ghost2_xtile = $55 + .label ghost2_ytile = 4 + .label target_ytile2 = 3 + .label ghost1_xtile = $56 + .label ghost1_ytile = 4 + .label target_ytile3 = 3 + // if(game_playable==0) + lda.z game_playable + bne __b1 + __breturn: + // } + rts + __b1: + // game_logic_substep+1 + ldx.z game_logic_substep + inx + // (game_logic_substep+1)&7 + txa + and #7 + // game_logic_substep = (game_logic_substep+1)&7 + // Move to next sub-step + sta.z game_logic_substep + // if(game_logic_substep==0) + bne !__b2+ + jmp __b2 + !__b2: + // if(game_logic_substep==1) + lda #1 + cmp.z game_logic_substep + bne !__b3+ + jmp __b3 + !__b3: + // if(game_logic_substep==2) + lda #2 + cmp.z game_logic_substep + bne !__b4+ + jmp __b4 + !__b4: + // if(game_logic_substep==4) + lda #4 + cmp.z game_logic_substep + bne !__b5+ + jmp __b5 + !__b5: + // if(game_logic_substep==5) + lda #5 + cmp.z game_logic_substep + bne !__b6+ + jmp __b6 + !__b6: + // if(game_logic_substep==6) + lda #6 + cmp.z game_logic_substep + bne !__b7+ + jmp __b7 + !__b7: + // if(game_logic_substep==3 || game_logic_substep==7) + lda #3 + cmp.z game_logic_substep + beq __b14 + lda #7 + cmp.z game_logic_substep + beq __b14 + rts + __b14: + // anim_frame_idx+1 + ldx.z anim_frame_idx + inx + // (anim_frame_idx+1) & 3 + txa + and #3 + // anim_frame_idx = (anim_frame_idx+1) & 3 + // Update animation and bobs + sta.z anim_frame_idx + // pacman_bob_xfine = pacman_xfine-1 + lda.z pacman_xfine + tay + dey + // pacman_bob_xfine/4 + tya + lsr + lsr + // bobs_xcol[0] = pacman_bob_xfine/4 + sta bobs_xcol + // pacman_yfine-1 + ldx.z pacman_yfine + dex + // bobs_yfine[0] = pacman_yfine-1 + stx bobs_yfine + // pacman_direction|anim_frame_idx + lda.z pacman_direction + ora.z anim_frame_idx + tax + // pacman_bob_xfine&3 + tya + and #3 + // pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3) + clc + adc pacman_frames,x + // bobs_bob_id[0] = pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3) + sta bobs_bob_id + // ghost_frame_idx = anim_frame_idx + lda.z anim_frame_idx + sta.z ghost_frame_idx + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b44 + // ghost_frame_idx |= 0x40 + lda #$40 + ora.z ghost_frame_idx + sta.z ghost_frame_idx + __b44: + // ghost1_bob_xfine = ghost1_xfine-1 + lda.z ghost1_xfine + tay + dey + // ghost1_bob_xfine/4 + tya + lsr + lsr + // bobs_xcol[1] = ghost1_bob_xfine/4 + sta bobs_xcol+1 + // ghost1_yfine-1 + ldx.z ghost1_yfine + dex + // bobs_yfine[1] = ghost1_yfine-1 + stx bobs_yfine+1 + // ghost1_direction|ghost_frame_idx + lda.z ghost1_direction + ora.z ghost_frame_idx + tax + // ghost1_bob_xfine&3 + tya + and #3 + // ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3) + clc + adc ghost_frames,x + // bobs_bob_id[1] = ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3) + sta bobs_bob_id+1 + // ghost2_bob_xfine = ghost2_xfine-1 + lda.z ghost2_xfine + tay + dey + // ghost2_bob_xfine/4 + tya + lsr + lsr + // bobs_xcol[2] = ghost2_bob_xfine/4 + sta bobs_xcol+2 + // ghost2_yfine-1 + ldx.z ghost2_yfine + dex + // bobs_yfine[2] = ghost2_yfine-1 + stx bobs_yfine+2 + // ghost2_direction|ghost_frame_idx + lda.z ghost2_direction + ora.z ghost_frame_idx + tax + // ghost2_bob_xfine&3 + tya + and #3 + // ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3) + clc + adc ghost_frames,x + // bobs_bob_id[2] = ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3) + sta bobs_bob_id+2 + // ghost3_bob_xfine = ghost3_xfine-1 + lda.z ghost3_xfine + tay + dey + // ghost3_bob_xfine/4 + tya + lsr + lsr + // bobs_xcol[3] = ghost3_bob_xfine/4 + sta bobs_xcol+3 + // ghost3_yfine-1 + ldx.z ghost3_yfine + dex + // bobs_yfine[3] = ghost3_yfine-1 + stx bobs_yfine+3 + // ghost3_direction|ghost_frame_idx + lda.z ghost3_direction + ora.z ghost_frame_idx + tax + // ghost3_bob_xfine&3 + tya + and #3 + // ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3) + clc + adc ghost_frames,x + // bobs_bob_id[3] = ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3) + sta bobs_bob_id+3 + // ghost4_bob_xfine = ghost4_xfine-1 + lda.z ghost4_xfine + tay + dey + // ghost4_bob_xfine/4 + tya + lsr + lsr + // bobs_xcol[4] = ghost4_bob_xfine/4 + sta bobs_xcol+4 + // ghost4_yfine-1 + ldx.z ghost4_yfine + dex + // bobs_yfine[4] = ghost4_yfine-1 + stx bobs_yfine+4 + // ghost4_direction|ghost_frame_idx + lda.z ghost4_direction + ora.z ghost_frame_idx + tax + // ghost4_bob_xfine&3 + tya + and #3 + // ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3) + clc + adc ghost_frames,x + // bobs_bob_id[4] = ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3) + sta bobs_bob_id+4 + rts + __b7: + // ghosts_mode_count++; + inc.z ghosts_mode_count + // if(ghosts_mode==SCATTER) + lda #SCATTER + cmp.z ghosts_mode + bne !__b45+ + jmp __b45 + !__b45: + // if(ghosts_mode==CHASE) + lda #CHASE + cmp.z ghosts_mode + bne !__b46+ + jmp __b46 + !__b46: + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b9 + // if(ghosts_mode_count>50) + lda.z ghosts_mode_count + cmp #$32+1 + bcc __b9 + // ghosts_mode = CHASE + lda #CHASE + sta.z ghosts_mode + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + __b8: + lda #1 + jmp __b47 + __b9: + lda #0 + __b47: + // if(do_reverse) + cmp #0 + beq __b48 + // ghost1_reverse = 1 + lda #1 + sta.z ghost1_reverse + // ghost2_reverse = 1 + sta.z ghost2_reverse + // ghost3_reverse = 1 + sta.z ghost3_reverse + // ghost4_reverse = 1 + sta.z ghost4_reverse + __b48: + // pacman_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + sta.z pacman_xtile + // pacman_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + // LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile] + asl + sta.z __210 + // ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile] + tay + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // tile_id = ytiles[pacman_xtile] + ldy.z pacman_xtile + lda (ytiles),y + tax + // if(TILES_TYPE[tile_id]==PILL) + lda TILES_TYPE,x + cmp #PILL + bne !__b49+ + jmp __b49 + !__b49: + // if(TILES_TYPE[tile_id]==POWERUP) + lda TILES_TYPE,x + cmp #POWERUP + bne __b50 + // ytiles[pacman_xtile] = EMPTY + // Empty the tile + lda #EMPTY + sta (ytiles),y + // pacman_xtile/2 + tya + lsr + // logic_tile_xcol = pacman_xtile/2 + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // pacman_xtile & 0xfe + lda #$fe + and.z pacman_xtile + // ytiles + (pacman_xtile & 0xfe) + clc + adc.z __67 + sta.z __67 + bcc !+ + inc.z __67+1 + !: + // logic_tile_ptr = ytiles + (pacman_xtile & 0xfe) + lda.z __67 + sta.z logic_tile_ptr + lda.z __67+1 + sta.z logic_tile_ptr+1 + // pacman_ytile*2 + lda.z __210 + // logic_tile_yfine = pacman_ytile*2 + sta.z logic_tile_yfine + // ghosts_mode = FRIGHTENED + // Start power-up mode + lda #FRIGHTENED + sta.z ghosts_mode + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + __b50: + // pacman_xfine-ghost1_xfine + lda.z pacman_xfine + sec + sbc.z ghost1_xfine + tax + // pacman_yfine-ghost1_yfine + lda.z pacman_yfine + sec + sbc.z ghost1_yfine + tay + // if(ABS[pacman_xfine-ghost1_xfine]<2 && ABS[pacman_yfine-ghost1_yfine]<2) + // Check if anyone dies + lda ABS,x + cmp #2 + bcs __b64 + lda ABS,y + cmp #2 + bcs !__b51+ + jmp __b51 + !__b51: + __b64: + // pacman_xfine-ghost2_xfine + lda.z pacman_xfine + sec + sbc.z ghost2_xfine + tax + // pacman_yfine-ghost2_yfine + lda.z pacman_yfine + sec + sbc.z ghost2_yfine + tay + // if(ABS[pacman_xfine-ghost2_xfine]<2 && ABS[pacman_yfine-ghost2_yfine]<2) + lda ABS,x + cmp #2 + bcs __b65 + lda ABS,y + cmp #2 + bcc __b52 + __b65: + // pacman_xfine-ghost3_xfine + lda.z pacman_xfine + sec + sbc.z ghost3_xfine + tax + // pacman_yfine-ghost3_yfine + lda.z pacman_yfine + sec + sbc.z ghost3_yfine + tay + // if(ABS[pacman_xfine-ghost3_xfine]<2 && ABS[pacman_yfine-ghost3_yfine]<2) + lda ABS,x + cmp #2 + bcs __b66 + lda ABS,y + cmp #2 + bcc __b53 + __b66: + // pacman_xfine-ghost4_xfine + lda.z pacman_xfine + sec + sbc.z ghost4_xfine + tax + // pacman_yfine-ghost4_yfine + lda.z pacman_yfine + sec + sbc.z ghost4_yfine + tay + // if(ABS[pacman_xfine-ghost4_xfine]<2 && ABS[pacman_yfine-ghost4_yfine]<2) + lda ABS,x + cmp #2 + bcc !__breturn+ + jmp __breturn + !__breturn: + lda ABS,y + cmp #2 + bcc __b67 + rts + __b67: + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b54 + // pacman_lives--; + dec.z pacman_lives + // spawn_all() + jsr spawn_all + rts + __b54: + // ghost4_direction = STOP + lda #STOP + sta.z ghost4_direction + // ghost4_xfine = 50 + lda #$32 + sta.z ghost4_xfine + // ghost4_yfine = 35 + lda #$23 + sta.z ghost4_yfine + // ghost4_substep = 0 + lda #0 + sta.z ghost4_substep + // ghost4_respawn = 50 + lda #$32 + sta.z ghost4_respawn + rts + __b53: + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b55 + // pacman_lives--; + dec.z pacman_lives + // spawn_all() + jsr spawn_all + rts + __b55: + // ghost3_direction = STOP + lda #STOP + sta.z ghost3_direction + // ghost3_xfine = 50 + lda #$32 + sta.z ghost3_xfine + // ghost3_yfine = 35 + lda #$23 + sta.z ghost3_yfine + // ghost3_substep = 0 + lda #0 + sta.z ghost3_substep + // ghost3_respawn = 50 + lda #$32 + sta.z ghost3_respawn + rts + __b52: + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b56 + // pacman_lives--; + dec.z pacman_lives + // spawn_all() + jsr spawn_all + rts + __b56: + // ghost2_direction = STOP + lda #STOP + sta.z ghost2_direction + // ghost2_xfine = 50 + lda #$32 + sta.z ghost2_xfine + // ghost2_yfine = 35 + lda #$23 + sta.z ghost2_yfine + // ghost2_substep = 0 + lda #0 + sta.z ghost2_substep + // ghost2_respawn = 50 + lda #$32 + sta.z ghost2_respawn + rts + __b51: + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b57 + // pacman_lives--; + dec.z pacman_lives + // spawn_all() + jsr spawn_all + rts + __b57: + // ghost1_direction = STOP + // ghost dies + lda #STOP + sta.z ghost1_direction + // ghost1_xfine = 50 + lda #$32 + sta.z ghost1_xfine + // ghost1_yfine = 35 + lda #$23 + sta.z ghost1_yfine + // ghost1_substep = 0 + lda #0 + sta.z ghost1_substep + // ghost1_respawn = 50 + lda #$32 + sta.z ghost1_respawn + rts + __b49: + // ytiles[pacman_xtile] = EMPTY + // Empty the tile + lda #EMPTY + ldy.z pacman_xtile + sta (ytiles),y + // pacman_xtile/2 + tya + lsr + // logic_tile_xcol = pacman_xtile/2 + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // pacman_xtile & 0xfe + lda #$fe + and.z pacman_xtile + // ytiles + (pacman_xtile & 0xfe) + clc + adc.z __71 + sta.z __71 + bcc !+ + inc.z __71+1 + !: + // logic_tile_ptr = ytiles + (pacman_xtile & 0xfe) + lda.z __71 + sta.z logic_tile_ptr + lda.z __71+1 + sta.z logic_tile_ptr+1 + // pacman_ytile*2 + lda.z __210 + // logic_tile_yfine = pacman_ytile*2 + sta.z logic_tile_yfine + // if(--pill_count==0) + lda.z pill_count + bne !+ + dec.z pill_count+1 + !: + dec.z pill_count + lda.z pill_count + ora.z pill_count+1 + beq !__b50+ + jmp __b50 + !__b50: + // pacman_wins = 1 + lda #1 + sta.z pacman_wins + jmp __b50 + __b46: + // if(ghosts_mode_count>150) + lda.z ghosts_mode_count + cmp #$96+1 + bcs !__b9+ + jmp __b9 + !__b9: + // ghosts_mode = SCATTER + lda #SCATTER + sta.z ghosts_mode + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + jmp __b8 + __b45: + // if(ghosts_mode_count>50) + lda.z ghosts_mode_count + cmp #$32+1 + bcs !__b9+ + jmp __b9 + !__b9: + // ghosts_mode = CHASE + lda #CHASE + sta.z ghosts_mode + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + jmp __b8 + __b6: + // if(ghost4_respawn) + // Ghost spawn timer + lda.z ghost4_respawn + beq !__b72+ + jmp __b72 + !__b72: + // if(ghost4_direction==RIGHT) + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost4_direction + bne !__b73+ + jmp __b73 + !__b73: + // if(ghost4_direction==DOWN) + lda #DOWN + cmp.z ghost4_direction + bne !__b74+ + jmp __b74 + !__b74: + // if(ghost4_direction==LEFT) + lda #LEFT + cmp.z ghost4_direction + bne !__b75+ + jmp __b75 + !__b75: + // if(ghost4_direction==UP) + lda #UP + cmp.z ghost4_direction + bne __b76 + // --ghost4_yfine; + dec.z ghost4_yfine + __b76: + // ghost4_direction!=STOP + ldx.z ghost4_direction + // if(ghost4_substep==0 && ghost4_direction!=STOP) + lda.z ghost4_substep + bne __b82 + cpx #STOP + bne __b77 + __b82: + // ghost4_substep = 0 + // Ghost is on a tile + lda #0 + sta.z ghost4_substep + // if(ghost4_reverse) + lda.z ghost4_reverse + bne __b78 + // ghost4_xtile = ghost4_xfine/2 + lda.z ghost4_xfine + lsr + sta.z ghost4_xtile + // ghost4_ytile = ghost4_yfine/2 + lda.z ghost4_yfine + lsr + sta.z ghost4_ytile + // level_tile_directions(ghost4_xtile, ghost4_ytile) + ldx.z ghost4_xtile + jsr level_tile_directions + // level_tile_directions(ghost4_xtile, ghost4_ytile) + // open_directions = level_tile_directions(ghost4_xtile, ghost4_ytile) + // open_directions &= DIRECTION_ELIMINATE[ghost4_direction] + // Eliminate the direction ghost came from + ldy.z ghost4_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b79 + // if(ghosts_mode==SCATTER) + lda #SCATTER + cmp.z ghosts_mode + beq __b10 + // target_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + sta.z target_ytile + jmp __b80 + __b10: + lda #2 + sta.z target_ytile + tax + __b80: + // choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + sty.z choose_direction.open_directions + ldy.z ghost4_xtile + jsr choose_direction + // choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + lda.z choose_direction.return + // ghost4_direction = choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + sta.z ghost4_direction + rts + __b79: + // ghost4_direction = DIRECTION_SINGLE[open_directions] + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost4_direction + rts + __b78: + // ghost4_direction = DIRECTION_REVERSE[ghost4_direction] + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost4_direction + lda DIRECTION_REVERSE,y + sta.z ghost4_direction + // ghost4_reverse = 0 + lda #0 + sta.z ghost4_reverse + rts + __b77: + // ghost4_substep = 1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost4_substep + // if(ghost4_xfine==1) + // Teleport if we are in the magic positions + cmp.z ghost4_xfine + beq __b81 + // if(ghost4_xfine==97) + lda #$61 + cmp.z ghost4_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost4_xfine = 1 + lda #1 + sta.z ghost4_xfine + rts + __b81: + // ghost4_xfine = 97 + lda #$61 + sta.z ghost4_xfine + rts + __b75: + // --ghost4_xfine; + dec.z ghost4_xfine + jmp __b76 + __b74: + // ++ghost4_yfine; + inc.z ghost4_yfine + jmp __b76 + __b73: + // ++ghost4_xfine; + inc.z ghost4_xfine + jmp __b76 + __b72: + // if(--ghost4_respawn==0) + dec.z ghost4_respawn + lda.z ghost4_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost4_direction = RIGHT + // Spawn ghost + lda #RIGHT + sta.z ghost4_direction + // ghost4_xfine = 2 + lda #2 + sta.z ghost4_xfine + // ghost4_yfine = 2 + sta.z ghost4_yfine + // ghost4_substep = 0 + lda #0 + sta.z ghost4_substep + rts + __b5: + // if(ghost3_respawn) + // Ghost spawn timer + lda.z ghost3_respawn + beq !__b89+ + jmp __b89 + !__b89: + // if(ghost3_direction==RIGHT) + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost3_direction + bne !__b90+ + jmp __b90 + !__b90: + // if(ghost3_direction==DOWN) + lda #DOWN + cmp.z ghost3_direction + bne !__b91+ + jmp __b91 + !__b91: + // if(ghost3_direction==LEFT) + lda #LEFT + cmp.z ghost3_direction + bne !__b92+ + jmp __b92 + !__b92: + // if(ghost3_direction==UP) + lda #UP + cmp.z ghost3_direction + bne __b93 + // --ghost3_yfine; + dec.z ghost3_yfine + __b93: + // ghost3_direction!=STOP + ldx.z ghost3_direction + // if(ghost3_substep==0 && ghost3_direction!=STOP) + lda.z ghost3_substep + bne __b99 + cpx #STOP + bne __b94 + __b99: + // ghost3_substep = 0 + // Ghost is on a tile + lda #0 + sta.z ghost3_substep + // if(ghost3_reverse) + lda.z ghost3_reverse + bne __b95 + // ghost3_xtile = ghost3_xfine/2 + lda.z ghost3_xfine + lsr + sta.z ghost3_xtile + // ghost3_ytile = ghost3_yfine/2 + lda.z ghost3_yfine + lsr + sta.z ghost3_ytile + // level_tile_directions(ghost3_xtile, ghost3_ytile) + ldx.z ghost3_xtile + jsr level_tile_directions + // level_tile_directions(ghost3_xtile, ghost3_ytile) + // open_directions = level_tile_directions(ghost3_xtile, ghost3_ytile) + // open_directions &= DIRECTION_ELIMINATE[ghost3_direction] + // Eliminate the direction ghost came from + ldy.z ghost3_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b96 + // if(ghosts_mode==SCATTER) + lda #SCATTER + cmp.z ghosts_mode + beq __b11 + // target_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + sta.z target_ytile1 + jmp __b97 + __b11: + lda #2 + sta.z target_ytile1 + tax + __b97: + // choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + sty.z choose_direction.open_directions + ldy.z ghost3_xtile + jsr choose_direction + // choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + lda.z choose_direction.return + // ghost3_direction = choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + sta.z ghost3_direction + rts + __b96: + // ghost3_direction = DIRECTION_SINGLE[open_directions] + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost3_direction + rts + __b95: + // ghost3_direction = DIRECTION_REVERSE[ghost3_direction] + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost3_direction + lda DIRECTION_REVERSE,y + sta.z ghost3_direction + // ghost3_reverse = 0 + lda #0 + sta.z ghost3_reverse + rts + __b94: + // ghost3_substep = 1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost3_substep + // if(ghost3_xfine==1) + // Teleport if we are in the magic positions + cmp.z ghost3_xfine + beq __b98 + // if(ghost3_xfine==97) + lda #$61 + cmp.z ghost3_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost3_xfine = 1 + lda #1 + sta.z ghost3_xfine + rts + __b98: + // ghost3_xfine = 97 + lda #$61 + sta.z ghost3_xfine + rts + __b92: + // --ghost3_xfine; + dec.z ghost3_xfine + jmp __b93 + __b91: + // ++ghost3_yfine; + inc.z ghost3_yfine + jmp __b93 + __b90: + // ++ghost3_xfine; + inc.z ghost3_xfine + jmp __b93 + __b89: + // if(--ghost3_respawn==0) + dec.z ghost3_respawn + lda.z ghost3_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost3_direction = UP + // Spawn ghost + lda #UP + sta.z ghost3_direction + // ghost3_xfine = 2 + lda #2 + sta.z ghost3_xfine + // ghost3_yfine = 70 + lda #$46 + sta.z ghost3_yfine + // ghost3_substep = 0 + lda #0 + sta.z ghost3_substep + rts + __b4: + // if(ghost2_respawn) + // Ghost spawn timer + lda.z ghost2_respawn + beq !__b106+ + jmp __b106 + !__b106: + // if(ghost2_direction==RIGHT) + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost2_direction + bne !__b107+ + jmp __b107 + !__b107: + // if(ghost2_direction==DOWN) + lda #DOWN + cmp.z ghost2_direction + bne !__b108+ + jmp __b108 + !__b108: + // if(ghost2_direction==LEFT) + lda #LEFT + cmp.z ghost2_direction + bne !__b109+ + jmp __b109 + !__b109: + // if(ghost2_direction==UP) + lda #UP + cmp.z ghost2_direction + bne __b110 + // --ghost2_yfine; + dec.z ghost2_yfine + __b110: + // ghost2_direction!=STOP + ldx.z ghost2_direction + // if(ghost2_substep==0 && ghost2_direction!=STOP) + lda.z ghost2_substep + bne __b116 + cpx #STOP + bne __b111 + __b116: + // ghost2_substep = 0 + // Ghost is on a tile + lda #0 + sta.z ghost2_substep + // if(ghost2_reverse) + lda.z ghost2_reverse + bne __b112 + // ghost2_xtile = ghost2_xfine/2 + lda.z ghost2_xfine + lsr + sta.z ghost2_xtile + // ghost2_ytile = ghost2_yfine/2 + lda.z ghost2_yfine + lsr + sta.z ghost2_ytile + // level_tile_directions(ghost2_xtile, ghost2_ytile) + ldx.z ghost2_xtile + jsr level_tile_directions + // level_tile_directions(ghost2_xtile, ghost2_ytile) + // open_directions = level_tile_directions(ghost2_xtile, ghost2_ytile) + // open_directions &= DIRECTION_ELIMINATE[ghost2_direction] + // Eliminate the direction ghost came from + ldy.z ghost2_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b113 + // if(ghosts_mode==SCATTER) + lda #SCATTER + cmp.z ghosts_mode + beq __b12 + // target_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + sta.z target_ytile2 + jmp __b114 + __b12: + lda #2 + sta.z target_ytile2 + tax + __b114: + // choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + sty.z choose_direction.open_directions + ldy.z ghost2_xtile + jsr choose_direction + // choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + lda.z choose_direction.return + // ghost2_direction = choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + sta.z ghost2_direction + rts + __b113: + // ghost2_direction = DIRECTION_SINGLE[open_directions] + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost2_direction + rts + __b112: + // ghost2_direction = DIRECTION_REVERSE[ghost2_direction] + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost2_direction + lda DIRECTION_REVERSE,y + sta.z ghost2_direction + // ghost2_reverse = 0 + lda #0 + sta.z ghost2_reverse + rts + __b111: + // ghost2_substep = 1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost2_substep + // if(ghost2_xfine==1) + // Teleport if we are in the magic positions + cmp.z ghost2_xfine + beq __b115 + // if(ghost2_xfine==97) + lda #$61 + cmp.z ghost2_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost2_xfine = 1 + lda #1 + sta.z ghost2_xfine + rts + __b115: + // ghost2_xfine = 97 + lda #$61 + sta.z ghost2_xfine + rts + __b109: + // --ghost2_xfine; + dec.z ghost2_xfine + jmp __b110 + __b108: + // ++ghost2_yfine; + inc.z ghost2_yfine + jmp __b110 + __b107: + // ++ghost2_xfine; + inc.z ghost2_xfine + jmp __b110 + __b106: + // if(--ghost2_respawn==0) + dec.z ghost2_respawn + lda.z ghost2_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost2_direction = LEFT + // Spawn ghost + lda #LEFT + sta.z ghost2_direction + // ghost2_xfine = 96 + lda #$60 + sta.z ghost2_xfine + // ghost2_yfine = 70 + lda #$46 + sta.z ghost2_yfine + // ghost2_substep = 0 + lda #0 + sta.z ghost2_substep + rts + __b3: + // if(ghost1_respawn) + // Ghost spawn timer + lda.z ghost1_respawn + beq !__b123+ + jmp __b123 + !__b123: + // if(ghost1_direction==RIGHT) + // Ghost 1 animation + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost1_direction + bne !__b124+ + jmp __b124 + !__b124: + // if(ghost1_direction==DOWN) + lda #DOWN + cmp.z ghost1_direction + bne !__b125+ + jmp __b125 + !__b125: + // if(ghost1_direction==LEFT) + lda #LEFT + cmp.z ghost1_direction + bne !__b126+ + jmp __b126 + !__b126: + // if(ghost1_direction==UP) + lda #UP + cmp.z ghost1_direction + bne __b127 + // --ghost1_yfine; + dec.z ghost1_yfine + __b127: + // ghost1_direction!=STOP + ldx.z ghost1_direction + // if(ghost1_substep==0 && ghost1_direction!=STOP) + lda.z ghost1_substep + bne __b133 + cpx #STOP + bne __b128 + __b133: + // ghost1_substep = 0 + // Ghost is on a tile + lda #0 + sta.z ghost1_substep + // if(ghost1_reverse) + lda.z ghost1_reverse + bne __b129 + // ghost1_xtile = ghost1_xfine/2 + lda.z ghost1_xfine + lsr + sta.z ghost1_xtile + // ghost1_ytile = ghost1_yfine/2 + lda.z ghost1_yfine + lsr + sta.z ghost1_ytile + // level_tile_directions(ghost1_xtile, ghost1_ytile) + ldx.z ghost1_xtile + jsr level_tile_directions + // level_tile_directions(ghost1_xtile, ghost1_ytile) + // open_directions = level_tile_directions(ghost1_xtile, ghost1_ytile) + // open_directions &= DIRECTION_ELIMINATE[ghost1_direction] + // Eliminate the direction ghost came from + ldy.z ghost1_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b130 + // if(ghosts_mode==SCATTER) + lda #SCATTER + cmp.z ghosts_mode + beq __b13 + // target_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + sta.z target_ytile3 + jmp __b131 + __b13: + lda #2 + sta.z target_ytile3 + tax + __b131: + // choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + sty.z choose_direction.open_directions + ldy.z ghost1_xtile + jsr choose_direction + // choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + lda.z choose_direction.return + // ghost1_direction = choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + sta.z ghost1_direction + rts + __b130: + // ghost1_direction = DIRECTION_SINGLE[open_directions] + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost1_direction + rts + __b129: + // ghost1_direction = DIRECTION_REVERSE[ghost1_direction] + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost1_direction + lda DIRECTION_REVERSE,y + sta.z ghost1_direction + // ghost1_reverse = 0 + lda #0 + sta.z ghost1_reverse + rts + __b128: + // ghost1_substep = 1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost1_substep + // if(ghost1_xfine==1) + // Teleport if we are in the magic positions + cmp.z ghost1_xfine + beq __b132 + // if(ghost1_xfine==97) + lda #$61 + cmp.z ghost1_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost1_xfine = 1 + lda #1 + sta.z ghost1_xfine + rts + __b132: + // ghost1_xfine = 97 + lda #$61 + sta.z ghost1_xfine + rts + __b126: + // --ghost1_xfine; + dec.z ghost1_xfine + jmp __b127 + __b125: + // ++ghost1_yfine; + inc.z ghost1_yfine + jmp __b127 + __b124: + // ++ghost1_xfine; + inc.z ghost1_xfine + jmp __b127 + __b123: + // if(--ghost1_respawn==0) + dec.z ghost1_respawn + lda.z ghost1_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // ghost1_direction = DOWN + // Spawn ghost 1 + lda #DOWN + sta.z ghost1_direction + // ghost1_xfine = 96 + lda #$60 + sta.z ghost1_xfine + // ghost1_yfine = 2 + lda #2 + sta.z ghost1_yfine + // ghost1_substep = 0 + lda #0 + sta.z ghost1_substep + rts + __b2: + // if(pacman_direction==RIGHT) + // Animate pacman + // Move pacman in the current direction (unless he is stopped) + lda #RIGHT + cmp.z pacman_direction + beq __b140 + // if(pacman_direction==DOWN) + lda #DOWN + cmp.z pacman_direction + beq __b141 + // if(pacman_direction==LEFT) + lda #LEFT + cmp.z pacman_direction + beq __b142 + // if(pacman_direction==UP) + lda #UP + cmp.z pacman_direction + bne __b143 + // --pacman_yfine; + dec.z pacman_yfine + __b143: + // pacman_direction!=STOP + ldx.z pacman_direction + // if(pacman_substep==0 && pacman_direction!=STOP) + lda.z pacman_substep + bne __b147 + cpx #STOP + bne __b144 + __b147: + // pacman_substep = 0 + // Pacman is on a (new) tile + lda #0 + sta.z pacman_substep + // pacman_xtile = pacman_xfine/2 + lda.z pacman_xfine + lsr + tax + // pacman_ytile = pacman_yfine/2 + lda.z pacman_yfine + lsr + // level_tile_directions(pacman_xtile, pacman_ytile) + jsr level_tile_directions + // level_tile_directions(pacman_xtile, pacman_ytile) + // open_directions = level_tile_directions(pacman_xtile, pacman_ytile) + tax + // CIA1->PORT_A & 0x0f + lda #$f + and CIA1 + // (CIA1->PORT_A & 0x0f)^0x0f + eor #$f + // joy_directions = ((CIA1->PORT_A & 0x0f)^0x0f)*4 + asl + asl + // if(joy_directions!=0) + cmp #0 + beq __b145 + // joy_directions&open_directions + stx.z $ff + and.z $ff + // new_direction = DIRECTION_SINGLE[joy_directions&open_directions] + tay + lda DIRECTION_SINGLE,y + // if(new_direction!=0) + cmp #0 + beq __b145 + // pacman_direction = new_direction + sta.z pacman_direction + __b145: + // pacman_direction &= open_directions + // Stop pacman if the current direction is no longer open + lda.z pacman_direction + sax.z pacman_direction + rts + __b144: + // pacman_substep = 1 + // Pacman was on a tile and is moving, so he is now between tiles + lda #1 + sta.z pacman_substep + // pacman_ch1_enabled = 1 + // Enable the eating sound whenever pacman is moving + sta.z pacman_ch1_enabled + // if(pacman_xfine==1) + // Teleport if we are in the magic positions + cmp.z pacman_xfine + beq __b146 + // if(pacman_xfine==97) + lda #$61 + cmp.z pacman_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // pacman_xfine = 1 + lda #1 + sta.z pacman_xfine + rts + __b146: + // pacman_xfine = 97 + lda #$61 + sta.z pacman_xfine + rts + __b142: + // --pacman_xfine; + dec.z pacman_xfine + jmp __b143 + __b141: + // ++pacman_yfine; + inc.z pacman_yfine + jmp __b143 + __b140: + // ++pacman_xfine; + inc.z pacman_xfine + jmp __b143 +} +pacman_sound_play: { + // if(pacman_ch1_enabled) + lda.z pacman_ch1_enabled + beq __breturn + // *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] + // Play the entire sound - and then reset and disable it + ldy.z pacman_ch1_idx + lda PACMAN_CH1_FREQ_HI,y + sta SID_CH1_FREQ_HI + // SID->CH1_CONTROL = PACMAN_CH1_CONTROL[pacman_ch1_idx] + lda PACMAN_CH1_CONTROL,y + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // if(++pacman_ch1_idx==sizeof(PACMAN_CH1_FREQ_HI)) + inc.z pacman_ch1_idx + lda #$16*SIZEOF_BYTE + cmp.z pacman_ch1_idx + bne __breturn + // pacman_ch1_idx = 0 + lda #0 + sta.z pacman_ch1_idx + // pacman_ch1_enabled = 0 + sta.z pacman_ch1_enabled + __breturn: + // } + rts +} +// Initializes all data for the splash and shows the splash. +// Returns when the splash is complete and the user clicks the joystidk #2 button +splash_run: { + .const toDd001_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + .label xpos = $59 + .label i = 5 + // asm + sei + // CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT + // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + // Disable kernal & basic & IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // *PROCPORT = PROCPORT_RAM_ALL + lda #PROCPORT_RAM_ALL + sta PROCPORT + // memset(0x4000, 0, 0xc00) + // Reset memory to avoid crashes + lda #<$4000 + sta.z memset.str + lda #>$4000 + sta.z memset.str+1 + lda #<$c00 + sta.z memset.num + lda #>$c00 + sta.z memset.num+1 + jsr memset + // byteboozer_decrunch(RASTER_CODE_CRUNCHED) + lda #RASTER_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // Decrunch raster code + jsr byteboozer_decrunch + // byteboozer_decrunch(LOGIC_CODE_CRUNCHED) + lda #LOGIC_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // Decrunch logic code + jsr byteboozer_decrunch + // merge_code(RASTER_CODE, RASTER_CODE_UNMERGED, LOGIC_CODE_UNMERGED) + // Merge the raster with the logic-code + jsr merge_code + // memset(BANK_1+0x2000, 0x00, 0x1fff) + // Clear the graphics banks + lda #BANK_1+$2000 + sta.z memset.str+1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // memset(BANK_2, 0x00, 0x3fff) + lda #BANK_2 + sta.z memset.str+1 + lda #<$3fff + sta.z memset.num + lda #>$3fff + sta.z memset.num+1 + jsr memset + // init_render_index() + // Initialize the renderer tables + jsr init_render_index + // byteboozer_decrunch(SPLASH_CRUNCHED) + lda #SPLASH_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // decrunch splash screen + jsr byteboozer_decrunch + // splash_show() + // Show the splash screen + jsr splash_show + // memset(BANK_1, 0x00, 0x1fff) + // Clear the graphics bank + lda #BANK_1 + sta.z memset.str+1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // init_bobs_restore() + // Initialize bobs_restore to "safe" values + jsr init_bobs_restore + // byteboozer_decrunch(BOB_GRAPHICS_CRUNCHED) + lda #BOB_GRAPHICS_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // decrunch bobs graphics tables + jsr byteboozer_decrunch + // init_sprite_pointers() + // Set sprite pointers on all screens (in both graphics banks) + jsr init_sprite_pointers + // memcpy(INTRO_MUSIC_CRUNCHED_UPPER, INTRO_MUSIC_CRUNCHED, INTRO_MUSIC_CRUNCHED_SIZE) + // Move the crunched music to upper memory before decrunching it + jsr memcpy + // byteboozer_decrunch(INTRO_MUSIC_CRUNCHED_UPPER) + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z byteboozer_decrunch.crunched+1 + // zero-fill the entire Init segment + //memset(LEVEL_TILES_CRUNCHED, 0, INTRO_MUSIC_CRUNCHED+INTRO_MUSIC_CRUNCHED_SIZE-LEVEL_TILES_CRUNCHED); + // decrunch intro music + jsr byteboozer_decrunch + // memset(INTRO_MUSIC_CRUNCHED_UPPER, 0, INTRO_MUSIC_CRUNCHED_SIZE) + // Zero-fill the upper memory + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z memset.str+1 + lda #INTRO_MUSIC_CRUNCHED_SIZE + sta.z memset.num+1 + jsr memset + // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + // Disable kernal & basic - enable IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // *PROCPORT = PROCPORT_RAM_IO + lda #PROCPORT_RAM_IO + sta PROCPORT + ldx #0 + txa + sta.z i + __b1: + // for(char i=0;i<8;i++) + lda.z i + cmp #8 + bcs !__b2+ + jmp __b2 + !__b2: + // CIA2->PORT_A = toDd00(SCREENS_1) + // Set initial graphics bank + lda #toDd001_return + sta CIA2 + // canvas_base_hi = >SPRITES_2 + // Set initial render/restore buffer + lda #>SPRITES_2 + sta.z canvas_base_hi + // bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + // VICII->MEMORY = toD018(SCREENS_1, SCREENS_1) + // Select first screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // VICII->SPRITES_XMSB = msb + stx VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB + // VICII->SPRITES_ENABLE = 0xff + lda #$ff + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE + // VICII->SPRITES_EXPAND_X = 0xff + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X + // VICII->BORDER_COLOR = BLACK + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // VICII->BG_COLOR = BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR + // VICII->SPRITES_MCOLOR1 = BLUE + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = RED + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // top_sprites_mc = 0x03 + // On the splash screen sprites all sprites are SC - except sprite #0,1 on the top/bottom of the screen + lda #3 + sta.z top_sprites_mc + // side_sprites_mc = 0x00 + lda #0 + sta.z side_sprites_mc + // bottom_sprites_mc = 0x03 + lda #3 + sta.z bottom_sprites_mc + // top_sprites_color = YELLOW + // On the splash top/bottom sc-sprites are yellow and side-sprites are blue + lda #YELLOW + sta.z top_sprites_color + // side_sprites_color = BLUE + lda #BLUE + sta.z side_sprites_color + // bottom_sprites_color = YELLOW + lda #YELLOW + sta.z bottom_sprites_color + // VICII->SPRITES_MC = top_sprites_mc + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + ldx #0 + // Set initial Sprite Color + __b5: + // for(char i=0;i<8;i++) + cpx #8 + bcc __b6 + // VICII->CONTROL2 = 0x08 + // Set VICII CONTROL2 ($d016) to 8 to allow ASL, LSR to be used for opening the border + lda #8 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + ldx #0 + // Move the bobs to the center to avoid interference while rendering the level + __b8: + // for(char i=0;i<4;i++) + cpx #4 + bcc __b9 + // asm + // Disable SID CH#3 + lda #1 + sta INTRO_MUSIC+$69 + // Init music + lda #0 + // (*musicInit)() + jsr musicInit + // phase = 0 + // Set phase to intro + lda #0 + sta.z phase + // VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + // Set an illegal mode to prevent any character graphics + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // Wait for line 0xfa (lower border) + __b11: + // while(VICII->RASTER!=0xfa) + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + // VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // VICII->IRQ_ENABLE = IRQ_RASTER + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // *IRQ_STATUS = 0x0f + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + // asm + cli + // joyinit() + // Prepare for joystick control + jsr joyinit + // music_play_next = 0 + // Wait for fire + lda #0 + sta.z music_play_next + __b13: + // joyfire() + jsr joyfire + // while(!joyfire()) + cmp #0 + beq __b14 + // } + rts + __b14: + // if(music_play_next) + lda.z music_play_next + beq __b13 + // (*musicPlay)() + //VICII->BG_COLOR=1; + jsr musicPlay + // music_play_next = 0 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13 + __b9: + // bobs_xcol[i] = 10 + lda #$a + sta bobs_xcol,x + // bobs_yfine[i] = 45 + lda #$2d + sta bobs_yfine,x + // bobs_bob_id[i] = 0 + lda #0 + sta bobs_bob_id,x + // for(char i=0;i<4;i++) + inx + jmp __b8 + __b6: + // SPRITES_COLOR[i] = top_sprites_color + lda.z top_sprites_color + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + inx + jmp __b5 + __b2: + // i*2 + lda.z i + asl + tay + // SPRITES_YPOS[i*2] = 7 + lda #7 + sta SPRITES_YPOS,y + // xpos = sprites_xpos[i] + lda sprites_xpos,y + sta.z xpos + lda sprites_xpos+1,y + sta.z xpos+1 + // SPRITES_XPOS[i*2] = (char)xpos + lda.z xpos + sta SPRITES_XPOS,y + // msb /= 2 + txa + lsr + tax + // >xpos + lda.z xpos+1 + // if((>xpos)) + cmp #0 + beq __b3 + // msb |=0x80 + txa + ora #$80 + tax + __b3: + // for(char i=0;i<8;i++) + inc.z i + jmp __b1 + .segment Data + // Sprite positions + sprites_xpos: .word $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f +} +.segment Code +// Initialize all data for gameplay and runs the game. +// Exits when the user has won or lost +gameplay_run: { + .label __4 = $b + // asm + sei + ldx #0 + // Stop any sound + __b1: + // for(char i=0;i<0x2f;i++) + cpx #$2f + bcs !__b2+ + jmp __b2 + !__b2: + // pacman_wins = 0 + // Pacman has not won yet + lda #0 + sta.z pacman_wins + // pacman_lives = 3 + // Pacman has 3 lives + lda #3 + sta.z pacman_lives + // VICII->SPRITES_MCOLOR1 = BLACK + // During transition all sprites are black + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + ldx #0 + __b4: + // for(char i=0;i<8;i++) + cpx #8 + bcs !__b5+ + jmp __b5 + !__b5: + // byteboozer_decrunch(LEVEL_TILES_CRUNCHED) + lda #LEVEL_TILES_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // decrunch level tiles + jsr byteboozer_decrunch + // init_level_tile_directions() + // Initialize tile directions + jsr init_level_tile_directions + // init_sprite_pointers() + // Set sprite pointers on all screens (in both graphics banks) + jsr init_sprite_pointers + // level_show() + jsr level_show + // level_show() + // pill_count = level_show() + // Show the level + lda.z __4 + sta.z pill_count + lda.z __4+1 + sta.z pill_count+1 + // top_sprites_mc = 0xff + // During gameplay all sprites are MC. + lda #$ff + sta.z top_sprites_mc + // side_sprites_mc = 0xff + sta.z side_sprites_mc + // bottom_sprites_mc = 0xff + sta.z bottom_sprites_mc + // top_sprites_color = YELLOW + // During gameplay all sprites are yellow + lda #YELLOW + sta.z top_sprites_color + // side_sprites_color = YELLOW + sta.z side_sprites_color + // bottom_sprites_color = YELLOW + sta.z bottom_sprites_color + // VICII->SPRITES_MC = top_sprites_mc + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + ldx #0 + // Set initial Sprite Color + __b7: + // for(char i=0;i<8;i++) + cpx #8 + bcc __b8 + // VICII->SPRITES_MCOLOR1 = BLUE + // Set sprite MC-colors for the game + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = RED + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // phase = 1 + // Set phase to game + lda #1 + sta.z phase + // spawn_all() + // Spawn pacman and all ghosts + jsr spawn_all + // pacman_sound_init() + // Initialize the game sound + jsr pacman_sound_init + // game_playable = 1 + // Start the game play + lda #1 + sta.z game_playable + // VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + // Turn on raster after transition + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // Wait at least one frames for DEN to take effect + __b10: + // while(VICII->RASTER!=0xfb) + lda #$fb + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b10 + __b11: + // while(VICII->RASTER!=0xfa) + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + // VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // VICII->IRQ_ENABLE = IRQ_RASTER + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // *IRQ_STATUS = 0x0f + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + // asm + cli + __b13: + // if(pacman_wins || pacman_lives==0) + lda.z pacman_wins + bne __breturn + lda.z pacman_lives + beq __breturn + jmp __b13 + __breturn: + // } + rts + __b8: + // SPRITES_COLOR[i] = top_sprites_color + lda.z top_sprites_color + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + inx + jmp __b7 + __b5: + // SPRITES_COLOR[i] = BLACK + lda #BLACK + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + inx + jmp __b4 + __b2: + // ((char*)SID)[i] = 0 + lda #0 + sta SID,x + // for(char i=0;i<0x2f;i++) + inx + jmp __b1 +} +// Show Victory or Game Over Image +// Returns when the user clicks the joystick button +done_run: { + // Show the win graphics + .label gfx = $59 + .label ypos = 6 + .label xcol = 5 + // game_playable = 0 + // Stop the game play + lda #0 + sta.z game_playable + // phase = 0 + // Set phase to intro + sta.z phase + tax + // Stop any sound + __b2: + // for(char i=0;i<0x2f;i++) + cpx #$2f + bcs !__b3+ + jmp __b3 + !__b3: + ldx #0 + // Move the bobs to the center to avoid interference while rendering the level + __b4: + // for(char i=0;i<4;i++) + cpx #4 + bcc __b5 + // asm + // Init music + lda #0 + // (*musicInit)() + jsr musicInit + // if(pacman_wins) + lda.z pacman_wins + bne __b1 + // byteboozer_decrunch(GAMEOVER_GFX_CRUNCHED) + lda #GAMEOVER_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // decrunch game over graphics + jsr byteboozer_decrunch + __b6: + lda #WIN_GFX + sta.z gfx+1 + lda #0 + sta.z xcol + __b8: + // for(char xcol=0;xcol<25;xcol++) + lda.z xcol + cmp #$19 + bcc __b7 + // music_play_next = 0 + // Wait for fire + lda #0 + sta.z music_play_next + __b13: + // joyfire() + jsr joyfire + // while(!joyfire()) + cmp #0 + beq __b14 + // } + rts + __b14: + // if(music_play_next) + lda.z music_play_next + beq __b13 + // (*musicPlay)() + //VICII->BG_COLOR=1; + jsr musicPlay + // music_play_next = 0 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13 + __b7: + lda #0 + sta.z ypos + __b10: + // for(char ypos=0;ypos<25;ypos++) + lda.z ypos + cmp #$19 + bcc __b11 + // for(char xcol=0;xcol<25;xcol++) + inc.z xcol + jmp __b8 + __b11: + // pixels = *gfx++ + // Render 8px x 1px + ldy #0 + lda (gfx),y + tax + inc.z gfx + bne !+ + inc.z gfx+1 + !: + // render(xcol, ypos, pixels) + stx.z render.pixels + jsr render + // for(char ypos=0;ypos<25;ypos++) + inc.z ypos + jmp __b10 + __b1: + // byteboozer_decrunch(WIN_GFX_CRUNCHED) + lda #WIN_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // decrunch win graphics + jsr byteboozer_decrunch + jmp __b6 + __b5: + // bobs_xcol[i] = 10 + lda #$a + sta bobs_xcol,x + // bobs_yfine[i] = 45 + lda #$2d + sta bobs_yfine,x + // bobs_bob_id[i] = 0 + lda #0 + sta bobs_bob_id,x + // for(char i=0;i<4;i++) + inx + jmp __b4 + __b3: + // ((char*)SID)[i] = 0 + lda #0 + sta SID,x + // for(char i=0;i<0x2f;i++) + inx + jmp __b2 +} +// Spawn pacman and all ghosts +spawn_all: { + // ghosts_mode_count = 0 + lda #0 + sta.z ghosts_mode_count + // pacman_substep = 0 + sta.z pacman_substep + // ghost1_substep = 0 + sta.z ghost1_substep + // ghost2_substep = 0 + sta.z ghost2_substep + // ghost3_substep = 0 + sta.z ghost3_substep + // ghost4_substep = 0 + sta.z ghost4_substep + // pacman_direction = STOP + lda #STOP + sta.z pacman_direction + // ghost1_direction = STOP + sta.z ghost1_direction + // ghost2_direction = STOP + sta.z ghost2_direction + // ghost3_direction = STOP + sta.z ghost3_direction + // ghost4_direction = STOP + sta.z ghost4_direction + // pacman_xfine = 50 + lda #$32 + sta.z pacman_xfine + // ghost1_xfine = 50 + sta.z ghost1_xfine + // ghost2_xfine = 50 + sta.z ghost2_xfine + // ghost3_xfine = 50 + sta.z ghost3_xfine + // ghost4_xfine = 50 + sta.z ghost4_xfine + // ghost1_yfine = 35 + lda #$23 + sta.z ghost1_yfine + // ghost2_yfine = 35 + sta.z ghost2_yfine + // ghost3_yfine = 35 + sta.z ghost3_yfine + // ghost4_yfine = 35 + sta.z ghost4_yfine + // pacman_yfine = 62 + lda #$3e + sta.z pacman_yfine + // ghost1_respawn = 10 + lda #$a + sta.z ghost1_respawn + // ghost2_respawn = 20 + lda #$14 + sta.z ghost2_respawn + // ghost3_respawn = 30 + lda #$1e + sta.z ghost3_respawn + // ghost4_respawn = 40 + lda #$28 + sta.z ghost4_respawn + // } + rts +} +// Get the open directions at a given (xtile, ytile) position +// Returns the open DIRECTIONs as bits +// If xtile of ytile is outside the legal range the empty tile (0) is returned +// level_tile_directions(byte register(X) xtile, byte register(A) ytile) +level_tile_directions: { + .label ytiles = $5b + // if(xtile>49 || ytile>36) + cpx #$31+1 + bcs __b1 + cmp #$24+1 + bcs __b1 + // LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile] + asl + // ytiles = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile] + tay + clc + lda #LEVEL_TILES_DIRECTIONS + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // return ytiles[xtile]; + txa + tay + lda (ytiles),y + rts + __b1: + lda #0 + // } + rts +} +// Choose the open direction that brings the ghost closest to the target +// Uses Manhattan distance calculation +// choose_direction(byte zp($4f) open_directions, byte register(Y) ghost_xtile, byte zp(4) ghost_ytile, byte register(X) target_xtile, byte zp(3) target_ytile) +choose_direction: { + .label open_directions = $4f + .label ghost_ytile = 4 + .label target_ytile = 3 + .label xdiff = $5d + .label ydiff = 4 + .label dist_left = $50 + .label return = $53 + .label direction = $53 + .label dist_min = $50 + // xdiff = ghost_xtile-target_xtile + tya + stx.z $ff + sec + sbc.z $ff + sta.z xdiff + // ydiff = ghost_ytile-target_ytile + lda.z ydiff + sec + sbc.z target_ytile + sta.z ydiff + // open_directions&UP + lda #UP + and.z open_directions + // if(open_directions&UP) + cmp #0 + beq __b5 + // ABS[xdiff] + ABS[ydiff-1] + ldy.z xdiff + lda ABS,y + ldy.z ydiff + clc + adc ABS+-1,y + tay + // if(dist_up0) + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + // end = (char*)str + num + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + __b2: + // for(char* dst = str; dst!=end; dst++) + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + __breturn: + // } + rts + __b3: + // *dst = c + lda #0 + tay + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2 +} +// Decrunch crunched data using ByteBoozer +// - crunched: Pointer to the start of the crunched data +// byteboozer_decrunch(byte* zp($57) crunched) +byteboozer_decrunch: { + .label crunched = $57 + // asm + ldy crunched + ldx crunched+1 + jsr b2.Decrunch + // } + rts +} +// Merge unrolled cycle-exact logic code into an unrolled cycle-exact raster code. +// The logic-code is merged into the raster code ensuring cycle-exact execution. If a logic-code block does not fit within the remaining cycle-budget of a raster-slot then NOPs/BIT $EA are used to reach the cycle-budget. +// If the logic-code runs out before the raster-code ends then the remaining raster-slots are filled with NOP/BIT$EA. +// If the raster-code runs out before the logic-code then the rest of the logic-code is added at the end. +// An RTS is added at the very end. +// +// Parameters: +// - dest_code: Address where the merged code is placed +// - raster_code: The unrolled raster code blocks with information about cycles to be filled. Format is decribed below. +// - logic_code: The unrolled logic code with information about cycles spent. Format is decribed below. +// +// Format of unrolled raster code. +// A number of blocks that have the following structure: +// * 0xff +// * : some bytes of code. any number of bytes are allowed. +// 0xff : signals the end of a block. +// : If is 00 then this is the last block of the unrolled raster code. +// If is non-zero it means that cycles must be spent here (the cycle budget of the slot). The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed. +// +// Format of unrolled logic code. +// A number of blocks that has the following structure: +// * 0xff +// : If is 00 then this is the last block of the unrolled logic code. No more bytes are used. +// If is non-zero it holds the number of cycles used by the block of code. +// * : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by +// 0xff : signals the end of a block. +// merge_code(byte* zp($b) dest_code, byte* zp($63) raster_code, byte* zp($59) logic_code) +merge_code: { + // Cycle-count signalling the last block of the logic-code + .const LOGIC_EXIT = 0 + // Value signalling the end of a block of the logic-code + .const LOGIC_END = $ff + // Cycle-count signalling the last block of the raster-code + .const RASTER_EXIT = 0 + // Value signalling the end of a block of the raster-code + .const RASTER_END = $ff + .label dest_code = $b + .label raster_code = $63 + .label logic_cycles = $60 + .label logic_code = $59 + lda #LOGIC_CODE_UNMERGED + sta.z logic_code+1 + lda #RASTER_CODE + sta.z dest_code+1 + lda #RASTER_CODE_UNMERGED + sta.z raster_code+1 + // Output raster code until meeting RASTER_END signalling the end of a block + __b1: + // while(*raster_code!=RASTER_END) + ldy #0 + lda (raster_code),y + cmp #RASTER_END + beq !__b2+ + jmp __b2 + !__b2: + // raster_code++; + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // cycle_budget = *raster_code++ + // Find the number of cycles + ldy #0 + lda (raster_code),y + tax + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // if(cycle_budget==RASTER_EXIT) + cpx #RASTER_EXIT + bne __b4 + __b3: + // No more raster code - fill in the rest of the logic code + // while(*logic_code!=LOGIC_EXIT) + ldy #0 + lda (logic_code),y + cmp #LOGIC_EXIT + bne __b15 + // *dest_code++ = 0x60 + // And add an RTS + lda #$60 + sta (dest_code),y + // } + rts + __b15: + // logic_code++; + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + __b5: + // Fill in the logic-code + // while(*logic_code!=LOGIC_END) + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b18 + // logic_code++; + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b3 + __b18: + // *dest_code++ = *logic_code++ + ldy #0 + lda (logic_code),y + sta (dest_code),y + // *dest_code++ = *logic_code++; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b5 + // Fit the cycle budget with logic-code + __b4: + // while(cycle_budget>0) + cpx #0 + beq __b6 + // logic_cycles = *logic_code + // Find the number of logic code cycles + ldy #0 + lda (logic_code),y + sta.z logic_cycles + // cycle_budget-1 + txa + tay + dey + // if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget)) + lda #LOGIC_EXIT + cmp.z logic_cycles + bne __b20 + __b6: + // Fit the cycle budget with NOPs + __b10: + // while(cycle_budget>0) + cpx #0 + bne __b11 + jmp __b1 + __b11: + // if(cycle_budget==3) + cpx #3 + beq __b12 + // *dest_code++ = 0xEA + lda #$ea + ldy #0 + sta (dest_code),y + // *dest_code++ = 0xEA; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // cycle_budget -= 2 + // NOP + dex + dex + jmp __b6 + __b12: + // *dest_code++ = 0x24 + lda #$24 + ldy #0 + sta (dest_code),y + // *dest_code++ = 0x24; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // *dest_code++ = 0xEA + // BIT $EA + lda #$ea + ldy #0 + sta (dest_code),y + // *dest_code++ = 0xEA; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // cycle_budget -= 3 + txa + axs #3 + jmp __b6 + __b20: + // if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget)) + cpy.z logic_cycles + beq !+ + bcs __b9 + !: + cpx.z logic_cycles + beq __b9 + jmp __b10 + __b9: + // logic_code++; + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + __b13: + // Fill in the logic-code + // while(*logic_code!=LOGIC_END) + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b7 + // logic_code++; + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // cycle_budget -= logic_cycles + // Reduce the cycle budget + txa + sec + sbc.z logic_cycles + tax + jmp __b4 + __b7: + // *dest_code++ = *logic_code++ + ldy #0 + lda (logic_code),y + sta (dest_code),y + // *dest_code++ = *logic_code++; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b13 + __b2: + // *dest_code++ = *raster_code++ + ldy #0 + lda (raster_code),y + sta (dest_code),y + // *dest_code++ = *raster_code++; + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + jmp __b1 +} +// Initialize the RENDER_INDEX table from sub-tables +init_render_index: { + .label __10 = $61 + .label __11 = $61 + .label render_index_xcol = $59 + .label canvas_xcol = $5e + .label canvas = $61 + .label render_index = $59 + .label x_col = 5 + .label render_index_xcol_1 = $63 + .label y_pos = 6 + // Special column in sprite#9 + .label render_ypos_table = $b + .label __12 = $61 + lda #RENDER_INDEX + sta.z render_index_xcol+1 + lda #0 + sta.z x_col + __b1: + // for(char x_col=0;x_col<26;x_col++) + lda.z x_col + cmp #$1a + bcc __b2 + // (RENDER_INDEX+24*0x100)[RENDER_OFFSET_YPOS_INC] = 0 + // Fix the first entry of the inc_offset in the last column (set it to point to 0,0,6,6...) + lda #0 + sta RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC + // (RENDER_INDEX+25*0x100)[RENDER_OFFSET_YPOS_INC] = 0 + sta RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC + // } + rts + __b2: + // if(x_col>=24) + lda.z x_col + cmp #$18 + bcc __b3 + ldx #$b + lda #RENDER_YPOS_9TH + sta.z render_ypos_table+1 + jmp __b4 + __b3: + ldx #0 + lda #RENDER_YPOS + sta.z render_ypos_table+1 + __b4: + // canvas_xcol = RENDER_XCOLS[x_col] + lda.z x_col + asl + tay + lda RENDER_XCOLS,y + sta.z canvas_xcol + lda RENDER_XCOLS+1,y + sta.z canvas_xcol+1 + lda.z render_index_xcol + sta.z render_index_xcol_1 + lda.z render_index_xcol+1 + sta.z render_index_xcol_1+1 + lda #0 + sta.z y_pos + __b5: + // for(char y_pos=0;y_pos<148;y_pos+=2) + lda.z y_pos + cmp #$94 + bcc __b6 + // render_index += 0x100 + clc + lda.z render_index + adc #<$100 + sta.z render_index + lda.z render_index+1 + adc #>$100 + sta.z render_index+1 + // for(char x_col=0;x_col<26;x_col++) + inc.z x_col + jmp __b1 + __b6: + // canvas_xcol + render_ypos_table[(unsigned int)y_pos] + lda.z y_pos + sta.z __11 + lda #0 + sta.z __11+1 + asl.z __10 + rol.z __10+1 + // canvas = canvas_xcol + render_ypos_table[(unsigned int)y_pos] + lda.z __12 + clc + adc.z render_ypos_table + sta.z __12 + lda.z __12+1 + adc.z render_ypos_table+1 + sta.z __12+1 + ldy #0 + clc + lda (canvas),y + adc.z canvas_xcol + pha + iny + lda (canvas),y + adc.z canvas_xcol+1 + sta.z canvas+1 + pla + sta.z canvas + // canvas + lda.z canvas+1 + // render_index_xcol[RENDER_OFFSET_CANVAS_HI] = >canvas + ldy #RENDER_OFFSET_CANVAS_HI + sta (render_index_xcol_1),y + // render_index_xcol[RENDER_OFFSET_YPOS_INC] = ypos_inc_offset + ldy #RENDER_OFFSET_YPOS_INC + txa + sta (render_index_xcol_1),y + // ypos_inc_offset += 2 + inx + inx + // if(ypos_inc_offset>=23) + cpx #$17 + bcc __b8 + // ypos_inc_offset-=21 + txa + axs #$15 + __b8: + // render_index_xcol++; + inc.z render_index_xcol_1 + bne !+ + inc.z render_index_xcol_1+1 + !: + // y_pos+=2 + lda.z y_pos + clc + adc #2 + sta.z y_pos + jmp __b5 +} +// Show the splash screen +splash_show: { + // Show splash screen + .label splash = $63 + .label ypos = 6 + .label xcol = 5 + lda #SPLASH + sta.z splash+1 + lda #0 + sta.z xcol + __b1: + // for(char xcol=0;xcol<25;xcol++) + lda.z xcol + cmp #$19 + bcc __b4 + // } + rts + __b4: + lda #0 + sta.z ypos + __b2: + // for(char ypos=0;ypos<147;ypos++) + lda.z ypos + cmp #$93 + bcc __b3 + // for(char xcol=0;xcol<25;xcol++) + inc.z xcol + jmp __b1 + __b3: + // pixels = *splash++ + // Render 8px x 1px + ldy #0 + lda (splash),y + tax + inc.z splash + bne !+ + inc.z splash+1 + !: + // render(xcol, ypos, pixels) + stx.z render.pixels + jsr render + // for(char ypos=0;ypos<147;ypos++) + inc.z ypos + jmp __b2 +} +// Initialize bobs_restore with data to prevent crash on the first call +init_bobs_restore: { + .label CANVAS_HIDDEN = $ea00 + .label bob_restore = $b + lda #bobs_restore + sta.z bob_restore+1 + ldx #0 + __b1: + // for(char bob=0;bobLEVEL_TILES+$40*$12+$c + sta.z logic_tile_ptr+1 + // logic_tile_xcol = 12 + lda #$c + sta.z logic_tile_xcol + // logic_tile_yfine = 35 + lda #$23 + sta.z logic_tile_yfine + // } + rts + __b2: + ldy #0 + __b3: + // for(char i=0;iCANVAS_HIDDEN + lda #>CANVAS_HIDDEN + ldy #1 + sta (bob_restore),y + // bob_restore[3] = CANVAS_HIDDEN + lda #>CANVAS_HIDDEN + ldy #4 + sta (bob_restore),y + // bob_restore += SIZE_BOB_RESTORE + lda #SIZE_BOB_RESTORE + clc + adc.z bob_restore + sta.z bob_restore + bcc !+ + inc.z bob_restore+1 + !: + // for(char bob=0;bobSCREENS_2+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_2+1 + lda #SCREENS_1+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_1+1 + ldx #0 + __b1: + // for(char screen=0;screen<14;screen++) + cpx #$e + bcc __b4 + // } + rts + __b4: + ldy #0 + __b2: + // for(char sprite=0; sprite<8; sprite++) + cpy #8 + bcc __b3 + // sprites_ptr_1 += 0x400 + clc + lda.z sprites_ptr_1 + adc #<$400 + sta.z sprites_ptr_1 + lda.z sprites_ptr_1+1 + adc #>$400 + sta.z sprites_ptr_1+1 + // sprites_ptr_2 += 0x400 + clc + lda.z sprites_ptr_2 + adc #<$400 + sta.z sprites_ptr_2 + lda.z sprites_ptr_2+1 + adc #>$400 + sta.z sprites_ptr_2+1 + // for(char screen=0;screen<14;screen++) + inx + jmp __b1 + __b3: + // SPRITE_ID_0 + screen + txa + clc + adc #SPRITE_ID_0 + // sprite_id = SPRITE_ID_0 + screen + sprites_id[sprite] + clc + adc sprites_id,y + // sprites_ptr_1[sprite] = sprite_id + sta (sprites_ptr_1),y + // sprites_ptr_2[sprite] = sprite_id + sta (sprites_ptr_2),y + // for(char sprite=0; sprite<8; sprite++) + iny + jmp __b2 + .segment Data + sprites_id: .byte 0, $70, $60, $50, $40, $30, $20, $10 +} +.segment Code +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = INTRO_MUSIC_CRUNCHED_UPPER + .label source = INTRO_MUSIC_CRUNCHED + .label src_end = source+INTRO_MUSIC_CRUNCHED_SIZE + .label dst = $b + .label src = 9 + lda #destination + sta.z dst+1 + lda #source + sta.z src+1 + __b1: + // while(src!=src_end) + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #PORT_A_DDR = 0x00 + // Joystick Read Mode + lda #0 + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR + // } + rts +} +// Return 1 if joy #2 fire is pressed +joyfire: { + // CIA1->PORT_A & 0x10 + lda #$10 + and CIA1 + // if( (CIA1->PORT_A & 0x10) == 0 ) + cmp #0 + beq __b1 + lda #0 + rts + __b1: + lda #1 + // } + rts +} +// Initialize the LEVEL_TILES_DIRECTIONS table with bits representing all open (non-blocked) movement directions from a tile +init_level_tile_directions: { + .label directions = $b + .label ytile = 5 + .label open_directions = 7 + .label xtile = 6 + lda #LEVEL_TILES_DIRECTIONS + sta.z directions+1 + lda #0 + sta.z ytile + __b1: + // for(char ytile=0;ytile<37;ytile++) + lda.z ytile + cmp #$25 + bcc __b4 + // } + rts + __b4: + lda #0 + sta.z xtile + __b2: + // for(char xtile=0; xtile<50; xtile++) + lda.z xtile + cmp #$32 + bcc __b3 + // directions += 0x40 + lda #$40 + clc + adc.z directions + sta.z directions + bcc !+ + inc.z directions+1 + !: + // for(char ytile=0;ytile<37;ytile++) + inc.z ytile + jmp __b1 + __b3: + // level_tile_get(xtile-1, ytile) + ldx.z xtile + dex + lda.z ytile + jsr level_tile_get + // level_tile_get(xtile-1, ytile) + tax + // if(TILES_TYPE[level_tile_get(xtile-1, ytile)]!=WALL) + lda TILES_TYPE,x + cmp #WALL + beq __b9 + lda #LEFT + sta.z open_directions + jmp __b5 + __b9: + lda #0 + sta.z open_directions + __b5: + // level_tile_get(xtile+1, ytile) + ldx.z xtile + inx + lda.z ytile + jsr level_tile_get + // level_tile_get(xtile+1, ytile) + tax + // if(TILES_TYPE[level_tile_get(xtile+1, ytile)]!=WALL) + lda TILES_TYPE,x + cmp #WALL + beq __b6 + // open_directions |= RIGHT + lda #RIGHT + ora.z open_directions + sta.z open_directions + __b6: + // level_tile_get(xtile, ytile-1) + lda.z ytile + sec + sbc #1 + ldx.z xtile + jsr level_tile_get + // level_tile_get(xtile, ytile-1) + // if(TILES_TYPE[level_tile_get(xtile, ytile-1)]!=WALL) + tay + lda TILES_TYPE,y + cmp #WALL + beq __b7 + // open_directions |= UP + lda #UP + ora.z open_directions + sta.z open_directions + __b7: + // level_tile_get(xtile, ytile+1) + lda.z ytile + clc + adc #1 + ldx.z xtile + jsr level_tile_get + // level_tile_get(xtile, ytile+1) + // if(TILES_TYPE[level_tile_get(xtile, ytile+1)]!=WALL) + tay + lda TILES_TYPE,y + cmp #WALL + beq __b8 + // open_directions |= DOWN + lda #DOWN + ora.z open_directions + sta.z open_directions + __b8: + // directions[xtile] = open_directions + lda.z open_directions + ldy.z xtile + sta (directions),y + // for(char xtile=0; xtile<50; xtile++) + inc.z xtile + jmp __b2 +} +// Show the level by rendering all tiles +// Returns the number of pills on the level +level_show: { + .label return = $b + .label level = 9 + .label ytile = 6 + .label tile_right = $60 + .label xtile = 8 + .label count = $b + .label xcol = 7 + lda #LEVEL_TILES + sta.z level+1 + lda #<0 + sta.z count + sta.z count+1 + sta.z ytile + __b1: + // for(char ytile=0;ytile<37;ytile++) + lda.z ytile + cmp #$25 + bcc __b4 + // } + rts + __b4: + lda #0 + sta.z xtile + sta.z xcol + __b2: + // for(char xcol=0, xtile=0; xcol<25; xcol++) + lda.z xcol + cmp #$19 + bcc __b3 + // level += 0x40 + lda #$40 + clc + adc.z level + sta.z level + bcc !+ + inc.z level+1 + !: + // for(char ytile=0;ytile<37;ytile++) + inc.z ytile + jmp __b1 + __b3: + // tile_left = level[xtile++] + ldy.z xtile + lda (level),y + tax + iny + // if(TILES_TYPE[tile_left]==PILL) + lda TILES_TYPE,x + cmp #PILL + bne __b5 + // count++; + inc.z count + bne !+ + inc.z count+1 + !: + __b5: + // tile_right = level[xtile++] + lda (level),y + sta.z tile_right + iny + sty.z xtile + // if(TILES_TYPE[tile_right]==PILL) + lda #PILL + ldy.z tile_right + cmp TILES_TYPE,y + bne __b6 + // count++; + inc.z count + bne !+ + inc.z count+1 + !: + __b6: + // render_tiles(xcol, ytile, tile_left, tile_right) + ldy.z tile_right + jsr render_tiles + // for(char xcol=0, xtile=0; xcol<25; xcol++) + inc.z xcol + jmp __b2 +} +// Sound effects for pacman +pacman_sound_init: { + // SID->VOLUME_FILTER_MODE = 0x0f + // Set master volume + lda #$f + sta SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE + // SID->CH1_FREQ = 0 + // Channel 1 is Pacman eating sound + lda #0 + sta SID+1 + sta SID + // SID->CH1_PULSE_WIDTH = 0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH+1 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH + // SID->CH1_CONTROL = 0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // SID->CH1_ATTACK_DECAY = 0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY + // SID->CH1_SUSTAIN_RELEASE = 0xf0 + lda #$f0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE + // } + rts +} +// Render graphic pixels into the 9 all-border sprites +// - xcol: x column (0-24). The x-column represents 8 bits of data, 4 mc pixels, 16 on-screen pixels (due to x-expanded sprites) +// - ypos: y position (0-145). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. +// - pixels: The pixel data to set +// render(byte zp(5) xcol, byte zp(6) ypos, byte zp(8) pixels) +render: { + .label render_index_xcol = $61 + .label canvas_offset = $b + .label canvas1 = 9 + .label canvas2 = $b + .label ypix = $60 + .label xcol = 5 + .label ypos = 6 + .label pixels = 8 + // ytile = ypos/4 + lda.z ypos + lsr + lsr + tay + // (>RENDER_INDEX) + xcol + lax.z xcol + axs #-[>RENDER_INDEX] + // ytile*2 + tya + asl + // render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 } + stx.z render_index_xcol+1 + sta.z render_index_xcol + // canvas_offset = { render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] } + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // canvas1 = SPRITES_1 + canvas_offset + clc + adc #SPRITES_1 + sta.z canvas1+1 + // canvas2 = SPRITES_2 + canvas_offset + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC] + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + // ypix = ypos&3 + lda #3 + and.z ypos + sta.z ypix + ldy #0 + __b1: + // for(char i=0;i49 || ytile>36) + cpx #$31+1 + bcs __b1 + cmp #$24+1 + bcs __b1 + // LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile] + asl + // ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile] + tay + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // return ytiles[xtile]; + txa + tay + lda (ytiles),y + rts + __b1: + lda #0 + // } + rts +} +// Renders 2x1 tiles on the canvas. +// Tiles are 4x4 px. This renders 8px x 4px. +// - xcol: The x column position (0-24) (a column is 8 pixels) +// - ytile: The y tile position (0-37). Tile y position 0 is a special half-tile at the top of the screen. +// - tile_left: The left tile ID. +// - tile_right: The right tile ID. +// render_tiles(byte zp(7) xcol, byte zp(6) ytile, byte register(X) tile_left, byte register(Y) tile_right) +render_tiles: { + .label tile_left_pixels = $61 + .label tile_right_pixels = $63 + .label render_index_xcol = $65 + .label canvas_offset = $5e + .label canvas1 = $59 + .label canvas2 = $5e + .label y = $60 + .label xcol = 7 + .label ytile = 6 + // tile_left*4 + txa + asl + asl + // tile_left_pixels = TILES_LEFT + tile_left*4 + clc + adc #TILES_LEFT + adc #0 + sta.z tile_left_pixels+1 + // tile_right*4 + tya + asl + asl + // tile_right_pixels = TILES_RIGHT + tile_right*4 + clc + adc #TILES_RIGHT + adc #0 + sta.z tile_right_pixels+1 + // (>RENDER_INDEX) + xcol + lax.z xcol + axs #-[>RENDER_INDEX] + // ytile*2 + lda.z ytile + asl + // render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 } + stx.z render_index_xcol+1 + sta.z render_index_xcol + // canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] } + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // canvas1 = SPRITES_1 + canvas_offset + clc + adc #SPRITES_1 + sta.z canvas1+1 + // canvas2 = SPRITES_2 + canvas_offset + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC] + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + lda #0 + sta.z y + __b1: + // for(char y=0;y<4;y++) + lda.z y + cmp #4 + bcc __b2 + // } + rts + __b2: + // pixels = tile_left_pixels[y] | tile_right_pixels[y] + ldy.z y + lda (tile_left_pixels),y + ora (tile_right_pixels),y + // *canvas1 = pixels + ldy #0 + sta (canvas1),y + // *canvas2 = pixels + sta (canvas2),y + // canvas1 += RENDER_YPOS_INC[ypos_inc_offset] + lda RENDER_YPOS_INC,x + clc + adc.z canvas1 + sta.z canvas1 + bcc !+ + inc.z canvas1+1 + !: + // canvas2 += RENDER_YPOS_INC[ypos_inc_offset] + lda RENDER_YPOS_INC,x + clc + adc.z canvas2 + sta.z canvas2 + bcc !+ + inc.z canvas2+1 + !: + // ypos_inc_offset++; + inx + // for(char y=0;y<4;y++) + inc.z y + jmp __b1 +} +.segment Data + // The byteboozer decruncher +BYTEBOOZER: +.const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + + // Pacman eating sound + PACMAN_CH1_FREQ_HI: .byte $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 + PACMAN_CH1_CONTROL: .byte $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 + // Address of the first pixel each x column + RENDER_XCOLS: .word 0, 1, 2, $400, $401, $402, $800, $801, $802, $c00, $c01, $c02, $1000, $1001, $1002, $1400, $1401, $1402, $1800, $1801, $1802, $1c00, $1c01, $1c02, 0, 0 + // Offset for each y-position from the first pixel of an X column + RENDER_YPOS: .word 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, $40+3, $40+9, $40+$f, $40+$15, $40+$1b, $40+$21, $40+$27, $40+$2d, $40+$33, $40+$39, $80, $80+6, $80+$c, $80+$12, $80+$18, $80+$1e, $80+$24, $80+$2a, $80+$30, $80+$36, $80+$3c, $c0+3, $c0+9, $c0+$f, $c0+$15, $c0+$1b, $c0+$21, $c0+$27, $c0+$2d, $c0+$33, $c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39 + // Offset for each y-position from the first pixel of an X column in sprite#9 + RENDER_YPOS_9TH: .word 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, $40+6, $40+$c, $40+$12, $40+$18, $40+$1e, $40+$24, $40+$2a, $40+$30, $40+$36, $40+$3c, $80+3, $80+9, $80+$f, $80+$15, $80+$1b, $80+$21, $80+$27, $80+$2d, $80+$33, $80+$39, $c0, $c0+6, $c0+$c, $c0+$12, $c0+$18, $c0+$1e, $c0+$24, $c0+$2a, $c0+$30, $c0+$36, $c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c + // Increment for each y-position from the first pixel of an X column + .align $20 + RENDER_YPOS_INC: .byte 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 + // The BOB x column position (0-24) (a column is 8 pixels) + bobs_xcol: .byte $a, $a, $a, $a, $a + // The BOB y fine position (0-99). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. + bobs_yfine: .byte $2d, $2d, $2d, $2d, $2d + // The BOB ID in the BOB data tables + bobs_bob_id: .byte 0, 0, 0, 0, 0 + // The BOB restore data: 18 bytes per BOB. Doubled for double-buffering. + // char * left_canvas; + // char left_ypos_inc_offset; + // char * right_canvas; + // char right_ypos_inc_offset; + // char[12] restore_pixels; + .align $100 + bobs_restore: .fill NUM_BOBS*SIZE_BOB_RESTORE*2, 0 +.segment Init + // The level represented as 4x4 px tiles. Each byte is the ID of a tile from the tile set. + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 50 tile IDs. +LEVEL_TILES_CRUNCHED: +.modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + + // BOB data: One table per bob byte (left/right, mask/pixels = 4 tables). The index into the table is the bob_id + row*BOB_ROW_SIZE. +BOB_GRAPHICS_CRUNCHED: +.modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + + // Splash screen 25 xcol * 147 ypos bytes +SPLASH_CRUNCHED: +.modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + + // Victory graphics 25 xcol * 25 ypos bytes +WIN_GFX_CRUNCHED: +.modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + + // Game Over graphics 25 xcol * 25 ypos bytes +GAMEOVER_GFX_CRUNCHED: +.modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + + // Renders the BOBs at the given positions + // The bob logic code will be merged with raster code using code-merger.c + // First restores the canvas from previously rendered bobs, and then renders the bobs at the given positions. + // BOBs are 16px*6px graphics (2 x-columns * 6px) with masks and pixels + // Uses the bobs_xcol, bobs_yfine, bobs_bob_id and bob_restore for data about the bobs + // Implemented in inline kick assembler +LOGIC_CODE_CRUNCHED: +.macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + + // Raster-code for displaying 9 sprites on the entire screen - with open side borders + // The uncrunched code will be merged with logic code using code-merger.c + // The unmerged raster-code is identical for both buffers! +RASTER_CODE_CRUNCHED: +.macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + + // SID tune + // Pacmania Shaun Southern https://csdb.dk/sid/?id=53795 + // Relocated using ./sidreloc-1.0/sidreloc -p30 c64src/borderline/Pacmania.sid c64src/borderline/Pacmania_3000.sid +INTRO_MUSIC_CRUNCHED: +.modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + +.segment Data + // Offset of the LEVEL_TILE data within the LEVEL_TILE data (each row is 64 bytes of data) + LEVEL_YTILE_OFFSET: .word 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 + // Used to choose a single direction when presented with multiple potential directions. + // Used to eliminate diagonal joy directions and convert them to a single direction + // Priority: (4)up, (8)down, (16)left, (32)right + .align $40 + DIRECTION_SINGLE: .byte 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 + // Used to eliminate a single direction (the one that the ghost came from) + // The value DIRECTION_ELIMINATE[current_direction] is ANDed onto the open directions to remove the current direction + .align $40 + DIRECTION_ELIMINATE: .byte $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef + // Used to reverse direction direction (when a ghost changes between chase and scatter) + .align $40 + DIRECTION_REVERSE: .byte 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 + // The animation frames for pacman. The index into this is DIRECTION + anim_frame_idx. + .align $40 + pacman_frames: .byte 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c + // The animation frames for ghost. The index into thos is DIRECTION + anim_frame_idx. + .align $80 + ghost_frames: .byte 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 + // Lookup the absolute value of a signed number + // PRE_ and POST_ are used to ensure lookup of ABS-1,y works for y=0 and ABS+1,y works for y=0xff + .align $100 + ABS_PRE: .byte 1 +ABS: +.for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + + ABS_POST: .byte 0 diff --git a/src/test/ref/complex/borderline_pacman/pacman.cfg b/src/test/ref/complex/borderline_pacman/pacman.cfg new file mode 100644 index 000000000..f06d8dfd6 --- /dev/null +++ b/src/test/ref/complex/borderline_pacman/pacman.cfg @@ -0,0 +1,2012 @@ + +void __start() +__start: scope:[__start] from + [0] phi() + to:__start::__init1 +__start::__init1: scope:[__start] from __start + [1] pacman_ch1_enabled = 0 + [2] pacman_ch1_idx = 0 + [3] logic_tile_ptr = (byte*) 0 + [4] logic_tile_xcol = 0 + [5] logic_tile_yfine = 0 + [6] logic_tile_left_idx = 0 + [7] logic_tile_right_idx = 0 + [8] left_render_index_xcol = (byte*) 0 + [9] left_canvas = (byte*) 0 + [10] left_ypos_inc_offset = 0 + [11] rigt_render_index_xcol = (byte*) 0 + [12] rigt_canvas = (byte*) 0 + [13] rigt_ypos_inc_offset = 0 + [14] canvas_base_hi = 0 + [15] bobs_restore_base = 0 + [16] top_sprites_color = 0 + [17] top_sprites_mc = 0 + [18] side_sprites_color = 0 + [19] side_sprites_mc = 0 + [20] bottom_sprites_color = 0 + [21] bottom_sprites_mc = 0 + [22] pill_count = 0 + [23] pacman_wins = 0 + [24] pacman_lives = 3 + [25] music_play_next = 0 + [26] phase = 0 + [27] frame = 0 + [28] anim_frame_idx = 0 + [29] pacman_xfine = $2d + [30] pacman_yfine = $23 + [31] pacman_direction = STOP + [32] pacman_substep = 0 + [33] ghosts_mode = 1 + [34] ghosts_mode_count = 0 + [35] ghost1_xfine = $2d + [36] ghost1_yfine = $23 + [37] ghost1_direction = STOP + [38] ghost1_substep = 0 + [39] ghost1_reverse = 0 + [40] ghost1_respawn = 0 + [41] ghost2_xfine = $2d + [42] ghost2_yfine = $23 + [43] ghost2_direction = STOP + [44] ghost2_substep = 0 + [45] ghost2_reverse = 0 + [46] ghost2_respawn = 0 + [47] ghost3_xfine = $2d + [48] ghost3_yfine = $23 + [49] ghost3_direction = STOP + [50] ghost3_substep = 0 + [51] ghost3_reverse = 0 + [52] ghost3_respawn = 0 + [53] ghost4_xfine = $2d + [54] ghost4_yfine = $23 + [55] ghost4_direction = STOP + [56] ghost4_substep = 0 + [57] ghost4_reverse = 0 + [58] ghost4_respawn = 0 + [59] game_logic_substep = 0 + [60] game_playable = 0 + to:__start::@1 +__start::@1: scope:[__start] from __start::__init1 + [61] phi() + [62] call main + to:__start::@return +__start::@return: scope:[__start] from __start::@1 + [63] return + to:@return + +__interrupt(hardware_clobber) void irq_screen_top() +irq_screen_top: scope:[irq_screen_top] from + kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} + asm { jsrRASTER_CODE } + [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 + [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 + [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 + [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 + [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 + [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 + [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 + [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 + to:irq_screen_top::toD0181 +irq_screen_top::toD0181: scope:[irq_screen_top] from irq_screen_top + [74] phi() + to:irq_screen_top::@5 +irq_screen_top::@5: scope:[irq_screen_top] from irq_screen_top::toD0181 + [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 + [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color + [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color + [79] irq_screen_top::$1 = frame + 1 + [80] irq_screen_top::$2 = irq_screen_top::$1 & 1 + [81] frame = irq_screen_top::$2 + [82] if(0!=frame) goto irq_screen_top::toDd001 + to:irq_screen_top::toDd002 +irq_screen_top::toDd002: scope:[irq_screen_top] from irq_screen_top::@5 + [83] phi() + to:irq_screen_top::@7 +irq_screen_top::@7: scope:[irq_screen_top] from irq_screen_top::toDd002 + [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 + [85] canvas_base_hi = >SPRITES_2 + [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + to:irq_screen_top::@1 +irq_screen_top::@1: scope:[irq_screen_top] from irq_screen_top::@6 irq_screen_top::@7 + [87] if(phase==0) goto irq_screen_top::@2 + to:irq_screen_top::@4 +irq_screen_top::@4: scope:[irq_screen_top] from irq_screen_top::@1 + [88] phi() + [89] call game_logic + to:irq_screen_top::@8 +irq_screen_top::@8: scope:[irq_screen_top] from irq_screen_top::@4 + [90] phi() + [91] call pacman_sound_play + to:irq_screen_top::@3 +irq_screen_top::@3: scope:[irq_screen_top] from irq_screen_top::@2 irq_screen_top::@8 + [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER + [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [94] *HARDWARE_IRQ = &irq_screen_top + to:irq_screen_top::@return +irq_screen_top::@return: scope:[irq_screen_top] from irq_screen_top::@3 + [95] return + to:@return +irq_screen_top::@2: scope:[irq_screen_top] from irq_screen_top::@1 + [96] music_play_next = 1 + to:irq_screen_top::@3 +irq_screen_top::toDd001: scope:[irq_screen_top] from irq_screen_top::@5 + [97] phi() + to:irq_screen_top::@6 +irq_screen_top::@6: scope:[irq_screen_top] from irq_screen_top::toDd001 + [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 + [99] canvas_base_hi = >SPRITES_1 + [100] bobs_restore_base = 0 + to:irq_screen_top::@1 + +void main() +main: scope:[main] from __start::@1 + [101] phi() + [102] call splash_run + to:main::@1 +main::@1: scope:[main] from main main::@2 + [103] phi() + [104] call gameplay_run + to:main::@2 +main::@2: scope:[main] from main::@1 + [105] phi() + [106] call done_run + to:main::@1 + +void game_logic() +game_logic: scope:[game_logic] from irq_screen_top::@4 + [107] if(game_playable!=0) goto game_logic::@1 + to:game_logic::@return +game_logic::@return: scope:[game_logic] from game_logic game_logic::@103 game_logic::@104 game_logic::@105 game_logic::@106 game_logic::@112 game_logic::@113 game_logic::@115 game_logic::@120 game_logic::@121 game_logic::@122 game_logic::@123 game_logic::@129 game_logic::@130 game_logic::@132 game_logic::@137 game_logic::@138 game_logic::@139 game_logic::@145 game_logic::@146 game_logic::@150 game_logic::@151 game_logic::@153 game_logic::@155 game_logic::@157 game_logic::@159 game_logic::@161 game_logic::@165 game_logic::@44 game_logic::@54 game_logic::@55 game_logic::@56 game_logic::@57 game_logic::@66 game_logic::@68 game_logic::@69 game_logic::@70 game_logic::@71 game_logic::@72 game_logic::@78 game_logic::@79 game_logic::@81 game_logic::@86 game_logic::@87 game_logic::@88 game_logic::@89 game_logic::@95 game_logic::@96 game_logic::@98 + [108] return + to:@return +game_logic::@1: scope:[game_logic] from game_logic + [109] game_logic::$2 = game_logic_substep + 1 + [110] game_logic::$3 = game_logic::$2 & 7 + [111] game_logic_substep = game_logic::$3 + [112] if(game_logic_substep==0) goto game_logic::@2 + to:game_logic::@8 +game_logic::@8: scope:[game_logic] from game_logic::@1 + [113] if(game_logic_substep==1) goto game_logic::@3 + to:game_logic::@9 +game_logic::@9: scope:[game_logic] from game_logic::@8 + [114] if(game_logic_substep==2) goto game_logic::@4 + to:game_logic::@10 +game_logic::@10: scope:[game_logic] from game_logic::@9 + [115] if(game_logic_substep==4) goto game_logic::@5 + to:game_logic::@11 +game_logic::@11: scope:[game_logic] from game_logic::@10 + [116] if(game_logic_substep==5) goto game_logic::@6 + to:game_logic::@12 +game_logic::@12: scope:[game_logic] from game_logic::@11 + [117] if(game_logic_substep==6) goto game_logic::@7 + to:game_logic::@13 +game_logic::@13: scope:[game_logic] from game_logic::@12 + [118] if(game_logic_substep==3) goto game_logic::@14 + to:game_logic::@161 +game_logic::@161: scope:[game_logic] from game_logic::@13 + [119] if(game_logic_substep==7) goto game_logic::@14 + to:game_logic::@return +game_logic::@14: scope:[game_logic] from game_logic::@13 game_logic::@161 + [120] game_logic::$14 = anim_frame_idx + 1 + [121] game_logic::$15 = game_logic::$14 & 3 + [122] anim_frame_idx = game_logic::$15 + [123] game_logic::pacman_bob_xfine#0 = pacman_xfine - 1 + [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 + [125] *bobs_xcol = game_logic::$17 + [126] game_logic::$18 = pacman_yfine - 1 + [127] *bobs_yfine = game_logic::$18 + [128] game_logic::$19 = pacman_direction | anim_frame_idx + [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 + [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 + [131] *bobs_bob_id = game_logic::$21 + [132] game_logic::ghost_frame_idx#0 = anim_frame_idx + [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 + to:game_logic::@15 +game_logic::@15: scope:[game_logic] from game_logic::@14 + [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 + to:game_logic::@44 +game_logic::@44: scope:[game_logic] from game_logic::@14 game_logic::@15 + [135] game_logic::ghost_frame_idx#2 = phi( game_logic::@14/game_logic::ghost_frame_idx#0, game_logic::@15/game_logic::ghost_frame_idx#1 ) + [136] game_logic::ghost1_bob_xfine#0 = ghost1_xfine - 1 + [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 + [138] *(bobs_xcol+1) = game_logic::$25 + [139] game_logic::$26 = ghost1_yfine - 1 + [140] *(bobs_yfine+1) = game_logic::$26 + [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 + [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 + [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 + [144] *(bobs_bob_id+1) = game_logic::$29 + [145] game_logic::ghost2_bob_xfine#0 = ghost2_xfine - 1 + [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 + [147] *(bobs_xcol+2) = game_logic::$31 + [148] game_logic::$32 = ghost2_yfine - 1 + [149] *(bobs_yfine+2) = game_logic::$32 + [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 + [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 + [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 + [153] *(bobs_bob_id+2) = game_logic::$35 + [154] game_logic::ghost3_bob_xfine#0 = ghost3_xfine - 1 + [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 + [156] *(bobs_xcol+3) = game_logic::$37 + [157] game_logic::$38 = ghost3_yfine - 1 + [158] *(bobs_yfine+3) = game_logic::$38 + [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 + [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 + [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 + [162] *(bobs_bob_id+3) = game_logic::$41 + [163] game_logic::ghost4_bob_xfine#0 = ghost4_xfine - 1 + [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 + [165] *(bobs_xcol+4) = game_logic::$43 + [166] game_logic::$44 = ghost4_yfine - 1 + [167] *(bobs_yfine+4) = game_logic::$44 + [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 + [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 + [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 + [171] *(bobs_bob_id+4) = game_logic::$47 + to:game_logic::@return +game_logic::@7: scope:[game_logic] from game_logic::@12 + [172] ghosts_mode_count = ++ ghosts_mode_count + [173] if(ghosts_mode==SCATTER) goto game_logic::@45 + to:game_logic::@16 +game_logic::@16: scope:[game_logic] from game_logic::@7 + [174] if(ghosts_mode==CHASE) goto game_logic::@46 + to:game_logic::@17 +game_logic::@17: scope:[game_logic] from game_logic::@16 + [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 + to:game_logic::@18 +game_logic::@18: scope:[game_logic] from game_logic::@17 + [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 + to:game_logic::@19 +game_logic::@19: scope:[game_logic] from game_logic::@18 + [177] ghosts_mode = CHASE + [178] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@47: scope:[game_logic] from game_logic::@17 game_logic::@18 game_logic::@19 game_logic::@45 game_logic::@46 game_logic::@58 game_logic::@59 + [179] game_logic::do_reverse#4 = phi( game_logic::@17/0, game_logic::@18/0, game_logic::@19/1, game_logic::@45/0, game_logic::@46/0, game_logic::@58/1, game_logic::@59/1 ) + [180] if(0==game_logic::do_reverse#4) goto game_logic::@48 + to:game_logic::@60 +game_logic::@60: scope:[game_logic] from game_logic::@47 + [181] ghost1_reverse = 1 + [182] ghost2_reverse = 1 + [183] ghost3_reverse = 1 + [184] ghost4_reverse = 1 + to:game_logic::@48 +game_logic::@48: scope:[game_logic] from game_logic::@47 game_logic::@60 + [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 + [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 + [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 + [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] + [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] + [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 + to:game_logic::@61 +game_logic::@61: scope:[game_logic] from game_logic::@48 + [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 + to:game_logic::@62 +game_logic::@62: scope:[game_logic] from game_logic::@61 + [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY + [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 + [194] logic_tile_xcol = game_logic::$65 + [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe + [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 + [197] logic_tile_ptr = game_logic::$67 + [198] game_logic::$68 = game_logic::$210 + [199] logic_tile_yfine = game_logic::$68 + [200] ghosts_mode = FRIGHTENED + [201] ghosts_mode_count = 0 + to:game_logic::@50 +game_logic::@50: scope:[game_logic] from game_logic::@49 game_logic::@61 game_logic::@62 game_logic::@63 + [202] game_logic::$75 = pacman_xfine - ghost1_xfine + [203] game_logic::$77 = pacman_yfine - ghost1_yfine + [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 + to:game_logic::@162 +game_logic::@162: scope:[game_logic] from game_logic::@50 + [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 + to:game_logic::@64 +game_logic::@64: scope:[game_logic] from game_logic::@162 game_logic::@50 + [206] game_logic::$80 = pacman_xfine - ghost2_xfine + [207] game_logic::$82 = pacman_yfine - ghost2_yfine + [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 + to:game_logic::@163 +game_logic::@163: scope:[game_logic] from game_logic::@64 + [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 + to:game_logic::@65 +game_logic::@65: scope:[game_logic] from game_logic::@163 game_logic::@64 + [210] game_logic::$85 = pacman_xfine - ghost3_xfine + [211] game_logic::$87 = pacman_yfine - ghost3_yfine + [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 + to:game_logic::@164 +game_logic::@164: scope:[game_logic] from game_logic::@65 + [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 + to:game_logic::@66 +game_logic::@66: scope:[game_logic] from game_logic::@164 game_logic::@65 + [214] game_logic::$90 = pacman_xfine - ghost4_xfine + [215] game_logic::$92 = pacman_yfine - ghost4_yfine + [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return + to:game_logic::@165 +game_logic::@165: scope:[game_logic] from game_logic::@66 + [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 + to:game_logic::@return +game_logic::@67: scope:[game_logic] from game_logic::@165 + [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 + to:game_logic::@68 +game_logic::@68: scope:[game_logic] from game_logic::@67 + [219] pacman_lives = -- pacman_lives + [220] call spawn_all + to:game_logic::@return +game_logic::@54: scope:[game_logic] from game_logic::@67 + [221] ghost4_direction = STOP + [222] ghost4_xfine = $32 + [223] ghost4_yfine = $23 + [224] ghost4_substep = 0 + [225] ghost4_respawn = $32 + to:game_logic::@return +game_logic::@53: scope:[game_logic] from game_logic::@164 + [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 + to:game_logic::@69 +game_logic::@69: scope:[game_logic] from game_logic::@53 + [227] pacman_lives = -- pacman_lives + [228] call spawn_all + to:game_logic::@return +game_logic::@55: scope:[game_logic] from game_logic::@53 + [229] ghost3_direction = STOP + [230] ghost3_xfine = $32 + [231] ghost3_yfine = $23 + [232] ghost3_substep = 0 + [233] ghost3_respawn = $32 + to:game_logic::@return +game_logic::@52: scope:[game_logic] from game_logic::@163 + [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 + to:game_logic::@70 +game_logic::@70: scope:[game_logic] from game_logic::@52 + [235] pacman_lives = -- pacman_lives + [236] call spawn_all + to:game_logic::@return +game_logic::@56: scope:[game_logic] from game_logic::@52 + [237] ghost2_direction = STOP + [238] ghost2_xfine = $32 + [239] ghost2_yfine = $23 + [240] ghost2_substep = 0 + [241] ghost2_respawn = $32 + to:game_logic::@return +game_logic::@51: scope:[game_logic] from game_logic::@162 + [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 + to:game_logic::@71 +game_logic::@71: scope:[game_logic] from game_logic::@51 + [243] pacman_lives = -- pacman_lives + [244] call spawn_all + to:game_logic::@return +game_logic::@57: scope:[game_logic] from game_logic::@51 + [245] ghost1_direction = STOP + [246] ghost1_xfine = $32 + [247] ghost1_yfine = $23 + [248] ghost1_substep = 0 + [249] ghost1_respawn = $32 + to:game_logic::@return +game_logic::@49: scope:[game_logic] from game_logic::@48 + [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY + [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 + [252] logic_tile_xcol = game_logic::$69 + [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe + [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 + [255] logic_tile_ptr = game_logic::$71 + [256] game_logic::$72 = game_logic::$210 + [257] logic_tile_yfine = game_logic::$72 + [258] pill_count = -- pill_count + [259] if(pill_count!=0) goto game_logic::@50 + to:game_logic::@63 +game_logic::@63: scope:[game_logic] from game_logic::@49 + [260] pacman_wins = 1 + to:game_logic::@50 +game_logic::@46: scope:[game_logic] from game_logic::@16 + [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 + to:game_logic::@58 +game_logic::@58: scope:[game_logic] from game_logic::@46 + [262] ghosts_mode = SCATTER + [263] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@45: scope:[game_logic] from game_logic::@7 + [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 + to:game_logic::@59 +game_logic::@59: scope:[game_logic] from game_logic::@45 + [265] ghosts_mode = CHASE + [266] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@6: scope:[game_logic] from game_logic::@11 + [267] if(0!=ghost4_respawn) goto game_logic::@72 + to:game_logic::@20 +game_logic::@20: scope:[game_logic] from game_logic::@6 + [268] if(ghost4_direction==RIGHT) goto game_logic::@73 + to:game_logic::@21 +game_logic::@21: scope:[game_logic] from game_logic::@20 + [269] if(ghost4_direction==DOWN) goto game_logic::@74 + to:game_logic::@22 +game_logic::@22: scope:[game_logic] from game_logic::@21 + [270] if(ghost4_direction==LEFT) goto game_logic::@75 + to:game_logic::@23 +game_logic::@23: scope:[game_logic] from game_logic::@22 + [271] if(ghost4_direction!=UP) goto game_logic::@76 + to:game_logic::@24 +game_logic::@24: scope:[game_logic] from game_logic::@23 + [272] ghost4_yfine = -- ghost4_yfine + to:game_logic::@76 +game_logic::@76: scope:[game_logic] from game_logic::@23 game_logic::@24 game_logic::@73 game_logic::@74 game_logic::@75 + [273] game_logic::$220 = ghost4_direction + [274] if(ghost4_substep!=0) goto game_logic::@82 + to:game_logic::@166 +game_logic::@166: scope:[game_logic] from game_logic::@76 + [275] if(game_logic::$220!=STOP) goto game_logic::@77 + to:game_logic::@82 +game_logic::@82: scope:[game_logic] from game_logic::@166 game_logic::@76 + [276] ghost4_substep = 0 + [277] if(0!=ghost4_reverse) goto game_logic::@78 + to:game_logic::@83 +game_logic::@83: scope:[game_logic] from game_logic::@82 + [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 + [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 + [280] level_tile_directions::xtile#0 = game_logic::ghost4_xtile#0 + [281] level_tile_directions::ytile#0 = game_logic::ghost4_ytile#0 + [282] call level_tile_directions + [283] level_tile_directions::return#3 = level_tile_directions::return#2 + to:game_logic::@152 +game_logic::@152: scope:[game_logic] from game_logic::@83 + [284] game_logic::open_directions#0 = level_tile_directions::return#3 + [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] + [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 + to:game_logic::@84 +game_logic::@84: scope:[game_logic] from game_logic::@152 + [287] if(ghosts_mode==SCATTER) goto game_logic::@80 + to:game_logic::@85 +game_logic::@85: scope:[game_logic] from game_logic::@84 + [288] game_logic::target_xtile#2 = pacman_xfine >> 1 + [289] game_logic::target_ytile#2 = pacman_yfine >> 1 + to:game_logic::@80 +game_logic::@80: scope:[game_logic] from game_logic::@84 game_logic::@85 + [290] game_logic::target_ytile#3 = phi( game_logic::@84/2, game_logic::@85/game_logic::target_ytile#2 ) + [290] game_logic::target_xtile#3 = phi( game_logic::@84/2, game_logic::@85/game_logic::target_xtile#2 ) + [291] choose_direction::open_directions#0 = game_logic::open_directions#1 + [292] choose_direction::ghost_xtile#0 = game_logic::ghost4_xtile#0 + [293] choose_direction::ghost_ytile#0 = game_logic::ghost4_ytile#0 + [294] choose_direction::target_xtile#0 = game_logic::target_xtile#3 + [295] choose_direction::target_ytile#0 = game_logic::target_ytile#3 + [296] call choose_direction + [297] choose_direction::return#0 = choose_direction::return#10 + to:game_logic::@153 +game_logic::@153: scope:[game_logic] from game_logic::@80 + [298] game_logic::$119 = choose_direction::return#0 + [299] ghost4_direction = game_logic::$119 + to:game_logic::@return +game_logic::@79: scope:[game_logic] from game_logic::@152 + [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] + to:game_logic::@return +game_logic::@78: scope:[game_logic] from game_logic::@82 + [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] + [302] ghost4_reverse = 0 + to:game_logic::@return +game_logic::@77: scope:[game_logic] from game_logic::@166 + [303] ghost4_substep = 1 + [304] if(ghost4_xfine==1) goto game_logic::@81 + to:game_logic::@86 +game_logic::@86: scope:[game_logic] from game_logic::@77 + [305] if(ghost4_xfine!=$61) goto game_logic::@return + to:game_logic::@87 +game_logic::@87: scope:[game_logic] from game_logic::@86 + [306] ghost4_xfine = 1 + to:game_logic::@return +game_logic::@81: scope:[game_logic] from game_logic::@77 + [307] ghost4_xfine = $61 + to:game_logic::@return +game_logic::@75: scope:[game_logic] from game_logic::@22 + [308] ghost4_xfine = -- ghost4_xfine + to:game_logic::@76 +game_logic::@74: scope:[game_logic] from game_logic::@21 + [309] ghost4_yfine = ++ ghost4_yfine + to:game_logic::@76 +game_logic::@73: scope:[game_logic] from game_logic::@20 + [310] ghost4_xfine = ++ ghost4_xfine + to:game_logic::@76 +game_logic::@72: scope:[game_logic] from game_logic::@6 + [311] ghost4_respawn = -- ghost4_respawn + [312] if(ghost4_respawn!=0) goto game_logic::@return + to:game_logic::@88 +game_logic::@88: scope:[game_logic] from game_logic::@72 + [313] ghost4_direction = RIGHT + [314] ghost4_xfine = 2 + [315] ghost4_yfine = 2 + [316] ghost4_substep = 0 + to:game_logic::@return +game_logic::@5: scope:[game_logic] from game_logic::@10 + [317] if(0!=ghost3_respawn) goto game_logic::@89 + to:game_logic::@25 +game_logic::@25: scope:[game_logic] from game_logic::@5 + [318] if(ghost3_direction==RIGHT) goto game_logic::@90 + to:game_logic::@26 +game_logic::@26: scope:[game_logic] from game_logic::@25 + [319] if(ghost3_direction==DOWN) goto game_logic::@91 + to:game_logic::@27 +game_logic::@27: scope:[game_logic] from game_logic::@26 + [320] if(ghost3_direction==LEFT) goto game_logic::@92 + to:game_logic::@28 +game_logic::@28: scope:[game_logic] from game_logic::@27 + [321] if(ghost3_direction!=UP) goto game_logic::@93 + to:game_logic::@29 +game_logic::@29: scope:[game_logic] from game_logic::@28 + [322] ghost3_yfine = -- ghost3_yfine + to:game_logic::@93 +game_logic::@93: scope:[game_logic] from game_logic::@28 game_logic::@29 game_logic::@90 game_logic::@91 game_logic::@92 + [323] game_logic::$223 = ghost3_direction + [324] if(ghost3_substep!=0) goto game_logic::@99 + to:game_logic::@167 +game_logic::@167: scope:[game_logic] from game_logic::@93 + [325] if(game_logic::$223!=STOP) goto game_logic::@94 + to:game_logic::@99 +game_logic::@99: scope:[game_logic] from game_logic::@167 game_logic::@93 + [326] ghost3_substep = 0 + [327] if(0!=ghost3_reverse) goto game_logic::@95 + to:game_logic::@100 +game_logic::@100: scope:[game_logic] from game_logic::@99 + [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 + [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 + [330] level_tile_directions::xtile#1 = game_logic::ghost3_xtile#0 + [331] level_tile_directions::ytile#1 = game_logic::ghost3_ytile#0 + [332] call level_tile_directions + [333] level_tile_directions::return#10 = level_tile_directions::return#2 + to:game_logic::@154 +game_logic::@154: scope:[game_logic] from game_logic::@100 + [334] game_logic::open_directions1#0 = level_tile_directions::return#10 + [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] + [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 + to:game_logic::@101 +game_logic::@101: scope:[game_logic] from game_logic::@154 + [337] if(ghosts_mode==SCATTER) goto game_logic::@97 + to:game_logic::@102 +game_logic::@102: scope:[game_logic] from game_logic::@101 + [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 + [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 + to:game_logic::@97 +game_logic::@97: scope:[game_logic] from game_logic::@101 game_logic::@102 + [340] game_logic::target_ytile1#3 = phi( game_logic::@102/game_logic::target_ytile1#2, game_logic::@101/2 ) + [340] game_logic::target_xtile1#3 = phi( game_logic::@102/game_logic::target_xtile1#2, game_logic::@101/2 ) + [341] choose_direction::open_directions#1 = game_logic::open_directions1#1 + [342] choose_direction::ghost_xtile#1 = game_logic::ghost3_xtile#0 + [343] choose_direction::ghost_ytile#1 = game_logic::ghost3_ytile#0 + [344] choose_direction::target_xtile#1 = game_logic::target_xtile1#3 + [345] choose_direction::target_ytile#1 = game_logic::target_ytile1#3 + [346] call choose_direction + [347] choose_direction::return#1 = choose_direction::return#10 + to:game_logic::@155 +game_logic::@155: scope:[game_logic] from game_logic::@97 + [348] game_logic::$140 = choose_direction::return#1 + [349] ghost3_direction = game_logic::$140 + to:game_logic::@return +game_logic::@96: scope:[game_logic] from game_logic::@154 + [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] + to:game_logic::@return +game_logic::@95: scope:[game_logic] from game_logic::@99 + [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] + [352] ghost3_reverse = 0 + to:game_logic::@return +game_logic::@94: scope:[game_logic] from game_logic::@167 + [353] ghost3_substep = 1 + [354] if(ghost3_xfine==1) goto game_logic::@98 + to:game_logic::@103 +game_logic::@103: scope:[game_logic] from game_logic::@94 + [355] if(ghost3_xfine!=$61) goto game_logic::@return + to:game_logic::@104 +game_logic::@104: scope:[game_logic] from game_logic::@103 + [356] ghost3_xfine = 1 + to:game_logic::@return +game_logic::@98: scope:[game_logic] from game_logic::@94 + [357] ghost3_xfine = $61 + to:game_logic::@return +game_logic::@92: scope:[game_logic] from game_logic::@27 + [358] ghost3_xfine = -- ghost3_xfine + to:game_logic::@93 +game_logic::@91: scope:[game_logic] from game_logic::@26 + [359] ghost3_yfine = ++ ghost3_yfine + to:game_logic::@93 +game_logic::@90: scope:[game_logic] from game_logic::@25 + [360] ghost3_xfine = ++ ghost3_xfine + to:game_logic::@93 +game_logic::@89: scope:[game_logic] from game_logic::@5 + [361] ghost3_respawn = -- ghost3_respawn + [362] if(ghost3_respawn!=0) goto game_logic::@return + to:game_logic::@105 +game_logic::@105: scope:[game_logic] from game_logic::@89 + [363] ghost3_direction = UP + [364] ghost3_xfine = 2 + [365] ghost3_yfine = $46 + [366] ghost3_substep = 0 + to:game_logic::@return +game_logic::@4: scope:[game_logic] from game_logic::@9 + [367] if(0!=ghost2_respawn) goto game_logic::@106 + to:game_logic::@30 +game_logic::@30: scope:[game_logic] from game_logic::@4 + [368] if(ghost2_direction==RIGHT) goto game_logic::@107 + to:game_logic::@31 +game_logic::@31: scope:[game_logic] from game_logic::@30 + [369] if(ghost2_direction==DOWN) goto game_logic::@108 + to:game_logic::@32 +game_logic::@32: scope:[game_logic] from game_logic::@31 + [370] if(ghost2_direction==LEFT) goto game_logic::@109 + to:game_logic::@33 +game_logic::@33: scope:[game_logic] from game_logic::@32 + [371] if(ghost2_direction!=UP) goto game_logic::@110 + to:game_logic::@34 +game_logic::@34: scope:[game_logic] from game_logic::@33 + [372] ghost2_yfine = -- ghost2_yfine + to:game_logic::@110 +game_logic::@110: scope:[game_logic] from game_logic::@107 game_logic::@108 game_logic::@109 game_logic::@33 game_logic::@34 + [373] game_logic::$226 = ghost2_direction + [374] if(ghost2_substep!=0) goto game_logic::@116 + to:game_logic::@168 +game_logic::@168: scope:[game_logic] from game_logic::@110 + [375] if(game_logic::$226!=STOP) goto game_logic::@111 + to:game_logic::@116 +game_logic::@116: scope:[game_logic] from game_logic::@110 game_logic::@168 + [376] ghost2_substep = 0 + [377] if(0!=ghost2_reverse) goto game_logic::@112 + to:game_logic::@117 +game_logic::@117: scope:[game_logic] from game_logic::@116 + [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 + [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 + [380] level_tile_directions::xtile#2 = game_logic::ghost2_xtile#0 + [381] level_tile_directions::ytile#2 = game_logic::ghost2_ytile#0 + [382] call level_tile_directions + [383] level_tile_directions::return#11 = level_tile_directions::return#2 + to:game_logic::@156 +game_logic::@156: scope:[game_logic] from game_logic::@117 + [384] game_logic::open_directions2#0 = level_tile_directions::return#11 + [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] + [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 + to:game_logic::@118 +game_logic::@118: scope:[game_logic] from game_logic::@156 + [387] if(ghosts_mode==SCATTER) goto game_logic::@114 + to:game_logic::@119 +game_logic::@119: scope:[game_logic] from game_logic::@118 + [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 + [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 + to:game_logic::@114 +game_logic::@114: scope:[game_logic] from game_logic::@118 game_logic::@119 + [390] game_logic::target_ytile2#3 = phi( game_logic::@118/2, game_logic::@119/game_logic::target_ytile2#2 ) + [390] game_logic::target_xtile2#3 = phi( game_logic::@118/2, game_logic::@119/game_logic::target_xtile2#2 ) + [391] choose_direction::open_directions#2 = game_logic::open_directions2#1 + [392] choose_direction::ghost_xtile#2 = game_logic::ghost2_xtile#0 + [393] choose_direction::ghost_ytile#2 = game_logic::ghost2_ytile#0 + [394] choose_direction::target_xtile#2 = game_logic::target_xtile2#3 + [395] choose_direction::target_ytile#2 = game_logic::target_ytile2#3 + [396] call choose_direction + [397] choose_direction::return#2 = choose_direction::return#10 + to:game_logic::@157 +game_logic::@157: scope:[game_logic] from game_logic::@114 + [398] game_logic::$161 = choose_direction::return#2 + [399] ghost2_direction = game_logic::$161 + to:game_logic::@return +game_logic::@113: scope:[game_logic] from game_logic::@156 + [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] + to:game_logic::@return +game_logic::@112: scope:[game_logic] from game_logic::@116 + [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] + [402] ghost2_reverse = 0 + to:game_logic::@return +game_logic::@111: scope:[game_logic] from game_logic::@168 + [403] ghost2_substep = 1 + [404] if(ghost2_xfine==1) goto game_logic::@115 + to:game_logic::@120 +game_logic::@120: scope:[game_logic] from game_logic::@111 + [405] if(ghost2_xfine!=$61) goto game_logic::@return + to:game_logic::@121 +game_logic::@121: scope:[game_logic] from game_logic::@120 + [406] ghost2_xfine = 1 + to:game_logic::@return +game_logic::@115: scope:[game_logic] from game_logic::@111 + [407] ghost2_xfine = $61 + to:game_logic::@return +game_logic::@109: scope:[game_logic] from game_logic::@32 + [408] ghost2_xfine = -- ghost2_xfine + to:game_logic::@110 +game_logic::@108: scope:[game_logic] from game_logic::@31 + [409] ghost2_yfine = ++ ghost2_yfine + to:game_logic::@110 +game_logic::@107: scope:[game_logic] from game_logic::@30 + [410] ghost2_xfine = ++ ghost2_xfine + to:game_logic::@110 +game_logic::@106: scope:[game_logic] from game_logic::@4 + [411] ghost2_respawn = -- ghost2_respawn + [412] if(ghost2_respawn!=0) goto game_logic::@return + to:game_logic::@122 +game_logic::@122: scope:[game_logic] from game_logic::@106 + [413] ghost2_direction = LEFT + [414] ghost2_xfine = $60 + [415] ghost2_yfine = $46 + [416] ghost2_substep = 0 + to:game_logic::@return +game_logic::@3: scope:[game_logic] from game_logic::@8 + [417] if(0!=ghost1_respawn) goto game_logic::@123 + to:game_logic::@35 +game_logic::@35: scope:[game_logic] from game_logic::@3 + [418] if(ghost1_direction==RIGHT) goto game_logic::@124 + to:game_logic::@36 +game_logic::@36: scope:[game_logic] from game_logic::@35 + [419] if(ghost1_direction==DOWN) goto game_logic::@125 + to:game_logic::@37 +game_logic::@37: scope:[game_logic] from game_logic::@36 + [420] if(ghost1_direction==LEFT) goto game_logic::@126 + to:game_logic::@38 +game_logic::@38: scope:[game_logic] from game_logic::@37 + [421] if(ghost1_direction!=UP) goto game_logic::@127 + to:game_logic::@39 +game_logic::@39: scope:[game_logic] from game_logic::@38 + [422] ghost1_yfine = -- ghost1_yfine + to:game_logic::@127 +game_logic::@127: scope:[game_logic] from game_logic::@124 game_logic::@125 game_logic::@126 game_logic::@38 game_logic::@39 + [423] game_logic::$229 = ghost1_direction + [424] if(ghost1_substep!=0) goto game_logic::@133 + to:game_logic::@169 +game_logic::@169: scope:[game_logic] from game_logic::@127 + [425] if(game_logic::$229!=STOP) goto game_logic::@128 + to:game_logic::@133 +game_logic::@133: scope:[game_logic] from game_logic::@127 game_logic::@169 + [426] ghost1_substep = 0 + [427] if(0!=ghost1_reverse) goto game_logic::@129 + to:game_logic::@134 +game_logic::@134: scope:[game_logic] from game_logic::@133 + [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 + [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 + [430] level_tile_directions::xtile#3 = game_logic::ghost1_xtile#0 + [431] level_tile_directions::ytile#3 = game_logic::ghost1_ytile#0 + [432] call level_tile_directions + [433] level_tile_directions::return#12 = level_tile_directions::return#2 + to:game_logic::@158 +game_logic::@158: scope:[game_logic] from game_logic::@134 + [434] game_logic::open_directions3#0 = level_tile_directions::return#12 + [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] + [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 + to:game_logic::@135 +game_logic::@135: scope:[game_logic] from game_logic::@158 + [437] if(ghosts_mode==SCATTER) goto game_logic::@131 + to:game_logic::@136 +game_logic::@136: scope:[game_logic] from game_logic::@135 + [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 + [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 + to:game_logic::@131 +game_logic::@131: scope:[game_logic] from game_logic::@135 game_logic::@136 + [440] game_logic::target_ytile3#3 = phi( game_logic::@135/2, game_logic::@136/game_logic::target_ytile3#2 ) + [440] game_logic::target_xtile3#3 = phi( game_logic::@135/2, game_logic::@136/game_logic::target_xtile3#2 ) + [441] choose_direction::open_directions#3 = game_logic::open_directions3#1 + [442] choose_direction::ghost_xtile#3 = game_logic::ghost1_xtile#0 + [443] choose_direction::ghost_ytile#3 = game_logic::ghost1_ytile#0 + [444] choose_direction::target_xtile#3 = game_logic::target_xtile3#3 + [445] choose_direction::target_ytile#3 = game_logic::target_ytile3#3 + [446] call choose_direction + [447] choose_direction::return#3 = choose_direction::return#10 + to:game_logic::@159 +game_logic::@159: scope:[game_logic] from game_logic::@131 + [448] game_logic::$182 = choose_direction::return#3 + [449] ghost1_direction = game_logic::$182 + to:game_logic::@return +game_logic::@130: scope:[game_logic] from game_logic::@158 + [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] + to:game_logic::@return +game_logic::@129: scope:[game_logic] from game_logic::@133 + [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] + [452] ghost1_reverse = 0 + to:game_logic::@return +game_logic::@128: scope:[game_logic] from game_logic::@169 + [453] ghost1_substep = 1 + [454] if(ghost1_xfine==1) goto game_logic::@132 + to:game_logic::@137 +game_logic::@137: scope:[game_logic] from game_logic::@128 + [455] if(ghost1_xfine!=$61) goto game_logic::@return + to:game_logic::@138 +game_logic::@138: scope:[game_logic] from game_logic::@137 + [456] ghost1_xfine = 1 + to:game_logic::@return +game_logic::@132: scope:[game_logic] from game_logic::@128 + [457] ghost1_xfine = $61 + to:game_logic::@return +game_logic::@126: scope:[game_logic] from game_logic::@37 + [458] ghost1_xfine = -- ghost1_xfine + to:game_logic::@127 +game_logic::@125: scope:[game_logic] from game_logic::@36 + [459] ghost1_yfine = ++ ghost1_yfine + to:game_logic::@127 +game_logic::@124: scope:[game_logic] from game_logic::@35 + [460] ghost1_xfine = ++ ghost1_xfine + to:game_logic::@127 +game_logic::@123: scope:[game_logic] from game_logic::@3 + [461] ghost1_respawn = -- ghost1_respawn + [462] if(ghost1_respawn!=0) goto game_logic::@return + to:game_logic::@139 +game_logic::@139: scope:[game_logic] from game_logic::@123 + [463] ghost1_direction = DOWN + [464] ghost1_xfine = $60 + [465] ghost1_yfine = 2 + [466] ghost1_substep = 0 + to:game_logic::@return +game_logic::@2: scope:[game_logic] from game_logic::@1 + [467] if(pacman_direction==RIGHT) goto game_logic::@140 + to:game_logic::@40 +game_logic::@40: scope:[game_logic] from game_logic::@2 + [468] if(pacman_direction==DOWN) goto game_logic::@141 + to:game_logic::@41 +game_logic::@41: scope:[game_logic] from game_logic::@40 + [469] if(pacman_direction==LEFT) goto game_logic::@142 + to:game_logic::@42 +game_logic::@42: scope:[game_logic] from game_logic::@41 + [470] if(pacman_direction!=UP) goto game_logic::@143 + to:game_logic::@43 +game_logic::@43: scope:[game_logic] from game_logic::@42 + [471] pacman_yfine = -- pacman_yfine + to:game_logic::@143 +game_logic::@143: scope:[game_logic] from game_logic::@140 game_logic::@141 game_logic::@142 game_logic::@42 game_logic::@43 + [472] game_logic::$232 = pacman_direction + [473] if(pacman_substep!=0) goto game_logic::@147 + to:game_logic::@170 +game_logic::@170: scope:[game_logic] from game_logic::@143 + [474] if(game_logic::$232!=STOP) goto game_logic::@144 + to:game_logic::@147 +game_logic::@147: scope:[game_logic] from game_logic::@143 game_logic::@170 + [475] pacman_substep = 0 + [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 + [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 + [478] level_tile_directions::xtile#4 = game_logic::pacman_xtile1#0 + [479] level_tile_directions::ytile#4 = game_logic::pacman_ytile1#0 + [480] call level_tile_directions + [481] level_tile_directions::return#13 = level_tile_directions::return#2 + to:game_logic::@160 +game_logic::@160: scope:[game_logic] from game_logic::@147 + [482] game_logic::open_directions4#0 = level_tile_directions::return#13 + [483] game_logic::$199 = *((byte*)CIA1) & $f + [484] game_logic::$200 = game_logic::$199 ^ $f + [485] game_logic::joy_directions#0 = game_logic::$200 << 2 + [486] if(game_logic::joy_directions#0==0) goto game_logic::@145 + to:game_logic::@148 +game_logic::@148: scope:[game_logic] from game_logic::@160 + [487] game_logic::$204 = game_logic::joy_directions#0 & game_logic::open_directions4#0 + [488] game_logic::new_direction#0 = DIRECTION_SINGLE[game_logic::$204] + [489] if(game_logic::new_direction#0==0) goto game_logic::@145 + to:game_logic::@149 +game_logic::@149: scope:[game_logic] from game_logic::@148 + [490] pacman_direction = game_logic::new_direction#0 + to:game_logic::@145 +game_logic::@145: scope:[game_logic] from game_logic::@148 game_logic::@149 game_logic::@160 + [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 + to:game_logic::@return +game_logic::@144: scope:[game_logic] from game_logic::@170 + [492] pacman_substep = 1 + [493] pacman_ch1_enabled = 1 + [494] if(pacman_xfine==1) goto game_logic::@146 + to:game_logic::@150 +game_logic::@150: scope:[game_logic] from game_logic::@144 + [495] if(pacman_xfine!=$61) goto game_logic::@return + to:game_logic::@151 +game_logic::@151: scope:[game_logic] from game_logic::@150 + [496] pacman_xfine = 1 + to:game_logic::@return +game_logic::@146: scope:[game_logic] from game_logic::@144 + [497] pacman_xfine = $61 + to:game_logic::@return +game_logic::@142: scope:[game_logic] from game_logic::@41 + [498] pacman_xfine = -- pacman_xfine + to:game_logic::@143 +game_logic::@141: scope:[game_logic] from game_logic::@40 + [499] pacman_yfine = ++ pacman_yfine + to:game_logic::@143 +game_logic::@140: scope:[game_logic] from game_logic::@2 + [500] pacman_xfine = ++ pacman_xfine + to:game_logic::@143 + +void pacman_sound_play() +pacman_sound_play: scope:[pacman_sound_play] from irq_screen_top::@8 + [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return + to:pacman_sound_play::@1 +pacman_sound_play::@1: scope:[pacman_sound_play] from pacman_sound_play + [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] + [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] + [504] pacman_ch1_idx = ++ pacman_ch1_idx + [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return + to:pacman_sound_play::@2 +pacman_sound_play::@2: scope:[pacman_sound_play] from pacman_sound_play::@1 + [506] pacman_ch1_idx = 0 + [507] pacman_ch1_enabled = 0 + to:pacman_sound_play::@return +pacman_sound_play::@return: scope:[pacman_sound_play] from pacman_sound_play pacman_sound_play::@1 pacman_sound_play::@2 + [508] return + to:@return + +void splash_run() +splash_run: scope:[splash_run] from main + [509] phi() + to:splash_run::SEI1 +splash_run::SEI1: scope:[splash_run] from splash_run + asm { sei } + to:splash_run::@16 +splash_run::@16: scope:[splash_run] from splash_run::SEI1 + [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR + [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + [513] *PROCPORT = PROCPORT_RAM_ALL + [514] call memset + to:splash_run::@20 +splash_run::@20: scope:[splash_run] from splash_run::@16 + [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED + [516] call byteboozer_decrunch + to:splash_run::@21 +splash_run::@21: scope:[splash_run] from splash_run::@20 + [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED + [518] call byteboozer_decrunch + to:splash_run::@22 +splash_run::@22: scope:[splash_run] from splash_run::@21 + [519] phi() + [520] call merge_code + to:splash_run::@23 +splash_run::@23: scope:[splash_run] from splash_run::@22 + [521] phi() + [522] call memset + to:splash_run::@24 +splash_run::@24: scope:[splash_run] from splash_run::@23 + [523] phi() + [524] call memset + to:splash_run::@25 +splash_run::@25: scope:[splash_run] from splash_run::@24 + [525] phi() + [526] call init_render_index + to:splash_run::@26 +splash_run::@26: scope:[splash_run] from splash_run::@25 + [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED + [528] call byteboozer_decrunch + to:splash_run::@27 +splash_run::@27: scope:[splash_run] from splash_run::@26 + [529] phi() + [530] call splash_show + to:splash_run::@28 +splash_run::@28: scope:[splash_run] from splash_run::@27 + [531] phi() + [532] call memset + to:splash_run::@29 +splash_run::@29: scope:[splash_run] from splash_run::@28 + [533] phi() + [534] call init_bobs_restore + to:splash_run::@30 +splash_run::@30: scope:[splash_run] from splash_run::@29 + [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED + [536] call byteboozer_decrunch + to:splash_run::@31 +splash_run::@31: scope:[splash_run] from splash_run::@30 + [537] phi() + [538] call init_sprite_pointers + to:splash_run::@32 +splash_run::@32: scope:[splash_run] from splash_run::@31 + [539] phi() + [540] call memcpy + to:splash_run::@33 +splash_run::@33: scope:[splash_run] from splash_run::@32 + [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER + [542] call byteboozer_decrunch + to:splash_run::@34 +splash_run::@34: scope:[splash_run] from splash_run::@33 + [543] phi() + [544] call memset + to:splash_run::@35 +splash_run::@35: scope:[splash_run] from splash_run::@34 + [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + [546] *PROCPORT = PROCPORT_RAM_IO + to:splash_run::@1 +splash_run::@1: scope:[splash_run] from splash_run::@3 splash_run::@35 + [547] splash_run::msb#10 = phi( splash_run::@35/0, splash_run::@3/splash_run::msb#8 ) + [547] splash_run::i#2 = phi( splash_run::@35/0, splash_run::@3/splash_run::i#1 ) + [548] if(splash_run::i#2<8) goto splash_run::@2 + to:splash_run::toDd001 +splash_run::toDd001: scope:[splash_run] from splash_run::@1 + [549] phi() + to:splash_run::@17 +splash_run::@17: scope:[splash_run] from splash_run::toDd001 + [550] *((byte*)CIA2) = splash_run::toDd001_return#0 + [551] canvas_base_hi = >SPRITES_2 + [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + to:splash_run::toD0181 +splash_run::toD0181: scope:[splash_run] from splash_run::@17 + [553] phi() + to:splash_run::@18 +splash_run::@18: scope:[splash_run] from splash_run::toD0181 + [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 + [555] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) = splash_run::msb#10 + [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff + [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff + [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK + [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK + [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + [562] top_sprites_mc = 3 + [563] side_sprites_mc = 0 + [564] bottom_sprites_mc = 3 + [565] top_sprites_color = YELLOW + [566] side_sprites_color = BLUE + [567] bottom_sprites_color = YELLOW + [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + to:splash_run::@5 +splash_run::@5: scope:[splash_run] from splash_run::@18 splash_run::@6 + [569] splash_run::i1#2 = phi( splash_run::@18/0, splash_run::@6/splash_run::i1#1 ) + [570] if(splash_run::i1#2<8) goto splash_run::@6 + to:splash_run::@7 +splash_run::@7: scope:[splash_run] from splash_run::@5 + [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 + to:splash_run::@8 +splash_run::@8: scope:[splash_run] from splash_run::@7 splash_run::@9 + [572] splash_run::i2#2 = phi( splash_run::@9/splash_run::i2#1, splash_run::@7/0 ) + [573] if(splash_run::i2#2<4) goto splash_run::@9 + to:splash_run::@10 +splash_run::@10: scope:[splash_run] from splash_run::@8 + asm { lda#1 staINTRO_MUSIC+$69 } + asm { lda#0 } + [576] call *musicInit + [577] phase = 0 + [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:splash_run::@11 +splash_run::@11: scope:[splash_run] from splash_run::@10 splash_run::@11 + [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 + to:splash_run::@12 +splash_run::@12: scope:[splash_run] from splash_run::@11 + [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [582] *HARDWARE_IRQ = &irq_screen_top + [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + [585] *IRQ_STATUS = $f + to:splash_run::CLI1 +splash_run::CLI1: scope:[splash_run] from splash_run::@12 + asm { cli } + to:splash_run::@19 +splash_run::@19: scope:[splash_run] from splash_run::CLI1 + [587] phi() + [588] call joyinit + to:splash_run::@36 +splash_run::@36: scope:[splash_run] from splash_run::@19 + [589] music_play_next = 0 + to:splash_run::@13 +splash_run::@13: scope:[splash_run] from splash_run::@14 splash_run::@15 splash_run::@36 + [590] phi() + [591] call joyfire + [592] joyfire::return#1 = joyfire::return#4 + to:splash_run::@37 +splash_run::@37: scope:[splash_run] from splash_run::@13 + [593] splash_run::$30 = joyfire::return#1 + [594] if(0==splash_run::$30) goto splash_run::@14 + to:splash_run::@return +splash_run::@return: scope:[splash_run] from splash_run::@37 + [595] return + to:@return +splash_run::@14: scope:[splash_run] from splash_run::@37 + [596] if(0==music_play_next) goto splash_run::@13 + to:splash_run::@15 +splash_run::@15: scope:[splash_run] from splash_run::@14 + [597] call *musicPlay + [598] music_play_next = 0 + to:splash_run::@13 +splash_run::@9: scope:[splash_run] from splash_run::@8 + [599] bobs_xcol[splash_run::i2#2] = $a + [600] bobs_yfine[splash_run::i2#2] = $2d + [601] bobs_bob_id[splash_run::i2#2] = 0 + [602] splash_run::i2#1 = ++ splash_run::i2#2 + to:splash_run::@8 +splash_run::@6: scope:[splash_run] from splash_run::@5 + [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color + [604] splash_run::i1#1 = ++ splash_run::i1#2 + to:splash_run::@5 +splash_run::@2: scope:[splash_run] from splash_run::@1 + [605] splash_run::$34 = splash_run::i#2 << 1 + [606] SPRITES_YPOS[splash_run::$34] = 7 + [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] + [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 + [609] splash_run::msb#1 = splash_run::msb#10 >> 1 + [610] splash_run::$25 = > splash_run::xpos#0 + [611] if(0==splash_run::$25) goto splash_run::@3 + to:splash_run::@4 +splash_run::@4: scope:[splash_run] from splash_run::@2 + [612] splash_run::msb#2 = splash_run::msb#1 | $80 + to:splash_run::@3 +splash_run::@3: scope:[splash_run] from splash_run::@2 splash_run::@4 + [613] splash_run::msb#8 = phi( splash_run::@2/splash_run::msb#1, splash_run::@4/splash_run::msb#2 ) + [614] splash_run::i#1 = ++ splash_run::i#2 + to:splash_run::@1 + +void gameplay_run() +gameplay_run: scope:[gameplay_run] from main::@1 + [615] phi() + to:gameplay_run::SEI1 +gameplay_run::SEI1: scope:[gameplay_run] from gameplay_run + asm { sei } + to:gameplay_run::@1 +gameplay_run::@1: scope:[gameplay_run] from gameplay_run::@2 gameplay_run::SEI1 + [617] gameplay_run::i#2 = phi( gameplay_run::SEI1/0, gameplay_run::@2/gameplay_run::i#1 ) + [618] if(gameplay_run::i#2<$2f) goto gameplay_run::@2 + to:gameplay_run::@3 +gameplay_run::@3: scope:[gameplay_run] from gameplay_run::@1 + [619] pacman_wins = 0 + [620] pacman_lives = 3 + [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK + [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK + to:gameplay_run::@4 +gameplay_run::@4: scope:[gameplay_run] from gameplay_run::@3 gameplay_run::@5 + [623] gameplay_run::i1#2 = phi( gameplay_run::@3/0, gameplay_run::@5/gameplay_run::i1#1 ) + [624] if(gameplay_run::i1#2<8) goto gameplay_run::@5 + to:gameplay_run::@6 +gameplay_run::@6: scope:[gameplay_run] from gameplay_run::@4 + [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED + [626] call byteboozer_decrunch + to:gameplay_run::@14 +gameplay_run::@14: scope:[gameplay_run] from gameplay_run::@6 + [627] phi() + [628] call init_level_tile_directions + to:gameplay_run::@15 +gameplay_run::@15: scope:[gameplay_run] from gameplay_run::@14 + [629] phi() + [630] call init_sprite_pointers + to:gameplay_run::@16 +gameplay_run::@16: scope:[gameplay_run] from gameplay_run::@15 + [631] phi() + [632] call level_show + [633] level_show::return#0 = level_show::count#12 + to:gameplay_run::@17 +gameplay_run::@17: scope:[gameplay_run] from gameplay_run::@16 + [634] gameplay_run::$4 = level_show::return#0 + [635] pill_count = gameplay_run::$4 + [636] top_sprites_mc = $ff + [637] side_sprites_mc = $ff + [638] bottom_sprites_mc = $ff + [639] top_sprites_color = YELLOW + [640] side_sprites_color = YELLOW + [641] bottom_sprites_color = YELLOW + [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + to:gameplay_run::@7 +gameplay_run::@7: scope:[gameplay_run] from gameplay_run::@17 gameplay_run::@8 + [643] gameplay_run::i2#2 = phi( gameplay_run::@17/0, gameplay_run::@8/gameplay_run::i2#1 ) + [644] if(gameplay_run::i2#2<8) goto gameplay_run::@8 + to:gameplay_run::@9 +gameplay_run::@9: scope:[gameplay_run] from gameplay_run::@7 + [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + [647] phase = 1 + [648] call spawn_all + to:gameplay_run::@18 +gameplay_run::@18: scope:[gameplay_run] from gameplay_run::@9 + [649] phi() + [650] call pacman_sound_init + to:gameplay_run::@19 +gameplay_run::@19: scope:[gameplay_run] from gameplay_run::@18 + [651] game_playable = 1 + [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:gameplay_run::@10 +gameplay_run::@10: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@19 + [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 + to:gameplay_run::@11 +gameplay_run::@11: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@11 + [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 + to:gameplay_run::@12 +gameplay_run::@12: scope:[gameplay_run] from gameplay_run::@11 + [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [657] *HARDWARE_IRQ = &irq_screen_top + [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + [660] *IRQ_STATUS = $f + to:gameplay_run::CLI1 +gameplay_run::CLI1: scope:[gameplay_run] from gameplay_run::@12 + asm { cli } + to:gameplay_run::@13 +gameplay_run::@13: scope:[gameplay_run] from gameplay_run::@20 gameplay_run::CLI1 + [662] if(0!=pacman_wins) goto gameplay_run::@return + to:gameplay_run::@20 +gameplay_run::@20: scope:[gameplay_run] from gameplay_run::@13 + [663] if(pacman_lives==0) goto gameplay_run::@return + to:gameplay_run::@13 +gameplay_run::@return: scope:[gameplay_run] from gameplay_run::@13 gameplay_run::@20 + [664] return + to:@return +gameplay_run::@8: scope:[gameplay_run] from gameplay_run::@7 + [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color + [666] gameplay_run::i2#1 = ++ gameplay_run::i2#2 + to:gameplay_run::@7 +gameplay_run::@5: scope:[gameplay_run] from gameplay_run::@4 + [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK + [668] gameplay_run::i1#1 = ++ gameplay_run::i1#2 + to:gameplay_run::@4 +gameplay_run::@2: scope:[gameplay_run] from gameplay_run::@1 + [669] ((byte*)SID)[gameplay_run::i#2] = 0 + [670] gameplay_run::i#1 = ++ gameplay_run::i#2 + to:gameplay_run::@1 + +void done_run() +done_run: scope:[done_run] from main::@2 + [671] game_playable = 0 + [672] phase = 0 + to:done_run::@2 +done_run::@2: scope:[done_run] from done_run done_run::@3 + [673] done_run::i#2 = phi( done_run/0, done_run::@3/done_run::i#1 ) + [674] if(done_run::i#2<$2f) goto done_run::@3 + to:done_run::@4 +done_run::@4: scope:[done_run] from done_run::@2 done_run::@5 + [675] done_run::i1#2 = phi( done_run::@2/0, done_run::@5/done_run::i1#1 ) + [676] if(done_run::i1#2<4) goto done_run::@5 + to:done_run::@6 +done_run::@6: scope:[done_run] from done_run::@4 + asm { lda#0 } + [678] call *musicInit + [679] if(0!=pacman_wins) goto done_run::@1 + to:done_run::@7 +done_run::@7: scope:[done_run] from done_run::@6 + [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED + [681] call byteboozer_decrunch + to:done_run::@8 +done_run::@8: scope:[done_run] from done_run::@1 done_run::@12 done_run::@7 + [682] done_run::gfx#4 = phi( done_run::@12/done_run::gfx#2, done_run::@1/WIN_GFX, done_run::@7/WIN_GFX ) + [682] done_run::xcol#2 = phi( done_run::@12/done_run::xcol#1, done_run::@1/0, done_run::@7/0 ) + [683] if(done_run::xcol#2<$19) goto done_run::@10 + to:done_run::@9 +done_run::@9: scope:[done_run] from done_run::@8 + [684] music_play_next = 0 + to:done_run::@13 +done_run::@13: scope:[done_run] from done_run::@14 done_run::@15 done_run::@9 + [685] phi() + [686] call joyfire + [687] joyfire::return#0 = joyfire::return#4 + to:done_run::@17 +done_run::@17: scope:[done_run] from done_run::@13 + [688] done_run::$8 = joyfire::return#0 + [689] if(0==done_run::$8) goto done_run::@14 + to:done_run::@return +done_run::@return: scope:[done_run] from done_run::@17 + [690] return + to:@return +done_run::@14: scope:[done_run] from done_run::@17 + [691] if(0==music_play_next) goto done_run::@13 + to:done_run::@15 +done_run::@15: scope:[done_run] from done_run::@14 + [692] call *musicPlay + [693] music_play_next = 0 + to:done_run::@13 +done_run::@10: scope:[done_run] from done_run::@16 done_run::@8 + [694] done_run::gfx#2 = phi( done_run::@8/done_run::gfx#4, done_run::@16/done_run::gfx#1 ) + [694] done_run::ypos#2 = phi( done_run::@8/0, done_run::@16/done_run::ypos#1 ) + [695] if(done_run::ypos#2<$19) goto done_run::@11 + to:done_run::@12 +done_run::@12: scope:[done_run] from done_run::@10 + [696] done_run::xcol#1 = ++ done_run::xcol#2 + to:done_run::@8 +done_run::@11: scope:[done_run] from done_run::@10 + [697] done_run::pixels#0 = *done_run::gfx#2 + [698] done_run::gfx#1 = ++ done_run::gfx#2 + [699] render::xcol#0 = done_run::xcol#2 + [700] render::ypos#0 = done_run::ypos#2 + [701] render::pixels#0 = done_run::pixels#0 + [702] call render + to:done_run::@16 +done_run::@16: scope:[done_run] from done_run::@11 + [703] done_run::ypos#1 = ++ done_run::ypos#2 + to:done_run::@10 +done_run::@1: scope:[done_run] from done_run::@6 + [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED + [705] call byteboozer_decrunch + to:done_run::@8 +done_run::@5: scope:[done_run] from done_run::@4 + [706] bobs_xcol[done_run::i1#2] = $a + [707] bobs_yfine[done_run::i1#2] = $2d + [708] bobs_bob_id[done_run::i1#2] = 0 + [709] done_run::i1#1 = ++ done_run::i1#2 + to:done_run::@4 +done_run::@3: scope:[done_run] from done_run::@2 + [710] ((byte*)SID)[done_run::i#2] = 0 + [711] done_run::i#1 = ++ done_run::i#2 + to:done_run::@2 + +void spawn_all() +spawn_all: scope:[spawn_all] from game_logic::@68 game_logic::@69 game_logic::@70 game_logic::@71 gameplay_run::@9 + [712] ghosts_mode_count = 0 + [713] pacman_substep = 0 + [714] ghost1_substep = 0 + [715] ghost2_substep = 0 + [716] ghost3_substep = 0 + [717] ghost4_substep = 0 + [718] pacman_direction = STOP + [719] ghost1_direction = STOP + [720] ghost2_direction = STOP + [721] ghost3_direction = STOP + [722] ghost4_direction = STOP + [723] pacman_xfine = $32 + [724] ghost1_xfine = $32 + [725] ghost2_xfine = $32 + [726] ghost3_xfine = $32 + [727] ghost4_xfine = $32 + [728] ghost1_yfine = $23 + [729] ghost2_yfine = $23 + [730] ghost3_yfine = $23 + [731] ghost4_yfine = $23 + [732] pacman_yfine = $3e + [733] ghost1_respawn = $a + [734] ghost2_respawn = $14 + [735] ghost3_respawn = $1e + [736] ghost4_respawn = $28 + to:spawn_all::@return +spawn_all::@return: scope:[spawn_all] from spawn_all + [737] return + to:@return + +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +level_tile_directions: scope:[level_tile_directions] from game_logic::@100 game_logic::@117 game_logic::@134 game_logic::@147 game_logic::@83 + [738] level_tile_directions::ytile#5 = phi( game_logic::@100/level_tile_directions::ytile#1, game_logic::@117/level_tile_directions::ytile#2, game_logic::@134/level_tile_directions::ytile#3, game_logic::@147/level_tile_directions::ytile#4, game_logic::@83/level_tile_directions::ytile#0 ) + [738] level_tile_directions::xtile#5 = phi( game_logic::@100/level_tile_directions::xtile#1, game_logic::@117/level_tile_directions::xtile#2, game_logic::@134/level_tile_directions::xtile#3, game_logic::@147/level_tile_directions::xtile#4, game_logic::@83/level_tile_directions::xtile#0 ) + [739] if(level_tile_directions::xtile#5>=$31+1) goto level_tile_directions::@return + to:level_tile_directions::@2 +level_tile_directions::@2: scope:[level_tile_directions] from level_tile_directions + [740] if(level_tile_directions::ytile#5>=$24+1) goto level_tile_directions::@return + to:level_tile_directions::@1 +level_tile_directions::@1: scope:[level_tile_directions] from level_tile_directions::@2 + [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 + [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] + [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] + to:level_tile_directions::@return +level_tile_directions::@return: scope:[level_tile_directions] from level_tile_directions level_tile_directions::@1 level_tile_directions::@2 + [744] level_tile_directions::return#2 = phi( level_tile_directions::@1/level_tile_directions::return#0, level_tile_directions/0, level_tile_directions::@2/0 ) + [745] return + to:@return + +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +choose_direction: scope:[choose_direction] from game_logic::@114 game_logic::@131 game_logic::@80 game_logic::@97 + [746] choose_direction::open_directions#10 = phi( game_logic::@114/choose_direction::open_directions#2, game_logic::@131/choose_direction::open_directions#3, game_logic::@80/choose_direction::open_directions#0, game_logic::@97/choose_direction::open_directions#1 ) + [746] choose_direction::target_ytile#4 = phi( game_logic::@114/choose_direction::target_ytile#2, game_logic::@131/choose_direction::target_ytile#3, game_logic::@80/choose_direction::target_ytile#0, game_logic::@97/choose_direction::target_ytile#1 ) + [746] choose_direction::ghost_ytile#4 = phi( game_logic::@114/choose_direction::ghost_ytile#2, game_logic::@131/choose_direction::ghost_ytile#3, game_logic::@80/choose_direction::ghost_ytile#0, game_logic::@97/choose_direction::ghost_ytile#1 ) + [746] choose_direction::target_xtile#4 = phi( game_logic::@114/choose_direction::target_xtile#2, game_logic::@131/choose_direction::target_xtile#3, game_logic::@80/choose_direction::target_xtile#0, game_logic::@97/choose_direction::target_xtile#1 ) + [746] choose_direction::ghost_xtile#4 = phi( game_logic::@114/choose_direction::ghost_xtile#2, game_logic::@131/choose_direction::ghost_xtile#3, game_logic::@80/choose_direction::ghost_xtile#0, game_logic::@97/choose_direction::ghost_xtile#1 ) + [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 + [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 + [749] choose_direction::$2 = choose_direction::open_directions#10 & UP + [750] if(0==choose_direction::$2) goto choose_direction::@1 + to:choose_direction::@5 +choose_direction::@5: scope:[choose_direction] from choose_direction + [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] + [752] if(choose_direction::dist_up#0>=$ff) goto choose_direction::@1 + to:choose_direction::@6 +choose_direction::@6: scope:[choose_direction] from choose_direction::@5 + [753] phi() + to:choose_direction::@1 +choose_direction::@1: scope:[choose_direction] from choose_direction choose_direction::@5 choose_direction::@6 + [754] choose_direction::direction#10 = phi( choose_direction/STOP, choose_direction::@5/STOP, choose_direction::@6/UP ) + [754] choose_direction::dist_min#6 = phi( choose_direction/$ff, choose_direction::@5/$ff, choose_direction::@6/choose_direction::dist_up#0 ) + [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN + [756] if(0==choose_direction::$4) goto choose_direction::@10 + to:choose_direction::@7 +choose_direction::@7: scope:[choose_direction] from choose_direction::@1 + [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] + [758] if(choose_direction::dist_down#0>=choose_direction::dist_min#6) goto choose_direction::@11 + to:choose_direction::@2 +choose_direction::@11: scope:[choose_direction] from choose_direction::@7 + [759] choose_direction::dist_min#14 = choose_direction::dist_min#6 + to:choose_direction::@2 +choose_direction::@2: scope:[choose_direction] from choose_direction::@10 choose_direction::@11 choose_direction::@7 + [760] choose_direction::direction#8 = phi( choose_direction::@10/choose_direction::direction#10, choose_direction::@11/choose_direction::direction#10, choose_direction::@7/DOWN ) + [760] choose_direction::dist_min#10 = phi( choose_direction::@10/choose_direction::dist_min#13, choose_direction::@11/choose_direction::dist_min#14, choose_direction::@7/choose_direction::dist_down#0 ) + [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT + [762] if(0==choose_direction::$6) goto choose_direction::@12 + to:choose_direction::@8 +choose_direction::@8: scope:[choose_direction] from choose_direction::@2 + [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] + [764] if(choose_direction::dist_left#0>=choose_direction::dist_min#10) goto choose_direction::@13 + to:choose_direction::@3 +choose_direction::@13: scope:[choose_direction] from choose_direction::@8 + [765] choose_direction::dist_min#18 = choose_direction::dist_min#10 + to:choose_direction::@3 +choose_direction::@3: scope:[choose_direction] from choose_direction::@12 choose_direction::@13 choose_direction::@8 + [766] choose_direction::dist_min#11 = phi( choose_direction::@8/choose_direction::dist_left#0, choose_direction::@12/choose_direction::dist_min#17, choose_direction::@13/choose_direction::dist_min#18 ) + [766] choose_direction::direction#6 = phi( choose_direction::@8/LEFT, choose_direction::@12/choose_direction::direction#8, choose_direction::@13/choose_direction::direction#8 ) + [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT + [768] if(0==choose_direction::$8) goto choose_direction::@4 + to:choose_direction::@9 +choose_direction::@9: scope:[choose_direction] from choose_direction::@3 + [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] + [770] if(choose_direction::dist_right#0>=choose_direction::dist_min#11) goto choose_direction::@14 + to:choose_direction::@4 +choose_direction::@14: scope:[choose_direction] from choose_direction::@9 + [771] phi() + to:choose_direction::@4 +choose_direction::@4: scope:[choose_direction] from choose_direction::@14 choose_direction::@3 choose_direction::@9 + [772] choose_direction::return#10 = phi( choose_direction::@14/choose_direction::direction#6, choose_direction::@9/RIGHT, choose_direction::@3/choose_direction::direction#6 ) + to:choose_direction::@return +choose_direction::@return: scope:[choose_direction] from choose_direction::@4 + [773] return + to:@return +choose_direction::@12: scope:[choose_direction] from choose_direction::@2 + [774] choose_direction::dist_min#17 = choose_direction::dist_min#10 + to:choose_direction::@3 +choose_direction::@10: scope:[choose_direction] from choose_direction::@1 + [775] choose_direction::dist_min#13 = choose_direction::dist_min#6 + to:choose_direction::@2 + +void* memset(void* memset::str , byte memset::c , word memset::num) +memset: scope:[memset] from splash_run::@16 splash_run::@23 splash_run::@24 splash_run::@28 splash_run::@34 + [776] memset::str#6 = phi( splash_run::@16/(void*) 16384, splash_run::@23/(void*)BANK_1+$2000, splash_run::@24/(void*)BANK_2, splash_run::@28/(void*)BANK_1, splash_run::@34/(void*)INTRO_MUSIC_CRUNCHED_UPPER ) + [776] memset::num#5 = phi( splash_run::@16/$c00, splash_run::@23/$1fff, splash_run::@24/$3fff, splash_run::@28/$1fff, splash_run::@34/INTRO_MUSIC_CRUNCHED_SIZE ) + [777] if(memset::num#5<=0) goto memset::@return + to:memset::@1 +memset::@1: scope:[memset] from memset + [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 + [779] memset::dst#4 = (byte*)memset::str#6 + to:memset::@2 +memset::@2: scope:[memset] from memset::@1 memset::@3 + [780] memset::dst#2 = phi( memset::@1/memset::dst#4, memset::@3/memset::dst#1 ) + [781] if(memset::dst#2!=memset::end#0) goto memset::@3 + to:memset::@return +memset::@return: scope:[memset] from memset memset::@2 + [782] return + to:@return +memset::@3: scope:[memset] from memset::@2 + [783] *memset::dst#2 = 0 + [784] memset::dst#1 = ++ memset::dst#2 + to:memset::@2 + +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +byteboozer_decrunch: scope:[byteboozer_decrunch] from done_run::@1 done_run::@7 gameplay_run::@6 splash_run::@20 splash_run::@21 splash_run::@26 splash_run::@30 splash_run::@33 + asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } + to:byteboozer_decrunch::@return +byteboozer_decrunch::@return: scope:[byteboozer_decrunch] from byteboozer_decrunch + [786] return + to:@return + +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +merge_code: scope:[merge_code] from splash_run::@22 + [787] phi() + to:merge_code::@1 +merge_code::@1: scope:[merge_code] from merge_code merge_code::@10 merge_code::@2 + [788] merge_code::logic_code#18 = phi( merge_code/LOGIC_CODE_UNMERGED, merge_code::@10/merge_code::logic_code#17, merge_code::@2/merge_code::logic_code#18 ) + [788] merge_code::dest_code#14 = phi( merge_code/RASTER_CODE, merge_code::@10/merge_code::dest_code#10, merge_code::@2/merge_code::dest_code#0 ) + [788] merge_code::raster_code#4 = phi( merge_code/RASTER_CODE_UNMERGED, merge_code::@10/merge_code::raster_code#2, merge_code::@2/merge_code::raster_code#0 ) + [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 + to:merge_code::@3 +merge_code::@3: scope:[merge_code] from merge_code::@1 + [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 + [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 + [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 + [793] if(merge_code::cycle_budget#0!=merge_code::RASTER_EXIT) goto merge_code::@4 + to:merge_code::@14 +merge_code::@14: scope:[merge_code] from merge_code::@19 merge_code::@3 + [794] merge_code::dest_code#12 = phi( merge_code::@19/merge_code::dest_code#13, merge_code::@3/merge_code::dest_code#14 ) + [794] merge_code::logic_code#12 = phi( merge_code::@19/merge_code::logic_code#5, merge_code::@3/merge_code::logic_code#18 ) + [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 + to:merge_code::@16 +merge_code::@16: scope:[merge_code] from merge_code::@14 + [796] *merge_code::dest_code#12 = $60 + to:merge_code::@return +merge_code::@return: scope:[merge_code] from merge_code::@16 + [797] return + to:@return +merge_code::@15: scope:[merge_code] from merge_code::@14 + [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 + to:merge_code::@17 +merge_code::@17: scope:[merge_code] from merge_code::@15 merge_code::@18 + [799] merge_code::dest_code#13 = phi( merge_code::@15/merge_code::dest_code#12, merge_code::@18/merge_code::dest_code#6 ) + [799] merge_code::logic_code#14 = phi( merge_code::@15/merge_code::logic_code#3, merge_code::@18/merge_code::logic_code#4 ) + [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 + to:merge_code::@19 +merge_code::@19: scope:[merge_code] from merge_code::@17 + [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 + to:merge_code::@14 +merge_code::@18: scope:[merge_code] from merge_code::@17 + [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 + [803] merge_code::dest_code#6 = ++ merge_code::dest_code#13 + [804] merge_code::logic_code#4 = ++ merge_code::logic_code#14 + to:merge_code::@17 +merge_code::@4: scope:[merge_code] from merge_code::@3 merge_code::@8 + [805] merge_code::dest_code#21 = phi( merge_code::@3/merge_code::dest_code#14, merge_code::@8/merge_code::dest_code#15 ) + [805] merge_code::logic_code#17 = phi( merge_code::@3/merge_code::logic_code#18, merge_code::@8/merge_code::logic_code#2 ) + [805] merge_code::cycle_budget#13 = phi( merge_code::@3/merge_code::cycle_budget#0, merge_code::@8/merge_code::cycle_budget#1 ) + [806] if(merge_code::cycle_budget#13<=0) goto merge_code::@10 + to:merge_code::@5 +merge_code::@5: scope:[merge_code] from merge_code::@4 + [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 + [808] merge_code::$5 = merge_code::cycle_budget#13 - 1 + [809] if(merge_code::logic_cycles#0!=merge_code::LOGIC_EXIT) goto merge_code::@20 + to:merge_code::@10 +merge_code::@10: scope:[merge_code] from merge_code::@12 merge_code::@13 merge_code::@21 merge_code::@4 merge_code::@5 + [810] merge_code::dest_code#10 = phi( merge_code::@12/merge_code::dest_code#3, merge_code::@13/merge_code::dest_code#4, merge_code::@4/merge_code::dest_code#21, merge_code::@5/merge_code::dest_code#21 ) + [810] merge_code::cycle_budget#10 = phi( merge_code::@12/merge_code::cycle_budget#2, merge_code::@13/merge_code::cycle_budget#3, merge_code::@4/merge_code::cycle_budget#13, merge_code::@5/merge_code::cycle_budget#13 ) + [811] if(merge_code::cycle_budget#10>0) goto merge_code::@11 + to:merge_code::@1 +merge_code::@11: scope:[merge_code] from merge_code::@10 + [812] if(merge_code::cycle_budget#10==3) goto merge_code::@12 + to:merge_code::@13 +merge_code::@13: scope:[merge_code] from merge_code::@11 + [813] *merge_code::dest_code#10 = $ea + [814] merge_code::dest_code#4 = ++ merge_code::dest_code#10 + [815] merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 + to:merge_code::@10 +merge_code::@12: scope:[merge_code] from merge_code::@11 + [816] *merge_code::dest_code#10 = $24 + [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 + [818] *merge_code::dest_code#2 = $ea + [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 + [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 + to:merge_code::@10 +merge_code::@20: scope:[merge_code] from merge_code::@5 + [821] if(merge_code::logic_cycles#0 init_render_index::canvas#0 + [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 + [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 + [859] init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 + [860] if(init_render_index::ypos_inc_offset#2<$17) goto init_render_index::@8 + to:init_render_index::@9 +init_render_index::@9: scope:[init_render_index] from init_render_index::@6 + [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 + to:init_render_index::@8 +init_render_index::@8: scope:[init_render_index] from init_render_index::@6 init_render_index::@9 + [862] init_render_index::ypos_inc_offset#8 = phi( init_render_index::@6/init_render_index::ypos_inc_offset#2, init_render_index::@9/init_render_index::ypos_inc_offset#3 ) + [863] init_render_index::render_index_xcol#1 = ++ init_render_index::render_index_xcol#2 + [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 + to:init_render_index::@5 + +void splash_show() +splash_show: scope:[splash_show] from splash_run::@27 + [865] phi() + to:splash_show::@1 +splash_show::@1: scope:[splash_show] from splash_show splash_show::@4 + [866] splash_show::splash#4 = phi( splash_show/SPLASH, splash_show::@4/splash_show::splash#2 ) + [866] splash_show::xcol#2 = phi( splash_show/0, splash_show::@4/splash_show::xcol#1 ) + [867] if(splash_show::xcol#2<$19) goto splash_show::@2 + to:splash_show::@return +splash_show::@return: scope:[splash_show] from splash_show::@1 + [868] return + to:@return +splash_show::@2: scope:[splash_show] from splash_show::@1 splash_show::@5 + [869] splash_show::splash#2 = phi( splash_show::@1/splash_show::splash#4, splash_show::@5/splash_show::splash#1 ) + [869] splash_show::ypos#2 = phi( splash_show::@1/0, splash_show::@5/splash_show::ypos#1 ) + [870] if(splash_show::ypos#2<$93) goto splash_show::@3 + to:splash_show::@4 +splash_show::@4: scope:[splash_show] from splash_show::@2 + [871] splash_show::xcol#1 = ++ splash_show::xcol#2 + to:splash_show::@1 +splash_show::@3: scope:[splash_show] from splash_show::@2 + [872] splash_show::pixels#0 = *splash_show::splash#2 + [873] splash_show::splash#1 = ++ splash_show::splash#2 + [874] render::xcol#1 = splash_show::xcol#2 + [875] render::ypos#1 = splash_show::ypos#2 + [876] render::pixels#1 = splash_show::pixels#0 + [877] call render + to:splash_show::@5 +splash_show::@5: scope:[splash_show] from splash_show::@3 + [878] splash_show::ypos#1 = ++ splash_show::ypos#2 + to:splash_show::@2 + +void init_bobs_restore() +init_bobs_restore: scope:[init_bobs_restore] from splash_run::@29 + [879] phi() + to:init_bobs_restore::@1 +init_bobs_restore::@1: scope:[init_bobs_restore] from init_bobs_restore init_bobs_restore::@5 + [880] init_bobs_restore::bob_restore#5 = phi( init_bobs_restore/bobs_restore, init_bobs_restore::@5/init_bobs_restore::bob_restore#1 ) + [880] init_bobs_restore::bob#2 = phi( init_bobs_restore/0, init_bobs_restore::@5/init_bobs_restore::bob#1 ) + [881] if(init_bobs_restore::bob#2init_bobs_restore::CANVAS_HIDDEN + [890] init_bobs_restore::bob_restore#5[3] = 0 + [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN + [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE + [893] init_bobs_restore::bob#1 = ++ init_bobs_restore::bob#2 + to:init_bobs_restore::@1 +init_bobs_restore::@4: scope:[init_bobs_restore] from init_bobs_restore::@3 + [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 + [895] init_bobs_restore::i#1 = ++ init_bobs_restore::i#2 + to:init_bobs_restore::@3 + +void init_sprite_pointers() +init_sprite_pointers: scope:[init_sprite_pointers] from gameplay_run::@15 splash_run::@31 + [896] phi() + to:init_sprite_pointers::@1 +init_sprite_pointers::@1: scope:[init_sprite_pointers] from init_sprite_pointers init_sprite_pointers::@4 + [897] init_sprite_pointers::sprites_ptr_2#5 = phi( init_sprite_pointers/SCREENS_2+OFFSET_SPRITE_PTRS, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_2#1 ) + [897] init_sprite_pointers::sprites_ptr_1#5 = phi( init_sprite_pointers/SCREENS_1+OFFSET_SPRITE_PTRS, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_1#1 ) + [897] init_sprite_pointers::screen#2 = phi( init_sprite_pointers/0, init_sprite_pointers::@4/init_sprite_pointers::screen#1 ) + [898] if(init_sprite_pointers::screen#2<$e) goto init_sprite_pointers::@2 + to:init_sprite_pointers::@return +init_sprite_pointers::@return: scope:[init_sprite_pointers] from init_sprite_pointers::@1 + [899] return + to:@return +init_sprite_pointers::@2: scope:[init_sprite_pointers] from init_sprite_pointers::@1 init_sprite_pointers::@3 + [900] init_sprite_pointers::sprite#2 = phi( init_sprite_pointers::@1/0, init_sprite_pointers::@3/init_sprite_pointers::sprite#1 ) + [901] if(init_sprite_pointers::sprite#2<8) goto init_sprite_pointers::@3 + to:init_sprite_pointers::@4 +init_sprite_pointers::@4: scope:[init_sprite_pointers] from init_sprite_pointers::@2 + [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 + [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 + [904] init_sprite_pointers::screen#1 = ++ init_sprite_pointers::screen#2 + to:init_sprite_pointers::@1 +init_sprite_pointers::@3: scope:[init_sprite_pointers] from init_sprite_pointers::@2 + [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 + [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] + [907] init_sprite_pointers::sprites_ptr_1#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 + [908] init_sprite_pointers::sprites_ptr_2#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 + [909] init_sprite_pointers::sprite#1 = ++ init_sprite_pointers::sprite#2 + to:init_sprite_pointers::@2 + +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +memcpy: scope:[memcpy] from splash_run::@32 + [910] phi() + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + [911] memcpy::dst#2 = phi( memcpy/(byte*)memcpy::destination#0, memcpy::@2/memcpy::dst#1 ) + [911] memcpy::src#2 = phi( memcpy/(byte*)memcpy::source#0, memcpy::@2/memcpy::src#1 ) + [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@1 + [913] return + to:@return +memcpy::@2: scope:[memcpy] from memcpy::@1 + [914] *memcpy::dst#2 = *memcpy::src#2 + [915] memcpy::dst#1 = ++ memcpy::dst#2 + [916] memcpy::src#1 = ++ memcpy::src#2 + to:memcpy::@1 + +void joyinit() +joyinit: scope:[joyinit] from splash_run::@19 + [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 + to:joyinit::@return +joyinit::@return: scope:[joyinit] from joyinit + [918] return + to:@return + +byte joyfire() +joyfire: scope:[joyfire] from done_run::@13 splash_run::@13 + [919] joyfire::$0 = *((byte*)CIA1) & $10 + [920] if(joyfire::$0==0) goto joyfire::@1 + to:joyfire::@return +joyfire::@1: scope:[joyfire] from joyfire + [921] phi() + to:joyfire::@return +joyfire::@return: scope:[joyfire] from joyfire joyfire::@1 + [922] joyfire::return#4 = phi( joyfire::@1/1, joyfire/0 ) + [923] return + to:@return + +void init_level_tile_directions() +init_level_tile_directions: scope:[init_level_tile_directions] from gameplay_run::@14 + [924] phi() + to:init_level_tile_directions::@1 +init_level_tile_directions::@1: scope:[init_level_tile_directions] from init_level_tile_directions init_level_tile_directions::@4 + [925] init_level_tile_directions::directions#7 = phi( init_level_tile_directions/LEVEL_TILES_DIRECTIONS, init_level_tile_directions::@4/init_level_tile_directions::directions#1 ) + [925] init_level_tile_directions::ytile#15 = phi( init_level_tile_directions/0, init_level_tile_directions::@4/init_level_tile_directions::ytile#1 ) + [926] if(init_level_tile_directions::ytile#15<$25) goto init_level_tile_directions::@2 + to:init_level_tile_directions::@return +init_level_tile_directions::@return: scope:[init_level_tile_directions] from init_level_tile_directions::@1 + [927] return + to:@return +init_level_tile_directions::@2: scope:[init_level_tile_directions] from init_level_tile_directions::@1 init_level_tile_directions::@8 + [928] init_level_tile_directions::xtile#10 = phi( init_level_tile_directions::@1/0, init_level_tile_directions::@8/init_level_tile_directions::xtile#1 ) + [929] if(init_level_tile_directions::xtile#10<$32) goto init_level_tile_directions::@3 + to:init_level_tile_directions::@4 +init_level_tile_directions::@4: scope:[init_level_tile_directions] from init_level_tile_directions::@2 + [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 + [931] init_level_tile_directions::ytile#1 = ++ init_level_tile_directions::ytile#15 + to:init_level_tile_directions::@1 +init_level_tile_directions::@3: scope:[init_level_tile_directions] from init_level_tile_directions::@2 + [932] level_tile_get::xtile#0 = init_level_tile_directions::xtile#10 - 1 + [933] level_tile_get::ytile#0 = init_level_tile_directions::ytile#15 + [934] call level_tile_get + [935] level_tile_get::return#3 = level_tile_get::return#2 + to:init_level_tile_directions::@13 +init_level_tile_directions::@13: scope:[init_level_tile_directions] from init_level_tile_directions::@3 + [936] init_level_tile_directions::$3 = level_tile_get::return#3 + [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 + to:init_level_tile_directions::@9 +init_level_tile_directions::@9: scope:[init_level_tile_directions] from init_level_tile_directions::@13 + [938] phi() + to:init_level_tile_directions::@5 +init_level_tile_directions::@5: scope:[init_level_tile_directions] from init_level_tile_directions::@13 init_level_tile_directions::@9 + [939] init_level_tile_directions::open_directions#11 = phi( init_level_tile_directions::@9/LEFT, init_level_tile_directions::@13/0 ) + [940] level_tile_get::xtile#1 = init_level_tile_directions::xtile#10 + 1 + [941] level_tile_get::ytile#1 = init_level_tile_directions::ytile#15 + [942] call level_tile_get + [943] level_tile_get::return#4 = level_tile_get::return#2 + to:init_level_tile_directions::@14 +init_level_tile_directions::@14: scope:[init_level_tile_directions] from init_level_tile_directions::@5 + [944] init_level_tile_directions::$7 = level_tile_get::return#4 + [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 + to:init_level_tile_directions::@10 +init_level_tile_directions::@10: scope:[init_level_tile_directions] from init_level_tile_directions::@14 + [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT + to:init_level_tile_directions::@6 +init_level_tile_directions::@6: scope:[init_level_tile_directions] from init_level_tile_directions::@10 init_level_tile_directions::@14 + [947] init_level_tile_directions::open_directions#12 = phi( init_level_tile_directions::@10/init_level_tile_directions::open_directions#2, init_level_tile_directions::@14/init_level_tile_directions::open_directions#11 ) + [948] level_tile_get::ytile#2 = init_level_tile_directions::ytile#15 - 1 + [949] level_tile_get::xtile#2 = init_level_tile_directions::xtile#10 + [950] call level_tile_get + [951] level_tile_get::return#10 = level_tile_get::return#2 + to:init_level_tile_directions::@15 +init_level_tile_directions::@15: scope:[init_level_tile_directions] from init_level_tile_directions::@6 + [952] init_level_tile_directions::$11 = level_tile_get::return#10 + [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 + to:init_level_tile_directions::@11 +init_level_tile_directions::@11: scope:[init_level_tile_directions] from init_level_tile_directions::@15 + [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP + to:init_level_tile_directions::@7 +init_level_tile_directions::@7: scope:[init_level_tile_directions] from init_level_tile_directions::@11 init_level_tile_directions::@15 + [955] init_level_tile_directions::open_directions#13 = phi( init_level_tile_directions::@11/init_level_tile_directions::open_directions#3, init_level_tile_directions::@15/init_level_tile_directions::open_directions#12 ) + [956] level_tile_get::ytile#3 = init_level_tile_directions::ytile#15 + 1 + [957] level_tile_get::xtile#3 = init_level_tile_directions::xtile#10 + [958] call level_tile_get + [959] level_tile_get::return#11 = level_tile_get::return#2 + to:init_level_tile_directions::@16 +init_level_tile_directions::@16: scope:[init_level_tile_directions] from init_level_tile_directions::@7 + [960] init_level_tile_directions::$15 = level_tile_get::return#11 + [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 + to:init_level_tile_directions::@12 +init_level_tile_directions::@12: scope:[init_level_tile_directions] from init_level_tile_directions::@16 + [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN + to:init_level_tile_directions::@8 +init_level_tile_directions::@8: scope:[init_level_tile_directions] from init_level_tile_directions::@12 init_level_tile_directions::@16 + [963] init_level_tile_directions::open_directions#8 = phi( init_level_tile_directions::@12/init_level_tile_directions::open_directions#4, init_level_tile_directions::@16/init_level_tile_directions::open_directions#13 ) + [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 + [965] init_level_tile_directions::xtile#1 = ++ init_level_tile_directions::xtile#10 + to:init_level_tile_directions::@2 + +word level_show() +level_show: scope:[level_show] from gameplay_run::@16 + [966] phi() + to:level_show::@1 +level_show::@1: scope:[level_show] from level_show level_show::@4 + [967] level_show::level#8 = phi( level_show/LEVEL_TILES, level_show::@4/level_show::level#1 ) + [967] level_show::count#12 = phi( level_show/0, level_show::@4/level_show::count#10 ) + [967] level_show::ytile#2 = phi( level_show/0, level_show::@4/level_show::ytile#1 ) + [968] if(level_show::ytile#2<$25) goto level_show::@2 + to:level_show::@return +level_show::@return: scope:[level_show] from level_show::@1 + [969] return + to:@return +level_show::@2: scope:[level_show] from level_show::@1 level_show::@9 + [970] level_show::count#10 = phi( level_show::@9/level_show::count#11, level_show::@1/level_show::count#12 ) + [970] level_show::xtile#3 = phi( level_show::@9/level_show::xtile#2, level_show::@1/0 ) + [970] level_show::xcol#2 = phi( level_show::@9/level_show::xcol#1, level_show::@1/0 ) + [971] if(level_show::xcol#2<$19) goto level_show::@3 + to:level_show::@4 +level_show::@4: scope:[level_show] from level_show::@2 + [972] level_show::level#1 = level_show::level#8 + $40 + [973] level_show::ytile#1 = ++ level_show::ytile#2 + to:level_show::@1 +level_show::@3: scope:[level_show] from level_show::@2 + [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] + [975] level_show::xtile#1 = ++ level_show::xtile#3 + [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 + to:level_show::@7 +level_show::@7: scope:[level_show] from level_show::@3 + [977] level_show::count#1 = ++ level_show::count#10 + to:level_show::@5 +level_show::@5: scope:[level_show] from level_show::@3 level_show::@7 + [978] level_show::count#5 = phi( level_show::@3/level_show::count#10, level_show::@7/level_show::count#1 ) + [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] + [980] level_show::xtile#2 = ++ level_show::xtile#1 + [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 + to:level_show::@8 +level_show::@8: scope:[level_show] from level_show::@5 + [982] level_show::count#2 = ++ level_show::count#5 + to:level_show::@6 +level_show::@6: scope:[level_show] from level_show::@5 level_show::@8 + [983] level_show::count#11 = phi( level_show::@8/level_show::count#2, level_show::@5/level_show::count#5 ) + [984] render_tiles::xcol#0 = level_show::xcol#2 + [985] render_tiles::ytile#0 = level_show::ytile#2 + [986] render_tiles::tile_left#0 = level_show::tile_left#0 + [987] render_tiles::tile_right#0 = level_show::tile_right#0 + [988] call render_tiles + to:level_show::@9 +level_show::@9: scope:[level_show] from level_show::@6 + [989] level_show::xcol#1 = ++ level_show::xcol#2 + to:level_show::@2 + +void pacman_sound_init() +pacman_sound_init: scope:[pacman_sound_init] from gameplay_run::@18 + [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f + [991] *((word*)SID) = 0 + [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 + [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 + [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 + [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 + to:pacman_sound_init::@return +pacman_sound_init::@return: scope:[pacman_sound_init] from pacman_sound_init + [996] return + to:@return + +void render(byte render::xcol , byte render::ypos , byte render::pixels) +render: scope:[render] from done_run::@11 splash_show::@3 + [997] render::pixels#4 = phi( done_run::@11/render::pixels#0, splash_show::@3/render::pixels#1 ) + [997] render::xcol#2 = phi( done_run::@11/render::xcol#0, splash_show::@3/render::xcol#1 ) + [997] render::ypos#2 = phi( done_run::@11/render::ypos#0, splash_show::@3/render::ypos#1 ) + [998] render::ytile#0 = render::ypos#2 >> 2 + [999] render::$1 = >RENDER_INDEX + render::xcol#2 + [1000] render::$2 = render::ytile#0 << 1 + [1001] render::render_index_xcol#0 = render::$1 w= render::$2 + [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) + [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 + [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 + [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] + [1006] render::ypix#0 = render::ypos#2 & 3 + to:render::@1 +render::@1: scope:[render] from render render::@2 + [1007] render::canvas2#2 = phi( render/render::canvas2#0, render::@2/render::canvas2#1 ) + [1007] render::ypos_inc_offset#2 = phi( render/render::ypos_inc_offset#0, render::@2/render::ypos_inc_offset#1 ) + [1007] render::canvas1#2 = phi( render/render::canvas1#0, render::@2/render::canvas1#1 ) + [1007] render::i#2 = phi( render/0, render::@2/render::i#1 ) + [1008] if(render::i#2=$31+1) goto level_tile_get::@return + to:level_tile_get::@2 +level_tile_get::@2: scope:[level_tile_get] from level_tile_get + [1018] if(level_tile_get::ytile#4>=$24+1) goto level_tile_get::@return + to:level_tile_get::@1 +level_tile_get::@1: scope:[level_tile_get] from level_tile_get::@2 + [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 + [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] + [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] + to:level_tile_get::@return +level_tile_get::@return: scope:[level_tile_get] from level_tile_get level_tile_get::@1 level_tile_get::@2 + [1022] level_tile_get::return#2 = phi( level_tile_get::@1/level_tile_get::return#0, level_tile_get/0, level_tile_get::@2/0 ) + [1023] return + to:@return + +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +render_tiles: scope:[render_tiles] from level_show::@6 + [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 + [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 + [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 + [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 + [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 + [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 + [1030] render_tiles::render_index_xcol#0 = render_tiles::$4 w= render_tiles::$5 + [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) + [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 + [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 + [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] + to:render_tiles::@1 +render_tiles::@1: scope:[render_tiles] from render_tiles render_tiles::@2 + [1035] render_tiles::ypos_inc_offset#2 = phi( render_tiles/render_tiles::ypos_inc_offset#0, render_tiles::@2/render_tiles::ypos_inc_offset#1 ) + [1035] render_tiles::canvas2#2 = phi( render_tiles/render_tiles::canvas2#0, render_tiles::@2/render_tiles::canvas2#1 ) + [1035] render_tiles::canvas1#2 = phi( render_tiles/render_tiles::canvas1#0, render_tiles::@2/render_tiles::canvas1#1 ) + [1035] render_tiles::y#2 = phi( render_tiles/0, render_tiles::@2/render_tiles::y#1 ) + [1036] if(render_tiles::y#2<4) goto render_tiles::@2 + to:render_tiles::@return +render_tiles::@return: scope:[render_tiles] from render_tiles::@1 + [1037] return + to:@return +render_tiles::@2: scope:[render_tiles] from render_tiles::@1 + [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] + [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 + [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 + [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + [1043] render_tiles::ypos_inc_offset#1 = ++ render_tiles::ypos_inc_offset#2 + [1044] render_tiles::y#1 = ++ render_tiles::y#2 + to:render_tiles::@1 diff --git a/src/test/ref/complex/borderline_pacman/pacman.log b/src/test/ref/complex/borderline_pacman/pacman.log new file mode 100644 index 000000000..601186445 --- /dev/null +++ b/src/test/ref/complex/borderline_pacman/pacman.log @@ -0,0 +1,31554 @@ +Loading link script "pacman.ld" +Resolved forward reference game_playable to game_playable +Resolved forward reference phase to phase +Resolved forward reference pacman_wins to pacman_wins +Resolved forward reference music_play_next to music_play_next +Resolved forward reference music_play_next to music_play_next +Resolved forward reference music_play_next to music_play_next +Resolved forward reference phase to phase +Resolved forward reference IRQ_SCREEN_TOP_LINE to IRQ_SCREEN_TOP_LINE +Resolved forward reference irq_screen_top to __interrupt(hardware_clobber) void irq_screen_top() +Resolved forward reference music_play_next to music_play_next +Resolved forward reference music_play_next to music_play_next +Resolved forward reference music_play_next to music_play_next +Resolved forward reference pacman_wins to pacman_wins +Resolved forward reference pacman_lives to pacman_lives +Resolved forward reference pill_count to pill_count +Resolved forward reference phase to phase +Resolved forward reference game_playable to game_playable +Resolved forward reference IRQ_SCREEN_TOP_LINE to IRQ_SCREEN_TOP_LINE +Resolved forward reference irq_screen_top to __interrupt(hardware_clobber) void irq_screen_top() +Resolved forward reference pacman_lives to pacman_lives +Resolved forward reference pacman_wins to pacman_wins +Resolved forward reference LEFT to LEFT +Resolved forward reference RIGHT to RIGHT +Resolved forward reference UP to UP +Resolved forward reference DOWN to DOWN +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Resolved forward reference ABS to ABS +Setting inferred volatile on symbol affected by address-of: logic_tile_ptr in logic_tile_ptr +Setting inferred volatile on symbol affected by address-of: byteboozer_decrunch::crunched in asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } +Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx +Inlined call call SEI +Inlined call splash_run::$17 = call toDd00 SCREENS_1 +Inlined call splash_run::$18 = call toD018 SCREENS_1 SCREENS_1 +Inlined call call CLI +Inlined call call SEI +Inlined call call CLI +Inlined call irq_screen_top::$0 = call toD018 SCREENS_1 SCREENS_1 +Inlined call irq_screen_top::$5 = call toDd00 SCREENS_2 +Inlined call irq_screen_top::$4 = call toDd00 SCREENS_1 +Inlined call call __init + +CONTROL FLOW GRAPH SSA + +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +memcpy: scope:[memcpy] from splash_run::@33 + memcpy::num#1 = phi( splash_run::@33/memcpy::num#0 ) + memcpy::destination#1 = phi( splash_run::@33/memcpy::destination#0 ) + memcpy::source#1 = phi( splash_run::@33/memcpy::source#0 ) + memcpy::src#0 = ((byte*)) memcpy::source#1 + memcpy::dst#0 = ((byte*)) memcpy::destination#1 + memcpy::$2 = (byte*)memcpy::source#1 + memcpy::$0 = memcpy::$2 + memcpy::num#1 + memcpy::src_end#0 = memcpy::$0 + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + memcpy::destination#3 = phi( memcpy/memcpy::destination#1, memcpy::@2/memcpy::destination#4 ) + memcpy::dst#3 = phi( memcpy/memcpy::dst#0, memcpy::@2/memcpy::dst#1 ) + memcpy::src_end#1 = phi( memcpy/memcpy::src_end#0, memcpy::@2/memcpy::src_end#2 ) + memcpy::src#2 = phi( memcpy/memcpy::src#0, memcpy::@2/memcpy::src#1 ) + memcpy::$1 = memcpy::src#2 != memcpy::src_end#1 + if(memcpy::$1) goto memcpy::@2 + to:memcpy::@3 +memcpy::@2: scope:[memcpy] from memcpy::@1 + memcpy::destination#4 = phi( memcpy::@1/memcpy::destination#3 ) + memcpy::src_end#2 = phi( memcpy::@1/memcpy::src_end#1 ) + memcpy::dst#2 = phi( memcpy::@1/memcpy::dst#3 ) + memcpy::src#3 = phi( memcpy::@1/memcpy::src#2 ) + *memcpy::dst#2 = *memcpy::src#3 + memcpy::dst#1 = ++ memcpy::dst#2 + memcpy::src#1 = ++ memcpy::src#3 + to:memcpy::@1 +memcpy::@3: scope:[memcpy] from memcpy::@1 + memcpy::destination#2 = phi( memcpy::@1/memcpy::destination#3 ) + memcpy::return#0 = memcpy::destination#2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@3 + memcpy::return#3 = phi( memcpy::@3/memcpy::return#0 ) + memcpy::return#1 = memcpy::return#3 + return + to:@return + +void* memset(void* memset::str , byte memset::c , word memset::num) +memset: scope:[memset] from splash_run::@17 splash_run::@24 splash_run::@25 splash_run::@29 splash_run::@35 + memset::c#8 = phi( splash_run::@17/memset::c#0, splash_run::@24/memset::c#1, splash_run::@25/memset::c#2, splash_run::@29/memset::c#3, splash_run::@35/memset::c#4 ) + memset::str#7 = phi( splash_run::@17/memset::str#0, splash_run::@24/memset::str#1, splash_run::@25/memset::str#2, splash_run::@29/memset::str#3, splash_run::@35/memset::str#4 ) + memset::num#5 = phi( splash_run::@17/memset::num#0, splash_run::@24/memset::num#1, splash_run::@25/memset::num#2, splash_run::@29/memset::num#3, splash_run::@35/memset::num#4 ) + memset::$0 = memset::num#5 > 0 + memset::$1 = ! memset::$0 + if(memset::$1) goto memset::@1 + to:memset::@2 +memset::@1: scope:[memset] from memset memset::@3 + memset::str#5 = phi( memset/memset::str#7, memset::@3/memset::str#8 ) + memset::return#0 = memset::str#5 + to:memset::@return +memset::@2: scope:[memset] from memset + memset::c#7 = phi( memset/memset::c#8 ) + memset::num#6 = phi( memset/memset::num#5 ) + memset::str#6 = phi( memset/memset::str#7 ) + memset::$4 = (byte*)memset::str#6 + memset::$2 = memset::$4 + memset::num#6 + memset::end#0 = memset::$2 + memset::dst#0 = ((byte*)) memset::str#6 + to:memset::@3 +memset::@3: scope:[memset] from memset::@2 memset::@4 + memset::c#6 = phi( memset::@2/memset::c#7, memset::@4/memset::c#5 ) + memset::str#8 = phi( memset::@2/memset::str#6, memset::@4/memset::str#9 ) + memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 ) + memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 ) + memset::$3 = memset::dst#2 != memset::end#1 + if(memset::$3) goto memset::@4 + to:memset::@1 +memset::@4: scope:[memset] from memset::@3 + memset::str#9 = phi( memset::@3/memset::str#8 ) + memset::end#2 = phi( memset::@3/memset::end#1 ) + memset::dst#3 = phi( memset::@3/memset::dst#2 ) + memset::c#5 = phi( memset::@3/memset::c#6 ) + *memset::dst#3 = memset::c#5 + memset::dst#1 = ++ memset::dst#3 + to:memset::@3 +memset::@return: scope:[memset] from memset::@1 + memset::return#7 = phi( memset::@1/memset::return#0 ) + memset::return#1 = memset::return#7 + return + to:@return + +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +byteboozer_decrunch: scope:[byteboozer_decrunch] from done_run::@1 done_run::@9 gameplay_run::@6 splash_run::@21 splash_run::@22 splash_run::@27 splash_run::@31 splash_run::@34 + asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } + to:byteboozer_decrunch::@return +byteboozer_decrunch::@return: scope:[byteboozer_decrunch] from byteboozer_decrunch + return + to:@return + +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +merge_code: scope:[merge_code] from splash_run::@23 + merge_code::logic_code#20 = phi( splash_run::@23/merge_code::logic_code#6 ) + merge_code::dest_code#19 = phi( splash_run::@23/merge_code::dest_code#7 ) + merge_code::raster_code#7 = phi( splash_run::@23/merge_code::raster_code#3 ) + to:merge_code::@1 +merge_code::@1: scope:[merge_code] from merge_code merge_code::@10 merge_code::@2 + merge_code::logic_code#19 = phi( merge_code/merge_code::logic_code#20, merge_code::@10/merge_code::logic_code#21, merge_code::@2/merge_code::logic_code#22 ) + merge_code::dest_code#14 = phi( merge_code/merge_code::dest_code#19, merge_code::@10/merge_code::dest_code#20, merge_code::@2/merge_code::dest_code#0 ) + merge_code::raster_code#4 = phi( merge_code/merge_code::raster_code#7, merge_code::@10/merge_code::raster_code#8, merge_code::@2/merge_code::raster_code#0 ) + merge_code::$0 = *merge_code::raster_code#4 != merge_code::RASTER_END + if(merge_code::$0) goto merge_code::@2 + to:merge_code::@3 +merge_code::@2: scope:[merge_code] from merge_code::@1 + merge_code::logic_code#22 = phi( merge_code::@1/merge_code::logic_code#19 ) + merge_code::dest_code#8 = phi( merge_code::@1/merge_code::dest_code#14 ) + merge_code::raster_code#5 = phi( merge_code::@1/merge_code::raster_code#4 ) + *merge_code::dest_code#8 = *merge_code::raster_code#5 + merge_code::dest_code#0 = ++ merge_code::dest_code#8 + merge_code::raster_code#0 = ++ merge_code::raster_code#5 + to:merge_code::@1 +merge_code::@3: scope:[merge_code] from merge_code::@1 + merge_code::dest_code#23 = phi( merge_code::@1/merge_code::dest_code#14 ) + merge_code::logic_code#18 = phi( merge_code::@1/merge_code::logic_code#19 ) + merge_code::raster_code#6 = phi( merge_code::@1/merge_code::raster_code#4 ) + merge_code::raster_code#1 = ++ merge_code::raster_code#6 + merge_code::cycle_budget#0 = *merge_code::raster_code#1 + merge_code::raster_code#2 = ++ merge_code::raster_code#1 + merge_code::$1 = merge_code::cycle_budget#0 == merge_code::RASTER_EXIT + merge_code::$2 = ! merge_code::$1 + if(merge_code::$2) goto merge_code::@4 + to:merge_code::@14 +merge_code::@4: scope:[merge_code] from merge_code::@3 merge_code::@8 + merge_code::dest_code#26 = phi( merge_code::@3/merge_code::dest_code#23, merge_code::@8/merge_code::dest_code#27 ) + merge_code::raster_code#11 = phi( merge_code::@3/merge_code::raster_code#2, merge_code::@8/merge_code::raster_code#13 ) + merge_code::logic_code#17 = phi( merge_code::@3/merge_code::logic_code#18, merge_code::@8/merge_code::logic_code#2 ) + merge_code::cycle_budget#4 = phi( merge_code::@3/merge_code::cycle_budget#0, merge_code::@8/merge_code::cycle_budget#1 ) + merge_code::$3 = merge_code::cycle_budget#4 > 0 + if(merge_code::$3) goto merge_code::@5 + to:merge_code::@10 +merge_code::@5: scope:[merge_code] from merge_code::@4 + merge_code::dest_code#25 = phi( merge_code::@4/merge_code::dest_code#26 ) + merge_code::raster_code#12 = phi( merge_code::@4/merge_code::raster_code#11 ) + merge_code::cycle_budget#5 = phi( merge_code::@4/merge_code::cycle_budget#4 ) + merge_code::logic_code#7 = phi( merge_code::@4/merge_code::logic_code#17 ) + merge_code::logic_cycles#0 = *merge_code::logic_code#7 + merge_code::$4 = merge_code::logic_cycles#0 != merge_code::LOGIC_EXIT + merge_code::$5 = merge_code::cycle_budget#5 - 1 + merge_code::$6 = merge_code::logic_cycles#0 < merge_code::$5 + merge_code::$7 = merge_code::logic_cycles#0 == merge_code::cycle_budget#5 + merge_code::$8 = merge_code::$6 || merge_code::$7 + merge_code::$9 = merge_code::$4 && merge_code::$8 + merge_code::$10 = ! merge_code::$9 + if(merge_code::$10) goto merge_code::@10 + to:merge_code::@9 +merge_code::@9: scope:[merge_code] from merge_code::@5 + merge_code::raster_code#17 = phi( merge_code::@5/merge_code::raster_code#12 ) + merge_code::logic_cycles#4 = phi( merge_code::@5/merge_code::logic_cycles#0 ) + merge_code::cycle_budget#13 = phi( merge_code::@5/merge_code::cycle_budget#5 ) + merge_code::dest_code#21 = phi( merge_code::@5/merge_code::dest_code#25 ) + merge_code::logic_code#8 = phi( merge_code::@5/merge_code::logic_code#7 ) + merge_code::logic_code#0 = ++ merge_code::logic_code#8 + to:merge_code::@6 +merge_code::@6: scope:[merge_code] from merge_code::@7 merge_code::@9 + merge_code::raster_code#15 = phi( merge_code::@7/merge_code::raster_code#16, merge_code::@9/merge_code::raster_code#17 ) + merge_code::logic_cycles#2 = phi( merge_code::@7/merge_code::logic_cycles#3, merge_code::@9/merge_code::logic_cycles#4 ) + merge_code::cycle_budget#11 = phi( merge_code::@7/merge_code::cycle_budget#12, merge_code::@9/merge_code::cycle_budget#13 ) + merge_code::dest_code#15 = phi( merge_code::@7/merge_code::dest_code#1, merge_code::@9/merge_code::dest_code#21 ) + merge_code::logic_code#9 = phi( merge_code::@7/merge_code::logic_code#1, merge_code::@9/merge_code::logic_code#0 ) + merge_code::$11 = *merge_code::logic_code#9 != merge_code::LOGIC_END + if(merge_code::$11) goto merge_code::@7 + to:merge_code::@8 +merge_code::@7: scope:[merge_code] from merge_code::@6 + merge_code::raster_code#16 = phi( merge_code::@6/merge_code::raster_code#15 ) + merge_code::logic_cycles#3 = phi( merge_code::@6/merge_code::logic_cycles#2 ) + merge_code::cycle_budget#12 = phi( merge_code::@6/merge_code::cycle_budget#11 ) + merge_code::dest_code#9 = phi( merge_code::@6/merge_code::dest_code#15 ) + merge_code::logic_code#10 = phi( merge_code::@6/merge_code::logic_code#9 ) + *merge_code::dest_code#9 = *merge_code::logic_code#10 + merge_code::dest_code#1 = ++ merge_code::dest_code#9 + merge_code::logic_code#1 = ++ merge_code::logic_code#10 + to:merge_code::@6 +merge_code::@8: scope:[merge_code] from merge_code::@6 + merge_code::dest_code#27 = phi( merge_code::@6/merge_code::dest_code#15 ) + merge_code::raster_code#13 = phi( merge_code::@6/merge_code::raster_code#15 ) + merge_code::logic_cycles#1 = phi( merge_code::@6/merge_code::logic_cycles#2 ) + merge_code::cycle_budget#6 = phi( merge_code::@6/merge_code::cycle_budget#11 ) + merge_code::logic_code#11 = phi( merge_code::@6/merge_code::logic_code#9 ) + merge_code::logic_code#2 = ++ merge_code::logic_code#11 + merge_code::cycle_budget#1 = merge_code::cycle_budget#6 - merge_code::logic_cycles#1 + to:merge_code::@4 +merge_code::@10: scope:[merge_code] from merge_code::@12 merge_code::@13 merge_code::@4 merge_code::@5 + merge_code::logic_code#21 = phi( merge_code::@12/merge_code::logic_code#23, merge_code::@13/merge_code::logic_code#24, merge_code::@4/merge_code::logic_code#17, merge_code::@5/merge_code::logic_code#7 ) + merge_code::dest_code#20 = phi( merge_code::@12/merge_code::dest_code#3, merge_code::@13/merge_code::dest_code#4, merge_code::@4/merge_code::dest_code#26, merge_code::@5/merge_code::dest_code#25 ) + merge_code::raster_code#8 = phi( merge_code::@12/merge_code::raster_code#9, merge_code::@13/merge_code::raster_code#10, merge_code::@4/merge_code::raster_code#11, merge_code::@5/merge_code::raster_code#12 ) + merge_code::cycle_budget#7 = phi( merge_code::@12/merge_code::cycle_budget#2, merge_code::@13/merge_code::cycle_budget#3, merge_code::@4/merge_code::cycle_budget#4, merge_code::@5/merge_code::cycle_budget#5 ) + merge_code::$12 = merge_code::cycle_budget#7 > 0 + if(merge_code::$12) goto merge_code::@11 + to:merge_code::@1 +merge_code::@11: scope:[merge_code] from merge_code::@10 + merge_code::logic_code#25 = phi( merge_code::@10/merge_code::logic_code#21 ) + merge_code::raster_code#14 = phi( merge_code::@10/merge_code::raster_code#8 ) + merge_code::dest_code#16 = phi( merge_code::@10/merge_code::dest_code#20 ) + merge_code::cycle_budget#8 = phi( merge_code::@10/merge_code::cycle_budget#7 ) + merge_code::$13 = merge_code::cycle_budget#8 == 3 + if(merge_code::$13) goto merge_code::@12 + to:merge_code::@13 +merge_code::@12: scope:[merge_code] from merge_code::@11 + merge_code::logic_code#23 = phi( merge_code::@11/merge_code::logic_code#25 ) + merge_code::raster_code#9 = phi( merge_code::@11/merge_code::raster_code#14 ) + merge_code::cycle_budget#9 = phi( merge_code::@11/merge_code::cycle_budget#8 ) + merge_code::dest_code#10 = phi( merge_code::@11/merge_code::dest_code#16 ) + *merge_code::dest_code#10 = $24 + merge_code::dest_code#2 = ++ merge_code::dest_code#10 + *merge_code::dest_code#2 = $ea + merge_code::dest_code#3 = ++ merge_code::dest_code#2 + merge_code::cycle_budget#2 = merge_code::cycle_budget#9 - 3 + to:merge_code::@10 +merge_code::@13: scope:[merge_code] from merge_code::@11 + merge_code::logic_code#24 = phi( merge_code::@11/merge_code::logic_code#25 ) + merge_code::raster_code#10 = phi( merge_code::@11/merge_code::raster_code#14 ) + merge_code::cycle_budget#10 = phi( merge_code::@11/merge_code::cycle_budget#8 ) + merge_code::dest_code#11 = phi( merge_code::@11/merge_code::dest_code#16 ) + *merge_code::dest_code#11 = $ea + merge_code::dest_code#4 = ++ merge_code::dest_code#11 + merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 + to:merge_code::@10 +merge_code::@14: scope:[merge_code] from merge_code::@19 merge_code::@3 + merge_code::dest_code#17 = phi( merge_code::@19/merge_code::dest_code#22, merge_code::@3/merge_code::dest_code#23 ) + merge_code::logic_code#12 = phi( merge_code::@19/merge_code::logic_code#5, merge_code::@3/merge_code::logic_code#18 ) + merge_code::$14 = *merge_code::logic_code#12 != merge_code::LOGIC_EXIT + if(merge_code::$14) goto merge_code::@15 + to:merge_code::@16 +merge_code::@15: scope:[merge_code] from merge_code::@14 + merge_code::dest_code#24 = phi( merge_code::@14/merge_code::dest_code#17 ) + merge_code::logic_code#13 = phi( merge_code::@14/merge_code::logic_code#12 ) + merge_code::logic_code#3 = ++ merge_code::logic_code#13 + to:merge_code::@17 +merge_code::@16: scope:[merge_code] from merge_code::@14 + merge_code::dest_code#12 = phi( merge_code::@14/merge_code::dest_code#17 ) + *merge_code::dest_code#12 = $60 + merge_code::dest_code#5 = ++ merge_code::dest_code#12 + to:merge_code::@return +merge_code::@17: scope:[merge_code] from merge_code::@15 merge_code::@18 + merge_code::dest_code#18 = phi( merge_code::@15/merge_code::dest_code#24, merge_code::@18/merge_code::dest_code#6 ) + merge_code::logic_code#14 = phi( merge_code::@15/merge_code::logic_code#3, merge_code::@18/merge_code::logic_code#4 ) + merge_code::$15 = *merge_code::logic_code#14 != merge_code::LOGIC_END + if(merge_code::$15) goto merge_code::@18 + to:merge_code::@19 +merge_code::@18: scope:[merge_code] from merge_code::@17 + merge_code::dest_code#13 = phi( merge_code::@17/merge_code::dest_code#18 ) + merge_code::logic_code#15 = phi( merge_code::@17/merge_code::logic_code#14 ) + *merge_code::dest_code#13 = *merge_code::logic_code#15 + merge_code::dest_code#6 = ++ merge_code::dest_code#13 + merge_code::logic_code#4 = ++ merge_code::logic_code#15 + to:merge_code::@17 +merge_code::@19: scope:[merge_code] from merge_code::@17 + merge_code::dest_code#22 = phi( merge_code::@17/merge_code::dest_code#18 ) + merge_code::logic_code#16 = phi( merge_code::@17/merge_code::logic_code#14 ) + merge_code::logic_code#5 = ++ merge_code::logic_code#16 + to:merge_code::@14 +merge_code::@return: scope:[merge_code] from merge_code::@16 + return + to:@return + +void pacman_sound_init() +pacman_sound_init: scope:[pacman_sound_init] from gameplay_run::@19 + *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f + *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_FREQ) = 0 + *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 + *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 + *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 + *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 + to:pacman_sound_init::@return +pacman_sound_init::@return: scope:[pacman_sound_init] from pacman_sound_init + return + to:@return + +void pacman_sound_play() +pacman_sound_play: scope:[pacman_sound_play] from irq_screen_top::@10 + pacman_sound_play::$4 = 0 != pacman_ch1_enabled + pacman_sound_play::$0 = ! pacman_sound_play::$4 + if(pacman_sound_play::$0) goto pacman_sound_play::@return + to:pacman_sound_play::@1 +pacman_sound_play::@1: scope:[pacman_sound_play] from pacman_sound_play + *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] + *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] + pacman_ch1_idx = ++ pacman_ch1_idx + pacman_sound_play::$1 = sizeof PACMAN_CH1_FREQ_HI + pacman_sound_play::$2 = pacman_ch1_idx == pacman_sound_play::$1 + pacman_sound_play::$3 = ! pacman_sound_play::$2 + if(pacman_sound_play::$3) goto pacman_sound_play::@return + to:pacman_sound_play::@2 +pacman_sound_play::@2: scope:[pacman_sound_play] from pacman_sound_play::@1 + pacman_ch1_idx = 0 + pacman_ch1_enabled = 0 + to:pacman_sound_play::@return +pacman_sound_play::@return: scope:[pacman_sound_play] from pacman_sound_play pacman_sound_play::@1 pacman_sound_play::@2 + return + to:@return + +void init_render_index() +init_render_index: scope:[init_render_index] from splash_run::@26 + init_render_index::render_index#0 = RENDER_INDEX + init_render_index::x_col#0 = 0 + to:init_render_index::@1 +init_render_index::@1: scope:[init_render_index] from init_render_index init_render_index::@7 + init_render_index::render_index#7 = phi( init_render_index/init_render_index::render_index#0, init_render_index::@7/init_render_index::render_index#1 ) + init_render_index::x_col#2 = phi( init_render_index/init_render_index::x_col#0, init_render_index::@7/init_render_index::x_col#1 ) + init_render_index::$0 = init_render_index::x_col#2 < $1a + if(init_render_index::$0) goto init_render_index::@2 + to:init_render_index::@3 +init_render_index::@2: scope:[init_render_index] from init_render_index::@1 + init_render_index::render_index#5 = phi( init_render_index::@1/init_render_index::render_index#7 ) + init_render_index::x_col#3 = phi( init_render_index::@1/init_render_index::x_col#2 ) + init_render_index::render_ypos_table#0 = RENDER_YPOS + init_render_index::ypos_inc_offset#0 = 0 + init_render_index::$1 = init_render_index::x_col#3 >= $18 + init_render_index::$2 = ! init_render_index::$1 + if(init_render_index::$2) goto init_render_index::@4 + to:init_render_index::@10 +init_render_index::@3: scope:[init_render_index] from init_render_index::@1 + (RENDER_INDEX+$18*$100)[RENDER_OFFSET_YPOS_INC] = 0 + (RENDER_INDEX+$19*$100)[RENDER_OFFSET_YPOS_INC] = 0 + to:init_render_index::@return +init_render_index::@4: scope:[init_render_index] from init_render_index::@10 init_render_index::@2 + init_render_index::ypos_inc_offset#7 = phi( init_render_index::@10/init_render_index::ypos_inc_offset#1, init_render_index::@2/init_render_index::ypos_inc_offset#0 ) + init_render_index::render_ypos_table#4 = phi( init_render_index::@10/init_render_index::render_ypos_table#1, init_render_index::@2/init_render_index::render_ypos_table#0 ) + init_render_index::x_col#4 = phi( init_render_index::@10/init_render_index::x_col#6, init_render_index::@2/init_render_index::x_col#3 ) + init_render_index::render_index#2 = phi( init_render_index::@10/init_render_index::render_index#4, init_render_index::@2/init_render_index::render_index#5 ) + init_render_index::render_index_xcol#0 = init_render_index::render_index#2 + init_render_index::$9 = init_render_index::x_col#4 * SIZEOF_POINTER + init_render_index::canvas_xcol#0 = RENDER_XCOLS[init_render_index::$9] + init_render_index::y_pos#0 = 0 + to:init_render_index::@5 +init_render_index::@10: scope:[init_render_index] from init_render_index::@2 + init_render_index::x_col#6 = phi( init_render_index::@2/init_render_index::x_col#3 ) + init_render_index::render_index#4 = phi( init_render_index::@2/init_render_index::render_index#5 ) + init_render_index::render_ypos_table#1 = RENDER_YPOS_9TH + init_render_index::ypos_inc_offset#1 = $b + to:init_render_index::@4 +init_render_index::@5: scope:[init_render_index] from init_render_index::@4 init_render_index::@8 + init_render_index::x_col#7 = phi( init_render_index::@4/init_render_index::x_col#4, init_render_index::@8/init_render_index::x_col#8 ) + init_render_index::render_index#6 = phi( init_render_index::@4/init_render_index::render_index#2, init_render_index::@8/init_render_index::render_index#8 ) + init_render_index::ypos_inc_offset#6 = phi( init_render_index::@4/init_render_index::ypos_inc_offset#7, init_render_index::@8/init_render_index::ypos_inc_offset#8 ) + init_render_index::render_index_xcol#4 = phi( init_render_index::@4/init_render_index::render_index_xcol#0, init_render_index::@8/init_render_index::render_index_xcol#1 ) + init_render_index::render_ypos_table#3 = phi( init_render_index::@4/init_render_index::render_ypos_table#4, init_render_index::@8/init_render_index::render_ypos_table#5 ) + init_render_index::canvas_xcol#2 = phi( init_render_index::@4/init_render_index::canvas_xcol#0, init_render_index::@8/init_render_index::canvas_xcol#3 ) + init_render_index::y_pos#2 = phi( init_render_index::@4/init_render_index::y_pos#0, init_render_index::@8/init_render_index::y_pos#1 ) + init_render_index::$3 = init_render_index::y_pos#2 < $94 + if(init_render_index::$3) goto init_render_index::@6 + to:init_render_index::@7 +init_render_index::@6: scope:[init_render_index] from init_render_index::@5 + init_render_index::x_col#9 = phi( init_render_index::@5/init_render_index::x_col#7 ) + init_render_index::render_index#9 = phi( init_render_index::@5/init_render_index::render_index#6 ) + init_render_index::ypos_inc_offset#4 = phi( init_render_index::@5/init_render_index::ypos_inc_offset#6 ) + init_render_index::render_index_xcol#2 = phi( init_render_index::@5/init_render_index::render_index_xcol#4 ) + init_render_index::render_ypos_table#2 = phi( init_render_index::@5/init_render_index::render_ypos_table#3 ) + init_render_index::canvas_xcol#1 = phi( init_render_index::@5/init_render_index::canvas_xcol#2 ) + init_render_index::y_pos#3 = phi( init_render_index::@5/init_render_index::y_pos#2 ) + init_render_index::$11 = (word)init_render_index::y_pos#3 + init_render_index::$10 = init_render_index::$11 * SIZEOF_WORD + init_render_index::$4 = init_render_index::canvas_xcol#1 + init_render_index::render_ypos_table#2[init_render_index::$10] + init_render_index::canvas#0 = init_render_index::$4 + init_render_index::$5 = < init_render_index::canvas#0 + init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_LO] = init_render_index::$5 + init_render_index::$6 = > init_render_index::canvas#0 + init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 + init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 + init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 + init_render_index::$7 = init_render_index::ypos_inc_offset#2 >= $17 + init_render_index::$8 = ! init_render_index::$7 + if(init_render_index::$8) goto init_render_index::@8 + to:init_render_index::@9 +init_render_index::@7: scope:[init_render_index] from init_render_index::@5 + init_render_index::x_col#5 = phi( init_render_index::@5/init_render_index::x_col#7 ) + init_render_index::render_index#3 = phi( init_render_index::@5/init_render_index::render_index#6 ) + init_render_index::render_index#1 = init_render_index::render_index#3 + $100 + init_render_index::x_col#1 = ++ init_render_index::x_col#5 + to:init_render_index::@1 +init_render_index::@8: scope:[init_render_index] from init_render_index::@6 init_render_index::@9 + init_render_index::x_col#8 = phi( init_render_index::@6/init_render_index::x_col#9, init_render_index::@9/init_render_index::x_col#10 ) + init_render_index::render_index#8 = phi( init_render_index::@6/init_render_index::render_index#9, init_render_index::@9/init_render_index::render_index#10 ) + init_render_index::ypos_inc_offset#8 = phi( init_render_index::@6/init_render_index::ypos_inc_offset#2, init_render_index::@9/init_render_index::ypos_inc_offset#3 ) + init_render_index::render_ypos_table#5 = phi( init_render_index::@6/init_render_index::render_ypos_table#2, init_render_index::@9/init_render_index::render_ypos_table#6 ) + init_render_index::canvas_xcol#3 = phi( init_render_index::@6/init_render_index::canvas_xcol#1, init_render_index::@9/init_render_index::canvas_xcol#4 ) + init_render_index::y_pos#4 = phi( init_render_index::@6/init_render_index::y_pos#3, init_render_index::@9/init_render_index::y_pos#5 ) + init_render_index::render_index_xcol#3 = phi( init_render_index::@6/init_render_index::render_index_xcol#2, init_render_index::@9/init_render_index::render_index_xcol#5 ) + init_render_index::render_index_xcol#1 = ++ init_render_index::render_index_xcol#3 + init_render_index::y_pos#1 = init_render_index::y_pos#4 + 2 + to:init_render_index::@5 +init_render_index::@9: scope:[init_render_index] from init_render_index::@6 + init_render_index::x_col#10 = phi( init_render_index::@6/init_render_index::x_col#9 ) + init_render_index::render_index#10 = phi( init_render_index::@6/init_render_index::render_index#9 ) + init_render_index::render_ypos_table#6 = phi( init_render_index::@6/init_render_index::render_ypos_table#2 ) + init_render_index::canvas_xcol#4 = phi( init_render_index::@6/init_render_index::canvas_xcol#1 ) + init_render_index::y_pos#5 = phi( init_render_index::@6/init_render_index::y_pos#3 ) + init_render_index::render_index_xcol#5 = phi( init_render_index::@6/init_render_index::render_index_xcol#2 ) + init_render_index::ypos_inc_offset#5 = phi( init_render_index::@6/init_render_index::ypos_inc_offset#2 ) + init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#5 - $15 + to:init_render_index::@8 +init_render_index::@return: scope:[init_render_index] from init_render_index::@3 + return + to:@return + +void render(byte render::xcol , byte render::ypos , byte render::pixels) +render: scope:[render] from done_run::@14 splash_show::@4 + render::pixels#4 = phi( done_run::@14/render::pixels#0, splash_show::@4/render::pixels#1 ) + render::xcol#2 = phi( done_run::@14/render::xcol#0, splash_show::@4/render::xcol#1 ) + render::ypos#2 = phi( done_run::@14/render::ypos#0, splash_show::@4/render::ypos#1 ) + render::$0 = render::ypos#2 / 4 + render::ytile#0 = render::$0 + render::$1 = >RENDER_INDEX + render::xcol#2 + render::$2 = render::ytile#0 * 2 + render::render_index_xcol#0 = (byte*){ render::$1, render::$2 } + render::canvas_offset#0 = (word){ render::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI], render::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] } + render::$3 = SPRITES_1 + render::canvas_offset#0 + render::canvas1#0 = render::$3 + render::$4 = SPRITES_2 + render::canvas_offset#0 + render::canvas2#0 = render::$4 + render::ypos_inc_offset#0 = render::render_index_xcol#0[RENDER_OFFSET_YPOS_INC] + render::$5 = render::ypos#2 & 3 + render::ypix#0 = render::$5 + render::i#0 = 0 + to:render::@1 +render::@1: scope:[render] from render render::@2 + render::pixels#3 = phi( render/render::pixels#4, render::@2/render::pixels#5 ) + render::canvas2#4 = phi( render/render::canvas2#0, render::@2/render::canvas2#1 ) + render::ypos_inc_offset#3 = phi( render/render::ypos_inc_offset#0, render::@2/render::ypos_inc_offset#1 ) + render::canvas1#4 = phi( render/render::canvas1#0, render::@2/render::canvas1#1 ) + render::ypix#1 = phi( render/render::ypix#0, render::@2/render::ypix#2 ) + render::i#2 = phi( render/render::i#0, render::@2/render::i#1 ) + render::$6 = render::i#2 < render::ypix#1 + if(render::$6) goto render::@2 + to:render::@3 +render::@2: scope:[render] from render::@1 + render::pixels#5 = phi( render::@1/render::pixels#3 ) + render::ypix#2 = phi( render::@1/render::ypix#1 ) + render::i#3 = phi( render::@1/render::i#2 ) + render::canvas2#2 = phi( render::@1/render::canvas2#4 ) + render::ypos_inc_offset#2 = phi( render::@1/render::ypos_inc_offset#3 ) + render::canvas1#2 = phi( render::@1/render::canvas1#4 ) + render::canvas1#1 = render::canvas1#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] + render::canvas2#1 = render::canvas2#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] + render::ypos_inc_offset#1 = ++ render::ypos_inc_offset#2 + render::i#1 = ++ render::i#3 + to:render::@1 +render::@3: scope:[render] from render::@1 + render::canvas2#3 = phi( render::@1/render::canvas2#4 ) + render::canvas1#3 = phi( render::@1/render::canvas1#4 ) + render::pixels#2 = phi( render::@1/render::pixels#3 ) + *render::canvas1#3 = render::pixels#2 + *render::canvas2#3 = render::pixels#2 + to:render::@return +render::@return: scope:[render] from render::@3 + return + to:@return + +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +render_tiles: scope:[render_tiles] from level_show::@8 + render_tiles::ytile#1 = phi( level_show::@8/render_tiles::ytile#0 ) + render_tiles::xcol#1 = phi( level_show::@8/render_tiles::xcol#0 ) + render_tiles::tile_right#1 = phi( level_show::@8/render_tiles::tile_right#0 ) + render_tiles::tile_left#1 = phi( level_show::@8/render_tiles::tile_left#0 ) + render_tiles::$0 = render_tiles::tile_left#1 * 4 + render_tiles::$1 = TILES_LEFT + render_tiles::$0 + render_tiles::tile_left_pixels#0 = render_tiles::$1 + render_tiles::$2 = render_tiles::tile_right#1 * 4 + render_tiles::$3 = TILES_RIGHT + render_tiles::$2 + render_tiles::tile_right_pixels#0 = render_tiles::$3 + render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#1 + render_tiles::$5 = render_tiles::ytile#1 * 2 + render_tiles::render_index_xcol#0 = (byte*){ render_tiles::$4, render_tiles::$5 } + render_tiles::canvas_offset#0 = (word){ render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI], render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] } + render_tiles::$6 = SPRITES_1 + render_tiles::canvas_offset#0 + render_tiles::canvas1#0 = render_tiles::$6 + render_tiles::$7 = SPRITES_2 + render_tiles::canvas_offset#0 + render_tiles::canvas2#0 = render_tiles::$7 + render_tiles::ypos_inc_offset#0 = render_tiles::render_index_xcol#0[RENDER_OFFSET_YPOS_INC] + render_tiles::y#0 = 0 + to:render_tiles::@1 +render_tiles::@1: scope:[render_tiles] from render_tiles render_tiles::@2 + render_tiles::ypos_inc_offset#3 = phi( render_tiles/render_tiles::ypos_inc_offset#0, render_tiles::@2/render_tiles::ypos_inc_offset#1 ) + render_tiles::canvas2#3 = phi( render_tiles/render_tiles::canvas2#0, render_tiles::@2/render_tiles::canvas2#1 ) + render_tiles::canvas1#3 = phi( render_tiles/render_tiles::canvas1#0, render_tiles::@2/render_tiles::canvas1#1 ) + render_tiles::tile_right_pixels#2 = phi( render_tiles/render_tiles::tile_right_pixels#0, render_tiles::@2/render_tiles::tile_right_pixels#1 ) + render_tiles::tile_left_pixels#2 = phi( render_tiles/render_tiles::tile_left_pixels#0, render_tiles::@2/render_tiles::tile_left_pixels#1 ) + render_tiles::y#2 = phi( render_tiles/render_tiles::y#0, render_tiles::@2/render_tiles::y#1 ) + render_tiles::$8 = render_tiles::y#2 < 4 + if(render_tiles::$8) goto render_tiles::@2 + to:render_tiles::@return +render_tiles::@2: scope:[render_tiles] from render_tiles::@1 + render_tiles::ypos_inc_offset#2 = phi( render_tiles::@1/render_tiles::ypos_inc_offset#3 ) + render_tiles::canvas2#2 = phi( render_tiles::@1/render_tiles::canvas2#3 ) + render_tiles::canvas1#2 = phi( render_tiles::@1/render_tiles::canvas1#3 ) + render_tiles::tile_right_pixels#1 = phi( render_tiles::@1/render_tiles::tile_right_pixels#2 ) + render_tiles::y#3 = phi( render_tiles::@1/render_tiles::y#2 ) + render_tiles::tile_left_pixels#1 = phi( render_tiles::@1/render_tiles::tile_left_pixels#2 ) + render_tiles::$9 = render_tiles::tile_left_pixels#1[render_tiles::y#3] | render_tiles::tile_right_pixels#1[render_tiles::y#3] + render_tiles::pixels#0 = render_tiles::$9 + *render_tiles::canvas1#2 = render_tiles::pixels#0 + *render_tiles::canvas2#2 = render_tiles::pixels#0 + render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + render_tiles::ypos_inc_offset#1 = ++ render_tiles::ypos_inc_offset#2 + render_tiles::y#1 = ++ render_tiles::y#3 + to:render_tiles::@1 +render_tiles::@return: scope:[render_tiles] from render_tiles::@1 + return + to:@return + +void init_bobs_restore() +init_bobs_restore: scope:[init_bobs_restore] from splash_run::@30 + init_bobs_restore::bob_restore#0 = bobs_restore + init_bobs_restore::bob#0 = 0 + to:init_bobs_restore::@1 +init_bobs_restore::@1: scope:[init_bobs_restore] from init_bobs_restore init_bobs_restore::@6 + init_bobs_restore::bob_restore#6 = phi( init_bobs_restore/init_bobs_restore::bob_restore#0, init_bobs_restore::@6/init_bobs_restore::bob_restore#1 ) + init_bobs_restore::bob#2 = phi( init_bobs_restore/init_bobs_restore::bob#0, init_bobs_restore::@6/init_bobs_restore::bob#1 ) + init_bobs_restore::$0 = init_bobs_restore::bob#2 < NUM_BOBS*2 + if(init_bobs_restore::$0) goto init_bobs_restore::@2 + to:init_bobs_restore::@3 +init_bobs_restore::@2: scope:[init_bobs_restore] from init_bobs_restore::@1 + init_bobs_restore::bob#5 = phi( init_bobs_restore::@1/init_bobs_restore::bob#2 ) + init_bobs_restore::bob_restore#5 = phi( init_bobs_restore::@1/init_bobs_restore::bob_restore#6 ) + init_bobs_restore::i#0 = 0 + to:init_bobs_restore::@4 +init_bobs_restore::@3: scope:[init_bobs_restore] from init_bobs_restore::@1 + logic_tile_ptr = LEVEL_TILES+$40*$12+$c + logic_tile_xcol = $c + logic_tile_yfine = $23 + to:init_bobs_restore::@return +init_bobs_restore::@4: scope:[init_bobs_restore] from init_bobs_restore::@2 init_bobs_restore::@5 + init_bobs_restore::bob#4 = phi( init_bobs_restore::@2/init_bobs_restore::bob#5, init_bobs_restore::@5/init_bobs_restore::bob#6 ) + init_bobs_restore::bob_restore#4 = phi( init_bobs_restore::@2/init_bobs_restore::bob_restore#5, init_bobs_restore::@5/init_bobs_restore::bob_restore#2 ) + init_bobs_restore::i#2 = phi( init_bobs_restore::@2/init_bobs_restore::i#0, init_bobs_restore::@5/init_bobs_restore::i#1 ) + init_bobs_restore::$1 = init_bobs_restore::i#2 < SIZE_BOB_RESTORE + if(init_bobs_restore::$1) goto init_bobs_restore::@5 + to:init_bobs_restore::@6 +init_bobs_restore::@5: scope:[init_bobs_restore] from init_bobs_restore::@4 + init_bobs_restore::bob#6 = phi( init_bobs_restore::@4/init_bobs_restore::bob#4 ) + init_bobs_restore::i#3 = phi( init_bobs_restore::@4/init_bobs_restore::i#2 ) + init_bobs_restore::bob_restore#2 = phi( init_bobs_restore::@4/init_bobs_restore::bob_restore#4 ) + init_bobs_restore::bob_restore#2[init_bobs_restore::i#3] = 0 + init_bobs_restore::i#1 = ++ init_bobs_restore::i#3 + to:init_bobs_restore::@4 +init_bobs_restore::@6: scope:[init_bobs_restore] from init_bobs_restore::@4 + init_bobs_restore::bob#3 = phi( init_bobs_restore::@4/init_bobs_restore::bob#4 ) + init_bobs_restore::bob_restore#3 = phi( init_bobs_restore::@4/init_bobs_restore::bob_restore#4 ) + init_bobs_restore::$2 = < init_bobs_restore::CANVAS_HIDDEN + init_bobs_restore::bob_restore#3[0] = init_bobs_restore::$2 + init_bobs_restore::$3 = > init_bobs_restore::CANVAS_HIDDEN + init_bobs_restore::bob_restore#3[1] = init_bobs_restore::$3 + init_bobs_restore::$4 = < init_bobs_restore::CANVAS_HIDDEN + init_bobs_restore::bob_restore#3[3] = init_bobs_restore::$4 + init_bobs_restore::$5 = > init_bobs_restore::CANVAS_HIDDEN + init_bobs_restore::bob_restore#3[4] = init_bobs_restore::$5 + init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#3 + SIZE_BOB_RESTORE + init_bobs_restore::bob#1 = ++ init_bobs_restore::bob#3 + to:init_bobs_restore::@1 +init_bobs_restore::@return: scope:[init_bobs_restore] from init_bobs_restore::@3 + return + to:@return + +void main() +main: scope:[main] from __start::@1 + call splash_run + to:main::@2 +main::@2: scope:[main] from main + to:main::@1 +main::@1: scope:[main] from main::@2 main::@4 + call gameplay_run + to:main::@3 +main::@3: scope:[main] from main::@1 + call done_run + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@1 +main::@return: scope:[main] from + return + to:@return + +void done_run() +done_run: scope:[done_run] from main::@3 + game_playable = 0 + phase = 0 + done_run::i#0 = 0 + to:done_run::@3 +done_run::@3: scope:[done_run] from done_run done_run::@4 + done_run::i#2 = phi( done_run/done_run::i#0, done_run::@4/done_run::i#1 ) + done_run::$1 = done_run::i#2 < $2f + if(done_run::$1) goto done_run::@4 + to:done_run::@5 +done_run::@4: scope:[done_run] from done_run::@3 + done_run::i#3 = phi( done_run::@3/done_run::i#2 ) + ((byte*)SID)[done_run::i#3] = 0 + done_run::i#1 = ++ done_run::i#3 + to:done_run::@3 +done_run::@5: scope:[done_run] from done_run::@3 + done_run::i1#0 = 0 + to:done_run::@6 +done_run::@6: scope:[done_run] from done_run::@5 done_run::@7 + done_run::i1#2 = phi( done_run::@5/done_run::i1#0, done_run::@7/done_run::i1#1 ) + done_run::$2 = done_run::i1#2 < 4 + if(done_run::$2) goto done_run::@7 + to:done_run::@8 +done_run::@7: scope:[done_run] from done_run::@6 + done_run::i1#3 = phi( done_run::@6/done_run::i1#2 ) + bobs_xcol[done_run::i1#3] = $a + bobs_yfine[done_run::i1#3] = $2d + bobs_bob_id[done_run::i1#3] = 0 + done_run::i1#1 = ++ done_run::i1#3 + to:done_run::@6 +done_run::@8: scope:[done_run] from done_run::@6 + asm { lda#0 } + call *musicInit + done_run::$12 = 0 != pacman_wins + if(done_run::$12) goto done_run::@1 + to:done_run::@9 +done_run::@1: scope:[done_run] from done_run::@8 + byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED + call byteboozer_decrunch + to:done_run::@19 +done_run::@19: scope:[done_run] from done_run::@1 + to:done_run::@2 +done_run::@9: scope:[done_run] from done_run::@8 + byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED + call byteboozer_decrunch + to:done_run::@20 +done_run::@20: scope:[done_run] from done_run::@9 + to:done_run::@2 +done_run::@2: scope:[done_run] from done_run::@19 done_run::@20 + done_run::gfx#0 = WIN_GFX + done_run::xcol#0 = 0 + to:done_run::@10 +done_run::@10: scope:[done_run] from done_run::@15 done_run::@2 + done_run::gfx#6 = phi( done_run::@15/done_run::gfx#7, done_run::@2/done_run::gfx#0 ) + done_run::xcol#2 = phi( done_run::@15/done_run::xcol#1, done_run::@2/done_run::xcol#0 ) + done_run::$5 = done_run::xcol#2 < $19 + if(done_run::$5) goto done_run::@11 + to:done_run::@12 +done_run::@11: scope:[done_run] from done_run::@10 + done_run::xcol#6 = phi( done_run::@10/done_run::xcol#2 ) + done_run::gfx#4 = phi( done_run::@10/done_run::gfx#6 ) + done_run::ypos#0 = 0 + to:done_run::@13 +done_run::@12: scope:[done_run] from done_run::@10 + music_play_next = 0 + to:done_run::@16 +done_run::@13: scope:[done_run] from done_run::@11 done_run::@21 + done_run::xcol#5 = phi( done_run::@11/done_run::xcol#6, done_run::@21/done_run::xcol#7 ) + done_run::gfx#3 = phi( done_run::@11/done_run::gfx#4, done_run::@21/done_run::gfx#5 ) + done_run::ypos#2 = phi( done_run::@11/done_run::ypos#0, done_run::@21/done_run::ypos#1 ) + done_run::$6 = done_run::ypos#2 < $19 + if(done_run::$6) goto done_run::@14 + to:done_run::@15 +done_run::@14: scope:[done_run] from done_run::@13 + done_run::ypos#3 = phi( done_run::@13/done_run::ypos#2 ) + done_run::xcol#3 = phi( done_run::@13/done_run::xcol#5 ) + done_run::gfx#2 = phi( done_run::@13/done_run::gfx#3 ) + done_run::pixels#0 = *done_run::gfx#2 + done_run::gfx#1 = ++ done_run::gfx#2 + render::xcol#0 = done_run::xcol#3 + render::ypos#0 = done_run::ypos#3 + render::pixels#0 = done_run::pixels#0 + call render + to:done_run::@21 +done_run::@21: scope:[done_run] from done_run::@14 + done_run::xcol#7 = phi( done_run::@14/done_run::xcol#3 ) + done_run::gfx#5 = phi( done_run::@14/done_run::gfx#1 ) + done_run::ypos#4 = phi( done_run::@14/done_run::ypos#3 ) + done_run::ypos#1 = ++ done_run::ypos#4 + to:done_run::@13 +done_run::@15: scope:[done_run] from done_run::@13 + done_run::gfx#7 = phi( done_run::@13/done_run::gfx#3 ) + done_run::xcol#4 = phi( done_run::@13/done_run::xcol#5 ) + done_run::xcol#1 = ++ done_run::xcol#4 + to:done_run::@10 +done_run::@16: scope:[done_run] from done_run::@12 done_run::@17 done_run::@18 + call joyfire + joyfire::return#0 = joyfire::return#4 + to:done_run::@22 +done_run::@22: scope:[done_run] from done_run::@16 + joyfire::return#5 = phi( done_run::@16/joyfire::return#0 ) + done_run::$8 = joyfire::return#5 + done_run::$13 = 0 != done_run::$8 + done_run::$9 = ! done_run::$13 + if(done_run::$9) goto done_run::@17 + to:done_run::@return +done_run::@17: scope:[done_run] from done_run::@22 + done_run::$14 = 0 != music_play_next + done_run::$10 = ! done_run::$14 + if(done_run::$10) goto done_run::@16 + to:done_run::@18 +done_run::@18: scope:[done_run] from done_run::@17 + call *musicPlay + music_play_next = 0 + to:done_run::@16 +done_run::@return: scope:[done_run] from done_run::@22 + return + to:@return + +void splash_run() +splash_run: scope:[splash_run] from main + to:splash_run::SEI1 +splash_run::SEI1: scope:[splash_run] from splash_run + asm { sei } + to:splash_run::@17 +splash_run::@17: scope:[splash_run] from splash_run::SEI1 + *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR + *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + *PROCPORT = PROCPORT_RAM_ALL + memset::str#0 = (void*)$4000 + memset::c#0 = 0 + memset::num#0 = $c00 + call memset + memset::return#2 = memset::return#1 + to:splash_run::@21 +splash_run::@21: scope:[splash_run] from splash_run::@17 + byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED + call byteboozer_decrunch + to:splash_run::@22 +splash_run::@22: scope:[splash_run] from splash_run::@21 + byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED + call byteboozer_decrunch + to:splash_run::@23 +splash_run::@23: scope:[splash_run] from splash_run::@22 + merge_code::dest_code#7 = RASTER_CODE + merge_code::raster_code#3 = RASTER_CODE_UNMERGED + merge_code::logic_code#6 = LOGIC_CODE_UNMERGED + call merge_code + to:splash_run::@24 +splash_run::@24: scope:[splash_run] from splash_run::@23 + memset::str#1 = (void*)BANK_1+$2000 + memset::c#1 = 0 + memset::num#1 = $1fff + call memset + memset::return#3 = memset::return#1 + to:splash_run::@25 +splash_run::@25: scope:[splash_run] from splash_run::@24 + memset::str#2 = (void*)BANK_2 + memset::c#2 = 0 + memset::num#2 = $3fff + call memset + memset::return#4 = memset::return#1 + to:splash_run::@26 +splash_run::@26: scope:[splash_run] from splash_run::@25 + call init_render_index + to:splash_run::@27 +splash_run::@27: scope:[splash_run] from splash_run::@26 + byteboozer_decrunch::crunched = SPLASH_CRUNCHED + call byteboozer_decrunch + to:splash_run::@28 +splash_run::@28: scope:[splash_run] from splash_run::@27 + call splash_show + to:splash_run::@29 +splash_run::@29: scope:[splash_run] from splash_run::@28 + memset::str#3 = (void*)BANK_1 + memset::c#3 = 0 + memset::num#3 = $1fff + call memset + memset::return#5 = memset::return#1 + to:splash_run::@30 +splash_run::@30: scope:[splash_run] from splash_run::@29 + call init_bobs_restore + to:splash_run::@31 +splash_run::@31: scope:[splash_run] from splash_run::@30 + byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED + call byteboozer_decrunch + to:splash_run::@32 +splash_run::@32: scope:[splash_run] from splash_run::@31 + call init_sprite_pointers + to:splash_run::@33 +splash_run::@33: scope:[splash_run] from splash_run::@32 + memcpy::destination#0 = (void*)INTRO_MUSIC_CRUNCHED_UPPER + memcpy::source#0 = (void*)INTRO_MUSIC_CRUNCHED + memcpy::num#0 = INTRO_MUSIC_CRUNCHED_SIZE + call memcpy + memcpy::return#2 = memcpy::return#1 + to:splash_run::@34 +splash_run::@34: scope:[splash_run] from splash_run::@33 + byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER + call byteboozer_decrunch + to:splash_run::@35 +splash_run::@35: scope:[splash_run] from splash_run::@34 + memset::str#4 = (void*)INTRO_MUSIC_CRUNCHED_UPPER + memset::c#4 = 0 + memset::num#4 = INTRO_MUSIC_CRUNCHED_SIZE + call memset + memset::return#6 = memset::return#1 + to:splash_run::@36 +splash_run::@36: scope:[splash_run] from splash_run::@35 + *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + *PROCPORT = PROCPORT_RAM_IO + splash_run::msb#0 = 0 + splash_run::i#0 = 0 + to:splash_run::@1 +splash_run::@1: scope:[splash_run] from splash_run::@36 splash_run::@4 + splash_run::msb#6 = phi( splash_run::@36/splash_run::msb#0, splash_run::@4/splash_run::msb#8 ) + splash_run::i#2 = phi( splash_run::@36/splash_run::i#0, splash_run::@4/splash_run::i#1 ) + splash_run::$22 = splash_run::i#2 < 8 + if(splash_run::$22) goto splash_run::@2 + to:splash_run::@3 +splash_run::@2: scope:[splash_run] from splash_run::@1 + splash_run::msb#3 = phi( splash_run::@1/splash_run::msb#6 ) + splash_run::i#3 = phi( splash_run::@1/splash_run::i#2 ) + splash_run::$23 = splash_run::i#3 * 2 + SPRITES_YPOS[splash_run::$23] = 7 + splash_run::$34 = splash_run::i#3 * SIZEOF_WORD + splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] + splash_run::$24 = splash_run::i#3 * 2 + SPRITES_XPOS[splash_run::$24] = (byte)splash_run::xpos#0 + splash_run::msb#1 = splash_run::msb#3 / 2 + splash_run::$25 = > splash_run::xpos#0 + splash_run::$35 = 0 != splash_run::$25 + splash_run::$26 = ! splash_run::$35 + if(splash_run::$26) goto splash_run::@4 + to:splash_run::@5 +splash_run::@3: scope:[splash_run] from splash_run::@1 + splash_run::msb#13 = phi( splash_run::@1/splash_run::msb#6 ) + splash_run::toDd001_gfx#0 = SCREENS_1 + to:splash_run::toDd001 +splash_run::toDd001: scope:[splash_run] from splash_run::@3 + splash_run::msb#12 = phi( splash_run::@3/splash_run::msb#13 ) + splash_run::toDd001_gfx#1 = phi( splash_run::@3/splash_run::toDd001_gfx#0 ) + splash_run::toDd001_$0 = > (word)splash_run::toDd001_gfx#1 + splash_run::toDd001_$1 = splash_run::toDd001_$0 / $40 + splash_run::toDd001_$2 = 3 ^ splash_run::toDd001_$1 + splash_run::toDd001_return#0 = splash_run::toDd001_$2 + to:splash_run::toDd001_@return +splash_run::toDd001_@return: scope:[splash_run] from splash_run::toDd001 + splash_run::msb#11 = phi( splash_run::toDd001/splash_run::msb#12 ) + splash_run::toDd001_return#2 = phi( splash_run::toDd001/splash_run::toDd001_return#0 ) + splash_run::toDd001_return#1 = splash_run::toDd001_return#2 + to:splash_run::@18 +splash_run::@18: scope:[splash_run] from splash_run::toDd001_@return + splash_run::msb#10 = phi( splash_run::toDd001_@return/splash_run::msb#11 ) + splash_run::toDd001_return#3 = phi( splash_run::toDd001_@return/splash_run::toDd001_return#1 ) + splash_run::$17 = splash_run::toDd001_return#3 + *((byte*)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = splash_run::$17 + canvas_base_hi = >SPRITES_2 + bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + splash_run::toD0181_screen#0 = SCREENS_1 + splash_run::toD0181_gfx#0 = SCREENS_1 + to:splash_run::toD0181 +splash_run::toD0181: scope:[splash_run] from splash_run::@18 + splash_run::msb#9 = phi( splash_run::@18/splash_run::msb#10 ) + splash_run::toD0181_gfx#1 = phi( splash_run::@18/splash_run::toD0181_gfx#0 ) + splash_run::toD0181_screen#1 = phi( splash_run::@18/splash_run::toD0181_screen#0 ) + splash_run::toD0181_$7 = (word)splash_run::toD0181_screen#1 + splash_run::toD0181_$0 = splash_run::toD0181_$7 & $3fff + splash_run::toD0181_$1 = splash_run::toD0181_$0 * 4 + splash_run::toD0181_$2 = > splash_run::toD0181_$1 + splash_run::toD0181_$3 = > (word)splash_run::toD0181_gfx#1 + splash_run::toD0181_$4 = splash_run::toD0181_$3 / 4 + splash_run::toD0181_$5 = splash_run::toD0181_$4 & $f + splash_run::toD0181_$6 = splash_run::toD0181_$2 | splash_run::toD0181_$5 + splash_run::toD0181_return#0 = splash_run::toD0181_$6 + to:splash_run::toD0181_@return +splash_run::toD0181_@return: scope:[splash_run] from splash_run::toD0181 + splash_run::msb#7 = phi( splash_run::toD0181/splash_run::msb#9 ) + splash_run::toD0181_return#2 = phi( splash_run::toD0181/splash_run::toD0181_return#0 ) + splash_run::toD0181_return#1 = splash_run::toD0181_return#2 + to:splash_run::@19 +splash_run::@19: scope:[splash_run] from splash_run::toD0181_@return + splash_run::msb#4 = phi( splash_run::toD0181_@return/splash_run::msb#7 ) + splash_run::toD0181_return#3 = phi( splash_run::toD0181_@return/splash_run::toD0181_return#1 ) + splash_run::$18 = splash_run::toD0181_return#3 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::$18 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) = splash_run::msb#4 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + top_sprites_mc = 3 + side_sprites_mc = 0 + bottom_sprites_mc = 3 + top_sprites_color = YELLOW + side_sprites_color = BLUE + bottom_sprites_color = YELLOW + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + splash_run::i1#0 = 0 + to:splash_run::@6 +splash_run::@4: scope:[splash_run] from splash_run::@2 splash_run::@5 + splash_run::msb#8 = phi( splash_run::@2/splash_run::msb#1, splash_run::@5/splash_run::msb#2 ) + splash_run::i#4 = phi( splash_run::@2/splash_run::i#3, splash_run::@5/splash_run::i#5 ) + splash_run::i#1 = ++ splash_run::i#4 + to:splash_run::@1 +splash_run::@5: scope:[splash_run] from splash_run::@2 + splash_run::i#5 = phi( splash_run::@2/splash_run::i#3 ) + splash_run::msb#5 = phi( splash_run::@2/splash_run::msb#1 ) + splash_run::msb#2 = splash_run::msb#5 | $80 + to:splash_run::@4 +splash_run::@6: scope:[splash_run] from splash_run::@19 splash_run::@7 + splash_run::i1#2 = phi( splash_run::@19/splash_run::i1#0, splash_run::@7/splash_run::i1#1 ) + splash_run::$27 = splash_run::i1#2 < 8 + if(splash_run::$27) goto splash_run::@7 + to:splash_run::@8 +splash_run::@7: scope:[splash_run] from splash_run::@6 + splash_run::i1#3 = phi( splash_run::@6/splash_run::i1#2 ) + SPRITES_COLOR[splash_run::i1#3] = top_sprites_color + splash_run::i1#1 = ++ splash_run::i1#3 + to:splash_run::@6 +splash_run::@8: scope:[splash_run] from splash_run::@6 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 + splash_run::i2#0 = 0 + to:splash_run::@9 +splash_run::@9: scope:[splash_run] from splash_run::@10 splash_run::@8 + splash_run::i2#2 = phi( splash_run::@10/splash_run::i2#1, splash_run::@8/splash_run::i2#0 ) + splash_run::$28 = splash_run::i2#2 < 4 + if(splash_run::$28) goto splash_run::@10 + to:splash_run::@11 +splash_run::@10: scope:[splash_run] from splash_run::@9 + splash_run::i2#3 = phi( splash_run::@9/splash_run::i2#2 ) + bobs_xcol[splash_run::i2#3] = $a + bobs_yfine[splash_run::i2#3] = $2d + bobs_bob_id[splash_run::i2#3] = 0 + splash_run::i2#1 = ++ splash_run::i2#3 + to:splash_run::@9 +splash_run::@11: scope:[splash_run] from splash_run::@9 + asm { lda#1 staINTRO_MUSIC+$69 } + asm { lda#0 } + call *musicInit + phase = 0 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:splash_run::@12 +splash_run::@12: scope:[splash_run] from splash_run::@11 splash_run::@12 + splash_run::$29 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fa + if(splash_run::$29) goto splash_run::@12 + to:splash_run::@13 +splash_run::@13: scope:[splash_run] from splash_run::@12 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + *HARDWARE_IRQ = &irq_screen_top + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + *IRQ_STATUS = $f + to:splash_run::CLI1 +splash_run::CLI1: scope:[splash_run] from splash_run::@13 + asm { cli } + to:splash_run::@20 +splash_run::@20: scope:[splash_run] from splash_run::CLI1 + call joyinit + to:splash_run::@37 +splash_run::@37: scope:[splash_run] from splash_run::@20 + music_play_next = 0 + to:splash_run::@14 +splash_run::@14: scope:[splash_run] from splash_run::@15 splash_run::@16 splash_run::@37 + call joyfire + joyfire::return#1 = joyfire::return#4 + to:splash_run::@38 +splash_run::@38: scope:[splash_run] from splash_run::@14 + joyfire::return#6 = phi( splash_run::@14/joyfire::return#1 ) + splash_run::$30 = joyfire::return#6 + splash_run::$36 = 0 != splash_run::$30 + splash_run::$31 = ! splash_run::$36 + if(splash_run::$31) goto splash_run::@15 + to:splash_run::@return +splash_run::@15: scope:[splash_run] from splash_run::@38 + splash_run::$37 = 0 != music_play_next + splash_run::$32 = ! splash_run::$37 + if(splash_run::$32) goto splash_run::@14 + to:splash_run::@16 +splash_run::@16: scope:[splash_run] from splash_run::@15 + call *musicPlay + music_play_next = 0 + to:splash_run::@14 +splash_run::@return: scope:[splash_run] from splash_run::@38 + return + to:@return + +void gameplay_run() +gameplay_run: scope:[gameplay_run] from main::@1 + to:gameplay_run::SEI1 +gameplay_run::SEI1: scope:[gameplay_run] from gameplay_run + asm { sei } + to:gameplay_run::@14 +gameplay_run::@14: scope:[gameplay_run] from gameplay_run::SEI1 + gameplay_run::i#0 = 0 + to:gameplay_run::@1 +gameplay_run::@1: scope:[gameplay_run] from gameplay_run::@14 gameplay_run::@2 + gameplay_run::i#2 = phi( gameplay_run::@14/gameplay_run::i#0, gameplay_run::@2/gameplay_run::i#1 ) + gameplay_run::$8 = gameplay_run::i#2 < $2f + if(gameplay_run::$8) goto gameplay_run::@2 + to:gameplay_run::@3 +gameplay_run::@2: scope:[gameplay_run] from gameplay_run::@1 + gameplay_run::i#3 = phi( gameplay_run::@1/gameplay_run::i#2 ) + ((byte*)SID)[gameplay_run::i#3] = 0 + gameplay_run::i#1 = ++ gameplay_run::i#3 + to:gameplay_run::@1 +gameplay_run::@3: scope:[gameplay_run] from gameplay_run::@1 + pacman_wins = 0 + pacman_lives = 3 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK + gameplay_run::i1#0 = 0 + to:gameplay_run::@4 +gameplay_run::@4: scope:[gameplay_run] from gameplay_run::@3 gameplay_run::@5 + gameplay_run::i1#2 = phi( gameplay_run::@3/gameplay_run::i1#0, gameplay_run::@5/gameplay_run::i1#1 ) + gameplay_run::$9 = gameplay_run::i1#2 < 8 + if(gameplay_run::$9) goto gameplay_run::@5 + to:gameplay_run::@6 +gameplay_run::@5: scope:[gameplay_run] from gameplay_run::@4 + gameplay_run::i1#3 = phi( gameplay_run::@4/gameplay_run::i1#2 ) + SPRITES_COLOR[gameplay_run::i1#3] = BLACK + gameplay_run::i1#1 = ++ gameplay_run::i1#3 + to:gameplay_run::@4 +gameplay_run::@6: scope:[gameplay_run] from gameplay_run::@4 + byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED + call byteboozer_decrunch + to:gameplay_run::@15 +gameplay_run::@15: scope:[gameplay_run] from gameplay_run::@6 + call init_level_tile_directions + to:gameplay_run::@16 +gameplay_run::@16: scope:[gameplay_run] from gameplay_run::@15 + call init_sprite_pointers + to:gameplay_run::@17 +gameplay_run::@17: scope:[gameplay_run] from gameplay_run::@16 + call level_show + level_show::return#0 = level_show::return#2 + to:gameplay_run::@18 +gameplay_run::@18: scope:[gameplay_run] from gameplay_run::@17 + level_show::return#3 = phi( gameplay_run::@17/level_show::return#0 ) + gameplay_run::$4 = level_show::return#3 + pill_count = gameplay_run::$4 + top_sprites_mc = $ff + side_sprites_mc = $ff + bottom_sprites_mc = $ff + top_sprites_color = YELLOW + side_sprites_color = YELLOW + bottom_sprites_color = YELLOW + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + gameplay_run::i2#0 = 0 + to:gameplay_run::@7 +gameplay_run::@7: scope:[gameplay_run] from gameplay_run::@18 gameplay_run::@8 + gameplay_run::i2#2 = phi( gameplay_run::@18/gameplay_run::i2#0, gameplay_run::@8/gameplay_run::i2#1 ) + gameplay_run::$10 = gameplay_run::i2#2 < 8 + if(gameplay_run::$10) goto gameplay_run::@8 + to:gameplay_run::@9 +gameplay_run::@8: scope:[gameplay_run] from gameplay_run::@7 + gameplay_run::i2#3 = phi( gameplay_run::@7/gameplay_run::i2#2 ) + SPRITES_COLOR[gameplay_run::i2#3] = top_sprites_color + gameplay_run::i2#1 = ++ gameplay_run::i2#3 + to:gameplay_run::@7 +gameplay_run::@9: scope:[gameplay_run] from gameplay_run::@7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + phase = 1 + call spawn_all + to:gameplay_run::@19 +gameplay_run::@19: scope:[gameplay_run] from gameplay_run::@9 + call pacman_sound_init + to:gameplay_run::@20 +gameplay_run::@20: scope:[gameplay_run] from gameplay_run::@19 + game_playable = 1 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:gameplay_run::@10 +gameplay_run::@10: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@20 + gameplay_run::$11 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fb + if(gameplay_run::$11) goto gameplay_run::@10 + to:gameplay_run::@11 +gameplay_run::@11: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@11 + gameplay_run::$12 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fa + if(gameplay_run::$12) goto gameplay_run::@11 + to:gameplay_run::@12 +gameplay_run::@12: scope:[gameplay_run] from gameplay_run::@11 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + *HARDWARE_IRQ = &irq_screen_top + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + *IRQ_STATUS = $f + to:gameplay_run::CLI1 +gameplay_run::CLI1: scope:[gameplay_run] from gameplay_run::@12 + asm { cli } + to:gameplay_run::@13 +gameplay_run::@13: scope:[gameplay_run] from gameplay_run::@13 gameplay_run::CLI1 + gameplay_run::$13 = pacman_lives == 0 + gameplay_run::$14 = pacman_wins || gameplay_run::$13 + gameplay_run::$15 = ! gameplay_run::$14 + if(gameplay_run::$15) goto gameplay_run::@13 + to:gameplay_run::@return +gameplay_run::@return: scope:[gameplay_run] from gameplay_run::@13 + return + to:@return + +void joyinit() +joyinit: scope:[joyinit] from splash_run::@20 + *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 + to:joyinit::@return +joyinit::@return: scope:[joyinit] from joyinit + return + to:@return + +byte joyfire() +joyfire: scope:[joyfire] from done_run::@16 splash_run::@14 + joyfire::$0 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $10 + joyfire::$1 = joyfire::$0 == 0 + if(joyfire::$1) goto joyfire::@1 + to:joyfire::@2 +joyfire::@1: scope:[joyfire] from joyfire + joyfire::return#2 = 1 + to:joyfire::@return +joyfire::@2: scope:[joyfire] from joyfire + joyfire::return#3 = 0 + to:joyfire::@return +joyfire::@return: scope:[joyfire] from joyfire::@1 joyfire::@2 + joyfire::return#7 = phi( joyfire::@1/joyfire::return#2, joyfire::@2/joyfire::return#3 ) + joyfire::return#4 = joyfire::return#7 + return + to:@return + +void splash_show() +splash_show: scope:[splash_show] from splash_run::@28 + splash_show::splash#0 = SPLASH + splash_show::xcol#0 = 0 + to:splash_show::@1 +splash_show::@1: scope:[splash_show] from splash_show splash_show::@5 + splash_show::splash#6 = phi( splash_show/splash_show::splash#0, splash_show::@5/splash_show::splash#7 ) + splash_show::xcol#2 = phi( splash_show/splash_show::xcol#0, splash_show::@5/splash_show::xcol#1 ) + splash_show::$0 = splash_show::xcol#2 < $19 + if(splash_show::$0) goto splash_show::@2 + to:splash_show::@return +splash_show::@2: scope:[splash_show] from splash_show::@1 + splash_show::xcol#6 = phi( splash_show::@1/splash_show::xcol#2 ) + splash_show::splash#4 = phi( splash_show::@1/splash_show::splash#6 ) + splash_show::ypos#0 = 0 + to:splash_show::@3 +splash_show::@3: scope:[splash_show] from splash_show::@2 splash_show::@6 + splash_show::xcol#5 = phi( splash_show::@2/splash_show::xcol#6, splash_show::@6/splash_show::xcol#7 ) + splash_show::splash#3 = phi( splash_show::@2/splash_show::splash#4, splash_show::@6/splash_show::splash#5 ) + splash_show::ypos#2 = phi( splash_show::@2/splash_show::ypos#0, splash_show::@6/splash_show::ypos#1 ) + splash_show::$1 = splash_show::ypos#2 < $93 + if(splash_show::$1) goto splash_show::@4 + to:splash_show::@5 +splash_show::@4: scope:[splash_show] from splash_show::@3 + splash_show::ypos#3 = phi( splash_show::@3/splash_show::ypos#2 ) + splash_show::xcol#3 = phi( splash_show::@3/splash_show::xcol#5 ) + splash_show::splash#2 = phi( splash_show::@3/splash_show::splash#3 ) + splash_show::pixels#0 = *splash_show::splash#2 + splash_show::splash#1 = ++ splash_show::splash#2 + render::xcol#1 = splash_show::xcol#3 + render::ypos#1 = splash_show::ypos#3 + render::pixels#1 = splash_show::pixels#0 + call render + to:splash_show::@6 +splash_show::@6: scope:[splash_show] from splash_show::@4 + splash_show::xcol#7 = phi( splash_show::@4/splash_show::xcol#3 ) + splash_show::splash#5 = phi( splash_show::@4/splash_show::splash#1 ) + splash_show::ypos#4 = phi( splash_show::@4/splash_show::ypos#3 ) + splash_show::ypos#1 = ++ splash_show::ypos#4 + to:splash_show::@3 +splash_show::@5: scope:[splash_show] from splash_show::@3 + splash_show::splash#7 = phi( splash_show::@3/splash_show::splash#3 ) + splash_show::xcol#4 = phi( splash_show::@3/splash_show::xcol#5 ) + splash_show::xcol#1 = ++ splash_show::xcol#4 + to:splash_show::@1 +splash_show::@return: scope:[splash_show] from splash_show::@1 + return + to:@return + +word level_show() +level_show: scope:[level_show] from gameplay_run::@17 + level_show::count#0 = 0 + level_show::level#0 = LEVEL_TILES + level_show::ytile#0 = 0 + to:level_show::@1 +level_show::@1: scope:[level_show] from level_show level_show::@6 + level_show::level#9 = phi( level_show/level_show::level#0, level_show::@6/level_show::level#1 ) + level_show::count#6 = phi( level_show/level_show::count#0, level_show::@6/level_show::count#9 ) + level_show::ytile#2 = phi( level_show/level_show::ytile#0, level_show::@6/level_show::ytile#1 ) + level_show::$0 = level_show::ytile#2 < $25 + if(level_show::$0) goto level_show::@2 + to:level_show::@3 +level_show::@2: scope:[level_show] from level_show::@1 + level_show::count#12 = phi( level_show::@1/level_show::count#6 ) + level_show::ytile#9 = phi( level_show::@1/level_show::ytile#2 ) + level_show::level#8 = phi( level_show::@1/level_show::level#9 ) + level_show::xcol#0 = 0 + level_show::xtile#0 = 0 + to:level_show::@4 +level_show::@3: scope:[level_show] from level_show::@1 + level_show::count#3 = phi( level_show::@1/level_show::count#6 ) + level_show::return#1 = level_show::count#3 + to:level_show::@return +level_show::@4: scope:[level_show] from level_show::@11 level_show::@2 + level_show::count#10 = phi( level_show::@11/level_show::count#11, level_show::@2/level_show::count#12 ) + level_show::ytile#5 = phi( level_show::@11/level_show::ytile#8, level_show::@2/level_show::ytile#9 ) + level_show::xtile#5 = phi( level_show::@11/level_show::xtile#7, level_show::@2/level_show::xtile#0 ) + level_show::level#5 = phi( level_show::@11/level_show::level#7, level_show::@2/level_show::level#8 ) + level_show::xcol#2 = phi( level_show::@11/level_show::xcol#1, level_show::@2/level_show::xcol#0 ) + level_show::$1 = level_show::xcol#2 < $19 + if(level_show::$1) goto level_show::@5 + to:level_show::@6 +level_show::@5: scope:[level_show] from level_show::@4 + level_show::ytile#10 = phi( level_show::@4/level_show::ytile#5 ) + level_show::xcol#7 = phi( level_show::@4/level_show::xcol#2 ) + level_show::count#7 = phi( level_show::@4/level_show::count#10 ) + level_show::xtile#3 = phi( level_show::@4/level_show::xtile#5 ) + level_show::level#2 = phi( level_show::@4/level_show::level#5 ) + level_show::tile_left#0 = level_show::level#2[level_show::xtile#3] + level_show::xtile#1 = ++ level_show::xtile#3 + level_show::$2 = TILES_TYPE[level_show::tile_left#0] == PILL + level_show::$3 = ! level_show::$2 + if(level_show::$3) goto level_show::@7 + to:level_show::@9 +level_show::@6: scope:[level_show] from level_show::@4 + level_show::count#9 = phi( level_show::@4/level_show::count#10 ) + level_show::ytile#3 = phi( level_show::@4/level_show::ytile#5 ) + level_show::level#3 = phi( level_show::@4/level_show::level#5 ) + level_show::level#1 = level_show::level#3 + $40 + level_show::ytile#1 = ++ level_show::ytile#3 + to:level_show::@1 +level_show::@7: scope:[level_show] from level_show::@5 level_show::@9 + level_show::count#8 = phi( level_show::@5/level_show::count#7, level_show::@9/level_show::count#1 ) + level_show::tile_left#3 = phi( level_show::@5/level_show::tile_left#0, level_show::@9/level_show::tile_left#4 ) + level_show::ytile#7 = phi( level_show::@5/level_show::ytile#10, level_show::@9/level_show::ytile#11 ) + level_show::xcol#6 = phi( level_show::@5/level_show::xcol#7, level_show::@9/level_show::xcol#8 ) + level_show::xtile#4 = phi( level_show::@5/level_show::xtile#1, level_show::@9/level_show::xtile#6 ) + level_show::level#4 = phi( level_show::@5/level_show::level#2, level_show::@9/level_show::level#6 ) + level_show::tile_right#0 = level_show::level#4[level_show::xtile#4] + level_show::xtile#2 = ++ level_show::xtile#4 + level_show::$4 = TILES_TYPE[level_show::tile_right#0] == PILL + level_show::$5 = ! level_show::$4 + if(level_show::$5) goto level_show::@8 + to:level_show::@10 +level_show::@9: scope:[level_show] from level_show::@5 + level_show::tile_left#4 = phi( level_show::@5/level_show::tile_left#0 ) + level_show::ytile#11 = phi( level_show::@5/level_show::ytile#10 ) + level_show::xcol#8 = phi( level_show::@5/level_show::xcol#7 ) + level_show::xtile#6 = phi( level_show::@5/level_show::xtile#1 ) + level_show::level#6 = phi( level_show::@5/level_show::level#2 ) + level_show::count#4 = phi( level_show::@5/level_show::count#7 ) + level_show::count#1 = ++ level_show::count#4 + to:level_show::@7 +level_show::@8: scope:[level_show] from level_show::@10 level_show::@7 + level_show::count#13 = phi( level_show::@10/level_show::count#2, level_show::@7/level_show::count#8 ) + level_show::xtile#8 = phi( level_show::@10/level_show::xtile#9, level_show::@7/level_show::xtile#2 ) + level_show::level#10 = phi( level_show::@10/level_show::level#11, level_show::@7/level_show::level#4 ) + level_show::tile_right#1 = phi( level_show::@10/level_show::tile_right#2, level_show::@7/level_show::tile_right#0 ) + level_show::tile_left#1 = phi( level_show::@10/level_show::tile_left#2, level_show::@7/level_show::tile_left#3 ) + level_show::ytile#4 = phi( level_show::@10/level_show::ytile#6, level_show::@7/level_show::ytile#7 ) + level_show::xcol#3 = phi( level_show::@10/level_show::xcol#5, level_show::@7/level_show::xcol#6 ) + render_tiles::xcol#0 = level_show::xcol#3 + render_tiles::ytile#0 = level_show::ytile#4 + render_tiles::tile_left#0 = level_show::tile_left#1 + render_tiles::tile_right#0 = level_show::tile_right#1 + call render_tiles + to:level_show::@11 +level_show::@11: scope:[level_show] from level_show::@8 + level_show::count#11 = phi( level_show::@8/level_show::count#13 ) + level_show::ytile#8 = phi( level_show::@8/level_show::ytile#4 ) + level_show::xtile#7 = phi( level_show::@8/level_show::xtile#8 ) + level_show::level#7 = phi( level_show::@8/level_show::level#10 ) + level_show::xcol#4 = phi( level_show::@8/level_show::xcol#3 ) + level_show::xcol#1 = ++ level_show::xcol#4 + to:level_show::@4 +level_show::@10: scope:[level_show] from level_show::@7 + level_show::xtile#9 = phi( level_show::@7/level_show::xtile#2 ) + level_show::level#11 = phi( level_show::@7/level_show::level#4 ) + level_show::tile_right#2 = phi( level_show::@7/level_show::tile_right#0 ) + level_show::tile_left#2 = phi( level_show::@7/level_show::tile_left#3 ) + level_show::ytile#6 = phi( level_show::@7/level_show::ytile#7 ) + level_show::xcol#5 = phi( level_show::@7/level_show::xcol#6 ) + level_show::count#5 = phi( level_show::@7/level_show::count#8 ) + level_show::count#2 = ++ level_show::count#5 + to:level_show::@8 +level_show::@return: scope:[level_show] from level_show::@3 + level_show::return#4 = phi( level_show::@3/level_show::return#1 ) + level_show::return#2 = level_show::return#4 + return + to:@return + +byte level_tile_get(byte level_tile_get::xtile , byte level_tile_get::ytile) +level_tile_get: scope:[level_tile_get] from init_level_tile_directions::@4 init_level_tile_directions::@6 init_level_tile_directions::@7 init_level_tile_directions::@8 + level_tile_get::ytile#4 = phi( init_level_tile_directions::@4/level_tile_get::ytile#0, init_level_tile_directions::@6/level_tile_get::ytile#1, init_level_tile_directions::@7/level_tile_get::ytile#2, init_level_tile_directions::@8/level_tile_get::ytile#3 ) + level_tile_get::xtile#4 = phi( init_level_tile_directions::@4/level_tile_get::xtile#0, init_level_tile_directions::@6/level_tile_get::xtile#1, init_level_tile_directions::@7/level_tile_get::xtile#2, init_level_tile_directions::@8/level_tile_get::xtile#3 ) + level_tile_get::$0 = level_tile_get::xtile#4 > $31 + level_tile_get::$1 = level_tile_get::ytile#4 > $24 + level_tile_get::$2 = level_tile_get::$0 || level_tile_get::$1 + level_tile_get::$3 = ! level_tile_get::$2 + if(level_tile_get::$3) goto level_tile_get::@1 + to:level_tile_get::@2 +level_tile_get::@1: scope:[level_tile_get] from level_tile_get + level_tile_get::xtile#5 = phi( level_tile_get/level_tile_get::xtile#4 ) + level_tile_get::ytile#5 = phi( level_tile_get/level_tile_get::ytile#4 ) + level_tile_get::$5 = level_tile_get::ytile#5 * SIZEOF_WORD + level_tile_get::$4 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] + level_tile_get::ytiles#0 = level_tile_get::$4 + level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#5] + to:level_tile_get::@return +level_tile_get::@2: scope:[level_tile_get] from level_tile_get + level_tile_get::return#1 = 0 + to:level_tile_get::@return +level_tile_get::@return: scope:[level_tile_get] from level_tile_get::@1 level_tile_get::@2 + level_tile_get::return#7 = phi( level_tile_get::@1/level_tile_get::return#0, level_tile_get::@2/level_tile_get::return#1 ) + level_tile_get::return#2 = level_tile_get::return#7 + return + to:@return + +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +level_tile_directions: scope:[level_tile_directions] from game_logic::@102 game_logic::@120 game_logic::@138 game_logic::@151 game_logic::@84 + level_tile_directions::ytile#5 = phi( game_logic::@102/level_tile_directions::ytile#1, game_logic::@120/level_tile_directions::ytile#2, game_logic::@138/level_tile_directions::ytile#3, game_logic::@151/level_tile_directions::ytile#4, game_logic::@84/level_tile_directions::ytile#0 ) + level_tile_directions::xtile#5 = phi( game_logic::@102/level_tile_directions::xtile#1, game_logic::@120/level_tile_directions::xtile#2, game_logic::@138/level_tile_directions::xtile#3, game_logic::@151/level_tile_directions::xtile#4, game_logic::@84/level_tile_directions::xtile#0 ) + level_tile_directions::$0 = level_tile_directions::xtile#5 > $31 + level_tile_directions::$1 = level_tile_directions::ytile#5 > $24 + level_tile_directions::$2 = level_tile_directions::$0 || level_tile_directions::$1 + level_tile_directions::$3 = ! level_tile_directions::$2 + if(level_tile_directions::$3) goto level_tile_directions::@1 + to:level_tile_directions::@2 +level_tile_directions::@1: scope:[level_tile_directions] from level_tile_directions + level_tile_directions::xtile#6 = phi( level_tile_directions/level_tile_directions::xtile#5 ) + level_tile_directions::ytile#6 = phi( level_tile_directions/level_tile_directions::ytile#5 ) + level_tile_directions::$5 = level_tile_directions::ytile#6 * SIZEOF_WORD + level_tile_directions::$4 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] + level_tile_directions::ytiles#0 = level_tile_directions::$4 + level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#6] + to:level_tile_directions::@return +level_tile_directions::@2: scope:[level_tile_directions] from level_tile_directions + level_tile_directions::return#1 = 0 + to:level_tile_directions::@return +level_tile_directions::@return: scope:[level_tile_directions] from level_tile_directions::@1 level_tile_directions::@2 + level_tile_directions::return#8 = phi( level_tile_directions::@1/level_tile_directions::return#0, level_tile_directions::@2/level_tile_directions::return#1 ) + level_tile_directions::return#2 = level_tile_directions::return#8 + return + to:@return + +void init_level_tile_directions() +init_level_tile_directions: scope:[init_level_tile_directions] from gameplay_run::@15 + init_level_tile_directions::directions#0 = LEVEL_TILES_DIRECTIONS + init_level_tile_directions::ytile#0 = 0 + to:init_level_tile_directions::@1 +init_level_tile_directions::@1: scope:[init_level_tile_directions] from init_level_tile_directions init_level_tile_directions::@5 + init_level_tile_directions::directions#9 = phi( init_level_tile_directions/init_level_tile_directions::directions#0, init_level_tile_directions::@5/init_level_tile_directions::directions#1 ) + init_level_tile_directions::ytile#2 = phi( init_level_tile_directions/init_level_tile_directions::ytile#0, init_level_tile_directions::@5/init_level_tile_directions::ytile#1 ) + init_level_tile_directions::$0 = init_level_tile_directions::ytile#2 < $25 + if(init_level_tile_directions::$0) goto init_level_tile_directions::@2 + to:init_level_tile_directions::@return +init_level_tile_directions::@2: scope:[init_level_tile_directions] from init_level_tile_directions::@1 + init_level_tile_directions::directions#7 = phi( init_level_tile_directions::@1/init_level_tile_directions::directions#9 ) + init_level_tile_directions::ytile#15 = phi( init_level_tile_directions::@1/init_level_tile_directions::ytile#2 ) + init_level_tile_directions::xtile#0 = 0 + to:init_level_tile_directions::@3 +init_level_tile_directions::@3: scope:[init_level_tile_directions] from init_level_tile_directions::@2 init_level_tile_directions::@9 + init_level_tile_directions::directions#4 = phi( init_level_tile_directions::@2/init_level_tile_directions::directions#7, init_level_tile_directions::@9/init_level_tile_directions::directions#3 ) + init_level_tile_directions::ytile#8 = phi( init_level_tile_directions::@2/init_level_tile_directions::ytile#15, init_level_tile_directions::@9/init_level_tile_directions::ytile#16 ) + init_level_tile_directions::xtile#2 = phi( init_level_tile_directions::@2/init_level_tile_directions::xtile#0, init_level_tile_directions::@9/init_level_tile_directions::xtile#1 ) + init_level_tile_directions::$1 = init_level_tile_directions::xtile#2 < $32 + if(init_level_tile_directions::$1) goto init_level_tile_directions::@4 + to:init_level_tile_directions::@5 +init_level_tile_directions::@4: scope:[init_level_tile_directions] from init_level_tile_directions::@3 + init_level_tile_directions::directions#18 = phi( init_level_tile_directions::@3/init_level_tile_directions::directions#4 ) + init_level_tile_directions::ytile#3 = phi( init_level_tile_directions::@3/init_level_tile_directions::ytile#8 ) + init_level_tile_directions::xtile#3 = phi( init_level_tile_directions::@3/init_level_tile_directions::xtile#2 ) + init_level_tile_directions::open_directions#0 = 0 + init_level_tile_directions::$2 = init_level_tile_directions::xtile#3 - 1 + level_tile_get::xtile#0 = init_level_tile_directions::$2 + level_tile_get::ytile#0 = init_level_tile_directions::ytile#3 + call level_tile_get + level_tile_get::return#3 = level_tile_get::return#2 + to:init_level_tile_directions::@14 +init_level_tile_directions::@14: scope:[init_level_tile_directions] from init_level_tile_directions::@4 + init_level_tile_directions::directions#17 = phi( init_level_tile_directions::@4/init_level_tile_directions::directions#18 ) + init_level_tile_directions::open_directions#10 = phi( init_level_tile_directions::@4/init_level_tile_directions::open_directions#0 ) + init_level_tile_directions::ytile#10 = phi( init_level_tile_directions::@4/init_level_tile_directions::ytile#3 ) + init_level_tile_directions::xtile#9 = phi( init_level_tile_directions::@4/init_level_tile_directions::xtile#3 ) + level_tile_get::return#8 = phi( init_level_tile_directions::@4/level_tile_get::return#3 ) + init_level_tile_directions::$3 = level_tile_get::return#8 + init_level_tile_directions::$4 = TILES_TYPE[init_level_tile_directions::$3] != WALL + init_level_tile_directions::$5 = ! init_level_tile_directions::$4 + if(init_level_tile_directions::$5) goto init_level_tile_directions::@6 + to:init_level_tile_directions::@10 +init_level_tile_directions::@5: scope:[init_level_tile_directions] from init_level_tile_directions::@3 + init_level_tile_directions::ytile#4 = phi( init_level_tile_directions::@3/init_level_tile_directions::ytile#8 ) + init_level_tile_directions::directions#2 = phi( init_level_tile_directions::@3/init_level_tile_directions::directions#4 ) + init_level_tile_directions::directions#1 = init_level_tile_directions::directions#2 + $40 + init_level_tile_directions::ytile#1 = ++ init_level_tile_directions::ytile#4 + to:init_level_tile_directions::@1 +init_level_tile_directions::@6: scope:[init_level_tile_directions] from init_level_tile_directions::@10 init_level_tile_directions::@14 + init_level_tile_directions::directions#15 = phi( init_level_tile_directions::@10/init_level_tile_directions::directions#16, init_level_tile_directions::@14/init_level_tile_directions::directions#17 ) + init_level_tile_directions::open_directions#14 = phi( init_level_tile_directions::@10/init_level_tile_directions::open_directions#1, init_level_tile_directions::@14/init_level_tile_directions::open_directions#10 ) + init_level_tile_directions::ytile#5 = phi( init_level_tile_directions::@10/init_level_tile_directions::ytile#9, init_level_tile_directions::@14/init_level_tile_directions::ytile#10 ) + init_level_tile_directions::xtile#4 = phi( init_level_tile_directions::@10/init_level_tile_directions::xtile#8, init_level_tile_directions::@14/init_level_tile_directions::xtile#9 ) + init_level_tile_directions::$6 = init_level_tile_directions::xtile#4 + 1 + level_tile_get::xtile#1 = init_level_tile_directions::$6 + level_tile_get::ytile#1 = init_level_tile_directions::ytile#5 + call level_tile_get + level_tile_get::return#4 = level_tile_get::return#2 + to:init_level_tile_directions::@15 +init_level_tile_directions::@15: scope:[init_level_tile_directions] from init_level_tile_directions::@6 + init_level_tile_directions::directions#14 = phi( init_level_tile_directions::@6/init_level_tile_directions::directions#15 ) + init_level_tile_directions::open_directions#11 = phi( init_level_tile_directions::@6/init_level_tile_directions::open_directions#14 ) + init_level_tile_directions::xtile#11 = phi( init_level_tile_directions::@6/init_level_tile_directions::xtile#4 ) + init_level_tile_directions::ytile#12 = phi( init_level_tile_directions::@6/init_level_tile_directions::ytile#5 ) + level_tile_get::return#9 = phi( init_level_tile_directions::@6/level_tile_get::return#4 ) + init_level_tile_directions::$7 = level_tile_get::return#9 + init_level_tile_directions::$8 = TILES_TYPE[init_level_tile_directions::$7] != WALL + init_level_tile_directions::$9 = ! init_level_tile_directions::$8 + if(init_level_tile_directions::$9) goto init_level_tile_directions::@7 + to:init_level_tile_directions::@11 +init_level_tile_directions::@10: scope:[init_level_tile_directions] from init_level_tile_directions::@14 + init_level_tile_directions::directions#16 = phi( init_level_tile_directions::@14/init_level_tile_directions::directions#17 ) + init_level_tile_directions::ytile#9 = phi( init_level_tile_directions::@14/init_level_tile_directions::ytile#10 ) + init_level_tile_directions::xtile#8 = phi( init_level_tile_directions::@14/init_level_tile_directions::xtile#9 ) + init_level_tile_directions::open_directions#5 = phi( init_level_tile_directions::@14/init_level_tile_directions::open_directions#10 ) + init_level_tile_directions::open_directions#1 = init_level_tile_directions::open_directions#5 | LEFT + to:init_level_tile_directions::@6 +init_level_tile_directions::@7: scope:[init_level_tile_directions] from init_level_tile_directions::@11 init_level_tile_directions::@15 + init_level_tile_directions::directions#12 = phi( init_level_tile_directions::@11/init_level_tile_directions::directions#13, init_level_tile_directions::@15/init_level_tile_directions::directions#14 ) + init_level_tile_directions::open_directions#15 = phi( init_level_tile_directions::@11/init_level_tile_directions::open_directions#2, init_level_tile_directions::@15/init_level_tile_directions::open_directions#11 ) + init_level_tile_directions::xtile#5 = phi( init_level_tile_directions::@11/init_level_tile_directions::xtile#10, init_level_tile_directions::@15/init_level_tile_directions::xtile#11 ) + init_level_tile_directions::ytile#6 = phi( init_level_tile_directions::@11/init_level_tile_directions::ytile#11, init_level_tile_directions::@15/init_level_tile_directions::ytile#12 ) + init_level_tile_directions::$10 = init_level_tile_directions::ytile#6 - 1 + level_tile_get::xtile#2 = init_level_tile_directions::xtile#5 + level_tile_get::ytile#2 = init_level_tile_directions::$10 + call level_tile_get + level_tile_get::return#5 = level_tile_get::return#2 + to:init_level_tile_directions::@16 +init_level_tile_directions::@16: scope:[init_level_tile_directions] from init_level_tile_directions::@7 + init_level_tile_directions::directions#11 = phi( init_level_tile_directions::@7/init_level_tile_directions::directions#12 ) + init_level_tile_directions::open_directions#12 = phi( init_level_tile_directions::@7/init_level_tile_directions::open_directions#15 ) + init_level_tile_directions::xtile#13 = phi( init_level_tile_directions::@7/init_level_tile_directions::xtile#5 ) + init_level_tile_directions::ytile#14 = phi( init_level_tile_directions::@7/init_level_tile_directions::ytile#6 ) + level_tile_get::return#10 = phi( init_level_tile_directions::@7/level_tile_get::return#5 ) + init_level_tile_directions::$11 = level_tile_get::return#10 + init_level_tile_directions::$12 = TILES_TYPE[init_level_tile_directions::$11] != WALL + init_level_tile_directions::$13 = ! init_level_tile_directions::$12 + if(init_level_tile_directions::$13) goto init_level_tile_directions::@8 + to:init_level_tile_directions::@12 +init_level_tile_directions::@11: scope:[init_level_tile_directions] from init_level_tile_directions::@15 + init_level_tile_directions::directions#13 = phi( init_level_tile_directions::@15/init_level_tile_directions::directions#14 ) + init_level_tile_directions::xtile#10 = phi( init_level_tile_directions::@15/init_level_tile_directions::xtile#11 ) + init_level_tile_directions::ytile#11 = phi( init_level_tile_directions::@15/init_level_tile_directions::ytile#12 ) + init_level_tile_directions::open_directions#6 = phi( init_level_tile_directions::@15/init_level_tile_directions::open_directions#11 ) + init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#6 | RIGHT + to:init_level_tile_directions::@7 +init_level_tile_directions::@8: scope:[init_level_tile_directions] from init_level_tile_directions::@12 init_level_tile_directions::@16 + init_level_tile_directions::directions#8 = phi( init_level_tile_directions::@12/init_level_tile_directions::directions#10, init_level_tile_directions::@16/init_level_tile_directions::directions#11 ) + init_level_tile_directions::open_directions#16 = phi( init_level_tile_directions::@12/init_level_tile_directions::open_directions#3, init_level_tile_directions::@16/init_level_tile_directions::open_directions#12 ) + init_level_tile_directions::xtile#6 = phi( init_level_tile_directions::@12/init_level_tile_directions::xtile#12, init_level_tile_directions::@16/init_level_tile_directions::xtile#13 ) + init_level_tile_directions::ytile#7 = phi( init_level_tile_directions::@12/init_level_tile_directions::ytile#13, init_level_tile_directions::@16/init_level_tile_directions::ytile#14 ) + init_level_tile_directions::$14 = init_level_tile_directions::ytile#7 + 1 + level_tile_get::xtile#3 = init_level_tile_directions::xtile#6 + level_tile_get::ytile#3 = init_level_tile_directions::$14 + call level_tile_get + level_tile_get::return#6 = level_tile_get::return#2 + to:init_level_tile_directions::@17 +init_level_tile_directions::@17: scope:[init_level_tile_directions] from init_level_tile_directions::@8 + init_level_tile_directions::ytile#18 = phi( init_level_tile_directions::@8/init_level_tile_directions::ytile#7 ) + init_level_tile_directions::xtile#15 = phi( init_level_tile_directions::@8/init_level_tile_directions::xtile#6 ) + init_level_tile_directions::directions#6 = phi( init_level_tile_directions::@8/init_level_tile_directions::directions#8 ) + init_level_tile_directions::open_directions#13 = phi( init_level_tile_directions::@8/init_level_tile_directions::open_directions#16 ) + level_tile_get::return#11 = phi( init_level_tile_directions::@8/level_tile_get::return#6 ) + init_level_tile_directions::$15 = level_tile_get::return#11 + init_level_tile_directions::$16 = TILES_TYPE[init_level_tile_directions::$15] != WALL + init_level_tile_directions::$17 = ! init_level_tile_directions::$16 + if(init_level_tile_directions::$17) goto init_level_tile_directions::@9 + to:init_level_tile_directions::@13 +init_level_tile_directions::@12: scope:[init_level_tile_directions] from init_level_tile_directions::@16 + init_level_tile_directions::directions#10 = phi( init_level_tile_directions::@16/init_level_tile_directions::directions#11 ) + init_level_tile_directions::xtile#12 = phi( init_level_tile_directions::@16/init_level_tile_directions::xtile#13 ) + init_level_tile_directions::ytile#13 = phi( init_level_tile_directions::@16/init_level_tile_directions::ytile#14 ) + init_level_tile_directions::open_directions#7 = phi( init_level_tile_directions::@16/init_level_tile_directions::open_directions#12 ) + init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#7 | UP + to:init_level_tile_directions::@8 +init_level_tile_directions::@9: scope:[init_level_tile_directions] from init_level_tile_directions::@13 init_level_tile_directions::@17 + init_level_tile_directions::ytile#16 = phi( init_level_tile_directions::@13/init_level_tile_directions::ytile#17, init_level_tile_directions::@17/init_level_tile_directions::ytile#18 ) + init_level_tile_directions::xtile#7 = phi( init_level_tile_directions::@13/init_level_tile_directions::xtile#14, init_level_tile_directions::@17/init_level_tile_directions::xtile#15 ) + init_level_tile_directions::directions#3 = phi( init_level_tile_directions::@13/init_level_tile_directions::directions#5, init_level_tile_directions::@17/init_level_tile_directions::directions#6 ) + init_level_tile_directions::open_directions#8 = phi( init_level_tile_directions::@13/init_level_tile_directions::open_directions#4, init_level_tile_directions::@17/init_level_tile_directions::open_directions#13 ) + init_level_tile_directions::directions#3[init_level_tile_directions::xtile#7] = init_level_tile_directions::open_directions#8 + init_level_tile_directions::xtile#1 = ++ init_level_tile_directions::xtile#7 + to:init_level_tile_directions::@3 +init_level_tile_directions::@13: scope:[init_level_tile_directions] from init_level_tile_directions::@17 + init_level_tile_directions::ytile#17 = phi( init_level_tile_directions::@17/init_level_tile_directions::ytile#18 ) + init_level_tile_directions::xtile#14 = phi( init_level_tile_directions::@17/init_level_tile_directions::xtile#15 ) + init_level_tile_directions::directions#5 = phi( init_level_tile_directions::@17/init_level_tile_directions::directions#6 ) + init_level_tile_directions::open_directions#9 = phi( init_level_tile_directions::@17/init_level_tile_directions::open_directions#13 ) + init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#9 | DOWN + to:init_level_tile_directions::@9 +init_level_tile_directions::@return: scope:[init_level_tile_directions] from init_level_tile_directions::@1 + return + to:@return + +void init_sprite_pointers() +init_sprite_pointers: scope:[init_sprite_pointers] from gameplay_run::@16 splash_run::@32 + init_sprite_pointers::sprites_ptr_1#0 = SCREENS_1+OFFSET_SPRITE_PTRS + init_sprite_pointers::sprites_ptr_2#0 = SCREENS_2+OFFSET_SPRITE_PTRS + init_sprite_pointers::screen#0 = 0 + to:init_sprite_pointers::@1 +init_sprite_pointers::@1: scope:[init_sprite_pointers] from init_sprite_pointers init_sprite_pointers::@5 + init_sprite_pointers::sprites_ptr_2#6 = phi( init_sprite_pointers/init_sprite_pointers::sprites_ptr_2#0, init_sprite_pointers::@5/init_sprite_pointers::sprites_ptr_2#1 ) + init_sprite_pointers::sprites_ptr_1#6 = phi( init_sprite_pointers/init_sprite_pointers::sprites_ptr_1#0, init_sprite_pointers::@5/init_sprite_pointers::sprites_ptr_1#1 ) + init_sprite_pointers::screen#2 = phi( init_sprite_pointers/init_sprite_pointers::screen#0, init_sprite_pointers::@5/init_sprite_pointers::screen#1 ) + init_sprite_pointers::$0 = init_sprite_pointers::screen#2 < $e + if(init_sprite_pointers::$0) goto init_sprite_pointers::@2 + to:init_sprite_pointers::@return +init_sprite_pointers::@2: scope:[init_sprite_pointers] from init_sprite_pointers::@1 + init_sprite_pointers::sprites_ptr_2#5 = phi( init_sprite_pointers::@1/init_sprite_pointers::sprites_ptr_2#6 ) + init_sprite_pointers::sprites_ptr_1#5 = phi( init_sprite_pointers::@1/init_sprite_pointers::sprites_ptr_1#6 ) + init_sprite_pointers::screen#6 = phi( init_sprite_pointers::@1/init_sprite_pointers::screen#2 ) + init_sprite_pointers::sprite#0 = 0 + to:init_sprite_pointers::@3 +init_sprite_pointers::@3: scope:[init_sprite_pointers] from init_sprite_pointers::@2 init_sprite_pointers::@4 + init_sprite_pointers::sprites_ptr_2#4 = phi( init_sprite_pointers::@2/init_sprite_pointers::sprites_ptr_2#5, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_2#2 ) + init_sprite_pointers::sprites_ptr_1#4 = phi( init_sprite_pointers::@2/init_sprite_pointers::sprites_ptr_1#5, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_1#2 ) + init_sprite_pointers::screen#5 = phi( init_sprite_pointers::@2/init_sprite_pointers::screen#6, init_sprite_pointers::@4/init_sprite_pointers::screen#3 ) + init_sprite_pointers::sprite#2 = phi( init_sprite_pointers::@2/init_sprite_pointers::sprite#0, init_sprite_pointers::@4/init_sprite_pointers::sprite#1 ) + init_sprite_pointers::$1 = init_sprite_pointers::sprite#2 < 8 + if(init_sprite_pointers::$1) goto init_sprite_pointers::@4 + to:init_sprite_pointers::@5 +init_sprite_pointers::@4: scope:[init_sprite_pointers] from init_sprite_pointers::@3 + init_sprite_pointers::sprites_ptr_2#2 = phi( init_sprite_pointers::@3/init_sprite_pointers::sprites_ptr_2#4 ) + init_sprite_pointers::sprites_ptr_1#2 = phi( init_sprite_pointers::@3/init_sprite_pointers::sprites_ptr_1#4 ) + init_sprite_pointers::sprite#3 = phi( init_sprite_pointers::@3/init_sprite_pointers::sprite#2 ) + init_sprite_pointers::screen#3 = phi( init_sprite_pointers::@3/init_sprite_pointers::screen#5 ) + init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#3 + init_sprite_pointers::$3 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#3] + init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$3 + init_sprite_pointers::sprites_ptr_1#2[init_sprite_pointers::sprite#3] = init_sprite_pointers::sprite_id#0 + init_sprite_pointers::sprites_ptr_2#2[init_sprite_pointers::sprite#3] = init_sprite_pointers::sprite_id#0 + init_sprite_pointers::sprite#1 = ++ init_sprite_pointers::sprite#3 + to:init_sprite_pointers::@3 +init_sprite_pointers::@5: scope:[init_sprite_pointers] from init_sprite_pointers::@3 + init_sprite_pointers::screen#4 = phi( init_sprite_pointers::@3/init_sprite_pointers::screen#5 ) + init_sprite_pointers::sprites_ptr_2#3 = phi( init_sprite_pointers::@3/init_sprite_pointers::sprites_ptr_2#4 ) + init_sprite_pointers::sprites_ptr_1#3 = phi( init_sprite_pointers::@3/init_sprite_pointers::sprites_ptr_1#4 ) + init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#3 + $400 + init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#3 + $400 + init_sprite_pointers::screen#1 = ++ init_sprite_pointers::screen#4 + to:init_sprite_pointers::@1 +init_sprite_pointers::@return: scope:[init_sprite_pointers] from init_sprite_pointers::@1 + return + to:@return + +__interrupt(hardware_clobber) void irq_screen_top() +irq_screen_top: scope:[irq_screen_top] from + kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} + asm { jsrRASTER_CODE } + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 + irq_screen_top::toD0181_screen#0 = SCREENS_1 + irq_screen_top::toD0181_gfx#0 = SCREENS_1 + to:irq_screen_top::toD0181 +irq_screen_top::toD0181: scope:[irq_screen_top] from irq_screen_top + irq_screen_top::toD0181_gfx#1 = phi( irq_screen_top/irq_screen_top::toD0181_gfx#0 ) + irq_screen_top::toD0181_screen#1 = phi( irq_screen_top/irq_screen_top::toD0181_screen#0 ) + irq_screen_top::toD0181_$7 = (word)irq_screen_top::toD0181_screen#1 + irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7 & $3fff + irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0 * 4 + irq_screen_top::toD0181_$2 = > irq_screen_top::toD0181_$1 + irq_screen_top::toD0181_$3 = > (word)irq_screen_top::toD0181_gfx#1 + irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3 / 4 + irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4 & $f + irq_screen_top::toD0181_$6 = irq_screen_top::toD0181_$2 | irq_screen_top::toD0181_$5 + irq_screen_top::toD0181_return#0 = irq_screen_top::toD0181_$6 + to:irq_screen_top::toD0181_@return +irq_screen_top::toD0181_@return: scope:[irq_screen_top] from irq_screen_top::toD0181 + irq_screen_top::toD0181_return#2 = phi( irq_screen_top::toD0181/irq_screen_top::toD0181_return#0 ) + irq_screen_top::toD0181_return#1 = irq_screen_top::toD0181_return#2 + to:irq_screen_top::@7 +irq_screen_top::@7: scope:[irq_screen_top] from irq_screen_top::toD0181_@return + irq_screen_top::toD0181_return#3 = phi( irq_screen_top::toD0181_@return/irq_screen_top::toD0181_return#1 ) + irq_screen_top::$0 = irq_screen_top::toD0181_return#3 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::$0 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color + irq_screen_top::$1 = frame + 1 + irq_screen_top::$2 = irq_screen_top::$1 & 1 + frame = irq_screen_top::$2 + irq_screen_top::$8 = 0 != frame + if(irq_screen_top::$8) goto irq_screen_top::@1 + to:irq_screen_top::@5 +irq_screen_top::@1: scope:[irq_screen_top] from irq_screen_top::@7 + irq_screen_top::toDd001_gfx#0 = SCREENS_2 + to:irq_screen_top::toDd001 +irq_screen_top::toDd001: scope:[irq_screen_top] from irq_screen_top::@1 + irq_screen_top::toDd001_gfx#1 = phi( irq_screen_top::@1/irq_screen_top::toDd001_gfx#0 ) + irq_screen_top::toDd001_$0 = > (word)irq_screen_top::toDd001_gfx#1 + irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0 / $40 + irq_screen_top::toDd001_$2 = 3 ^ irq_screen_top::toDd001_$1 + irq_screen_top::toDd001_return#0 = irq_screen_top::toDd001_$2 + to:irq_screen_top::toDd001_@return +irq_screen_top::toDd001_@return: scope:[irq_screen_top] from irq_screen_top::toDd001 + irq_screen_top::toDd001_return#2 = phi( irq_screen_top::toDd001/irq_screen_top::toDd001_return#0 ) + irq_screen_top::toDd001_return#1 = irq_screen_top::toDd001_return#2 + to:irq_screen_top::@8 +irq_screen_top::@8: scope:[irq_screen_top] from irq_screen_top::toDd001_@return + irq_screen_top::toDd001_return#3 = phi( irq_screen_top::toDd001_@return/irq_screen_top::toDd001_return#1 ) + irq_screen_top::$5 = irq_screen_top::toDd001_return#3 + *((byte*)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = irq_screen_top::$5 + canvas_base_hi = >SPRITES_1 + bobs_restore_base = 0 + to:irq_screen_top::@2 +irq_screen_top::@5: scope:[irq_screen_top] from irq_screen_top::@7 + irq_screen_top::toDd002_gfx#0 = SCREENS_1 + to:irq_screen_top::toDd002 +irq_screen_top::toDd002: scope:[irq_screen_top] from irq_screen_top::@5 + irq_screen_top::toDd002_gfx#1 = phi( irq_screen_top::@5/irq_screen_top::toDd002_gfx#0 ) + irq_screen_top::toDd002_$0 = > (word)irq_screen_top::toDd002_gfx#1 + irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0 / $40 + irq_screen_top::toDd002_$2 = 3 ^ irq_screen_top::toDd002_$1 + irq_screen_top::toDd002_return#0 = irq_screen_top::toDd002_$2 + to:irq_screen_top::toDd002_@return +irq_screen_top::toDd002_@return: scope:[irq_screen_top] from irq_screen_top::toDd002 + irq_screen_top::toDd002_return#2 = phi( irq_screen_top::toDd002/irq_screen_top::toDd002_return#0 ) + irq_screen_top::toDd002_return#1 = irq_screen_top::toDd002_return#2 + to:irq_screen_top::@9 +irq_screen_top::@9: scope:[irq_screen_top] from irq_screen_top::toDd002_@return + irq_screen_top::toDd002_return#3 = phi( irq_screen_top::toDd002_@return/irq_screen_top::toDd002_return#1 ) + irq_screen_top::$4 = irq_screen_top::toDd002_return#3 + *((byte*)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = irq_screen_top::$4 + canvas_base_hi = >SPRITES_2 + bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + to:irq_screen_top::@2 +irq_screen_top::@2: scope:[irq_screen_top] from irq_screen_top::@8 irq_screen_top::@9 + irq_screen_top::$3 = phase == 0 + if(irq_screen_top::$3) goto irq_screen_top::@3 + to:irq_screen_top::@6 +irq_screen_top::@3: scope:[irq_screen_top] from irq_screen_top::@2 + music_play_next = 1 + to:irq_screen_top::@4 +irq_screen_top::@6: scope:[irq_screen_top] from irq_screen_top::@2 + call game_logic + to:irq_screen_top::@10 +irq_screen_top::@10: scope:[irq_screen_top] from irq_screen_top::@6 + call pacman_sound_play + to:irq_screen_top::@11 +irq_screen_top::@11: scope:[irq_screen_top] from irq_screen_top::@10 + to:irq_screen_top::@4 +irq_screen_top::@4: scope:[irq_screen_top] from irq_screen_top::@11 irq_screen_top::@3 + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER + *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + *HARDWARE_IRQ = &irq_screen_top + to:irq_screen_top::@return +irq_screen_top::@return: scope:[irq_screen_top] from irq_screen_top::@4 + return + to:@return + +void game_logic() +game_logic: scope:[game_logic] from irq_screen_top::@6 + game_logic::$0 = game_playable == 0 + game_logic::$1 = ! game_logic::$0 + if(game_logic::$1) goto game_logic::@1 + to:game_logic::@return +game_logic::@1: scope:[game_logic] from game_logic + game_logic::$2 = game_logic_substep + 1 + game_logic::$3 = game_logic::$2 & 7 + game_logic_substep = game_logic::$3 + game_logic::$4 = game_logic_substep == 0 + if(game_logic::$4) goto game_logic::@2 + to:game_logic::@8 +game_logic::@return: scope:[game_logic] from game_logic game_logic::@100 game_logic::@105 game_logic::@106 game_logic::@107 game_logic::@108 game_logic::@114 game_logic::@115 game_logic::@118 game_logic::@123 game_logic::@124 game_logic::@125 game_logic::@126 game_logic::@13 game_logic::@132 game_logic::@133 game_logic::@136 game_logic::@141 game_logic::@142 game_logic::@143 game_logic::@149 game_logic::@150 game_logic::@154 game_logic::@155 game_logic::@156 game_logic::@157 game_logic::@158 game_logic::@159 game_logic::@161 game_logic::@163 game_logic::@165 game_logic::@167 game_logic::@44 game_logic::@54 game_logic::@55 game_logic::@56 game_logic::@57 game_logic::@66 game_logic::@72 game_logic::@78 game_logic::@79 game_logic::@82 game_logic::@87 game_logic::@88 game_logic::@89 game_logic::@90 game_logic::@96 game_logic::@97 + return + to:@return +game_logic::@2: scope:[game_logic] from game_logic::@1 + game_logic::$188 = pacman_direction == RIGHT + if(game_logic::$188) goto game_logic::@144 + to:game_logic::@40 +game_logic::@8: scope:[game_logic] from game_logic::@1 + game_logic::$5 = game_logic_substep == 1 + if(game_logic::$5) goto game_logic::@3 + to:game_logic::@9 +game_logic::@3: scope:[game_logic] from game_logic::@8 + game_logic::$211 = 0 != ghost1_respawn + if(game_logic::$211) goto game_logic::@126 + to:game_logic::@35 +game_logic::@9: scope:[game_logic] from game_logic::@8 + game_logic::$6 = game_logic_substep == 2 + if(game_logic::$6) goto game_logic::@4 + to:game_logic::@10 +game_logic::@4: scope:[game_logic] from game_logic::@9 + game_logic::$212 = 0 != ghost2_respawn + if(game_logic::$212) goto game_logic::@108 + to:game_logic::@30 +game_logic::@10: scope:[game_logic] from game_logic::@9 + game_logic::$7 = game_logic_substep == 4 + if(game_logic::$7) goto game_logic::@5 + to:game_logic::@11 +game_logic::@5: scope:[game_logic] from game_logic::@10 + game_logic::$213 = 0 != ghost3_respawn + if(game_logic::$213) goto game_logic::@90 + to:game_logic::@25 +game_logic::@11: scope:[game_logic] from game_logic::@10 + game_logic::$8 = game_logic_substep == 5 + if(game_logic::$8) goto game_logic::@6 + to:game_logic::@12 +game_logic::@6: scope:[game_logic] from game_logic::@11 + game_logic::$214 = 0 != ghost4_respawn + if(game_logic::$214) goto game_logic::@72 + to:game_logic::@20 +game_logic::@12: scope:[game_logic] from game_logic::@11 + game_logic::$9 = game_logic_substep == 6 + if(game_logic::$9) goto game_logic::@7 + to:game_logic::@13 +game_logic::@7: scope:[game_logic] from game_logic::@12 + ghosts_mode_count = ++ ghosts_mode_count + game_logic::do_reverse#0 = 0 + game_logic::$48 = ghosts_mode == SCATTER + if(game_logic::$48) goto game_logic::@45 + to:game_logic::@16 +game_logic::@13: scope:[game_logic] from game_logic::@12 + game_logic::$10 = game_logic_substep == 3 + game_logic::$11 = game_logic_substep == 7 + game_logic::$12 = game_logic::$10 || game_logic::$11 + game_logic::$13 = ! game_logic::$12 + if(game_logic::$13) goto game_logic::@return + to:game_logic::@14 +game_logic::@14: scope:[game_logic] from game_logic::@13 + game_logic::$14 = anim_frame_idx + 1 + game_logic::$15 = game_logic::$14 & 3 + anim_frame_idx = game_logic::$15 + game_logic::$16 = pacman_xfine - 1 + game_logic::pacman_bob_xfine#0 = game_logic::$16 + game_logic::$17 = game_logic::pacman_bob_xfine#0 / 4 + bobs_xcol[0] = game_logic::$17 + game_logic::$18 = pacman_yfine - 1 + bobs_yfine[0] = game_logic::$18 + game_logic::$19 = pacman_direction | anim_frame_idx + game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 + game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 + bobs_bob_id[0] = game_logic::$21 + game_logic::ghost_frame_idx#0 = anim_frame_idx + game_logic::$22 = ghosts_mode == FRIGHTENED + game_logic::$23 = ! game_logic::$22 + if(game_logic::$23) goto game_logic::@44 + to:game_logic::@15 +game_logic::@44: scope:[game_logic] from game_logic::@14 game_logic::@15 + game_logic::ghost_frame_idx#2 = phi( game_logic::@14/game_logic::ghost_frame_idx#0, game_logic::@15/game_logic::ghost_frame_idx#1 ) + game_logic::$24 = ghost1_xfine - 1 + game_logic::ghost1_bob_xfine#0 = game_logic::$24 + game_logic::$25 = game_logic::ghost1_bob_xfine#0 / 4 + bobs_xcol[1] = game_logic::$25 + game_logic::$26 = ghost1_yfine - 1 + bobs_yfine[1] = game_logic::$26 + game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 + game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 + game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 + bobs_bob_id[1] = game_logic::$29 + game_logic::$30 = ghost2_xfine - 1 + game_logic::ghost2_bob_xfine#0 = game_logic::$30 + game_logic::$31 = game_logic::ghost2_bob_xfine#0 / 4 + bobs_xcol[2] = game_logic::$31 + game_logic::$32 = ghost2_yfine - 1 + bobs_yfine[2] = game_logic::$32 + game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 + game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 + game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 + bobs_bob_id[2] = game_logic::$35 + game_logic::$36 = ghost3_xfine - 1 + game_logic::ghost3_bob_xfine#0 = game_logic::$36 + game_logic::$37 = game_logic::ghost3_bob_xfine#0 / 4 + bobs_xcol[3] = game_logic::$37 + game_logic::$38 = ghost3_yfine - 1 + bobs_yfine[3] = game_logic::$38 + game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 + game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 + game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 + bobs_bob_id[3] = game_logic::$41 + game_logic::$42 = ghost4_xfine - 1 + game_logic::ghost4_bob_xfine#0 = game_logic::$42 + game_logic::$43 = game_logic::ghost4_bob_xfine#0 / 4 + bobs_xcol[4] = game_logic::$43 + game_logic::$44 = ghost4_yfine - 1 + bobs_yfine[4] = game_logic::$44 + game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 + game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 + game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 + bobs_bob_id[4] = game_logic::$47 + to:game_logic::@return +game_logic::@15: scope:[game_logic] from game_logic::@14 + game_logic::ghost_frame_idx#3 = phi( game_logic::@14/game_logic::ghost_frame_idx#0 ) + game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#3 | $40 + to:game_logic::@44 +game_logic::@45: scope:[game_logic] from game_logic::@7 + game_logic::do_reverse#7 = phi( game_logic::@7/game_logic::do_reverse#0 ) + game_logic::$56 = ghosts_mode_count > $32 + game_logic::$57 = ! game_logic::$56 + if(game_logic::$57) goto game_logic::@47 + to:game_logic::@59 +game_logic::@16: scope:[game_logic] from game_logic::@7 + game_logic::do_reverse#9 = phi( game_logic::@7/game_logic::do_reverse#0 ) + game_logic::$49 = ghosts_mode == CHASE + if(game_logic::$49) goto game_logic::@46 + to:game_logic::@17 +game_logic::@46: scope:[game_logic] from game_logic::@16 + game_logic::do_reverse#8 = phi( game_logic::@16/game_logic::do_reverse#9 ) + game_logic::$54 = ghosts_mode_count > $96 + game_logic::$55 = ! game_logic::$54 + if(game_logic::$55) goto game_logic::@47 + to:game_logic::@58 +game_logic::@17: scope:[game_logic] from game_logic::@16 + game_logic::do_reverse#5 = phi( game_logic::@16/game_logic::do_reverse#9 ) + game_logic::$50 = ghosts_mode == FRIGHTENED + game_logic::$51 = ! game_logic::$50 + if(game_logic::$51) goto game_logic::@47 + to:game_logic::@18 +game_logic::@18: scope:[game_logic] from game_logic::@17 + game_logic::do_reverse#6 = phi( game_logic::@17/game_logic::do_reverse#5 ) + game_logic::$52 = ghosts_mode_count > $32 + game_logic::$53 = ! game_logic::$52 + if(game_logic::$53) goto game_logic::@47 + to:game_logic::@19 +game_logic::@19: scope:[game_logic] from game_logic::@18 + ghosts_mode = CHASE + ghosts_mode_count = 0 + game_logic::do_reverse#1 = 1 + to:game_logic::@47 +game_logic::@58: scope:[game_logic] from game_logic::@46 + ghosts_mode = SCATTER + ghosts_mode_count = 0 + game_logic::do_reverse#2 = 1 + to:game_logic::@47 +game_logic::@47: scope:[game_logic] from game_logic::@17 game_logic::@18 game_logic::@19 game_logic::@45 game_logic::@46 game_logic::@58 game_logic::@59 + game_logic::do_reverse#4 = phi( game_logic::@17/game_logic::do_reverse#5, game_logic::@18/game_logic::do_reverse#6, game_logic::@19/game_logic::do_reverse#1, game_logic::@45/game_logic::do_reverse#7, game_logic::@46/game_logic::do_reverse#8, game_logic::@58/game_logic::do_reverse#2, game_logic::@59/game_logic::do_reverse#3 ) + game_logic::$219 = 0 != game_logic::do_reverse#4 + game_logic::$58 = ! game_logic::$219 + if(game_logic::$58) goto game_logic::@48 + to:game_logic::@60 +game_logic::@59: scope:[game_logic] from game_logic::@45 + ghosts_mode = CHASE + ghosts_mode_count = 0 + game_logic::do_reverse#3 = 1 + to:game_logic::@47 +game_logic::@48: scope:[game_logic] from game_logic::@47 game_logic::@60 + game_logic::$59 = pacman_xfine / 2 + game_logic::pacman_xtile#0 = game_logic::$59 + game_logic::$60 = pacman_yfine / 2 + game_logic::pacman_ytile#0 = game_logic::$60 + game_logic::$210 = game_logic::pacman_ytile#0 * SIZEOF_WORD + game_logic::$61 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] + game_logic::ytiles#0 = game_logic::$61 + game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] + game_logic::$62 = TILES_TYPE[game_logic::tile_id#0] == PILL + if(game_logic::$62) goto game_logic::@49 + to:game_logic::@61 +game_logic::@60: scope:[game_logic] from game_logic::@47 + ghost1_reverse = 1 + ghost2_reverse = 1 + ghost3_reverse = 1 + ghost4_reverse = 1 + to:game_logic::@48 +game_logic::@49: scope:[game_logic] from game_logic::@48 + game_logic::pacman_ytile#1 = phi( game_logic::@48/game_logic::pacman_ytile#0 ) + game_logic::pacman_xtile#1 = phi( game_logic::@48/game_logic::pacman_xtile#0 ) + game_logic::ytiles#1 = phi( game_logic::@48/game_logic::ytiles#0 ) + game_logic::ytiles#1[game_logic::pacman_xtile#1] = EMPTY + game_logic::$69 = game_logic::pacman_xtile#1 / 2 + logic_tile_xcol = game_logic::$69 + game_logic::$70 = game_logic::pacman_xtile#1 & $fe + game_logic::$71 = game_logic::ytiles#1 + game_logic::$70 + logic_tile_ptr = game_logic::$71 + game_logic::$72 = game_logic::pacman_ytile#1 * 2 + logic_tile_yfine = game_logic::$72 + pill_count = -- pill_count + game_logic::$73 = pill_count == 0 + game_logic::$74 = ! game_logic::$73 + if(game_logic::$74) goto game_logic::@50 + to:game_logic::@63 +game_logic::@61: scope:[game_logic] from game_logic::@48 + game_logic::pacman_ytile#3 = phi( game_logic::@48/game_logic::pacman_ytile#0 ) + game_logic::pacman_xtile#3 = phi( game_logic::@48/game_logic::pacman_xtile#0 ) + game_logic::ytiles#3 = phi( game_logic::@48/game_logic::ytiles#0 ) + game_logic::tile_id#1 = phi( game_logic::@48/game_logic::tile_id#0 ) + game_logic::$63 = TILES_TYPE[game_logic::tile_id#1] == POWERUP + game_logic::$64 = ! game_logic::$63 + if(game_logic::$64) goto game_logic::@50 + to:game_logic::@62 +game_logic::@62: scope:[game_logic] from game_logic::@61 + game_logic::pacman_ytile#2 = phi( game_logic::@61/game_logic::pacman_ytile#3 ) + game_logic::pacman_xtile#2 = phi( game_logic::@61/game_logic::pacman_xtile#3 ) + game_logic::ytiles#2 = phi( game_logic::@61/game_logic::ytiles#3 ) + game_logic::ytiles#2[game_logic::pacman_xtile#2] = EMPTY + game_logic::$65 = game_logic::pacman_xtile#2 / 2 + logic_tile_xcol = game_logic::$65 + game_logic::$66 = game_logic::pacman_xtile#2 & $fe + game_logic::$67 = game_logic::ytiles#2 + game_logic::$66 + logic_tile_ptr = game_logic::$67 + game_logic::$68 = game_logic::pacman_ytile#2 * 2 + logic_tile_yfine = game_logic::$68 + ghosts_mode = FRIGHTENED + ghosts_mode_count = 0 + to:game_logic::@50 +game_logic::@50: scope:[game_logic] from game_logic::@49 game_logic::@61 game_logic::@62 game_logic::@63 + game_logic::$75 = pacman_xfine - ghost1_xfine + game_logic::$76 = ABS[game_logic::$75] < 2 + game_logic::$77 = pacman_yfine - ghost1_yfine + game_logic::$78 = ABS[game_logic::$77] < 2 + game_logic::$79 = game_logic::$76 && game_logic::$78 + if(game_logic::$79) goto game_logic::@51 + to:game_logic::@64 +game_logic::@63: scope:[game_logic] from game_logic::@49 + pacman_wins = 1 + to:game_logic::@50 +game_logic::@51: scope:[game_logic] from game_logic::@50 + game_logic::$102 = ghosts_mode == FRIGHTENED + if(game_logic::$102) goto game_logic::@57 + to:game_logic::@71 +game_logic::@64: scope:[game_logic] from game_logic::@50 + game_logic::$80 = pacman_xfine - ghost2_xfine + game_logic::$81 = ABS[game_logic::$80] < 2 + game_logic::$82 = pacman_yfine - ghost2_yfine + game_logic::$83 = ABS[game_logic::$82] < 2 + game_logic::$84 = game_logic::$81 && game_logic::$83 + if(game_logic::$84) goto game_logic::@52 + to:game_logic::@65 +game_logic::@52: scope:[game_logic] from game_logic::@64 + game_logic::$100 = ghosts_mode == FRIGHTENED + if(game_logic::$100) goto game_logic::@56 + to:game_logic::@70 +game_logic::@65: scope:[game_logic] from game_logic::@64 + game_logic::$85 = pacman_xfine - ghost3_xfine + game_logic::$86 = ABS[game_logic::$85] < 2 + game_logic::$87 = pacman_yfine - ghost3_yfine + game_logic::$88 = ABS[game_logic::$87] < 2 + game_logic::$89 = game_logic::$86 && game_logic::$88 + if(game_logic::$89) goto game_logic::@53 + to:game_logic::@66 +game_logic::@53: scope:[game_logic] from game_logic::@65 + game_logic::$98 = ghosts_mode == FRIGHTENED + if(game_logic::$98) goto game_logic::@55 + to:game_logic::@69 +game_logic::@66: scope:[game_logic] from game_logic::@65 + game_logic::$90 = pacman_xfine - ghost4_xfine + game_logic::$91 = ABS[game_logic::$90] < 2 + game_logic::$92 = pacman_yfine - ghost4_yfine + game_logic::$93 = ABS[game_logic::$92] < 2 + game_logic::$94 = game_logic::$91 && game_logic::$93 + game_logic::$95 = ! game_logic::$94 + if(game_logic::$95) goto game_logic::@return + to:game_logic::@67 +game_logic::@67: scope:[game_logic] from game_logic::@66 + game_logic::$96 = ghosts_mode == FRIGHTENED + if(game_logic::$96) goto game_logic::@54 + to:game_logic::@68 +game_logic::@54: scope:[game_logic] from game_logic::@67 + ghost4_direction = STOP + ghost4_xfine = $32 + ghost4_yfine = $23 + ghost4_substep = 0 + ghost4_respawn = $32 + to:game_logic::@return +game_logic::@68: scope:[game_logic] from game_logic::@67 + pacman_lives = -- pacman_lives + call spawn_all + to:game_logic::@156 +game_logic::@156: scope:[game_logic] from game_logic::@68 + to:game_logic::@return +game_logic::@55: scope:[game_logic] from game_logic::@53 + ghost3_direction = STOP + ghost3_xfine = $32 + ghost3_yfine = $23 + ghost3_substep = 0 + ghost3_respawn = $32 + to:game_logic::@return +game_logic::@69: scope:[game_logic] from game_logic::@53 + pacman_lives = -- pacman_lives + call spawn_all + to:game_logic::@157 +game_logic::@157: scope:[game_logic] from game_logic::@69 + to:game_logic::@return +game_logic::@56: scope:[game_logic] from game_logic::@52 + ghost2_direction = STOP + ghost2_xfine = $32 + ghost2_yfine = $23 + ghost2_substep = 0 + ghost2_respawn = $32 + to:game_logic::@return +game_logic::@70: scope:[game_logic] from game_logic::@52 + pacman_lives = -- pacman_lives + call spawn_all + to:game_logic::@158 +game_logic::@158: scope:[game_logic] from game_logic::@70 + to:game_logic::@return +game_logic::@57: scope:[game_logic] from game_logic::@51 + ghost1_direction = STOP + ghost1_xfine = $32 + ghost1_yfine = $23 + ghost1_substep = 0 + ghost1_respawn = $32 + to:game_logic::@return +game_logic::@71: scope:[game_logic] from game_logic::@51 + pacman_lives = -- pacman_lives + call spawn_all + to:game_logic::@159 +game_logic::@159: scope:[game_logic] from game_logic::@71 + to:game_logic::@return +game_logic::@72: scope:[game_logic] from game_logic::@6 + ghost4_respawn = -- ghost4_respawn + game_logic::$123 = ghost4_respawn == 0 + game_logic::$124 = ! game_logic::$123 + if(game_logic::$124) goto game_logic::@return + to:game_logic::@89 +game_logic::@20: scope:[game_logic] from game_logic::@6 + game_logic::$104 = ghost4_direction == RIGHT + if(game_logic::$104) goto game_logic::@73 + to:game_logic::@21 +game_logic::@73: scope:[game_logic] from game_logic::@20 + ghost4_xfine = ++ ghost4_xfine + to:game_logic::@76 +game_logic::@21: scope:[game_logic] from game_logic::@20 + game_logic::$105 = ghost4_direction == DOWN + if(game_logic::$105) goto game_logic::@74 + to:game_logic::@22 +game_logic::@74: scope:[game_logic] from game_logic::@21 + ghost4_yfine = ++ ghost4_yfine + to:game_logic::@76 +game_logic::@22: scope:[game_logic] from game_logic::@21 + game_logic::$106 = ghost4_direction == LEFT + if(game_logic::$106) goto game_logic::@75 + to:game_logic::@23 +game_logic::@75: scope:[game_logic] from game_logic::@22 + ghost4_xfine = -- ghost4_xfine + to:game_logic::@76 +game_logic::@23: scope:[game_logic] from game_logic::@22 + game_logic::$107 = ghost4_direction == UP + game_logic::$108 = ! game_logic::$107 + if(game_logic::$108) goto game_logic::@76 + to:game_logic::@24 +game_logic::@24: scope:[game_logic] from game_logic::@23 + ghost4_yfine = -- ghost4_yfine + to:game_logic::@76 +game_logic::@76: scope:[game_logic] from game_logic::@23 game_logic::@24 game_logic::@73 game_logic::@74 game_logic::@75 + game_logic::$109 = ghost4_substep == 0 + game_logic::$110 = ghost4_direction != STOP + game_logic::$111 = game_logic::$109 && game_logic::$110 + if(game_logic::$111) goto game_logic::@77 + to:game_logic::@83 +game_logic::@77: scope:[game_logic] from game_logic::@76 + ghost4_substep = 1 + game_logic::$120 = ghost4_xfine == 1 + if(game_logic::$120) goto game_logic::@82 + to:game_logic::@87 +game_logic::@83: scope:[game_logic] from game_logic::@76 + ghost4_substep = 0 + game_logic::$215 = 0 != ghost4_reverse + if(game_logic::$215) goto game_logic::@78 + to:game_logic::@84 +game_logic::@78: scope:[game_logic] from game_logic::@83 + ghost4_direction = DIRECTION_REVERSE[ghost4_direction] + ghost4_reverse = 0 + to:game_logic::@return +game_logic::@84: scope:[game_logic] from game_logic::@83 + game_logic::$112 = ghost4_xfine / 2 + game_logic::ghost4_xtile#0 = game_logic::$112 + game_logic::$113 = ghost4_yfine / 2 + game_logic::ghost4_ytile#0 = game_logic::$113 + level_tile_directions::xtile#0 = game_logic::ghost4_xtile#0 + level_tile_directions::ytile#0 = game_logic::ghost4_ytile#0 + call level_tile_directions + level_tile_directions::return#3 = level_tile_directions::return#2 + to:game_logic::@160 +game_logic::@160: scope:[game_logic] from game_logic::@84 + game_logic::ghost4_ytile#5 = phi( game_logic::@84/game_logic::ghost4_ytile#0 ) + game_logic::ghost4_xtile#5 = phi( game_logic::@84/game_logic::ghost4_xtile#0 ) + level_tile_directions::return#9 = phi( game_logic::@84/level_tile_directions::return#3 ) + game_logic::$114 = level_tile_directions::return#9 + game_logic::open_directions#0 = game_logic::$114 + game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] + game_logic::$115 = ghosts_mode == FRIGHTENED + if(game_logic::$115) goto game_logic::@79 + to:game_logic::@85 +game_logic::@79: scope:[game_logic] from game_logic::@160 + game_logic::open_directions#2 = phi( game_logic::@160/game_logic::open_directions#1 ) + ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#2] + to:game_logic::@return +game_logic::@85: scope:[game_logic] from game_logic::@160 + game_logic::ghost4_ytile#4 = phi( game_logic::@160/game_logic::ghost4_ytile#5 ) + game_logic::ghost4_xtile#4 = phi( game_logic::@160/game_logic::ghost4_xtile#5 ) + game_logic::open_directions#6 = phi( game_logic::@160/game_logic::open_directions#1 ) + game_logic::target_xtile#0 = 0 + game_logic::target_ytile#0 = 0 + game_logic::$116 = ghosts_mode == SCATTER + if(game_logic::$116) goto game_logic::@80 + to:game_logic::@86 +game_logic::@80: scope:[game_logic] from game_logic::@85 + game_logic::ghost4_ytile#2 = phi( game_logic::@85/game_logic::ghost4_ytile#4 ) + game_logic::ghost4_xtile#2 = phi( game_logic::@85/game_logic::ghost4_xtile#4 ) + game_logic::open_directions#4 = phi( game_logic::@85/game_logic::open_directions#6 ) + game_logic::target_xtile#1 = 2 + game_logic::target_ytile#1 = 2 + to:game_logic::@81 +game_logic::@86: scope:[game_logic] from game_logic::@85 + game_logic::ghost4_ytile#3 = phi( game_logic::@85/game_logic::ghost4_ytile#4 ) + game_logic::ghost4_xtile#3 = phi( game_logic::@85/game_logic::ghost4_xtile#4 ) + game_logic::open_directions#5 = phi( game_logic::@85/game_logic::open_directions#6 ) + game_logic::$117 = pacman_xfine / 2 + game_logic::target_xtile#2 = game_logic::$117 + game_logic::$118 = pacman_yfine / 2 + game_logic::target_ytile#2 = game_logic::$118 + to:game_logic::@81 +game_logic::@81: scope:[game_logic] from game_logic::@80 game_logic::@86 + game_logic::target_ytile#3 = phi( game_logic::@80/game_logic::target_ytile#1, game_logic::@86/game_logic::target_ytile#2 ) + game_logic::target_xtile#3 = phi( game_logic::@80/game_logic::target_xtile#1, game_logic::@86/game_logic::target_xtile#2 ) + game_logic::ghost4_ytile#1 = phi( game_logic::@80/game_logic::ghost4_ytile#2, game_logic::@86/game_logic::ghost4_ytile#3 ) + game_logic::ghost4_xtile#1 = phi( game_logic::@80/game_logic::ghost4_xtile#2, game_logic::@86/game_logic::ghost4_xtile#3 ) + game_logic::open_directions#3 = phi( game_logic::@80/game_logic::open_directions#4, game_logic::@86/game_logic::open_directions#5 ) + choose_direction::open_directions#0 = game_logic::open_directions#3 + choose_direction::ghost_xtile#0 = game_logic::ghost4_xtile#1 + choose_direction::ghost_ytile#0 = game_logic::ghost4_ytile#1 + choose_direction::target_xtile#0 = game_logic::target_xtile#3 + choose_direction::target_ytile#0 = game_logic::target_ytile#3 + call choose_direction + choose_direction::return#0 = choose_direction::return#5 + to:game_logic::@161 +game_logic::@161: scope:[game_logic] from game_logic::@81 + choose_direction::return#6 = phi( game_logic::@81/choose_direction::return#0 ) + game_logic::$119 = choose_direction::return#6 + ghost4_direction = game_logic::$119 + to:game_logic::@return +game_logic::@82: scope:[game_logic] from game_logic::@77 + ghost4_xfine = $61 + to:game_logic::@return +game_logic::@87: scope:[game_logic] from game_logic::@77 + game_logic::$121 = ghost4_xfine == $61 + game_logic::$122 = ! game_logic::$121 + if(game_logic::$122) goto game_logic::@return + to:game_logic::@88 +game_logic::@88: scope:[game_logic] from game_logic::@87 + ghost4_xfine = 1 + to:game_logic::@return +game_logic::@89: scope:[game_logic] from game_logic::@72 + ghost4_direction = RIGHT + ghost4_xfine = 2 + ghost4_yfine = 2 + ghost4_substep = 0 + to:game_logic::@return +game_logic::@90: scope:[game_logic] from game_logic::@5 + ghost3_respawn = -- ghost3_respawn + game_logic::$144 = ghost3_respawn == 0 + game_logic::$145 = ! game_logic::$144 + if(game_logic::$145) goto game_logic::@return + to:game_logic::@107 +game_logic::@25: scope:[game_logic] from game_logic::@5 + game_logic::$125 = ghost3_direction == RIGHT + if(game_logic::$125) goto game_logic::@91 + to:game_logic::@26 +game_logic::@91: scope:[game_logic] from game_logic::@25 + ghost3_xfine = ++ ghost3_xfine + to:game_logic::@94 +game_logic::@26: scope:[game_logic] from game_logic::@25 + game_logic::$126 = ghost3_direction == DOWN + if(game_logic::$126) goto game_logic::@92 + to:game_logic::@27 +game_logic::@92: scope:[game_logic] from game_logic::@26 + ghost3_yfine = ++ ghost3_yfine + to:game_logic::@94 +game_logic::@27: scope:[game_logic] from game_logic::@26 + game_logic::$127 = ghost3_direction == LEFT + if(game_logic::$127) goto game_logic::@93 + to:game_logic::@28 +game_logic::@93: scope:[game_logic] from game_logic::@27 + ghost3_xfine = -- ghost3_xfine + to:game_logic::@94 +game_logic::@28: scope:[game_logic] from game_logic::@27 + game_logic::$128 = ghost3_direction == UP + game_logic::$129 = ! game_logic::$128 + if(game_logic::$129) goto game_logic::@94 + to:game_logic::@29 +game_logic::@29: scope:[game_logic] from game_logic::@28 + ghost3_yfine = -- ghost3_yfine + to:game_logic::@94 +game_logic::@94: scope:[game_logic] from game_logic::@28 game_logic::@29 game_logic::@91 game_logic::@92 game_logic::@93 + game_logic::$130 = ghost3_substep == 0 + game_logic::$131 = ghost3_direction != STOP + game_logic::$132 = game_logic::$130 && game_logic::$131 + if(game_logic::$132) goto game_logic::@95 + to:game_logic::@101 +game_logic::@95: scope:[game_logic] from game_logic::@94 + ghost3_substep = 1 + game_logic::$141 = ghost3_xfine == 1 + if(game_logic::$141) goto game_logic::@100 + to:game_logic::@105 +game_logic::@101: scope:[game_logic] from game_logic::@94 + ghost3_substep = 0 + game_logic::$216 = 0 != ghost3_reverse + if(game_logic::$216) goto game_logic::@96 + to:game_logic::@102 +game_logic::@96: scope:[game_logic] from game_logic::@101 + ghost3_direction = DIRECTION_REVERSE[ghost3_direction] + ghost3_reverse = 0 + to:game_logic::@return +game_logic::@102: scope:[game_logic] from game_logic::@101 + game_logic::$133 = ghost3_xfine / 2 + game_logic::ghost3_xtile#0 = game_logic::$133 + game_logic::$134 = ghost3_yfine / 2 + game_logic::ghost3_ytile#0 = game_logic::$134 + level_tile_directions::xtile#1 = game_logic::ghost3_xtile#0 + level_tile_directions::ytile#1 = game_logic::ghost3_ytile#0 + call level_tile_directions + level_tile_directions::return#4 = level_tile_directions::return#2 + to:game_logic::@162 +game_logic::@162: scope:[game_logic] from game_logic::@102 + game_logic::ghost3_ytile#5 = phi( game_logic::@102/game_logic::ghost3_ytile#0 ) + game_logic::ghost3_xtile#5 = phi( game_logic::@102/game_logic::ghost3_xtile#0 ) + level_tile_directions::return#10 = phi( game_logic::@102/level_tile_directions::return#4 ) + game_logic::$135 = level_tile_directions::return#10 + game_logic::open_directions1#0 = game_logic::$135 + game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] + game_logic::$136 = ghosts_mode == FRIGHTENED + if(game_logic::$136) goto game_logic::@97 + to:game_logic::@103 +game_logic::@97: scope:[game_logic] from game_logic::@162 + game_logic::open_directions1#2 = phi( game_logic::@162/game_logic::open_directions1#1 ) + ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#2] + to:game_logic::@return +game_logic::@103: scope:[game_logic] from game_logic::@162 + game_logic::ghost3_ytile#4 = phi( game_logic::@162/game_logic::ghost3_ytile#5 ) + game_logic::ghost3_xtile#4 = phi( game_logic::@162/game_logic::ghost3_xtile#5 ) + game_logic::open_directions1#6 = phi( game_logic::@162/game_logic::open_directions1#1 ) + game_logic::target_xtile1#0 = 0 + game_logic::target_ytile1#0 = 0 + game_logic::$137 = ghosts_mode == SCATTER + if(game_logic::$137) goto game_logic::@98 + to:game_logic::@104 +game_logic::@98: scope:[game_logic] from game_logic::@103 + game_logic::ghost3_ytile#3 = phi( game_logic::@103/game_logic::ghost3_ytile#4 ) + game_logic::ghost3_xtile#3 = phi( game_logic::@103/game_logic::ghost3_xtile#4 ) + game_logic::open_directions1#5 = phi( game_logic::@103/game_logic::open_directions1#6 ) + game_logic::target_xtile1#1 = 2 + game_logic::target_ytile1#1 = 2 + to:game_logic::@99 +game_logic::@104: scope:[game_logic] from game_logic::@103 + game_logic::ghost3_ytile#2 = phi( game_logic::@103/game_logic::ghost3_ytile#4 ) + game_logic::ghost3_xtile#2 = phi( game_logic::@103/game_logic::ghost3_xtile#4 ) + game_logic::open_directions1#4 = phi( game_logic::@103/game_logic::open_directions1#6 ) + game_logic::$138 = pacman_xfine / 2 + game_logic::target_xtile1#2 = game_logic::$138 + game_logic::$139 = pacman_yfine / 2 + game_logic::target_ytile1#2 = game_logic::$139 + to:game_logic::@99 +game_logic::@99: scope:[game_logic] from game_logic::@104 game_logic::@98 + game_logic::target_ytile1#3 = phi( game_logic::@104/game_logic::target_ytile1#2, game_logic::@98/game_logic::target_ytile1#1 ) + game_logic::target_xtile1#3 = phi( game_logic::@104/game_logic::target_xtile1#2, game_logic::@98/game_logic::target_xtile1#1 ) + game_logic::ghost3_ytile#1 = phi( game_logic::@104/game_logic::ghost3_ytile#2, game_logic::@98/game_logic::ghost3_ytile#3 ) + game_logic::ghost3_xtile#1 = phi( game_logic::@104/game_logic::ghost3_xtile#2, game_logic::@98/game_logic::ghost3_xtile#3 ) + game_logic::open_directions1#3 = phi( game_logic::@104/game_logic::open_directions1#4, game_logic::@98/game_logic::open_directions1#5 ) + choose_direction::open_directions#1 = game_logic::open_directions1#3 + choose_direction::ghost_xtile#1 = game_logic::ghost3_xtile#1 + choose_direction::ghost_ytile#1 = game_logic::ghost3_ytile#1 + choose_direction::target_xtile#1 = game_logic::target_xtile1#3 + choose_direction::target_ytile#1 = game_logic::target_ytile1#3 + call choose_direction + choose_direction::return#1 = choose_direction::return#5 + to:game_logic::@163 +game_logic::@163: scope:[game_logic] from game_logic::@99 + choose_direction::return#7 = phi( game_logic::@99/choose_direction::return#1 ) + game_logic::$140 = choose_direction::return#7 + ghost3_direction = game_logic::$140 + to:game_logic::@return +game_logic::@100: scope:[game_logic] from game_logic::@95 + ghost3_xfine = $61 + to:game_logic::@return +game_logic::@105: scope:[game_logic] from game_logic::@95 + game_logic::$142 = ghost3_xfine == $61 + game_logic::$143 = ! game_logic::$142 + if(game_logic::$143) goto game_logic::@return + to:game_logic::@106 +game_logic::@106: scope:[game_logic] from game_logic::@105 + ghost3_xfine = 1 + to:game_logic::@return +game_logic::@107: scope:[game_logic] from game_logic::@90 + ghost3_direction = UP + ghost3_xfine = 2 + ghost3_yfine = $46 + ghost3_substep = 0 + to:game_logic::@return +game_logic::@108: scope:[game_logic] from game_logic::@4 + ghost2_respawn = -- ghost2_respawn + game_logic::$165 = ghost2_respawn == 0 + game_logic::$166 = ! game_logic::$165 + if(game_logic::$166) goto game_logic::@return + to:game_logic::@125 +game_logic::@30: scope:[game_logic] from game_logic::@4 + game_logic::$146 = ghost2_direction == RIGHT + if(game_logic::$146) goto game_logic::@109 + to:game_logic::@31 +game_logic::@109: scope:[game_logic] from game_logic::@30 + ghost2_xfine = ++ ghost2_xfine + to:game_logic::@112 +game_logic::@31: scope:[game_logic] from game_logic::@30 + game_logic::$147 = ghost2_direction == DOWN + if(game_logic::$147) goto game_logic::@110 + to:game_logic::@32 +game_logic::@110: scope:[game_logic] from game_logic::@31 + ghost2_yfine = ++ ghost2_yfine + to:game_logic::@112 +game_logic::@32: scope:[game_logic] from game_logic::@31 + game_logic::$148 = ghost2_direction == LEFT + if(game_logic::$148) goto game_logic::@111 + to:game_logic::@33 +game_logic::@111: scope:[game_logic] from game_logic::@32 + ghost2_xfine = -- ghost2_xfine + to:game_logic::@112 +game_logic::@33: scope:[game_logic] from game_logic::@32 + game_logic::$149 = ghost2_direction == UP + game_logic::$150 = ! game_logic::$149 + if(game_logic::$150) goto game_logic::@112 + to:game_logic::@34 +game_logic::@34: scope:[game_logic] from game_logic::@33 + ghost2_yfine = -- ghost2_yfine + to:game_logic::@112 +game_logic::@112: scope:[game_logic] from game_logic::@109 game_logic::@110 game_logic::@111 game_logic::@33 game_logic::@34 + game_logic::$151 = ghost2_substep == 0 + game_logic::$152 = ghost2_direction != STOP + game_logic::$153 = game_logic::$151 && game_logic::$152 + if(game_logic::$153) goto game_logic::@113 + to:game_logic::@119 +game_logic::@113: scope:[game_logic] from game_logic::@112 + ghost2_substep = 1 + game_logic::$162 = ghost2_xfine == 1 + if(game_logic::$162) goto game_logic::@118 + to:game_logic::@123 +game_logic::@119: scope:[game_logic] from game_logic::@112 + ghost2_substep = 0 + game_logic::$217 = 0 != ghost2_reverse + if(game_logic::$217) goto game_logic::@114 + to:game_logic::@120 +game_logic::@114: scope:[game_logic] from game_logic::@119 + ghost2_direction = DIRECTION_REVERSE[ghost2_direction] + ghost2_reverse = 0 + to:game_logic::@return +game_logic::@120: scope:[game_logic] from game_logic::@119 + game_logic::$154 = ghost2_xfine / 2 + game_logic::ghost2_xtile#0 = game_logic::$154 + game_logic::$155 = ghost2_yfine / 2 + game_logic::ghost2_ytile#0 = game_logic::$155 + level_tile_directions::xtile#2 = game_logic::ghost2_xtile#0 + level_tile_directions::ytile#2 = game_logic::ghost2_ytile#0 + call level_tile_directions + level_tile_directions::return#5 = level_tile_directions::return#2 + to:game_logic::@164 +game_logic::@164: scope:[game_logic] from game_logic::@120 + game_logic::ghost2_ytile#5 = phi( game_logic::@120/game_logic::ghost2_ytile#0 ) + game_logic::ghost2_xtile#5 = phi( game_logic::@120/game_logic::ghost2_xtile#0 ) + level_tile_directions::return#11 = phi( game_logic::@120/level_tile_directions::return#5 ) + game_logic::$156 = level_tile_directions::return#11 + game_logic::open_directions2#0 = game_logic::$156 + game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] + game_logic::$157 = ghosts_mode == FRIGHTENED + if(game_logic::$157) goto game_logic::@115 + to:game_logic::@121 +game_logic::@115: scope:[game_logic] from game_logic::@164 + game_logic::open_directions2#2 = phi( game_logic::@164/game_logic::open_directions2#1 ) + ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#2] + to:game_logic::@return +game_logic::@121: scope:[game_logic] from game_logic::@164 + game_logic::ghost2_ytile#4 = phi( game_logic::@164/game_logic::ghost2_ytile#5 ) + game_logic::ghost2_xtile#4 = phi( game_logic::@164/game_logic::ghost2_xtile#5 ) + game_logic::open_directions2#6 = phi( game_logic::@164/game_logic::open_directions2#1 ) + game_logic::target_xtile2#0 = 0 + game_logic::target_ytile2#0 = 0 + game_logic::$158 = ghosts_mode == SCATTER + if(game_logic::$158) goto game_logic::@116 + to:game_logic::@122 +game_logic::@116: scope:[game_logic] from game_logic::@121 + game_logic::ghost2_ytile#2 = phi( game_logic::@121/game_logic::ghost2_ytile#4 ) + game_logic::ghost2_xtile#2 = phi( game_logic::@121/game_logic::ghost2_xtile#4 ) + game_logic::open_directions2#4 = phi( game_logic::@121/game_logic::open_directions2#6 ) + game_logic::target_xtile2#1 = 2 + game_logic::target_ytile2#1 = 2 + to:game_logic::@117 +game_logic::@122: scope:[game_logic] from game_logic::@121 + game_logic::ghost2_ytile#3 = phi( game_logic::@121/game_logic::ghost2_ytile#4 ) + game_logic::ghost2_xtile#3 = phi( game_logic::@121/game_logic::ghost2_xtile#4 ) + game_logic::open_directions2#5 = phi( game_logic::@121/game_logic::open_directions2#6 ) + game_logic::$159 = pacman_xfine / 2 + game_logic::target_xtile2#2 = game_logic::$159 + game_logic::$160 = pacman_yfine / 2 + game_logic::target_ytile2#2 = game_logic::$160 + to:game_logic::@117 +game_logic::@117: scope:[game_logic] from game_logic::@116 game_logic::@122 + game_logic::target_ytile2#3 = phi( game_logic::@116/game_logic::target_ytile2#1, game_logic::@122/game_logic::target_ytile2#2 ) + game_logic::target_xtile2#3 = phi( game_logic::@116/game_logic::target_xtile2#1, game_logic::@122/game_logic::target_xtile2#2 ) + game_logic::ghost2_ytile#1 = phi( game_logic::@116/game_logic::ghost2_ytile#2, game_logic::@122/game_logic::ghost2_ytile#3 ) + game_logic::ghost2_xtile#1 = phi( game_logic::@116/game_logic::ghost2_xtile#2, game_logic::@122/game_logic::ghost2_xtile#3 ) + game_logic::open_directions2#3 = phi( game_logic::@116/game_logic::open_directions2#4, game_logic::@122/game_logic::open_directions2#5 ) + choose_direction::open_directions#2 = game_logic::open_directions2#3 + choose_direction::ghost_xtile#2 = game_logic::ghost2_xtile#1 + choose_direction::ghost_ytile#2 = game_logic::ghost2_ytile#1 + choose_direction::target_xtile#2 = game_logic::target_xtile2#3 + choose_direction::target_ytile#2 = game_logic::target_ytile2#3 + call choose_direction + choose_direction::return#2 = choose_direction::return#5 + to:game_logic::@165 +game_logic::@165: scope:[game_logic] from game_logic::@117 + choose_direction::return#8 = phi( game_logic::@117/choose_direction::return#2 ) + game_logic::$161 = choose_direction::return#8 + ghost2_direction = game_logic::$161 + to:game_logic::@return +game_logic::@118: scope:[game_logic] from game_logic::@113 + ghost2_xfine = $61 + to:game_logic::@return +game_logic::@123: scope:[game_logic] from game_logic::@113 + game_logic::$163 = ghost2_xfine == $61 + game_logic::$164 = ! game_logic::$163 + if(game_logic::$164) goto game_logic::@return + to:game_logic::@124 +game_logic::@124: scope:[game_logic] from game_logic::@123 + ghost2_xfine = 1 + to:game_logic::@return +game_logic::@125: scope:[game_logic] from game_logic::@108 + ghost2_direction = LEFT + ghost2_xfine = $60 + ghost2_yfine = $46 + ghost2_substep = 0 + to:game_logic::@return +game_logic::@126: scope:[game_logic] from game_logic::@3 + ghost1_respawn = -- ghost1_respawn + game_logic::$186 = ghost1_respawn == 0 + game_logic::$187 = ! game_logic::$186 + if(game_logic::$187) goto game_logic::@return + to:game_logic::@143 +game_logic::@35: scope:[game_logic] from game_logic::@3 + game_logic::$167 = ghost1_direction == RIGHT + if(game_logic::$167) goto game_logic::@127 + to:game_logic::@36 +game_logic::@127: scope:[game_logic] from game_logic::@35 + ghost1_xfine = ++ ghost1_xfine + to:game_logic::@130 +game_logic::@36: scope:[game_logic] from game_logic::@35 + game_logic::$168 = ghost1_direction == DOWN + if(game_logic::$168) goto game_logic::@128 + to:game_logic::@37 +game_logic::@128: scope:[game_logic] from game_logic::@36 + ghost1_yfine = ++ ghost1_yfine + to:game_logic::@130 +game_logic::@37: scope:[game_logic] from game_logic::@36 + game_logic::$169 = ghost1_direction == LEFT + if(game_logic::$169) goto game_logic::@129 + to:game_logic::@38 +game_logic::@129: scope:[game_logic] from game_logic::@37 + ghost1_xfine = -- ghost1_xfine + to:game_logic::@130 +game_logic::@38: scope:[game_logic] from game_logic::@37 + game_logic::$170 = ghost1_direction == UP + game_logic::$171 = ! game_logic::$170 + if(game_logic::$171) goto game_logic::@130 + to:game_logic::@39 +game_logic::@39: scope:[game_logic] from game_logic::@38 + ghost1_yfine = -- ghost1_yfine + to:game_logic::@130 +game_logic::@130: scope:[game_logic] from game_logic::@127 game_logic::@128 game_logic::@129 game_logic::@38 game_logic::@39 + game_logic::$172 = ghost1_substep == 0 + game_logic::$173 = ghost1_direction != STOP + game_logic::$174 = game_logic::$172 && game_logic::$173 + if(game_logic::$174) goto game_logic::@131 + to:game_logic::@137 +game_logic::@131: scope:[game_logic] from game_logic::@130 + ghost1_substep = 1 + game_logic::$183 = ghost1_xfine == 1 + if(game_logic::$183) goto game_logic::@136 + to:game_logic::@141 +game_logic::@137: scope:[game_logic] from game_logic::@130 + ghost1_substep = 0 + game_logic::$218 = 0 != ghost1_reverse + if(game_logic::$218) goto game_logic::@132 + to:game_logic::@138 +game_logic::@132: scope:[game_logic] from game_logic::@137 + ghost1_direction = DIRECTION_REVERSE[ghost1_direction] + ghost1_reverse = 0 + to:game_logic::@return +game_logic::@138: scope:[game_logic] from game_logic::@137 + game_logic::$175 = ghost1_xfine / 2 + game_logic::ghost1_xtile#0 = game_logic::$175 + game_logic::$176 = ghost1_yfine / 2 + game_logic::ghost1_ytile#0 = game_logic::$176 + level_tile_directions::xtile#3 = game_logic::ghost1_xtile#0 + level_tile_directions::ytile#3 = game_logic::ghost1_ytile#0 + call level_tile_directions + level_tile_directions::return#6 = level_tile_directions::return#2 + to:game_logic::@166 +game_logic::@166: scope:[game_logic] from game_logic::@138 + game_logic::ghost1_ytile#5 = phi( game_logic::@138/game_logic::ghost1_ytile#0 ) + game_logic::ghost1_xtile#5 = phi( game_logic::@138/game_logic::ghost1_xtile#0 ) + level_tile_directions::return#12 = phi( game_logic::@138/level_tile_directions::return#6 ) + game_logic::$177 = level_tile_directions::return#12 + game_logic::open_directions3#0 = game_logic::$177 + game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] + game_logic::$178 = ghosts_mode == FRIGHTENED + if(game_logic::$178) goto game_logic::@133 + to:game_logic::@139 +game_logic::@133: scope:[game_logic] from game_logic::@166 + game_logic::open_directions3#2 = phi( game_logic::@166/game_logic::open_directions3#1 ) + ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#2] + to:game_logic::@return +game_logic::@139: scope:[game_logic] from game_logic::@166 + game_logic::ghost1_ytile#4 = phi( game_logic::@166/game_logic::ghost1_ytile#5 ) + game_logic::ghost1_xtile#4 = phi( game_logic::@166/game_logic::ghost1_xtile#5 ) + game_logic::open_directions3#6 = phi( game_logic::@166/game_logic::open_directions3#1 ) + game_logic::target_xtile3#0 = 0 + game_logic::target_ytile3#0 = 0 + game_logic::$179 = ghosts_mode == SCATTER + if(game_logic::$179) goto game_logic::@134 + to:game_logic::@140 +game_logic::@134: scope:[game_logic] from game_logic::@139 + game_logic::ghost1_ytile#2 = phi( game_logic::@139/game_logic::ghost1_ytile#4 ) + game_logic::ghost1_xtile#2 = phi( game_logic::@139/game_logic::ghost1_xtile#4 ) + game_logic::open_directions3#4 = phi( game_logic::@139/game_logic::open_directions3#6 ) + game_logic::target_xtile3#1 = 2 + game_logic::target_ytile3#1 = 2 + to:game_logic::@135 +game_logic::@140: scope:[game_logic] from game_logic::@139 + game_logic::ghost1_ytile#3 = phi( game_logic::@139/game_logic::ghost1_ytile#4 ) + game_logic::ghost1_xtile#3 = phi( game_logic::@139/game_logic::ghost1_xtile#4 ) + game_logic::open_directions3#5 = phi( game_logic::@139/game_logic::open_directions3#6 ) + game_logic::$180 = pacman_xfine / 2 + game_logic::target_xtile3#2 = game_logic::$180 + game_logic::$181 = pacman_yfine / 2 + game_logic::target_ytile3#2 = game_logic::$181 + to:game_logic::@135 +game_logic::@135: scope:[game_logic] from game_logic::@134 game_logic::@140 + game_logic::target_ytile3#3 = phi( game_logic::@134/game_logic::target_ytile3#1, game_logic::@140/game_logic::target_ytile3#2 ) + game_logic::target_xtile3#3 = phi( game_logic::@134/game_logic::target_xtile3#1, game_logic::@140/game_logic::target_xtile3#2 ) + game_logic::ghost1_ytile#1 = phi( game_logic::@134/game_logic::ghost1_ytile#2, game_logic::@140/game_logic::ghost1_ytile#3 ) + game_logic::ghost1_xtile#1 = phi( game_logic::@134/game_logic::ghost1_xtile#2, game_logic::@140/game_logic::ghost1_xtile#3 ) + game_logic::open_directions3#3 = phi( game_logic::@134/game_logic::open_directions3#4, game_logic::@140/game_logic::open_directions3#5 ) + choose_direction::open_directions#3 = game_logic::open_directions3#3 + choose_direction::ghost_xtile#3 = game_logic::ghost1_xtile#1 + choose_direction::ghost_ytile#3 = game_logic::ghost1_ytile#1 + choose_direction::target_xtile#3 = game_logic::target_xtile3#3 + choose_direction::target_ytile#3 = game_logic::target_ytile3#3 + call choose_direction + choose_direction::return#3 = choose_direction::return#5 + to:game_logic::@167 +game_logic::@167: scope:[game_logic] from game_logic::@135 + choose_direction::return#9 = phi( game_logic::@135/choose_direction::return#3 ) + game_logic::$182 = choose_direction::return#9 + ghost1_direction = game_logic::$182 + to:game_logic::@return +game_logic::@136: scope:[game_logic] from game_logic::@131 + ghost1_xfine = $61 + to:game_logic::@return +game_logic::@141: scope:[game_logic] from game_logic::@131 + game_logic::$184 = ghost1_xfine == $61 + game_logic::$185 = ! game_logic::$184 + if(game_logic::$185) goto game_logic::@return + to:game_logic::@142 +game_logic::@142: scope:[game_logic] from game_logic::@141 + ghost1_xfine = 1 + to:game_logic::@return +game_logic::@143: scope:[game_logic] from game_logic::@126 + ghost1_direction = DOWN + ghost1_xfine = $60 + ghost1_yfine = 2 + ghost1_substep = 0 + to:game_logic::@return +game_logic::@144: scope:[game_logic] from game_logic::@2 + pacman_xfine = ++ pacman_xfine + to:game_logic::@147 +game_logic::@40: scope:[game_logic] from game_logic::@2 + game_logic::$189 = pacman_direction == DOWN + if(game_logic::$189) goto game_logic::@145 + to:game_logic::@41 +game_logic::@145: scope:[game_logic] from game_logic::@40 + pacman_yfine = ++ pacman_yfine + to:game_logic::@147 +game_logic::@41: scope:[game_logic] from game_logic::@40 + game_logic::$190 = pacman_direction == LEFT + if(game_logic::$190) goto game_logic::@146 + to:game_logic::@42 +game_logic::@146: scope:[game_logic] from game_logic::@41 + pacman_xfine = -- pacman_xfine + to:game_logic::@147 +game_logic::@42: scope:[game_logic] from game_logic::@41 + game_logic::$191 = pacman_direction == UP + game_logic::$192 = ! game_logic::$191 + if(game_logic::$192) goto game_logic::@147 + to:game_logic::@43 +game_logic::@43: scope:[game_logic] from game_logic::@42 + pacman_yfine = -- pacman_yfine + to:game_logic::@147 +game_logic::@147: scope:[game_logic] from game_logic::@144 game_logic::@145 game_logic::@146 game_logic::@42 game_logic::@43 + game_logic::$193 = pacman_substep == 0 + game_logic::$194 = pacman_direction != STOP + game_logic::$195 = game_logic::$193 && game_logic::$194 + if(game_logic::$195) goto game_logic::@148 + to:game_logic::@151 +game_logic::@148: scope:[game_logic] from game_logic::@147 + pacman_substep = 1 + pacman_ch1_enabled = 1 + game_logic::$207 = pacman_xfine == 1 + if(game_logic::$207) goto game_logic::@150 + to:game_logic::@154 +game_logic::@151: scope:[game_logic] from game_logic::@147 + pacman_substep = 0 + game_logic::$196 = pacman_xfine / 2 + game_logic::pacman_xtile1#0 = game_logic::$196 + game_logic::$197 = pacman_yfine / 2 + game_logic::pacman_ytile1#0 = game_logic::$197 + level_tile_directions::xtile#4 = game_logic::pacman_xtile1#0 + level_tile_directions::ytile#4 = game_logic::pacman_ytile1#0 + call level_tile_directions + level_tile_directions::return#7 = level_tile_directions::return#2 + to:game_logic::@168 +game_logic::@168: scope:[game_logic] from game_logic::@151 + level_tile_directions::return#13 = phi( game_logic::@151/level_tile_directions::return#7 ) + game_logic::$198 = level_tile_directions::return#13 + game_logic::open_directions4#0 = game_logic::$198 + game_logic::$199 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $f + game_logic::$200 = game_logic::$199 ^ $f + game_logic::$201 = game_logic::$200 * 4 + game_logic::joy_directions#0 = game_logic::$201 + game_logic::$202 = game_logic::joy_directions#0 != 0 + game_logic::$203 = ! game_logic::$202 + if(game_logic::$203) goto game_logic::@149 + to:game_logic::@152 +game_logic::@149: scope:[game_logic] from game_logic::@152 game_logic::@153 game_logic::@168 + game_logic::open_directions4#1 = phi( game_logic::@152/game_logic::open_directions4#2, game_logic::@153/game_logic::open_directions4#3, game_logic::@168/game_logic::open_directions4#0 ) + pacman_direction = pacman_direction & game_logic::open_directions4#1 + to:game_logic::@return +game_logic::@152: scope:[game_logic] from game_logic::@168 + game_logic::open_directions4#2 = phi( game_logic::@168/game_logic::open_directions4#0 ) + game_logic::joy_directions#1 = phi( game_logic::@168/game_logic::joy_directions#0 ) + game_logic::$204 = game_logic::joy_directions#1 & game_logic::open_directions4#2 + game_logic::new_direction#0 = DIRECTION_SINGLE[game_logic::$204] + game_logic::$205 = game_logic::new_direction#0 != 0 + game_logic::$206 = ! game_logic::$205 + if(game_logic::$206) goto game_logic::@149 + to:game_logic::@153 +game_logic::@153: scope:[game_logic] from game_logic::@152 + game_logic::open_directions4#3 = phi( game_logic::@152/game_logic::open_directions4#2 ) + game_logic::new_direction#1 = phi( game_logic::@152/game_logic::new_direction#0 ) + pacman_direction = game_logic::new_direction#1 + to:game_logic::@149 +game_logic::@150: scope:[game_logic] from game_logic::@148 + pacman_xfine = $61 + to:game_logic::@return +game_logic::@154: scope:[game_logic] from game_logic::@148 + game_logic::$208 = pacman_xfine == $61 + game_logic::$209 = ! game_logic::$208 + if(game_logic::$209) goto game_logic::@return + to:game_logic::@155 +game_logic::@155: scope:[game_logic] from game_logic::@154 + pacman_xfine = 1 + to:game_logic::@return + +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +choose_direction: scope:[choose_direction] from game_logic::@117 game_logic::@135 game_logic::@81 game_logic::@99 + choose_direction::open_directions#4 = phi( game_logic::@117/choose_direction::open_directions#2, game_logic::@135/choose_direction::open_directions#3, game_logic::@81/choose_direction::open_directions#0, game_logic::@99/choose_direction::open_directions#1 ) + choose_direction::target_ytile#4 = phi( game_logic::@117/choose_direction::target_ytile#2, game_logic::@135/choose_direction::target_ytile#3, game_logic::@81/choose_direction::target_ytile#0, game_logic::@99/choose_direction::target_ytile#1 ) + choose_direction::ghost_ytile#4 = phi( game_logic::@117/choose_direction::ghost_ytile#2, game_logic::@135/choose_direction::ghost_ytile#3, game_logic::@81/choose_direction::ghost_ytile#0, game_logic::@99/choose_direction::ghost_ytile#1 ) + choose_direction::target_xtile#4 = phi( game_logic::@117/choose_direction::target_xtile#2, game_logic::@135/choose_direction::target_xtile#3, game_logic::@81/choose_direction::target_xtile#0, game_logic::@99/choose_direction::target_xtile#1 ) + choose_direction::ghost_xtile#4 = phi( game_logic::@117/choose_direction::ghost_xtile#2, game_logic::@135/choose_direction::ghost_xtile#3, game_logic::@81/choose_direction::ghost_xtile#0, game_logic::@99/choose_direction::ghost_xtile#1 ) + choose_direction::$0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 + choose_direction::xdiff#0 = choose_direction::$0 + choose_direction::$1 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 + choose_direction::ydiff#0 = choose_direction::$1 + choose_direction::direction#0 = STOP + choose_direction::dist_min#0 = $ff + choose_direction::$2 = choose_direction::open_directions#4 & UP + choose_direction::$26 = 0 != choose_direction::$2 + choose_direction::$3 = ! choose_direction::$26 + if(choose_direction::$3) goto choose_direction::@1 + to:choose_direction::@5 +choose_direction::@1: scope:[choose_direction] from choose_direction choose_direction::@5 choose_direction::@6 + choose_direction::direction#10 = phi( choose_direction/choose_direction::direction#0, choose_direction::@5/choose_direction::direction#12, choose_direction::@6/choose_direction::direction#1 ) + choose_direction::dist_min#9 = phi( choose_direction/choose_direction::dist_min#0, choose_direction::@5/choose_direction::dist_min#5, choose_direction::@6/choose_direction::dist_min#1 ) + choose_direction::xdiff#5 = phi( choose_direction/choose_direction::xdiff#0, choose_direction::@5/choose_direction::xdiff#1, choose_direction::@6/choose_direction::xdiff#8 ) + choose_direction::ydiff#5 = phi( choose_direction/choose_direction::ydiff#0, choose_direction::@5/choose_direction::ydiff#1, choose_direction::@6/choose_direction::ydiff#8 ) + choose_direction::open_directions#5 = phi( choose_direction/choose_direction::open_directions#4, choose_direction::@5/choose_direction::open_directions#8, choose_direction::@6/choose_direction::open_directions#9 ) + choose_direction::$4 = choose_direction::open_directions#5 & DOWN + choose_direction::$27 = 0 != choose_direction::$4 + choose_direction::$5 = ! choose_direction::$27 + if(choose_direction::$5) goto choose_direction::@2 + to:choose_direction::@7 +choose_direction::@5: scope:[choose_direction] from choose_direction + choose_direction::direction#12 = phi( choose_direction/choose_direction::direction#0 ) + choose_direction::open_directions#8 = phi( choose_direction/choose_direction::open_directions#4 ) + choose_direction::dist_min#5 = phi( choose_direction/choose_direction::dist_min#0 ) + choose_direction::xdiff#1 = phi( choose_direction/choose_direction::xdiff#0 ) + choose_direction::ydiff#1 = phi( choose_direction/choose_direction::ydiff#0 ) + choose_direction::$10 = choose_direction::ydiff#1 - 1 + choose_direction::$11 = ABS[choose_direction::xdiff#1] + ABS[choose_direction::$10] + choose_direction::dist_up#0 = choose_direction::$11 + choose_direction::$12 = choose_direction::dist_up#0 < choose_direction::dist_min#5 + choose_direction::$13 = ! choose_direction::$12 + if(choose_direction::$13) goto choose_direction::@1 + to:choose_direction::@6 +choose_direction::@6: scope:[choose_direction] from choose_direction::@5 + choose_direction::xdiff#8 = phi( choose_direction::@5/choose_direction::xdiff#1 ) + choose_direction::ydiff#8 = phi( choose_direction::@5/choose_direction::ydiff#1 ) + choose_direction::open_directions#9 = phi( choose_direction::@5/choose_direction::open_directions#8 ) + choose_direction::dist_up#1 = phi( choose_direction::@5/choose_direction::dist_up#0 ) + choose_direction::direction#1 = UP + choose_direction::dist_min#1 = choose_direction::dist_up#1 + to:choose_direction::@1 +choose_direction::@2: scope:[choose_direction] from choose_direction::@1 choose_direction::@7 choose_direction::@8 + choose_direction::direction#8 = phi( choose_direction::@1/choose_direction::direction#10, choose_direction::@7/choose_direction::direction#11, choose_direction::@8/choose_direction::direction#2 ) + choose_direction::dist_min#10 = phi( choose_direction::@1/choose_direction::dist_min#9, choose_direction::@7/choose_direction::dist_min#6, choose_direction::@8/choose_direction::dist_min#2 ) + choose_direction::ydiff#6 = phi( choose_direction::@1/choose_direction::ydiff#5, choose_direction::@7/choose_direction::ydiff#2, choose_direction::@8/choose_direction::ydiff#9 ) + choose_direction::xdiff#6 = phi( choose_direction::@1/choose_direction::xdiff#5, choose_direction::@7/choose_direction::xdiff#2, choose_direction::@8/choose_direction::xdiff#9 ) + choose_direction::open_directions#6 = phi( choose_direction::@1/choose_direction::open_directions#5, choose_direction::@7/choose_direction::open_directions#10, choose_direction::@8/choose_direction::open_directions#11 ) + choose_direction::$6 = choose_direction::open_directions#6 & LEFT + choose_direction::$28 = 0 != choose_direction::$6 + choose_direction::$7 = ! choose_direction::$28 + if(choose_direction::$7) goto choose_direction::@3 + to:choose_direction::@9 +choose_direction::@7: scope:[choose_direction] from choose_direction::@1 + choose_direction::direction#11 = phi( choose_direction::@1/choose_direction::direction#10 ) + choose_direction::open_directions#10 = phi( choose_direction::@1/choose_direction::open_directions#5 ) + choose_direction::dist_min#6 = phi( choose_direction::@1/choose_direction::dist_min#9 ) + choose_direction::xdiff#2 = phi( choose_direction::@1/choose_direction::xdiff#5 ) + choose_direction::ydiff#2 = phi( choose_direction::@1/choose_direction::ydiff#5 ) + choose_direction::$14 = choose_direction::ydiff#2 + 1 + choose_direction::$15 = ABS[choose_direction::xdiff#2] + ABS[choose_direction::$14] + choose_direction::dist_down#0 = choose_direction::$15 + choose_direction::$16 = choose_direction::dist_down#0 < choose_direction::dist_min#6 + choose_direction::$17 = ! choose_direction::$16 + if(choose_direction::$17) goto choose_direction::@2 + to:choose_direction::@8 +choose_direction::@8: scope:[choose_direction] from choose_direction::@7 + choose_direction::ydiff#9 = phi( choose_direction::@7/choose_direction::ydiff#2 ) + choose_direction::xdiff#9 = phi( choose_direction::@7/choose_direction::xdiff#2 ) + choose_direction::open_directions#11 = phi( choose_direction::@7/choose_direction::open_directions#10 ) + choose_direction::dist_down#1 = phi( choose_direction::@7/choose_direction::dist_down#0 ) + choose_direction::direction#2 = DOWN + choose_direction::dist_min#2 = choose_direction::dist_down#1 + to:choose_direction::@2 +choose_direction::@3: scope:[choose_direction] from choose_direction::@10 choose_direction::@2 choose_direction::@9 + choose_direction::dist_min#11 = phi( choose_direction::@10/choose_direction::dist_min#3, choose_direction::@2/choose_direction::dist_min#10, choose_direction::@9/choose_direction::dist_min#7 ) + choose_direction::ydiff#7 = phi( choose_direction::@10/choose_direction::ydiff#10, choose_direction::@2/choose_direction::ydiff#6, choose_direction::@9/choose_direction::ydiff#3 ) + choose_direction::xdiff#7 = phi( choose_direction::@10/choose_direction::xdiff#10, choose_direction::@2/choose_direction::xdiff#6, choose_direction::@9/choose_direction::xdiff#3 ) + choose_direction::direction#7 = phi( choose_direction::@10/choose_direction::direction#3, choose_direction::@2/choose_direction::direction#8, choose_direction::@9/choose_direction::direction#9 ) + choose_direction::open_directions#7 = phi( choose_direction::@10/choose_direction::open_directions#12, choose_direction::@2/choose_direction::open_directions#6, choose_direction::@9/choose_direction::open_directions#13 ) + choose_direction::$8 = choose_direction::open_directions#7 & RIGHT + choose_direction::$29 = 0 != choose_direction::$8 + choose_direction::$9 = ! choose_direction::$29 + if(choose_direction::$9) goto choose_direction::@4 + to:choose_direction::@11 +choose_direction::@9: scope:[choose_direction] from choose_direction::@2 + choose_direction::direction#9 = phi( choose_direction::@2/choose_direction::direction#8 ) + choose_direction::open_directions#13 = phi( choose_direction::@2/choose_direction::open_directions#6 ) + choose_direction::dist_min#7 = phi( choose_direction::@2/choose_direction::dist_min#10 ) + choose_direction::ydiff#3 = phi( choose_direction::@2/choose_direction::ydiff#6 ) + choose_direction::xdiff#3 = phi( choose_direction::@2/choose_direction::xdiff#6 ) + choose_direction::$18 = choose_direction::xdiff#3 - 1 + choose_direction::$19 = ABS[choose_direction::$18] + ABS[choose_direction::ydiff#3] + choose_direction::dist_left#0 = choose_direction::$19 + choose_direction::$20 = choose_direction::dist_left#0 < choose_direction::dist_min#7 + choose_direction::$21 = ! choose_direction::$20 + if(choose_direction::$21) goto choose_direction::@3 + to:choose_direction::@10 +choose_direction::@10: scope:[choose_direction] from choose_direction::@9 + choose_direction::ydiff#10 = phi( choose_direction::@9/choose_direction::ydiff#3 ) + choose_direction::xdiff#10 = phi( choose_direction::@9/choose_direction::xdiff#3 ) + choose_direction::open_directions#12 = phi( choose_direction::@9/choose_direction::open_directions#13 ) + choose_direction::dist_left#1 = phi( choose_direction::@9/choose_direction::dist_left#0 ) + choose_direction::direction#3 = LEFT + choose_direction::dist_min#3 = choose_direction::dist_left#1 + to:choose_direction::@3 +choose_direction::@4: scope:[choose_direction] from choose_direction::@11 choose_direction::@12 choose_direction::@3 + choose_direction::direction#5 = phi( choose_direction::@11/choose_direction::direction#6, choose_direction::@12/choose_direction::direction#4, choose_direction::@3/choose_direction::direction#7 ) + choose_direction::return#4 = choose_direction::direction#5 + to:choose_direction::@return +choose_direction::@11: scope:[choose_direction] from choose_direction::@3 + choose_direction::direction#6 = phi( choose_direction::@3/choose_direction::direction#7 ) + choose_direction::dist_min#8 = phi( choose_direction::@3/choose_direction::dist_min#11 ) + choose_direction::ydiff#4 = phi( choose_direction::@3/choose_direction::ydiff#7 ) + choose_direction::xdiff#4 = phi( choose_direction::@3/choose_direction::xdiff#7 ) + choose_direction::$22 = choose_direction::xdiff#4 + 1 + choose_direction::$23 = ABS[choose_direction::$22] + ABS[choose_direction::ydiff#4] + choose_direction::dist_right#0 = choose_direction::$23 + choose_direction::$24 = choose_direction::dist_right#0 < choose_direction::dist_min#8 + choose_direction::$25 = ! choose_direction::$24 + if(choose_direction::$25) goto choose_direction::@4 + to:choose_direction::@12 +choose_direction::@12: scope:[choose_direction] from choose_direction::@11 + choose_direction::dist_right#1 = phi( choose_direction::@11/choose_direction::dist_right#0 ) + choose_direction::direction#4 = RIGHT + choose_direction::dist_min#4 = choose_direction::dist_right#1 + to:choose_direction::@4 +choose_direction::@return: scope:[choose_direction] from choose_direction::@4 + choose_direction::return#10 = phi( choose_direction::@4/choose_direction::return#4 ) + choose_direction::return#5 = choose_direction::return#10 + return + to:@return + +void spawn_all() +spawn_all: scope:[spawn_all] from game_logic::@68 game_logic::@69 game_logic::@70 game_logic::@71 gameplay_run::@9 + ghosts_mode_count = 0 + pacman_substep = 0 + ghost1_substep = 0 + ghost2_substep = 0 + ghost3_substep = 0 + ghost4_substep = 0 + pacman_direction = STOP + ghost1_direction = STOP + ghost2_direction = STOP + ghost3_direction = STOP + ghost4_direction = STOP + pacman_xfine = $32 + ghost1_xfine = $32 + ghost2_xfine = $32 + ghost3_xfine = $32 + ghost4_xfine = $32 + ghost1_yfine = $23 + ghost2_yfine = $23 + ghost3_yfine = $23 + ghost4_yfine = $23 + pacman_yfine = $3e + ghost1_respawn = $a + ghost2_respawn = $14 + ghost3_respawn = $1e + ghost4_respawn = $28 + to:spawn_all::@return +spawn_all::@return: scope:[spawn_all] from spawn_all + return + to:@return + +void __start() +__start: scope:[__start] from + to:__start::__init1 +__start::__init1: scope:[__start] from __start + pacman_ch1_enabled = 0 + pacman_ch1_idx = 0 + logic_tile_ptr = (byte*) 0 + logic_tile_xcol = 0 + logic_tile_yfine = 0 + logic_tile_left_idx = 0 + logic_tile_right_idx = 0 + left_render_index_xcol = (byte*) 0 + left_canvas = (byte*) 0 + left_ypos_inc_offset = 0 + rigt_render_index_xcol = (byte*) 0 + rigt_canvas = (byte*) 0 + rigt_ypos_inc_offset = 0 + canvas_base_hi = 0 + bobs_restore_base = 0 + top_sprites_color = 0 + top_sprites_mc = 0 + side_sprites_color = 0 + side_sprites_mc = 0 + bottom_sprites_color = 0 + bottom_sprites_mc = 0 + pill_count = 0 + pacman_wins = 0 + pacman_lives = 3 + music_play_next = 0 + phase = 0 + frame = 0 + anim_frame_idx = 0 + pacman_xfine = $2d + pacman_yfine = $23 + pacman_direction = STOP + pacman_substep = 0 + ghosts_mode = 1 + ghosts_mode_count = 0 + ghost1_xfine = $2d + ghost1_yfine = $23 + ghost1_direction = STOP + ghost1_substep = 0 + ghost1_reverse = 0 + ghost1_respawn = 0 + ghost2_xfine = $2d + ghost2_yfine = $23 + ghost2_direction = STOP + ghost2_substep = 0 + ghost2_reverse = 0 + ghost2_respawn = 0 + ghost3_xfine = $2d + ghost3_yfine = $23 + ghost3_direction = STOP + ghost3_substep = 0 + ghost3_reverse = 0 + ghost3_respawn = 0 + ghost4_xfine = $2d + ghost4_yfine = $23 + ghost4_direction = STOP + ghost4_substep = 0 + ghost4_reverse = 0 + ghost4_respawn = 0 + game_logic_substep = 0 + game_playable = 0 + to:__start::@1 +__start::@1: scope:[__start] from __start::__init1 + call main + to:__start::@2 +__start::@2: scope:[__start] from __start::@1 + to:__start::@return +__start::@return: scope:[__start] from __start::@2 + return + to:@return + +SYMBOL TABLE SSA +const byte* ABS[$100] = kickasm {{ .for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + }} +const byte* ABS_POST[1] = { 0 } +const byte* ABS_PRE[1] = { 1 } +const nomodify byte* BANK_1 = (byte*)$4000 +const nomodify byte* BANK_2 = (byte*)$c000 +const nomodify byte BLACK = 0 +const nomodify byte BLUE = 6 +const byte* BOB_GRAPHICS_CRUNCHED[] = kickasm( uses BOB_MASK_LEFT) {{ .modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + }} +const nomodify byte* BOB_MASK_LEFT = (byte*)$5400 +const nomodify byte* BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 +const nomodify byte* BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c +const nomodify byte* BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 +const nomodify byte BOB_ROW_SIZE = $80 +const nomodify byte* BORDER_COLOR = (byte*)$d020 +const byte* BYTEBOOZER[] = kickasm {{ .const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + }} +const byte CHASE = 0 +const nomodify struct MOS6526_CIA* CIA1 = (struct MOS6526_CIA*)$dc00 +const nomodify byte* CIA1_INTERRUPT = (byte*)$dc0d +const nomodify struct MOS6526_CIA* CIA2 = (struct MOS6526_CIA*)$dd00 +const nomodify byte CIA_INTERRUPT_CLEAR = $7f +const byte DIRECTION::DOWN = 8 +const byte DIRECTION::LEFT = $10 +const byte DIRECTION::RIGHT = $20 +const byte DIRECTION::STOP = 0 +const byte DIRECTION::UP = 4 +const byte* DIRECTION_ELIMINATE[$21] = { $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef } +const byte* DIRECTION_REVERSE[$21] = { 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 } +const byte* DIRECTION_SINGLE[$40] = { 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 } +const byte DOWN = 8 +const byte EMPTY = 0 +const byte FRIGHTENED = 2 +const nomodify byte* GAMEOVER_GFX = (byte*)$a700 +const byte* GAMEOVER_GFX_CRUNCHED[] = kickasm( uses GAMEOVER_GFX) {{ .modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + }} +const byte GHOSTS_MODE::CHASE = 0 +const byte GHOSTS_MODE::FRIGHTENED = 2 +const byte GHOSTS_MODE::SCATTER = 1 +const nomodify void()** HARDWARE_IRQ = (void()**)$fffe +const nomodify byte* INTRO_MUSIC = (byte*)$3000 +const byte* INTRO_MUSIC_CRUNCHED[] = kickasm( uses INTRO_MUSIC) {{ .modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + }} +const nomodify word INTRO_MUSIC_CRUNCHED_SIZE = $600 +const nomodify byte* INTRO_MUSIC_CRUNCHED_UPPER = (byte*)$a700 +const nomodify byte IRQ_RASTER = 1 +const nomodify byte IRQ_SCREEN_TOP_LINE = 5 +const nomodify byte* IRQ_STATUS = (byte*)$d019 +const byte LEFT = $10 +const nomodify byte* LEVEL_TILES = (byte*)$4800 +const byte* LEVEL_TILES_CRUNCHED[] = kickasm( uses LEVEL_TILES) {{ .modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + }} +const nomodify byte* LEVEL_TILES_DIRECTIONS = (byte*)$3e00 +const word* LEVEL_YTILE_OFFSET[$25] = { 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 } +const byte* LOGIC_CODE_CRUNCHED[] = kickasm( uses bobs_xcol uses bobs_yfine uses bobs_bob_id uses bobs_restore uses RENDER_INDEX uses RENDER_OFFSET_CANVAS_LO uses RENDER_OFFSET_CANVAS_HI uses RENDER_OFFSET_YPOS_INC uses SIZE_BOB_RESTORE uses BOB_ROW_SIZE uses NUM_BOBS uses left_render_index_xcol uses left_canvas uses left_ypos_inc_offset uses rigt_render_index_xcol uses rigt_canvas uses rigt_ypos_inc_offset uses BOB_MASK_LEFT uses BOB_PIXEL_LEFT uses BOB_MASK_RIGT uses BOB_PIXEL_RIGT uses canvas_base_hi uses bobs_restore_base uses RENDER_YPOS_INC uses logic_tile_ptr uses logic_tile_xcol uses logic_tile_yfine uses logic_tile_left_idx uses logic_tile_right_idx) {{ .macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + }} +const nomodify byte* LOGIC_CODE_UNMERGED = (byte*)$e000 +const nomodify byte NUM_BOBS = 5 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 +const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d +const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A = 0 +const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 +const byte OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 +const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 +const byte OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 +const byte OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_FREQ = 0 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 +const byte OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 +const byte* PACMAN_CH1_CONTROL[] = { $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 } +const byte* PACMAN_CH1_FREQ_HI[] = { $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 } +const byte PILL = 1 +const byte POWERUP = 2 +const nomodify byte* PROCPORT = (byte*)1 +const nomodify byte* PROCPORT_DDR = (byte*)0 +const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 +const nomodify byte PROCPORT_RAM_ALL = 0 +const nomodify byte PROCPORT_RAM_IO = 5 +const nomodify byte* RASTER = (byte*)$d012 +const nomodify byte* RASTER_CODE = (byte*)$8000 +const byte* RASTER_CODE_CRUNCHED[] = kickasm( uses VICII_CONTROL2 uses BORDER_COLOR uses RASTER_CODE_UNMERGED uses side_sprites_color uses side_sprites_mc uses bottom_sprites_color uses bottom_sprites_mc) {{ .macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + }} +const nomodify byte* RASTER_CODE_UNMERGED = (byte*)$6000 +const nomodify byte RED = 2 +const nomodify byte* RENDER_INDEX = (byte*)$b600 +const nomodify byte RENDER_OFFSET_CANVAS_HI = $50 +const nomodify byte RENDER_OFFSET_CANVAS_LO = 0 +const nomodify byte RENDER_OFFSET_YPOS_INC = $a0 +const byte** RENDER_XCOLS[$1a] = { (byte*)0, (byte*)1, (byte*)2, (byte*)$400, (byte*)$401, (byte*)$402, (byte*)$800, (byte*)$801, (byte*)$802, (byte*)$c00, (byte*)$c01, (byte*)$c02, (byte*)$1000, (byte*)$1001, (byte*)$1002, (byte*)$1400, (byte*)$1401, (byte*)$1402, (byte*)$1800, (byte*)$1801, (byte*)$1802, (byte*)$1c00, (byte*)$1c01, (byte*)$1c02, (byte*)0, (byte*)0 } +const word* RENDER_YPOS[$95] = { (word)0+0, (word)0+0, (word)0+0, (word)0+6, (word)0+$c, (word)0+$12, (word)0+$18, (word)0+$1e, (word)0+$24, (word)0+$2a, (word)0+$30, (word)0+$36, (word)0+$3c, (word)$40+3, (word)$40+9, (word)$40+$f, (word)$40+$15, (word)$40+$1b, (word)$40+$21, (word)$40+$27, (word)$40+$2d, (word)$40+$33, (word)$40+$39, (word)$80+0, (word)$80+6, (word)$80+$c, (word)$80+$12, (word)$80+$18, (word)$80+$1e, (word)$80+$24, (word)$80+$2a, (word)$80+$30, (word)$80+$36, (word)$80+$3c, (word)$c0+3, (word)$c0+9, (word)$c0+$f, (word)$c0+$15, (word)$c0+$1b, (word)$c0+$21, (word)$c0+$27, (word)$c0+$2d, (word)$c0+$33, (word)$c0+$39, (word)$100+0, (word)$100+6, (word)$100+$c, (word)$100+$12, (word)$100+$18, (word)$100+$1e, (word)$100+$24, (word)$100+$2a, (word)$100+$30, (word)$100+$36, (word)$100+$3c, (word)$140+3, (word)$140+9, (word)$140+$f, (word)$140+$15, (word)$140+$1b, (word)$140+$21, (word)$140+$27, (word)$140+$2d, (word)$140+$33, (word)$140+$39, (word)$180+0, (word)$180+6, (word)$180+$c, (word)$180+$12, (word)$180+$18, (word)$180+$1e, (word)$180+$24, (word)$180+$2a, (word)$180+$30, (word)$180+$36, (word)$180+$3c, (word)$1c0+3, (word)$1c0+9, (word)$1c0+$f, (word)$1c0+$15, (word)$1c0+$1b, (word)$1c0+$21, (word)$1c0+$27, (word)$1c0+$2d, (word)$1c0+$33, (word)$1c0+$39, (word)$200+0, (word)$200+6, (word)$200+$c, (word)$200+$12, (word)$200+$18, (word)$200+$1e, (word)$200+$24, (word)$200+$2a, (word)$200+$30, (word)$200+$36, (word)$200+$3c, (word)$240+3, (word)$240+9, (word)$240+$f, (word)$240+$15, (word)$240+$1b, (word)$240+$21, (word)$240+$27, (word)$240+$2d, (word)$240+$33, (word)$240+$39, (word)$280+0, (word)$280+6, (word)$280+$c, (word)$280+$12, (word)$280+$18, (word)$280+$1e, (word)$280+$24, (word)$280+$2a, (word)$280+$30, (word)$280+$36, (word)$280+$3c, (word)$2c0+3, (word)$2c0+9, (word)$2c0+$f, (word)$2c0+$15, (word)$2c0+$1b, (word)$2c0+$21, (word)$2c0+$27, (word)$2c0+$2d, (word)$2c0+$33, (word)$2c0+$39, (word)$300+0, (word)$300+6, (word)$300+$c, (word)$300+$12, (word)$300+$18, (word)$300+$1e, (word)$300+$24, (word)$300+$2a, (word)$300+$30, (word)$300+$36, (word)$300+$3c, (word)$340+3, (word)$340+9, (word)$340+$f, (word)$340+$15, (word)$340+$1b, (word)$340+$21, (word)$340+$27, (word)$340+$2d, (word)$340+$33, (word)$340+$39 } +const word* RENDER_YPOS_9TH[$95] = { (word)0+3, (word)0+3, (word)0+3, (word)0+9, (word)0+$f, (word)0+$15, (word)0+$1b, (word)0+$21, (word)0+$27, (word)0+$2d, (word)0+$33, (word)0+$39, (word)$40+0, (word)$40+6, (word)$40+$c, (word)$40+$12, (word)$40+$18, (word)$40+$1e, (word)$40+$24, (word)$40+$2a, (word)$40+$30, (word)$40+$36, (word)$40+$3c, (word)$80+3, (word)$80+9, (word)$80+$f, (word)$80+$15, (word)$80+$1b, (word)$80+$21, (word)$80+$27, (word)$80+$2d, (word)$80+$33, (word)$80+$39, (word)$c0+0, (word)$c0+6, (word)$c0+$c, (word)$c0+$12, (word)$c0+$18, (word)$c0+$1e, (word)$c0+$24, (word)$c0+$2a, (word)$c0+$30, (word)$c0+$36, (word)$c0+$3c, (word)$100+3, (word)$100+9, (word)$100+$f, (word)$100+$15, (word)$100+$1b, (word)$100+$21, (word)$100+$27, (word)$100+$2d, (word)$100+$33, (word)$100+$39, (word)$140+0, (word)$140+6, (word)$140+$c, (word)$140+$12, (word)$140+$18, (word)$140+$1e, (word)$140+$24, (word)$140+$2a, (word)$140+$30, (word)$140+$36, (word)$140+$3c, (word)$180+3, (word)$180+9, (word)$180+$f, (word)$180+$15, (word)$180+$1b, (word)$180+$21, (word)$180+$27, (word)$180+$2d, (word)$180+$33, (word)$180+$39, (word)$1c0+0, (word)$1c0+6, (word)$1c0+$c, (word)$1c0+$12, (word)$1c0+$18, (word)$1c0+$1e, (word)$1c0+$24, (word)$1c0+$2a, (word)$1c0+$30, (word)$1c0+$36, (word)$1c0+$3c, (word)$200+3, (word)$200+9, (word)$200+$f, (word)$200+$15, (word)$200+$1b, (word)$200+$21, (word)$200+$27, (word)$200+$2d, (word)$200+$33, (word)$200+$39, (word)$240+0, (word)$240+6, (word)$240+$c, (word)$240+$12, (word)$240+$18, (word)$240+$1e, (word)$240+$24, (word)$240+$2a, (word)$240+$30, (word)$240+$36, (word)$240+$3c, (word)$280+3, (word)$280+9, (word)$280+$f, (word)$280+$15, (word)$280+$1b, (word)$280+$21, (word)$280+$27, (word)$280+$2d, (word)$280+$33, (word)$280+$39, (word)$2c0+0, (word)$2c0+6, (word)$2c0+$c, (word)$2c0+$12, (word)$2c0+$18, (word)$2c0+$1e, (word)$2c0+$24, (word)$2c0+$2a, (word)$2c0+$30, (word)$2c0+$36, (word)$2c0+$3c, (word)$300+3, (word)$300+9, (word)$300+$f, (word)$300+$15, (word)$300+$1b, (word)$300+$21, (word)$300+$27, (word)$300+$2d, (word)$300+$33, (word)$300+$39, (word)$340+0, (word)$340+6, (word)$340+$c, (word)$340+$12, (word)$340+$18, (word)$340+$1e, (word)$340+$24, (word)$340+$2a, (word)$340+$30, (word)$340+$36, (word)$340+$3c } +const byte* RENDER_YPOS_INC[$a0] = { 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 } +const byte RIGHT = $20 +const byte SCATTER = 1 +const nomodify byte* SCREENS_1 = (byte*)$4000 +const nomodify byte* SCREENS_2 = (byte*)$c000 +const nomodify struct MOS6581_SID* SID = (struct MOS6581_SID*)$d400 +const nomodify byte* SID_CH1_FREQ_HI = (byte*)$d401 +const byte SIZEOF_POINTER = 2 +const byte SIZEOF_WORD = 2 +const nomodify byte SIZE_BOB_RESTORE = $12 +const nomodify byte* SPLASH = (byte*)$4000 +const byte* SPLASH_CRUNCHED[] = kickasm( uses SPLASH) {{ .modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + }} +const nomodify byte* SPRITES_1 = (byte*)$6000 +const nomodify byte* SPRITES_2 = (byte*)$e000 +const nomodify byte* SPRITES_COLOR = (byte*)$d027 +const nomodify byte* SPRITES_XPOS = (byte*)$d000 +const nomodify byte* SPRITES_YPOS = (byte*)$d001 +const byte STOP = 0 +const nomodify byte* TILES_LEFT = LEVEL_TILES+$a00 +const nomodify byte* TILES_RIGHT = LEVEL_TILES+$a80 +const nomodify byte* TILES_TYPE = LEVEL_TILES+$b00 +const byte TILE_TYPE::EMPTY = 0 +const byte TILE_TYPE::PILL = 1 +const byte TILE_TYPE::POWERUP = 2 +const byte TILE_TYPE::WALL = 4 +const byte UP = 4 +const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*)$d000 +const nomodify byte VICII_BMM = $20 +const nomodify byte* VICII_CONTROL1 = (byte*)$d011 +const nomodify byte* VICII_CONTROL2 = (byte*)$d016 +const nomodify byte VICII_DEN = $10 +const nomodify byte VICII_ECM = $40 +const nomodify byte* VICII_MEMORY = (byte*)$d018 +const nomodify byte VICII_RSEL = 8 +const nomodify byte VICII_RST8 = $80 +const byte WALL = 4 +const nomodify byte* WIN_GFX = (byte*)$a700 +const byte* WIN_GFX_CRUNCHED[] = kickasm( uses WIN_GFX) {{ .modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + }} +const nomodify byte YELLOW = 7 +void __start() +volatile byte anim_frame_idx loadstore +const byte* bobs_bob_id[NUM_BOBS] = { 0, 0, 0, 0, 0 } +const byte* bobs_restore[NUM_BOBS*SIZE_BOB_RESTORE*2] = { fill( NUM_BOBS*SIZE_BOB_RESTORE*2, 0) } +volatile byte bobs_restore_base loadstore +const byte* bobs_xcol[NUM_BOBS] = { $a, $a, $a, $a, $a } +const byte* bobs_yfine[NUM_BOBS] = { $2d, $2d, $2d, $2d, $2d } +volatile byte bottom_sprites_color loadstore +volatile byte bottom_sprites_mc loadstore +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +volatile byte* byteboozer_decrunch::crunched loadstore +volatile byte canvas_base_hi loadstore +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +byte~ choose_direction::$0 +byte~ choose_direction::$1 +number~ choose_direction::$10 +byte~ choose_direction::$11 +bool~ choose_direction::$12 +bool~ choose_direction::$13 +number~ choose_direction::$14 +byte~ choose_direction::$15 +bool~ choose_direction::$16 +bool~ choose_direction::$17 +number~ choose_direction::$18 +byte~ choose_direction::$19 +byte~ choose_direction::$2 +bool~ choose_direction::$20 +bool~ choose_direction::$21 +number~ choose_direction::$22 +byte~ choose_direction::$23 +bool~ choose_direction::$24 +bool~ choose_direction::$25 +bool~ choose_direction::$26 +bool~ choose_direction::$27 +bool~ choose_direction::$28 +bool~ choose_direction::$29 +bool~ choose_direction::$3 +byte~ choose_direction::$4 +bool~ choose_direction::$5 +byte~ choose_direction::$6 +bool~ choose_direction::$7 +byte~ choose_direction::$8 +bool~ choose_direction::$9 +byte choose_direction::direction +byte choose_direction::direction#0 +byte choose_direction::direction#1 +byte choose_direction::direction#10 +byte choose_direction::direction#11 +byte choose_direction::direction#12 +byte choose_direction::direction#2 +byte choose_direction::direction#3 +byte choose_direction::direction#4 +byte choose_direction::direction#5 +byte choose_direction::direction#6 +byte choose_direction::direction#7 +byte choose_direction::direction#8 +byte choose_direction::direction#9 +byte choose_direction::dist_down +byte choose_direction::dist_down#0 +byte choose_direction::dist_down#1 +byte choose_direction::dist_left +byte choose_direction::dist_left#0 +byte choose_direction::dist_left#1 +byte choose_direction::dist_min +byte choose_direction::dist_min#0 +byte choose_direction::dist_min#1 +byte choose_direction::dist_min#10 +byte choose_direction::dist_min#11 +byte choose_direction::dist_min#2 +byte choose_direction::dist_min#3 +byte choose_direction::dist_min#4 +byte choose_direction::dist_min#5 +byte choose_direction::dist_min#6 +byte choose_direction::dist_min#7 +byte choose_direction::dist_min#8 +byte choose_direction::dist_min#9 +byte choose_direction::dist_right +byte choose_direction::dist_right#0 +byte choose_direction::dist_right#1 +byte choose_direction::dist_up +byte choose_direction::dist_up#0 +byte choose_direction::dist_up#1 +byte choose_direction::ghost_xtile +byte choose_direction::ghost_xtile#0 +byte choose_direction::ghost_xtile#1 +byte choose_direction::ghost_xtile#2 +byte choose_direction::ghost_xtile#3 +byte choose_direction::ghost_xtile#4 +byte choose_direction::ghost_ytile +byte choose_direction::ghost_ytile#0 +byte choose_direction::ghost_ytile#1 +byte choose_direction::ghost_ytile#2 +byte choose_direction::ghost_ytile#3 +byte choose_direction::ghost_ytile#4 +byte choose_direction::open_directions +byte choose_direction::open_directions#0 +byte choose_direction::open_directions#1 +byte choose_direction::open_directions#10 +byte choose_direction::open_directions#11 +byte choose_direction::open_directions#12 +byte choose_direction::open_directions#13 +byte choose_direction::open_directions#2 +byte choose_direction::open_directions#3 +byte choose_direction::open_directions#4 +byte choose_direction::open_directions#5 +byte choose_direction::open_directions#6 +byte choose_direction::open_directions#7 +byte choose_direction::open_directions#8 +byte choose_direction::open_directions#9 +byte choose_direction::return +byte choose_direction::return#0 +byte choose_direction::return#1 +byte choose_direction::return#10 +byte choose_direction::return#2 +byte choose_direction::return#3 +byte choose_direction::return#4 +byte choose_direction::return#5 +byte choose_direction::return#6 +byte choose_direction::return#7 +byte choose_direction::return#8 +byte choose_direction::return#9 +byte choose_direction::target_xtile +byte choose_direction::target_xtile#0 +byte choose_direction::target_xtile#1 +byte choose_direction::target_xtile#2 +byte choose_direction::target_xtile#3 +byte choose_direction::target_xtile#4 +byte choose_direction::target_ytile +byte choose_direction::target_ytile#0 +byte choose_direction::target_ytile#1 +byte choose_direction::target_ytile#2 +byte choose_direction::target_ytile#3 +byte choose_direction::target_ytile#4 +byte choose_direction::xdiff +byte choose_direction::xdiff#0 +byte choose_direction::xdiff#1 +byte choose_direction::xdiff#10 +byte choose_direction::xdiff#2 +byte choose_direction::xdiff#3 +byte choose_direction::xdiff#4 +byte choose_direction::xdiff#5 +byte choose_direction::xdiff#6 +byte choose_direction::xdiff#7 +byte choose_direction::xdiff#8 +byte choose_direction::xdiff#9 +byte choose_direction::ydiff +byte choose_direction::ydiff#0 +byte choose_direction::ydiff#1 +byte choose_direction::ydiff#10 +byte choose_direction::ydiff#2 +byte choose_direction::ydiff#3 +byte choose_direction::ydiff#4 +byte choose_direction::ydiff#5 +byte choose_direction::ydiff#6 +byte choose_direction::ydiff#7 +byte choose_direction::ydiff#8 +byte choose_direction::ydiff#9 +void done_run() +bool~ done_run::$1 +bool~ done_run::$10 +bool~ done_run::$12 +bool~ done_run::$13 +bool~ done_run::$14 +bool~ done_run::$2 +bool~ done_run::$5 +bool~ done_run::$6 +byte~ done_run::$8 +bool~ done_run::$9 +byte* done_run::gfx +byte* done_run::gfx#0 +byte* done_run::gfx#1 +byte* done_run::gfx#2 +byte* done_run::gfx#3 +byte* done_run::gfx#4 +byte* done_run::gfx#5 +byte* done_run::gfx#6 +byte* done_run::gfx#7 +byte done_run::i +byte done_run::i#0 +byte done_run::i#1 +byte done_run::i#2 +byte done_run::i#3 +byte done_run::i1 +byte done_run::i1#0 +byte done_run::i1#1 +byte done_run::i1#2 +byte done_run::i1#3 +byte done_run::pixels +byte done_run::pixels#0 +byte done_run::xcol +byte done_run::xcol#0 +byte done_run::xcol#1 +byte done_run::xcol#2 +byte done_run::xcol#3 +byte done_run::xcol#4 +byte done_run::xcol#5 +byte done_run::xcol#6 +byte done_run::xcol#7 +byte done_run::ypos +byte done_run::ypos#0 +byte done_run::ypos#1 +byte done_run::ypos#2 +byte done_run::ypos#3 +byte done_run::ypos#4 +volatile byte frame loadstore +void game_logic() +bool~ game_logic::$0 +bool~ game_logic::$1 +bool~ game_logic::$10 +bool~ game_logic::$100 +bool~ game_logic::$102 +bool~ game_logic::$104 +bool~ game_logic::$105 +bool~ game_logic::$106 +bool~ game_logic::$107 +bool~ game_logic::$108 +bool~ game_logic::$109 +bool~ game_logic::$11 +bool~ game_logic::$110 +bool~ game_logic::$111 +number~ game_logic::$112 +number~ game_logic::$113 +byte~ game_logic::$114 +bool~ game_logic::$115 +bool~ game_logic::$116 +number~ game_logic::$117 +number~ game_logic::$118 +byte~ game_logic::$119 +bool~ game_logic::$12 +bool~ game_logic::$120 +bool~ game_logic::$121 +bool~ game_logic::$122 +bool~ game_logic::$123 +bool~ game_logic::$124 +bool~ game_logic::$125 +bool~ game_logic::$126 +bool~ game_logic::$127 +bool~ game_logic::$128 +bool~ game_logic::$129 +bool~ game_logic::$13 +bool~ game_logic::$130 +bool~ game_logic::$131 +bool~ game_logic::$132 +number~ game_logic::$133 +number~ game_logic::$134 +byte~ game_logic::$135 +bool~ game_logic::$136 +bool~ game_logic::$137 +number~ game_logic::$138 +number~ game_logic::$139 +number~ game_logic::$14 +byte~ game_logic::$140 +bool~ game_logic::$141 +bool~ game_logic::$142 +bool~ game_logic::$143 +bool~ game_logic::$144 +bool~ game_logic::$145 +bool~ game_logic::$146 +bool~ game_logic::$147 +bool~ game_logic::$148 +bool~ game_logic::$149 +number~ game_logic::$15 +bool~ game_logic::$150 +bool~ game_logic::$151 +bool~ game_logic::$152 +bool~ game_logic::$153 +number~ game_logic::$154 +number~ game_logic::$155 +byte~ game_logic::$156 +bool~ game_logic::$157 +bool~ game_logic::$158 +number~ game_logic::$159 +number~ game_logic::$16 +number~ game_logic::$160 +byte~ game_logic::$161 +bool~ game_logic::$162 +bool~ game_logic::$163 +bool~ game_logic::$164 +bool~ game_logic::$165 +bool~ game_logic::$166 +bool~ game_logic::$167 +bool~ game_logic::$168 +bool~ game_logic::$169 +number~ game_logic::$17 +bool~ game_logic::$170 +bool~ game_logic::$171 +bool~ game_logic::$172 +bool~ game_logic::$173 +bool~ game_logic::$174 +number~ game_logic::$175 +number~ game_logic::$176 +byte~ game_logic::$177 +bool~ game_logic::$178 +bool~ game_logic::$179 +number~ game_logic::$18 +number~ game_logic::$180 +number~ game_logic::$181 +byte~ game_logic::$182 +bool~ game_logic::$183 +bool~ game_logic::$184 +bool~ game_logic::$185 +bool~ game_logic::$186 +bool~ game_logic::$187 +bool~ game_logic::$188 +bool~ game_logic::$189 +byte~ game_logic::$19 +bool~ game_logic::$190 +bool~ game_logic::$191 +bool~ game_logic::$192 +bool~ game_logic::$193 +bool~ game_logic::$194 +bool~ game_logic::$195 +number~ game_logic::$196 +number~ game_logic::$197 +byte~ game_logic::$198 +number~ game_logic::$199 +number~ game_logic::$2 +number~ game_logic::$20 +number~ game_logic::$200 +number~ game_logic::$201 +bool~ game_logic::$202 +bool~ game_logic::$203 +byte~ game_logic::$204 +bool~ game_logic::$205 +bool~ game_logic::$206 +bool~ game_logic::$207 +bool~ game_logic::$208 +bool~ game_logic::$209 +number~ game_logic::$21 +byte~ game_logic::$210 +bool~ game_logic::$211 +bool~ game_logic::$212 +bool~ game_logic::$213 +bool~ game_logic::$214 +bool~ game_logic::$215 +bool~ game_logic::$216 +bool~ game_logic::$217 +bool~ game_logic::$218 +bool~ game_logic::$219 +bool~ game_logic::$22 +bool~ game_logic::$23 +number~ game_logic::$24 +number~ game_logic::$25 +number~ game_logic::$26 +byte~ game_logic::$27 +number~ game_logic::$28 +number~ game_logic::$29 +number~ game_logic::$3 +number~ game_logic::$30 +number~ game_logic::$31 +number~ game_logic::$32 +byte~ game_logic::$33 +number~ game_logic::$34 +number~ game_logic::$35 +number~ game_logic::$36 +number~ game_logic::$37 +number~ game_logic::$38 +byte~ game_logic::$39 +bool~ game_logic::$4 +number~ game_logic::$40 +number~ game_logic::$41 +number~ game_logic::$42 +number~ game_logic::$43 +number~ game_logic::$44 +byte~ game_logic::$45 +number~ game_logic::$46 +number~ game_logic::$47 +bool~ game_logic::$48 +bool~ game_logic::$49 +bool~ game_logic::$5 +bool~ game_logic::$50 +bool~ game_logic::$51 +bool~ game_logic::$52 +bool~ game_logic::$53 +bool~ game_logic::$54 +bool~ game_logic::$55 +bool~ game_logic::$56 +bool~ game_logic::$57 +bool~ game_logic::$58 +number~ game_logic::$59 +bool~ game_logic::$6 +number~ game_logic::$60 +byte*~ game_logic::$61 +bool~ game_logic::$62 +bool~ game_logic::$63 +bool~ game_logic::$64 +number~ game_logic::$65 +number~ game_logic::$66 +byte*~ game_logic::$67 +number~ game_logic::$68 +number~ game_logic::$69 +bool~ game_logic::$7 +number~ game_logic::$70 +byte*~ game_logic::$71 +number~ game_logic::$72 +bool~ game_logic::$73 +bool~ game_logic::$74 +byte~ game_logic::$75 +bool~ game_logic::$76 +byte~ game_logic::$77 +bool~ game_logic::$78 +bool~ game_logic::$79 +bool~ game_logic::$8 +byte~ game_logic::$80 +bool~ game_logic::$81 +byte~ game_logic::$82 +bool~ game_logic::$83 +bool~ game_logic::$84 +byte~ game_logic::$85 +bool~ game_logic::$86 +byte~ game_logic::$87 +bool~ game_logic::$88 +bool~ game_logic::$89 +bool~ game_logic::$9 +byte~ game_logic::$90 +bool~ game_logic::$91 +byte~ game_logic::$92 +bool~ game_logic::$93 +bool~ game_logic::$94 +bool~ game_logic::$95 +bool~ game_logic::$96 +bool~ game_logic::$98 +byte game_logic::do_reverse +byte game_logic::do_reverse#0 +byte game_logic::do_reverse#1 +byte game_logic::do_reverse#2 +byte game_logic::do_reverse#3 +byte game_logic::do_reverse#4 +byte game_logic::do_reverse#5 +byte game_logic::do_reverse#6 +byte game_logic::do_reverse#7 +byte game_logic::do_reverse#8 +byte game_logic::do_reverse#9 +byte game_logic::ghost1_bob_xfine +byte game_logic::ghost1_bob_xfine#0 +byte game_logic::ghost1_xtile +byte game_logic::ghost1_xtile#0 +byte game_logic::ghost1_xtile#1 +byte game_logic::ghost1_xtile#2 +byte game_logic::ghost1_xtile#3 +byte game_logic::ghost1_xtile#4 +byte game_logic::ghost1_xtile#5 +byte game_logic::ghost1_ytile +byte game_logic::ghost1_ytile#0 +byte game_logic::ghost1_ytile#1 +byte game_logic::ghost1_ytile#2 +byte game_logic::ghost1_ytile#3 +byte game_logic::ghost1_ytile#4 +byte game_logic::ghost1_ytile#5 +byte game_logic::ghost2_bob_xfine +byte game_logic::ghost2_bob_xfine#0 +byte game_logic::ghost2_xtile +byte game_logic::ghost2_xtile#0 +byte game_logic::ghost2_xtile#1 +byte game_logic::ghost2_xtile#2 +byte game_logic::ghost2_xtile#3 +byte game_logic::ghost2_xtile#4 +byte game_logic::ghost2_xtile#5 +byte game_logic::ghost2_ytile +byte game_logic::ghost2_ytile#0 +byte game_logic::ghost2_ytile#1 +byte game_logic::ghost2_ytile#2 +byte game_logic::ghost2_ytile#3 +byte game_logic::ghost2_ytile#4 +byte game_logic::ghost2_ytile#5 +byte game_logic::ghost3_bob_xfine +byte game_logic::ghost3_bob_xfine#0 +byte game_logic::ghost3_xtile +byte game_logic::ghost3_xtile#0 +byte game_logic::ghost3_xtile#1 +byte game_logic::ghost3_xtile#2 +byte game_logic::ghost3_xtile#3 +byte game_logic::ghost3_xtile#4 +byte game_logic::ghost3_xtile#5 +byte game_logic::ghost3_ytile +byte game_logic::ghost3_ytile#0 +byte game_logic::ghost3_ytile#1 +byte game_logic::ghost3_ytile#2 +byte game_logic::ghost3_ytile#3 +byte game_logic::ghost3_ytile#4 +byte game_logic::ghost3_ytile#5 +byte game_logic::ghost4_bob_xfine +byte game_logic::ghost4_bob_xfine#0 +byte game_logic::ghost4_xtile +byte game_logic::ghost4_xtile#0 +byte game_logic::ghost4_xtile#1 +byte game_logic::ghost4_xtile#2 +byte game_logic::ghost4_xtile#3 +byte game_logic::ghost4_xtile#4 +byte game_logic::ghost4_xtile#5 +byte game_logic::ghost4_ytile +byte game_logic::ghost4_ytile#0 +byte game_logic::ghost4_ytile#1 +byte game_logic::ghost4_ytile#2 +byte game_logic::ghost4_ytile#3 +byte game_logic::ghost4_ytile#4 +byte game_logic::ghost4_ytile#5 +byte game_logic::ghost_frame_idx +byte game_logic::ghost_frame_idx#0 +byte game_logic::ghost_frame_idx#1 +byte game_logic::ghost_frame_idx#2 +byte game_logic::ghost_frame_idx#3 +byte game_logic::joy_directions +byte game_logic::joy_directions#0 +byte game_logic::joy_directions#1 +byte game_logic::new_direction +byte game_logic::new_direction#0 +byte game_logic::new_direction#1 +byte game_logic::open_directions +byte game_logic::open_directions#0 +byte game_logic::open_directions#1 +byte game_logic::open_directions#2 +byte game_logic::open_directions#3 +byte game_logic::open_directions#4 +byte game_logic::open_directions#5 +byte game_logic::open_directions#6 +byte game_logic::open_directions1 +byte game_logic::open_directions1#0 +byte game_logic::open_directions1#1 +byte game_logic::open_directions1#2 +byte game_logic::open_directions1#3 +byte game_logic::open_directions1#4 +byte game_logic::open_directions1#5 +byte game_logic::open_directions1#6 +byte game_logic::open_directions2 +byte game_logic::open_directions2#0 +byte game_logic::open_directions2#1 +byte game_logic::open_directions2#2 +byte game_logic::open_directions2#3 +byte game_logic::open_directions2#4 +byte game_logic::open_directions2#5 +byte game_logic::open_directions2#6 +byte game_logic::open_directions3 +byte game_logic::open_directions3#0 +byte game_logic::open_directions3#1 +byte game_logic::open_directions3#2 +byte game_logic::open_directions3#3 +byte game_logic::open_directions3#4 +byte game_logic::open_directions3#5 +byte game_logic::open_directions3#6 +byte game_logic::open_directions4 +byte game_logic::open_directions4#0 +byte game_logic::open_directions4#1 +byte game_logic::open_directions4#2 +byte game_logic::open_directions4#3 +byte game_logic::pacman_bob_xfine +byte game_logic::pacman_bob_xfine#0 +byte game_logic::pacman_xtile +byte game_logic::pacman_xtile#0 +byte game_logic::pacman_xtile#1 +byte game_logic::pacman_xtile#2 +byte game_logic::pacman_xtile#3 +byte game_logic::pacman_xtile1 +byte game_logic::pacman_xtile1#0 +byte game_logic::pacman_ytile +byte game_logic::pacman_ytile#0 +byte game_logic::pacman_ytile#1 +byte game_logic::pacman_ytile#2 +byte game_logic::pacman_ytile#3 +byte game_logic::pacman_ytile1 +byte game_logic::pacman_ytile1#0 +byte game_logic::target_xtile +byte game_logic::target_xtile#0 +byte game_logic::target_xtile#1 +byte game_logic::target_xtile#2 +byte game_logic::target_xtile#3 +byte game_logic::target_xtile1 +byte game_logic::target_xtile1#0 +byte game_logic::target_xtile1#1 +byte game_logic::target_xtile1#2 +byte game_logic::target_xtile1#3 +byte game_logic::target_xtile2 +byte game_logic::target_xtile2#0 +byte game_logic::target_xtile2#1 +byte game_logic::target_xtile2#2 +byte game_logic::target_xtile2#3 +byte game_logic::target_xtile3 +byte game_logic::target_xtile3#0 +byte game_logic::target_xtile3#1 +byte game_logic::target_xtile3#2 +byte game_logic::target_xtile3#3 +byte game_logic::target_ytile +byte game_logic::target_ytile#0 +byte game_logic::target_ytile#1 +byte game_logic::target_ytile#2 +byte game_logic::target_ytile#3 +byte game_logic::target_ytile1 +byte game_logic::target_ytile1#0 +byte game_logic::target_ytile1#1 +byte game_logic::target_ytile1#2 +byte game_logic::target_ytile1#3 +byte game_logic::target_ytile2 +byte game_logic::target_ytile2#0 +byte game_logic::target_ytile2#1 +byte game_logic::target_ytile2#2 +byte game_logic::target_ytile2#3 +byte game_logic::target_ytile3 +byte game_logic::target_ytile3#0 +byte game_logic::target_ytile3#1 +byte game_logic::target_ytile3#2 +byte game_logic::target_ytile3#3 +byte game_logic::tile_id +byte game_logic::tile_id#0 +byte game_logic::tile_id#1 +byte* game_logic::ytiles +byte* game_logic::ytiles#0 +byte* game_logic::ytiles#1 +byte* game_logic::ytiles#2 +byte* game_logic::ytiles#3 +volatile byte game_logic_substep loadstore +volatile byte game_playable loadstore +void gameplay_run() +bool~ gameplay_run::$10 +bool~ gameplay_run::$11 +bool~ gameplay_run::$12 +bool~ gameplay_run::$13 +bool~ gameplay_run::$14 +bool~ gameplay_run::$15 +word~ gameplay_run::$4 +bool~ gameplay_run::$8 +bool~ gameplay_run::$9 +byte gameplay_run::i +byte gameplay_run::i#0 +byte gameplay_run::i#1 +byte gameplay_run::i#2 +byte gameplay_run::i#3 +byte gameplay_run::i1 +byte gameplay_run::i1#0 +byte gameplay_run::i1#1 +byte gameplay_run::i1#2 +byte gameplay_run::i1#3 +byte gameplay_run::i2 +byte gameplay_run::i2#0 +byte gameplay_run::i2#1 +byte gameplay_run::i2#2 +byte gameplay_run::i2#3 +volatile byte ghost1_direction loadstore +volatile byte ghost1_respawn loadstore +volatile byte ghost1_reverse loadstore +volatile byte ghost1_substep loadstore +volatile byte ghost1_xfine loadstore +volatile byte ghost1_yfine loadstore +volatile byte ghost2_direction loadstore +volatile byte ghost2_respawn loadstore +volatile byte ghost2_reverse loadstore +volatile byte ghost2_substep loadstore +volatile byte ghost2_xfine loadstore +volatile byte ghost2_yfine loadstore +volatile byte ghost3_direction loadstore +volatile byte ghost3_respawn loadstore +volatile byte ghost3_reverse loadstore +volatile byte ghost3_substep loadstore +volatile byte ghost3_xfine loadstore +volatile byte ghost3_yfine loadstore +volatile byte ghost4_direction loadstore +volatile byte ghost4_respawn loadstore +volatile byte ghost4_reverse loadstore +volatile byte ghost4_substep loadstore +volatile byte ghost4_xfine loadstore +volatile byte ghost4_yfine loadstore +const byte* ghost_frames[] = { 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 } +volatile byte ghosts_mode loadstore +volatile byte ghosts_mode_count loadstore +void init_bobs_restore() +bool~ init_bobs_restore::$0 +bool~ init_bobs_restore::$1 +byte~ init_bobs_restore::$2 +byte~ init_bobs_restore::$3 +byte~ init_bobs_restore::$4 +byte~ init_bobs_restore::$5 +const byte* init_bobs_restore::CANVAS_HIDDEN = (byte*)$ea00 +byte init_bobs_restore::bob +byte init_bobs_restore::bob#0 +byte init_bobs_restore::bob#1 +byte init_bobs_restore::bob#2 +byte init_bobs_restore::bob#3 +byte init_bobs_restore::bob#4 +byte init_bobs_restore::bob#5 +byte init_bobs_restore::bob#6 +byte* init_bobs_restore::bob_restore +byte* init_bobs_restore::bob_restore#0 +byte* init_bobs_restore::bob_restore#1 +byte* init_bobs_restore::bob_restore#2 +byte* init_bobs_restore::bob_restore#3 +byte* init_bobs_restore::bob_restore#4 +byte* init_bobs_restore::bob_restore#5 +byte* init_bobs_restore::bob_restore#6 +byte init_bobs_restore::i +byte init_bobs_restore::i#0 +byte init_bobs_restore::i#1 +byte init_bobs_restore::i#2 +byte init_bobs_restore::i#3 +void init_level_tile_directions() +bool~ init_level_tile_directions::$0 +bool~ init_level_tile_directions::$1 +number~ init_level_tile_directions::$10 +byte~ init_level_tile_directions::$11 +bool~ init_level_tile_directions::$12 +bool~ init_level_tile_directions::$13 +number~ init_level_tile_directions::$14 +byte~ init_level_tile_directions::$15 +bool~ init_level_tile_directions::$16 +bool~ init_level_tile_directions::$17 +number~ init_level_tile_directions::$2 +byte~ init_level_tile_directions::$3 +bool~ init_level_tile_directions::$4 +bool~ init_level_tile_directions::$5 +number~ init_level_tile_directions::$6 +byte~ init_level_tile_directions::$7 +bool~ init_level_tile_directions::$8 +bool~ init_level_tile_directions::$9 +byte* init_level_tile_directions::directions +byte* init_level_tile_directions::directions#0 +byte* init_level_tile_directions::directions#1 +byte* init_level_tile_directions::directions#10 +byte* init_level_tile_directions::directions#11 +byte* init_level_tile_directions::directions#12 +byte* init_level_tile_directions::directions#13 +byte* init_level_tile_directions::directions#14 +byte* init_level_tile_directions::directions#15 +byte* init_level_tile_directions::directions#16 +byte* init_level_tile_directions::directions#17 +byte* init_level_tile_directions::directions#18 +byte* init_level_tile_directions::directions#2 +byte* init_level_tile_directions::directions#3 +byte* init_level_tile_directions::directions#4 +byte* init_level_tile_directions::directions#5 +byte* init_level_tile_directions::directions#6 +byte* init_level_tile_directions::directions#7 +byte* init_level_tile_directions::directions#8 +byte* init_level_tile_directions::directions#9 +byte init_level_tile_directions::open_directions +byte init_level_tile_directions::open_directions#0 +byte init_level_tile_directions::open_directions#1 +byte init_level_tile_directions::open_directions#10 +byte init_level_tile_directions::open_directions#11 +byte init_level_tile_directions::open_directions#12 +byte init_level_tile_directions::open_directions#13 +byte init_level_tile_directions::open_directions#14 +byte init_level_tile_directions::open_directions#15 +byte init_level_tile_directions::open_directions#16 +byte init_level_tile_directions::open_directions#2 +byte init_level_tile_directions::open_directions#3 +byte init_level_tile_directions::open_directions#4 +byte init_level_tile_directions::open_directions#5 +byte init_level_tile_directions::open_directions#6 +byte init_level_tile_directions::open_directions#7 +byte init_level_tile_directions::open_directions#8 +byte init_level_tile_directions::open_directions#9 +byte init_level_tile_directions::xtile +byte init_level_tile_directions::xtile#0 +byte init_level_tile_directions::xtile#1 +byte init_level_tile_directions::xtile#10 +byte init_level_tile_directions::xtile#11 +byte init_level_tile_directions::xtile#12 +byte init_level_tile_directions::xtile#13 +byte init_level_tile_directions::xtile#14 +byte init_level_tile_directions::xtile#15 +byte init_level_tile_directions::xtile#2 +byte init_level_tile_directions::xtile#3 +byte init_level_tile_directions::xtile#4 +byte init_level_tile_directions::xtile#5 +byte init_level_tile_directions::xtile#6 +byte init_level_tile_directions::xtile#7 +byte init_level_tile_directions::xtile#8 +byte init_level_tile_directions::xtile#9 +byte init_level_tile_directions::ytile +byte init_level_tile_directions::ytile#0 +byte init_level_tile_directions::ytile#1 +byte init_level_tile_directions::ytile#10 +byte init_level_tile_directions::ytile#11 +byte init_level_tile_directions::ytile#12 +byte init_level_tile_directions::ytile#13 +byte init_level_tile_directions::ytile#14 +byte init_level_tile_directions::ytile#15 +byte init_level_tile_directions::ytile#16 +byte init_level_tile_directions::ytile#17 +byte init_level_tile_directions::ytile#18 +byte init_level_tile_directions::ytile#2 +byte init_level_tile_directions::ytile#3 +byte init_level_tile_directions::ytile#4 +byte init_level_tile_directions::ytile#5 +byte init_level_tile_directions::ytile#6 +byte init_level_tile_directions::ytile#7 +byte init_level_tile_directions::ytile#8 +byte init_level_tile_directions::ytile#9 +void init_render_index() +bool~ init_render_index::$0 +bool~ init_render_index::$1 +word~ init_render_index::$10 +word~ init_render_index::$11 +bool~ init_render_index::$2 +bool~ init_render_index::$3 +byte*~ init_render_index::$4 +byte~ init_render_index::$5 +byte~ init_render_index::$6 +bool~ init_render_index::$7 +bool~ init_render_index::$8 +byte~ init_render_index::$9 +byte* init_render_index::canvas +byte* init_render_index::canvas#0 +byte* init_render_index::canvas_xcol +byte* init_render_index::canvas_xcol#0 +byte* init_render_index::canvas_xcol#1 +byte* init_render_index::canvas_xcol#2 +byte* init_render_index::canvas_xcol#3 +byte* init_render_index::canvas_xcol#4 +byte* init_render_index::render_index +byte* init_render_index::render_index#0 +byte* init_render_index::render_index#1 +byte* init_render_index::render_index#10 +byte* init_render_index::render_index#2 +byte* init_render_index::render_index#3 +byte* init_render_index::render_index#4 +byte* init_render_index::render_index#5 +byte* init_render_index::render_index#6 +byte* init_render_index::render_index#7 +byte* init_render_index::render_index#8 +byte* init_render_index::render_index#9 +byte* init_render_index::render_index_xcol +byte* init_render_index::render_index_xcol#0 +byte* init_render_index::render_index_xcol#1 +byte* init_render_index::render_index_xcol#2 +byte* init_render_index::render_index_xcol#3 +byte* init_render_index::render_index_xcol#4 +byte* init_render_index::render_index_xcol#5 +word* init_render_index::render_ypos_table +word* init_render_index::render_ypos_table#0 +word* init_render_index::render_ypos_table#1 +word* init_render_index::render_ypos_table#2 +word* init_render_index::render_ypos_table#3 +word* init_render_index::render_ypos_table#4 +word* init_render_index::render_ypos_table#5 +word* init_render_index::render_ypos_table#6 +byte init_render_index::x_col +byte init_render_index::x_col#0 +byte init_render_index::x_col#1 +byte init_render_index::x_col#10 +byte init_render_index::x_col#2 +byte init_render_index::x_col#3 +byte init_render_index::x_col#4 +byte init_render_index::x_col#5 +byte init_render_index::x_col#6 +byte init_render_index::x_col#7 +byte init_render_index::x_col#8 +byte init_render_index::x_col#9 +byte init_render_index::y_pos +byte init_render_index::y_pos#0 +byte init_render_index::y_pos#1 +byte init_render_index::y_pos#2 +byte init_render_index::y_pos#3 +byte init_render_index::y_pos#4 +byte init_render_index::y_pos#5 +byte init_render_index::ypos_inc_offset +byte init_render_index::ypos_inc_offset#0 +byte init_render_index::ypos_inc_offset#1 +byte init_render_index::ypos_inc_offset#2 +byte init_render_index::ypos_inc_offset#3 +byte init_render_index::ypos_inc_offset#4 +byte init_render_index::ypos_inc_offset#5 +byte init_render_index::ypos_inc_offset#6 +byte init_render_index::ypos_inc_offset#7 +byte init_render_index::ypos_inc_offset#8 +void init_sprite_pointers() +bool~ init_sprite_pointers::$0 +bool~ init_sprite_pointers::$1 +byte~ init_sprite_pointers::$2 +byte~ init_sprite_pointers::$3 +const nomodify byte init_sprite_pointers::SPRITE_ID_0 = (byte)SPRITES_1&$3fff/$40 +byte init_sprite_pointers::screen +byte init_sprite_pointers::screen#0 +byte init_sprite_pointers::screen#1 +byte init_sprite_pointers::screen#2 +byte init_sprite_pointers::screen#3 +byte init_sprite_pointers::screen#4 +byte init_sprite_pointers::screen#5 +byte init_sprite_pointers::screen#6 +byte init_sprite_pointers::sprite +byte init_sprite_pointers::sprite#0 +byte init_sprite_pointers::sprite#1 +byte init_sprite_pointers::sprite#2 +byte init_sprite_pointers::sprite#3 +byte init_sprite_pointers::sprite_id +byte init_sprite_pointers::sprite_id#0 +const byte* init_sprite_pointers::sprites_id[] = { 0, $70, $60, $50, $40, $30, $20, $10 } +byte* init_sprite_pointers::sprites_ptr_1 +byte* init_sprite_pointers::sprites_ptr_1#0 +byte* init_sprite_pointers::sprites_ptr_1#1 +byte* init_sprite_pointers::sprites_ptr_1#2 +byte* init_sprite_pointers::sprites_ptr_1#3 +byte* init_sprite_pointers::sprites_ptr_1#4 +byte* init_sprite_pointers::sprites_ptr_1#5 +byte* init_sprite_pointers::sprites_ptr_1#6 +byte* init_sprite_pointers::sprites_ptr_2 +byte* init_sprite_pointers::sprites_ptr_2#0 +byte* init_sprite_pointers::sprites_ptr_2#1 +byte* init_sprite_pointers::sprites_ptr_2#2 +byte* init_sprite_pointers::sprites_ptr_2#3 +byte* init_sprite_pointers::sprites_ptr_2#4 +byte* init_sprite_pointers::sprites_ptr_2#5 +byte* init_sprite_pointers::sprites_ptr_2#6 +__interrupt(hardware_clobber) void irq_screen_top() +byte~ irq_screen_top::$0 +number~ irq_screen_top::$1 +number~ irq_screen_top::$2 +bool~ irq_screen_top::$3 +byte~ irq_screen_top::$4 +byte~ irq_screen_top::$5 +bool~ irq_screen_top::$8 +number~ irq_screen_top::toD0181_$0 +number~ irq_screen_top::toD0181_$1 +number~ irq_screen_top::toD0181_$2 +byte~ irq_screen_top::toD0181_$3 +number~ irq_screen_top::toD0181_$4 +number~ irq_screen_top::toD0181_$5 +number~ irq_screen_top::toD0181_$6 +word~ irq_screen_top::toD0181_$7 +byte* irq_screen_top::toD0181_gfx +byte* irq_screen_top::toD0181_gfx#0 +byte* irq_screen_top::toD0181_gfx#1 +byte irq_screen_top::toD0181_return +byte irq_screen_top::toD0181_return#0 +byte irq_screen_top::toD0181_return#1 +byte irq_screen_top::toD0181_return#2 +byte irq_screen_top::toD0181_return#3 +byte* irq_screen_top::toD0181_screen +byte* irq_screen_top::toD0181_screen#0 +byte* irq_screen_top::toD0181_screen#1 +byte~ irq_screen_top::toDd001_$0 +number~ irq_screen_top::toDd001_$1 +number~ irq_screen_top::toDd001_$2 +byte* irq_screen_top::toDd001_gfx +byte* irq_screen_top::toDd001_gfx#0 +byte* irq_screen_top::toDd001_gfx#1 +byte irq_screen_top::toDd001_return +byte irq_screen_top::toDd001_return#0 +byte irq_screen_top::toDd001_return#1 +byte irq_screen_top::toDd001_return#2 +byte irq_screen_top::toDd001_return#3 +byte~ irq_screen_top::toDd002_$0 +number~ irq_screen_top::toDd002_$1 +number~ irq_screen_top::toDd002_$2 +byte* irq_screen_top::toDd002_gfx +byte* irq_screen_top::toDd002_gfx#0 +byte* irq_screen_top::toDd002_gfx#1 +byte irq_screen_top::toDd002_return +byte irq_screen_top::toDd002_return#0 +byte irq_screen_top::toDd002_return#1 +byte irq_screen_top::toDd002_return#2 +byte irq_screen_top::toDd002_return#3 +byte joyfire() +number~ joyfire::$0 +bool~ joyfire::$1 +byte joyfire::return +byte joyfire::return#0 +byte joyfire::return#1 +byte joyfire::return#2 +byte joyfire::return#3 +byte joyfire::return#4 +byte joyfire::return#5 +byte joyfire::return#6 +byte joyfire::return#7 +void joyinit() +volatile byte* left_canvas loadstore +volatile byte* left_render_index_xcol loadstore +volatile byte left_ypos_inc_offset loadstore +word level_show() +bool~ level_show::$0 +bool~ level_show::$1 +bool~ level_show::$2 +bool~ level_show::$3 +bool~ level_show::$4 +bool~ level_show::$5 +word level_show::count +word level_show::count#0 +word level_show::count#1 +word level_show::count#10 +word level_show::count#11 +word level_show::count#12 +word level_show::count#13 +word level_show::count#2 +word level_show::count#3 +word level_show::count#4 +word level_show::count#5 +word level_show::count#6 +word level_show::count#7 +word level_show::count#8 +word level_show::count#9 +byte* level_show::level +byte* level_show::level#0 +byte* level_show::level#1 +byte* level_show::level#10 +byte* level_show::level#11 +byte* level_show::level#2 +byte* level_show::level#3 +byte* level_show::level#4 +byte* level_show::level#5 +byte* level_show::level#6 +byte* level_show::level#7 +byte* level_show::level#8 +byte* level_show::level#9 +word level_show::return +word level_show::return#0 +word level_show::return#1 +word level_show::return#2 +word level_show::return#3 +word level_show::return#4 +byte level_show::tile_left +byte level_show::tile_left#0 +byte level_show::tile_left#1 +byte level_show::tile_left#2 +byte level_show::tile_left#3 +byte level_show::tile_left#4 +byte level_show::tile_right +byte level_show::tile_right#0 +byte level_show::tile_right#1 +byte level_show::tile_right#2 +byte level_show::xcol +byte level_show::xcol#0 +byte level_show::xcol#1 +byte level_show::xcol#2 +byte level_show::xcol#3 +byte level_show::xcol#4 +byte level_show::xcol#5 +byte level_show::xcol#6 +byte level_show::xcol#7 +byte level_show::xcol#8 +byte level_show::xtile +byte level_show::xtile#0 +byte level_show::xtile#1 +byte level_show::xtile#2 +byte level_show::xtile#3 +byte level_show::xtile#4 +byte level_show::xtile#5 +byte level_show::xtile#6 +byte level_show::xtile#7 +byte level_show::xtile#8 +byte level_show::xtile#9 +byte level_show::ytile +byte level_show::ytile#0 +byte level_show::ytile#1 +byte level_show::ytile#10 +byte level_show::ytile#11 +byte level_show::ytile#2 +byte level_show::ytile#3 +byte level_show::ytile#4 +byte level_show::ytile#5 +byte level_show::ytile#6 +byte level_show::ytile#7 +byte level_show::ytile#8 +byte level_show::ytile#9 +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +bool~ level_tile_directions::$0 +bool~ level_tile_directions::$1 +bool~ level_tile_directions::$2 +bool~ level_tile_directions::$3 +byte*~ level_tile_directions::$4 +byte~ level_tile_directions::$5 +byte level_tile_directions::return +byte level_tile_directions::return#0 +byte level_tile_directions::return#1 +byte level_tile_directions::return#10 +byte level_tile_directions::return#11 +byte level_tile_directions::return#12 +byte level_tile_directions::return#13 +byte level_tile_directions::return#2 +byte level_tile_directions::return#3 +byte level_tile_directions::return#4 +byte level_tile_directions::return#5 +byte level_tile_directions::return#6 +byte level_tile_directions::return#7 +byte level_tile_directions::return#8 +byte level_tile_directions::return#9 +byte level_tile_directions::xtile +byte level_tile_directions::xtile#0 +byte level_tile_directions::xtile#1 +byte level_tile_directions::xtile#2 +byte level_tile_directions::xtile#3 +byte level_tile_directions::xtile#4 +byte level_tile_directions::xtile#5 +byte level_tile_directions::xtile#6 +byte level_tile_directions::ytile +byte level_tile_directions::ytile#0 +byte level_tile_directions::ytile#1 +byte level_tile_directions::ytile#2 +byte level_tile_directions::ytile#3 +byte level_tile_directions::ytile#4 +byte level_tile_directions::ytile#5 +byte level_tile_directions::ytile#6 +byte* level_tile_directions::ytiles +byte* level_tile_directions::ytiles#0 +byte level_tile_get(byte level_tile_get::xtile , byte level_tile_get::ytile) +bool~ level_tile_get::$0 +bool~ level_tile_get::$1 +bool~ level_tile_get::$2 +bool~ level_tile_get::$3 +byte*~ level_tile_get::$4 +byte~ level_tile_get::$5 +byte level_tile_get::return +byte level_tile_get::return#0 +byte level_tile_get::return#1 +byte level_tile_get::return#10 +byte level_tile_get::return#11 +byte level_tile_get::return#2 +byte level_tile_get::return#3 +byte level_tile_get::return#4 +byte level_tile_get::return#5 +byte level_tile_get::return#6 +byte level_tile_get::return#7 +byte level_tile_get::return#8 +byte level_tile_get::return#9 +byte level_tile_get::xtile +byte level_tile_get::xtile#0 +byte level_tile_get::xtile#1 +byte level_tile_get::xtile#2 +byte level_tile_get::xtile#3 +byte level_tile_get::xtile#4 +byte level_tile_get::xtile#5 +byte level_tile_get::ytile +byte level_tile_get::ytile#0 +byte level_tile_get::ytile#1 +byte level_tile_get::ytile#2 +byte level_tile_get::ytile#3 +byte level_tile_get::ytile#4 +byte level_tile_get::ytile#5 +byte* level_tile_get::ytiles +byte* level_tile_get::ytiles#0 +volatile byte logic_tile_left_idx loadstore +volatile to_volatile byte* logic_tile_ptr loadstore +volatile byte logic_tile_right_idx loadstore +volatile byte logic_tile_xcol loadstore +volatile byte logic_tile_yfine loadstore +void main() +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +byte*~ memcpy::$0 +bool~ memcpy::$1 +byte*~ memcpy::$2 +void* memcpy::destination +void* memcpy::destination#0 +void* memcpy::destination#1 +void* memcpy::destination#2 +void* memcpy::destination#3 +void* memcpy::destination#4 +byte* memcpy::dst +byte* memcpy::dst#0 +byte* memcpy::dst#1 +byte* memcpy::dst#2 +byte* memcpy::dst#3 +word memcpy::num +word memcpy::num#0 +word memcpy::num#1 +void* memcpy::return +void* memcpy::return#0 +void* memcpy::return#1 +void* memcpy::return#2 +void* memcpy::return#3 +void* memcpy::source +void* memcpy::source#0 +void* memcpy::source#1 +byte* memcpy::src +byte* memcpy::src#0 +byte* memcpy::src#1 +byte* memcpy::src#2 +byte* memcpy::src#3 +byte* memcpy::src_end +byte* memcpy::src_end#0 +byte* memcpy::src_end#1 +byte* memcpy::src_end#2 +void* memset(void* memset::str , byte memset::c , word memset::num) +bool~ memset::$0 +bool~ memset::$1 +byte*~ memset::$2 +bool~ memset::$3 +byte*~ memset::$4 +byte memset::c +byte memset::c#0 +byte memset::c#1 +byte memset::c#2 +byte memset::c#3 +byte memset::c#4 +byte memset::c#5 +byte memset::c#6 +byte memset::c#7 +byte memset::c#8 +byte* memset::dst +byte* memset::dst#0 +byte* memset::dst#1 +byte* memset::dst#2 +byte* memset::dst#3 +byte* memset::end +byte* memset::end#0 +byte* memset::end#1 +byte* memset::end#2 +word memset::num +word memset::num#0 +word memset::num#1 +word memset::num#2 +word memset::num#3 +word memset::num#4 +word memset::num#5 +word memset::num#6 +void* memset::return +void* memset::return#0 +void* memset::return#1 +void* memset::return#2 +void* memset::return#3 +void* memset::return#4 +void* memset::return#5 +void* memset::return#6 +void* memset::return#7 +void* memset::str +void* memset::str#0 +void* memset::str#1 +void* memset::str#2 +void* memset::str#3 +void* memset::str#4 +void* memset::str#5 +void* memset::str#6 +void* memset::str#7 +void* memset::str#8 +void* memset::str#9 +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +bool~ merge_code::$0 +bool~ merge_code::$1 +bool~ merge_code::$10 +bool~ merge_code::$11 +bool~ merge_code::$12 +bool~ merge_code::$13 +bool~ merge_code::$14 +bool~ merge_code::$15 +bool~ merge_code::$2 +bool~ merge_code::$3 +bool~ merge_code::$4 +number~ merge_code::$5 +bool~ merge_code::$6 +bool~ merge_code::$7 +bool~ merge_code::$8 +bool~ merge_code::$9 +const nomodify byte merge_code::LOGIC_END = $ff +const nomodify byte merge_code::LOGIC_EXIT = 0 +const nomodify byte merge_code::RASTER_END = $ff +const nomodify byte merge_code::RASTER_EXIT = 0 +byte merge_code::cycle_budget +byte merge_code::cycle_budget#0 +byte merge_code::cycle_budget#1 +byte merge_code::cycle_budget#10 +byte merge_code::cycle_budget#11 +byte merge_code::cycle_budget#12 +byte merge_code::cycle_budget#13 +byte merge_code::cycle_budget#2 +byte merge_code::cycle_budget#3 +byte merge_code::cycle_budget#4 +byte merge_code::cycle_budget#5 +byte merge_code::cycle_budget#6 +byte merge_code::cycle_budget#7 +byte merge_code::cycle_budget#8 +byte merge_code::cycle_budget#9 +byte* merge_code::dest_code +byte* merge_code::dest_code#0 +byte* merge_code::dest_code#1 +byte* merge_code::dest_code#10 +byte* merge_code::dest_code#11 +byte* merge_code::dest_code#12 +byte* merge_code::dest_code#13 +byte* merge_code::dest_code#14 +byte* merge_code::dest_code#15 +byte* merge_code::dest_code#16 +byte* merge_code::dest_code#17 +byte* merge_code::dest_code#18 +byte* merge_code::dest_code#19 +byte* merge_code::dest_code#2 +byte* merge_code::dest_code#20 +byte* merge_code::dest_code#21 +byte* merge_code::dest_code#22 +byte* merge_code::dest_code#23 +byte* merge_code::dest_code#24 +byte* merge_code::dest_code#25 +byte* merge_code::dest_code#26 +byte* merge_code::dest_code#27 +byte* merge_code::dest_code#3 +byte* merge_code::dest_code#4 +byte* merge_code::dest_code#5 +byte* merge_code::dest_code#6 +byte* merge_code::dest_code#7 +byte* merge_code::dest_code#8 +byte* merge_code::dest_code#9 +byte* merge_code::logic_code +byte* merge_code::logic_code#0 +byte* merge_code::logic_code#1 +byte* merge_code::logic_code#10 +byte* merge_code::logic_code#11 +byte* merge_code::logic_code#12 +byte* merge_code::logic_code#13 +byte* merge_code::logic_code#14 +byte* merge_code::logic_code#15 +byte* merge_code::logic_code#16 +byte* merge_code::logic_code#17 +byte* merge_code::logic_code#18 +byte* merge_code::logic_code#19 +byte* merge_code::logic_code#2 +byte* merge_code::logic_code#20 +byte* merge_code::logic_code#21 +byte* merge_code::logic_code#22 +byte* merge_code::logic_code#23 +byte* merge_code::logic_code#24 +byte* merge_code::logic_code#25 +byte* merge_code::logic_code#3 +byte* merge_code::logic_code#4 +byte* merge_code::logic_code#5 +byte* merge_code::logic_code#6 +byte* merge_code::logic_code#7 +byte* merge_code::logic_code#8 +byte* merge_code::logic_code#9 +byte merge_code::logic_cycles +byte merge_code::logic_cycles#0 +byte merge_code::logic_cycles#1 +byte merge_code::logic_cycles#2 +byte merge_code::logic_cycles#3 +byte merge_code::logic_cycles#4 +byte* merge_code::raster_code +byte* merge_code::raster_code#0 +byte* merge_code::raster_code#1 +byte* merge_code::raster_code#10 +byte* merge_code::raster_code#11 +byte* merge_code::raster_code#12 +byte* merge_code::raster_code#13 +byte* merge_code::raster_code#14 +byte* merge_code::raster_code#15 +byte* merge_code::raster_code#16 +byte* merge_code::raster_code#17 +byte* merge_code::raster_code#2 +byte* merge_code::raster_code#3 +byte* merge_code::raster_code#4 +byte* merge_code::raster_code#5 +byte* merge_code::raster_code#6 +byte* merge_code::raster_code#7 +byte* merge_code::raster_code#8 +byte* merge_code::raster_code#9 +const nomodify void()* musicInit = (void()*)INTRO_MUSIC+0 +const nomodify void()* musicPlay = (void()*)INTRO_MUSIC+6 +volatile byte music_play_next loadstore +volatile byte pacman_ch1_enabled loadstore +volatile byte pacman_ch1_idx loadstore +volatile byte pacman_direction loadstore +const byte* pacman_frames[] = { 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c } +volatile byte pacman_lives loadstore +void pacman_sound_init() +void pacman_sound_play() +bool~ pacman_sound_play::$0 +byte~ pacman_sound_play::$1 +bool~ pacman_sound_play::$2 +bool~ pacman_sound_play::$3 +bool~ pacman_sound_play::$4 +volatile byte pacman_substep loadstore +volatile byte pacman_wins loadstore +volatile byte pacman_xfine loadstore +volatile byte pacman_yfine loadstore +volatile byte phase loadstore +volatile word pill_count loadstore +void render(byte render::xcol , byte render::ypos , byte render::pixels) +number~ render::$0 +byte~ render::$1 +number~ render::$2 +byte*~ render::$3 +byte*~ render::$4 +number~ render::$5 +bool~ render::$6 +byte* render::canvas1 +byte* render::canvas1#0 +byte* render::canvas1#1 +byte* render::canvas1#2 +byte* render::canvas1#3 +byte* render::canvas1#4 +byte* render::canvas2 +byte* render::canvas2#0 +byte* render::canvas2#1 +byte* render::canvas2#2 +byte* render::canvas2#3 +byte* render::canvas2#4 +word render::canvas_offset +word render::canvas_offset#0 +byte render::i +byte render::i#0 +byte render::i#1 +byte render::i#2 +byte render::i#3 +byte render::pixels +byte render::pixels#0 +byte render::pixels#1 +byte render::pixels#2 +byte render::pixels#3 +byte render::pixels#4 +byte render::pixels#5 +byte* render::render_index_xcol +byte* render::render_index_xcol#0 +byte render::xcol +byte render::xcol#0 +byte render::xcol#1 +byte render::xcol#2 +byte render::ypix +byte render::ypix#0 +byte render::ypix#1 +byte render::ypix#2 +byte render::ypos +byte render::ypos#0 +byte render::ypos#1 +byte render::ypos#2 +byte render::ypos_inc_offset +byte render::ypos_inc_offset#0 +byte render::ypos_inc_offset#1 +byte render::ypos_inc_offset#2 +byte render::ypos_inc_offset#3 +byte render::ytile +byte render::ytile#0 +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +number~ render_tiles::$0 +byte*~ render_tiles::$1 +number~ render_tiles::$2 +byte*~ render_tiles::$3 +byte~ render_tiles::$4 +number~ render_tiles::$5 +byte*~ render_tiles::$6 +byte*~ render_tiles::$7 +bool~ render_tiles::$8 +byte~ render_tiles::$9 +byte* render_tiles::canvas1 +byte* render_tiles::canvas1#0 +byte* render_tiles::canvas1#1 +byte* render_tiles::canvas1#2 +byte* render_tiles::canvas1#3 +byte* render_tiles::canvas2 +byte* render_tiles::canvas2#0 +byte* render_tiles::canvas2#1 +byte* render_tiles::canvas2#2 +byte* render_tiles::canvas2#3 +word render_tiles::canvas_offset +word render_tiles::canvas_offset#0 +byte render_tiles::pixels +byte render_tiles::pixels#0 +byte* render_tiles::render_index_xcol +byte* render_tiles::render_index_xcol#0 +byte render_tiles::tile_left +byte render_tiles::tile_left#0 +byte render_tiles::tile_left#1 +byte* render_tiles::tile_left_pixels +byte* render_tiles::tile_left_pixels#0 +byte* render_tiles::tile_left_pixels#1 +byte* render_tiles::tile_left_pixels#2 +byte render_tiles::tile_right +byte render_tiles::tile_right#0 +byte render_tiles::tile_right#1 +byte* render_tiles::tile_right_pixels +byte* render_tiles::tile_right_pixels#0 +byte* render_tiles::tile_right_pixels#1 +byte* render_tiles::tile_right_pixels#2 +byte render_tiles::xcol +byte render_tiles::xcol#0 +byte render_tiles::xcol#1 +byte render_tiles::y +byte render_tiles::y#0 +byte render_tiles::y#1 +byte render_tiles::y#2 +byte render_tiles::y#3 +byte render_tiles::ypos_inc_offset +byte render_tiles::ypos_inc_offset#0 +byte render_tiles::ypos_inc_offset#1 +byte render_tiles::ypos_inc_offset#2 +byte render_tiles::ypos_inc_offset#3 +byte render_tiles::ytile +byte render_tiles::ytile#0 +byte render_tiles::ytile#1 +volatile byte* rigt_canvas loadstore +volatile byte* rigt_render_index_xcol loadstore +volatile byte rigt_ypos_inc_offset loadstore +volatile byte side_sprites_color loadstore +volatile byte side_sprites_mc loadstore +void spawn_all() +void splash_run() +byte~ splash_run::$17 +byte~ splash_run::$18 +bool~ splash_run::$22 +number~ splash_run::$23 +number~ splash_run::$24 +byte~ splash_run::$25 +bool~ splash_run::$26 +bool~ splash_run::$27 +bool~ splash_run::$28 +bool~ splash_run::$29 +byte~ splash_run::$30 +bool~ splash_run::$31 +bool~ splash_run::$32 +byte~ splash_run::$34 +bool~ splash_run::$35 +bool~ splash_run::$36 +bool~ splash_run::$37 +byte splash_run::i +byte splash_run::i#0 +byte splash_run::i#1 +byte splash_run::i#2 +byte splash_run::i#3 +byte splash_run::i#4 +byte splash_run::i#5 +byte splash_run::i1 +byte splash_run::i1#0 +byte splash_run::i1#1 +byte splash_run::i1#2 +byte splash_run::i1#3 +byte splash_run::i2 +byte splash_run::i2#0 +byte splash_run::i2#1 +byte splash_run::i2#2 +byte splash_run::i2#3 +byte splash_run::msb +byte splash_run::msb#0 +byte splash_run::msb#1 +byte splash_run::msb#10 +byte splash_run::msb#11 +byte splash_run::msb#12 +byte splash_run::msb#13 +byte splash_run::msb#2 +byte splash_run::msb#3 +byte splash_run::msb#4 +byte splash_run::msb#5 +byte splash_run::msb#6 +byte splash_run::msb#7 +byte splash_run::msb#8 +byte splash_run::msb#9 +const word* splash_run::sprites_xpos[] = { $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f } +number~ splash_run::toD0181_$0 +number~ splash_run::toD0181_$1 +number~ splash_run::toD0181_$2 +byte~ splash_run::toD0181_$3 +number~ splash_run::toD0181_$4 +number~ splash_run::toD0181_$5 +number~ splash_run::toD0181_$6 +word~ splash_run::toD0181_$7 +byte* splash_run::toD0181_gfx +byte* splash_run::toD0181_gfx#0 +byte* splash_run::toD0181_gfx#1 +byte splash_run::toD0181_return +byte splash_run::toD0181_return#0 +byte splash_run::toD0181_return#1 +byte splash_run::toD0181_return#2 +byte splash_run::toD0181_return#3 +byte* splash_run::toD0181_screen +byte* splash_run::toD0181_screen#0 +byte* splash_run::toD0181_screen#1 +byte~ splash_run::toDd001_$0 +number~ splash_run::toDd001_$1 +number~ splash_run::toDd001_$2 +byte* splash_run::toDd001_gfx +byte* splash_run::toDd001_gfx#0 +byte* splash_run::toDd001_gfx#1 +byte splash_run::toDd001_return +byte splash_run::toDd001_return#0 +byte splash_run::toDd001_return#1 +byte splash_run::toDd001_return#2 +byte splash_run::toDd001_return#3 +word splash_run::xpos +word splash_run::xpos#0 +void splash_show() +bool~ splash_show::$0 +bool~ splash_show::$1 +byte splash_show::pixels +byte splash_show::pixels#0 +byte* splash_show::splash +byte* splash_show::splash#0 +byte* splash_show::splash#1 +byte* splash_show::splash#2 +byte* splash_show::splash#3 +byte* splash_show::splash#4 +byte* splash_show::splash#5 +byte* splash_show::splash#6 +byte* splash_show::splash#7 +byte splash_show::xcol +byte splash_show::xcol#0 +byte splash_show::xcol#1 +byte splash_show::xcol#2 +byte splash_show::xcol#3 +byte splash_show::xcol#4 +byte splash_show::xcol#5 +byte splash_show::xcol#6 +byte splash_show::xcol#7 +byte splash_show::ypos +byte splash_show::ypos#0 +byte splash_show::ypos#1 +byte splash_show::ypos#2 +byte splash_show::ypos#3 +byte splash_show::ypos#4 +volatile byte top_sprites_color loadstore +volatile byte top_sprites_mc loadstore + +Fixing inline constructor with render::$7 = (byte)render::$1 w= (byte)render::$2 +Fixing inline constructor with render::$8 = (byte)render::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI] w= (byte)render::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] +Fixing inline constructor with render_tiles::$10 = (byte)render_tiles::$4 w= (byte)render_tiles::$5 +Fixing inline constructor with render_tiles::$11 = (byte)render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI] w= (byte)render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] +Successful SSA optimization Pass2FixInlineConstructors +Adding number conversion cast (unumber) $a00 in +Adding number conversion cast (unumber) $a80 in +Adding number conversion cast (unumber) $b00 in +Adding number conversion cast (unumber) BOB_ROW_SIZE*6 in +Adding number conversion cast (unumber) 6 in +Adding number conversion cast (unumber) BOB_ROW_SIZE*$c in +Adding number conversion cast (unumber) $c in +Adding number conversion cast (unumber) BOB_ROW_SIZE*$12 in +Adding number conversion cast (unumber) $12 in +Adding number conversion cast (unumber) 2 in +Adding number conversion cast (unumber) 0 in +Adding number conversion cast (unumber) 6 in +Adding number conversion cast (unumber) $3fff in +Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#5 > 0 +Adding number conversion cast (unumber) 0 in merge_code::$3 = merge_code::cycle_budget#4 > 0 +Adding number conversion cast (unumber) 1 in merge_code::$5 = merge_code::cycle_budget#5 - 1 +Adding number conversion cast (unumber) merge_code::$5 in merge_code::$5 = merge_code::cycle_budget#5 - (unumber)1 +Adding number conversion cast (unumber) 0 in merge_code::$12 = merge_code::cycle_budget#7 > 0 +Adding number conversion cast (unumber) 3 in merge_code::$13 = merge_code::cycle_budget#8 == 3 +Adding number conversion cast (unumber) $24 in *merge_code::dest_code#10 = $24 +Adding number conversion cast (unumber) $ea in *merge_code::dest_code#2 = $ea +Adding number conversion cast (unumber) 3 in merge_code::cycle_budget#2 = merge_code::cycle_budget#9 - 3 +Adding number conversion cast (unumber) $ea in *merge_code::dest_code#11 = $ea +Adding number conversion cast (unumber) 2 in merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 +Adding number conversion cast (unumber) $60 in *merge_code::dest_code#12 = $60 +Adding number conversion cast (unumber) $f in *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f +Adding number conversion cast (unumber) 0 in *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_FREQ) = 0 +Adding number conversion cast (unumber) 0 in *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 +Adding number conversion cast (unumber) 0 in *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 +Adding number conversion cast (unumber) 0 in *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 +Adding number conversion cast (unumber) $f0 in *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 +Adding number conversion cast (unumber) 0 in pacman_sound_play::$4 = 0 != pacman_ch1_enabled +Adding number conversion cast (unumber) 0 in pacman_ch1_idx = 0 +Adding number conversion cast (unumber) 0 in pacman_ch1_enabled = 0 +Adding number conversion cast (unumber) $1a in init_render_index::$0 = init_render_index::x_col#2 < $1a +Adding number conversion cast (unumber) $18 in init_render_index::$1 = init_render_index::x_col#3 >= $18 +Adding number conversion cast (unumber) 0 in (RENDER_INDEX+$18*$100)[RENDER_OFFSET_YPOS_INC] = 0 +Adding number conversion cast (unumber) $18*$100 in (RENDER_INDEX+$18*$100)[RENDER_OFFSET_YPOS_INC] = ((unumber)) 0 +Adding number conversion cast (unumber) 0 in (RENDER_INDEX+$19*$100)[RENDER_OFFSET_YPOS_INC] = 0 +Adding number conversion cast (unumber) $19*$100 in (RENDER_INDEX+$19*$100)[RENDER_OFFSET_YPOS_INC] = ((unumber)) 0 +Adding number conversion cast (unumber) $b in init_render_index::ypos_inc_offset#1 = $b +Adding number conversion cast (unumber) $94 in init_render_index::$3 = init_render_index::y_pos#2 < $94 +Adding number conversion cast (unumber) 2 in init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 +Adding number conversion cast (unumber) $17 in init_render_index::$7 = init_render_index::ypos_inc_offset#2 >= $17 +Adding number conversion cast (unumber) $100 in init_render_index::render_index#1 = init_render_index::render_index#3 + $100 +Adding number conversion cast (unumber) 2 in init_render_index::y_pos#1 = init_render_index::y_pos#4 + 2 +Adding number conversion cast (unumber) $15 in init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#5 - $15 +Adding number conversion cast (unumber) 4 in render::$0 = render::ypos#2 / 4 +Adding number conversion cast (unumber) render::$0 in render::$0 = render::ypos#2 / (unumber)4 +Adding number conversion cast (unumber) 2 in render::$2 = render::ytile#0 * 2 +Adding number conversion cast (unumber) render::$2 in render::$2 = render::ytile#0 * (unumber)2 +Adding number conversion cast (unumber) 3 in render::$5 = render::ypos#2 & 3 +Adding number conversion cast (unumber) render::$5 in render::$5 = render::ypos#2 & (unumber)3 +Adding number conversion cast (unumber) 4 in render_tiles::$0 = render_tiles::tile_left#1 * 4 +Adding number conversion cast (unumber) render_tiles::$0 in render_tiles::$0 = render_tiles::tile_left#1 * (unumber)4 +Adding number conversion cast (unumber) 4 in render_tiles::$2 = render_tiles::tile_right#1 * 4 +Adding number conversion cast (unumber) render_tiles::$2 in render_tiles::$2 = render_tiles::tile_right#1 * (unumber)4 +Adding number conversion cast (unumber) 2 in render_tiles::$5 = render_tiles::ytile#1 * 2 +Adding number conversion cast (unumber) render_tiles::$5 in render_tiles::$5 = render_tiles::ytile#1 * (unumber)2 +Adding number conversion cast (unumber) 4 in render_tiles::$8 = render_tiles::y#2 < 4 +Adding number conversion cast (unumber) NUM_BOBS*2 in init_bobs_restore::$0 = init_bobs_restore::bob#2 < NUM_BOBS*2 +Adding number conversion cast (unumber) 2 in init_bobs_restore::$0 = init_bobs_restore::bob#2 < (unumber)NUM_BOBS*2 +Adding number conversion cast (unumber) $c in logic_tile_ptr = LEVEL_TILES+$40*$12+$c +Adding number conversion cast (unumber) $40*$12 in logic_tile_ptr = LEVEL_TILES+$40*$12+(unumber)$c +Adding number conversion cast (unumber) $c in logic_tile_xcol = $c +Adding number conversion cast (unumber) $23 in logic_tile_yfine = $23 +Adding number conversion cast (unumber) 0 in init_bobs_restore::bob_restore#2[init_bobs_restore::i#3] = 0 +Adding number conversion cast (unumber) 0 in init_bobs_restore::bob_restore#3[0] = init_bobs_restore::$2 +Adding number conversion cast (unumber) 1 in init_bobs_restore::bob_restore#3[1] = init_bobs_restore::$3 +Adding number conversion cast (unumber) 3 in init_bobs_restore::bob_restore#3[3] = init_bobs_restore::$4 +Adding number conversion cast (unumber) 4 in init_bobs_restore::bob_restore#3[4] = init_bobs_restore::$5 +Adding number conversion cast (unumber) 0 in game_playable = 0 +Adding number conversion cast (unumber) 0 in phase = 0 +Adding number conversion cast (unumber) $2f in done_run::$1 = done_run::i#2 < $2f +Adding number conversion cast (unumber) 0 in ((byte*)SID)[done_run::i#3] = 0 +Adding number conversion cast (unumber) 4 in done_run::$2 = done_run::i1#2 < 4 +Adding number conversion cast (unumber) $a in bobs_xcol[done_run::i1#3] = $a +Adding number conversion cast (unumber) $2d in bobs_yfine[done_run::i1#3] = $2d +Adding number conversion cast (unumber) 0 in bobs_bob_id[done_run::i1#3] = 0 +Adding number conversion cast (unumber) 0 in done_run::$12 = 0 != pacman_wins +Adding number conversion cast (unumber) $19 in done_run::$5 = done_run::xcol#2 < $19 +Adding number conversion cast (unumber) 0 in music_play_next = 0 +Adding number conversion cast (unumber) $19 in done_run::$6 = done_run::ypos#2 < $19 +Adding number conversion cast (unumber) 0 in done_run::$13 = 0 != done_run::$8 +Adding number conversion cast (unumber) 0 in done_run::$14 = 0 != music_play_next +Adding number conversion cast (unumber) 0 in music_play_next = 0 +Adding number conversion cast (unumber) 0 in memset::c#0 = 0 +Adding number conversion cast (unumber) $c00 in memset::num#0 = $c00 +Adding number conversion cast (unumber) $2000 in memset::str#1 = (void*)BANK_1+$2000 +Adding number conversion cast (unumber) 0 in memset::c#1 = 0 +Adding number conversion cast (unumber) $1fff in memset::num#1 = $1fff +Adding number conversion cast (unumber) 0 in memset::c#2 = 0 +Adding number conversion cast (unumber) $3fff in memset::num#2 = $3fff +Adding number conversion cast (unumber) 0 in memset::c#3 = 0 +Adding number conversion cast (unumber) $1fff in memset::num#3 = $1fff +Adding number conversion cast (unumber) 0 in memset::c#4 = 0 +Adding number conversion cast (unumber) 8 in splash_run::$22 = splash_run::i#2 < 8 +Adding number conversion cast (unumber) 2 in splash_run::$23 = splash_run::i#3 * 2 +Adding number conversion cast (unumber) splash_run::$23 in splash_run::$23 = splash_run::i#3 * (unumber)2 +Adding number conversion cast (unumber) 7 in SPRITES_YPOS[splash_run::$23] = 7 +Adding number conversion cast (unumber) 2 in splash_run::$24 = splash_run::i#3 * 2 +Adding number conversion cast (unumber) splash_run::$24 in splash_run::$24 = splash_run::i#3 * (unumber)2 +Adding number conversion cast (unumber) 2 in splash_run::msb#1 = splash_run::msb#3 / 2 +Adding number conversion cast (unumber) 0 in splash_run::$35 = 0 != splash_run::$25 +Adding number conversion cast (unumber) $40 in splash_run::toDd001_$1 = splash_run::toDd001_$0 / $40 +Adding number conversion cast (unumber) splash_run::toDd001_$1 in splash_run::toDd001_$1 = splash_run::toDd001_$0 / (unumber)$40 +Adding number conversion cast (unumber) 3 in splash_run::toDd001_$2 = 3 ^ splash_run::toDd001_$1 +Adding number conversion cast (unumber) splash_run::toDd001_$2 in splash_run::toDd001_$2 = (unumber)3 ^ splash_run::toDd001_$1 +Adding number conversion cast (unumber) $3fff in splash_run::toD0181_$0 = splash_run::toD0181_$7 & $3fff +Adding number conversion cast (unumber) splash_run::toD0181_$0 in splash_run::toD0181_$0 = splash_run::toD0181_$7 & (unumber)$3fff +Adding number conversion cast (unumber) 4 in splash_run::toD0181_$1 = splash_run::toD0181_$0 * 4 +Adding number conversion cast (unumber) splash_run::toD0181_$1 in splash_run::toD0181_$1 = splash_run::toD0181_$0 * (unumber)4 +Adding number conversion cast (unumber) splash_run::toD0181_$2 in splash_run::toD0181_$2 = > splash_run::toD0181_$1 +Adding number conversion cast (unumber) 4 in splash_run::toD0181_$4 = splash_run::toD0181_$3 / 4 +Adding number conversion cast (unumber) splash_run::toD0181_$4 in splash_run::toD0181_$4 = splash_run::toD0181_$3 / (unumber)4 +Adding number conversion cast (unumber) $f in splash_run::toD0181_$5 = splash_run::toD0181_$4 & $f +Adding number conversion cast (unumber) splash_run::toD0181_$5 in splash_run::toD0181_$5 = splash_run::toD0181_$4 & (unumber)$f +Adding number conversion cast (unumber) splash_run::toD0181_$6 in splash_run::toD0181_$6 = splash_run::toD0181_$2 | splash_run::toD0181_$5 +Adding number conversion cast (unumber) $ff in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff +Adding number conversion cast (unumber) $ff in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff +Adding number conversion cast (unumber) 3 in top_sprites_mc = 3 +Adding number conversion cast (unumber) 0 in side_sprites_mc = 0 +Adding number conversion cast (unumber) 3 in bottom_sprites_mc = 3 +Adding number conversion cast (unumber) $80 in splash_run::msb#2 = splash_run::msb#5 | $80 +Adding number conversion cast (unumber) 8 in splash_run::$27 = splash_run::i1#2 < 8 +Adding number conversion cast (unumber) 8 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 +Adding number conversion cast (unumber) 4 in splash_run::$28 = splash_run::i2#2 < 4 +Adding number conversion cast (unumber) $a in bobs_xcol[splash_run::i2#3] = $a +Adding number conversion cast (unumber) $2d in bobs_yfine[splash_run::i2#3] = $2d +Adding number conversion cast (unumber) 0 in bobs_bob_id[splash_run::i2#3] = 0 +Adding number conversion cast (unumber) 0 in phase = 0 +Adding number conversion cast (unumber) $fa in splash_run::$29 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fa +Adding number conversion cast (unumber) $f in *IRQ_STATUS = $f +Adding number conversion cast (unumber) 0 in music_play_next = 0 +Adding number conversion cast (unumber) 0 in splash_run::$36 = 0 != splash_run::$30 +Adding number conversion cast (unumber) 0 in splash_run::$37 = 0 != music_play_next +Adding number conversion cast (unumber) 0 in music_play_next = 0 +Adding number conversion cast (unumber) $2f in gameplay_run::$8 = gameplay_run::i#2 < $2f +Adding number conversion cast (unumber) 0 in ((byte*)SID)[gameplay_run::i#3] = 0 +Adding number conversion cast (unumber) 0 in pacman_wins = 0 +Adding number conversion cast (unumber) 3 in pacman_lives = 3 +Adding number conversion cast (unumber) 8 in gameplay_run::$9 = gameplay_run::i1#2 < 8 +Adding number conversion cast (unumber) $ff in top_sprites_mc = $ff +Adding number conversion cast (unumber) $ff in side_sprites_mc = $ff +Adding number conversion cast (unumber) $ff in bottom_sprites_mc = $ff +Adding number conversion cast (unumber) 8 in gameplay_run::$10 = gameplay_run::i2#2 < 8 +Adding number conversion cast (unumber) 1 in phase = 1 +Adding number conversion cast (unumber) 1 in game_playable = 1 +Adding number conversion cast (unumber) $fb in gameplay_run::$11 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fb +Adding number conversion cast (unumber) $fa in gameplay_run::$12 = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) != $fa +Adding number conversion cast (unumber) $f in *IRQ_STATUS = $f +Adding number conversion cast (unumber) 0 in gameplay_run::$13 = pacman_lives == 0 +Adding number conversion cast (unumber) 0 in *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 +Adding number conversion cast (unumber) $10 in joyfire::$0 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $10 +Adding number conversion cast (unumber) joyfire::$0 in joyfire::$0 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & (unumber)$10 +Adding number conversion cast (unumber) 0 in joyfire::$1 = joyfire::$0 == 0 +Adding number conversion cast (unumber) 1 in joyfire::return#2 = 1 +Adding number conversion cast (unumber) 0 in joyfire::return#3 = 0 +Adding number conversion cast (unumber) $19 in splash_show::$0 = splash_show::xcol#2 < $19 +Adding number conversion cast (unumber) $93 in splash_show::$1 = splash_show::ypos#2 < $93 +Adding number conversion cast (unumber) $25 in level_show::$0 = level_show::ytile#2 < $25 +Adding number conversion cast (unumber) $19 in level_show::$1 = level_show::xcol#2 < $19 +Adding number conversion cast (unumber) $40 in level_show::level#1 = level_show::level#3 + $40 +Adding number conversion cast (unumber) $31 in level_tile_get::$0 = level_tile_get::xtile#4 > $31 +Adding number conversion cast (unumber) $24 in level_tile_get::$1 = level_tile_get::ytile#4 > $24 +Adding number conversion cast (unumber) 0 in level_tile_get::return#1 = 0 +Adding number conversion cast (unumber) $31 in level_tile_directions::$0 = level_tile_directions::xtile#5 > $31 +Adding number conversion cast (unumber) $24 in level_tile_directions::$1 = level_tile_directions::ytile#5 > $24 +Adding number conversion cast (unumber) 0 in level_tile_directions::return#1 = 0 +Adding number conversion cast (unumber) $25 in init_level_tile_directions::$0 = init_level_tile_directions::ytile#2 < $25 +Adding number conversion cast (unumber) $32 in init_level_tile_directions::$1 = init_level_tile_directions::xtile#2 < $32 +Adding number conversion cast (unumber) 1 in init_level_tile_directions::$2 = init_level_tile_directions::xtile#3 - 1 +Adding number conversion cast (unumber) init_level_tile_directions::$2 in init_level_tile_directions::$2 = init_level_tile_directions::xtile#3 - (unumber)1 +Adding number conversion cast (unumber) $40 in init_level_tile_directions::directions#1 = init_level_tile_directions::directions#2 + $40 +Adding number conversion cast (unumber) 1 in init_level_tile_directions::$6 = init_level_tile_directions::xtile#4 + 1 +Adding number conversion cast (unumber) init_level_tile_directions::$6 in init_level_tile_directions::$6 = init_level_tile_directions::xtile#4 + (unumber)1 +Adding number conversion cast (unumber) 1 in init_level_tile_directions::$10 = init_level_tile_directions::ytile#6 - 1 +Adding number conversion cast (unumber) init_level_tile_directions::$10 in init_level_tile_directions::$10 = init_level_tile_directions::ytile#6 - (unumber)1 +Adding number conversion cast (unumber) 1 in init_level_tile_directions::$14 = init_level_tile_directions::ytile#7 + 1 +Adding number conversion cast (unumber) init_level_tile_directions::$14 in init_level_tile_directions::$14 = init_level_tile_directions::ytile#7 + (unumber)1 +Adding number conversion cast (unumber) $e in init_sprite_pointers::$0 = init_sprite_pointers::screen#2 < $e +Adding number conversion cast (unumber) 8 in init_sprite_pointers::$1 = init_sprite_pointers::sprite#2 < 8 +Adding number conversion cast (unumber) $400 in init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#3 + $400 +Adding number conversion cast (unumber) $400 in init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#3 + $400 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 +Adding number conversion cast (unumber) 7 in *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 +Adding number conversion cast (unumber) $3fff in irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7 & $3fff +Adding number conversion cast (unumber) irq_screen_top::toD0181_$0 in irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7 & (unumber)$3fff +Adding number conversion cast (unumber) 4 in irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0 * 4 +Adding number conversion cast (unumber) irq_screen_top::toD0181_$1 in irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0 * (unumber)4 +Adding number conversion cast (unumber) irq_screen_top::toD0181_$2 in irq_screen_top::toD0181_$2 = > irq_screen_top::toD0181_$1 +Adding number conversion cast (unumber) 4 in irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3 / 4 +Adding number conversion cast (unumber) irq_screen_top::toD0181_$4 in irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3 / (unumber)4 +Adding number conversion cast (unumber) $f in irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4 & $f +Adding number conversion cast (unumber) irq_screen_top::toD0181_$5 in irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4 & (unumber)$f +Adding number conversion cast (unumber) irq_screen_top::toD0181_$6 in irq_screen_top::toD0181_$6 = irq_screen_top::toD0181_$2 | irq_screen_top::toD0181_$5 +Adding number conversion cast (unumber) 1 in irq_screen_top::$1 = frame + 1 +Adding number conversion cast (unumber) irq_screen_top::$1 in irq_screen_top::$1 = frame + (unumber)1 +Adding number conversion cast (unumber) 1 in irq_screen_top::$2 = irq_screen_top::$1 & 1 +Adding number conversion cast (unumber) irq_screen_top::$2 in irq_screen_top::$2 = irq_screen_top::$1 & (unumber)1 +Adding number conversion cast (unumber) 0 in irq_screen_top::$8 = 0 != frame +Adding number conversion cast (unumber) $40 in irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0 / $40 +Adding number conversion cast (unumber) irq_screen_top::toDd001_$1 in irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0 / (unumber)$40 +Adding number conversion cast (unumber) 3 in irq_screen_top::toDd001_$2 = 3 ^ irq_screen_top::toDd001_$1 +Adding number conversion cast (unumber) irq_screen_top::toDd001_$2 in irq_screen_top::toDd001_$2 = (unumber)3 ^ irq_screen_top::toDd001_$1 +Adding number conversion cast (unumber) 0 in bobs_restore_base = 0 +Adding number conversion cast (unumber) $40 in irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0 / $40 +Adding number conversion cast (unumber) irq_screen_top::toDd002_$1 in irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0 / (unumber)$40 +Adding number conversion cast (unumber) 3 in irq_screen_top::toDd002_$2 = 3 ^ irq_screen_top::toDd002_$1 +Adding number conversion cast (unumber) irq_screen_top::toDd002_$2 in irq_screen_top::toDd002_$2 = (unumber)3 ^ irq_screen_top::toDd002_$1 +Adding number conversion cast (unumber) 0 in irq_screen_top::$3 = phase == 0 +Adding number conversion cast (unumber) 1 in music_play_next = 1 +Adding number conversion cast (unumber) 0 in game_logic::$0 = game_playable == 0 +Adding number conversion cast (unumber) 1 in game_logic::$2 = game_logic_substep + 1 +Adding number conversion cast (unumber) game_logic::$2 in game_logic::$2 = game_logic_substep + (unumber)1 +Adding number conversion cast (unumber) 7 in game_logic::$3 = game_logic::$2 & 7 +Adding number conversion cast (unumber) game_logic::$3 in game_logic::$3 = game_logic::$2 & (unumber)7 +Adding number conversion cast (unumber) 0 in game_logic::$4 = game_logic_substep == 0 +Adding number conversion cast (unumber) 1 in game_logic::$5 = game_logic_substep == 1 +Adding number conversion cast (unumber) 0 in game_logic::$211 = 0 != ghost1_respawn +Adding number conversion cast (unumber) 2 in game_logic::$6 = game_logic_substep == 2 +Adding number conversion cast (unumber) 0 in game_logic::$212 = 0 != ghost2_respawn +Adding number conversion cast (unumber) 4 in game_logic::$7 = game_logic_substep == 4 +Adding number conversion cast (unumber) 0 in game_logic::$213 = 0 != ghost3_respawn +Adding number conversion cast (unumber) 5 in game_logic::$8 = game_logic_substep == 5 +Adding number conversion cast (unumber) 0 in game_logic::$214 = 0 != ghost4_respawn +Adding number conversion cast (unumber) 6 in game_logic::$9 = game_logic_substep == 6 +Adding number conversion cast (unumber) 3 in game_logic::$10 = game_logic_substep == 3 +Adding number conversion cast (unumber) 7 in game_logic::$11 = game_logic_substep == 7 +Adding number conversion cast (unumber) 1 in game_logic::$14 = anim_frame_idx + 1 +Adding number conversion cast (unumber) game_logic::$14 in game_logic::$14 = anim_frame_idx + (unumber)1 +Adding number conversion cast (unumber) 3 in game_logic::$15 = game_logic::$14 & 3 +Adding number conversion cast (unumber) game_logic::$15 in game_logic::$15 = game_logic::$14 & (unumber)3 +Adding number conversion cast (unumber) 1 in game_logic::$16 = pacman_xfine - 1 +Adding number conversion cast (unumber) game_logic::$16 in game_logic::$16 = pacman_xfine - (unumber)1 +Adding number conversion cast (unumber) 4 in game_logic::$17 = game_logic::pacman_bob_xfine#0 / 4 +Adding number conversion cast (unumber) game_logic::$17 in game_logic::$17 = game_logic::pacman_bob_xfine#0 / (unumber)4 +Adding number conversion cast (unumber) 0 in bobs_xcol[0] = game_logic::$17 +Adding number conversion cast (unumber) 1 in game_logic::$18 = pacman_yfine - 1 +Adding number conversion cast (unumber) game_logic::$18 in game_logic::$18 = pacman_yfine - (unumber)1 +Adding number conversion cast (unumber) 0 in bobs_yfine[0] = game_logic::$18 +Adding number conversion cast (unumber) 3 in game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 +Adding number conversion cast (unumber) game_logic::$20 in game_logic::$20 = game_logic::pacman_bob_xfine#0 & (unumber)3 +Adding number conversion cast (unumber) game_logic::$21 in game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 +Adding number conversion cast (unumber) 0 in bobs_bob_id[0] = game_logic::$21 +Adding number conversion cast (unumber) 1 in game_logic::$24 = ghost1_xfine - 1 +Adding number conversion cast (unumber) game_logic::$24 in game_logic::$24 = ghost1_xfine - (unumber)1 +Adding number conversion cast (unumber) 4 in game_logic::$25 = game_logic::ghost1_bob_xfine#0 / 4 +Adding number conversion cast (unumber) game_logic::$25 in game_logic::$25 = game_logic::ghost1_bob_xfine#0 / (unumber)4 +Adding number conversion cast (unumber) 1 in bobs_xcol[1] = game_logic::$25 +Adding number conversion cast (unumber) 1 in game_logic::$26 = ghost1_yfine - 1 +Adding number conversion cast (unumber) game_logic::$26 in game_logic::$26 = ghost1_yfine - (unumber)1 +Adding number conversion cast (unumber) 1 in bobs_yfine[1] = game_logic::$26 +Adding number conversion cast (unumber) 3 in game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 +Adding number conversion cast (unumber) game_logic::$28 in game_logic::$28 = game_logic::ghost1_bob_xfine#0 & (unumber)3 +Adding number conversion cast (unumber) game_logic::$29 in game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 +Adding number conversion cast (unumber) 1 in bobs_bob_id[1] = game_logic::$29 +Adding number conversion cast (unumber) 1 in game_logic::$30 = ghost2_xfine - 1 +Adding number conversion cast (unumber) game_logic::$30 in game_logic::$30 = ghost2_xfine - (unumber)1 +Adding number conversion cast (unumber) 4 in game_logic::$31 = game_logic::ghost2_bob_xfine#0 / 4 +Adding number conversion cast (unumber) game_logic::$31 in game_logic::$31 = game_logic::ghost2_bob_xfine#0 / (unumber)4 +Adding number conversion cast (unumber) 2 in bobs_xcol[2] = game_logic::$31 +Adding number conversion cast (unumber) 1 in game_logic::$32 = ghost2_yfine - 1 +Adding number conversion cast (unumber) game_logic::$32 in game_logic::$32 = ghost2_yfine - (unumber)1 +Adding number conversion cast (unumber) 2 in bobs_yfine[2] = game_logic::$32 +Adding number conversion cast (unumber) 3 in game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 +Adding number conversion cast (unumber) game_logic::$34 in game_logic::$34 = game_logic::ghost2_bob_xfine#0 & (unumber)3 +Adding number conversion cast (unumber) game_logic::$35 in game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 +Adding number conversion cast (unumber) 2 in bobs_bob_id[2] = game_logic::$35 +Adding number conversion cast (unumber) 1 in game_logic::$36 = ghost3_xfine - 1 +Adding number conversion cast (unumber) game_logic::$36 in game_logic::$36 = ghost3_xfine - (unumber)1 +Adding number conversion cast (unumber) 4 in game_logic::$37 = game_logic::ghost3_bob_xfine#0 / 4 +Adding number conversion cast (unumber) game_logic::$37 in game_logic::$37 = game_logic::ghost3_bob_xfine#0 / (unumber)4 +Adding number conversion cast (unumber) 3 in bobs_xcol[3] = game_logic::$37 +Adding number conversion cast (unumber) 1 in game_logic::$38 = ghost3_yfine - 1 +Adding number conversion cast (unumber) game_logic::$38 in game_logic::$38 = ghost3_yfine - (unumber)1 +Adding number conversion cast (unumber) 3 in bobs_yfine[3] = game_logic::$38 +Adding number conversion cast (unumber) 3 in game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 +Adding number conversion cast (unumber) game_logic::$40 in game_logic::$40 = game_logic::ghost3_bob_xfine#0 & (unumber)3 +Adding number conversion cast (unumber) game_logic::$41 in game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 +Adding number conversion cast (unumber) 3 in bobs_bob_id[3] = game_logic::$41 +Adding number conversion cast (unumber) 1 in game_logic::$42 = ghost4_xfine - 1 +Adding number conversion cast (unumber) game_logic::$42 in game_logic::$42 = ghost4_xfine - (unumber)1 +Adding number conversion cast (unumber) 4 in game_logic::$43 = game_logic::ghost4_bob_xfine#0 / 4 +Adding number conversion cast (unumber) game_logic::$43 in game_logic::$43 = game_logic::ghost4_bob_xfine#0 / (unumber)4 +Adding number conversion cast (unumber) 4 in bobs_xcol[4] = game_logic::$43 +Adding number conversion cast (unumber) 1 in game_logic::$44 = ghost4_yfine - 1 +Adding number conversion cast (unumber) game_logic::$44 in game_logic::$44 = ghost4_yfine - (unumber)1 +Adding number conversion cast (unumber) 4 in bobs_yfine[4] = game_logic::$44 +Adding number conversion cast (unumber) 3 in game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 +Adding number conversion cast (unumber) game_logic::$46 in game_logic::$46 = game_logic::ghost4_bob_xfine#0 & (unumber)3 +Adding number conversion cast (unumber) game_logic::$47 in game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 +Adding number conversion cast (unumber) 4 in bobs_bob_id[4] = game_logic::$47 +Adding number conversion cast (unumber) $40 in game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#3 | $40 +Adding number conversion cast (unumber) $32 in game_logic::$56 = ghosts_mode_count > $32 +Adding number conversion cast (unumber) $96 in game_logic::$54 = ghosts_mode_count > $96 +Adding number conversion cast (unumber) $32 in game_logic::$52 = ghosts_mode_count > $32 +Adding number conversion cast (unumber) 0 in ghosts_mode_count = 0 +Adding number conversion cast (unumber) 1 in game_logic::do_reverse#1 = 1 +Adding number conversion cast (unumber) 0 in ghosts_mode_count = 0 +Adding number conversion cast (unumber) 1 in game_logic::do_reverse#2 = 1 +Adding number conversion cast (unumber) 0 in game_logic::$219 = 0 != game_logic::do_reverse#4 +Adding number conversion cast (unumber) 0 in ghosts_mode_count = 0 +Adding number conversion cast (unumber) 1 in game_logic::do_reverse#3 = 1 +Adding number conversion cast (unumber) 2 in game_logic::$59 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$59 in game_logic::$59 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$60 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$60 in game_logic::$60 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) 1 in ghost1_reverse = 1 +Adding number conversion cast (unumber) 1 in ghost2_reverse = 1 +Adding number conversion cast (unumber) 1 in ghost3_reverse = 1 +Adding number conversion cast (unumber) 1 in ghost4_reverse = 1 +Adding number conversion cast (unumber) 2 in game_logic::$69 = game_logic::pacman_xtile#1 / 2 +Adding number conversion cast (unumber) game_logic::$69 in game_logic::$69 = game_logic::pacman_xtile#1 / (unumber)2 +Adding number conversion cast (unumber) $fe in game_logic::$70 = game_logic::pacman_xtile#1 & $fe +Adding number conversion cast (unumber) game_logic::$70 in game_logic::$70 = game_logic::pacman_xtile#1 & (unumber)$fe +Adding number conversion cast (unumber) 2 in game_logic::$72 = game_logic::pacman_ytile#1 * 2 +Adding number conversion cast (unumber) game_logic::$72 in game_logic::$72 = game_logic::pacman_ytile#1 * (unumber)2 +Adding number conversion cast (unumber) 0 in game_logic::$73 = pill_count == 0 +Adding number conversion cast (unumber) 2 in game_logic::$65 = game_logic::pacman_xtile#2 / 2 +Adding number conversion cast (unumber) game_logic::$65 in game_logic::$65 = game_logic::pacman_xtile#2 / (unumber)2 +Adding number conversion cast (unumber) $fe in game_logic::$66 = game_logic::pacman_xtile#2 & $fe +Adding number conversion cast (unumber) game_logic::$66 in game_logic::$66 = game_logic::pacman_xtile#2 & (unumber)$fe +Adding number conversion cast (unumber) 2 in game_logic::$68 = game_logic::pacman_ytile#2 * 2 +Adding number conversion cast (unumber) game_logic::$68 in game_logic::$68 = game_logic::pacman_ytile#2 * (unumber)2 +Adding number conversion cast (unumber) 0 in ghosts_mode_count = 0 +Adding number conversion cast (unumber) 2 in game_logic::$76 = ABS[game_logic::$75] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$78 = ABS[game_logic::$77] < 2 +Adding number conversion cast (unumber) 1 in pacman_wins = 1 +Adding number conversion cast (unumber) 2 in game_logic::$81 = ABS[game_logic::$80] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$83 = ABS[game_logic::$82] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$86 = ABS[game_logic::$85] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$88 = ABS[game_logic::$87] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$91 = ABS[game_logic::$90] < 2 +Adding number conversion cast (unumber) 2 in game_logic::$93 = ABS[game_logic::$92] < 2 +Adding number conversion cast (unumber) $32 in ghost4_xfine = $32 +Adding number conversion cast (unumber) $23 in ghost4_yfine = $23 +Adding number conversion cast (unumber) 0 in ghost4_substep = 0 +Adding number conversion cast (unumber) $32 in ghost4_respawn = $32 +Adding number conversion cast (unumber) $32 in ghost3_xfine = $32 +Adding number conversion cast (unumber) $23 in ghost3_yfine = $23 +Adding number conversion cast (unumber) 0 in ghost3_substep = 0 +Adding number conversion cast (unumber) $32 in ghost3_respawn = $32 +Adding number conversion cast (unumber) $32 in ghost2_xfine = $32 +Adding number conversion cast (unumber) $23 in ghost2_yfine = $23 +Adding number conversion cast (unumber) 0 in ghost2_substep = 0 +Adding number conversion cast (unumber) $32 in ghost2_respawn = $32 +Adding number conversion cast (unumber) $32 in ghost1_xfine = $32 +Adding number conversion cast (unumber) $23 in ghost1_yfine = $23 +Adding number conversion cast (unumber) 0 in ghost1_substep = 0 +Adding number conversion cast (unumber) $32 in ghost1_respawn = $32 +Adding number conversion cast (unumber) 0 in game_logic::$123 = ghost4_respawn == 0 +Adding number conversion cast (unumber) 0 in game_logic::$109 = ghost4_substep == 0 +Adding number conversion cast (unumber) 1 in ghost4_substep = 1 +Adding number conversion cast (unumber) 1 in game_logic::$120 = ghost4_xfine == 1 +Adding number conversion cast (unumber) 0 in ghost4_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$215 = 0 != ghost4_reverse +Adding number conversion cast (unumber) 0 in ghost4_reverse = 0 +Adding number conversion cast (unumber) 2 in game_logic::$112 = ghost4_xfine / 2 +Adding number conversion cast (unumber) game_logic::$112 in game_logic::$112 = ghost4_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$113 = ghost4_yfine / 2 +Adding number conversion cast (unumber) game_logic::$113 in game_logic::$113 = ghost4_yfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::target_xtile#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::target_ytile#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::$117 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$117 in game_logic::$117 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$118 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$118 in game_logic::$118 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) $61 in ghost4_xfine = $61 +Adding number conversion cast (unumber) $61 in game_logic::$121 = ghost4_xfine == $61 +Adding number conversion cast (unumber) 1 in ghost4_xfine = 1 +Adding number conversion cast (unumber) 2 in ghost4_xfine = 2 +Adding number conversion cast (unumber) 2 in ghost4_yfine = 2 +Adding number conversion cast (unumber) 0 in ghost4_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$144 = ghost3_respawn == 0 +Adding number conversion cast (unumber) 0 in game_logic::$130 = ghost3_substep == 0 +Adding number conversion cast (unumber) 1 in ghost3_substep = 1 +Adding number conversion cast (unumber) 1 in game_logic::$141 = ghost3_xfine == 1 +Adding number conversion cast (unumber) 0 in ghost3_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$216 = 0 != ghost3_reverse +Adding number conversion cast (unumber) 0 in ghost3_reverse = 0 +Adding number conversion cast (unumber) 2 in game_logic::$133 = ghost3_xfine / 2 +Adding number conversion cast (unumber) game_logic::$133 in game_logic::$133 = ghost3_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$134 = ghost3_yfine / 2 +Adding number conversion cast (unumber) game_logic::$134 in game_logic::$134 = ghost3_yfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::target_xtile1#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::target_ytile1#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::$138 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$138 in game_logic::$138 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$139 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$139 in game_logic::$139 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) $61 in ghost3_xfine = $61 +Adding number conversion cast (unumber) $61 in game_logic::$142 = ghost3_xfine == $61 +Adding number conversion cast (unumber) 1 in ghost3_xfine = 1 +Adding number conversion cast (unumber) 2 in ghost3_xfine = 2 +Adding number conversion cast (unumber) $46 in ghost3_yfine = $46 +Adding number conversion cast (unumber) 0 in ghost3_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$165 = ghost2_respawn == 0 +Adding number conversion cast (unumber) 0 in game_logic::$151 = ghost2_substep == 0 +Adding number conversion cast (unumber) 1 in ghost2_substep = 1 +Adding number conversion cast (unumber) 1 in game_logic::$162 = ghost2_xfine == 1 +Adding number conversion cast (unumber) 0 in ghost2_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$217 = 0 != ghost2_reverse +Adding number conversion cast (unumber) 0 in ghost2_reverse = 0 +Adding number conversion cast (unumber) 2 in game_logic::$154 = ghost2_xfine / 2 +Adding number conversion cast (unumber) game_logic::$154 in game_logic::$154 = ghost2_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$155 = ghost2_yfine / 2 +Adding number conversion cast (unumber) game_logic::$155 in game_logic::$155 = ghost2_yfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::target_xtile2#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::target_ytile2#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::$159 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$159 in game_logic::$159 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$160 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$160 in game_logic::$160 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) $61 in ghost2_xfine = $61 +Adding number conversion cast (unumber) $61 in game_logic::$163 = ghost2_xfine == $61 +Adding number conversion cast (unumber) 1 in ghost2_xfine = 1 +Adding number conversion cast (unumber) $60 in ghost2_xfine = $60 +Adding number conversion cast (unumber) $46 in ghost2_yfine = $46 +Adding number conversion cast (unumber) 0 in ghost2_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$186 = ghost1_respawn == 0 +Adding number conversion cast (unumber) 0 in game_logic::$172 = ghost1_substep == 0 +Adding number conversion cast (unumber) 1 in ghost1_substep = 1 +Adding number conversion cast (unumber) 1 in game_logic::$183 = ghost1_xfine == 1 +Adding number conversion cast (unumber) 0 in ghost1_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$218 = 0 != ghost1_reverse +Adding number conversion cast (unumber) 0 in ghost1_reverse = 0 +Adding number conversion cast (unumber) 2 in game_logic::$175 = ghost1_xfine / 2 +Adding number conversion cast (unumber) game_logic::$175 in game_logic::$175 = ghost1_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$176 = ghost1_yfine / 2 +Adding number conversion cast (unumber) game_logic::$176 in game_logic::$176 = ghost1_yfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::target_xtile3#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::target_ytile3#1 = 2 +Adding number conversion cast (unumber) 2 in game_logic::$180 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$180 in game_logic::$180 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$181 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$181 in game_logic::$181 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) $61 in ghost1_xfine = $61 +Adding number conversion cast (unumber) $61 in game_logic::$184 = ghost1_xfine == $61 +Adding number conversion cast (unumber) 1 in ghost1_xfine = 1 +Adding number conversion cast (unumber) $60 in ghost1_xfine = $60 +Adding number conversion cast (unumber) 2 in ghost1_yfine = 2 +Adding number conversion cast (unumber) 0 in ghost1_substep = 0 +Adding number conversion cast (unumber) 0 in game_logic::$193 = pacman_substep == 0 +Adding number conversion cast (unumber) 1 in pacman_substep = 1 +Adding number conversion cast (unumber) 1 in pacman_ch1_enabled = 1 +Adding number conversion cast (unumber) 1 in game_logic::$207 = pacman_xfine == 1 +Adding number conversion cast (unumber) 0 in pacman_substep = 0 +Adding number conversion cast (unumber) 2 in game_logic::$196 = pacman_xfine / 2 +Adding number conversion cast (unumber) game_logic::$196 in game_logic::$196 = pacman_xfine / (unumber)2 +Adding number conversion cast (unumber) 2 in game_logic::$197 = pacman_yfine / 2 +Adding number conversion cast (unumber) game_logic::$197 in game_logic::$197 = pacman_yfine / (unumber)2 +Adding number conversion cast (unumber) $f in game_logic::$199 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $f +Adding number conversion cast (unumber) game_logic::$199 in game_logic::$199 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & (unumber)$f +Adding number conversion cast (unumber) $f in game_logic::$200 = game_logic::$199 ^ $f +Adding number conversion cast (unumber) game_logic::$200 in game_logic::$200 = game_logic::$199 ^ (unumber)$f +Adding number conversion cast (unumber) 4 in game_logic::$201 = game_logic::$200 * 4 +Adding number conversion cast (unumber) game_logic::$201 in game_logic::$201 = game_logic::$200 * (unumber)4 +Adding number conversion cast (unumber) 0 in game_logic::$202 = game_logic::joy_directions#0 != 0 +Adding number conversion cast (unumber) 0 in game_logic::$205 = game_logic::new_direction#0 != 0 +Adding number conversion cast (unumber) $61 in pacman_xfine = $61 +Adding number conversion cast (unumber) $61 in game_logic::$208 = pacman_xfine == $61 +Adding number conversion cast (unumber) 1 in pacman_xfine = 1 +Adding number conversion cast (unumber) 0 in choose_direction::$26 = 0 != choose_direction::$2 +Adding number conversion cast (unumber) 0 in choose_direction::$27 = 0 != choose_direction::$4 +Adding number conversion cast (unumber) 1 in choose_direction::$10 = choose_direction::ydiff#1 - 1 +Adding number conversion cast (unumber) choose_direction::$10 in choose_direction::$10 = choose_direction::ydiff#1 - (unumber)1 +Adding number conversion cast (unumber) 0 in choose_direction::$28 = 0 != choose_direction::$6 +Adding number conversion cast (unumber) 1 in choose_direction::$14 = choose_direction::ydiff#2 + 1 +Adding number conversion cast (unumber) choose_direction::$14 in choose_direction::$14 = choose_direction::ydiff#2 + (unumber)1 +Adding number conversion cast (unumber) 0 in choose_direction::$29 = 0 != choose_direction::$8 +Adding number conversion cast (unumber) 1 in choose_direction::$18 = choose_direction::xdiff#3 - 1 +Adding number conversion cast (unumber) choose_direction::$18 in choose_direction::$18 = choose_direction::xdiff#3 - (unumber)1 +Adding number conversion cast (unumber) 1 in choose_direction::$22 = choose_direction::xdiff#4 + 1 +Adding number conversion cast (unumber) choose_direction::$22 in choose_direction::$22 = choose_direction::xdiff#4 + (unumber)1 +Adding number conversion cast (unumber) 0 in ghosts_mode_count = 0 +Adding number conversion cast (unumber) 0 in pacman_substep = 0 +Adding number conversion cast (unumber) 0 in ghost1_substep = 0 +Adding number conversion cast (unumber) 0 in ghost2_substep = 0 +Adding number conversion cast (unumber) 0 in ghost3_substep = 0 +Adding number conversion cast (unumber) 0 in ghost4_substep = 0 +Adding number conversion cast (unumber) $32 in pacman_xfine = $32 +Adding number conversion cast (unumber) $32 in ghost1_xfine = $32 +Adding number conversion cast (unumber) $32 in ghost2_xfine = $32 +Adding number conversion cast (unumber) $32 in ghost3_xfine = $32 +Adding number conversion cast (unumber) $32 in ghost4_xfine = $32 +Adding number conversion cast (unumber) $23 in ghost1_yfine = $23 +Adding number conversion cast (unumber) $23 in ghost2_yfine = $23 +Adding number conversion cast (unumber) $23 in ghost3_yfine = $23 +Adding number conversion cast (unumber) $23 in ghost4_yfine = $23 +Adding number conversion cast (unumber) $3e in pacman_yfine = $3e +Adding number conversion cast (unumber) $a in ghost1_respawn = $a +Adding number conversion cast (unumber) $14 in ghost2_respawn = $14 +Adding number conversion cast (unumber) $1e in ghost3_respawn = $1e +Adding number conversion cast (unumber) $28 in ghost4_respawn = $28 +Successful SSA optimization PassNAddNumberTypeConversions +Adding number conversion cast (unumber) $40 in +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast memcpy::src#0 = (byte*)memcpy::source#1 +Inlining cast memcpy::dst#0 = (byte*)memcpy::destination#1 +Inlining cast memset::dst#0 = (byte*)memset::str#6 +Inlining cast *merge_code::dest_code#10 = (unumber)$24 +Inlining cast *merge_code::dest_code#2 = (unumber)$ea +Inlining cast *merge_code::dest_code#11 = (unumber)$ea +Inlining cast *merge_code::dest_code#12 = (unumber)$60 +Inlining cast *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = (unumber)$f +Inlining cast *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_FREQ) = (unumber)0 +Inlining cast *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = (unumber)0 +Inlining cast *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = (unumber)0 +Inlining cast *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = (unumber)0 +Inlining cast *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = (unumber)$f0 +Inlining cast pacman_ch1_idx = (unumber)0 +Inlining cast pacman_ch1_enabled = (unumber)0 +Inlining cast (RENDER_INDEX+(unumber)$18*$100)[RENDER_OFFSET_YPOS_INC] = (unumber)0 +Inlining cast (RENDER_INDEX+(unumber)$19*$100)[RENDER_OFFSET_YPOS_INC] = (unumber)0 +Inlining cast init_render_index::ypos_inc_offset#1 = (unumber)$b +Inlining cast logic_tile_xcol = (unumber)$c +Inlining cast logic_tile_yfine = (unumber)$23 +Inlining cast init_bobs_restore::bob_restore#2[init_bobs_restore::i#3] = (unumber)0 +Inlining cast game_playable = (unumber)0 +Inlining cast phase = (unumber)0 +Inlining cast ((byte*)SID)[done_run::i#3] = (unumber)0 +Inlining cast bobs_xcol[done_run::i1#3] = (unumber)$a +Inlining cast bobs_yfine[done_run::i1#3] = (unumber)$2d +Inlining cast bobs_bob_id[done_run::i1#3] = (unumber)0 +Inlining cast music_play_next = (unumber)0 +Inlining cast music_play_next = (unumber)0 +Inlining cast memset::c#0 = (unumber)0 +Inlining cast memset::num#0 = (unumber)$c00 +Inlining cast memset::c#1 = (unumber)0 +Inlining cast memset::num#1 = (unumber)$1fff +Inlining cast memset::c#2 = (unumber)0 +Inlining cast memset::num#2 = (unumber)$3fff +Inlining cast memset::c#3 = (unumber)0 +Inlining cast memset::num#3 = (unumber)$1fff +Inlining cast memset::c#4 = (unumber)0 +Inlining cast SPRITES_YPOS[splash_run::$23] = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = (unumber)$ff +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = (unumber)$ff +Inlining cast top_sprites_mc = (unumber)3 +Inlining cast side_sprites_mc = (unumber)0 +Inlining cast bottom_sprites_mc = (unumber)3 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = (unumber)8 +Inlining cast bobs_xcol[splash_run::i2#3] = (unumber)$a +Inlining cast bobs_yfine[splash_run::i2#3] = (unumber)$2d +Inlining cast bobs_bob_id[splash_run::i2#3] = (unumber)0 +Inlining cast phase = (unumber)0 +Inlining cast *IRQ_STATUS = (unumber)$f +Inlining cast music_play_next = (unumber)0 +Inlining cast music_play_next = (unumber)0 +Inlining cast ((byte*)SID)[gameplay_run::i#3] = (unumber)0 +Inlining cast pacman_wins = (unumber)0 +Inlining cast pacman_lives = (unumber)3 +Inlining cast top_sprites_mc = (unumber)$ff +Inlining cast side_sprites_mc = (unumber)$ff +Inlining cast bottom_sprites_mc = (unumber)$ff +Inlining cast phase = (unumber)1 +Inlining cast game_playable = (unumber)1 +Inlining cast *IRQ_STATUS = (unumber)$f +Inlining cast *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = (unumber)0 +Inlining cast joyfire::return#2 = (unumber)1 +Inlining cast joyfire::return#3 = (unumber)0 +Inlining cast level_tile_get::return#1 = (unumber)0 +Inlining cast level_tile_directions::return#1 = (unumber)0 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = (unumber)7 +Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = (unumber)7 +Inlining cast bobs_restore_base = (unumber)0 +Inlining cast music_play_next = (unumber)1 +Inlining cast ghosts_mode_count = (unumber)0 +Inlining cast game_logic::do_reverse#1 = (unumber)1 +Inlining cast ghosts_mode_count = (unumber)0 +Inlining cast game_logic::do_reverse#2 = (unumber)1 +Inlining cast ghosts_mode_count = (unumber)0 +Inlining cast game_logic::do_reverse#3 = (unumber)1 +Inlining cast ghost1_reverse = (unumber)1 +Inlining cast ghost2_reverse = (unumber)1 +Inlining cast ghost3_reverse = (unumber)1 +Inlining cast ghost4_reverse = (unumber)1 +Inlining cast ghosts_mode_count = (unumber)0 +Inlining cast pacman_wins = (unumber)1 +Inlining cast ghost4_xfine = (unumber)$32 +Inlining cast ghost4_yfine = (unumber)$23 +Inlining cast ghost4_substep = (unumber)0 +Inlining cast ghost4_respawn = (unumber)$32 +Inlining cast ghost3_xfine = (unumber)$32 +Inlining cast ghost3_yfine = (unumber)$23 +Inlining cast ghost3_substep = (unumber)0 +Inlining cast ghost3_respawn = (unumber)$32 +Inlining cast ghost2_xfine = (unumber)$32 +Inlining cast ghost2_yfine = (unumber)$23 +Inlining cast ghost2_substep = (unumber)0 +Inlining cast ghost2_respawn = (unumber)$32 +Inlining cast ghost1_xfine = (unumber)$32 +Inlining cast ghost1_yfine = (unumber)$23 +Inlining cast ghost1_substep = (unumber)0 +Inlining cast ghost1_respawn = (unumber)$32 +Inlining cast ghost4_substep = (unumber)1 +Inlining cast ghost4_substep = (unumber)0 +Inlining cast ghost4_reverse = (unumber)0 +Inlining cast game_logic::target_xtile#1 = (unumber)2 +Inlining cast game_logic::target_ytile#1 = (unumber)2 +Inlining cast ghost4_xfine = (unumber)$61 +Inlining cast ghost4_xfine = (unumber)1 +Inlining cast ghost4_xfine = (unumber)2 +Inlining cast ghost4_yfine = (unumber)2 +Inlining cast ghost4_substep = (unumber)0 +Inlining cast ghost3_substep = (unumber)1 +Inlining cast ghost3_substep = (unumber)0 +Inlining cast ghost3_reverse = (unumber)0 +Inlining cast game_logic::target_xtile1#1 = (unumber)2 +Inlining cast game_logic::target_ytile1#1 = (unumber)2 +Inlining cast ghost3_xfine = (unumber)$61 +Inlining cast ghost3_xfine = (unumber)1 +Inlining cast ghost3_xfine = (unumber)2 +Inlining cast ghost3_yfine = (unumber)$46 +Inlining cast ghost3_substep = (unumber)0 +Inlining cast ghost2_substep = (unumber)1 +Inlining cast ghost2_substep = (unumber)0 +Inlining cast ghost2_reverse = (unumber)0 +Inlining cast game_logic::target_xtile2#1 = (unumber)2 +Inlining cast game_logic::target_ytile2#1 = (unumber)2 +Inlining cast ghost2_xfine = (unumber)$61 +Inlining cast ghost2_xfine = (unumber)1 +Inlining cast ghost2_xfine = (unumber)$60 +Inlining cast ghost2_yfine = (unumber)$46 +Inlining cast ghost2_substep = (unumber)0 +Inlining cast ghost1_substep = (unumber)1 +Inlining cast ghost1_substep = (unumber)0 +Inlining cast ghost1_reverse = (unumber)0 +Inlining cast game_logic::target_xtile3#1 = (unumber)2 +Inlining cast game_logic::target_ytile3#1 = (unumber)2 +Inlining cast ghost1_xfine = (unumber)$61 +Inlining cast ghost1_xfine = (unumber)1 +Inlining cast ghost1_xfine = (unumber)$60 +Inlining cast ghost1_yfine = (unumber)2 +Inlining cast ghost1_substep = (unumber)0 +Inlining cast pacman_substep = (unumber)1 +Inlining cast pacman_ch1_enabled = (unumber)1 +Inlining cast pacman_substep = (unumber)0 +Inlining cast pacman_xfine = (unumber)$61 +Inlining cast pacman_xfine = (unumber)1 +Inlining cast ghosts_mode_count = (unumber)0 +Inlining cast pacman_substep = (unumber)0 +Inlining cast ghost1_substep = (unumber)0 +Inlining cast ghost2_substep = (unumber)0 +Inlining cast ghost3_substep = (unumber)0 +Inlining cast ghost4_substep = (unumber)0 +Inlining cast pacman_xfine = (unumber)$32 +Inlining cast ghost1_xfine = (unumber)$32 +Inlining cast ghost2_xfine = (unumber)$32 +Inlining cast ghost3_xfine = (unumber)$32 +Inlining cast ghost4_xfine = (unumber)$32 +Inlining cast ghost1_yfine = (unumber)$23 +Inlining cast ghost2_yfine = (unumber)$23 +Inlining cast ghost3_yfine = (unumber)$23 +Inlining cast ghost4_yfine = (unumber)$23 +Inlining cast pacman_yfine = (unumber)$3e +Inlining cast ghost1_respawn = (unumber)$a +Inlining cast ghost2_respawn = (unumber)$14 +Inlining cast ghost3_respawn = (unumber)$1e +Inlining cast ghost4_respawn = (unumber)$28 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (byte*) 53248 +Simplifying constant pointer cast (byte*) 53249 +Simplifying constant pointer cast (byte*) 53287 +Simplifying constant pointer cast (byte*) 53266 +Simplifying constant pointer cast (byte*) 53280 +Simplifying constant pointer cast (byte*) 53265 +Simplifying constant pointer cast (byte*) 53270 +Simplifying constant pointer cast (byte*) 53272 +Simplifying constant pointer cast (byte*) 53273 +Simplifying constant pointer cast (byte*) 54273 +Simplifying constant pointer cast (byte*) 0 +Simplifying constant pointer cast (byte*) 1 +Simplifying constant pointer cast (struct MOS6581_SID*) 54272 +Simplifying constant pointer cast (struct MOS6569_VICII*) 53248 +Simplifying constant pointer cast (struct MOS6526_CIA*) 56320 +Simplifying constant pointer cast (struct MOS6526_CIA*) 56576 +Simplifying constant pointer cast (byte*) 56333 +Simplifying constant pointer cast (void()**) 65534 +Simplifying constant pointer cast (byte*) 16384 +Simplifying constant pointer cast (byte*) 24576 +Simplifying constant pointer cast (byte*) 16384 +Simplifying constant pointer cast (byte*) 49152 +Simplifying constant pointer cast (byte*) 57344 +Simplifying constant pointer cast (byte*) 49152 +Simplifying constant pointer cast (byte*) 57344 +Simplifying constant pointer cast (byte*) 24576 +Simplifying constant pointer cast (byte*) 32768 +Simplifying constant pointer cast (byte*) 16384 +Simplifying constant pointer cast (byte*) 42752 +Simplifying constant pointer cast (byte*) 42752 +Simplifying constant pointer cast (byte*) 18432 +Simplifying constant integer cast $a00 +Simplifying constant integer cast $a80 +Simplifying constant integer cast $b00 +Simplifying constant pointer cast (byte*) 15872 +Simplifying constant pointer cast (byte*) 21504 +Simplifying constant integer cast BOB_ROW_SIZE*(unumber)6 +Simplifying constant integer cast 6 +Simplifying constant integer cast BOB_ROW_SIZE*(unumber)$c +Simplifying constant integer cast $c +Simplifying constant integer cast BOB_ROW_SIZE*(unumber)$12 +Simplifying constant integer cast $12 +Simplifying constant pointer cast (byte*) 46592 +Simplifying constant pointer cast (byte*) 0 +Simplifying constant pointer cast (byte*) 1 +Simplifying constant pointer cast (byte*) 2 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant pointer cast (byte*) 1025 +Simplifying constant pointer cast (byte*) 1026 +Simplifying constant pointer cast (byte*) 2048 +Simplifying constant pointer cast (byte*) 2049 +Simplifying constant pointer cast (byte*) 2050 +Simplifying constant pointer cast (byte*) 3072 +Simplifying constant pointer cast (byte*) 3073 +Simplifying constant pointer cast (byte*) 3074 +Simplifying constant pointer cast (byte*) 4096 +Simplifying constant pointer cast (byte*) 4097 +Simplifying constant pointer cast (byte*) 4098 +Simplifying constant pointer cast (byte*) 5120 +Simplifying constant pointer cast (byte*) 5121 +Simplifying constant pointer cast (byte*) 5122 +Simplifying constant pointer cast (byte*) 6144 +Simplifying constant pointer cast (byte*) 6145 +Simplifying constant pointer cast (byte*) 6146 +Simplifying constant pointer cast (byte*) 7168 +Simplifying constant pointer cast (byte*) 7169 +Simplifying constant pointer cast (byte*) 7170 +Simplifying constant pointer cast (byte*) 0 +Simplifying constant pointer cast (byte*) 0 +Simplifying constant integer cast 2 +Simplifying constant pointer cast (byte*) 59904 +Simplifying constant pointer cast (byte*) 42752 +Simplifying constant pointer cast (byte*) 12288 +Simplifying constant integer cast 0 +Simplifying constant integer cast 6 +Simplifying constant integer cast $3fff +Simplifying constant integer cast $40 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 3 +Simplifying constant integer cast $24 +Simplifying constant integer cast $ea +Simplifying constant integer cast 3 +Simplifying constant integer cast $ea +Simplifying constant integer cast 2 +Simplifying constant integer cast $60 +Simplifying constant integer cast $f +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $f0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $1a +Simplifying constant integer cast $18 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $b +Simplifying constant integer cast $94 +Simplifying constant integer cast 2 +Simplifying constant integer cast $17 +Simplifying constant integer cast $100 +Simplifying constant integer cast 2 +Simplifying constant integer cast $15 +Simplifying constant integer cast 4 +Simplifying constant integer cast 2 +Simplifying constant integer cast render::$1 +Simplifying constant integer cast render::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI] +Simplifying constant integer cast render::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] +Simplifying constant integer cast 3 +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast 2 +Simplifying constant integer cast render_tiles::$4 +Simplifying constant integer cast render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_HI] +Simplifying constant integer cast render_tiles::render_index_xcol#0[RENDER_OFFSET_CANVAS_LO] +Simplifying constant integer cast 4 +Simplifying constant integer cast NUM_BOBS*(unumber)2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $c +Simplifying constant integer cast $c +Simplifying constant integer cast $23 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast 4 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $2f +Simplifying constant integer cast 0 +Simplifying constant integer cast 4 +Simplifying constant integer cast $a +Simplifying constant integer cast $2d +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $19 +Simplifying constant integer cast 0 +Simplifying constant integer cast $19 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant pointer cast (void*) 16384 +Simplifying constant integer cast 0 +Simplifying constant integer cast $c00 +Simplifying constant integer cast $2000 +Simplifying constant integer cast 0 +Simplifying constant integer cast $1fff +Simplifying constant integer cast 0 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 0 +Simplifying constant integer cast $1fff +Simplifying constant integer cast 0 +Simplifying constant integer cast 8 +Simplifying constant integer cast 2 +Simplifying constant integer cast 7 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast $40 +Simplifying constant integer cast 3 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast $ff +Simplifying constant integer cast $ff +Simplifying constant integer cast 3 +Simplifying constant integer cast 0 +Simplifying constant integer cast 3 +Simplifying constant integer cast $80 +Simplifying constant integer cast 8 +Simplifying constant integer cast 8 +Simplifying constant integer cast 4 +Simplifying constant integer cast $a +Simplifying constant integer cast $2d +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $fa +Simplifying constant integer cast $f +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $2f +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 3 +Simplifying constant integer cast 8 +Simplifying constant integer cast $ff +Simplifying constant integer cast $ff +Simplifying constant integer cast $ff +Simplifying constant integer cast 8 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $fb +Simplifying constant integer cast $fa +Simplifying constant integer cast $f +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $10 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast $19 +Simplifying constant integer cast $93 +Simplifying constant integer cast $25 +Simplifying constant integer cast $19 +Simplifying constant integer cast $40 +Simplifying constant integer cast $31 +Simplifying constant integer cast $24 +Simplifying constant integer cast 0 +Simplifying constant integer cast $31 +Simplifying constant integer cast $24 +Simplifying constant integer cast 0 +Simplifying constant integer cast $25 +Simplifying constant integer cast $32 +Simplifying constant integer cast 1 +Simplifying constant integer cast $40 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $e +Simplifying constant integer cast 8 +Simplifying constant integer cast $400 +Simplifying constant integer cast $400 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +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 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast $40 +Simplifying constant integer cast 3 +Simplifying constant integer cast 0 +Simplifying constant integer cast $40 +Simplifying constant integer cast 3 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 7 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast 4 +Simplifying constant integer cast 0 +Simplifying constant integer cast 5 +Simplifying constant integer cast 0 +Simplifying constant integer cast 6 +Simplifying constant integer cast 3 +Simplifying constant integer cast 7 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 3 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast 3 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 3 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast 3 +Simplifying constant integer cast 3 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast 1 +Simplifying constant integer cast 4 +Simplifying constant integer cast 3 +Simplifying constant integer cast 4 +Simplifying constant integer cast $40 +Simplifying constant integer cast $32 +Simplifying constant integer cast $96 +Simplifying constant integer cast $32 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast $fe +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast $fe +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $32 +Simplifying constant integer cast $23 +Simplifying constant integer cast 0 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $23 +Simplifying constant integer cast 0 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $23 +Simplifying constant integer cast 0 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $23 +Simplifying constant integer cast 0 +Simplifying constant integer cast $32 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $61 +Simplifying constant integer cast $61 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $61 +Simplifying constant integer cast $61 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast $46 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $61 +Simplifying constant integer cast $61 +Simplifying constant integer cast 1 +Simplifying constant integer cast $60 +Simplifying constant integer cast $46 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $61 +Simplifying constant integer cast $61 +Simplifying constant integer cast 1 +Simplifying constant integer cast $60 +Simplifying constant integer cast 2 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $f +Simplifying constant integer cast $f +Simplifying constant integer cast 4 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $61 +Simplifying constant integer cast $61 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $32 +Simplifying constant integer cast $23 +Simplifying constant integer cast $23 +Simplifying constant integer cast $23 +Simplifying constant integer cast $23 +Simplifying constant integer cast $3e +Simplifying constant integer cast $a +Simplifying constant integer cast $14 +Simplifying constant integer cast $1e +Simplifying constant integer cast $28 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (word) $a00 +Finalized unsigned number type (word) $a80 +Finalized unsigned number type (word) $b00 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) $ea +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $ea +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $60 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $f0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $1a +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $b +Finalized unsigned number type (byte) $94 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $17 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $2f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $a +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $c00 +Finalized unsigned number type (word) $2000 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $1fff +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $1fff +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 3 +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) $ff +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $a +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $fa +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $2f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $fb +Finalized unsigned number type (byte) $fa +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) $93 +Finalized unsigned number type (byte) $25 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $31 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $31 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $25 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $e +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (word) $400 +Finalized unsigned number type (word) $400 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +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) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 5 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $96 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $fe +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $fe +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $46 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $60 +Finalized unsigned number type (byte) $46 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $60 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) $61 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $32 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) $23 +Finalized unsigned number type (byte) $3e +Finalized unsigned number type (byte) $a +Finalized unsigned number type (byte) $14 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (byte) $28 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in merge_code::$5 = merge_code::cycle_budget#5 - 1 +Inferred type updated to byte in render::$0 = render::ypos#2 / 4 +Inferred type updated to byte in render::$2 = render::ytile#0 * 2 +Inferred type updated to byte in render::$5 = render::ypos#2 & 3 +Inferred type updated to byte in render_tiles::$0 = render_tiles::tile_left#1 * 4 +Inferred type updated to byte in render_tiles::$2 = render_tiles::tile_right#1 * 4 +Inferred type updated to byte in render_tiles::$5 = render_tiles::ytile#1 * 2 +Inferred type updated to byte in splash_run::$23 = splash_run::i#3 * 2 +Inferred type updated to byte in splash_run::$24 = splash_run::i#3 * 2 +Inferred type updated to byte in splash_run::toDd001_$1 = splash_run::toDd001_$0 / $40 +Inferred type updated to byte in splash_run::toDd001_$2 = 3 ^ splash_run::toDd001_$1 +Inferred type updated to word in splash_run::toD0181_$0 = splash_run::toD0181_$7 & $3fff +Inferred type updated to word in splash_run::toD0181_$1 = splash_run::toD0181_$0 * 4 +Inferred type updated to byte in splash_run::toD0181_$2 = > splash_run::toD0181_$1 +Inferred type updated to byte in splash_run::toD0181_$4 = splash_run::toD0181_$3 / 4 +Inferred type updated to byte in splash_run::toD0181_$5 = splash_run::toD0181_$4 & $f +Inferred type updated to byte in splash_run::toD0181_$6 = splash_run::toD0181_$2 | splash_run::toD0181_$5 +Inferred type updated to byte in joyfire::$0 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $10 +Inferred type updated to byte in init_level_tile_directions::$2 = init_level_tile_directions::xtile#3 - 1 +Inferred type updated to byte in init_level_tile_directions::$6 = init_level_tile_directions::xtile#4 + 1 +Inferred type updated to byte in init_level_tile_directions::$10 = init_level_tile_directions::ytile#6 - 1 +Inferred type updated to byte in init_level_tile_directions::$14 = init_level_tile_directions::ytile#7 + 1 +Inferred type updated to word in irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7 & $3fff +Inferred type updated to word in irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0 * 4 +Inferred type updated to byte in irq_screen_top::toD0181_$2 = > irq_screen_top::toD0181_$1 +Inferred type updated to byte in irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3 / 4 +Inferred type updated to byte in irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4 & $f +Inferred type updated to byte in irq_screen_top::toD0181_$6 = irq_screen_top::toD0181_$2 | irq_screen_top::toD0181_$5 +Inferred type updated to byte in irq_screen_top::$1 = frame + 1 +Inferred type updated to byte in irq_screen_top::$2 = irq_screen_top::$1 & 1 +Inferred type updated to byte in irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0 / $40 +Inferred type updated to byte in irq_screen_top::toDd001_$2 = 3 ^ irq_screen_top::toDd001_$1 +Inferred type updated to byte in irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0 / $40 +Inferred type updated to byte in irq_screen_top::toDd002_$2 = 3 ^ irq_screen_top::toDd002_$1 +Inferred type updated to byte in game_logic::$2 = game_logic_substep + 1 +Inferred type updated to byte in game_logic::$3 = game_logic::$2 & 7 +Inferred type updated to byte in game_logic::$14 = anim_frame_idx + 1 +Inferred type updated to byte in game_logic::$15 = game_logic::$14 & 3 +Inferred type updated to byte in game_logic::$16 = pacman_xfine - 1 +Inferred type updated to byte in game_logic::$17 = game_logic::pacman_bob_xfine#0 / 4 +Inferred type updated to byte in game_logic::$18 = pacman_yfine - 1 +Inferred type updated to byte in game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 +Inferred type updated to byte in game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 +Inferred type updated to byte in game_logic::$24 = ghost1_xfine - 1 +Inferred type updated to byte in game_logic::$25 = game_logic::ghost1_bob_xfine#0 / 4 +Inferred type updated to byte in game_logic::$26 = ghost1_yfine - 1 +Inferred type updated to byte in game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 +Inferred type updated to byte in game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 +Inferred type updated to byte in game_logic::$30 = ghost2_xfine - 1 +Inferred type updated to byte in game_logic::$31 = game_logic::ghost2_bob_xfine#0 / 4 +Inferred type updated to byte in game_logic::$32 = ghost2_yfine - 1 +Inferred type updated to byte in game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 +Inferred type updated to byte in game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 +Inferred type updated to byte in game_logic::$36 = ghost3_xfine - 1 +Inferred type updated to byte in game_logic::$37 = game_logic::ghost3_bob_xfine#0 / 4 +Inferred type updated to byte in game_logic::$38 = ghost3_yfine - 1 +Inferred type updated to byte in game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 +Inferred type updated to byte in game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 +Inferred type updated to byte in game_logic::$42 = ghost4_xfine - 1 +Inferred type updated to byte in game_logic::$43 = game_logic::ghost4_bob_xfine#0 / 4 +Inferred type updated to byte in game_logic::$44 = ghost4_yfine - 1 +Inferred type updated to byte in game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 +Inferred type updated to byte in game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 +Inferred type updated to byte in game_logic::$59 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$60 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$69 = game_logic::pacman_xtile#1 / 2 +Inferred type updated to byte in game_logic::$70 = game_logic::pacman_xtile#1 & $fe +Inferred type updated to byte in game_logic::$72 = game_logic::pacman_ytile#1 * 2 +Inferred type updated to byte in game_logic::$65 = game_logic::pacman_xtile#2 / 2 +Inferred type updated to byte in game_logic::$66 = game_logic::pacman_xtile#2 & $fe +Inferred type updated to byte in game_logic::$68 = game_logic::pacman_ytile#2 * 2 +Inferred type updated to byte in game_logic::$112 = ghost4_xfine / 2 +Inferred type updated to byte in game_logic::$113 = ghost4_yfine / 2 +Inferred type updated to byte in game_logic::$117 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$118 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$133 = ghost3_xfine / 2 +Inferred type updated to byte in game_logic::$134 = ghost3_yfine / 2 +Inferred type updated to byte in game_logic::$138 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$139 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$154 = ghost2_xfine / 2 +Inferred type updated to byte in game_logic::$155 = ghost2_yfine / 2 +Inferred type updated to byte in game_logic::$159 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$160 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$175 = ghost1_xfine / 2 +Inferred type updated to byte in game_logic::$176 = ghost1_yfine / 2 +Inferred type updated to byte in game_logic::$180 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$181 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$196 = pacman_xfine / 2 +Inferred type updated to byte in game_logic::$197 = pacman_yfine / 2 +Inferred type updated to byte in game_logic::$199 = *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A) & $f +Inferred type updated to byte in game_logic::$200 = game_logic::$199 ^ $f +Inferred type updated to byte in game_logic::$201 = game_logic::$200 * 4 +Inferred type updated to byte in choose_direction::$10 = choose_direction::ydiff#1 - 1 +Inferred type updated to byte in choose_direction::$14 = choose_direction::ydiff#2 + 1 +Inferred type updated to byte in choose_direction::$18 = choose_direction::xdiff#3 - 1 +Inferred type updated to byte in choose_direction::$22 = choose_direction::xdiff#4 + 1 +Adding pointer type conversion cast (byte*) render::$7 in render::$7 = render::$1 w= (byte)render::$2 +Adding pointer type conversion cast (byte*) render_tiles::$10 in render_tiles::$10 = render_tiles::$4 w= (byte)render_tiles::$5 +Successful SSA optimization PassNAddTypeConversionAssignment +Inversing boolean not [20] memset::$1 = memset::num#5 <= 0 from [19] memset::$0 = memset::num#5 > 0 +Inversing boolean not [53] merge_code::$2 = merge_code::cycle_budget#0 != merge_code::RASTER_EXIT from [52] merge_code::$1 = merge_code::cycle_budget#0 == merge_code::RASTER_EXIT +Inversing boolean not [122] pacman_sound_play::$0 = 0 == pacman_ch1_enabled from [121] pacman_sound_play::$4 = 0 != pacman_ch1_enabled +Inversing boolean not [129] pacman_sound_play::$3 = pacman_ch1_idx != pacman_sound_play::$1 from [128] pacman_sound_play::$2 = pacman_ch1_idx == pacman_sound_play::$1 +Inversing boolean not [143] init_render_index::$2 = init_render_index::x_col#3 < $18 from [142] init_render_index::$1 = init_render_index::x_col#3 >= $18 +Inversing boolean not [170] init_render_index::$8 = init_render_index::ypos_inc_offset#2 < $17 from [169] init_render_index::$7 = init_render_index::ypos_inc_offset#2 >= $17 +Inversing boolean not [329] done_run::$9 = 0 == done_run::$8 from [328] done_run::$13 = 0 != done_run::$8 +Inversing boolean not [332] done_run::$10 = 0 == music_play_next from [331] done_run::$14 = 0 != music_play_next +Inversing boolean not [406] splash_run::$26 = 0 == splash_run::$25 from [405] splash_run::$35 = 0 != splash_run::$25 +Inversing boolean not [495] splash_run::$31 = 0 == splash_run::$30 from [494] splash_run::$36 = 0 != splash_run::$30 +Inversing boolean not [498] splash_run::$32 = 0 == music_play_next from [497] splash_run::$37 = 0 != music_play_next +Inversing boolean not [618] level_show::$3 = TILES_TYPE[level_show::tile_left#0] != PILL from [617] level_show::$2 = TILES_TYPE[level_show::tile_left#0] == PILL +Inversing boolean not [627] level_show::$5 = TILES_TYPE[level_show::tile_right#0] != PILL from [626] level_show::$4 = TILES_TYPE[level_show::tile_right#0] == PILL +Inversing boolean not [694] init_level_tile_directions::$5 = TILES_TYPE[init_level_tile_directions::$3] == WALL from [693] init_level_tile_directions::$4 = TILES_TYPE[init_level_tile_directions::$3] != WALL +Inversing boolean not [708] init_level_tile_directions::$9 = TILES_TYPE[init_level_tile_directions::$7] == WALL from [707] init_level_tile_directions::$8 = TILES_TYPE[init_level_tile_directions::$7] != WALL +Inversing boolean not [721] init_level_tile_directions::$13 = TILES_TYPE[init_level_tile_directions::$11] == WALL from [720] init_level_tile_directions::$12 = TILES_TYPE[init_level_tile_directions::$11] != WALL +Inversing boolean not [734] init_level_tile_directions::$17 = TILES_TYPE[init_level_tile_directions::$15] == WALL from [733] init_level_tile_directions::$16 = TILES_TYPE[init_level_tile_directions::$15] != WALL +Inversing boolean not [838] game_logic::$1 = game_playable != 0 from [837] game_logic::$0 = game_playable == 0 +Inversing boolean not [890] game_logic::$23 = ghosts_mode != FRIGHTENED from [889] game_logic::$22 = ghosts_mode == FRIGHTENED +Inversing boolean not [937] game_logic::$57 = ghosts_mode_count <= $32 from [936] game_logic::$56 = ghosts_mode_count > $32 +Inversing boolean not [944] game_logic::$55 = ghosts_mode_count <= $96 from [943] game_logic::$54 = ghosts_mode_count > $96 +Inversing boolean not [948] game_logic::$51 = ghosts_mode != FRIGHTENED from [947] game_logic::$50 = ghosts_mode == FRIGHTENED +Inversing boolean not [952] game_logic::$53 = ghosts_mode_count <= $32 from [951] game_logic::$52 = ghosts_mode_count > $32 +Inversing boolean not [962] game_logic::$58 = 0 == game_logic::do_reverse#4 from [961] game_logic::$219 = 0 != game_logic::do_reverse#4 +Inversing boolean not [992] game_logic::$74 = pill_count != 0 from [991] game_logic::$73 = pill_count == 0 +Inversing boolean not [996] game_logic::$64 = TILES_TYPE[game_logic::tile_id#1] != POWERUP from [995] game_logic::$63 = TILES_TYPE[game_logic::tile_id#1] == POWERUP +Inversing boolean not [1073] game_logic::$124 = ghost4_respawn != 0 from [1072] game_logic::$123 = ghost4_respawn == 0 +Inversing boolean not [1085] game_logic::$108 = ghost4_direction != UP from [1084] game_logic::$107 = ghost4_direction == UP +Inversing boolean not [1142] game_logic::$122 = ghost4_xfine != $61 from [1141] game_logic::$121 = ghost4_xfine == $61 +Inversing boolean not [1151] game_logic::$145 = ghost3_respawn != 0 from [1150] game_logic::$144 = ghost3_respawn == 0 +Inversing boolean not [1163] game_logic::$129 = ghost3_direction != UP from [1162] game_logic::$128 = ghost3_direction == UP +Inversing boolean not [1220] game_logic::$143 = ghost3_xfine != $61 from [1219] game_logic::$142 = ghost3_xfine == $61 +Inversing boolean not [1229] game_logic::$166 = ghost2_respawn != 0 from [1228] game_logic::$165 = ghost2_respawn == 0 +Inversing boolean not [1241] game_logic::$150 = ghost2_direction != UP from [1240] game_logic::$149 = ghost2_direction == UP +Inversing boolean not [1298] game_logic::$164 = ghost2_xfine != $61 from [1297] game_logic::$163 = ghost2_xfine == $61 +Inversing boolean not [1307] game_logic::$187 = ghost1_respawn != 0 from [1306] game_logic::$186 = ghost1_respawn == 0 +Inversing boolean not [1319] game_logic::$171 = ghost1_direction != UP from [1318] game_logic::$170 = ghost1_direction == UP +Inversing boolean not [1376] game_logic::$185 = ghost1_xfine != $61 from [1375] game_logic::$184 = ghost1_xfine == $61 +Inversing boolean not [1391] game_logic::$192 = pacman_direction != UP from [1390] game_logic::$191 = pacman_direction == UP +Inversing boolean not [1419] game_logic::$203 = game_logic::joy_directions#0 == 0 from [1418] game_logic::$202 = game_logic::joy_directions#0 != 0 +Inversing boolean not [1427] game_logic::$206 = game_logic::new_direction#0 == 0 from [1426] game_logic::$205 = game_logic::new_direction#0 != 0 +Inversing boolean not [1433] game_logic::$209 = pacman_xfine != $61 from [1432] game_logic::$208 = pacman_xfine == $61 +Inversing boolean not [1445] choose_direction::$3 = 0 == choose_direction::$2 from [1444] choose_direction::$26 = 0 != choose_direction::$2 +Inversing boolean not [1450] choose_direction::$5 = 0 == choose_direction::$4 from [1449] choose_direction::$27 = 0 != choose_direction::$4 +Inversing boolean not [1457] choose_direction::$13 = choose_direction::dist_up#0 >= choose_direction::dist_min#5 from [1456] choose_direction::$12 = choose_direction::dist_up#0 < choose_direction::dist_min#5 +Inversing boolean not [1465] choose_direction::$7 = 0 == choose_direction::$6 from [1464] choose_direction::$28 = 0 != choose_direction::$6 +Inversing boolean not [1472] choose_direction::$17 = choose_direction::dist_down#0 >= choose_direction::dist_min#6 from [1471] choose_direction::$16 = choose_direction::dist_down#0 < choose_direction::dist_min#6 +Inversing boolean not [1480] choose_direction::$9 = 0 == choose_direction::$8 from [1479] choose_direction::$29 = 0 != choose_direction::$8 +Inversing boolean not [1487] choose_direction::$21 = choose_direction::dist_left#0 >= choose_direction::dist_min#7 from [1486] choose_direction::$20 = choose_direction::dist_left#0 < choose_direction::dist_min#7 +Inversing boolean not [1499] choose_direction::$25 = choose_direction::dist_right#0 >= choose_direction::dist_min#8 from [1498] choose_direction::$24 = choose_direction::dist_right#0 < choose_direction::dist_min#8 +Successful SSA optimization Pass2UnaryNotSimplification +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias memcpy::src_end#0 = memcpy::$0 +Alias memcpy::src#2 = memcpy::src#3 +Alias memcpy::dst#2 = memcpy::dst#3 +Alias memcpy::src_end#1 = memcpy::src_end#2 +Alias memcpy::destination#2 = memcpy::destination#4 memcpy::destination#3 memcpy::return#0 memcpy::return#3 memcpy::return#1 +Alias memset::return#0 = memset::str#5 memset::return#7 memset::return#1 +Alias memset::str#6 = memset::str#7 +Alias memset::num#5 = memset::num#6 +Alias memset::c#7 = memset::c#8 +Alias memset::end#0 = memset::$2 +Alias memset::c#5 = memset::c#6 +Alias memset::dst#2 = memset::dst#3 +Alias memset::end#1 = memset::end#2 +Alias memset::str#8 = memset::str#9 +Alias merge_code::raster_code#4 = merge_code::raster_code#5 merge_code::raster_code#6 +Alias merge_code::dest_code#14 = merge_code::dest_code#8 merge_code::dest_code#23 +Alias merge_code::logic_code#18 = merge_code::logic_code#22 merge_code::logic_code#19 +Alias merge_code::logic_code#17 = merge_code::logic_code#7 merge_code::logic_code#8 +Alias merge_code::cycle_budget#13 = merge_code::cycle_budget#5 merge_code::cycle_budget#4 +Alias merge_code::raster_code#11 = merge_code::raster_code#12 merge_code::raster_code#17 +Alias merge_code::dest_code#21 = merge_code::dest_code#25 merge_code::dest_code#26 +Alias merge_code::logic_cycles#0 = merge_code::logic_cycles#4 +Alias merge_code::logic_code#10 = merge_code::logic_code#9 merge_code::logic_code#11 +Alias merge_code::dest_code#15 = merge_code::dest_code#9 merge_code::dest_code#27 +Alias merge_code::cycle_budget#11 = merge_code::cycle_budget#12 merge_code::cycle_budget#6 +Alias merge_code::logic_cycles#1 = merge_code::logic_cycles#3 merge_code::logic_cycles#2 +Alias merge_code::raster_code#13 = merge_code::raster_code#16 merge_code::raster_code#15 +Alias merge_code::cycle_budget#10 = merge_code::cycle_budget#8 merge_code::cycle_budget#7 merge_code::cycle_budget#9 +Alias merge_code::dest_code#10 = merge_code::dest_code#16 merge_code::dest_code#20 merge_code::dest_code#11 +Alias merge_code::raster_code#10 = merge_code::raster_code#14 merge_code::raster_code#8 merge_code::raster_code#9 +Alias merge_code::logic_code#21 = merge_code::logic_code#25 merge_code::logic_code#23 merge_code::logic_code#24 +Alias merge_code::logic_code#12 = merge_code::logic_code#13 +Alias merge_code::dest_code#12 = merge_code::dest_code#24 merge_code::dest_code#17 +Alias merge_code::logic_code#14 = merge_code::logic_code#15 merge_code::logic_code#16 +Alias merge_code::dest_code#13 = merge_code::dest_code#18 merge_code::dest_code#22 +Alias init_render_index::x_col#2 = init_render_index::x_col#3 init_render_index::x_col#6 +Alias init_render_index::render_index#4 = init_render_index::render_index#5 init_render_index::render_index#7 +Alias init_render_index::render_index_xcol#0 = init_render_index::render_index#2 +Alias init_render_index::y_pos#2 = init_render_index::y_pos#3 init_render_index::y_pos#5 +Alias init_render_index::canvas_xcol#1 = init_render_index::canvas_xcol#2 init_render_index::canvas_xcol#4 +Alias init_render_index::render_ypos_table#2 = init_render_index::render_ypos_table#3 init_render_index::render_ypos_table#6 +Alias init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#4 init_render_index::render_index_xcol#5 +Alias init_render_index::ypos_inc_offset#4 = init_render_index::ypos_inc_offset#6 +Alias init_render_index::render_index#10 = init_render_index::render_index#9 init_render_index::render_index#6 init_render_index::render_index#3 +Alias init_render_index::x_col#10 = init_render_index::x_col#9 init_render_index::x_col#7 init_render_index::x_col#5 +Alias init_render_index::canvas#0 = init_render_index::$4 +Alias init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#5 +Alias render::ytile#0 = render::$0 +Alias render::render_index_xcol#0 = render::$7 +Alias render::canvas_offset#0 = render::$8 +Alias render::canvas1#0 = render::$3 +Alias render::canvas2#0 = render::$4 +Alias render::ypix#0 = render::$5 +Alias render::canvas1#2 = render::canvas1#4 render::canvas1#3 +Alias render::ypos_inc_offset#2 = render::ypos_inc_offset#3 +Alias render::canvas2#2 = render::canvas2#4 render::canvas2#3 +Alias render::i#2 = render::i#3 +Alias render::ypix#1 = render::ypix#2 +Alias render::pixels#2 = render::pixels#5 render::pixels#3 +Alias render_tiles::tile_left_pixels#0 = render_tiles::$1 +Alias render_tiles::tile_right_pixels#0 = render_tiles::$3 +Alias render_tiles::render_index_xcol#0 = render_tiles::$10 +Alias render_tiles::canvas_offset#0 = render_tiles::$11 +Alias render_tiles::canvas1#0 = render_tiles::$6 +Alias render_tiles::canvas2#0 = render_tiles::$7 +Alias render_tiles::tile_left_pixels#1 = render_tiles::tile_left_pixels#2 +Alias render_tiles::y#2 = render_tiles::y#3 +Alias render_tiles::tile_right_pixels#1 = render_tiles::tile_right_pixels#2 +Alias render_tiles::canvas1#2 = render_tiles::canvas1#3 +Alias render_tiles::canvas2#2 = render_tiles::canvas2#3 +Alias render_tiles::ypos_inc_offset#2 = render_tiles::ypos_inc_offset#3 +Alias render_tiles::pixels#0 = render_tiles::$9 +Alias init_bobs_restore::bob_restore#5 = init_bobs_restore::bob_restore#6 +Alias init_bobs_restore::bob#2 = init_bobs_restore::bob#5 +Alias init_bobs_restore::bob_restore#2 = init_bobs_restore::bob_restore#4 init_bobs_restore::bob_restore#3 +Alias init_bobs_restore::i#2 = init_bobs_restore::i#3 +Alias init_bobs_restore::bob#3 = init_bobs_restore::bob#6 init_bobs_restore::bob#4 +Alias done_run::i#2 = done_run::i#3 +Alias done_run::i1#2 = done_run::i1#3 +Alias done_run::gfx#4 = done_run::gfx#6 +Alias done_run::xcol#2 = done_run::xcol#6 +Alias done_run::gfx#2 = done_run::gfx#3 done_run::gfx#7 +Alias done_run::xcol#3 = done_run::xcol#5 done_run::xcol#7 done_run::xcol#4 +Alias done_run::ypos#2 = done_run::ypos#3 done_run::ypos#4 +Alias done_run::gfx#1 = done_run::gfx#5 +Alias joyfire::return#0 = joyfire::return#5 +Alias splash_run::i#2 = splash_run::i#3 splash_run::i#5 +Alias splash_run::msb#10 = splash_run::msb#3 splash_run::msb#6 splash_run::msb#13 splash_run::msb#12 splash_run::msb#11 splash_run::msb#9 splash_run::msb#7 splash_run::msb#4 +Alias splash_run::toDd001_gfx#0 = splash_run::toDd001_gfx#1 +Alias splash_run::toDd001_return#0 = splash_run::toDd001_$2 splash_run::toDd001_return#2 splash_run::toDd001_return#1 splash_run::toDd001_return#3 splash_run::$17 +Alias splash_run::toD0181_screen#0 = splash_run::toD0181_screen#1 +Alias splash_run::toD0181_gfx#0 = splash_run::toD0181_gfx#1 +Alias splash_run::toD0181_return#0 = splash_run::toD0181_$6 splash_run::toD0181_return#2 splash_run::toD0181_return#1 splash_run::toD0181_return#3 splash_run::$18 +Alias splash_run::msb#1 = splash_run::msb#5 +Alias splash_run::i1#2 = splash_run::i1#3 +Alias splash_run::i2#2 = splash_run::i2#3 +Alias joyfire::return#1 = joyfire::return#6 +Alias gameplay_run::i#2 = gameplay_run::i#3 +Alias gameplay_run::i1#2 = gameplay_run::i1#3 +Alias level_show::return#0 = level_show::return#3 +Alias gameplay_run::i2#2 = gameplay_run::i2#3 +Alias joyfire::return#4 = joyfire::return#7 +Alias splash_show::splash#4 = splash_show::splash#6 +Alias splash_show::xcol#2 = splash_show::xcol#6 +Alias splash_show::splash#2 = splash_show::splash#3 splash_show::splash#7 +Alias splash_show::xcol#3 = splash_show::xcol#5 splash_show::xcol#7 splash_show::xcol#4 +Alias splash_show::ypos#2 = splash_show::ypos#3 splash_show::ypos#4 +Alias splash_show::splash#1 = splash_show::splash#5 +Alias level_show::level#8 = level_show::level#9 +Alias level_show::ytile#2 = level_show::ytile#9 +Alias level_show::count#12 = level_show::count#6 level_show::count#3 level_show::return#1 level_show::return#4 level_show::return#2 +Alias level_show::level#2 = level_show::level#5 level_show::level#3 level_show::level#6 +Alias level_show::xtile#3 = level_show::xtile#5 +Alias level_show::count#10 = level_show::count#7 level_show::count#9 level_show::count#4 +Alias level_show::xcol#2 = level_show::xcol#7 level_show::xcol#8 +Alias level_show::ytile#10 = level_show::ytile#5 level_show::ytile#3 level_show::ytile#11 +Alias level_show::xtile#1 = level_show::xtile#6 +Alias level_show::tile_left#0 = level_show::tile_left#4 +Alias level_show::xcol#3 = level_show::xcol#4 +Alias level_show::level#10 = level_show::level#7 +Alias level_show::xtile#7 = level_show::xtile#8 +Alias level_show::ytile#4 = level_show::ytile#8 +Alias level_show::count#11 = level_show::count#13 +Alias level_show::count#5 = level_show::count#8 +Alias level_show::xcol#5 = level_show::xcol#6 +Alias level_show::ytile#6 = level_show::ytile#7 +Alias level_show::tile_left#2 = level_show::tile_left#3 +Alias level_show::tile_right#0 = level_show::tile_right#2 +Alias level_show::level#11 = level_show::level#4 +Alias level_show::xtile#2 = level_show::xtile#9 +Alias level_tile_get::ytile#4 = level_tile_get::ytile#5 +Alias level_tile_get::xtile#4 = level_tile_get::xtile#5 +Alias level_tile_get::ytiles#0 = level_tile_get::$4 +Alias level_tile_get::return#2 = level_tile_get::return#7 +Alias level_tile_directions::ytile#5 = level_tile_directions::ytile#6 +Alias level_tile_directions::xtile#5 = level_tile_directions::xtile#6 +Alias level_tile_directions::ytiles#0 = level_tile_directions::$4 +Alias level_tile_directions::return#2 = level_tile_directions::return#8 +Alias init_level_tile_directions::ytile#15 = init_level_tile_directions::ytile#2 +Alias init_level_tile_directions::directions#7 = init_level_tile_directions::directions#9 +Alias init_level_tile_directions::xtile#2 = init_level_tile_directions::xtile#3 init_level_tile_directions::xtile#9 init_level_tile_directions::xtile#8 +Alias init_level_tile_directions::ytile#10 = init_level_tile_directions::ytile#3 init_level_tile_directions::ytile#8 init_level_tile_directions::ytile#4 init_level_tile_directions::ytile#9 +Alias init_level_tile_directions::directions#16 = init_level_tile_directions::directions#18 init_level_tile_directions::directions#4 init_level_tile_directions::directions#17 init_level_tile_directions::directions#2 +Alias level_tile_get::xtile#0 = init_level_tile_directions::$2 +Alias level_tile_get::return#3 = level_tile_get::return#8 +Alias init_level_tile_directions::open_directions#0 = init_level_tile_directions::open_directions#10 init_level_tile_directions::open_directions#5 +Alias level_tile_get::xtile#1 = init_level_tile_directions::$6 +Alias level_tile_get::return#4 = level_tile_get::return#9 +Alias init_level_tile_directions::ytile#11 = init_level_tile_directions::ytile#12 init_level_tile_directions::ytile#5 +Alias init_level_tile_directions::xtile#10 = init_level_tile_directions::xtile#11 init_level_tile_directions::xtile#4 +Alias init_level_tile_directions::open_directions#11 = init_level_tile_directions::open_directions#14 init_level_tile_directions::open_directions#6 +Alias init_level_tile_directions::directions#13 = init_level_tile_directions::directions#14 init_level_tile_directions::directions#15 +Alias level_tile_get::ytile#2 = init_level_tile_directions::$10 +Alias level_tile_get::return#10 = level_tile_get::return#5 +Alias init_level_tile_directions::ytile#13 = init_level_tile_directions::ytile#14 init_level_tile_directions::ytile#6 +Alias init_level_tile_directions::xtile#12 = init_level_tile_directions::xtile#13 init_level_tile_directions::xtile#5 +Alias init_level_tile_directions::open_directions#12 = init_level_tile_directions::open_directions#15 init_level_tile_directions::open_directions#7 +Alias init_level_tile_directions::directions#10 = init_level_tile_directions::directions#11 init_level_tile_directions::directions#12 +Alias level_tile_get::ytile#3 = init_level_tile_directions::$14 +Alias level_tile_get::return#11 = level_tile_get::return#6 +Alias init_level_tile_directions::open_directions#13 = init_level_tile_directions::open_directions#16 init_level_tile_directions::open_directions#9 +Alias init_level_tile_directions::directions#5 = init_level_tile_directions::directions#6 init_level_tile_directions::directions#8 +Alias init_level_tile_directions::xtile#14 = init_level_tile_directions::xtile#15 init_level_tile_directions::xtile#6 +Alias init_level_tile_directions::ytile#17 = init_level_tile_directions::ytile#18 init_level_tile_directions::ytile#7 +Alias init_sprite_pointers::screen#2 = init_sprite_pointers::screen#6 +Alias init_sprite_pointers::sprites_ptr_1#5 = init_sprite_pointers::sprites_ptr_1#6 +Alias init_sprite_pointers::sprites_ptr_2#5 = init_sprite_pointers::sprites_ptr_2#6 +Alias init_sprite_pointers::screen#3 = init_sprite_pointers::screen#5 init_sprite_pointers::screen#4 +Alias init_sprite_pointers::sprite#2 = init_sprite_pointers::sprite#3 +Alias init_sprite_pointers::sprites_ptr_1#2 = init_sprite_pointers::sprites_ptr_1#4 init_sprite_pointers::sprites_ptr_1#3 +Alias init_sprite_pointers::sprites_ptr_2#2 = init_sprite_pointers::sprites_ptr_2#4 init_sprite_pointers::sprites_ptr_2#3 +Alias init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$3 +Alias irq_screen_top::toD0181_screen#0 = irq_screen_top::toD0181_screen#1 +Alias irq_screen_top::toD0181_gfx#0 = irq_screen_top::toD0181_gfx#1 +Alias irq_screen_top::toD0181_return#0 = irq_screen_top::toD0181_$6 irq_screen_top::toD0181_return#2 irq_screen_top::toD0181_return#1 irq_screen_top::toD0181_return#3 irq_screen_top::$0 +Alias irq_screen_top::toDd001_gfx#0 = irq_screen_top::toDd001_gfx#1 +Alias irq_screen_top::toDd001_return#0 = irq_screen_top::toDd001_$2 irq_screen_top::toDd001_return#2 irq_screen_top::toDd001_return#1 irq_screen_top::toDd001_return#3 irq_screen_top::$5 +Alias irq_screen_top::toDd002_gfx#0 = irq_screen_top::toDd002_gfx#1 +Alias irq_screen_top::toDd002_return#0 = irq_screen_top::toDd002_$2 irq_screen_top::toDd002_return#2 irq_screen_top::toDd002_return#1 irq_screen_top::toDd002_return#3 irq_screen_top::$4 +Alias game_logic::pacman_bob_xfine#0 = game_logic::$16 +Alias game_logic::ghost1_bob_xfine#0 = game_logic::$24 +Alias game_logic::ghost2_bob_xfine#0 = game_logic::$30 +Alias game_logic::ghost3_bob_xfine#0 = game_logic::$36 +Alias game_logic::ghost4_bob_xfine#0 = game_logic::$42 +Alias game_logic::ghost_frame_idx#0 = game_logic::ghost_frame_idx#3 +Alias game_logic::do_reverse#0 = game_logic::do_reverse#7 game_logic::do_reverse#9 game_logic::do_reverse#8 game_logic::do_reverse#5 game_logic::do_reverse#6 +Alias game_logic::pacman_xtile#0 = game_logic::$59 game_logic::pacman_xtile#1 game_logic::pacman_xtile#3 game_logic::pacman_xtile#2 +Alias game_logic::pacman_ytile#0 = game_logic::$60 game_logic::pacman_ytile#1 game_logic::pacman_ytile#3 game_logic::pacman_ytile#2 +Alias game_logic::ytiles#0 = game_logic::$61 game_logic::ytiles#1 game_logic::ytiles#3 game_logic::ytiles#2 +Alias game_logic::tile_id#0 = game_logic::tile_id#1 +Alias game_logic::ghost4_xtile#0 = game_logic::$112 game_logic::ghost4_xtile#5 game_logic::ghost4_xtile#4 game_logic::ghost4_xtile#2 game_logic::ghost4_xtile#3 +Alias game_logic::ghost4_ytile#0 = game_logic::$113 game_logic::ghost4_ytile#5 game_logic::ghost4_ytile#4 game_logic::ghost4_ytile#2 game_logic::ghost4_ytile#3 +Alias level_tile_directions::return#3 = level_tile_directions::return#9 +Alias game_logic::open_directions#0 = game_logic::$114 +Alias game_logic::open_directions#1 = game_logic::open_directions#2 game_logic::open_directions#6 game_logic::open_directions#4 game_logic::open_directions#5 +Alias game_logic::target_xtile#2 = game_logic::$117 +Alias game_logic::target_ytile#2 = game_logic::$118 +Alias choose_direction::return#0 = choose_direction::return#6 +Alias game_logic::ghost3_xtile#0 = game_logic::$133 game_logic::ghost3_xtile#5 game_logic::ghost3_xtile#4 game_logic::ghost3_xtile#3 game_logic::ghost3_xtile#2 +Alias game_logic::ghost3_ytile#0 = game_logic::$134 game_logic::ghost3_ytile#5 game_logic::ghost3_ytile#4 game_logic::ghost3_ytile#3 game_logic::ghost3_ytile#2 +Alias level_tile_directions::return#10 = level_tile_directions::return#4 +Alias game_logic::open_directions1#0 = game_logic::$135 +Alias game_logic::open_directions1#1 = game_logic::open_directions1#2 game_logic::open_directions1#6 game_logic::open_directions1#5 game_logic::open_directions1#4 +Alias game_logic::target_xtile1#2 = game_logic::$138 +Alias game_logic::target_ytile1#2 = game_logic::$139 +Alias choose_direction::return#1 = choose_direction::return#7 +Alias game_logic::ghost2_xtile#0 = game_logic::$154 game_logic::ghost2_xtile#5 game_logic::ghost2_xtile#4 game_logic::ghost2_xtile#2 game_logic::ghost2_xtile#3 +Alias game_logic::ghost2_ytile#0 = game_logic::$155 game_logic::ghost2_ytile#5 game_logic::ghost2_ytile#4 game_logic::ghost2_ytile#2 game_logic::ghost2_ytile#3 +Alias level_tile_directions::return#11 = level_tile_directions::return#5 +Alias game_logic::open_directions2#0 = game_logic::$156 +Alias game_logic::open_directions2#1 = game_logic::open_directions2#2 game_logic::open_directions2#6 game_logic::open_directions2#4 game_logic::open_directions2#5 +Alias game_logic::target_xtile2#2 = game_logic::$159 +Alias game_logic::target_ytile2#2 = game_logic::$160 +Alias choose_direction::return#2 = choose_direction::return#8 +Alias game_logic::ghost1_xtile#0 = game_logic::$175 game_logic::ghost1_xtile#5 game_logic::ghost1_xtile#4 game_logic::ghost1_xtile#2 game_logic::ghost1_xtile#3 +Alias game_logic::ghost1_ytile#0 = game_logic::$176 game_logic::ghost1_ytile#5 game_logic::ghost1_ytile#4 game_logic::ghost1_ytile#2 game_logic::ghost1_ytile#3 +Alias level_tile_directions::return#12 = level_tile_directions::return#6 +Alias game_logic::open_directions3#0 = game_logic::$177 +Alias game_logic::open_directions3#1 = game_logic::open_directions3#2 game_logic::open_directions3#6 game_logic::open_directions3#4 game_logic::open_directions3#5 +Alias game_logic::target_xtile3#2 = game_logic::$180 +Alias game_logic::target_ytile3#2 = game_logic::$181 +Alias choose_direction::return#3 = choose_direction::return#9 +Alias game_logic::pacman_xtile1#0 = game_logic::$196 +Alias game_logic::pacman_ytile1#0 = game_logic::$197 +Alias level_tile_directions::return#13 = level_tile_directions::return#7 +Alias game_logic::open_directions4#0 = game_logic::$198 game_logic::open_directions4#2 game_logic::open_directions4#3 +Alias game_logic::joy_directions#0 = game_logic::$201 game_logic::joy_directions#1 +Alias game_logic::new_direction#0 = game_logic::new_direction#1 +Alias choose_direction::xdiff#0 = choose_direction::$0 choose_direction::xdiff#1 choose_direction::xdiff#8 +Alias choose_direction::ydiff#0 = choose_direction::$1 choose_direction::ydiff#1 choose_direction::ydiff#8 +Alias choose_direction::dist_min#0 = choose_direction::dist_min#5 +Alias choose_direction::open_directions#4 = choose_direction::open_directions#8 choose_direction::open_directions#9 +Alias choose_direction::direction#0 = choose_direction::direction#12 +Alias choose_direction::dist_up#0 = choose_direction::$11 choose_direction::dist_up#1 choose_direction::dist_min#1 +Alias choose_direction::ydiff#2 = choose_direction::ydiff#5 choose_direction::ydiff#9 +Alias choose_direction::xdiff#2 = choose_direction::xdiff#5 choose_direction::xdiff#9 +Alias choose_direction::dist_min#6 = choose_direction::dist_min#9 +Alias choose_direction::open_directions#10 = choose_direction::open_directions#5 choose_direction::open_directions#11 +Alias choose_direction::direction#10 = choose_direction::direction#11 +Alias choose_direction::dist_down#0 = choose_direction::$15 choose_direction::dist_down#1 choose_direction::dist_min#2 +Alias choose_direction::xdiff#10 = choose_direction::xdiff#3 choose_direction::xdiff#6 +Alias choose_direction::ydiff#10 = choose_direction::ydiff#3 choose_direction::ydiff#6 +Alias choose_direction::dist_min#10 = choose_direction::dist_min#7 +Alias choose_direction::open_directions#12 = choose_direction::open_directions#13 choose_direction::open_directions#6 +Alias choose_direction::direction#8 = choose_direction::direction#9 +Alias choose_direction::dist_left#0 = choose_direction::$19 choose_direction::dist_left#1 choose_direction::dist_min#3 +Alias choose_direction::return#10 = choose_direction::return#4 choose_direction::direction#5 choose_direction::return#5 +Alias choose_direction::xdiff#4 = choose_direction::xdiff#7 +Alias choose_direction::ydiff#4 = choose_direction::ydiff#7 +Alias choose_direction::dist_min#11 = choose_direction::dist_min#8 +Alias choose_direction::direction#6 = choose_direction::direction#7 +Alias choose_direction::dist_right#0 = choose_direction::$23 choose_direction::dist_right#1 choose_direction::dist_min#4 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias init_render_index::render_index_xcol#0 = init_render_index::render_index#4 +Alias init_render_index::x_col#2 = init_render_index::x_col#4 +Alias init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#3 +Alias init_render_index::y_pos#2 = init_render_index::y_pos#4 +Alias init_render_index::canvas_xcol#1 = init_render_index::canvas_xcol#3 +Alias init_render_index::render_ypos_table#2 = init_render_index::render_ypos_table#5 +Alias init_render_index::render_index#10 = init_render_index::render_index#8 +Alias init_render_index::x_col#10 = init_render_index::x_col#8 +Alias splash_run::i#2 = splash_run::i#4 +Alias level_show::level#10 = level_show::level#11 level_show::level#2 +Alias level_show::xtile#1 = level_show::xtile#4 +Alias level_show::xcol#2 = level_show::xcol#5 level_show::xcol#3 +Alias level_show::ytile#10 = level_show::ytile#6 level_show::ytile#4 +Alias level_show::tile_left#0 = level_show::tile_left#2 level_show::tile_left#1 +Alias level_show::tile_right#0 = level_show::tile_right#1 +Alias level_show::xtile#2 = level_show::xtile#7 +Alias init_level_tile_directions::xtile#10 = init_level_tile_directions::xtile#2 init_level_tile_directions::xtile#12 init_level_tile_directions::xtile#14 init_level_tile_directions::xtile#7 +Alias init_level_tile_directions::ytile#10 = init_level_tile_directions::ytile#11 init_level_tile_directions::ytile#13 init_level_tile_directions::ytile#17 init_level_tile_directions::ytile#16 +Alias init_level_tile_directions::directions#10 = init_level_tile_directions::directions#13 init_level_tile_directions::directions#16 init_level_tile_directions::directions#5 init_level_tile_directions::directions#3 +Alias game_logic::open_directions#1 = game_logic::open_directions#3 +Alias game_logic::ghost4_xtile#0 = game_logic::ghost4_xtile#1 +Alias game_logic::ghost4_ytile#0 = game_logic::ghost4_ytile#1 +Alias game_logic::open_directions1#1 = game_logic::open_directions1#3 +Alias game_logic::ghost3_xtile#0 = game_logic::ghost3_xtile#1 +Alias game_logic::ghost3_ytile#0 = game_logic::ghost3_ytile#1 +Alias game_logic::open_directions2#1 = game_logic::open_directions2#3 +Alias game_logic::ghost2_xtile#0 = game_logic::ghost2_xtile#1 +Alias game_logic::ghost2_ytile#0 = game_logic::ghost2_ytile#1 +Alias game_logic::open_directions3#1 = game_logic::open_directions3#3 +Alias game_logic::ghost1_xtile#0 = game_logic::ghost1_xtile#1 +Alias game_logic::ghost1_ytile#0 = game_logic::ghost1_ytile#1 +Alias game_logic::open_directions4#0 = game_logic::open_directions4#1 +Alias choose_direction::open_directions#10 = choose_direction::open_directions#4 choose_direction::open_directions#12 choose_direction::open_directions#7 +Alias choose_direction::ydiff#0 = choose_direction::ydiff#2 choose_direction::ydiff#10 choose_direction::ydiff#4 +Alias choose_direction::xdiff#0 = choose_direction::xdiff#2 choose_direction::xdiff#10 choose_direction::xdiff#4 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Identical Phi Values memcpy::source#1 memcpy::source#0 +Identical Phi Values memcpy::destination#1 memcpy::destination#0 +Identical Phi Values memcpy::num#1 memcpy::num#0 +Identical Phi Values memcpy::src_end#1 memcpy::src_end#0 +Identical Phi Values memcpy::destination#2 memcpy::destination#1 +Identical Phi Values memset::end#1 memset::end#0 +Identical Phi Values memset::str#8 memset::str#6 +Identical Phi Values memset::c#5 memset::c#7 +Identical Phi Values merge_code::raster_code#7 merge_code::raster_code#3 +Identical Phi Values merge_code::dest_code#19 merge_code::dest_code#7 +Identical Phi Values merge_code::logic_code#20 merge_code::logic_code#6 +Identical Phi Values merge_code::cycle_budget#11 merge_code::cycle_budget#13 +Identical Phi Values merge_code::logic_cycles#1 merge_code::logic_cycles#0 +Identical Phi Values merge_code::raster_code#13 merge_code::raster_code#11 +Identical Phi Values merge_code::raster_code#10 merge_code::raster_code#11 +Identical Phi Values merge_code::logic_code#21 merge_code::logic_code#17 +Identical Phi Values init_render_index::canvas_xcol#1 init_render_index::canvas_xcol#0 +Identical Phi Values init_render_index::render_ypos_table#2 init_render_index::render_ypos_table#4 +Identical Phi Values init_render_index::render_index#10 init_render_index::render_index_xcol#0 +Identical Phi Values init_render_index::x_col#10 init_render_index::x_col#2 +Identical Phi Values render::ypix#1 render::ypix#0 +Identical Phi Values render::pixels#2 render::pixels#4 +Identical Phi Values render_tiles::tile_left#1 render_tiles::tile_left#0 +Identical Phi Values render_tiles::tile_right#1 render_tiles::tile_right#0 +Identical Phi Values render_tiles::xcol#1 render_tiles::xcol#0 +Identical Phi Values render_tiles::ytile#1 render_tiles::ytile#0 +Identical Phi Values render_tiles::tile_left_pixels#1 render_tiles::tile_left_pixels#0 +Identical Phi Values render_tiles::tile_right_pixels#1 render_tiles::tile_right_pixels#0 +Identical Phi Values init_bobs_restore::bob_restore#2 init_bobs_restore::bob_restore#5 +Identical Phi Values init_bobs_restore::bob#3 init_bobs_restore::bob#2 +Identical Phi Values done_run::xcol#3 done_run::xcol#2 +Identical Phi Values splash_show::xcol#3 splash_show::xcol#2 +Identical Phi Values level_show::level#10 level_show::level#8 +Identical Phi Values level_show::ytile#10 level_show::ytile#2 +Identical Phi Values init_level_tile_directions::ytile#10 init_level_tile_directions::ytile#15 +Identical Phi Values init_level_tile_directions::directions#10 init_level_tile_directions::directions#7 +Identical Phi Values init_sprite_pointers::screen#3 init_sprite_pointers::screen#2 +Identical Phi Values init_sprite_pointers::sprites_ptr_1#2 init_sprite_pointers::sprites_ptr_1#5 +Identical Phi Values init_sprite_pointers::sprites_ptr_2#2 init_sprite_pointers::sprites_ptr_2#5 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values memset::return#0 memset::str#6 +Identical Phi Values merge_code::raster_code#11 merge_code::raster_code#2 +Successful SSA optimization Pass2IdenticalPhiElimination +Identified duplicate assignment right side [401] splash_run::$24 = splash_run::i#2 * 2 +Successful SSA optimization Pass2DuplicateRValueIdentification +Simple Condition memcpy::$1 [7] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 +Simple Condition memset::$1 [14] if(memset::num#5<=0) goto memset::@1 +Simple Condition memset::$3 [21] if(memset::dst#2!=memset::end#0) goto memset::@4 +Simple Condition merge_code::$0 [30] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 +Simple Condition merge_code::$2 [38] if(merge_code::cycle_budget#0!=merge_code::RASTER_EXIT) goto merge_code::@4 +Simple Condition merge_code::$3 [41] if(merge_code::cycle_budget#13>0) goto merge_code::@5 +Simple Condition merge_code::$11 [54] if(*merge_code::logic_code#10!=merge_code::LOGIC_END) goto merge_code::@7 +Simple Condition merge_code::$12 [62] if(merge_code::cycle_budget#10>0) goto merge_code::@11 +Simple Condition merge_code::$13 [64] if(merge_code::cycle_budget#10==3) goto merge_code::@12 +Simple Condition merge_code::$14 [75] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 +Simple Condition merge_code::$15 [81] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 +Simple Condition pacman_sound_play::$0 [95] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return +Simple Condition pacman_sound_play::$3 [101] if(pacman_ch1_idx!=pacman_sound_play::$1) goto pacman_sound_play::@return +Simple Condition init_render_index::$0 [109] if(init_render_index::x_col#2<$1a) goto init_render_index::@2 +Simple Condition init_render_index::$2 [113] if(init_render_index::x_col#2<$18) goto init_render_index::@4 +Simple Condition init_render_index::$3 [124] if(init_render_index::y_pos#2<$94) goto init_render_index::@6 +Simple Condition init_render_index::$8 [135] if(init_render_index::ypos_inc_offset#2<$17) goto init_render_index::@8 +Simple Condition render::$6 [157] if(render::i#2=choose_direction::dist_min#0) goto choose_direction::@1 +Simple Condition choose_direction::$7 [1207] if(0==choose_direction::$6) goto choose_direction::@3 +Simple Condition choose_direction::$17 [1211] if(choose_direction::dist_down#0>=choose_direction::dist_min#6) goto choose_direction::@2 +Simple Condition choose_direction::$9 [1216] if(0==choose_direction::$8) goto choose_direction::@4 +Simple Condition choose_direction::$21 [1220] if(choose_direction::dist_left#0>=choose_direction::dist_min#10) goto choose_direction::@3 +Simple Condition choose_direction::$25 [1226] if(choose_direction::dist_right#0>=choose_direction::dist_min#11) goto choose_direction::@4 +Successful SSA optimization Pass2ConditionalJumpSimplification +Rewriting ! if()-condition to reversed if() [49] merge_code::$10 = ! merge_code::$9 +Rewriting && if()-condition to two if()s [48] merge_code::$9 = merge_code::$4 && merge_code::$8 +Rewriting ! if()-condition to reversed if() [474] gameplay_run::$15 = ! gameplay_run::$14 +Rewriting || if()-condition to two if()s [473] gameplay_run::$14 = pacman_wins || gameplay_run::$13 +Rewriting ! if()-condition to reversed if() [540] level_tile_get::$3 = ! level_tile_get::$2 +Rewriting || if()-condition to two if()s [539] level_tile_get::$2 = level_tile_get::$0 || level_tile_get::$1 +Rewriting ! if()-condition to reversed if() [552] level_tile_directions::$3 = ! level_tile_directions::$2 +Rewriting || if()-condition to two if()s [551] level_tile_directions::$2 = level_tile_directions::$0 || level_tile_directions::$1 +Rewriting ! if()-condition to reversed if() [717] game_logic::$13 = ! game_logic::$12 +Rewriting || if()-condition to two if()s [716] game_logic::$12 = game_logic::$10 || game_logic::$11 +Rewriting && if()-condition to two if()s [832] game_logic::$79 = game_logic::$76 && game_logic::$78 +Rewriting && if()-condition to two if()s [841] game_logic::$84 = game_logic::$81 && game_logic::$83 +Rewriting && if()-condition to two if()s [849] game_logic::$89 = game_logic::$86 && game_logic::$88 +Rewriting ! if()-condition to reversed if() [858] game_logic::$95 = ! game_logic::$94 +Rewriting && if()-condition to two if()s [857] game_logic::$94 = game_logic::$91 && game_logic::$93 +Rewriting && if()-condition to two if()s [907] game_logic::$111 = game_logic::$109 && game_logic::$110 +Rewriting && if()-condition to two if()s [971] game_logic::$132 = game_logic::$130 && game_logic::$131 +Rewriting && if()-condition to two if()s [1035] game_logic::$153 = game_logic::$151 && game_logic::$152 +Rewriting && if()-condition to two if()s [1099] game_logic::$174 = game_logic::$172 && game_logic::$173 +Rewriting && if()-condition to two if()s [1158] game_logic::$195 = game_logic::$193 && game_logic::$194 +Rewriting || if()-condition to two if()s [47] merge_code::$8 = merge_code::$6 || merge_code::$7 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Warning! Adding boolean cast to non-boolean condition pacman_wins +Negating conditional jump and destination [41] if(merge_code::cycle_budget#13<=0) goto merge_code::@10 +Constant right-side identified [99] pacman_sound_play::$1 = sizeof PACMAN_CH1_FREQ_HI +Constant right-side identified [204] init_bobs_restore::$2 = < init_bobs_restore::CANVAS_HIDDEN +Constant right-side identified [206] init_bobs_restore::$3 = > init_bobs_restore::CANVAS_HIDDEN +Constant right-side identified [208] init_bobs_restore::$4 = < init_bobs_restore::CANVAS_HIDDEN +Constant right-side identified [210] init_bobs_restore::$5 = > init_bobs_restore::CANVAS_HIDDEN +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant pacman_sound_play::$1 = sizeof PACMAN_CH1_FREQ_HI +Constant init_render_index::render_index#0 = RENDER_INDEX +Constant init_render_index::x_col#0 = 0 +Constant init_render_index::render_ypos_table#0 = RENDER_YPOS +Constant init_render_index::ypos_inc_offset#0 = 0 +Constant init_render_index::y_pos#0 = 0 +Constant init_render_index::render_ypos_table#1 = RENDER_YPOS_9TH +Constant init_render_index::ypos_inc_offset#1 = $b +Constant render::i#0 = 0 +Constant render_tiles::y#0 = 0 +Constant init_bobs_restore::bob_restore#0 = bobs_restore +Constant init_bobs_restore::bob#0 = 0 +Constant init_bobs_restore::i#0 = 0 +Constant init_bobs_restore::$2 = init_bobs_restore::CANVAS_HIDDEN +Constant init_bobs_restore::$4 = init_bobs_restore::CANVAS_HIDDEN +Constant done_run::i#0 = 0 +Constant done_run::i1#0 = 0 +Constant done_run::gfx#0 = WIN_GFX +Constant done_run::xcol#0 = 0 +Constant done_run::ypos#0 = 0 +Constant memset::str#0 = (void*) 16384 +Constant memset::c#0 = 0 +Constant memset::num#0 = $c00 +Constant merge_code::dest_code#7 = RASTER_CODE +Constant merge_code::raster_code#3 = RASTER_CODE_UNMERGED +Constant merge_code::logic_code#6 = LOGIC_CODE_UNMERGED +Constant memset::str#1 = (void*)BANK_1+$2000 +Constant memset::c#1 = 0 +Constant memset::num#1 = $1fff +Constant memset::str#2 = (void*)BANK_2 +Constant memset::c#2 = 0 +Constant memset::num#2 = $3fff +Constant memset::str#3 = (void*)BANK_1 +Constant memset::c#3 = 0 +Constant memset::num#3 = $1fff +Constant memcpy::destination#0 = (void*)INTRO_MUSIC_CRUNCHED_UPPER +Constant memcpy::source#0 = (void*)INTRO_MUSIC_CRUNCHED +Constant memcpy::num#0 = INTRO_MUSIC_CRUNCHED_SIZE +Constant memset::str#4 = (void*)INTRO_MUSIC_CRUNCHED_UPPER +Constant memset::c#4 = 0 +Constant memset::num#4 = INTRO_MUSIC_CRUNCHED_SIZE +Constant splash_run::msb#0 = 0 +Constant splash_run::i#0 = 0 +Constant splash_run::toDd001_gfx#0 = SCREENS_1 +Constant splash_run::toD0181_screen#0 = SCREENS_1 +Constant splash_run::toD0181_gfx#0 = SCREENS_1 +Constant splash_run::i1#0 = 0 +Constant splash_run::i2#0 = 0 +Constant gameplay_run::i#0 = 0 +Constant gameplay_run::i1#0 = 0 +Constant gameplay_run::i2#0 = 0 +Constant joyfire::return#2 = 1 +Constant joyfire::return#3 = 0 +Constant splash_show::splash#0 = SPLASH +Constant splash_show::xcol#0 = 0 +Constant splash_show::ypos#0 = 0 +Constant level_show::count#0 = 0 +Constant level_show::level#0 = LEVEL_TILES +Constant level_show::ytile#0 = 0 +Constant level_show::xcol#0 = 0 +Constant level_show::xtile#0 = 0 +Constant level_tile_get::return#1 = 0 +Constant level_tile_directions::return#1 = 0 +Constant init_level_tile_directions::directions#0 = LEVEL_TILES_DIRECTIONS +Constant init_level_tile_directions::ytile#0 = 0 +Constant init_level_tile_directions::xtile#0 = 0 +Constant init_level_tile_directions::open_directions#0 = 0 +Constant init_sprite_pointers::sprites_ptr_1#0 = SCREENS_1+OFFSET_SPRITE_PTRS +Constant init_sprite_pointers::sprites_ptr_2#0 = SCREENS_2+OFFSET_SPRITE_PTRS +Constant init_sprite_pointers::screen#0 = 0 +Constant init_sprite_pointers::sprite#0 = 0 +Constant irq_screen_top::toD0181_screen#0 = SCREENS_1 +Constant irq_screen_top::toD0181_gfx#0 = SCREENS_1 +Constant irq_screen_top::toDd001_gfx#0 = SCREENS_2 +Constant irq_screen_top::toDd002_gfx#0 = SCREENS_1 +Constant game_logic::do_reverse#0 = 0 +Constant game_logic::do_reverse#1 = 1 +Constant game_logic::do_reverse#2 = 1 +Constant game_logic::do_reverse#3 = 1 +Constant game_logic::target_xtile#0 = 0 +Constant game_logic::target_ytile#0 = 0 +Constant game_logic::target_xtile#1 = 2 +Constant game_logic::target_ytile#1 = 2 +Constant game_logic::target_xtile1#0 = 0 +Constant game_logic::target_ytile1#0 = 0 +Constant game_logic::target_xtile1#1 = 2 +Constant game_logic::target_ytile1#1 = 2 +Constant game_logic::target_xtile2#0 = 0 +Constant game_logic::target_ytile2#0 = 0 +Constant game_logic::target_xtile2#1 = 2 +Constant game_logic::target_ytile2#1 = 2 +Constant game_logic::target_xtile3#0 = 0 +Constant game_logic::target_ytile3#0 = 0 +Constant game_logic::target_xtile3#1 = 2 +Constant game_logic::target_ytile3#1 = 2 +Constant choose_direction::direction#0 = STOP +Constant choose_direction::dist_min#0 = $ff +Constant choose_direction::direction#1 = UP +Constant choose_direction::direction#2 = DOWN +Constant choose_direction::direction#3 = LEFT +Constant choose_direction::direction#4 = RIGHT +Successful SSA optimization Pass2ConstantIdentification +Constant memcpy::src#0 = (byte*)memcpy::source#0 +Constant memcpy::dst#0 = (byte*)memcpy::destination#0 +Constant memcpy::$2 = (byte*)memcpy::source#0 +Constant memcpy::return#2 = memcpy::destination#0 +Constant splash_run::toD0181_$7 = (word)splash_run::toD0181_screen#0 +Constant irq_screen_top::toD0181_$7 = (word)irq_screen_top::toD0181_screen#0 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (word)splash_run::toDd001_gfx#0 in [341] splash_run::toDd001_$0 = > (word)splash_run::toDd001_gfx#0 +Constant value identified (word)splash_run::toD0181_gfx#0 in [353] splash_run::toD0181_$3 = > (word)splash_run::toD0181_gfx#0 +Constant value identified (word)irq_screen_top::toD0181_gfx#0 in [646] irq_screen_top::toD0181_$3 = > (word)irq_screen_top::toD0181_gfx#0 +Constant value identified (word)irq_screen_top::toDd001_gfx#0 in [660] irq_screen_top::toDd001_$0 = > (word)irq_screen_top::toDd001_gfx#0 +Constant value identified (word)irq_screen_top::toDd002_gfx#0 in [667] irq_screen_top::toDd002_$0 = > (word)irq_screen_top::toDd002_gfx#0 +Successful SSA optimization Pass2ConstantValues +Rewriting conditional comparison [773] if(ghosts_mode_count<=$32) goto game_logic::@47 +Rewriting conditional comparison [777] if(ghosts_mode_count<=$96) goto game_logic::@47 +Rewriting conditional comparison [781] if(ghosts_mode_count<=$32) goto game_logic::@47 +De-inlining pointer[w] to *(pointer+w) [127] init_render_index::canvas#0 = init_render_index::canvas_xcol#0 + init_render_index::render_ypos_table#4[init_render_index::$10] +Successful SSA optimization Pass2DeInlineWordDerefIdx +Simplifying constant evaluating to zero (word)0+0 in +Simplifying constant evaluating to zero (word)0+0 in +Simplifying constant evaluating to zero (word)0+0 in +Simplifying constant evaluating to zero $31) goto level_tile_get::@2 +Simple Condition level_tile_directions::$0 [418] if(level_tile_directions::xtile#5>$31) goto level_tile_directions::@2 +Simple Condition game_logic::$10 [543] if(game_logic_substep==3) goto game_logic::@14 +Simple Condition game_logic::$76 [644] if(ABS[game_logic::$75]<2) goto game_logic::@170 +Simple Condition game_logic::$81 [651] if(ABS[game_logic::$80]<2) goto game_logic::@171 +Simple Condition game_logic::$86 [657] if(ABS[game_logic::$85]<2) goto game_logic::@172 +Simple Condition game_logic::$91 [663] if(ABS[game_logic::$90]<2) goto game_logic::@173 +Simple Condition game_logic::$109 [705] if(ghost4_substep==0) goto game_logic::@174 +Simple Condition game_logic::$130 [754] if(ghost3_substep==0) goto game_logic::@175 +Simple Condition game_logic::$151 [803] if(ghost2_substep==0) goto game_logic::@176 +Simple Condition game_logic::$172 [852] if(ghost1_substep==0) goto game_logic::@177 +Simple Condition game_logic::$193 [898] if(pacman_substep==0) goto game_logic::@178 +Simple Condition merge_code::$6 [1038] if(merge_code::logic_cycles#0$24) goto level_tile_get::@2 +Simple Condition level_tile_directions::$1 [1041] if(level_tile_directions::ytile#5>$24) goto level_tile_directions::@2 +Simple Condition game_logic::$11 [1042] if(game_logic_substep==7) goto game_logic::@14 +Simple Condition game_logic::$78 [1043] if(ABS[game_logic::$77]<2) goto game_logic::@51 +Simple Condition game_logic::$83 [1044] if(ABS[game_logic::$82]<2) goto game_logic::@52 +Simple Condition game_logic::$88 [1045] if(ABS[game_logic::$87]<2) goto game_logic::@53 +Simple Condition game_logic::$93 [1046] if(ABS[game_logic::$92]<2) goto game_logic::@67 +Condition not simple game_logic::$110 [1047] if(game_logic::$110) goto game_logic::@77 +Introduced intermediate condition variable game_logic::$220 = ghost4_direction +Condition not simple game_logic::$110 [1047] if(game_logic::$110) goto game_logic::@77 +Introduced intermediate condition variable game_logic::$221 = ghost4_direction +Condition not simple game_logic::$110 [1047] if(game_logic::$110) goto game_logic::@77 +Introduced intermediate condition variable game_logic::$222 = ghost4_direction +Simple Condition game_logic::$110 [1047] if(game_logic::$220!=STOP) goto game_logic::@77 +Condition not simple game_logic::$131 [1048] if(game_logic::$131) goto game_logic::@95 +Introduced intermediate condition variable game_logic::$223 = ghost3_direction +Condition not simple game_logic::$131 [1048] if(game_logic::$131) goto game_logic::@95 +Introduced intermediate condition variable game_logic::$224 = ghost3_direction +Condition not simple game_logic::$131 [1048] if(game_logic::$131) goto game_logic::@95 +Introduced intermediate condition variable game_logic::$225 = ghost3_direction +Simple Condition game_logic::$131 [1048] if(game_logic::$223!=STOP) goto game_logic::@95 +Condition not simple game_logic::$152 [1049] if(game_logic::$152) goto game_logic::@113 +Introduced intermediate condition variable game_logic::$226 = ghost2_direction +Condition not simple game_logic::$152 [1049] if(game_logic::$152) goto game_logic::@113 +Introduced intermediate condition variable game_logic::$227 = ghost2_direction +Condition not simple game_logic::$152 [1049] if(game_logic::$152) goto game_logic::@113 +Introduced intermediate condition variable game_logic::$228 = ghost2_direction +Simple Condition game_logic::$152 [1049] if(game_logic::$226!=STOP) goto game_logic::@113 +Condition not simple game_logic::$173 [1050] if(game_logic::$173) goto game_logic::@131 +Introduced intermediate condition variable game_logic::$229 = ghost1_direction +Condition not simple game_logic::$173 [1050] if(game_logic::$173) goto game_logic::@131 +Introduced intermediate condition variable game_logic::$230 = ghost1_direction +Condition not simple game_logic::$173 [1050] if(game_logic::$173) goto game_logic::@131 +Introduced intermediate condition variable game_logic::$231 = ghost1_direction +Simple Condition game_logic::$173 [1050] if(game_logic::$229!=STOP) goto game_logic::@131 +Condition not simple game_logic::$194 [1051] if(game_logic::$194) goto game_logic::@148 +Introduced intermediate condition variable game_logic::$232 = pacman_direction +Condition not simple game_logic::$194 [1051] if(game_logic::$194) goto game_logic::@148 +Introduced intermediate condition variable game_logic::$233 = pacman_direction +Simple Condition game_logic::$194 [1051] if(game_logic::$232!=STOP) goto game_logic::@148 +Simple Condition merge_code::$7 [1052] if(merge_code::logic_cycles#0==merge_code::cycle_budget#13) goto merge_code::@9 +Successful SSA optimization Pass2ConditionalJumpSimplification +Negating conditional jump and destination [644] if(ABS[game_logic::$75]>=2) goto game_logic::@64 +Negating conditional jump and destination [651] if(ABS[game_logic::$80]>=2) goto game_logic::@65 +Negating conditional jump and destination [657] if(ABS[game_logic::$85]>=2) goto game_logic::@66 +Negating conditional jump and destination [663] if(ABS[game_logic::$90]>=2) goto game_logic::@return +Negating conditional jump and destination [705] if(ghost4_substep!=0) goto game_logic::@83 +Negating conditional jump and destination [754] if(ghost3_substep!=0) goto game_logic::@101 +Negating conditional jump and destination [803] if(ghost2_substep!=0) goto game_logic::@119 +Negating conditional jump and destination [852] if(ghost1_substep!=0) goto game_logic::@137 +Negating conditional jump and destination [898] if(pacman_substep!=0) goto game_logic::@151 +Successful SSA optimization Pass2ConditionalJumpSequenceImprovement +Constant right-side identified [0] memcpy::src_end#0 = memcpy::$2 + memcpy::num#0 +Constant right-side identified [247] splash_run::toDd001_$0 = > (word)splash_run::toDd001_gfx#0 +Constant right-side identified [253] splash_run::toD0181_$0 = splash_run::toD0181_$7 & $3fff +Constant right-side identified [256] splash_run::toD0181_$3 = > (word)splash_run::toD0181_gfx#0 +Constant right-side identified [488] irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7 & $3fff +Constant right-side identified [491] irq_screen_top::toD0181_$3 = > (word)irq_screen_top::toD0181_gfx#0 +Constant right-side identified [503] irq_screen_top::toDd001_$0 = > (word)irq_screen_top::toDd001_gfx#0 +Constant right-side identified [509] irq_screen_top::toDd002_$0 = > (word)irq_screen_top::toDd002_gfx#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant memcpy::src_end#0 = memcpy::$2+memcpy::num#0 +Constant splash_run::toDd001_$0 = >(word)splash_run::toDd001_gfx#0 +Constant splash_run::toD0181_$0 = splash_run::toD0181_$7&$3fff +Constant splash_run::toD0181_$3 = >(word)splash_run::toD0181_gfx#0 +Constant init_level_tile_directions::open_directions#1 = LEFT +Constant irq_screen_top::toD0181_$0 = irq_screen_top::toD0181_$7&$3fff +Constant irq_screen_top::toD0181_$3 = >(word)irq_screen_top::toD0181_gfx#0 +Constant irq_screen_top::toDd001_$0 = >(word)irq_screen_top::toDd001_gfx#0 +Constant irq_screen_top::toDd002_$0 = >(word)irq_screen_top::toDd002_gfx#0 +Successful SSA optimization Pass2ConstantIdentification +Rewriting conditional comparison [409] if(level_tile_get::xtile#4>$31) goto level_tile_get::@2 +Rewriting conditional comparison [418] if(level_tile_directions::xtile#5>$31) goto level_tile_directions::@2 +Rewriting conditional comparison [1040] if(level_tile_get::ytile#4>$24) goto level_tile_get::@2 +Rewriting conditional comparison [1041] if(level_tile_directions::ytile#5>$24) goto level_tile_directions::@2 +Simplifying constant evaluating to zero splash_run::toD0181_$7&$3fff in +Simplifying constant evaluating to zero irq_screen_top::toD0181_$7&$3fff in +Successful SSA optimization PassNSimplifyConstantZero +Eliminating unused variable game_logic::$221 and assignment [676] game_logic::$221 = ghost4_direction +Eliminating unused variable game_logic::$222 and assignment [677] game_logic::$222 = ghost4_direction +Eliminating unused variable game_logic::$224 and assignment [726] game_logic::$224 = ghost3_direction +Eliminating unused variable game_logic::$225 and assignment [727] game_logic::$225 = ghost3_direction +Eliminating unused variable game_logic::$227 and assignment [776] game_logic::$227 = ghost2_direction +Eliminating unused variable game_logic::$228 and assignment [777] game_logic::$228 = ghost2_direction +Eliminating unused variable game_logic::$230 and assignment [826] game_logic::$230 = ghost1_direction +Eliminating unused variable game_logic::$231 and assignment [827] game_logic::$231 = ghost1_direction +Eliminating unused variable game_logic::$233 and assignment [873] game_logic::$233 = pacman_direction +Eliminating unused constant splash_run::toD0181_$7 +Eliminating unused constant irq_screen_top::toD0181_$7 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant splash_run::toD0181_screen#0 +Eliminating unused constant irq_screen_top::toD0181_screen#0 +Successful SSA optimization PassNEliminateUnusedVars +Adding number conversion cast (unumber) $16 in +Adding number conversion cast (unumber) $31+1 in if(level_tile_get::xtile#4>=$31+1) goto level_tile_get::@2 +Adding number conversion cast (unumber) 1 in if(level_tile_get::xtile#4>=(unumber)$31+1) goto level_tile_get::@2 +Adding number conversion cast (unumber) $31+1 in if(level_tile_directions::xtile#5>=$31+1) goto level_tile_directions::@2 +Adding number conversion cast (unumber) 1 in if(level_tile_directions::xtile#5>=(unumber)$31+1) goto level_tile_directions::@2 +Adding number conversion cast (unumber) $24+1 in if(level_tile_get::ytile#4>=$24+1) goto level_tile_get::@2 +Adding number conversion cast (unumber) 1 in if(level_tile_get::ytile#4>=(unumber)$24+1) goto level_tile_get::@2 +Adding number conversion cast (unumber) $24+1 in if(level_tile_directions::ytile#5>=$24+1) goto level_tile_directions::@2 +Adding number conversion cast (unumber) 1 in if(level_tile_directions::ytile#5>=(unumber)$24+1) goto level_tile_directions::@2 +Successful SSA optimization PassNAddNumberTypeConversions +Simplifying constant integer cast $16 +Simplifying constant integer cast $31+(unumber)1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $31+(unumber)1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $24+(unumber)1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $24+(unumber)1 +Simplifying constant integer cast 1 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) $16 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Constant right-side identified [243] splash_run::toDd001_$1 = splash_run::toDd001_$0 / $40 +Constant right-side identified [248] splash_run::toD0181_$1 = splash_run::toD0181_$0 * 4 +Constant right-side identified [250] splash_run::toD0181_$4 = splash_run::toD0181_$3 / 4 +Constant right-side identified [474] irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0 * 4 +Constant right-side identified [476] irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3 / 4 +Constant right-side identified [487] irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0 / $40 +Constant right-side identified [492] irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0 / $40 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant splash_run::toDd001_$1 = splash_run::toDd001_$0/$40 +Constant splash_run::toD0181_$1 = splash_run::toD0181_$0*4 +Constant splash_run::toD0181_$4 = splash_run::toD0181_$3/4 +Constant irq_screen_top::toD0181_$1 = irq_screen_top::toD0181_$0*4 +Constant irq_screen_top::toD0181_$4 = irq_screen_top::toD0181_$3/4 +Constant irq_screen_top::toDd001_$1 = irq_screen_top::toDd001_$0/$40 +Constant irq_screen_top::toDd002_$1 = irq_screen_top::toDd002_$0/$40 +Successful SSA optimization Pass2ConstantIdentification +Simplifying constant evaluating to zero splash_run::toD0181_$0*4 in +Simplifying constant evaluating to zero irq_screen_top::toD0181_$0*4 in +Successful SSA optimization PassNSimplifyConstantZero +Eliminating unused constant splash_run::toD0181_$0 +Eliminating unused constant irq_screen_top::toD0181_$0 +Successful SSA optimization PassNEliminateUnusedVars +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Constant right-side identified [243] splash_run::toDd001_return#0 = 3 ^ splash_run::toDd001_$1 +Constant right-side identified [247] splash_run::toD0181_$2 = > splash_run::toD0181_$1 +Constant right-side identified [248] splash_run::toD0181_$5 = splash_run::toD0181_$4 & $f +Constant right-side identified [471] irq_screen_top::toD0181_$2 = > irq_screen_top::toD0181_$1 +Constant right-side identified [472] irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4 & $f +Constant right-side identified [482] irq_screen_top::toDd001_return#0 = 3 ^ irq_screen_top::toDd001_$1 +Constant right-side identified [486] irq_screen_top::toDd002_return#0 = 3 ^ irq_screen_top::toDd002_$1 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant splash_run::toDd001_return#0 = 3^splash_run::toDd001_$1 +Constant splash_run::toD0181_$2 = >splash_run::toD0181_$1 +Constant splash_run::toD0181_$5 = splash_run::toD0181_$4&$f +Constant irq_screen_top::toD0181_$2 = >irq_screen_top::toD0181_$1 +Constant irq_screen_top::toD0181_$5 = irq_screen_top::toD0181_$4&$f +Constant irq_screen_top::toDd001_return#0 = 3^irq_screen_top::toDd001_$1 +Constant irq_screen_top::toDd002_return#0 = 3^irq_screen_top::toDd002_$1 +Successful SSA optimization Pass2ConstantIdentification +Simplifying constant evaluating to zero >splash_run::toD0181_$1 in +Simplifying constant evaluating to zero splash_run::toD0181_$4&$f in +Simplifying constant evaluating to zero >irq_screen_top::toD0181_$1 in +Simplifying constant evaluating to zero irq_screen_top::toD0181_$4&$f in +Simplifying constant evaluating to zero 3^irq_screen_top::toDd001_$1 in +Successful SSA optimization PassNSimplifyConstantZero +Simplifying expression containing zero splash_run::toD0181_$5 in [249] splash_run::toD0181_return#0 = splash_run::toD0181_$2 | splash_run::toD0181_$5 +Simplifying expression containing zero irq_screen_top::toD0181_$5 in [473] irq_screen_top::toD0181_return#0 = irq_screen_top::toD0181_$2 | irq_screen_top::toD0181_$5 +Successful SSA optimization PassNSimplifyExpressionWithZero +Eliminating unused constant splash_run::toD0181_$1 +Eliminating unused constant splash_run::toD0181_$4 +Eliminating unused constant splash_run::toD0181_$2 +Eliminating unused constant irq_screen_top::toD0181_$1 +Eliminating unused constant irq_screen_top::toD0181_$4 +Eliminating unused constant irq_screen_top::toDd001_$1 +Eliminating unused constant irq_screen_top::toD0181_$2 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant splash_run::toD0181_$3 +Eliminating unused constant irq_screen_top::toD0181_$3 +Eliminating unused constant irq_screen_top::toDd001_$0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant splash_run::toD0181_gfx#0 +Eliminating unused constant irq_screen_top::toD0181_gfx#0 +Eliminating unused constant irq_screen_top::toDd001_gfx#0 +Successful SSA optimization PassNEliminateUnusedVars +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Constant splash_run::toD0181_return#0 = splash_run::toD0181_$5 +Constant irq_screen_top::toD0181_return#0 = irq_screen_top::toD0181_$5 +Successful SSA optimization Pass2ConstantIdentification +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Inlining Noop Cast [8] memset::$4 = (byte*)memset::str#6 keeping memset::str#6 +Inlining Noop Cast [10] memset::dst#0 = (byte*)memset::str#6 keeping memset::str#6 +Successful SSA optimization Pass2NopCastInlining +Inlining Noop Cast [110] render::render_index_xcol#0 = (byte*)render::$9 keeping render::render_index_xcol#0 +Inlining Noop Cast [132] render_tiles::render_index_xcol#0 = (byte*)render_tiles::$12 keeping render_tiles::render_index_xcol#0 +Successful SSA optimization Pass2NopCastInlining +Rewriting multiplication to use shift [83] init_render_index::$9 = init_render_index::x_col#2 * SIZEOF_POINTER +Rewriting multiplication to use shift [88] init_render_index::$10 = init_render_index::$11 * SIZEOF_WORD +Rewriting division to use shift [106] render::ytile#0 = render::ypos#2 / 4 +Rewriting multiplication to use shift [108] render::$2 = render::ytile#0 * 2 +Rewriting multiplication to use shift [125] render_tiles::$0 = render_tiles::tile_left#0 * 4 +Rewriting multiplication to use shift [127] render_tiles::$2 = render_tiles::tile_right#0 * 4 +Rewriting multiplication to use shift [130] render_tiles::$5 = render_tiles::ytile#0 * 2 +Rewriting multiplication to use shift [235] splash_run::$24 = splash_run::i#2 * 2 +Rewriting multiplication to use shift [237] splash_run::$34 = splash_run::i#2 * SIZEOF_WORD +Rewriting division to use shift [240] splash_run::msb#1 = splash_run::msb#10 / 2 +Rewriting multiplication to use shift [392] level_tile_get::$5 = level_tile_get::ytile#4 * SIZEOF_WORD +Rewriting multiplication to use shift [399] level_tile_directions::$5 = level_tile_directions::ytile#5 * SIZEOF_WORD +Rewriting division to use shift [512] game_logic::$17 = game_logic::pacman_bob_xfine#0 / 4 +Rewriting division to use shift [524] game_logic::$25 = game_logic::ghost1_bob_xfine#0 / 4 +Rewriting division to use shift [533] game_logic::$31 = game_logic::ghost2_bob_xfine#0 / 4 +Rewriting division to use shift [542] game_logic::$37 = game_logic::ghost3_bob_xfine#0 / 4 +Rewriting division to use shift [551] game_logic::$43 = game_logic::ghost4_bob_xfine#0 / 4 +Rewriting division to use shift [573] game_logic::pacman_xtile#0 = pacman_xfine / 2 +Rewriting division to use shift [574] game_logic::pacman_ytile#0 = pacman_yfine / 2 +Rewriting multiplication to use shift [575] game_logic::$210 = game_logic::pacman_ytile#0 * SIZEOF_WORD +Rewriting division to use shift [584] game_logic::$69 = game_logic::pacman_xtile#0 / 2 +Rewriting multiplication to use shift [589] game_logic::$72 = game_logic::pacman_ytile#0 * 2 +Rewriting division to use shift [595] game_logic::$65 = game_logic::pacman_xtile#0 / 2 +Rewriting multiplication to use shift [600] game_logic::$68 = game_logic::pacman_ytile#0 * 2 +Rewriting division to use shift [667] game_logic::ghost4_xtile#0 = ghost4_xfine / 2 +Rewriting division to use shift [668] game_logic::ghost4_ytile#0 = ghost4_yfine / 2 +Rewriting division to use shift [678] game_logic::target_xtile#2 = pacman_xfine / 2 +Rewriting division to use shift [679] game_logic::target_ytile#2 = pacman_yfine / 2 +Rewriting division to use shift [715] game_logic::ghost3_xtile#0 = ghost3_xfine / 2 +Rewriting division to use shift [716] game_logic::ghost3_ytile#0 = ghost3_yfine / 2 +Rewriting division to use shift [726] game_logic::target_xtile1#2 = pacman_xfine / 2 +Rewriting division to use shift [727] game_logic::target_ytile1#2 = pacman_yfine / 2 +Rewriting division to use shift [763] game_logic::ghost2_xtile#0 = ghost2_xfine / 2 +Rewriting division to use shift [764] game_logic::ghost2_ytile#0 = ghost2_yfine / 2 +Rewriting division to use shift [774] game_logic::target_xtile2#2 = pacman_xfine / 2 +Rewriting division to use shift [775] game_logic::target_ytile2#2 = pacman_yfine / 2 +Rewriting division to use shift [811] game_logic::ghost1_xtile#0 = ghost1_xfine / 2 +Rewriting division to use shift [812] game_logic::ghost1_ytile#0 = ghost1_yfine / 2 +Rewriting division to use shift [822] game_logic::target_xtile3#2 = pacman_xfine / 2 +Rewriting division to use shift [823] game_logic::target_ytile3#2 = pacman_yfine / 2 +Rewriting division to use shift [854] game_logic::pacman_xtile1#0 = pacman_xfine / 2 +Rewriting division to use shift [855] game_logic::pacman_ytile1#0 = pacman_yfine / 2 +Rewriting multiplication to use shift [863] game_logic::joy_directions#0 = game_logic::$200 * 4 +Successful SSA optimization Pass2MultiplyToShiftRewriting +Inlining constant with var siblings memcpy::src#0 +Inlining constant with var siblings memcpy::dst#0 +Inlining constant with var siblings memset::str#0 +Inlining constant with var siblings memset::c#0 +Inlining constant with var siblings memset::num#0 +Inlining constant with var siblings memset::str#1 +Inlining constant with var siblings memset::c#1 +Inlining constant with var siblings memset::num#1 +Inlining constant with var siblings memset::str#2 +Inlining constant with var siblings memset::c#2 +Inlining constant with var siblings memset::num#2 +Inlining constant with var siblings memset::str#3 +Inlining constant with var siblings memset::c#3 +Inlining constant with var siblings memset::num#3 +Inlining constant with var siblings memset::str#4 +Inlining constant with var siblings memset::c#4 +Inlining constant with var siblings memset::num#4 +Inlining constant with var siblings merge_code::dest_code#7 +Inlining constant with var siblings merge_code::raster_code#3 +Inlining constant with var siblings merge_code::logic_code#6 +Inlining constant with var siblings init_render_index::render_index#0 +Inlining constant with var siblings init_render_index::x_col#0 +Inlining constant with var siblings init_render_index::render_ypos_table#0 +Inlining constant with var siblings init_render_index::ypos_inc_offset#0 +Inlining constant with var siblings init_render_index::y_pos#0 +Inlining constant with var siblings init_render_index::render_ypos_table#1 +Inlining constant with var siblings init_render_index::ypos_inc_offset#1 +Inlining constant with var siblings render::i#0 +Inlining constant with var siblings render_tiles::y#0 +Inlining constant with var siblings init_bobs_restore::bob_restore#0 +Inlining constant with var siblings init_bobs_restore::bob#0 +Inlining constant with var siblings init_bobs_restore::i#0 +Inlining constant with var siblings done_run::i#0 +Inlining constant with var siblings done_run::i1#0 +Inlining constant with var siblings done_run::gfx#0 +Inlining constant with var siblings done_run::xcol#0 +Inlining constant with var siblings done_run::ypos#0 +Inlining constant with var siblings splash_run::msb#0 +Inlining constant with var siblings splash_run::i#0 +Inlining constant with var siblings splash_run::i1#0 +Inlining constant with var siblings splash_run::i2#0 +Inlining constant with var siblings gameplay_run::i#0 +Inlining constant with var siblings gameplay_run::i1#0 +Inlining constant with var siblings gameplay_run::i2#0 +Inlining constant with var siblings joyfire::return#2 +Inlining constant with var siblings joyfire::return#3 +Inlining constant with var siblings splash_show::splash#0 +Inlining constant with var siblings splash_show::xcol#0 +Inlining constant with var siblings splash_show::ypos#0 +Inlining constant with var siblings level_show::count#0 +Inlining constant with var siblings level_show::level#0 +Inlining constant with var siblings level_show::ytile#0 +Inlining constant with var siblings level_show::xcol#0 +Inlining constant with var siblings level_show::xtile#0 +Inlining constant with var siblings level_tile_get::return#1 +Inlining constant with var siblings level_tile_directions::return#1 +Inlining constant with var siblings init_level_tile_directions::directions#0 +Inlining constant with var siblings init_level_tile_directions::ytile#0 +Inlining constant with var siblings init_level_tile_directions::xtile#0 +Inlining constant with var siblings init_level_tile_directions::open_directions#0 +Inlining constant with var siblings init_level_tile_directions::open_directions#1 +Inlining constant with var siblings init_sprite_pointers::sprites_ptr_1#0 +Inlining constant with var siblings init_sprite_pointers::sprites_ptr_2#0 +Inlining constant with var siblings init_sprite_pointers::screen#0 +Inlining constant with var siblings init_sprite_pointers::sprite#0 +Inlining constant with var siblings game_logic::do_reverse#0 +Inlining constant with var siblings game_logic::do_reverse#1 +Inlining constant with var siblings game_logic::do_reverse#2 +Inlining constant with var siblings game_logic::do_reverse#3 +Inlining constant with var siblings game_logic::target_xtile#1 +Inlining constant with var siblings game_logic::target_ytile#1 +Inlining constant with var siblings game_logic::target_xtile1#1 +Inlining constant with var siblings game_logic::target_ytile1#1 +Inlining constant with var siblings game_logic::target_xtile2#1 +Inlining constant with var siblings game_logic::target_ytile2#1 +Inlining constant with var siblings game_logic::target_xtile3#1 +Inlining constant with var siblings game_logic::target_ytile3#1 +Inlining constant with var siblings choose_direction::direction#0 +Inlining constant with var siblings choose_direction::dist_min#0 +Inlining constant with var siblings choose_direction::direction#1 +Inlining constant with var siblings choose_direction::direction#2 +Inlining constant with var siblings choose_direction::direction#3 +Inlining constant with var siblings choose_direction::direction#4 +Constant inlined splash_show::ypos#0 = 0 +Constant inlined splash_show::xcol#0 = 0 +Constant inlined level_show::xcol#0 = 0 +Constant inlined game_logic::target_ytile#1 = 2 +Constant inlined init_level_tile_directions::xtile#0 = 0 +Constant inlined init_level_tile_directions::open_directions#0 = 0 +Constant inlined memcpy::$2 = (byte*)memcpy::source#0 +Constant inlined init_level_tile_directions::open_directions#1 = LEFT +Constant inlined splash_run::toDd001_gfx#0 = SCREENS_1 +Constant inlined irq_screen_top::toDd002_gfx#0 = SCREENS_1 +Constant inlined splash_run::msb#0 = 0 +Constant inlined level_show::xtile#0 = 0 +Constant inlined init_level_tile_directions::directions#0 = LEVEL_TILES_DIRECTIONS +Constant inlined splash_run::i#0 = 0 +Constant inlined game_logic::target_ytile1#1 = 2 +Constant inlined render_tiles::y#0 = 0 +Constant inlined init_sprite_pointers::sprites_ptr_2#0 = SCREENS_2+OFFSET_SPRITE_PTRS +Constant inlined memset::c#0 = 0 +Constant inlined memset::c#1 = 0 +Constant inlined memset::c#2 = 0 +Constant inlined memset::c#3 = 0 +Constant inlined memset::c#4 = 0 +Constant inlined choose_direction::dist_min#0 = $ff +Constant inlined init_bobs_restore::bob_restore#0 = bobs_restore +Constant inlined merge_code::dest_code#7 = RASTER_CODE +Constant inlined irq_screen_top::toD0181_$5 = 0 +Constant inlined splash_show::splash#0 = SPLASH +Constant inlined level_tile_get::return#1 = 0 +Constant inlined splash_run::i1#0 = 0 +Constant inlined render::i#0 = 0 +Constant inlined gameplay_run::i1#0 = 0 +Constant inlined game_logic::target_xtile3#1 = 2 +Constant inlined pacman_sound_play::$1 = $16*SIZEOF_BYTE +Constant inlined game_logic::target_ytile2#1 = 2 +Constant inlined done_run::xcol#0 = 0 +Constant inlined game_logic::do_reverse#3 = 1 +Constant inlined game_logic::do_reverse#2 = 1 +Constant inlined level_show::ytile#0 = 0 +Constant inlined game_logic::do_reverse#1 = 1 +Constant inlined done_run::gfx#0 = WIN_GFX +Constant inlined game_logic::do_reverse#0 = 0 +Constant inlined memset::num#3 = $1fff +Constant inlined memset::num#2 = $3fff +Constant inlined choose_direction::direction#3 = LEFT +Constant inlined memset::num#4 = INTRO_MUSIC_CRUNCHED_SIZE +Constant inlined choose_direction::direction#4 = RIGHT +Constant inlined choose_direction::direction#1 = UP +Constant inlined init_sprite_pointers::screen#0 = 0 +Constant inlined choose_direction::direction#2 = DOWN +Constant inlined memset::num#1 = $1fff +Constant inlined choose_direction::direction#0 = STOP +Constant inlined memset::num#0 = $c00 +Constant inlined done_run::i1#0 = 0 +Constant inlined init_render_index::ypos_inc_offset#1 = $b +Constant inlined done_run::i#0 = 0 +Constant inlined init_render_index::ypos_inc_offset#0 = 0 +Constant inlined splash_run::i2#0 = 0 +Constant inlined gameplay_run::i2#0 = 0 +Constant inlined merge_code::logic_code#6 = LOGIC_CODE_UNMERGED +Constant inlined level_tile_directions::return#1 = 0 +Constant inlined done_run::ypos#0 = 0 +Constant inlined init_bobs_restore::i#0 = 0 +Constant inlined splash_run::toDd001_$0 = >(word)SCREENS_1 +Constant inlined game_logic::target_ytile3#1 = 2 +Constant inlined splash_run::toDd001_$1 = >(word)SCREENS_1/$40 +Constant inlined game_logic::target_xtile2#1 = 2 +Constant inlined level_show::count#0 = 0 +Constant inlined gameplay_run::i#0 = 0 +Constant inlined init_level_tile_directions::ytile#0 = 0 +Constant inlined game_logic::target_xtile#1 = 2 +Constant inlined init_bobs_restore::bob#0 = 0 +Constant inlined memcpy::dst#0 = (byte*)memcpy::destination#0 +Constant inlined splash_run::toD0181_$5 = 0 +Constant inlined memcpy::src#0 = (byte*)memcpy::source#0 +Constant inlined init_render_index::y_pos#0 = 0 +Constant inlined merge_code::raster_code#3 = RASTER_CODE_UNMERGED +Constant inlined init_bobs_restore::$4 = 0 +Constant inlined init_bobs_restore::$5 = >init_bobs_restore::CANVAS_HIDDEN +Constant inlined init_render_index::x_col#0 = 0 +Constant inlined init_bobs_restore::$2 = 0 +Constant inlined init_bobs_restore::$3 = >init_bobs_restore::CANVAS_HIDDEN +Constant inlined memset::str#2 = (void*)BANK_2 +Constant inlined memset::str#1 = (void*)BANK_1+$2000 +Constant inlined memset::str#0 = (void*) 16384 +Constant inlined memset::str#4 = (void*)INTRO_MUSIC_CRUNCHED_UPPER +Constant inlined memset::str#3 = (void*)BANK_1 +Constant inlined game_logic::target_xtile1#1 = 2 +Constant inlined level_show::level#0 = LEVEL_TILES +Constant inlined init_sprite_pointers::sprites_ptr_1#0 = SCREENS_1+OFFSET_SPRITE_PTRS +Constant inlined memcpy::num#0 = INTRO_MUSIC_CRUNCHED_SIZE +Constant inlined irq_screen_top::toDd002_$1 = >(word)SCREENS_1/$40 +Constant inlined init_sprite_pointers::sprite#0 = 0 +Constant inlined init_render_index::render_ypos_table#0 = RENDER_YPOS +Constant inlined irq_screen_top::toDd002_$0 = >(word)SCREENS_1 +Constant inlined init_render_index::render_ypos_table#1 = RENDER_YPOS_9TH +Constant inlined init_render_index::render_index#0 = RENDER_INDEX +Constant inlined joyfire::return#2 = 1 +Constant inlined joyfire::return#3 = 0 +Successful SSA optimization Pass2ConstantInlining +Consolidated array index constant in *(RENDER_INDEX+(word)$18*$100+RENDER_OFFSET_YPOS_INC) +Consolidated array index constant in *(RENDER_INDEX+(word)$19*$100+RENDER_OFFSET_YPOS_INC) +Consolidated array index constant in *(bobs_xcol+1) +Consolidated array index constant in *(bobs_yfine+1) +Consolidated array index constant in *(bobs_bob_id+1) +Consolidated array index constant in *(bobs_xcol+2) +Consolidated array index constant in *(bobs_yfine+2) +Consolidated array index constant in *(bobs_bob_id+2) +Consolidated array index constant in *(bobs_xcol+3) +Consolidated array index constant in *(bobs_yfine+3) +Consolidated array index constant in *(bobs_bob_id+3) +Consolidated array index constant in *(bobs_xcol+4) +Consolidated array index constant in *(bobs_yfine+4) +Consolidated array index constant in *(bobs_bob_id+4) +Consolidated array index constant in assignment (ABS+-1)[choose_direction::$10] +Consolidated array index constant in assignment (ABS+1)[choose_direction::$14] +Consolidated array index constant in assignment (ABS+-1)[choose_direction::$18] +Consolidated array index constant in assignment (ABS+1)[choose_direction::$22] +Successful SSA optimization Pass2ConstantAdditionElimination +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias choose_direction::ydiff#0 = choose_direction::$10 choose_direction::$14 +Alias choose_direction::xdiff#0 = choose_direction::$18 choose_direction::$22 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Identical Phi Values memset::c#7 0 +Successful SSA optimization Pass2IdenticalPhiElimination +Identified duplicate assignment right side [233] splash_run::$34 = splash_run::i#2 << 1 +Identified duplicate assignment right side [585] game_logic::$72 = game_logic::pacman_ytile#0 << 1 +Identified duplicate assignment right side [596] game_logic::$68 = game_logic::pacman_ytile#0 << 1 +Successful SSA optimization Pass2DuplicateRValueIdentification +Eliminating unused constant SIZEOF_POINTER +Eliminating unused constant SIZEOF_WORD +Successful SSA optimization PassNEliminateUnusedVars +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$210 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias splash_run::$34 = splash_run::$24 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$210 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$210 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $1a +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (byte) $95 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (byte) $c0 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $140 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $180 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $1c0 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $200 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $240 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $280 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $2c0 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) 9 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $1b +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $27 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $2d +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $33 +Finalized unsigned number type (word) $300 +Finalized unsigned number type (byte) $39 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $c +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $12 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $1e +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $24 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $2a +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $30 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $36 +Finalized unsigned number type (word) $340 +Finalized unsigned number type (byte) $3c +Finalized unsigned number type (byte) $95 +Finalized unsigned number type (byte) $a0 +Finalized unsigned number type (byte) $25 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (byte) $21 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $18 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $19 +Finalized unsigned number type (word) $100 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $12 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Simplifying constant integer cast $100+6 +Simplifying constant integer cast $100+$c +Simplifying constant integer cast $100+$12 +Simplifying constant integer cast $100+$18 +Simplifying constant integer cast $100+$1e +Simplifying constant integer cast $100+$24 +Simplifying constant integer cast $100+$2a +Simplifying constant integer cast $100+$30 +Simplifying constant integer cast $100+$36 +Simplifying constant integer cast $100+$3c +Simplifying constant integer cast $140+3 +Simplifying constant integer cast $140+9 +Simplifying constant integer cast $140+$f +Simplifying constant integer cast $140+$15 +Simplifying constant integer cast $140+$1b +Simplifying constant integer cast $140+$21 +Simplifying constant integer cast $140+$27 +Simplifying constant integer cast $140+$2d +Simplifying constant integer cast $140+$33 +Simplifying constant integer cast $140+$39 +Simplifying constant integer cast $180+6 +Simplifying constant integer cast $180+$c +Simplifying constant integer cast $180+$12 +Simplifying constant integer cast $180+$18 +Simplifying constant integer cast $180+$1e +Simplifying constant integer cast $180+$24 +Simplifying constant integer cast $180+$2a +Simplifying constant integer cast $180+$30 +Simplifying constant integer cast $180+$36 +Simplifying constant integer cast $180+$3c +Simplifying constant integer cast $1c0+3 +Simplifying constant integer cast $1c0+9 +Simplifying constant integer cast $1c0+$f +Simplifying constant integer cast $1c0+$15 +Simplifying constant integer cast $1c0+$1b +Simplifying constant integer cast $1c0+$21 +Simplifying constant integer cast $1c0+$27 +Simplifying constant integer cast $1c0+$2d +Simplifying constant integer cast $1c0+$33 +Simplifying constant integer cast $1c0+$39 +Simplifying constant integer cast $200+6 +Simplifying constant integer cast $200+$c +Simplifying constant integer cast $200+$12 +Simplifying constant integer cast $200+$18 +Simplifying constant integer cast $200+$1e +Simplifying constant integer cast $200+$24 +Simplifying constant integer cast $200+$2a +Simplifying constant integer cast $200+$30 +Simplifying constant integer cast $200+$36 +Simplifying constant integer cast $200+$3c +Simplifying constant integer cast $240+3 +Simplifying constant integer cast $240+9 +Simplifying constant integer cast $240+$f +Simplifying constant integer cast $240+$15 +Simplifying constant integer cast $240+$1b +Simplifying constant integer cast $240+$21 +Simplifying constant integer cast $240+$27 +Simplifying constant integer cast $240+$2d +Simplifying constant integer cast $240+$33 +Simplifying constant integer cast $240+$39 +Simplifying constant integer cast $280+6 +Simplifying constant integer cast $280+$c +Simplifying constant integer cast $280+$12 +Simplifying constant integer cast $280+$18 +Simplifying constant integer cast $280+$1e +Simplifying constant integer cast $280+$24 +Simplifying constant integer cast $280+$2a +Simplifying constant integer cast $280+$30 +Simplifying constant integer cast $280+$36 +Simplifying constant integer cast $280+$3c +Simplifying constant integer cast $2c0+3 +Simplifying constant integer cast $2c0+9 +Simplifying constant integer cast $2c0+$f +Simplifying constant integer cast $2c0+$15 +Simplifying constant integer cast $2c0+$1b +Simplifying constant integer cast $2c0+$21 +Simplifying constant integer cast $2c0+$27 +Simplifying constant integer cast $2c0+$2d +Simplifying constant integer cast $2c0+$33 +Simplifying constant integer cast $2c0+$39 +Simplifying constant integer cast $300+6 +Simplifying constant integer cast $300+$c +Simplifying constant integer cast $300+$12 +Simplifying constant integer cast $300+$18 +Simplifying constant integer cast $300+$1e +Simplifying constant integer cast $300+$24 +Simplifying constant integer cast $300+$2a +Simplifying constant integer cast $300+$30 +Simplifying constant integer cast $300+$36 +Simplifying constant integer cast $300+$3c +Simplifying constant integer cast $340+3 +Simplifying constant integer cast $340+9 +Simplifying constant integer cast $340+$f +Simplifying constant integer cast $340+$15 +Simplifying constant integer cast $340+$1b +Simplifying constant integer cast $340+$21 +Simplifying constant integer cast $340+$27 +Simplifying constant integer cast $340+$2d +Simplifying constant integer cast $340+$33 +Simplifying constant integer cast $340+$39 +Simplifying constant integer cast $100+3 +Simplifying constant integer cast $100+9 +Simplifying constant integer cast $100+$f +Simplifying constant integer cast $100+$15 +Simplifying constant integer cast $100+$1b +Simplifying constant integer cast $100+$21 +Simplifying constant integer cast $100+$27 +Simplifying constant integer cast $100+$2d +Simplifying constant integer cast $100+$33 +Simplifying constant integer cast $100+$39 +Simplifying constant integer cast $140+6 +Simplifying constant integer cast $140+$c +Simplifying constant integer cast $140+$12 +Simplifying constant integer cast $140+$18 +Simplifying constant integer cast $140+$1e +Simplifying constant integer cast $140+$24 +Simplifying constant integer cast $140+$2a +Simplifying constant integer cast $140+$30 +Simplifying constant integer cast $140+$36 +Simplifying constant integer cast $140+$3c +Simplifying constant integer cast $180+3 +Simplifying constant integer cast $180+9 +Simplifying constant integer cast $180+$f +Simplifying constant integer cast $180+$15 +Simplifying constant integer cast $180+$1b +Simplifying constant integer cast $180+$21 +Simplifying constant integer cast $180+$27 +Simplifying constant integer cast $180+$2d +Simplifying constant integer cast $180+$33 +Simplifying constant integer cast $180+$39 +Simplifying constant integer cast $1c0+6 +Simplifying constant integer cast $1c0+$c +Simplifying constant integer cast $1c0+$12 +Simplifying constant integer cast $1c0+$18 +Simplifying constant integer cast $1c0+$1e +Simplifying constant integer cast $1c0+$24 +Simplifying constant integer cast $1c0+$2a +Simplifying constant integer cast $1c0+$30 +Simplifying constant integer cast $1c0+$36 +Simplifying constant integer cast $1c0+$3c +Simplifying constant integer cast $200+3 +Simplifying constant integer cast $200+9 +Simplifying constant integer cast $200+$f +Simplifying constant integer cast $200+$15 +Simplifying constant integer cast $200+$1b +Simplifying constant integer cast $200+$21 +Simplifying constant integer cast $200+$27 +Simplifying constant integer cast $200+$2d +Simplifying constant integer cast $200+$33 +Simplifying constant integer cast $200+$39 +Simplifying constant integer cast $240+6 +Simplifying constant integer cast $240+$c +Simplifying constant integer cast $240+$12 +Simplifying constant integer cast $240+$18 +Simplifying constant integer cast $240+$1e +Simplifying constant integer cast $240+$24 +Simplifying constant integer cast $240+$2a +Simplifying constant integer cast $240+$30 +Simplifying constant integer cast $240+$36 +Simplifying constant integer cast $240+$3c +Simplifying constant integer cast $280+3 +Simplifying constant integer cast $280+9 +Simplifying constant integer cast $280+$f +Simplifying constant integer cast $280+$15 +Simplifying constant integer cast $280+$1b +Simplifying constant integer cast $280+$21 +Simplifying constant integer cast $280+$27 +Simplifying constant integer cast $280+$2d +Simplifying constant integer cast $280+$33 +Simplifying constant integer cast $280+$39 +Simplifying constant integer cast $2c0+6 +Simplifying constant integer cast $2c0+$c +Simplifying constant integer cast $2c0+$12 +Simplifying constant integer cast $2c0+$18 +Simplifying constant integer cast $2c0+$1e +Simplifying constant integer cast $2c0+$24 +Simplifying constant integer cast $2c0+$2a +Simplifying constant integer cast $2c0+$30 +Simplifying constant integer cast $2c0+$36 +Simplifying constant integer cast $2c0+$3c +Simplifying constant integer cast $300+3 +Simplifying constant integer cast $300+9 +Simplifying constant integer cast $300+$f +Simplifying constant integer cast $300+$15 +Simplifying constant integer cast $300+$1b +Simplifying constant integer cast $300+$21 +Simplifying constant integer cast $300+$27 +Simplifying constant integer cast $300+$2d +Simplifying constant integer cast $300+$33 +Simplifying constant integer cast $300+$39 +Simplifying constant integer cast $340+6 +Simplifying constant integer cast $340+$c +Simplifying constant integer cast $340+$12 +Simplifying constant integer cast $340+$18 +Simplifying constant integer cast $340+$1e +Simplifying constant integer cast $340+$24 +Simplifying constant integer cast $340+$2a +Simplifying constant integer cast $340+$30 +Simplifying constant integer cast $340+$36 +Simplifying constant integer cast $340+$3c +Simplifying constant integer cast $18*$100 +Simplifying constant integer cast $19*$100 +Successful SSA optimization PassNCastSimplification +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$210 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Alias candidate removed (volatile)pill_count = gameplay_run::$4 +Alias candidate removed (volatile)frame = irq_screen_top::$2 +Alias candidate removed (volatile)game_logic_substep = game_logic::$3 +Alias candidate removed (volatile)anim_frame_idx = game_logic::$15 +Alias candidate removed (volatile)logic_tile_xcol = game_logic::$69 game_logic::$65 +Alias candidate removed (volatile)logic_tile_ptr = game_logic::$71 game_logic::$67 +Alias candidate removed (volatile)logic_tile_yfine = game_logic::$72 game_logic::$210 game_logic::$68 +Alias candidate removed (volatile)ghost4_direction = game_logic::$119 +Alias candidate removed (volatile)ghost3_direction = game_logic::$140 +Alias candidate removed (volatile)ghost2_direction = game_logic::$161 +Alias candidate removed (volatile)ghost1_direction = game_logic::$182 +Added new block during phi lifting merge_code::@22(between merge_code::@10 and merge_code::@1) +Added new block during phi lifting merge_code::@23(between merge_code::@3 and merge_code::@4) +Added new block during phi lifting merge_code::@24(between merge_code::@4 and merge_code::@10) +Added new block during phi lifting merge_code::@25(between merge_code::@5 and merge_code::@10) +Added new block during phi lifting merge_code::@26(between merge_code::@3 and merge_code::@14) +Added new block during phi lifting init_render_index::@11(between init_render_index::@6 and init_render_index::@8) +Added new block during phi lifting splash_run::@39(between splash_run::@2 and splash_run::@4) +Added new block during phi lifting level_show::@12(between level_show::@5 and level_show::@7) +Added new block during phi lifting level_show::@13(between level_show::@7 and level_show::@8) +Added new block during phi lifting init_level_tile_directions::@18(between init_level_tile_directions::@15 and init_level_tile_directions::@7) +Added new block during phi lifting init_level_tile_directions::@19(between init_level_tile_directions::@16 and init_level_tile_directions::@8) +Added new block during phi lifting init_level_tile_directions::@20(between init_level_tile_directions::@17 and init_level_tile_directions::@9) +Added new block during phi lifting game_logic::@179(between game_logic::@14 and game_logic::@44) +Added new block during phi lifting choose_direction::@13(between choose_direction::@1 and choose_direction::@2) +Added new block during phi lifting choose_direction::@14(between choose_direction::@7 and choose_direction::@2) +Added new block during phi lifting choose_direction::@15(between choose_direction::@2 and choose_direction::@3) +Added new block during phi lifting choose_direction::@16(between choose_direction::@9 and choose_direction::@3) +Added new block during phi lifting choose_direction::@17(between choose_direction::@11 and choose_direction::@4) +Added new block during phi lifting choose_direction::@18(between choose_direction::@3 and choose_direction::@4) +Adding NOP phi() at start of __start +Adding NOP phi() at start of __start::@1 +Adding NOP phi() at start of __start::@2 +Adding NOP phi() at start of irq_screen_top::toD0181 +Adding NOP phi() at start of irq_screen_top::toD0181_@return +Adding NOP phi() at start of irq_screen_top::@5 +Adding NOP phi() at start of irq_screen_top::toDd002 +Adding NOP phi() at start of irq_screen_top::toDd002_@return +Adding NOP phi() at start of irq_screen_top::@6 +Adding NOP phi() at start of irq_screen_top::@10 +Adding NOP phi() at start of irq_screen_top::@11 +Adding NOP phi() at start of irq_screen_top::@1 +Adding NOP phi() at start of irq_screen_top::toDd001 +Adding NOP phi() at start of irq_screen_top::toDd001_@return +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@4 +Adding NOP phi() at start of game_logic::@156 +Adding NOP phi() at start of game_logic::@157 +Adding NOP phi() at start of game_logic::@158 +Adding NOP phi() at start of game_logic::@159 +Adding NOP phi() at start of game_logic::@80 +Adding NOP phi() at start of game_logic::@98 +Adding NOP phi() at start of game_logic::@116 +Adding NOP phi() at start of game_logic::@134 +Adding NOP phi() at start of splash_run +Adding NOP phi() at start of splash_run::@23 +Adding NOP phi() at start of splash_run::@24 +Adding NOP phi() at start of splash_run::@25 +Adding NOP phi() at start of splash_run::@26 +Adding NOP phi() at start of splash_run::@28 +Adding NOP phi() at start of splash_run::@29 +Adding NOP phi() at start of splash_run::@30 +Adding NOP phi() at start of splash_run::@32 +Adding NOP phi() at start of splash_run::@33 +Adding NOP phi() at start of splash_run::@35 +Adding NOP phi() at start of splash_run::@3 +Adding NOP phi() at start of splash_run::toDd001 +Adding NOP phi() at start of splash_run::toDd001_@return +Adding NOP phi() at start of splash_run::toD0181 +Adding NOP phi() at start of splash_run::toD0181_@return +Adding NOP phi() at start of splash_run::@20 +Adding NOP phi() at start of splash_run::@14 +Adding NOP phi() at start of gameplay_run +Adding NOP phi() at start of gameplay_run::@14 +Adding NOP phi() at start of gameplay_run::@15 +Adding NOP phi() at start of gameplay_run::@16 +Adding NOP phi() at start of gameplay_run::@17 +Adding NOP phi() at start of gameplay_run::@19 +Adding NOP phi() at start of done_run::@5 +Adding NOP phi() at start of done_run::@20 +Adding NOP phi() at start of done_run::@2 +Adding NOP phi() at start of done_run::@16 +Adding NOP phi() at start of done_run::@19 +Adding NOP phi() at start of level_tile_directions::@2 +Adding NOP phi() at start of choose_direction::@12 +Adding NOP phi() at start of memset::@1 +Adding NOP phi() at start of merge_code +Adding NOP phi() at start of init_render_index +Adding NOP phi() at start of init_render_index::@10 +Adding NOP phi() at start of splash_show +Adding NOP phi() at start of init_bobs_restore +Adding NOP phi() at start of init_bobs_restore::@2 +Adding NOP phi() at start of init_sprite_pointers +Adding NOP phi() at start of init_sprite_pointers::@2 +Adding NOP phi() at start of memcpy +Adding NOP phi() at start of memcpy::@3 +Adding NOP phi() at start of joyfire::@2 +Adding NOP phi() at start of joyfire::@1 +Adding NOP phi() at start of init_level_tile_directions +Adding NOP phi() at start of init_level_tile_directions::@2 +Adding NOP phi() at start of init_level_tile_directions::@10 +Adding NOP phi() at start of level_show +Adding NOP phi() at start of level_show::@3 +Adding NOP phi() at start of level_tile_get::@2 +CALL GRAPH +Calls in [__start] to main:62 +Calls in [irq_screen_top] to game_logic:93 pacman_sound_play:95 +Calls in [main] to splash_run:109 gameplay_run:112 done_run:114 +Calls in [game_logic] to spawn_all:231 spawn_all:240 spawn_all:249 spawn_all:258 level_tile_directions:299 choose_direction:320 level_tile_directions:359 choose_direction:380 level_tile_directions:419 choose_direction:440 level_tile_directions:479 choose_direction:500 level_tile_directions:537 +Calls in [splash_run] to memset:571 byteboozer_decrunch:573 byteboozer_decrunch:575 merge_code:577 memset:579 memset:581 init_render_index:583 byteboozer_decrunch:585 splash_show:587 memset:589 init_bobs_restore:591 byteboozer_decrunch:593 init_sprite_pointers:595 memcpy:597 byteboozer_decrunch:599 memset:601 joyinit:648 joyfire:651 +Calls in [gameplay_run] to byteboozer_decrunch:693 init_level_tile_directions:695 init_sprite_pointers:697 level_show:699 spawn_all:715 pacman_sound_init:717 +Calls in [done_run] to byteboozer_decrunch:752 joyfire:759 render:781 byteboozer_decrunch:786 +Calls in [splash_show] to render:1019 +Calls in [init_level_tile_directions] to level_tile_get:1096 level_tile_get:1106 level_tile_get:1117 level_tile_get:1128 +Calls in [level_show] to render_tiles:1170 + +Created 107 initial phi equivalence classes +Coalesced [144] game_logic::ghost_frame_idx#5 = game_logic::ghost_frame_idx#1 +Coalesced [182] game_logic::ghost_frame_idx#4 = game_logic::ghost_frame_idx#0 +Coalesced [297] level_tile_directions::xtile#11 = level_tile_directions::xtile#0 +Coalesced [298] level_tile_directions::ytile#11 = level_tile_directions::ytile#0 +Coalesced [307] game_logic::target_xtile#4 = game_logic::target_xtile#2 +Coalesced [308] game_logic::target_ytile#4 = game_logic::target_ytile#2 +Coalesced [315] choose_direction::ghost_xtile#7 = choose_direction::ghost_xtile#0 +Coalesced [316] choose_direction::target_xtile#7 = choose_direction::target_xtile#0 +Coalesced [317] choose_direction::ghost_ytile#7 = choose_direction::ghost_ytile#0 +Coalesced [318] choose_direction::target_ytile#7 = choose_direction::target_ytile#0 +Coalesced [319] choose_direction::open_directions#16 = choose_direction::open_directions#0 +Coalesced [357] level_tile_directions::xtile#7 = level_tile_directions::xtile#1 +Coalesced [358] level_tile_directions::ytile#7 = level_tile_directions::ytile#1 +Coalesced [367] game_logic::target_xtile1#4 = game_logic::target_xtile1#2 +Coalesced [368] game_logic::target_ytile1#4 = game_logic::target_ytile1#2 +Coalesced [375] choose_direction::ghost_xtile#8 = choose_direction::ghost_xtile#1 +Coalesced [376] choose_direction::target_xtile#8 = choose_direction::target_xtile#1 +Coalesced [377] choose_direction::ghost_ytile#8 = choose_direction::ghost_ytile#1 +Coalesced [378] choose_direction::target_ytile#8 = choose_direction::target_ytile#1 +Coalesced [379] choose_direction::open_directions#17 = choose_direction::open_directions#1 +Coalesced [417] level_tile_directions::xtile#8 = level_tile_directions::xtile#2 +Coalesced [418] level_tile_directions::ytile#8 = level_tile_directions::ytile#2 +Coalesced [427] game_logic::target_xtile2#4 = game_logic::target_xtile2#2 +Coalesced [428] game_logic::target_ytile2#4 = game_logic::target_ytile2#2 +Coalesced [435] choose_direction::ghost_xtile#5 = choose_direction::ghost_xtile#2 +Coalesced [436] choose_direction::target_xtile#5 = choose_direction::target_xtile#2 +Coalesced [437] choose_direction::ghost_ytile#5 = choose_direction::ghost_ytile#2 +Coalesced [438] choose_direction::target_ytile#5 = choose_direction::target_ytile#2 +Coalesced [439] choose_direction::open_directions#14 = choose_direction::open_directions#2 +Coalesced [477] level_tile_directions::xtile#9 = level_tile_directions::xtile#3 +Coalesced [478] level_tile_directions::ytile#9 = level_tile_directions::ytile#3 +Coalesced [487] game_logic::target_xtile3#4 = game_logic::target_xtile3#2 +Coalesced [488] game_logic::target_ytile3#4 = game_logic::target_ytile3#2 +Coalesced [495] choose_direction::ghost_xtile#6 = choose_direction::ghost_xtile#3 +Coalesced [496] choose_direction::target_xtile#6 = choose_direction::target_xtile#3 +Coalesced [497] choose_direction::ghost_ytile#6 = choose_direction::ghost_ytile#3 +Coalesced [498] choose_direction::target_ytile#6 = choose_direction::target_ytile#3 +Coalesced [499] choose_direction::open_directions#15 = choose_direction::open_directions#3 +Coalesced [535] level_tile_directions::xtile#10 = level_tile_directions::xtile#4 +Coalesced [536] level_tile_directions::ytile#10 = level_tile_directions::ytile#4 +Coalesced [663] splash_run::i2#4 = splash_run::i2#1 +Coalesced [666] splash_run::i1#4 = splash_run::i1#1 +Coalesced [675] splash_run::msb#16 = splash_run::msb#2 +Coalesced [678] splash_run::i#6 = splash_run::i#1 +Coalesced [679] splash_run::msb#14 = splash_run::msb#8 +Coalesced [680] splash_run::msb#15 = splash_run::msb#1 +Coalesced [734] gameplay_run::i2#4 = gameplay_run::i2#1 +Coalesced [737] gameplay_run::i1#4 = gameplay_run::i1#1 +Coalesced [740] gameplay_run::i#4 = gameplay_run::i#1 +Coalesced [767] done_run::gfx#9 = done_run::gfx#4 +Coalesced [771] done_run::xcol#8 = done_run::xcol#1 +Coalesced (already) [772] done_run::gfx#8 = done_run::gfx#2 +Coalesced [778] render::ypos#3 = render::ypos#0 +Coalesced [779] render::xcol#3 = render::xcol#0 +Coalesced [780] render::pixels#6 = render::pixels#0 +Coalesced [783] done_run::ypos#5 = done_run::ypos#1 +Coalesced [784] done_run::gfx#10 = done_run::gfx#1 +Coalesced [792] done_run::i1#4 = done_run::i1#1 +Coalesced [795] done_run::i#4 = done_run::i#1 +Coalesced [828] level_tile_directions::return#14 = level_tile_directions::return#0 +Coalesced [839] choose_direction::dist_min#12 = choose_direction::dist_up#0 +Coalesced [845] choose_direction::dist_min#15 = choose_direction::dist_down#0 +Coalesced [851] choose_direction::dist_min#16 = choose_direction::dist_left#0 +Coalesced [860] choose_direction::return#11 = choose_direction::direction#6 +Coalesced (already) [861] choose_direction::return#12 = choose_direction::direction#6 +Coalesced [862] choose_direction::direction#16 = choose_direction::direction#8 +Not coalescing [863] choose_direction::dist_min#18 = choose_direction::dist_min#10 +Coalesced (already) [864] choose_direction::direction#15 = choose_direction::direction#8 +Not coalescing [865] choose_direction::dist_min#17 = choose_direction::dist_min#10 +Not coalescing [866] choose_direction::dist_min#14 = choose_direction::dist_min#6 +Coalesced [867] choose_direction::direction#14 = choose_direction::direction#10 +Not coalescing [868] choose_direction::dist_min#13 = choose_direction::dist_min#6 +Coalesced (already) [869] choose_direction::direction#13 = choose_direction::direction#10 +Coalesced [880] memset::dst#5 = memset::dst#1 +Coalesced [890] merge_code::logic_code#33 = merge_code::logic_code#18 +Coalesced [891] merge_code::dest_code#39 = merge_code::dest_code#14 +Coalesced [897] merge_code::logic_code#34 = merge_code::logic_code#3 +Coalesced [898] merge_code::dest_code#40 = merge_code::dest_code#12 +Coalesced [902] merge_code::logic_code#32 = merge_code::logic_code#5 +Coalesced (already) [903] merge_code::dest_code#38 = merge_code::dest_code#13 +Coalesced [907] merge_code::logic_code#35 = merge_code::logic_code#4 +Coalesced [908] merge_code::dest_code#41 = merge_code::dest_code#6 +Coalesced [909] merge_code::cycle_budget#14 = merge_code::cycle_budget#0 +Coalesced [910] merge_code::logic_code#28 = merge_code::logic_code#18 +Coalesced [911] merge_code::dest_code#30 = merge_code::dest_code#14 +Coalesced [917] merge_code::cycle_budget#19 = merge_code::cycle_budget#13 +Coalesced [918] merge_code::dest_code#37 = merge_code::dest_code#21 +Coalesced [921] merge_code::raster_code#18 = merge_code::raster_code#2 +Coalesced (already) [922] merge_code::dest_code#28 = merge_code::dest_code#10 +Coalesced (already) [923] merge_code::logic_code#26 = merge_code::logic_code#17 +Coalesced [928] merge_code::cycle_budget#17 = merge_code::cycle_budget#3 +Coalesced [929] merge_code::dest_code#35 = merge_code::dest_code#4 +Coalesced [935] merge_code::cycle_budget#16 = merge_code::cycle_budget#2 +Coalesced [936] merge_code::dest_code#34 = merge_code::dest_code#3 +Coalesced [940] merge_code::logic_code#31 = merge_code::logic_code#0 +Coalesced [941] merge_code::dest_code#33 = merge_code::dest_code#21 +Coalesced [946] merge_code::cycle_budget#15 = merge_code::cycle_budget#1 +Coalesced [947] merge_code::logic_code#29 = merge_code::logic_code#2 +Coalesced (already) [948] merge_code::dest_code#31 = merge_code::dest_code#15 +Coalesced [952] merge_code::logic_code#30 = merge_code::logic_code#1 +Coalesced [953] merge_code::dest_code#32 = merge_code::dest_code#1 +Coalesced (already) [954] merge_code::cycle_budget#18 = merge_code::cycle_budget#13 +Coalesced (already) [955] merge_code::dest_code#36 = merge_code::dest_code#21 +Coalesced [959] merge_code::raster_code#19 = merge_code::raster_code#0 +Coalesced [960] merge_code::dest_code#29 = merge_code::dest_code#0 +Coalesced (already) [961] merge_code::logic_code#27 = merge_code::logic_code#18 +Not coalescing [973] init_render_index::render_index_xcol#7 = init_render_index::render_index_xcol#0 +Coalesced [974] init_render_index::ypos_inc_offset#9 = init_render_index::ypos_inc_offset#7 +Coalesced [979] init_render_index::x_col#11 = init_render_index::x_col#1 +Coalesced [980] init_render_index::render_index_xcol#6 = init_render_index::render_index#1 +Coalesced [993] init_render_index::ypos_inc_offset#12 = init_render_index::ypos_inc_offset#3 +Coalesced [997] init_render_index::y_pos#6 = init_render_index::y_pos#1 +Coalesced [998] init_render_index::render_index_xcol#8 = init_render_index::render_index_xcol#1 +Coalesced [999] init_render_index::ypos_inc_offset#10 = init_render_index::ypos_inc_offset#8 +Coalesced [1000] init_render_index::ypos_inc_offset#11 = init_render_index::ypos_inc_offset#2 +Coalesced [1005] splash_show::splash#9 = splash_show::splash#4 +Coalesced [1009] splash_show::xcol#8 = splash_show::xcol#1 +Coalesced (already) [1010] splash_show::splash#8 = splash_show::splash#2 +Coalesced [1016] render::ypos#4 = render::ypos#1 +Coalesced [1017] render::xcol#4 = render::xcol#1 +Coalesced [1018] render::pixels#7 = render::pixels#1 +Coalesced [1021] splash_show::ypos#5 = splash_show::ypos#1 +Coalesced [1022] splash_show::splash#10 = splash_show::splash#1 +Coalesced [1039] init_bobs_restore::bob#7 = init_bobs_restore::bob#1 +Coalesced [1040] init_bobs_restore::bob_restore#7 = init_bobs_restore::bob_restore#1 +Coalesced [1043] init_bobs_restore::i#4 = init_bobs_restore::i#1 +Coalesced [1054] init_sprite_pointers::screen#7 = init_sprite_pointers::screen#1 +Coalesced [1055] init_sprite_pointers::sprites_ptr_1#7 = init_sprite_pointers::sprites_ptr_1#1 +Coalesced [1056] init_sprite_pointers::sprites_ptr_2#7 = init_sprite_pointers::sprites_ptr_2#1 +Coalesced [1062] init_sprite_pointers::sprite#4 = init_sprite_pointers::sprite#1 +Coalesced [1071] memcpy::src#4 = memcpy::src#1 +Coalesced [1072] memcpy::dst#4 = memcpy::dst#1 +Coalesced [1090] init_level_tile_directions::ytile#19 = init_level_tile_directions::ytile#1 +Coalesced [1091] init_level_tile_directions::directions#19 = init_level_tile_directions::directions#1 +Coalesced [1094] level_tile_get::xtile#6 = level_tile_get::xtile#0 +Coalesced [1095] level_tile_get::ytile#6 = level_tile_get::ytile#0 +Coalesced [1104] level_tile_get::xtile#7 = level_tile_get::xtile#1 +Coalesced [1105] level_tile_get::ytile#7 = level_tile_get::ytile#1 +Coalesced [1111] init_level_tile_directions::open_directions#17 = init_level_tile_directions::open_directions#2 +Coalesced [1115] level_tile_get::xtile#8 = level_tile_get::xtile#2 +Coalesced [1116] level_tile_get::ytile#8 = level_tile_get::ytile#2 +Coalesced [1122] init_level_tile_directions::open_directions#19 = init_level_tile_directions::open_directions#3 +Coalesced [1126] level_tile_get::xtile#9 = level_tile_get::xtile#3 +Coalesced [1127] level_tile_get::ytile#9 = level_tile_get::ytile#3 +Coalesced [1133] init_level_tile_directions::open_directions#21 = init_level_tile_directions::open_directions#4 +Coalesced [1137] init_level_tile_directions::xtile#16 = init_level_tile_directions::xtile#1 +Coalesced [1138] init_level_tile_directions::open_directions#22 = init_level_tile_directions::open_directions#13 +Coalesced [1139] init_level_tile_directions::open_directions#20 = init_level_tile_directions::open_directions#12 +Coalesced [1140] init_level_tile_directions::open_directions#18 = init_level_tile_directions::open_directions#11 +Coalesced [1146] level_show::count#16 = level_show::count#12 +Coalesced [1151] level_show::ytile#12 = level_show::ytile#1 +Coalesced (already) [1152] level_show::count#14 = level_show::count#10 +Coalesced [1153] level_show::level#12 = level_show::level#1 +Coalesced [1158] level_show::count#18 = level_show::count#1 +Coalesced [1164] level_show::count#19 = level_show::count#2 +Coalesced [1172] level_show::xcol#9 = level_show::xcol#1 +Coalesced [1173] level_show::xtile#10 = level_show::xtile#2 +Coalesced [1174] level_show::count#15 = level_show::count#11 +Coalesced [1175] level_show::count#20 = level_show::count#5 +Coalesced (already) [1176] level_show::count#17 = level_show::count#10 +Coalesced [1194] render::canvas1#5 = render::canvas1#0 +Coalesced [1195] render::ypos_inc_offset#4 = render::ypos_inc_offset#0 +Coalesced [1196] render::canvas2#5 = render::canvas2#0 +Coalesced [1206] render::i#4 = render::i#1 +Coalesced [1207] render::canvas1#6 = render::canvas1#1 +Coalesced [1208] render::ypos_inc_offset#5 = render::ypos_inc_offset#1 +Coalesced [1209] render::canvas2#6 = render::canvas2#1 +Coalesced [1216] level_tile_get::return#12 = level_tile_get::return#0 +Coalesced [1231] render_tiles::canvas1#4 = render_tiles::canvas1#0 +Coalesced [1232] render_tiles::canvas2#4 = render_tiles::canvas2#0 +Coalesced [1233] render_tiles::ypos_inc_offset#4 = render_tiles::ypos_inc_offset#0 +Coalesced [1244] render_tiles::y#4 = render_tiles::y#1 +Coalesced [1245] render_tiles::canvas1#5 = render_tiles::canvas1#1 +Coalesced [1246] render_tiles::canvas2#5 = render_tiles::canvas2#1 +Coalesced [1247] render_tiles::ypos_inc_offset#5 = render_tiles::ypos_inc_offset#1 +Coalesced down to 85 phi equivalence classes +Culled Empty Block label __start::@2 +Culled Empty Block label irq_screen_top::toD0181_@return +Culled Empty Block label irq_screen_top::@5 +Culled Empty Block label irq_screen_top::toDd002_@return +Culled Empty Block label irq_screen_top::@11 +Culled Empty Block label irq_screen_top::@1 +Culled Empty Block label irq_screen_top::toDd001_@return +Culled Empty Block label main::@2 +Culled Empty Block label main::@4 +Culled Empty Block label game_logic::@179 +Culled Empty Block label game_logic::@156 +Culled Empty Block label game_logic::@157 +Culled Empty Block label game_logic::@158 +Culled Empty Block label game_logic::@159 +Culled Empty Block label game_logic::@80 +Culled Empty Block label game_logic::@98 +Culled Empty Block label game_logic::@116 +Culled Empty Block label game_logic::@134 +Culled Empty Block label splash_run::@3 +Culled Empty Block label splash_run::toDd001_@return +Culled Empty Block label splash_run::toD0181_@return +Culled Empty Block label splash_run::@39 +Culled Empty Block label gameplay_run::@14 +Culled Empty Block label done_run::@5 +Culled Empty Block label done_run::@20 +Culled Empty Block label done_run::@2 +Culled Empty Block label done_run::@11 +Culled Empty Block label done_run::@19 +Culled Empty Block label level_tile_directions::@2 +Culled Empty Block label choose_direction::@8 +Culled Empty Block label choose_direction::@10 +Culled Empty Block label choose_direction::@12 +Culled Empty Block label choose_direction::@18 +Culled Empty Block label memset::@1 +Culled Empty Block label merge_code::@26 +Culled Empty Block label merge_code::@23 +Culled Empty Block label merge_code::@25 +Culled Empty Block label merge_code::@22 +Culled Empty Block label merge_code::@24 +Culled Empty Block label init_render_index::@11 +Culled Empty Block label splash_show::@2 +Culled Empty Block label init_bobs_restore::@2 +Culled Empty Block label init_sprite_pointers::@2 +Culled Empty Block label memcpy::@3 +Culled Empty Block label joyfire::@2 +Culled Empty Block label init_level_tile_directions::@2 +Culled Empty Block label init_level_tile_directions::@20 +Culled Empty Block label init_level_tile_directions::@19 +Culled Empty Block label init_level_tile_directions::@18 +Culled Empty Block label level_show::@3 +Culled Empty Block label level_show::@2 +Culled Empty Block label level_show::@13 +Culled Empty Block label level_show::@12 +Culled Empty Block label level_tile_get::@2 +Renumbering block memset::@2 to memset::@1 +Renumbering block memset::@3 to memset::@2 +Renumbering block memset::@4 to memset::@3 +Renumbering block init_bobs_restore::@3 to init_bobs_restore::@2 +Renumbering block init_bobs_restore::@4 to init_bobs_restore::@3 +Renumbering block init_bobs_restore::@5 to init_bobs_restore::@4 +Renumbering block init_bobs_restore::@6 to init_bobs_restore::@5 +Renumbering block main::@3 to main::@2 +Renumbering block done_run::@3 to done_run::@2 +Renumbering block done_run::@4 to done_run::@3 +Renumbering block done_run::@6 to done_run::@4 +Renumbering block done_run::@7 to done_run::@5 +Renumbering block done_run::@8 to done_run::@6 +Renumbering block done_run::@9 to done_run::@7 +Renumbering block done_run::@10 to done_run::@8 +Renumbering block done_run::@12 to done_run::@9 +Renumbering block done_run::@13 to done_run::@10 +Renumbering block done_run::@14 to done_run::@11 +Renumbering block done_run::@15 to done_run::@12 +Renumbering block done_run::@16 to done_run::@13 +Renumbering block done_run::@17 to done_run::@14 +Renumbering block done_run::@18 to done_run::@15 +Renumbering block done_run::@21 to done_run::@16 +Renumbering block done_run::@22 to done_run::@17 +Renumbering block splash_run::@4 to splash_run::@3 +Renumbering block splash_run::@5 to splash_run::@4 +Renumbering block splash_run::@6 to splash_run::@5 +Renumbering block splash_run::@7 to splash_run::@6 +Renumbering block splash_run::@8 to splash_run::@7 +Renumbering block splash_run::@9 to splash_run::@8 +Renumbering block splash_run::@10 to splash_run::@9 +Renumbering block splash_run::@11 to splash_run::@10 +Renumbering block splash_run::@12 to splash_run::@11 +Renumbering block splash_run::@13 to splash_run::@12 +Renumbering block splash_run::@14 to splash_run::@13 +Renumbering block splash_run::@15 to splash_run::@14 +Renumbering block splash_run::@16 to splash_run::@15 +Renumbering block splash_run::@17 to splash_run::@16 +Renumbering block splash_run::@18 to splash_run::@17 +Renumbering block splash_run::@19 to splash_run::@18 +Renumbering block splash_run::@20 to splash_run::@19 +Renumbering block splash_run::@21 to splash_run::@20 +Renumbering block splash_run::@22 to splash_run::@21 +Renumbering block splash_run::@23 to splash_run::@22 +Renumbering block splash_run::@24 to splash_run::@23 +Renumbering block splash_run::@25 to splash_run::@24 +Renumbering block splash_run::@26 to splash_run::@25 +Renumbering block splash_run::@27 to splash_run::@26 +Renumbering block splash_run::@28 to splash_run::@27 +Renumbering block splash_run::@29 to splash_run::@28 +Renumbering block splash_run::@30 to splash_run::@29 +Renumbering block splash_run::@31 to splash_run::@30 +Renumbering block splash_run::@32 to splash_run::@31 +Renumbering block splash_run::@33 to splash_run::@32 +Renumbering block splash_run::@34 to splash_run::@33 +Renumbering block splash_run::@35 to splash_run::@34 +Renumbering block splash_run::@36 to splash_run::@35 +Renumbering block splash_run::@37 to splash_run::@36 +Renumbering block splash_run::@38 to splash_run::@37 +Renumbering block gameplay_run::@15 to gameplay_run::@14 +Renumbering block gameplay_run::@16 to gameplay_run::@15 +Renumbering block gameplay_run::@17 to gameplay_run::@16 +Renumbering block gameplay_run::@18 to gameplay_run::@17 +Renumbering block gameplay_run::@19 to gameplay_run::@18 +Renumbering block gameplay_run::@20 to gameplay_run::@19 +Renumbering block gameplay_run::@21 to gameplay_run::@20 +Renumbering block splash_show::@3 to splash_show::@2 +Renumbering block splash_show::@4 to splash_show::@3 +Renumbering block splash_show::@5 to splash_show::@4 +Renumbering block splash_show::@6 to splash_show::@5 +Renumbering block level_show::@4 to level_show::@2 +Renumbering block level_show::@5 to level_show::@3 +Renumbering block level_show::@6 to level_show::@4 +Renumbering block level_show::@7 to level_show::@5 +Renumbering block level_show::@8 to level_show::@6 +Renumbering block level_show::@9 to level_show::@7 +Renumbering block level_show::@10 to level_show::@8 +Renumbering block level_show::@11 to level_show::@9 +Renumbering block level_tile_get::@3 to level_tile_get::@2 +Renumbering block level_tile_directions::@3 to level_tile_directions::@2 +Renumbering block init_level_tile_directions::@3 to init_level_tile_directions::@2 +Renumbering block init_level_tile_directions::@4 to init_level_tile_directions::@3 +Renumbering block init_level_tile_directions::@5 to init_level_tile_directions::@4 +Renumbering block init_level_tile_directions::@6 to init_level_tile_directions::@5 +Renumbering block init_level_tile_directions::@7 to init_level_tile_directions::@6 +Renumbering block init_level_tile_directions::@8 to init_level_tile_directions::@7 +Renumbering block init_level_tile_directions::@9 to init_level_tile_directions::@8 +Renumbering block init_level_tile_directions::@10 to init_level_tile_directions::@9 +Renumbering block init_level_tile_directions::@11 to init_level_tile_directions::@10 +Renumbering block init_level_tile_directions::@12 to init_level_tile_directions::@11 +Renumbering block init_level_tile_directions::@13 to init_level_tile_directions::@12 +Renumbering block init_level_tile_directions::@14 to init_level_tile_directions::@13 +Renumbering block init_level_tile_directions::@15 to init_level_tile_directions::@14 +Renumbering block init_level_tile_directions::@16 to init_level_tile_directions::@15 +Renumbering block init_level_tile_directions::@17 to init_level_tile_directions::@16 +Renumbering block init_sprite_pointers::@3 to init_sprite_pointers::@2 +Renumbering block init_sprite_pointers::@4 to init_sprite_pointers::@3 +Renumbering block init_sprite_pointers::@5 to init_sprite_pointers::@4 +Renumbering block irq_screen_top::@2 to irq_screen_top::@1 +Renumbering block irq_screen_top::@3 to irq_screen_top::@2 +Renumbering block irq_screen_top::@4 to irq_screen_top::@3 +Renumbering block irq_screen_top::@6 to irq_screen_top::@4 +Renumbering block irq_screen_top::@7 to irq_screen_top::@5 +Renumbering block irq_screen_top::@8 to irq_screen_top::@6 +Renumbering block irq_screen_top::@9 to irq_screen_top::@7 +Renumbering block irq_screen_top::@10 to irq_screen_top::@8 +Renumbering block game_logic::@81 to game_logic::@80 +Renumbering block game_logic::@82 to game_logic::@81 +Renumbering block game_logic::@83 to game_logic::@82 +Renumbering block game_logic::@84 to game_logic::@83 +Renumbering block game_logic::@85 to game_logic::@84 +Renumbering block game_logic::@86 to game_logic::@85 +Renumbering block game_logic::@87 to game_logic::@86 +Renumbering block game_logic::@88 to game_logic::@87 +Renumbering block game_logic::@89 to game_logic::@88 +Renumbering block game_logic::@90 to game_logic::@89 +Renumbering block game_logic::@91 to game_logic::@90 +Renumbering block game_logic::@92 to game_logic::@91 +Renumbering block game_logic::@93 to game_logic::@92 +Renumbering block game_logic::@94 to game_logic::@93 +Renumbering block game_logic::@95 to game_logic::@94 +Renumbering block game_logic::@96 to game_logic::@95 +Renumbering block game_logic::@97 to game_logic::@96 +Renumbering block game_logic::@99 to game_logic::@97 +Renumbering block game_logic::@100 to game_logic::@98 +Renumbering block game_logic::@101 to game_logic::@99 +Renumbering block game_logic::@102 to game_logic::@100 +Renumbering block game_logic::@103 to game_logic::@101 +Renumbering block game_logic::@104 to game_logic::@102 +Renumbering block game_logic::@105 to game_logic::@103 +Renumbering block game_logic::@106 to game_logic::@104 +Renumbering block game_logic::@107 to game_logic::@105 +Renumbering block game_logic::@108 to game_logic::@106 +Renumbering block game_logic::@109 to game_logic::@107 +Renumbering block game_logic::@110 to game_logic::@108 +Renumbering block game_logic::@111 to game_logic::@109 +Renumbering block game_logic::@112 to game_logic::@110 +Renumbering block game_logic::@113 to game_logic::@111 +Renumbering block game_logic::@114 to game_logic::@112 +Renumbering block game_logic::@115 to game_logic::@113 +Renumbering block game_logic::@117 to game_logic::@114 +Renumbering block game_logic::@118 to game_logic::@115 +Renumbering block game_logic::@119 to game_logic::@116 +Renumbering block game_logic::@120 to game_logic::@117 +Renumbering block game_logic::@121 to game_logic::@118 +Renumbering block game_logic::@122 to game_logic::@119 +Renumbering block game_logic::@123 to game_logic::@120 +Renumbering block game_logic::@124 to game_logic::@121 +Renumbering block game_logic::@125 to game_logic::@122 +Renumbering block game_logic::@126 to game_logic::@123 +Renumbering block game_logic::@127 to game_logic::@124 +Renumbering block game_logic::@128 to game_logic::@125 +Renumbering block game_logic::@129 to game_logic::@126 +Renumbering block game_logic::@130 to game_logic::@127 +Renumbering block game_logic::@131 to game_logic::@128 +Renumbering block game_logic::@132 to game_logic::@129 +Renumbering block game_logic::@133 to game_logic::@130 +Renumbering block game_logic::@135 to game_logic::@131 +Renumbering block game_logic::@136 to game_logic::@132 +Renumbering block game_logic::@137 to game_logic::@133 +Renumbering block game_logic::@138 to game_logic::@134 +Renumbering block game_logic::@139 to game_logic::@135 +Renumbering block game_logic::@140 to game_logic::@136 +Renumbering block game_logic::@141 to game_logic::@137 +Renumbering block game_logic::@142 to game_logic::@138 +Renumbering block game_logic::@143 to game_logic::@139 +Renumbering block game_logic::@144 to game_logic::@140 +Renumbering block game_logic::@145 to game_logic::@141 +Renumbering block game_logic::@146 to game_logic::@142 +Renumbering block game_logic::@147 to game_logic::@143 +Renumbering block game_logic::@148 to game_logic::@144 +Renumbering block game_logic::@149 to game_logic::@145 +Renumbering block game_logic::@150 to game_logic::@146 +Renumbering block game_logic::@151 to game_logic::@147 +Renumbering block game_logic::@152 to game_logic::@148 +Renumbering block game_logic::@153 to game_logic::@149 +Renumbering block game_logic::@154 to game_logic::@150 +Renumbering block game_logic::@155 to game_logic::@151 +Renumbering block game_logic::@160 to game_logic::@152 +Renumbering block game_logic::@161 to game_logic::@153 +Renumbering block game_logic::@162 to game_logic::@154 +Renumbering block game_logic::@163 to game_logic::@155 +Renumbering block game_logic::@164 to game_logic::@156 +Renumbering block game_logic::@165 to game_logic::@157 +Renumbering block game_logic::@166 to game_logic::@158 +Renumbering block game_logic::@167 to game_logic::@159 +Renumbering block game_logic::@168 to game_logic::@160 +Renumbering block game_logic::@169 to game_logic::@161 +Renumbering block game_logic::@170 to game_logic::@162 +Renumbering block game_logic::@171 to game_logic::@163 +Renumbering block game_logic::@172 to game_logic::@164 +Renumbering block game_logic::@173 to game_logic::@165 +Renumbering block game_logic::@174 to game_logic::@166 +Renumbering block game_logic::@175 to game_logic::@167 +Renumbering block game_logic::@176 to game_logic::@168 +Renumbering block game_logic::@177 to game_logic::@169 +Renumbering block game_logic::@178 to game_logic::@170 +Renumbering block choose_direction::@9 to choose_direction::@8 +Renumbering block choose_direction::@11 to choose_direction::@9 +Renumbering block choose_direction::@13 to choose_direction::@10 +Renumbering block choose_direction::@14 to choose_direction::@11 +Renumbering block choose_direction::@15 to choose_direction::@12 +Renumbering block choose_direction::@16 to choose_direction::@13 +Renumbering block choose_direction::@17 to choose_direction::@14 +Adding NOP phi() at start of __start +Adding NOP phi() at start of __start::@1 +Adding NOP phi() at start of irq_screen_top::toD0181 +Adding NOP phi() at start of irq_screen_top::toDd002 +Adding NOP phi() at start of irq_screen_top::@4 +Adding NOP phi() at start of irq_screen_top::@8 +Adding NOP phi() at start of irq_screen_top::toDd001 +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of splash_run +Adding NOP phi() at start of splash_run::@22 +Adding NOP phi() at start of splash_run::@23 +Adding NOP phi() at start of splash_run::@24 +Adding NOP phi() at start of splash_run::@25 +Adding NOP phi() at start of splash_run::@27 +Adding NOP phi() at start of splash_run::@28 +Adding NOP phi() at start of splash_run::@29 +Adding NOP phi() at start of splash_run::@31 +Adding NOP phi() at start of splash_run::@32 +Adding NOP phi() at start of splash_run::@34 +Adding NOP phi() at start of splash_run::toDd001 +Adding NOP phi() at start of splash_run::toD0181 +Adding NOP phi() at start of splash_run::@19 +Adding NOP phi() at start of splash_run::@13 +Adding NOP phi() at start of gameplay_run +Adding NOP phi() at start of gameplay_run::@14 +Adding NOP phi() at start of gameplay_run::@15 +Adding NOP phi() at start of gameplay_run::@16 +Adding NOP phi() at start of gameplay_run::@18 +Adding NOP phi() at start of done_run::@13 +Adding NOP phi() at start of choose_direction::@6 +Adding NOP phi() at start of choose_direction::@14 +Adding NOP phi() at start of merge_code +Adding NOP phi() at start of init_render_index +Adding NOP phi() at start of init_render_index::@10 +Adding NOP phi() at start of splash_show +Adding NOP phi() at start of init_bobs_restore +Adding NOP phi() at start of init_sprite_pointers +Adding NOP phi() at start of memcpy +Adding NOP phi() at start of joyfire::@1 +Adding NOP phi() at start of init_level_tile_directions +Adding NOP phi() at start of init_level_tile_directions::@9 +Adding NOP phi() at start of level_show + +FINAL CONTROL FLOW GRAPH + +void __start() +__start: scope:[__start] from + [0] phi() + to:__start::__init1 +__start::__init1: scope:[__start] from __start + [1] pacman_ch1_enabled = 0 + [2] pacman_ch1_idx = 0 + [3] logic_tile_ptr = (byte*) 0 + [4] logic_tile_xcol = 0 + [5] logic_tile_yfine = 0 + [6] logic_tile_left_idx = 0 + [7] logic_tile_right_idx = 0 + [8] left_render_index_xcol = (byte*) 0 + [9] left_canvas = (byte*) 0 + [10] left_ypos_inc_offset = 0 + [11] rigt_render_index_xcol = (byte*) 0 + [12] rigt_canvas = (byte*) 0 + [13] rigt_ypos_inc_offset = 0 + [14] canvas_base_hi = 0 + [15] bobs_restore_base = 0 + [16] top_sprites_color = 0 + [17] top_sprites_mc = 0 + [18] side_sprites_color = 0 + [19] side_sprites_mc = 0 + [20] bottom_sprites_color = 0 + [21] bottom_sprites_mc = 0 + [22] pill_count = 0 + [23] pacman_wins = 0 + [24] pacman_lives = 3 + [25] music_play_next = 0 + [26] phase = 0 + [27] frame = 0 + [28] anim_frame_idx = 0 + [29] pacman_xfine = $2d + [30] pacman_yfine = $23 + [31] pacman_direction = STOP + [32] pacman_substep = 0 + [33] ghosts_mode = 1 + [34] ghosts_mode_count = 0 + [35] ghost1_xfine = $2d + [36] ghost1_yfine = $23 + [37] ghost1_direction = STOP + [38] ghost1_substep = 0 + [39] ghost1_reverse = 0 + [40] ghost1_respawn = 0 + [41] ghost2_xfine = $2d + [42] ghost2_yfine = $23 + [43] ghost2_direction = STOP + [44] ghost2_substep = 0 + [45] ghost2_reverse = 0 + [46] ghost2_respawn = 0 + [47] ghost3_xfine = $2d + [48] ghost3_yfine = $23 + [49] ghost3_direction = STOP + [50] ghost3_substep = 0 + [51] ghost3_reverse = 0 + [52] ghost3_respawn = 0 + [53] ghost4_xfine = $2d + [54] ghost4_yfine = $23 + [55] ghost4_direction = STOP + [56] ghost4_substep = 0 + [57] ghost4_reverse = 0 + [58] ghost4_respawn = 0 + [59] game_logic_substep = 0 + [60] game_playable = 0 + to:__start::@1 +__start::@1: scope:[__start] from __start::__init1 + [61] phi() + [62] call main + to:__start::@return +__start::@return: scope:[__start] from __start::@1 + [63] return + to:@return + +__interrupt(hardware_clobber) void irq_screen_top() +irq_screen_top: scope:[irq_screen_top] from + kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} + asm { jsrRASTER_CODE } + [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 + [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 + [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 + [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 + [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 + [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 + [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 + [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 + to:irq_screen_top::toD0181 +irq_screen_top::toD0181: scope:[irq_screen_top] from irq_screen_top + [74] phi() + to:irq_screen_top::@5 +irq_screen_top::@5: scope:[irq_screen_top] from irq_screen_top::toD0181 + [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 + [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color + [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color + [79] irq_screen_top::$1 = frame + 1 + [80] irq_screen_top::$2 = irq_screen_top::$1 & 1 + [81] frame = irq_screen_top::$2 + [82] if(0!=frame) goto irq_screen_top::toDd001 + to:irq_screen_top::toDd002 +irq_screen_top::toDd002: scope:[irq_screen_top] from irq_screen_top::@5 + [83] phi() + to:irq_screen_top::@7 +irq_screen_top::@7: scope:[irq_screen_top] from irq_screen_top::toDd002 + [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 + [85] canvas_base_hi = >SPRITES_2 + [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + to:irq_screen_top::@1 +irq_screen_top::@1: scope:[irq_screen_top] from irq_screen_top::@6 irq_screen_top::@7 + [87] if(phase==0) goto irq_screen_top::@2 + to:irq_screen_top::@4 +irq_screen_top::@4: scope:[irq_screen_top] from irq_screen_top::@1 + [88] phi() + [89] call game_logic + to:irq_screen_top::@8 +irq_screen_top::@8: scope:[irq_screen_top] from irq_screen_top::@4 + [90] phi() + [91] call pacman_sound_play + to:irq_screen_top::@3 +irq_screen_top::@3: scope:[irq_screen_top] from irq_screen_top::@2 irq_screen_top::@8 + [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER + [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [94] *HARDWARE_IRQ = &irq_screen_top + to:irq_screen_top::@return +irq_screen_top::@return: scope:[irq_screen_top] from irq_screen_top::@3 + [95] return + to:@return +irq_screen_top::@2: scope:[irq_screen_top] from irq_screen_top::@1 + [96] music_play_next = 1 + to:irq_screen_top::@3 +irq_screen_top::toDd001: scope:[irq_screen_top] from irq_screen_top::@5 + [97] phi() + to:irq_screen_top::@6 +irq_screen_top::@6: scope:[irq_screen_top] from irq_screen_top::toDd001 + [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 + [99] canvas_base_hi = >SPRITES_1 + [100] bobs_restore_base = 0 + to:irq_screen_top::@1 + +void main() +main: scope:[main] from __start::@1 + [101] phi() + [102] call splash_run + to:main::@1 +main::@1: scope:[main] from main main::@2 + [103] phi() + [104] call gameplay_run + to:main::@2 +main::@2: scope:[main] from main::@1 + [105] phi() + [106] call done_run + to:main::@1 + +void game_logic() +game_logic: scope:[game_logic] from irq_screen_top::@4 + [107] if(game_playable!=0) goto game_logic::@1 + to:game_logic::@return +game_logic::@return: scope:[game_logic] from game_logic game_logic::@103 game_logic::@104 game_logic::@105 game_logic::@106 game_logic::@112 game_logic::@113 game_logic::@115 game_logic::@120 game_logic::@121 game_logic::@122 game_logic::@123 game_logic::@129 game_logic::@130 game_logic::@132 game_logic::@137 game_logic::@138 game_logic::@139 game_logic::@145 game_logic::@146 game_logic::@150 game_logic::@151 game_logic::@153 game_logic::@155 game_logic::@157 game_logic::@159 game_logic::@161 game_logic::@165 game_logic::@44 game_logic::@54 game_logic::@55 game_logic::@56 game_logic::@57 game_logic::@66 game_logic::@68 game_logic::@69 game_logic::@70 game_logic::@71 game_logic::@72 game_logic::@78 game_logic::@79 game_logic::@81 game_logic::@86 game_logic::@87 game_logic::@88 game_logic::@89 game_logic::@95 game_logic::@96 game_logic::@98 + [108] return + to:@return +game_logic::@1: scope:[game_logic] from game_logic + [109] game_logic::$2 = game_logic_substep + 1 + [110] game_logic::$3 = game_logic::$2 & 7 + [111] game_logic_substep = game_logic::$3 + [112] if(game_logic_substep==0) goto game_logic::@2 + to:game_logic::@8 +game_logic::@8: scope:[game_logic] from game_logic::@1 + [113] if(game_logic_substep==1) goto game_logic::@3 + to:game_logic::@9 +game_logic::@9: scope:[game_logic] from game_logic::@8 + [114] if(game_logic_substep==2) goto game_logic::@4 + to:game_logic::@10 +game_logic::@10: scope:[game_logic] from game_logic::@9 + [115] if(game_logic_substep==4) goto game_logic::@5 + to:game_logic::@11 +game_logic::@11: scope:[game_logic] from game_logic::@10 + [116] if(game_logic_substep==5) goto game_logic::@6 + to:game_logic::@12 +game_logic::@12: scope:[game_logic] from game_logic::@11 + [117] if(game_logic_substep==6) goto game_logic::@7 + to:game_logic::@13 +game_logic::@13: scope:[game_logic] from game_logic::@12 + [118] if(game_logic_substep==3) goto game_logic::@14 + to:game_logic::@161 +game_logic::@161: scope:[game_logic] from game_logic::@13 + [119] if(game_logic_substep==7) goto game_logic::@14 + to:game_logic::@return +game_logic::@14: scope:[game_logic] from game_logic::@13 game_logic::@161 + [120] game_logic::$14 = anim_frame_idx + 1 + [121] game_logic::$15 = game_logic::$14 & 3 + [122] anim_frame_idx = game_logic::$15 + [123] game_logic::pacman_bob_xfine#0 = pacman_xfine - 1 + [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 + [125] *bobs_xcol = game_logic::$17 + [126] game_logic::$18 = pacman_yfine - 1 + [127] *bobs_yfine = game_logic::$18 + [128] game_logic::$19 = pacman_direction | anim_frame_idx + [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 + [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 + [131] *bobs_bob_id = game_logic::$21 + [132] game_logic::ghost_frame_idx#0 = anim_frame_idx + [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 + to:game_logic::@15 +game_logic::@15: scope:[game_logic] from game_logic::@14 + [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 + to:game_logic::@44 +game_logic::@44: scope:[game_logic] from game_logic::@14 game_logic::@15 + [135] game_logic::ghost_frame_idx#2 = phi( game_logic::@14/game_logic::ghost_frame_idx#0, game_logic::@15/game_logic::ghost_frame_idx#1 ) + [136] game_logic::ghost1_bob_xfine#0 = ghost1_xfine - 1 + [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 + [138] *(bobs_xcol+1) = game_logic::$25 + [139] game_logic::$26 = ghost1_yfine - 1 + [140] *(bobs_yfine+1) = game_logic::$26 + [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 + [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 + [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 + [144] *(bobs_bob_id+1) = game_logic::$29 + [145] game_logic::ghost2_bob_xfine#0 = ghost2_xfine - 1 + [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 + [147] *(bobs_xcol+2) = game_logic::$31 + [148] game_logic::$32 = ghost2_yfine - 1 + [149] *(bobs_yfine+2) = game_logic::$32 + [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 + [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 + [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 + [153] *(bobs_bob_id+2) = game_logic::$35 + [154] game_logic::ghost3_bob_xfine#0 = ghost3_xfine - 1 + [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 + [156] *(bobs_xcol+3) = game_logic::$37 + [157] game_logic::$38 = ghost3_yfine - 1 + [158] *(bobs_yfine+3) = game_logic::$38 + [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 + [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 + [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 + [162] *(bobs_bob_id+3) = game_logic::$41 + [163] game_logic::ghost4_bob_xfine#0 = ghost4_xfine - 1 + [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 + [165] *(bobs_xcol+4) = game_logic::$43 + [166] game_logic::$44 = ghost4_yfine - 1 + [167] *(bobs_yfine+4) = game_logic::$44 + [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 + [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 + [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 + [171] *(bobs_bob_id+4) = game_logic::$47 + to:game_logic::@return +game_logic::@7: scope:[game_logic] from game_logic::@12 + [172] ghosts_mode_count = ++ ghosts_mode_count + [173] if(ghosts_mode==SCATTER) goto game_logic::@45 + to:game_logic::@16 +game_logic::@16: scope:[game_logic] from game_logic::@7 + [174] if(ghosts_mode==CHASE) goto game_logic::@46 + to:game_logic::@17 +game_logic::@17: scope:[game_logic] from game_logic::@16 + [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 + to:game_logic::@18 +game_logic::@18: scope:[game_logic] from game_logic::@17 + [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 + to:game_logic::@19 +game_logic::@19: scope:[game_logic] from game_logic::@18 + [177] ghosts_mode = CHASE + [178] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@47: scope:[game_logic] from game_logic::@17 game_logic::@18 game_logic::@19 game_logic::@45 game_logic::@46 game_logic::@58 game_logic::@59 + [179] game_logic::do_reverse#4 = phi( game_logic::@17/0, game_logic::@18/0, game_logic::@19/1, game_logic::@45/0, game_logic::@46/0, game_logic::@58/1, game_logic::@59/1 ) + [180] if(0==game_logic::do_reverse#4) goto game_logic::@48 + to:game_logic::@60 +game_logic::@60: scope:[game_logic] from game_logic::@47 + [181] ghost1_reverse = 1 + [182] ghost2_reverse = 1 + [183] ghost3_reverse = 1 + [184] ghost4_reverse = 1 + to:game_logic::@48 +game_logic::@48: scope:[game_logic] from game_logic::@47 game_logic::@60 + [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 + [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 + [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 + [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] + [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] + [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 + to:game_logic::@61 +game_logic::@61: scope:[game_logic] from game_logic::@48 + [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 + to:game_logic::@62 +game_logic::@62: scope:[game_logic] from game_logic::@61 + [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY + [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 + [194] logic_tile_xcol = game_logic::$65 + [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe + [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 + [197] logic_tile_ptr = game_logic::$67 + [198] game_logic::$68 = game_logic::$210 + [199] logic_tile_yfine = game_logic::$68 + [200] ghosts_mode = FRIGHTENED + [201] ghosts_mode_count = 0 + to:game_logic::@50 +game_logic::@50: scope:[game_logic] from game_logic::@49 game_logic::@61 game_logic::@62 game_logic::@63 + [202] game_logic::$75 = pacman_xfine - ghost1_xfine + [203] game_logic::$77 = pacman_yfine - ghost1_yfine + [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 + to:game_logic::@162 +game_logic::@162: scope:[game_logic] from game_logic::@50 + [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 + to:game_logic::@64 +game_logic::@64: scope:[game_logic] from game_logic::@162 game_logic::@50 + [206] game_logic::$80 = pacman_xfine - ghost2_xfine + [207] game_logic::$82 = pacman_yfine - ghost2_yfine + [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 + to:game_logic::@163 +game_logic::@163: scope:[game_logic] from game_logic::@64 + [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 + to:game_logic::@65 +game_logic::@65: scope:[game_logic] from game_logic::@163 game_logic::@64 + [210] game_logic::$85 = pacman_xfine - ghost3_xfine + [211] game_logic::$87 = pacman_yfine - ghost3_yfine + [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 + to:game_logic::@164 +game_logic::@164: scope:[game_logic] from game_logic::@65 + [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 + to:game_logic::@66 +game_logic::@66: scope:[game_logic] from game_logic::@164 game_logic::@65 + [214] game_logic::$90 = pacman_xfine - ghost4_xfine + [215] game_logic::$92 = pacman_yfine - ghost4_yfine + [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return + to:game_logic::@165 +game_logic::@165: scope:[game_logic] from game_logic::@66 + [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 + to:game_logic::@return +game_logic::@67: scope:[game_logic] from game_logic::@165 + [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 + to:game_logic::@68 +game_logic::@68: scope:[game_logic] from game_logic::@67 + [219] pacman_lives = -- pacman_lives + [220] call spawn_all + to:game_logic::@return +game_logic::@54: scope:[game_logic] from game_logic::@67 + [221] ghost4_direction = STOP + [222] ghost4_xfine = $32 + [223] ghost4_yfine = $23 + [224] ghost4_substep = 0 + [225] ghost4_respawn = $32 + to:game_logic::@return +game_logic::@53: scope:[game_logic] from game_logic::@164 + [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 + to:game_logic::@69 +game_logic::@69: scope:[game_logic] from game_logic::@53 + [227] pacman_lives = -- pacman_lives + [228] call spawn_all + to:game_logic::@return +game_logic::@55: scope:[game_logic] from game_logic::@53 + [229] ghost3_direction = STOP + [230] ghost3_xfine = $32 + [231] ghost3_yfine = $23 + [232] ghost3_substep = 0 + [233] ghost3_respawn = $32 + to:game_logic::@return +game_logic::@52: scope:[game_logic] from game_logic::@163 + [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 + to:game_logic::@70 +game_logic::@70: scope:[game_logic] from game_logic::@52 + [235] pacman_lives = -- pacman_lives + [236] call spawn_all + to:game_logic::@return +game_logic::@56: scope:[game_logic] from game_logic::@52 + [237] ghost2_direction = STOP + [238] ghost2_xfine = $32 + [239] ghost2_yfine = $23 + [240] ghost2_substep = 0 + [241] ghost2_respawn = $32 + to:game_logic::@return +game_logic::@51: scope:[game_logic] from game_logic::@162 + [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 + to:game_logic::@71 +game_logic::@71: scope:[game_logic] from game_logic::@51 + [243] pacman_lives = -- pacman_lives + [244] call spawn_all + to:game_logic::@return +game_logic::@57: scope:[game_logic] from game_logic::@51 + [245] ghost1_direction = STOP + [246] ghost1_xfine = $32 + [247] ghost1_yfine = $23 + [248] ghost1_substep = 0 + [249] ghost1_respawn = $32 + to:game_logic::@return +game_logic::@49: scope:[game_logic] from game_logic::@48 + [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY + [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 + [252] logic_tile_xcol = game_logic::$69 + [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe + [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 + [255] logic_tile_ptr = game_logic::$71 + [256] game_logic::$72 = game_logic::$210 + [257] logic_tile_yfine = game_logic::$72 + [258] pill_count = -- pill_count + [259] if(pill_count!=0) goto game_logic::@50 + to:game_logic::@63 +game_logic::@63: scope:[game_logic] from game_logic::@49 + [260] pacman_wins = 1 + to:game_logic::@50 +game_logic::@46: scope:[game_logic] from game_logic::@16 + [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 + to:game_logic::@58 +game_logic::@58: scope:[game_logic] from game_logic::@46 + [262] ghosts_mode = SCATTER + [263] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@45: scope:[game_logic] from game_logic::@7 + [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 + to:game_logic::@59 +game_logic::@59: scope:[game_logic] from game_logic::@45 + [265] ghosts_mode = CHASE + [266] ghosts_mode_count = 0 + to:game_logic::@47 +game_logic::@6: scope:[game_logic] from game_logic::@11 + [267] if(0!=ghost4_respawn) goto game_logic::@72 + to:game_logic::@20 +game_logic::@20: scope:[game_logic] from game_logic::@6 + [268] if(ghost4_direction==RIGHT) goto game_logic::@73 + to:game_logic::@21 +game_logic::@21: scope:[game_logic] from game_logic::@20 + [269] if(ghost4_direction==DOWN) goto game_logic::@74 + to:game_logic::@22 +game_logic::@22: scope:[game_logic] from game_logic::@21 + [270] if(ghost4_direction==LEFT) goto game_logic::@75 + to:game_logic::@23 +game_logic::@23: scope:[game_logic] from game_logic::@22 + [271] if(ghost4_direction!=UP) goto game_logic::@76 + to:game_logic::@24 +game_logic::@24: scope:[game_logic] from game_logic::@23 + [272] ghost4_yfine = -- ghost4_yfine + to:game_logic::@76 +game_logic::@76: scope:[game_logic] from game_logic::@23 game_logic::@24 game_logic::@73 game_logic::@74 game_logic::@75 + [273] game_logic::$220 = ghost4_direction + [274] if(ghost4_substep!=0) goto game_logic::@82 + to:game_logic::@166 +game_logic::@166: scope:[game_logic] from game_logic::@76 + [275] if(game_logic::$220!=STOP) goto game_logic::@77 + to:game_logic::@82 +game_logic::@82: scope:[game_logic] from game_logic::@166 game_logic::@76 + [276] ghost4_substep = 0 + [277] if(0!=ghost4_reverse) goto game_logic::@78 + to:game_logic::@83 +game_logic::@83: scope:[game_logic] from game_logic::@82 + [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 + [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 + [280] level_tile_directions::xtile#0 = game_logic::ghost4_xtile#0 + [281] level_tile_directions::ytile#0 = game_logic::ghost4_ytile#0 + [282] call level_tile_directions + [283] level_tile_directions::return#3 = level_tile_directions::return#2 + to:game_logic::@152 +game_logic::@152: scope:[game_logic] from game_logic::@83 + [284] game_logic::open_directions#0 = level_tile_directions::return#3 + [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] + [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 + to:game_logic::@84 +game_logic::@84: scope:[game_logic] from game_logic::@152 + [287] if(ghosts_mode==SCATTER) goto game_logic::@80 + to:game_logic::@85 +game_logic::@85: scope:[game_logic] from game_logic::@84 + [288] game_logic::target_xtile#2 = pacman_xfine >> 1 + [289] game_logic::target_ytile#2 = pacman_yfine >> 1 + to:game_logic::@80 +game_logic::@80: scope:[game_logic] from game_logic::@84 game_logic::@85 + [290] game_logic::target_ytile#3 = phi( game_logic::@84/2, game_logic::@85/game_logic::target_ytile#2 ) + [290] game_logic::target_xtile#3 = phi( game_logic::@84/2, game_logic::@85/game_logic::target_xtile#2 ) + [291] choose_direction::open_directions#0 = game_logic::open_directions#1 + [292] choose_direction::ghost_xtile#0 = game_logic::ghost4_xtile#0 + [293] choose_direction::ghost_ytile#0 = game_logic::ghost4_ytile#0 + [294] choose_direction::target_xtile#0 = game_logic::target_xtile#3 + [295] choose_direction::target_ytile#0 = game_logic::target_ytile#3 + [296] call choose_direction + [297] choose_direction::return#0 = choose_direction::return#10 + to:game_logic::@153 +game_logic::@153: scope:[game_logic] from game_logic::@80 + [298] game_logic::$119 = choose_direction::return#0 + [299] ghost4_direction = game_logic::$119 + to:game_logic::@return +game_logic::@79: scope:[game_logic] from game_logic::@152 + [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] + to:game_logic::@return +game_logic::@78: scope:[game_logic] from game_logic::@82 + [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] + [302] ghost4_reverse = 0 + to:game_logic::@return +game_logic::@77: scope:[game_logic] from game_logic::@166 + [303] ghost4_substep = 1 + [304] if(ghost4_xfine==1) goto game_logic::@81 + to:game_logic::@86 +game_logic::@86: scope:[game_logic] from game_logic::@77 + [305] if(ghost4_xfine!=$61) goto game_logic::@return + to:game_logic::@87 +game_logic::@87: scope:[game_logic] from game_logic::@86 + [306] ghost4_xfine = 1 + to:game_logic::@return +game_logic::@81: scope:[game_logic] from game_logic::@77 + [307] ghost4_xfine = $61 + to:game_logic::@return +game_logic::@75: scope:[game_logic] from game_logic::@22 + [308] ghost4_xfine = -- ghost4_xfine + to:game_logic::@76 +game_logic::@74: scope:[game_logic] from game_logic::@21 + [309] ghost4_yfine = ++ ghost4_yfine + to:game_logic::@76 +game_logic::@73: scope:[game_logic] from game_logic::@20 + [310] ghost4_xfine = ++ ghost4_xfine + to:game_logic::@76 +game_logic::@72: scope:[game_logic] from game_logic::@6 + [311] ghost4_respawn = -- ghost4_respawn + [312] if(ghost4_respawn!=0) goto game_logic::@return + to:game_logic::@88 +game_logic::@88: scope:[game_logic] from game_logic::@72 + [313] ghost4_direction = RIGHT + [314] ghost4_xfine = 2 + [315] ghost4_yfine = 2 + [316] ghost4_substep = 0 + to:game_logic::@return +game_logic::@5: scope:[game_logic] from game_logic::@10 + [317] if(0!=ghost3_respawn) goto game_logic::@89 + to:game_logic::@25 +game_logic::@25: scope:[game_logic] from game_logic::@5 + [318] if(ghost3_direction==RIGHT) goto game_logic::@90 + to:game_logic::@26 +game_logic::@26: scope:[game_logic] from game_logic::@25 + [319] if(ghost3_direction==DOWN) goto game_logic::@91 + to:game_logic::@27 +game_logic::@27: scope:[game_logic] from game_logic::@26 + [320] if(ghost3_direction==LEFT) goto game_logic::@92 + to:game_logic::@28 +game_logic::@28: scope:[game_logic] from game_logic::@27 + [321] if(ghost3_direction!=UP) goto game_logic::@93 + to:game_logic::@29 +game_logic::@29: scope:[game_logic] from game_logic::@28 + [322] ghost3_yfine = -- ghost3_yfine + to:game_logic::@93 +game_logic::@93: scope:[game_logic] from game_logic::@28 game_logic::@29 game_logic::@90 game_logic::@91 game_logic::@92 + [323] game_logic::$223 = ghost3_direction + [324] if(ghost3_substep!=0) goto game_logic::@99 + to:game_logic::@167 +game_logic::@167: scope:[game_logic] from game_logic::@93 + [325] if(game_logic::$223!=STOP) goto game_logic::@94 + to:game_logic::@99 +game_logic::@99: scope:[game_logic] from game_logic::@167 game_logic::@93 + [326] ghost3_substep = 0 + [327] if(0!=ghost3_reverse) goto game_logic::@95 + to:game_logic::@100 +game_logic::@100: scope:[game_logic] from game_logic::@99 + [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 + [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 + [330] level_tile_directions::xtile#1 = game_logic::ghost3_xtile#0 + [331] level_tile_directions::ytile#1 = game_logic::ghost3_ytile#0 + [332] call level_tile_directions + [333] level_tile_directions::return#10 = level_tile_directions::return#2 + to:game_logic::@154 +game_logic::@154: scope:[game_logic] from game_logic::@100 + [334] game_logic::open_directions1#0 = level_tile_directions::return#10 + [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] + [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 + to:game_logic::@101 +game_logic::@101: scope:[game_logic] from game_logic::@154 + [337] if(ghosts_mode==SCATTER) goto game_logic::@97 + to:game_logic::@102 +game_logic::@102: scope:[game_logic] from game_logic::@101 + [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 + [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 + to:game_logic::@97 +game_logic::@97: scope:[game_logic] from game_logic::@101 game_logic::@102 + [340] game_logic::target_ytile1#3 = phi( game_logic::@102/game_logic::target_ytile1#2, game_logic::@101/2 ) + [340] game_logic::target_xtile1#3 = phi( game_logic::@102/game_logic::target_xtile1#2, game_logic::@101/2 ) + [341] choose_direction::open_directions#1 = game_logic::open_directions1#1 + [342] choose_direction::ghost_xtile#1 = game_logic::ghost3_xtile#0 + [343] choose_direction::ghost_ytile#1 = game_logic::ghost3_ytile#0 + [344] choose_direction::target_xtile#1 = game_logic::target_xtile1#3 + [345] choose_direction::target_ytile#1 = game_logic::target_ytile1#3 + [346] call choose_direction + [347] choose_direction::return#1 = choose_direction::return#10 + to:game_logic::@155 +game_logic::@155: scope:[game_logic] from game_logic::@97 + [348] game_logic::$140 = choose_direction::return#1 + [349] ghost3_direction = game_logic::$140 + to:game_logic::@return +game_logic::@96: scope:[game_logic] from game_logic::@154 + [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] + to:game_logic::@return +game_logic::@95: scope:[game_logic] from game_logic::@99 + [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] + [352] ghost3_reverse = 0 + to:game_logic::@return +game_logic::@94: scope:[game_logic] from game_logic::@167 + [353] ghost3_substep = 1 + [354] if(ghost3_xfine==1) goto game_logic::@98 + to:game_logic::@103 +game_logic::@103: scope:[game_logic] from game_logic::@94 + [355] if(ghost3_xfine!=$61) goto game_logic::@return + to:game_logic::@104 +game_logic::@104: scope:[game_logic] from game_logic::@103 + [356] ghost3_xfine = 1 + to:game_logic::@return +game_logic::@98: scope:[game_logic] from game_logic::@94 + [357] ghost3_xfine = $61 + to:game_logic::@return +game_logic::@92: scope:[game_logic] from game_logic::@27 + [358] ghost3_xfine = -- ghost3_xfine + to:game_logic::@93 +game_logic::@91: scope:[game_logic] from game_logic::@26 + [359] ghost3_yfine = ++ ghost3_yfine + to:game_logic::@93 +game_logic::@90: scope:[game_logic] from game_logic::@25 + [360] ghost3_xfine = ++ ghost3_xfine + to:game_logic::@93 +game_logic::@89: scope:[game_logic] from game_logic::@5 + [361] ghost3_respawn = -- ghost3_respawn + [362] if(ghost3_respawn!=0) goto game_logic::@return + to:game_logic::@105 +game_logic::@105: scope:[game_logic] from game_logic::@89 + [363] ghost3_direction = UP + [364] ghost3_xfine = 2 + [365] ghost3_yfine = $46 + [366] ghost3_substep = 0 + to:game_logic::@return +game_logic::@4: scope:[game_logic] from game_logic::@9 + [367] if(0!=ghost2_respawn) goto game_logic::@106 + to:game_logic::@30 +game_logic::@30: scope:[game_logic] from game_logic::@4 + [368] if(ghost2_direction==RIGHT) goto game_logic::@107 + to:game_logic::@31 +game_logic::@31: scope:[game_logic] from game_logic::@30 + [369] if(ghost2_direction==DOWN) goto game_logic::@108 + to:game_logic::@32 +game_logic::@32: scope:[game_logic] from game_logic::@31 + [370] if(ghost2_direction==LEFT) goto game_logic::@109 + to:game_logic::@33 +game_logic::@33: scope:[game_logic] from game_logic::@32 + [371] if(ghost2_direction!=UP) goto game_logic::@110 + to:game_logic::@34 +game_logic::@34: scope:[game_logic] from game_logic::@33 + [372] ghost2_yfine = -- ghost2_yfine + to:game_logic::@110 +game_logic::@110: scope:[game_logic] from game_logic::@107 game_logic::@108 game_logic::@109 game_logic::@33 game_logic::@34 + [373] game_logic::$226 = ghost2_direction + [374] if(ghost2_substep!=0) goto game_logic::@116 + to:game_logic::@168 +game_logic::@168: scope:[game_logic] from game_logic::@110 + [375] if(game_logic::$226!=STOP) goto game_logic::@111 + to:game_logic::@116 +game_logic::@116: scope:[game_logic] from game_logic::@110 game_logic::@168 + [376] ghost2_substep = 0 + [377] if(0!=ghost2_reverse) goto game_logic::@112 + to:game_logic::@117 +game_logic::@117: scope:[game_logic] from game_logic::@116 + [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 + [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 + [380] level_tile_directions::xtile#2 = game_logic::ghost2_xtile#0 + [381] level_tile_directions::ytile#2 = game_logic::ghost2_ytile#0 + [382] call level_tile_directions + [383] level_tile_directions::return#11 = level_tile_directions::return#2 + to:game_logic::@156 +game_logic::@156: scope:[game_logic] from game_logic::@117 + [384] game_logic::open_directions2#0 = level_tile_directions::return#11 + [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] + [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 + to:game_logic::@118 +game_logic::@118: scope:[game_logic] from game_logic::@156 + [387] if(ghosts_mode==SCATTER) goto game_logic::@114 + to:game_logic::@119 +game_logic::@119: scope:[game_logic] from game_logic::@118 + [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 + [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 + to:game_logic::@114 +game_logic::@114: scope:[game_logic] from game_logic::@118 game_logic::@119 + [390] game_logic::target_ytile2#3 = phi( game_logic::@118/2, game_logic::@119/game_logic::target_ytile2#2 ) + [390] game_logic::target_xtile2#3 = phi( game_logic::@118/2, game_logic::@119/game_logic::target_xtile2#2 ) + [391] choose_direction::open_directions#2 = game_logic::open_directions2#1 + [392] choose_direction::ghost_xtile#2 = game_logic::ghost2_xtile#0 + [393] choose_direction::ghost_ytile#2 = game_logic::ghost2_ytile#0 + [394] choose_direction::target_xtile#2 = game_logic::target_xtile2#3 + [395] choose_direction::target_ytile#2 = game_logic::target_ytile2#3 + [396] call choose_direction + [397] choose_direction::return#2 = choose_direction::return#10 + to:game_logic::@157 +game_logic::@157: scope:[game_logic] from game_logic::@114 + [398] game_logic::$161 = choose_direction::return#2 + [399] ghost2_direction = game_logic::$161 + to:game_logic::@return +game_logic::@113: scope:[game_logic] from game_logic::@156 + [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] + to:game_logic::@return +game_logic::@112: scope:[game_logic] from game_logic::@116 + [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] + [402] ghost2_reverse = 0 + to:game_logic::@return +game_logic::@111: scope:[game_logic] from game_logic::@168 + [403] ghost2_substep = 1 + [404] if(ghost2_xfine==1) goto game_logic::@115 + to:game_logic::@120 +game_logic::@120: scope:[game_logic] from game_logic::@111 + [405] if(ghost2_xfine!=$61) goto game_logic::@return + to:game_logic::@121 +game_logic::@121: scope:[game_logic] from game_logic::@120 + [406] ghost2_xfine = 1 + to:game_logic::@return +game_logic::@115: scope:[game_logic] from game_logic::@111 + [407] ghost2_xfine = $61 + to:game_logic::@return +game_logic::@109: scope:[game_logic] from game_logic::@32 + [408] ghost2_xfine = -- ghost2_xfine + to:game_logic::@110 +game_logic::@108: scope:[game_logic] from game_logic::@31 + [409] ghost2_yfine = ++ ghost2_yfine + to:game_logic::@110 +game_logic::@107: scope:[game_logic] from game_logic::@30 + [410] ghost2_xfine = ++ ghost2_xfine + to:game_logic::@110 +game_logic::@106: scope:[game_logic] from game_logic::@4 + [411] ghost2_respawn = -- ghost2_respawn + [412] if(ghost2_respawn!=0) goto game_logic::@return + to:game_logic::@122 +game_logic::@122: scope:[game_logic] from game_logic::@106 + [413] ghost2_direction = LEFT + [414] ghost2_xfine = $60 + [415] ghost2_yfine = $46 + [416] ghost2_substep = 0 + to:game_logic::@return +game_logic::@3: scope:[game_logic] from game_logic::@8 + [417] if(0!=ghost1_respawn) goto game_logic::@123 + to:game_logic::@35 +game_logic::@35: scope:[game_logic] from game_logic::@3 + [418] if(ghost1_direction==RIGHT) goto game_logic::@124 + to:game_logic::@36 +game_logic::@36: scope:[game_logic] from game_logic::@35 + [419] if(ghost1_direction==DOWN) goto game_logic::@125 + to:game_logic::@37 +game_logic::@37: scope:[game_logic] from game_logic::@36 + [420] if(ghost1_direction==LEFT) goto game_logic::@126 + to:game_logic::@38 +game_logic::@38: scope:[game_logic] from game_logic::@37 + [421] if(ghost1_direction!=UP) goto game_logic::@127 + to:game_logic::@39 +game_logic::@39: scope:[game_logic] from game_logic::@38 + [422] ghost1_yfine = -- ghost1_yfine + to:game_logic::@127 +game_logic::@127: scope:[game_logic] from game_logic::@124 game_logic::@125 game_logic::@126 game_logic::@38 game_logic::@39 + [423] game_logic::$229 = ghost1_direction + [424] if(ghost1_substep!=0) goto game_logic::@133 + to:game_logic::@169 +game_logic::@169: scope:[game_logic] from game_logic::@127 + [425] if(game_logic::$229!=STOP) goto game_logic::@128 + to:game_logic::@133 +game_logic::@133: scope:[game_logic] from game_logic::@127 game_logic::@169 + [426] ghost1_substep = 0 + [427] if(0!=ghost1_reverse) goto game_logic::@129 + to:game_logic::@134 +game_logic::@134: scope:[game_logic] from game_logic::@133 + [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 + [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 + [430] level_tile_directions::xtile#3 = game_logic::ghost1_xtile#0 + [431] level_tile_directions::ytile#3 = game_logic::ghost1_ytile#0 + [432] call level_tile_directions + [433] level_tile_directions::return#12 = level_tile_directions::return#2 + to:game_logic::@158 +game_logic::@158: scope:[game_logic] from game_logic::@134 + [434] game_logic::open_directions3#0 = level_tile_directions::return#12 + [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] + [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 + to:game_logic::@135 +game_logic::@135: scope:[game_logic] from game_logic::@158 + [437] if(ghosts_mode==SCATTER) goto game_logic::@131 + to:game_logic::@136 +game_logic::@136: scope:[game_logic] from game_logic::@135 + [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 + [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 + to:game_logic::@131 +game_logic::@131: scope:[game_logic] from game_logic::@135 game_logic::@136 + [440] game_logic::target_ytile3#3 = phi( game_logic::@135/2, game_logic::@136/game_logic::target_ytile3#2 ) + [440] game_logic::target_xtile3#3 = phi( game_logic::@135/2, game_logic::@136/game_logic::target_xtile3#2 ) + [441] choose_direction::open_directions#3 = game_logic::open_directions3#1 + [442] choose_direction::ghost_xtile#3 = game_logic::ghost1_xtile#0 + [443] choose_direction::ghost_ytile#3 = game_logic::ghost1_ytile#0 + [444] choose_direction::target_xtile#3 = game_logic::target_xtile3#3 + [445] choose_direction::target_ytile#3 = game_logic::target_ytile3#3 + [446] call choose_direction + [447] choose_direction::return#3 = choose_direction::return#10 + to:game_logic::@159 +game_logic::@159: scope:[game_logic] from game_logic::@131 + [448] game_logic::$182 = choose_direction::return#3 + [449] ghost1_direction = game_logic::$182 + to:game_logic::@return +game_logic::@130: scope:[game_logic] from game_logic::@158 + [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] + to:game_logic::@return +game_logic::@129: scope:[game_logic] from game_logic::@133 + [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] + [452] ghost1_reverse = 0 + to:game_logic::@return +game_logic::@128: scope:[game_logic] from game_logic::@169 + [453] ghost1_substep = 1 + [454] if(ghost1_xfine==1) goto game_logic::@132 + to:game_logic::@137 +game_logic::@137: scope:[game_logic] from game_logic::@128 + [455] if(ghost1_xfine!=$61) goto game_logic::@return + to:game_logic::@138 +game_logic::@138: scope:[game_logic] from game_logic::@137 + [456] ghost1_xfine = 1 + to:game_logic::@return +game_logic::@132: scope:[game_logic] from game_logic::@128 + [457] ghost1_xfine = $61 + to:game_logic::@return +game_logic::@126: scope:[game_logic] from game_logic::@37 + [458] ghost1_xfine = -- ghost1_xfine + to:game_logic::@127 +game_logic::@125: scope:[game_logic] from game_logic::@36 + [459] ghost1_yfine = ++ ghost1_yfine + to:game_logic::@127 +game_logic::@124: scope:[game_logic] from game_logic::@35 + [460] ghost1_xfine = ++ ghost1_xfine + to:game_logic::@127 +game_logic::@123: scope:[game_logic] from game_logic::@3 + [461] ghost1_respawn = -- ghost1_respawn + [462] if(ghost1_respawn!=0) goto game_logic::@return + to:game_logic::@139 +game_logic::@139: scope:[game_logic] from game_logic::@123 + [463] ghost1_direction = DOWN + [464] ghost1_xfine = $60 + [465] ghost1_yfine = 2 + [466] ghost1_substep = 0 + to:game_logic::@return +game_logic::@2: scope:[game_logic] from game_logic::@1 + [467] if(pacman_direction==RIGHT) goto game_logic::@140 + to:game_logic::@40 +game_logic::@40: scope:[game_logic] from game_logic::@2 + [468] if(pacman_direction==DOWN) goto game_logic::@141 + to:game_logic::@41 +game_logic::@41: scope:[game_logic] from game_logic::@40 + [469] if(pacman_direction==LEFT) goto game_logic::@142 + to:game_logic::@42 +game_logic::@42: scope:[game_logic] from game_logic::@41 + [470] if(pacman_direction!=UP) goto game_logic::@143 + to:game_logic::@43 +game_logic::@43: scope:[game_logic] from game_logic::@42 + [471] pacman_yfine = -- pacman_yfine + to:game_logic::@143 +game_logic::@143: scope:[game_logic] from game_logic::@140 game_logic::@141 game_logic::@142 game_logic::@42 game_logic::@43 + [472] game_logic::$232 = pacman_direction + [473] if(pacman_substep!=0) goto game_logic::@147 + to:game_logic::@170 +game_logic::@170: scope:[game_logic] from game_logic::@143 + [474] if(game_logic::$232!=STOP) goto game_logic::@144 + to:game_logic::@147 +game_logic::@147: scope:[game_logic] from game_logic::@143 game_logic::@170 + [475] pacman_substep = 0 + [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 + [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 + [478] level_tile_directions::xtile#4 = game_logic::pacman_xtile1#0 + [479] level_tile_directions::ytile#4 = game_logic::pacman_ytile1#0 + [480] call level_tile_directions + [481] level_tile_directions::return#13 = level_tile_directions::return#2 + to:game_logic::@160 +game_logic::@160: scope:[game_logic] from game_logic::@147 + [482] game_logic::open_directions4#0 = level_tile_directions::return#13 + [483] game_logic::$199 = *((byte*)CIA1) & $f + [484] game_logic::$200 = game_logic::$199 ^ $f + [485] game_logic::joy_directions#0 = game_logic::$200 << 2 + [486] if(game_logic::joy_directions#0==0) goto game_logic::@145 + to:game_logic::@148 +game_logic::@148: scope:[game_logic] from game_logic::@160 + [487] game_logic::$204 = game_logic::joy_directions#0 & game_logic::open_directions4#0 + [488] game_logic::new_direction#0 = DIRECTION_SINGLE[game_logic::$204] + [489] if(game_logic::new_direction#0==0) goto game_logic::@145 + to:game_logic::@149 +game_logic::@149: scope:[game_logic] from game_logic::@148 + [490] pacman_direction = game_logic::new_direction#0 + to:game_logic::@145 +game_logic::@145: scope:[game_logic] from game_logic::@148 game_logic::@149 game_logic::@160 + [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 + to:game_logic::@return +game_logic::@144: scope:[game_logic] from game_logic::@170 + [492] pacman_substep = 1 + [493] pacman_ch1_enabled = 1 + [494] if(pacman_xfine==1) goto game_logic::@146 + to:game_logic::@150 +game_logic::@150: scope:[game_logic] from game_logic::@144 + [495] if(pacman_xfine!=$61) goto game_logic::@return + to:game_logic::@151 +game_logic::@151: scope:[game_logic] from game_logic::@150 + [496] pacman_xfine = 1 + to:game_logic::@return +game_logic::@146: scope:[game_logic] from game_logic::@144 + [497] pacman_xfine = $61 + to:game_logic::@return +game_logic::@142: scope:[game_logic] from game_logic::@41 + [498] pacman_xfine = -- pacman_xfine + to:game_logic::@143 +game_logic::@141: scope:[game_logic] from game_logic::@40 + [499] pacman_yfine = ++ pacman_yfine + to:game_logic::@143 +game_logic::@140: scope:[game_logic] from game_logic::@2 + [500] pacman_xfine = ++ pacman_xfine + to:game_logic::@143 + +void pacman_sound_play() +pacman_sound_play: scope:[pacman_sound_play] from irq_screen_top::@8 + [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return + to:pacman_sound_play::@1 +pacman_sound_play::@1: scope:[pacman_sound_play] from pacman_sound_play + [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] + [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] + [504] pacman_ch1_idx = ++ pacman_ch1_idx + [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return + to:pacman_sound_play::@2 +pacman_sound_play::@2: scope:[pacman_sound_play] from pacman_sound_play::@1 + [506] pacman_ch1_idx = 0 + [507] pacman_ch1_enabled = 0 + to:pacman_sound_play::@return +pacman_sound_play::@return: scope:[pacman_sound_play] from pacman_sound_play pacman_sound_play::@1 pacman_sound_play::@2 + [508] return + to:@return + +void splash_run() +splash_run: scope:[splash_run] from main + [509] phi() + to:splash_run::SEI1 +splash_run::SEI1: scope:[splash_run] from splash_run + asm { sei } + to:splash_run::@16 +splash_run::@16: scope:[splash_run] from splash_run::SEI1 + [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR + [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + [513] *PROCPORT = PROCPORT_RAM_ALL + [514] call memset + to:splash_run::@20 +splash_run::@20: scope:[splash_run] from splash_run::@16 + [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED + [516] call byteboozer_decrunch + to:splash_run::@21 +splash_run::@21: scope:[splash_run] from splash_run::@20 + [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED + [518] call byteboozer_decrunch + to:splash_run::@22 +splash_run::@22: scope:[splash_run] from splash_run::@21 + [519] phi() + [520] call merge_code + to:splash_run::@23 +splash_run::@23: scope:[splash_run] from splash_run::@22 + [521] phi() + [522] call memset + to:splash_run::@24 +splash_run::@24: scope:[splash_run] from splash_run::@23 + [523] phi() + [524] call memset + to:splash_run::@25 +splash_run::@25: scope:[splash_run] from splash_run::@24 + [525] phi() + [526] call init_render_index + to:splash_run::@26 +splash_run::@26: scope:[splash_run] from splash_run::@25 + [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED + [528] call byteboozer_decrunch + to:splash_run::@27 +splash_run::@27: scope:[splash_run] from splash_run::@26 + [529] phi() + [530] call splash_show + to:splash_run::@28 +splash_run::@28: scope:[splash_run] from splash_run::@27 + [531] phi() + [532] call memset + to:splash_run::@29 +splash_run::@29: scope:[splash_run] from splash_run::@28 + [533] phi() + [534] call init_bobs_restore + to:splash_run::@30 +splash_run::@30: scope:[splash_run] from splash_run::@29 + [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED + [536] call byteboozer_decrunch + to:splash_run::@31 +splash_run::@31: scope:[splash_run] from splash_run::@30 + [537] phi() + [538] call init_sprite_pointers + to:splash_run::@32 +splash_run::@32: scope:[splash_run] from splash_run::@31 + [539] phi() + [540] call memcpy + to:splash_run::@33 +splash_run::@33: scope:[splash_run] from splash_run::@32 + [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER + [542] call byteboozer_decrunch + to:splash_run::@34 +splash_run::@34: scope:[splash_run] from splash_run::@33 + [543] phi() + [544] call memset + to:splash_run::@35 +splash_run::@35: scope:[splash_run] from splash_run::@34 + [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + [546] *PROCPORT = PROCPORT_RAM_IO + to:splash_run::@1 +splash_run::@1: scope:[splash_run] from splash_run::@3 splash_run::@35 + [547] splash_run::msb#10 = phi( splash_run::@35/0, splash_run::@3/splash_run::msb#8 ) + [547] splash_run::i#2 = phi( splash_run::@35/0, splash_run::@3/splash_run::i#1 ) + [548] if(splash_run::i#2<8) goto splash_run::@2 + to:splash_run::toDd001 +splash_run::toDd001: scope:[splash_run] from splash_run::@1 + [549] phi() + to:splash_run::@17 +splash_run::@17: scope:[splash_run] from splash_run::toDd001 + [550] *((byte*)CIA2) = splash_run::toDd001_return#0 + [551] canvas_base_hi = >SPRITES_2 + [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + to:splash_run::toD0181 +splash_run::toD0181: scope:[splash_run] from splash_run::@17 + [553] phi() + to:splash_run::@18 +splash_run::@18: scope:[splash_run] from splash_run::toD0181 + [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 + [555] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) = splash_run::msb#10 + [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff + [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff + [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK + [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK + [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + [562] top_sprites_mc = 3 + [563] side_sprites_mc = 0 + [564] bottom_sprites_mc = 3 + [565] top_sprites_color = YELLOW + [566] side_sprites_color = BLUE + [567] bottom_sprites_color = YELLOW + [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + to:splash_run::@5 +splash_run::@5: scope:[splash_run] from splash_run::@18 splash_run::@6 + [569] splash_run::i1#2 = phi( splash_run::@18/0, splash_run::@6/splash_run::i1#1 ) + [570] if(splash_run::i1#2<8) goto splash_run::@6 + to:splash_run::@7 +splash_run::@7: scope:[splash_run] from splash_run::@5 + [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 + to:splash_run::@8 +splash_run::@8: scope:[splash_run] from splash_run::@7 splash_run::@9 + [572] splash_run::i2#2 = phi( splash_run::@9/splash_run::i2#1, splash_run::@7/0 ) + [573] if(splash_run::i2#2<4) goto splash_run::@9 + to:splash_run::@10 +splash_run::@10: scope:[splash_run] from splash_run::@8 + asm { lda#1 staINTRO_MUSIC+$69 } + asm { lda#0 } + [576] call *musicInit + [577] phase = 0 + [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:splash_run::@11 +splash_run::@11: scope:[splash_run] from splash_run::@10 splash_run::@11 + [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 + to:splash_run::@12 +splash_run::@12: scope:[splash_run] from splash_run::@11 + [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [582] *HARDWARE_IRQ = &irq_screen_top + [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + [585] *IRQ_STATUS = $f + to:splash_run::CLI1 +splash_run::CLI1: scope:[splash_run] from splash_run::@12 + asm { cli } + to:splash_run::@19 +splash_run::@19: scope:[splash_run] from splash_run::CLI1 + [587] phi() + [588] call joyinit + to:splash_run::@36 +splash_run::@36: scope:[splash_run] from splash_run::@19 + [589] music_play_next = 0 + to:splash_run::@13 +splash_run::@13: scope:[splash_run] from splash_run::@14 splash_run::@15 splash_run::@36 + [590] phi() + [591] call joyfire + [592] joyfire::return#1 = joyfire::return#4 + to:splash_run::@37 +splash_run::@37: scope:[splash_run] from splash_run::@13 + [593] splash_run::$30 = joyfire::return#1 + [594] if(0==splash_run::$30) goto splash_run::@14 + to:splash_run::@return +splash_run::@return: scope:[splash_run] from splash_run::@37 + [595] return + to:@return +splash_run::@14: scope:[splash_run] from splash_run::@37 + [596] if(0==music_play_next) goto splash_run::@13 + to:splash_run::@15 +splash_run::@15: scope:[splash_run] from splash_run::@14 + [597] call *musicPlay + [598] music_play_next = 0 + to:splash_run::@13 +splash_run::@9: scope:[splash_run] from splash_run::@8 + [599] bobs_xcol[splash_run::i2#2] = $a + [600] bobs_yfine[splash_run::i2#2] = $2d + [601] bobs_bob_id[splash_run::i2#2] = 0 + [602] splash_run::i2#1 = ++ splash_run::i2#2 + to:splash_run::@8 +splash_run::@6: scope:[splash_run] from splash_run::@5 + [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color + [604] splash_run::i1#1 = ++ splash_run::i1#2 + to:splash_run::@5 +splash_run::@2: scope:[splash_run] from splash_run::@1 + [605] splash_run::$34 = splash_run::i#2 << 1 + [606] SPRITES_YPOS[splash_run::$34] = 7 + [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] + [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 + [609] splash_run::msb#1 = splash_run::msb#10 >> 1 + [610] splash_run::$25 = > splash_run::xpos#0 + [611] if(0==splash_run::$25) goto splash_run::@3 + to:splash_run::@4 +splash_run::@4: scope:[splash_run] from splash_run::@2 + [612] splash_run::msb#2 = splash_run::msb#1 | $80 + to:splash_run::@3 +splash_run::@3: scope:[splash_run] from splash_run::@2 splash_run::@4 + [613] splash_run::msb#8 = phi( splash_run::@2/splash_run::msb#1, splash_run::@4/splash_run::msb#2 ) + [614] splash_run::i#1 = ++ splash_run::i#2 + to:splash_run::@1 + +void gameplay_run() +gameplay_run: scope:[gameplay_run] from main::@1 + [615] phi() + to:gameplay_run::SEI1 +gameplay_run::SEI1: scope:[gameplay_run] from gameplay_run + asm { sei } + to:gameplay_run::@1 +gameplay_run::@1: scope:[gameplay_run] from gameplay_run::@2 gameplay_run::SEI1 + [617] gameplay_run::i#2 = phi( gameplay_run::SEI1/0, gameplay_run::@2/gameplay_run::i#1 ) + [618] if(gameplay_run::i#2<$2f) goto gameplay_run::@2 + to:gameplay_run::@3 +gameplay_run::@3: scope:[gameplay_run] from gameplay_run::@1 + [619] pacman_wins = 0 + [620] pacman_lives = 3 + [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK + [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK + to:gameplay_run::@4 +gameplay_run::@4: scope:[gameplay_run] from gameplay_run::@3 gameplay_run::@5 + [623] gameplay_run::i1#2 = phi( gameplay_run::@3/0, gameplay_run::@5/gameplay_run::i1#1 ) + [624] if(gameplay_run::i1#2<8) goto gameplay_run::@5 + to:gameplay_run::@6 +gameplay_run::@6: scope:[gameplay_run] from gameplay_run::@4 + [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED + [626] call byteboozer_decrunch + to:gameplay_run::@14 +gameplay_run::@14: scope:[gameplay_run] from gameplay_run::@6 + [627] phi() + [628] call init_level_tile_directions + to:gameplay_run::@15 +gameplay_run::@15: scope:[gameplay_run] from gameplay_run::@14 + [629] phi() + [630] call init_sprite_pointers + to:gameplay_run::@16 +gameplay_run::@16: scope:[gameplay_run] from gameplay_run::@15 + [631] phi() + [632] call level_show + [633] level_show::return#0 = level_show::count#12 + to:gameplay_run::@17 +gameplay_run::@17: scope:[gameplay_run] from gameplay_run::@16 + [634] gameplay_run::$4 = level_show::return#0 + [635] pill_count = gameplay_run::$4 + [636] top_sprites_mc = $ff + [637] side_sprites_mc = $ff + [638] bottom_sprites_mc = $ff + [639] top_sprites_color = YELLOW + [640] side_sprites_color = YELLOW + [641] bottom_sprites_color = YELLOW + [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc + to:gameplay_run::@7 +gameplay_run::@7: scope:[gameplay_run] from gameplay_run::@17 gameplay_run::@8 + [643] gameplay_run::i2#2 = phi( gameplay_run::@17/0, gameplay_run::@8/gameplay_run::i2#1 ) + [644] if(gameplay_run::i2#2<8) goto gameplay_run::@8 + to:gameplay_run::@9 +gameplay_run::@9: scope:[gameplay_run] from gameplay_run::@7 + [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE + [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED + [647] phase = 1 + [648] call spawn_all + to:gameplay_run::@18 +gameplay_run::@18: scope:[gameplay_run] from gameplay_run::@9 + [649] phi() + [650] call pacman_sound_init + to:gameplay_run::@19 +gameplay_run::@19: scope:[gameplay_run] from gameplay_run::@18 + [651] game_playable = 1 + [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + to:gameplay_run::@10 +gameplay_run::@10: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@19 + [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 + to:gameplay_run::@11 +gameplay_run::@11: scope:[gameplay_run] from gameplay_run::@10 gameplay_run::@11 + [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 + to:gameplay_run::@12 +gameplay_run::@12: scope:[gameplay_run] from gameplay_run::@11 + [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN + [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE + [657] *HARDWARE_IRQ = &irq_screen_top + [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER + asm { ldaCIA1_INTERRUPT } + [660] *IRQ_STATUS = $f + to:gameplay_run::CLI1 +gameplay_run::CLI1: scope:[gameplay_run] from gameplay_run::@12 + asm { cli } + to:gameplay_run::@13 +gameplay_run::@13: scope:[gameplay_run] from gameplay_run::@20 gameplay_run::CLI1 + [662] if(0!=pacman_wins) goto gameplay_run::@return + to:gameplay_run::@20 +gameplay_run::@20: scope:[gameplay_run] from gameplay_run::@13 + [663] if(pacman_lives==0) goto gameplay_run::@return + to:gameplay_run::@13 +gameplay_run::@return: scope:[gameplay_run] from gameplay_run::@13 gameplay_run::@20 + [664] return + to:@return +gameplay_run::@8: scope:[gameplay_run] from gameplay_run::@7 + [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color + [666] gameplay_run::i2#1 = ++ gameplay_run::i2#2 + to:gameplay_run::@7 +gameplay_run::@5: scope:[gameplay_run] from gameplay_run::@4 + [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK + [668] gameplay_run::i1#1 = ++ gameplay_run::i1#2 + to:gameplay_run::@4 +gameplay_run::@2: scope:[gameplay_run] from gameplay_run::@1 + [669] ((byte*)SID)[gameplay_run::i#2] = 0 + [670] gameplay_run::i#1 = ++ gameplay_run::i#2 + to:gameplay_run::@1 + +void done_run() +done_run: scope:[done_run] from main::@2 + [671] game_playable = 0 + [672] phase = 0 + to:done_run::@2 +done_run::@2: scope:[done_run] from done_run done_run::@3 + [673] done_run::i#2 = phi( done_run/0, done_run::@3/done_run::i#1 ) + [674] if(done_run::i#2<$2f) goto done_run::@3 + to:done_run::@4 +done_run::@4: scope:[done_run] from done_run::@2 done_run::@5 + [675] done_run::i1#2 = phi( done_run::@2/0, done_run::@5/done_run::i1#1 ) + [676] if(done_run::i1#2<4) goto done_run::@5 + to:done_run::@6 +done_run::@6: scope:[done_run] from done_run::@4 + asm { lda#0 } + [678] call *musicInit + [679] if(0!=pacman_wins) goto done_run::@1 + to:done_run::@7 +done_run::@7: scope:[done_run] from done_run::@6 + [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED + [681] call byteboozer_decrunch + to:done_run::@8 +done_run::@8: scope:[done_run] from done_run::@1 done_run::@12 done_run::@7 + [682] done_run::gfx#4 = phi( done_run::@12/done_run::gfx#2, done_run::@1/WIN_GFX, done_run::@7/WIN_GFX ) + [682] done_run::xcol#2 = phi( done_run::@12/done_run::xcol#1, done_run::@1/0, done_run::@7/0 ) + [683] if(done_run::xcol#2<$19) goto done_run::@10 + to:done_run::@9 +done_run::@9: scope:[done_run] from done_run::@8 + [684] music_play_next = 0 + to:done_run::@13 +done_run::@13: scope:[done_run] from done_run::@14 done_run::@15 done_run::@9 + [685] phi() + [686] call joyfire + [687] joyfire::return#0 = joyfire::return#4 + to:done_run::@17 +done_run::@17: scope:[done_run] from done_run::@13 + [688] done_run::$8 = joyfire::return#0 + [689] if(0==done_run::$8) goto done_run::@14 + to:done_run::@return +done_run::@return: scope:[done_run] from done_run::@17 + [690] return + to:@return +done_run::@14: scope:[done_run] from done_run::@17 + [691] if(0==music_play_next) goto done_run::@13 + to:done_run::@15 +done_run::@15: scope:[done_run] from done_run::@14 + [692] call *musicPlay + [693] music_play_next = 0 + to:done_run::@13 +done_run::@10: scope:[done_run] from done_run::@16 done_run::@8 + [694] done_run::gfx#2 = phi( done_run::@8/done_run::gfx#4, done_run::@16/done_run::gfx#1 ) + [694] done_run::ypos#2 = phi( done_run::@8/0, done_run::@16/done_run::ypos#1 ) + [695] if(done_run::ypos#2<$19) goto done_run::@11 + to:done_run::@12 +done_run::@12: scope:[done_run] from done_run::@10 + [696] done_run::xcol#1 = ++ done_run::xcol#2 + to:done_run::@8 +done_run::@11: scope:[done_run] from done_run::@10 + [697] done_run::pixels#0 = *done_run::gfx#2 + [698] done_run::gfx#1 = ++ done_run::gfx#2 + [699] render::xcol#0 = done_run::xcol#2 + [700] render::ypos#0 = done_run::ypos#2 + [701] render::pixels#0 = done_run::pixels#0 + [702] call render + to:done_run::@16 +done_run::@16: scope:[done_run] from done_run::@11 + [703] done_run::ypos#1 = ++ done_run::ypos#2 + to:done_run::@10 +done_run::@1: scope:[done_run] from done_run::@6 + [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED + [705] call byteboozer_decrunch + to:done_run::@8 +done_run::@5: scope:[done_run] from done_run::@4 + [706] bobs_xcol[done_run::i1#2] = $a + [707] bobs_yfine[done_run::i1#2] = $2d + [708] bobs_bob_id[done_run::i1#2] = 0 + [709] done_run::i1#1 = ++ done_run::i1#2 + to:done_run::@4 +done_run::@3: scope:[done_run] from done_run::@2 + [710] ((byte*)SID)[done_run::i#2] = 0 + [711] done_run::i#1 = ++ done_run::i#2 + to:done_run::@2 + +void spawn_all() +spawn_all: scope:[spawn_all] from game_logic::@68 game_logic::@69 game_logic::@70 game_logic::@71 gameplay_run::@9 + [712] ghosts_mode_count = 0 + [713] pacman_substep = 0 + [714] ghost1_substep = 0 + [715] ghost2_substep = 0 + [716] ghost3_substep = 0 + [717] ghost4_substep = 0 + [718] pacman_direction = STOP + [719] ghost1_direction = STOP + [720] ghost2_direction = STOP + [721] ghost3_direction = STOP + [722] ghost4_direction = STOP + [723] pacman_xfine = $32 + [724] ghost1_xfine = $32 + [725] ghost2_xfine = $32 + [726] ghost3_xfine = $32 + [727] ghost4_xfine = $32 + [728] ghost1_yfine = $23 + [729] ghost2_yfine = $23 + [730] ghost3_yfine = $23 + [731] ghost4_yfine = $23 + [732] pacman_yfine = $3e + [733] ghost1_respawn = $a + [734] ghost2_respawn = $14 + [735] ghost3_respawn = $1e + [736] ghost4_respawn = $28 + to:spawn_all::@return +spawn_all::@return: scope:[spawn_all] from spawn_all + [737] return + to:@return + +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +level_tile_directions: scope:[level_tile_directions] from game_logic::@100 game_logic::@117 game_logic::@134 game_logic::@147 game_logic::@83 + [738] level_tile_directions::ytile#5 = phi( game_logic::@100/level_tile_directions::ytile#1, game_logic::@117/level_tile_directions::ytile#2, game_logic::@134/level_tile_directions::ytile#3, game_logic::@147/level_tile_directions::ytile#4, game_logic::@83/level_tile_directions::ytile#0 ) + [738] level_tile_directions::xtile#5 = phi( game_logic::@100/level_tile_directions::xtile#1, game_logic::@117/level_tile_directions::xtile#2, game_logic::@134/level_tile_directions::xtile#3, game_logic::@147/level_tile_directions::xtile#4, game_logic::@83/level_tile_directions::xtile#0 ) + [739] if(level_tile_directions::xtile#5>=$31+1) goto level_tile_directions::@return + to:level_tile_directions::@2 +level_tile_directions::@2: scope:[level_tile_directions] from level_tile_directions + [740] if(level_tile_directions::ytile#5>=$24+1) goto level_tile_directions::@return + to:level_tile_directions::@1 +level_tile_directions::@1: scope:[level_tile_directions] from level_tile_directions::@2 + [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 + [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] + [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] + to:level_tile_directions::@return +level_tile_directions::@return: scope:[level_tile_directions] from level_tile_directions level_tile_directions::@1 level_tile_directions::@2 + [744] level_tile_directions::return#2 = phi( level_tile_directions::@1/level_tile_directions::return#0, level_tile_directions/0, level_tile_directions::@2/0 ) + [745] return + to:@return + +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +choose_direction: scope:[choose_direction] from game_logic::@114 game_logic::@131 game_logic::@80 game_logic::@97 + [746] choose_direction::open_directions#10 = phi( game_logic::@114/choose_direction::open_directions#2, game_logic::@131/choose_direction::open_directions#3, game_logic::@80/choose_direction::open_directions#0, game_logic::@97/choose_direction::open_directions#1 ) + [746] choose_direction::target_ytile#4 = phi( game_logic::@114/choose_direction::target_ytile#2, game_logic::@131/choose_direction::target_ytile#3, game_logic::@80/choose_direction::target_ytile#0, game_logic::@97/choose_direction::target_ytile#1 ) + [746] choose_direction::ghost_ytile#4 = phi( game_logic::@114/choose_direction::ghost_ytile#2, game_logic::@131/choose_direction::ghost_ytile#3, game_logic::@80/choose_direction::ghost_ytile#0, game_logic::@97/choose_direction::ghost_ytile#1 ) + [746] choose_direction::target_xtile#4 = phi( game_logic::@114/choose_direction::target_xtile#2, game_logic::@131/choose_direction::target_xtile#3, game_logic::@80/choose_direction::target_xtile#0, game_logic::@97/choose_direction::target_xtile#1 ) + [746] choose_direction::ghost_xtile#4 = phi( game_logic::@114/choose_direction::ghost_xtile#2, game_logic::@131/choose_direction::ghost_xtile#3, game_logic::@80/choose_direction::ghost_xtile#0, game_logic::@97/choose_direction::ghost_xtile#1 ) + [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 + [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 + [749] choose_direction::$2 = choose_direction::open_directions#10 & UP + [750] if(0==choose_direction::$2) goto choose_direction::@1 + to:choose_direction::@5 +choose_direction::@5: scope:[choose_direction] from choose_direction + [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] + [752] if(choose_direction::dist_up#0>=$ff) goto choose_direction::@1 + to:choose_direction::@6 +choose_direction::@6: scope:[choose_direction] from choose_direction::@5 + [753] phi() + to:choose_direction::@1 +choose_direction::@1: scope:[choose_direction] from choose_direction choose_direction::@5 choose_direction::@6 + [754] choose_direction::direction#10 = phi( choose_direction/STOP, choose_direction::@5/STOP, choose_direction::@6/UP ) + [754] choose_direction::dist_min#6 = phi( choose_direction/$ff, choose_direction::@5/$ff, choose_direction::@6/choose_direction::dist_up#0 ) + [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN + [756] if(0==choose_direction::$4) goto choose_direction::@10 + to:choose_direction::@7 +choose_direction::@7: scope:[choose_direction] from choose_direction::@1 + [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] + [758] if(choose_direction::dist_down#0>=choose_direction::dist_min#6) goto choose_direction::@11 + to:choose_direction::@2 +choose_direction::@11: scope:[choose_direction] from choose_direction::@7 + [759] choose_direction::dist_min#14 = choose_direction::dist_min#6 + to:choose_direction::@2 +choose_direction::@2: scope:[choose_direction] from choose_direction::@10 choose_direction::@11 choose_direction::@7 + [760] choose_direction::direction#8 = phi( choose_direction::@10/choose_direction::direction#10, choose_direction::@11/choose_direction::direction#10, choose_direction::@7/DOWN ) + [760] choose_direction::dist_min#10 = phi( choose_direction::@10/choose_direction::dist_min#13, choose_direction::@11/choose_direction::dist_min#14, choose_direction::@7/choose_direction::dist_down#0 ) + [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT + [762] if(0==choose_direction::$6) goto choose_direction::@12 + to:choose_direction::@8 +choose_direction::@8: scope:[choose_direction] from choose_direction::@2 + [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] + [764] if(choose_direction::dist_left#0>=choose_direction::dist_min#10) goto choose_direction::@13 + to:choose_direction::@3 +choose_direction::@13: scope:[choose_direction] from choose_direction::@8 + [765] choose_direction::dist_min#18 = choose_direction::dist_min#10 + to:choose_direction::@3 +choose_direction::@3: scope:[choose_direction] from choose_direction::@12 choose_direction::@13 choose_direction::@8 + [766] choose_direction::dist_min#11 = phi( choose_direction::@8/choose_direction::dist_left#0, choose_direction::@12/choose_direction::dist_min#17, choose_direction::@13/choose_direction::dist_min#18 ) + [766] choose_direction::direction#6 = phi( choose_direction::@8/LEFT, choose_direction::@12/choose_direction::direction#8, choose_direction::@13/choose_direction::direction#8 ) + [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT + [768] if(0==choose_direction::$8) goto choose_direction::@4 + to:choose_direction::@9 +choose_direction::@9: scope:[choose_direction] from choose_direction::@3 + [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] + [770] if(choose_direction::dist_right#0>=choose_direction::dist_min#11) goto choose_direction::@14 + to:choose_direction::@4 +choose_direction::@14: scope:[choose_direction] from choose_direction::@9 + [771] phi() + to:choose_direction::@4 +choose_direction::@4: scope:[choose_direction] from choose_direction::@14 choose_direction::@3 choose_direction::@9 + [772] choose_direction::return#10 = phi( choose_direction::@14/choose_direction::direction#6, choose_direction::@9/RIGHT, choose_direction::@3/choose_direction::direction#6 ) + to:choose_direction::@return +choose_direction::@return: scope:[choose_direction] from choose_direction::@4 + [773] return + to:@return +choose_direction::@12: scope:[choose_direction] from choose_direction::@2 + [774] choose_direction::dist_min#17 = choose_direction::dist_min#10 + to:choose_direction::@3 +choose_direction::@10: scope:[choose_direction] from choose_direction::@1 + [775] choose_direction::dist_min#13 = choose_direction::dist_min#6 + to:choose_direction::@2 + +void* memset(void* memset::str , byte memset::c , word memset::num) +memset: scope:[memset] from splash_run::@16 splash_run::@23 splash_run::@24 splash_run::@28 splash_run::@34 + [776] memset::str#6 = phi( splash_run::@16/(void*) 16384, splash_run::@23/(void*)BANK_1+$2000, splash_run::@24/(void*)BANK_2, splash_run::@28/(void*)BANK_1, splash_run::@34/(void*)INTRO_MUSIC_CRUNCHED_UPPER ) + [776] memset::num#5 = phi( splash_run::@16/$c00, splash_run::@23/$1fff, splash_run::@24/$3fff, splash_run::@28/$1fff, splash_run::@34/INTRO_MUSIC_CRUNCHED_SIZE ) + [777] if(memset::num#5<=0) goto memset::@return + to:memset::@1 +memset::@1: scope:[memset] from memset + [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 + [779] memset::dst#4 = (byte*)memset::str#6 + to:memset::@2 +memset::@2: scope:[memset] from memset::@1 memset::@3 + [780] memset::dst#2 = phi( memset::@1/memset::dst#4, memset::@3/memset::dst#1 ) + [781] if(memset::dst#2!=memset::end#0) goto memset::@3 + to:memset::@return +memset::@return: scope:[memset] from memset memset::@2 + [782] return + to:@return +memset::@3: scope:[memset] from memset::@2 + [783] *memset::dst#2 = 0 + [784] memset::dst#1 = ++ memset::dst#2 + to:memset::@2 + +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +byteboozer_decrunch: scope:[byteboozer_decrunch] from done_run::@1 done_run::@7 gameplay_run::@6 splash_run::@20 splash_run::@21 splash_run::@26 splash_run::@30 splash_run::@33 + asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } + to:byteboozer_decrunch::@return +byteboozer_decrunch::@return: scope:[byteboozer_decrunch] from byteboozer_decrunch + [786] return + to:@return + +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +merge_code: scope:[merge_code] from splash_run::@22 + [787] phi() + to:merge_code::@1 +merge_code::@1: scope:[merge_code] from merge_code merge_code::@10 merge_code::@2 + [788] merge_code::logic_code#18 = phi( merge_code/LOGIC_CODE_UNMERGED, merge_code::@10/merge_code::logic_code#17, merge_code::@2/merge_code::logic_code#18 ) + [788] merge_code::dest_code#14 = phi( merge_code/RASTER_CODE, merge_code::@10/merge_code::dest_code#10, merge_code::@2/merge_code::dest_code#0 ) + [788] merge_code::raster_code#4 = phi( merge_code/RASTER_CODE_UNMERGED, merge_code::@10/merge_code::raster_code#2, merge_code::@2/merge_code::raster_code#0 ) + [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 + to:merge_code::@3 +merge_code::@3: scope:[merge_code] from merge_code::@1 + [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 + [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 + [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 + [793] if(merge_code::cycle_budget#0!=merge_code::RASTER_EXIT) goto merge_code::@4 + to:merge_code::@14 +merge_code::@14: scope:[merge_code] from merge_code::@19 merge_code::@3 + [794] merge_code::dest_code#12 = phi( merge_code::@19/merge_code::dest_code#13, merge_code::@3/merge_code::dest_code#14 ) + [794] merge_code::logic_code#12 = phi( merge_code::@19/merge_code::logic_code#5, merge_code::@3/merge_code::logic_code#18 ) + [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 + to:merge_code::@16 +merge_code::@16: scope:[merge_code] from merge_code::@14 + [796] *merge_code::dest_code#12 = $60 + to:merge_code::@return +merge_code::@return: scope:[merge_code] from merge_code::@16 + [797] return + to:@return +merge_code::@15: scope:[merge_code] from merge_code::@14 + [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 + to:merge_code::@17 +merge_code::@17: scope:[merge_code] from merge_code::@15 merge_code::@18 + [799] merge_code::dest_code#13 = phi( merge_code::@15/merge_code::dest_code#12, merge_code::@18/merge_code::dest_code#6 ) + [799] merge_code::logic_code#14 = phi( merge_code::@15/merge_code::logic_code#3, merge_code::@18/merge_code::logic_code#4 ) + [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 + to:merge_code::@19 +merge_code::@19: scope:[merge_code] from merge_code::@17 + [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 + to:merge_code::@14 +merge_code::@18: scope:[merge_code] from merge_code::@17 + [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 + [803] merge_code::dest_code#6 = ++ merge_code::dest_code#13 + [804] merge_code::logic_code#4 = ++ merge_code::logic_code#14 + to:merge_code::@17 +merge_code::@4: scope:[merge_code] from merge_code::@3 merge_code::@8 + [805] merge_code::dest_code#21 = phi( merge_code::@3/merge_code::dest_code#14, merge_code::@8/merge_code::dest_code#15 ) + [805] merge_code::logic_code#17 = phi( merge_code::@3/merge_code::logic_code#18, merge_code::@8/merge_code::logic_code#2 ) + [805] merge_code::cycle_budget#13 = phi( merge_code::@3/merge_code::cycle_budget#0, merge_code::@8/merge_code::cycle_budget#1 ) + [806] if(merge_code::cycle_budget#13<=0) goto merge_code::@10 + to:merge_code::@5 +merge_code::@5: scope:[merge_code] from merge_code::@4 + [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 + [808] merge_code::$5 = merge_code::cycle_budget#13 - 1 + [809] if(merge_code::logic_cycles#0!=merge_code::LOGIC_EXIT) goto merge_code::@20 + to:merge_code::@10 +merge_code::@10: scope:[merge_code] from merge_code::@12 merge_code::@13 merge_code::@21 merge_code::@4 merge_code::@5 + [810] merge_code::dest_code#10 = phi( merge_code::@12/merge_code::dest_code#3, merge_code::@13/merge_code::dest_code#4, merge_code::@4/merge_code::dest_code#21, merge_code::@5/merge_code::dest_code#21 ) + [810] merge_code::cycle_budget#10 = phi( merge_code::@12/merge_code::cycle_budget#2, merge_code::@13/merge_code::cycle_budget#3, merge_code::@4/merge_code::cycle_budget#13, merge_code::@5/merge_code::cycle_budget#13 ) + [811] if(merge_code::cycle_budget#10>0) goto merge_code::@11 + to:merge_code::@1 +merge_code::@11: scope:[merge_code] from merge_code::@10 + [812] if(merge_code::cycle_budget#10==3) goto merge_code::@12 + to:merge_code::@13 +merge_code::@13: scope:[merge_code] from merge_code::@11 + [813] *merge_code::dest_code#10 = $ea + [814] merge_code::dest_code#4 = ++ merge_code::dest_code#10 + [815] merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 + to:merge_code::@10 +merge_code::@12: scope:[merge_code] from merge_code::@11 + [816] *merge_code::dest_code#10 = $24 + [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 + [818] *merge_code::dest_code#2 = $ea + [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 + [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 + to:merge_code::@10 +merge_code::@20: scope:[merge_code] from merge_code::@5 + [821] if(merge_code::logic_cycles#0 init_render_index::canvas#0 + [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 + [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 + [859] init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 + [860] if(init_render_index::ypos_inc_offset#2<$17) goto init_render_index::@8 + to:init_render_index::@9 +init_render_index::@9: scope:[init_render_index] from init_render_index::@6 + [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 + to:init_render_index::@8 +init_render_index::@8: scope:[init_render_index] from init_render_index::@6 init_render_index::@9 + [862] init_render_index::ypos_inc_offset#8 = phi( init_render_index::@6/init_render_index::ypos_inc_offset#2, init_render_index::@9/init_render_index::ypos_inc_offset#3 ) + [863] init_render_index::render_index_xcol#1 = ++ init_render_index::render_index_xcol#2 + [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 + to:init_render_index::@5 + +void splash_show() +splash_show: scope:[splash_show] from splash_run::@27 + [865] phi() + to:splash_show::@1 +splash_show::@1: scope:[splash_show] from splash_show splash_show::@4 + [866] splash_show::splash#4 = phi( splash_show/SPLASH, splash_show::@4/splash_show::splash#2 ) + [866] splash_show::xcol#2 = phi( splash_show/0, splash_show::@4/splash_show::xcol#1 ) + [867] if(splash_show::xcol#2<$19) goto splash_show::@2 + to:splash_show::@return +splash_show::@return: scope:[splash_show] from splash_show::@1 + [868] return + to:@return +splash_show::@2: scope:[splash_show] from splash_show::@1 splash_show::@5 + [869] splash_show::splash#2 = phi( splash_show::@1/splash_show::splash#4, splash_show::@5/splash_show::splash#1 ) + [869] splash_show::ypos#2 = phi( splash_show::@1/0, splash_show::@5/splash_show::ypos#1 ) + [870] if(splash_show::ypos#2<$93) goto splash_show::@3 + to:splash_show::@4 +splash_show::@4: scope:[splash_show] from splash_show::@2 + [871] splash_show::xcol#1 = ++ splash_show::xcol#2 + to:splash_show::@1 +splash_show::@3: scope:[splash_show] from splash_show::@2 + [872] splash_show::pixels#0 = *splash_show::splash#2 + [873] splash_show::splash#1 = ++ splash_show::splash#2 + [874] render::xcol#1 = splash_show::xcol#2 + [875] render::ypos#1 = splash_show::ypos#2 + [876] render::pixels#1 = splash_show::pixels#0 + [877] call render + to:splash_show::@5 +splash_show::@5: scope:[splash_show] from splash_show::@3 + [878] splash_show::ypos#1 = ++ splash_show::ypos#2 + to:splash_show::@2 + +void init_bobs_restore() +init_bobs_restore: scope:[init_bobs_restore] from splash_run::@29 + [879] phi() + to:init_bobs_restore::@1 +init_bobs_restore::@1: scope:[init_bobs_restore] from init_bobs_restore init_bobs_restore::@5 + [880] init_bobs_restore::bob_restore#5 = phi( init_bobs_restore/bobs_restore, init_bobs_restore::@5/init_bobs_restore::bob_restore#1 ) + [880] init_bobs_restore::bob#2 = phi( init_bobs_restore/0, init_bobs_restore::@5/init_bobs_restore::bob#1 ) + [881] if(init_bobs_restore::bob#2init_bobs_restore::CANVAS_HIDDEN + [890] init_bobs_restore::bob_restore#5[3] = 0 + [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN + [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE + [893] init_bobs_restore::bob#1 = ++ init_bobs_restore::bob#2 + to:init_bobs_restore::@1 +init_bobs_restore::@4: scope:[init_bobs_restore] from init_bobs_restore::@3 + [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 + [895] init_bobs_restore::i#1 = ++ init_bobs_restore::i#2 + to:init_bobs_restore::@3 + +void init_sprite_pointers() +init_sprite_pointers: scope:[init_sprite_pointers] from gameplay_run::@15 splash_run::@31 + [896] phi() + to:init_sprite_pointers::@1 +init_sprite_pointers::@1: scope:[init_sprite_pointers] from init_sprite_pointers init_sprite_pointers::@4 + [897] init_sprite_pointers::sprites_ptr_2#5 = phi( init_sprite_pointers/SCREENS_2+OFFSET_SPRITE_PTRS, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_2#1 ) + [897] init_sprite_pointers::sprites_ptr_1#5 = phi( init_sprite_pointers/SCREENS_1+OFFSET_SPRITE_PTRS, init_sprite_pointers::@4/init_sprite_pointers::sprites_ptr_1#1 ) + [897] init_sprite_pointers::screen#2 = phi( init_sprite_pointers/0, init_sprite_pointers::@4/init_sprite_pointers::screen#1 ) + [898] if(init_sprite_pointers::screen#2<$e) goto init_sprite_pointers::@2 + to:init_sprite_pointers::@return +init_sprite_pointers::@return: scope:[init_sprite_pointers] from init_sprite_pointers::@1 + [899] return + to:@return +init_sprite_pointers::@2: scope:[init_sprite_pointers] from init_sprite_pointers::@1 init_sprite_pointers::@3 + [900] init_sprite_pointers::sprite#2 = phi( init_sprite_pointers::@1/0, init_sprite_pointers::@3/init_sprite_pointers::sprite#1 ) + [901] if(init_sprite_pointers::sprite#2<8) goto init_sprite_pointers::@3 + to:init_sprite_pointers::@4 +init_sprite_pointers::@4: scope:[init_sprite_pointers] from init_sprite_pointers::@2 + [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 + [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 + [904] init_sprite_pointers::screen#1 = ++ init_sprite_pointers::screen#2 + to:init_sprite_pointers::@1 +init_sprite_pointers::@3: scope:[init_sprite_pointers] from init_sprite_pointers::@2 + [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 + [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] + [907] init_sprite_pointers::sprites_ptr_1#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 + [908] init_sprite_pointers::sprites_ptr_2#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 + [909] init_sprite_pointers::sprite#1 = ++ init_sprite_pointers::sprite#2 + to:init_sprite_pointers::@2 + +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +memcpy: scope:[memcpy] from splash_run::@32 + [910] phi() + to:memcpy::@1 +memcpy::@1: scope:[memcpy] from memcpy memcpy::@2 + [911] memcpy::dst#2 = phi( memcpy/(byte*)memcpy::destination#0, memcpy::@2/memcpy::dst#1 ) + [911] memcpy::src#2 = phi( memcpy/(byte*)memcpy::source#0, memcpy::@2/memcpy::src#1 ) + [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 + to:memcpy::@return +memcpy::@return: scope:[memcpy] from memcpy::@1 + [913] return + to:@return +memcpy::@2: scope:[memcpy] from memcpy::@1 + [914] *memcpy::dst#2 = *memcpy::src#2 + [915] memcpy::dst#1 = ++ memcpy::dst#2 + [916] memcpy::src#1 = ++ memcpy::src#2 + to:memcpy::@1 + +void joyinit() +joyinit: scope:[joyinit] from splash_run::@19 + [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 + to:joyinit::@return +joyinit::@return: scope:[joyinit] from joyinit + [918] return + to:@return + +byte joyfire() +joyfire: scope:[joyfire] from done_run::@13 splash_run::@13 + [919] joyfire::$0 = *((byte*)CIA1) & $10 + [920] if(joyfire::$0==0) goto joyfire::@1 + to:joyfire::@return +joyfire::@1: scope:[joyfire] from joyfire + [921] phi() + to:joyfire::@return +joyfire::@return: scope:[joyfire] from joyfire joyfire::@1 + [922] joyfire::return#4 = phi( joyfire::@1/1, joyfire/0 ) + [923] return + to:@return + +void init_level_tile_directions() +init_level_tile_directions: scope:[init_level_tile_directions] from gameplay_run::@14 + [924] phi() + to:init_level_tile_directions::@1 +init_level_tile_directions::@1: scope:[init_level_tile_directions] from init_level_tile_directions init_level_tile_directions::@4 + [925] init_level_tile_directions::directions#7 = phi( init_level_tile_directions/LEVEL_TILES_DIRECTIONS, init_level_tile_directions::@4/init_level_tile_directions::directions#1 ) + [925] init_level_tile_directions::ytile#15 = phi( init_level_tile_directions/0, init_level_tile_directions::@4/init_level_tile_directions::ytile#1 ) + [926] if(init_level_tile_directions::ytile#15<$25) goto init_level_tile_directions::@2 + to:init_level_tile_directions::@return +init_level_tile_directions::@return: scope:[init_level_tile_directions] from init_level_tile_directions::@1 + [927] return + to:@return +init_level_tile_directions::@2: scope:[init_level_tile_directions] from init_level_tile_directions::@1 init_level_tile_directions::@8 + [928] init_level_tile_directions::xtile#10 = phi( init_level_tile_directions::@1/0, init_level_tile_directions::@8/init_level_tile_directions::xtile#1 ) + [929] if(init_level_tile_directions::xtile#10<$32) goto init_level_tile_directions::@3 + to:init_level_tile_directions::@4 +init_level_tile_directions::@4: scope:[init_level_tile_directions] from init_level_tile_directions::@2 + [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 + [931] init_level_tile_directions::ytile#1 = ++ init_level_tile_directions::ytile#15 + to:init_level_tile_directions::@1 +init_level_tile_directions::@3: scope:[init_level_tile_directions] from init_level_tile_directions::@2 + [932] level_tile_get::xtile#0 = init_level_tile_directions::xtile#10 - 1 + [933] level_tile_get::ytile#0 = init_level_tile_directions::ytile#15 + [934] call level_tile_get + [935] level_tile_get::return#3 = level_tile_get::return#2 + to:init_level_tile_directions::@13 +init_level_tile_directions::@13: scope:[init_level_tile_directions] from init_level_tile_directions::@3 + [936] init_level_tile_directions::$3 = level_tile_get::return#3 + [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 + to:init_level_tile_directions::@9 +init_level_tile_directions::@9: scope:[init_level_tile_directions] from init_level_tile_directions::@13 + [938] phi() + to:init_level_tile_directions::@5 +init_level_tile_directions::@5: scope:[init_level_tile_directions] from init_level_tile_directions::@13 init_level_tile_directions::@9 + [939] init_level_tile_directions::open_directions#11 = phi( init_level_tile_directions::@9/LEFT, init_level_tile_directions::@13/0 ) + [940] level_tile_get::xtile#1 = init_level_tile_directions::xtile#10 + 1 + [941] level_tile_get::ytile#1 = init_level_tile_directions::ytile#15 + [942] call level_tile_get + [943] level_tile_get::return#4 = level_tile_get::return#2 + to:init_level_tile_directions::@14 +init_level_tile_directions::@14: scope:[init_level_tile_directions] from init_level_tile_directions::@5 + [944] init_level_tile_directions::$7 = level_tile_get::return#4 + [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 + to:init_level_tile_directions::@10 +init_level_tile_directions::@10: scope:[init_level_tile_directions] from init_level_tile_directions::@14 + [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT + to:init_level_tile_directions::@6 +init_level_tile_directions::@6: scope:[init_level_tile_directions] from init_level_tile_directions::@10 init_level_tile_directions::@14 + [947] init_level_tile_directions::open_directions#12 = phi( init_level_tile_directions::@10/init_level_tile_directions::open_directions#2, init_level_tile_directions::@14/init_level_tile_directions::open_directions#11 ) + [948] level_tile_get::ytile#2 = init_level_tile_directions::ytile#15 - 1 + [949] level_tile_get::xtile#2 = init_level_tile_directions::xtile#10 + [950] call level_tile_get + [951] level_tile_get::return#10 = level_tile_get::return#2 + to:init_level_tile_directions::@15 +init_level_tile_directions::@15: scope:[init_level_tile_directions] from init_level_tile_directions::@6 + [952] init_level_tile_directions::$11 = level_tile_get::return#10 + [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 + to:init_level_tile_directions::@11 +init_level_tile_directions::@11: scope:[init_level_tile_directions] from init_level_tile_directions::@15 + [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP + to:init_level_tile_directions::@7 +init_level_tile_directions::@7: scope:[init_level_tile_directions] from init_level_tile_directions::@11 init_level_tile_directions::@15 + [955] init_level_tile_directions::open_directions#13 = phi( init_level_tile_directions::@11/init_level_tile_directions::open_directions#3, init_level_tile_directions::@15/init_level_tile_directions::open_directions#12 ) + [956] level_tile_get::ytile#3 = init_level_tile_directions::ytile#15 + 1 + [957] level_tile_get::xtile#3 = init_level_tile_directions::xtile#10 + [958] call level_tile_get + [959] level_tile_get::return#11 = level_tile_get::return#2 + to:init_level_tile_directions::@16 +init_level_tile_directions::@16: scope:[init_level_tile_directions] from init_level_tile_directions::@7 + [960] init_level_tile_directions::$15 = level_tile_get::return#11 + [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 + to:init_level_tile_directions::@12 +init_level_tile_directions::@12: scope:[init_level_tile_directions] from init_level_tile_directions::@16 + [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN + to:init_level_tile_directions::@8 +init_level_tile_directions::@8: scope:[init_level_tile_directions] from init_level_tile_directions::@12 init_level_tile_directions::@16 + [963] init_level_tile_directions::open_directions#8 = phi( init_level_tile_directions::@12/init_level_tile_directions::open_directions#4, init_level_tile_directions::@16/init_level_tile_directions::open_directions#13 ) + [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 + [965] init_level_tile_directions::xtile#1 = ++ init_level_tile_directions::xtile#10 + to:init_level_tile_directions::@2 + +word level_show() +level_show: scope:[level_show] from gameplay_run::@16 + [966] phi() + to:level_show::@1 +level_show::@1: scope:[level_show] from level_show level_show::@4 + [967] level_show::level#8 = phi( level_show/LEVEL_TILES, level_show::@4/level_show::level#1 ) + [967] level_show::count#12 = phi( level_show/0, level_show::@4/level_show::count#10 ) + [967] level_show::ytile#2 = phi( level_show/0, level_show::@4/level_show::ytile#1 ) + [968] if(level_show::ytile#2<$25) goto level_show::@2 + to:level_show::@return +level_show::@return: scope:[level_show] from level_show::@1 + [969] return + to:@return +level_show::@2: scope:[level_show] from level_show::@1 level_show::@9 + [970] level_show::count#10 = phi( level_show::@9/level_show::count#11, level_show::@1/level_show::count#12 ) + [970] level_show::xtile#3 = phi( level_show::@9/level_show::xtile#2, level_show::@1/0 ) + [970] level_show::xcol#2 = phi( level_show::@9/level_show::xcol#1, level_show::@1/0 ) + [971] if(level_show::xcol#2<$19) goto level_show::@3 + to:level_show::@4 +level_show::@4: scope:[level_show] from level_show::@2 + [972] level_show::level#1 = level_show::level#8 + $40 + [973] level_show::ytile#1 = ++ level_show::ytile#2 + to:level_show::@1 +level_show::@3: scope:[level_show] from level_show::@2 + [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] + [975] level_show::xtile#1 = ++ level_show::xtile#3 + [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 + to:level_show::@7 +level_show::@7: scope:[level_show] from level_show::@3 + [977] level_show::count#1 = ++ level_show::count#10 + to:level_show::@5 +level_show::@5: scope:[level_show] from level_show::@3 level_show::@7 + [978] level_show::count#5 = phi( level_show::@3/level_show::count#10, level_show::@7/level_show::count#1 ) + [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] + [980] level_show::xtile#2 = ++ level_show::xtile#1 + [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 + to:level_show::@8 +level_show::@8: scope:[level_show] from level_show::@5 + [982] level_show::count#2 = ++ level_show::count#5 + to:level_show::@6 +level_show::@6: scope:[level_show] from level_show::@5 level_show::@8 + [983] level_show::count#11 = phi( level_show::@8/level_show::count#2, level_show::@5/level_show::count#5 ) + [984] render_tiles::xcol#0 = level_show::xcol#2 + [985] render_tiles::ytile#0 = level_show::ytile#2 + [986] render_tiles::tile_left#0 = level_show::tile_left#0 + [987] render_tiles::tile_right#0 = level_show::tile_right#0 + [988] call render_tiles + to:level_show::@9 +level_show::@9: scope:[level_show] from level_show::@6 + [989] level_show::xcol#1 = ++ level_show::xcol#2 + to:level_show::@2 + +void pacman_sound_init() +pacman_sound_init: scope:[pacman_sound_init] from gameplay_run::@18 + [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f + [991] *((word*)SID) = 0 + [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 + [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 + [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 + [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 + to:pacman_sound_init::@return +pacman_sound_init::@return: scope:[pacman_sound_init] from pacman_sound_init + [996] return + to:@return + +void render(byte render::xcol , byte render::ypos , byte render::pixels) +render: scope:[render] from done_run::@11 splash_show::@3 + [997] render::pixels#4 = phi( done_run::@11/render::pixels#0, splash_show::@3/render::pixels#1 ) + [997] render::xcol#2 = phi( done_run::@11/render::xcol#0, splash_show::@3/render::xcol#1 ) + [997] render::ypos#2 = phi( done_run::@11/render::ypos#0, splash_show::@3/render::ypos#1 ) + [998] render::ytile#0 = render::ypos#2 >> 2 + [999] render::$1 = >RENDER_INDEX + render::xcol#2 + [1000] render::$2 = render::ytile#0 << 1 + [1001] render::render_index_xcol#0 = render::$1 w= render::$2 + [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) + [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 + [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 + [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] + [1006] render::ypix#0 = render::ypos#2 & 3 + to:render::@1 +render::@1: scope:[render] from render render::@2 + [1007] render::canvas2#2 = phi( render/render::canvas2#0, render::@2/render::canvas2#1 ) + [1007] render::ypos_inc_offset#2 = phi( render/render::ypos_inc_offset#0, render::@2/render::ypos_inc_offset#1 ) + [1007] render::canvas1#2 = phi( render/render::canvas1#0, render::@2/render::canvas1#1 ) + [1007] render::i#2 = phi( render/0, render::@2/render::i#1 ) + [1008] if(render::i#2=$31+1) goto level_tile_get::@return + to:level_tile_get::@2 +level_tile_get::@2: scope:[level_tile_get] from level_tile_get + [1018] if(level_tile_get::ytile#4>=$24+1) goto level_tile_get::@return + to:level_tile_get::@1 +level_tile_get::@1: scope:[level_tile_get] from level_tile_get::@2 + [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 + [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] + [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] + to:level_tile_get::@return +level_tile_get::@return: scope:[level_tile_get] from level_tile_get level_tile_get::@1 level_tile_get::@2 + [1022] level_tile_get::return#2 = phi( level_tile_get::@1/level_tile_get::return#0, level_tile_get/0, level_tile_get::@2/0 ) + [1023] return + to:@return + +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +render_tiles: scope:[render_tiles] from level_show::@6 + [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 + [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 + [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 + [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 + [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 + [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 + [1030] render_tiles::render_index_xcol#0 = render_tiles::$4 w= render_tiles::$5 + [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) + [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 + [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 + [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] + to:render_tiles::@1 +render_tiles::@1: scope:[render_tiles] from render_tiles render_tiles::@2 + [1035] render_tiles::ypos_inc_offset#2 = phi( render_tiles/render_tiles::ypos_inc_offset#0, render_tiles::@2/render_tiles::ypos_inc_offset#1 ) + [1035] render_tiles::canvas2#2 = phi( render_tiles/render_tiles::canvas2#0, render_tiles::@2/render_tiles::canvas2#1 ) + [1035] render_tiles::canvas1#2 = phi( render_tiles/render_tiles::canvas1#0, render_tiles::@2/render_tiles::canvas1#1 ) + [1035] render_tiles::y#2 = phi( render_tiles/0, render_tiles::@2/render_tiles::y#1 ) + [1036] if(render_tiles::y#2<4) goto render_tiles::@2 + to:render_tiles::@return +render_tiles::@return: scope:[render_tiles] from render_tiles::@1 + [1037] return + to:@return +render_tiles::@2: scope:[render_tiles] from render_tiles::@1 + [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] + [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 + [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 + [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] + [1043] render_tiles::ypos_inc_offset#1 = ++ render_tiles::ypos_inc_offset#2 + [1044] render_tiles::y#1 = ++ render_tiles::y#2 + to:render_tiles::@1 + + +VARIABLE REGISTER WEIGHTS +void __start() +volatile byte anim_frame_idx loadstore 0.9019607843137255 +volatile byte bobs_restore_base loadstore 1070.0 +volatile byte bottom_sprites_color loadstore 11040.0 +volatile byte bottom_sprites_mc loadstore 11040.0 +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +volatile byte* byteboozer_decrunch::crunched loadstore 438.5 +volatile byte canvas_base_hi loadstore 1070.0 +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +byte~ choose_direction::$2 202.0 +byte~ choose_direction::$4 202.0 +byte~ choose_direction::$6 202.0 +byte~ choose_direction::$8 202.0 +byte choose_direction::direction +byte choose_direction::direction#10 28.857142857142858 +byte choose_direction::direction#6 67.33333333333333 +byte choose_direction::direction#8 57.714285714285715 +byte choose_direction::dist_down +byte choose_direction::dist_down#0 151.5 +byte choose_direction::dist_left +byte choose_direction::dist_left#0 151.5 +byte choose_direction::dist_min +byte choose_direction::dist_min#10 121.2 +byte choose_direction::dist_min#11 101.0 +byte choose_direction::dist_min#13 202.0 +byte choose_direction::dist_min#14 202.0 +byte choose_direction::dist_min#17 202.0 +byte choose_direction::dist_min#18 202.0 +byte choose_direction::dist_min#6 80.8 +byte choose_direction::dist_right +byte choose_direction::dist_right#0 202.0 +byte choose_direction::dist_up +byte choose_direction::dist_up#0 101.0 +byte choose_direction::ghost_xtile +byte choose_direction::ghost_xtile#0 5.5 +byte choose_direction::ghost_xtile#1 5.5 +byte choose_direction::ghost_xtile#2 5.5 +byte choose_direction::ghost_xtile#3 5.5 +byte choose_direction::ghost_xtile#4 145.0 +byte choose_direction::ghost_ytile +byte choose_direction::ghost_ytile#0 7.333333333333333 +byte choose_direction::ghost_ytile#1 7.333333333333333 +byte choose_direction::ghost_ytile#2 7.333333333333333 +byte choose_direction::ghost_ytile#3 7.333333333333333 +byte choose_direction::ghost_ytile#4 72.5 +byte choose_direction::open_directions +byte choose_direction::open_directions#0 4.4 +byte choose_direction::open_directions#1 4.4 +byte choose_direction::open_directions#10 19.478260869565215 +byte choose_direction::open_directions#2 4.4 +byte choose_direction::open_directions#3 4.4 +byte choose_direction::return +byte choose_direction::return#0 22.0 +byte choose_direction::return#1 22.0 +byte choose_direction::return#10 41.0 +byte choose_direction::return#2 22.0 +byte choose_direction::return#3 22.0 +byte choose_direction::target_xtile +byte choose_direction::target_xtile#0 11.0 +byte choose_direction::target_xtile#1 11.0 +byte choose_direction::target_xtile#2 11.0 +byte choose_direction::target_xtile#3 11.0 +byte choose_direction::target_xtile#4 145.0 +byte choose_direction::target_ytile +byte choose_direction::target_ytile#0 22.0 +byte choose_direction::target_ytile#1 22.0 +byte choose_direction::target_ytile#2 22.0 +byte choose_direction::target_ytile#3 22.0 +byte choose_direction::target_ytile#4 72.5 +byte choose_direction::xdiff +byte choose_direction::xdiff#0 21.041666666666664 +byte choose_direction::ydiff +byte choose_direction::ydiff#0 21.956521739130434 +void done_run() +byte~ done_run::$8 2000002.0 +byte* done_run::gfx +byte* done_run::gfx#1 333333.6666666667 +byte* done_run::gfx#2 800001.25 +byte* done_run::gfx#4 100001.0 +byte done_run::i +byte done_run::i#1 200002.0 +byte done_run::i#2 133334.66666666666 +byte done_run::i1 +byte done_run::i1#1 200002.0 +byte done_run::i1#2 120001.2 +byte done_run::pixels +byte done_run::pixels#0 500000.5 +byte done_run::xcol +byte done_run::xcol#1 200002.0 +byte done_run::xcol#2 118182.18181818182 +byte done_run::ypos +byte done_run::ypos#1 2000002.0 +byte done_run::ypos#2 500000.5 +volatile byte frame loadstore 0.5 +void game_logic() +byte~ game_logic::$119 22.0 +byte~ game_logic::$14 22.0 +byte~ game_logic::$140 22.0 +byte~ game_logic::$15 22.0 +byte~ game_logic::$161 22.0 +byte~ game_logic::$17 22.0 +byte~ game_logic::$18 22.0 +byte~ game_logic::$182 22.0 +byte~ game_logic::$19 11.0 +byte~ game_logic::$199 22.0 +byte~ game_logic::$2 22.0 +byte~ game_logic::$20 22.0 +byte~ game_logic::$200 22.0 +byte~ game_logic::$204 22.0 +byte~ game_logic::$21 22.0 +byte~ game_logic::$210 2.588235294117647 +byte~ game_logic::$220 11.0 +byte~ game_logic::$223 11.0 +byte~ game_logic::$226 11.0 +byte~ game_logic::$229 11.0 +byte~ game_logic::$232 11.0 +byte~ game_logic::$25 22.0 +byte~ game_logic::$26 22.0 +byte~ game_logic::$27 11.0 +byte~ game_logic::$28 22.0 +byte~ game_logic::$29 22.0 +byte~ game_logic::$3 22.0 +byte~ game_logic::$31 22.0 +byte~ game_logic::$32 22.0 +byte~ game_logic::$33 11.0 +byte~ game_logic::$34 22.0 +byte~ game_logic::$35 22.0 +byte~ game_logic::$37 22.0 +byte~ game_logic::$38 22.0 +byte~ game_logic::$39 11.0 +byte~ game_logic::$40 22.0 +byte~ game_logic::$41 22.0 +byte~ game_logic::$43 22.0 +byte~ game_logic::$44 22.0 +byte~ game_logic::$45 11.0 +byte~ game_logic::$46 22.0 +byte~ game_logic::$47 22.0 +byte~ game_logic::$65 22.0 +byte~ game_logic::$66 22.0 +byte*~ game_logic::$67 22.0 +byte~ game_logic::$68 22.0 +byte~ game_logic::$69 22.0 +byte~ game_logic::$70 22.0 +byte*~ game_logic::$71 22.0 +byte~ game_logic::$72 22.0 +byte~ game_logic::$75 11.0 +byte~ game_logic::$77 11.0 +byte~ game_logic::$80 11.0 +byte~ game_logic::$82 11.0 +byte~ game_logic::$85 11.0 +byte~ game_logic::$87 11.0 +byte~ game_logic::$90 11.0 +byte~ game_logic::$92 11.0 +byte game_logic::do_reverse +byte game_logic::do_reverse#4 11.0 +byte game_logic::ghost1_bob_xfine +byte game_logic::ghost1_bob_xfine#0 5.5 +byte game_logic::ghost1_xtile +byte game_logic::ghost1_xtile#0 2.357142857142857 +byte game_logic::ghost1_ytile +byte game_logic::ghost1_ytile#0 2.357142857142857 +byte game_logic::ghost2_bob_xfine +byte game_logic::ghost2_bob_xfine#0 5.5 +byte game_logic::ghost2_xtile +byte game_logic::ghost2_xtile#0 2.357142857142857 +byte game_logic::ghost2_ytile +byte game_logic::ghost2_ytile#0 2.357142857142857 +byte game_logic::ghost3_bob_xfine +byte game_logic::ghost3_bob_xfine#0 5.5 +byte game_logic::ghost3_xtile +byte game_logic::ghost3_xtile#0 2.357142857142857 +byte game_logic::ghost3_ytile +byte game_logic::ghost3_ytile#0 2.357142857142857 +byte game_logic::ghost4_bob_xfine +byte game_logic::ghost4_bob_xfine#0 5.5 +byte game_logic::ghost4_xtile +byte game_logic::ghost4_xtile#0 2.357142857142857 +byte game_logic::ghost4_ytile +byte game_logic::ghost4_ytile#0 2.357142857142857 +byte game_logic::ghost_frame_idx +byte game_logic::ghost_frame_idx#0 16.5 +byte game_logic::ghost_frame_idx#1 22.0 +byte game_logic::ghost_frame_idx#2 1.9999999999999998 +byte game_logic::joy_directions +byte game_logic::joy_directions#0 16.5 +byte game_logic::new_direction +byte game_logic::new_direction#0 16.5 +byte game_logic::open_directions +byte game_logic::open_directions#0 22.0 +byte game_logic::open_directions#1 5.5 +byte game_logic::open_directions1 +byte game_logic::open_directions1#0 22.0 +byte game_logic::open_directions1#1 5.5 +byte game_logic::open_directions2 +byte game_logic::open_directions2#0 22.0 +byte game_logic::open_directions2#1 5.5 +byte game_logic::open_directions3 +byte game_logic::open_directions3#0 22.0 +byte game_logic::open_directions3#1 5.5 +byte game_logic::open_directions4 +byte game_logic::open_directions4#0 3.666666666666667 +byte game_logic::pacman_bob_xfine +byte game_logic::pacman_bob_xfine#0 5.5 +byte game_logic::pacman_xtile +byte game_logic::pacman_xtile#0 6.769230769230768 +byte game_logic::pacman_xtile1 +byte game_logic::pacman_xtile1#0 11.0 +byte game_logic::pacman_ytile +byte game_logic::pacman_ytile#0 22.0 +byte game_logic::pacman_ytile1 +byte game_logic::pacman_ytile1#0 11.0 +byte game_logic::target_xtile +byte game_logic::target_xtile#2 11.0 +byte game_logic::target_xtile#3 5.5 +byte game_logic::target_xtile1 +byte game_logic::target_xtile1#2 11.0 +byte game_logic::target_xtile1#3 5.5 +byte game_logic::target_xtile2 +byte game_logic::target_xtile2#2 11.0 +byte game_logic::target_xtile2#3 5.5 +byte game_logic::target_xtile3 +byte game_logic::target_xtile3#2 11.0 +byte game_logic::target_xtile3#3 5.5 +byte game_logic::target_ytile +byte game_logic::target_ytile#2 22.0 +byte game_logic::target_ytile#3 4.4 +byte game_logic::target_ytile1 +byte game_logic::target_ytile1#2 22.0 +byte game_logic::target_ytile1#3 4.4 +byte game_logic::target_ytile2 +byte game_logic::target_ytile2#2 22.0 +byte game_logic::target_ytile2#3 4.4 +byte game_logic::target_ytile3 +byte game_logic::target_ytile3#2 22.0 +byte game_logic::target_ytile3#3 4.4 +byte game_logic::tile_id +byte game_logic::tile_id#0 16.5 +byte* game_logic::ytiles +byte* game_logic::ytiles#0 5.5 +volatile byte game_logic_substep loadstore 2.947368421052632 +volatile byte game_playable loadstore 69.48275862068965 +void gameplay_run() +word~ gameplay_run::$4 2002.0 +byte gameplay_run::i +byte gameplay_run::i#1 200002.0 +byte gameplay_run::i#2 133334.66666666666 +byte gameplay_run::i1 +byte gameplay_run::i1#1 200002.0 +byte gameplay_run::i1#2 133334.66666666666 +byte gameplay_run::i2 +byte gameplay_run::i2#1 200002.0 +byte gameplay_run::i2#2 133334.66666666666 +volatile byte ghost1_direction loadstore 122.24096385542168 +volatile byte ghost1_respawn loadstore 271.8378378378378 +volatile byte ghost1_reverse loadstore 0.7291666666666666 +volatile byte ghost1_substep loadstore 223.51111111111112 +volatile byte ghost1_xfine loadstore 84.55 +volatile byte ghost1_yfine loadstore 82.13008130081302 +volatile byte ghost2_direction loadstore 110.28260869565217 +volatile byte ghost2_respawn loadstore 264.6842105263158 +volatile byte ghost2_reverse loadstore 0.7142857142857143 +volatile byte ghost2_substep loadstore 218.65217391304347 +volatile byte ghost2_xfine loadstore 76.28571428571428 +volatile byte ghost2_yfine loadstore 74.27941176470588 +volatile byte ghost3_direction loadstore 100.45544554455446 +volatile byte ghost3_respawn loadstore 257.8974358974359 +volatile byte ghost3_reverse loadstore 0.7 +volatile byte ghost3_substep loadstore 214.0 +volatile byte ghost3_xfine loadstore 69.4931506849315 +volatile byte ghost3_yfine loadstore 67.7986577181208 +volatile byte ghost4_direction loadstore 92.23636363636363 +volatile byte ghost4_respawn loadstore 251.45000000000002 +volatile byte ghost4_reverse loadstore 0.6862745098039216 +volatile byte ghost4_substep loadstore 209.54166666666666 +volatile byte ghost4_xfine loadstore 63.81132075471698 +volatile byte ghost4_yfine loadstore 62.358024691358025 +volatile byte ghosts_mode loadstore 1.1044776119402984 +volatile byte ghosts_mode_count loadstore 234.93023255813955 +void init_bobs_restore() +byte init_bobs_restore::bob +byte init_bobs_restore::bob#1 20002.0 +byte init_bobs_restore::bob#2 2727.5454545454545 +byte* init_bobs_restore::bob_restore +byte* init_bobs_restore::bob_restore#1 10001.0 +byte* init_bobs_restore::bob_restore#5 16000.7 +byte init_bobs_restore::i +byte init_bobs_restore::i#1 200002.0 +byte init_bobs_restore::i#2 133334.66666666666 +void init_level_tile_directions() +byte~ init_level_tile_directions::$11 2.0000002E7 +byte~ init_level_tile_directions::$15 2.0000002E7 +byte~ init_level_tile_directions::$3 2.0000002E7 +byte~ init_level_tile_directions::$7 2.0000002E7 +byte* init_level_tile_directions::directions +byte* init_level_tile_directions::directions#1 1000001.0 +byte* init_level_tile_directions::directions#7 315789.55263157893 +byte init_level_tile_directions::open_directions +byte init_level_tile_directions::open_directions#11 2857143.1428571427 +byte init_level_tile_directions::open_directions#12 5714286.285714285 +byte init_level_tile_directions::open_directions#13 5714286.285714285 +byte init_level_tile_directions::open_directions#2 2.0000002E7 +byte init_level_tile_directions::open_directions#3 2.0000002E7 +byte init_level_tile_directions::open_directions#4 2.0000002E7 +byte init_level_tile_directions::open_directions#8 3.0000003E7 +byte init_level_tile_directions::xtile +byte init_level_tile_directions::xtile#1 2.0000002E7 +byte init_level_tile_directions::xtile#10 2285714.514285714 +byte init_level_tile_directions::ytile +byte init_level_tile_directions::ytile#1 2000002.0 +byte init_level_tile_directions::ytile#15 1102564.282051282 +void init_render_index() +word~ init_render_index::$10 200002.0 +word~ init_render_index::$11 200002.0 +word*~ init_render_index::$12 200002.0 +byte~ init_render_index::$5 200002.0 +byte~ init_render_index::$6 200002.0 +byte~ init_render_index::$9 20002.0 +byte* init_render_index::canvas +byte* init_render_index::canvas#0 100001.0 +byte* init_render_index::canvas_xcol +byte* init_render_index::canvas_xcol#0 5789.578947368421 +byte* init_render_index::render_index +byte* init_render_index::render_index#1 10001.0 +byte* init_render_index::render_index_xcol +byte* init_render_index::render_index_xcol#0 1200.1200000000001 +byte* init_render_index::render_index_xcol#1 100001.0 +byte* init_render_index::render_index_xcol#2 34000.4 +byte* init_render_index::render_index_xcol#7 20002.0 +word* init_render_index::render_ypos_table +word* init_render_index::render_ypos_table#4 4761.952380952381 +byte init_render_index::x_col +byte init_render_index::x_col#1 20002.0 +byte init_render_index::x_col#2 1923.2692307692307 +byte init_render_index::y_pos +byte init_render_index::y_pos#1 200002.0 +byte init_render_index::y_pos#2 18750.1875 +byte init_render_index::ypos_inc_offset +byte init_render_index::ypos_inc_offset#2 200002.0 +byte init_render_index::ypos_inc_offset#3 200002.0 +byte init_render_index::ypos_inc_offset#4 28182.181818181816 +byte init_render_index::ypos_inc_offset#7 2500.25 +byte init_render_index::ypos_inc_offset#8 100001.0 +void init_sprite_pointers() +byte~ init_sprite_pointers::$2 2.0000002E7 +byte init_sprite_pointers::screen +byte init_sprite_pointers::screen#1 2000002.0 +byte init_sprite_pointers::screen#2 1181818.5454545454 +byte init_sprite_pointers::sprite +byte init_sprite_pointers::sprite#1 2.0000002E7 +byte init_sprite_pointers::sprite#2 1.0000001E7 +byte init_sprite_pointers::sprite_id +byte init_sprite_pointers::sprite_id#0 1.50000015E7 +byte* init_sprite_pointers::sprites_ptr_1 +byte* init_sprite_pointers::sprites_ptr_1#1 666667.3333333334 +byte* init_sprite_pointers::sprites_ptr_1#5 1333333.6666666667 +byte* init_sprite_pointers::sprites_ptr_2 +byte* init_sprite_pointers::sprites_ptr_2#1 1000001.0 +byte* init_sprite_pointers::sprites_ptr_2#5 1200000.3 +__interrupt(hardware_clobber) void irq_screen_top() +byte~ irq_screen_top::$1 4.0 +byte~ irq_screen_top::$2 4.0 +byte* irq_screen_top::toD0181_gfx +byte irq_screen_top::toD0181_return +byte* irq_screen_top::toD0181_screen +byte* irq_screen_top::toDd001_gfx +byte irq_screen_top::toDd001_return +byte* irq_screen_top::toDd002_gfx +byte irq_screen_top::toDd002_return +byte joyfire() +byte~ joyfire::$0 2.0000002E7 +byte joyfire::return +byte joyfire::return#0 2000002.0 +byte joyfire::return#1 20002.0 +byte joyfire::return#4 252500.5 +void joyinit() +volatile byte* left_canvas loadstore 20.0 +volatile byte* left_render_index_xcol loadstore 20.0 +volatile byte left_ypos_inc_offset loadstore 20.0 +word level_show() +word level_show::count +word level_show::count#1 2.0000002E7 +word level_show::count#10 4571429.285714285 +word level_show::count#11 4285714.714285715 +word level_show::count#12 500250.75 +word level_show::count#2 2.0000002E7 +word level_show::count#5 1.0000001E7 +byte* level_show::level +byte* level_show::level#1 1000001.0 +byte* level_show::level#8 1100000.2 +word level_show::return +word level_show::return#0 2002.0 +byte level_show::tile_left +byte level_show::tile_left#0 2500000.25 +byte level_show::tile_right +byte level_show::tile_right#0 3750000.375 +byte level_show::xcol +byte level_show::xcol#1 2.0000002E7 +byte level_show::xcol#2 2352941.411764706 +byte level_show::xtile +byte level_show::xtile#1 6000000.6 +byte level_show::xtile#2 2000000.2 +byte level_show::xtile#3 1.0000001E7 +byte level_show::ytile +byte level_show::ytile#1 2000002.0 +byte level_show::ytile#2 619047.8095238095 +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +byte~ level_tile_directions::$5 202.0 +byte level_tile_directions::return +byte level_tile_directions::return#0 202.0 +byte level_tile_directions::return#10 22.0 +byte level_tile_directions::return#11 22.0 +byte level_tile_directions::return#12 22.0 +byte level_tile_directions::return#13 22.0 +byte level_tile_directions::return#2 22.285714285714285 +byte level_tile_directions::return#3 22.0 +byte level_tile_directions::xtile +byte level_tile_directions::xtile#0 11.0 +byte level_tile_directions::xtile#1 11.0 +byte level_tile_directions::xtile#2 11.0 +byte level_tile_directions::xtile#3 11.0 +byte level_tile_directions::xtile#4 11.0 +byte level_tile_directions::xtile#5 51.4 +byte level_tile_directions::ytile +byte level_tile_directions::ytile#0 22.0 +byte level_tile_directions::ytile#1 22.0 +byte level_tile_directions::ytile#2 22.0 +byte level_tile_directions::ytile#3 22.0 +byte level_tile_directions::ytile#4 22.0 +byte level_tile_directions::ytile#5 85.66666666666666 +byte* level_tile_directions::ytiles +byte* level_tile_directions::ytiles#0 202.0 +byte level_tile_get(byte level_tile_get::xtile , byte level_tile_get::ytile) +byte~ level_tile_get::$5 2.00000002E8 +byte level_tile_get::return +byte level_tile_get::return#0 2.00000002E8 +byte level_tile_get::return#10 2.0000002E7 +byte level_tile_get::return#11 2.0000002E7 +byte level_tile_get::return#2 2.3333334166666668E7 +byte level_tile_get::return#3 2.0000002E7 +byte level_tile_get::return#4 2.0000002E7 +byte level_tile_get::xtile +byte level_tile_get::xtile#0 1.0000001E7 +byte level_tile_get::xtile#1 1.0000001E7 +byte level_tile_get::xtile#2 2.0000002E7 +byte level_tile_get::xtile#3 2.0000002E7 +byte level_tile_get::xtile#4 4.80000012E7 +byte level_tile_get::ytile +byte level_tile_get::ytile#0 2.0000002E7 +byte level_tile_get::ytile#1 2.0000002E7 +byte level_tile_get::ytile#2 1.0000001E7 +byte level_tile_get::ytile#3 1.0000001E7 +byte level_tile_get::ytile#4 8.0000002E7 +byte* level_tile_get::ytiles +byte* level_tile_get::ytiles#0 2.00000002E8 +volatile byte logic_tile_left_idx loadstore 20.0 +volatile to_volatile byte* logic_tile_ptr loadstore 10250.0 +volatile byte logic_tile_right_idx loadstore 20.0 +volatile byte logic_tile_xcol loadstore 10250.0 +volatile byte logic_tile_yfine loadstore 10250.0 +void main() +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +void* memcpy::destination +byte* memcpy::dst +byte* memcpy::dst#1 10001.0 +byte* memcpy::dst#2 10001.0 +word memcpy::num +void* memcpy::return +void* memcpy::source +byte* memcpy::src +byte* memcpy::src#1 20002.0 +byte* memcpy::src#2 10001.0 +byte* memcpy::src_end +void* memset(void* memset::str , byte memset::c , word memset::num) +byte memset::c +byte* memset::dst +byte* memset::dst#1 20002.0 +byte* memset::dst#2 13668.333333333332 +byte* memset::dst#4 2002.0 +byte* memset::end +byte* memset::end#0 1833.6666666666665 +word memset::num +word memset::num#5 1001.0 +void* memset::return +void* memset::str +void* memset::str#6 +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +byte~ merge_code::$5 100001.0 +byte merge_code::cycle_budget +byte merge_code::cycle_budget#0 10001.0 +byte merge_code::cycle_budget#1 200002.0 +byte merge_code::cycle_budget#10 88889.77777777777 +byte merge_code::cycle_budget#13 50714.857142857145 +byte merge_code::cycle_budget#2 200002.0 +byte merge_code::cycle_budget#3 200002.0 +byte* merge_code::dest_code +byte* merge_code::dest_code#0 10001.0 +byte* merge_code::dest_code#1 1000001.0 +byte* merge_code::dest_code#10 180001.80000000002 +byte* merge_code::dest_code#12 10334.666666666666 +byte* merge_code::dest_code#13 80001.25 +byte* merge_code::dest_code#14 21429.428571428572 +byte* merge_code::dest_code#15 640001.0 +byte* merge_code::dest_code#2 150001.5 +byte* merge_code::dest_code#21 51250.625 +byte* merge_code::dest_code#3 100001.0 +byte* merge_code::dest_code#4 100001.0 +byte* merge_code::dest_code#6 100001.0 +byte* merge_code::logic_code +byte* merge_code::logic_code#0 200002.0 +byte* merge_code::logic_code#1 2000002.0 +byte* merge_code::logic_code#10 1050001.5 +byte* merge_code::logic_code#12 20002.0 +byte* merge_code::logic_code#14 105001.5 +byte* merge_code::logic_code#17 22778.055555555555 +byte* merge_code::logic_code#18 15556.111111111113 +byte* merge_code::logic_code#2 100001.0 +byte* merge_code::logic_code#3 20002.0 +byte* merge_code::logic_code#4 200002.0 +byte* merge_code::logic_code#5 20002.0 +byte merge_code::logic_cycles +byte merge_code::logic_cycles#0 41667.08333333333 +byte* merge_code::raster_code +byte* merge_code::raster_code#0 20002.0 +byte* merge_code::raster_code#1 15001.5 +byte* merge_code::raster_code#2 3928.6428571428573 +byte* merge_code::raster_code#4 37501.5 +volatile byte music_play_next loadstore 69506.875 +volatile byte pacman_ch1_enabled loadstore 0.08254716981132076 +volatile byte pacman_ch1_idx loadstore 1.9428571428571428 +volatile byte pacman_direction loadstore 132.92105263157893 +volatile byte pacman_lives loadstore 656.4415584415585 +void pacman_sound_init() +void pacman_sound_play() +volatile byte pacman_substep loadstore 233.39534883720933 +volatile byte pacman_wins loadstore 1545.6969696969697 +volatile byte pacman_xfine loadstore 47.719626168224295 +volatile byte pacman_yfine loadstore 46.21818181818182 +volatile byte phase loadstore 78.03703703703704 +volatile word pill_count loadstore 14.191780821917808 +void render(byte render::xcol , byte render::ypos , byte render::pixels) +byte~ render::$1 1.0000001E7 +byte~ render::$2 2.0000002E7 +byte* render::canvas1 +byte* render::canvas1#0 5000000.5 +byte* render::canvas1#1 5.00000000005E10 +byte* render::canvas1#2 1.00010000002E11 +byte* render::canvas2 +byte* render::canvas2#0 6666667.333333333 +byte* render::canvas2#1 6.6666666667333336E10 +byte* render::canvas2#2 5.0005000001E10 +word render::canvas_offset +word render::canvas_offset#0 1.50000015E7 +byte render::i +byte render::i#1 2.00000000002E11 +byte render::i#2 6.0000000000600006E10 +byte render::pixels +byte render::pixels#0 2000002.0 +byte render::pixels#1 200002.0 +byte render::pixels#4 1241176.705882353 +byte* render::render_index_xcol +word render::render_index_xcol#0 2500000.25 +byte render::xcol +byte render::xcol#0 666667.3333333334 +byte render::xcol#1 66667.33333333333 +byte render::xcol#2 5550001.5 +byte render::ypix +byte render::ypix#0 1.4287142857428572E10 +byte render::ypos +byte render::ypos#0 1000001.0 +byte render::ypos#1 100001.0 +byte render::ypos#2 2344444.888888889 +byte render::ypos_inc_offset +byte render::ypos_inc_offset#0 1.0000001E7 +byte render::ypos_inc_offset#1 1.00000000001E11 +byte render::ypos_inc_offset#2 1.0000250000125E11 +byte render::ytile +byte render::ytile#0 1.0000001E7 +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +byte~ render_tiles::$0 2.00000002E8 +byte~ render_tiles::$2 2.00000002E8 +byte~ render_tiles::$4 1.00000001E8 +byte~ render_tiles::$5 2.00000002E8 +byte* render_tiles::canvas1 +byte* render_tiles::canvas1#0 6.6666667333333336E7 +byte* render_tiles::canvas1#1 5.000000000005E11 +byte* render_tiles::canvas1#2 6.000200000008E11 +byte* render_tiles::canvas2 +byte* render_tiles::canvas2#0 1.00000001E8 +byte* render_tiles::canvas2#1 6.666666666673334E11 +byte* render_tiles::canvas2#2 5.000166666673334E11 +word render_tiles::canvas_offset +word render_tiles::canvas_offset#0 1.500000015E8 +byte render_tiles::pixels +byte render_tiles::pixels#0 1.5000000000015E12 +byte* render_tiles::render_index_xcol +word render_tiles::render_index_xcol#0 2.500000025E7 +byte render_tiles::tile_left +byte render_tiles::tile_left#0 5.5000001E7 +byte* render_tiles::tile_left_pixels +byte* render_tiles::tile_left_pixels#0 5.2636842105368416E10 +byte render_tiles::tile_right +byte render_tiles::tile_right#0 3.6666667333333336E7 +byte* render_tiles::tile_right_pixels +byte* render_tiles::tile_right_pixels#0 5.882941176482353E10 +byte render_tiles::xcol +byte render_tiles::xcol#0 1.375000025E7 +byte render_tiles::y +byte render_tiles::y#1 2.000000000002E12 +byte render_tiles::y#2 6.25000000000625E11 +byte render_tiles::ypos_inc_offset +byte render_tiles::ypos_inc_offset#0 2.00000002E8 +byte render_tiles::ypos_inc_offset#1 1.000000000001E12 +byte render_tiles::ypos_inc_offset#2 5.714428571435714E11 +byte render_tiles::ytile +byte render_tiles::ytile#0 1.375000025E7 +volatile byte* rigt_canvas loadstore 20.0 +volatile byte* rigt_render_index_xcol loadstore 20.0 +volatile byte rigt_ypos_inc_offset loadstore 20.0 +volatile byte side_sprites_color loadstore 11040.0 +volatile byte side_sprites_mc loadstore 11040.0 +void spawn_all() +void splash_run() +byte~ splash_run::$25 2002.0 +byte~ splash_run::$30 20002.0 +byte~ splash_run::$34 1334.6666666666667 +byte splash_run::i +byte splash_run::i#1 2002.0 +byte splash_run::i#2 364.0 +byte splash_run::i1 +byte splash_run::i1#1 2002.0 +byte splash_run::i1#2 1334.6666666666667 +byte splash_run::i2 +byte splash_run::i2#1 2002.0 +byte splash_run::i2#2 1201.2 +byte splash_run::msb +byte splash_run::msb#1 1001.0 +byte splash_run::msb#10 175.25 +byte splash_run::msb#2 2002.0 +byte splash_run::msb#8 1501.5 +byte* splash_run::toD0181_gfx +byte splash_run::toD0181_return +byte* splash_run::toD0181_screen +byte* splash_run::toDd001_gfx +byte splash_run::toDd001_return +word splash_run::xpos +word splash_run::xpos#0 667.3333333333334 +void splash_show() +byte splash_show::pixels +byte splash_show::pixels#0 50000.5 +byte* splash_show::splash +byte* splash_show::splash#1 33333.666666666664 +byte* splash_show::splash#2 80001.25 +byte* splash_show::splash#4 10001.0 +byte splash_show::xcol +byte splash_show::xcol#1 20002.0 +byte splash_show::xcol#2 11818.545454545454 +byte splash_show::ypos +byte splash_show::ypos#1 200002.0 +byte splash_show::ypos#2 50000.5 +volatile byte top_sprites_color loadstore 3403.666666666667 +volatile byte top_sprites_mc loadstore 92.0 + +Initial phi equivalence classes +[ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +[ game_logic::do_reverse#4 ] +[ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +[ game_logic::target_ytile#3 game_logic::target_ytile#2 ] +[ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +[ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] +[ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +[ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] +[ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +[ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +[ splash_run::i#2 splash_run::i#1 ] +[ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +[ splash_run::i1#2 splash_run::i1#1 ] +[ splash_run::i2#2 splash_run::i2#1 ] +[ gameplay_run::i#2 gameplay_run::i#1 ] +[ gameplay_run::i1#2 gameplay_run::i1#1 ] +[ gameplay_run::i2#2 gameplay_run::i2#1 ] +[ done_run::i#2 done_run::i#1 ] +[ done_run::i1#2 done_run::i1#1 ] +[ done_run::xcol#2 done_run::xcol#1 ] +[ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +[ done_run::ypos#2 done_run::ypos#1 ] +[ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +[ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] +[ level_tile_directions::return#2 level_tile_directions::return#0 ] +[ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +[ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +[ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +[ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +[ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +[ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +[ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +[ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +[ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +[ memset::num#5 ] +[ memset::str#6 ] +[ memset::dst#2 memset::dst#4 memset::dst#1 ] +[ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] +[ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] +[ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] +[ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] +[ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +[ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] +[ init_render_index::x_col#2 init_render_index::x_col#1 ] +[ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] +[ init_render_index::render_ypos_table#4 ] +[ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +[ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] +[ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +[ splash_show::xcol#2 splash_show::xcol#1 ] +[ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] +[ splash_show::ypos#2 splash_show::ypos#1 ] +[ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +[ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] +[ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +[ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +[ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] +[ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +[ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +[ memcpy::src#2 memcpy::src#1 ] +[ memcpy::dst#2 memcpy::dst#1 ] +[ joyfire::return#4 ] +[ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +[ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] +[ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +[ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +[ level_show::ytile#2 level_show::ytile#1 ] +[ level_show::level#8 level_show::level#1 ] +[ level_show::xcol#2 level_show::xcol#1 ] +[ level_show::xtile#3 level_show::xtile#2 ] +[ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] +[ render::ypos#2 render::ypos#0 render::ypos#1 ] +[ render::xcol#2 render::xcol#0 render::xcol#1 ] +[ render::pixels#4 render::pixels#0 render::pixels#1 ] +[ render::i#2 render::i#1 ] +[ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] +[ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +[ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] +[ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +[ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] +[ level_tile_get::return#2 level_tile_get::return#0 ] +[ render_tiles::y#2 render_tiles::y#1 ] +[ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] +[ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] +[ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +Added variable pacman_ch1_enabled to live range equivalence class [ pacman_ch1_enabled ] +Added variable pacman_ch1_idx to live range equivalence class [ pacman_ch1_idx ] +Added variable logic_tile_ptr to live range equivalence class [ logic_tile_ptr ] +Added variable logic_tile_xcol to live range equivalence class [ logic_tile_xcol ] +Added variable logic_tile_yfine to live range equivalence class [ logic_tile_yfine ] +Added variable logic_tile_left_idx to live range equivalence class [ logic_tile_left_idx ] +Added variable logic_tile_right_idx to live range equivalence class [ logic_tile_right_idx ] +Added variable left_render_index_xcol to live range equivalence class [ left_render_index_xcol ] +Added variable left_canvas to live range equivalence class [ left_canvas ] +Added variable left_ypos_inc_offset to live range equivalence class [ left_ypos_inc_offset ] +Added variable rigt_render_index_xcol to live range equivalence class [ rigt_render_index_xcol ] +Added variable rigt_canvas to live range equivalence class [ rigt_canvas ] +Added variable rigt_ypos_inc_offset to live range equivalence class [ rigt_ypos_inc_offset ] +Added variable canvas_base_hi to live range equivalence class [ canvas_base_hi ] +Added variable bobs_restore_base to live range equivalence class [ bobs_restore_base ] +Added variable top_sprites_color to live range equivalence class [ top_sprites_color ] +Added variable top_sprites_mc to live range equivalence class [ top_sprites_mc ] +Added variable side_sprites_color to live range equivalence class [ side_sprites_color ] +Added variable side_sprites_mc to live range equivalence class [ side_sprites_mc ] +Added variable bottom_sprites_color to live range equivalence class [ bottom_sprites_color ] +Added variable bottom_sprites_mc to live range equivalence class [ bottom_sprites_mc ] +Added variable pill_count to live range equivalence class [ pill_count ] +Added variable pacman_wins to live range equivalence class [ pacman_wins ] +Added variable pacman_lives to live range equivalence class [ pacman_lives ] +Added variable music_play_next to live range equivalence class [ music_play_next ] +Added variable phase to live range equivalence class [ phase ] +Added variable frame to live range equivalence class [ frame ] +Added variable anim_frame_idx to live range equivalence class [ anim_frame_idx ] +Added variable pacman_xfine to live range equivalence class [ pacman_xfine ] +Added variable pacman_yfine to live range equivalence class [ pacman_yfine ] +Added variable pacman_direction to live range equivalence class [ pacman_direction ] +Added variable pacman_substep to live range equivalence class [ pacman_substep ] +Added variable ghosts_mode to live range equivalence class [ ghosts_mode ] +Added variable ghosts_mode_count to live range equivalence class [ ghosts_mode_count ] +Added variable ghost1_xfine to live range equivalence class [ ghost1_xfine ] +Added variable ghost1_yfine to live range equivalence class [ ghost1_yfine ] +Added variable ghost1_direction to live range equivalence class [ ghost1_direction ] +Added variable ghost1_substep to live range equivalence class [ ghost1_substep ] +Added variable ghost1_reverse to live range equivalence class [ ghost1_reverse ] +Added variable ghost1_respawn to live range equivalence class [ ghost1_respawn ] +Added variable ghost2_xfine to live range equivalence class [ ghost2_xfine ] +Added variable ghost2_yfine to live range equivalence class [ ghost2_yfine ] +Added variable ghost2_direction to live range equivalence class [ ghost2_direction ] +Added variable ghost2_substep to live range equivalence class [ ghost2_substep ] +Added variable ghost2_reverse to live range equivalence class [ ghost2_reverse ] +Added variable ghost2_respawn to live range equivalence class [ ghost2_respawn ] +Added variable ghost3_xfine to live range equivalence class [ ghost3_xfine ] +Added variable ghost3_yfine to live range equivalence class [ ghost3_yfine ] +Added variable ghost3_direction to live range equivalence class [ ghost3_direction ] +Added variable ghost3_substep to live range equivalence class [ ghost3_substep ] +Added variable ghost3_reverse to live range equivalence class [ ghost3_reverse ] +Added variable ghost3_respawn to live range equivalence class [ ghost3_respawn ] +Added variable ghost4_xfine to live range equivalence class [ ghost4_xfine ] +Added variable ghost4_yfine to live range equivalence class [ ghost4_yfine ] +Added variable ghost4_direction to live range equivalence class [ ghost4_direction ] +Added variable ghost4_substep to live range equivalence class [ ghost4_substep ] +Added variable ghost4_reverse to live range equivalence class [ ghost4_reverse ] +Added variable ghost4_respawn to live range equivalence class [ ghost4_respawn ] +Added variable game_logic_substep to live range equivalence class [ game_logic_substep ] +Added variable game_playable to live range equivalence class [ game_playable ] +Added variable irq_screen_top::$1 to live range equivalence class [ irq_screen_top::$1 ] +Added variable irq_screen_top::$2 to live range equivalence class [ irq_screen_top::$2 ] +Added variable game_logic::$2 to live range equivalence class [ game_logic::$2 ] +Added variable game_logic::$3 to live range equivalence class [ game_logic::$3 ] +Added variable game_logic::$14 to live range equivalence class [ game_logic::$14 ] +Added variable game_logic::$15 to live range equivalence class [ game_logic::$15 ] +Added variable game_logic::pacman_bob_xfine#0 to live range equivalence class [ game_logic::pacman_bob_xfine#0 ] +Added variable game_logic::$17 to live range equivalence class [ game_logic::$17 ] +Added variable game_logic::$18 to live range equivalence class [ game_logic::$18 ] +Added variable game_logic::$19 to live range equivalence class [ game_logic::$19 ] +Added variable game_logic::$20 to live range equivalence class [ game_logic::$20 ] +Added variable game_logic::$21 to live range equivalence class [ game_logic::$21 ] +Added variable game_logic::ghost1_bob_xfine#0 to live range equivalence class [ game_logic::ghost1_bob_xfine#0 ] +Added variable game_logic::$25 to live range equivalence class [ game_logic::$25 ] +Added variable game_logic::$26 to live range equivalence class [ game_logic::$26 ] +Added variable game_logic::$27 to live range equivalence class [ game_logic::$27 ] +Added variable game_logic::$28 to live range equivalence class [ game_logic::$28 ] +Added variable game_logic::$29 to live range equivalence class [ game_logic::$29 ] +Added variable game_logic::ghost2_bob_xfine#0 to live range equivalence class [ game_logic::ghost2_bob_xfine#0 ] +Added variable game_logic::$31 to live range equivalence class [ game_logic::$31 ] +Added variable game_logic::$32 to live range equivalence class [ game_logic::$32 ] +Added variable game_logic::$33 to live range equivalence class [ game_logic::$33 ] +Added variable game_logic::$34 to live range equivalence class [ game_logic::$34 ] +Added variable game_logic::$35 to live range equivalence class [ game_logic::$35 ] +Added variable game_logic::ghost3_bob_xfine#0 to live range equivalence class [ game_logic::ghost3_bob_xfine#0 ] +Added variable game_logic::$37 to live range equivalence class [ game_logic::$37 ] +Added variable game_logic::$38 to live range equivalence class [ game_logic::$38 ] +Added variable game_logic::$39 to live range equivalence class [ game_logic::$39 ] +Added variable game_logic::$40 to live range equivalence class [ game_logic::$40 ] +Added variable game_logic::$41 to live range equivalence class [ game_logic::$41 ] +Added variable game_logic::ghost4_bob_xfine#0 to live range equivalence class [ game_logic::ghost4_bob_xfine#0 ] +Added variable game_logic::$43 to live range equivalence class [ game_logic::$43 ] +Added variable game_logic::$44 to live range equivalence class [ game_logic::$44 ] +Added variable game_logic::$45 to live range equivalence class [ game_logic::$45 ] +Added variable game_logic::$46 to live range equivalence class [ game_logic::$46 ] +Added variable game_logic::$47 to live range equivalence class [ game_logic::$47 ] +Added variable game_logic::pacman_xtile#0 to live range equivalence class [ game_logic::pacman_xtile#0 ] +Added variable game_logic::pacman_ytile#0 to live range equivalence class [ game_logic::pacman_ytile#0 ] +Added variable game_logic::$210 to live range equivalence class [ game_logic::$210 ] +Added variable game_logic::ytiles#0 to live range equivalence class [ game_logic::ytiles#0 ] +Added variable game_logic::tile_id#0 to live range equivalence class [ game_logic::tile_id#0 ] +Added variable game_logic::$65 to live range equivalence class [ game_logic::$65 ] +Added variable game_logic::$66 to live range equivalence class [ game_logic::$66 ] +Added variable game_logic::$67 to live range equivalence class [ game_logic::$67 ] +Added variable game_logic::$68 to live range equivalence class [ game_logic::$68 ] +Added variable game_logic::$75 to live range equivalence class [ game_logic::$75 ] +Added variable game_logic::$77 to live range equivalence class [ game_logic::$77 ] +Added variable game_logic::$80 to live range equivalence class [ game_logic::$80 ] +Added variable game_logic::$82 to live range equivalence class [ game_logic::$82 ] +Added variable game_logic::$85 to live range equivalence class [ game_logic::$85 ] +Added variable game_logic::$87 to live range equivalence class [ game_logic::$87 ] +Added variable game_logic::$90 to live range equivalence class [ game_logic::$90 ] +Added variable game_logic::$92 to live range equivalence class [ game_logic::$92 ] +Added variable game_logic::$69 to live range equivalence class [ game_logic::$69 ] +Added variable game_logic::$70 to live range equivalence class [ game_logic::$70 ] +Added variable game_logic::$71 to live range equivalence class [ game_logic::$71 ] +Added variable game_logic::$72 to live range equivalence class [ game_logic::$72 ] +Added variable game_logic::$220 to live range equivalence class [ game_logic::$220 ] +Added variable game_logic::ghost4_xtile#0 to live range equivalence class [ game_logic::ghost4_xtile#0 ] +Added variable game_logic::ghost4_ytile#0 to live range equivalence class [ game_logic::ghost4_ytile#0 ] +Added variable level_tile_directions::return#3 to live range equivalence class [ level_tile_directions::return#3 ] +Added variable game_logic::open_directions#0 to live range equivalence class [ game_logic::open_directions#0 ] +Added variable game_logic::open_directions#1 to live range equivalence class [ game_logic::open_directions#1 ] +Added variable choose_direction::return#0 to live range equivalence class [ choose_direction::return#0 ] +Added variable game_logic::$119 to live range equivalence class [ game_logic::$119 ] +Added variable game_logic::$223 to live range equivalence class [ game_logic::$223 ] +Added variable game_logic::ghost3_xtile#0 to live range equivalence class [ game_logic::ghost3_xtile#0 ] +Added variable game_logic::ghost3_ytile#0 to live range equivalence class [ game_logic::ghost3_ytile#0 ] +Added variable level_tile_directions::return#10 to live range equivalence class [ level_tile_directions::return#10 ] +Added variable game_logic::open_directions1#0 to live range equivalence class [ game_logic::open_directions1#0 ] +Added variable game_logic::open_directions1#1 to live range equivalence class [ game_logic::open_directions1#1 ] +Added variable choose_direction::return#1 to live range equivalence class [ choose_direction::return#1 ] +Added variable game_logic::$140 to live range equivalence class [ game_logic::$140 ] +Added variable game_logic::$226 to live range equivalence class [ game_logic::$226 ] +Added variable game_logic::ghost2_xtile#0 to live range equivalence class [ game_logic::ghost2_xtile#0 ] +Added variable game_logic::ghost2_ytile#0 to live range equivalence class [ game_logic::ghost2_ytile#0 ] +Added variable level_tile_directions::return#11 to live range equivalence class [ level_tile_directions::return#11 ] +Added variable game_logic::open_directions2#0 to live range equivalence class [ game_logic::open_directions2#0 ] +Added variable game_logic::open_directions2#1 to live range equivalence class [ game_logic::open_directions2#1 ] +Added variable choose_direction::return#2 to live range equivalence class [ choose_direction::return#2 ] +Added variable game_logic::$161 to live range equivalence class [ game_logic::$161 ] +Added variable game_logic::$229 to live range equivalence class [ game_logic::$229 ] +Added variable game_logic::ghost1_xtile#0 to live range equivalence class [ game_logic::ghost1_xtile#0 ] +Added variable game_logic::ghost1_ytile#0 to live range equivalence class [ game_logic::ghost1_ytile#0 ] +Added variable level_tile_directions::return#12 to live range equivalence class [ level_tile_directions::return#12 ] +Added variable game_logic::open_directions3#0 to live range equivalence class [ game_logic::open_directions3#0 ] +Added variable game_logic::open_directions3#1 to live range equivalence class [ game_logic::open_directions3#1 ] +Added variable choose_direction::return#3 to live range equivalence class [ choose_direction::return#3 ] +Added variable game_logic::$182 to live range equivalence class [ game_logic::$182 ] +Added variable game_logic::$232 to live range equivalence class [ game_logic::$232 ] +Added variable game_logic::pacman_xtile1#0 to live range equivalence class [ game_logic::pacman_xtile1#0 ] +Added variable game_logic::pacman_ytile1#0 to live range equivalence class [ game_logic::pacman_ytile1#0 ] +Added variable level_tile_directions::return#13 to live range equivalence class [ level_tile_directions::return#13 ] +Added variable game_logic::open_directions4#0 to live range equivalence class [ game_logic::open_directions4#0 ] +Added variable game_logic::$199 to live range equivalence class [ game_logic::$199 ] +Added variable game_logic::$200 to live range equivalence class [ game_logic::$200 ] +Added variable game_logic::joy_directions#0 to live range equivalence class [ game_logic::joy_directions#0 ] +Added variable game_logic::$204 to live range equivalence class [ game_logic::$204 ] +Added variable game_logic::new_direction#0 to live range equivalence class [ game_logic::new_direction#0 ] +Added variable byteboozer_decrunch::crunched to live range equivalence class [ byteboozer_decrunch::crunched ] +Added variable joyfire::return#1 to live range equivalence class [ joyfire::return#1 ] +Added variable splash_run::$30 to live range equivalence class [ splash_run::$30 ] +Added variable splash_run::$34 to live range equivalence class [ splash_run::$34 ] +Added variable splash_run::xpos#0 to live range equivalence class [ splash_run::xpos#0 ] +Added variable splash_run::$25 to live range equivalence class [ splash_run::$25 ] +Added variable level_show::return#0 to live range equivalence class [ level_show::return#0 ] +Added variable gameplay_run::$4 to live range equivalence class [ gameplay_run::$4 ] +Added variable joyfire::return#0 to live range equivalence class [ joyfire::return#0 ] +Added variable done_run::$8 to live range equivalence class [ done_run::$8 ] +Added variable done_run::pixels#0 to live range equivalence class [ done_run::pixels#0 ] +Added variable level_tile_directions::$5 to live range equivalence class [ level_tile_directions::$5 ] +Added variable level_tile_directions::ytiles#0 to live range equivalence class [ level_tile_directions::ytiles#0 ] +Added variable choose_direction::xdiff#0 to live range equivalence class [ choose_direction::xdiff#0 ] +Added variable choose_direction::ydiff#0 to live range equivalence class [ choose_direction::ydiff#0 ] +Added variable choose_direction::$2 to live range equivalence class [ choose_direction::$2 ] +Added variable choose_direction::$4 to live range equivalence class [ choose_direction::$4 ] +Added variable choose_direction::$6 to live range equivalence class [ choose_direction::$6 ] +Added variable choose_direction::$8 to live range equivalence class [ choose_direction::$8 ] +Added variable choose_direction::dist_right#0 to live range equivalence class [ choose_direction::dist_right#0 ] +Added variable memset::end#0 to live range equivalence class [ memset::end#0 ] +Added variable merge_code::raster_code#1 to live range equivalence class [ merge_code::raster_code#1 ] +Added variable merge_code::logic_cycles#0 to live range equivalence class [ merge_code::logic_cycles#0 ] +Added variable merge_code::$5 to live range equivalence class [ merge_code::$5 ] +Added variable merge_code::dest_code#2 to live range equivalence class [ merge_code::dest_code#2 ] +Added variable init_render_index::$9 to live range equivalence class [ init_render_index::$9 ] +Added variable init_render_index::canvas_xcol#0 to live range equivalence class [ init_render_index::canvas_xcol#0 ] +Added variable init_render_index::$11 to live range equivalence class [ init_render_index::$11 ] +Added variable init_render_index::$10 to live range equivalence class [ init_render_index::$10 ] +Added variable init_render_index::$12 to live range equivalence class [ init_render_index::$12 ] +Added variable init_render_index::canvas#0 to live range equivalence class [ init_render_index::canvas#0 ] +Added variable init_render_index::$5 to live range equivalence class [ init_render_index::$5 ] +Added variable init_render_index::$6 to live range equivalence class [ init_render_index::$6 ] +Added variable splash_show::pixels#0 to live range equivalence class [ splash_show::pixels#0 ] +Added variable init_sprite_pointers::$2 to live range equivalence class [ init_sprite_pointers::$2 ] +Added variable init_sprite_pointers::sprite_id#0 to live range equivalence class [ init_sprite_pointers::sprite_id#0 ] +Added variable joyfire::$0 to live range equivalence class [ joyfire::$0 ] +Added variable level_tile_get::return#3 to live range equivalence class [ level_tile_get::return#3 ] +Added variable init_level_tile_directions::$3 to live range equivalence class [ init_level_tile_directions::$3 ] +Added variable level_tile_get::return#4 to live range equivalence class [ level_tile_get::return#4 ] +Added variable init_level_tile_directions::$7 to live range equivalence class [ init_level_tile_directions::$7 ] +Added variable level_tile_get::return#10 to live range equivalence class [ level_tile_get::return#10 ] +Added variable init_level_tile_directions::$11 to live range equivalence class [ init_level_tile_directions::$11 ] +Added variable level_tile_get::return#11 to live range equivalence class [ level_tile_get::return#11 ] +Added variable init_level_tile_directions::$15 to live range equivalence class [ init_level_tile_directions::$15 ] +Added variable level_show::tile_left#0 to live range equivalence class [ level_show::tile_left#0 ] +Added variable level_show::xtile#1 to live range equivalence class [ level_show::xtile#1 ] +Added variable level_show::tile_right#0 to live range equivalence class [ level_show::tile_right#0 ] +Added variable render_tiles::xcol#0 to live range equivalence class [ render_tiles::xcol#0 ] +Added variable render_tiles::ytile#0 to live range equivalence class [ render_tiles::ytile#0 ] +Added variable render_tiles::tile_left#0 to live range equivalence class [ render_tiles::tile_left#0 ] +Added variable render_tiles::tile_right#0 to live range equivalence class [ render_tiles::tile_right#0 ] +Added variable render::ytile#0 to live range equivalence class [ render::ytile#0 ] +Added variable render::$1 to live range equivalence class [ render::$1 ] +Added variable render::$2 to live range equivalence class [ render::$2 ] +Added variable render::render_index_xcol#0 to live range equivalence class [ render::render_index_xcol#0 ] +Added variable render::canvas_offset#0 to live range equivalence class [ render::canvas_offset#0 ] +Added variable render::ypix#0 to live range equivalence class [ render::ypix#0 ] +Added variable level_tile_get::$5 to live range equivalence class [ level_tile_get::$5 ] +Added variable level_tile_get::ytiles#0 to live range equivalence class [ level_tile_get::ytiles#0 ] +Added variable render_tiles::$0 to live range equivalence class [ render_tiles::$0 ] +Added variable render_tiles::tile_left_pixels#0 to live range equivalence class [ render_tiles::tile_left_pixels#0 ] +Added variable render_tiles::$2 to live range equivalence class [ render_tiles::$2 ] +Added variable render_tiles::tile_right_pixels#0 to live range equivalence class [ render_tiles::tile_right_pixels#0 ] +Added variable render_tiles::$4 to live range equivalence class [ render_tiles::$4 ] +Added variable render_tiles::$5 to live range equivalence class [ render_tiles::$5 ] +Added variable render_tiles::render_index_xcol#0 to live range equivalence class [ render_tiles::render_index_xcol#0 ] +Added variable render_tiles::canvas_offset#0 to live range equivalence class [ render_tiles::canvas_offset#0 ] +Added variable render_tiles::pixels#0 to live range equivalence class [ render_tiles::pixels#0 ] +Complete equivalence classes +[ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +[ game_logic::do_reverse#4 ] +[ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +[ game_logic::target_ytile#3 game_logic::target_ytile#2 ] +[ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +[ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] +[ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +[ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] +[ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +[ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +[ splash_run::i#2 splash_run::i#1 ] +[ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +[ splash_run::i1#2 splash_run::i1#1 ] +[ splash_run::i2#2 splash_run::i2#1 ] +[ gameplay_run::i#2 gameplay_run::i#1 ] +[ gameplay_run::i1#2 gameplay_run::i1#1 ] +[ gameplay_run::i2#2 gameplay_run::i2#1 ] +[ done_run::i#2 done_run::i#1 ] +[ done_run::i1#2 done_run::i1#1 ] +[ done_run::xcol#2 done_run::xcol#1 ] +[ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +[ done_run::ypos#2 done_run::ypos#1 ] +[ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +[ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] +[ level_tile_directions::return#2 level_tile_directions::return#0 ] +[ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +[ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +[ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +[ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +[ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +[ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +[ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +[ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +[ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +[ memset::num#5 ] +[ memset::str#6 ] +[ memset::dst#2 memset::dst#4 memset::dst#1 ] +[ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] +[ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] +[ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] +[ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] +[ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +[ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] +[ init_render_index::x_col#2 init_render_index::x_col#1 ] +[ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] +[ init_render_index::render_ypos_table#4 ] +[ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +[ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] +[ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +[ splash_show::xcol#2 splash_show::xcol#1 ] +[ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] +[ splash_show::ypos#2 splash_show::ypos#1 ] +[ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +[ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] +[ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +[ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +[ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] +[ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +[ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +[ memcpy::src#2 memcpy::src#1 ] +[ memcpy::dst#2 memcpy::dst#1 ] +[ joyfire::return#4 ] +[ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +[ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] +[ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +[ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +[ level_show::ytile#2 level_show::ytile#1 ] +[ level_show::level#8 level_show::level#1 ] +[ level_show::xcol#2 level_show::xcol#1 ] +[ level_show::xtile#3 level_show::xtile#2 ] +[ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] +[ render::ypos#2 render::ypos#0 render::ypos#1 ] +[ render::xcol#2 render::xcol#0 render::xcol#1 ] +[ render::pixels#4 render::pixels#0 render::pixels#1 ] +[ render::i#2 render::i#1 ] +[ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] +[ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +[ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] +[ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +[ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] +[ level_tile_get::return#2 level_tile_get::return#0 ] +[ render_tiles::y#2 render_tiles::y#1 ] +[ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] +[ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] +[ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +[ pacman_ch1_enabled ] +[ pacman_ch1_idx ] +[ logic_tile_ptr ] +[ logic_tile_xcol ] +[ logic_tile_yfine ] +[ logic_tile_left_idx ] +[ logic_tile_right_idx ] +[ left_render_index_xcol ] +[ left_canvas ] +[ left_ypos_inc_offset ] +[ rigt_render_index_xcol ] +[ rigt_canvas ] +[ rigt_ypos_inc_offset ] +[ canvas_base_hi ] +[ bobs_restore_base ] +[ top_sprites_color ] +[ top_sprites_mc ] +[ side_sprites_color ] +[ side_sprites_mc ] +[ bottom_sprites_color ] +[ bottom_sprites_mc ] +[ pill_count ] +[ pacman_wins ] +[ pacman_lives ] +[ music_play_next ] +[ phase ] +[ frame ] +[ anim_frame_idx ] +[ pacman_xfine ] +[ pacman_yfine ] +[ pacman_direction ] +[ pacman_substep ] +[ ghosts_mode ] +[ ghosts_mode_count ] +[ ghost1_xfine ] +[ ghost1_yfine ] +[ ghost1_direction ] +[ ghost1_substep ] +[ ghost1_reverse ] +[ ghost1_respawn ] +[ ghost2_xfine ] +[ ghost2_yfine ] +[ ghost2_direction ] +[ ghost2_substep ] +[ ghost2_reverse ] +[ ghost2_respawn ] +[ ghost3_xfine ] +[ ghost3_yfine ] +[ ghost3_direction ] +[ ghost3_substep ] +[ ghost3_reverse ] +[ ghost3_respawn ] +[ ghost4_xfine ] +[ ghost4_yfine ] +[ ghost4_direction ] +[ ghost4_substep ] +[ ghost4_reverse ] +[ ghost4_respawn ] +[ game_logic_substep ] +[ game_playable ] +[ irq_screen_top::$1 ] +[ irq_screen_top::$2 ] +[ game_logic::$2 ] +[ game_logic::$3 ] +[ game_logic::$14 ] +[ game_logic::$15 ] +[ game_logic::pacman_bob_xfine#0 ] +[ game_logic::$17 ] +[ game_logic::$18 ] +[ game_logic::$19 ] +[ game_logic::$20 ] +[ game_logic::$21 ] +[ game_logic::ghost1_bob_xfine#0 ] +[ game_logic::$25 ] +[ game_logic::$26 ] +[ game_logic::$27 ] +[ game_logic::$28 ] +[ game_logic::$29 ] +[ game_logic::ghost2_bob_xfine#0 ] +[ game_logic::$31 ] +[ game_logic::$32 ] +[ game_logic::$33 ] +[ game_logic::$34 ] +[ game_logic::$35 ] +[ game_logic::ghost3_bob_xfine#0 ] +[ game_logic::$37 ] +[ game_logic::$38 ] +[ game_logic::$39 ] +[ game_logic::$40 ] +[ game_logic::$41 ] +[ game_logic::ghost4_bob_xfine#0 ] +[ game_logic::$43 ] +[ game_logic::$44 ] +[ game_logic::$45 ] +[ game_logic::$46 ] +[ game_logic::$47 ] +[ game_logic::pacman_xtile#0 ] +[ game_logic::pacman_ytile#0 ] +[ game_logic::$210 ] +[ game_logic::ytiles#0 ] +[ game_logic::tile_id#0 ] +[ game_logic::$65 ] +[ game_logic::$66 ] +[ game_logic::$67 ] +[ game_logic::$68 ] +[ game_logic::$75 ] +[ game_logic::$77 ] +[ game_logic::$80 ] +[ game_logic::$82 ] +[ game_logic::$85 ] +[ game_logic::$87 ] +[ game_logic::$90 ] +[ game_logic::$92 ] +[ game_logic::$69 ] +[ game_logic::$70 ] +[ game_logic::$71 ] +[ game_logic::$72 ] +[ game_logic::$220 ] +[ game_logic::ghost4_xtile#0 ] +[ game_logic::ghost4_ytile#0 ] +[ level_tile_directions::return#3 ] +[ game_logic::open_directions#0 ] +[ game_logic::open_directions#1 ] +[ choose_direction::return#0 ] +[ game_logic::$119 ] +[ game_logic::$223 ] +[ game_logic::ghost3_xtile#0 ] +[ game_logic::ghost3_ytile#0 ] +[ level_tile_directions::return#10 ] +[ game_logic::open_directions1#0 ] +[ game_logic::open_directions1#1 ] +[ choose_direction::return#1 ] +[ game_logic::$140 ] +[ game_logic::$226 ] +[ game_logic::ghost2_xtile#0 ] +[ game_logic::ghost2_ytile#0 ] +[ level_tile_directions::return#11 ] +[ game_logic::open_directions2#0 ] +[ game_logic::open_directions2#1 ] +[ choose_direction::return#2 ] +[ game_logic::$161 ] +[ game_logic::$229 ] +[ game_logic::ghost1_xtile#0 ] +[ game_logic::ghost1_ytile#0 ] +[ level_tile_directions::return#12 ] +[ game_logic::open_directions3#0 ] +[ game_logic::open_directions3#1 ] +[ choose_direction::return#3 ] +[ game_logic::$182 ] +[ game_logic::$232 ] +[ game_logic::pacman_xtile1#0 ] +[ game_logic::pacman_ytile1#0 ] +[ level_tile_directions::return#13 ] +[ game_logic::open_directions4#0 ] +[ game_logic::$199 ] +[ game_logic::$200 ] +[ game_logic::joy_directions#0 ] +[ game_logic::$204 ] +[ game_logic::new_direction#0 ] +[ byteboozer_decrunch::crunched ] +[ joyfire::return#1 ] +[ splash_run::$30 ] +[ splash_run::$34 ] +[ splash_run::xpos#0 ] +[ splash_run::$25 ] +[ level_show::return#0 ] +[ gameplay_run::$4 ] +[ joyfire::return#0 ] +[ done_run::$8 ] +[ done_run::pixels#0 ] +[ level_tile_directions::$5 ] +[ level_tile_directions::ytiles#0 ] +[ choose_direction::xdiff#0 ] +[ choose_direction::ydiff#0 ] +[ choose_direction::$2 ] +[ choose_direction::$4 ] +[ choose_direction::$6 ] +[ choose_direction::$8 ] +[ choose_direction::dist_right#0 ] +[ memset::end#0 ] +[ merge_code::raster_code#1 ] +[ merge_code::logic_cycles#0 ] +[ merge_code::$5 ] +[ merge_code::dest_code#2 ] +[ init_render_index::$9 ] +[ init_render_index::canvas_xcol#0 ] +[ init_render_index::$11 ] +[ init_render_index::$10 ] +[ init_render_index::$12 ] +[ init_render_index::canvas#0 ] +[ init_render_index::$5 ] +[ init_render_index::$6 ] +[ splash_show::pixels#0 ] +[ init_sprite_pointers::$2 ] +[ init_sprite_pointers::sprite_id#0 ] +[ joyfire::$0 ] +[ level_tile_get::return#3 ] +[ init_level_tile_directions::$3 ] +[ level_tile_get::return#4 ] +[ init_level_tile_directions::$7 ] +[ level_tile_get::return#10 ] +[ init_level_tile_directions::$11 ] +[ level_tile_get::return#11 ] +[ init_level_tile_directions::$15 ] +[ level_show::tile_left#0 ] +[ level_show::xtile#1 ] +[ level_show::tile_right#0 ] +[ render_tiles::xcol#0 ] +[ render_tiles::ytile#0 ] +[ render_tiles::tile_left#0 ] +[ render_tiles::tile_right#0 ] +[ render::ytile#0 ] +[ render::$1 ] +[ render::$2 ] +[ render::render_index_xcol#0 ] +[ render::canvas_offset#0 ] +[ render::ypix#0 ] +[ level_tile_get::$5 ] +[ level_tile_get::ytiles#0 ] +[ render_tiles::$0 ] +[ render_tiles::tile_left_pixels#0 ] +[ render_tiles::$2 ] +[ render_tiles::tile_right_pixels#0 ] +[ render_tiles::$4 ] +[ render_tiles::$5 ] +[ render_tiles::render_index_xcol#0 ] +[ render_tiles::canvas_offset#0 ] +[ render_tiles::pixels#0 ] +Allocated zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +Allocated zp[1]:3 [ game_logic::do_reverse#4 ] +Allocated zp[1]:4 [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +Allocated zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] +Allocated zp[1]:6 [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +Allocated zp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] +Allocated zp[1]:8 [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +Allocated zp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] +Allocated zp[1]:10 [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +Allocated zp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +Allocated zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] +Allocated zp[1]:13 [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +Allocated zp[1]:14 [ splash_run::i1#2 splash_run::i1#1 ] +Allocated zp[1]:15 [ splash_run::i2#2 splash_run::i2#1 ] +Allocated zp[1]:16 [ gameplay_run::i#2 gameplay_run::i#1 ] +Allocated zp[1]:17 [ gameplay_run::i1#2 gameplay_run::i1#1 ] +Allocated zp[1]:18 [ gameplay_run::i2#2 gameplay_run::i2#1 ] +Allocated zp[1]:19 [ done_run::i#2 done_run::i#1 ] +Allocated zp[1]:20 [ done_run::i1#2 done_run::i1#1 ] +Allocated zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Allocated zp[2]:22 [ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +Allocated zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] +Allocated zp[1]:25 [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +Allocated zp[1]:26 [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] +Allocated zp[1]:27 [ level_tile_directions::return#2 level_tile_directions::return#0 ] +Allocated zp[1]:28 [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +Allocated zp[1]:29 [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +Allocated zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +Allocated zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +Allocated zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +Allocated zp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +Allocated zp[1]:34 [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +Allocated zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +Allocated zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +Allocated zp[2]:37 [ memset::num#5 ] +Allocated zp[2]:39 [ memset::str#6 ] +Allocated zp[2]:41 [ memset::dst#2 memset::dst#4 memset::dst#1 ] +Allocated zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] +Allocated zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] +Allocated zp[2]:47 [ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] +Allocated zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] +Allocated zp[1]:51 [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +Allocated zp[2]:52 [ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] +Allocated zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Allocated zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] +Allocated zp[2]:57 [ init_render_index::render_ypos_table#4 ] +Allocated zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Allocated zp[2]:60 [ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] +Allocated zp[1]:62 [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +Allocated zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Allocated zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] +Allocated zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] +Allocated zp[1]:67 [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +Allocated zp[2]:68 [ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] +Allocated zp[1]:70 [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +Allocated zp[1]:71 [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +Allocated zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] +Allocated zp[2]:74 [ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +Allocated zp[1]:76 [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +Allocated zp[2]:77 [ memcpy::src#2 memcpy::src#1 ] +Allocated zp[2]:79 [ memcpy::dst#2 memcpy::dst#1 ] +Allocated zp[1]:81 [ joyfire::return#4 ] +Allocated zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +Allocated zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] +Allocated zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +Allocated zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +Allocated zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] +Allocated zp[2]:88 [ level_show::level#8 level_show::level#1 ] +Allocated zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] +Allocated zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] +Allocated zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] +Allocated zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] +Allocated zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] +Allocated zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] +Allocated zp[1]:97 [ render::i#2 render::i#1 ] +Allocated zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] +Allocated zp[1]:100 [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +Allocated zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] +Allocated zp[1]:103 [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +Allocated zp[1]:104 [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] +Allocated zp[1]:105 [ level_tile_get::return#2 level_tile_get::return#0 ] +Allocated zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] +Allocated zp[2]:107 [ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] +Allocated zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] +Allocated zp[1]:111 [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +Allocated zp[1]:112 [ pacman_ch1_enabled ] +Allocated zp[1]:113 [ pacman_ch1_idx ] +Allocated zp[2]:114 [ logic_tile_ptr ] +Allocated zp[1]:116 [ logic_tile_xcol ] +Allocated zp[1]:117 [ logic_tile_yfine ] +Allocated zp[1]:118 [ logic_tile_left_idx ] +Allocated zp[1]:119 [ logic_tile_right_idx ] +Allocated zp[2]:120 [ left_render_index_xcol ] +Allocated zp[2]:122 [ left_canvas ] +Allocated zp[1]:124 [ left_ypos_inc_offset ] +Allocated zp[2]:125 [ rigt_render_index_xcol ] +Allocated zp[2]:127 [ rigt_canvas ] +Allocated zp[1]:129 [ rigt_ypos_inc_offset ] +Allocated zp[1]:130 [ canvas_base_hi ] +Allocated zp[1]:131 [ bobs_restore_base ] +Allocated zp[1]:132 [ top_sprites_color ] +Allocated zp[1]:133 [ top_sprites_mc ] +Allocated zp[1]:134 [ side_sprites_color ] +Allocated zp[1]:135 [ side_sprites_mc ] +Allocated zp[1]:136 [ bottom_sprites_color ] +Allocated zp[1]:137 [ bottom_sprites_mc ] +Allocated zp[2]:138 [ pill_count ] +Allocated zp[1]:140 [ pacman_wins ] +Allocated zp[1]:141 [ pacman_lives ] +Allocated zp[1]:142 [ music_play_next ] +Allocated zp[1]:143 [ phase ] +Allocated zp[1]:144 [ frame ] +Allocated zp[1]:145 [ anim_frame_idx ] +Allocated zp[1]:146 [ pacman_xfine ] +Allocated zp[1]:147 [ pacman_yfine ] +Allocated zp[1]:148 [ pacman_direction ] +Allocated zp[1]:149 [ pacman_substep ] +Allocated zp[1]:150 [ ghosts_mode ] +Allocated zp[1]:151 [ ghosts_mode_count ] +Allocated zp[1]:152 [ ghost1_xfine ] +Allocated zp[1]:153 [ ghost1_yfine ] +Allocated zp[1]:154 [ ghost1_direction ] +Allocated zp[1]:155 [ ghost1_substep ] +Allocated zp[1]:156 [ ghost1_reverse ] +Allocated zp[1]:157 [ ghost1_respawn ] +Allocated zp[1]:158 [ ghost2_xfine ] +Allocated zp[1]:159 [ ghost2_yfine ] +Allocated zp[1]:160 [ ghost2_direction ] +Allocated zp[1]:161 [ ghost2_substep ] +Allocated zp[1]:162 [ ghost2_reverse ] +Allocated zp[1]:163 [ ghost2_respawn ] +Allocated zp[1]:164 [ ghost3_xfine ] +Allocated zp[1]:165 [ ghost3_yfine ] +Allocated zp[1]:166 [ ghost3_direction ] +Allocated zp[1]:167 [ ghost3_substep ] +Allocated zp[1]:168 [ ghost3_reverse ] +Allocated zp[1]:169 [ ghost3_respawn ] +Allocated zp[1]:170 [ ghost4_xfine ] +Allocated zp[1]:171 [ ghost4_yfine ] +Allocated zp[1]:172 [ ghost4_direction ] +Allocated zp[1]:173 [ ghost4_substep ] +Allocated zp[1]:174 [ ghost4_reverse ] +Allocated zp[1]:175 [ ghost4_respawn ] +Allocated zp[1]:176 [ game_logic_substep ] +Allocated zp[1]:177 [ game_playable ] +Allocated zp[1]:178 [ irq_screen_top::$1 ] +Allocated zp[1]:179 [ irq_screen_top::$2 ] +Allocated zp[1]:180 [ game_logic::$2 ] +Allocated zp[1]:181 [ game_logic::$3 ] +Allocated zp[1]:182 [ game_logic::$14 ] +Allocated zp[1]:183 [ game_logic::$15 ] +Allocated zp[1]:184 [ game_logic::pacman_bob_xfine#0 ] +Allocated zp[1]:185 [ game_logic::$17 ] +Allocated zp[1]:186 [ game_logic::$18 ] +Allocated zp[1]:187 [ game_logic::$19 ] +Allocated zp[1]:188 [ game_logic::$20 ] +Allocated zp[1]:189 [ game_logic::$21 ] +Allocated zp[1]:190 [ game_logic::ghost1_bob_xfine#0 ] +Allocated zp[1]:191 [ game_logic::$25 ] +Allocated zp[1]:192 [ game_logic::$26 ] +Allocated zp[1]:193 [ game_logic::$27 ] +Allocated zp[1]:194 [ game_logic::$28 ] +Allocated zp[1]:195 [ game_logic::$29 ] +Allocated zp[1]:196 [ game_logic::ghost2_bob_xfine#0 ] +Allocated zp[1]:197 [ game_logic::$31 ] +Allocated zp[1]:198 [ game_logic::$32 ] +Allocated zp[1]:199 [ game_logic::$33 ] +Allocated zp[1]:200 [ game_logic::$34 ] +Allocated zp[1]:201 [ game_logic::$35 ] +Allocated zp[1]:202 [ game_logic::ghost3_bob_xfine#0 ] +Allocated zp[1]:203 [ game_logic::$37 ] +Allocated zp[1]:204 [ game_logic::$38 ] +Allocated zp[1]:205 [ game_logic::$39 ] +Allocated zp[1]:206 [ game_logic::$40 ] +Allocated zp[1]:207 [ game_logic::$41 ] +Allocated zp[1]:208 [ game_logic::ghost4_bob_xfine#0 ] +Allocated zp[1]:209 [ game_logic::$43 ] +Allocated zp[1]:210 [ game_logic::$44 ] +Allocated zp[1]:211 [ game_logic::$45 ] +Allocated zp[1]:212 [ game_logic::$46 ] +Allocated zp[1]:213 [ game_logic::$47 ] +Allocated zp[1]:214 [ game_logic::pacman_xtile#0 ] +Allocated zp[1]:215 [ game_logic::pacman_ytile#0 ] +Allocated zp[1]:216 [ game_logic::$210 ] +Allocated zp[2]:217 [ game_logic::ytiles#0 ] +Allocated zp[1]:219 [ game_logic::tile_id#0 ] +Allocated zp[1]:220 [ game_logic::$65 ] +Allocated zp[1]:221 [ game_logic::$66 ] +Allocated zp[2]:222 [ game_logic::$67 ] +Allocated zp[1]:224 [ game_logic::$68 ] +Allocated zp[1]:225 [ game_logic::$75 ] +Allocated zp[1]:226 [ game_logic::$77 ] +Allocated zp[1]:227 [ game_logic::$80 ] +Allocated zp[1]:228 [ game_logic::$82 ] +Allocated zp[1]:229 [ game_logic::$85 ] +Allocated zp[1]:230 [ game_logic::$87 ] +Allocated zp[1]:231 [ game_logic::$90 ] +Allocated zp[1]:232 [ game_logic::$92 ] +Allocated zp[1]:233 [ game_logic::$69 ] +Allocated zp[1]:234 [ game_logic::$70 ] +Allocated zp[2]:235 [ game_logic::$71 ] +Allocated zp[1]:237 [ game_logic::$72 ] +Allocated zp[1]:238 [ game_logic::$220 ] +Allocated zp[1]:239 [ game_logic::ghost4_xtile#0 ] +Allocated zp[1]:240 [ game_logic::ghost4_ytile#0 ] +Allocated zp[1]:241 [ level_tile_directions::return#3 ] +Allocated zp[1]:242 [ game_logic::open_directions#0 ] +Allocated zp[1]:243 [ game_logic::open_directions#1 ] +Allocated zp[1]:244 [ choose_direction::return#0 ] +Allocated zp[1]:245 [ game_logic::$119 ] +Allocated zp[1]:246 [ game_logic::$223 ] +Allocated zp[1]:247 [ game_logic::ghost3_xtile#0 ] +Allocated zp[1]:248 [ game_logic::ghost3_ytile#0 ] +Allocated zp[1]:249 [ level_tile_directions::return#10 ] +Allocated zp[1]:250 [ game_logic::open_directions1#0 ] +Allocated zp[1]:251 [ game_logic::open_directions1#1 ] +Allocated zp[1]:252 [ choose_direction::return#1 ] +Allocated zp[1]:253 [ game_logic::$140 ] +Allocated zp[1]:254 [ game_logic::$226 ] +Allocated zp[1]:255 [ game_logic::ghost2_xtile#0 ] +Allocated zp[1]:256 [ game_logic::ghost2_ytile#0 ] +Allocated zp[1]:257 [ level_tile_directions::return#11 ] +Allocated zp[1]:258 [ game_logic::open_directions2#0 ] +Allocated zp[1]:259 [ game_logic::open_directions2#1 ] +Allocated zp[1]:260 [ choose_direction::return#2 ] +Allocated zp[1]:261 [ game_logic::$161 ] +Allocated zp[1]:262 [ game_logic::$229 ] +Allocated zp[1]:263 [ game_logic::ghost1_xtile#0 ] +Allocated zp[1]:264 [ game_logic::ghost1_ytile#0 ] +Allocated zp[1]:265 [ level_tile_directions::return#12 ] +Allocated zp[1]:266 [ game_logic::open_directions3#0 ] +Allocated zp[1]:267 [ game_logic::open_directions3#1 ] +Allocated zp[1]:268 [ choose_direction::return#3 ] +Allocated zp[1]:269 [ game_logic::$182 ] +Allocated zp[1]:270 [ game_logic::$232 ] +Allocated zp[1]:271 [ game_logic::pacman_xtile1#0 ] +Allocated zp[1]:272 [ game_logic::pacman_ytile1#0 ] +Allocated zp[1]:273 [ level_tile_directions::return#13 ] +Allocated zp[1]:274 [ game_logic::open_directions4#0 ] +Allocated zp[1]:275 [ game_logic::$199 ] +Allocated zp[1]:276 [ game_logic::$200 ] +Allocated zp[1]:277 [ game_logic::joy_directions#0 ] +Allocated zp[1]:278 [ game_logic::$204 ] +Allocated zp[1]:279 [ game_logic::new_direction#0 ] +Allocated zp[2]:280 [ byteboozer_decrunch::crunched ] +Allocated zp[1]:282 [ joyfire::return#1 ] +Allocated zp[1]:283 [ splash_run::$30 ] +Allocated zp[1]:284 [ splash_run::$34 ] +Allocated zp[2]:285 [ splash_run::xpos#0 ] +Allocated zp[1]:287 [ splash_run::$25 ] +Allocated zp[2]:288 [ level_show::return#0 ] +Allocated zp[2]:290 [ gameplay_run::$4 ] +Allocated zp[1]:292 [ joyfire::return#0 ] +Allocated zp[1]:293 [ done_run::$8 ] +Allocated zp[1]:294 [ done_run::pixels#0 ] +Allocated zp[1]:295 [ level_tile_directions::$5 ] +Allocated zp[2]:296 [ level_tile_directions::ytiles#0 ] +Allocated zp[1]:298 [ choose_direction::xdiff#0 ] +Allocated zp[1]:299 [ choose_direction::ydiff#0 ] +Allocated zp[1]:300 [ choose_direction::$2 ] +Allocated zp[1]:301 [ choose_direction::$4 ] +Allocated zp[1]:302 [ choose_direction::$6 ] +Allocated zp[1]:303 [ choose_direction::$8 ] +Allocated zp[1]:304 [ choose_direction::dist_right#0 ] +Allocated zp[2]:305 [ memset::end#0 ] +Allocated zp[2]:307 [ merge_code::raster_code#1 ] +Allocated zp[1]:309 [ merge_code::logic_cycles#0 ] +Allocated zp[1]:310 [ merge_code::$5 ] +Allocated zp[2]:311 [ merge_code::dest_code#2 ] +Allocated zp[1]:313 [ init_render_index::$9 ] +Allocated zp[2]:314 [ init_render_index::canvas_xcol#0 ] +Allocated zp[2]:316 [ init_render_index::$11 ] +Allocated zp[2]:318 [ init_render_index::$10 ] +Allocated zp[2]:320 [ init_render_index::$12 ] +Allocated zp[2]:322 [ init_render_index::canvas#0 ] +Allocated zp[1]:324 [ init_render_index::$5 ] +Allocated zp[1]:325 [ init_render_index::$6 ] +Allocated zp[1]:326 [ splash_show::pixels#0 ] +Allocated zp[1]:327 [ init_sprite_pointers::$2 ] +Allocated zp[1]:328 [ init_sprite_pointers::sprite_id#0 ] +Allocated zp[1]:329 [ joyfire::$0 ] +Allocated zp[1]:330 [ level_tile_get::return#3 ] +Allocated zp[1]:331 [ init_level_tile_directions::$3 ] +Allocated zp[1]:332 [ level_tile_get::return#4 ] +Allocated zp[1]:333 [ init_level_tile_directions::$7 ] +Allocated zp[1]:334 [ level_tile_get::return#10 ] +Allocated zp[1]:335 [ init_level_tile_directions::$11 ] +Allocated zp[1]:336 [ level_tile_get::return#11 ] +Allocated zp[1]:337 [ init_level_tile_directions::$15 ] +Allocated zp[1]:338 [ level_show::tile_left#0 ] +Allocated zp[1]:339 [ level_show::xtile#1 ] +Allocated zp[1]:340 [ level_show::tile_right#0 ] +Allocated zp[1]:341 [ render_tiles::xcol#0 ] +Allocated zp[1]:342 [ render_tiles::ytile#0 ] +Allocated zp[1]:343 [ render_tiles::tile_left#0 ] +Allocated zp[1]:344 [ render_tiles::tile_right#0 ] +Allocated zp[1]:345 [ render::ytile#0 ] +Allocated zp[1]:346 [ render::$1 ] +Allocated zp[1]:347 [ render::$2 ] +Allocated zp[2]:348 [ render::render_index_xcol#0 ] +Allocated zp[2]:350 [ render::canvas_offset#0 ] +Allocated zp[1]:352 [ render::ypix#0 ] +Allocated zp[1]:353 [ level_tile_get::$5 ] +Allocated zp[2]:354 [ level_tile_get::ytiles#0 ] +Allocated zp[1]:356 [ render_tiles::$0 ] +Allocated zp[2]:357 [ render_tiles::tile_left_pixels#0 ] +Allocated zp[1]:359 [ render_tiles::$2 ] +Allocated zp[2]:360 [ render_tiles::tile_right_pixels#0 ] +Allocated zp[1]:362 [ render_tiles::$4 ] +Allocated zp[1]:363 [ render_tiles::$5 ] +Allocated zp[2]:364 [ render_tiles::render_index_xcol#0 ] +Allocated zp[2]:366 [ render_tiles::canvas_offset#0 ] +Allocated zp[1]:368 [ render_tiles::pixels#0 ] +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [1] pacman_ch1_enabled = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] pacman_ch1_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] logic_tile_ptr = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] logic_tile_xcol = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] logic_tile_yfine = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [6] logic_tile_left_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [7] logic_tile_right_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [8] left_render_index_xcol = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [9] left_canvas = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [10] left_ypos_inc_offset = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [11] rigt_render_index_xcol = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [12] rigt_canvas = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [13] rigt_ypos_inc_offset = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [14] canvas_base_hi = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [15] bobs_restore_base = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [16] top_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [17] top_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [18] side_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [19] side_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [20] bottom_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [21] bottom_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [22] pill_count = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [23] pacman_wins = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [24] pacman_lives = 3 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [25] music_play_next = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [26] phase = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [27] frame = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [28] anim_frame_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [29] pacman_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [30] pacman_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [31] pacman_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [32] pacman_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [33] ghosts_mode = 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [34] ghosts_mode_count = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [35] ghost1_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [36] ghost1_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [37] ghost1_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [38] ghost1_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [39] ghost1_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [40] ghost1_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [41] ghost2_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [42] ghost2_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [43] ghost2_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [44] ghost2_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [45] ghost2_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [46] ghost2_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [47] ghost3_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [48] ghost3_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [49] ghost3_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [50] ghost3_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [51] ghost3_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [52] ghost3_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [53] ghost4_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [54] ghost4_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [55] ghost4_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [56] ghost4_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [57] ghost4_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [58] ghost4_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [59] game_logic_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [60] game_playable = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} always clobbers reg byte a reg byte x +Statement asm { jsrRASTER_CODE } always clobbers reg byte a reg byte x reg byte y +Statement [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [82] if(0!=frame) goto irq_screen_top::toDd001 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [85] canvas_base_hi = >SPRITES_2 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [87] if(phase==0) goto irq_screen_top::@2 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a +Statement [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ ] ( [ ] { } ) always clobbers reg byte a +Statement [94] *HARDWARE_IRQ = &irq_screen_top [ ] ( [ ] { } ) always clobbers reg byte a +Statement [95] return [ ] ( [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [96] music_play_next = 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [99] canvas_base_hi = >SPRITES_1 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [100] bobs_restore_base = 0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [107] if(game_playable!=0) goto game_logic::@1 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [112] if(game_logic_substep==0) goto game_logic::@2 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [113] if(game_logic_substep==1) goto game_logic::@3 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [114] if(game_logic_substep==2) goto game_logic::@4 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [115] if(game_logic_substep==4) goto game_logic::@5 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [116] if(game_logic_substep==5) goto game_logic::@6 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [117] if(game_logic_substep==6) goto game_logic::@7 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] { } ) always clobbers reg byte a +Statement [118] if(game_logic_substep==3) goto game_logic::@14 [ pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] { } ) always clobbers reg byte a +Statement [119] if(game_logic_substep==7) goto game_logic::@14 [ pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ] { } ) always clobbers reg byte a +Statement [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 [ pacman_ch1_enabled anim_frame_idx pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$17 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$17 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:184 [ game_logic::pacman_bob_xfine#0 ] +Statement [128] game_logic::$19 = pacman_direction | anim_frame_idx [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$19 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$19 ] { } ) always clobbers reg byte a +Statement [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$19 game_logic::$20 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$19 game_logic::$20 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:187 [ game_logic::$19 ] +Statement [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$21 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$21 ] { } ) always clobbers reg byte a +Statement [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 [ pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +Statement [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 [ pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#1 ] { } ) always clobbers reg byte a +Statement [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$25 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$25 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:190 [ game_logic::ghost1_bob_xfine#0 ] +Statement [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$27 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$27 ] { } ) always clobbers reg byte a +Statement [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$27 game_logic::$28 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$27 game_logic::$28 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:193 [ game_logic::$27 ] +Statement [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$29 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$29 ] { } ) always clobbers reg byte a +Statement [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$31 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$31 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:196 [ game_logic::ghost2_bob_xfine#0 ] +Statement [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$33 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$33 ] { } ) always clobbers reg byte a +Statement [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$33 game_logic::$34 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$33 game_logic::$34 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:199 [ game_logic::$33 ] +Statement [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$35 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$35 ] { } ) always clobbers reg byte a +Statement [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$37 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$37 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:202 [ game_logic::ghost3_bob_xfine#0 ] +Statement [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$39 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$39 ] { } ) always clobbers reg byte a +Statement [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$39 game_logic::$40 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$39 game_logic::$40 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:205 [ game_logic::$39 ] +Statement [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$41 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$41 ] { } ) always clobbers reg byte a +Statement [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost4_bob_xfine#0 game_logic::$43 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost4_bob_xfine#0 game_logic::$43 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:208 [ game_logic::ghost4_bob_xfine#0 ] +Statement [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled game_logic::ghost4_bob_xfine#0 game_logic::$45 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost4_bob_xfine#0 game_logic::$45 ] { } ) always clobbers reg byte a +Statement [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 [ pacman_ch1_enabled game_logic::$45 game_logic::$46 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::$45 game_logic::$46 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:211 [ game_logic::$45 ] +Statement [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 [ pacman_ch1_enabled game_logic::$47 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::$47 ] { } ) always clobbers reg byte a +Statement [173] if(ghosts_mode==SCATTER) goto game_logic::@45 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [174] if(ghosts_mode==CHASE) goto game_logic::@46 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [177] ghosts_mode = CHASE [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [178] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [181] ghost1_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [182] ghost2_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [183] ghost3_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [184] ghost4_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 ] { } ) always clobbers reg byte a +Statement [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::pacman_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::pacman_ytile#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:214 [ game_logic::pacman_xtile#0 ] +Statement [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 ] { } ) always clobbers reg byte a +Statement [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:216 [ game_logic::$210 ] +Statement [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] { } ) always clobbers reg byte a +Statement [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:219 [ game_logic::tile_id#0 ] +Statement [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$65 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$65 ] { } ) always clobbers reg byte a +Statement [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$66 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$66 ] { } ) always clobbers reg byte a +Statement [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$67 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$67 ] { } ) always clobbers reg byte a +Statement [197] logic_tile_ptr = game_logic::$67 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] { } ) always clobbers reg byte a +Statement [200] ghosts_mode = FRIGHTENED [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [201] ghosts_mode_count = 0 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [202] game_logic::$75 = pacman_xfine - ghost1_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 ] { } ) always clobbers reg byte a +Statement [203] game_logic::$77 = pacman_yfine - ghost1_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 game_logic::$77 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 game_logic::$77 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:225 [ game_logic::$75 ] +Statement [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$77 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$77 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:226 [ game_logic::$77 ] +Statement [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [206] game_logic::$80 = pacman_xfine - ghost2_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 ] { } ) always clobbers reg byte a +Statement [207] game_logic::$82 = pacman_yfine - ghost2_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 game_logic::$82 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 game_logic::$82 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:227 [ game_logic::$80 ] +Statement [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$82 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$82 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:228 [ game_logic::$82 ] +Statement [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [210] game_logic::$85 = pacman_xfine - ghost3_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$85 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$85 ] { } ) always clobbers reg byte a +Statement [211] game_logic::$87 = pacman_yfine - ghost3_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$85 game_logic::$87 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$85 game_logic::$87 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:229 [ game_logic::$85 ] +Statement [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$87 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$87 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:230 [ game_logic::$87 ] +Statement [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [214] game_logic::$90 = pacman_xfine - ghost4_xfine [ pacman_ch1_enabled pacman_lives pacman_yfine ghosts_mode ghost4_yfine game_logic::$90 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_yfine ghosts_mode ghost4_yfine game_logic::$90 ] { } ) always clobbers reg byte a +Statement [215] game_logic::$92 = pacman_yfine - ghost4_yfine [ pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$90 game_logic::$92 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$90 game_logic::$92 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:231 [ game_logic::$90 ] +Statement [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return [ pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$92 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$92 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:232 [ game_logic::$92 ] +Statement [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 [ pacman_ch1_enabled pacman_lives ghosts_mode ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode ] { } ) always clobbers reg byte a +Statement [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [221] ghost4_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [222] ghost4_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [223] ghost4_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [224] ghost4_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [225] ghost4_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [229] ghost3_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [230] ghost3_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [231] ghost3_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [232] ghost3_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [233] ghost3_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [237] ghost2_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [238] ghost2_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [239] ghost2_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [240] ghost2_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [241] ghost2_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [245] ghost1_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [246] ghost1_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [247] ghost1_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [248] ghost1_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [249] ghost1_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$69 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$69 ] { } ) always clobbers reg byte a +Statement [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$70 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$70 ] { } ) always clobbers reg byte a +Statement [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$71 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$71 ] { } ) always clobbers reg byte a +Statement [255] logic_tile_ptr = game_logic::$71 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] { } ) always clobbers reg byte a +Statement [258] pill_count = -- pill_count [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [259] if(pill_count!=0) goto game_logic::@50 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [260] pacman_wins = 1 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [262] ghosts_mode = SCATTER [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [263] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [265] ghosts_mode = CHASE [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [266] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [267] if(0!=ghost4_respawn) goto game_logic::@72 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn ] { } ) always clobbers reg byte a +Statement [268] if(ghost4_direction==RIGHT) goto game_logic::@73 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [269] if(ghost4_direction==DOWN) goto game_logic::@74 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [270] if(ghost4_direction==LEFT) goto game_logic::@75 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [271] if(ghost4_direction!=UP) goto game_logic::@76 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [274] if(ghost4_substep!=0) goto game_logic::@82 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse game_logic::$220 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse game_logic::$220 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:238 [ game_logic::$220 ] +Statement [276] ghost4_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse ] { } ) always clobbers reg byte a +Statement [277] if(0!=ghost4_reverse) goto game_logic::@78 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ] { } ) always clobbers reg byte a +Statement [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_yfine ghost4_direction game_logic::ghost4_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_yfine ghost4_direction game_logic::ghost4_xtile#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } ) always clobbers reg byte a +Statement [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:239 [ game_logic::ghost4_xtile#0 ] +Statement [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:240 [ game_logic::ghost4_ytile#0 ] +Statement [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:243 [ game_logic::open_directions#1 ] +Statement [287] if(ghosts_mode==SCATTER) goto game_logic::@80 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Statement [288] game_logic::target_xtile#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 ] { } ) always clobbers reg byte a +Statement [289] game_logic::target_ytile#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 game_logic::target_ytile#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 game_logic::target_ytile#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:4 [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +Statement [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [302] ghost4_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [303] ghost4_substep = 1 [ pacman_ch1_enabled ghost4_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ] { } ) always clobbers reg byte a +Statement [304] if(ghost4_xfine==1) goto game_logic::@81 [ pacman_ch1_enabled ghost4_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ] { } ) always clobbers reg byte a +Statement [305] if(ghost4_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [306] ghost4_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [307] ghost4_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [312] if(ghost4_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [313] ghost4_direction = RIGHT [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [314] ghost4_xfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [315] ghost4_yfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [316] ghost4_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [317] if(0!=ghost3_respawn) goto game_logic::@89 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ] { } ) always clobbers reg byte a +Statement [318] if(ghost3_direction==RIGHT) goto game_logic::@90 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [319] if(ghost3_direction==DOWN) goto game_logic::@91 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [320] if(ghost3_direction==LEFT) goto game_logic::@92 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [321] if(ghost3_direction!=UP) goto game_logic::@93 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [324] if(ghost3_substep!=0) goto game_logic::@99 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse game_logic::$223 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse game_logic::$223 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:246 [ game_logic::$223 ] +Statement [326] ghost3_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse ] { } ) always clobbers reg byte a +Statement [327] if(0!=ghost3_reverse) goto game_logic::@95 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ] { } ) always clobbers reg byte a +Statement [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost3_direction game_logic::ghost3_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost3_direction game_logic::ghost3_xtile#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:247 [ game_logic::ghost3_xtile#0 ] +Statement [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:248 [ game_logic::ghost3_ytile#0 ] +Statement [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:251 [ game_logic::open_directions1#1 ] +Statement [337] if(ghosts_mode==SCATTER) goto game_logic::@97 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Statement [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 ] { } ) always clobbers reg byte a +Statement [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 game_logic::target_ytile1#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 game_logic::target_ytile1#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:6 [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +Statement [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [352] ghost3_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [353] ghost3_substep = 1 [ pacman_ch1_enabled ghost3_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ] { } ) always clobbers reg byte a +Statement [354] if(ghost3_xfine==1) goto game_logic::@98 [ pacman_ch1_enabled ghost3_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ] { } ) always clobbers reg byte a +Statement [355] if(ghost3_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [356] ghost3_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [357] ghost3_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [362] if(ghost3_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [363] ghost3_direction = UP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [364] ghost3_xfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [365] ghost3_yfine = $46 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [366] ghost3_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [367] if(0!=ghost2_respawn) goto game_logic::@106 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ] { } ) always clobbers reg byte a +Statement [368] if(ghost2_direction==RIGHT) goto game_logic::@107 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [369] if(ghost2_direction==DOWN) goto game_logic::@108 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [370] if(ghost2_direction==LEFT) goto game_logic::@109 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [371] if(ghost2_direction!=UP) goto game_logic::@110 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [374] if(ghost2_substep!=0) goto game_logic::@116 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse game_logic::$226 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse game_logic::$226 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:254 [ game_logic::$226 ] +Statement [376] ghost2_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse ] { } ) always clobbers reg byte a +Statement [377] if(0!=ghost2_reverse) goto game_logic::@112 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ] { } ) always clobbers reg byte a +Statement [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost2_direction game_logic::ghost2_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost2_direction game_logic::ghost2_xtile#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:255 [ game_logic::ghost2_xtile#0 ] +Statement [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:256 [ game_logic::ghost2_ytile#0 ] +Statement [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:259 [ game_logic::open_directions2#1 ] +Statement [387] if(ghosts_mode==SCATTER) goto game_logic::@114 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Statement [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 ] { } ) always clobbers reg byte a +Statement [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 game_logic::target_ytile2#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 game_logic::target_ytile2#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:8 [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +Statement [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [402] ghost2_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [403] ghost2_substep = 1 [ pacman_ch1_enabled ghost2_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ] { } ) always clobbers reg byte a +Statement [404] if(ghost2_xfine==1) goto game_logic::@115 [ pacman_ch1_enabled ghost2_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ] { } ) always clobbers reg byte a +Statement [405] if(ghost2_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [406] ghost2_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [407] ghost2_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [412] if(ghost2_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [413] ghost2_direction = LEFT [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [414] ghost2_xfine = $60 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [415] ghost2_yfine = $46 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [416] ghost2_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [417] if(0!=ghost1_respawn) goto game_logic::@123 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ] { } ) always clobbers reg byte a +Statement [418] if(ghost1_direction==RIGHT) goto game_logic::@124 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [419] if(ghost1_direction==DOWN) goto game_logic::@125 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [420] if(ghost1_direction==LEFT) goto game_logic::@126 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [421] if(ghost1_direction!=UP) goto game_logic::@127 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [424] if(ghost1_substep!=0) goto game_logic::@133 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse game_logic::$229 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse game_logic::$229 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:262 [ game_logic::$229 ] +Statement [426] ghost1_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse ] { } ) always clobbers reg byte a +Statement [427] if(0!=ghost1_reverse) goto game_logic::@129 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ] { } ) always clobbers reg byte a +Statement [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost1_direction game_logic::ghost1_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost1_direction game_logic::ghost1_xtile#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:263 [ game_logic::ghost1_xtile#0 ] +Statement [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:264 [ game_logic::ghost1_ytile#0 ] +Statement [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:267 [ game_logic::open_directions3#1 ] +Statement [437] if(ghosts_mode==SCATTER) goto game_logic::@131 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Statement [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 ] { } ) always clobbers reg byte a +Statement [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 game_logic::target_ytile3#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 game_logic::target_ytile3#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:10 [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +Statement [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [452] ghost1_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [453] ghost1_substep = 1 [ pacman_ch1_enabled ghost1_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ] { } ) always clobbers reg byte a +Statement [454] if(ghost1_xfine==1) goto game_logic::@132 [ pacman_ch1_enabled ghost1_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ] { } ) always clobbers reg byte a +Statement [455] if(ghost1_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [456] ghost1_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [457] ghost1_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [462] if(ghost1_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [463] ghost1_direction = DOWN [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [464] ghost1_xfine = $60 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [465] ghost1_yfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [466] ghost1_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [467] if(pacman_direction==RIGHT) goto game_logic::@140 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [468] if(pacman_direction==DOWN) goto game_logic::@141 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [469] if(pacman_direction==LEFT) goto game_logic::@142 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [470] if(pacman_direction!=UP) goto game_logic::@143 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [473] if(pacman_substep!=0) goto game_logic::@147 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction game_logic::$232 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction game_logic::$232 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:270 [ game_logic::$232 ] +Statement [475] pacman_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine pacman_direction game_logic::pacman_xtile1#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine pacman_direction game_logic::pacman_xtile1#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 [ pacman_ch1_enabled pacman_direction game_logic::pacman_xtile1#0 game_logic::pacman_ytile1#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::pacman_xtile1#0 game_logic::pacman_ytile1#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:271 [ game_logic::pacman_xtile1#0 ] +Statement [483] game_logic::$199 = *((byte*)CIA1) & $f [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$199 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$199 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:274 [ game_logic::open_directions4#0 ] +Statement [484] game_logic::$200 = game_logic::$199 ^ $f [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$200 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$200 ] { } ) always clobbers reg byte a +Statement [485] game_logic::joy_directions#0 = game_logic::$200 << 2 [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::joy_directions#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::joy_directions#0 ] { } ) always clobbers reg byte a +Statement [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [492] pacman_substep = 1 [ pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_xfine ] { } ) always clobbers reg byte a +Statement [493] pacman_ch1_enabled = 1 [ pacman_ch1_enabled pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine ] { } ) always clobbers reg byte a +Statement [494] if(pacman_xfine==1) goto game_logic::@146 [ pacman_ch1_enabled pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine ] { } ) always clobbers reg byte a +Statement [495] if(pacman_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [496] pacman_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [497] pacman_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a +Statement [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a reg byte y +Statement [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a reg byte y +Statement [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [506] pacman_ch1_idx = 0 [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [507] pacman_ch1_enabled = 0 [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [513] *PROCPORT = PROCPORT_RAM_ALL [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [546] *PROCPORT = PROCPORT_RAM_IO [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [550] *((byte*)CIA2) = splash_run::toDd001_return#0 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:13 [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +Statement [551] canvas_base_hi = >SPRITES_2 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [562] top_sprites_mc = 3 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [563] side_sprites_mc = 0 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [564] bottom_sprites_mc = 3 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [565] top_sprites_color = YELLOW [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [566] side_sprites_color = BLUE [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [567] bottom_sprites_color = YELLOW [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ top_sprites_color ] ( main:62::splash_run:102 [ top_sprites_color ] { } ) always clobbers reg byte a +Statement [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement asm { lda#1 staINTRO_MUSIC+$69 } always clobbers reg byte a +Statement asm { lda#0 } always clobbers reg byte a +Statement [576] call *musicInit [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [577] phase = 0 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [582] *HARDWARE_IRQ = &irq_screen_top [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement asm { ldaCIA1_INTERRUPT } always clobbers reg byte a +Statement [585] *IRQ_STATUS = $f [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [589] music_play_next = 0 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [596] if(0==music_play_next) goto splash_run::@13 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [597] call *musicPlay [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [598] music_play_next = 0 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [599] bobs_xcol[splash_run::i2#2] = $a [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:15 [ splash_run::i2#2 splash_run::i2#1 ] +Statement [600] bobs_yfine[splash_run::i2#2] = $2d [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Statement [601] bobs_bob_id[splash_run::i2#2] = 0 [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Statement [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color [ top_sprites_color splash_run::i1#2 ] ( main:62::splash_run:102 [ top_sprites_color splash_run::i1#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:14 [ splash_run::i1#2 splash_run::i1#1 ] +Statement [605] splash_run::$34 = splash_run::i#2 << 1 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] +Statement [606] SPRITES_YPOS[splash_run::$34] = 7 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:284 [ splash_run::$34 ] +Statement [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] [ splash_run::i#2 splash_run::msb#10 splash_run::$34 splash_run::xpos#0 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 splash_run::xpos#0 ] { } ) always clobbers reg byte a +Statement [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 [ splash_run::i#2 splash_run::msb#10 splash_run::xpos#0 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::xpos#0 ] { } ) always clobbers reg byte a +Statement [612] splash_run::msb#2 = splash_run::msb#1 | $80 [ splash_run::i#2 splash_run::msb#2 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#2 ] { } ) always clobbers reg byte a +Statement [619] pacman_wins = 0 [ pacman_wins ] ( main:62::gameplay_run:104 [ pacman_wins ] { } ) always clobbers reg byte a +Statement [620] pacman_lives = 3 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED [ pacman_wins pacman_lives byteboozer_decrunch::crunched ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [633] level_show::return#0 = level_show::count#12 [ pacman_wins pacman_lives level_show::return#0 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives level_show::return#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [634] gameplay_run::$4 = level_show::return#0 [ pacman_wins pacman_lives gameplay_run::$4 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives gameplay_run::$4 ] { } ) always clobbers reg byte a +Statement [635] pill_count = gameplay_run::$4 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [636] top_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [637] side_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [638] bottom_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [639] top_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [640] side_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [641] bottom_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ top_sprites_color pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [647] phase = 1 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [651] game_playable = 1 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [657] *HARDWARE_IRQ = &irq_screen_top [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement asm { ldaCIA1_INTERRUPT } always clobbers reg byte a +Statement [660] *IRQ_STATUS = $f [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [662] if(0!=pacman_wins) goto gameplay_run::@return [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [663] if(pacman_lives==0) goto gameplay_run::@return [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color [ top_sprites_color pacman_wins pacman_lives gameplay_run::i2#2 ] ( main:62::gameplay_run:104 [ top_sprites_color pacman_wins pacman_lives gameplay_run::i2#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:18 [ gameplay_run::i2#2 gameplay_run::i2#1 ] +Statement [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK [ pacman_wins pacman_lives gameplay_run::i1#2 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives gameplay_run::i1#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:17 [ gameplay_run::i1#2 gameplay_run::i1#1 ] +Statement [669] ((byte*)SID)[gameplay_run::i#2] = 0 [ gameplay_run::i#2 ] ( main:62::gameplay_run:104 [ gameplay_run::i#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:16 [ gameplay_run::i#2 gameplay_run::i#1 ] +Statement [671] game_playable = 0 [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a +Statement [672] phase = 0 [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a +Statement asm { lda#0 } always clobbers reg byte a +Statement [678] call *musicInit [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [679] if(0!=pacman_wins) goto done_run::@1 [ ] ( main:62::done_run:106 [ ] { } ) always clobbers reg byte a +Statement [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::done_run:106 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [684] music_play_next = 0 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [691] if(0==music_play_next) goto done_run::@13 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [692] call *musicPlay [ ] ( main:62::done_run:106 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [693] music_play_next = 0 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [697] done_run::pixels#0 = *done_run::gfx#2 [ done_run::xcol#2 done_run::gfx#2 done_run::ypos#2 done_run::pixels#0 ] ( main:62::done_run:106 [ done_run::xcol#2 done_run::gfx#2 done_run::ypos#2 done_run::pixels#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte a as potential for zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] +Statement [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::done_run:106 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [706] bobs_xcol[done_run::i1#2] = $a [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:20 [ done_run::i1#2 done_run::i1#1 ] +Statement [707] bobs_yfine[done_run::i1#2] = $2d [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Statement [708] bobs_bob_id[done_run::i1#2] = 0 [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Statement [710] ((byte*)SID)[done_run::i#2] = 0 [ pacman_wins done_run::i#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:19 [ done_run::i#2 done_run::i#1 ] +Statement [712] ghosts_mode_count = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [713] pacman_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [714] ghost1_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [715] ghost2_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [716] ghost3_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [717] ghost4_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [718] pacman_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [719] ghost1_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [720] ghost2_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [721] ghost3_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [722] ghost4_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [723] pacman_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [724] ghost1_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [725] ghost2_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [726] ghost3_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [727] ghost4_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [728] ghost1_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [729] ghost2_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [730] ghost3_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [731] ghost4_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [732] pacman_yfine = $3e [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [733] ghost1_respawn = $a [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [734] ghost2_respawn = $14 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [735] ghost3_respawn = $1e [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [736] ghost4_respawn = $28 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 [ level_tile_directions::xtile#5 level_tile_directions::$5 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:25 [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +Statement [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] [ level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] [ level_tile_directions::return#0 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::return#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 [ choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +Statement [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:298 [ choose_direction::xdiff#0 ] +Statement [749] choose_direction::$2 = choose_direction::open_directions#10 & UP [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:299 [ choose_direction::ydiff#0 ] +Statement [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +Statement [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:34 [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +Statement [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT [ choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +Statement [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] [ choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [777] if(memset::num#5<=0) goto memset::@return [ memset::num#5 memset::str#6 ] ( main:62::splash_run:102::memset:514 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:522 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:524 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:532 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:544 [ memset::num#5 memset::str#6 ] { } ) always clobbers reg byte a +Statement [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 [ memset::str#6 memset::end#0 ] ( main:62::splash_run:102::memset:514 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:522 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:524 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:532 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:544 [ memset::str#6 memset::end#0 ] { } ) always clobbers reg byte a +Statement [779] memset::dst#4 = (byte*)memset::str#6 [ memset::end#0 memset::dst#4 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a +Statement [781] if(memset::dst#2!=memset::end#0) goto memset::@3 [ memset::end#0 memset::dst#2 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a +Statement [783] *memset::dst#2 = 0 [ memset::end#0 memset::dst#2 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } always clobbers reg byte a reg byte x reg byte y +Statement [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] { } ) always clobbers reg byte a reg byte y +Statement [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 ] { } ) always clobbers reg byte a +Statement [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 merge_code::cycle_budget#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 merge_code::cycle_budget#0 ] { } ) always clobbers reg byte a reg byte y +Statement [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#2 merge_code::cycle_budget#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#2 merge_code::cycle_budget#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:51 [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +Statement [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 [ merge_code::logic_code#12 merge_code::dest_code#12 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::logic_code#12 merge_code::dest_code#12 ] { } ) always clobbers reg byte a reg byte y +Statement [796] *merge_code::dest_code#12 = $60 [ ] ( main:62::splash_run:102::merge_code:520 [ ] { } ) always clobbers reg byte a reg byte y +Statement [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 [ merge_code::dest_code#12 merge_code::logic_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#12 merge_code::logic_code#3 ] { } ) always clobbers reg byte a +Statement [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 [ merge_code::dest_code#13 merge_code::logic_code#14 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#13 merge_code::logic_code#14 ] { } ) always clobbers reg byte a reg byte y +Statement [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 [ merge_code::logic_code#5 merge_code::dest_code#13 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::logic_code#5 merge_code::dest_code#13 ] { } ) always clobbers reg byte a +Statement [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 [ merge_code::dest_code#13 merge_code::logic_code#14 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#13 merge_code::logic_code#14 ] { } ) always clobbers reg byte a reg byte y +Statement [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:51 [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +Statement [813] *merge_code::dest_code#10 = $ea [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] { } ) always clobbers reg byte a reg byte y +Statement [816] *merge_code::dest_code#10 = $24 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] { } ) always clobbers reg byte a reg byte y +Statement [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] { } ) always clobbers reg byte a +Statement [818] *merge_code::dest_code#2 = $ea [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] { } ) always clobbers reg byte a reg byte y +Statement [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#3 ] { } ) always clobbers reg byte a +Statement [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#2 merge_code::dest_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#2 merge_code::dest_code#3 ] { } ) always clobbers reg byte a reg byte x +Statement [823] merge_code::logic_code#0 = ++ merge_code::logic_code#17 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 merge_code::logic_code#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 merge_code::logic_code#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:309 [ merge_code::logic_cycles#0 ] +Statement [825] if(*merge_code::logic_code#10!=merge_code::LOGIC_END) goto merge_code::@7 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:309 [ merge_code::logic_cycles#0 ] +Statement [826] merge_code::logic_code#2 = ++ merge_code::logic_code#10 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::logic_code#2 merge_code::dest_code#15 merge_code::logic_cycles#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::logic_code#2 merge_code::dest_code#15 merge_code::logic_cycles#0 ] { } ) always clobbers reg byte a +Statement [827] merge_code::cycle_budget#1 = merge_code::cycle_budget#13 - merge_code::logic_cycles#0 [ merge_code::raster_code#2 merge_code::cycle_budget#1 merge_code::logic_code#2 merge_code::dest_code#15 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#1 merge_code::logic_code#2 merge_code::dest_code#15 ] { } ) always clobbers reg byte a +Statement [828] *merge_code::dest_code#15 = *merge_code::logic_code#10 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] { } ) always clobbers reg byte a reg byte y +Statement [831] *merge_code::dest_code#14 = *merge_code::raster_code#4 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] { } ) always clobbers reg byte a reg byte y +Statement [837] *(RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC) = 0 [ ] ( main:62::splash_run:102::init_render_index:526 [ ] { } ) always clobbers reg byte a +Statement [838] *(RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC) = 0 [ ] ( main:62::splash_run:102::init_render_index:526 [ ] { } ) always clobbers reg byte a +Statement [843] init_render_index::$9 = init_render_index::x_col#2 << 1 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::$9 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::$9 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:62 [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +Statement [844] init_render_index::canvas_xcol#0 = RENDER_XCOLS[init_render_index::$9] [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 ] { } ) always clobbers reg byte a +Statement [845] init_render_index::render_index_xcol#7 = init_render_index::render_index_xcol#0 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 init_render_index::render_index_xcol#7 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 init_render_index::render_index_xcol#7 ] { } ) always clobbers reg byte a +Statement [848] init_render_index::render_index#1 = init_render_index::render_index_xcol#0 + $100 [ init_render_index::x_col#2 init_render_index::render_index#1 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index#1 ] { } ) always clobbers reg byte a +Statement [850] init_render_index::$11 = (word)init_render_index::y_pos#2 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$11 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$11 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Statement [851] init_render_index::$10 = init_render_index::$11 << 1 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$10 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$10 ] { } ) always clobbers reg byte a +Statement [852] init_render_index::$12 = init_render_index::render_ypos_table#4 + init_render_index::$10 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$12 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$12 ] { } ) always clobbers reg byte a +Statement [853] init_render_index::canvas#0 = init_render_index::canvas_xcol#0 + *init_render_index::$12 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:62 [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +Statement [855] *init_render_index::render_index_xcol#2 = init_render_index::$5 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] { } ) always clobbers reg byte y +Statement [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] { } ) always clobbers reg byte y +Statement [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] { } ) always clobbers reg byte a reg byte y +Statement [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#3 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#3 ] { } ) always clobbers reg byte a reg byte x +Removing always clobbered register reg byte x as potential for zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Removing always clobbered register reg byte x as potential for zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Statement [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#1 init_render_index::render_index_xcol#1 init_render_index::ypos_inc_offset#8 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#1 init_render_index::render_index_xcol#1 init_render_index::ypos_inc_offset#8 ] { } ) always clobbers reg byte a +Statement [872] splash_show::pixels#0 = *splash_show::splash#2 [ splash_show::xcol#2 splash_show::splash#2 splash_show::ypos#2 splash_show::pixels#0 ] ( main:62::splash_run:102::splash_show:530 [ splash_show::xcol#2 splash_show::splash#2 splash_show::ypos#2 splash_show::pixels#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte a as potential for zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] +Statement [882] logic_tile_ptr = LEVEL_TILES+(word)$40*$12+$c [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [883] logic_tile_xcol = $c [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [884] logic_tile_yfine = $23 [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [888] *init_bobs_restore::bob_restore#5 = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte a as potential for zp[1]:67 [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:67 [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +Statement [889] init_bobs_restore::bob_restore#5[1] = >init_bobs_restore::CANVAS_HIDDEN [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [890] init_bobs_restore::bob_restore#5[3] = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#1 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#1 ] { } ) always clobbers reg byte a +Statement [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 init_bobs_restore::i#2 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 init_bobs_restore::i#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:70 [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +Statement [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:71 [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +Statement [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] { } ) always clobbers reg byte a +Statement [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:76 [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +Statement [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] { } ) always clobbers reg byte a +Statement [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 [ memcpy::src#2 memcpy::dst#2 ] ( main:62::splash_run:102::memcpy:540 [ memcpy::src#2 memcpy::dst#2 ] { } ) always clobbers reg byte a +Statement [914] *memcpy::dst#2 = *memcpy::src#2 [ memcpy::src#2 memcpy::dst#2 ] ( main:62::splash_run:102::memcpy:540 [ memcpy::src#2 memcpy::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 [ ] ( main:62::splash_run:102::joyinit:588 [ ] { } ) always clobbers reg byte a +Statement [919] joyfire::$0 = *((byte*)CIA1) & $10 [ joyfire::$0 ] ( main:62::splash_run:102::joyfire:591 [ music_play_next joyfire::$0 ] { { joyfire::return#1 = joyfire::return#4 } } main:62::done_run:106::joyfire:686 [ music_play_next joyfire::$0 ] { { joyfire::return#0 = joyfire::return#4 } } ) always clobbers reg byte a +Statement [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#1 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +Statement [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +Statement [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +Statement [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#2 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#2 ] { } ) always clobbers reg byte a +Statement [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 ] { } ) always clobbers reg byte a +Statement [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#3 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#3 ] { } ) always clobbers reg byte a +Statement [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 ] { } ) always clobbers reg byte a +Statement [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#4 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#4 ] { } ) always clobbers reg byte a +Statement [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] { } ) always clobbers reg byte a +Statement [972] level_show::level#1 = level_show::level#8 + $40 [ level_show::ytile#2 level_show::count#10 level_show::level#1 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::count#10 level_show::level#1 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] +Statement [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] [ level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::xtile#3 level_show::tile_left#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::xtile#3 level_show::tile_left#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] +Statement [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 [ level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:338 [ level_show::tile_left#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:339 [ level_show::xtile#1 ] +Statement [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] [ level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 level_show::count#5 level_show::tile_right#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 level_show::count#5 level_show::tile_right#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 [ level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::tile_left#0 level_show::count#5 level_show::tile_right#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::tile_left#0 level_show::count#5 level_show::tile_right#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:340 [ level_show::tile_right#0 ] +Statement [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [991] *((word*)SID) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [998] render::ytile#0 = render::ypos#2 >> 2 [ render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] +Statement [999] render::$1 = >RENDER_INDEX + render::xcol#2 [ render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:345 [ render::ytile#0 ] +Statement [1000] render::$2 = render::ytile#0 << 1 [ render::ypos#2 render::pixels#4 render::$1 render::$2 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::$1 render::$2 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::$1 render::$2 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:346 [ render::$1 ] +Statement [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] +Statement [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] [ render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1006] render::ypix#0 = render::ypos#2 & 3 [ render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:100 [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +Statement [1009] *render::canvas1#2 = render::pixels#4 [ render::pixels#4 render::canvas2#2 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::canvas2#2 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::canvas2#2 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1010] *render::canvas2#2 = render::pixels#4 [ ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1012] render::canvas1#1 = render::canvas1#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] [ render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:352 [ render::ypix#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:97 [ render::i#2 render::i#1 ] +Statement [1013] render::canvas2#1 = render::canvas2#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] [ render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 [ level_tile_get::xtile#4 level_tile_get::$5 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:103 [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +Statement [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] [ level_tile_get::xtile#4 level_tile_get::ytiles#0 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Statement [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] [ level_tile_get::return#0 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::return#0 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::return#0 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::return#0 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::return#0 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Statement [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::$0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::$0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:341 [ render_tiles::xcol#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:342 [ render_tiles::ytile#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:344 [ render_tiles::tile_right#0 ] +Statement [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::tile_left_pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::tile_left_pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::$2 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::$2 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 [ render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 render_tiles::$5 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 render_tiles::$5 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:362 [ render_tiles::$4 ] +Statement [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] +Statement [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 render_tiles::canvas1#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 render_tiles::canvas1#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas1#0 render_tiles::canvas2#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas1#0 render_tiles::canvas2#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::canvas1#0 render_tiles::canvas2#0 render_tiles::ypos_inc_offset#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::canvas1#0 render_tiles::canvas2#0 render_tiles::ypos_inc_offset#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a reg byte y +Statement [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:111 [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +Statement [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:111 [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:368 [ render_tiles::pixels#0 ] +Statement [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte y +Statement [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 render_tiles::canvas2#1 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 render_tiles::canvas2#1 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1] pacman_ch1_enabled = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] pacman_ch1_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] logic_tile_ptr = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] logic_tile_xcol = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] logic_tile_yfine = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [6] logic_tile_left_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [7] logic_tile_right_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [8] left_render_index_xcol = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [9] left_canvas = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [10] left_ypos_inc_offset = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [11] rigt_render_index_xcol = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [12] rigt_canvas = (byte*) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [13] rigt_ypos_inc_offset = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [14] canvas_base_hi = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [15] bobs_restore_base = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [16] top_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [17] top_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [18] side_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [19] side_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [20] bottom_sprites_color = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [21] bottom_sprites_mc = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [22] pill_count = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [23] pacman_wins = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [24] pacman_lives = 3 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [25] music_play_next = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [26] phase = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [27] frame = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [28] anim_frame_idx = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [29] pacman_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [30] pacman_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [31] pacman_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [32] pacman_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [33] ghosts_mode = 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [34] ghosts_mode_count = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [35] ghost1_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [36] ghost1_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [37] ghost1_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [38] ghost1_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [39] ghost1_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [40] ghost1_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [41] ghost2_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [42] ghost2_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [43] ghost2_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [44] ghost2_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [45] ghost2_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [46] ghost2_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [47] ghost3_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [48] ghost3_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [49] ghost3_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [50] ghost3_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [51] ghost3_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [52] ghost3_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [53] ghost4_xfine = $2d [ ] ( [ ] { } ) always clobbers reg byte a +Statement [54] ghost4_yfine = $23 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [55] ghost4_direction = STOP [ ] ( [ ] { } ) always clobbers reg byte a +Statement [56] ghost4_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [57] ghost4_reverse = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [58] ghost4_respawn = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [59] game_logic_substep = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [60] game_playable = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + }} always clobbers reg byte a reg byte x +Statement asm { jsrRASTER_CODE } always clobbers reg byte a reg byte x reg byte y +Statement [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color top_sprites_mc pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx top_sprites_color pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase frame anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [82] if(0!=frame) goto irq_screen_top::toDd001 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [85] canvas_base_hi = >SPRITES_2 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [87] if(phase==0) goto irq_screen_top::@2 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a +Statement [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ ] ( [ ] { } ) always clobbers reg byte a +Statement [94] *HARDWARE_IRQ = &irq_screen_top [ ] ( [ ] { } ) always clobbers reg byte a +Statement [95] return [ ] ( [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [96] music_play_next = 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [99] canvas_base_hi = >SPRITES_1 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [100] bobs_restore_base = 0 [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] ( [ pacman_ch1_enabled pacman_ch1_idx pill_count pacman_lives phase anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep game_playable ] { } ) always clobbers reg byte a +Statement [107] if(game_playable!=0) goto game_logic::@1 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [112] if(game_logic_substep==0) goto game_logic::@2 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction pacman_substep ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [113] if(game_logic_substep==1) goto game_logic::@3 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [114] if(game_logic_substep==2) goto game_logic::@4 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [115] if(game_logic_substep==4) goto game_logic::@5 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [116] if(game_logic_substep==5) goto game_logic::@6 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn game_logic_substep ] { } ) always clobbers reg byte a +Statement [117] if(game_logic_substep==6) goto game_logic::@7 [ pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] { } ) always clobbers reg byte a +Statement [118] if(game_logic_substep==3) goto game_logic::@14 [ pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic_substep ] { } ) always clobbers reg byte a +Statement [119] if(game_logic_substep==7) goto game_logic::@14 [ pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_xfine pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction ] { } ) always clobbers reg byte a +Statement [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 [ pacman_ch1_enabled anim_frame_idx pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$17 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx pacman_yfine pacman_direction ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$17 ] { } ) always clobbers reg byte a +Statement [128] game_logic::$19 = pacman_direction | anim_frame_idx [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$19 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::pacman_bob_xfine#0 game_logic::$19 ] { } ) always clobbers reg byte a +Statement [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$19 game_logic::$20 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$19 game_logic::$20 ] { } ) always clobbers reg byte a +Statement [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 [ pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$21 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled anim_frame_idx ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::$21 ] { } ) always clobbers reg byte a +Statement [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 [ pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#0 ] { } ) always clobbers reg byte a +Statement [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 [ pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#1 ] { } ) always clobbers reg byte a +Statement [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$25 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_yfine ghost1_direction ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$25 ] { } ) always clobbers reg byte a +Statement [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$27 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost1_bob_xfine#0 game_logic::$27 ] { } ) always clobbers reg byte a +Statement [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$27 game_logic::$28 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$27 game_logic::$28 ] { } ) always clobbers reg byte a +Statement [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 [ pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$29 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$29 ] { } ) always clobbers reg byte a +Statement [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$31 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_yfine ghost2_direction ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$31 ] { } ) always clobbers reg byte a +Statement [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$33 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost2_bob_xfine#0 game_logic::$33 ] { } ) always clobbers reg byte a +Statement [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$33 game_logic::$34 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$33 game_logic::$34 ] { } ) always clobbers reg byte a +Statement [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 [ pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$35 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$35 ] { } ) always clobbers reg byte a +Statement [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$37 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_yfine ghost3_direction ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$37 ] { } ) always clobbers reg byte a +Statement [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$39 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost3_bob_xfine#0 game_logic::$39 ] { } ) always clobbers reg byte a +Statement [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$39 game_logic::$40 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$39 game_logic::$40 ] { } ) always clobbers reg byte a +Statement [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 [ pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$41 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::$41 ] { } ) always clobbers reg byte a +Statement [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 [ pacman_ch1_enabled ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost4_bob_xfine#0 game_logic::$43 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_yfine ghost4_direction game_logic::ghost_frame_idx#2 game_logic::ghost4_bob_xfine#0 game_logic::$43 ] { } ) always clobbers reg byte a +Statement [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 [ pacman_ch1_enabled game_logic::ghost4_bob_xfine#0 game_logic::$45 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost4_bob_xfine#0 game_logic::$45 ] { } ) always clobbers reg byte a +Statement [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 [ pacman_ch1_enabled game_logic::$45 game_logic::$46 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::$45 game_logic::$46 ] { } ) always clobbers reg byte a +Statement [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 [ pacman_ch1_enabled game_logic::$47 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::$47 ] { } ) always clobbers reg byte a +Statement [173] if(ghosts_mode==SCATTER) goto game_logic::@45 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [174] if(ghosts_mode==CHASE) goto game_logic::@46 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghosts_mode_count ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [177] ghosts_mode = CHASE [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [178] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [181] ghost1_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [182] ghost2_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [183] ghost3_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [184] ghost4_reverse = 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 ] { } ) always clobbers reg byte a +Statement [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::pacman_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::pacman_ytile#0 ] { } ) always clobbers reg byte a +Statement [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 ] { } ) always clobbers reg byte a +Statement [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] { } ) always clobbers reg byte a +Statement [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::tile_id#0 ] { } ) always clobbers reg byte a +Statement [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$65 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$65 ] { } ) always clobbers reg byte a +Statement [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$66 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$66 ] { } ) always clobbers reg byte a +Statement [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$67 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$67 ] { } ) always clobbers reg byte a +Statement [197] logic_tile_ptr = game_logic::$67 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] { } ) always clobbers reg byte a +Statement [200] ghosts_mode = FRIGHTENED [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [201] ghosts_mode_count = 0 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [202] game_logic::$75 = pacman_xfine - ghost1_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 ] { } ) always clobbers reg byte a +Statement [203] game_logic::$77 = pacman_yfine - ghost1_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 game_logic::$77 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$75 game_logic::$77 ] { } ) always clobbers reg byte a +Statement [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$77 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$77 ] { } ) always clobbers reg byte a +Statement [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [206] game_logic::$80 = pacman_xfine - ghost2_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 ] { } ) always clobbers reg byte a +Statement [207] game_logic::$82 = pacman_yfine - ghost2_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 game_logic::$82 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$80 game_logic::$82 ] { } ) always clobbers reg byte a +Statement [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$82 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$82 ] { } ) always clobbers reg byte a +Statement [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [210] game_logic::$85 = pacman_xfine - ghost3_xfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$85 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$85 ] { } ) always clobbers reg byte a +Statement [211] game_logic::$87 = pacman_yfine - ghost3_yfine [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$85 game_logic::$87 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$85 game_logic::$87 ] { } ) always clobbers reg byte a +Statement [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$87 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine game_logic::$87 ] { } ) always clobbers reg byte a +Statement [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [214] game_logic::$90 = pacman_xfine - ghost4_xfine [ pacman_ch1_enabled pacman_lives pacman_yfine ghosts_mode ghost4_yfine game_logic::$90 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_yfine ghosts_mode ghost4_yfine game_logic::$90 ] { } ) always clobbers reg byte a +Statement [215] game_logic::$92 = pacman_yfine - ghost4_yfine [ pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$90 game_logic::$92 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$90 game_logic::$92 ] { } ) always clobbers reg byte a +Statement [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return [ pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$92 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode game_logic::$92 ] { } ) always clobbers reg byte a +Statement [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 [ pacman_ch1_enabled pacman_lives ghosts_mode ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ghosts_mode ] { } ) always clobbers reg byte a +Statement [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [221] ghost4_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [222] ghost4_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [223] ghost4_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [224] ghost4_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [225] ghost4_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [229] ghost3_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [230] ghost3_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [231] ghost3_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [232] ghost3_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [233] ghost3_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [237] ghost2_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [238] ghost2_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [239] ghost2_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [240] ghost2_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [241] ghost2_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 [ pacman_ch1_enabled pacman_lives ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives ] { } ) always clobbers reg byte a +Statement [245] ghost1_direction = STOP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [246] ghost1_xfine = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [247] ghost1_yfine = $23 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [248] ghost1_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [249] ghost1_respawn = $32 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 ] { } ) always clobbers reg byte a +Statement [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$69 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::pacman_xtile#0 game_logic::$210 game_logic::ytiles#0 game_logic::$69 ] { } ) always clobbers reg byte a +Statement [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$70 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::ytiles#0 game_logic::$70 ] { } ) always clobbers reg byte a +Statement [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$71 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 game_logic::$71 ] { } ) always clobbers reg byte a +Statement [255] logic_tile_ptr = game_logic::$71 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine game_logic::$210 ] { } ) always clobbers reg byte a +Statement [258] pill_count = -- pill_count [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [259] if(pill_count!=0) goto game_logic::@50 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [260] pacman_wins = 1 [ pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [262] ghosts_mode = SCATTER [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [263] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [265] ghosts_mode = CHASE [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [266] ghosts_mode_count = 0 [ pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pill_count pacman_lives pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost2_xfine ghost2_yfine ghost3_xfine ghost3_yfine ghost4_xfine ghost4_yfine ] { } ) always clobbers reg byte a +Statement [267] if(0!=ghost4_respawn) goto game_logic::@72 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ghost4_respawn ] { } ) always clobbers reg byte a +Statement [268] if(ghost4_direction==RIGHT) goto game_logic::@73 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [269] if(ghost4_direction==DOWN) goto game_logic::@74 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [270] if(ghost4_direction==LEFT) goto game_logic::@75 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [271] if(ghost4_direction!=UP) goto game_logic::@76 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_substep ghost4_reverse ] { } ) always clobbers reg byte a +Statement [274] if(ghost4_substep!=0) goto game_logic::@82 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse game_logic::$220 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse game_logic::$220 ] { } ) always clobbers reg byte a +Statement [276] ghost4_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ghost4_reverse ] { } ) always clobbers reg byte a +Statement [277] if(0!=ghost4_reverse) goto game_logic::@78 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_xfine ghost4_yfine ghost4_direction ] { } ) always clobbers reg byte a +Statement [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_yfine ghost4_direction game_logic::ghost4_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_yfine ghost4_direction game_logic::ghost4_xtile#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } ) always clobbers reg byte a +Statement [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } ) always clobbers reg byte a +Statement [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Statement [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Statement [287] if(ghosts_mode==SCATTER) goto game_logic::@80 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 ] { } ) always clobbers reg byte a +Statement [288] game_logic::target_xtile#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 ] { } ) always clobbers reg byte a +Statement [289] game_logic::target_ytile#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 game_logic::target_ytile#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 game_logic::open_directions#1 game_logic::target_xtile#2 game_logic::target_ytile#2 ] { } ) always clobbers reg byte a +Statement [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [302] ghost4_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [303] ghost4_substep = 1 [ pacman_ch1_enabled ghost4_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ] { } ) always clobbers reg byte a +Statement [304] if(ghost4_xfine==1) goto game_logic::@81 [ pacman_ch1_enabled ghost4_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost4_xfine ] { } ) always clobbers reg byte a +Statement [305] if(ghost4_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [306] ghost4_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [307] ghost4_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [312] if(ghost4_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [313] ghost4_direction = RIGHT [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [314] ghost4_xfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [315] ghost4_yfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [316] ghost4_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [317] if(0!=ghost3_respawn) goto game_logic::@89 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ghost3_respawn ] { } ) always clobbers reg byte a +Statement [318] if(ghost3_direction==RIGHT) goto game_logic::@90 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [319] if(ghost3_direction==DOWN) goto game_logic::@91 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [320] if(ghost3_direction==LEFT) goto game_logic::@92 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [321] if(ghost3_direction!=UP) goto game_logic::@93 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_substep ghost3_reverse ] { } ) always clobbers reg byte a +Statement [324] if(ghost3_substep!=0) goto game_logic::@99 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse game_logic::$223 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse game_logic::$223 ] { } ) always clobbers reg byte a +Statement [326] ghost3_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ghost3_reverse ] { } ) always clobbers reg byte a +Statement [327] if(0!=ghost3_reverse) goto game_logic::@95 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_xfine ghost3_yfine ghost3_direction ] { } ) always clobbers reg byte a +Statement [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost3_direction game_logic::ghost3_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_yfine ghost3_direction game_logic::ghost3_xtile#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Statement [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Statement [337] if(ghosts_mode==SCATTER) goto game_logic::@97 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 ] { } ) always clobbers reg byte a +Statement [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 ] { } ) always clobbers reg byte a +Statement [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 game_logic::target_ytile1#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 game_logic::open_directions1#1 game_logic::target_xtile1#2 game_logic::target_ytile1#2 ] { } ) always clobbers reg byte a +Statement [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [352] ghost3_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [353] ghost3_substep = 1 [ pacman_ch1_enabled ghost3_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ] { } ) always clobbers reg byte a +Statement [354] if(ghost3_xfine==1) goto game_logic::@98 [ pacman_ch1_enabled ghost3_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost3_xfine ] { } ) always clobbers reg byte a +Statement [355] if(ghost3_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [356] ghost3_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [357] ghost3_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [362] if(ghost3_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [363] ghost3_direction = UP [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [364] ghost3_xfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [365] ghost3_yfine = $46 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [366] ghost3_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [367] if(0!=ghost2_respawn) goto game_logic::@106 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ghost2_respawn ] { } ) always clobbers reg byte a +Statement [368] if(ghost2_direction==RIGHT) goto game_logic::@107 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [369] if(ghost2_direction==DOWN) goto game_logic::@108 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [370] if(ghost2_direction==LEFT) goto game_logic::@109 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [371] if(ghost2_direction!=UP) goto game_logic::@110 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_substep ghost2_reverse ] { } ) always clobbers reg byte a +Statement [374] if(ghost2_substep!=0) goto game_logic::@116 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse game_logic::$226 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse game_logic::$226 ] { } ) always clobbers reg byte a +Statement [376] ghost2_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ghost2_reverse ] { } ) always clobbers reg byte a +Statement [377] if(0!=ghost2_reverse) goto game_logic::@112 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_xfine ghost2_yfine ghost2_direction ] { } ) always clobbers reg byte a +Statement [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost2_direction game_logic::ghost2_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_yfine ghost2_direction game_logic::ghost2_xtile#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Statement [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Statement [387] if(ghosts_mode==SCATTER) goto game_logic::@114 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 ] { } ) always clobbers reg byte a +Statement [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 ] { } ) always clobbers reg byte a +Statement [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 game_logic::target_ytile2#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 game_logic::open_directions2#1 game_logic::target_xtile2#2 game_logic::target_ytile2#2 ] { } ) always clobbers reg byte a +Statement [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [402] ghost2_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [403] ghost2_substep = 1 [ pacman_ch1_enabled ghost2_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ] { } ) always clobbers reg byte a +Statement [404] if(ghost2_xfine==1) goto game_logic::@115 [ pacman_ch1_enabled ghost2_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost2_xfine ] { } ) always clobbers reg byte a +Statement [405] if(ghost2_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [406] ghost2_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [407] ghost2_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [412] if(ghost2_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [413] ghost2_direction = LEFT [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [414] ghost2_xfine = $60 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [415] ghost2_yfine = $46 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [416] ghost2_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [417] if(0!=ghost1_respawn) goto game_logic::@123 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ghost1_respawn ] { } ) always clobbers reg byte a +Statement [418] if(ghost1_direction==RIGHT) goto game_logic::@124 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [419] if(ghost1_direction==DOWN) goto game_logic::@125 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [420] if(ghost1_direction==LEFT) goto game_logic::@126 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [421] if(ghost1_direction!=UP) goto game_logic::@127 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_substep ghost1_reverse ] { } ) always clobbers reg byte a +Statement [424] if(ghost1_substep!=0) goto game_logic::@133 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse game_logic::$229 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse game_logic::$229 ] { } ) always clobbers reg byte a +Statement [426] ghost1_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ghost1_reverse ] { } ) always clobbers reg byte a +Statement [427] if(0!=ghost1_reverse) goto game_logic::@129 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_xfine ghost1_yfine ghost1_direction ] { } ) always clobbers reg byte a +Statement [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost1_direction game_logic::ghost1_xtile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_yfine ghost1_direction game_logic::ghost1_xtile#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Statement [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 [ pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Statement [437] if(ghosts_mode==SCATTER) goto game_logic::@131 [ pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 ] { } ) always clobbers reg byte a +Statement [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 ] { } ) always clobbers reg byte a +Statement [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 [ pacman_ch1_enabled game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 game_logic::target_ytile3#2 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 game_logic::open_directions3#1 game_logic::target_xtile3#2 game_logic::target_ytile3#2 ] { } ) always clobbers reg byte a +Statement [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a reg byte y +Statement [452] ghost1_reverse = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [453] ghost1_substep = 1 [ pacman_ch1_enabled ghost1_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ] { } ) always clobbers reg byte a +Statement [454] if(ghost1_xfine==1) goto game_logic::@132 [ pacman_ch1_enabled ghost1_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ghost1_xfine ] { } ) always clobbers reg byte a +Statement [455] if(ghost1_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [456] ghost1_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [457] ghost1_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [462] if(ghost1_respawn!=0) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [463] ghost1_direction = DOWN [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [464] ghost1_xfine = $60 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [465] ghost1_yfine = 2 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [466] ghost1_substep = 0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [467] if(pacman_direction==RIGHT) goto game_logic::@140 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [468] if(pacman_direction==DOWN) goto game_logic::@141 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [469] if(pacman_direction==LEFT) goto game_logic::@142 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [470] if(pacman_direction!=UP) goto game_logic::@143 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction pacman_substep ] { } ) always clobbers reg byte a +Statement [473] if(pacman_substep!=0) goto game_logic::@147 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction game_logic::$232 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction game_logic::$232 ] { } ) always clobbers reg byte a +Statement [475] pacman_substep = 0 [ pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine pacman_direction ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 [ pacman_ch1_enabled pacman_yfine pacman_direction game_logic::pacman_xtile1#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_yfine pacman_direction game_logic::pacman_xtile1#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 [ pacman_ch1_enabled pacman_direction game_logic::pacman_xtile1#0 game_logic::pacman_ytile1#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::pacman_xtile1#0 game_logic::pacman_ytile1#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [483] game_logic::$199 = *((byte*)CIA1) & $f [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$199 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$199 ] { } ) always clobbers reg byte a +Statement [484] game_logic::$200 = game_logic::$199 ^ $f [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$200 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::$200 ] { } ) always clobbers reg byte a +Statement [485] game_logic::joy_directions#0 = game_logic::$200 << 2 [ pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::joy_directions#0 ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction game_logic::open_directions4#0 game_logic::joy_directions#0 ] { } ) always clobbers reg byte a +Statement [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [492] pacman_substep = 1 [ pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_xfine ] { } ) always clobbers reg byte a +Statement [493] pacman_ch1_enabled = 1 [ pacman_ch1_enabled pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine ] { } ) always clobbers reg byte a +Statement [494] if(pacman_xfine==1) goto game_logic::@146 [ pacman_ch1_enabled pacman_xfine ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine ] { } ) always clobbers reg byte a +Statement [495] if(pacman_xfine!=$61) goto game_logic::@return [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [496] pacman_xfine = 1 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [497] pacman_xfine = $61 [ pacman_ch1_enabled ] ( game_logic:89 [ pacman_ch1_idx pacman_ch1_enabled ] { } ) always clobbers reg byte a +Statement [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a +Statement [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a reg byte y +Statement [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] [ pacman_ch1_idx ] ( pacman_sound_play:91 [ pacman_ch1_idx ] { } ) always clobbers reg byte a reg byte y +Statement [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [506] pacman_ch1_idx = 0 [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [507] pacman_ch1_enabled = 0 [ ] ( pacman_sound_play:91 [ ] { } ) always clobbers reg byte a +Statement [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [513] *PROCPORT = PROCPORT_RAM_ALL [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER [ byteboozer_decrunch::crunched ] ( main:62::splash_run:102 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [546] *PROCPORT = PROCPORT_RAM_IO [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [550] *((byte*)CIA2) = splash_run::toDd001_return#0 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [551] canvas_base_hi = >SPRITES_2 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 [ splash_run::msb#10 ] ( main:62::splash_run:102 [ splash_run::msb#10 ] { } ) always clobbers reg byte a +Statement [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [562] top_sprites_mc = 3 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [563] side_sprites_mc = 0 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [564] bottom_sprites_mc = 3 [ top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_mc ] { } ) always clobbers reg byte a +Statement [565] top_sprites_color = YELLOW [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [566] side_sprites_color = BLUE [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [567] bottom_sprites_color = YELLOW [ top_sprites_color top_sprites_mc ] ( main:62::splash_run:102 [ top_sprites_color top_sprites_mc ] { } ) always clobbers reg byte a +Statement [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ top_sprites_color ] ( main:62::splash_run:102 [ top_sprites_color ] { } ) always clobbers reg byte a +Statement [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement asm { lda#1 staINTRO_MUSIC+$69 } always clobbers reg byte a +Statement asm { lda#0 } always clobbers reg byte a +Statement [576] call *musicInit [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [577] phase = 0 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [582] *HARDWARE_IRQ = &irq_screen_top [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement asm { ldaCIA1_INTERRUPT } always clobbers reg byte a +Statement [585] *IRQ_STATUS = $f [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a +Statement [589] music_play_next = 0 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [596] if(0==music_play_next) goto splash_run::@13 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [597] call *musicPlay [ ] ( main:62::splash_run:102 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [598] music_play_next = 0 [ music_play_next ] ( main:62::splash_run:102 [ music_play_next ] { } ) always clobbers reg byte a +Statement [599] bobs_xcol[splash_run::i2#2] = $a [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Statement [600] bobs_yfine[splash_run::i2#2] = $2d [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Statement [601] bobs_bob_id[splash_run::i2#2] = 0 [ splash_run::i2#2 ] ( main:62::splash_run:102 [ splash_run::i2#2 ] { } ) always clobbers reg byte a +Statement [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color [ top_sprites_color splash_run::i1#2 ] ( main:62::splash_run:102 [ top_sprites_color splash_run::i1#2 ] { } ) always clobbers reg byte a +Statement [605] splash_run::$34 = splash_run::i#2 << 1 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] { } ) always clobbers reg byte a +Statement [606] SPRITES_YPOS[splash_run::$34] = 7 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 ] { } ) always clobbers reg byte a +Statement [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] [ splash_run::i#2 splash_run::msb#10 splash_run::$34 splash_run::xpos#0 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::$34 splash_run::xpos#0 ] { } ) always clobbers reg byte a +Statement [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 [ splash_run::i#2 splash_run::msb#10 splash_run::xpos#0 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#10 splash_run::xpos#0 ] { } ) always clobbers reg byte a +Statement [612] splash_run::msb#2 = splash_run::msb#1 | $80 [ splash_run::i#2 splash_run::msb#2 ] ( main:62::splash_run:102 [ splash_run::i#2 splash_run::msb#2 ] { } ) always clobbers reg byte a +Statement [619] pacman_wins = 0 [ pacman_wins ] ( main:62::gameplay_run:104 [ pacman_wins ] { } ) always clobbers reg byte a +Statement [620] pacman_lives = 3 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED [ pacman_wins pacman_lives byteboozer_decrunch::crunched ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [633] level_show::return#0 = level_show::count#12 [ pacman_wins pacman_lives level_show::return#0 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives level_show::return#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [634] gameplay_run::$4 = level_show::return#0 [ pacman_wins pacman_lives gameplay_run::$4 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives gameplay_run::$4 ] { } ) always clobbers reg byte a +Statement [635] pill_count = gameplay_run::$4 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [636] top_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [637] side_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [638] bottom_sprites_mc = $ff [ top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [639] top_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [640] side_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [641] bottom_sprites_color = YELLOW [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color top_sprites_mc pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc [ top_sprites_color pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ top_sprites_color pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [647] phase = 1 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [651] game_playable = 1 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [657] *HARDWARE_IRQ = &irq_screen_top [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement asm { ldaCIA1_INTERRUPT } always clobbers reg byte a +Statement [660] *IRQ_STATUS = $f [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [662] if(0!=pacman_wins) goto gameplay_run::@return [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [663] if(pacman_lives==0) goto gameplay_run::@return [ pacman_wins pacman_lives ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color [ top_sprites_color pacman_wins pacman_lives gameplay_run::i2#2 ] ( main:62::gameplay_run:104 [ top_sprites_color pacman_wins pacman_lives gameplay_run::i2#2 ] { } ) always clobbers reg byte a +Statement [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK [ pacman_wins pacman_lives gameplay_run::i1#2 ] ( main:62::gameplay_run:104 [ pacman_wins pacman_lives gameplay_run::i1#2 ] { } ) always clobbers reg byte a +Statement [669] ((byte*)SID)[gameplay_run::i#2] = 0 [ gameplay_run::i#2 ] ( main:62::gameplay_run:104 [ gameplay_run::i#2 ] { } ) always clobbers reg byte a +Statement [671] game_playable = 0 [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a +Statement [672] phase = 0 [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a +Statement asm { lda#0 } always clobbers reg byte a +Statement [678] call *musicInit [ pacman_wins ] ( main:62::done_run:106 [ pacman_wins ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [679] if(0!=pacman_wins) goto done_run::@1 [ ] ( main:62::done_run:106 [ ] { } ) always clobbers reg byte a +Statement [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::done_run:106 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [684] music_play_next = 0 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [691] if(0==music_play_next) goto done_run::@13 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [692] call *musicPlay [ ] ( main:62::done_run:106 [ ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [693] music_play_next = 0 [ music_play_next ] ( main:62::done_run:106 [ music_play_next ] { } ) always clobbers reg byte a +Statement [697] done_run::pixels#0 = *done_run::gfx#2 [ done_run::xcol#2 done_run::gfx#2 done_run::ypos#2 done_run::pixels#0 ] ( main:62::done_run:106 [ done_run::xcol#2 done_run::gfx#2 done_run::ypos#2 done_run::pixels#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED [ byteboozer_decrunch::crunched ] ( main:62::done_run:106 [ byteboozer_decrunch::crunched ] { } ) always clobbers reg byte a +Statement [706] bobs_xcol[done_run::i1#2] = $a [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Statement [707] bobs_yfine[done_run::i1#2] = $2d [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Statement [708] bobs_bob_id[done_run::i1#2] = 0 [ pacman_wins done_run::i1#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i1#2 ] { } ) always clobbers reg byte a +Statement [710] ((byte*)SID)[done_run::i#2] = 0 [ pacman_wins done_run::i#2 ] ( main:62::done_run:106 [ pacman_wins done_run::i#2 ] { } ) always clobbers reg byte a +Statement [712] ghosts_mode_count = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [713] pacman_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [714] ghost1_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [715] ghost2_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [716] ghost3_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [717] ghost4_substep = 0 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [718] pacman_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [719] ghost1_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [720] ghost2_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [721] ghost3_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [722] ghost4_direction = STOP [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [723] pacman_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [724] ghost1_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [725] ghost2_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [726] ghost3_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [727] ghost4_xfine = $32 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [728] ghost1_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [729] ghost2_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [730] ghost3_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [731] ghost4_yfine = $23 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [732] pacman_yfine = $3e [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [733] ghost1_respawn = $a [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [734] ghost2_respawn = $14 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [735] ghost3_respawn = $1e [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [736] ghost4_respawn = $28 [ ] ( game_logic:89::spawn_all:220 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:228 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:236 [ pacman_ch1_idx pacman_ch1_enabled ] { } game_logic:89::spawn_all:244 [ pacman_ch1_idx pacman_ch1_enabled ] { } main:62::gameplay_run:104::spawn_all:648 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 [ level_tile_directions::xtile#5 level_tile_directions::$5 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::xtile#5 level_tile_directions::$5 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] [ level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::xtile#5 level_tile_directions::ytiles#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] [ level_tile_directions::return#0 ] ( game_logic:89::level_tile_directions:282 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost4_direction game_logic::ghost4_xtile#0 game_logic::ghost4_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#0 = level_tile_directions::xtile#5 game_logic::ghost4_xtile#0 } { level_tile_directions::ytile#0 = level_tile_directions::ytile#5 game_logic::ghost4_ytile#0 } { level_tile_directions::return#2 = level_tile_directions::return#3 } } game_logic:89::level_tile_directions:332 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost3_direction game_logic::ghost3_xtile#0 game_logic::ghost3_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#1 = level_tile_directions::xtile#5 game_logic::ghost3_xtile#0 } { level_tile_directions::ytile#1 = level_tile_directions::ytile#5 game_logic::ghost3_ytile#0 } { level_tile_directions::return#10 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:382 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost2_direction game_logic::ghost2_xtile#0 game_logic::ghost2_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#2 = level_tile_directions::xtile#5 game_logic::ghost2_xtile#0 } { level_tile_directions::ytile#2 = level_tile_directions::ytile#5 game_logic::ghost2_ytile#0 } { level_tile_directions::return#11 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:432 [ pacman_ch1_idx pacman_ch1_enabled pacman_xfine pacman_yfine ghosts_mode ghost1_direction game_logic::ghost1_xtile#0 game_logic::ghost1_ytile#0 level_tile_directions::return#0 ] { { level_tile_directions::xtile#3 = level_tile_directions::xtile#5 game_logic::ghost1_xtile#0 } { level_tile_directions::ytile#3 = level_tile_directions::ytile#5 game_logic::ghost1_ytile#0 } { level_tile_directions::return#12 = level_tile_directions::return#2 } } game_logic:89::level_tile_directions:480 [ pacman_ch1_idx pacman_ch1_enabled pacman_direction level_tile_directions::return#0 ] { { level_tile_directions::xtile#4 = level_tile_directions::xtile#5 game_logic::pacman_xtile1#0 } { level_tile_directions::ytile#4 = level_tile_directions::ytile#5 game_logic::pacman_ytile1#0 } { level_tile_directions::return#13 = level_tile_directions::return#2 } } ) always clobbers reg byte a +Statement [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 [ choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::ghost_ytile#4 choose_direction::target_ytile#4 choose_direction::open_directions#10 choose_direction::xdiff#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [749] choose_direction::$2 = choose_direction::open_directions#10 & UP [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::$2 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_up#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::$4 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#6 choose_direction::direction#10 choose_direction::dist_down#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::$6 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] [ choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::open_directions#10 choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::dist_min#10 choose_direction::direction#8 choose_direction::dist_left#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT [ choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::xdiff#0 choose_direction::ydiff#0 choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::$8 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] [ choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] ( game_logic:89::choose_direction:296 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#0 = choose_direction::ghost_xtile#4 game_logic::ghost4_xtile#0 } { choose_direction::target_xtile#0 = choose_direction::target_xtile#4 game_logic::target_xtile#3 } { choose_direction::ghost_ytile#0 = choose_direction::ghost_ytile#4 game_logic::ghost4_ytile#0 } { choose_direction::target_ytile#0 = choose_direction::target_ytile#4 game_logic::target_ytile#3 } { choose_direction::open_directions#0 = choose_direction::open_directions#10 game_logic::open_directions#1 } { choose_direction::return#0 = choose_direction::return#10 } } game_logic:89::choose_direction:346 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#1 = choose_direction::ghost_xtile#4 game_logic::ghost3_xtile#0 } { choose_direction::target_xtile#1 = choose_direction::target_xtile#4 game_logic::target_xtile1#3 } { choose_direction::ghost_ytile#1 = choose_direction::ghost_ytile#4 game_logic::ghost3_ytile#0 } { choose_direction::target_ytile#1 = choose_direction::target_ytile#4 game_logic::target_ytile1#3 } { choose_direction::open_directions#1 = choose_direction::open_directions#10 game_logic::open_directions1#1 } { choose_direction::return#1 = choose_direction::return#10 } } game_logic:89::choose_direction:396 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#2 = choose_direction::ghost_xtile#4 game_logic::ghost2_xtile#0 } { choose_direction::target_xtile#2 = choose_direction::target_xtile#4 game_logic::target_xtile2#3 } { choose_direction::ghost_ytile#2 = choose_direction::ghost_ytile#4 game_logic::ghost2_ytile#0 } { choose_direction::target_ytile#2 = choose_direction::target_ytile#4 game_logic::target_ytile2#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#2 game_logic::open_directions2#1 } { choose_direction::return#10 = choose_direction::return#2 } } game_logic:89::choose_direction:446 [ pacman_ch1_idx pacman_ch1_enabled choose_direction::direction#6 choose_direction::dist_min#11 choose_direction::dist_right#0 ] { { choose_direction::ghost_xtile#3 = choose_direction::ghost_xtile#4 game_logic::ghost1_xtile#0 } { choose_direction::target_xtile#3 = choose_direction::target_xtile#4 game_logic::target_xtile3#3 } { choose_direction::ghost_ytile#3 = choose_direction::ghost_ytile#4 game_logic::ghost1_ytile#0 } { choose_direction::target_ytile#3 = choose_direction::target_ytile#4 game_logic::target_ytile3#3 } { choose_direction::open_directions#10 = choose_direction::open_directions#3 game_logic::open_directions3#1 } { choose_direction::return#10 = choose_direction::return#3 } } ) always clobbers reg byte a +Statement [777] if(memset::num#5<=0) goto memset::@return [ memset::num#5 memset::str#6 ] ( main:62::splash_run:102::memset:514 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:522 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:524 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:532 [ memset::num#5 memset::str#6 ] { } main:62::splash_run:102::memset:544 [ memset::num#5 memset::str#6 ] { } ) always clobbers reg byte a +Statement [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 [ memset::str#6 memset::end#0 ] ( main:62::splash_run:102::memset:514 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:522 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:524 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:532 [ memset::str#6 memset::end#0 ] { } main:62::splash_run:102::memset:544 [ memset::str#6 memset::end#0 ] { } ) always clobbers reg byte a +Statement [779] memset::dst#4 = (byte*)memset::str#6 [ memset::end#0 memset::dst#4 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#4 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a +Statement [781] if(memset::dst#2!=memset::end#0) goto memset::@3 [ memset::end#0 memset::dst#2 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a +Statement [783] *memset::dst#2 = 0 [ memset::end#0 memset::dst#2 ] ( main:62::splash_run:102::memset:514 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:522 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:524 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:532 [ memset::end#0 memset::dst#2 ] { } main:62::splash_run:102::memset:544 [ memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } always clobbers reg byte a reg byte x reg byte y +Statement [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] { } ) always clobbers reg byte a reg byte y +Statement [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 ] { } ) always clobbers reg byte a +Statement [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 merge_code::cycle_budget#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#1 merge_code::cycle_budget#0 ] { } ) always clobbers reg byte a reg byte y +Statement [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#2 merge_code::cycle_budget#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#14 merge_code::logic_code#18 merge_code::raster_code#2 merge_code::cycle_budget#0 ] { } ) always clobbers reg byte a +Statement [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 [ merge_code::logic_code#12 merge_code::dest_code#12 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::logic_code#12 merge_code::dest_code#12 ] { } ) always clobbers reg byte a reg byte y +Statement [796] *merge_code::dest_code#12 = $60 [ ] ( main:62::splash_run:102::merge_code:520 [ ] { } ) always clobbers reg byte a reg byte y +Statement [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 [ merge_code::dest_code#12 merge_code::logic_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#12 merge_code::logic_code#3 ] { } ) always clobbers reg byte a +Statement [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 [ merge_code::dest_code#13 merge_code::logic_code#14 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#13 merge_code::logic_code#14 ] { } ) always clobbers reg byte a reg byte y +Statement [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 [ merge_code::logic_code#5 merge_code::dest_code#13 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::logic_code#5 merge_code::dest_code#13 ] { } ) always clobbers reg byte a +Statement [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 [ merge_code::dest_code#13 merge_code::logic_code#14 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::dest_code#13 merge_code::logic_code#14 ] { } ) always clobbers reg byte a reg byte y +Statement [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 ] { } ) always clobbers reg byte a reg byte y +Statement [813] *merge_code::dest_code#10 = $ea [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] { } ) always clobbers reg byte a reg byte y +Statement [816] *merge_code::dest_code#10 = $24 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::dest_code#10 merge_code::logic_code#17 merge_code::cycle_budget#10 ] { } ) always clobbers reg byte a reg byte y +Statement [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] { } ) always clobbers reg byte a +Statement [818] *merge_code::dest_code#2 = $ea [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#2 ] { } ) always clobbers reg byte a reg byte y +Statement [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#10 merge_code::dest_code#3 ] { } ) always clobbers reg byte a +Statement [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#2 merge_code::dest_code#3 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::logic_code#17 merge_code::cycle_budget#2 merge_code::dest_code#3 ] { } ) always clobbers reg byte a reg byte x +Statement [823] merge_code::logic_code#0 = ++ merge_code::logic_code#17 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 merge_code::logic_code#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#21 merge_code::logic_cycles#0 merge_code::logic_code#0 ] { } ) always clobbers reg byte a +Statement [825] if(*merge_code::logic_code#10!=merge_code::LOGIC_END) goto merge_code::@7 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] { } ) always clobbers reg byte a reg byte y +Statement [826] merge_code::logic_code#2 = ++ merge_code::logic_code#10 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::logic_code#2 merge_code::dest_code#15 merge_code::logic_cycles#0 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::logic_code#2 merge_code::dest_code#15 merge_code::logic_cycles#0 ] { } ) always clobbers reg byte a +Statement [827] merge_code::cycle_budget#1 = merge_code::cycle_budget#13 - merge_code::logic_cycles#0 [ merge_code::raster_code#2 merge_code::cycle_budget#1 merge_code::logic_code#2 merge_code::dest_code#15 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#1 merge_code::logic_code#2 merge_code::dest_code#15 ] { } ) always clobbers reg byte a +Statement [828] *merge_code::dest_code#15 = *merge_code::logic_code#10 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#2 merge_code::cycle_budget#13 merge_code::dest_code#15 merge_code::logic_cycles#0 merge_code::logic_code#10 ] { } ) always clobbers reg byte a reg byte y +Statement [831] *merge_code::dest_code#14 = *merge_code::raster_code#4 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] ( main:62::splash_run:102::merge_code:520 [ merge_code::raster_code#4 merge_code::dest_code#14 merge_code::logic_code#18 ] { } ) always clobbers reg byte a reg byte y +Statement [836] if(init_render_index::x_col#2<$1a) goto init_render_index::@2 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 ] { } ) always clobbers reg byte a +Statement [837] *(RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC) = 0 [ ] ( main:62::splash_run:102::init_render_index:526 [ ] { } ) always clobbers reg byte a +Statement [838] *(RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC) = 0 [ ] ( main:62::splash_run:102::init_render_index:526 [ ] { } ) always clobbers reg byte a +Statement [840] if(init_render_index::x_col#2<$18) goto init_render_index::@4 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 ] { } ) always clobbers reg byte a +Statement [843] init_render_index::$9 = init_render_index::x_col#2 << 1 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::$9 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::$9 ] { } ) always clobbers reg byte a +Statement [844] init_render_index::canvas_xcol#0 = RENDER_XCOLS[init_render_index::$9] [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 ] { } ) always clobbers reg byte a +Statement [845] init_render_index::render_index_xcol#7 = init_render_index::render_index_xcol#0 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 init_render_index::render_index_xcol#7 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::ypos_inc_offset#7 init_render_index::canvas_xcol#0 init_render_index::render_index_xcol#7 ] { } ) always clobbers reg byte a +Statement [847] if(init_render_index::y_pos#2<$94) goto init_render_index::@6 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] { } ) always clobbers reg byte a +Statement [848] init_render_index::render_index#1 = init_render_index::render_index_xcol#0 + $100 [ init_render_index::x_col#2 init_render_index::render_index#1 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index#1 ] { } ) always clobbers reg byte a +Statement [850] init_render_index::$11 = (word)init_render_index::y_pos#2 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$11 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$11 ] { } ) always clobbers reg byte a +Statement [851] init_render_index::$10 = init_render_index::$11 << 1 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$10 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$10 ] { } ) always clobbers reg byte a +Statement [852] init_render_index::$12 = init_render_index::render_ypos_table#4 + init_render_index::$10 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$12 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::$12 ] { } ) always clobbers reg byte a +Statement [853] init_render_index::canvas#0 = init_render_index::canvas_xcol#0 + *init_render_index::$12 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] { } ) always clobbers reg byte a reg byte y +Statement [855] *init_render_index::render_index_xcol#2 = init_render_index::$5 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 init_render_index::canvas#0 ] { } ) always clobbers reg byte y +Statement [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] { } ) always clobbers reg byte y +Statement [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#4 ] { } ) always clobbers reg byte a reg byte y +Statement [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#3 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#2 init_render_index::render_index_xcol#2 init_render_index::ypos_inc_offset#3 ] { } ) always clobbers reg byte a reg byte x +Statement [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#1 init_render_index::render_index_xcol#1 init_render_index::ypos_inc_offset#8 ] ( main:62::splash_run:102::init_render_index:526 [ init_render_index::x_col#2 init_render_index::render_index_xcol#0 init_render_index::render_ypos_table#4 init_render_index::canvas_xcol#0 init_render_index::y_pos#1 init_render_index::render_index_xcol#1 init_render_index::ypos_inc_offset#8 ] { } ) always clobbers reg byte a +Statement [872] splash_show::pixels#0 = *splash_show::splash#2 [ splash_show::xcol#2 splash_show::splash#2 splash_show::ypos#2 splash_show::pixels#0 ] ( main:62::splash_run:102::splash_show:530 [ splash_show::xcol#2 splash_show::splash#2 splash_show::ypos#2 splash_show::pixels#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [882] logic_tile_ptr = LEVEL_TILES+(word)$40*$12+$c [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [883] logic_tile_xcol = $c [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [884] logic_tile_yfine = $23 [ ] ( main:62::splash_run:102::init_bobs_restore:534 [ ] { } ) always clobbers reg byte a +Statement [888] *init_bobs_restore::bob_restore#5 = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [889] init_bobs_restore::bob_restore#5[1] = >init_bobs_restore::CANVAS_HIDDEN [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [890] init_bobs_restore::bob_restore#5[3] = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 ] { } ) always clobbers reg byte a reg byte y +Statement [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#1 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#1 ] { } ) always clobbers reg byte a +Statement [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 init_bobs_restore::i#2 ] ( main:62::splash_run:102::init_bobs_restore:534 [ init_bobs_restore::bob#2 init_bobs_restore::bob_restore#5 init_bobs_restore::i#2 ] { } ) always clobbers reg byte a +Statement [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_1#1 ] { } ) always clobbers reg byte a +Statement [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#1 init_sprite_pointers::sprites_ptr_2#1 ] { } ) always clobbers reg byte a +Statement [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::$2 ] { } ) always clobbers reg byte a +Statement [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] ( main:62::splash_run:102::init_sprite_pointers:538 [ init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] { } main:62::gameplay_run:104::init_sprite_pointers:630 [ pacman_wins pacman_lives init_sprite_pointers::screen#2 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprite#2 init_sprite_pointers::sprite_id#0 ] { } ) always clobbers reg byte a +Statement [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 [ memcpy::src#2 memcpy::dst#2 ] ( main:62::splash_run:102::memcpy:540 [ memcpy::src#2 memcpy::dst#2 ] { } ) always clobbers reg byte a +Statement [914] *memcpy::dst#2 = *memcpy::src#2 [ memcpy::src#2 memcpy::dst#2 ] ( main:62::splash_run:102::memcpy:540 [ memcpy::src#2 memcpy::dst#2 ] { } ) always clobbers reg byte a reg byte y +Statement [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 [ ] ( main:62::splash_run:102::joyinit:588 [ ] { } ) always clobbers reg byte a +Statement [919] joyfire::$0 = *((byte*)CIA1) & $10 [ joyfire::$0 ] ( main:62::splash_run:102::joyfire:591 [ music_play_next joyfire::$0 ] { { joyfire::return#1 = joyfire::return#4 } } main:62::done_run:106::joyfire:686 [ music_play_next joyfire::$0 ] { { joyfire::return#0 = joyfire::return#4 } } ) always clobbers reg byte a +Statement [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#1 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#1 ] { } ) always clobbers reg byte a +Statement [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] { } ) always clobbers reg byte a +Statement [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 ] { } ) always clobbers reg byte a +Statement [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#2 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#2 ] { } ) always clobbers reg byte a +Statement [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 ] { } ) always clobbers reg byte a +Statement [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#3 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#3 ] { } ) always clobbers reg byte a +Statement [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 ] { } ) always clobbers reg byte a +Statement [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#4 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#4 ] { } ) always clobbers reg byte a +Statement [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 [ init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] ( main:62::gameplay_run:104::init_level_tile_directions:628 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 ] { } ) always clobbers reg byte a +Statement [972] level_show::level#1 = level_show::level#8 + $40 [ level_show::ytile#2 level_show::count#10 level_show::level#1 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::count#10 level_show::level#1 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] [ level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::xtile#3 level_show::tile_left#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::xtile#3 level_show::tile_left#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a reg byte y +Statement [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 [ level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::count#10 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] [ level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 level_show::count#5 level_show::tile_right#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::tile_left#0 level_show::xtile#1 level_show::count#5 level_show::tile_right#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 [ level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::tile_left#0 level_show::count#5 level_show::tile_right#0 ] ( main:62::gameplay_run:104::level_show:632 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::tile_left#0 level_show::count#5 level_show::tile_right#0 ] { { level_show::return#0 = level_show::count#12 } } ) always clobbers reg byte a +Statement [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [991] *((word*)SID) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 [ ] ( main:62::gameplay_run:104::pacman_sound_init:650 [ pacman_wins pacman_lives ] { } ) always clobbers reg byte a +Statement [998] render::ytile#0 = render::ypos#2 >> 2 [ render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::xcol#2 render::pixels#4 render::ytile#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [999] render::$1 = >RENDER_INDEX + render::xcol#2 [ render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::ytile#0 render::$1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1000] render::$2 = render::ytile#0 << 1 [ render::ypos#2 render::pixels#4 render::$1 render::$2 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::$1 render::$2 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::$1 render::$2 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas_offset#0 render::canvas1#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 [ render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::render_index_xcol#0 render::canvas1#0 render::canvas2#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] [ render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::ypos#2 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1006] render::ypix#0 = render::ypos#2 & 3 [ render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::canvas1#0 render::canvas2#0 render::ypos_inc_offset#0 render::ypix#0 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1009] *render::canvas1#2 = render::pixels#4 [ render::pixels#4 render::canvas2#2 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::canvas2#2 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::canvas2#2 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1010] *render::canvas2#2 = render::pixels#4 [ ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a reg byte y +Statement [1012] render::canvas1#1 = render::canvas1#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] [ render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas2#2 render::canvas1#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1013] render::canvas2#1 = render::canvas2#2 + RENDER_YPOS_INC[render::ypos_inc_offset#2] [ render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] ( main:62::done_run:106::render:702 [ done_run::xcol#2 done_run::ypos#2 done_run::gfx#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] { { render::ypos#0 = render::ypos#2 done_run::ypos#2 } { render::xcol#0 = render::xcol#2 done_run::xcol#2 } { render::pixels#0 = render::pixels#4 done_run::pixels#0 } } main:62::splash_run:102::splash_show:530::render:877 [ splash_show::xcol#2 splash_show::ypos#2 splash_show::splash#1 render::pixels#4 render::ypix#0 render::i#2 render::ypos_inc_offset#2 render::canvas1#1 render::canvas2#1 ] { { render::ypos#1 = render::ypos#2 splash_show::ypos#2 } { render::xcol#1 = render::xcol#2 splash_show::xcol#2 } { render::pixels#1 = render::pixels#4 splash_show::pixels#0 } } ) always clobbers reg byte a +Statement [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 [ level_tile_get::xtile#4 level_tile_get::$5 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::xtile#4 level_tile_get::$5 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Statement [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] [ level_tile_get::xtile#4 level_tile_get::ytiles#0 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::xtile#4 level_tile_get::ytiles#0 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Statement [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] [ level_tile_get::return#0 ] ( main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:934 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 level_tile_get::return#0 ] { { level_tile_get::xtile#0 = level_tile_get::xtile#4 } { level_tile_get::ytile#0 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#3 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:942 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#11 level_tile_get::return#0 ] { { level_tile_get::xtile#1 = level_tile_get::xtile#4 } { level_tile_get::ytile#1 = level_tile_get::ytile#4 init_level_tile_directions::ytile#15 } { level_tile_get::return#2 = level_tile_get::return#4 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:950 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#12 level_tile_get::return#0 ] { { level_tile_get::xtile#2 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#2 = level_tile_get::ytile#4 } { level_tile_get::return#10 = level_tile_get::return#2 } } main:62::gameplay_run:104::init_level_tile_directions:628::level_tile_get:958 [ pacman_wins pacman_lives init_level_tile_directions::ytile#15 init_level_tile_directions::directions#7 init_level_tile_directions::xtile#10 init_level_tile_directions::open_directions#13 level_tile_get::return#0 ] { { level_tile_get::xtile#3 = level_tile_get::xtile#4 init_level_tile_directions::xtile#10 } { level_tile_get::ytile#3 = level_tile_get::ytile#4 } { level_tile_get::return#11 = level_tile_get::return#2 } } ) always clobbers reg byte a +Statement [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::$0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::$0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::tile_left_pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_right#0 render_tiles::tile_left_pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::$2 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::$2 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 [ render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::xcol#0 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 [ render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::ytile#0 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 render_tiles::$5 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::$4 render_tiles::$5 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a reg byte y +Statement [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 render_tiles::canvas1#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas_offset#0 render_tiles::canvas1#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas1#0 render_tiles::canvas2#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::render_index_xcol#0 render_tiles::canvas1#0 render_tiles::canvas2#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::canvas1#0 render_tiles::canvas2#0 render_tiles::ypos_inc_offset#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::canvas1#0 render_tiles::canvas2#0 render_tiles::ypos_inc_offset#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a reg byte y +Statement [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a reg byte y +Statement [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::pixels#0 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte y +Statement [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas1#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte y +Statement [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::canvas2#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Statement [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] [ render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 render_tiles::canvas2#1 ] ( main:62::gameplay_run:104::level_show:632::render_tiles:988 [ pacman_wins pacman_lives level_show::ytile#2 level_show::level#8 level_show::xcol#2 level_show::xtile#2 level_show::count#11 render_tiles::tile_left_pixels#0 render_tiles::tile_right_pixels#0 render_tiles::y#2 render_tiles::ypos_inc_offset#2 render_tiles::canvas1#1 render_tiles::canvas2#1 ] { { level_show::return#0 = level_show::count#12 } { render_tiles::xcol#0 = level_show::xcol#2 } { render_tiles::ytile#0 = level_show::ytile#2 } { render_tiles::tile_left#0 = level_show::tile_left#0 } { render_tiles::tile_right#0 = level_show::tile_right#0 } } ) always clobbers reg byte a +Potential registers zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] : zp[1]:2 , reg byte x , reg byte y , +Potential registers zp[1]:3 [ game_logic::do_reverse#4 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:4 [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] : zp[1]:4 , reg byte x , reg byte y , +Potential registers zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:6 [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] : zp[1]:6 , reg byte x , reg byte y , +Potential registers zp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:8 [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] : zp[1]:8 , reg byte x , reg byte y , +Potential registers zp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:10 [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] : zp[1]:10 , reg byte x , reg byte y , +Potential registers zp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] : zp[1]:11 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] : zp[1]:12 , reg byte x , reg byte y , +Potential registers zp[1]:13 [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] : zp[1]:13 , reg byte x , reg byte y , +Potential registers zp[1]:14 [ splash_run::i1#2 splash_run::i1#1 ] : zp[1]:14 , reg byte x , reg byte y , +Potential registers zp[1]:15 [ splash_run::i2#2 splash_run::i2#1 ] : zp[1]:15 , reg byte x , reg byte y , +Potential registers zp[1]:16 [ gameplay_run::i#2 gameplay_run::i#1 ] : zp[1]:16 , reg byte x , reg byte y , +Potential registers zp[1]:17 [ gameplay_run::i1#2 gameplay_run::i1#1 ] : zp[1]:17 , reg byte x , reg byte y , +Potential registers zp[1]:18 [ gameplay_run::i2#2 gameplay_run::i2#1 ] : zp[1]:18 , reg byte x , reg byte y , +Potential registers zp[1]:19 [ done_run::i#2 done_run::i#1 ] : zp[1]:19 , reg byte x , reg byte y , +Potential registers zp[1]:20 [ done_run::i1#2 done_run::i1#1 ] : zp[1]:20 , reg byte x , reg byte y , +Potential registers zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] : zp[1]:21 , reg byte x , +Potential registers zp[2]:22 [ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] : zp[2]:22 , +Potential registers zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] : zp[1]:24 , reg byte x , +Potential registers zp[1]:25 [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] : zp[1]:25 , reg byte x , reg byte y , +Potential registers zp[1]:26 [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:27 [ level_tile_directions::return#2 level_tile_directions::return#0 ] : zp[1]:27 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:28 [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] : zp[1]:28 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:29 [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] : zp[1]:29 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] : zp[1]:30 , reg byte x , reg byte y , +Potential registers zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] : zp[1]:31 , reg byte x , reg byte y , +Potential registers zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] : zp[1]:32 , reg byte x , reg byte y , +Potential registers zp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] : zp[1]:33 , reg byte x , reg byte y , +Potential registers zp[1]:34 [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] : zp[1]:34 , reg byte x , reg byte y , +Potential registers zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] : zp[1]:35 , reg byte x , reg byte y , +Potential registers zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] : zp[1]:36 , reg byte x , reg byte y , +Potential registers zp[2]:37 [ memset::num#5 ] : zp[2]:37 , +Potential registers zp[2]:39 [ memset::str#6 ] : zp[2]:39 , +Potential registers zp[2]:41 [ memset::dst#2 memset::dst#4 memset::dst#1 ] : zp[2]:41 , +Potential registers zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] : zp[2]:43 , +Potential registers zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] : zp[2]:45 , +Potential registers zp[2]:47 [ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] : zp[2]:47 , +Potential registers zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] : zp[2]:49 , +Potential registers zp[1]:51 [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] : zp[1]:51 , reg byte x , +Potential registers zp[2]:52 [ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] : zp[2]:52 , +Potential registers zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] : zp[1]:54 , +Potential registers zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] : zp[2]:55 , +Potential registers zp[2]:57 [ init_render_index::render_ypos_table#4 ] : zp[2]:57 , +Potential registers zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] : zp[1]:59 , +Potential registers zp[2]:60 [ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] : zp[2]:60 , +Potential registers zp[1]:62 [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] : zp[1]:62 , reg byte x , +Potential registers zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] : zp[1]:63 , reg byte x , +Potential registers zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] : zp[2]:64 , +Potential registers zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] : zp[1]:66 , reg byte x , +Potential registers zp[1]:67 [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] : zp[1]:67 , reg byte x , +Potential registers zp[2]:68 [ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] : zp[2]:68 , +Potential registers zp[1]:70 [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] : zp[1]:70 , reg byte x , reg byte y , +Potential registers zp[1]:71 [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] : zp[1]:71 , reg byte x , reg byte y , +Potential registers zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] : zp[2]:72 , +Potential registers zp[2]:74 [ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] : zp[2]:74 , +Potential registers zp[1]:76 [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] : zp[1]:76 , reg byte x , reg byte y , +Potential registers zp[2]:77 [ memcpy::src#2 memcpy::src#1 ] : zp[2]:77 , +Potential registers zp[2]:79 [ memcpy::dst#2 memcpy::dst#1 ] : zp[2]:79 , +Potential registers zp[1]:81 [ joyfire::return#4 ] : zp[1]:81 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] : zp[1]:82 , reg byte x , reg byte y , +Potential registers zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] : zp[2]:83 , +Potential registers zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] : zp[1]:85 , reg byte x , reg byte y , +Potential registers zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] : zp[1]:86 , reg byte x , reg byte y , +Potential registers zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] : zp[1]:87 , reg byte x , +Potential registers zp[2]:88 [ level_show::level#8 level_show::level#1 ] : zp[2]:88 , +Potential registers zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] : zp[1]:90 , reg byte x , +Potential registers zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] : zp[1]:91 , reg byte x , +Potential registers zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] : zp[2]:92 , +Potential registers zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] : zp[1]:94 , reg byte x , +Potential registers zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] : zp[1]:95 , reg byte x , reg byte y , +Potential registers zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] : zp[1]:96 , reg byte x , +Potential registers zp[1]:97 [ render::i#2 render::i#1 ] : zp[1]:97 , reg byte x , reg byte y , +Potential registers zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] : zp[2]:98 , +Potential registers zp[1]:100 [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] : zp[1]:100 , reg byte x , reg byte y , +Potential registers zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] : zp[2]:101 , +Potential registers zp[1]:103 [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] : zp[1]:103 , reg byte x , reg byte y , +Potential registers zp[1]:104 [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] : zp[1]:104 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:105 [ level_tile_get::return#2 level_tile_get::return#0 ] : zp[1]:105 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] : zp[1]:106 , reg byte x , +Potential registers zp[2]:107 [ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] : zp[2]:107 , +Potential registers zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] : zp[2]:109 , +Potential registers zp[1]:111 [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] : zp[1]:111 , reg byte x , +Potential registers zp[1]:112 [ pacman_ch1_enabled ] : zp[1]:112 , +Potential registers zp[1]:113 [ pacman_ch1_idx ] : zp[1]:113 , +Potential registers zp[2]:114 [ logic_tile_ptr ] : zp[2]:114 , +Potential registers zp[1]:116 [ logic_tile_xcol ] : zp[1]:116 , +Potential registers zp[1]:117 [ logic_tile_yfine ] : zp[1]:117 , +Potential registers zp[1]:118 [ logic_tile_left_idx ] : zp[1]:118 , +Potential registers zp[1]:119 [ logic_tile_right_idx ] : zp[1]:119 , +Potential registers zp[2]:120 [ left_render_index_xcol ] : zp[2]:120 , +Potential registers zp[2]:122 [ left_canvas ] : zp[2]:122 , +Potential registers zp[1]:124 [ left_ypos_inc_offset ] : zp[1]:124 , +Potential registers zp[2]:125 [ rigt_render_index_xcol ] : zp[2]:125 , +Potential registers zp[2]:127 [ rigt_canvas ] : zp[2]:127 , +Potential registers zp[1]:129 [ rigt_ypos_inc_offset ] : zp[1]:129 , +Potential registers zp[1]:130 [ canvas_base_hi ] : zp[1]:130 , +Potential registers zp[1]:131 [ bobs_restore_base ] : zp[1]:131 , +Potential registers zp[1]:132 [ top_sprites_color ] : zp[1]:132 , +Potential registers zp[1]:133 [ top_sprites_mc ] : zp[1]:133 , +Potential registers zp[1]:134 [ side_sprites_color ] : zp[1]:134 , +Potential registers zp[1]:135 [ side_sprites_mc ] : zp[1]:135 , +Potential registers zp[1]:136 [ bottom_sprites_color ] : zp[1]:136 , +Potential registers zp[1]:137 [ bottom_sprites_mc ] : zp[1]:137 , +Potential registers zp[2]:138 [ pill_count ] : zp[2]:138 , +Potential registers zp[1]:140 [ pacman_wins ] : zp[1]:140 , +Potential registers zp[1]:141 [ pacman_lives ] : zp[1]:141 , +Potential registers zp[1]:142 [ music_play_next ] : zp[1]:142 , +Potential registers zp[1]:143 [ phase ] : zp[1]:143 , +Potential registers zp[1]:144 [ frame ] : zp[1]:144 , +Potential registers zp[1]:145 [ anim_frame_idx ] : zp[1]:145 , +Potential registers zp[1]:146 [ pacman_xfine ] : zp[1]:146 , +Potential registers zp[1]:147 [ pacman_yfine ] : zp[1]:147 , +Potential registers zp[1]:148 [ pacman_direction ] : zp[1]:148 , +Potential registers zp[1]:149 [ pacman_substep ] : zp[1]:149 , +Potential registers zp[1]:150 [ ghosts_mode ] : zp[1]:150 , +Potential registers zp[1]:151 [ ghosts_mode_count ] : zp[1]:151 , +Potential registers zp[1]:152 [ ghost1_xfine ] : zp[1]:152 , +Potential registers zp[1]:153 [ ghost1_yfine ] : zp[1]:153 , +Potential registers zp[1]:154 [ ghost1_direction ] : zp[1]:154 , +Potential registers zp[1]:155 [ ghost1_substep ] : zp[1]:155 , +Potential registers zp[1]:156 [ ghost1_reverse ] : zp[1]:156 , +Potential registers zp[1]:157 [ ghost1_respawn ] : zp[1]:157 , +Potential registers zp[1]:158 [ ghost2_xfine ] : zp[1]:158 , +Potential registers zp[1]:159 [ ghost2_yfine ] : zp[1]:159 , +Potential registers zp[1]:160 [ ghost2_direction ] : zp[1]:160 , +Potential registers zp[1]:161 [ ghost2_substep ] : zp[1]:161 , +Potential registers zp[1]:162 [ ghost2_reverse ] : zp[1]:162 , +Potential registers zp[1]:163 [ ghost2_respawn ] : zp[1]:163 , +Potential registers zp[1]:164 [ ghost3_xfine ] : zp[1]:164 , +Potential registers zp[1]:165 [ ghost3_yfine ] : zp[1]:165 , +Potential registers zp[1]:166 [ ghost3_direction ] : zp[1]:166 , +Potential registers zp[1]:167 [ ghost3_substep ] : zp[1]:167 , +Potential registers zp[1]:168 [ ghost3_reverse ] : zp[1]:168 , +Potential registers zp[1]:169 [ ghost3_respawn ] : zp[1]:169 , +Potential registers zp[1]:170 [ ghost4_xfine ] : zp[1]:170 , +Potential registers zp[1]:171 [ ghost4_yfine ] : zp[1]:171 , +Potential registers zp[1]:172 [ ghost4_direction ] : zp[1]:172 , +Potential registers zp[1]:173 [ ghost4_substep ] : zp[1]:173 , +Potential registers zp[1]:174 [ ghost4_reverse ] : zp[1]:174 , +Potential registers zp[1]:175 [ ghost4_respawn ] : zp[1]:175 , +Potential registers zp[1]:176 [ game_logic_substep ] : zp[1]:176 , +Potential registers zp[1]:177 [ game_playable ] : zp[1]:177 , +Potential registers zp[1]:178 [ irq_screen_top::$1 ] : zp[1]:178 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:179 [ irq_screen_top::$2 ] : zp[1]:179 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:180 [ game_logic::$2 ] : zp[1]:180 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:181 [ game_logic::$3 ] : zp[1]:181 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:182 [ game_logic::$14 ] : zp[1]:182 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:183 [ game_logic::$15 ] : zp[1]:183 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:184 [ game_logic::pacman_bob_xfine#0 ] : zp[1]:184 , reg byte x , reg byte y , +Potential registers zp[1]:185 [ game_logic::$17 ] : zp[1]:185 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:186 [ game_logic::$18 ] : zp[1]:186 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:187 [ game_logic::$19 ] : zp[1]:187 , reg byte x , reg byte y , +Potential registers zp[1]:188 [ game_logic::$20 ] : zp[1]:188 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:189 [ game_logic::$21 ] : zp[1]:189 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:190 [ game_logic::ghost1_bob_xfine#0 ] : zp[1]:190 , reg byte x , reg byte y , +Potential registers zp[1]:191 [ game_logic::$25 ] : zp[1]:191 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:192 [ game_logic::$26 ] : zp[1]:192 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:193 [ game_logic::$27 ] : zp[1]:193 , reg byte x , reg byte y , +Potential registers zp[1]:194 [ game_logic::$28 ] : zp[1]:194 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:195 [ game_logic::$29 ] : zp[1]:195 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:196 [ game_logic::ghost2_bob_xfine#0 ] : zp[1]:196 , reg byte x , reg byte y , +Potential registers zp[1]:197 [ game_logic::$31 ] : zp[1]:197 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:198 [ game_logic::$32 ] : zp[1]:198 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:199 [ game_logic::$33 ] : zp[1]:199 , reg byte x , reg byte y , +Potential registers zp[1]:200 [ game_logic::$34 ] : zp[1]:200 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:201 [ game_logic::$35 ] : zp[1]:201 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:202 [ game_logic::ghost3_bob_xfine#0 ] : zp[1]:202 , reg byte x , reg byte y , +Potential registers zp[1]:203 [ game_logic::$37 ] : zp[1]:203 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:204 [ game_logic::$38 ] : zp[1]:204 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:205 [ game_logic::$39 ] : zp[1]:205 , reg byte x , reg byte y , +Potential registers zp[1]:206 [ game_logic::$40 ] : zp[1]:206 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:207 [ game_logic::$41 ] : zp[1]:207 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:208 [ game_logic::ghost4_bob_xfine#0 ] : zp[1]:208 , reg byte x , reg byte y , +Potential registers zp[1]:209 [ game_logic::$43 ] : zp[1]:209 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:210 [ game_logic::$44 ] : zp[1]:210 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:211 [ game_logic::$45 ] : zp[1]:211 , reg byte x , reg byte y , +Potential registers zp[1]:212 [ game_logic::$46 ] : zp[1]:212 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:213 [ game_logic::$47 ] : zp[1]:213 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:214 [ game_logic::pacman_xtile#0 ] : zp[1]:214 , reg byte x , reg byte y , +Potential registers zp[1]:215 [ game_logic::pacman_ytile#0 ] : zp[1]:215 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:216 [ game_logic::$210 ] : zp[1]:216 , reg byte x , reg byte y , +Potential registers zp[2]:217 [ game_logic::ytiles#0 ] : zp[2]:217 , +Potential registers zp[1]:219 [ game_logic::tile_id#0 ] : zp[1]:219 , reg byte x , reg byte y , +Potential registers zp[1]:220 [ game_logic::$65 ] : zp[1]:220 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:221 [ game_logic::$66 ] : zp[1]:221 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:222 [ game_logic::$67 ] : zp[2]:222 , +Potential registers zp[1]:224 [ game_logic::$68 ] : zp[1]:224 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:225 [ game_logic::$75 ] : zp[1]:225 , reg byte x , reg byte y , +Potential registers zp[1]:226 [ game_logic::$77 ] : zp[1]:226 , reg byte x , reg byte y , +Potential registers zp[1]:227 [ game_logic::$80 ] : zp[1]:227 , reg byte x , reg byte y , +Potential registers zp[1]:228 [ game_logic::$82 ] : zp[1]:228 , reg byte x , reg byte y , +Potential registers zp[1]:229 [ game_logic::$85 ] : zp[1]:229 , reg byte x , reg byte y , +Potential registers zp[1]:230 [ game_logic::$87 ] : zp[1]:230 , reg byte x , reg byte y , +Potential registers zp[1]:231 [ game_logic::$90 ] : zp[1]:231 , reg byte x , reg byte y , +Potential registers zp[1]:232 [ game_logic::$92 ] : zp[1]:232 , reg byte x , reg byte y , +Potential registers zp[1]:233 [ game_logic::$69 ] : zp[1]:233 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:234 [ game_logic::$70 ] : zp[1]:234 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:235 [ game_logic::$71 ] : zp[2]:235 , +Potential registers zp[1]:237 [ game_logic::$72 ] : zp[1]:237 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:238 [ game_logic::$220 ] : zp[1]:238 , reg byte x , reg byte y , +Potential registers zp[1]:239 [ game_logic::ghost4_xtile#0 ] : zp[1]:239 , reg byte x , reg byte y , +Potential registers zp[1]:240 [ game_logic::ghost4_ytile#0 ] : zp[1]:240 , reg byte x , reg byte y , +Potential registers zp[1]:241 [ level_tile_directions::return#3 ] : zp[1]:241 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:242 [ game_logic::open_directions#0 ] : zp[1]:242 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:243 [ game_logic::open_directions#1 ] : zp[1]:243 , reg byte x , reg byte y , +Potential registers zp[1]:244 [ choose_direction::return#0 ] : zp[1]:244 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:245 [ game_logic::$119 ] : zp[1]:245 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:246 [ game_logic::$223 ] : zp[1]:246 , reg byte x , reg byte y , +Potential registers zp[1]:247 [ game_logic::ghost3_xtile#0 ] : zp[1]:247 , reg byte x , reg byte y , +Potential registers zp[1]:248 [ game_logic::ghost3_ytile#0 ] : zp[1]:248 , reg byte x , reg byte y , +Potential registers zp[1]:249 [ level_tile_directions::return#10 ] : zp[1]:249 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:250 [ game_logic::open_directions1#0 ] : zp[1]:250 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:251 [ game_logic::open_directions1#1 ] : zp[1]:251 , reg byte x , reg byte y , +Potential registers zp[1]:252 [ choose_direction::return#1 ] : zp[1]:252 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:253 [ game_logic::$140 ] : zp[1]:253 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:254 [ game_logic::$226 ] : zp[1]:254 , reg byte x , reg byte y , +Potential registers zp[1]:255 [ game_logic::ghost2_xtile#0 ] : zp[1]:255 , reg byte x , reg byte y , +Potential registers zp[1]:256 [ game_logic::ghost2_ytile#0 ] : zp[1]:256 , reg byte x , reg byte y , +Potential registers zp[1]:257 [ level_tile_directions::return#11 ] : zp[1]:257 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:258 [ game_logic::open_directions2#0 ] : zp[1]:258 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:259 [ game_logic::open_directions2#1 ] : zp[1]:259 , reg byte x , reg byte y , +Potential registers zp[1]:260 [ choose_direction::return#2 ] : zp[1]:260 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:261 [ game_logic::$161 ] : zp[1]:261 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:262 [ game_logic::$229 ] : zp[1]:262 , reg byte x , reg byte y , +Potential registers zp[1]:263 [ game_logic::ghost1_xtile#0 ] : zp[1]:263 , reg byte x , reg byte y , +Potential registers zp[1]:264 [ game_logic::ghost1_ytile#0 ] : zp[1]:264 , reg byte x , reg byte y , +Potential registers zp[1]:265 [ level_tile_directions::return#12 ] : zp[1]:265 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:266 [ game_logic::open_directions3#0 ] : zp[1]:266 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:267 [ game_logic::open_directions3#1 ] : zp[1]:267 , reg byte x , reg byte y , +Potential registers zp[1]:268 [ choose_direction::return#3 ] : zp[1]:268 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:269 [ game_logic::$182 ] : zp[1]:269 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:270 [ game_logic::$232 ] : zp[1]:270 , reg byte x , reg byte y , +Potential registers zp[1]:271 [ game_logic::pacman_xtile1#0 ] : zp[1]:271 , reg byte x , reg byte y , +Potential registers zp[1]:272 [ game_logic::pacman_ytile1#0 ] : zp[1]:272 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:273 [ level_tile_directions::return#13 ] : zp[1]:273 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:274 [ game_logic::open_directions4#0 ] : zp[1]:274 , reg byte x , reg byte y , +Potential registers zp[1]:275 [ game_logic::$199 ] : zp[1]:275 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:276 [ game_logic::$200 ] : zp[1]:276 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:277 [ game_logic::joy_directions#0 ] : zp[1]:277 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:278 [ game_logic::$204 ] : zp[1]:278 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:279 [ game_logic::new_direction#0 ] : zp[1]:279 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:280 [ byteboozer_decrunch::crunched ] : zp[2]:280 , +Potential registers zp[1]:282 [ joyfire::return#1 ] : zp[1]:282 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:283 [ splash_run::$30 ] : zp[1]:283 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:284 [ splash_run::$34 ] : zp[1]:284 , reg byte x , reg byte y , +Potential registers zp[2]:285 [ splash_run::xpos#0 ] : zp[2]:285 , +Potential registers zp[1]:287 [ splash_run::$25 ] : zp[1]:287 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:288 [ level_show::return#0 ] : zp[2]:288 , +Potential registers zp[2]:290 [ gameplay_run::$4 ] : zp[2]:290 , +Potential registers zp[1]:292 [ joyfire::return#0 ] : zp[1]:292 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:293 [ done_run::$8 ] : zp[1]:293 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:294 [ done_run::pixels#0 ] : zp[1]:294 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:295 [ level_tile_directions::$5 ] : zp[1]:295 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:296 [ level_tile_directions::ytiles#0 ] : zp[2]:296 , +Potential registers zp[1]:298 [ choose_direction::xdiff#0 ] : zp[1]:298 , reg byte x , reg byte y , +Potential registers zp[1]:299 [ choose_direction::ydiff#0 ] : zp[1]:299 , reg byte x , reg byte y , +Potential registers zp[1]:300 [ choose_direction::$2 ] : zp[1]:300 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:301 [ choose_direction::$4 ] : zp[1]:301 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:302 [ choose_direction::$6 ] : zp[1]:302 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:303 [ choose_direction::$8 ] : zp[1]:303 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:304 [ choose_direction::dist_right#0 ] : zp[1]:304 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:305 [ memset::end#0 ] : zp[2]:305 , +Potential registers zp[2]:307 [ merge_code::raster_code#1 ] : zp[2]:307 , +Potential registers zp[1]:309 [ merge_code::logic_cycles#0 ] : zp[1]:309 , reg byte x , +Potential registers zp[1]:310 [ merge_code::$5 ] : zp[1]:310 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:311 [ merge_code::dest_code#2 ] : zp[2]:311 , +Potential registers zp[1]:313 [ init_render_index::$9 ] : zp[1]:313 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:314 [ init_render_index::canvas_xcol#0 ] : zp[2]:314 , +Potential registers zp[2]:316 [ init_render_index::$11 ] : zp[2]:316 , +Potential registers zp[2]:318 [ init_render_index::$10 ] : zp[2]:318 , +Potential registers zp[2]:320 [ init_render_index::$12 ] : zp[2]:320 , +Potential registers zp[2]:322 [ init_render_index::canvas#0 ] : zp[2]:322 , +Potential registers zp[1]:324 [ init_render_index::$5 ] : zp[1]:324 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:325 [ init_render_index::$6 ] : zp[1]:325 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:326 [ splash_show::pixels#0 ] : zp[1]:326 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:327 [ init_sprite_pointers::$2 ] : zp[1]:327 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:328 [ init_sprite_pointers::sprite_id#0 ] : zp[1]:328 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:329 [ joyfire::$0 ] : zp[1]:329 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:330 [ level_tile_get::return#3 ] : zp[1]:330 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:331 [ init_level_tile_directions::$3 ] : zp[1]:331 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:332 [ level_tile_get::return#4 ] : zp[1]:332 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:333 [ init_level_tile_directions::$7 ] : zp[1]:333 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:334 [ level_tile_get::return#10 ] : zp[1]:334 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:335 [ init_level_tile_directions::$11 ] : zp[1]:335 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:336 [ level_tile_get::return#11 ] : zp[1]:336 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:337 [ init_level_tile_directions::$15 ] : zp[1]:337 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:338 [ level_show::tile_left#0 ] : zp[1]:338 , reg byte x , reg byte y , +Potential registers zp[1]:339 [ level_show::xtile#1 ] : zp[1]:339 , reg byte x , reg byte y , +Potential registers zp[1]:340 [ level_show::tile_right#0 ] : zp[1]:340 , reg byte x , reg byte y , +Potential registers zp[1]:341 [ render_tiles::xcol#0 ] : zp[1]:341 , reg byte x , reg byte y , +Potential registers zp[1]:342 [ render_tiles::ytile#0 ] : zp[1]:342 , reg byte x , reg byte y , +Potential registers zp[1]:343 [ render_tiles::tile_left#0 ] : zp[1]:343 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:344 [ render_tiles::tile_right#0 ] : zp[1]:344 , reg byte x , reg byte y , +Potential registers zp[1]:345 [ render::ytile#0 ] : zp[1]:345 , reg byte x , reg byte y , +Potential registers zp[1]:346 [ render::$1 ] : zp[1]:346 , reg byte x , reg byte y , +Potential registers zp[1]:347 [ render::$2 ] : zp[1]:347 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:348 [ render::render_index_xcol#0 ] : zp[2]:348 , +Potential registers zp[2]:350 [ render::canvas_offset#0 ] : zp[2]:350 , +Potential registers zp[1]:352 [ render::ypix#0 ] : zp[1]:352 , reg byte x , reg byte y , +Potential registers zp[1]:353 [ level_tile_get::$5 ] : zp[1]:353 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:354 [ level_tile_get::ytiles#0 ] : zp[2]:354 , +Potential registers zp[1]:356 [ render_tiles::$0 ] : zp[1]:356 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:357 [ render_tiles::tile_left_pixels#0 ] : zp[2]:357 , +Potential registers zp[1]:359 [ render_tiles::$2 ] : zp[1]:359 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:360 [ render_tiles::tile_right_pixels#0 ] : zp[2]:360 , +Potential registers zp[1]:362 [ render_tiles::$4 ] : zp[1]:362 , reg byte x , reg byte y , +Potential registers zp[1]:363 [ render_tiles::$5 ] : zp[1]:363 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:364 [ render_tiles::render_index_xcol#0 ] : zp[2]:364 , +Potential registers zp[2]:366 [ render_tiles::canvas_offset#0 ] : zp[2]:366 , +Potential registers zp[1]:368 [ render_tiles::pixels#0 ] : zp[1]:368 , reg byte a , reg byte x , + +REGISTER UPLIFT SCOPES +Uplift Scope [render_tiles] 2,625,000,000,002.62: zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] 1,571,642,857,146.57: zp[1]:111 [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] 1,500,000,000,001.5: zp[1]:368 [ render_tiles::pixels#0 ] 1,166,783,333,335.67: zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] 1,100,086,666,668.63: zp[2]:107 [ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] 58,829,411,764.82: zp[2]:360 [ render_tiles::tile_right_pixels#0 ] 52,636,842,105.37: zp[2]:357 [ render_tiles::tile_left_pixels#0 ] 200,000,002: zp[1]:356 [ render_tiles::$0 ] 200,000,002: zp[1]:359 [ render_tiles::$2 ] 200,000,002: zp[1]:363 [ render_tiles::$5 ] 150,000,001.5: zp[2]:366 [ render_tiles::canvas_offset#0 ] 100,000,001: zp[1]:362 [ render_tiles::$4 ] 55,000,001: zp[1]:343 [ render_tiles::tile_left#0 ] 36,666,667.33: zp[1]:344 [ render_tiles::tile_right#0 ] 25,000,000.25: zp[2]:364 [ render_tiles::render_index_xcol#0 ] 13,750,000.25: zp[1]:341 [ render_tiles::xcol#0 ] 13,750,000.25: zp[1]:342 [ render_tiles::ytile#0 ] +Uplift Scope [render] 260,000,000,002.6: zp[1]:97 [ render::i#2 render::i#1 ] 200,012,500,003.25: zp[1]:100 [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] 150,015,000,003: zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] 116,678,333,335.67: zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] 14,287,142,857.43: zp[1]:352 [ render::ypix#0 ] 20,000,002: zp[1]:347 [ render::$2 ] 15,000,001.5: zp[2]:350 [ render::canvas_offset#0 ] 10,000,001: zp[1]:345 [ render::ytile#0 ] 10,000,001: zp[1]:346 [ render::$1 ] 6,283,336.17: zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] 3,444,446.89: zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] 3,441,180.71: zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] 2,500,000.25: zp[2]:348 [ render::render_index_xcol#0 ] +Uplift Scope [level_tile_get] 223,333,336.17: zp[1]:105 [ level_tile_get::return#2 level_tile_get::return#0 ] 200,000,002: zp[1]:353 [ level_tile_get::$5 ] 200,000,002: zp[2]:354 [ level_tile_get::ytiles#0 ] 140,000,008: zp[1]:104 [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] 108,000,007.2: zp[1]:103 [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] 20,000,002: zp[1]:330 [ level_tile_get::return#3 ] 20,000,002: zp[1]:332 [ level_tile_get::return#4 ] 20,000,002: zp[1]:334 [ level_tile_get::return#10 ] 20,000,002: zp[1]:336 [ level_tile_get::return#11 ] +Uplift Scope [init_level_tile_directions] 104,285,724.71: zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] 22,285,716.51: zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] 20,000,002: zp[1]:331 [ init_level_tile_directions::$3 ] 20,000,002: zp[1]:333 [ init_level_tile_directions::$7 ] 20,000,002: zp[1]:335 [ init_level_tile_directions::$11 ] 20,000,002: zp[1]:337 [ init_level_tile_directions::$15 ] 3,102,566.28: zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] 1,315,790.55: zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] +Uplift Scope [level_show] 59,357,399.75: zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] 22,352,943.41: zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] 12,000,001.2: zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] 6,000,000.6: zp[1]:339 [ level_show::xtile#1 ] 3,750,000.38: zp[1]:340 [ level_show::tile_right#0 ] 2,619,049.81: zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] 2,500,000.25: zp[1]:338 [ level_show::tile_left#0 ] 2,100,001.2: zp[2]:88 [ level_show::level#8 level_show::level#1 ] 2,002: zp[2]:288 [ level_show::return#0 ] +Uplift Scope [init_sprite_pointers] 30,000,003: zp[1]:76 [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] 20,000,002: zp[1]:327 [ init_sprite_pointers::$2 ] 15,000,001.5: zp[1]:328 [ init_sprite_pointers::sprite_id#0 ] 3,181,820.55: zp[1]:71 [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] 2,200,001.3: zp[2]:74 [ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] 2,000,001: zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] +Uplift Scope [joyfire] 20,000,002: zp[1]:329 [ joyfire::$0 ] 2,000,002: zp[1]:292 [ joyfire::return#0 ] 252,500.5: zp[1]:81 [ joyfire::return#4 ] 20,002: zp[1]:282 [ joyfire::return#1 ] +Uplift Scope [done_run] 2,500,002.5: zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] 2,000,002: zp[1]:293 [ done_run::$8 ] 1,233,335.92: zp[2]:22 [ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] 500,000.5: zp[1]:294 [ done_run::pixels#0 ] 333,336.67: zp[1]:19 [ done_run::i#2 done_run::i#1 ] 320,003.2: zp[1]:20 [ done_run::i1#2 done_run::i1#1 ] 318,184.18: zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Uplift Scope [merge_code] 3,250,005.5: zp[2]:52 [ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] 2,293,023.77: zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] 749,611.63: zp[1]:51 [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] 325,005.5: zp[2]:47 [ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] 178,339.17: zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] 150,001.5: zp[2]:311 [ merge_code::dest_code#2 ] 100,001: zp[1]:310 [ merge_code::$5 ] 61,432.14: zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] 41,667.08: zp[1]:309 [ merge_code::logic_cycles#0 ] 15,001.5: zp[2]:307 [ merge_code::raster_code#1 ] +Uplift Scope [init_render_index] 530,687.43: zp[1]:62 [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] 218,752.19: zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] 200,002: zp[2]:316 [ init_render_index::$11 ] 200,002: zp[2]:318 [ init_render_index::$10 ] 200,002: zp[2]:320 [ init_render_index::$12 ] 200,002: zp[1]:324 [ init_render_index::$5 ] 200,002: zp[1]:325 [ init_render_index::$6 ] 154,003.4: zp[2]:60 [ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] 100,001: zp[2]:322 [ init_render_index::canvas#0 ] 21,925.27: zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] 20,002: zp[1]:313 [ init_render_index::$9 ] 11,201.12: zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] 5,789.58: zp[2]:314 [ init_render_index::canvas_xcol#0 ] 4,761.95: zp[2]:57 [ init_render_index::render_ypos_table#4 ] +Uplift Scope [gameplay_run] 333,336.67: zp[1]:16 [ gameplay_run::i#2 gameplay_run::i#1 ] 333,336.67: zp[1]:17 [ gameplay_run::i1#2 gameplay_run::i1#1 ] 333,336.67: zp[1]:18 [ gameplay_run::i2#2 gameplay_run::i2#1 ] 2,002: zp[2]:290 [ gameplay_run::$4 ] +Uplift Scope [splash_show] 250,002.5: zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] 123,335.92: zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] 50,000.5: zp[1]:326 [ splash_show::pixels#0 ] 31,820.55: zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Uplift Scope [init_bobs_restore] 333,336.67: zp[1]:70 [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] 26,001.7: zp[2]:68 [ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] 22,729.55: zp[1]:67 [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +Uplift Scope [] 69,506.88: zp[1]:142 [ music_play_next ] 11,040: zp[1]:134 [ side_sprites_color ] 11,040: zp[1]:135 [ side_sprites_mc ] 11,040: zp[1]:136 [ bottom_sprites_color ] 11,040: zp[1]:137 [ bottom_sprites_mc ] 10,250: zp[2]:114 [ logic_tile_ptr ] 10,250: zp[1]:116 [ logic_tile_xcol ] 10,250: zp[1]:117 [ logic_tile_yfine ] 3,403.67: zp[1]:132 [ top_sprites_color ] 1,545.7: zp[1]:140 [ pacman_wins ] 1,070: zp[1]:130 [ canvas_base_hi ] 1,070: zp[1]:131 [ bobs_restore_base ] 656.44: zp[1]:141 [ pacman_lives ] 271.84: zp[1]:157 [ ghost1_respawn ] 264.68: zp[1]:163 [ ghost2_respawn ] 257.9: zp[1]:169 [ ghost3_respawn ] 251.45: zp[1]:175 [ ghost4_respawn ] 234.93: zp[1]:151 [ ghosts_mode_count ] 233.4: zp[1]:149 [ pacman_substep ] 223.51: zp[1]:155 [ ghost1_substep ] 218.65: zp[1]:161 [ ghost2_substep ] 214: zp[1]:167 [ ghost3_substep ] 209.54: zp[1]:173 [ ghost4_substep ] 132.92: zp[1]:148 [ pacman_direction ] 122.24: zp[1]:154 [ ghost1_direction ] 110.28: zp[1]:160 [ ghost2_direction ] 100.46: zp[1]:166 [ ghost3_direction ] 92.24: zp[1]:172 [ ghost4_direction ] 92: zp[1]:133 [ top_sprites_mc ] 84.55: zp[1]:152 [ ghost1_xfine ] 82.13: zp[1]:153 [ ghost1_yfine ] 78.04: zp[1]:143 [ phase ] 76.29: zp[1]:158 [ ghost2_xfine ] 74.28: zp[1]:159 [ ghost2_yfine ] 69.49: zp[1]:164 [ ghost3_xfine ] 69.48: zp[1]:177 [ game_playable ] 67.8: zp[1]:165 [ ghost3_yfine ] 63.81: zp[1]:170 [ ghost4_xfine ] 62.36: zp[1]:171 [ ghost4_yfine ] 47.72: zp[1]:146 [ pacman_xfine ] 46.22: zp[1]:147 [ pacman_yfine ] 20: zp[1]:118 [ logic_tile_left_idx ] 20: zp[1]:119 [ logic_tile_right_idx ] 20: zp[2]:120 [ left_render_index_xcol ] 20: zp[2]:122 [ left_canvas ] 20: zp[1]:124 [ left_ypos_inc_offset ] 20: zp[2]:125 [ rigt_render_index_xcol ] 20: zp[2]:127 [ rigt_canvas ] 20: zp[1]:129 [ rigt_ypos_inc_offset ] 14.19: zp[2]:138 [ pill_count ] 2.95: zp[1]:176 [ game_logic_substep ] 1.94: zp[1]:113 [ pacman_ch1_idx ] 1.1: zp[1]:150 [ ghosts_mode ] 0.9: zp[1]:145 [ anim_frame_idx ] 0.73: zp[1]:156 [ ghost1_reverse ] 0.71: zp[1]:162 [ ghost2_reverse ] 0.7: zp[1]:168 [ ghost3_reverse ] 0.69: zp[1]:174 [ ghost4_reverse ] 0.5: zp[1]:144 [ frame ] 0.08: zp[1]:112 [ pacman_ch1_enabled ] +Uplift Scope [memcpy] 30,003: zp[2]:77 [ memcpy::src#2 memcpy::src#1 ] 20,002: zp[2]:79 [ memcpy::dst#2 memcpy::dst#1 ] +Uplift Scope [memset] 35,672.33: zp[2]:41 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 1,833.67: zp[2]:305 [ memset::end#0 ] 1,001: zp[2]:37 [ memset::num#5 ] 0: zp[2]:39 [ memset::str#6 ] +Uplift Scope [splash_run] 20,002: zp[1]:283 [ splash_run::$30 ] 4,679.75: zp[1]:13 [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] 3,336.67: zp[1]:14 [ splash_run::i1#2 splash_run::i1#1 ] 3,203.2: zp[1]:15 [ splash_run::i2#2 splash_run::i2#1 ] 2,366: zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] 2,002: zp[1]:287 [ splash_run::$25 ] 1,334.67: zp[1]:284 [ splash_run::$34 ] 667.33: zp[2]:285 [ splash_run::xpos#0 ] +Uplift Scope [choose_direction] 676.7: zp[1]:34 [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] 656.5: zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] 202: zp[1]:300 [ choose_direction::$2 ] 202: zp[1]:301 [ choose_direction::$4 ] 202: zp[1]:302 [ choose_direction::$6 ] 202: zp[1]:303 [ choose_direction::$8 ] 202: zp[1]:304 [ choose_direction::dist_right#0 ] 194.9: zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] 189: zp[1]:29 [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] 181.8: zp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] 167: zp[1]:28 [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] 160.5: zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] 101.83: zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] 37.08: zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] 22: zp[1]:244 [ choose_direction::return#0 ] 22: zp[1]:252 [ choose_direction::return#1 ] 22: zp[1]:260 [ choose_direction::return#2 ] 22: zp[1]:268 [ choose_direction::return#3 ] 21.96: zp[1]:299 [ choose_direction::ydiff#0 ] 21.04: zp[1]:298 [ choose_direction::xdiff#0 ] +Uplift Scope [game_logic] 40.5: zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] 26.4: zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] 26.4: zp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] 26.4: zp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] 26.4: zp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] 22: zp[1]:180 [ game_logic::$2 ] 22: zp[1]:181 [ game_logic::$3 ] 22: zp[1]:182 [ game_logic::$14 ] 22: zp[1]:183 [ game_logic::$15 ] 22: zp[1]:185 [ game_logic::$17 ] 22: zp[1]:186 [ game_logic::$18 ] 22: zp[1]:188 [ game_logic::$20 ] 22: zp[1]:189 [ game_logic::$21 ] 22: zp[1]:191 [ game_logic::$25 ] 22: zp[1]:192 [ game_logic::$26 ] 22: zp[1]:194 [ game_logic::$28 ] 22: zp[1]:195 [ game_logic::$29 ] 22: zp[1]:197 [ game_logic::$31 ] 22: zp[1]:198 [ game_logic::$32 ] 22: zp[1]:200 [ game_logic::$34 ] 22: zp[1]:201 [ game_logic::$35 ] 22: zp[1]:203 [ game_logic::$37 ] 22: zp[1]:204 [ game_logic::$38 ] 22: zp[1]:206 [ game_logic::$40 ] 22: zp[1]:207 [ game_logic::$41 ] 22: zp[1]:209 [ game_logic::$43 ] 22: zp[1]:210 [ game_logic::$44 ] 22: zp[1]:212 [ game_logic::$46 ] 22: zp[1]:213 [ game_logic::$47 ] 22: zp[1]:215 [ game_logic::pacman_ytile#0 ] 22: zp[1]:220 [ game_logic::$65 ] 22: zp[1]:221 [ game_logic::$66 ] 22: zp[2]:222 [ game_logic::$67 ] 22: zp[1]:224 [ game_logic::$68 ] 22: zp[1]:233 [ game_logic::$69 ] 22: zp[1]:234 [ game_logic::$70 ] 22: zp[2]:235 [ game_logic::$71 ] 22: zp[1]:237 [ game_logic::$72 ] 22: zp[1]:242 [ game_logic::open_directions#0 ] 22: zp[1]:245 [ game_logic::$119 ] 22: zp[1]:250 [ game_logic::open_directions1#0 ] 22: zp[1]:253 [ game_logic::$140 ] 22: zp[1]:258 [ game_logic::open_directions2#0 ] 22: zp[1]:261 [ game_logic::$161 ] 22: zp[1]:266 [ game_logic::open_directions3#0 ] 22: zp[1]:269 [ game_logic::$182 ] 22: zp[1]:275 [ game_logic::$199 ] 22: zp[1]:276 [ game_logic::$200 ] 22: zp[1]:278 [ game_logic::$204 ] 16.5: zp[1]:4 [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] 16.5: zp[1]:6 [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] 16.5: zp[1]:8 [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] 16.5: zp[1]:10 [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] 16.5: zp[1]:219 [ game_logic::tile_id#0 ] 16.5: zp[1]:277 [ game_logic::joy_directions#0 ] 16.5: zp[1]:279 [ game_logic::new_direction#0 ] 11: zp[1]:3 [ game_logic::do_reverse#4 ] 11: zp[1]:187 [ game_logic::$19 ] 11: zp[1]:193 [ game_logic::$27 ] 11: zp[1]:199 [ game_logic::$33 ] 11: zp[1]:205 [ game_logic::$39 ] 11: zp[1]:211 [ game_logic::$45 ] 11: zp[1]:225 [ game_logic::$75 ] 11: zp[1]:226 [ game_logic::$77 ] 11: zp[1]:227 [ game_logic::$80 ] 11: zp[1]:228 [ game_logic::$82 ] 11: zp[1]:229 [ game_logic::$85 ] 11: zp[1]:230 [ game_logic::$87 ] 11: zp[1]:231 [ game_logic::$90 ] 11: zp[1]:232 [ game_logic::$92 ] 11: zp[1]:238 [ game_logic::$220 ] 11: zp[1]:246 [ game_logic::$223 ] 11: zp[1]:254 [ game_logic::$226 ] 11: zp[1]:262 [ game_logic::$229 ] 11: zp[1]:270 [ game_logic::$232 ] 11: zp[1]:271 [ game_logic::pacman_xtile1#0 ] 11: zp[1]:272 [ game_logic::pacman_ytile1#0 ] 6.77: zp[1]:214 [ game_logic::pacman_xtile#0 ] 5.5: zp[1]:184 [ game_logic::pacman_bob_xfine#0 ] 5.5: zp[1]:190 [ game_logic::ghost1_bob_xfine#0 ] 5.5: zp[1]:196 [ game_logic::ghost2_bob_xfine#0 ] 5.5: zp[1]:202 [ game_logic::ghost3_bob_xfine#0 ] 5.5: zp[1]:208 [ game_logic::ghost4_bob_xfine#0 ] 5.5: zp[2]:217 [ game_logic::ytiles#0 ] 5.5: zp[1]:243 [ game_logic::open_directions#1 ] 5.5: zp[1]:251 [ game_logic::open_directions1#1 ] 5.5: zp[1]:259 [ game_logic::open_directions2#1 ] 5.5: zp[1]:267 [ game_logic::open_directions3#1 ] 3.67: zp[1]:274 [ game_logic::open_directions4#0 ] 2.59: zp[1]:216 [ game_logic::$210 ] 2.36: zp[1]:239 [ game_logic::ghost4_xtile#0 ] 2.36: zp[1]:240 [ game_logic::ghost4_ytile#0 ] 2.36: zp[1]:247 [ game_logic::ghost3_xtile#0 ] 2.36: zp[1]:248 [ game_logic::ghost3_ytile#0 ] 2.36: zp[1]:255 [ game_logic::ghost2_xtile#0 ] 2.36: zp[1]:256 [ game_logic::ghost2_ytile#0 ] 2.36: zp[1]:263 [ game_logic::ghost1_xtile#0 ] 2.36: zp[1]:264 [ game_logic::ghost1_ytile#0 ] +Uplift Scope [level_tile_directions] 224.29: zp[1]:27 [ level_tile_directions::return#2 level_tile_directions::return#0 ] 202: zp[1]:295 [ level_tile_directions::$5 ] 202: zp[2]:296 [ level_tile_directions::ytiles#0 ] 195.67: zp[1]:26 [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] 106.4: zp[1]:25 [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] 22: zp[1]:241 [ level_tile_directions::return#3 ] 22: zp[1]:249 [ level_tile_directions::return#10 ] 22: zp[1]:257 [ level_tile_directions::return#11 ] 22: zp[1]:265 [ level_tile_directions::return#12 ] 22: zp[1]:273 [ level_tile_directions::return#13 ] +Uplift Scope [byteboozer_decrunch] 438.5: zp[2]:280 [ byteboozer_decrunch::crunched ] +Uplift Scope [irq_screen_top] 4: zp[1]:178 [ irq_screen_top::$1 ] 4: zp[1]:179 [ irq_screen_top::$2 ] +Uplift Scope [MOS6526_CIA] +Uplift Scope [MOS6569_VICII] +Uplift Scope [MOS6581_SID] +Uplift Scope [pacman_sound_init] +Uplift Scope [pacman_sound_play] +Uplift Scope [TILE_TYPE] +Uplift Scope [main] +Uplift Scope [joyinit] +Uplift Scope [DIRECTION] +Uplift Scope [GHOSTS_MODE] +Uplift Scope [spawn_all] +Uplift Scope [__start] + +Uplifting [render_tiles] best 2570194 combination zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] reg byte x [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] reg byte a [ render_tiles::pixels#0 ] zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] zp[2]:107 [ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] zp[2]:360 [ render_tiles::tile_right_pixels#0 ] zp[2]:357 [ render_tiles::tile_left_pixels#0 ] reg byte a [ render_tiles::$0 ] reg byte a [ render_tiles::$2 ] zp[1]:363 [ render_tiles::$5 ] zp[2]:366 [ render_tiles::canvas_offset#0 ] zp[1]:362 [ render_tiles::$4 ] zp[1]:343 [ render_tiles::tile_left#0 ] zp[1]:344 [ render_tiles::tile_right#0 ] zp[2]:364 [ render_tiles::render_index_xcol#0 ] zp[1]:341 [ render_tiles::xcol#0 ] zp[1]:342 [ render_tiles::ytile#0 ] +Limited combination testing to 100 combinations of 248832 possible. +Uplifting [render] best 2390187 combination reg byte y [ render::i#2 render::i#1 ] reg byte x [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] zp[1]:352 [ render::ypix#0 ] reg byte a [ render::$2 ] zp[2]:350 [ render::canvas_offset#0 ] zp[1]:345 [ render::ytile#0 ] zp[1]:346 [ render::$1 ] zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] zp[2]:348 [ render::render_index_xcol#0 ] +Limited combination testing to 100 combinations of 11664 possible. +Uplifting [level_tile_get] best 2358169 combination reg byte a [ level_tile_get::return#2 level_tile_get::return#0 ] reg byte a [ level_tile_get::$5 ] zp[2]:354 [ level_tile_get::ytiles#0 ] reg byte a [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] reg byte x [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] zp[1]:330 [ level_tile_get::return#3 ] zp[1]:332 [ level_tile_get::return#4 ] zp[1]:334 [ level_tile_get::return#10 ] zp[1]:336 [ level_tile_get::return#11 ] +Limited combination testing to 100 combinations of 49152 possible. +Uplifting [init_level_tile_directions] best 2346169 combination zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] reg byte x [ init_level_tile_directions::$3 ] reg byte x [ init_level_tile_directions::$7 ] zp[1]:335 [ init_level_tile_directions::$11 ] zp[1]:337 [ init_level_tile_directions::$15 ] zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] +Limited combination testing to 100 combinations of 6912 possible. +Uplifting [level_show] best 2330169 combination zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] reg byte y [ level_show::xtile#1 ] zp[1]:340 [ level_show::tile_right#0 ] zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] reg byte x [ level_show::tile_left#0 ] zp[2]:88 [ level_show::level#8 level_show::level#1 ] zp[2]:288 [ level_show::return#0 ] +Limited combination testing to 100 combinations of 216 possible. +Uplifting [init_sprite_pointers] best 2297269 combination reg byte y [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] reg byte a [ init_sprite_pointers::$2 ] reg byte a [ init_sprite_pointers::sprite_id#0 ] reg byte x [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] zp[2]:74 [ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] +Limited combination testing to 100 combinations of 144 possible. +Uplifting [joyfire] best 2287359 combination reg byte a [ joyfire::$0 ] reg byte a [ joyfire::return#0 ] reg byte a [ joyfire::return#4 ] reg byte a [ joyfire::return#1 ] +Limited combination testing to 100 combinations of 256 possible. +Uplifting [done_run] best 2278159 combination zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] reg byte a [ done_run::$8 ] zp[2]:22 [ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] reg byte x [ done_run::pixels#0 ] reg byte x [ done_run::i#2 done_run::i#1 ] zp[1]:20 [ done_run::i1#2 done_run::i1#1 ] zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Limited combination testing to 100 combinations of 576 possible. +Uplifting [merge_code] best 2275669 combination zp[2]:52 [ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] reg byte x [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] zp[2]:47 [ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] zp[2]:311 [ merge_code::dest_code#2 ] reg byte y [ merge_code::$5 ] zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] zp[1]:309 [ merge_code::logic_cycles#0 ] zp[2]:307 [ merge_code::raster_code#1 ] +Uplifting [init_render_index] best 2272969 combination reg byte x [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] zp[2]:316 [ init_render_index::$11 ] zp[2]:318 [ init_render_index::$10 ] zp[2]:320 [ init_render_index::$12 ] reg byte a [ init_render_index::$5 ] reg byte a [ init_render_index::$6 ] zp[2]:60 [ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] zp[2]:322 [ init_render_index::canvas#0 ] zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] reg byte a [ init_render_index::$9 ] zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] zp[2]:314 [ init_render_index::canvas_xcol#0 ] zp[2]:57 [ init_render_index::render_ypos_table#4 ] +Limited combination testing to 100 combinations of 128 possible. +Uplifting [gameplay_run] best 2269369 combination reg byte x [ gameplay_run::i#2 gameplay_run::i#1 ] reg byte x [ gameplay_run::i1#2 gameplay_run::i1#1 ] reg byte x [ gameplay_run::i2#2 gameplay_run::i2#1 ] zp[2]:290 [ gameplay_run::$4 ] +Uplifting [splash_show] best 2268969 combination zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] reg byte x [ splash_show::pixels#0 ] zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Uplifting [init_bobs_restore] best 2267679 combination reg byte y [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] zp[2]:68 [ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] reg byte x [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +Uplifting [] best 2267679 combination zp[1]:142 [ music_play_next ] zp[1]:134 [ side_sprites_color ] zp[1]:135 [ side_sprites_mc ] zp[1]:136 [ bottom_sprites_color ] zp[1]:137 [ bottom_sprites_mc ] zp[2]:114 [ logic_tile_ptr ] zp[1]:116 [ logic_tile_xcol ] zp[1]:117 [ logic_tile_yfine ] zp[1]:132 [ top_sprites_color ] zp[1]:140 [ pacman_wins ] zp[1]:130 [ canvas_base_hi ] zp[1]:131 [ bobs_restore_base ] zp[1]:141 [ pacman_lives ] zp[1]:157 [ ghost1_respawn ] zp[1]:163 [ ghost2_respawn ] zp[1]:169 [ ghost3_respawn ] zp[1]:175 [ ghost4_respawn ] zp[1]:151 [ ghosts_mode_count ] zp[1]:149 [ pacman_substep ] zp[1]:155 [ ghost1_substep ] zp[1]:161 [ ghost2_substep ] zp[1]:167 [ ghost3_substep ] zp[1]:173 [ ghost4_substep ] zp[1]:148 [ pacman_direction ] zp[1]:154 [ ghost1_direction ] zp[1]:160 [ ghost2_direction ] zp[1]:166 [ ghost3_direction ] zp[1]:172 [ ghost4_direction ] zp[1]:133 [ top_sprites_mc ] zp[1]:152 [ ghost1_xfine ] zp[1]:153 [ ghost1_yfine ] zp[1]:143 [ phase ] zp[1]:158 [ ghost2_xfine ] zp[1]:159 [ ghost2_yfine ] zp[1]:164 [ ghost3_xfine ] zp[1]:177 [ game_playable ] zp[1]:165 [ ghost3_yfine ] zp[1]:170 [ ghost4_xfine ] zp[1]:171 [ ghost4_yfine ] zp[1]:146 [ pacman_xfine ] zp[1]:147 [ pacman_yfine ] zp[1]:118 [ logic_tile_left_idx ] zp[1]:119 [ logic_tile_right_idx ] zp[2]:120 [ left_render_index_xcol ] zp[2]:122 [ left_canvas ] zp[1]:124 [ left_ypos_inc_offset ] zp[2]:125 [ rigt_render_index_xcol ] zp[2]:127 [ rigt_canvas ] zp[1]:129 [ rigt_ypos_inc_offset ] zp[2]:138 [ pill_count ] zp[1]:176 [ game_logic_substep ] zp[1]:113 [ pacman_ch1_idx ] zp[1]:150 [ ghosts_mode ] zp[1]:145 [ anim_frame_idx ] zp[1]:156 [ ghost1_reverse ] zp[1]:162 [ ghost2_reverse ] zp[1]:168 [ ghost3_reverse ] zp[1]:174 [ ghost4_reverse ] zp[1]:144 [ frame ] zp[1]:112 [ pacman_ch1_enabled ] +Uplifting [memcpy] best 2267679 combination zp[2]:77 [ memcpy::src#2 memcpy::src#1 ] zp[2]:79 [ memcpy::dst#2 memcpy::dst#1 ] +Uplifting [memset] best 2267679 combination zp[2]:41 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:305 [ memset::end#0 ] zp[2]:37 [ memset::num#5 ] zp[2]:39 [ memset::str#6 ] +Uplifting [splash_run] best 2266936 combination reg byte a [ splash_run::$30 ] reg byte x [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] reg byte x [ splash_run::i1#2 splash_run::i1#1 ] reg byte x [ splash_run::i2#2 splash_run::i2#1 ] zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] zp[1]:287 [ splash_run::$25 ] zp[1]:284 [ splash_run::$34 ] zp[2]:285 [ splash_run::xpos#0 ] +Limited combination testing to 100 combinations of 3888 possible. +Uplifting [choose_direction] best 2266915 combination reg byte x [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] reg byte a [ choose_direction::$2 ] reg byte a [ choose_direction::$4 ] zp[1]:302 [ choose_direction::$6 ] zp[1]:303 [ choose_direction::$8 ] zp[1]:304 [ choose_direction::dist_right#0 ] zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] zp[1]:29 [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] zp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] zp[1]:28 [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] zp[1]:244 [ choose_direction::return#0 ] zp[1]:252 [ choose_direction::return#1 ] zp[1]:260 [ choose_direction::return#2 ] zp[1]:268 [ choose_direction::return#3 ] zp[1]:299 [ choose_direction::ydiff#0 ] zp[1]:298 [ choose_direction::xdiff#0 ] +Limited combination testing to 100 combinations of 952107008 possible. +Uplifting [level_tile_directions] best 2266852 combination reg byte a [ level_tile_directions::return#2 level_tile_directions::return#0 ] reg byte a [ level_tile_directions::$5 ] zp[2]:296 [ level_tile_directions::ytiles#0 ] reg byte a [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] reg byte x [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] zp[1]:241 [ level_tile_directions::return#3 ] zp[1]:249 [ level_tile_directions::return#10 ] zp[1]:257 [ level_tile_directions::return#11 ] zp[1]:265 [ level_tile_directions::return#12 ] zp[1]:273 [ level_tile_directions::return#13 ] +Limited combination testing to 100 combinations of 196608 possible. +Uplifting [byteboozer_decrunch] best 2266852 combination zp[2]:280 [ byteboozer_decrunch::crunched ] +Uplifting [irq_screen_top] best 2266842 combination reg byte a [ irq_screen_top::$1 ] reg byte a [ irq_screen_top::$2 ] +Uplifting [MOS6526_CIA] best 2266842 combination +Uplifting [MOS6569_VICII] best 2266842 combination +Uplifting [MOS6581_SID] best 2266842 combination +Uplifting [pacman_sound_init] best 2266842 combination +Uplifting [pacman_sound_play] best 2266842 combination +Uplifting [TILE_TYPE] best 2266842 combination +Uplifting [main] best 2266842 combination +Uplifting [joyinit] best 2266842 combination +Uplifting [DIRECTION] best 2266842 combination +Uplifting [GHOSTS_MODE] best 2266842 combination +Uplifting [spawn_all] best 2266842 combination +Uplifting [__start] best 2266842 combination +Attempting to uplift remaining variables inzp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] +Uplifting [render_tiles] best 2266842 combination zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] +Attempting to uplift remaining variables inzp[1]:352 [ render::ypix#0 ] +Uplifting [render] best 2266842 combination zp[1]:352 [ render::ypix#0 ] +Attempting to uplift remaining variables inzp[1]:363 [ render_tiles::$5 ] +Uplifting [render_tiles] best 2266836 combination reg byte a [ render_tiles::$5 ] +Attempting to uplift remaining variables inzp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +Uplifting [init_level_tile_directions] best 2266836 combination zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +Attempting to uplift remaining variables inzp[1]:362 [ render_tiles::$4 ] +Uplifting [render_tiles] best 2266830 combination reg byte x [ render_tiles::$4 ] +Attempting to uplift remaining variables inzp[1]:343 [ render_tiles::tile_left#0 ] +Uplifting [render_tiles] best 2263829 combination reg byte x [ render_tiles::tile_left#0 ] +Attempting to uplift remaining variables inzp[1]:344 [ render_tiles::tile_right#0 ] +Uplifting [render_tiles] best 2260828 combination reg byte y [ render_tiles::tile_right#0 ] +Attempting to uplift remaining variables inzp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] +Uplifting [level_show] best 2260828 combination zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] +Attempting to uplift remaining variables inzp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +Uplifting [init_level_tile_directions] best 2260828 combination zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] +Attempting to uplift remaining variables inzp[1]:330 [ level_tile_get::return#3 ] +Uplifting [level_tile_get] best 2256828 combination reg byte a [ level_tile_get::return#3 ] +Attempting to uplift remaining variables inzp[1]:332 [ level_tile_get::return#4 ] +Uplifting [level_tile_get] best 2252828 combination reg byte a [ level_tile_get::return#4 ] +Attempting to uplift remaining variables inzp[1]:334 [ level_tile_get::return#10 ] +Uplifting [level_tile_get] best 2246828 combination reg byte a [ level_tile_get::return#10 ] +Attempting to uplift remaining variables inzp[1]:335 [ init_level_tile_directions::$11 ] +Uplifting [init_level_tile_directions] best 2242828 combination reg byte a [ init_level_tile_directions::$11 ] +Attempting to uplift remaining variables inzp[1]:336 [ level_tile_get::return#11 ] +Uplifting [level_tile_get] best 2236828 combination reg byte a [ level_tile_get::return#11 ] +Attempting to uplift remaining variables inzp[1]:337 [ init_level_tile_directions::$15 ] +Uplifting [init_level_tile_directions] best 2232828 combination reg byte a [ init_level_tile_directions::$15 ] +Attempting to uplift remaining variables inzp[1]:341 [ render_tiles::xcol#0 ] +Uplifting [render_tiles] best 2232828 combination zp[1]:341 [ render_tiles::xcol#0 ] +Attempting to uplift remaining variables inzp[1]:342 [ render_tiles::ytile#0 ] +Uplifting [render_tiles] best 2232828 combination zp[1]:342 [ render_tiles::ytile#0 ] +Attempting to uplift remaining variables inzp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] +Uplifting [level_show] best 2232828 combination zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] +Attempting to uplift remaining variables inzp[1]:345 [ render::ytile#0 ] +Uplifting [render] best 2232826 combination reg byte y [ render::ytile#0 ] +Attempting to uplift remaining variables inzp[1]:346 [ render::$1 ] +Uplifting [render] best 2232820 combination reg byte x [ render::$1 ] +Attempting to uplift remaining variables inzp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] +Uplifting [render] best 2232820 combination zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] +Attempting to uplift remaining variables inzp[1]:340 [ level_show::tile_right#0 ] +Uplifting [level_show] best 2232820 combination zp[1]:340 [ level_show::tile_right#0 ] +Attempting to uplift remaining variables inzp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] +Uplifting [render] best 2232820 combination zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] +Attempting to uplift remaining variables inzp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] +Uplifting [render] best 2232820 combination zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] +Attempting to uplift remaining variables inzp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +Uplifting [init_level_tile_directions] best 2232820 combination zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] +Attempting to uplift remaining variables inzp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] +Uplifting [level_show] best 2232820 combination zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] +Attempting to uplift remaining variables inzp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] +Uplifting [done_run] best 2232820 combination zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] +Attempting to uplift remaining variables inzp[1]:20 [ done_run::i1#2 done_run::i1#1 ] +Uplifting [done_run] best 2231020 combination reg byte x [ done_run::i1#2 done_run::i1#1 ] +Attempting to uplift remaining variables inzp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Uplifting [done_run] best 2231020 combination zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] +Attempting to uplift remaining variables inzp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] +Uplifting [splash_show] best 2231020 combination zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] +Attempting to uplift remaining variables inzp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Uplifting [init_render_index] best 2231020 combination zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] +Attempting to uplift remaining variables inzp[1]:142 [ music_play_next ] +Uplifting [] best 2231020 combination zp[1]:142 [ music_play_next ] +Attempting to uplift remaining variables inzp[1]:309 [ merge_code::logic_cycles#0 ] +Uplifting [merge_code] best 2231020 combination zp[1]:309 [ merge_code::logic_cycles#0 ] +Attempting to uplift remaining variables inzp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Uplifting [splash_show] best 2231020 combination zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] +Attempting to uplift remaining variables inzp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Uplifting [init_render_index] best 2231020 combination zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] +Attempting to uplift remaining variables inzp[1]:134 [ side_sprites_color ] +Uplifting [] best 2231020 combination zp[1]:134 [ side_sprites_color ] +Attempting to uplift remaining variables inzp[1]:135 [ side_sprites_mc ] +Uplifting [] best 2231020 combination zp[1]:135 [ side_sprites_mc ] +Attempting to uplift remaining variables inzp[1]:136 [ bottom_sprites_color ] +Uplifting [] best 2231020 combination zp[1]:136 [ bottom_sprites_color ] +Attempting to uplift remaining variables inzp[1]:137 [ bottom_sprites_mc ] +Uplifting [] best 2231020 combination zp[1]:137 [ bottom_sprites_mc ] +Attempting to uplift remaining variables inzp[1]:116 [ logic_tile_xcol ] +Uplifting [] best 2231020 combination zp[1]:116 [ logic_tile_xcol ] +Attempting to uplift remaining variables inzp[1]:117 [ logic_tile_yfine ] +Uplifting [] best 2231020 combination zp[1]:117 [ logic_tile_yfine ] +Attempting to uplift remaining variables inzp[1]:132 [ top_sprites_color ] +Uplifting [] best 2231020 combination zp[1]:132 [ top_sprites_color ] +Attempting to uplift remaining variables inzp[1]:12 [ splash_run::i#2 splash_run::i#1 ] +Uplifting [splash_run] best 2231020 combination zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] +Attempting to uplift remaining variables inzp[1]:287 [ splash_run::$25 ] +Uplifting [splash_run] best 2230980 combination reg byte a [ splash_run::$25 ] +Attempting to uplift remaining variables inzp[1]:140 [ pacman_wins ] +Uplifting [] best 2230980 combination zp[1]:140 [ pacman_wins ] +Attempting to uplift remaining variables inzp[1]:284 [ splash_run::$34 ] +Uplifting [splash_run] best 2230880 combination reg byte y [ splash_run::$34 ] +Attempting to uplift remaining variables inzp[1]:130 [ canvas_base_hi ] +Uplifting [] best 2230880 combination zp[1]:130 [ canvas_base_hi ] +Attempting to uplift remaining variables inzp[1]:131 [ bobs_restore_base ] +Uplifting [] best 2230880 combination zp[1]:131 [ bobs_restore_base ] +Attempting to uplift remaining variables inzp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +Uplifting [choose_direction] best 2230880 combination zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +Attempting to uplift remaining variables inzp[1]:141 [ pacman_lives ] +Uplifting [] best 2230880 combination zp[1]:141 [ pacman_lives ] +Attempting to uplift remaining variables inzp[1]:157 [ ghost1_respawn ] +Uplifting [] best 2230880 combination zp[1]:157 [ ghost1_respawn ] +Attempting to uplift remaining variables inzp[1]:163 [ ghost2_respawn ] +Uplifting [] best 2230880 combination zp[1]:163 [ ghost2_respawn ] +Attempting to uplift remaining variables inzp[1]:169 [ ghost3_respawn ] +Uplifting [] best 2230880 combination zp[1]:169 [ ghost3_respawn ] +Attempting to uplift remaining variables inzp[1]:175 [ ghost4_respawn ] +Uplifting [] best 2230880 combination zp[1]:175 [ ghost4_respawn ] +Attempting to uplift remaining variables inzp[1]:151 [ ghosts_mode_count ] +Uplifting [] best 2230880 combination zp[1]:151 [ ghosts_mode_count ] +Attempting to uplift remaining variables inzp[1]:149 [ pacman_substep ] +Uplifting [] best 2230880 combination zp[1]:149 [ pacman_substep ] +Attempting to uplift remaining variables inzp[1]:155 [ ghost1_substep ] +Uplifting [] best 2230880 combination zp[1]:155 [ ghost1_substep ] +Attempting to uplift remaining variables inzp[1]:161 [ ghost2_substep ] +Uplifting [] best 2230880 combination zp[1]:161 [ ghost2_substep ] +Attempting to uplift remaining variables inzp[1]:167 [ ghost3_substep ] +Uplifting [] best 2230880 combination zp[1]:167 [ ghost3_substep ] +Attempting to uplift remaining variables inzp[1]:173 [ ghost4_substep ] +Uplifting [] best 2230880 combination zp[1]:173 [ ghost4_substep ] +Attempting to uplift remaining variables inzp[1]:302 [ choose_direction::$6 ] +Uplifting [choose_direction] best 2230876 combination reg byte a [ choose_direction::$6 ] +Attempting to uplift remaining variables inzp[1]:303 [ choose_direction::$8 ] +Uplifting [choose_direction] best 2230872 combination reg byte a [ choose_direction::$8 ] +Attempting to uplift remaining variables inzp[1]:304 [ choose_direction::dist_right#0 ] +Uplifting [choose_direction] best 2230866 combination reg byte a [ choose_direction::dist_right#0 ] +Attempting to uplift remaining variables inzp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +Uplifting [choose_direction] best 2230866 combination zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +Attempting to uplift remaining variables inzp[1]:29 [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +Uplifting [choose_direction] best 2230855 combination reg byte x [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +Attempting to uplift remaining variables inzp[1]:33 [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +Uplifting [choose_direction] best 2230853 combination reg byte y [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +Attempting to uplift remaining variables inzp[1]:28 [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +Uplifting [choose_direction] best 2230842 combination reg byte y [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +Attempting to uplift remaining variables inzp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +Uplifting [choose_direction] best 2230842 combination zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] +Attempting to uplift remaining variables inzp[1]:148 [ pacman_direction ] +Uplifting [] best 2230842 combination zp[1]:148 [ pacman_direction ] +Attempting to uplift remaining variables inzp[1]:154 [ ghost1_direction ] +Uplifting [] best 2230842 combination zp[1]:154 [ ghost1_direction ] +Attempting to uplift remaining variables inzp[1]:160 [ ghost2_direction ] +Uplifting [] best 2230842 combination zp[1]:160 [ ghost2_direction ] +Attempting to uplift remaining variables inzp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +Uplifting [choose_direction] best 2230842 combination zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] +Attempting to uplift remaining variables inzp[1]:166 [ ghost3_direction ] +Uplifting [] best 2230842 combination zp[1]:166 [ ghost3_direction ] +Attempting to uplift remaining variables inzp[1]:172 [ ghost4_direction ] +Uplifting [] best 2230842 combination zp[1]:172 [ ghost4_direction ] +Attempting to uplift remaining variables inzp[1]:133 [ top_sprites_mc ] +Uplifting [] best 2230842 combination zp[1]:133 [ top_sprites_mc ] +Attempting to uplift remaining variables inzp[1]:152 [ ghost1_xfine ] +Uplifting [] best 2230842 combination zp[1]:152 [ ghost1_xfine ] +Attempting to uplift remaining variables inzp[1]:153 [ ghost1_yfine ] +Uplifting [] best 2230842 combination zp[1]:153 [ ghost1_yfine ] +Attempting to uplift remaining variables inzp[1]:143 [ phase ] +Uplifting [] best 2230842 combination zp[1]:143 [ phase ] +Attempting to uplift remaining variables inzp[1]:158 [ ghost2_xfine ] +Uplifting [] best 2230842 combination zp[1]:158 [ ghost2_xfine ] +Attempting to uplift remaining variables inzp[1]:159 [ ghost2_yfine ] +Uplifting [] best 2230842 combination zp[1]:159 [ ghost2_yfine ] +Attempting to uplift remaining variables inzp[1]:164 [ ghost3_xfine ] +Uplifting [] best 2230842 combination zp[1]:164 [ ghost3_xfine ] +Attempting to uplift remaining variables inzp[1]:177 [ game_playable ] +Uplifting [] best 2230842 combination zp[1]:177 [ game_playable ] +Attempting to uplift remaining variables inzp[1]:165 [ ghost3_yfine ] +Uplifting [] best 2230842 combination zp[1]:165 [ ghost3_yfine ] +Attempting to uplift remaining variables inzp[1]:170 [ ghost4_xfine ] +Uplifting [] best 2230842 combination zp[1]:170 [ ghost4_xfine ] +Attempting to uplift remaining variables inzp[1]:171 [ ghost4_yfine ] +Uplifting [] best 2230842 combination zp[1]:171 [ ghost4_yfine ] +Attempting to uplift remaining variables inzp[1]:146 [ pacman_xfine ] +Uplifting [] best 2230842 combination zp[1]:146 [ pacman_xfine ] +Attempting to uplift remaining variables inzp[1]:147 [ pacman_yfine ] +Uplifting [] best 2230842 combination zp[1]:147 [ pacman_yfine ] +Attempting to uplift remaining variables inzp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +Uplifting [game_logic] best 2230842 combination zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +Attempting to uplift remaining variables inzp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +Uplifting [choose_direction] best 2230842 combination zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +Attempting to uplift remaining variables inzp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] +Uplifting [game_logic] best 2230842 combination zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] +Attempting to uplift remaining variables inzp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] +Uplifting [game_logic] best 2230842 combination zp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] +Attempting to uplift remaining variables inzp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] +Uplifting [game_logic] best 2230842 combination zp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] +Attempting to uplift remaining variables inzp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +Uplifting [game_logic] best 2230842 combination zp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +Attempting to uplift remaining variables inzp[1]:180 [ game_logic::$2 ] +Uplifting [game_logic] best 2230836 combination reg byte x [ game_logic::$2 ] +Attempting to uplift remaining variables inzp[1]:181 [ game_logic::$3 ] +Uplifting [game_logic] best 2230832 combination reg byte a [ game_logic::$3 ] +Attempting to uplift remaining variables inzp[1]:182 [ game_logic::$14 ] +Uplifting [game_logic] best 2230826 combination reg byte x [ game_logic::$14 ] +Attempting to uplift remaining variables inzp[1]:183 [ game_logic::$15 ] +Uplifting [game_logic] best 2230822 combination reg byte a [ game_logic::$15 ] +Attempting to uplift remaining variables inzp[1]:185 [ game_logic::$17 ] +Uplifting [game_logic] best 2230816 combination reg byte a [ game_logic::$17 ] +Attempting to uplift remaining variables inzp[1]:186 [ game_logic::$18 ] +Uplifting [game_logic] best 2230810 combination reg byte x [ game_logic::$18 ] +Attempting to uplift remaining variables inzp[1]:188 [ game_logic::$20 ] +Uplifting [game_logic] best 2230804 combination reg byte a [ game_logic::$20 ] +Attempting to uplift remaining variables inzp[1]:189 [ game_logic::$21 ] +Uplifting [game_logic] best 2230798 combination reg byte a [ game_logic::$21 ] +Attempting to uplift remaining variables inzp[1]:191 [ game_logic::$25 ] +Uplifting [game_logic] best 2230792 combination reg byte a [ game_logic::$25 ] +Attempting to uplift remaining variables inzp[1]:192 [ game_logic::$26 ] +Uplifting [game_logic] best 2230786 combination reg byte x [ game_logic::$26 ] +Attempting to uplift remaining variables inzp[1]:194 [ game_logic::$28 ] +Uplifting [game_logic] best 2230780 combination reg byte a [ game_logic::$28 ] +Attempting to uplift remaining variables inzp[1]:195 [ game_logic::$29 ] +Uplifting [game_logic] best 2230774 combination reg byte a [ game_logic::$29 ] +Attempting to uplift remaining variables inzp[1]:197 [ game_logic::$31 ] +Uplifting [game_logic] best 2230768 combination reg byte a [ game_logic::$31 ] +Attempting to uplift remaining variables inzp[1]:198 [ game_logic::$32 ] +Uplifting [game_logic] best 2230762 combination reg byte x [ game_logic::$32 ] +Attempting to uplift remaining variables inzp[1]:200 [ game_logic::$34 ] +Uplifting [game_logic] best 2230756 combination reg byte a [ game_logic::$34 ] +Attempting to uplift remaining variables inzp[1]:201 [ game_logic::$35 ] +Uplifting [game_logic] best 2230750 combination reg byte a [ game_logic::$35 ] +Attempting to uplift remaining variables inzp[1]:203 [ game_logic::$37 ] +Uplifting [game_logic] best 2230744 combination reg byte a [ game_logic::$37 ] +Attempting to uplift remaining variables inzp[1]:204 [ game_logic::$38 ] +Uplifting [game_logic] best 2230738 combination reg byte x [ game_logic::$38 ] +Attempting to uplift remaining variables inzp[1]:206 [ game_logic::$40 ] +Uplifting [game_logic] best 2230732 combination reg byte a [ game_logic::$40 ] +Attempting to uplift remaining variables inzp[1]:207 [ game_logic::$41 ] +Uplifting [game_logic] best 2230726 combination reg byte a [ game_logic::$41 ] +Attempting to uplift remaining variables inzp[1]:209 [ game_logic::$43 ] +Uplifting [game_logic] best 2230720 combination reg byte a [ game_logic::$43 ] +Attempting to uplift remaining variables inzp[1]:210 [ game_logic::$44 ] +Uplifting [game_logic] best 2230714 combination reg byte x [ game_logic::$44 ] +Attempting to uplift remaining variables inzp[1]:212 [ game_logic::$46 ] +Uplifting [game_logic] best 2230708 combination reg byte a [ game_logic::$46 ] +Attempting to uplift remaining variables inzp[1]:213 [ game_logic::$47 ] +Uplifting [game_logic] best 2230702 combination reg byte a [ game_logic::$47 ] +Attempting to uplift remaining variables inzp[1]:215 [ game_logic::pacman_ytile#0 ] +Uplifting [game_logic] best 2230696 combination reg byte a [ game_logic::pacman_ytile#0 ] +Attempting to uplift remaining variables inzp[1]:220 [ game_logic::$65 ] +Uplifting [game_logic] best 2230690 combination reg byte a [ game_logic::$65 ] +Attempting to uplift remaining variables inzp[1]:221 [ game_logic::$66 ] +Uplifting [game_logic] best 2230684 combination reg byte a [ game_logic::$66 ] +Attempting to uplift remaining variables inzp[1]:224 [ game_logic::$68 ] +Uplifting [game_logic] best 2230678 combination reg byte a [ game_logic::$68 ] +Attempting to uplift remaining variables inzp[1]:233 [ game_logic::$69 ] +Uplifting [game_logic] best 2230672 combination reg byte a [ game_logic::$69 ] +Attempting to uplift remaining variables inzp[1]:234 [ game_logic::$70 ] +Uplifting [game_logic] best 2230666 combination reg byte a [ game_logic::$70 ] +Attempting to uplift remaining variables inzp[1]:237 [ game_logic::$72 ] +Uplifting [game_logic] best 2230660 combination reg byte a [ game_logic::$72 ] +Attempting to uplift remaining variables inzp[1]:241 [ level_tile_directions::return#3 ] +Uplifting [level_tile_directions] best 2230654 combination reg byte a [ level_tile_directions::return#3 ] +Attempting to uplift remaining variables inzp[1]:242 [ game_logic::open_directions#0 ] +Uplifting [game_logic] best 2230648 combination reg byte a [ game_logic::open_directions#0 ] +Attempting to uplift remaining variables inzp[1]:244 [ choose_direction::return#0 ] +Uplifting [choose_direction] best 2230642 combination reg byte a [ choose_direction::return#0 ] +Attempting to uplift remaining variables inzp[1]:245 [ game_logic::$119 ] +Uplifting [game_logic] best 2230636 combination reg byte a [ game_logic::$119 ] +Attempting to uplift remaining variables inzp[1]:249 [ level_tile_directions::return#10 ] +Uplifting [level_tile_directions] best 2230630 combination reg byte a [ level_tile_directions::return#10 ] +Attempting to uplift remaining variables inzp[1]:250 [ game_logic::open_directions1#0 ] +Uplifting [game_logic] best 2230624 combination reg byte a [ game_logic::open_directions1#0 ] +Attempting to uplift remaining variables inzp[1]:252 [ choose_direction::return#1 ] +Uplifting [choose_direction] best 2230618 combination reg byte a [ choose_direction::return#1 ] +Attempting to uplift remaining variables inzp[1]:253 [ game_logic::$140 ] +Uplifting [game_logic] best 2230612 combination reg byte a [ game_logic::$140 ] +Attempting to uplift remaining variables inzp[1]:257 [ level_tile_directions::return#11 ] +Uplifting [level_tile_directions] best 2230606 combination reg byte a [ level_tile_directions::return#11 ] +Attempting to uplift remaining variables inzp[1]:258 [ game_logic::open_directions2#0 ] +Uplifting [game_logic] best 2230600 combination reg byte a [ game_logic::open_directions2#0 ] +Attempting to uplift remaining variables inzp[1]:260 [ choose_direction::return#2 ] +Uplifting [choose_direction] best 2230594 combination reg byte a [ choose_direction::return#2 ] +Attempting to uplift remaining variables inzp[1]:261 [ game_logic::$161 ] +Uplifting [game_logic] best 2230588 combination reg byte a [ game_logic::$161 ] +Attempting to uplift remaining variables inzp[1]:265 [ level_tile_directions::return#12 ] +Uplifting [level_tile_directions] best 2230582 combination reg byte a [ level_tile_directions::return#12 ] +Attempting to uplift remaining variables inzp[1]:266 [ game_logic::open_directions3#0 ] +Uplifting [game_logic] best 2230576 combination reg byte a [ game_logic::open_directions3#0 ] +Attempting to uplift remaining variables inzp[1]:268 [ choose_direction::return#3 ] +Uplifting [choose_direction] best 2230570 combination reg byte a [ choose_direction::return#3 ] +Attempting to uplift remaining variables inzp[1]:269 [ game_logic::$182 ] +Uplifting [game_logic] best 2230564 combination reg byte a [ game_logic::$182 ] +Attempting to uplift remaining variables inzp[1]:273 [ level_tile_directions::return#13 ] +Uplifting [level_tile_directions] best 2230558 combination reg byte a [ level_tile_directions::return#13 ] +Attempting to uplift remaining variables inzp[1]:275 [ game_logic::$199 ] +Uplifting [game_logic] best 2230552 combination reg byte a [ game_logic::$199 ] +Attempting to uplift remaining variables inzp[1]:276 [ game_logic::$200 ] +Uplifting [game_logic] best 2230546 combination reg byte a [ game_logic::$200 ] +Attempting to uplift remaining variables inzp[1]:278 [ game_logic::$204 ] +Uplifting [game_logic] best 2230542 combination reg byte a [ game_logic::$204 ] +Attempting to uplift remaining variables inzp[1]:299 [ choose_direction::ydiff#0 ] +Uplifting [choose_direction] best 2230542 combination zp[1]:299 [ choose_direction::ydiff#0 ] +Attempting to uplift remaining variables inzp[1]:298 [ choose_direction::xdiff#0 ] +Uplifting [choose_direction] best 2230542 combination zp[1]:298 [ choose_direction::xdiff#0 ] +Attempting to uplift remaining variables inzp[1]:118 [ logic_tile_left_idx ] +Uplifting [] best 2230542 combination zp[1]:118 [ logic_tile_left_idx ] +Attempting to uplift remaining variables inzp[1]:119 [ logic_tile_right_idx ] +Uplifting [] best 2230542 combination zp[1]:119 [ logic_tile_right_idx ] +Attempting to uplift remaining variables inzp[1]:124 [ left_ypos_inc_offset ] +Uplifting [] best 2230542 combination zp[1]:124 [ left_ypos_inc_offset ] +Attempting to uplift remaining variables inzp[1]:129 [ rigt_ypos_inc_offset ] +Uplifting [] best 2230542 combination zp[1]:129 [ rigt_ypos_inc_offset ] +Attempting to uplift remaining variables inzp[1]:4 [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +Uplifting [game_logic] best 2230535 combination reg byte x [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +Attempting to uplift remaining variables inzp[1]:6 [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +Uplifting [game_logic] best 2230528 combination reg byte x [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +Attempting to uplift remaining variables inzp[1]:8 [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +Uplifting [game_logic] best 2230521 combination reg byte x [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +Attempting to uplift remaining variables inzp[1]:10 [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +Uplifting [game_logic] best 2230514 combination reg byte x [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +Attempting to uplift remaining variables inzp[1]:219 [ game_logic::tile_id#0 ] +Uplifting [game_logic] best 2230507 combination reg byte x [ game_logic::tile_id#0 ] +Attempting to uplift remaining variables inzp[1]:277 [ game_logic::joy_directions#0 ] +Uplifting [game_logic] best 2230500 combination reg byte a [ game_logic::joy_directions#0 ] +Attempting to uplift remaining variables inzp[1]:279 [ game_logic::new_direction#0 ] +Uplifting [game_logic] best 2230493 combination reg byte a [ game_logic::new_direction#0 ] +Attempting to uplift remaining variables inzp[1]:3 [ game_logic::do_reverse#4 ] +Uplifting [game_logic] best 2230486 combination reg byte a [ game_logic::do_reverse#4 ] +Attempting to uplift remaining variables inzp[1]:187 [ game_logic::$19 ] +Uplifting [game_logic] best 2230482 combination reg byte x [ game_logic::$19 ] +Attempting to uplift remaining variables inzp[1]:193 [ game_logic::$27 ] +Uplifting [game_logic] best 2230478 combination reg byte x [ game_logic::$27 ] +Attempting to uplift remaining variables inzp[1]:199 [ game_logic::$33 ] +Uplifting [game_logic] best 2230474 combination reg byte x [ game_logic::$33 ] +Attempting to uplift remaining variables inzp[1]:205 [ game_logic::$39 ] +Uplifting [game_logic] best 2230470 combination reg byte x [ game_logic::$39 ] +Attempting to uplift remaining variables inzp[1]:211 [ game_logic::$45 ] +Uplifting [game_logic] best 2230466 combination reg byte x [ game_logic::$45 ] +Attempting to uplift remaining variables inzp[1]:225 [ game_logic::$75 ] +Uplifting [game_logic] best 2230462 combination reg byte x [ game_logic::$75 ] +Attempting to uplift remaining variables inzp[1]:226 [ game_logic::$77 ] +Uplifting [game_logic] best 2230458 combination reg byte y [ game_logic::$77 ] +Attempting to uplift remaining variables inzp[1]:227 [ game_logic::$80 ] +Uplifting [game_logic] best 2230454 combination reg byte x [ game_logic::$80 ] +Attempting to uplift remaining variables inzp[1]:228 [ game_logic::$82 ] +Uplifting [game_logic] best 2230450 combination reg byte y [ game_logic::$82 ] +Attempting to uplift remaining variables inzp[1]:229 [ game_logic::$85 ] +Uplifting [game_logic] best 2230446 combination reg byte x [ game_logic::$85 ] +Attempting to uplift remaining variables inzp[1]:230 [ game_logic::$87 ] +Uplifting [game_logic] best 2230442 combination reg byte y [ game_logic::$87 ] +Attempting to uplift remaining variables inzp[1]:231 [ game_logic::$90 ] +Uplifting [game_logic] best 2230438 combination reg byte x [ game_logic::$90 ] +Attempting to uplift remaining variables inzp[1]:232 [ game_logic::$92 ] +Uplifting [game_logic] best 2230434 combination reg byte y [ game_logic::$92 ] +Attempting to uplift remaining variables inzp[1]:238 [ game_logic::$220 ] +Uplifting [game_logic] best 2230428 combination reg byte x [ game_logic::$220 ] +Attempting to uplift remaining variables inzp[1]:246 [ game_logic::$223 ] +Uplifting [game_logic] best 2230422 combination reg byte x [ game_logic::$223 ] +Attempting to uplift remaining variables inzp[1]:254 [ game_logic::$226 ] +Uplifting [game_logic] best 2230416 combination reg byte x [ game_logic::$226 ] +Attempting to uplift remaining variables inzp[1]:262 [ game_logic::$229 ] +Uplifting [game_logic] best 2230410 combination reg byte x [ game_logic::$229 ] +Attempting to uplift remaining variables inzp[1]:270 [ game_logic::$232 ] +Uplifting [game_logic] best 2230404 combination reg byte x [ game_logic::$232 ] +Attempting to uplift remaining variables inzp[1]:271 [ game_logic::pacman_xtile1#0 ] +Uplifting [game_logic] best 2230400 combination reg byte x [ game_logic::pacman_xtile1#0 ] +Attempting to uplift remaining variables inzp[1]:272 [ game_logic::pacman_ytile1#0 ] +Uplifting [game_logic] best 2230394 combination reg byte a [ game_logic::pacman_ytile1#0 ] +Attempting to uplift remaining variables inzp[1]:214 [ game_logic::pacman_xtile#0 ] +Uplifting [game_logic] best 2230394 combination zp[1]:214 [ game_logic::pacman_xtile#0 ] +Attempting to uplift remaining variables inzp[1]:184 [ game_logic::pacman_bob_xfine#0 ] +Uplifting [game_logic] best 2230391 combination reg byte y [ game_logic::pacman_bob_xfine#0 ] +Attempting to uplift remaining variables inzp[1]:190 [ game_logic::ghost1_bob_xfine#0 ] +Uplifting [game_logic] best 2230388 combination reg byte y [ game_logic::ghost1_bob_xfine#0 ] +Attempting to uplift remaining variables inzp[1]:196 [ game_logic::ghost2_bob_xfine#0 ] +Uplifting [game_logic] best 2230385 combination reg byte y [ game_logic::ghost2_bob_xfine#0 ] +Attempting to uplift remaining variables inzp[1]:202 [ game_logic::ghost3_bob_xfine#0 ] +Uplifting [game_logic] best 2230382 combination reg byte y [ game_logic::ghost3_bob_xfine#0 ] +Attempting to uplift remaining variables inzp[1]:208 [ game_logic::ghost4_bob_xfine#0 ] +Uplifting [game_logic] best 2230379 combination reg byte y [ game_logic::ghost4_bob_xfine#0 ] +Attempting to uplift remaining variables inzp[1]:243 [ game_logic::open_directions#1 ] +Uplifting [game_logic] best 2230372 combination reg byte y [ game_logic::open_directions#1 ] +Attempting to uplift remaining variables inzp[1]:251 [ game_logic::open_directions1#1 ] +Uplifting [game_logic] best 2230365 combination reg byte y [ game_logic::open_directions1#1 ] +Attempting to uplift remaining variables inzp[1]:259 [ game_logic::open_directions2#1 ] +Uplifting [game_logic] best 2230358 combination reg byte y [ game_logic::open_directions2#1 ] +Attempting to uplift remaining variables inzp[1]:267 [ game_logic::open_directions3#1 ] +Uplifting [game_logic] best 2230351 combination reg byte y [ game_logic::open_directions3#1 ] +Attempting to uplift remaining variables inzp[1]:274 [ game_logic::open_directions4#0 ] +Uplifting [game_logic] best 2230350 combination reg byte x [ game_logic::open_directions4#0 ] +Attempting to uplift remaining variables inzp[1]:176 [ game_logic_substep ] +Uplifting [] best 2230350 combination zp[1]:176 [ game_logic_substep ] +Attempting to uplift remaining variables inzp[1]:216 [ game_logic::$210 ] +Uplifting [game_logic] best 2230350 combination zp[1]:216 [ game_logic::$210 ] +Attempting to uplift remaining variables inzp[1]:239 [ game_logic::ghost4_xtile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:239 [ game_logic::ghost4_xtile#0 ] +Attempting to uplift remaining variables inzp[1]:240 [ game_logic::ghost4_ytile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:240 [ game_logic::ghost4_ytile#0 ] +Attempting to uplift remaining variables inzp[1]:247 [ game_logic::ghost3_xtile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:247 [ game_logic::ghost3_xtile#0 ] +Attempting to uplift remaining variables inzp[1]:248 [ game_logic::ghost3_ytile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:248 [ game_logic::ghost3_ytile#0 ] +Attempting to uplift remaining variables inzp[1]:255 [ game_logic::ghost2_xtile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:255 [ game_logic::ghost2_xtile#0 ] +Attempting to uplift remaining variables inzp[1]:256 [ game_logic::ghost2_ytile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:256 [ game_logic::ghost2_ytile#0 ] +Attempting to uplift remaining variables inzp[1]:263 [ game_logic::ghost1_xtile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:263 [ game_logic::ghost1_xtile#0 ] +Attempting to uplift remaining variables inzp[1]:264 [ game_logic::ghost1_ytile#0 ] +Uplifting [game_logic] best 2230350 combination zp[1]:264 [ game_logic::ghost1_ytile#0 ] +Attempting to uplift remaining variables inzp[1]:113 [ pacman_ch1_idx ] +Uplifting [] best 2230350 combination zp[1]:113 [ pacman_ch1_idx ] +Attempting to uplift remaining variables inzp[1]:150 [ ghosts_mode ] +Uplifting [] best 2230350 combination zp[1]:150 [ ghosts_mode ] +Attempting to uplift remaining variables inzp[1]:145 [ anim_frame_idx ] +Uplifting [] best 2230350 combination zp[1]:145 [ anim_frame_idx ] +Attempting to uplift remaining variables inzp[1]:156 [ ghost1_reverse ] +Uplifting [] best 2230350 combination zp[1]:156 [ ghost1_reverse ] +Attempting to uplift remaining variables inzp[1]:162 [ ghost2_reverse ] +Uplifting [] best 2230350 combination zp[1]:162 [ ghost2_reverse ] +Attempting to uplift remaining variables inzp[1]:168 [ ghost3_reverse ] +Uplifting [] best 2230350 combination zp[1]:168 [ ghost3_reverse ] +Attempting to uplift remaining variables inzp[1]:174 [ ghost4_reverse ] +Uplifting [] best 2230350 combination zp[1]:174 [ ghost4_reverse ] +Attempting to uplift remaining variables inzp[1]:144 [ frame ] +Uplifting [] best 2230350 combination zp[1]:144 [ frame ] +Attempting to uplift remaining variables inzp[1]:112 [ pacman_ch1_enabled ] +Uplifting [] best 2230350 combination zp[1]:112 [ pacman_ch1_enabled ] +Coalescing zero page register [ zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 ] ] with [ zp[2]:307 [ merge_code::raster_code#1 ] ] - score: 2 +Coalescing zero page register [ zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 ] ] with [ zp[2]:47 [ merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] ] - score: 2 +Coalescing zero page register [ zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 ] ] with [ zp[2]:52 [ merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] ] - score: 2 +Coalescing zero page register [ zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 ] ] with [ zp[2]:311 [ merge_code::dest_code#2 ] ] - score: 2 +Coalescing zero page register [ zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 ] ] with [ zp[1]:31 [ choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] ] - score: 1 +Coalescing zero page register [ zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 ] ] with [ zp[1]:95 [ render::xcol#2 render::xcol#0 render::xcol#1 ] ] - score: 1 +Coalescing zero page register [ zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 ] ] with [ zp[1]:94 [ render::ypos#2 render::ypos#0 render::ypos#1 ] ] - score: 1 +Coalescing zero page register [ zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 ] ] with [ zp[1]:240 [ game_logic::ghost4_ytile#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 ] ] with [ zp[1]:248 [ game_logic::ghost3_ytile#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 ] ] with [ zp[1]:256 [ game_logic::ghost2_ytile#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 ] ] with [ zp[1]:264 [ game_logic::ghost1_ytile#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:30 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 game_logic::ghost1_ytile#0 ] ] with [ zp[1]:299 [ choose_direction::ydiff#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:37 [ memset::num#5 ] ] with [ zp[2]:305 [ memset::end#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:39 [ memset::str#6 ] ] with [ zp[2]:41 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1 +Coalescing zero page register [ zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 ] ] with [ zp[1]:342 [ render_tiles::ytile#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 ] ] with [ zp[1]:341 [ render_tiles::xcol#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 ] ] with [ zp[2]:288 [ level_show::return#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 ] ] with [ zp[2]:350 [ render::canvas_offset#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 ] ] with [ zp[2]:366 [ render_tiles::canvas_offset#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:217 [ game_logic::ytiles#0 ] ] with [ zp[2]:222 [ game_logic::$67 ] ] - score: 1 +Coalescing zero page register [ zp[2]:217 [ game_logic::ytiles#0 game_logic::$67 ] ] with [ zp[2]:235 [ game_logic::$71 ] ] - score: 1 +Coalescing zero page register [ zp[2]:316 [ init_render_index::$11 ] ] with [ zp[2]:318 [ init_render_index::$10 ] ] - score: 1 +Coalescing zero page register [ zp[2]:320 [ init_render_index::$12 ] ] with [ zp[2]:322 [ init_render_index::canvas#0 ] ] - score: 1 +Coalescing zero page register [ zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 ] ] with [ zp[1]:7 [ game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] ] - score: 1 +Coalescing zero page register [ zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 ] ] with [ zp[1]:9 [ game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] ] - score: 1 +Coalescing zero page register [ zp[1]:5 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 game_logic::target_ytile2#3 game_logic::target_ytile2#2 ] ] with [ zp[1]:11 [ game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] ] - score: 1 +Coalescing zero page register [ zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 ] ] with [ zp[1]:63 [ splash_show::xcol#2 splash_show::xcol#1 ] ] - score: 1 +Coalescing zero page register [ zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 ] ] with [ zp[1]:66 [ splash_show::ypos#2 splash_show::ypos#1 ] ] - score: 1 +Coalescing zero page register [ zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 ] ] with [ zp[2]:290 [ gameplay_run::$4 ] ] - score: 1 +Coalescing zero page register [ zp[2]:316 [ init_render_index::$11 init_render_index::$10 ] ] with [ zp[2]:320 [ init_render_index::$12 init_render_index::canvas#0 ] ] - score: 1 +Coalescing zero page register [ zp[2]:37 [ memset::num#5 memset::end#0 ] ] with [ zp[2]:22 [ done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] ] +Coalescing zero page register [ zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 ] ] with [ zp[2]:39 [ memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] ] +Coalescing zero page register [ zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 ] ] with [ zp[1]:21 [ done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 splash_show::xcol#2 splash_show::xcol#1 ] ] +Coalescing zero page register [ zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 ] ] with [ zp[2]:45 [ merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] ] +Coalescing zero page register [ zp[2]:57 [ init_render_index::render_ypos_table#4 ] ] with [ zp[2]:49 [ merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] ] +Coalescing zero page register [ zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 ] ] with [ zp[1]:24 [ done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 splash_show::ypos#2 splash_show::ypos#1 ] ] +Coalescing zero page register [ zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 ] ] with [ zp[2]:60 [ init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] ] +Coalescing zero page register [ zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 ] ] with [ zp[2]:68 [ init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] ] +Coalescing zero page register [ zp[2]:77 [ memcpy::src#2 memcpy::src#1 ] ] with [ zp[2]:74 [ init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] ] +Coalescing zero page register [ zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 ] ] with [ zp[1]:12 [ splash_run::i#2 splash_run::i#1 ] ] +Coalescing zero page register [ zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 ] ] with [ zp[2]:79 [ memcpy::dst#2 memcpy::dst#1 ] ] +Coalescing zero page register [ zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 render_tiles::ytile#0 ] ] with [ zp[1]:85 [ init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] ] +Coalescing zero page register [ zp[1]:90 [ level_show::xcol#2 level_show::xcol#1 render_tiles::xcol#0 ] ] with [ zp[1]:86 [ init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] ] +Coalescing zero page register [ zp[1]:96 [ render::pixels#4 render::pixels#0 render::pixels#1 ] ] with [ zp[1]:91 [ level_show::xtile#3 level_show::xtile#2 ] ] +Coalescing zero page register [ zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 ] ] with [ zp[2]:88 [ level_show::level#8 level_show::level#1 ] ] +Coalescing zero page register [ zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 ] ] with [ zp[2]:92 [ level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 ] ] +Coalescing zero page register [ zp[1]:214 [ game_logic::pacman_xtile#0 ] ] with [ zp[1]:32 [ choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] ] +Coalescing zero page register [ zp[1]:216 [ game_logic::$210 ] ] with [ zp[1]:35 [ choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] ] +Coalescing zero page register [ zp[1]:239 [ game_logic::ghost4_xtile#0 ] ] with [ zp[1]:36 [ choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] ] +Coalescing zero page register [ zp[2]:285 [ splash_run::xpos#0 ] ] with [ zp[2]:107 [ render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] ] +Coalescing zero page register [ zp[1]:309 [ merge_code::logic_cycles#0 ] ] with [ zp[1]:106 [ render_tiles::y#2 render_tiles::y#1 ] ] +Coalescing zero page register [ zp[2]:314 [ init_render_index::canvas_xcol#0 ] ] with [ zp[2]:109 [ render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 render_tiles::canvas_offset#0 ] ] +Coalescing zero page register [ zp[2]:348 [ render::render_index_xcol#0 ] ] with [ zp[2]:316 [ init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ] ] +Coalescing zero page register [ zp[1]:352 [ render::ypix#0 ] ] with [ zp[1]:340 [ level_show::tile_right#0 ] ] +Coalescing zero page register [ zp[2]:357 [ render_tiles::tile_left_pixels#0 ] ] with [ zp[2]:354 [ level_tile_get::ytiles#0 ] ] +Coalescing zero page register [ zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 ] ] with [ zp[2]:37 [ memset::num#5 memset::end#0 done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] ] +Coalescing zero page register [ zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 ] ] with [ zp[2]:43 [ merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] ] +Coalescing zero page register [ zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 ] ] with [ zp[2]:57 [ init_render_index::render_ypos_table#4 merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] ] +Coalescing zero page register [ zp[1]:82 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 splash_run::i#2 splash_run::i#1 ] ] with [ zp[1]:54 [ init_render_index::x_col#2 init_render_index::x_col#1 done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 splash_show::xcol#2 splash_show::xcol#1 ] ] +Coalescing zero page register [ zp[1]:87 [ level_show::ytile#2 level_show::ytile#1 render_tiles::ytile#0 init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 ] ] with [ zp[1]:59 [ init_render_index::y_pos#2 init_render_index::y_pos#1 done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 splash_show::ypos#2 splash_show::ypos#1 ] ] +Coalescing zero page register [ zp[2]:98 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 level_show::level#8 level_show::level#1 ] ] with [ zp[2]:77 [ memcpy::src#2 memcpy::src#1 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] ] +Coalescing zero page register [ zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 ] ] with [ zp[2]:83 [ init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 memcpy::dst#2 memcpy::dst#1 ] ] +Coalescing zero page register [ zp[1]:352 [ render::ypix#0 level_show::tile_right#0 ] ] with [ zp[1]:309 [ merge_code::logic_cycles#0 render_tiles::y#2 render_tiles::y#1 ] ] +Coalescing zero page register [ zp[2]:357 [ render_tiles::tile_left_pixels#0 level_tile_get::ytiles#0 ] ] with [ zp[2]:348 [ render::render_index_xcol#0 init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ] ] +Coalescing zero page register [ zp[2]:101 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 memcpy::dst#2 memcpy::dst#1 ] ] with [ zp[2]:72 [ init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 init_render_index::render_ypos_table#4 merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] ] +Coalescing zero page register [ zp[2]:285 [ splash_run::xpos#0 render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 ] ] with [ zp[2]:55 [ init_render_index::render_index_xcol#0 init_render_index::render_index#1 merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 memset::num#5 memset::end#0 done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] ] +Coalescing zero page register [ zp[2]:360 [ render_tiles::tile_right_pixels#0 ] ] with [ zp[2]:64 [ splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] ] +Allocated (was zp[1]:5) zp[1]:3 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 game_logic::target_ytile2#3 game_logic::target_ytile2#2 game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +Allocated (was zp[1]:30) zp[1]:4 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 game_logic::ghost1_ytile#0 choose_direction::ydiff#0 ] +Allocated (was zp[1]:82) zp[1]:5 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 splash_run::i#2 splash_run::i#1 init_render_index::x_col#2 init_render_index::x_col#1 done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 splash_show::xcol#2 splash_show::xcol#1 ] +Allocated (was zp[1]:87) zp[1]:6 [ level_show::ytile#2 level_show::ytile#1 render_tiles::ytile#0 init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 init_render_index::y_pos#2 init_render_index::y_pos#1 done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 splash_show::ypos#2 splash_show::ypos#1 ] +Allocated (was zp[1]:90) zp[1]:7 [ level_show::xcol#2 level_show::xcol#1 render_tiles::xcol#0 init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +Allocated (was zp[1]:96) zp[1]:8 [ render::pixels#4 render::pixels#0 render::pixels#1 level_show::xtile#3 level_show::xtile#2 ] +Allocated (was zp[2]:98) zp[2]:9 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 level_show::level#8 level_show::level#1 memcpy::src#2 memcpy::src#1 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +Allocated (was zp[2]:101) zp[2]:11 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 memcpy::dst#2 memcpy::dst#1 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 init_render_index::render_ypos_table#4 merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] +Allocated (was zp[1]:112) zp[1]:13 [ pacman_ch1_enabled ] +Allocated (was zp[1]:113) zp[1]:14 [ pacman_ch1_idx ] +Allocated (was zp[2]:114) zp[2]:15 [ logic_tile_ptr ] +Allocated (was zp[1]:116) zp[1]:17 [ logic_tile_xcol ] +Allocated (was zp[1]:117) zp[1]:18 [ logic_tile_yfine ] +Allocated (was zp[1]:118) zp[1]:19 [ logic_tile_left_idx ] +Allocated (was zp[1]:119) zp[1]:20 [ logic_tile_right_idx ] +Allocated (was zp[2]:120) zp[2]:21 [ left_render_index_xcol ] +Allocated (was zp[2]:122) zp[2]:23 [ left_canvas ] +Allocated (was zp[1]:124) zp[1]:25 [ left_ypos_inc_offset ] +Allocated (was zp[2]:125) zp[2]:26 [ rigt_render_index_xcol ] +Allocated (was zp[2]:127) zp[2]:28 [ rigt_canvas ] +Allocated (was zp[1]:129) zp[1]:30 [ rigt_ypos_inc_offset ] +Allocated (was zp[1]:130) zp[1]:31 [ canvas_base_hi ] +Allocated (was zp[1]:131) zp[1]:32 [ bobs_restore_base ] +Allocated (was zp[1]:132) zp[1]:33 [ top_sprites_color ] +Allocated (was zp[1]:133) zp[1]:34 [ top_sprites_mc ] +Allocated (was zp[1]:134) zp[1]:35 [ side_sprites_color ] +Allocated (was zp[1]:135) zp[1]:36 [ side_sprites_mc ] +Allocated (was zp[1]:136) zp[1]:37 [ bottom_sprites_color ] +Allocated (was zp[1]:137) zp[1]:38 [ bottom_sprites_mc ] +Allocated (was zp[2]:138) zp[2]:39 [ pill_count ] +Allocated (was zp[1]:140) zp[1]:41 [ pacman_wins ] +Allocated (was zp[1]:141) zp[1]:42 [ pacman_lives ] +Allocated (was zp[1]:142) zp[1]:43 [ music_play_next ] +Allocated (was zp[1]:143) zp[1]:44 [ phase ] +Allocated (was zp[1]:144) zp[1]:45 [ frame ] +Allocated (was zp[1]:145) zp[1]:46 [ anim_frame_idx ] +Allocated (was zp[1]:146) zp[1]:47 [ pacman_xfine ] +Allocated (was zp[1]:147) zp[1]:48 [ pacman_yfine ] +Allocated (was zp[1]:148) zp[1]:49 [ pacman_direction ] +Allocated (was zp[1]:149) zp[1]:50 [ pacman_substep ] +Allocated (was zp[1]:150) zp[1]:51 [ ghosts_mode ] +Allocated (was zp[1]:151) zp[1]:52 [ ghosts_mode_count ] +Allocated (was zp[1]:152) zp[1]:53 [ ghost1_xfine ] +Allocated (was zp[1]:153) zp[1]:54 [ ghost1_yfine ] +Allocated (was zp[1]:154) zp[1]:55 [ ghost1_direction ] +Allocated (was zp[1]:155) zp[1]:56 [ ghost1_substep ] +Allocated (was zp[1]:156) zp[1]:57 [ ghost1_reverse ] +Allocated (was zp[1]:157) zp[1]:58 [ ghost1_respawn ] +Allocated (was zp[1]:158) zp[1]:59 [ ghost2_xfine ] +Allocated (was zp[1]:159) zp[1]:60 [ ghost2_yfine ] +Allocated (was zp[1]:160) zp[1]:61 [ ghost2_direction ] +Allocated (was zp[1]:161) zp[1]:62 [ ghost2_substep ] +Allocated (was zp[1]:162) zp[1]:63 [ ghost2_reverse ] +Allocated (was zp[1]:163) zp[1]:64 [ ghost2_respawn ] +Allocated (was zp[1]:164) zp[1]:65 [ ghost3_xfine ] +Allocated (was zp[1]:165) zp[1]:66 [ ghost3_yfine ] +Allocated (was zp[1]:166) zp[1]:67 [ ghost3_direction ] +Allocated (was zp[1]:167) zp[1]:68 [ ghost3_substep ] +Allocated (was zp[1]:168) zp[1]:69 [ ghost3_reverse ] +Allocated (was zp[1]:169) zp[1]:70 [ ghost3_respawn ] +Allocated (was zp[1]:170) zp[1]:71 [ ghost4_xfine ] +Allocated (was zp[1]:171) zp[1]:72 [ ghost4_yfine ] +Allocated (was zp[1]:172) zp[1]:73 [ ghost4_direction ] +Allocated (was zp[1]:173) zp[1]:74 [ ghost4_substep ] +Allocated (was zp[1]:174) zp[1]:75 [ ghost4_reverse ] +Allocated (was zp[1]:175) zp[1]:76 [ ghost4_respawn ] +Allocated (was zp[1]:176) zp[1]:77 [ game_logic_substep ] +Allocated (was zp[1]:177) zp[1]:78 [ game_playable ] +Allocated (was zp[1]:214) zp[1]:79 [ game_logic::pacman_xtile#0 choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +Allocated (was zp[1]:216) zp[1]:80 [ game_logic::$210 choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +Allocated (was zp[2]:217) zp[2]:81 [ game_logic::ytiles#0 game_logic::$67 game_logic::$71 ] +Allocated (was zp[1]:239) zp[1]:83 [ game_logic::ghost4_xtile#0 choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +Allocated (was zp[1]:247) zp[1]:84 [ game_logic::ghost3_xtile#0 ] +Allocated (was zp[1]:255) zp[1]:85 [ game_logic::ghost2_xtile#0 ] +Allocated (was zp[1]:263) zp[1]:86 [ game_logic::ghost1_xtile#0 ] +Allocated (was zp[2]:280) zp[2]:87 [ byteboozer_decrunch::crunched ] +Allocated (was zp[2]:285) zp[2]:89 [ splash_run::xpos#0 render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 init_render_index::render_index_xcol#0 init_render_index::render_index#1 merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 memset::num#5 memset::end#0 done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +Allocated (was zp[2]:296) zp[2]:91 [ level_tile_directions::ytiles#0 ] +Allocated (was zp[1]:298) zp[1]:93 [ choose_direction::xdiff#0 ] +Allocated (was zp[2]:314) zp[2]:94 [ init_render_index::canvas_xcol#0 render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 render_tiles::canvas_offset#0 ] +Allocated (was zp[1]:352) zp[1]:96 [ render::ypix#0 level_show::tile_right#0 merge_code::logic_cycles#0 render_tiles::y#2 render_tiles::y#1 ] +Allocated (was zp[2]:357) zp[2]:97 [ render_tiles::tile_left_pixels#0 level_tile_get::ytiles#0 render::render_index_xcol#0 init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ] +Allocated (was zp[2]:360) zp[2]:99 [ render_tiles::tile_right_pixels#0 splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] +Allocated (was zp[2]:364) zp[2]:101 [ render_tiles::render_index_xcol#0 ] +Interrupt procedure irq_screen_top clobbers AXYZcnzvidePSB + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Camelot Borderline Entry +// Pacman made with 9 sprites in in the borders + // Upstart + // Commodore 64 PRG executable file +.plugin "se.triad.kickass.CruncherPlugins" +.file [name="pacman.prg", type="prg", segments="Program", modify="B2exe", _jmpAdress=__start] +.segmentdef Program [segments="Code, Data, Init"] +.segmentdef Code [start=$810] +.segmentdef Data [startAfter="Code"] +.segmentdef Init [startAfter="Data"] + // Global Constants & labels + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The offset of the sprite pointers from the screen start address + .const OFFSET_SPRITE_PTRS = $3f8 + .const VICII_RST8 = $80 + .const VICII_ECM = $40 + .const VICII_BMM = $20 + .const VICII_DEN = $10 + .const VICII_RSEL = 8 + // Bits for the VICII IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // RAM in all three areas 0xA000, 0xD000, 0xE000 + .const PROCPORT_RAM_ALL = 0 + // RAM in 0xA000, 0xE000 I/O in 0xD000 + .const PROCPORT_RAM_IO = 5 + // The colors of the C64 + .const BLACK = 0 + .const RED = 2 + .const BLUE = 6 + .const YELLOW = 7 + .const EMPTY = 0 + .const PILL = 1 + .const POWERUP = 2 + .const WALL = 4 + // Address of the (decrunched) splash screen + .const BOB_ROW_SIZE = $80 + .const RENDER_OFFSET_CANVAS_LO = 0 + .const RENDER_OFFSET_CANVAS_HI = $50 + .const RENDER_OFFSET_YPOS_INC = $a0 + // The number of bobs rendered + .const NUM_BOBS = 5 + // The size of the BOB restore structure + .const SIZE_BOB_RESTORE = $12 + // Size of the crunched music + .const INTRO_MUSIC_CRUNCHED_SIZE = $600 + // The raster line for irq_screen_top() + .const IRQ_SCREEN_TOP_LINE = 5 + .const STOP = 0 + .const UP = 4 + .const DOWN = 8 + .const LEFT = $10 + .const RIGHT = $20 + .const CHASE = 0 + .const SCATTER = 1 + .const FRIGHTENED = 2 + .const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 + .const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 + .const OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 + .const OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 + .const OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 + .const OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 + .const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 + .const SIZEOF_BYTE = 1 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_COLOR = $d027 + .label RASTER = $d012 + .label BORDER_COLOR = $d020 + .label VICII_CONTROL1 = $d011 + .label VICII_CONTROL2 = $d016 + .label VICII_MEMORY = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // Channel 1 Frequency High byte + .label SID_CH1_FREQ_HI = $d401 + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // The SID MOS 6581/8580 + .label SID = $d400 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // The CIA#1: keyboard matrix, joystick #1/#2 + .label CIA1 = $dc00 + // The CIA#2: Serial bus, RS-232, VIC memory bank + .label CIA2 = $dd00 + // CIA#1 Interrupt for reading in ASM + .label CIA1_INTERRUPT = $dc0d + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // Graphics Bank 1 + // Address of the sprites + .label BANK_1 = $4000 + // Address of the sprites + .label SPRITES_1 = $6000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_1 = $4000 + // Graphics Bank 2 + // Address of the sprites + .label BANK_2 = $c000 + // Address of the sprites + .label SPRITES_2 = $e000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_2 = $c000 + // The location where the logic code will be located before merging + .label LOGIC_CODE_UNMERGED = $e000 + // The location where the screen raster code will be located before merging + .label RASTER_CODE_UNMERGED = $6000 + // The location where the screen raster code will be located when running + .label RASTER_CODE = $8000 + // Address of the (decrunched) splash screen + .label SPLASH = $4000 + // Address for the victory graphics + .label WIN_GFX = $a700 + // Address for the gameover graphics + .label GAMEOVER_GFX = $a700 + // Address used by (decrunched) tiles + .label LEVEL_TILES = $4800 + .label TILES_LEFT = LEVEL_TILES+$a00 + .label TILES_RIGHT = LEVEL_TILES+$a80 + .label TILES_TYPE = LEVEL_TILES+$b00 + // Address used for table containing available directions for all tiles + // TABLE LEVEL_TILES_DIRECTIONS[64*37] + // The level data is organized as 37 rows of 64 bytes. Each row is 50 bytes containing DIRECTION bits plus 14 unused bytes to achieve 64-byte alignment. + .label LEVEL_TILES_DIRECTIONS = $3e00 + .label BOB_MASK_LEFT = $5400 + .label BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 + .label BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c + .label BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 + // Tables pointing to the graphics. + // Each page represents one X column (1 byte wide, 4 MC pixels) + // On each page: + // - 0xNN00-0xNN4A : low-byte of the graphics for (X-column, Y-fine) + // - 0xNN50-0xNN9A : high-byte of the graphics for (X-column, Y-fine) + // - 0xNNA0-0xNNEA : index into RENDER_YPOS_INC for incrementing the y-pos. + .label RENDER_INDEX = $b600 + // Upper memory location used during decrunching + .label INTRO_MUSIC_CRUNCHED_UPPER = $a700 + // Address of the music during run-time + .label INTRO_MUSIC = $3000 + // Pointer to the music init routine + .label musicInit = INTRO_MUSIC + // Pointer to the music play routine + .label musicPlay = INTRO_MUSIC+6 + // Is the pacman eating sound enabled + .label pacman_ch1_enabled = $d + // Index into the eating sound + .label pacman_ch1_idx = $e + // Pointer to the tile to render in the logic code + .label logic_tile_ptr = $f + // The x-column of the tile to render + .label logic_tile_xcol = $11 + // The y-fine of the tile to render + .label logic_tile_yfine = $12 + // The ID*4 of the left tile to render + .label logic_tile_left_idx = $13 + // The ID*4 of the right tile to render + .label logic_tile_right_idx = $14 + // Variables used by the logic-code renderer and restorer + .label left_render_index_xcol = $15 + .label left_canvas = $17 + .label left_ypos_inc_offset = $19 + .label rigt_render_index_xcol = $1a + .label rigt_canvas = $1c + .label rigt_ypos_inc_offset = $1e + // The high-byte of the start-address of the canvas currently being rendered to + .label canvas_base_hi = $1f + // The offset used for bobs_restore - used to achieve double buffering + .label bobs_restore_base = $20 + // Sprite settings used for the top/side/bottom sprites. + // Used for achieving single-color sprites on the splash and multi-color sprites in the game + .label top_sprites_color = $21 + .label top_sprites_mc = $22 + .label side_sprites_color = $23 + .label side_sprites_mc = $24 + .label bottom_sprites_color = $25 + .label bottom_sprites_mc = $26 + // The number of pills left + .label pill_count = $27 + // 1 When pacman wins + .label pacman_wins = $29 + // The number of pacman lives left + .label pacman_lives = $2a + // Signal for playing th next music frame during the intro + .label music_play_next = $2b + // 0: intro, 1: game + .label phase = $2c + // The double buffer frame (0=BANK_1, 1=BANK_2) + .label frame = $2d + // The animation frame IDX (within the current direction) [0-3] + .label anim_frame_idx = $2e + // Pacman x fine position (0-99). + .label pacman_xfine = $2f + // Pacman y fine position (0-70). + .label pacman_yfine = $30 + // The pacman movement current direction + .label pacman_direction = $31 + // Pacman movement substep (0: on tile, 1: between tiles). + .label pacman_substep = $32 + // Mode determining ghost target mode. 0: chase, 1: scatter + .label ghosts_mode = $33 + // Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase ) + .label ghosts_mode_count = $34 + // Ghost 1 x fine position (0-99). + .label ghost1_xfine = $35 + // Ghost 1 y fine position (0-70). + .label ghost1_yfine = $36 + // Ghost 1 movement current direction + .label ghost1_direction = $37 + // Ghost 1 movement substep (0: on tile, 1: between tiles). + .label ghost1_substep = $38 + // Ghost 1 movement should be reversed (0: normal, 1: reverse direction) + .label ghost1_reverse = $39 + // Ghost 1 respawn timer + .label ghost1_respawn = $3a + // Ghost 2 x fine position (0-99). + .label ghost2_xfine = $3b + // Ghost 2 y fine position (0-70). + .label ghost2_yfine = $3c + // Ghost 2 movement current direction + .label ghost2_direction = $3d + // Ghost 2 movement substep (0: on tile, 1: between tiles). + .label ghost2_substep = $3e + // Ghost 2 movement should be reversed (0: normal, 1: reverse direction) + .label ghost2_reverse = $3f + // Ghost 2 respawn timer + .label ghost2_respawn = $40 + // Ghost 3 x fine position (0-99). + .label ghost3_xfine = $41 + // Ghost 3 y fine position (0-70). + .label ghost3_yfine = $42 + // Ghost 3 movement current direction + .label ghost3_direction = $43 + // Ghost 3 movement substep (0: on tile, 1: between tiles). + .label ghost3_substep = $44 + // Ghost 3 movement should be reversed (0: normal, 1: reverse direction) + .label ghost3_reverse = $45 + // Ghost 3 respawn timer + .label ghost3_respawn = $46 + // Ghost 4 x fine position (0-99). + .label ghost4_xfine = $47 + // Ghost 4 y fine position (0-70). + .label ghost4_yfine = $48 + // Ghost 4 movement current direction + .label ghost4_direction = $49 + // Ghost 4 movement substep (0: on tile, 1: between tiles). + .label ghost4_substep = $4a + // Ghost 4 movement should be reversed (0: normal, 1: reverse direction) + .label ghost4_reverse = $4b + // Ghost 4 respawn timer + .label ghost4_respawn = $4c + // Game logic sub-step [0-7]. Each frame a different sub-step is animated + .label game_logic_substep = $4d + // 1 when the game is playable and characters should move around + .label game_playable = $4e +.segment Code + // __start +__start: { + jmp __init1 + // __start::__init1 + __init1: + // [1] pacman_ch1_enabled = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_enabled + // [2] pacman_ch1_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_idx + // [3] logic_tile_ptr = (byte*) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z logic_tile_ptr + lda #>0 + sta.z logic_tile_ptr+1 + // [4] logic_tile_xcol = 0 -- vbuz1=vbuc1 + lda #0 + sta.z logic_tile_xcol + // [5] logic_tile_yfine = 0 -- vbuz1=vbuc1 + lda #0 + sta.z logic_tile_yfine + // [6] logic_tile_left_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z logic_tile_left_idx + // [7] logic_tile_right_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z logic_tile_right_idx + // [8] left_render_index_xcol = (byte*) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z left_render_index_xcol + lda #>0 + sta.z left_render_index_xcol+1 + // [9] left_canvas = (byte*) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z left_canvas + lda #>0 + sta.z left_canvas+1 + // [10] left_ypos_inc_offset = 0 -- vbuz1=vbuc1 + lda #0 + sta.z left_ypos_inc_offset + // [11] rigt_render_index_xcol = (byte*) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z rigt_render_index_xcol + lda #>0 + sta.z rigt_render_index_xcol+1 + // [12] rigt_canvas = (byte*) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z rigt_canvas + lda #>0 + sta.z rigt_canvas+1 + // [13] rigt_ypos_inc_offset = 0 -- vbuz1=vbuc1 + lda #0 + sta.z rigt_ypos_inc_offset + // [14] canvas_base_hi = 0 -- vbuz1=vbuc1 + lda #0 + sta.z canvas_base_hi + // [15] bobs_restore_base = 0 -- vbuz1=vbuc1 + lda #0 + sta.z bobs_restore_base + // [16] top_sprites_color = 0 -- vbuz1=vbuc1 + lda #0 + sta.z top_sprites_color + // [17] top_sprites_mc = 0 -- vbuz1=vbuc1 + lda #0 + sta.z top_sprites_mc + // [18] side_sprites_color = 0 -- vbuz1=vbuc1 + lda #0 + sta.z side_sprites_color + // [19] side_sprites_mc = 0 -- vbuz1=vbuc1 + lda #0 + sta.z side_sprites_mc + // [20] bottom_sprites_color = 0 -- vbuz1=vbuc1 + lda #0 + sta.z bottom_sprites_color + // [21] bottom_sprites_mc = 0 -- vbuz1=vbuc1 + lda #0 + sta.z bottom_sprites_mc + // [22] pill_count = 0 -- vwuz1=vwuc1 + lda #<0 + sta.z pill_count + lda #>0 + sta.z pill_count+1 + // [23] pacman_wins = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_wins + // [24] pacman_lives = 3 -- vbuz1=vbuc1 + lda #3 + sta.z pacman_lives + // [25] music_play_next = 0 -- vbuz1=vbuc1 + lda #0 + sta.z music_play_next + // [26] phase = 0 -- vbuz1=vbuc1 + lda #0 + sta.z phase + // [27] frame = 0 -- vbuz1=vbuc1 + lda #0 + sta.z frame + // [28] anim_frame_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z anim_frame_idx + // [29] pacman_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z pacman_xfine + // [30] pacman_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z pacman_yfine + // [31] pacman_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z pacman_direction + // [32] pacman_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_substep + // [33] ghosts_mode = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghosts_mode + // [34] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // [35] ghost1_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost1_xfine + // [36] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // [37] ghost1_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost1_direction + // [38] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + // [39] ghost1_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_reverse + // [40] ghost1_respawn = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_respawn + // [41] ghost2_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost2_xfine + // [42] ghost2_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost2_yfine + // [43] ghost2_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost2_direction + // [44] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + // [45] ghost2_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_reverse + // [46] ghost2_respawn = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_respawn + // [47] ghost3_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost3_xfine + // [48] ghost3_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost3_yfine + // [49] ghost3_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost3_direction + // [50] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + // [51] ghost3_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_reverse + // [52] ghost3_respawn = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_respawn + // [53] ghost4_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost4_xfine + // [54] ghost4_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost4_yfine + // [55] ghost4_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost4_direction + // [56] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + // [57] ghost4_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_reverse + // [58] ghost4_respawn = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_respawn + // [59] game_logic_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z game_logic_substep + // [60] game_playable = 0 -- vbuz1=vbuc1 + lda #0 + sta.z game_playable + // [61] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1] + __b1_from___init1: + jmp __b1 + // __start::@1 + __b1: + // [62] call main + // [101] phi from __start::@1 to main [phi:__start::@1->main] + main_from___b1: + jsr main + jmp __breturn + // __start::@return + __breturn: + // [63] return + rts +} + // irq_screen_top +// Interrupt Routine at Screen Top +irq_screen_top: { + .const toDd001_return = 0 + .const toDd002_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + // interrupt(isr_hardware_clobber_entry) -- isr_hardware_all_entry + sta rega+1 + stx regx+1 + sty regy+1 + // kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method // Acknowledge the IRQ lda #IRQ_RASTER sta IRQ_STATUS // Set-up IRQ for the next line inc RASTER // Point IRQ to almost stable code lda #stable sta HARDWARE_IRQ+1 tsx // Save stack pointer cli // Reenable interrupts // Wait for new IRQ using NOP's to ensure minimal jitter when it hits .fill 15, NOP .align $20 stable: txs // Restore stack pointer ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) !: dex bne !- nop lda RASTER cmp RASTER bne !+ // And correct the last cycle of potential jitter !: // Raster is now completely stable! (Line 0x007 cycle 7) }} + // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + + // asm { jsrRASTER_CODE } + jsr RASTER_CODE + // [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 -- _deref_pbuc1=vbuc2 + // Move sprites back to the top + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y + // [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y + // [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y + // [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y + // [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y + // [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y + // [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y + // [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 -- _deref_pbuc1=vbuc2 + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y + // [74] phi from irq_screen_top to irq_screen_top::toD0181 [phi:irq_screen_top->irq_screen_top::toD0181] + toD0181_from_irq_screen_top: + jmp toD0181 + // irq_screen_top::toD0181 + toD0181: + jmp __b5 + // irq_screen_top::@5 + __b5: + // [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Select first screen (graphics bank not important since layout in the banks is identical) + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the top sprites color/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color -- _deref_pbuc1=vbuz1 + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR + // [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color -- _deref_pbuc1=vbuz1 + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR + // [79] irq_screen_top::$1 = frame + 1 -- vbuaa=vbuz1_plus_1 + lda.z frame + clc + adc #1 + // [80] irq_screen_top::$2 = irq_screen_top::$1 & 1 -- vbuaa=vbuaa_band_vbuc1 + and #1 + // [81] frame = irq_screen_top::$2 -- vbuz1=vbuaa + // Move to next frame + sta.z frame + // [82] if(0!=frame) goto irq_screen_top::toDd001 -- 0_neq_vbuz1_then_la1 + lda.z frame + bne toDd001_from___b5 + // [83] phi from irq_screen_top::@5 to irq_screen_top::toDd002 [phi:irq_screen_top::@5->irq_screen_top::toDd002] + toDd002_from___b5: + jmp toDd002 + // irq_screen_top::toDd002 + toDd002: + jmp __b7 + // irq_screen_top::@7 + __b7: + // [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 -- _deref_pbuc1=vbuc2 + // Change graphics bank + lda #toDd002_return + sta CIA2 + // [85] canvas_base_hi = >SPRITES_2 -- vbuz1=vbuc1 + // Set the next canvas base address + lda #>SPRITES_2 + sta.z canvas_base_hi + // [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE -- vbuz1=vbuc1 + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + jmp __b1 + // irq_screen_top::@1 + __b1: + // [87] if(phase==0) goto irq_screen_top::@2 -- vbuz1_eq_0_then_la1 + lda.z phase + beq __b2 + // [88] phi from irq_screen_top::@1 to irq_screen_top::@4 [phi:irq_screen_top::@1->irq_screen_top::@4] + __b4_from___b1: + jmp __b4 + // irq_screen_top::@4 + __b4: + // [89] call game_logic + // Game phase + // Perform game logic + jsr game_logic + // [90] phi from irq_screen_top::@4 to irq_screen_top::@8 [phi:irq_screen_top::@4->irq_screen_top::@8] + __b8_from___b4: + jmp __b8 + // irq_screen_top::@8 + __b8: + // [91] call pacman_sound_play + // Play sounds + jsr pacman_sound_play + jmp __b3 + // irq_screen_top::@3 + __b3: + // [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS + // [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + // Trigger IRQ at screen top again + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // [94] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + jmp __breturn + // irq_screen_top::@return + __breturn: + // [95] return + // interrupt(isr_hardware_clobber_exit) -- isr_hardware_all_exit + rega: + lda #0 + regx: + ldx #0 + regy: + ldy #0 + rti + // irq_screen_top::@2 + __b2: + // [96] music_play_next = 1 -- vbuz1=vbuc1 + // intro phase + // Play intro music + lda #1 + sta.z music_play_next + jmp __b3 + // [97] phi from irq_screen_top::@5 to irq_screen_top::toDd001 [phi:irq_screen_top::@5->irq_screen_top::toDd001] + toDd001_from___b5: + jmp toDd001 + // irq_screen_top::toDd001 + toDd001: + jmp __b6 + // irq_screen_top::@6 + __b6: + // [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 -- _deref_pbuc1=vbuc2 + // Change graphics bank + lda #toDd001_return + sta CIA2 + // [99] canvas_base_hi = >SPRITES_1 -- vbuz1=vbuc1 + // Set the next canvas base address + lda #>SPRITES_1 + sta.z canvas_base_hi + // [100] bobs_restore_base = 0 -- vbuz1=vbuc1 + lda #0 + sta.z bobs_restore_base + jmp __b1 +} + // main +main: { + // [102] call splash_run + // Show the splash screen + // [509] phi from main to splash_run [phi:main->splash_run] + splash_run_from_main: + jsr splash_run + // [103] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1] + __b1_from_main: + __b1_from___b2: + jmp __b1 + // main::@1 + __b1: + // [104] call gameplay_run + // Run the gameplay + // [615] phi from main::@1 to gameplay_run [phi:main::@1->gameplay_run] + gameplay_run_from___b1: + jsr gameplay_run + // [105] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + __b2_from___b1: + jmp __b2 + // main::@2 + __b2: + // [106] call done_run + // Show victory or game over image + jsr done_run + jmp __b1_from___b2 +} + // game_logic +// Perform game logic such as moving pacman and ghosts +game_logic: { + .label __67 = $51 + .label __71 = $51 + .label __210 = $50 + .label ghost_frame_idx = 2 + .label pacman_xtile = $4f + .label ytiles = $51 + .label ghost4_xtile = $53 + .label ghost4_ytile = 4 + .label target_ytile = 3 + .label ghost3_xtile = $54 + .label ghost3_ytile = 4 + .label target_ytile1 = 3 + .label ghost2_xtile = $55 + .label ghost2_ytile = 4 + .label target_ytile2 = 3 + .label ghost1_xtile = $56 + .label ghost1_ytile = 4 + .label target_ytile3 = 3 + // [107] if(game_playable!=0) goto game_logic::@1 -- vbuz1_neq_0_then_la1 + lda.z game_playable + bne __b1 + jmp __breturn + // game_logic::@return + __breturn: + // [108] return + rts + // game_logic::@1 + __b1: + // [109] game_logic::$2 = game_logic_substep + 1 -- vbuxx=vbuz1_plus_1 + ldx.z game_logic_substep + inx + // [110] game_logic::$3 = game_logic::$2 & 7 -- vbuaa=vbuxx_band_vbuc1 + txa + and #7 + // [111] game_logic_substep = game_logic::$3 -- vbuz1=vbuaa + // Move to next sub-step + sta.z game_logic_substep + // [112] if(game_logic_substep==0) goto game_logic::@2 -- vbuz1_eq_0_then_la1 + lda.z game_logic_substep + beq __b2 + jmp __b8 + // game_logic::@8 + __b8: + // [113] if(game_logic_substep==1) goto game_logic::@3 -- vbuz1_eq_vbuc1_then_la1 + lda #1 + cmp.z game_logic_substep + beq __b3 + jmp __b9 + // game_logic::@9 + __b9: + // [114] if(game_logic_substep==2) goto game_logic::@4 -- vbuz1_eq_vbuc1_then_la1 + lda #2 + cmp.z game_logic_substep + beq __b4 + jmp __b10 + // game_logic::@10 + __b10: + // [115] if(game_logic_substep==4) goto game_logic::@5 -- vbuz1_eq_vbuc1_then_la1 + lda #4 + cmp.z game_logic_substep + beq __b5 + jmp __b11 + // game_logic::@11 + __b11: + // [116] if(game_logic_substep==5) goto game_logic::@6 -- vbuz1_eq_vbuc1_then_la1 + lda #5 + cmp.z game_logic_substep + beq __b6 + jmp __b12 + // game_logic::@12 + __b12: + // [117] if(game_logic_substep==6) goto game_logic::@7 -- vbuz1_eq_vbuc1_then_la1 + lda #6 + cmp.z game_logic_substep + beq __b7 + jmp __b13 + // game_logic::@13 + __b13: + // [118] if(game_logic_substep==3) goto game_logic::@14 -- vbuz1_eq_vbuc1_then_la1 + lda #3 + cmp.z game_logic_substep + beq __b14 + jmp __b161 + // game_logic::@161 + __b161: + // [119] if(game_logic_substep==7) goto game_logic::@14 -- vbuz1_eq_vbuc1_then_la1 + lda #7 + cmp.z game_logic_substep + beq __b14 + jmp __breturn + // game_logic::@14 + __b14: + // [120] game_logic::$14 = anim_frame_idx + 1 -- vbuxx=vbuz1_plus_1 + ldx.z anim_frame_idx + inx + // [121] game_logic::$15 = game_logic::$14 & 3 -- vbuaa=vbuxx_band_vbuc1 + txa + and #3 + // [122] anim_frame_idx = game_logic::$15 -- vbuz1=vbuaa + // Update animation and bobs + sta.z anim_frame_idx + // [123] game_logic::pacman_bob_xfine#0 = pacman_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z pacman_xfine + tay + dey + // [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // [125] *bobs_xcol = game_logic::$17 -- _deref_pbuc1=vbuaa + sta bobs_xcol + // [126] game_logic::$18 = pacman_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z pacman_yfine + dex + // [127] *bobs_yfine = game_logic::$18 -- _deref_pbuc1=vbuxx + stx bobs_yfine + // [128] game_logic::$19 = pacman_direction | anim_frame_idx -- vbuxx=vbuz1_bor_vbuz2 + lda.z pacman_direction + ora.z anim_frame_idx + tax + // [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc pacman_frames,x + // [131] *bobs_bob_id = game_logic::$21 -- _deref_pbuc1=vbuaa + sta bobs_bob_id + // [132] game_logic::ghost_frame_idx#0 = anim_frame_idx -- vbuz1=vbuz2 + lda.z anim_frame_idx + sta.z ghost_frame_idx + // [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 -- vbuz1_neq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b44_from___b14 + jmp __b15 + // game_logic::@15 + __b15: + // [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 -- vbuz1=vbuz1_bor_vbuc1 + lda #$40 + ora.z ghost_frame_idx + sta.z ghost_frame_idx + // [135] phi from game_logic::@14 game_logic::@15 to game_logic::@44 [phi:game_logic::@14/game_logic::@15->game_logic::@44] + __b44_from___b14: + __b44_from___b15: + // [135] phi game_logic::ghost_frame_idx#2 = game_logic::ghost_frame_idx#0 [phi:game_logic::@14/game_logic::@15->game_logic::@44#0] -- register_copy + jmp __b44 + // game_logic::@44 + __b44: + // [136] game_logic::ghost1_bob_xfine#0 = ghost1_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost1_xfine + tay + dey + // [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // [138] *(bobs_xcol+1) = game_logic::$25 -- _deref_pbuc1=vbuaa + sta bobs_xcol+1 + // [139] game_logic::$26 = ghost1_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost1_yfine + dex + // [140] *(bobs_yfine+1) = game_logic::$26 -- _deref_pbuc1=vbuxx + stx bobs_yfine+1 + // [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost1_direction + ora.z ghost_frame_idx + tax + // [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // [144] *(bobs_bob_id+1) = game_logic::$29 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+1 + // [145] game_logic::ghost2_bob_xfine#0 = ghost2_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost2_xfine + tay + dey + // [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // [147] *(bobs_xcol+2) = game_logic::$31 -- _deref_pbuc1=vbuaa + sta bobs_xcol+2 + // [148] game_logic::$32 = ghost2_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost2_yfine + dex + // [149] *(bobs_yfine+2) = game_logic::$32 -- _deref_pbuc1=vbuxx + stx bobs_yfine+2 + // [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost2_direction + ora.z ghost_frame_idx + tax + // [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // [153] *(bobs_bob_id+2) = game_logic::$35 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+2 + // [154] game_logic::ghost3_bob_xfine#0 = ghost3_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost3_xfine + tay + dey + // [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // [156] *(bobs_xcol+3) = game_logic::$37 -- _deref_pbuc1=vbuaa + sta bobs_xcol+3 + // [157] game_logic::$38 = ghost3_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost3_yfine + dex + // [158] *(bobs_yfine+3) = game_logic::$38 -- _deref_pbuc1=vbuxx + stx bobs_yfine+3 + // [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost3_direction + ora.z ghost_frame_idx + tax + // [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // [162] *(bobs_bob_id+3) = game_logic::$41 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+3 + // [163] game_logic::ghost4_bob_xfine#0 = ghost4_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost4_xfine + tay + dey + // [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // [165] *(bobs_xcol+4) = game_logic::$43 -- _deref_pbuc1=vbuaa + sta bobs_xcol+4 + // [166] game_logic::$44 = ghost4_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost4_yfine + dex + // [167] *(bobs_yfine+4) = game_logic::$44 -- _deref_pbuc1=vbuxx + stx bobs_yfine+4 + // [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost4_direction + ora.z ghost_frame_idx + tax + // [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // [171] *(bobs_bob_id+4) = game_logic::$47 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+4 + jmp __breturn + // game_logic::@7 + __b7: + // [172] ghosts_mode_count = ++ ghosts_mode_count -- vbuz1=_inc_vbuz1 + inc.z ghosts_mode_count + // [173] if(ghosts_mode==SCATTER) goto game_logic::@45 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b45 + jmp __b16 + // game_logic::@16 + __b16: + // [174] if(ghosts_mode==CHASE) goto game_logic::@46 -- vbuz1_eq_vbuc1_then_la1 + lda #CHASE + cmp.z ghosts_mode + beq __b46 + jmp __b17 + // game_logic::@17 + __b17: + // [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 -- vbuz1_neq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b47_from___b17 + jmp __b18 + // game_logic::@18 + __b18: + // [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$32+1 + bcc __b47_from___b18 + jmp __b19 + // game_logic::@19 + __b19: + // [177] ghosts_mode = CHASE -- vbuz1=vbuc1 + lda #CHASE + sta.z ghosts_mode + // [178] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // [179] phi from game_logic::@19 game_logic::@58 game_logic::@59 to game_logic::@47 [phi:game_logic::@19/game_logic::@58/game_logic::@59->game_logic::@47] + __b47_from___b19: + __b47_from___b58: + __b47_from___b59: + // [179] phi game_logic::do_reverse#4 = 1 [phi:game_logic::@19/game_logic::@58/game_logic::@59->game_logic::@47#0] -- vbuaa=vbuc1 + lda #1 + jmp __b47 + // [179] phi from game_logic::@17 game_logic::@18 game_logic::@45 game_logic::@46 to game_logic::@47 [phi:game_logic::@17/game_logic::@18/game_logic::@45/game_logic::@46->game_logic::@47] + __b47_from___b17: + __b47_from___b18: + __b47_from___b45: + __b47_from___b46: + // [179] phi game_logic::do_reverse#4 = 0 [phi:game_logic::@17/game_logic::@18/game_logic::@45/game_logic::@46->game_logic::@47#0] -- vbuaa=vbuc1 + lda #0 + jmp __b47 + // game_logic::@47 + __b47: + // [180] if(0==game_logic::do_reverse#4) goto game_logic::@48 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b48 + jmp __b60 + // game_logic::@60 + __b60: + // [181] ghost1_reverse = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost1_reverse + // [182] ghost2_reverse = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost2_reverse + // [183] ghost3_reverse = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost3_reverse + // [184] ghost4_reverse = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost4_reverse + jmp __b48 + // game_logic::@48 + __b48: + // [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_xfine + lsr + sta.z pacman_xtile + // [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_yfine + lsr + // [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 -- vbuz1=vbuaa_rol_1 + asl + sta.z __210 + // [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuz2 + ldy.z __210 + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] -- vbuxx=pbuz1_derefidx_vbuz2 + ldy.z pacman_xtile + lda (ytiles),y + tax + // [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #PILL + beq __b49 + jmp __b61 + // game_logic::@61 + __b61: + // [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 -- pbuc1_derefidx_vbuxx_neq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #POWERUP + bne __b50 + jmp __b62 + // game_logic::@62 + __b62: + // [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY -- pbuz1_derefidx_vbuz2=vbuc1 + // Empty the tile + lda #EMPTY + ldy.z pacman_xtile + sta (ytiles),y + // [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_xtile + lsr + // [194] logic_tile_xcol = game_logic::$65 -- vbuz1=vbuaa + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe -- vbuaa=vbuz1_band_vbuc1 + lda #$fe + and.z pacman_xtile + // [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 -- pbuz1=pbuz1_plus_vbuaa + clc + adc.z __67 + sta.z __67 + bcc !+ + inc.z __67+1 + !: + // [197] logic_tile_ptr = game_logic::$67 -- pbuz1=pbuz2 + lda.z __67 + sta.z logic_tile_ptr + lda.z __67+1 + sta.z logic_tile_ptr+1 + // [198] game_logic::$68 = game_logic::$210 -- vbuaa=vbuz1 + lda.z __210 + // [199] logic_tile_yfine = game_logic::$68 -- vbuz1=vbuaa + sta.z logic_tile_yfine + // [200] ghosts_mode = FRIGHTENED -- vbuz1=vbuc1 + // Start power-up mode + lda #FRIGHTENED + sta.z ghosts_mode + // [201] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + jmp __b50 + // game_logic::@50 + __b50: + // [202] game_logic::$75 = pacman_xfine - ghost1_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost1_xfine + tax + // [203] game_logic::$77 = pacman_yfine - ghost1_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost1_yfine + tay + // [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + // Check if anyone dies + lda ABS,x + cmp #2 + bcs __b64 + jmp __b162 + // game_logic::@162 + __b162: + // [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b51 + jmp __b64 + // game_logic::@64 + __b64: + // [206] game_logic::$80 = pacman_xfine - ghost2_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost2_xfine + tax + // [207] game_logic::$82 = pacman_yfine - ghost2_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost2_yfine + tay + // [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcs __b65 + jmp __b163 + // game_logic::@163 + __b163: + // [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b52 + jmp __b65 + // game_logic::@65 + __b65: + // [210] game_logic::$85 = pacman_xfine - ghost3_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost3_xfine + tax + // [211] game_logic::$87 = pacman_yfine - ghost3_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost3_yfine + tay + // [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcs __b66 + jmp __b164 + // game_logic::@164 + __b164: + // [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b53 + jmp __b66 + // game_logic::@66 + __b66: + // [214] game_logic::$90 = pacman_xfine - ghost4_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost4_xfine + tax + // [215] game_logic::$92 = pacman_yfine - ghost4_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost4_yfine + tay + // [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcs __breturn + jmp __b165 + // game_logic::@165 + __b165: + // [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b67 + jmp __breturn + // game_logic::@67 + __b67: + // [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b54 + jmp __b68 + // game_logic::@68 + __b68: + // [219] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // [220] call spawn_all + jsr spawn_all + jmp __breturn + // game_logic::@54 + __b54: + // [221] ghost4_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost4_direction + // [222] ghost4_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost4_xfine + // [223] ghost4_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost4_yfine + // [224] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + // [225] ghost4_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost4_respawn + jmp __breturn + // game_logic::@53 + __b53: + // [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b55 + jmp __b69 + // game_logic::@69 + __b69: + // [227] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // [228] call spawn_all + jsr spawn_all + jmp __breturn + // game_logic::@55 + __b55: + // [229] ghost3_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost3_direction + // [230] ghost3_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost3_xfine + // [231] ghost3_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost3_yfine + // [232] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + // [233] ghost3_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost3_respawn + jmp __breturn + // game_logic::@52 + __b52: + // [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b56 + jmp __b70 + // game_logic::@70 + __b70: + // [235] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // [236] call spawn_all + jsr spawn_all + jmp __breturn + // game_logic::@56 + __b56: + // [237] ghost2_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost2_direction + // [238] ghost2_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost2_xfine + // [239] ghost2_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost2_yfine + // [240] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + // [241] ghost2_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost2_respawn + jmp __breturn + // game_logic::@51 + __b51: + // [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b57 + jmp __b71 + // game_logic::@71 + __b71: + // [243] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // [244] call spawn_all + jsr spawn_all + jmp __breturn + // game_logic::@57 + __b57: + // [245] ghost1_direction = STOP -- vbuz1=vbuc1 + // ghost dies + lda #STOP + sta.z ghost1_direction + // [246] ghost1_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost1_xfine + // [247] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // [248] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + // [249] ghost1_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost1_respawn + jmp __breturn + // game_logic::@49 + __b49: + // [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY -- pbuz1_derefidx_vbuz2=vbuc1 + // Empty the tile + lda #EMPTY + ldy.z pacman_xtile + sta (ytiles),y + // [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_xtile + lsr + // [252] logic_tile_xcol = game_logic::$69 -- vbuz1=vbuaa + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe -- vbuaa=vbuz1_band_vbuc1 + lda #$fe + and.z pacman_xtile + // [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 -- pbuz1=pbuz1_plus_vbuaa + clc + adc.z __71 + sta.z __71 + bcc !+ + inc.z __71+1 + !: + // [255] logic_tile_ptr = game_logic::$71 -- pbuz1=pbuz2 + lda.z __71 + sta.z logic_tile_ptr + lda.z __71+1 + sta.z logic_tile_ptr+1 + // [256] game_logic::$72 = game_logic::$210 -- vbuaa=vbuz1 + lda.z __210 + // [257] logic_tile_yfine = game_logic::$72 -- vbuz1=vbuaa + sta.z logic_tile_yfine + // [258] pill_count = -- pill_count -- vwuz1=_dec_vwuz1 + lda.z pill_count + bne !+ + dec.z pill_count+1 + !: + dec.z pill_count + // [259] if(pill_count!=0) goto game_logic::@50 -- vwuz1_neq_0_then_la1 + lda.z pill_count + ora.z pill_count+1 + bne __b50 + jmp __b63 + // game_logic::@63 + __b63: + // [260] pacman_wins = 1 -- vbuz1=vbuc1 + lda #1 + sta.z pacman_wins + jmp __b50 + // game_logic::@46 + __b46: + // [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$96+1 + bcc __b47_from___b46 + jmp __b58 + // game_logic::@58 + __b58: + // [262] ghosts_mode = SCATTER -- vbuz1=vbuc1 + lda #SCATTER + sta.z ghosts_mode + // [263] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + jmp __b47_from___b58 + // game_logic::@45 + __b45: + // [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$32+1 + bcc __b47_from___b45 + jmp __b59 + // game_logic::@59 + __b59: + // [265] ghosts_mode = CHASE -- vbuz1=vbuc1 + lda #CHASE + sta.z ghosts_mode + // [266] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + jmp __b47_from___b59 + // game_logic::@6 + __b6: + // [267] if(0!=ghost4_respawn) goto game_logic::@72 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost4_respawn + bne __b72 + jmp __b20 + // game_logic::@20 + __b20: + // [268] if(ghost4_direction==RIGHT) goto game_logic::@73 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost4_direction + beq __b73 + jmp __b21 + // game_logic::@21 + __b21: + // [269] if(ghost4_direction==DOWN) goto game_logic::@74 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost4_direction + beq __b74 + jmp __b22 + // game_logic::@22 + __b22: + // [270] if(ghost4_direction==LEFT) goto game_logic::@75 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost4_direction + beq __b75 + jmp __b23 + // game_logic::@23 + __b23: + // [271] if(ghost4_direction!=UP) goto game_logic::@76 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost4_direction + bne __b76 + jmp __b24 + // game_logic::@24 + __b24: + // [272] ghost4_yfine = -- ghost4_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost4_yfine + jmp __b76 + // game_logic::@76 + __b76: + // [273] game_logic::$220 = ghost4_direction -- vbuxx=vbuz1 + ldx.z ghost4_direction + // [274] if(ghost4_substep!=0) goto game_logic::@82 -- vbuz1_neq_0_then_la1 + lda.z ghost4_substep + bne __b82 + jmp __b166 + // game_logic::@166 + __b166: + // [275] if(game_logic::$220!=STOP) goto game_logic::@77 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b77 + jmp __b82 + // game_logic::@82 + __b82: + // [276] ghost4_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost4_substep + // [277] if(0!=ghost4_reverse) goto game_logic::@78 -- 0_neq_vbuz1_then_la1 + lda.z ghost4_reverse + bne __b78 + jmp __b83 + // game_logic::@83 + __b83: + // [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost4_xfine + lsr + sta.z ghost4_xtile + // [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost4_yfine + lsr + sta.z ghost4_ytile + // [280] level_tile_directions::xtile#0 = game_logic::ghost4_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost4_xtile + // [281] level_tile_directions::ytile#0 = game_logic::ghost4_ytile#0 -- vbuaa=vbuz1 + lda.z ghost4_ytile + // [282] call level_tile_directions + // [738] phi from game_logic::@83 to level_tile_directions [phi:game_logic::@83->level_tile_directions] + level_tile_directions_from___b83: + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#0 [phi:game_logic::@83->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#0 [phi:game_logic::@83->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // [283] level_tile_directions::return#3 = level_tile_directions::return#2 + jmp __b152 + // game_logic::@152 + __b152: + // [284] game_logic::open_directions#0 = level_tile_directions::return#3 + // [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost4_direction + and DIRECTION_ELIMINATE,y + tay + // [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b79 + jmp __b84 + // game_logic::@84 + __b84: + // [287] if(ghosts_mode==SCATTER) goto game_logic::@80 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b80_from___b84 + jmp __b85 + // game_logic::@85 + __b85: + // [288] game_logic::target_xtile#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // [289] game_logic::target_ytile#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile + // [290] phi from game_logic::@85 to game_logic::@80 [phi:game_logic::@85->game_logic::@80] + __b80_from___b85: + // [290] phi game_logic::target_ytile#3 = game_logic::target_ytile#2 [phi:game_logic::@85->game_logic::@80#0] -- register_copy + // [290] phi game_logic::target_xtile#3 = game_logic::target_xtile#2 [phi:game_logic::@85->game_logic::@80#1] -- register_copy + jmp __b80 + // [290] phi from game_logic::@84 to game_logic::@80 [phi:game_logic::@84->game_logic::@80] + __b80_from___b84: + // [290] phi game_logic::target_ytile#3 = 2 [phi:game_logic::@84->game_logic::@80#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile + // [290] phi game_logic::target_xtile#3 = 2 [phi:game_logic::@84->game_logic::@80#1] -- vbuxx=vbuc1 + ldx #2 + jmp __b80 + // game_logic::@80 + __b80: + // [291] choose_direction::open_directions#0 = game_logic::open_directions#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [292] choose_direction::ghost_xtile#0 = game_logic::ghost4_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost4_xtile + // [293] choose_direction::ghost_ytile#0 = game_logic::ghost4_ytile#0 + // [294] choose_direction::target_xtile#0 = game_logic::target_xtile#3 + // [295] choose_direction::target_ytile#0 = game_logic::target_ytile#3 + // [296] call choose_direction + // [746] phi from game_logic::@80 to choose_direction [phi:game_logic::@80->choose_direction] + choose_direction_from___b80: + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#0 [phi:game_logic::@80->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#0 [phi:game_logic::@80->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#0 [phi:game_logic::@80->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#0 [phi:game_logic::@80->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#0 [phi:game_logic::@80->choose_direction#4] -- register_copy + jsr choose_direction + // [297] choose_direction::return#0 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + jmp __b153 + // game_logic::@153 + __b153: + // [298] game_logic::$119 = choose_direction::return#0 + // [299] ghost4_direction = game_logic::$119 -- vbuz1=vbuaa + sta.z ghost4_direction + jmp __breturn + // game_logic::@79 + __b79: + // [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost4_direction + jmp __breturn + // game_logic::@78 + __b78: + // [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost4_direction + lda DIRECTION_REVERSE,y + sta.z ghost4_direction + // [302] ghost4_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_reverse + jmp __breturn + // game_logic::@77 + __b77: + // [303] ghost4_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost4_substep + // [304] if(ghost4_xfine==1) goto game_logic::@81 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + lda #1 + cmp.z ghost4_xfine + beq __b81 + jmp __b86 + // game_logic::@86 + __b86: + // [305] if(ghost4_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost4_xfine + bne __breturn + jmp __b87 + // game_logic::@87 + __b87: + // [306] ghost4_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost4_xfine + jmp __breturn + // game_logic::@81 + __b81: + // [307] ghost4_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost4_xfine + jmp __breturn + // game_logic::@75 + __b75: + // [308] ghost4_xfine = -- ghost4_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost4_xfine + jmp __b76 + // game_logic::@74 + __b74: + // [309] ghost4_yfine = ++ ghost4_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost4_yfine + jmp __b76 + // game_logic::@73 + __b73: + // [310] ghost4_xfine = ++ ghost4_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost4_xfine + jmp __b76 + // game_logic::@72 + __b72: + // [311] ghost4_respawn = -- ghost4_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost4_respawn + // [312] if(ghost4_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost4_respawn + bne __breturn + jmp __b88 + // game_logic::@88 + __b88: + // [313] ghost4_direction = RIGHT -- vbuz1=vbuc1 + // Spawn ghost + lda #RIGHT + sta.z ghost4_direction + // [314] ghost4_xfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost4_xfine + // [315] ghost4_yfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost4_yfine + // [316] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + jmp __breturn + // game_logic::@5 + __b5: + // [317] if(0!=ghost3_respawn) goto game_logic::@89 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost3_respawn + bne __b89 + jmp __b25 + // game_logic::@25 + __b25: + // [318] if(ghost3_direction==RIGHT) goto game_logic::@90 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost3_direction + beq __b90 + jmp __b26 + // game_logic::@26 + __b26: + // [319] if(ghost3_direction==DOWN) goto game_logic::@91 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost3_direction + beq __b91 + jmp __b27 + // game_logic::@27 + __b27: + // [320] if(ghost3_direction==LEFT) goto game_logic::@92 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost3_direction + beq __b92 + jmp __b28 + // game_logic::@28 + __b28: + // [321] if(ghost3_direction!=UP) goto game_logic::@93 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost3_direction + bne __b93 + jmp __b29 + // game_logic::@29 + __b29: + // [322] ghost3_yfine = -- ghost3_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost3_yfine + jmp __b93 + // game_logic::@93 + __b93: + // [323] game_logic::$223 = ghost3_direction -- vbuxx=vbuz1 + ldx.z ghost3_direction + // [324] if(ghost3_substep!=0) goto game_logic::@99 -- vbuz1_neq_0_then_la1 + lda.z ghost3_substep + bne __b99 + jmp __b167 + // game_logic::@167 + __b167: + // [325] if(game_logic::$223!=STOP) goto game_logic::@94 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b94 + jmp __b99 + // game_logic::@99 + __b99: + // [326] ghost3_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost3_substep + // [327] if(0!=ghost3_reverse) goto game_logic::@95 -- 0_neq_vbuz1_then_la1 + lda.z ghost3_reverse + bne __b95 + jmp __b100 + // game_logic::@100 + __b100: + // [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost3_xfine + lsr + sta.z ghost3_xtile + // [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost3_yfine + lsr + sta.z ghost3_ytile + // [330] level_tile_directions::xtile#1 = game_logic::ghost3_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost3_xtile + // [331] level_tile_directions::ytile#1 = game_logic::ghost3_ytile#0 -- vbuaa=vbuz1 + lda.z ghost3_ytile + // [332] call level_tile_directions + // [738] phi from game_logic::@100 to level_tile_directions [phi:game_logic::@100->level_tile_directions] + level_tile_directions_from___b100: + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#1 [phi:game_logic::@100->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#1 [phi:game_logic::@100->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // [333] level_tile_directions::return#10 = level_tile_directions::return#2 + jmp __b154 + // game_logic::@154 + __b154: + // [334] game_logic::open_directions1#0 = level_tile_directions::return#10 + // [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost3_direction + and DIRECTION_ELIMINATE,y + tay + // [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b96 + jmp __b101 + // game_logic::@101 + __b101: + // [337] if(ghosts_mode==SCATTER) goto game_logic::@97 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b97_from___b101 + jmp __b102 + // game_logic::@102 + __b102: + // [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile1 + // [340] phi from game_logic::@102 to game_logic::@97 [phi:game_logic::@102->game_logic::@97] + __b97_from___b102: + // [340] phi game_logic::target_ytile1#3 = game_logic::target_ytile1#2 [phi:game_logic::@102->game_logic::@97#0] -- register_copy + // [340] phi game_logic::target_xtile1#3 = game_logic::target_xtile1#2 [phi:game_logic::@102->game_logic::@97#1] -- register_copy + jmp __b97 + // [340] phi from game_logic::@101 to game_logic::@97 [phi:game_logic::@101->game_logic::@97] + __b97_from___b101: + // [340] phi game_logic::target_ytile1#3 = 2 [phi:game_logic::@101->game_logic::@97#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile1 + // [340] phi game_logic::target_xtile1#3 = 2 [phi:game_logic::@101->game_logic::@97#1] -- vbuxx=vbuc1 + ldx #2 + jmp __b97 + // game_logic::@97 + __b97: + // [341] choose_direction::open_directions#1 = game_logic::open_directions1#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [342] choose_direction::ghost_xtile#1 = game_logic::ghost3_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost3_xtile + // [343] choose_direction::ghost_ytile#1 = game_logic::ghost3_ytile#0 + // [344] choose_direction::target_xtile#1 = game_logic::target_xtile1#3 + // [345] choose_direction::target_ytile#1 = game_logic::target_ytile1#3 + // [346] call choose_direction + // [746] phi from game_logic::@97 to choose_direction [phi:game_logic::@97->choose_direction] + choose_direction_from___b97: + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#1 [phi:game_logic::@97->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#1 [phi:game_logic::@97->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#1 [phi:game_logic::@97->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#1 [phi:game_logic::@97->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#1 [phi:game_logic::@97->choose_direction#4] -- register_copy + jsr choose_direction + // [347] choose_direction::return#1 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + jmp __b155 + // game_logic::@155 + __b155: + // [348] game_logic::$140 = choose_direction::return#1 + // [349] ghost3_direction = game_logic::$140 -- vbuz1=vbuaa + sta.z ghost3_direction + jmp __breturn + // game_logic::@96 + __b96: + // [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost3_direction + jmp __breturn + // game_logic::@95 + __b95: + // [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost3_direction + lda DIRECTION_REVERSE,y + sta.z ghost3_direction + // [352] ghost3_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_reverse + jmp __breturn + // game_logic::@94 + __b94: + // [353] ghost3_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost3_substep + // [354] if(ghost3_xfine==1) goto game_logic::@98 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + lda #1 + cmp.z ghost3_xfine + beq __b98 + jmp __b103 + // game_logic::@103 + __b103: + // [355] if(ghost3_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost3_xfine + bne __breturn + jmp __b104 + // game_logic::@104 + __b104: + // [356] ghost3_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost3_xfine + jmp __breturn + // game_logic::@98 + __b98: + // [357] ghost3_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost3_xfine + jmp __breturn + // game_logic::@92 + __b92: + // [358] ghost3_xfine = -- ghost3_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost3_xfine + jmp __b93 + // game_logic::@91 + __b91: + // [359] ghost3_yfine = ++ ghost3_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost3_yfine + jmp __b93 + // game_logic::@90 + __b90: + // [360] ghost3_xfine = ++ ghost3_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost3_xfine + jmp __b93 + // game_logic::@89 + __b89: + // [361] ghost3_respawn = -- ghost3_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost3_respawn + // [362] if(ghost3_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost3_respawn + bne __breturn + jmp __b105 + // game_logic::@105 + __b105: + // [363] ghost3_direction = UP -- vbuz1=vbuc1 + // Spawn ghost + lda #UP + sta.z ghost3_direction + // [364] ghost3_xfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost3_xfine + // [365] ghost3_yfine = $46 -- vbuz1=vbuc1 + lda #$46 + sta.z ghost3_yfine + // [366] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + jmp __breturn + // game_logic::@4 + __b4: + // [367] if(0!=ghost2_respawn) goto game_logic::@106 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost2_respawn + bne __b106 + jmp __b30 + // game_logic::@30 + __b30: + // [368] if(ghost2_direction==RIGHT) goto game_logic::@107 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost2_direction + beq __b107 + jmp __b31 + // game_logic::@31 + __b31: + // [369] if(ghost2_direction==DOWN) goto game_logic::@108 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost2_direction + beq __b108 + jmp __b32 + // game_logic::@32 + __b32: + // [370] if(ghost2_direction==LEFT) goto game_logic::@109 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost2_direction + beq __b109 + jmp __b33 + // game_logic::@33 + __b33: + // [371] if(ghost2_direction!=UP) goto game_logic::@110 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost2_direction + bne __b110 + jmp __b34 + // game_logic::@34 + __b34: + // [372] ghost2_yfine = -- ghost2_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost2_yfine + jmp __b110 + // game_logic::@110 + __b110: + // [373] game_logic::$226 = ghost2_direction -- vbuxx=vbuz1 + ldx.z ghost2_direction + // [374] if(ghost2_substep!=0) goto game_logic::@116 -- vbuz1_neq_0_then_la1 + lda.z ghost2_substep + bne __b116 + jmp __b168 + // game_logic::@168 + __b168: + // [375] if(game_logic::$226!=STOP) goto game_logic::@111 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b111 + jmp __b116 + // game_logic::@116 + __b116: + // [376] ghost2_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost2_substep + // [377] if(0!=ghost2_reverse) goto game_logic::@112 -- 0_neq_vbuz1_then_la1 + lda.z ghost2_reverse + bne __b112 + jmp __b117 + // game_logic::@117 + __b117: + // [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost2_xfine + lsr + sta.z ghost2_xtile + // [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost2_yfine + lsr + sta.z ghost2_ytile + // [380] level_tile_directions::xtile#2 = game_logic::ghost2_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost2_xtile + // [381] level_tile_directions::ytile#2 = game_logic::ghost2_ytile#0 -- vbuaa=vbuz1 + lda.z ghost2_ytile + // [382] call level_tile_directions + // [738] phi from game_logic::@117 to level_tile_directions [phi:game_logic::@117->level_tile_directions] + level_tile_directions_from___b117: + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#2 [phi:game_logic::@117->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#2 [phi:game_logic::@117->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // [383] level_tile_directions::return#11 = level_tile_directions::return#2 + jmp __b156 + // game_logic::@156 + __b156: + // [384] game_logic::open_directions2#0 = level_tile_directions::return#11 + // [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost2_direction + and DIRECTION_ELIMINATE,y + tay + // [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b113 + jmp __b118 + // game_logic::@118 + __b118: + // [387] if(ghosts_mode==SCATTER) goto game_logic::@114 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b114_from___b118 + jmp __b119 + // game_logic::@119 + __b119: + // [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile2 + // [390] phi from game_logic::@119 to game_logic::@114 [phi:game_logic::@119->game_logic::@114] + __b114_from___b119: + // [390] phi game_logic::target_ytile2#3 = game_logic::target_ytile2#2 [phi:game_logic::@119->game_logic::@114#0] -- register_copy + // [390] phi game_logic::target_xtile2#3 = game_logic::target_xtile2#2 [phi:game_logic::@119->game_logic::@114#1] -- register_copy + jmp __b114 + // [390] phi from game_logic::@118 to game_logic::@114 [phi:game_logic::@118->game_logic::@114] + __b114_from___b118: + // [390] phi game_logic::target_ytile2#3 = 2 [phi:game_logic::@118->game_logic::@114#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile2 + // [390] phi game_logic::target_xtile2#3 = 2 [phi:game_logic::@118->game_logic::@114#1] -- vbuxx=vbuc1 + ldx #2 + jmp __b114 + // game_logic::@114 + __b114: + // [391] choose_direction::open_directions#2 = game_logic::open_directions2#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [392] choose_direction::ghost_xtile#2 = game_logic::ghost2_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost2_xtile + // [393] choose_direction::ghost_ytile#2 = game_logic::ghost2_ytile#0 + // [394] choose_direction::target_xtile#2 = game_logic::target_xtile2#3 + // [395] choose_direction::target_ytile#2 = game_logic::target_ytile2#3 + // [396] call choose_direction + // [746] phi from game_logic::@114 to choose_direction [phi:game_logic::@114->choose_direction] + choose_direction_from___b114: + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#2 [phi:game_logic::@114->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#2 [phi:game_logic::@114->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#2 [phi:game_logic::@114->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#2 [phi:game_logic::@114->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#2 [phi:game_logic::@114->choose_direction#4] -- register_copy + jsr choose_direction + // [397] choose_direction::return#2 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + jmp __b157 + // game_logic::@157 + __b157: + // [398] game_logic::$161 = choose_direction::return#2 + // [399] ghost2_direction = game_logic::$161 -- vbuz1=vbuaa + sta.z ghost2_direction + jmp __breturn + // game_logic::@113 + __b113: + // [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost2_direction + jmp __breturn + // game_logic::@112 + __b112: + // [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost2_direction + lda DIRECTION_REVERSE,y + sta.z ghost2_direction + // [402] ghost2_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_reverse + jmp __breturn + // game_logic::@111 + __b111: + // [403] ghost2_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost2_substep + // [404] if(ghost2_xfine==1) goto game_logic::@115 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + lda #1 + cmp.z ghost2_xfine + beq __b115 + jmp __b120 + // game_logic::@120 + __b120: + // [405] if(ghost2_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost2_xfine + bne __breturn + jmp __b121 + // game_logic::@121 + __b121: + // [406] ghost2_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost2_xfine + jmp __breturn + // game_logic::@115 + __b115: + // [407] ghost2_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost2_xfine + jmp __breturn + // game_logic::@109 + __b109: + // [408] ghost2_xfine = -- ghost2_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost2_xfine + jmp __b110 + // game_logic::@108 + __b108: + // [409] ghost2_yfine = ++ ghost2_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost2_yfine + jmp __b110 + // game_logic::@107 + __b107: + // [410] ghost2_xfine = ++ ghost2_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost2_xfine + jmp __b110 + // game_logic::@106 + __b106: + // [411] ghost2_respawn = -- ghost2_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost2_respawn + // [412] if(ghost2_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost2_respawn + bne __breturn + jmp __b122 + // game_logic::@122 + __b122: + // [413] ghost2_direction = LEFT -- vbuz1=vbuc1 + // Spawn ghost + lda #LEFT + sta.z ghost2_direction + // [414] ghost2_xfine = $60 -- vbuz1=vbuc1 + lda #$60 + sta.z ghost2_xfine + // [415] ghost2_yfine = $46 -- vbuz1=vbuc1 + lda #$46 + sta.z ghost2_yfine + // [416] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + jmp __breturn + // game_logic::@3 + __b3: + // [417] if(0!=ghost1_respawn) goto game_logic::@123 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost1_respawn + bne __b123 + jmp __b35 + // game_logic::@35 + __b35: + // [418] if(ghost1_direction==RIGHT) goto game_logic::@124 -- vbuz1_eq_vbuc1_then_la1 + // Ghost 1 animation + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost1_direction + beq __b124 + jmp __b36 + // game_logic::@36 + __b36: + // [419] if(ghost1_direction==DOWN) goto game_logic::@125 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost1_direction + beq __b125 + jmp __b37 + // game_logic::@37 + __b37: + // [420] if(ghost1_direction==LEFT) goto game_logic::@126 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost1_direction + beq __b126 + jmp __b38 + // game_logic::@38 + __b38: + // [421] if(ghost1_direction!=UP) goto game_logic::@127 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost1_direction + bne __b127 + jmp __b39 + // game_logic::@39 + __b39: + // [422] ghost1_yfine = -- ghost1_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost1_yfine + jmp __b127 + // game_logic::@127 + __b127: + // [423] game_logic::$229 = ghost1_direction -- vbuxx=vbuz1 + ldx.z ghost1_direction + // [424] if(ghost1_substep!=0) goto game_logic::@133 -- vbuz1_neq_0_then_la1 + lda.z ghost1_substep + bne __b133 + jmp __b169 + // game_logic::@169 + __b169: + // [425] if(game_logic::$229!=STOP) goto game_logic::@128 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b128 + jmp __b133 + // game_logic::@133 + __b133: + // [426] ghost1_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost1_substep + // [427] if(0!=ghost1_reverse) goto game_logic::@129 -- 0_neq_vbuz1_then_la1 + lda.z ghost1_reverse + bne __b129 + jmp __b134 + // game_logic::@134 + __b134: + // [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost1_xfine + lsr + sta.z ghost1_xtile + // [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost1_yfine + lsr + sta.z ghost1_ytile + // [430] level_tile_directions::xtile#3 = game_logic::ghost1_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost1_xtile + // [431] level_tile_directions::ytile#3 = game_logic::ghost1_ytile#0 -- vbuaa=vbuz1 + lda.z ghost1_ytile + // [432] call level_tile_directions + // [738] phi from game_logic::@134 to level_tile_directions [phi:game_logic::@134->level_tile_directions] + level_tile_directions_from___b134: + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#3 [phi:game_logic::@134->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#3 [phi:game_logic::@134->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // [433] level_tile_directions::return#12 = level_tile_directions::return#2 + jmp __b158 + // game_logic::@158 + __b158: + // [434] game_logic::open_directions3#0 = level_tile_directions::return#12 + // [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost1_direction + and DIRECTION_ELIMINATE,y + tay + // [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b130 + jmp __b135 + // game_logic::@135 + __b135: + // [437] if(ghosts_mode==SCATTER) goto game_logic::@131 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b131_from___b135 + jmp __b136 + // game_logic::@136 + __b136: + // [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile3 + // [440] phi from game_logic::@136 to game_logic::@131 [phi:game_logic::@136->game_logic::@131] + __b131_from___b136: + // [440] phi game_logic::target_ytile3#3 = game_logic::target_ytile3#2 [phi:game_logic::@136->game_logic::@131#0] -- register_copy + // [440] phi game_logic::target_xtile3#3 = game_logic::target_xtile3#2 [phi:game_logic::@136->game_logic::@131#1] -- register_copy + jmp __b131 + // [440] phi from game_logic::@135 to game_logic::@131 [phi:game_logic::@135->game_logic::@131] + __b131_from___b135: + // [440] phi game_logic::target_ytile3#3 = 2 [phi:game_logic::@135->game_logic::@131#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile3 + // [440] phi game_logic::target_xtile3#3 = 2 [phi:game_logic::@135->game_logic::@131#1] -- vbuxx=vbuc1 + ldx #2 + jmp __b131 + // game_logic::@131 + __b131: + // [441] choose_direction::open_directions#3 = game_logic::open_directions3#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [442] choose_direction::ghost_xtile#3 = game_logic::ghost1_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost1_xtile + // [443] choose_direction::ghost_ytile#3 = game_logic::ghost1_ytile#0 + // [444] choose_direction::target_xtile#3 = game_logic::target_xtile3#3 + // [445] choose_direction::target_ytile#3 = game_logic::target_ytile3#3 + // [446] call choose_direction + // [746] phi from game_logic::@131 to choose_direction [phi:game_logic::@131->choose_direction] + choose_direction_from___b131: + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#3 [phi:game_logic::@131->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#3 [phi:game_logic::@131->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#3 [phi:game_logic::@131->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#3 [phi:game_logic::@131->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#3 [phi:game_logic::@131->choose_direction#4] -- register_copy + jsr choose_direction + // [447] choose_direction::return#3 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + jmp __b159 + // game_logic::@159 + __b159: + // [448] game_logic::$182 = choose_direction::return#3 + // [449] ghost1_direction = game_logic::$182 -- vbuz1=vbuaa + sta.z ghost1_direction + jmp __breturn + // game_logic::@130 + __b130: + // [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost1_direction + jmp __breturn + // game_logic::@129 + __b129: + // [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost1_direction + lda DIRECTION_REVERSE,y + sta.z ghost1_direction + // [452] ghost1_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_reverse + jmp __breturn + // game_logic::@128 + __b128: + // [453] ghost1_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost1_substep + // [454] if(ghost1_xfine==1) goto game_logic::@132 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + lda #1 + cmp.z ghost1_xfine + beq __b132 + jmp __b137 + // game_logic::@137 + __b137: + // [455] if(ghost1_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost1_xfine + bne __breturn + jmp __b138 + // game_logic::@138 + __b138: + // [456] ghost1_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost1_xfine + jmp __breturn + // game_logic::@132 + __b132: + // [457] ghost1_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost1_xfine + jmp __breturn + // game_logic::@126 + __b126: + // [458] ghost1_xfine = -- ghost1_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost1_xfine + jmp __b127 + // game_logic::@125 + __b125: + // [459] ghost1_yfine = ++ ghost1_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost1_yfine + jmp __b127 + // game_logic::@124 + __b124: + // [460] ghost1_xfine = ++ ghost1_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost1_xfine + jmp __b127 + // game_logic::@123 + __b123: + // [461] ghost1_respawn = -- ghost1_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost1_respawn + // [462] if(ghost1_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost1_respawn + bne __breturn + jmp __b139 + // game_logic::@139 + __b139: + // [463] ghost1_direction = DOWN -- vbuz1=vbuc1 + // Spawn ghost 1 + lda #DOWN + sta.z ghost1_direction + // [464] ghost1_xfine = $60 -- vbuz1=vbuc1 + lda #$60 + sta.z ghost1_xfine + // [465] ghost1_yfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost1_yfine + // [466] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + jmp __breturn + // game_logic::@2 + __b2: + // [467] if(pacman_direction==RIGHT) goto game_logic::@140 -- vbuz1_eq_vbuc1_then_la1 + // Animate pacman + // Move pacman in the current direction (unless he is stopped) + lda #RIGHT + cmp.z pacman_direction + beq __b140 + jmp __b40 + // game_logic::@40 + __b40: + // [468] if(pacman_direction==DOWN) goto game_logic::@141 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z pacman_direction + beq __b141 + jmp __b41 + // game_logic::@41 + __b41: + // [469] if(pacman_direction==LEFT) goto game_logic::@142 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z pacman_direction + beq __b142 + jmp __b42 + // game_logic::@42 + __b42: + // [470] if(pacman_direction!=UP) goto game_logic::@143 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z pacman_direction + bne __b143 + jmp __b43 + // game_logic::@43 + __b43: + // [471] pacman_yfine = -- pacman_yfine -- vbuz1=_dec_vbuz1 + dec.z pacman_yfine + jmp __b143 + // game_logic::@143 + __b143: + // [472] game_logic::$232 = pacman_direction -- vbuxx=vbuz1 + ldx.z pacman_direction + // [473] if(pacman_substep!=0) goto game_logic::@147 -- vbuz1_neq_0_then_la1 + lda.z pacman_substep + bne __b147 + jmp __b170 + // game_logic::@170 + __b170: + // [474] if(game_logic::$232!=STOP) goto game_logic::@144 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b144 + jmp __b147 + // game_logic::@147 + __b147: + // [475] pacman_substep = 0 -- vbuz1=vbuc1 + // Pacman is on a (new) tile + lda #0 + sta.z pacman_substep + // [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_yfine + lsr + // [478] level_tile_directions::xtile#4 = game_logic::pacman_xtile1#0 + // [479] level_tile_directions::ytile#4 = game_logic::pacman_ytile1#0 + // [480] call level_tile_directions + // [738] phi from game_logic::@147 to level_tile_directions [phi:game_logic::@147->level_tile_directions] + level_tile_directions_from___b147: + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#4 [phi:game_logic::@147->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#4 [phi:game_logic::@147->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // [481] level_tile_directions::return#13 = level_tile_directions::return#2 + jmp __b160 + // game_logic::@160 + __b160: + // [482] game_logic::open_directions4#0 = level_tile_directions::return#13 -- vbuxx=vbuaa + tax + // [483] game_logic::$199 = *((byte*)CIA1) & $f -- vbuaa=_deref_pbuc1_band_vbuc2 + lda #$f + and CIA1 + // [484] game_logic::$200 = game_logic::$199 ^ $f -- vbuaa=vbuaa_bxor_vbuc1 + eor #$f + // [485] game_logic::joy_directions#0 = game_logic::$200 << 2 -- vbuaa=vbuaa_rol_2 + asl + asl + // [486] if(game_logic::joy_directions#0==0) goto game_logic::@145 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b145 + jmp __b148 + // game_logic::@148 + __b148: + // [487] game_logic::$204 = game_logic::joy_directions#0 & game_logic::open_directions4#0 -- vbuaa=vbuaa_band_vbuxx + stx.z $ff + and.z $ff + // [488] game_logic::new_direction#0 = DIRECTION_SINGLE[game_logic::$204] -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda DIRECTION_SINGLE,y + // [489] if(game_logic::new_direction#0==0) goto game_logic::@145 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b145 + jmp __b149 + // game_logic::@149 + __b149: + // [490] pacman_direction = game_logic::new_direction#0 -- vbuz1=vbuaa + sta.z pacman_direction + jmp __b145 + // game_logic::@145 + __b145: + // [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 -- vbuz1=vbuz1_band_vbuxx + // Stop pacman if the current direction is no longer open + lda.z pacman_direction + sax.z pacman_direction + jmp __breturn + // game_logic::@144 + __b144: + // [492] pacman_substep = 1 -- vbuz1=vbuc1 + // Pacman was on a tile and is moving, so he is now between tiles + lda #1 + sta.z pacman_substep + // [493] pacman_ch1_enabled = 1 -- vbuz1=vbuc1 + // Enable the eating sound whenever pacman is moving + lda #1 + sta.z pacman_ch1_enabled + // [494] if(pacman_xfine==1) goto game_logic::@146 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + lda #1 + cmp.z pacman_xfine + beq __b146 + jmp __b150 + // game_logic::@150 + __b150: + // [495] if(pacman_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z pacman_xfine + bne __breturn + jmp __b151 + // game_logic::@151 + __b151: + // [496] pacman_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z pacman_xfine + jmp __breturn + // game_logic::@146 + __b146: + // [497] pacman_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z pacman_xfine + jmp __breturn + // game_logic::@142 + __b142: + // [498] pacman_xfine = -- pacman_xfine -- vbuz1=_dec_vbuz1 + dec.z pacman_xfine + jmp __b143 + // game_logic::@141 + __b141: + // [499] pacman_yfine = ++ pacman_yfine -- vbuz1=_inc_vbuz1 + inc.z pacman_yfine + jmp __b143 + // game_logic::@140 + __b140: + // [500] pacman_xfine = ++ pacman_xfine -- vbuz1=_inc_vbuz1 + inc.z pacman_xfine + jmp __b143 +} + // pacman_sound_play +pacman_sound_play: { + // [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return -- 0_eq_vbuz1_then_la1 + lda.z pacman_ch1_enabled + beq __breturn + jmp __b1 + // pacman_sound_play::@1 + __b1: + // [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + // Play the entire sound - and then reset and disable it + ldy.z pacman_ch1_idx + lda PACMAN_CH1_FREQ_HI,y + sta SID_CH1_FREQ_HI + // [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + ldy.z pacman_ch1_idx + lda PACMAN_CH1_CONTROL,y + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // [504] pacman_ch1_idx = ++ pacman_ch1_idx -- vbuz1=_inc_vbuz1 + inc.z pacman_ch1_idx + // [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$16*SIZEOF_BYTE + cmp.z pacman_ch1_idx + bne __breturn + jmp __b2 + // pacman_sound_play::@2 + __b2: + // [506] pacman_ch1_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_idx + // [507] pacman_ch1_enabled = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_enabled + jmp __breturn + // pacman_sound_play::@return + __breturn: + // [508] return + rts +} + // splash_run +// Initializes all data for the splash and shows the splash. +// Returns when the splash is complete and the user clicks the joystidk #2 button +splash_run: { + .const toDd001_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + .label xpos = $59 + .label i = 5 + jmp SEI1 + // splash_run::SEI1 + SEI1: + // asm { sei } + sei + jmp __b16 + // splash_run::@16 + __b16: + // [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT + // [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 + // Disable kernal & basic & IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // [513] *PROCPORT = PROCPORT_RAM_ALL -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_ALL + sta PROCPORT + // [514] call memset + // Reset memory to avoid crashes + // [776] phi from splash_run::@16 to memset [phi:splash_run::@16->memset] + memset_from___b16: + // [776] phi memset::str#6 = (void*) 16384 [phi:splash_run::@16->memset#0] -- pvoz1=pvoc1 + lda #<$4000 + sta.z memset.str + lda #>$4000 + sta.z memset.str+1 + // [776] phi memset::num#5 = $c00 [phi:splash_run::@16->memset#1] -- vwuz1=vwuc1 + lda #<$c00 + sta.z memset.num + lda #>$c00 + sta.z memset.num+1 + jsr memset + jmp __b20 + // splash_run::@20 + __b20: + // [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED -- pbuz1=pbuc1 + lda #RASTER_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [516] call byteboozer_decrunch + // Decrunch raster code + jsr byteboozer_decrunch + jmp __b21 + // splash_run::@21 + __b21: + // [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED -- pbuz1=pbuc1 + lda #LOGIC_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [518] call byteboozer_decrunch + // Decrunch logic code + jsr byteboozer_decrunch + // [519] phi from splash_run::@21 to splash_run::@22 [phi:splash_run::@21->splash_run::@22] + __b22_from___b21: + jmp __b22 + // splash_run::@22 + __b22: + // [520] call merge_code + // Merge the raster with the logic-code + // [787] phi from splash_run::@22 to merge_code [phi:splash_run::@22->merge_code] + merge_code_from___b22: + jsr merge_code + // [521] phi from splash_run::@22 to splash_run::@23 [phi:splash_run::@22->splash_run::@23] + __b23_from___b22: + jmp __b23 + // splash_run::@23 + __b23: + // [522] call memset + // Clear the graphics banks + // [776] phi from splash_run::@23 to memset [phi:splash_run::@23->memset] + memset_from___b23: + // [776] phi memset::str#6 = (void*)BANK_1+$2000 [phi:splash_run::@23->memset#0] -- pvoz1=pvoc1 + lda #BANK_1+$2000 + sta.z memset.str+1 + // [776] phi memset::num#5 = $1fff [phi:splash_run::@23->memset#1] -- vwuz1=vwuc1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // [523] phi from splash_run::@23 to splash_run::@24 [phi:splash_run::@23->splash_run::@24] + __b24_from___b23: + jmp __b24 + // splash_run::@24 + __b24: + // [524] call memset + // [776] phi from splash_run::@24 to memset [phi:splash_run::@24->memset] + memset_from___b24: + // [776] phi memset::str#6 = (void*)BANK_2 [phi:splash_run::@24->memset#0] -- pvoz1=pvoc1 + lda #BANK_2 + sta.z memset.str+1 + // [776] phi memset::num#5 = $3fff [phi:splash_run::@24->memset#1] -- vwuz1=vwuc1 + lda #<$3fff + sta.z memset.num + lda #>$3fff + sta.z memset.num+1 + jsr memset + // [525] phi from splash_run::@24 to splash_run::@25 [phi:splash_run::@24->splash_run::@25] + __b25_from___b24: + jmp __b25 + // splash_run::@25 + __b25: + // [526] call init_render_index + // Initialize the renderer tables + // [834] phi from splash_run::@25 to init_render_index [phi:splash_run::@25->init_render_index] + init_render_index_from___b25: + jsr init_render_index + jmp __b26 + // splash_run::@26 + __b26: + // [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED -- pbuz1=pbuc1 + lda #SPLASH_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [528] call byteboozer_decrunch + // decrunch splash screen + jsr byteboozer_decrunch + // [529] phi from splash_run::@26 to splash_run::@27 [phi:splash_run::@26->splash_run::@27] + __b27_from___b26: + jmp __b27 + // splash_run::@27 + __b27: + // [530] call splash_show + // Show the splash screen + // [865] phi from splash_run::@27 to splash_show [phi:splash_run::@27->splash_show] + splash_show_from___b27: + jsr splash_show + // [531] phi from splash_run::@27 to splash_run::@28 [phi:splash_run::@27->splash_run::@28] + __b28_from___b27: + jmp __b28 + // splash_run::@28 + __b28: + // [532] call memset + // Clear the graphics bank + // [776] phi from splash_run::@28 to memset [phi:splash_run::@28->memset] + memset_from___b28: + // [776] phi memset::str#6 = (void*)BANK_1 [phi:splash_run::@28->memset#0] -- pvoz1=pvoc1 + lda #BANK_1 + sta.z memset.str+1 + // [776] phi memset::num#5 = $1fff [phi:splash_run::@28->memset#1] -- vwuz1=vwuc1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // [533] phi from splash_run::@28 to splash_run::@29 [phi:splash_run::@28->splash_run::@29] + __b29_from___b28: + jmp __b29 + // splash_run::@29 + __b29: + // [534] call init_bobs_restore + // Initialize bobs_restore to "safe" values + // [879] phi from splash_run::@29 to init_bobs_restore [phi:splash_run::@29->init_bobs_restore] + init_bobs_restore_from___b29: + jsr init_bobs_restore + jmp __b30 + // splash_run::@30 + __b30: + // [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED -- pbuz1=pbuc1 + lda #BOB_GRAPHICS_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [536] call byteboozer_decrunch + // decrunch bobs graphics tables + jsr byteboozer_decrunch + // [537] phi from splash_run::@30 to splash_run::@31 [phi:splash_run::@30->splash_run::@31] + __b31_from___b30: + jmp __b31 + // splash_run::@31 + __b31: + // [538] call init_sprite_pointers + // Set sprite pointers on all screens (in both graphics banks) + // [896] phi from splash_run::@31 to init_sprite_pointers [phi:splash_run::@31->init_sprite_pointers] + init_sprite_pointers_from___b31: + jsr init_sprite_pointers + // [539] phi from splash_run::@31 to splash_run::@32 [phi:splash_run::@31->splash_run::@32] + __b32_from___b31: + jmp __b32 + // splash_run::@32 + __b32: + // [540] call memcpy + // Move the crunched music to upper memory before decrunching it + // [910] phi from splash_run::@32 to memcpy [phi:splash_run::@32->memcpy] + memcpy_from___b32: + jsr memcpy + jmp __b33 + // splash_run::@33 + __b33: + // [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER -- pbuz1=pbuc1 + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z byteboozer_decrunch.crunched+1 + // [542] call byteboozer_decrunch + // zero-fill the entire Init segment + //memset(LEVEL_TILES_CRUNCHED, 0, INTRO_MUSIC_CRUNCHED+INTRO_MUSIC_CRUNCHED_SIZE-LEVEL_TILES_CRUNCHED); + // decrunch intro music + jsr byteboozer_decrunch + // [543] phi from splash_run::@33 to splash_run::@34 [phi:splash_run::@33->splash_run::@34] + __b34_from___b33: + jmp __b34 + // splash_run::@34 + __b34: + // [544] call memset + // Zero-fill the upper memory + // [776] phi from splash_run::@34 to memset [phi:splash_run::@34->memset] + memset_from___b34: + // [776] phi memset::str#6 = (void*)INTRO_MUSIC_CRUNCHED_UPPER [phi:splash_run::@34->memset#0] -- pvoz1=pvoc1 + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z memset.str+1 + // [776] phi memset::num#5 = INTRO_MUSIC_CRUNCHED_SIZE [phi:splash_run::@34->memset#1] -- vwuz1=vwuc1 + lda #INTRO_MUSIC_CRUNCHED_SIZE + sta.z memset.num+1 + jsr memset + jmp __b35 + // splash_run::@35 + __b35: + // [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 + // Disable kernal & basic - enable IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // [546] *PROCPORT = PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_IO + sta PROCPORT + // [547] phi from splash_run::@35 to splash_run::@1 [phi:splash_run::@35->splash_run::@1] + __b1_from___b35: + // [547] phi splash_run::msb#10 = 0 [phi:splash_run::@35->splash_run::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [547] phi splash_run::i#2 = 0 [phi:splash_run::@35->splash_run::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z i + jmp __b1 + // splash_run::@1 + __b1: + // [548] if(splash_run::i#2<8) goto splash_run::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z i + cmp #8 + bcc __b2 + // [549] phi from splash_run::@1 to splash_run::toDd001 [phi:splash_run::@1->splash_run::toDd001] + toDd001_from___b1: + jmp toDd001 + // splash_run::toDd001 + toDd001: + jmp __b17 + // splash_run::@17 + __b17: + // [550] *((byte*)CIA2) = splash_run::toDd001_return#0 -- _deref_pbuc1=vbuc2 + // Set initial graphics bank + lda #toDd001_return + sta CIA2 + // [551] canvas_base_hi = >SPRITES_2 -- vbuz1=vbuc1 + // Set initial render/restore buffer + lda #>SPRITES_2 + sta.z canvas_base_hi + // [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE -- vbuz1=vbuc1 + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + // [553] phi from splash_run::@17 to splash_run::toD0181 [phi:splash_run::@17->splash_run::toD0181] + toD0181_from___b17: + jmp toD0181 + // splash_run::toD0181 + toD0181: + jmp __b18 + // splash_run::@18 + __b18: + // [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Select first screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // [555] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) = splash_run::msb#10 -- _deref_pbuc1=vbuxx + stx VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB + // [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff -- _deref_pbuc1=vbuc2 + lda #$ff + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE + // [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff -- _deref_pbuc1=vbuc2 + lda #$ff + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X + // [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR + // [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE -- _deref_pbuc1=vbuc2 + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED -- _deref_pbuc1=vbuc2 + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // [562] top_sprites_mc = 3 -- vbuz1=vbuc1 + // On the splash screen sprites all sprites are SC - except sprite #0,1 on the top/bottom of the screen + lda #3 + sta.z top_sprites_mc + // [563] side_sprites_mc = 0 -- vbuz1=vbuc1 + lda #0 + sta.z side_sprites_mc + // [564] bottom_sprites_mc = 3 -- vbuz1=vbuc1 + lda #3 + sta.z bottom_sprites_mc + // [565] top_sprites_color = YELLOW -- vbuz1=vbuc1 + // On the splash top/bottom sc-sprites are yellow and side-sprites are blue + lda #YELLOW + sta.z top_sprites_color + // [566] side_sprites_color = BLUE -- vbuz1=vbuc1 + lda #BLUE + sta.z side_sprites_color + // [567] bottom_sprites_color = YELLOW -- vbuz1=vbuc1 + lda #YELLOW + sta.z bottom_sprites_color + // [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // [569] phi from splash_run::@18 to splash_run::@5 [phi:splash_run::@18->splash_run::@5] + __b5_from___b18: + // [569] phi splash_run::i1#2 = 0 [phi:splash_run::@18->splash_run::@5#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b5 + // Set initial Sprite Color + // splash_run::@5 + __b5: + // [570] if(splash_run::i1#2<8) goto splash_run::@6 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcc __b6 + jmp __b7 + // splash_run::@7 + __b7: + // [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 -- _deref_pbuc1=vbuc2 + // Set VICII CONTROL2 ($d016) to 8 to allow ASL, LSR to be used for opening the border + lda #8 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // [572] phi from splash_run::@7 to splash_run::@8 [phi:splash_run::@7->splash_run::@8] + __b8_from___b7: + // [572] phi splash_run::i2#2 = 0 [phi:splash_run::@7->splash_run::@8#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b8 + // Move the bobs to the center to avoid interference while rendering the level + // splash_run::@8 + __b8: + // [573] if(splash_run::i2#2<4) goto splash_run::@9 -- vbuxx_lt_vbuc1_then_la1 + cpx #4 + bcc __b9 + jmp __b10 + // splash_run::@10 + __b10: + // asm { lda#1 staINTRO_MUSIC+$69 } + // Disable SID CH#3 + lda #1 + sta INTRO_MUSIC+$69 + // asm { lda#0 } + // Init music + lda #0 + // [576] call *musicInit + jsr musicInit + // [577] phase = 0 -- vbuz1=vbuc1 + // Set phase to intro + lda #0 + sta.z phase + // [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM -- _deref_pbuc1=vbuc2 + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + // Set an illegal mode to prevent any character graphics + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + jmp __b11 + // Wait for line 0xfa (lower border) + // splash_run::@11 + __b11: + // [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + jmp __b12 + // splash_run::@12 + __b12: + // [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // [582] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm { ldaCIA1_INTERRUPT } + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // [585] *IRQ_STATUS = $f -- _deref_pbuc1=vbuc2 + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + jmp CLI1 + // splash_run::CLI1 + CLI1: + // asm { cli } + cli + // [587] phi from splash_run::CLI1 to splash_run::@19 [phi:splash_run::CLI1->splash_run::@19] + __b19_from_CLI1: + jmp __b19 + // splash_run::@19 + __b19: + // [588] call joyinit + // Prepare for joystick control + jsr joyinit + jmp __b36 + // splash_run::@36 + __b36: + // [589] music_play_next = 0 -- vbuz1=vbuc1 + // Wait for fire + lda #0 + sta.z music_play_next + // [590] phi from splash_run::@14 splash_run::@15 splash_run::@36 to splash_run::@13 [phi:splash_run::@14/splash_run::@15/splash_run::@36->splash_run::@13] + __b13_from___b14: + __b13_from___b15: + __b13_from___b36: + jmp __b13 + // splash_run::@13 + __b13: + // [591] call joyfire + jsr joyfire + // [592] joyfire::return#1 = joyfire::return#4 + jmp __b37 + // splash_run::@37 + __b37: + // [593] splash_run::$30 = joyfire::return#1 + // [594] if(0==splash_run::$30) goto splash_run::@14 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b14 + jmp __breturn + // splash_run::@return + __breturn: + // [595] return + rts + // splash_run::@14 + __b14: + // [596] if(0==music_play_next) goto splash_run::@13 -- 0_eq_vbuz1_then_la1 + lda.z music_play_next + beq __b13_from___b14 + jmp __b15 + // splash_run::@15 + __b15: + // [597] call *musicPlay + //VICII->BG_COLOR=1; + jsr musicPlay + // [598] music_play_next = 0 -- vbuz1=vbuc1 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13_from___b15 + // splash_run::@9 + __b9: + // [599] bobs_xcol[splash_run::i2#2] = $a -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$a + sta bobs_xcol,x + // [600] bobs_yfine[splash_run::i2#2] = $2d -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$2d + sta bobs_yfine,x + // [601] bobs_bob_id[splash_run::i2#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta bobs_bob_id,x + // [602] splash_run::i2#1 = ++ splash_run::i2#2 -- vbuxx=_inc_vbuxx + inx + // [572] phi from splash_run::@9 to splash_run::@8 [phi:splash_run::@9->splash_run::@8] + __b8_from___b9: + // [572] phi splash_run::i2#2 = splash_run::i2#1 [phi:splash_run::@9->splash_run::@8#0] -- register_copy + jmp __b8 + // splash_run::@6 + __b6: + // [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z top_sprites_color + sta SPRITES_COLOR,x + // [604] splash_run::i1#1 = ++ splash_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [569] phi from splash_run::@6 to splash_run::@5 [phi:splash_run::@6->splash_run::@5] + __b5_from___b6: + // [569] phi splash_run::i1#2 = splash_run::i1#1 [phi:splash_run::@6->splash_run::@5#0] -- register_copy + jmp __b5 + // splash_run::@2 + __b2: + // [605] splash_run::$34 = splash_run::i#2 << 1 -- vbuyy=vbuz1_rol_1 + lda.z i + asl + tay + // [606] SPRITES_YPOS[splash_run::$34] = 7 -- pbuc1_derefidx_vbuyy=vbuc2 + lda #7 + sta SPRITES_YPOS,y + // [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] -- vwuz1=pwuc1_derefidx_vbuyy + lda sprites_xpos,y + sta.z xpos + lda sprites_xpos+1,y + sta.z xpos+1 + // [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 -- pbuc1_derefidx_vbuyy=_byte_vwuz1 + lda.z xpos + sta SPRITES_XPOS,y + // [609] splash_run::msb#1 = splash_run::msb#10 >> 1 -- vbuxx=vbuxx_ror_1 + txa + lsr + tax + // [610] splash_run::$25 = > splash_run::xpos#0 -- vbuaa=_hi_vwuz1 + lda.z xpos+1 + // [611] if(0==splash_run::$25) goto splash_run::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b3_from___b2 + jmp __b4 + // splash_run::@4 + __b4: + // [612] splash_run::msb#2 = splash_run::msb#1 | $80 -- vbuxx=vbuxx_bor_vbuc1 + txa + ora #$80 + tax + // [613] phi from splash_run::@2 splash_run::@4 to splash_run::@3 [phi:splash_run::@2/splash_run::@4->splash_run::@3] + __b3_from___b2: + __b3_from___b4: + // [613] phi splash_run::msb#8 = splash_run::msb#1 [phi:splash_run::@2/splash_run::@4->splash_run::@3#0] -- register_copy + jmp __b3 + // splash_run::@3 + __b3: + // [614] splash_run::i#1 = ++ splash_run::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [547] phi from splash_run::@3 to splash_run::@1 [phi:splash_run::@3->splash_run::@1] + __b1_from___b3: + // [547] phi splash_run::msb#10 = splash_run::msb#8 [phi:splash_run::@3->splash_run::@1#0] -- register_copy + // [547] phi splash_run::i#2 = splash_run::i#1 [phi:splash_run::@3->splash_run::@1#1] -- register_copy + jmp __b1 + .segment Data + // Sprite positions + sprites_xpos: .word $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f +} +.segment Code + // gameplay_run +// Initialize all data for gameplay and runs the game. +// Exits when the user has won or lost +gameplay_run: { + .label __4 = $b + jmp SEI1 + // gameplay_run::SEI1 + SEI1: + // asm { sei } + sei + // [617] phi from gameplay_run::SEI1 to gameplay_run::@1 [phi:gameplay_run::SEI1->gameplay_run::@1] + __b1_from_SEI1: + // [617] phi gameplay_run::i#2 = 0 [phi:gameplay_run::SEI1->gameplay_run::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b1 + // Stop any sound + // gameplay_run::@1 + __b1: + // [618] if(gameplay_run::i#2<$2f) goto gameplay_run::@2 -- vbuxx_lt_vbuc1_then_la1 + cpx #$2f + bcc __b2 + jmp __b3 + // gameplay_run::@3 + __b3: + // [619] pacman_wins = 0 -- vbuz1=vbuc1 + // Pacman has not won yet + lda #0 + sta.z pacman_wins + // [620] pacman_lives = 3 -- vbuz1=vbuc1 + // Pacman has 3 lives + lda #3 + sta.z pacman_lives + // [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK -- _deref_pbuc1=vbuc2 + // During transition all sprites are black + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // [623] phi from gameplay_run::@3 to gameplay_run::@4 [phi:gameplay_run::@3->gameplay_run::@4] + __b4_from___b3: + // [623] phi gameplay_run::i1#2 = 0 [phi:gameplay_run::@3->gameplay_run::@4#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b4 + // gameplay_run::@4 + __b4: + // [624] if(gameplay_run::i1#2<8) goto gameplay_run::@5 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcc __b5 + jmp __b6 + // gameplay_run::@6 + __b6: + // [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED -- pbuz1=pbuc1 + lda #LEVEL_TILES_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [626] call byteboozer_decrunch + // decrunch level tiles + jsr byteboozer_decrunch + // [627] phi from gameplay_run::@6 to gameplay_run::@14 [phi:gameplay_run::@6->gameplay_run::@14] + __b14_from___b6: + jmp __b14 + // gameplay_run::@14 + __b14: + // [628] call init_level_tile_directions + // Initialize tile directions + // [924] phi from gameplay_run::@14 to init_level_tile_directions [phi:gameplay_run::@14->init_level_tile_directions] + init_level_tile_directions_from___b14: + jsr init_level_tile_directions + // [629] phi from gameplay_run::@14 to gameplay_run::@15 [phi:gameplay_run::@14->gameplay_run::@15] + __b15_from___b14: + jmp __b15 + // gameplay_run::@15 + __b15: + // [630] call init_sprite_pointers + // Set sprite pointers on all screens (in both graphics banks) + // [896] phi from gameplay_run::@15 to init_sprite_pointers [phi:gameplay_run::@15->init_sprite_pointers] + init_sprite_pointers_from___b15: + jsr init_sprite_pointers + // [631] phi from gameplay_run::@15 to gameplay_run::@16 [phi:gameplay_run::@15->gameplay_run::@16] + __b16_from___b15: + jmp __b16 + // gameplay_run::@16 + __b16: + // [632] call level_show + // [966] phi from gameplay_run::@16 to level_show [phi:gameplay_run::@16->level_show] + level_show_from___b16: + jsr level_show + // [633] level_show::return#0 = level_show::count#12 + jmp __b17 + // gameplay_run::@17 + __b17: + // [634] gameplay_run::$4 = level_show::return#0 + // [635] pill_count = gameplay_run::$4 -- vwuz1=vwuz2 + // Show the level + lda.z __4 + sta.z pill_count + lda.z __4+1 + sta.z pill_count+1 + // [636] top_sprites_mc = $ff -- vbuz1=vbuc1 + // During gameplay all sprites are MC. + lda #$ff + sta.z top_sprites_mc + // [637] side_sprites_mc = $ff -- vbuz1=vbuc1 + lda #$ff + sta.z side_sprites_mc + // [638] bottom_sprites_mc = $ff -- vbuz1=vbuc1 + lda #$ff + sta.z bottom_sprites_mc + // [639] top_sprites_color = YELLOW -- vbuz1=vbuc1 + // During gameplay all sprites are yellow + lda #YELLOW + sta.z top_sprites_color + // [640] side_sprites_color = YELLOW -- vbuz1=vbuc1 + lda #YELLOW + sta.z side_sprites_color + // [641] bottom_sprites_color = YELLOW -- vbuz1=vbuc1 + lda #YELLOW + sta.z bottom_sprites_color + // [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // [643] phi from gameplay_run::@17 to gameplay_run::@7 [phi:gameplay_run::@17->gameplay_run::@7] + __b7_from___b17: + // [643] phi gameplay_run::i2#2 = 0 [phi:gameplay_run::@17->gameplay_run::@7#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b7 + // Set initial Sprite Color + // gameplay_run::@7 + __b7: + // [644] if(gameplay_run::i2#2<8) goto gameplay_run::@8 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcc __b8 + jmp __b9 + // gameplay_run::@9 + __b9: + // [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE -- _deref_pbuc1=vbuc2 + // Set sprite MC-colors for the game + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED -- _deref_pbuc1=vbuc2 + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // [647] phase = 1 -- vbuz1=vbuc1 + // Set phase to game + lda #1 + sta.z phase + // [648] call spawn_all + // Spawn pacman and all ghosts + jsr spawn_all + // [649] phi from gameplay_run::@9 to gameplay_run::@18 [phi:gameplay_run::@9->gameplay_run::@18] + __b18_from___b9: + jmp __b18 + // gameplay_run::@18 + __b18: + // [650] call pacman_sound_init + // Initialize the game sound + jsr pacman_sound_init + jmp __b19 + // gameplay_run::@19 + __b19: + // [651] game_playable = 1 -- vbuz1=vbuc1 + // Start the game play + lda #1 + sta.z game_playable + // [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM -- _deref_pbuc1=vbuc2 + // Turn on raster after transition + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + jmp __b10 + // Wait at least one frames for DEN to take effect + // gameplay_run::@10 + __b10: + // [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fb + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b10 + jmp __b11 + // gameplay_run::@11 + __b11: + // [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + jmp __b12 + // gameplay_run::@12 + __b12: + // [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // [657] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm { ldaCIA1_INTERRUPT } + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // [660] *IRQ_STATUS = $f -- _deref_pbuc1=vbuc2 + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + jmp CLI1 + // gameplay_run::CLI1 + CLI1: + // asm { cli } + cli + jmp __b13 + // gameplay_run::@13 + __b13: + // [662] if(0!=pacman_wins) goto gameplay_run::@return -- 0_neq_vbuz1_then_la1 + lda.z pacman_wins + bne __breturn + jmp __b20 + // gameplay_run::@20 + __b20: + // [663] if(pacman_lives==0) goto gameplay_run::@return -- vbuz1_eq_0_then_la1 + lda.z pacman_lives + beq __breturn + jmp __b13 + // gameplay_run::@return + __breturn: + // [664] return + rts + // gameplay_run::@8 + __b8: + // [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z top_sprites_color + sta SPRITES_COLOR,x + // [666] gameplay_run::i2#1 = ++ gameplay_run::i2#2 -- vbuxx=_inc_vbuxx + inx + // [643] phi from gameplay_run::@8 to gameplay_run::@7 [phi:gameplay_run::@8->gameplay_run::@7] + __b7_from___b8: + // [643] phi gameplay_run::i2#2 = gameplay_run::i2#1 [phi:gameplay_run::@8->gameplay_run::@7#0] -- register_copy + jmp __b7 + // gameplay_run::@5 + __b5: + // [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK -- pbuc1_derefidx_vbuxx=vbuc2 + lda #BLACK + sta SPRITES_COLOR,x + // [668] gameplay_run::i1#1 = ++ gameplay_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [623] phi from gameplay_run::@5 to gameplay_run::@4 [phi:gameplay_run::@5->gameplay_run::@4] + __b4_from___b5: + // [623] phi gameplay_run::i1#2 = gameplay_run::i1#1 [phi:gameplay_run::@5->gameplay_run::@4#0] -- register_copy + jmp __b4 + // gameplay_run::@2 + __b2: + // [669] ((byte*)SID)[gameplay_run::i#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta SID,x + // [670] gameplay_run::i#1 = ++ gameplay_run::i#2 -- vbuxx=_inc_vbuxx + inx + // [617] phi from gameplay_run::@2 to gameplay_run::@1 [phi:gameplay_run::@2->gameplay_run::@1] + __b1_from___b2: + // [617] phi gameplay_run::i#2 = gameplay_run::i#1 [phi:gameplay_run::@2->gameplay_run::@1#0] -- register_copy + jmp __b1 +} + // done_run +// Show Victory or Game Over Image +// Returns when the user clicks the joystick button +done_run: { + // Show the win graphics + .label gfx = $59 + .label ypos = 6 + .label xcol = 5 + // [671] game_playable = 0 -- vbuz1=vbuc1 + // Stop the game play + lda #0 + sta.z game_playable + // [672] phase = 0 -- vbuz1=vbuc1 + // Set phase to intro + lda #0 + sta.z phase + // [673] phi from done_run to done_run::@2 [phi:done_run->done_run::@2] + __b2_from_done_run: + // [673] phi done_run::i#2 = 0 [phi:done_run->done_run::@2#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b2 + // Stop any sound + // done_run::@2 + __b2: + // [674] if(done_run::i#2<$2f) goto done_run::@3 -- vbuxx_lt_vbuc1_then_la1 + cpx #$2f + bcc __b3 + // [675] phi from done_run::@2 to done_run::@4 [phi:done_run::@2->done_run::@4] + __b4_from___b2: + // [675] phi done_run::i1#2 = 0 [phi:done_run::@2->done_run::@4#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b4 + // Move the bobs to the center to avoid interference while rendering the level + // done_run::@4 + __b4: + // [676] if(done_run::i1#2<4) goto done_run::@5 -- vbuxx_lt_vbuc1_then_la1 + cpx #4 + bcc __b5 + jmp __b6 + // done_run::@6 + __b6: + // asm { lda#0 } + // Init music + lda #0 + // [678] call *musicInit + jsr musicInit + // [679] if(0!=pacman_wins) goto done_run::@1 -- 0_neq_vbuz1_then_la1 + lda.z pacman_wins + bne __b1 + jmp __b7 + // done_run::@7 + __b7: + // [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED -- pbuz1=pbuc1 + lda #GAMEOVER_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [681] call byteboozer_decrunch + // decrunch game over graphics + jsr byteboozer_decrunch + // [682] phi from done_run::@1 done_run::@7 to done_run::@8 [phi:done_run::@1/done_run::@7->done_run::@8] + __b8_from___b1: + __b8_from___b7: + // [682] phi done_run::gfx#4 = WIN_GFX [phi:done_run::@1/done_run::@7->done_run::@8#0] -- pbuz1=pbuc1 + lda #WIN_GFX + sta.z gfx+1 + // [682] phi done_run::xcol#2 = 0 [phi:done_run::@1/done_run::@7->done_run::@8#1] -- vbuz1=vbuc1 + lda #0 + sta.z xcol + jmp __b8 + // done_run::@8 + __b8: + // [683] if(done_run::xcol#2<$19) goto done_run::@10 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b10_from___b8 + jmp __b9 + // done_run::@9 + __b9: + // [684] music_play_next = 0 -- vbuz1=vbuc1 + // Wait for fire + lda #0 + sta.z music_play_next + // [685] phi from done_run::@14 done_run::@15 done_run::@9 to done_run::@13 [phi:done_run::@14/done_run::@15/done_run::@9->done_run::@13] + __b13_from___b14: + __b13_from___b15: + __b13_from___b9: + jmp __b13 + // done_run::@13 + __b13: + // [686] call joyfire + jsr joyfire + // [687] joyfire::return#0 = joyfire::return#4 + jmp __b17 + // done_run::@17 + __b17: + // [688] done_run::$8 = joyfire::return#0 + // [689] if(0==done_run::$8) goto done_run::@14 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b14 + jmp __breturn + // done_run::@return + __breturn: + // [690] return + rts + // done_run::@14 + __b14: + // [691] if(0==music_play_next) goto done_run::@13 -- 0_eq_vbuz1_then_la1 + lda.z music_play_next + beq __b13_from___b14 + jmp __b15 + // done_run::@15 + __b15: + // [692] call *musicPlay + //VICII->BG_COLOR=1; + jsr musicPlay + // [693] music_play_next = 0 -- vbuz1=vbuc1 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13_from___b15 + // [694] phi from done_run::@8 to done_run::@10 [phi:done_run::@8->done_run::@10] + __b10_from___b8: + // [694] phi done_run::gfx#2 = done_run::gfx#4 [phi:done_run::@8->done_run::@10#0] -- register_copy + // [694] phi done_run::ypos#2 = 0 [phi:done_run::@8->done_run::@10#1] -- vbuz1=vbuc1 + lda #0 + sta.z ypos + jmp __b10 + // done_run::@10 + __b10: + // [695] if(done_run::ypos#2<$19) goto done_run::@11 -- vbuz1_lt_vbuc1_then_la1 + lda.z ypos + cmp #$19 + bcc __b11 + jmp __b12 + // done_run::@12 + __b12: + // [696] done_run::xcol#1 = ++ done_run::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [682] phi from done_run::@12 to done_run::@8 [phi:done_run::@12->done_run::@8] + __b8_from___b12: + // [682] phi done_run::gfx#4 = done_run::gfx#2 [phi:done_run::@12->done_run::@8#0] -- register_copy + // [682] phi done_run::xcol#2 = done_run::xcol#1 [phi:done_run::@12->done_run::@8#1] -- register_copy + jmp __b8 + // done_run::@11 + __b11: + // [697] done_run::pixels#0 = *done_run::gfx#2 -- vbuxx=_deref_pbuz1 + // Render 8px x 1px + ldy #0 + lda (gfx),y + tax + // [698] done_run::gfx#1 = ++ done_run::gfx#2 -- pbuz1=_inc_pbuz1 + inc.z gfx + bne !+ + inc.z gfx+1 + !: + // [699] render::xcol#0 = done_run::xcol#2 + // [700] render::ypos#0 = done_run::ypos#2 + // [701] render::pixels#0 = done_run::pixels#0 -- vbuz1=vbuxx + stx.z render.pixels + // [702] call render + // [997] phi from done_run::@11 to render [phi:done_run::@11->render] + render_from___b11: + // [997] phi render::pixels#4 = render::pixels#0 [phi:done_run::@11->render#0] -- register_copy + // [997] phi render::xcol#2 = render::xcol#0 [phi:done_run::@11->render#1] -- register_copy + // [997] phi render::ypos#2 = render::ypos#0 [phi:done_run::@11->render#2] -- register_copy + jsr render + jmp __b16 + // done_run::@16 + __b16: + // [703] done_run::ypos#1 = ++ done_run::ypos#2 -- vbuz1=_inc_vbuz1 + inc.z ypos + // [694] phi from done_run::@16 to done_run::@10 [phi:done_run::@16->done_run::@10] + __b10_from___b16: + // [694] phi done_run::gfx#2 = done_run::gfx#1 [phi:done_run::@16->done_run::@10#0] -- register_copy + // [694] phi done_run::ypos#2 = done_run::ypos#1 [phi:done_run::@16->done_run::@10#1] -- register_copy + jmp __b10 + // done_run::@1 + __b1: + // [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED -- pbuz1=pbuc1 + lda #WIN_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [705] call byteboozer_decrunch + // decrunch win graphics + jsr byteboozer_decrunch + jmp __b8_from___b1 + // done_run::@5 + __b5: + // [706] bobs_xcol[done_run::i1#2] = $a -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$a + sta bobs_xcol,x + // [707] bobs_yfine[done_run::i1#2] = $2d -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$2d + sta bobs_yfine,x + // [708] bobs_bob_id[done_run::i1#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta bobs_bob_id,x + // [709] done_run::i1#1 = ++ done_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [675] phi from done_run::@5 to done_run::@4 [phi:done_run::@5->done_run::@4] + __b4_from___b5: + // [675] phi done_run::i1#2 = done_run::i1#1 [phi:done_run::@5->done_run::@4#0] -- register_copy + jmp __b4 + // done_run::@3 + __b3: + // [710] ((byte*)SID)[done_run::i#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta SID,x + // [711] done_run::i#1 = ++ done_run::i#2 -- vbuxx=_inc_vbuxx + inx + // [673] phi from done_run::@3 to done_run::@2 [phi:done_run::@3->done_run::@2] + __b2_from___b3: + // [673] phi done_run::i#2 = done_run::i#1 [phi:done_run::@3->done_run::@2#0] -- register_copy + jmp __b2 +} + // spawn_all +// Spawn pacman and all ghosts +spawn_all: { + // [712] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // [713] pacman_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_substep + // [714] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + // [715] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + // [716] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + // [717] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + // [718] pacman_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z pacman_direction + // [719] ghost1_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost1_direction + // [720] ghost2_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost2_direction + // [721] ghost3_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost3_direction + // [722] ghost4_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost4_direction + // [723] pacman_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z pacman_xfine + // [724] ghost1_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost1_xfine + // [725] ghost2_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost2_xfine + // [726] ghost3_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost3_xfine + // [727] ghost4_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost4_xfine + // [728] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // [729] ghost2_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost2_yfine + // [730] ghost3_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost3_yfine + // [731] ghost4_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost4_yfine + // [732] pacman_yfine = $3e -- vbuz1=vbuc1 + lda #$3e + sta.z pacman_yfine + // [733] ghost1_respawn = $a -- vbuz1=vbuc1 + lda #$a + sta.z ghost1_respawn + // [734] ghost2_respawn = $14 -- vbuz1=vbuc1 + lda #$14 + sta.z ghost2_respawn + // [735] ghost3_respawn = $1e -- vbuz1=vbuc1 + lda #$1e + sta.z ghost3_respawn + // [736] ghost4_respawn = $28 -- vbuz1=vbuc1 + lda #$28 + sta.z ghost4_respawn + jmp __breturn + // spawn_all::@return + __breturn: + // [737] return + rts +} + // level_tile_directions +// Get the open directions at a given (xtile, ytile) position +// Returns the open DIRECTIONs as bits +// If xtile of ytile is outside the legal range the empty tile (0) is returned +// level_tile_directions(byte register(X) xtile, byte register(A) ytile) +level_tile_directions: { + .label ytiles = $5b + // [739] if(level_tile_directions::xtile#5>=$31+1) goto level_tile_directions::@return -- vbuxx_ge_vbuc1_then_la1 + cpx #$31+1 + bcs __breturn_from_level_tile_directions + jmp __b2 + // level_tile_directions::@2 + __b2: + // [740] if(level_tile_directions::ytile#5>=$24+1) goto level_tile_directions::@return -- vbuaa_ge_vbuc1_then_la1 + cmp #$24+1 + bcs __breturn_from___b2 + jmp __b1 + // level_tile_directions::@1 + __b1: + // [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 -- vbuaa=vbuaa_rol_1 + asl + // [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuaa + tay + clc + lda #LEVEL_TILES_DIRECTIONS + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] -- vbuaa=pbuz1_derefidx_vbuxx + txa + tay + lda (ytiles),y + // [744] phi from level_tile_directions::@1 to level_tile_directions::@return [phi:level_tile_directions::@1->level_tile_directions::@return] + __breturn_from___b1: + // [744] phi level_tile_directions::return#2 = level_tile_directions::return#0 [phi:level_tile_directions::@1->level_tile_directions::@return#0] -- register_copy + jmp __breturn + // [744] phi from level_tile_directions level_tile_directions::@2 to level_tile_directions::@return [phi:level_tile_directions/level_tile_directions::@2->level_tile_directions::@return] + __breturn_from_level_tile_directions: + __breturn_from___b2: + // [744] phi level_tile_directions::return#2 = 0 [phi:level_tile_directions/level_tile_directions::@2->level_tile_directions::@return#0] -- vbuaa=vbuc1 + lda #0 + jmp __breturn + // level_tile_directions::@return + __breturn: + // [745] return + rts +} + // choose_direction +// Choose the open direction that brings the ghost closest to the target +// Uses Manhattan distance calculation +// choose_direction(byte zp($4f) open_directions, byte register(Y) ghost_xtile, byte zp(4) ghost_ytile, byte register(X) target_xtile, byte zp(3) target_ytile) +choose_direction: { + .label open_directions = $4f + .label ghost_ytile = 4 + .label target_ytile = 3 + .label xdiff = $5d + .label ydiff = 4 + .label dist_left = $50 + .label return = $53 + .label direction = $53 + .label dist_min = $50 + // [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 -- vbuz1=vbuyy_minus_vbuxx + tya + stx.z $ff + sec + sbc.z $ff + sta.z xdiff + // [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 -- vbuz1=vbuz1_minus_vbuz2 + lda.z ydiff + sec + sbc.z target_ytile + sta.z ydiff + // [749] choose_direction::$2 = choose_direction::open_directions#10 & UP -- vbuaa=vbuz1_band_vbuc1 + lda #UP + and.z open_directions + // [750] if(0==choose_direction::$2) goto choose_direction::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b1_from_choose_direction + jmp __b5 + // choose_direction::@5 + __b5: + // [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] -- vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldy.z xdiff + lda ABS,y + ldy.z ydiff + clc + adc ABS+-1,y + tay + // [752] if(choose_direction::dist_up#0>=$ff) goto choose_direction::@1 -- vbuyy_ge_vbuc1_then_la1 + cpy #$ff + bcs __b1_from___b5 + // [753] phi from choose_direction::@5 to choose_direction::@6 [phi:choose_direction::@5->choose_direction::@6] + __b6_from___b5: + jmp __b6 + // choose_direction::@6 + __b6: + // [754] phi from choose_direction::@6 to choose_direction::@1 [phi:choose_direction::@6->choose_direction::@1] + __b1_from___b6: + // [754] phi choose_direction::direction#10 = UP [phi:choose_direction::@6->choose_direction::@1#0] -- vbuz1=vbuc1 + lda #UP + sta.z direction + // [754] phi choose_direction::dist_min#6 = choose_direction::dist_up#0 [phi:choose_direction::@6->choose_direction::@1#1] -- register_copy + jmp __b1 + // [754] phi from choose_direction choose_direction::@5 to choose_direction::@1 [phi:choose_direction/choose_direction::@5->choose_direction::@1] + __b1_from_choose_direction: + __b1_from___b5: + // [754] phi choose_direction::direction#10 = STOP [phi:choose_direction/choose_direction::@5->choose_direction::@1#0] -- vbuz1=vbuc1 + lda #STOP + sta.z direction + // [754] phi choose_direction::dist_min#6 = $ff [phi:choose_direction/choose_direction::@5->choose_direction::@1#1] -- vbuyy=vbuc1 + ldy #$ff + jmp __b1 + // choose_direction::@1 + __b1: + // [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN -- vbuaa=vbuz1_band_vbuc1 + lda #DOWN + and.z open_directions + // [756] if(0==choose_direction::$4) goto choose_direction::@10 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b10 + jmp __b7 + // choose_direction::@7 + __b7: + // [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] -- vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldx.z xdiff + lda ABS,x + ldx.z ydiff + clc + adc ABS+1,x + tax + // [758] if(choose_direction::dist_down#0>=choose_direction::dist_min#6) goto choose_direction::@11 -- vbuxx_ge_vbuyy_then_la1 + sty.z $ff + cpx.z $ff + bcs __b11 + // [760] phi from choose_direction::@7 to choose_direction::@2 [phi:choose_direction::@7->choose_direction::@2] + __b2_from___b7: + // [760] phi choose_direction::direction#8 = DOWN [phi:choose_direction::@7->choose_direction::@2#0] -- vbuz1=vbuc1 + lda #DOWN + sta.z direction + // [760] phi choose_direction::dist_min#10 = choose_direction::dist_down#0 [phi:choose_direction::@7->choose_direction::@2#1] -- register_copy + jmp __b2 + // choose_direction::@11 + __b11: + // [759] choose_direction::dist_min#14 = choose_direction::dist_min#6 -- vbuxx=vbuyy + tya + tax + // [760] phi from choose_direction::@10 choose_direction::@11 to choose_direction::@2 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2] + __b2_from___b10: + __b2_from___b11: + // [760] phi choose_direction::direction#8 = choose_direction::direction#10 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2#0] -- register_copy + // [760] phi choose_direction::dist_min#10 = choose_direction::dist_min#13 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2#1] -- register_copy + jmp __b2 + // choose_direction::@2 + __b2: + // [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT -- vbuaa=vbuz1_band_vbuc1 + lda #LEFT + and.z open_directions + // [762] if(0==choose_direction::$6) goto choose_direction::@12 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b12 + jmp __b8 + // choose_direction::@8 + __b8: + // [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] -- vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuz3 + ldy.z xdiff + lda ABS+-1,y + ldy.z ydiff + clc + adc ABS,y + sta.z dist_left + // [764] if(choose_direction::dist_left#0>=choose_direction::dist_min#10) goto choose_direction::@13 -- vbuz1_ge_vbuxx_then_la1 + lda.z dist_left + stx.z $ff + cmp.z $ff + bcs __b13 + // [766] phi from choose_direction::@8 to choose_direction::@3 [phi:choose_direction::@8->choose_direction::@3] + __b3_from___b8: + // [766] phi choose_direction::dist_min#11 = choose_direction::dist_left#0 [phi:choose_direction::@8->choose_direction::@3#0] -- register_copy + // [766] phi choose_direction::direction#6 = LEFT [phi:choose_direction::@8->choose_direction::@3#1] -- vbuz1=vbuc1 + lda #LEFT + sta.z direction + jmp __b3 + // choose_direction::@13 + __b13: + // [765] choose_direction::dist_min#18 = choose_direction::dist_min#10 -- vbuz1=vbuxx + stx.z dist_min + // [766] phi from choose_direction::@12 choose_direction::@13 to choose_direction::@3 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3] + __b3_from___b12: + __b3_from___b13: + // [766] phi choose_direction::dist_min#11 = choose_direction::dist_min#17 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3#0] -- register_copy + // [766] phi choose_direction::direction#6 = choose_direction::direction#8 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3#1] -- register_copy + jmp __b3 + // choose_direction::@3 + __b3: + // [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT -- vbuaa=vbuz1_band_vbuc1 + lda #RIGHT + and.z open_directions + // [768] if(0==choose_direction::$8) goto choose_direction::@4 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b4_from___b3 + jmp __b9 + // choose_direction::@9 + __b9: + // [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldy.z xdiff + lda ABS+1,y + ldy.z ydiff + clc + adc ABS,y + // [770] if(choose_direction::dist_right#0>=choose_direction::dist_min#11) goto choose_direction::@14 -- vbuaa_ge_vbuz1_then_la1 + cmp.z dist_min + bcs __b14_from___b9 + // [772] phi from choose_direction::@9 to choose_direction::@4 [phi:choose_direction::@9->choose_direction::@4] + __b4_from___b9: + // [772] phi choose_direction::return#10 = RIGHT [phi:choose_direction::@9->choose_direction::@4#0] -- vbuz1=vbuc1 + lda #RIGHT + sta.z return + jmp __b4 + // [771] phi from choose_direction::@9 to choose_direction::@14 [phi:choose_direction::@9->choose_direction::@14] + __b14_from___b9: + jmp __b14 + // choose_direction::@14 + __b14: + // [772] phi from choose_direction::@14 choose_direction::@3 to choose_direction::@4 [phi:choose_direction::@14/choose_direction::@3->choose_direction::@4] + __b4_from___b14: + __b4_from___b3: + // [772] phi choose_direction::return#10 = choose_direction::direction#6 [phi:choose_direction::@14/choose_direction::@3->choose_direction::@4#0] -- register_copy + jmp __b4 + // choose_direction::@4 + __b4: + jmp __breturn + // choose_direction::@return + __breturn: + // [773] return + rts + // choose_direction::@12 + __b12: + // [774] choose_direction::dist_min#17 = choose_direction::dist_min#10 -- vbuz1=vbuxx + stx.z dist_min + jmp __b3_from___b12 + // choose_direction::@10 + __b10: + // [775] choose_direction::dist_min#13 = choose_direction::dist_min#6 -- vbuxx=vbuyy + tya + tax + jmp __b2_from___b10 +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp($63) str, word zp($59) num) +memset: { + .label end = $59 + .label dst = $63 + .label num = $59 + .label str = $63 + // [777] if(memset::num#5<=0) goto memset::@return -- vwuz1_le_0_then_la1 + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + jmp __b1 + // memset::@1 + __b1: + // [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 -- pbuz1=pbuz2_plus_vwuz1 + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + // [779] memset::dst#4 = (byte*)memset::str#6 + // [780] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2] + __b2_from___b1: + __b2_from___b3: + // [780] phi memset::dst#2 = memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy + jmp __b2 + // memset::@2 + __b2: + // [781] if(memset::dst#2!=memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + jmp __breturn + // memset::@return + __breturn: + // [782] return + rts + // memset::@3 + __b3: + // [783] *memset::dst#2 = 0 -- _deref_pbuz1=vbuc1 + lda #0 + ldy #0 + sta (dst),y + // [784] memset::dst#1 = ++ memset::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2_from___b3 +} + // byteboozer_decrunch +// Decrunch crunched data using ByteBoozer +// - crunched: Pointer to the start of the crunched data +// byteboozer_decrunch(byte* zp($57) crunched) +byteboozer_decrunch: { + .label crunched = $57 + // asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } + ldy crunched + ldx crunched+1 + jsr b2.Decrunch + jmp __breturn + // byteboozer_decrunch::@return + __breturn: + // [786] return + rts +} + // merge_code +// Merge unrolled cycle-exact logic code into an unrolled cycle-exact raster code. +// The logic-code is merged into the raster code ensuring cycle-exact execution. If a logic-code block does not fit within the remaining cycle-budget of a raster-slot then NOPs/BIT $EA are used to reach the cycle-budget. +// If the logic-code runs out before the raster-code ends then the remaining raster-slots are filled with NOP/BIT$EA. +// If the raster-code runs out before the logic-code then the rest of the logic-code is added at the end. +// An RTS is added at the very end. +// +// Parameters: +// - dest_code: Address where the merged code is placed +// - raster_code: The unrolled raster code blocks with information about cycles to be filled. Format is decribed below. +// - logic_code: The unrolled logic code with information about cycles spent. Format is decribed below. +// +// Format of unrolled raster code. +// A number of blocks that have the following structure: +// * 0xff +// * : some bytes of code. any number of bytes are allowed. +// 0xff : signals the end of a block. +// : If is 00 then this is the last block of the unrolled raster code. +// If is non-zero it means that cycles must be spent here (the cycle budget of the slot). The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed. +// +// Format of unrolled logic code. +// A number of blocks that has the following structure: +// * 0xff +// : If is 00 then this is the last block of the unrolled logic code. No more bytes are used. +// If is non-zero it holds the number of cycles used by the block of code. +// * : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by +// 0xff : signals the end of a block. +// merge_code(byte* zp($b) dest_code, byte* zp($63) raster_code, byte* zp($59) logic_code) +merge_code: { + // Cycle-count signalling the last block of the logic-code + .const LOGIC_EXIT = 0 + // Value signalling the end of a block of the logic-code + .const LOGIC_END = $ff + // Cycle-count signalling the last block of the raster-code + .const RASTER_EXIT = 0 + // Value signalling the end of a block of the raster-code + .const RASTER_END = $ff + .label dest_code = $b + .label raster_code = $63 + .label logic_cycles = $60 + .label logic_code = $59 + // [788] phi from merge_code to merge_code::@1 [phi:merge_code->merge_code::@1] + __b1_from_merge_code: + // [788] phi merge_code::logic_code#18 = LOGIC_CODE_UNMERGED [phi:merge_code->merge_code::@1#0] -- pbuz1=pbuc1 + lda #LOGIC_CODE_UNMERGED + sta.z logic_code+1 + // [788] phi merge_code::dest_code#14 = RASTER_CODE [phi:merge_code->merge_code::@1#1] -- pbuz1=pbuc1 + lda #RASTER_CODE + sta.z dest_code+1 + // [788] phi merge_code::raster_code#4 = RASTER_CODE_UNMERGED [phi:merge_code->merge_code::@1#2] -- pbuz1=pbuc1 + lda #RASTER_CODE_UNMERGED + sta.z raster_code+1 + jmp __b1 + // Output raster code until meeting RASTER_END signalling the end of a block + // merge_code::@1 + __b1: + // [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (raster_code),y + cmp #RASTER_END + bne __b2 + jmp __b3 + // merge_code::@3 + __b3: + // [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 -- vbuxx=_deref_pbuz1 + // Find the number of cycles + ldy #0 + lda (raster_code),y + tax + // [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // [793] if(merge_code::cycle_budget#0!=merge_code::RASTER_EXIT) goto merge_code::@4 -- vbuxx_neq_vbuc1_then_la1 + cpx #RASTER_EXIT + bne __b4_from___b3 + // [794] phi from merge_code::@19 merge_code::@3 to merge_code::@14 [phi:merge_code::@19/merge_code::@3->merge_code::@14] + __b14_from___b19: + __b14_from___b3: + // [794] phi merge_code::dest_code#12 = merge_code::dest_code#13 [phi:merge_code::@19/merge_code::@3->merge_code::@14#0] -- register_copy + // [794] phi merge_code::logic_code#12 = merge_code::logic_code#5 [phi:merge_code::@19/merge_code::@3->merge_code::@14#1] -- register_copy + jmp __b14 + // No more raster code - fill in the rest of the logic code + // merge_code::@14 + __b14: + // [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_EXIT + bne __b15 + jmp __b16 + // merge_code::@16 + __b16: + // [796] *merge_code::dest_code#12 = $60 -- _deref_pbuz1=vbuc1 + // And add an RTS + lda #$60 + ldy #0 + sta (dest_code),y + jmp __breturn + // merge_code::@return + __breturn: + // [797] return + rts + // merge_code::@15 + __b15: + // [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // [799] phi from merge_code::@15 merge_code::@18 to merge_code::@17 [phi:merge_code::@15/merge_code::@18->merge_code::@17] + __b17_from___b15: + __b17_from___b18: + // [799] phi merge_code::dest_code#13 = merge_code::dest_code#12 [phi:merge_code::@15/merge_code::@18->merge_code::@17#0] -- register_copy + // [799] phi merge_code::logic_code#14 = merge_code::logic_code#3 [phi:merge_code::@15/merge_code::@18->merge_code::@17#1] -- register_copy + jmp __b17 + // Fill in the logic-code + // merge_code::@17 + __b17: + // [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b18 + jmp __b19 + // merge_code::@19 + __b19: + // [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b14_from___b19 + // merge_code::@18 + __b18: + // [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (logic_code),y + ldy #0 + sta (dest_code),y + // [803] merge_code::dest_code#6 = ++ merge_code::dest_code#13 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [804] merge_code::logic_code#4 = ++ merge_code::logic_code#14 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b17_from___b18 + // Fit the cycle budget with logic-code + // [805] phi from merge_code::@3 merge_code::@8 to merge_code::@4 [phi:merge_code::@3/merge_code::@8->merge_code::@4] + __b4_from___b3: + __b4_from___b8: + // [805] phi merge_code::dest_code#21 = merge_code::dest_code#14 [phi:merge_code::@3/merge_code::@8->merge_code::@4#0] -- register_copy + // [805] phi merge_code::logic_code#17 = merge_code::logic_code#18 [phi:merge_code::@3/merge_code::@8->merge_code::@4#1] -- register_copy + // [805] phi merge_code::cycle_budget#13 = merge_code::cycle_budget#0 [phi:merge_code::@3/merge_code::@8->merge_code::@4#2] -- register_copy + jmp __b4 + // merge_code::@4 + __b4: + // [806] if(merge_code::cycle_budget#13<=0) goto merge_code::@10 -- vbuxx_le_0_then_la1 + cpx #0 + beq __b10_from___b4 + jmp __b5 + // merge_code::@5 + __b5: + // [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 -- vbuz1=_deref_pbuz2 + // Find the number of logic code cycles + ldy #0 + lda (logic_code),y + sta.z logic_cycles + // [808] merge_code::$5 = merge_code::cycle_budget#13 - 1 -- vbuyy=vbuxx_minus_1 + txa + tay + dey + // [809] if(merge_code::logic_cycles#0!=merge_code::LOGIC_EXIT) goto merge_code::@20 -- vbuz1_neq_vbuc1_then_la1 + lda #LOGIC_EXIT + cmp.z logic_cycles + bne __b20 + // [810] phi from merge_code::@12 merge_code::@13 merge_code::@4 merge_code::@5 to merge_code::@10 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10] + __b10_from___b12: + __b10_from___b13: + __b10_from___b4: + __b10_from___b5: + // [810] phi merge_code::dest_code#10 = merge_code::dest_code#3 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10#0] -- register_copy + // [810] phi merge_code::cycle_budget#10 = merge_code::cycle_budget#2 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10#1] -- register_copy + jmp __b10 + // Fit the cycle budget with NOPs + // merge_code::@10 + __b10: + // [811] if(merge_code::cycle_budget#10>0) goto merge_code::@11 -- vbuxx_gt_0_then_la1 + cpx #0 + bne __b11 + // [788] phi from merge_code::@10 merge_code::@2 to merge_code::@1 [phi:merge_code::@10/merge_code::@2->merge_code::@1] + __b1_from___b10: + __b1_from___b2: + // [788] phi merge_code::logic_code#18 = merge_code::logic_code#17 [phi:merge_code::@10/merge_code::@2->merge_code::@1#0] -- register_copy + // [788] phi merge_code::dest_code#14 = merge_code::dest_code#10 [phi:merge_code::@10/merge_code::@2->merge_code::@1#1] -- register_copy + // [788] phi merge_code::raster_code#4 = merge_code::raster_code#2 [phi:merge_code::@10/merge_code::@2->merge_code::@1#2] -- register_copy + jmp __b1 + // merge_code::@11 + __b11: + // [812] if(merge_code::cycle_budget#10==3) goto merge_code::@12 -- vbuxx_eq_vbuc1_then_la1 + cpx #3 + beq __b12 + jmp __b13 + // merge_code::@13 + __b13: + // [813] *merge_code::dest_code#10 = $ea -- _deref_pbuz1=vbuc1 + lda #$ea + ldy #0 + sta (dest_code),y + // [814] merge_code::dest_code#4 = ++ merge_code::dest_code#10 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [815] merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 -- vbuxx=vbuxx_minus_2 + // NOP + dex + dex + jmp __b10_from___b13 + // merge_code::@12 + __b12: + // [816] *merge_code::dest_code#10 = $24 -- _deref_pbuz1=vbuc1 + lda #$24 + ldy #0 + sta (dest_code),y + // [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [818] *merge_code::dest_code#2 = $ea -- _deref_pbuz1=vbuc1 + // BIT $EA + lda #$ea + ldy #0 + sta (dest_code),y + // [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 -- vbuxx=vbuxx_minus_vbuc1 + txa + axs #3 + jmp __b10_from___b12 + // merge_code::@20 + __b20: + // [821] if(merge_code::logic_cycles#0merge_code::@10] + __b10_from___b21: + jmp __b10 + // merge_code::@9 + __b9: + // [823] merge_code::logic_code#0 = ++ merge_code::logic_code#17 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // [824] phi from merge_code::@7 merge_code::@9 to merge_code::@6 [phi:merge_code::@7/merge_code::@9->merge_code::@6] + __b6_from___b7: + __b6_from___b9: + // [824] phi merge_code::dest_code#15 = merge_code::dest_code#1 [phi:merge_code::@7/merge_code::@9->merge_code::@6#0] -- register_copy + // [824] phi merge_code::logic_code#10 = merge_code::logic_code#1 [phi:merge_code::@7/merge_code::@9->merge_code::@6#1] -- register_copy + jmp __b6 + // Fill in the logic-code + // merge_code::@6 + __b6: + // [825] if(*merge_code::logic_code#10!=merge_code::LOGIC_END) goto merge_code::@7 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b7 + jmp __b8 + // merge_code::@8 + __b8: + // [826] merge_code::logic_code#2 = ++ merge_code::logic_code#10 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // [827] merge_code::cycle_budget#1 = merge_code::cycle_budget#13 - merge_code::logic_cycles#0 -- vbuxx=vbuxx_minus_vbuz1 + // Reduce the cycle budget + txa + sec + sbc.z logic_cycles + tax + jmp __b4_from___b8 + // merge_code::@7 + __b7: + // [828] *merge_code::dest_code#15 = *merge_code::logic_code#10 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (logic_code),y + ldy #0 + sta (dest_code),y + // [829] merge_code::dest_code#1 = ++ merge_code::dest_code#15 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [830] merge_code::logic_code#1 = ++ merge_code::logic_code#10 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b6_from___b7 + // merge_code::@2 + __b2: + // [831] *merge_code::dest_code#14 = *merge_code::raster_code#4 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (raster_code),y + ldy #0 + sta (dest_code),y + // [832] merge_code::dest_code#0 = ++ merge_code::dest_code#14 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [833] merge_code::raster_code#0 = ++ merge_code::raster_code#4 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + jmp __b1_from___b2 +} + // init_render_index +// Initialize the RENDER_INDEX table from sub-tables +init_render_index: { + .label __10 = $61 + .label __11 = $61 + .label render_index_xcol = $59 + .label canvas_xcol = $5e + .label canvas = $61 + .label render_index = $59 + .label x_col = 5 + .label render_index_xcol_1 = $63 + .label y_pos = 6 + // Special column in sprite#9 + .label render_ypos_table = $b + .label __12 = $61 + // [835] phi from init_render_index to init_render_index::@1 [phi:init_render_index->init_render_index::@1] + __b1_from_init_render_index: + // [835] phi init_render_index::render_index_xcol#0 = RENDER_INDEX [phi:init_render_index->init_render_index::@1#0] -- pbuz1=pbuc1 + lda #RENDER_INDEX + sta.z render_index_xcol+1 + // [835] phi init_render_index::x_col#2 = 0 [phi:init_render_index->init_render_index::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z x_col + jmp __b1 + // init_render_index::@1 + __b1: + // [836] if(init_render_index::x_col#2<$1a) goto init_render_index::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z x_col + cmp #$1a + bcc __b2 + jmp __b3 + // init_render_index::@3 + __b3: + // [837] *(RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC) = 0 -- _deref_pbuc1=vbuc2 + // Fix the first entry of the inc_offset in the last column (set it to point to 0,0,6,6...) + lda #0 + sta RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC + // [838] *(RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC + jmp __breturn + // init_render_index::@return + __breturn: + // [839] return + rts + // init_render_index::@2 + __b2: + // [840] if(init_render_index::x_col#2<$18) goto init_render_index::@4 -- vbuz1_lt_vbuc1_then_la1 + lda.z x_col + cmp #$18 + bcc __b4_from___b2 + // [841] phi from init_render_index::@2 to init_render_index::@10 [phi:init_render_index::@2->init_render_index::@10] + __b10_from___b2: + jmp __b10 + // init_render_index::@10 + __b10: + // [842] phi from init_render_index::@10 to init_render_index::@4 [phi:init_render_index::@10->init_render_index::@4] + __b4_from___b10: + // [842] phi init_render_index::ypos_inc_offset#7 = $b [phi:init_render_index::@10->init_render_index::@4#0] -- vbuxx=vbuc1 + ldx #$b + // [842] phi init_render_index::render_ypos_table#4 = RENDER_YPOS_9TH [phi:init_render_index::@10->init_render_index::@4#1] -- pwuz1=pwuc1 + lda #RENDER_YPOS_9TH + sta.z render_ypos_table+1 + jmp __b4 + // [842] phi from init_render_index::@2 to init_render_index::@4 [phi:init_render_index::@2->init_render_index::@4] + __b4_from___b2: + // [842] phi init_render_index::ypos_inc_offset#7 = 0 [phi:init_render_index::@2->init_render_index::@4#0] -- vbuxx=vbuc1 + ldx #0 + // [842] phi init_render_index::render_ypos_table#4 = RENDER_YPOS [phi:init_render_index::@2->init_render_index::@4#1] -- pwuz1=pwuc1 + lda #RENDER_YPOS + sta.z render_ypos_table+1 + jmp __b4 + // init_render_index::@4 + __b4: + // [843] init_render_index::$9 = init_render_index::x_col#2 << 1 -- vbuaa=vbuz1_rol_1 + lda.z x_col + asl + // [844] init_render_index::canvas_xcol#0 = RENDER_XCOLS[init_render_index::$9] -- pbuz1=qbuc1_derefidx_vbuaa + tay + lda RENDER_XCOLS,y + sta.z canvas_xcol + lda RENDER_XCOLS+1,y + sta.z canvas_xcol+1 + // [845] init_render_index::render_index_xcol#7 = init_render_index::render_index_xcol#0 -- pbuz1=pbuz2 + lda.z render_index_xcol + sta.z render_index_xcol_1 + lda.z render_index_xcol+1 + sta.z render_index_xcol_1+1 + // [846] phi from init_render_index::@4 to init_render_index::@5 [phi:init_render_index::@4->init_render_index::@5] + __b5_from___b4: + // [846] phi init_render_index::ypos_inc_offset#4 = init_render_index::ypos_inc_offset#7 [phi:init_render_index::@4->init_render_index::@5#0] -- register_copy + // [846] phi init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#7 [phi:init_render_index::@4->init_render_index::@5#1] -- register_copy + // [846] phi init_render_index::y_pos#2 = 0 [phi:init_render_index::@4->init_render_index::@5#2] -- vbuz1=vbuc1 + lda #0 + sta.z y_pos + jmp __b5 + // init_render_index::@5 + __b5: + // [847] if(init_render_index::y_pos#2<$94) goto init_render_index::@6 -- vbuz1_lt_vbuc1_then_la1 + lda.z y_pos + cmp #$94 + bcc __b6 + jmp __b7 + // init_render_index::@7 + __b7: + // [848] init_render_index::render_index#1 = init_render_index::render_index_xcol#0 + $100 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z render_index + adc #<$100 + sta.z render_index + lda.z render_index+1 + adc #>$100 + sta.z render_index+1 + // [849] init_render_index::x_col#1 = ++ init_render_index::x_col#2 -- vbuz1=_inc_vbuz1 + inc.z x_col + // [835] phi from init_render_index::@7 to init_render_index::@1 [phi:init_render_index::@7->init_render_index::@1] + __b1_from___b7: + // [835] phi init_render_index::render_index_xcol#0 = init_render_index::render_index#1 [phi:init_render_index::@7->init_render_index::@1#0] -- register_copy + // [835] phi init_render_index::x_col#2 = init_render_index::x_col#1 [phi:init_render_index::@7->init_render_index::@1#1] -- register_copy + jmp __b1 + // init_render_index::@6 + __b6: + // [850] init_render_index::$11 = (word)init_render_index::y_pos#2 -- vwuz1=_word_vbuz2 + lda.z y_pos + sta.z __11 + lda #0 + sta.z __11+1 + // [851] init_render_index::$10 = init_render_index::$11 << 1 -- vwuz1=vwuz1_rol_1 + asl.z __10 + rol.z __10+1 + // [852] init_render_index::$12 = init_render_index::render_ypos_table#4 + init_render_index::$10 -- pwuz1=pwuz2_plus_vwuz1 + lda.z __12 + clc + adc.z render_ypos_table + sta.z __12 + lda.z __12+1 + adc.z render_ypos_table+1 + sta.z __12+1 + // [853] init_render_index::canvas#0 = init_render_index::canvas_xcol#0 + *init_render_index::$12 -- pbuz1=pbuz2_plus__deref_pwuz1 + ldy #0 + clc + lda (canvas),y + adc.z canvas_xcol + pha + iny + lda (canvas),y + adc.z canvas_xcol+1 + sta.z canvas+1 + pla + sta.z canvas + // [854] init_render_index::$5 = < init_render_index::canvas#0 -- vbuaa=_lo_pbuz1 + lda.z canvas + // [855] *init_render_index::render_index_xcol#2 = init_render_index::$5 -- _deref_pbuz1=vbuaa + ldy #0 + sta (render_index_xcol_1),y + // [856] init_render_index::$6 = > init_render_index::canvas#0 -- vbuaa=_hi_pbuz1 + lda.z canvas+1 + // [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 -- pbuz1_derefidx_vbuc1=vbuaa + ldy #RENDER_OFFSET_CANVAS_HI + sta (render_index_xcol_1),y + // [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 -- pbuz1_derefidx_vbuc1=vbuxx + ldy #RENDER_OFFSET_YPOS_INC + txa + sta (render_index_xcol_1),y + // [859] init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 -- vbuxx=vbuxx_plus_2 + inx + inx + // [860] if(init_render_index::ypos_inc_offset#2<$17) goto init_render_index::@8 -- vbuxx_lt_vbuc1_then_la1 + cpx #$17 + bcc __b8_from___b6 + jmp __b9 + // init_render_index::@9 + __b9: + // [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 -- vbuxx=vbuxx_minus_vbuc1 + txa + axs #$15 + // [862] phi from init_render_index::@6 init_render_index::@9 to init_render_index::@8 [phi:init_render_index::@6/init_render_index::@9->init_render_index::@8] + __b8_from___b6: + __b8_from___b9: + // [862] phi init_render_index::ypos_inc_offset#8 = init_render_index::ypos_inc_offset#2 [phi:init_render_index::@6/init_render_index::@9->init_render_index::@8#0] -- register_copy + jmp __b8 + // init_render_index::@8 + __b8: + // [863] init_render_index::render_index_xcol#1 = ++ init_render_index::render_index_xcol#2 -- pbuz1=_inc_pbuz1 + inc.z render_index_xcol_1 + bne !+ + inc.z render_index_xcol_1+1 + !: + // [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 -- vbuz1=vbuz1_plus_2 + lda.z y_pos + clc + adc #2 + sta.z y_pos + // [846] phi from init_render_index::@8 to init_render_index::@5 [phi:init_render_index::@8->init_render_index::@5] + __b5_from___b8: + // [846] phi init_render_index::ypos_inc_offset#4 = init_render_index::ypos_inc_offset#8 [phi:init_render_index::@8->init_render_index::@5#0] -- register_copy + // [846] phi init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#1 [phi:init_render_index::@8->init_render_index::@5#1] -- register_copy + // [846] phi init_render_index::y_pos#2 = init_render_index::y_pos#1 [phi:init_render_index::@8->init_render_index::@5#2] -- register_copy + jmp __b5 +} + // splash_show +// Show the splash screen +splash_show: { + // Show splash screen + .label splash = $63 + .label ypos = 6 + .label xcol = 5 + // [866] phi from splash_show to splash_show::@1 [phi:splash_show->splash_show::@1] + __b1_from_splash_show: + // [866] phi splash_show::splash#4 = SPLASH [phi:splash_show->splash_show::@1#0] -- pbuz1=pbuc1 + lda #SPLASH + sta.z splash+1 + // [866] phi splash_show::xcol#2 = 0 [phi:splash_show->splash_show::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z xcol + jmp __b1 + // splash_show::@1 + __b1: + // [867] if(splash_show::xcol#2<$19) goto splash_show::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b2_from___b1 + jmp __breturn + // splash_show::@return + __breturn: + // [868] return + rts + // [869] phi from splash_show::@1 to splash_show::@2 [phi:splash_show::@1->splash_show::@2] + __b2_from___b1: + // [869] phi splash_show::splash#2 = splash_show::splash#4 [phi:splash_show::@1->splash_show::@2#0] -- register_copy + // [869] phi splash_show::ypos#2 = 0 [phi:splash_show::@1->splash_show::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z ypos + jmp __b2 + // splash_show::@2 + __b2: + // [870] if(splash_show::ypos#2<$93) goto splash_show::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z ypos + cmp #$93 + bcc __b3 + jmp __b4 + // splash_show::@4 + __b4: + // [871] splash_show::xcol#1 = ++ splash_show::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [866] phi from splash_show::@4 to splash_show::@1 [phi:splash_show::@4->splash_show::@1] + __b1_from___b4: + // [866] phi splash_show::splash#4 = splash_show::splash#2 [phi:splash_show::@4->splash_show::@1#0] -- register_copy + // [866] phi splash_show::xcol#2 = splash_show::xcol#1 [phi:splash_show::@4->splash_show::@1#1] -- register_copy + jmp __b1 + // splash_show::@3 + __b3: + // [872] splash_show::pixels#0 = *splash_show::splash#2 -- vbuxx=_deref_pbuz1 + // Render 8px x 1px + ldy #0 + lda (splash),y + tax + // [873] splash_show::splash#1 = ++ splash_show::splash#2 -- pbuz1=_inc_pbuz1 + inc.z splash + bne !+ + inc.z splash+1 + !: + // [874] render::xcol#1 = splash_show::xcol#2 + // [875] render::ypos#1 = splash_show::ypos#2 + // [876] render::pixels#1 = splash_show::pixels#0 -- vbuz1=vbuxx + stx.z render.pixels + // [877] call render + // [997] phi from splash_show::@3 to render [phi:splash_show::@3->render] + render_from___b3: + // [997] phi render::pixels#4 = render::pixels#1 [phi:splash_show::@3->render#0] -- register_copy + // [997] phi render::xcol#2 = render::xcol#1 [phi:splash_show::@3->render#1] -- register_copy + // [997] phi render::ypos#2 = render::ypos#1 [phi:splash_show::@3->render#2] -- register_copy + jsr render + jmp __b5 + // splash_show::@5 + __b5: + // [878] splash_show::ypos#1 = ++ splash_show::ypos#2 -- vbuz1=_inc_vbuz1 + inc.z ypos + // [869] phi from splash_show::@5 to splash_show::@2 [phi:splash_show::@5->splash_show::@2] + __b2_from___b5: + // [869] phi splash_show::splash#2 = splash_show::splash#1 [phi:splash_show::@5->splash_show::@2#0] -- register_copy + // [869] phi splash_show::ypos#2 = splash_show::ypos#1 [phi:splash_show::@5->splash_show::@2#1] -- register_copy + jmp __b2 +} + // init_bobs_restore +// Initialize bobs_restore with data to prevent crash on the first call +init_bobs_restore: { + .label CANVAS_HIDDEN = $ea00 + .label bob_restore = $b + // [880] phi from init_bobs_restore to init_bobs_restore::@1 [phi:init_bobs_restore->init_bobs_restore::@1] + __b1_from_init_bobs_restore: + // [880] phi init_bobs_restore::bob_restore#5 = bobs_restore [phi:init_bobs_restore->init_bobs_restore::@1#0] -- pbuz1=pbuc1 + lda #bobs_restore + sta.z bob_restore+1 + // [880] phi init_bobs_restore::bob#2 = 0 [phi:init_bobs_restore->init_bobs_restore::@1#1] -- vbuxx=vbuc1 + ldx #0 + jmp __b1 + // init_bobs_restore::@1 + __b1: + // [881] if(init_bobs_restore::bob#2LEVEL_TILES+$40*$12+$c + sta.z logic_tile_ptr+1 + // [883] logic_tile_xcol = $c -- vbuz1=vbuc1 + lda #$c + sta.z logic_tile_xcol + // [884] logic_tile_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z logic_tile_yfine + jmp __breturn + // init_bobs_restore::@return + __breturn: + // [885] return + rts + // [886] phi from init_bobs_restore::@1 to init_bobs_restore::@3 [phi:init_bobs_restore::@1->init_bobs_restore::@3] + __b3_from___b1: + // [886] phi init_bobs_restore::i#2 = 0 [phi:init_bobs_restore::@1->init_bobs_restore::@3#0] -- vbuyy=vbuc1 + ldy #0 + jmp __b3 + // init_bobs_restore::@3 + __b3: + // [887] if(init_bobs_restore::i#2init_bobs_restore::CANVAS_HIDDEN -- pbuz1_derefidx_vbuc1=vbuc2 + lda #>CANVAS_HIDDEN + ldy #1 + sta (bob_restore),y + // [890] init_bobs_restore::bob_restore#5[3] = 0 -- pbuz1_derefidx_vbuc1=vbuc2 + lda #0 + ldy #3 + sta (bob_restore),y + // [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN -- pbuz1_derefidx_vbuc1=vbuc2 + lda #>CANVAS_HIDDEN + ldy #4 + sta (bob_restore),y + // [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE -- pbuz1=pbuz1_plus_vbuc1 + lda #SIZE_BOB_RESTORE + clc + adc.z bob_restore + sta.z bob_restore + bcc !+ + inc.z bob_restore+1 + !: + // [893] init_bobs_restore::bob#1 = ++ init_bobs_restore::bob#2 -- vbuxx=_inc_vbuxx + inx + // [880] phi from init_bobs_restore::@5 to init_bobs_restore::@1 [phi:init_bobs_restore::@5->init_bobs_restore::@1] + __b1_from___b5: + // [880] phi init_bobs_restore::bob_restore#5 = init_bobs_restore::bob_restore#1 [phi:init_bobs_restore::@5->init_bobs_restore::@1#0] -- register_copy + // [880] phi init_bobs_restore::bob#2 = init_bobs_restore::bob#1 [phi:init_bobs_restore::@5->init_bobs_restore::@1#1] -- register_copy + jmp __b1 + // init_bobs_restore::@4 + __b4: + // [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 -- pbuz1_derefidx_vbuyy=vbuc1 + lda #0 + sta (bob_restore),y + // [895] init_bobs_restore::i#1 = ++ init_bobs_restore::i#2 -- vbuyy=_inc_vbuyy + iny + // [886] phi from init_bobs_restore::@4 to init_bobs_restore::@3 [phi:init_bobs_restore::@4->init_bobs_restore::@3] + __b3_from___b4: + // [886] phi init_bobs_restore::i#2 = init_bobs_restore::i#1 [phi:init_bobs_restore::@4->init_bobs_restore::@3#0] -- register_copy + jmp __b3 +} + // init_sprite_pointers +// Initialize sprite pointers on all screens (in both graphics banks) +init_sprite_pointers: { + .const SPRITE_ID_0 = $ff&(SPRITES_1&$3fff)/$40 + .label sprites_ptr_1 = $b + .label sprites_ptr_2 = 9 + // [897] phi from init_sprite_pointers to init_sprite_pointers::@1 [phi:init_sprite_pointers->init_sprite_pointers::@1] + __b1_from_init_sprite_pointers: + // [897] phi init_sprite_pointers::sprites_ptr_2#5 = SCREENS_2+OFFSET_SPRITE_PTRS [phi:init_sprite_pointers->init_sprite_pointers::@1#0] -- pbuz1=pbuc1 + lda #SCREENS_2+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_2+1 + // [897] phi init_sprite_pointers::sprites_ptr_1#5 = SCREENS_1+OFFSET_SPRITE_PTRS [phi:init_sprite_pointers->init_sprite_pointers::@1#1] -- pbuz1=pbuc1 + lda #SCREENS_1+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_1+1 + // [897] phi init_sprite_pointers::screen#2 = 0 [phi:init_sprite_pointers->init_sprite_pointers::@1#2] -- vbuxx=vbuc1 + ldx #0 + jmp __b1 + // init_sprite_pointers::@1 + __b1: + // [898] if(init_sprite_pointers::screen#2<$e) goto init_sprite_pointers::@2 -- vbuxx_lt_vbuc1_then_la1 + cpx #$e + bcc __b2_from___b1 + jmp __breturn + // init_sprite_pointers::@return + __breturn: + // [899] return + rts + // [900] phi from init_sprite_pointers::@1 to init_sprite_pointers::@2 [phi:init_sprite_pointers::@1->init_sprite_pointers::@2] + __b2_from___b1: + // [900] phi init_sprite_pointers::sprite#2 = 0 [phi:init_sprite_pointers::@1->init_sprite_pointers::@2#0] -- vbuyy=vbuc1 + ldy #0 + jmp __b2 + // init_sprite_pointers::@2 + __b2: + // [901] if(init_sprite_pointers::sprite#2<8) goto init_sprite_pointers::@3 -- vbuyy_lt_vbuc1_then_la1 + cpy #8 + bcc __b3 + jmp __b4 + // init_sprite_pointers::@4 + __b4: + // [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z sprites_ptr_1 + adc #<$400 + sta.z sprites_ptr_1 + lda.z sprites_ptr_1+1 + adc #>$400 + sta.z sprites_ptr_1+1 + // [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z sprites_ptr_2 + adc #<$400 + sta.z sprites_ptr_2 + lda.z sprites_ptr_2+1 + adc #>$400 + sta.z sprites_ptr_2+1 + // [904] init_sprite_pointers::screen#1 = ++ init_sprite_pointers::screen#2 -- vbuxx=_inc_vbuxx + inx + // [897] phi from init_sprite_pointers::@4 to init_sprite_pointers::@1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1] + __b1_from___b4: + // [897] phi init_sprite_pointers::sprites_ptr_2#5 = init_sprite_pointers::sprites_ptr_2#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#0] -- register_copy + // [897] phi init_sprite_pointers::sprites_ptr_1#5 = init_sprite_pointers::sprites_ptr_1#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#1] -- register_copy + // [897] phi init_sprite_pointers::screen#2 = init_sprite_pointers::screen#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#2] -- register_copy + jmp __b1 + // init_sprite_pointers::@3 + __b3: + // [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 -- vbuaa=vbuc1_plus_vbuxx + txa + clc + adc #SPRITE_ID_0 + // [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] -- vbuaa=vbuaa_plus_pbuc1_derefidx_vbuyy + clc + adc sprites_id,y + // [907] init_sprite_pointers::sprites_ptr_1#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 -- pbuz1_derefidx_vbuyy=vbuaa + sta (sprites_ptr_1),y + // [908] init_sprite_pointers::sprites_ptr_2#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 -- pbuz1_derefidx_vbuyy=vbuaa + sta (sprites_ptr_2),y + // [909] init_sprite_pointers::sprite#1 = ++ init_sprite_pointers::sprite#2 -- vbuyy=_inc_vbuyy + iny + // [900] phi from init_sprite_pointers::@3 to init_sprite_pointers::@2 [phi:init_sprite_pointers::@3->init_sprite_pointers::@2] + __b2_from___b3: + // [900] phi init_sprite_pointers::sprite#2 = init_sprite_pointers::sprite#1 [phi:init_sprite_pointers::@3->init_sprite_pointers::@2#0] -- register_copy + jmp __b2 + .segment Data + sprites_id: .byte 0, $70, $60, $50, $40, $30, $20, $10 +} +.segment Code + // memcpy +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = INTRO_MUSIC_CRUNCHED_UPPER + .label source = INTRO_MUSIC_CRUNCHED + .label src_end = source+INTRO_MUSIC_CRUNCHED_SIZE + .label dst = $b + .label src = 9 + // [911] phi from memcpy to memcpy::@1 [phi:memcpy->memcpy::@1] + __b1_from_memcpy: + // [911] phi memcpy::dst#2 = (byte*)memcpy::destination#0 [phi:memcpy->memcpy::@1#0] -- pbuz1=pbuc1 + lda #destination + sta.z dst+1 + // [911] phi memcpy::src#2 = (byte*)memcpy::source#0 [phi:memcpy->memcpy::@1#1] -- pbuz1=pbuc1 + lda #source + sta.z src+1 + jmp __b1 + // memcpy::@1 + __b1: + // [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #memcpy::@1] + __b1_from___b2: + // [911] phi memcpy::dst#2 = memcpy::dst#1 [phi:memcpy::@2->memcpy::@1#0] -- register_copy + // [911] phi memcpy::src#2 = memcpy::src#1 [phi:memcpy::@2->memcpy::@1#1] -- register_copy + jmp __b1 +} + // joyinit +// Prepare for joystick control +joyinit: { + // [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 -- _deref_pbuc1=vbuc2 + // Joystick Read Mode + lda #0 + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR + jmp __breturn + // joyinit::@return + __breturn: + // [918] return + rts +} + // joyfire +// Return 1 if joy #2 fire is pressed +joyfire: { + // [919] joyfire::$0 = *((byte*)CIA1) & $10 -- vbuaa=_deref_pbuc1_band_vbuc2 + lda #$10 + and CIA1 + // [920] if(joyfire::$0==0) goto joyfire::@1 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b1_from_joyfire + // [922] phi from joyfire to joyfire::@return [phi:joyfire->joyfire::@return] + __breturn_from_joyfire: + // [922] phi joyfire::return#4 = 0 [phi:joyfire->joyfire::@return#0] -- vbuaa=vbuc1 + lda #0 + jmp __breturn + // [921] phi from joyfire to joyfire::@1 [phi:joyfire->joyfire::@1] + __b1_from_joyfire: + jmp __b1 + // joyfire::@1 + __b1: + // [922] phi from joyfire::@1 to joyfire::@return [phi:joyfire::@1->joyfire::@return] + __breturn_from___b1: + // [922] phi joyfire::return#4 = 1 [phi:joyfire::@1->joyfire::@return#0] -- vbuaa=vbuc1 + lda #1 + jmp __breturn + // joyfire::@return + __breturn: + // [923] return + rts +} + // init_level_tile_directions +// Initialize the LEVEL_TILES_DIRECTIONS table with bits representing all open (non-blocked) movement directions from a tile +init_level_tile_directions: { + .label directions = $b + .label ytile = 5 + .label open_directions = 7 + .label xtile = 6 + // [925] phi from init_level_tile_directions to init_level_tile_directions::@1 [phi:init_level_tile_directions->init_level_tile_directions::@1] + __b1_from_init_level_tile_directions: + // [925] phi init_level_tile_directions::directions#7 = LEVEL_TILES_DIRECTIONS [phi:init_level_tile_directions->init_level_tile_directions::@1#0] -- pbuz1=pbuc1 + lda #LEVEL_TILES_DIRECTIONS + sta.z directions+1 + // [925] phi init_level_tile_directions::ytile#15 = 0 [phi:init_level_tile_directions->init_level_tile_directions::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z ytile + jmp __b1 + // init_level_tile_directions::@1 + __b1: + // [926] if(init_level_tile_directions::ytile#15<$25) goto init_level_tile_directions::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z ytile + cmp #$25 + bcc __b2_from___b1 + jmp __breturn + // init_level_tile_directions::@return + __breturn: + // [927] return + rts + // [928] phi from init_level_tile_directions::@1 to init_level_tile_directions::@2 [phi:init_level_tile_directions::@1->init_level_tile_directions::@2] + __b2_from___b1: + // [928] phi init_level_tile_directions::xtile#10 = 0 [phi:init_level_tile_directions::@1->init_level_tile_directions::@2#0] -- vbuz1=vbuc1 + lda #0 + sta.z xtile + jmp __b2 + // init_level_tile_directions::@2 + __b2: + // [929] if(init_level_tile_directions::xtile#10<$32) goto init_level_tile_directions::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z xtile + cmp #$32 + bcc __b3 + jmp __b4 + // init_level_tile_directions::@4 + __b4: + // [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z directions + sta.z directions + bcc !+ + inc.z directions+1 + !: + // [931] init_level_tile_directions::ytile#1 = ++ init_level_tile_directions::ytile#15 -- vbuz1=_inc_vbuz1 + inc.z ytile + // [925] phi from init_level_tile_directions::@4 to init_level_tile_directions::@1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1] + __b1_from___b4: + // [925] phi init_level_tile_directions::directions#7 = init_level_tile_directions::directions#1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1#0] -- register_copy + // [925] phi init_level_tile_directions::ytile#15 = init_level_tile_directions::ytile#1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1#1] -- register_copy + jmp __b1 + // init_level_tile_directions::@3 + __b3: + // [932] level_tile_get::xtile#0 = init_level_tile_directions::xtile#10 - 1 -- vbuxx=vbuz1_minus_1 + ldx.z xtile + dex + // [933] level_tile_get::ytile#0 = init_level_tile_directions::ytile#15 -- vbuaa=vbuz1 + lda.z ytile + // [934] call level_tile_get + // [1016] phi from init_level_tile_directions::@3 to level_tile_get [phi:init_level_tile_directions::@3->level_tile_get] + level_tile_get_from___b3: + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#0 [phi:init_level_tile_directions::@3->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#0 [phi:init_level_tile_directions::@3->level_tile_get#1] -- register_copy + jsr level_tile_get + // [935] level_tile_get::return#3 = level_tile_get::return#2 + jmp __b13 + // init_level_tile_directions::@13 + __b13: + // [936] init_level_tile_directions::$3 = level_tile_get::return#3 -- vbuxx=vbuaa + tax + // [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #WALL + beq __b5_from___b13 + // [938] phi from init_level_tile_directions::@13 to init_level_tile_directions::@9 [phi:init_level_tile_directions::@13->init_level_tile_directions::@9] + __b9_from___b13: + jmp __b9 + // init_level_tile_directions::@9 + __b9: + // [939] phi from init_level_tile_directions::@9 to init_level_tile_directions::@5 [phi:init_level_tile_directions::@9->init_level_tile_directions::@5] + __b5_from___b9: + // [939] phi init_level_tile_directions::open_directions#11 = LEFT [phi:init_level_tile_directions::@9->init_level_tile_directions::@5#0] -- vbuz1=vbuc1 + lda #LEFT + sta.z open_directions + jmp __b5 + // [939] phi from init_level_tile_directions::@13 to init_level_tile_directions::@5 [phi:init_level_tile_directions::@13->init_level_tile_directions::@5] + __b5_from___b13: + // [939] phi init_level_tile_directions::open_directions#11 = 0 [phi:init_level_tile_directions::@13->init_level_tile_directions::@5#0] -- vbuz1=vbuc1 + lda #0 + sta.z open_directions + jmp __b5 + // init_level_tile_directions::@5 + __b5: + // [940] level_tile_get::xtile#1 = init_level_tile_directions::xtile#10 + 1 -- vbuxx=vbuz1_plus_1 + ldx.z xtile + inx + // [941] level_tile_get::ytile#1 = init_level_tile_directions::ytile#15 -- vbuaa=vbuz1 + lda.z ytile + // [942] call level_tile_get + // [1016] phi from init_level_tile_directions::@5 to level_tile_get [phi:init_level_tile_directions::@5->level_tile_get] + level_tile_get_from___b5: + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#1 [phi:init_level_tile_directions::@5->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#1 [phi:init_level_tile_directions::@5->level_tile_get#1] -- register_copy + jsr level_tile_get + // [943] level_tile_get::return#4 = level_tile_get::return#2 + jmp __b14 + // init_level_tile_directions::@14 + __b14: + // [944] init_level_tile_directions::$7 = level_tile_get::return#4 -- vbuxx=vbuaa + tax + // [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #WALL + beq __b6_from___b14 + jmp __b10 + // init_level_tile_directions::@10 + __b10: + // [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT -- vbuz1=vbuz1_bor_vbuc1 + lda #RIGHT + ora.z open_directions + sta.z open_directions + // [947] phi from init_level_tile_directions::@10 init_level_tile_directions::@14 to init_level_tile_directions::@6 [phi:init_level_tile_directions::@10/init_level_tile_directions::@14->init_level_tile_directions::@6] + __b6_from___b10: + __b6_from___b14: + // [947] phi init_level_tile_directions::open_directions#12 = init_level_tile_directions::open_directions#2 [phi:init_level_tile_directions::@10/init_level_tile_directions::@14->init_level_tile_directions::@6#0] -- register_copy + jmp __b6 + // init_level_tile_directions::@6 + __b6: + // [948] level_tile_get::ytile#2 = init_level_tile_directions::ytile#15 - 1 -- vbuaa=vbuz1_minus_1 + lda.z ytile + sec + sbc #1 + // [949] level_tile_get::xtile#2 = init_level_tile_directions::xtile#10 -- vbuxx=vbuz1 + ldx.z xtile + // [950] call level_tile_get + // [1016] phi from init_level_tile_directions::@6 to level_tile_get [phi:init_level_tile_directions::@6->level_tile_get] + level_tile_get_from___b6: + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#2 [phi:init_level_tile_directions::@6->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#2 [phi:init_level_tile_directions::@6->level_tile_get#1] -- register_copy + jsr level_tile_get + // [951] level_tile_get::return#10 = level_tile_get::return#2 + jmp __b15 + // init_level_tile_directions::@15 + __b15: + // [952] init_level_tile_directions::$11 = level_tile_get::return#10 + // [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 -- pbuc1_derefidx_vbuaa_eq_vbuc2_then_la1 + tay + lda TILES_TYPE,y + cmp #WALL + beq __b7_from___b15 + jmp __b11 + // init_level_tile_directions::@11 + __b11: + // [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP -- vbuz1=vbuz1_bor_vbuc1 + lda #UP + ora.z open_directions + sta.z open_directions + // [955] phi from init_level_tile_directions::@11 init_level_tile_directions::@15 to init_level_tile_directions::@7 [phi:init_level_tile_directions::@11/init_level_tile_directions::@15->init_level_tile_directions::@7] + __b7_from___b11: + __b7_from___b15: + // [955] phi init_level_tile_directions::open_directions#13 = init_level_tile_directions::open_directions#3 [phi:init_level_tile_directions::@11/init_level_tile_directions::@15->init_level_tile_directions::@7#0] -- register_copy + jmp __b7 + // init_level_tile_directions::@7 + __b7: + // [956] level_tile_get::ytile#3 = init_level_tile_directions::ytile#15 + 1 -- vbuaa=vbuz1_plus_1 + lda.z ytile + clc + adc #1 + // [957] level_tile_get::xtile#3 = init_level_tile_directions::xtile#10 -- vbuxx=vbuz1 + ldx.z xtile + // [958] call level_tile_get + // [1016] phi from init_level_tile_directions::@7 to level_tile_get [phi:init_level_tile_directions::@7->level_tile_get] + level_tile_get_from___b7: + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#3 [phi:init_level_tile_directions::@7->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#3 [phi:init_level_tile_directions::@7->level_tile_get#1] -- register_copy + jsr level_tile_get + // [959] level_tile_get::return#11 = level_tile_get::return#2 + jmp __b16 + // init_level_tile_directions::@16 + __b16: + // [960] init_level_tile_directions::$15 = level_tile_get::return#11 + // [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 -- pbuc1_derefidx_vbuaa_eq_vbuc2_then_la1 + tay + lda TILES_TYPE,y + cmp #WALL + beq __b8_from___b16 + jmp __b12 + // init_level_tile_directions::@12 + __b12: + // [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN -- vbuz1=vbuz1_bor_vbuc1 + lda #DOWN + ora.z open_directions + sta.z open_directions + // [963] phi from init_level_tile_directions::@12 init_level_tile_directions::@16 to init_level_tile_directions::@8 [phi:init_level_tile_directions::@12/init_level_tile_directions::@16->init_level_tile_directions::@8] + __b8_from___b12: + __b8_from___b16: + // [963] phi init_level_tile_directions::open_directions#8 = init_level_tile_directions::open_directions#4 [phi:init_level_tile_directions::@12/init_level_tile_directions::@16->init_level_tile_directions::@8#0] -- register_copy + jmp __b8 + // init_level_tile_directions::@8 + __b8: + // [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 -- pbuz1_derefidx_vbuz2=vbuz3 + lda.z open_directions + ldy.z xtile + sta (directions),y + // [965] init_level_tile_directions::xtile#1 = ++ init_level_tile_directions::xtile#10 -- vbuz1=_inc_vbuz1 + inc.z xtile + // [928] phi from init_level_tile_directions::@8 to init_level_tile_directions::@2 [phi:init_level_tile_directions::@8->init_level_tile_directions::@2] + __b2_from___b8: + // [928] phi init_level_tile_directions::xtile#10 = init_level_tile_directions::xtile#1 [phi:init_level_tile_directions::@8->init_level_tile_directions::@2#0] -- register_copy + jmp __b2 +} + // level_show +// Show the level by rendering all tiles +// Returns the number of pills on the level +level_show: { + .label return = $b + .label level = 9 + .label ytile = 6 + .label tile_right = $60 + .label xtile = 8 + .label count = $b + .label xcol = 7 + // [967] phi from level_show to level_show::@1 [phi:level_show->level_show::@1] + __b1_from_level_show: + // [967] phi level_show::level#8 = LEVEL_TILES [phi:level_show->level_show::@1#0] -- pbuz1=pbuc1 + lda #LEVEL_TILES + sta.z level+1 + // [967] phi level_show::count#12 = 0 [phi:level_show->level_show::@1#1] -- vwuz1=vwuc1 + lda #<0 + sta.z count + lda #>0 + sta.z count+1 + // [967] phi level_show::ytile#2 = 0 [phi:level_show->level_show::@1#2] -- vbuz1=vbuc1 + lda #0 + sta.z ytile + jmp __b1 + // level_show::@1 + __b1: + // [968] if(level_show::ytile#2<$25) goto level_show::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z ytile + cmp #$25 + bcc __b2_from___b1 + jmp __breturn + // level_show::@return + __breturn: + // [969] return + rts + // [970] phi from level_show::@1 to level_show::@2 [phi:level_show::@1->level_show::@2] + __b2_from___b1: + // [970] phi level_show::count#10 = level_show::count#12 [phi:level_show::@1->level_show::@2#0] -- register_copy + // [970] phi level_show::xtile#3 = 0 [phi:level_show::@1->level_show::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z xtile + // [970] phi level_show::xcol#2 = 0 [phi:level_show::@1->level_show::@2#2] -- vbuz1=vbuc1 + lda #0 + sta.z xcol + jmp __b2 + // level_show::@2 + __b2: + // [971] if(level_show::xcol#2<$19) goto level_show::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b3 + jmp __b4 + // level_show::@4 + __b4: + // [972] level_show::level#1 = level_show::level#8 + $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z level + sta.z level + bcc !+ + inc.z level+1 + !: + // [973] level_show::ytile#1 = ++ level_show::ytile#2 -- vbuz1=_inc_vbuz1 + inc.z ytile + // [967] phi from level_show::@4 to level_show::@1 [phi:level_show::@4->level_show::@1] + __b1_from___b4: + // [967] phi level_show::level#8 = level_show::level#1 [phi:level_show::@4->level_show::@1#0] -- register_copy + // [967] phi level_show::count#12 = level_show::count#10 [phi:level_show::@4->level_show::@1#1] -- register_copy + // [967] phi level_show::ytile#2 = level_show::ytile#1 [phi:level_show::@4->level_show::@1#2] -- register_copy + jmp __b1 + // level_show::@3 + __b3: + // [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] -- vbuxx=pbuz1_derefidx_vbuz2 + ldy.z xtile + lda (level),y + tax + // [975] level_show::xtile#1 = ++ level_show::xtile#3 -- vbuyy=_inc_vbuz1 + ldy.z xtile + iny + // [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 -- pbuc1_derefidx_vbuxx_neq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #PILL + bne __b5_from___b3 + jmp __b7 + // level_show::@7 + __b7: + // [977] level_show::count#1 = ++ level_show::count#10 -- vwuz1=_inc_vwuz1 + inc.z count + bne !+ + inc.z count+1 + !: + // [978] phi from level_show::@3 level_show::@7 to level_show::@5 [phi:level_show::@3/level_show::@7->level_show::@5] + __b5_from___b3: + __b5_from___b7: + // [978] phi level_show::count#5 = level_show::count#10 [phi:level_show::@3/level_show::@7->level_show::@5#0] -- register_copy + jmp __b5 + // level_show::@5 + __b5: + // [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] -- vbuz1=pbuz2_derefidx_vbuyy + lda (level),y + sta.z tile_right + // [980] level_show::xtile#2 = ++ level_show::xtile#1 -- vbuz1=_inc_vbuyy + iny + sty.z xtile + // [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + lda #PILL + ldy.z tile_right + cmp TILES_TYPE,y + bne __b6_from___b5 + jmp __b8 + // level_show::@8 + __b8: + // [982] level_show::count#2 = ++ level_show::count#5 -- vwuz1=_inc_vwuz1 + inc.z count + bne !+ + inc.z count+1 + !: + // [983] phi from level_show::@5 level_show::@8 to level_show::@6 [phi:level_show::@5/level_show::@8->level_show::@6] + __b6_from___b5: + __b6_from___b8: + // [983] phi level_show::count#11 = level_show::count#5 [phi:level_show::@5/level_show::@8->level_show::@6#0] -- register_copy + jmp __b6 + // level_show::@6 + __b6: + // [984] render_tiles::xcol#0 = level_show::xcol#2 + // [985] render_tiles::ytile#0 = level_show::ytile#2 + // [986] render_tiles::tile_left#0 = level_show::tile_left#0 + // [987] render_tiles::tile_right#0 = level_show::tile_right#0 -- vbuyy=vbuz1 + ldy.z tile_right + // [988] call render_tiles + jsr render_tiles + jmp __b9 + // level_show::@9 + __b9: + // [989] level_show::xcol#1 = ++ level_show::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [970] phi from level_show::@9 to level_show::@2 [phi:level_show::@9->level_show::@2] + __b2_from___b9: + // [970] phi level_show::count#10 = level_show::count#11 [phi:level_show::@9->level_show::@2#0] -- register_copy + // [970] phi level_show::xtile#3 = level_show::xtile#2 [phi:level_show::@9->level_show::@2#1] -- register_copy + // [970] phi level_show::xcol#2 = level_show::xcol#1 [phi:level_show::@9->level_show::@2#2] -- register_copy + jmp __b2 +} + // pacman_sound_init +// Sound effects for pacman +pacman_sound_init: { + // [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f -- _deref_pbuc1=vbuc2 + // Set master volume + lda #$f + sta SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE + // [991] *((word*)SID) = 0 -- _deref_pwuc1=vbuc2 + // Channel 1 is Pacman eating sound + lda #0 + sta SID+1 + lda #<0 + sta SID + // [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 -- _deref_pwuc1=vbuc2 + lda #0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH+1 + lda #<0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH + // [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY + // [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 -- _deref_pbuc1=vbuc2 + lda #$f0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE + jmp __breturn + // pacman_sound_init::@return + __breturn: + // [996] return + rts +} + // render +// Render graphic pixels into the 9 all-border sprites +// - xcol: x column (0-24). The x-column represents 8 bits of data, 4 mc pixels, 16 on-screen pixels (due to x-expanded sprites) +// - ypos: y position (0-145). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. +// - pixels: The pixel data to set +// render(byte zp(5) xcol, byte zp(6) ypos, byte zp(8) pixels) +render: { + .label render_index_xcol = $61 + .label canvas_offset = $b + .label canvas1 = 9 + .label canvas2 = $b + .label ypix = $60 + .label xcol = 5 + .label ypos = 6 + .label pixels = 8 + // [998] render::ytile#0 = render::ypos#2 >> 2 -- vbuyy=vbuz1_ror_2 + lda.z ypos + lsr + lsr + tay + // [999] render::$1 = >RENDER_INDEX + render::xcol#2 -- vbuxx=vbuc1_plus_vbuz1 + lax.z xcol + axs #-[>RENDER_INDEX] + // [1000] render::$2 = render::ytile#0 << 1 -- vbuaa=vbuyy_rol_1 + tya + asl + // [1001] render::render_index_xcol#0 = render::$1 w= render::$2 -- vwuz1=vbuxx_word_vbuaa + stx.z render_index_xcol+1 + sta.z render_index_xcol + // [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) -- vwuz1=pbuz2_derefidx_vbuc1_word__deref_pbuz2 + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz2 + clc + lda.z canvas_offset + adc #SPRITES_1 + sta.z canvas1+1 + // [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] -- vbuxx=pbuz1_derefidx_vbuc1 + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + // [1006] render::ypix#0 = render::ypos#2 & 3 -- vbuz1=vbuz2_band_vbuc1 + lda #3 + and.z ypos + sta.z ypix + // [1007] phi from render to render::@1 [phi:render->render::@1] + __b1_from_render: + // [1007] phi render::canvas2#2 = render::canvas2#0 [phi:render->render::@1#0] -- register_copy + // [1007] phi render::ypos_inc_offset#2 = render::ypos_inc_offset#0 [phi:render->render::@1#1] -- register_copy + // [1007] phi render::canvas1#2 = render::canvas1#0 [phi:render->render::@1#2] -- register_copy + // [1007] phi render::i#2 = 0 [phi:render->render::@1#3] -- vbuyy=vbuc1 + ldy #0 + jmp __b1 + // render::@1 + __b1: + // [1008] if(render::i#2render::@1] + __b1_from___b2: + // [1007] phi render::canvas2#2 = render::canvas2#1 [phi:render::@2->render::@1#0] -- register_copy + // [1007] phi render::ypos_inc_offset#2 = render::ypos_inc_offset#1 [phi:render::@2->render::@1#1] -- register_copy + // [1007] phi render::canvas1#2 = render::canvas1#1 [phi:render::@2->render::@1#2] -- register_copy + // [1007] phi render::i#2 = render::i#1 [phi:render::@2->render::@1#3] -- register_copy + jmp __b1 +} + // level_tile_get +// Get the level tile at a given (xtile, ytile) position +// Returns the TILE ID +// If xtile of ytile is outside the legal range the empty tile (0) is returned +// level_tile_get(byte register(X) xtile, byte register(A) ytile) +level_tile_get: { + .label ytiles = $61 + // [1017] if(level_tile_get::xtile#4>=$31+1) goto level_tile_get::@return -- vbuxx_ge_vbuc1_then_la1 + cpx #$31+1 + bcs __breturn_from_level_tile_get + jmp __b2 + // level_tile_get::@2 + __b2: + // [1018] if(level_tile_get::ytile#4>=$24+1) goto level_tile_get::@return -- vbuaa_ge_vbuc1_then_la1 + cmp #$24+1 + bcs __breturn_from___b2 + jmp __b1 + // level_tile_get::@1 + __b1: + // [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 -- vbuaa=vbuaa_rol_1 + asl + // [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuaa + tay + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] -- vbuaa=pbuz1_derefidx_vbuxx + txa + tay + lda (ytiles),y + // [1022] phi from level_tile_get::@1 to level_tile_get::@return [phi:level_tile_get::@1->level_tile_get::@return] + __breturn_from___b1: + // [1022] phi level_tile_get::return#2 = level_tile_get::return#0 [phi:level_tile_get::@1->level_tile_get::@return#0] -- register_copy + jmp __breturn + // [1022] phi from level_tile_get level_tile_get::@2 to level_tile_get::@return [phi:level_tile_get/level_tile_get::@2->level_tile_get::@return] + __breturn_from_level_tile_get: + __breturn_from___b2: + // [1022] phi level_tile_get::return#2 = 0 [phi:level_tile_get/level_tile_get::@2->level_tile_get::@return#0] -- vbuaa=vbuc1 + lda #0 + jmp __breturn + // level_tile_get::@return + __breturn: + // [1023] return + rts +} + // render_tiles +// Renders 2x1 tiles on the canvas. +// Tiles are 4x4 px. This renders 8px x 4px. +// - xcol: The x column position (0-24) (a column is 8 pixels) +// - ytile: The y tile position (0-37). Tile y position 0 is a special half-tile at the top of the screen. +// - tile_left: The left tile ID. +// - tile_right: The right tile ID. +// render_tiles(byte zp(7) xcol, byte zp(6) ytile, byte register(X) tile_left, byte register(Y) tile_right) +render_tiles: { + .label tile_left_pixels = $61 + .label tile_right_pixels = $63 + .label render_index_xcol = $65 + .label canvas_offset = $5e + .label canvas1 = $59 + .label canvas2 = $5e + .label y = $60 + .label xcol = 7 + .label ytile = 6 + // [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 -- vbuaa=vbuxx_rol_2 + txa + asl + asl + // [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 -- pbuz1=pbuc1_plus_vbuaa + clc + adc #TILES_LEFT + adc #0 + sta.z tile_left_pixels+1 + // [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 -- vbuaa=vbuyy_rol_2 + tya + asl + asl + // [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 -- pbuz1=pbuc1_plus_vbuaa + clc + adc #TILES_RIGHT + adc #0 + sta.z tile_right_pixels+1 + // [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 -- vbuxx=vbuc1_plus_vbuz1 + lax.z xcol + axs #-[>RENDER_INDEX] + // [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 -- vbuaa=vbuz1_rol_1 + lda.z ytile + asl + // [1030] render_tiles::render_index_xcol#0 = render_tiles::$4 w= render_tiles::$5 -- vwuz1=vbuxx_word_vbuaa + stx.z render_index_xcol+1 + sta.z render_index_xcol + // [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) -- vwuz1=pbuz2_derefidx_vbuc1_word__deref_pbuz2 + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz2 + clc + lda.z canvas_offset + adc #SPRITES_1 + sta.z canvas1+1 + // [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] -- vbuxx=pbuz1_derefidx_vbuc1 + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + // [1035] phi from render_tiles to render_tiles::@1 [phi:render_tiles->render_tiles::@1] + __b1_from_render_tiles: + // [1035] phi render_tiles::ypos_inc_offset#2 = render_tiles::ypos_inc_offset#0 [phi:render_tiles->render_tiles::@1#0] -- register_copy + // [1035] phi render_tiles::canvas2#2 = render_tiles::canvas2#0 [phi:render_tiles->render_tiles::@1#1] -- register_copy + // [1035] phi render_tiles::canvas1#2 = render_tiles::canvas1#0 [phi:render_tiles->render_tiles::@1#2] -- register_copy + // [1035] phi render_tiles::y#2 = 0 [phi:render_tiles->render_tiles::@1#3] -- vbuz1=vbuc1 + lda #0 + sta.z y + jmp __b1 + // render_tiles::@1 + __b1: + // [1036] if(render_tiles::y#2<4) goto render_tiles::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z y + cmp #4 + bcc __b2 + jmp __breturn + // render_tiles::@return + __breturn: + // [1037] return + rts + // render_tiles::@2 + __b2: + // [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] -- vbuaa=pbuz1_derefidx_vbuz2_bor_pbuz3_derefidx_vbuz2 + ldy.z y + lda (tile_left_pixels),y + ora (tile_right_pixels),y + // [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 -- _deref_pbuz1=vbuaa + ldy #0 + sta (canvas1),y + // [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 -- _deref_pbuz1=vbuaa + ldy #0 + sta (canvas2),y + // [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] -- pbuz1=pbuz1_plus_pbuc1_derefidx_vbuxx + lda RENDER_YPOS_INC,x + clc + adc.z canvas1 + sta.z canvas1 + bcc !+ + inc.z canvas1+1 + !: + // [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] -- pbuz1=pbuz1_plus_pbuc1_derefidx_vbuxx + lda RENDER_YPOS_INC,x + clc + adc.z canvas2 + sta.z canvas2 + bcc !+ + inc.z canvas2+1 + !: + // [1043] render_tiles::ypos_inc_offset#1 = ++ render_tiles::ypos_inc_offset#2 -- vbuxx=_inc_vbuxx + inx + // [1044] render_tiles::y#1 = ++ render_tiles::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // [1035] phi from render_tiles::@2 to render_tiles::@1 [phi:render_tiles::@2->render_tiles::@1] + __b1_from___b2: + // [1035] phi render_tiles::ypos_inc_offset#2 = render_tiles::ypos_inc_offset#1 [phi:render_tiles::@2->render_tiles::@1#0] -- register_copy + // [1035] phi render_tiles::canvas2#2 = render_tiles::canvas2#1 [phi:render_tiles::@2->render_tiles::@1#1] -- register_copy + // [1035] phi render_tiles::canvas1#2 = render_tiles::canvas1#1 [phi:render_tiles::@2->render_tiles::@1#2] -- register_copy + // [1035] phi render_tiles::y#2 = render_tiles::y#1 [phi:render_tiles::@2->render_tiles::@1#3] -- register_copy + jmp __b1 +} + // File Data +.segment Data + // The byteboozer decruncher +BYTEBOOZER: +.const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + + // Pacman eating sound + PACMAN_CH1_FREQ_HI: .byte $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 + PACMAN_CH1_CONTROL: .byte $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 + // Address of the first pixel each x column + RENDER_XCOLS: .word 0, 1, 2, $400, $401, $402, $800, $801, $802, $c00, $c01, $c02, $1000, $1001, $1002, $1400, $1401, $1402, $1800, $1801, $1802, $1c00, $1c01, $1c02, 0, 0 + // Offset for each y-position from the first pixel of an X column + RENDER_YPOS: .word 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, $40+3, $40+9, $40+$f, $40+$15, $40+$1b, $40+$21, $40+$27, $40+$2d, $40+$33, $40+$39, $80, $80+6, $80+$c, $80+$12, $80+$18, $80+$1e, $80+$24, $80+$2a, $80+$30, $80+$36, $80+$3c, $c0+3, $c0+9, $c0+$f, $c0+$15, $c0+$1b, $c0+$21, $c0+$27, $c0+$2d, $c0+$33, $c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39 + // Offset for each y-position from the first pixel of an X column in sprite#9 + RENDER_YPOS_9TH: .word 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, $40+6, $40+$c, $40+$12, $40+$18, $40+$1e, $40+$24, $40+$2a, $40+$30, $40+$36, $40+$3c, $80+3, $80+9, $80+$f, $80+$15, $80+$1b, $80+$21, $80+$27, $80+$2d, $80+$33, $80+$39, $c0, $c0+6, $c0+$c, $c0+$12, $c0+$18, $c0+$1e, $c0+$24, $c0+$2a, $c0+$30, $c0+$36, $c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c + // Increment for each y-position from the first pixel of an X column + .align $20 + RENDER_YPOS_INC: .byte 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 + // The BOB x column position (0-24) (a column is 8 pixels) + bobs_xcol: .byte $a, $a, $a, $a, $a + // The BOB y fine position (0-99). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. + bobs_yfine: .byte $2d, $2d, $2d, $2d, $2d + // The BOB ID in the BOB data tables + bobs_bob_id: .byte 0, 0, 0, 0, 0 + // The BOB restore data: 18 bytes per BOB. Doubled for double-buffering. + // char * left_canvas; + // char left_ypos_inc_offset; + // char * right_canvas; + // char right_ypos_inc_offset; + // char[12] restore_pixels; + .align $100 + bobs_restore: .fill NUM_BOBS*SIZE_BOB_RESTORE*2, 0 +.segment Init + // The level represented as 4x4 px tiles. Each byte is the ID of a tile from the tile set. + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 50 tile IDs. +LEVEL_TILES_CRUNCHED: +.modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + + // BOB data: One table per bob byte (left/right, mask/pixels = 4 tables). The index into the table is the bob_id + row*BOB_ROW_SIZE. +BOB_GRAPHICS_CRUNCHED: +.modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + + // Splash screen 25 xcol * 147 ypos bytes +SPLASH_CRUNCHED: +.modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + + // Victory graphics 25 xcol * 25 ypos bytes +WIN_GFX_CRUNCHED: +.modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + + // Game Over graphics 25 xcol * 25 ypos bytes +GAMEOVER_GFX_CRUNCHED: +.modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + + // Renders the BOBs at the given positions + // The bob logic code will be merged with raster code using code-merger.c + // First restores the canvas from previously rendered bobs, and then renders the bobs at the given positions. + // BOBs are 16px*6px graphics (2 x-columns * 6px) with masks and pixels + // Uses the bobs_xcol, bobs_yfine, bobs_bob_id and bob_restore for data about the bobs + // Implemented in inline kick assembler +LOGIC_CODE_CRUNCHED: +.macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + + // Raster-code for displaying 9 sprites on the entire screen - with open side borders + // The uncrunched code will be merged with logic code using code-merger.c + // The unmerged raster-code is identical for both buffers! +RASTER_CODE_CRUNCHED: +.macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + + // SID tune + // Pacmania Shaun Southern https://csdb.dk/sid/?id=53795 + // Relocated using ./sidreloc-1.0/sidreloc -p30 c64src/borderline/Pacmania.sid c64src/borderline/Pacmania_3000.sid +INTRO_MUSIC_CRUNCHED: +.modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + +.segment Data + // Offset of the LEVEL_TILE data within the LEVEL_TILE data (each row is 64 bytes of data) + LEVEL_YTILE_OFFSET: .word 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 + // Used to choose a single direction when presented with multiple potential directions. + // Used to eliminate diagonal joy directions and convert them to a single direction + // Priority: (4)up, (8)down, (16)left, (32)right + .align $40 + DIRECTION_SINGLE: .byte 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 + // Used to eliminate a single direction (the one that the ghost came from) + // The value DIRECTION_ELIMINATE[current_direction] is ANDed onto the open directions to remove the current direction + .align $40 + DIRECTION_ELIMINATE: .byte $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef + // Used to reverse direction direction (when a ghost changes between chase and scatter) + .align $40 + DIRECTION_REVERSE: .byte 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 + // The animation frames for pacman. The index into this is DIRECTION + anim_frame_idx. + .align $40 + pacman_frames: .byte 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c + // The animation frames for ghost. The index into thos is DIRECTION + anim_frame_idx. + .align $80 + ghost_frames: .byte 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 + // Lookup the absolute value of a signed number + // PRE_ and POST_ are used to ensure lookup of ABS-1,y works for y=0 and ABS+1,y works for y=0xff + .align $100 + ABS_PRE: .byte 1 +ABS: +.for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + + ABS_POST: .byte 0 + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp __init1 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp toD0181 +Removing instruction jmp __b5 +Removing instruction jmp toDd002 +Removing instruction jmp __b7 +Removing instruction jmp __b1 +Removing instruction jmp __b4 +Removing instruction jmp __b8 +Removing instruction jmp __b3 +Removing instruction jmp __breturn +Removing instruction jmp toDd001 +Removing instruction jmp __b6 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b8 +Removing instruction jmp __b9 +Removing instruction jmp __b10 +Removing instruction jmp __b11 +Removing instruction jmp __b12 +Removing instruction jmp __b13 +Removing instruction jmp __b161 +Removing instruction jmp __b15 +Removing instruction jmp __b44 +Removing instruction jmp __b16 +Removing instruction jmp __b17 +Removing instruction jmp __b18 +Removing instruction jmp __b19 +Removing instruction jmp __b47 +Removing instruction jmp __b60 +Removing instruction jmp __b48 +Removing instruction jmp __b61 +Removing instruction jmp __b62 +Removing instruction jmp __b50 +Removing instruction jmp __b162 +Removing instruction jmp __b64 +Removing instruction jmp __b163 +Removing instruction jmp __b65 +Removing instruction jmp __b164 +Removing instruction jmp __b66 +Removing instruction jmp __b165 +Removing instruction jmp __b68 +Removing instruction jmp __b69 +Removing instruction jmp __b70 +Removing instruction jmp __b71 +Removing instruction jmp __b63 +Removing instruction jmp __b58 +Removing instruction jmp __b59 +Removing instruction jmp __b20 +Removing instruction jmp __b21 +Removing instruction jmp __b22 +Removing instruction jmp __b23 +Removing instruction jmp __b24 +Removing instruction jmp __b76 +Removing instruction jmp __b166 +Removing instruction jmp __b82 +Removing instruction jmp __b83 +Removing instruction jmp __b152 +Removing instruction jmp __b84 +Removing instruction jmp __b85 +Removing instruction jmp __b80 +Removing instruction jmp __b153 +Removing instruction jmp __b86 +Removing instruction jmp __b87 +Removing instruction jmp __b88 +Removing instruction jmp __b25 +Removing instruction jmp __b26 +Removing instruction jmp __b27 +Removing instruction jmp __b28 +Removing instruction jmp __b29 +Removing instruction jmp __b93 +Removing instruction jmp __b167 +Removing instruction jmp __b99 +Removing instruction jmp __b100 +Removing instruction jmp __b154 +Removing instruction jmp __b101 +Removing instruction jmp __b102 +Removing instruction jmp __b97 +Removing instruction jmp __b155 +Removing instruction jmp __b103 +Removing instruction jmp __b104 +Removing instruction jmp __b105 +Removing instruction jmp __b30 +Removing instruction jmp __b31 +Removing instruction jmp __b32 +Removing instruction jmp __b33 +Removing instruction jmp __b34 +Removing instruction jmp __b110 +Removing instruction jmp __b168 +Removing instruction jmp __b116 +Removing instruction jmp __b117 +Removing instruction jmp __b156 +Removing instruction jmp __b118 +Removing instruction jmp __b119 +Removing instruction jmp __b114 +Removing instruction jmp __b157 +Removing instruction jmp __b120 +Removing instruction jmp __b121 +Removing instruction jmp __b122 +Removing instruction jmp __b35 +Removing instruction jmp __b36 +Removing instruction jmp __b37 +Removing instruction jmp __b38 +Removing instruction jmp __b39 +Removing instruction jmp __b127 +Removing instruction jmp __b169 +Removing instruction jmp __b133 +Removing instruction jmp __b134 +Removing instruction jmp __b158 +Removing instruction jmp __b135 +Removing instruction jmp __b136 +Removing instruction jmp __b131 +Removing instruction jmp __b159 +Removing instruction jmp __b137 +Removing instruction jmp __b138 +Removing instruction jmp __b139 +Removing instruction jmp __b40 +Removing instruction jmp __b41 +Removing instruction jmp __b42 +Removing instruction jmp __b43 +Removing instruction jmp __b143 +Removing instruction jmp __b170 +Removing instruction jmp __b147 +Removing instruction jmp __b160 +Removing instruction jmp __b148 +Removing instruction jmp __b149 +Removing instruction jmp __b145 +Removing instruction jmp __b150 +Removing instruction jmp __b151 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp SEI1 +Removing instruction jmp __b16 +Removing instruction jmp __b20 +Removing instruction jmp __b21 +Removing instruction jmp __b22 +Removing instruction jmp __b23 +Removing instruction jmp __b24 +Removing instruction jmp __b25 +Removing instruction jmp __b26 +Removing instruction jmp __b27 +Removing instruction jmp __b28 +Removing instruction jmp __b29 +Removing instruction jmp __b30 +Removing instruction jmp __b31 +Removing instruction jmp __b32 +Removing instruction jmp __b33 +Removing instruction jmp __b34 +Removing instruction jmp __b35 +Removing instruction jmp __b1 +Removing instruction jmp toDd001 +Removing instruction jmp __b17 +Removing instruction jmp toD0181 +Removing instruction jmp __b18 +Removing instruction jmp __b5 +Removing instruction jmp __b7 +Removing instruction jmp __b8 +Removing instruction jmp __b10 +Removing instruction jmp __b11 +Removing instruction jmp __b12 +Removing instruction jmp CLI1 +Removing instruction jmp __b19 +Removing instruction jmp __b36 +Removing instruction jmp __b13 +Removing instruction jmp __b37 +Removing instruction jmp __breturn +Removing instruction jmp __b15 +Removing instruction jmp __b4 +Removing instruction jmp __b3 +Removing instruction jmp SEI1 +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __b4 +Removing instruction jmp __b6 +Removing instruction jmp __b14 +Removing instruction jmp __b15 +Removing instruction jmp __b16 +Removing instruction jmp __b17 +Removing instruction jmp __b7 +Removing instruction jmp __b9 +Removing instruction jmp __b18 +Removing instruction jmp __b19 +Removing instruction jmp __b10 +Removing instruction jmp __b11 +Removing instruction jmp __b12 +Removing instruction jmp CLI1 +Removing instruction jmp __b13 +Removing instruction jmp __b20 +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __b6 +Removing instruction jmp __b7 +Removing instruction jmp __b8 +Removing instruction jmp __b9 +Removing instruction jmp __b13 +Removing instruction jmp __b17 +Removing instruction jmp __breturn +Removing instruction jmp __b15 +Removing instruction jmp __b10 +Removing instruction jmp __b12 +Removing instruction jmp __b16 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b5 +Removing instruction jmp __b6 +Removing instruction jmp __b1 +Removing instruction jmp __b7 +Removing instruction jmp __b2 +Removing instruction jmp __b8 +Removing instruction jmp __b3 +Removing instruction jmp __b9 +Removing instruction jmp __b14 +Removing instruction jmp __b4 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __b14 +Removing instruction jmp __b16 +Removing instruction jmp __breturn +Removing instruction jmp __b17 +Removing instruction jmp __b19 +Removing instruction jmp __b4 +Removing instruction jmp __b5 +Removing instruction jmp __b10 +Removing instruction jmp __b13 +Removing instruction jmp __b21 +Removing instruction jmp __b6 +Removing instruction jmp __b8 +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __breturn +Removing instruction jmp __b10 +Removing instruction jmp __b4 +Removing instruction jmp __b5 +Removing instruction jmp __b7 +Removing instruction jmp __b9 +Removing instruction jmp __b8 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __b5 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp __b3 +Removing instruction jmp __b5 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __b13 +Removing instruction jmp __b9 +Removing instruction jmp __b5 +Removing instruction jmp __b14 +Removing instruction jmp __b10 +Removing instruction jmp __b6 +Removing instruction jmp __b15 +Removing instruction jmp __b11 +Removing instruction jmp __b7 +Removing instruction jmp __b16 +Removing instruction jmp __b12 +Removing instruction jmp __b8 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __b7 +Removing instruction jmp __b5 +Removing instruction jmp __b8 +Removing instruction jmp __b6 +Removing instruction jmp __b9 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __breturn +Removing instruction jmp __b2 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #<0 +Removing instruction lda #>0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda #7 +Removing instruction lda.z frame +Removing instruction lda.z game_logic_substep +Removing instruction lda #1 +Removing instruction lda #1 +Removing instruction lda #1 +Replacing instruction ldy.z __210 with TAY +Replacing instruction lda.z pacman_xtile with TYA +Replacing instruction lda.z pacman_xtile with TYA +Removing instruction lda.z ghost4_ytile +Replacing instruction ldx #2 with TAX +Removing instruction lda #1 +Removing instruction lda #2 +Removing instruction lda.z ghost3_ytile +Replacing instruction ldx #2 with TAX +Removing instruction lda #1 +Removing instruction lda.z ghost2_ytile +Replacing instruction ldx #2 with TAX +Removing instruction lda #1 +Removing instruction lda.z ghost1_ytile +Replacing instruction ldx #2 with TAX +Removing instruction lda #1 +Removing instruction lda #1 +Removing instruction lda #1 +Removing instruction ldy.z pacman_ch1_idx +Removing instruction lda #0 +Replacing instruction lda #0 with TXA +Removing instruction lda #$ff +Removing instruction lda #BLACK +Removing instruction lda #BLACK +Removing instruction lda #$ff +Removing instruction lda #$ff +Removing instruction lda #YELLOW +Removing instruction lda #YELLOW +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #STOP +Removing instruction lda #STOP +Removing instruction lda #STOP +Removing instruction lda #STOP +Removing instruction lda #$32 +Removing instruction lda #$32 +Removing instruction lda #$32 +Removing instruction lda #$32 +Removing instruction lda #$23 +Removing instruction lda #$23 +Removing instruction lda #$23 +Removing instruction lda.z dist_left +Replacing instruction ldy #0 with TAY +Removing instruction ldy #0 +Removing instruction ldy #0 +Removing instruction ldy #0 +Removing instruction lda #0 +Removing instruction lda.z canvas +Replacing instruction ldy #0 with TAY +Removing instruction ldy #0 +Removing instruction lda #>0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction ldy.z xtile +Removing instruction lda #<0 +Removing instruction lda #0 +Removing instruction lda #<0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda.z canvas_offset +Removing instruction lda.z pixels +Removing instruction ldy #0 +Removing instruction lda.z canvas_offset +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label toDd001_from___b5 with __b6 +Replacing label __b1_from___b2 with __b1 +Replacing label __b44_from___b14 with __b44 +Replacing label __b47_from___b17 with __b47_from___b46 +Replacing label __b47_from___b18 with __b47_from___b46 +Replacing label __b47_from___b58 with __b47_from___b59 +Replacing label __b47_from___b45 with __b47_from___b46 +Replacing label __b13_from___b14 with __b13 +Replacing label __b13_from___b15 with __b13 +Replacing label __b3_from___b2 with __b3 +Replacing label __b13_from___b14 with __b13 +Replacing label __b13_from___b15 with __b13 +Replacing label __b8_from___b1 with __b8_from___b7 +Replacing label __breturn_from_level_tile_directions with __breturn_from___b2 +Replacing label __b1_from_choose_direction with __b1_from___b5 +Replacing label __b4_from___b3 with __b4 +Replacing label __b14_from___b9 with __b4 +Replacing label __b3_from___b12 with __b3 +Replacing label __b2_from___b10 with __b2 +Replacing label __b2_from___b3 with __b2 +Replacing label __b4_from___b3 with __b4 +Replacing label __b14_from___b19 with __b14_from___b3 +Replacing label __b10_from___b4 with __b10_from___b5 +Replacing label __b10_from___b13 with __b10_from___b5 +Replacing label __b10_from___b12 with __b10_from___b5 +Replacing label __b4_from___b8 with __b4 +Replacing label __b6_from___b7 with __b6_from___b9 +Replacing label __b8_from___b6 with __b8 +Replacing label __b1_from_joyfire with __b1 +Replacing label __b6_from___b14 with __b6 +Replacing label __b7_from___b15 with __b7 +Replacing label __b8_from___b16 with __b8 +Replacing label __b5_from___b3 with __b5 +Replacing label __b6_from___b5 with __b6 +Replacing label __breturn_from_level_tile_get with __breturn_from___b2 +Removing instruction __b1_from___init1: +Removing instruction main_from___b1: +Removing instruction toD0181_from_irq_screen_top: +Removing instruction toD0181: +Removing instruction toDd002_from___b5: +Removing instruction toDd002: +Removing instruction __b4_from___b1: +Removing instruction __b8_from___b4: +Removing instruction __breturn: +Removing instruction toDd001_from___b5: +Removing instruction toDd001: +Removing instruction __b1_from_main: +Removing instruction __b1_from___b2: +Removing instruction __b2_from___b1: +Removing instruction __b44_from___b14: +Removing instruction __b44_from___b15: +Removing instruction __b47_from___b19: +Removing instruction __b47_from___b58: +Removing instruction __b47_from___b17: +Removing instruction __b47_from___b18: +Removing instruction __b47_from___b45: +Removing instruction __b22_from___b21: +Removing instruction __b23_from___b22: +Removing instruction __b24_from___b23: +Removing instruction memset_from___b24: +Removing instruction __b25_from___b24: +Removing instruction __b27_from___b26: +Removing instruction __b28_from___b27: +Removing instruction __b29_from___b28: +Removing instruction __b31_from___b30: +Removing instruction __b32_from___b31: +Removing instruction __b34_from___b33: +Removing instruction toDd001_from___b1: +Removing instruction toDd001: +Removing instruction toD0181_from___b17: +Removing instruction toD0181: +Removing instruction __b19_from_CLI1: +Removing instruction __b13_from___b14: +Removing instruction __b13_from___b15: +Removing instruction __b13_from___b36: +Removing instruction __b3_from___b2: +Removing instruction __b3_from___b4: +Removing instruction __b14_from___b6: +Removing instruction __b15_from___b14: +Removing instruction __b16_from___b15: +Removing instruction level_show_from___b16: +Removing instruction __b18_from___b9: +Removing instruction __b8_from___b1: +Removing instruction __b13_from___b14: +Removing instruction __b13_from___b15: +Removing instruction __b13_from___b9: +Removing instruction __breturn_from_level_tile_directions: +Removing instruction __b6_from___b5: +Removing instruction __b1_from___b6: +Removing instruction __b1_from_choose_direction: +Removing instruction __b2_from___b10: +Removing instruction __b2_from___b11: +Removing instruction __b3_from___b12: +Removing instruction __b3_from___b13: +Removing instruction __b14_from___b9: +Removing instruction __b14: +Removing instruction __b4_from___b14: +Removing instruction __b4_from___b3: +Removing instruction __breturn: +Removing instruction __b2_from___b1: +Removing instruction __b2_from___b3: +Removing instruction __b14_from___b19: +Removing instruction __b17_from___b15: +Removing instruction __b4_from___b3: +Removing instruction __b4_from___b8: +Removing instruction __b10_from___b12: +Removing instruction __b10_from___b13: +Removing instruction __b10_from___b4: +Removing instruction __b1_from___b10: +Removing instruction __b6_from___b7: +Removing instruction __b10_from___b2: +Removing instruction __b4_from___b10: +Removing instruction __b8_from___b6: +Removing instruction __b8_from___b9: +Removing instruction __b1_from_joyfire: +Removing instruction __breturn_from___b1: +Removing instruction __b9_from___b13: +Removing instruction __b5_from___b9: +Removing instruction __b6_from___b10: +Removing instruction __b6_from___b14: +Removing instruction __b7_from___b11: +Removing instruction __b7_from___b15: +Removing instruction __b8_from___b12: +Removing instruction __b8_from___b16: +Removing instruction __b5_from___b3: +Removing instruction __b5_from___b7: +Removing instruction __b6_from___b5: +Removing instruction __b6_from___b8: +Removing instruction __breturn_from_level_tile_get: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction __init1: +Removing instruction __b1: +Removing instruction __breturn: +Removing instruction __b5: +Removing instruction __b7: +Removing instruction __b4: +Removing instruction __b8: +Removing instruction splash_run_from_main: +Removing instruction gameplay_run_from___b1: +Removing instruction __b2: +Removing instruction __b8: +Removing instruction __b9: +Removing instruction __b10: +Removing instruction __b11: +Removing instruction __b12: +Removing instruction __b13: +Removing instruction __b161: +Removing instruction __b15: +Removing instruction __b16: +Removing instruction __b17: +Removing instruction __b18: +Removing instruction __b19: +Removing instruction __b60: +Removing instruction __b61: +Removing instruction __b62: +Removing instruction __b162: +Removing instruction __b163: +Removing instruction __b164: +Removing instruction __b165: +Removing instruction __b68: +Removing instruction __b69: +Removing instruction __b70: +Removing instruction __b71: +Removing instruction __b63: +Removing instruction __b58: +Removing instruction __b59: +Removing instruction __b20: +Removing instruction __b21: +Removing instruction __b22: +Removing instruction __b23: +Removing instruction __b24: +Removing instruction __b166: +Removing instruction __b83: +Removing instruction level_tile_directions_from___b83: +Removing instruction __b152: +Removing instruction __b84: +Removing instruction __b85: +Removing instruction __b80_from___b85: +Removing instruction choose_direction_from___b80: +Removing instruction __b153: +Removing instruction __b86: +Removing instruction __b87: +Removing instruction __b88: +Removing instruction __b25: +Removing instruction __b26: +Removing instruction __b27: +Removing instruction __b28: +Removing instruction __b29: +Removing instruction __b167: +Removing instruction __b100: +Removing instruction level_tile_directions_from___b100: +Removing instruction __b154: +Removing instruction __b101: +Removing instruction __b102: +Removing instruction __b97_from___b102: +Removing instruction choose_direction_from___b97: +Removing instruction __b155: +Removing instruction __b103: +Removing instruction __b104: +Removing instruction __b105: +Removing instruction __b30: +Removing instruction __b31: +Removing instruction __b32: +Removing instruction __b33: +Removing instruction __b34: +Removing instruction __b168: +Removing instruction __b117: +Removing instruction level_tile_directions_from___b117: +Removing instruction __b156: +Removing instruction __b118: +Removing instruction __b119: +Removing instruction __b114_from___b119: +Removing instruction choose_direction_from___b114: +Removing instruction __b157: +Removing instruction __b120: +Removing instruction __b121: +Removing instruction __b122: +Removing instruction __b35: +Removing instruction __b36: +Removing instruction __b37: +Removing instruction __b38: +Removing instruction __b39: +Removing instruction __b169: +Removing instruction __b134: +Removing instruction level_tile_directions_from___b134: +Removing instruction __b158: +Removing instruction __b135: +Removing instruction __b136: +Removing instruction __b131_from___b136: +Removing instruction choose_direction_from___b131: +Removing instruction __b159: +Removing instruction __b137: +Removing instruction __b138: +Removing instruction __b139: +Removing instruction __b40: +Removing instruction __b41: +Removing instruction __b42: +Removing instruction __b43: +Removing instruction __b170: +Removing instruction level_tile_directions_from___b147: +Removing instruction __b160: +Removing instruction __b148: +Removing instruction __b149: +Removing instruction __b150: +Removing instruction __b151: +Removing instruction __b1: +Removing instruction __b2: +Removing instruction SEI1: +Removing instruction __b16: +Removing instruction memset_from___b16: +Removing instruction __b20: +Removing instruction __b21: +Removing instruction __b22: +Removing instruction merge_code_from___b22: +Removing instruction __b23: +Removing instruction memset_from___b23: +Removing instruction __b24: +Removing instruction __b25: +Removing instruction init_render_index_from___b25: +Removing instruction __b26: +Removing instruction __b27: +Removing instruction splash_show_from___b27: +Removing instruction __b28: +Removing instruction memset_from___b28: +Removing instruction __b29: +Removing instruction init_bobs_restore_from___b29: +Removing instruction __b30: +Removing instruction __b31: +Removing instruction init_sprite_pointers_from___b31: +Removing instruction __b32: +Removing instruction memcpy_from___b32: +Removing instruction __b33: +Removing instruction __b34: +Removing instruction memset_from___b34: +Removing instruction __b35: +Removing instruction __b1_from___b35: +Removing instruction __b17: +Removing instruction __b18: +Removing instruction __b5_from___b18: +Removing instruction __b7: +Removing instruction __b8_from___b7: +Removing instruction __b10: +Removing instruction __b12: +Removing instruction CLI1: +Removing instruction __b19: +Removing instruction __b36: +Removing instruction __b37: +Removing instruction __breturn: +Removing instruction __b15: +Removing instruction __b8_from___b9: +Removing instruction __b5_from___b6: +Removing instruction __b4: +Removing instruction __b1_from___b3: +Removing instruction SEI1: +Removing instruction __b1_from_SEI1: +Removing instruction __b3: +Removing instruction __b4_from___b3: +Removing instruction __b6: +Removing instruction __b14: +Removing instruction init_level_tile_directions_from___b14: +Removing instruction __b15: +Removing instruction init_sprite_pointers_from___b15: +Removing instruction __b16: +Removing instruction __b17: +Removing instruction __b7_from___b17: +Removing instruction __b9: +Removing instruction __b18: +Removing instruction __b19: +Removing instruction __b12: +Removing instruction CLI1: +Removing instruction __b20: +Removing instruction __b7_from___b8: +Removing instruction __b4_from___b5: +Removing instruction __b1_from___b2: +Removing instruction __b2_from_done_run: +Removing instruction __b4_from___b2: +Removing instruction __b6: +Removing instruction __b7: +Removing instruction __b9: +Removing instruction __b17: +Removing instruction __breturn: +Removing instruction __b15: +Removing instruction __b12: +Removing instruction __b8_from___b12: +Removing instruction render_from___b11: +Removing instruction __b16: +Removing instruction __b10_from___b16: +Removing instruction __b4_from___b5: +Removing instruction __b2_from___b3: +Removing instruction __breturn: +Removing instruction __b2: +Removing instruction __b1: +Removing instruction __breturn_from___b1: +Removing instruction __b5: +Removing instruction __b6: +Removing instruction __b7: +Removing instruction __b2_from___b7: +Removing instruction __b8: +Removing instruction __b3_from___b8: +Removing instruction __b9: +Removing instruction __b4_from___b9: +Removing instruction __b1: +Removing instruction __breturn: +Removing instruction __b1_from_merge_code: +Removing instruction __b3: +Removing instruction __b14: +Removing instruction __b16: +Removing instruction __breturn: +Removing instruction __b17: +Removing instruction __b19: +Removing instruction __b5: +Removing instruction __b13: +Removing instruction __b21: +Removing instruction __b10_from___b21: +Removing instruction __b6: +Removing instruction __b8: +Removing instruction __b1_from_init_render_index: +Removing instruction __b3: +Removing instruction __breturn: +Removing instruction __b10: +Removing instruction __b5_from___b4: +Removing instruction __b7: +Removing instruction __b1_from___b7: +Removing instruction __b9: +Removing instruction __b5_from___b8: +Removing instruction __b1_from_splash_show: +Removing instruction __breturn: +Removing instruction __b4: +Removing instruction __b1_from___b4: +Removing instruction render_from___b3: +Removing instruction __b5: +Removing instruction __b2_from___b5: +Removing instruction __b1_from_init_bobs_restore: +Removing instruction __b2: +Removing instruction __breturn: +Removing instruction __b5: +Removing instruction __b1_from___b5: +Removing instruction __b3_from___b4: +Removing instruction __b1_from_init_sprite_pointers: +Removing instruction __breturn: +Removing instruction __b4: +Removing instruction __b1_from___b4: +Removing instruction __b2_from___b3: +Removing instruction __b1_from_memcpy: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction __breturn: +Removing instruction __breturn_from_joyfire: +Removing instruction __b1_from_init_level_tile_directions: +Removing instruction __breturn: +Removing instruction __b4: +Removing instruction __b1_from___b4: +Removing instruction level_tile_get_from___b3: +Removing instruction __b13: +Removing instruction __b9: +Removing instruction level_tile_get_from___b5: +Removing instruction __b14: +Removing instruction __b10: +Removing instruction level_tile_get_from___b6: +Removing instruction __b15: +Removing instruction __b11: +Removing instruction level_tile_get_from___b7: +Removing instruction __b16: +Removing instruction __b12: +Removing instruction __b2_from___b8: +Removing instruction __b1_from_level_show: +Removing instruction __breturn: +Removing instruction __b4: +Removing instruction __b1_from___b4: +Removing instruction __b7: +Removing instruction __b8: +Removing instruction __b9: +Removing instruction __b2_from___b9: +Removing instruction __breturn: +Removing instruction __b1_from_render: +Removing instruction __b3: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Removing instruction __b2: +Removing instruction __b1: +Removing instruction __breturn_from___b1: +Removing instruction __b1_from_render_tiles: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Succesful ASM optimization Pass5UnusedLabelElimination +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __b4 +Skipping double jump to __b1 in jmp __b1_from___b2 +Replacing jump to rts with rts in jmp __breturn +Replacing jump to rts with rts in jmp __breturn +Succesful ASM optimization Pass5DoubleJumpElimination +Relabelling long label __b47_from___b59 to __b8 +Relabelling long label __b47_from___b46 to __b9 +Relabelling long label __b80_from___b84 to __b10 +Relabelling long label __b97_from___b101 to __b11 +Relabelling long label __b114_from___b118 to __b12 +Relabelling long label __b131_from___b135 to __b13 +Relabelling long label __b8_from___b7 to __b6 +Relabelling long label __b10_from___b8 to __b7 +Relabelling long label __breturn_from___b2 to __b1 +Relabelling long label __b1_from___b5 to __b5 +Relabelling long label __b14_from___b3 to __b3 +Relabelling long label __b17_from___b18 to __b5 +Relabelling long label __b10_from___b5 to __b6 +Relabelling long label __b1_from___b2 to __b8 +Relabelling long label __b6_from___b9 to __b13 +Relabelling long label __b4_from___b2 to __b3 +Relabelling long label __b2_from___b1 to __b4 +Relabelling long label __b3_from___b1 to __b2 +Relabelling long label __b2_from___b1 to __b4 +Relabelling long label __b2_from___b1 to __b4 +Relabelling long label __b5_from___b13 to __b9 +Relabelling long label __b2_from___b1 to __b4 +Relabelling long label __breturn_from___b2 to __b1 +Succesful ASM optimization Pass5RelabelLongLabels +Removing instruction ldy.z pacman_xtile +Replacing instruction ldx #0 with TAX +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Removing instruction __breturn: +Removing instruction __b8: +Removing instruction __breturn: +Removing instruction __breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Fixing long branch [802] bcs __breturn to bcc +Fixing long branch [916] bne __b50 to beq +Fixing long branch [925] bcc __b9 to bcs +Fixing long branch [936] bcc __b9 to bcs +Fixing long branch [1032] bne __breturn to beq +Fixing long branch [1054] bne __breturn to beq +Fixing long branch [1154] bne __breturn to beq +Fixing long branch [1176] bne __breturn to beq +Fixing long branch [1277] bne __breturn to beq +Fixing long branch [1299] bne __breturn to beq +Fixing long branch [1401] bne __breturn to beq +Fixing long branch [1423] bne __breturn to beq +Fixing long branch [1499] bne __breturn to beq +Fixing long branch [533] beq __b2 to bne +Fixing long branch [538] beq __b3 to bne +Fixing long branch [543] beq __b4 to bne +Fixing long branch [548] beq __b5 to bne +Fixing long branch [553] beq __b6 to bne +Fixing long branch [558] beq __b7 to bne +Fixing long branch [679] beq __b45 to bne +Fixing long branch [684] beq __b46 to bne +Fixing long branch [731] beq __b49 to bne +Fixing long branch [778] bcc __b51 to bcs +Fixing long branch [967] bne __b72 to beq +Fixing long branch [973] beq __b73 to bne +Fixing long branch [978] beq __b74 to bne +Fixing long branch [983] beq __b75 to bne +Fixing long branch [1097] bne __b89 to beq +Fixing long branch [1103] beq __b90 to bne +Fixing long branch [1108] beq __b91 to bne +Fixing long branch [1113] beq __b92 to bne +Fixing long branch [1228] bne __b106 to beq +Fixing long branch [1234] beq __b107 to bne +Fixing long branch [1239] beq __b108 to bne +Fixing long branch [1244] beq __b109 to bne +Fixing long branch [1359] bne __b123 to beq +Fixing long branch [1366] beq __b124 to bne +Fixing long branch [1371] beq __b125 to bne +Fixing long branch [1376] beq __b126 to bne +Fixing long branch [1710] bcc __b2 to bcs +Fixing long branch [1875] bcc __b2 to bcs +Fixing long branch [1891] bcc __b5 to bcs +Fixing long branch [2017] bcc __b3 to bcs +Fixing long branch [2384] bne __b2 to beq + +FINAL SYMBOL TABLE +const byte* ABS[$100] = kickasm {{ .for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + }} +const byte* ABS_POST[1] = { 0 } +const byte* ABS_PRE[1] = { 1 } +const nomodify byte* BANK_1 = (byte*) 16384 +const nomodify byte* BANK_2 = (byte*) 49152 +const nomodify byte BLACK = 0 +const nomodify byte BLUE = 6 +const byte* BOB_GRAPHICS_CRUNCHED[] = kickasm( uses BOB_MASK_LEFT) {{ .modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + }} +const nomodify byte* BOB_MASK_LEFT = (byte*) 21504 +const nomodify byte* BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 +const nomodify byte* BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c +const nomodify byte* BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 +const nomodify byte BOB_ROW_SIZE = $80 +const nomodify byte* BORDER_COLOR = (byte*) 53280 +const byte* BYTEBOOZER[] = kickasm {{ .const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + }} +const byte CHASE = 0 +const nomodify struct MOS6526_CIA* CIA1 = (struct MOS6526_CIA*) 56320 +const nomodify byte* CIA1_INTERRUPT = (byte*) 56333 +const nomodify struct MOS6526_CIA* CIA2 = (struct MOS6526_CIA*) 56576 +const nomodify byte CIA_INTERRUPT_CLEAR = $7f +const byte DIRECTION::DOWN = 8 +const byte DIRECTION::LEFT = $10 +const byte DIRECTION::RIGHT = $20 +const byte DIRECTION::STOP = 0 +const byte DIRECTION::UP = 4 +const byte* DIRECTION_ELIMINATE[$21] = { $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef } +const byte* DIRECTION_REVERSE[$21] = { 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 } +const byte* DIRECTION_SINGLE[$40] = { 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 } +const byte DOWN = 8 +const byte EMPTY = 0 +const byte FRIGHTENED = 2 +const nomodify byte* GAMEOVER_GFX = (byte*) 42752 +const byte* GAMEOVER_GFX_CRUNCHED[] = kickasm( uses GAMEOVER_GFX) {{ .modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + }} +const byte GHOSTS_MODE::CHASE = 0 +const byte GHOSTS_MODE::FRIGHTENED = 2 +const byte GHOSTS_MODE::SCATTER = 1 +const nomodify void()** HARDWARE_IRQ = (void()**) 65534 +const nomodify byte* INTRO_MUSIC = (byte*) 12288 +const byte* INTRO_MUSIC_CRUNCHED[] = kickasm( uses INTRO_MUSIC) {{ .modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + }} +const nomodify word INTRO_MUSIC_CRUNCHED_SIZE = $600 +const nomodify byte* INTRO_MUSIC_CRUNCHED_UPPER = (byte*) 42752 +const nomodify byte IRQ_RASTER = 1 +const nomodify byte IRQ_SCREEN_TOP_LINE = 5 +const nomodify byte* IRQ_STATUS = (byte*) 53273 +const byte LEFT = $10 +const nomodify byte* LEVEL_TILES = (byte*) 18432 +const byte* LEVEL_TILES_CRUNCHED[] = kickasm( uses LEVEL_TILES) {{ .modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + }} +const nomodify byte* LEVEL_TILES_DIRECTIONS = (byte*) 15872 +const word* LEVEL_YTILE_OFFSET[$25] = { 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 } +const byte* LOGIC_CODE_CRUNCHED[] = kickasm( uses bobs_xcol uses bobs_yfine uses bobs_bob_id uses bobs_restore uses RENDER_INDEX uses RENDER_OFFSET_CANVAS_LO uses RENDER_OFFSET_CANVAS_HI uses RENDER_OFFSET_YPOS_INC uses SIZE_BOB_RESTORE uses BOB_ROW_SIZE uses NUM_BOBS uses left_render_index_xcol uses left_canvas uses left_ypos_inc_offset uses rigt_render_index_xcol uses rigt_canvas uses rigt_ypos_inc_offset uses BOB_MASK_LEFT uses BOB_PIXEL_LEFT uses BOB_MASK_RIGT uses BOB_PIXEL_RIGT uses canvas_base_hi uses bobs_restore_base uses RENDER_YPOS_INC uses logic_tile_ptr uses logic_tile_xcol uses logic_tile_yfine uses logic_tile_left_idx uses logic_tile_right_idx) {{ .macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + }} +const nomodify byte* LOGIC_CODE_UNMERGED = (byte*) 57344 +const nomodify byte NUM_BOBS = 5 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 +const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d +const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 +const byte OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 +const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 +const byte OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 +const byte OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 +const byte OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 +const byte* PACMAN_CH1_CONTROL[] = { $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 } +const byte* PACMAN_CH1_FREQ_HI[] = { $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 } +const byte PILL = 1 +const byte POWERUP = 2 +const nomodify byte* PROCPORT = (byte*) 1 +const nomodify byte* PROCPORT_DDR = (byte*) 0 +const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 +const nomodify byte PROCPORT_RAM_ALL = 0 +const nomodify byte PROCPORT_RAM_IO = 5 +const nomodify byte* RASTER = (byte*) 53266 +const nomodify byte* RASTER_CODE = (byte*) 32768 +const byte* RASTER_CODE_CRUNCHED[] = kickasm( uses VICII_CONTROL2 uses BORDER_COLOR uses RASTER_CODE_UNMERGED uses side_sprites_color uses side_sprites_mc uses bottom_sprites_color uses bottom_sprites_mc) {{ .macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + }} +const nomodify byte* RASTER_CODE_UNMERGED = (byte*) 24576 +const nomodify byte RED = 2 +const nomodify byte* RENDER_INDEX = (byte*) 46592 +const nomodify byte RENDER_OFFSET_CANVAS_HI = $50 +const nomodify byte RENDER_OFFSET_CANVAS_LO = 0 +const nomodify byte RENDER_OFFSET_YPOS_INC = $a0 +const byte** RENDER_XCOLS[$1a] = { (byte*) 0, (byte*) 1, (byte*) 2, (byte*) 1024, (byte*) 1025, (byte*) 1026, (byte*) 2048, (byte*) 2049, (byte*) 2050, (byte*) 3072, (byte*) 3073, (byte*) 3074, (byte*) 4096, (byte*) 4097, (byte*) 4098, (byte*) 5120, (byte*) 5121, (byte*) 5122, (byte*) 6144, (byte*) 6145, (byte*) 6146, (byte*) 7168, (byte*) 7169, (byte*) 7170, (byte*) 0, (byte*) 0 } +const word* RENDER_YPOS[$95] = { 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, (word)$40+3, (word)$40+9, (word)$40+$f, (word)$40+$15, (word)$40+$1b, (word)$40+$21, (word)$40+$27, (word)$40+$2d, (word)$40+$33, (word)$40+$39, $80, (word)$80+6, (word)$80+$c, (word)$80+$12, (word)$80+$18, (word)$80+$1e, (word)$80+$24, (word)$80+$2a, (word)$80+$30, (word)$80+$36, (word)$80+$3c, (word)$c0+3, (word)$c0+9, (word)$c0+$f, (word)$c0+$15, (word)$c0+$1b, (word)$c0+$21, (word)$c0+$27, (word)$c0+$2d, (word)$c0+$33, (word)$c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39 } +const word* RENDER_YPOS_9TH[$95] = { 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, (word)$40+6, (word)$40+$c, (word)$40+$12, (word)$40+$18, (word)$40+$1e, (word)$40+$24, (word)$40+$2a, (word)$40+$30, (word)$40+$36, (word)$40+$3c, (word)$80+3, (word)$80+9, (word)$80+$f, (word)$80+$15, (word)$80+$1b, (word)$80+$21, (word)$80+$27, (word)$80+$2d, (word)$80+$33, (word)$80+$39, $c0, (word)$c0+6, (word)$c0+$c, (word)$c0+$12, (word)$c0+$18, (word)$c0+$1e, (word)$c0+$24, (word)$c0+$2a, (word)$c0+$30, (word)$c0+$36, (word)$c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c } +const byte* RENDER_YPOS_INC[$a0] = { 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 } +const byte RIGHT = $20 +const byte SCATTER = 1 +const nomodify byte* SCREENS_1 = (byte*) 16384 +const nomodify byte* SCREENS_2 = (byte*) 49152 +const nomodify struct MOS6581_SID* SID = (struct MOS6581_SID*) 54272 +const nomodify byte* SID_CH1_FREQ_HI = (byte*) 54273 +const byte SIZEOF_BYTE = 1 +const nomodify byte SIZE_BOB_RESTORE = $12 +const nomodify byte* SPLASH = (byte*) 16384 +const byte* SPLASH_CRUNCHED[] = kickasm( uses SPLASH) {{ .modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + }} +const nomodify byte* SPRITES_1 = (byte*) 24576 +const nomodify byte* SPRITES_2 = (byte*) 57344 +const nomodify byte* SPRITES_COLOR = (byte*) 53287 +const nomodify byte* SPRITES_XPOS = (byte*) 53248 +const nomodify byte* SPRITES_YPOS = (byte*) 53249 +const byte STOP = 0 +const nomodify byte* TILES_LEFT = LEVEL_TILES+$a00 +const nomodify byte* TILES_RIGHT = LEVEL_TILES+$a80 +const nomodify byte* TILES_TYPE = LEVEL_TILES+$b00 +const byte TILE_TYPE::EMPTY = 0 +const byte TILE_TYPE::PILL = 1 +const byte TILE_TYPE::POWERUP = 2 +const byte TILE_TYPE::WALL = 4 +const byte UP = 4 +const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 +const nomodify byte VICII_BMM = $20 +const nomodify byte* VICII_CONTROL1 = (byte*) 53265 +const nomodify byte* VICII_CONTROL2 = (byte*) 53270 +const nomodify byte VICII_DEN = $10 +const nomodify byte VICII_ECM = $40 +const nomodify byte* VICII_MEMORY = (byte*) 53272 +const nomodify byte VICII_RSEL = 8 +const nomodify byte VICII_RST8 = $80 +const byte WALL = 4 +const nomodify byte* WIN_GFX = (byte*) 42752 +const byte* WIN_GFX_CRUNCHED[] = kickasm( uses WIN_GFX) {{ .modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + }} +const nomodify byte YELLOW = 7 +void __start() +volatile byte anim_frame_idx loadstore zp[1]:46 0.9019607843137255 +const byte* bobs_bob_id[NUM_BOBS] = { 0, 0, 0, 0, 0 } +const byte* bobs_restore[NUM_BOBS*SIZE_BOB_RESTORE*2] = { fill( NUM_BOBS*SIZE_BOB_RESTORE*2, 0) } +volatile byte bobs_restore_base loadstore zp[1]:32 1070.0 +const byte* bobs_xcol[NUM_BOBS] = { $a, $a, $a, $a, $a } +const byte* bobs_yfine[NUM_BOBS] = { $2d, $2d, $2d, $2d, $2d } +volatile byte bottom_sprites_color loadstore zp[1]:37 11040.0 +volatile byte bottom_sprites_mc loadstore zp[1]:38 11040.0 +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +volatile byte* byteboozer_decrunch::crunched loadstore zp[2]:87 438.5 +volatile byte canvas_base_hi loadstore zp[1]:31 1070.0 +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +byte~ choose_direction::$2 reg byte a 202.0 +byte~ choose_direction::$4 reg byte a 202.0 +byte~ choose_direction::$6 reg byte a 202.0 +byte~ choose_direction::$8 reg byte a 202.0 +byte choose_direction::direction +byte choose_direction::direction#10 direction zp[1]:83 28.857142857142858 +byte choose_direction::direction#6 direction zp[1]:83 67.33333333333333 +byte choose_direction::direction#8 direction zp[1]:83 57.714285714285715 +byte choose_direction::dist_down +byte choose_direction::dist_down#0 reg byte x 151.5 +byte choose_direction::dist_left +byte choose_direction::dist_left#0 dist_left zp[1]:80 151.5 +byte choose_direction::dist_min +byte choose_direction::dist_min#10 reg byte x 121.2 +byte choose_direction::dist_min#11 dist_min zp[1]:80 101.0 +byte choose_direction::dist_min#13 reg byte x 202.0 +byte choose_direction::dist_min#14 reg byte x 202.0 +byte choose_direction::dist_min#17 dist_min zp[1]:80 202.0 +byte choose_direction::dist_min#18 dist_min zp[1]:80 202.0 +byte choose_direction::dist_min#6 reg byte y 80.8 +byte choose_direction::dist_right +byte choose_direction::dist_right#0 reg byte a 202.0 +byte choose_direction::dist_up +byte choose_direction::dist_up#0 reg byte y 101.0 +byte choose_direction::ghost_xtile +byte choose_direction::ghost_xtile#0 reg byte y 5.5 +byte choose_direction::ghost_xtile#1 reg byte y 5.5 +byte choose_direction::ghost_xtile#2 reg byte y 5.5 +byte choose_direction::ghost_xtile#3 reg byte y 5.5 +byte choose_direction::ghost_xtile#4 reg byte y 145.0 +byte choose_direction::ghost_ytile +byte choose_direction::ghost_ytile#0 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#1 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#2 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#3 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#4 ghost_ytile zp[1]:4 72.5 +byte choose_direction::open_directions +byte choose_direction::open_directions#0 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#1 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#10 open_directions zp[1]:79 19.478260869565215 +byte choose_direction::open_directions#2 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#3 open_directions zp[1]:79 4.4 +byte choose_direction::return +byte choose_direction::return#0 reg byte a 22.0 +byte choose_direction::return#1 reg byte a 22.0 +byte choose_direction::return#10 return zp[1]:83 41.0 +byte choose_direction::return#2 reg byte a 22.0 +byte choose_direction::return#3 reg byte a 22.0 +byte choose_direction::target_xtile +byte choose_direction::target_xtile#0 reg byte x 11.0 +byte choose_direction::target_xtile#1 reg byte x 11.0 +byte choose_direction::target_xtile#2 reg byte x 11.0 +byte choose_direction::target_xtile#3 reg byte x 11.0 +byte choose_direction::target_xtile#4 reg byte x 145.0 +byte choose_direction::target_ytile +byte choose_direction::target_ytile#0 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#1 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#2 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#3 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#4 target_ytile zp[1]:3 72.5 +byte choose_direction::xdiff +byte choose_direction::xdiff#0 xdiff zp[1]:93 21.041666666666664 +byte choose_direction::ydiff +byte choose_direction::ydiff#0 ydiff zp[1]:4 21.956521739130434 +void done_run() +byte~ done_run::$8 reg byte a 2000002.0 +byte* done_run::gfx +byte* done_run::gfx#1 gfx zp[2]:89 333333.6666666667 +byte* done_run::gfx#2 gfx zp[2]:89 800001.25 +byte* done_run::gfx#4 gfx zp[2]:89 100001.0 +byte done_run::i +byte done_run::i#1 reg byte x 200002.0 +byte done_run::i#2 reg byte x 133334.66666666666 +byte done_run::i1 +byte done_run::i1#1 reg byte x 200002.0 +byte done_run::i1#2 reg byte x 120001.2 +byte done_run::pixels +byte done_run::pixels#0 reg byte x 500000.5 +byte done_run::xcol +byte done_run::xcol#1 xcol zp[1]:5 200002.0 +byte done_run::xcol#2 xcol zp[1]:5 118182.18181818182 +byte done_run::ypos +byte done_run::ypos#1 ypos zp[1]:6 2000002.0 +byte done_run::ypos#2 ypos zp[1]:6 500000.5 +volatile byte frame loadstore zp[1]:45 0.5 +void game_logic() +byte~ game_logic::$119 reg byte a 22.0 +byte~ game_logic::$14 reg byte x 22.0 +byte~ game_logic::$140 reg byte a 22.0 +byte~ game_logic::$15 reg byte a 22.0 +byte~ game_logic::$161 reg byte a 22.0 +byte~ game_logic::$17 reg byte a 22.0 +byte~ game_logic::$18 reg byte x 22.0 +byte~ game_logic::$182 reg byte a 22.0 +byte~ game_logic::$19 reg byte x 11.0 +byte~ game_logic::$199 reg byte a 22.0 +byte~ game_logic::$2 reg byte x 22.0 +byte~ game_logic::$20 reg byte a 22.0 +byte~ game_logic::$200 reg byte a 22.0 +byte~ game_logic::$204 reg byte a 22.0 +byte~ game_logic::$21 reg byte a 22.0 +byte~ game_logic::$210 zp[1]:80 2.588235294117647 +byte~ game_logic::$220 reg byte x 11.0 +byte~ game_logic::$223 reg byte x 11.0 +byte~ game_logic::$226 reg byte x 11.0 +byte~ game_logic::$229 reg byte x 11.0 +byte~ game_logic::$232 reg byte x 11.0 +byte~ game_logic::$25 reg byte a 22.0 +byte~ game_logic::$26 reg byte x 22.0 +byte~ game_logic::$27 reg byte x 11.0 +byte~ game_logic::$28 reg byte a 22.0 +byte~ game_logic::$29 reg byte a 22.0 +byte~ game_logic::$3 reg byte a 22.0 +byte~ game_logic::$31 reg byte a 22.0 +byte~ game_logic::$32 reg byte x 22.0 +byte~ game_logic::$33 reg byte x 11.0 +byte~ game_logic::$34 reg byte a 22.0 +byte~ game_logic::$35 reg byte a 22.0 +byte~ game_logic::$37 reg byte a 22.0 +byte~ game_logic::$38 reg byte x 22.0 +byte~ game_logic::$39 reg byte x 11.0 +byte~ game_logic::$40 reg byte a 22.0 +byte~ game_logic::$41 reg byte a 22.0 +byte~ game_logic::$43 reg byte a 22.0 +byte~ game_logic::$44 reg byte x 22.0 +byte~ game_logic::$45 reg byte x 11.0 +byte~ game_logic::$46 reg byte a 22.0 +byte~ game_logic::$47 reg byte a 22.0 +byte~ game_logic::$65 reg byte a 22.0 +byte~ game_logic::$66 reg byte a 22.0 +byte*~ game_logic::$67 zp[2]:81 22.0 +byte~ game_logic::$68 reg byte a 22.0 +byte~ game_logic::$69 reg byte a 22.0 +byte~ game_logic::$70 reg byte a 22.0 +byte*~ game_logic::$71 zp[2]:81 22.0 +byte~ game_logic::$72 reg byte a 22.0 +byte~ game_logic::$75 reg byte x 11.0 +byte~ game_logic::$77 reg byte y 11.0 +byte~ game_logic::$80 reg byte x 11.0 +byte~ game_logic::$82 reg byte y 11.0 +byte~ game_logic::$85 reg byte x 11.0 +byte~ game_logic::$87 reg byte y 11.0 +byte~ game_logic::$90 reg byte x 11.0 +byte~ game_logic::$92 reg byte y 11.0 +byte game_logic::do_reverse +byte game_logic::do_reverse#4 reg byte a 11.0 +byte game_logic::ghost1_bob_xfine +byte game_logic::ghost1_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost1_xtile +byte game_logic::ghost1_xtile#0 ghost1_xtile zp[1]:86 2.357142857142857 +byte game_logic::ghost1_ytile +byte game_logic::ghost1_ytile#0 ghost1_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost2_bob_xfine +byte game_logic::ghost2_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost2_xtile +byte game_logic::ghost2_xtile#0 ghost2_xtile zp[1]:85 2.357142857142857 +byte game_logic::ghost2_ytile +byte game_logic::ghost2_ytile#0 ghost2_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost3_bob_xfine +byte game_logic::ghost3_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost3_xtile +byte game_logic::ghost3_xtile#0 ghost3_xtile zp[1]:84 2.357142857142857 +byte game_logic::ghost3_ytile +byte game_logic::ghost3_ytile#0 ghost3_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost4_bob_xfine +byte game_logic::ghost4_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost4_xtile +byte game_logic::ghost4_xtile#0 ghost4_xtile zp[1]:83 2.357142857142857 +byte game_logic::ghost4_ytile +byte game_logic::ghost4_ytile#0 ghost4_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost_frame_idx +byte game_logic::ghost_frame_idx#0 ghost_frame_idx zp[1]:2 16.5 +byte game_logic::ghost_frame_idx#1 ghost_frame_idx zp[1]:2 22.0 +byte game_logic::ghost_frame_idx#2 ghost_frame_idx zp[1]:2 1.9999999999999998 +byte game_logic::joy_directions +byte game_logic::joy_directions#0 reg byte a 16.5 +byte game_logic::new_direction +byte game_logic::new_direction#0 reg byte a 16.5 +byte game_logic::open_directions +byte game_logic::open_directions#0 reg byte a 22.0 +byte game_logic::open_directions#1 reg byte y 5.5 +byte game_logic::open_directions1 +byte game_logic::open_directions1#0 reg byte a 22.0 +byte game_logic::open_directions1#1 reg byte y 5.5 +byte game_logic::open_directions2 +byte game_logic::open_directions2#0 reg byte a 22.0 +byte game_logic::open_directions2#1 reg byte y 5.5 +byte game_logic::open_directions3 +byte game_logic::open_directions3#0 reg byte a 22.0 +byte game_logic::open_directions3#1 reg byte y 5.5 +byte game_logic::open_directions4 +byte game_logic::open_directions4#0 reg byte x 3.666666666666667 +byte game_logic::pacman_bob_xfine +byte game_logic::pacman_bob_xfine#0 reg byte y 5.5 +byte game_logic::pacman_xtile +byte game_logic::pacman_xtile#0 pacman_xtile zp[1]:79 6.769230769230768 +byte game_logic::pacman_xtile1 +byte game_logic::pacman_xtile1#0 reg byte x 11.0 +byte game_logic::pacman_ytile +byte game_logic::pacman_ytile#0 reg byte a 22.0 +byte game_logic::pacman_ytile1 +byte game_logic::pacman_ytile1#0 reg byte a 11.0 +byte game_logic::target_xtile +byte game_logic::target_xtile#2 reg byte x 11.0 +byte game_logic::target_xtile#3 reg byte x 5.5 +byte game_logic::target_xtile1 +byte game_logic::target_xtile1#2 reg byte x 11.0 +byte game_logic::target_xtile1#3 reg byte x 5.5 +byte game_logic::target_xtile2 +byte game_logic::target_xtile2#2 reg byte x 11.0 +byte game_logic::target_xtile2#3 reg byte x 5.5 +byte game_logic::target_xtile3 +byte game_logic::target_xtile3#2 reg byte x 11.0 +byte game_logic::target_xtile3#3 reg byte x 5.5 +byte game_logic::target_ytile +byte game_logic::target_ytile#2 target_ytile zp[1]:3 22.0 +byte game_logic::target_ytile#3 target_ytile zp[1]:3 4.4 +byte game_logic::target_ytile1 +byte game_logic::target_ytile1#2 target_ytile1 zp[1]:3 22.0 +byte game_logic::target_ytile1#3 target_ytile1 zp[1]:3 4.4 +byte game_logic::target_ytile2 +byte game_logic::target_ytile2#2 target_ytile2 zp[1]:3 22.0 +byte game_logic::target_ytile2#3 target_ytile2 zp[1]:3 4.4 +byte game_logic::target_ytile3 +byte game_logic::target_ytile3#2 target_ytile3 zp[1]:3 22.0 +byte game_logic::target_ytile3#3 target_ytile3 zp[1]:3 4.4 +byte game_logic::tile_id +byte game_logic::tile_id#0 reg byte x 16.5 +byte* game_logic::ytiles +byte* game_logic::ytiles#0 ytiles zp[2]:81 5.5 +volatile byte game_logic_substep loadstore zp[1]:77 2.947368421052632 +volatile byte game_playable loadstore zp[1]:78 69.48275862068965 +void gameplay_run() +word~ gameplay_run::$4 zp[2]:11 2002.0 +byte gameplay_run::i +byte gameplay_run::i#1 reg byte x 200002.0 +byte gameplay_run::i#2 reg byte x 133334.66666666666 +byte gameplay_run::i1 +byte gameplay_run::i1#1 reg byte x 200002.0 +byte gameplay_run::i1#2 reg byte x 133334.66666666666 +byte gameplay_run::i2 +byte gameplay_run::i2#1 reg byte x 200002.0 +byte gameplay_run::i2#2 reg byte x 133334.66666666666 +volatile byte ghost1_direction loadstore zp[1]:55 122.24096385542168 +volatile byte ghost1_respawn loadstore zp[1]:58 271.8378378378378 +volatile byte ghost1_reverse loadstore zp[1]:57 0.7291666666666666 +volatile byte ghost1_substep loadstore zp[1]:56 223.51111111111112 +volatile byte ghost1_xfine loadstore zp[1]:53 84.55 +volatile byte ghost1_yfine loadstore zp[1]:54 82.13008130081302 +volatile byte ghost2_direction loadstore zp[1]:61 110.28260869565217 +volatile byte ghost2_respawn loadstore zp[1]:64 264.6842105263158 +volatile byte ghost2_reverse loadstore zp[1]:63 0.7142857142857143 +volatile byte ghost2_substep loadstore zp[1]:62 218.65217391304347 +volatile byte ghost2_xfine loadstore zp[1]:59 76.28571428571428 +volatile byte ghost2_yfine loadstore zp[1]:60 74.27941176470588 +volatile byte ghost3_direction loadstore zp[1]:67 100.45544554455446 +volatile byte ghost3_respawn loadstore zp[1]:70 257.8974358974359 +volatile byte ghost3_reverse loadstore zp[1]:69 0.7 +volatile byte ghost3_substep loadstore zp[1]:68 214.0 +volatile byte ghost3_xfine loadstore zp[1]:65 69.4931506849315 +volatile byte ghost3_yfine loadstore zp[1]:66 67.7986577181208 +volatile byte ghost4_direction loadstore zp[1]:73 92.23636363636363 +volatile byte ghost4_respawn loadstore zp[1]:76 251.45000000000002 +volatile byte ghost4_reverse loadstore zp[1]:75 0.6862745098039216 +volatile byte ghost4_substep loadstore zp[1]:74 209.54166666666666 +volatile byte ghost4_xfine loadstore zp[1]:71 63.81132075471698 +volatile byte ghost4_yfine loadstore zp[1]:72 62.358024691358025 +const byte* ghost_frames[] = { 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 } +volatile byte ghosts_mode loadstore zp[1]:51 1.1044776119402984 +volatile byte ghosts_mode_count loadstore zp[1]:52 234.93023255813955 +void init_bobs_restore() +const byte* init_bobs_restore::CANVAS_HIDDEN = (byte*) 59904 +byte init_bobs_restore::bob +byte init_bobs_restore::bob#1 reg byte x 20002.0 +byte init_bobs_restore::bob#2 reg byte x 2727.5454545454545 +byte* init_bobs_restore::bob_restore +byte* init_bobs_restore::bob_restore#1 bob_restore zp[2]:11 10001.0 +byte* init_bobs_restore::bob_restore#5 bob_restore zp[2]:11 16000.7 +byte init_bobs_restore::i +byte init_bobs_restore::i#1 reg byte y 200002.0 +byte init_bobs_restore::i#2 reg byte y 133334.66666666666 +void init_level_tile_directions() +byte~ init_level_tile_directions::$11 reg byte a 2.0000002E7 +byte~ init_level_tile_directions::$15 reg byte a 2.0000002E7 +byte~ init_level_tile_directions::$3 reg byte x 2.0000002E7 +byte~ init_level_tile_directions::$7 reg byte x 2.0000002E7 +byte* init_level_tile_directions::directions +byte* init_level_tile_directions::directions#1 directions zp[2]:11 1000001.0 +byte* init_level_tile_directions::directions#7 directions zp[2]:11 315789.55263157893 +byte init_level_tile_directions::open_directions +byte init_level_tile_directions::open_directions#11 open_directions zp[1]:7 2857143.1428571427 +byte init_level_tile_directions::open_directions#12 open_directions zp[1]:7 5714286.285714285 +byte init_level_tile_directions::open_directions#13 open_directions zp[1]:7 5714286.285714285 +byte init_level_tile_directions::open_directions#2 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#3 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#4 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#8 open_directions zp[1]:7 3.0000003E7 +byte init_level_tile_directions::xtile +byte init_level_tile_directions::xtile#1 xtile zp[1]:6 2.0000002E7 +byte init_level_tile_directions::xtile#10 xtile zp[1]:6 2285714.514285714 +byte init_level_tile_directions::ytile +byte init_level_tile_directions::ytile#1 ytile zp[1]:5 2000002.0 +byte init_level_tile_directions::ytile#15 ytile zp[1]:5 1102564.282051282 +void init_render_index() +word~ init_render_index::$10 zp[2]:97 200002.0 +word~ init_render_index::$11 zp[2]:97 200002.0 +word*~ init_render_index::$12 zp[2]:97 200002.0 +byte~ init_render_index::$5 reg byte a 200002.0 +byte~ init_render_index::$6 reg byte a 200002.0 +byte~ init_render_index::$9 reg byte a 20002.0 +byte* init_render_index::canvas +byte* init_render_index::canvas#0 canvas zp[2]:97 100001.0 +byte* init_render_index::canvas_xcol +byte* init_render_index::canvas_xcol#0 canvas_xcol zp[2]:94 5789.578947368421 +byte* init_render_index::render_index +byte* init_render_index::render_index#1 render_index zp[2]:89 10001.0 +byte* init_render_index::render_index_xcol +byte* init_render_index::render_index_xcol#0 render_index_xcol zp[2]:89 1200.1200000000001 +byte* init_render_index::render_index_xcol#1 render_index_xcol_1 zp[2]:99 100001.0 +byte* init_render_index::render_index_xcol#2 render_index_xcol_1 zp[2]:99 34000.4 +byte* init_render_index::render_index_xcol#7 render_index_xcol_1 zp[2]:99 20002.0 +word* init_render_index::render_ypos_table +word* init_render_index::render_ypos_table#4 render_ypos_table zp[2]:11 4761.952380952381 +byte init_render_index::x_col +byte init_render_index::x_col#1 x_col zp[1]:5 20002.0 +byte init_render_index::x_col#2 x_col zp[1]:5 1923.2692307692307 +byte init_render_index::y_pos +byte init_render_index::y_pos#1 y_pos zp[1]:6 200002.0 +byte init_render_index::y_pos#2 y_pos zp[1]:6 18750.1875 +byte init_render_index::ypos_inc_offset +byte init_render_index::ypos_inc_offset#2 reg byte x 200002.0 +byte init_render_index::ypos_inc_offset#3 reg byte x 200002.0 +byte init_render_index::ypos_inc_offset#4 reg byte x 28182.181818181816 +byte init_render_index::ypos_inc_offset#7 reg byte x 2500.25 +byte init_render_index::ypos_inc_offset#8 reg byte x 100001.0 +void init_sprite_pointers() +byte~ init_sprite_pointers::$2 reg byte a 2.0000002E7 +const nomodify byte init_sprite_pointers::SPRITE_ID_0 = (byte)SPRITES_1&$3fff/$40 +byte init_sprite_pointers::screen +byte init_sprite_pointers::screen#1 reg byte x 2000002.0 +byte init_sprite_pointers::screen#2 reg byte x 1181818.5454545454 +byte init_sprite_pointers::sprite +byte init_sprite_pointers::sprite#1 reg byte y 2.0000002E7 +byte init_sprite_pointers::sprite#2 reg byte y 1.0000001E7 +byte init_sprite_pointers::sprite_id +byte init_sprite_pointers::sprite_id#0 reg byte a 1.50000015E7 +const byte* init_sprite_pointers::sprites_id[] = { 0, $70, $60, $50, $40, $30, $20, $10 } +byte* init_sprite_pointers::sprites_ptr_1 +byte* init_sprite_pointers::sprites_ptr_1#1 sprites_ptr_1 zp[2]:11 666667.3333333334 +byte* init_sprite_pointers::sprites_ptr_1#5 sprites_ptr_1 zp[2]:11 1333333.6666666667 +byte* init_sprite_pointers::sprites_ptr_2 +byte* init_sprite_pointers::sprites_ptr_2#1 sprites_ptr_2 zp[2]:9 1000001.0 +byte* init_sprite_pointers::sprites_ptr_2#5 sprites_ptr_2 zp[2]:9 1200000.3 +__interrupt(hardware_clobber) void irq_screen_top() +byte~ irq_screen_top::$1 reg byte a 4.0 +byte~ irq_screen_top::$2 reg byte a 4.0 +byte* irq_screen_top::toD0181_gfx +byte irq_screen_top::toD0181_return +const byte irq_screen_top::toD0181_return#0 toD0181_return = 0 +byte* irq_screen_top::toD0181_screen +byte* irq_screen_top::toDd001_gfx +byte irq_screen_top::toDd001_return +const byte irq_screen_top::toDd001_return#0 toDd001_return = 0 +byte* irq_screen_top::toDd002_gfx +byte irq_screen_top::toDd002_return +const byte irq_screen_top::toDd002_return#0 toDd002_return = 3^>(word)SCREENS_1/$40 +byte joyfire() +byte~ joyfire::$0 reg byte a 2.0000002E7 +byte joyfire::return +byte joyfire::return#0 reg byte a 2000002.0 +byte joyfire::return#1 reg byte a 20002.0 +byte joyfire::return#4 reg byte a 252500.5 +void joyinit() +volatile byte* left_canvas loadstore zp[2]:23 20.0 +volatile byte* left_render_index_xcol loadstore zp[2]:21 20.0 +volatile byte left_ypos_inc_offset loadstore zp[1]:25 20.0 +word level_show() +word level_show::count +word level_show::count#1 count zp[2]:11 2.0000002E7 +word level_show::count#10 count zp[2]:11 4571429.285714285 +word level_show::count#11 count zp[2]:11 4285714.714285715 +word level_show::count#12 count zp[2]:11 500250.75 +word level_show::count#2 count zp[2]:11 2.0000002E7 +word level_show::count#5 count zp[2]:11 1.0000001E7 +byte* level_show::level +byte* level_show::level#1 level zp[2]:9 1000001.0 +byte* level_show::level#8 level zp[2]:9 1100000.2 +word level_show::return +word level_show::return#0 return zp[2]:11 2002.0 +byte level_show::tile_left +byte level_show::tile_left#0 reg byte x 2500000.25 +byte level_show::tile_right +byte level_show::tile_right#0 tile_right zp[1]:96 3750000.375 +byte level_show::xcol +byte level_show::xcol#1 xcol zp[1]:7 2.0000002E7 +byte level_show::xcol#2 xcol zp[1]:7 2352941.411764706 +byte level_show::xtile +byte level_show::xtile#1 reg byte y 6000000.6 +byte level_show::xtile#2 xtile zp[1]:8 2000000.2 +byte level_show::xtile#3 xtile zp[1]:8 1.0000001E7 +byte level_show::ytile +byte level_show::ytile#1 ytile zp[1]:6 2000002.0 +byte level_show::ytile#2 ytile zp[1]:6 619047.8095238095 +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +byte~ level_tile_directions::$5 reg byte a 202.0 +byte level_tile_directions::return +byte level_tile_directions::return#0 reg byte a 202.0 +byte level_tile_directions::return#10 reg byte a 22.0 +byte level_tile_directions::return#11 reg byte a 22.0 +byte level_tile_directions::return#12 reg byte a 22.0 +byte level_tile_directions::return#13 reg byte a 22.0 +byte level_tile_directions::return#2 reg byte a 22.285714285714285 +byte level_tile_directions::return#3 reg byte a 22.0 +byte level_tile_directions::xtile +byte level_tile_directions::xtile#0 reg byte x 11.0 +byte level_tile_directions::xtile#1 reg byte x 11.0 +byte level_tile_directions::xtile#2 reg byte x 11.0 +byte level_tile_directions::xtile#3 reg byte x 11.0 +byte level_tile_directions::xtile#4 reg byte x 11.0 +byte level_tile_directions::xtile#5 reg byte x 51.4 +byte level_tile_directions::ytile +byte level_tile_directions::ytile#0 reg byte a 22.0 +byte level_tile_directions::ytile#1 reg byte a 22.0 +byte level_tile_directions::ytile#2 reg byte a 22.0 +byte level_tile_directions::ytile#3 reg byte a 22.0 +byte level_tile_directions::ytile#4 reg byte a 22.0 +byte level_tile_directions::ytile#5 reg byte a 85.66666666666666 +byte* level_tile_directions::ytiles +byte* level_tile_directions::ytiles#0 ytiles zp[2]:91 202.0 +byte level_tile_get(byte level_tile_get::xtile , byte level_tile_get::ytile) +byte~ level_tile_get::$5 reg byte a 2.00000002E8 +byte level_tile_get::return +byte level_tile_get::return#0 reg byte a 2.00000002E8 +byte level_tile_get::return#10 reg byte a 2.0000002E7 +byte level_tile_get::return#11 reg byte a 2.0000002E7 +byte level_tile_get::return#2 reg byte a 2.3333334166666668E7 +byte level_tile_get::return#3 reg byte a 2.0000002E7 +byte level_tile_get::return#4 reg byte a 2.0000002E7 +byte level_tile_get::xtile +byte level_tile_get::xtile#0 reg byte x 1.0000001E7 +byte level_tile_get::xtile#1 reg byte x 1.0000001E7 +byte level_tile_get::xtile#2 reg byte x 2.0000002E7 +byte level_tile_get::xtile#3 reg byte x 2.0000002E7 +byte level_tile_get::xtile#4 reg byte x 4.80000012E7 +byte level_tile_get::ytile +byte level_tile_get::ytile#0 reg byte a 2.0000002E7 +byte level_tile_get::ytile#1 reg byte a 2.0000002E7 +byte level_tile_get::ytile#2 reg byte a 1.0000001E7 +byte level_tile_get::ytile#3 reg byte a 1.0000001E7 +byte level_tile_get::ytile#4 reg byte a 8.0000002E7 +byte* level_tile_get::ytiles +byte* level_tile_get::ytiles#0 ytiles zp[2]:97 2.00000002E8 +volatile byte logic_tile_left_idx loadstore zp[1]:19 20.0 +volatile to_volatile byte* logic_tile_ptr loadstore zp[2]:15 10250.0 +volatile byte logic_tile_right_idx loadstore zp[1]:20 20.0 +volatile byte logic_tile_xcol loadstore zp[1]:17 10250.0 +volatile byte logic_tile_yfine loadstore zp[1]:18 10250.0 +void main() +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +void* memcpy::destination +const void* memcpy::destination#0 destination = (void*)INTRO_MUSIC_CRUNCHED_UPPER +byte* memcpy::dst +byte* memcpy::dst#1 dst zp[2]:11 10001.0 +byte* memcpy::dst#2 dst zp[2]:11 10001.0 +word memcpy::num +void* memcpy::return +void* memcpy::source +const void* memcpy::source#0 source = (void*)INTRO_MUSIC_CRUNCHED +byte* memcpy::src +byte* memcpy::src#1 src zp[2]:9 20002.0 +byte* memcpy::src#2 src zp[2]:9 10001.0 +byte* memcpy::src_end +const byte* memcpy::src_end#0 src_end = (byte*)memcpy::source#0+INTRO_MUSIC_CRUNCHED_SIZE +void* memset(void* memset::str , byte memset::c , word memset::num) +byte memset::c +byte* memset::dst +byte* memset::dst#1 dst zp[2]:99 20002.0 +byte* memset::dst#2 dst zp[2]:99 13668.333333333332 +byte* memset::dst#4 dst zp[2]:99 2002.0 +byte* memset::end +byte* memset::end#0 end zp[2]:89 1833.6666666666665 +word memset::num +word memset::num#5 num zp[2]:89 1001.0 +void* memset::return +void* memset::str +void* memset::str#6 str zp[2]:99 +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +byte~ merge_code::$5 reg byte y 100001.0 +const nomodify byte merge_code::LOGIC_END = $ff +const nomodify byte merge_code::LOGIC_EXIT = 0 +const nomodify byte merge_code::RASTER_END = $ff +const nomodify byte merge_code::RASTER_EXIT = 0 +byte merge_code::cycle_budget +byte merge_code::cycle_budget#0 reg byte x 10001.0 +byte merge_code::cycle_budget#1 reg byte x 200002.0 +byte merge_code::cycle_budget#10 reg byte x 88889.77777777777 +byte merge_code::cycle_budget#13 reg byte x 50714.857142857145 +byte merge_code::cycle_budget#2 reg byte x 200002.0 +byte merge_code::cycle_budget#3 reg byte x 200002.0 +byte* merge_code::dest_code +byte* merge_code::dest_code#0 dest_code zp[2]:11 10001.0 +byte* merge_code::dest_code#1 dest_code zp[2]:11 1000001.0 +byte* merge_code::dest_code#10 dest_code zp[2]:11 180001.80000000002 +byte* merge_code::dest_code#12 dest_code zp[2]:11 10334.666666666666 +byte* merge_code::dest_code#13 dest_code zp[2]:11 80001.25 +byte* merge_code::dest_code#14 dest_code zp[2]:11 21429.428571428572 +byte* merge_code::dest_code#15 dest_code zp[2]:11 640001.0 +byte* merge_code::dest_code#2 dest_code zp[2]:11 150001.5 +byte* merge_code::dest_code#21 dest_code zp[2]:11 51250.625 +byte* merge_code::dest_code#3 dest_code zp[2]:11 100001.0 +byte* merge_code::dest_code#4 dest_code zp[2]:11 100001.0 +byte* merge_code::dest_code#6 dest_code zp[2]:11 100001.0 +byte* merge_code::logic_code +byte* merge_code::logic_code#0 logic_code zp[2]:89 200002.0 +byte* merge_code::logic_code#1 logic_code zp[2]:89 2000002.0 +byte* merge_code::logic_code#10 logic_code zp[2]:89 1050001.5 +byte* merge_code::logic_code#12 logic_code zp[2]:89 20002.0 +byte* merge_code::logic_code#14 logic_code zp[2]:89 105001.5 +byte* merge_code::logic_code#17 logic_code zp[2]:89 22778.055555555555 +byte* merge_code::logic_code#18 logic_code zp[2]:89 15556.111111111113 +byte* merge_code::logic_code#2 logic_code zp[2]:89 100001.0 +byte* merge_code::logic_code#3 logic_code zp[2]:89 20002.0 +byte* merge_code::logic_code#4 logic_code zp[2]:89 200002.0 +byte* merge_code::logic_code#5 logic_code zp[2]:89 20002.0 +byte merge_code::logic_cycles +byte merge_code::logic_cycles#0 logic_cycles zp[1]:96 41667.08333333333 +byte* merge_code::raster_code +byte* merge_code::raster_code#0 raster_code zp[2]:99 20002.0 +byte* merge_code::raster_code#1 raster_code zp[2]:99 15001.5 +byte* merge_code::raster_code#2 raster_code zp[2]:99 3928.6428571428573 +byte* merge_code::raster_code#4 raster_code zp[2]:99 37501.5 +const nomodify void()* musicInit = (void()*)INTRO_MUSIC +const nomodify void()* musicPlay = (void()*)INTRO_MUSIC+6 +volatile byte music_play_next loadstore zp[1]:43 69506.875 +volatile byte pacman_ch1_enabled loadstore zp[1]:13 0.08254716981132076 +volatile byte pacman_ch1_idx loadstore zp[1]:14 1.9428571428571428 +volatile byte pacman_direction loadstore zp[1]:49 132.92105263157893 +const byte* pacman_frames[] = { 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c } +volatile byte pacman_lives loadstore zp[1]:42 656.4415584415585 +void pacman_sound_init() +void pacman_sound_play() +volatile byte pacman_substep loadstore zp[1]:50 233.39534883720933 +volatile byte pacman_wins loadstore zp[1]:41 1545.6969696969697 +volatile byte pacman_xfine loadstore zp[1]:47 47.719626168224295 +volatile byte pacman_yfine loadstore zp[1]:48 46.21818181818182 +volatile byte phase loadstore zp[1]:44 78.03703703703704 +volatile word pill_count loadstore zp[2]:39 14.191780821917808 +void render(byte render::xcol , byte render::ypos , byte render::pixels) +byte~ render::$1 reg byte x 1.0000001E7 +byte~ render::$2 reg byte a 2.0000002E7 +byte* render::canvas1 +byte* render::canvas1#0 canvas1 zp[2]:9 5000000.5 +byte* render::canvas1#1 canvas1 zp[2]:9 5.00000000005E10 +byte* render::canvas1#2 canvas1 zp[2]:9 1.00010000002E11 +byte* render::canvas2 +byte* render::canvas2#0 canvas2 zp[2]:11 6666667.333333333 +byte* render::canvas2#1 canvas2 zp[2]:11 6.6666666667333336E10 +byte* render::canvas2#2 canvas2 zp[2]:11 5.0005000001E10 +word render::canvas_offset +word render::canvas_offset#0 canvas_offset zp[2]:11 1.50000015E7 +byte render::i +byte render::i#1 reg byte y 2.00000000002E11 +byte render::i#2 reg byte y 6.0000000000600006E10 +byte render::pixels +byte render::pixels#0 pixels zp[1]:8 2000002.0 +byte render::pixels#1 pixels zp[1]:8 200002.0 +byte render::pixels#4 pixels zp[1]:8 1241176.705882353 +byte* render::render_index_xcol +word render::render_index_xcol#0 render_index_xcol zp[2]:97 2500000.25 +byte render::xcol +byte render::xcol#0 xcol zp[1]:5 666667.3333333334 +byte render::xcol#1 xcol zp[1]:5 66667.33333333333 +byte render::xcol#2 xcol zp[1]:5 5550001.5 +byte render::ypix +byte render::ypix#0 ypix zp[1]:96 1.4287142857428572E10 +byte render::ypos +byte render::ypos#0 ypos zp[1]:6 1000001.0 +byte render::ypos#1 ypos zp[1]:6 100001.0 +byte render::ypos#2 ypos zp[1]:6 2344444.888888889 +byte render::ypos_inc_offset +byte render::ypos_inc_offset#0 reg byte x 1.0000001E7 +byte render::ypos_inc_offset#1 reg byte x 1.00000000001E11 +byte render::ypos_inc_offset#2 reg byte x 1.0000250000125E11 +byte render::ytile +byte render::ytile#0 reg byte y 1.0000001E7 +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +byte~ render_tiles::$0 reg byte a 2.00000002E8 +byte~ render_tiles::$2 reg byte a 2.00000002E8 +byte~ render_tiles::$4 reg byte x 1.00000001E8 +byte~ render_tiles::$5 reg byte a 2.00000002E8 +byte* render_tiles::canvas1 +byte* render_tiles::canvas1#0 canvas1 zp[2]:89 6.6666667333333336E7 +byte* render_tiles::canvas1#1 canvas1 zp[2]:89 5.000000000005E11 +byte* render_tiles::canvas1#2 canvas1 zp[2]:89 6.000200000008E11 +byte* render_tiles::canvas2 +byte* render_tiles::canvas2#0 canvas2 zp[2]:94 1.00000001E8 +byte* render_tiles::canvas2#1 canvas2 zp[2]:94 6.666666666673334E11 +byte* render_tiles::canvas2#2 canvas2 zp[2]:94 5.000166666673334E11 +word render_tiles::canvas_offset +word render_tiles::canvas_offset#0 canvas_offset zp[2]:94 1.500000015E8 +byte render_tiles::pixels +byte render_tiles::pixels#0 reg byte a 1.5000000000015E12 +byte* render_tiles::render_index_xcol +word render_tiles::render_index_xcol#0 render_index_xcol zp[2]:101 2.500000025E7 +byte render_tiles::tile_left +byte render_tiles::tile_left#0 reg byte x 5.5000001E7 +byte* render_tiles::tile_left_pixels +byte* render_tiles::tile_left_pixels#0 tile_left_pixels zp[2]:97 5.2636842105368416E10 +byte render_tiles::tile_right +byte render_tiles::tile_right#0 reg byte y 3.6666667333333336E7 +byte* render_tiles::tile_right_pixels +byte* render_tiles::tile_right_pixels#0 tile_right_pixels zp[2]:99 5.882941176482353E10 +byte render_tiles::xcol +byte render_tiles::xcol#0 xcol zp[1]:7 1.375000025E7 +byte render_tiles::y +byte render_tiles::y#1 y zp[1]:96 2.000000000002E12 +byte render_tiles::y#2 y zp[1]:96 6.25000000000625E11 +byte render_tiles::ypos_inc_offset +byte render_tiles::ypos_inc_offset#0 reg byte x 2.00000002E8 +byte render_tiles::ypos_inc_offset#1 reg byte x 1.000000000001E12 +byte render_tiles::ypos_inc_offset#2 reg byte x 5.714428571435714E11 +byte render_tiles::ytile +byte render_tiles::ytile#0 ytile zp[1]:6 1.375000025E7 +volatile byte* rigt_canvas loadstore zp[2]:28 20.0 +volatile byte* rigt_render_index_xcol loadstore zp[2]:26 20.0 +volatile byte rigt_ypos_inc_offset loadstore zp[1]:30 20.0 +volatile byte side_sprites_color loadstore zp[1]:35 11040.0 +volatile byte side_sprites_mc loadstore zp[1]:36 11040.0 +void spawn_all() +void splash_run() +byte~ splash_run::$25 reg byte a 2002.0 +byte~ splash_run::$30 reg byte a 20002.0 +byte~ splash_run::$34 reg byte y 1334.6666666666667 +byte splash_run::i +byte splash_run::i#1 i zp[1]:5 2002.0 +byte splash_run::i#2 i zp[1]:5 364.0 +byte splash_run::i1 +byte splash_run::i1#1 reg byte x 2002.0 +byte splash_run::i1#2 reg byte x 1334.6666666666667 +byte splash_run::i2 +byte splash_run::i2#1 reg byte x 2002.0 +byte splash_run::i2#2 reg byte x 1201.2 +byte splash_run::msb +byte splash_run::msb#1 reg byte x 1001.0 +byte splash_run::msb#10 reg byte x 175.25 +byte splash_run::msb#2 reg byte x 2002.0 +byte splash_run::msb#8 reg byte x 1501.5 +const word* splash_run::sprites_xpos[] = { $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f } +byte* splash_run::toD0181_gfx +byte splash_run::toD0181_return +const byte splash_run::toD0181_return#0 toD0181_return = 0 +byte* splash_run::toD0181_screen +byte* splash_run::toDd001_gfx +byte splash_run::toDd001_return +const byte splash_run::toDd001_return#0 toDd001_return = 3^>(word)SCREENS_1/$40 +word splash_run::xpos +word splash_run::xpos#0 xpos zp[2]:89 667.3333333333334 +void splash_show() +byte splash_show::pixels +byte splash_show::pixels#0 reg byte x 50000.5 +byte* splash_show::splash +byte* splash_show::splash#1 splash zp[2]:99 33333.666666666664 +byte* splash_show::splash#2 splash zp[2]:99 80001.25 +byte* splash_show::splash#4 splash zp[2]:99 10001.0 +byte splash_show::xcol +byte splash_show::xcol#1 xcol zp[1]:5 20002.0 +byte splash_show::xcol#2 xcol zp[1]:5 11818.545454545454 +byte splash_show::ypos +byte splash_show::ypos#1 ypos zp[1]:6 200002.0 +byte splash_show::ypos#2 ypos zp[1]:6 50000.5 +volatile byte top_sprites_color loadstore zp[1]:33 3403.666666666667 +volatile byte top_sprites_mc loadstore zp[1]:34 92.0 + +zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +reg byte a [ game_logic::do_reverse#4 ] +reg byte x [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +zp[1]:3 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 game_logic::target_ytile2#3 game_logic::target_ytile2#2 game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +reg byte x [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +reg byte x [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +reg byte x [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +reg byte x [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +reg byte x [ splash_run::i1#2 splash_run::i1#1 ] +reg byte x [ splash_run::i2#2 splash_run::i2#1 ] +reg byte x [ gameplay_run::i#2 gameplay_run::i#1 ] +reg byte x [ gameplay_run::i1#2 gameplay_run::i1#1 ] +reg byte x [ gameplay_run::i2#2 gameplay_run::i2#1 ] +reg byte x [ done_run::i#2 done_run::i#1 ] +reg byte x [ done_run::i1#2 done_run::i1#1 ] +reg byte x [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +reg byte a [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] +reg byte a [ level_tile_directions::return#2 level_tile_directions::return#0 ] +reg byte y [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +reg byte x [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +zp[1]:4 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 game_logic::ghost1_ytile#0 choose_direction::ydiff#0 ] +reg byte y [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +reg byte x [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +reg byte x [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +reg byte x [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +reg byte x [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +reg byte y [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +reg byte x [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +reg byte y [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +reg byte a [ joyfire::return#4 ] +zp[1]:5 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 splash_run::i#2 splash_run::i#1 init_render_index::x_col#2 init_render_index::x_col#1 done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 splash_show::xcol#2 splash_show::xcol#1 ] +zp[1]:6 [ level_show::ytile#2 level_show::ytile#1 render_tiles::ytile#0 init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 init_render_index::y_pos#2 init_render_index::y_pos#1 done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 splash_show::ypos#2 splash_show::ypos#1 ] +zp[1]:7 [ level_show::xcol#2 level_show::xcol#1 render_tiles::xcol#0 init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +zp[1]:8 [ render::pixels#4 render::pixels#0 render::pixels#1 level_show::xtile#3 level_show::xtile#2 ] +reg byte y [ render::i#2 render::i#1 ] +zp[2]:9 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 level_show::level#8 level_show::level#1 memcpy::src#2 memcpy::src#1 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +reg byte x [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +zp[2]:11 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 memcpy::dst#2 memcpy::dst#1 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 init_render_index::render_ypos_table#4 merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] +reg byte x [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +reg byte a [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] +reg byte a [ level_tile_get::return#2 level_tile_get::return#0 ] +reg byte x [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +zp[1]:13 [ pacman_ch1_enabled ] +zp[1]:14 [ pacman_ch1_idx ] +zp[2]:15 [ logic_tile_ptr ] +zp[1]:17 [ logic_tile_xcol ] +zp[1]:18 [ logic_tile_yfine ] +zp[1]:19 [ logic_tile_left_idx ] +zp[1]:20 [ logic_tile_right_idx ] +zp[2]:21 [ left_render_index_xcol ] +zp[2]:23 [ left_canvas ] +zp[1]:25 [ left_ypos_inc_offset ] +zp[2]:26 [ rigt_render_index_xcol ] +zp[2]:28 [ rigt_canvas ] +zp[1]:30 [ rigt_ypos_inc_offset ] +zp[1]:31 [ canvas_base_hi ] +zp[1]:32 [ bobs_restore_base ] +zp[1]:33 [ top_sprites_color ] +zp[1]:34 [ top_sprites_mc ] +zp[1]:35 [ side_sprites_color ] +zp[1]:36 [ side_sprites_mc ] +zp[1]:37 [ bottom_sprites_color ] +zp[1]:38 [ bottom_sprites_mc ] +zp[2]:39 [ pill_count ] +zp[1]:41 [ pacman_wins ] +zp[1]:42 [ pacman_lives ] +zp[1]:43 [ music_play_next ] +zp[1]:44 [ phase ] +zp[1]:45 [ frame ] +zp[1]:46 [ anim_frame_idx ] +zp[1]:47 [ pacman_xfine ] +zp[1]:48 [ pacman_yfine ] +zp[1]:49 [ pacman_direction ] +zp[1]:50 [ pacman_substep ] +zp[1]:51 [ ghosts_mode ] +zp[1]:52 [ ghosts_mode_count ] +zp[1]:53 [ ghost1_xfine ] +zp[1]:54 [ ghost1_yfine ] +zp[1]:55 [ ghost1_direction ] +zp[1]:56 [ ghost1_substep ] +zp[1]:57 [ ghost1_reverse ] +zp[1]:58 [ ghost1_respawn ] +zp[1]:59 [ ghost2_xfine ] +zp[1]:60 [ ghost2_yfine ] +zp[1]:61 [ ghost2_direction ] +zp[1]:62 [ ghost2_substep ] +zp[1]:63 [ ghost2_reverse ] +zp[1]:64 [ ghost2_respawn ] +zp[1]:65 [ ghost3_xfine ] +zp[1]:66 [ ghost3_yfine ] +zp[1]:67 [ ghost3_direction ] +zp[1]:68 [ ghost3_substep ] +zp[1]:69 [ ghost3_reverse ] +zp[1]:70 [ ghost3_respawn ] +zp[1]:71 [ ghost4_xfine ] +zp[1]:72 [ ghost4_yfine ] +zp[1]:73 [ ghost4_direction ] +zp[1]:74 [ ghost4_substep ] +zp[1]:75 [ ghost4_reverse ] +zp[1]:76 [ ghost4_respawn ] +zp[1]:77 [ game_logic_substep ] +zp[1]:78 [ game_playable ] +reg byte a [ irq_screen_top::$1 ] +reg byte a [ irq_screen_top::$2 ] +reg byte x [ game_logic::$2 ] +reg byte a [ game_logic::$3 ] +reg byte x [ game_logic::$14 ] +reg byte a [ game_logic::$15 ] +reg byte y [ game_logic::pacman_bob_xfine#0 ] +reg byte a [ game_logic::$17 ] +reg byte x [ game_logic::$18 ] +reg byte x [ game_logic::$19 ] +reg byte a [ game_logic::$20 ] +reg byte a [ game_logic::$21 ] +reg byte y [ game_logic::ghost1_bob_xfine#0 ] +reg byte a [ game_logic::$25 ] +reg byte x [ game_logic::$26 ] +reg byte x [ game_logic::$27 ] +reg byte a [ game_logic::$28 ] +reg byte a [ game_logic::$29 ] +reg byte y [ game_logic::ghost2_bob_xfine#0 ] +reg byte a [ game_logic::$31 ] +reg byte x [ game_logic::$32 ] +reg byte x [ game_logic::$33 ] +reg byte a [ game_logic::$34 ] +reg byte a [ game_logic::$35 ] +reg byte y [ game_logic::ghost3_bob_xfine#0 ] +reg byte a [ game_logic::$37 ] +reg byte x [ game_logic::$38 ] +reg byte x [ game_logic::$39 ] +reg byte a [ game_logic::$40 ] +reg byte a [ game_logic::$41 ] +reg byte y [ game_logic::ghost4_bob_xfine#0 ] +reg byte a [ game_logic::$43 ] +reg byte x [ game_logic::$44 ] +reg byte x [ game_logic::$45 ] +reg byte a [ game_logic::$46 ] +reg byte a [ game_logic::$47 ] +zp[1]:79 [ game_logic::pacman_xtile#0 choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +reg byte a [ game_logic::pacman_ytile#0 ] +zp[1]:80 [ game_logic::$210 choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +zp[2]:81 [ game_logic::ytiles#0 game_logic::$67 game_logic::$71 ] +reg byte x [ game_logic::tile_id#0 ] +reg byte a [ game_logic::$65 ] +reg byte a [ game_logic::$66 ] +reg byte a [ game_logic::$68 ] +reg byte x [ game_logic::$75 ] +reg byte y [ game_logic::$77 ] +reg byte x [ game_logic::$80 ] +reg byte y [ game_logic::$82 ] +reg byte x [ game_logic::$85 ] +reg byte y [ game_logic::$87 ] +reg byte x [ game_logic::$90 ] +reg byte y [ game_logic::$92 ] +reg byte a [ game_logic::$69 ] +reg byte a [ game_logic::$70 ] +reg byte a [ game_logic::$72 ] +reg byte x [ game_logic::$220 ] +zp[1]:83 [ game_logic::ghost4_xtile#0 choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +reg byte a [ level_tile_directions::return#3 ] +reg byte a [ game_logic::open_directions#0 ] +reg byte y [ game_logic::open_directions#1 ] +reg byte a [ choose_direction::return#0 ] +reg byte a [ game_logic::$119 ] +reg byte x [ game_logic::$223 ] +zp[1]:84 [ game_logic::ghost3_xtile#0 ] +reg byte a [ level_tile_directions::return#10 ] +reg byte a [ game_logic::open_directions1#0 ] +reg byte y [ game_logic::open_directions1#1 ] +reg byte a [ choose_direction::return#1 ] +reg byte a [ game_logic::$140 ] +reg byte x [ game_logic::$226 ] +zp[1]:85 [ game_logic::ghost2_xtile#0 ] +reg byte a [ level_tile_directions::return#11 ] +reg byte a [ game_logic::open_directions2#0 ] +reg byte y [ game_logic::open_directions2#1 ] +reg byte a [ choose_direction::return#2 ] +reg byte a [ game_logic::$161 ] +reg byte x [ game_logic::$229 ] +zp[1]:86 [ game_logic::ghost1_xtile#0 ] +reg byte a [ level_tile_directions::return#12 ] +reg byte a [ game_logic::open_directions3#0 ] +reg byte y [ game_logic::open_directions3#1 ] +reg byte a [ choose_direction::return#3 ] +reg byte a [ game_logic::$182 ] +reg byte x [ game_logic::$232 ] +reg byte x [ game_logic::pacman_xtile1#0 ] +reg byte a [ game_logic::pacman_ytile1#0 ] +reg byte a [ level_tile_directions::return#13 ] +reg byte x [ game_logic::open_directions4#0 ] +reg byte a [ game_logic::$199 ] +reg byte a [ game_logic::$200 ] +reg byte a [ game_logic::joy_directions#0 ] +reg byte a [ game_logic::$204 ] +reg byte a [ game_logic::new_direction#0 ] +zp[2]:87 [ byteboozer_decrunch::crunched ] +reg byte a [ joyfire::return#1 ] +reg byte a [ splash_run::$30 ] +reg byte y [ splash_run::$34 ] +zp[2]:89 [ splash_run::xpos#0 render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 init_render_index::render_index_xcol#0 init_render_index::render_index#1 merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 memset::num#5 memset::end#0 done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +reg byte a [ splash_run::$25 ] +reg byte a [ joyfire::return#0 ] +reg byte a [ done_run::$8 ] +reg byte x [ done_run::pixels#0 ] +reg byte a [ level_tile_directions::$5 ] +zp[2]:91 [ level_tile_directions::ytiles#0 ] +zp[1]:93 [ choose_direction::xdiff#0 ] +reg byte a [ choose_direction::$2 ] +reg byte a [ choose_direction::$4 ] +reg byte a [ choose_direction::$6 ] +reg byte a [ choose_direction::$8 ] +reg byte a [ choose_direction::dist_right#0 ] +reg byte y [ merge_code::$5 ] +reg byte a [ init_render_index::$9 ] +zp[2]:94 [ init_render_index::canvas_xcol#0 render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 render_tiles::canvas_offset#0 ] +reg byte a [ init_render_index::$5 ] +reg byte a [ init_render_index::$6 ] +reg byte x [ splash_show::pixels#0 ] +reg byte a [ init_sprite_pointers::$2 ] +reg byte a [ init_sprite_pointers::sprite_id#0 ] +reg byte a [ joyfire::$0 ] +reg byte a [ level_tile_get::return#3 ] +reg byte x [ init_level_tile_directions::$3 ] +reg byte a [ level_tile_get::return#4 ] +reg byte x [ init_level_tile_directions::$7 ] +reg byte a [ level_tile_get::return#10 ] +reg byte a [ init_level_tile_directions::$11 ] +reg byte a [ level_tile_get::return#11 ] +reg byte a [ init_level_tile_directions::$15 ] +reg byte x [ level_show::tile_left#0 ] +reg byte y [ level_show::xtile#1 ] +reg byte x [ render_tiles::tile_left#0 ] +reg byte y [ render_tiles::tile_right#0 ] +reg byte y [ render::ytile#0 ] +reg byte x [ render::$1 ] +reg byte a [ render::$2 ] +zp[1]:96 [ render::ypix#0 level_show::tile_right#0 merge_code::logic_cycles#0 render_tiles::y#2 render_tiles::y#1 ] +reg byte a [ level_tile_get::$5 ] +reg byte a [ render_tiles::$0 ] +zp[2]:97 [ render_tiles::tile_left_pixels#0 level_tile_get::ytiles#0 render::render_index_xcol#0 init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ] +reg byte a [ render_tiles::$2 ] +zp[2]:99 [ render_tiles::tile_right_pixels#0 splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] +reg byte x [ render_tiles::$4 ] +reg byte a [ render_tiles::$5 ] +zp[2]:101 [ render_tiles::render_index_xcol#0 ] +reg byte a [ render_tiles::pixels#0 ] + + +FINAL ASSEMBLER +Score: 1949466 + + // File Comments +// Camelot Borderline Entry +// Pacman made with 9 sprites in in the borders + // Upstart + // Commodore 64 PRG executable file +.plugin "se.triad.kickass.CruncherPlugins" +.file [name="pacman.prg", type="prg", segments="Program", modify="B2exe", _jmpAdress=__start] +.segmentdef Program [segments="Code, Data, Init"] +.segmentdef Code [start=$810] +.segmentdef Data [startAfter="Code"] +.segmentdef Init [startAfter="Data"] + // Global Constants & labels + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The offset of the sprite pointers from the screen start address + .const OFFSET_SPRITE_PTRS = $3f8 + .const VICII_RST8 = $80 + .const VICII_ECM = $40 + .const VICII_BMM = $20 + .const VICII_DEN = $10 + .const VICII_RSEL = 8 + // Bits for the VICII IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // RAM in all three areas 0xA000, 0xD000, 0xE000 + .const PROCPORT_RAM_ALL = 0 + // RAM in 0xA000, 0xE000 I/O in 0xD000 + .const PROCPORT_RAM_IO = 5 + // The colors of the C64 + .const BLACK = 0 + .const RED = 2 + .const BLUE = 6 + .const YELLOW = 7 + .const EMPTY = 0 + .const PILL = 1 + .const POWERUP = 2 + .const WALL = 4 + // Address of the (decrunched) splash screen + .const BOB_ROW_SIZE = $80 + .const RENDER_OFFSET_CANVAS_LO = 0 + .const RENDER_OFFSET_CANVAS_HI = $50 + .const RENDER_OFFSET_YPOS_INC = $a0 + // The number of bobs rendered + .const NUM_BOBS = 5 + // The size of the BOB restore structure + .const SIZE_BOB_RESTORE = $12 + // Size of the crunched music + .const INTRO_MUSIC_CRUNCHED_SIZE = $600 + // The raster line for irq_screen_top() + .const IRQ_SCREEN_TOP_LINE = 5 + .const STOP = 0 + .const UP = 4 + .const DOWN = 8 + .const LEFT = $10 + .const RIGHT = $20 + .const CHASE = 0 + .const SCATTER = 1 + .const FRIGHTENED = 2 + .const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 + .const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 + .const OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 + .const OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 + .const OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 + .const OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 + .const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d + .const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d + .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 + .const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 + .const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 + .const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 + .const OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 + .const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 + .const SIZEOF_BYTE = 1 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_COLOR = $d027 + .label RASTER = $d012 + .label BORDER_COLOR = $d020 + .label VICII_CONTROL1 = $d011 + .label VICII_CONTROL2 = $d016 + .label VICII_MEMORY = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // Channel 1 Frequency High byte + .label SID_CH1_FREQ_HI = $d401 + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // The SID MOS 6581/8580 + .label SID = $d400 + // The VIC-II MOS 6567/6569 + .label VICII = $d000 + // The CIA#1: keyboard matrix, joystick #1/#2 + .label CIA1 = $dc00 + // The CIA#2: Serial bus, RS-232, VIC memory bank + .label CIA2 = $dd00 + // CIA#1 Interrupt for reading in ASM + .label CIA1_INTERRUPT = $dc0d + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // Graphics Bank 1 + // Address of the sprites + .label BANK_1 = $4000 + // Address of the sprites + .label SPRITES_1 = $6000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_1 = $4000 + // Graphics Bank 2 + // Address of the sprites + .label BANK_2 = $c000 + // Address of the sprites + .label SPRITES_2 = $e000 + // Use sprite pointers on all screens (0x43f8, 0x47f8, ...) + .label SCREENS_2 = $c000 + // The location where the logic code will be located before merging + .label LOGIC_CODE_UNMERGED = $e000 + // The location where the screen raster code will be located before merging + .label RASTER_CODE_UNMERGED = $6000 + // The location where the screen raster code will be located when running + .label RASTER_CODE = $8000 + // Address of the (decrunched) splash screen + .label SPLASH = $4000 + // Address for the victory graphics + .label WIN_GFX = $a700 + // Address for the gameover graphics + .label GAMEOVER_GFX = $a700 + // Address used by (decrunched) tiles + .label LEVEL_TILES = $4800 + .label TILES_LEFT = LEVEL_TILES+$a00 + .label TILES_RIGHT = LEVEL_TILES+$a80 + .label TILES_TYPE = LEVEL_TILES+$b00 + // Address used for table containing available directions for all tiles + // TABLE LEVEL_TILES_DIRECTIONS[64*37] + // The level data is organized as 37 rows of 64 bytes. Each row is 50 bytes containing DIRECTION bits plus 14 unused bytes to achieve 64-byte alignment. + .label LEVEL_TILES_DIRECTIONS = $3e00 + .label BOB_MASK_LEFT = $5400 + .label BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 + .label BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c + .label BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 + // Tables pointing to the graphics. + // Each page represents one X column (1 byte wide, 4 MC pixels) + // On each page: + // - 0xNN00-0xNN4A : low-byte of the graphics for (X-column, Y-fine) + // - 0xNN50-0xNN9A : high-byte of the graphics for (X-column, Y-fine) + // - 0xNNA0-0xNNEA : index into RENDER_YPOS_INC for incrementing the y-pos. + .label RENDER_INDEX = $b600 + // Upper memory location used during decrunching + .label INTRO_MUSIC_CRUNCHED_UPPER = $a700 + // Address of the music during run-time + .label INTRO_MUSIC = $3000 + // Pointer to the music init routine + .label musicInit = INTRO_MUSIC + // Pointer to the music play routine + .label musicPlay = INTRO_MUSIC+6 + // Is the pacman eating sound enabled + .label pacman_ch1_enabled = $d + // Index into the eating sound + .label pacman_ch1_idx = $e + // Pointer to the tile to render in the logic code + .label logic_tile_ptr = $f + // The x-column of the tile to render + .label logic_tile_xcol = $11 + // The y-fine of the tile to render + .label logic_tile_yfine = $12 + // The ID*4 of the left tile to render + .label logic_tile_left_idx = $13 + // The ID*4 of the right tile to render + .label logic_tile_right_idx = $14 + // Variables used by the logic-code renderer and restorer + .label left_render_index_xcol = $15 + .label left_canvas = $17 + .label left_ypos_inc_offset = $19 + .label rigt_render_index_xcol = $1a + .label rigt_canvas = $1c + .label rigt_ypos_inc_offset = $1e + // The high-byte of the start-address of the canvas currently being rendered to + .label canvas_base_hi = $1f + // The offset used for bobs_restore - used to achieve double buffering + .label bobs_restore_base = $20 + // Sprite settings used for the top/side/bottom sprites. + // Used for achieving single-color sprites on the splash and multi-color sprites in the game + .label top_sprites_color = $21 + .label top_sprites_mc = $22 + .label side_sprites_color = $23 + .label side_sprites_mc = $24 + .label bottom_sprites_color = $25 + .label bottom_sprites_mc = $26 + // The number of pills left + .label pill_count = $27 + // 1 When pacman wins + .label pacman_wins = $29 + // The number of pacman lives left + .label pacman_lives = $2a + // Signal for playing th next music frame during the intro + .label music_play_next = $2b + // 0: intro, 1: game + .label phase = $2c + // The double buffer frame (0=BANK_1, 1=BANK_2) + .label frame = $2d + // The animation frame IDX (within the current direction) [0-3] + .label anim_frame_idx = $2e + // Pacman x fine position (0-99). + .label pacman_xfine = $2f + // Pacman y fine position (0-70). + .label pacman_yfine = $30 + // The pacman movement current direction + .label pacman_direction = $31 + // Pacman movement substep (0: on tile, 1: between tiles). + .label pacman_substep = $32 + // Mode determining ghost target mode. 0: chase, 1: scatter + .label ghosts_mode = $33 + // Counts frames to change ghost mode (7 seconds scatter, 20 seconds chase ) + .label ghosts_mode_count = $34 + // Ghost 1 x fine position (0-99). + .label ghost1_xfine = $35 + // Ghost 1 y fine position (0-70). + .label ghost1_yfine = $36 + // Ghost 1 movement current direction + .label ghost1_direction = $37 + // Ghost 1 movement substep (0: on tile, 1: between tiles). + .label ghost1_substep = $38 + // Ghost 1 movement should be reversed (0: normal, 1: reverse direction) + .label ghost1_reverse = $39 + // Ghost 1 respawn timer + .label ghost1_respawn = $3a + // Ghost 2 x fine position (0-99). + .label ghost2_xfine = $3b + // Ghost 2 y fine position (0-70). + .label ghost2_yfine = $3c + // Ghost 2 movement current direction + .label ghost2_direction = $3d + // Ghost 2 movement substep (0: on tile, 1: between tiles). + .label ghost2_substep = $3e + // Ghost 2 movement should be reversed (0: normal, 1: reverse direction) + .label ghost2_reverse = $3f + // Ghost 2 respawn timer + .label ghost2_respawn = $40 + // Ghost 3 x fine position (0-99). + .label ghost3_xfine = $41 + // Ghost 3 y fine position (0-70). + .label ghost3_yfine = $42 + // Ghost 3 movement current direction + .label ghost3_direction = $43 + // Ghost 3 movement substep (0: on tile, 1: between tiles). + .label ghost3_substep = $44 + // Ghost 3 movement should be reversed (0: normal, 1: reverse direction) + .label ghost3_reverse = $45 + // Ghost 3 respawn timer + .label ghost3_respawn = $46 + // Ghost 4 x fine position (0-99). + .label ghost4_xfine = $47 + // Ghost 4 y fine position (0-70). + .label ghost4_yfine = $48 + // Ghost 4 movement current direction + .label ghost4_direction = $49 + // Ghost 4 movement substep (0: on tile, 1: between tiles). + .label ghost4_substep = $4a + // Ghost 4 movement should be reversed (0: normal, 1: reverse direction) + .label ghost4_reverse = $4b + // Ghost 4 respawn timer + .label ghost4_respawn = $4c + // Game logic sub-step [0-7]. Each frame a different sub-step is animated + .label game_logic_substep = $4d + // 1 when the game is playable and characters should move around + .label game_playable = $4e +.segment Code + // __start +__start: { + // __start::__init1 + // pacman_ch1_enabled = 0 + // [1] pacman_ch1_enabled = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_enabled + // pacman_ch1_idx = 0 + // [2] pacman_ch1_idx = 0 -- vbuz1=vbuc1 + sta.z pacman_ch1_idx + // logic_tile_ptr + // [3] logic_tile_ptr = (byte*) 0 -- pbuz1=pbuc1 + sta.z logic_tile_ptr + sta.z logic_tile_ptr+1 + // logic_tile_xcol + // [4] logic_tile_xcol = 0 -- vbuz1=vbuc1 + sta.z logic_tile_xcol + // logic_tile_yfine + // [5] logic_tile_yfine = 0 -- vbuz1=vbuc1 + sta.z logic_tile_yfine + // logic_tile_left_idx + // [6] logic_tile_left_idx = 0 -- vbuz1=vbuc1 + sta.z logic_tile_left_idx + // logic_tile_right_idx + // [7] logic_tile_right_idx = 0 -- vbuz1=vbuc1 + sta.z logic_tile_right_idx + // left_render_index_xcol + // [8] left_render_index_xcol = (byte*) 0 -- pbuz1=pbuc1 + sta.z left_render_index_xcol + sta.z left_render_index_xcol+1 + // left_canvas + // [9] left_canvas = (byte*) 0 -- pbuz1=pbuc1 + sta.z left_canvas + sta.z left_canvas+1 + // left_ypos_inc_offset + // [10] left_ypos_inc_offset = 0 -- vbuz1=vbuc1 + sta.z left_ypos_inc_offset + // rigt_render_index_xcol + // [11] rigt_render_index_xcol = (byte*) 0 -- pbuz1=pbuc1 + sta.z rigt_render_index_xcol + sta.z rigt_render_index_xcol+1 + // rigt_canvas + // [12] rigt_canvas = (byte*) 0 -- pbuz1=pbuc1 + sta.z rigt_canvas + sta.z rigt_canvas+1 + // rigt_ypos_inc_offset + // [13] rigt_ypos_inc_offset = 0 -- vbuz1=vbuc1 + sta.z rigt_ypos_inc_offset + // canvas_base_hi + // [14] canvas_base_hi = 0 -- vbuz1=vbuc1 + sta.z canvas_base_hi + // bobs_restore_base + // [15] bobs_restore_base = 0 -- vbuz1=vbuc1 + sta.z bobs_restore_base + // top_sprites_color + // [16] top_sprites_color = 0 -- vbuz1=vbuc1 + sta.z top_sprites_color + // top_sprites_mc + // [17] top_sprites_mc = 0 -- vbuz1=vbuc1 + sta.z top_sprites_mc + // side_sprites_color + // [18] side_sprites_color = 0 -- vbuz1=vbuc1 + sta.z side_sprites_color + // side_sprites_mc + // [19] side_sprites_mc = 0 -- vbuz1=vbuc1 + sta.z side_sprites_mc + // bottom_sprites_color + // [20] bottom_sprites_color = 0 -- vbuz1=vbuc1 + sta.z bottom_sprites_color + // bottom_sprites_mc + // [21] bottom_sprites_mc = 0 -- vbuz1=vbuc1 + sta.z bottom_sprites_mc + // pill_count + // [22] pill_count = 0 -- vwuz1=vwuc1 + sta.z pill_count + sta.z pill_count+1 + // pacman_wins = 0 + // [23] pacman_wins = 0 -- vbuz1=vbuc1 + sta.z pacman_wins + // pacman_lives = 3 + // [24] pacman_lives = 3 -- vbuz1=vbuc1 + lda #3 + sta.z pacman_lives + // music_play_next = 0 + // [25] music_play_next = 0 -- vbuz1=vbuc1 + lda #0 + sta.z music_play_next + // phase = 0 + // [26] phase = 0 -- vbuz1=vbuc1 + sta.z phase + // frame = 0 + // [27] frame = 0 -- vbuz1=vbuc1 + sta.z frame + // anim_frame_idx = 0 + // [28] anim_frame_idx = 0 -- vbuz1=vbuc1 + sta.z anim_frame_idx + // pacman_xfine = 45 + // [29] pacman_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z pacman_xfine + // pacman_yfine = 35 + // [30] pacman_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z pacman_yfine + // pacman_direction = STOP + // [31] pacman_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z pacman_direction + // pacman_substep = 0 + // [32] pacman_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_substep + // ghosts_mode = 1 + // [33] ghosts_mode = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghosts_mode + // ghosts_mode_count = 0 + // [34] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // ghost1_xfine = 45 + // [35] ghost1_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost1_xfine + // ghost1_yfine = 35 + // [36] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // ghost1_direction = STOP + // [37] ghost1_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost1_direction + // ghost1_substep = 0 + // [38] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + // ghost1_reverse = 0 + // [39] ghost1_reverse = 0 -- vbuz1=vbuc1 + sta.z ghost1_reverse + // ghost1_respawn = 0 + // [40] ghost1_respawn = 0 -- vbuz1=vbuc1 + sta.z ghost1_respawn + // ghost2_xfine = 45 + // [41] ghost2_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost2_xfine + // ghost2_yfine = 35 + // [42] ghost2_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost2_yfine + // ghost2_direction = STOP + // [43] ghost2_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost2_direction + // ghost2_substep = 0 + // [44] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + // ghost2_reverse = 0 + // [45] ghost2_reverse = 0 -- vbuz1=vbuc1 + sta.z ghost2_reverse + // ghost2_respawn = 0 + // [46] ghost2_respawn = 0 -- vbuz1=vbuc1 + sta.z ghost2_respawn + // ghost3_xfine = 45 + // [47] ghost3_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost3_xfine + // ghost3_yfine = 35 + // [48] ghost3_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost3_yfine + // ghost3_direction = STOP + // [49] ghost3_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost3_direction + // ghost3_substep = 0 + // [50] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + // ghost3_reverse = 0 + // [51] ghost3_reverse = 0 -- vbuz1=vbuc1 + sta.z ghost3_reverse + // ghost3_respawn = 0 + // [52] ghost3_respawn = 0 -- vbuz1=vbuc1 + sta.z ghost3_respawn + // ghost4_xfine = 45 + // [53] ghost4_xfine = $2d -- vbuz1=vbuc1 + lda #$2d + sta.z ghost4_xfine + // ghost4_yfine = 35 + // [54] ghost4_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost4_yfine + // ghost4_direction = STOP + // [55] ghost4_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost4_direction + // ghost4_substep = 0 + // [56] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + // ghost4_reverse = 0 + // [57] ghost4_reverse = 0 -- vbuz1=vbuc1 + sta.z ghost4_reverse + // ghost4_respawn = 0 + // [58] ghost4_respawn = 0 -- vbuz1=vbuc1 + sta.z ghost4_respawn + // game_logic_substep = 0 + // [59] game_logic_substep = 0 -- vbuz1=vbuc1 + sta.z game_logic_substep + // game_playable = 0 + // [60] game_playable = 0 -- vbuz1=vbuc1 + sta.z game_playable + // [61] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1] + // __start::@1 + // [62] call main + // [101] phi from __start::@1 to main [phi:__start::@1->main] + jsr main + // __start::@return + // [63] return + rts +} + // irq_screen_top +// Interrupt Routine at Screen Top +irq_screen_top: { + .const toDd001_return = 0 + .const toDd002_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + // interrupt(isr_hardware_clobber_entry) -- isr_hardware_all_entry + sta rega+1 + stx regx+1 + sty regy+1 + // kickasm + // kickasm( uses HARDWARE_IRQ uses RASTER uses IRQ_STATUS uses IRQ_RASTER uses VICII_CONTROL1 uses VICII_RSEL uses VICII_MEMORY) {{ // Stabilize the raster by using the double IRQ method // Acknowledge the IRQ lda #IRQ_RASTER sta IRQ_STATUS // Set-up IRQ for the next line inc RASTER // Point IRQ to almost stable code lda #stable sta HARDWARE_IRQ+1 tsx // Save stack pointer cli // Reenable interrupts // Wait for new IRQ using NOP's to ensure minimal jitter when it hits .fill 15, NOP .align $20 stable: txs // Restore stack pointer ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) !: dex bne !- nop lda RASTER cmp RASTER bne !+ // And correct the last cycle of potential jitter !: // Raster is now completely stable! (Line 0x007 cycle 7) }} + // Stabilize the raster by using the double IRQ method + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // Set-up IRQ for the next line + inc RASTER + // Point IRQ to almost stable code + lda #stable + sta HARDWARE_IRQ+1 + tsx // Save stack pointer + cli // Reenable interrupts + // Wait for new IRQ using NOP's to ensure minimal jitter when it hits + .fill 15, NOP + .align $20 + stable: + txs // Restore stack pointer + ldx #9 // Wait till the raster has almost crossed to the next line (48 cycles) + !: dex + bne !- + nop + lda RASTER + cmp RASTER + bne !+ // And correct the last cycle of potential jitter + !: + // Raster is now completely stable! (Line 0x007 cycle 7) + + // asm + // asm { jsrRASTER_CODE } + jsr RASTER_CODE + // VICII->SPRITE0_Y =7 + // [66] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y) = 7 -- _deref_pbuc1=vbuc2 + // Move sprites back to the top + lda #7 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y + // VICII->SPRITE1_Y =7 + // [67] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y + // VICII->SPRITE2_Y =7 + // [68] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y + // VICII->SPRITE3_Y =7 + // [69] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y + // VICII->SPRITE4_Y =7 + // [70] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y + // VICII->SPRITE5_Y =7 + // [71] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y + // VICII->SPRITE6_Y =7 + // [72] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y + // VICII->SPRITE7_Y =7 + // [73] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y) = 7 -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y + // [74] phi from irq_screen_top to irq_screen_top::toD0181 [phi:irq_screen_top->irq_screen_top::toD0181] + // irq_screen_top::toD0181 + // irq_screen_top::@5 + // VICII->MEMORY = toD018(SCREENS_1, SCREENS_1) + // [75] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = irq_screen_top::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Select first screen (graphics bank not important since layout in the banks is identical) + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // VICII->SPRITES_MC = top_sprites_mc + // [76] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the top sprites color/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // VICII->SPRITE0_COLOR = top_sprites_color + // [77] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR) = top_sprites_color -- _deref_pbuc1=vbuz1 + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR + // VICII->SPRITE1_COLOR = top_sprites_color + // [78] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR) = top_sprites_color -- _deref_pbuc1=vbuz1 + lda.z top_sprites_color + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR + // frame+1 + // [79] irq_screen_top::$1 = frame + 1 -- vbuaa=vbuz1_plus_1 + lda.z frame + clc + adc #1 + // (frame+1) & 1 + // [80] irq_screen_top::$2 = irq_screen_top::$1 & 1 -- vbuaa=vbuaa_band_vbuc1 + and #1 + // frame = (frame+1) & 1 + // [81] frame = irq_screen_top::$2 -- vbuz1=vbuaa + // Move to next frame + sta.z frame + // if(frame) + // [82] if(0!=frame) goto irq_screen_top::toDd001 -- 0_neq_vbuz1_then_la1 + bne __b6 + // [83] phi from irq_screen_top::@5 to irq_screen_top::toDd002 [phi:irq_screen_top::@5->irq_screen_top::toDd002] + // irq_screen_top::toDd002 + // irq_screen_top::@7 + // CIA2->PORT_A = toDd00(SCREENS_1) + // [84] *((byte*)CIA2) = irq_screen_top::toDd002_return#0 -- _deref_pbuc1=vbuc2 + // Change graphics bank + lda #toDd002_return + sta CIA2 + // canvas_base_hi = >SPRITES_2 + // [85] canvas_base_hi = >SPRITES_2 -- vbuz1=vbuc1 + // Set the next canvas base address + lda #>SPRITES_2 + sta.z canvas_base_hi + // bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + // [86] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE -- vbuz1=vbuc1 + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + // irq_screen_top::@1 + __b1: + // if(phase==0) + // [87] if(phase==0) goto irq_screen_top::@2 -- vbuz1_eq_0_then_la1 + lda.z phase + beq __b2 + // [88] phi from irq_screen_top::@1 to irq_screen_top::@4 [phi:irq_screen_top::@1->irq_screen_top::@4] + // irq_screen_top::@4 + // game_logic() + // [89] call game_logic + // Game phase + // Perform game logic + jsr game_logic + // [90] phi from irq_screen_top::@4 to irq_screen_top::@8 [phi:irq_screen_top::@4->irq_screen_top::@8] + // irq_screen_top::@8 + // pacman_sound_play() + // [91] call pacman_sound_play + // Play sounds + jsr pacman_sound_play + // irq_screen_top::@3 + __b3: + // VICII->IRQ_STATUS = IRQ_RASTER + // [92] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + // [93] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + // Trigger IRQ at screen top again + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + // [94] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // irq_screen_top::@return + // } + // [95] return + // interrupt(isr_hardware_clobber_exit) -- isr_hardware_all_exit + rega: + lda #0 + regx: + ldx #0 + regy: + ldy #0 + rti + // irq_screen_top::@2 + __b2: + // music_play_next = 1 + // [96] music_play_next = 1 -- vbuz1=vbuc1 + // intro phase + // Play intro music + lda #1 + sta.z music_play_next + jmp __b3 + // [97] phi from irq_screen_top::@5 to irq_screen_top::toDd001 [phi:irq_screen_top::@5->irq_screen_top::toDd001] + // irq_screen_top::toDd001 + // irq_screen_top::@6 + __b6: + // CIA2->PORT_A = toDd00(SCREENS_2) + // [98] *((byte*)CIA2) = irq_screen_top::toDd001_return#0 -- _deref_pbuc1=vbuc2 + // Change graphics bank + lda #toDd001_return + sta CIA2 + // canvas_base_hi = >SPRITES_1 + // [99] canvas_base_hi = >SPRITES_1 -- vbuz1=vbuc1 + // Set the next canvas base address + lda #>SPRITES_1 + sta.z canvas_base_hi + // bobs_restore_base = 0 + // [100] bobs_restore_base = 0 -- vbuz1=vbuc1 + lda #0 + sta.z bobs_restore_base + jmp __b1 +} + // main +main: { + // splash_run() + // [102] call splash_run + // Show the splash screen + // [509] phi from main to splash_run [phi:main->splash_run] + jsr splash_run + // [103] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1] + // main::@1 + __b1: + // gameplay_run() + // [104] call gameplay_run + // Run the gameplay + // [615] phi from main::@1 to gameplay_run [phi:main::@1->gameplay_run] + jsr gameplay_run + // [105] phi from main::@1 to main::@2 [phi:main::@1->main::@2] + // main::@2 + // done_run() + // [106] call done_run + // Show victory or game over image + jsr done_run + jmp __b1 +} + // game_logic +// Perform game logic such as moving pacman and ghosts +game_logic: { + .label __67 = $51 + .label __71 = $51 + .label __210 = $50 + .label ghost_frame_idx = 2 + .label pacman_xtile = $4f + .label ytiles = $51 + .label ghost4_xtile = $53 + .label ghost4_ytile = 4 + .label target_ytile = 3 + .label ghost3_xtile = $54 + .label ghost3_ytile = 4 + .label target_ytile1 = 3 + .label ghost2_xtile = $55 + .label ghost2_ytile = 4 + .label target_ytile2 = 3 + .label ghost1_xtile = $56 + .label ghost1_ytile = 4 + .label target_ytile3 = 3 + // if(game_playable==0) + // [107] if(game_playable!=0) goto game_logic::@1 -- vbuz1_neq_0_then_la1 + lda.z game_playable + bne __b1 + // game_logic::@return + __breturn: + // } + // [108] return + rts + // game_logic::@1 + __b1: + // game_logic_substep+1 + // [109] game_logic::$2 = game_logic_substep + 1 -- vbuxx=vbuz1_plus_1 + ldx.z game_logic_substep + inx + // (game_logic_substep+1)&7 + // [110] game_logic::$3 = game_logic::$2 & 7 -- vbuaa=vbuxx_band_vbuc1 + txa + and #7 + // game_logic_substep = (game_logic_substep+1)&7 + // [111] game_logic_substep = game_logic::$3 -- vbuz1=vbuaa + // Move to next sub-step + sta.z game_logic_substep + // if(game_logic_substep==0) + // [112] if(game_logic_substep==0) goto game_logic::@2 -- vbuz1_eq_0_then_la1 + bne !__b2+ + jmp __b2 + !__b2: + // game_logic::@8 + // if(game_logic_substep==1) + // [113] if(game_logic_substep==1) goto game_logic::@3 -- vbuz1_eq_vbuc1_then_la1 + lda #1 + cmp.z game_logic_substep + bne !__b3+ + jmp __b3 + !__b3: + // game_logic::@9 + // if(game_logic_substep==2) + // [114] if(game_logic_substep==2) goto game_logic::@4 -- vbuz1_eq_vbuc1_then_la1 + lda #2 + cmp.z game_logic_substep + bne !__b4+ + jmp __b4 + !__b4: + // game_logic::@10 + // if(game_logic_substep==4) + // [115] if(game_logic_substep==4) goto game_logic::@5 -- vbuz1_eq_vbuc1_then_la1 + lda #4 + cmp.z game_logic_substep + bne !__b5+ + jmp __b5 + !__b5: + // game_logic::@11 + // if(game_logic_substep==5) + // [116] if(game_logic_substep==5) goto game_logic::@6 -- vbuz1_eq_vbuc1_then_la1 + lda #5 + cmp.z game_logic_substep + bne !__b6+ + jmp __b6 + !__b6: + // game_logic::@12 + // if(game_logic_substep==6) + // [117] if(game_logic_substep==6) goto game_logic::@7 -- vbuz1_eq_vbuc1_then_la1 + lda #6 + cmp.z game_logic_substep + bne !__b7+ + jmp __b7 + !__b7: + // game_logic::@13 + // if(game_logic_substep==3 || game_logic_substep==7) + // [118] if(game_logic_substep==3) goto game_logic::@14 -- vbuz1_eq_vbuc1_then_la1 + lda #3 + cmp.z game_logic_substep + beq __b14 + // game_logic::@161 + // [119] if(game_logic_substep==7) goto game_logic::@14 -- vbuz1_eq_vbuc1_then_la1 + lda #7 + cmp.z game_logic_substep + beq __b14 + rts + // game_logic::@14 + __b14: + // anim_frame_idx+1 + // [120] game_logic::$14 = anim_frame_idx + 1 -- vbuxx=vbuz1_plus_1 + ldx.z anim_frame_idx + inx + // (anim_frame_idx+1) & 3 + // [121] game_logic::$15 = game_logic::$14 & 3 -- vbuaa=vbuxx_band_vbuc1 + txa + and #3 + // anim_frame_idx = (anim_frame_idx+1) & 3 + // [122] anim_frame_idx = game_logic::$15 -- vbuz1=vbuaa + // Update animation and bobs + sta.z anim_frame_idx + // pacman_bob_xfine = pacman_xfine-1 + // [123] game_logic::pacman_bob_xfine#0 = pacman_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z pacman_xfine + tay + dey + // pacman_bob_xfine/4 + // [124] game_logic::$17 = game_logic::pacman_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // bobs_xcol[0] = pacman_bob_xfine/4 + // [125] *bobs_xcol = game_logic::$17 -- _deref_pbuc1=vbuaa + sta bobs_xcol + // pacman_yfine-1 + // [126] game_logic::$18 = pacman_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z pacman_yfine + dex + // bobs_yfine[0] = pacman_yfine-1 + // [127] *bobs_yfine = game_logic::$18 -- _deref_pbuc1=vbuxx + stx bobs_yfine + // pacman_direction|anim_frame_idx + // [128] game_logic::$19 = pacman_direction | anim_frame_idx -- vbuxx=vbuz1_bor_vbuz2 + lda.z pacman_direction + ora.z anim_frame_idx + tax + // pacman_bob_xfine&3 + // [129] game_logic::$20 = game_logic::pacman_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3) + // [130] game_logic::$21 = pacman_frames[game_logic::$19] + game_logic::$20 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc pacman_frames,x + // bobs_bob_id[0] = pacman_frames[pacman_direction|anim_frame_idx] + (pacman_bob_xfine&3) + // [131] *bobs_bob_id = game_logic::$21 -- _deref_pbuc1=vbuaa + sta bobs_bob_id + // ghost_frame_idx = anim_frame_idx + // [132] game_logic::ghost_frame_idx#0 = anim_frame_idx -- vbuz1=vbuz2 + lda.z anim_frame_idx + sta.z ghost_frame_idx + // if(ghosts_mode==FRIGHTENED) + // [133] if(ghosts_mode!=FRIGHTENED) goto game_logic::@44 -- vbuz1_neq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b44 + // game_logic::@15 + // ghost_frame_idx |= 0x40 + // [134] game_logic::ghost_frame_idx#1 = game_logic::ghost_frame_idx#0 | $40 -- vbuz1=vbuz1_bor_vbuc1 + lda #$40 + ora.z ghost_frame_idx + sta.z ghost_frame_idx + // [135] phi from game_logic::@14 game_logic::@15 to game_logic::@44 [phi:game_logic::@14/game_logic::@15->game_logic::@44] + // [135] phi game_logic::ghost_frame_idx#2 = game_logic::ghost_frame_idx#0 [phi:game_logic::@14/game_logic::@15->game_logic::@44#0] -- register_copy + // game_logic::@44 + __b44: + // ghost1_bob_xfine = ghost1_xfine-1 + // [136] game_logic::ghost1_bob_xfine#0 = ghost1_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost1_xfine + tay + dey + // ghost1_bob_xfine/4 + // [137] game_logic::$25 = game_logic::ghost1_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // bobs_xcol[1] = ghost1_bob_xfine/4 + // [138] *(bobs_xcol+1) = game_logic::$25 -- _deref_pbuc1=vbuaa + sta bobs_xcol+1 + // ghost1_yfine-1 + // [139] game_logic::$26 = ghost1_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost1_yfine + dex + // bobs_yfine[1] = ghost1_yfine-1 + // [140] *(bobs_yfine+1) = game_logic::$26 -- _deref_pbuc1=vbuxx + stx bobs_yfine+1 + // ghost1_direction|ghost_frame_idx + // [141] game_logic::$27 = ghost1_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost1_direction + ora.z ghost_frame_idx + tax + // ghost1_bob_xfine&3 + // [142] game_logic::$28 = game_logic::ghost1_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3) + // [143] game_logic::$29 = ghost_frames[game_logic::$27] + game_logic::$28 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // bobs_bob_id[1] = ghost_frames[ghost1_direction|ghost_frame_idx] + (ghost1_bob_xfine&3) + // [144] *(bobs_bob_id+1) = game_logic::$29 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+1 + // ghost2_bob_xfine = ghost2_xfine-1 + // [145] game_logic::ghost2_bob_xfine#0 = ghost2_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost2_xfine + tay + dey + // ghost2_bob_xfine/4 + // [146] game_logic::$31 = game_logic::ghost2_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // bobs_xcol[2] = ghost2_bob_xfine/4 + // [147] *(bobs_xcol+2) = game_logic::$31 -- _deref_pbuc1=vbuaa + sta bobs_xcol+2 + // ghost2_yfine-1 + // [148] game_logic::$32 = ghost2_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost2_yfine + dex + // bobs_yfine[2] = ghost2_yfine-1 + // [149] *(bobs_yfine+2) = game_logic::$32 -- _deref_pbuc1=vbuxx + stx bobs_yfine+2 + // ghost2_direction|ghost_frame_idx + // [150] game_logic::$33 = ghost2_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost2_direction + ora.z ghost_frame_idx + tax + // ghost2_bob_xfine&3 + // [151] game_logic::$34 = game_logic::ghost2_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3) + // [152] game_logic::$35 = ghost_frames[game_logic::$33] + game_logic::$34 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // bobs_bob_id[2] = ghost_frames[ghost2_direction|ghost_frame_idx] + (ghost2_bob_xfine&3) + // [153] *(bobs_bob_id+2) = game_logic::$35 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+2 + // ghost3_bob_xfine = ghost3_xfine-1 + // [154] game_logic::ghost3_bob_xfine#0 = ghost3_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost3_xfine + tay + dey + // ghost3_bob_xfine/4 + // [155] game_logic::$37 = game_logic::ghost3_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // bobs_xcol[3] = ghost3_bob_xfine/4 + // [156] *(bobs_xcol+3) = game_logic::$37 -- _deref_pbuc1=vbuaa + sta bobs_xcol+3 + // ghost3_yfine-1 + // [157] game_logic::$38 = ghost3_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost3_yfine + dex + // bobs_yfine[3] = ghost3_yfine-1 + // [158] *(bobs_yfine+3) = game_logic::$38 -- _deref_pbuc1=vbuxx + stx bobs_yfine+3 + // ghost3_direction|ghost_frame_idx + // [159] game_logic::$39 = ghost3_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost3_direction + ora.z ghost_frame_idx + tax + // ghost3_bob_xfine&3 + // [160] game_logic::$40 = game_logic::ghost3_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3) + // [161] game_logic::$41 = ghost_frames[game_logic::$39] + game_logic::$40 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // bobs_bob_id[3] = ghost_frames[ghost3_direction|ghost_frame_idx] + (ghost3_bob_xfine&3) + // [162] *(bobs_bob_id+3) = game_logic::$41 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+3 + // ghost4_bob_xfine = ghost4_xfine-1 + // [163] game_logic::ghost4_bob_xfine#0 = ghost4_xfine - 1 -- vbuyy=vbuz1_minus_1 + lda.z ghost4_xfine + tay + dey + // ghost4_bob_xfine/4 + // [164] game_logic::$43 = game_logic::ghost4_bob_xfine#0 >> 2 -- vbuaa=vbuyy_ror_2 + tya + lsr + lsr + // bobs_xcol[4] = ghost4_bob_xfine/4 + // [165] *(bobs_xcol+4) = game_logic::$43 -- _deref_pbuc1=vbuaa + sta bobs_xcol+4 + // ghost4_yfine-1 + // [166] game_logic::$44 = ghost4_yfine - 1 -- vbuxx=vbuz1_minus_1 + ldx.z ghost4_yfine + dex + // bobs_yfine[4] = ghost4_yfine-1 + // [167] *(bobs_yfine+4) = game_logic::$44 -- _deref_pbuc1=vbuxx + stx bobs_yfine+4 + // ghost4_direction|ghost_frame_idx + // [168] game_logic::$45 = ghost4_direction | game_logic::ghost_frame_idx#2 -- vbuxx=vbuz1_bor_vbuz2 + lda.z ghost4_direction + ora.z ghost_frame_idx + tax + // ghost4_bob_xfine&3 + // [169] game_logic::$46 = game_logic::ghost4_bob_xfine#0 & 3 -- vbuaa=vbuyy_band_vbuc1 + tya + and #3 + // ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3) + // [170] game_logic::$47 = ghost_frames[game_logic::$45] + game_logic::$46 -- vbuaa=pbuc1_derefidx_vbuxx_plus_vbuaa + clc + adc ghost_frames,x + // bobs_bob_id[4] = ghost_frames[ghost4_direction|ghost_frame_idx] + (ghost4_bob_xfine&3) + // [171] *(bobs_bob_id+4) = game_logic::$47 -- _deref_pbuc1=vbuaa + sta bobs_bob_id+4 + rts + // game_logic::@7 + __b7: + // ghosts_mode_count++; + // [172] ghosts_mode_count = ++ ghosts_mode_count -- vbuz1=_inc_vbuz1 + inc.z ghosts_mode_count + // if(ghosts_mode==SCATTER) + // [173] if(ghosts_mode==SCATTER) goto game_logic::@45 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + bne !__b45+ + jmp __b45 + !__b45: + // game_logic::@16 + // if(ghosts_mode==CHASE) + // [174] if(ghosts_mode==CHASE) goto game_logic::@46 -- vbuz1_eq_vbuc1_then_la1 + lda #CHASE + cmp.z ghosts_mode + bne !__b46+ + jmp __b46 + !__b46: + // game_logic::@17 + // if(ghosts_mode==FRIGHTENED) + // [175] if(ghosts_mode!=FRIGHTENED) goto game_logic::@47 -- vbuz1_neq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + bne __b9 + // game_logic::@18 + // if(ghosts_mode_count>50) + // [176] if(ghosts_mode_count<$32+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$32+1 + bcc __b9 + // game_logic::@19 + // ghosts_mode = CHASE + // [177] ghosts_mode = CHASE -- vbuz1=vbuc1 + lda #CHASE + sta.z ghosts_mode + // ghosts_mode_count = 0 + // [178] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // [179] phi from game_logic::@19 game_logic::@58 game_logic::@59 to game_logic::@47 [phi:game_logic::@19/game_logic::@58/game_logic::@59->game_logic::@47] + __b8: + // [179] phi game_logic::do_reverse#4 = 1 [phi:game_logic::@19/game_logic::@58/game_logic::@59->game_logic::@47#0] -- vbuaa=vbuc1 + lda #1 + jmp __b47 + // [179] phi from game_logic::@17 game_logic::@18 game_logic::@45 game_logic::@46 to game_logic::@47 [phi:game_logic::@17/game_logic::@18/game_logic::@45/game_logic::@46->game_logic::@47] + __b9: + // [179] phi game_logic::do_reverse#4 = 0 [phi:game_logic::@17/game_logic::@18/game_logic::@45/game_logic::@46->game_logic::@47#0] -- vbuaa=vbuc1 + lda #0 + // game_logic::@47 + __b47: + // if(do_reverse) + // [180] if(0==game_logic::do_reverse#4) goto game_logic::@48 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b48 + // game_logic::@60 + // ghost1_reverse = 1 + // [181] ghost1_reverse = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost1_reverse + // ghost2_reverse = 1 + // [182] ghost2_reverse = 1 -- vbuz1=vbuc1 + sta.z ghost2_reverse + // ghost3_reverse = 1 + // [183] ghost3_reverse = 1 -- vbuz1=vbuc1 + sta.z ghost3_reverse + // ghost4_reverse = 1 + // [184] ghost4_reverse = 1 -- vbuz1=vbuc1 + sta.z ghost4_reverse + // game_logic::@48 + __b48: + // pacman_xtile = pacman_xfine/2 + // [185] game_logic::pacman_xtile#0 = pacman_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_xfine + lsr + sta.z pacman_xtile + // pacman_ytile = pacman_yfine/2 + // [186] game_logic::pacman_ytile#0 = pacman_yfine >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_yfine + lsr + // LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile] + // [187] game_logic::$210 = game_logic::pacman_ytile#0 << 1 -- vbuz1=vbuaa_rol_1 + asl + sta.z __210 + // ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[pacman_ytile] + // [188] game_logic::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[game_logic::$210] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuz2 + tay + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // tile_id = ytiles[pacman_xtile] + // [189] game_logic::tile_id#0 = game_logic::ytiles#0[game_logic::pacman_xtile#0] -- vbuxx=pbuz1_derefidx_vbuz2 + ldy.z pacman_xtile + lda (ytiles),y + tax + // if(TILES_TYPE[tile_id]==PILL) + // [190] if(TILES_TYPE[game_logic::tile_id#0]==PILL) goto game_logic::@49 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #PILL + bne !__b49+ + jmp __b49 + !__b49: + // game_logic::@61 + // if(TILES_TYPE[tile_id]==POWERUP) + // [191] if(TILES_TYPE[game_logic::tile_id#0]!=POWERUP) goto game_logic::@50 -- pbuc1_derefidx_vbuxx_neq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #POWERUP + bne __b50 + // game_logic::@62 + // ytiles[pacman_xtile] = EMPTY + // [192] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY -- pbuz1_derefidx_vbuz2=vbuc1 + // Empty the tile + lda #EMPTY + sta (ytiles),y + // pacman_xtile/2 + // [193] game_logic::$65 = game_logic::pacman_xtile#0 >> 1 -- vbuaa=vbuz1_ror_1 + tya + lsr + // logic_tile_xcol = pacman_xtile/2 + // [194] logic_tile_xcol = game_logic::$65 -- vbuz1=vbuaa + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // pacman_xtile & 0xfe + // [195] game_logic::$66 = game_logic::pacman_xtile#0 & $fe -- vbuaa=vbuz1_band_vbuc1 + lda #$fe + and.z pacman_xtile + // ytiles + (pacman_xtile & 0xfe) + // [196] game_logic::$67 = game_logic::ytiles#0 + game_logic::$66 -- pbuz1=pbuz1_plus_vbuaa + clc + adc.z __67 + sta.z __67 + bcc !+ + inc.z __67+1 + !: + // logic_tile_ptr = ytiles + (pacman_xtile & 0xfe) + // [197] logic_tile_ptr = game_logic::$67 -- pbuz1=pbuz2 + lda.z __67 + sta.z logic_tile_ptr + lda.z __67+1 + sta.z logic_tile_ptr+1 + // pacman_ytile*2 + // [198] game_logic::$68 = game_logic::$210 -- vbuaa=vbuz1 + lda.z __210 + // logic_tile_yfine = pacman_ytile*2 + // [199] logic_tile_yfine = game_logic::$68 -- vbuz1=vbuaa + sta.z logic_tile_yfine + // ghosts_mode = FRIGHTENED + // [200] ghosts_mode = FRIGHTENED -- vbuz1=vbuc1 + // Start power-up mode + lda #FRIGHTENED + sta.z ghosts_mode + // ghosts_mode_count = 0 + // [201] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // game_logic::@50 + __b50: + // pacman_xfine-ghost1_xfine + // [202] game_logic::$75 = pacman_xfine - ghost1_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost1_xfine + tax + // pacman_yfine-ghost1_yfine + // [203] game_logic::$77 = pacman_yfine - ghost1_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost1_yfine + tay + // if(ABS[pacman_xfine-ghost1_xfine]<2 && ABS[pacman_yfine-ghost1_yfine]<2) + // [204] if(ABS[game_logic::$75]>=2) goto game_logic::@64 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + // Check if anyone dies + lda ABS,x + cmp #2 + bcs __b64 + // game_logic::@162 + // [205] if(ABS[game_logic::$77]<2) goto game_logic::@51 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcs !__b51+ + jmp __b51 + !__b51: + // game_logic::@64 + __b64: + // pacman_xfine-ghost2_xfine + // [206] game_logic::$80 = pacman_xfine - ghost2_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost2_xfine + tax + // pacman_yfine-ghost2_yfine + // [207] game_logic::$82 = pacman_yfine - ghost2_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost2_yfine + tay + // if(ABS[pacman_xfine-ghost2_xfine]<2 && ABS[pacman_yfine-ghost2_yfine]<2) + // [208] if(ABS[game_logic::$80]>=2) goto game_logic::@65 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcs __b65 + // game_logic::@163 + // [209] if(ABS[game_logic::$82]<2) goto game_logic::@52 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b52 + // game_logic::@65 + __b65: + // pacman_xfine-ghost3_xfine + // [210] game_logic::$85 = pacman_xfine - ghost3_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost3_xfine + tax + // pacman_yfine-ghost3_yfine + // [211] game_logic::$87 = pacman_yfine - ghost3_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost3_yfine + tay + // if(ABS[pacman_xfine-ghost3_xfine]<2 && ABS[pacman_yfine-ghost3_yfine]<2) + // [212] if(ABS[game_logic::$85]>=2) goto game_logic::@66 -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcs __b66 + // game_logic::@164 + // [213] if(ABS[game_logic::$87]<2) goto game_logic::@53 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b53 + // game_logic::@66 + __b66: + // pacman_xfine-ghost4_xfine + // [214] game_logic::$90 = pacman_xfine - ghost4_xfine -- vbuxx=vbuz1_minus_vbuz2 + lda.z pacman_xfine + sec + sbc.z ghost4_xfine + tax + // pacman_yfine-ghost4_yfine + // [215] game_logic::$92 = pacman_yfine - ghost4_yfine -- vbuyy=vbuz1_minus_vbuz2 + lda.z pacman_yfine + sec + sbc.z ghost4_yfine + tay + // if(ABS[pacman_xfine-ghost4_xfine]<2 && ABS[pacman_yfine-ghost4_yfine]<2) + // [216] if(ABS[game_logic::$90]>=2) goto game_logic::@return -- pbuc1_derefidx_vbuxx_ge_vbuc2_then_la1 + lda ABS,x + cmp #2 + bcc !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@165 + // [217] if(ABS[game_logic::$92]<2) goto game_logic::@67 -- pbuc1_derefidx_vbuyy_lt_vbuc2_then_la1 + lda ABS,y + cmp #2 + bcc __b67 + rts + // game_logic::@67 + __b67: + // if(ghosts_mode==FRIGHTENED) + // [218] if(ghosts_mode==FRIGHTENED) goto game_logic::@54 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b54 + // game_logic::@68 + // pacman_lives--; + // [219] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // spawn_all() + // [220] call spawn_all + jsr spawn_all + rts + // game_logic::@54 + __b54: + // ghost4_direction = STOP + // [221] ghost4_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost4_direction + // ghost4_xfine = 50 + // [222] ghost4_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost4_xfine + // ghost4_yfine = 35 + // [223] ghost4_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost4_yfine + // ghost4_substep = 0 + // [224] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + // ghost4_respawn = 50 + // [225] ghost4_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost4_respawn + rts + // game_logic::@53 + __b53: + // if(ghosts_mode==FRIGHTENED) + // [226] if(ghosts_mode==FRIGHTENED) goto game_logic::@55 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b55 + // game_logic::@69 + // pacman_lives--; + // [227] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // spawn_all() + // [228] call spawn_all + jsr spawn_all + rts + // game_logic::@55 + __b55: + // ghost3_direction = STOP + // [229] ghost3_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost3_direction + // ghost3_xfine = 50 + // [230] ghost3_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost3_xfine + // ghost3_yfine = 35 + // [231] ghost3_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost3_yfine + // ghost3_substep = 0 + // [232] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + // ghost3_respawn = 50 + // [233] ghost3_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost3_respawn + rts + // game_logic::@52 + __b52: + // if(ghosts_mode==FRIGHTENED) + // [234] if(ghosts_mode==FRIGHTENED) goto game_logic::@56 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b56 + // game_logic::@70 + // pacman_lives--; + // [235] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // spawn_all() + // [236] call spawn_all + jsr spawn_all + rts + // game_logic::@56 + __b56: + // ghost2_direction = STOP + // [237] ghost2_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z ghost2_direction + // ghost2_xfine = 50 + // [238] ghost2_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost2_xfine + // ghost2_yfine = 35 + // [239] ghost2_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost2_yfine + // ghost2_substep = 0 + // [240] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + // ghost2_respawn = 50 + // [241] ghost2_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost2_respawn + rts + // game_logic::@51 + __b51: + // if(ghosts_mode==FRIGHTENED) + // [242] if(ghosts_mode==FRIGHTENED) goto game_logic::@57 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b57 + // game_logic::@71 + // pacman_lives--; + // [243] pacman_lives = -- pacman_lives -- vbuz1=_dec_vbuz1 + dec.z pacman_lives + // spawn_all() + // [244] call spawn_all + jsr spawn_all + rts + // game_logic::@57 + __b57: + // ghost1_direction = STOP + // [245] ghost1_direction = STOP -- vbuz1=vbuc1 + // ghost dies + lda #STOP + sta.z ghost1_direction + // ghost1_xfine = 50 + // [246] ghost1_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost1_xfine + // ghost1_yfine = 35 + // [247] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // ghost1_substep = 0 + // [248] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + // ghost1_respawn = 50 + // [249] ghost1_respawn = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z ghost1_respawn + rts + // game_logic::@49 + __b49: + // ytiles[pacman_xtile] = EMPTY + // [250] game_logic::ytiles#0[game_logic::pacman_xtile#0] = EMPTY -- pbuz1_derefidx_vbuz2=vbuc1 + // Empty the tile + lda #EMPTY + ldy.z pacman_xtile + sta (ytiles),y + // pacman_xtile/2 + // [251] game_logic::$69 = game_logic::pacman_xtile#0 >> 1 -- vbuaa=vbuz1_ror_1 + tya + lsr + // logic_tile_xcol = pacman_xtile/2 + // [252] logic_tile_xcol = game_logic::$69 -- vbuz1=vbuaa + // Ask the logic code renderer to update the tile + sta.z logic_tile_xcol + // pacman_xtile & 0xfe + // [253] game_logic::$70 = game_logic::pacman_xtile#0 & $fe -- vbuaa=vbuz1_band_vbuc1 + lda #$fe + and.z pacman_xtile + // ytiles + (pacman_xtile & 0xfe) + // [254] game_logic::$71 = game_logic::ytiles#0 + game_logic::$70 -- pbuz1=pbuz1_plus_vbuaa + clc + adc.z __71 + sta.z __71 + bcc !+ + inc.z __71+1 + !: + // logic_tile_ptr = ytiles + (pacman_xtile & 0xfe) + // [255] logic_tile_ptr = game_logic::$71 -- pbuz1=pbuz2 + lda.z __71 + sta.z logic_tile_ptr + lda.z __71+1 + sta.z logic_tile_ptr+1 + // pacman_ytile*2 + // [256] game_logic::$72 = game_logic::$210 -- vbuaa=vbuz1 + lda.z __210 + // logic_tile_yfine = pacman_ytile*2 + // [257] logic_tile_yfine = game_logic::$72 -- vbuz1=vbuaa + sta.z logic_tile_yfine + // if(--pill_count==0) + // [258] pill_count = -- pill_count -- vwuz1=_dec_vwuz1 + lda.z pill_count + bne !+ + dec.z pill_count+1 + !: + dec.z pill_count + // [259] if(pill_count!=0) goto game_logic::@50 -- vwuz1_neq_0_then_la1 + lda.z pill_count + ora.z pill_count+1 + beq !__b50+ + jmp __b50 + !__b50: + // game_logic::@63 + // pacman_wins = 1 + // [260] pacman_wins = 1 -- vbuz1=vbuc1 + lda #1 + sta.z pacman_wins + jmp __b50 + // game_logic::@46 + __b46: + // if(ghosts_mode_count>150) + // [261] if(ghosts_mode_count<$96+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$96+1 + bcs !__b9+ + jmp __b9 + !__b9: + // game_logic::@58 + // ghosts_mode = SCATTER + // [262] ghosts_mode = SCATTER -- vbuz1=vbuc1 + lda #SCATTER + sta.z ghosts_mode + // ghosts_mode_count = 0 + // [263] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + jmp __b8 + // game_logic::@45 + __b45: + // if(ghosts_mode_count>50) + // [264] if(ghosts_mode_count<$32+1) goto game_logic::@47 -- vbuz1_lt_vbuc1_then_la1 + lda.z ghosts_mode_count + cmp #$32+1 + bcs !__b9+ + jmp __b9 + !__b9: + // game_logic::@59 + // ghosts_mode = CHASE + // [265] ghosts_mode = CHASE -- vbuz1=vbuc1 + lda #CHASE + sta.z ghosts_mode + // ghosts_mode_count = 0 + // [266] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + jmp __b8 + // game_logic::@6 + __b6: + // if(ghost4_respawn) + // [267] if(0!=ghost4_respawn) goto game_logic::@72 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost4_respawn + beq !__b72+ + jmp __b72 + !__b72: + // game_logic::@20 + // if(ghost4_direction==RIGHT) + // [268] if(ghost4_direction==RIGHT) goto game_logic::@73 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost4_direction + bne !__b73+ + jmp __b73 + !__b73: + // game_logic::@21 + // if(ghost4_direction==DOWN) + // [269] if(ghost4_direction==DOWN) goto game_logic::@74 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost4_direction + bne !__b74+ + jmp __b74 + !__b74: + // game_logic::@22 + // if(ghost4_direction==LEFT) + // [270] if(ghost4_direction==LEFT) goto game_logic::@75 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost4_direction + bne !__b75+ + jmp __b75 + !__b75: + // game_logic::@23 + // if(ghost4_direction==UP) + // [271] if(ghost4_direction!=UP) goto game_logic::@76 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost4_direction + bne __b76 + // game_logic::@24 + // --ghost4_yfine; + // [272] ghost4_yfine = -- ghost4_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost4_yfine + // game_logic::@76 + __b76: + // ghost4_direction!=STOP + // [273] game_logic::$220 = ghost4_direction -- vbuxx=vbuz1 + ldx.z ghost4_direction + // if(ghost4_substep==0 && ghost4_direction!=STOP) + // [274] if(ghost4_substep!=0) goto game_logic::@82 -- vbuz1_neq_0_then_la1 + lda.z ghost4_substep + bne __b82 + // game_logic::@166 + // [275] if(game_logic::$220!=STOP) goto game_logic::@77 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b77 + // game_logic::@82 + __b82: + // ghost4_substep = 0 + // [276] ghost4_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost4_substep + // if(ghost4_reverse) + // [277] if(0!=ghost4_reverse) goto game_logic::@78 -- 0_neq_vbuz1_then_la1 + lda.z ghost4_reverse + bne __b78 + // game_logic::@83 + // ghost4_xtile = ghost4_xfine/2 + // [278] game_logic::ghost4_xtile#0 = ghost4_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost4_xfine + lsr + sta.z ghost4_xtile + // ghost4_ytile = ghost4_yfine/2 + // [279] game_logic::ghost4_ytile#0 = ghost4_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost4_yfine + lsr + sta.z ghost4_ytile + // level_tile_directions(ghost4_xtile, ghost4_ytile) + // [280] level_tile_directions::xtile#0 = game_logic::ghost4_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost4_xtile + // [281] level_tile_directions::ytile#0 = game_logic::ghost4_ytile#0 -- vbuaa=vbuz1 + // [282] call level_tile_directions + // [738] phi from game_logic::@83 to level_tile_directions [phi:game_logic::@83->level_tile_directions] + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#0 [phi:game_logic::@83->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#0 [phi:game_logic::@83->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // level_tile_directions(ghost4_xtile, ghost4_ytile) + // [283] level_tile_directions::return#3 = level_tile_directions::return#2 + // game_logic::@152 + // open_directions = level_tile_directions(ghost4_xtile, ghost4_ytile) + // [284] game_logic::open_directions#0 = level_tile_directions::return#3 + // open_directions &= DIRECTION_ELIMINATE[ghost4_direction] + // [285] game_logic::open_directions#1 = game_logic::open_directions#0 & DIRECTION_ELIMINATE[ghost4_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost4_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + // [286] if(ghosts_mode==FRIGHTENED) goto game_logic::@79 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b79 + // game_logic::@84 + // if(ghosts_mode==SCATTER) + // [287] if(ghosts_mode==SCATTER) goto game_logic::@80 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b10 + // game_logic::@85 + // target_xtile = pacman_xfine/2 + // [288] game_logic::target_xtile#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + // [289] game_logic::target_ytile#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile + // [290] phi from game_logic::@85 to game_logic::@80 [phi:game_logic::@85->game_logic::@80] + // [290] phi game_logic::target_ytile#3 = game_logic::target_ytile#2 [phi:game_logic::@85->game_logic::@80#0] -- register_copy + // [290] phi game_logic::target_xtile#3 = game_logic::target_xtile#2 [phi:game_logic::@85->game_logic::@80#1] -- register_copy + jmp __b80 + // [290] phi from game_logic::@84 to game_logic::@80 [phi:game_logic::@84->game_logic::@80] + __b10: + // [290] phi game_logic::target_ytile#3 = 2 [phi:game_logic::@84->game_logic::@80#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile + // [290] phi game_logic::target_xtile#3 = 2 [phi:game_logic::@84->game_logic::@80#1] -- vbuxx=vbuc1 + tax + // game_logic::@80 + __b80: + // choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + // [291] choose_direction::open_directions#0 = game_logic::open_directions#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [292] choose_direction::ghost_xtile#0 = game_logic::ghost4_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost4_xtile + // [293] choose_direction::ghost_ytile#0 = game_logic::ghost4_ytile#0 + // [294] choose_direction::target_xtile#0 = game_logic::target_xtile#3 + // [295] choose_direction::target_ytile#0 = game_logic::target_ytile#3 + // [296] call choose_direction + // [746] phi from game_logic::@80 to choose_direction [phi:game_logic::@80->choose_direction] + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#0 [phi:game_logic::@80->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#0 [phi:game_logic::@80->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#0 [phi:game_logic::@80->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#0 [phi:game_logic::@80->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#0 [phi:game_logic::@80->choose_direction#4] -- register_copy + jsr choose_direction + // choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + // [297] choose_direction::return#0 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + // game_logic::@153 + // [298] game_logic::$119 = choose_direction::return#0 + // ghost4_direction = choose_direction( open_directions, ghost4_xtile, ghost4_ytile, target_xtile, target_ytile ) + // [299] ghost4_direction = game_logic::$119 -- vbuz1=vbuaa + sta.z ghost4_direction + rts + // game_logic::@79 + __b79: + // ghost4_direction = DIRECTION_SINGLE[open_directions] + // [300] ghost4_direction = DIRECTION_SINGLE[game_logic::open_directions#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost4_direction + rts + // game_logic::@78 + __b78: + // ghost4_direction = DIRECTION_REVERSE[ghost4_direction] + // [301] ghost4_direction = DIRECTION_REVERSE[ghost4_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost4_direction + lda DIRECTION_REVERSE,y + sta.z ghost4_direction + // ghost4_reverse = 0 + // [302] ghost4_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_reverse + rts + // game_logic::@77 + __b77: + // ghost4_substep = 1 + // [303] ghost4_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost4_substep + // if(ghost4_xfine==1) + // [304] if(ghost4_xfine==1) goto game_logic::@81 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + cmp.z ghost4_xfine + beq __b81 + // game_logic::@86 + // if(ghost4_xfine==97) + // [305] if(ghost4_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost4_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@87 + // ghost4_xfine = 1 + // [306] ghost4_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost4_xfine + rts + // game_logic::@81 + __b81: + // ghost4_xfine = 97 + // [307] ghost4_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost4_xfine + rts + // game_logic::@75 + __b75: + // --ghost4_xfine; + // [308] ghost4_xfine = -- ghost4_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost4_xfine + jmp __b76 + // game_logic::@74 + __b74: + // ++ghost4_yfine; + // [309] ghost4_yfine = ++ ghost4_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost4_yfine + jmp __b76 + // game_logic::@73 + __b73: + // ++ghost4_xfine; + // [310] ghost4_xfine = ++ ghost4_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost4_xfine + jmp __b76 + // game_logic::@72 + __b72: + // if(--ghost4_respawn==0) + // [311] ghost4_respawn = -- ghost4_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost4_respawn + // [312] if(ghost4_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost4_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@88 + // ghost4_direction = RIGHT + // [313] ghost4_direction = RIGHT -- vbuz1=vbuc1 + // Spawn ghost + lda #RIGHT + sta.z ghost4_direction + // ghost4_xfine = 2 + // [314] ghost4_xfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost4_xfine + // ghost4_yfine = 2 + // [315] ghost4_yfine = 2 -- vbuz1=vbuc1 + sta.z ghost4_yfine + // ghost4_substep = 0 + // [316] ghost4_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost4_substep + rts + // game_logic::@5 + __b5: + // if(ghost3_respawn) + // [317] if(0!=ghost3_respawn) goto game_logic::@89 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost3_respawn + beq !__b89+ + jmp __b89 + !__b89: + // game_logic::@25 + // if(ghost3_direction==RIGHT) + // [318] if(ghost3_direction==RIGHT) goto game_logic::@90 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost3_direction + bne !__b90+ + jmp __b90 + !__b90: + // game_logic::@26 + // if(ghost3_direction==DOWN) + // [319] if(ghost3_direction==DOWN) goto game_logic::@91 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost3_direction + bne !__b91+ + jmp __b91 + !__b91: + // game_logic::@27 + // if(ghost3_direction==LEFT) + // [320] if(ghost3_direction==LEFT) goto game_logic::@92 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost3_direction + bne !__b92+ + jmp __b92 + !__b92: + // game_logic::@28 + // if(ghost3_direction==UP) + // [321] if(ghost3_direction!=UP) goto game_logic::@93 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost3_direction + bne __b93 + // game_logic::@29 + // --ghost3_yfine; + // [322] ghost3_yfine = -- ghost3_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost3_yfine + // game_logic::@93 + __b93: + // ghost3_direction!=STOP + // [323] game_logic::$223 = ghost3_direction -- vbuxx=vbuz1 + ldx.z ghost3_direction + // if(ghost3_substep==0 && ghost3_direction!=STOP) + // [324] if(ghost3_substep!=0) goto game_logic::@99 -- vbuz1_neq_0_then_la1 + lda.z ghost3_substep + bne __b99 + // game_logic::@167 + // [325] if(game_logic::$223!=STOP) goto game_logic::@94 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b94 + // game_logic::@99 + __b99: + // ghost3_substep = 0 + // [326] ghost3_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost3_substep + // if(ghost3_reverse) + // [327] if(0!=ghost3_reverse) goto game_logic::@95 -- 0_neq_vbuz1_then_la1 + lda.z ghost3_reverse + bne __b95 + // game_logic::@100 + // ghost3_xtile = ghost3_xfine/2 + // [328] game_logic::ghost3_xtile#0 = ghost3_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost3_xfine + lsr + sta.z ghost3_xtile + // ghost3_ytile = ghost3_yfine/2 + // [329] game_logic::ghost3_ytile#0 = ghost3_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost3_yfine + lsr + sta.z ghost3_ytile + // level_tile_directions(ghost3_xtile, ghost3_ytile) + // [330] level_tile_directions::xtile#1 = game_logic::ghost3_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost3_xtile + // [331] level_tile_directions::ytile#1 = game_logic::ghost3_ytile#0 -- vbuaa=vbuz1 + // [332] call level_tile_directions + // [738] phi from game_logic::@100 to level_tile_directions [phi:game_logic::@100->level_tile_directions] + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#1 [phi:game_logic::@100->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#1 [phi:game_logic::@100->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // level_tile_directions(ghost3_xtile, ghost3_ytile) + // [333] level_tile_directions::return#10 = level_tile_directions::return#2 + // game_logic::@154 + // open_directions = level_tile_directions(ghost3_xtile, ghost3_ytile) + // [334] game_logic::open_directions1#0 = level_tile_directions::return#10 + // open_directions &= DIRECTION_ELIMINATE[ghost3_direction] + // [335] game_logic::open_directions1#1 = game_logic::open_directions1#0 & DIRECTION_ELIMINATE[ghost3_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost3_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + // [336] if(ghosts_mode==FRIGHTENED) goto game_logic::@96 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b96 + // game_logic::@101 + // if(ghosts_mode==SCATTER) + // [337] if(ghosts_mode==SCATTER) goto game_logic::@97 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b11 + // game_logic::@102 + // target_xtile = pacman_xfine/2 + // [338] game_logic::target_xtile1#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + // [339] game_logic::target_ytile1#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile1 + // [340] phi from game_logic::@102 to game_logic::@97 [phi:game_logic::@102->game_logic::@97] + // [340] phi game_logic::target_ytile1#3 = game_logic::target_ytile1#2 [phi:game_logic::@102->game_logic::@97#0] -- register_copy + // [340] phi game_logic::target_xtile1#3 = game_logic::target_xtile1#2 [phi:game_logic::@102->game_logic::@97#1] -- register_copy + jmp __b97 + // [340] phi from game_logic::@101 to game_logic::@97 [phi:game_logic::@101->game_logic::@97] + __b11: + // [340] phi game_logic::target_ytile1#3 = 2 [phi:game_logic::@101->game_logic::@97#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile1 + // [340] phi game_logic::target_xtile1#3 = 2 [phi:game_logic::@101->game_logic::@97#1] -- vbuxx=vbuc1 + tax + // game_logic::@97 + __b97: + // choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + // [341] choose_direction::open_directions#1 = game_logic::open_directions1#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [342] choose_direction::ghost_xtile#1 = game_logic::ghost3_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost3_xtile + // [343] choose_direction::ghost_ytile#1 = game_logic::ghost3_ytile#0 + // [344] choose_direction::target_xtile#1 = game_logic::target_xtile1#3 + // [345] choose_direction::target_ytile#1 = game_logic::target_ytile1#3 + // [346] call choose_direction + // [746] phi from game_logic::@97 to choose_direction [phi:game_logic::@97->choose_direction] + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#1 [phi:game_logic::@97->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#1 [phi:game_logic::@97->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#1 [phi:game_logic::@97->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#1 [phi:game_logic::@97->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#1 [phi:game_logic::@97->choose_direction#4] -- register_copy + jsr choose_direction + // choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + // [347] choose_direction::return#1 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + // game_logic::@155 + // [348] game_logic::$140 = choose_direction::return#1 + // ghost3_direction = choose_direction( open_directions, ghost3_xtile, ghost3_ytile, target_xtile, target_ytile ) + // [349] ghost3_direction = game_logic::$140 -- vbuz1=vbuaa + sta.z ghost3_direction + rts + // game_logic::@96 + __b96: + // ghost3_direction = DIRECTION_SINGLE[open_directions] + // [350] ghost3_direction = DIRECTION_SINGLE[game_logic::open_directions1#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost3_direction + rts + // game_logic::@95 + __b95: + // ghost3_direction = DIRECTION_REVERSE[ghost3_direction] + // [351] ghost3_direction = DIRECTION_REVERSE[ghost3_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost3_direction + lda DIRECTION_REVERSE,y + sta.z ghost3_direction + // ghost3_reverse = 0 + // [352] ghost3_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_reverse + rts + // game_logic::@94 + __b94: + // ghost3_substep = 1 + // [353] ghost3_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost3_substep + // if(ghost3_xfine==1) + // [354] if(ghost3_xfine==1) goto game_logic::@98 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + cmp.z ghost3_xfine + beq __b98 + // game_logic::@103 + // if(ghost3_xfine==97) + // [355] if(ghost3_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost3_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@104 + // ghost3_xfine = 1 + // [356] ghost3_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost3_xfine + rts + // game_logic::@98 + __b98: + // ghost3_xfine = 97 + // [357] ghost3_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost3_xfine + rts + // game_logic::@92 + __b92: + // --ghost3_xfine; + // [358] ghost3_xfine = -- ghost3_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost3_xfine + jmp __b93 + // game_logic::@91 + __b91: + // ++ghost3_yfine; + // [359] ghost3_yfine = ++ ghost3_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost3_yfine + jmp __b93 + // game_logic::@90 + __b90: + // ++ghost3_xfine; + // [360] ghost3_xfine = ++ ghost3_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost3_xfine + jmp __b93 + // game_logic::@89 + __b89: + // if(--ghost3_respawn==0) + // [361] ghost3_respawn = -- ghost3_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost3_respawn + // [362] if(ghost3_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost3_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@105 + // ghost3_direction = UP + // [363] ghost3_direction = UP -- vbuz1=vbuc1 + // Spawn ghost + lda #UP + sta.z ghost3_direction + // ghost3_xfine = 2 + // [364] ghost3_xfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost3_xfine + // ghost3_yfine = 70 + // [365] ghost3_yfine = $46 -- vbuz1=vbuc1 + lda #$46 + sta.z ghost3_yfine + // ghost3_substep = 0 + // [366] ghost3_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost3_substep + rts + // game_logic::@4 + __b4: + // if(ghost2_respawn) + // [367] if(0!=ghost2_respawn) goto game_logic::@106 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost2_respawn + beq !__b106+ + jmp __b106 + !__b106: + // game_logic::@30 + // if(ghost2_direction==RIGHT) + // [368] if(ghost2_direction==RIGHT) goto game_logic::@107 -- vbuz1_eq_vbuc1_then_la1 + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost2_direction + bne !__b107+ + jmp __b107 + !__b107: + // game_logic::@31 + // if(ghost2_direction==DOWN) + // [369] if(ghost2_direction==DOWN) goto game_logic::@108 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost2_direction + bne !__b108+ + jmp __b108 + !__b108: + // game_logic::@32 + // if(ghost2_direction==LEFT) + // [370] if(ghost2_direction==LEFT) goto game_logic::@109 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost2_direction + bne !__b109+ + jmp __b109 + !__b109: + // game_logic::@33 + // if(ghost2_direction==UP) + // [371] if(ghost2_direction!=UP) goto game_logic::@110 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost2_direction + bne __b110 + // game_logic::@34 + // --ghost2_yfine; + // [372] ghost2_yfine = -- ghost2_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost2_yfine + // game_logic::@110 + __b110: + // ghost2_direction!=STOP + // [373] game_logic::$226 = ghost2_direction -- vbuxx=vbuz1 + ldx.z ghost2_direction + // if(ghost2_substep==0 && ghost2_direction!=STOP) + // [374] if(ghost2_substep!=0) goto game_logic::@116 -- vbuz1_neq_0_then_la1 + lda.z ghost2_substep + bne __b116 + // game_logic::@168 + // [375] if(game_logic::$226!=STOP) goto game_logic::@111 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b111 + // game_logic::@116 + __b116: + // ghost2_substep = 0 + // [376] ghost2_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost2_substep + // if(ghost2_reverse) + // [377] if(0!=ghost2_reverse) goto game_logic::@112 -- 0_neq_vbuz1_then_la1 + lda.z ghost2_reverse + bne __b112 + // game_logic::@117 + // ghost2_xtile = ghost2_xfine/2 + // [378] game_logic::ghost2_xtile#0 = ghost2_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost2_xfine + lsr + sta.z ghost2_xtile + // ghost2_ytile = ghost2_yfine/2 + // [379] game_logic::ghost2_ytile#0 = ghost2_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost2_yfine + lsr + sta.z ghost2_ytile + // level_tile_directions(ghost2_xtile, ghost2_ytile) + // [380] level_tile_directions::xtile#2 = game_logic::ghost2_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost2_xtile + // [381] level_tile_directions::ytile#2 = game_logic::ghost2_ytile#0 -- vbuaa=vbuz1 + // [382] call level_tile_directions + // [738] phi from game_logic::@117 to level_tile_directions [phi:game_logic::@117->level_tile_directions] + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#2 [phi:game_logic::@117->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#2 [phi:game_logic::@117->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // level_tile_directions(ghost2_xtile, ghost2_ytile) + // [383] level_tile_directions::return#11 = level_tile_directions::return#2 + // game_logic::@156 + // open_directions = level_tile_directions(ghost2_xtile, ghost2_ytile) + // [384] game_logic::open_directions2#0 = level_tile_directions::return#11 + // open_directions &= DIRECTION_ELIMINATE[ghost2_direction] + // [385] game_logic::open_directions2#1 = game_logic::open_directions2#0 & DIRECTION_ELIMINATE[ghost2_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost2_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + // [386] if(ghosts_mode==FRIGHTENED) goto game_logic::@113 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b113 + // game_logic::@118 + // if(ghosts_mode==SCATTER) + // [387] if(ghosts_mode==SCATTER) goto game_logic::@114 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b12 + // game_logic::@119 + // target_xtile = pacman_xfine/2 + // [388] game_logic::target_xtile2#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + // [389] game_logic::target_ytile2#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile2 + // [390] phi from game_logic::@119 to game_logic::@114 [phi:game_logic::@119->game_logic::@114] + // [390] phi game_logic::target_ytile2#3 = game_logic::target_ytile2#2 [phi:game_logic::@119->game_logic::@114#0] -- register_copy + // [390] phi game_logic::target_xtile2#3 = game_logic::target_xtile2#2 [phi:game_logic::@119->game_logic::@114#1] -- register_copy + jmp __b114 + // [390] phi from game_logic::@118 to game_logic::@114 [phi:game_logic::@118->game_logic::@114] + __b12: + // [390] phi game_logic::target_ytile2#3 = 2 [phi:game_logic::@118->game_logic::@114#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile2 + // [390] phi game_logic::target_xtile2#3 = 2 [phi:game_logic::@118->game_logic::@114#1] -- vbuxx=vbuc1 + tax + // game_logic::@114 + __b114: + // choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + // [391] choose_direction::open_directions#2 = game_logic::open_directions2#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [392] choose_direction::ghost_xtile#2 = game_logic::ghost2_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost2_xtile + // [393] choose_direction::ghost_ytile#2 = game_logic::ghost2_ytile#0 + // [394] choose_direction::target_xtile#2 = game_logic::target_xtile2#3 + // [395] choose_direction::target_ytile#2 = game_logic::target_ytile2#3 + // [396] call choose_direction + // [746] phi from game_logic::@114 to choose_direction [phi:game_logic::@114->choose_direction] + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#2 [phi:game_logic::@114->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#2 [phi:game_logic::@114->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#2 [phi:game_logic::@114->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#2 [phi:game_logic::@114->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#2 [phi:game_logic::@114->choose_direction#4] -- register_copy + jsr choose_direction + // choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + // [397] choose_direction::return#2 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + // game_logic::@157 + // [398] game_logic::$161 = choose_direction::return#2 + // ghost2_direction = choose_direction( open_directions, ghost2_xtile, ghost2_ytile, target_xtile, target_ytile ) + // [399] ghost2_direction = game_logic::$161 -- vbuz1=vbuaa + sta.z ghost2_direction + rts + // game_logic::@113 + __b113: + // ghost2_direction = DIRECTION_SINGLE[open_directions] + // [400] ghost2_direction = DIRECTION_SINGLE[game_logic::open_directions2#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost2_direction + rts + // game_logic::@112 + __b112: + // ghost2_direction = DIRECTION_REVERSE[ghost2_direction] + // [401] ghost2_direction = DIRECTION_REVERSE[ghost2_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost2_direction + lda DIRECTION_REVERSE,y + sta.z ghost2_direction + // ghost2_reverse = 0 + // [402] ghost2_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_reverse + rts + // game_logic::@111 + __b111: + // ghost2_substep = 1 + // [403] ghost2_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost2_substep + // if(ghost2_xfine==1) + // [404] if(ghost2_xfine==1) goto game_logic::@115 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + cmp.z ghost2_xfine + beq __b115 + // game_logic::@120 + // if(ghost2_xfine==97) + // [405] if(ghost2_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost2_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@121 + // ghost2_xfine = 1 + // [406] ghost2_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost2_xfine + rts + // game_logic::@115 + __b115: + // ghost2_xfine = 97 + // [407] ghost2_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost2_xfine + rts + // game_logic::@109 + __b109: + // --ghost2_xfine; + // [408] ghost2_xfine = -- ghost2_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost2_xfine + jmp __b110 + // game_logic::@108 + __b108: + // ++ghost2_yfine; + // [409] ghost2_yfine = ++ ghost2_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost2_yfine + jmp __b110 + // game_logic::@107 + __b107: + // ++ghost2_xfine; + // [410] ghost2_xfine = ++ ghost2_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost2_xfine + jmp __b110 + // game_logic::@106 + __b106: + // if(--ghost2_respawn==0) + // [411] ghost2_respawn = -- ghost2_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost2_respawn + // [412] if(ghost2_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost2_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@122 + // ghost2_direction = LEFT + // [413] ghost2_direction = LEFT -- vbuz1=vbuc1 + // Spawn ghost + lda #LEFT + sta.z ghost2_direction + // ghost2_xfine = 96 + // [414] ghost2_xfine = $60 -- vbuz1=vbuc1 + lda #$60 + sta.z ghost2_xfine + // ghost2_yfine = 70 + // [415] ghost2_yfine = $46 -- vbuz1=vbuc1 + lda #$46 + sta.z ghost2_yfine + // ghost2_substep = 0 + // [416] ghost2_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost2_substep + rts + // game_logic::@3 + __b3: + // if(ghost1_respawn) + // [417] if(0!=ghost1_respawn) goto game_logic::@123 -- 0_neq_vbuz1_then_la1 + // Ghost spawn timer + lda.z ghost1_respawn + beq !__b123+ + jmp __b123 + !__b123: + // game_logic::@35 + // if(ghost1_direction==RIGHT) + // [418] if(ghost1_direction==RIGHT) goto game_logic::@124 -- vbuz1_eq_vbuc1_then_la1 + // Ghost 1 animation + // Move in the current direction (unless he is stopped) + lda #RIGHT + cmp.z ghost1_direction + bne !__b124+ + jmp __b124 + !__b124: + // game_logic::@36 + // if(ghost1_direction==DOWN) + // [419] if(ghost1_direction==DOWN) goto game_logic::@125 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z ghost1_direction + bne !__b125+ + jmp __b125 + !__b125: + // game_logic::@37 + // if(ghost1_direction==LEFT) + // [420] if(ghost1_direction==LEFT) goto game_logic::@126 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z ghost1_direction + bne !__b126+ + jmp __b126 + !__b126: + // game_logic::@38 + // if(ghost1_direction==UP) + // [421] if(ghost1_direction!=UP) goto game_logic::@127 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z ghost1_direction + bne __b127 + // game_logic::@39 + // --ghost1_yfine; + // [422] ghost1_yfine = -- ghost1_yfine -- vbuz1=_dec_vbuz1 + dec.z ghost1_yfine + // game_logic::@127 + __b127: + // ghost1_direction!=STOP + // [423] game_logic::$229 = ghost1_direction -- vbuxx=vbuz1 + ldx.z ghost1_direction + // if(ghost1_substep==0 && ghost1_direction!=STOP) + // [424] if(ghost1_substep!=0) goto game_logic::@133 -- vbuz1_neq_0_then_la1 + lda.z ghost1_substep + bne __b133 + // game_logic::@169 + // [425] if(game_logic::$229!=STOP) goto game_logic::@128 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b128 + // game_logic::@133 + __b133: + // ghost1_substep = 0 + // [426] ghost1_substep = 0 -- vbuz1=vbuc1 + // Ghost is on a tile + lda #0 + sta.z ghost1_substep + // if(ghost1_reverse) + // [427] if(0!=ghost1_reverse) goto game_logic::@129 -- 0_neq_vbuz1_then_la1 + lda.z ghost1_reverse + bne __b129 + // game_logic::@134 + // ghost1_xtile = ghost1_xfine/2 + // [428] game_logic::ghost1_xtile#0 = ghost1_xfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost1_xfine + lsr + sta.z ghost1_xtile + // ghost1_ytile = ghost1_yfine/2 + // [429] game_logic::ghost1_ytile#0 = ghost1_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z ghost1_yfine + lsr + sta.z ghost1_ytile + // level_tile_directions(ghost1_xtile, ghost1_ytile) + // [430] level_tile_directions::xtile#3 = game_logic::ghost1_xtile#0 -- vbuxx=vbuz1 + ldx.z ghost1_xtile + // [431] level_tile_directions::ytile#3 = game_logic::ghost1_ytile#0 -- vbuaa=vbuz1 + // [432] call level_tile_directions + // [738] phi from game_logic::@134 to level_tile_directions [phi:game_logic::@134->level_tile_directions] + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#3 [phi:game_logic::@134->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#3 [phi:game_logic::@134->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // level_tile_directions(ghost1_xtile, ghost1_ytile) + // [433] level_tile_directions::return#12 = level_tile_directions::return#2 + // game_logic::@158 + // open_directions = level_tile_directions(ghost1_xtile, ghost1_ytile) + // [434] game_logic::open_directions3#0 = level_tile_directions::return#12 + // open_directions &= DIRECTION_ELIMINATE[ghost1_direction] + // [435] game_logic::open_directions3#1 = game_logic::open_directions3#0 & DIRECTION_ELIMINATE[ghost1_direction] -- vbuyy=vbuaa_band_pbuc1_derefidx_vbuz1 + // Eliminate the direction ghost came from + ldy.z ghost1_direction + and DIRECTION_ELIMINATE,y + tay + // if(ghosts_mode==FRIGHTENED) + // [436] if(ghosts_mode==FRIGHTENED) goto game_logic::@130 -- vbuz1_eq_vbuc1_then_la1 + lda #FRIGHTENED + cmp.z ghosts_mode + beq __b130 + // game_logic::@135 + // if(ghosts_mode==SCATTER) + // [437] if(ghosts_mode==SCATTER) goto game_logic::@131 -- vbuz1_eq_vbuc1_then_la1 + lda #SCATTER + cmp.z ghosts_mode + beq __b13 + // game_logic::@136 + // target_xtile = pacman_xfine/2 + // [438] game_logic::target_xtile3#2 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // target_ytile = pacman_yfine/2 + // [439] game_logic::target_ytile3#2 = pacman_yfine >> 1 -- vbuz1=vbuz2_ror_1 + lda.z pacman_yfine + lsr + sta.z target_ytile3 + // [440] phi from game_logic::@136 to game_logic::@131 [phi:game_logic::@136->game_logic::@131] + // [440] phi game_logic::target_ytile3#3 = game_logic::target_ytile3#2 [phi:game_logic::@136->game_logic::@131#0] -- register_copy + // [440] phi game_logic::target_xtile3#3 = game_logic::target_xtile3#2 [phi:game_logic::@136->game_logic::@131#1] -- register_copy + jmp __b131 + // [440] phi from game_logic::@135 to game_logic::@131 [phi:game_logic::@135->game_logic::@131] + __b13: + // [440] phi game_logic::target_ytile3#3 = 2 [phi:game_logic::@135->game_logic::@131#0] -- vbuz1=vbuc1 + lda #2 + sta.z target_ytile3 + // [440] phi game_logic::target_xtile3#3 = 2 [phi:game_logic::@135->game_logic::@131#1] -- vbuxx=vbuc1 + tax + // game_logic::@131 + __b131: + // choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + // [441] choose_direction::open_directions#3 = game_logic::open_directions3#1 -- vbuz1=vbuyy + sty.z choose_direction.open_directions + // [442] choose_direction::ghost_xtile#3 = game_logic::ghost1_xtile#0 -- vbuyy=vbuz1 + ldy.z ghost1_xtile + // [443] choose_direction::ghost_ytile#3 = game_logic::ghost1_ytile#0 + // [444] choose_direction::target_xtile#3 = game_logic::target_xtile3#3 + // [445] choose_direction::target_ytile#3 = game_logic::target_ytile3#3 + // [446] call choose_direction + // [746] phi from game_logic::@131 to choose_direction [phi:game_logic::@131->choose_direction] + // [746] phi choose_direction::open_directions#10 = choose_direction::open_directions#3 [phi:game_logic::@131->choose_direction#0] -- register_copy + // [746] phi choose_direction::target_ytile#4 = choose_direction::target_ytile#3 [phi:game_logic::@131->choose_direction#1] -- register_copy + // [746] phi choose_direction::ghost_ytile#4 = choose_direction::ghost_ytile#3 [phi:game_logic::@131->choose_direction#2] -- register_copy + // [746] phi choose_direction::target_xtile#4 = choose_direction::target_xtile#3 [phi:game_logic::@131->choose_direction#3] -- register_copy + // [746] phi choose_direction::ghost_xtile#4 = choose_direction::ghost_xtile#3 [phi:game_logic::@131->choose_direction#4] -- register_copy + jsr choose_direction + // choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + // [447] choose_direction::return#3 = choose_direction::return#10 -- vbuaa=vbuz1 + lda.z choose_direction.return + // game_logic::@159 + // [448] game_logic::$182 = choose_direction::return#3 + // ghost1_direction = choose_direction( open_directions, ghost1_xtile, ghost1_ytile, target_xtile, target_ytile ) + // [449] ghost1_direction = game_logic::$182 -- vbuz1=vbuaa + sta.z ghost1_direction + rts + // game_logic::@130 + __b130: + // ghost1_direction = DIRECTION_SINGLE[open_directions] + // [450] ghost1_direction = DIRECTION_SINGLE[game_logic::open_directions3#1] -- vbuz1=pbuc1_derefidx_vbuyy + // Choose a random direction between the open directions + lda DIRECTION_SINGLE,y + sta.z ghost1_direction + rts + // game_logic::@129 + __b129: + // ghost1_direction = DIRECTION_REVERSE[ghost1_direction] + // [451] ghost1_direction = DIRECTION_REVERSE[ghost1_direction] -- vbuz1=pbuc1_derefidx_vbuz1 + // If we are changing between scatter & chase then reverse the direction + ldy.z ghost1_direction + lda DIRECTION_REVERSE,y + sta.z ghost1_direction + // ghost1_reverse = 0 + // [452] ghost1_reverse = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_reverse + rts + // game_logic::@128 + __b128: + // ghost1_substep = 1 + // [453] ghost1_substep = 1 -- vbuz1=vbuc1 + // Ghost was on a tile and is moving, so he is now between tiles + lda #1 + sta.z ghost1_substep + // if(ghost1_xfine==1) + // [454] if(ghost1_xfine==1) goto game_logic::@132 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + cmp.z ghost1_xfine + beq __b132 + // game_logic::@137 + // if(ghost1_xfine==97) + // [455] if(ghost1_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z ghost1_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@138 + // ghost1_xfine = 1 + // [456] ghost1_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z ghost1_xfine + rts + // game_logic::@132 + __b132: + // ghost1_xfine = 97 + // [457] ghost1_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z ghost1_xfine + rts + // game_logic::@126 + __b126: + // --ghost1_xfine; + // [458] ghost1_xfine = -- ghost1_xfine -- vbuz1=_dec_vbuz1 + dec.z ghost1_xfine + jmp __b127 + // game_logic::@125 + __b125: + // ++ghost1_yfine; + // [459] ghost1_yfine = ++ ghost1_yfine -- vbuz1=_inc_vbuz1 + inc.z ghost1_yfine + jmp __b127 + // game_logic::@124 + __b124: + // ++ghost1_xfine; + // [460] ghost1_xfine = ++ ghost1_xfine -- vbuz1=_inc_vbuz1 + inc.z ghost1_xfine + jmp __b127 + // game_logic::@123 + __b123: + // if(--ghost1_respawn==0) + // [461] ghost1_respawn = -- ghost1_respawn -- vbuz1=_dec_vbuz1 + dec.z ghost1_respawn + // [462] if(ghost1_respawn!=0) goto game_logic::@return -- vbuz1_neq_0_then_la1 + lda.z ghost1_respawn + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@139 + // ghost1_direction = DOWN + // [463] ghost1_direction = DOWN -- vbuz1=vbuc1 + // Spawn ghost 1 + lda #DOWN + sta.z ghost1_direction + // ghost1_xfine = 96 + // [464] ghost1_xfine = $60 -- vbuz1=vbuc1 + lda #$60 + sta.z ghost1_xfine + // ghost1_yfine = 2 + // [465] ghost1_yfine = 2 -- vbuz1=vbuc1 + lda #2 + sta.z ghost1_yfine + // ghost1_substep = 0 + // [466] ghost1_substep = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghost1_substep + rts + // game_logic::@2 + __b2: + // if(pacman_direction==RIGHT) + // [467] if(pacman_direction==RIGHT) goto game_logic::@140 -- vbuz1_eq_vbuc1_then_la1 + // Animate pacman + // Move pacman in the current direction (unless he is stopped) + lda #RIGHT + cmp.z pacman_direction + beq __b140 + // game_logic::@40 + // if(pacman_direction==DOWN) + // [468] if(pacman_direction==DOWN) goto game_logic::@141 -- vbuz1_eq_vbuc1_then_la1 + lda #DOWN + cmp.z pacman_direction + beq __b141 + // game_logic::@41 + // if(pacman_direction==LEFT) + // [469] if(pacman_direction==LEFT) goto game_logic::@142 -- vbuz1_eq_vbuc1_then_la1 + lda #LEFT + cmp.z pacman_direction + beq __b142 + // game_logic::@42 + // if(pacman_direction==UP) + // [470] if(pacman_direction!=UP) goto game_logic::@143 -- vbuz1_neq_vbuc1_then_la1 + lda #UP + cmp.z pacman_direction + bne __b143 + // game_logic::@43 + // --pacman_yfine; + // [471] pacman_yfine = -- pacman_yfine -- vbuz1=_dec_vbuz1 + dec.z pacman_yfine + // game_logic::@143 + __b143: + // pacman_direction!=STOP + // [472] game_logic::$232 = pacman_direction -- vbuxx=vbuz1 + ldx.z pacman_direction + // if(pacman_substep==0 && pacman_direction!=STOP) + // [473] if(pacman_substep!=0) goto game_logic::@147 -- vbuz1_neq_0_then_la1 + lda.z pacman_substep + bne __b147 + // game_logic::@170 + // [474] if(game_logic::$232!=STOP) goto game_logic::@144 -- vbuxx_neq_vbuc1_then_la1 + cpx #STOP + bne __b144 + // game_logic::@147 + __b147: + // pacman_substep = 0 + // [475] pacman_substep = 0 -- vbuz1=vbuc1 + // Pacman is on a (new) tile + lda #0 + sta.z pacman_substep + // pacman_xtile = pacman_xfine/2 + // [476] game_logic::pacman_xtile1#0 = pacman_xfine >> 1 -- vbuxx=vbuz1_ror_1 + lda.z pacman_xfine + lsr + tax + // pacman_ytile = pacman_yfine/2 + // [477] game_logic::pacman_ytile1#0 = pacman_yfine >> 1 -- vbuaa=vbuz1_ror_1 + lda.z pacman_yfine + lsr + // level_tile_directions(pacman_xtile, pacman_ytile) + // [478] level_tile_directions::xtile#4 = game_logic::pacman_xtile1#0 + // [479] level_tile_directions::ytile#4 = game_logic::pacman_ytile1#0 + // [480] call level_tile_directions + // [738] phi from game_logic::@147 to level_tile_directions [phi:game_logic::@147->level_tile_directions] + // [738] phi level_tile_directions::ytile#5 = level_tile_directions::ytile#4 [phi:game_logic::@147->level_tile_directions#0] -- register_copy + // [738] phi level_tile_directions::xtile#5 = level_tile_directions::xtile#4 [phi:game_logic::@147->level_tile_directions#1] -- register_copy + jsr level_tile_directions + // level_tile_directions(pacman_xtile, pacman_ytile) + // [481] level_tile_directions::return#13 = level_tile_directions::return#2 + // game_logic::@160 + // open_directions = level_tile_directions(pacman_xtile, pacman_ytile) + // [482] game_logic::open_directions4#0 = level_tile_directions::return#13 -- vbuxx=vbuaa + tax + // CIA1->PORT_A & 0x0f + // [483] game_logic::$199 = *((byte*)CIA1) & $f -- vbuaa=_deref_pbuc1_band_vbuc2 + lda #$f + and CIA1 + // (CIA1->PORT_A & 0x0f)^0x0f + // [484] game_logic::$200 = game_logic::$199 ^ $f -- vbuaa=vbuaa_bxor_vbuc1 + eor #$f + // joy_directions = ((CIA1->PORT_A & 0x0f)^0x0f)*4 + // [485] game_logic::joy_directions#0 = game_logic::$200 << 2 -- vbuaa=vbuaa_rol_2 + asl + asl + // if(joy_directions!=0) + // [486] if(game_logic::joy_directions#0==0) goto game_logic::@145 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b145 + // game_logic::@148 + // joy_directions&open_directions + // [487] game_logic::$204 = game_logic::joy_directions#0 & game_logic::open_directions4#0 -- vbuaa=vbuaa_band_vbuxx + stx.z $ff + and.z $ff + // new_direction = DIRECTION_SINGLE[joy_directions&open_directions] + // [488] game_logic::new_direction#0 = DIRECTION_SINGLE[game_logic::$204] -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda DIRECTION_SINGLE,y + // if(new_direction!=0) + // [489] if(game_logic::new_direction#0==0) goto game_logic::@145 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b145 + // game_logic::@149 + // pacman_direction = new_direction + // [490] pacman_direction = game_logic::new_direction#0 -- vbuz1=vbuaa + sta.z pacman_direction + // game_logic::@145 + __b145: + // pacman_direction &= open_directions + // [491] pacman_direction = pacman_direction & game_logic::open_directions4#0 -- vbuz1=vbuz1_band_vbuxx + // Stop pacman if the current direction is no longer open + lda.z pacman_direction + sax.z pacman_direction + rts + // game_logic::@144 + __b144: + // pacman_substep = 1 + // [492] pacman_substep = 1 -- vbuz1=vbuc1 + // Pacman was on a tile and is moving, so he is now between tiles + lda #1 + sta.z pacman_substep + // pacman_ch1_enabled = 1 + // [493] pacman_ch1_enabled = 1 -- vbuz1=vbuc1 + // Enable the eating sound whenever pacman is moving + sta.z pacman_ch1_enabled + // if(pacman_xfine==1) + // [494] if(pacman_xfine==1) goto game_logic::@146 -- vbuz1_eq_vbuc1_then_la1 + // Teleport if we are in the magic positions + cmp.z pacman_xfine + beq __b146 + // game_logic::@150 + // if(pacman_xfine==97) + // [495] if(pacman_xfine!=$61) goto game_logic::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$61 + cmp.z pacman_xfine + beq !__breturn+ + jmp __breturn + !__breturn: + // game_logic::@151 + // pacman_xfine = 1 + // [496] pacman_xfine = 1 -- vbuz1=vbuc1 + lda #1 + sta.z pacman_xfine + rts + // game_logic::@146 + __b146: + // pacman_xfine = 97 + // [497] pacman_xfine = $61 -- vbuz1=vbuc1 + lda #$61 + sta.z pacman_xfine + rts + // game_logic::@142 + __b142: + // --pacman_xfine; + // [498] pacman_xfine = -- pacman_xfine -- vbuz1=_dec_vbuz1 + dec.z pacman_xfine + jmp __b143 + // game_logic::@141 + __b141: + // ++pacman_yfine; + // [499] pacman_yfine = ++ pacman_yfine -- vbuz1=_inc_vbuz1 + inc.z pacman_yfine + jmp __b143 + // game_logic::@140 + __b140: + // ++pacman_xfine; + // [500] pacman_xfine = ++ pacman_xfine -- vbuz1=_inc_vbuz1 + inc.z pacman_xfine + jmp __b143 +} + // pacman_sound_play +pacman_sound_play: { + // if(pacman_ch1_enabled) + // [501] if(0==pacman_ch1_enabled) goto pacman_sound_play::@return -- 0_eq_vbuz1_then_la1 + lda.z pacman_ch1_enabled + beq __breturn + // pacman_sound_play::@1 + // *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] + // [502] *SID_CH1_FREQ_HI = PACMAN_CH1_FREQ_HI[pacman_ch1_idx] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + // Play the entire sound - and then reset and disable it + ldy.z pacman_ch1_idx + lda PACMAN_CH1_FREQ_HI,y + sta SID_CH1_FREQ_HI + // SID->CH1_CONTROL = PACMAN_CH1_CONTROL[pacman_ch1_idx] + // [503] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = PACMAN_CH1_CONTROL[pacman_ch1_idx] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + lda PACMAN_CH1_CONTROL,y + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // if(++pacman_ch1_idx==sizeof(PACMAN_CH1_FREQ_HI)) + // [504] pacman_ch1_idx = ++ pacman_ch1_idx -- vbuz1=_inc_vbuz1 + inc.z pacman_ch1_idx + // [505] if(pacman_ch1_idx!=$16*SIZEOF_BYTE) goto pacman_sound_play::@return -- vbuz1_neq_vbuc1_then_la1 + lda #$16*SIZEOF_BYTE + cmp.z pacman_ch1_idx + bne __breturn + // pacman_sound_play::@2 + // pacman_ch1_idx = 0 + // [506] pacman_ch1_idx = 0 -- vbuz1=vbuc1 + lda #0 + sta.z pacman_ch1_idx + // pacman_ch1_enabled = 0 + // [507] pacman_ch1_enabled = 0 -- vbuz1=vbuc1 + sta.z pacman_ch1_enabled + // pacman_sound_play::@return + __breturn: + // } + // [508] return + rts +} + // splash_run +// Initializes all data for the splash and shows the splash. +// Returns when the splash is complete and the user clicks the joystidk #2 button +splash_run: { + .const toDd001_return = 3^(>SCREENS_1)/$40 + .const toD0181_return = 0 + .label xpos = $59 + .label i = 5 + // splash_run::SEI1 + // asm + // asm { sei } + sei + // splash_run::@16 + // CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR + // [511] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) = CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT + // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + // [512] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 + // Disable kernal & basic & IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // *PROCPORT = PROCPORT_RAM_ALL + // [513] *PROCPORT = PROCPORT_RAM_ALL -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_ALL + sta PROCPORT + // memset(0x4000, 0, 0xc00) + // [514] call memset + // Reset memory to avoid crashes + // [776] phi from splash_run::@16 to memset [phi:splash_run::@16->memset] + // [776] phi memset::str#6 = (void*) 16384 [phi:splash_run::@16->memset#0] -- pvoz1=pvoc1 + lda #<$4000 + sta.z memset.str + lda #>$4000 + sta.z memset.str+1 + // [776] phi memset::num#5 = $c00 [phi:splash_run::@16->memset#1] -- vwuz1=vwuc1 + lda #<$c00 + sta.z memset.num + lda #>$c00 + sta.z memset.num+1 + jsr memset + // splash_run::@20 + // byteboozer_decrunch(RASTER_CODE_CRUNCHED) + // [515] byteboozer_decrunch::crunched = RASTER_CODE_CRUNCHED -- pbuz1=pbuc1 + lda #RASTER_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [516] call byteboozer_decrunch + // Decrunch raster code + jsr byteboozer_decrunch + // splash_run::@21 + // byteboozer_decrunch(LOGIC_CODE_CRUNCHED) + // [517] byteboozer_decrunch::crunched = LOGIC_CODE_CRUNCHED -- pbuz1=pbuc1 + lda #LOGIC_CODE_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [518] call byteboozer_decrunch + // Decrunch logic code + jsr byteboozer_decrunch + // [519] phi from splash_run::@21 to splash_run::@22 [phi:splash_run::@21->splash_run::@22] + // splash_run::@22 + // merge_code(RASTER_CODE, RASTER_CODE_UNMERGED, LOGIC_CODE_UNMERGED) + // [520] call merge_code + // Merge the raster with the logic-code + // [787] phi from splash_run::@22 to merge_code [phi:splash_run::@22->merge_code] + jsr merge_code + // [521] phi from splash_run::@22 to splash_run::@23 [phi:splash_run::@22->splash_run::@23] + // splash_run::@23 + // memset(BANK_1+0x2000, 0x00, 0x1fff) + // [522] call memset + // Clear the graphics banks + // [776] phi from splash_run::@23 to memset [phi:splash_run::@23->memset] + // [776] phi memset::str#6 = (void*)BANK_1+$2000 [phi:splash_run::@23->memset#0] -- pvoz1=pvoc1 + lda #BANK_1+$2000 + sta.z memset.str+1 + // [776] phi memset::num#5 = $1fff [phi:splash_run::@23->memset#1] -- vwuz1=vwuc1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // [523] phi from splash_run::@23 to splash_run::@24 [phi:splash_run::@23->splash_run::@24] + // splash_run::@24 + // memset(BANK_2, 0x00, 0x3fff) + // [524] call memset + // [776] phi from splash_run::@24 to memset [phi:splash_run::@24->memset] + // [776] phi memset::str#6 = (void*)BANK_2 [phi:splash_run::@24->memset#0] -- pvoz1=pvoc1 + lda #BANK_2 + sta.z memset.str+1 + // [776] phi memset::num#5 = $3fff [phi:splash_run::@24->memset#1] -- vwuz1=vwuc1 + lda #<$3fff + sta.z memset.num + lda #>$3fff + sta.z memset.num+1 + jsr memset + // [525] phi from splash_run::@24 to splash_run::@25 [phi:splash_run::@24->splash_run::@25] + // splash_run::@25 + // init_render_index() + // [526] call init_render_index + // Initialize the renderer tables + // [834] phi from splash_run::@25 to init_render_index [phi:splash_run::@25->init_render_index] + jsr init_render_index + // splash_run::@26 + // byteboozer_decrunch(SPLASH_CRUNCHED) + // [527] byteboozer_decrunch::crunched = SPLASH_CRUNCHED -- pbuz1=pbuc1 + lda #SPLASH_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [528] call byteboozer_decrunch + // decrunch splash screen + jsr byteboozer_decrunch + // [529] phi from splash_run::@26 to splash_run::@27 [phi:splash_run::@26->splash_run::@27] + // splash_run::@27 + // splash_show() + // [530] call splash_show + // Show the splash screen + // [865] phi from splash_run::@27 to splash_show [phi:splash_run::@27->splash_show] + jsr splash_show + // [531] phi from splash_run::@27 to splash_run::@28 [phi:splash_run::@27->splash_run::@28] + // splash_run::@28 + // memset(BANK_1, 0x00, 0x1fff) + // [532] call memset + // Clear the graphics bank + // [776] phi from splash_run::@28 to memset [phi:splash_run::@28->memset] + // [776] phi memset::str#6 = (void*)BANK_1 [phi:splash_run::@28->memset#0] -- pvoz1=pvoc1 + lda #BANK_1 + sta.z memset.str+1 + // [776] phi memset::num#5 = $1fff [phi:splash_run::@28->memset#1] -- vwuz1=vwuc1 + lda #<$1fff + sta.z memset.num + lda #>$1fff + sta.z memset.num+1 + jsr memset + // [533] phi from splash_run::@28 to splash_run::@29 [phi:splash_run::@28->splash_run::@29] + // splash_run::@29 + // init_bobs_restore() + // [534] call init_bobs_restore + // Initialize bobs_restore to "safe" values + // [879] phi from splash_run::@29 to init_bobs_restore [phi:splash_run::@29->init_bobs_restore] + jsr init_bobs_restore + // splash_run::@30 + // byteboozer_decrunch(BOB_GRAPHICS_CRUNCHED) + // [535] byteboozer_decrunch::crunched = BOB_GRAPHICS_CRUNCHED -- pbuz1=pbuc1 + lda #BOB_GRAPHICS_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [536] call byteboozer_decrunch + // decrunch bobs graphics tables + jsr byteboozer_decrunch + // [537] phi from splash_run::@30 to splash_run::@31 [phi:splash_run::@30->splash_run::@31] + // splash_run::@31 + // init_sprite_pointers() + // [538] call init_sprite_pointers + // Set sprite pointers on all screens (in both graphics banks) + // [896] phi from splash_run::@31 to init_sprite_pointers [phi:splash_run::@31->init_sprite_pointers] + jsr init_sprite_pointers + // [539] phi from splash_run::@31 to splash_run::@32 [phi:splash_run::@31->splash_run::@32] + // splash_run::@32 + // memcpy(INTRO_MUSIC_CRUNCHED_UPPER, INTRO_MUSIC_CRUNCHED, INTRO_MUSIC_CRUNCHED_SIZE) + // [540] call memcpy + // Move the crunched music to upper memory before decrunching it + // [910] phi from splash_run::@32 to memcpy [phi:splash_run::@32->memcpy] + jsr memcpy + // splash_run::@33 + // byteboozer_decrunch(INTRO_MUSIC_CRUNCHED_UPPER) + // [541] byteboozer_decrunch::crunched = INTRO_MUSIC_CRUNCHED_UPPER -- pbuz1=pbuc1 + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z byteboozer_decrunch.crunched+1 + // [542] call byteboozer_decrunch + // zero-fill the entire Init segment + //memset(LEVEL_TILES_CRUNCHED, 0, INTRO_MUSIC_CRUNCHED+INTRO_MUSIC_CRUNCHED_SIZE-LEVEL_TILES_CRUNCHED); + // decrunch intro music + jsr byteboozer_decrunch + // [543] phi from splash_run::@33 to splash_run::@34 [phi:splash_run::@33->splash_run::@34] + // splash_run::@34 + // memset(INTRO_MUSIC_CRUNCHED_UPPER, 0, INTRO_MUSIC_CRUNCHED_SIZE) + // [544] call memset + // Zero-fill the upper memory + // [776] phi from splash_run::@34 to memset [phi:splash_run::@34->memset] + // [776] phi memset::str#6 = (void*)INTRO_MUSIC_CRUNCHED_UPPER [phi:splash_run::@34->memset#0] -- pvoz1=pvoc1 + lda #INTRO_MUSIC_CRUNCHED_UPPER + sta.z memset.str+1 + // [776] phi memset::num#5 = INTRO_MUSIC_CRUNCHED_SIZE [phi:splash_run::@34->memset#1] -- vwuz1=vwuc1 + lda #INTRO_MUSIC_CRUNCHED_SIZE + sta.z memset.num+1 + jsr memset + // splash_run::@35 + // *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK + // [545] *PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK -- _deref_pbuc1=vbuc2 + // Disable kernal & basic - enable IO + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + // *PROCPORT = PROCPORT_RAM_IO + // [546] *PROCPORT = PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_IO + sta PROCPORT + // [547] phi from splash_run::@35 to splash_run::@1 [phi:splash_run::@35->splash_run::@1] + // [547] phi splash_run::msb#10 = 0 [phi:splash_run::@35->splash_run::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [547] phi splash_run::i#2 = 0 [phi:splash_run::@35->splash_run::@1#1] -- vbuz1=vbuc1 + txa + sta.z i + // splash_run::@1 + __b1: + // for(char i=0;i<8;i++) + // [548] if(splash_run::i#2<8) goto splash_run::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z i + cmp #8 + bcs !__b2+ + jmp __b2 + !__b2: + // [549] phi from splash_run::@1 to splash_run::toDd001 [phi:splash_run::@1->splash_run::toDd001] + // splash_run::toDd001 + // splash_run::@17 + // CIA2->PORT_A = toDd00(SCREENS_1) + // [550] *((byte*)CIA2) = splash_run::toDd001_return#0 -- _deref_pbuc1=vbuc2 + // Set initial graphics bank + lda #toDd001_return + sta CIA2 + // canvas_base_hi = >SPRITES_2 + // [551] canvas_base_hi = >SPRITES_2 -- vbuz1=vbuc1 + // Set initial render/restore buffer + lda #>SPRITES_2 + sta.z canvas_base_hi + // bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE + // [552] bobs_restore_base = NUM_BOBS*SIZE_BOB_RESTORE -- vbuz1=vbuc1 + lda #NUM_BOBS*SIZE_BOB_RESTORE + sta.z bobs_restore_base + // [553] phi from splash_run::@17 to splash_run::toD0181 [phi:splash_run::@17->splash_run::toD0181] + // splash_run::toD0181 + // splash_run::@18 + // VICII->MEMORY = toD018(SCREENS_1, SCREENS_1) + // [554] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY) = splash_run::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Select first screen + lda #toD0181_return + sta VICII+OFFSET_STRUCT_MOS6569_VICII_MEMORY + // VICII->SPRITES_XMSB = msb + // [555] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) = splash_run::msb#10 -- _deref_pbuc1=vbuxx + stx VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB + // VICII->SPRITES_ENABLE = 0xff + // [556] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff -- _deref_pbuc1=vbuc2 + lda #$ff + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE + // VICII->SPRITES_EXPAND_X = 0xff + // [557] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X) = $ff -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X + // VICII->BORDER_COLOR = BLACK + // [558] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = BLACK -- _deref_pbuc1=vbuc2 + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR + // VICII->BG_COLOR = BLACK + // [559] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) = BLACK -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR + // VICII->SPRITES_MCOLOR1 = BLUE + // [560] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE -- _deref_pbuc1=vbuc2 + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = RED + // [561] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED -- _deref_pbuc1=vbuc2 + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // top_sprites_mc = 0x03 + // [562] top_sprites_mc = 3 -- vbuz1=vbuc1 + // On the splash screen sprites all sprites are SC - except sprite #0,1 on the top/bottom of the screen + lda #3 + sta.z top_sprites_mc + // side_sprites_mc = 0x00 + // [563] side_sprites_mc = 0 -- vbuz1=vbuc1 + lda #0 + sta.z side_sprites_mc + // bottom_sprites_mc = 0x03 + // [564] bottom_sprites_mc = 3 -- vbuz1=vbuc1 + lda #3 + sta.z bottom_sprites_mc + // top_sprites_color = YELLOW + // [565] top_sprites_color = YELLOW -- vbuz1=vbuc1 + // On the splash top/bottom sc-sprites are yellow and side-sprites are blue + lda #YELLOW + sta.z top_sprites_color + // side_sprites_color = BLUE + // [566] side_sprites_color = BLUE -- vbuz1=vbuc1 + lda #BLUE + sta.z side_sprites_color + // bottom_sprites_color = YELLOW + // [567] bottom_sprites_color = YELLOW -- vbuz1=vbuc1 + lda #YELLOW + sta.z bottom_sprites_color + // VICII->SPRITES_MC = top_sprites_mc + // [568] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // [569] phi from splash_run::@18 to splash_run::@5 [phi:splash_run::@18->splash_run::@5] + // [569] phi splash_run::i1#2 = 0 [phi:splash_run::@18->splash_run::@5#0] -- vbuxx=vbuc1 + ldx #0 + // Set initial Sprite Color + // splash_run::@5 + __b5: + // for(char i=0;i<8;i++) + // [570] if(splash_run::i1#2<8) goto splash_run::@6 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcc __b6 + // splash_run::@7 + // VICII->CONTROL2 = 0x08 + // [571] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = 8 -- _deref_pbuc1=vbuc2 + // Set VICII CONTROL2 ($d016) to 8 to allow ASL, LSR to be used for opening the border + lda #8 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2 + // [572] phi from splash_run::@7 to splash_run::@8 [phi:splash_run::@7->splash_run::@8] + // [572] phi splash_run::i2#2 = 0 [phi:splash_run::@7->splash_run::@8#0] -- vbuxx=vbuc1 + ldx #0 + // Move the bobs to the center to avoid interference while rendering the level + // splash_run::@8 + __b8: + // for(char i=0;i<4;i++) + // [573] if(splash_run::i2#2<4) goto splash_run::@9 -- vbuxx_lt_vbuc1_then_la1 + cpx #4 + bcc __b9 + // splash_run::@10 + // asm + // asm { lda#1 staINTRO_MUSIC+$69 } + // Disable SID CH#3 + lda #1 + sta INTRO_MUSIC+$69 + // asm { lda#0 } + // Init music + lda #0 + // (*musicInit)() + // [576] call *musicInit + jsr musicInit + // phase = 0 + // [577] phase = 0 -- vbuz1=vbuc1 + // Set phase to intro + lda #0 + sta.z phase + // VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + // [578] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM -- _deref_pbuc1=vbuc2 + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + // Set an illegal mode to prevent any character graphics + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // Wait for line 0xfa (lower border) + // splash_run::@11 + __b11: + // while(VICII->RASTER!=0xfa) + // [579] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto splash_run::@11 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + // splash_run::@12 + // VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) + // [580] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + // [581] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + // [582] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // VICII->IRQ_ENABLE = IRQ_RASTER + // [583] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm + // asm { ldaCIA1_INTERRUPT } + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // *IRQ_STATUS = 0x0f + // [585] *IRQ_STATUS = $f -- _deref_pbuc1=vbuc2 + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + // splash_run::CLI1 + // asm + // asm { cli } + cli + // [587] phi from splash_run::CLI1 to splash_run::@19 [phi:splash_run::CLI1->splash_run::@19] + // splash_run::@19 + // joyinit() + // [588] call joyinit + // Prepare for joystick control + jsr joyinit + // splash_run::@36 + // music_play_next = 0 + // [589] music_play_next = 0 -- vbuz1=vbuc1 + // Wait for fire + lda #0 + sta.z music_play_next + // [590] phi from splash_run::@14 splash_run::@15 splash_run::@36 to splash_run::@13 [phi:splash_run::@14/splash_run::@15/splash_run::@36->splash_run::@13] + // splash_run::@13 + __b13: + // joyfire() + // [591] call joyfire + jsr joyfire + // [592] joyfire::return#1 = joyfire::return#4 + // splash_run::@37 + // [593] splash_run::$30 = joyfire::return#1 + // while(!joyfire()) + // [594] if(0==splash_run::$30) goto splash_run::@14 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b14 + // splash_run::@return + // } + // [595] return + rts + // splash_run::@14 + __b14: + // if(music_play_next) + // [596] if(0==music_play_next) goto splash_run::@13 -- 0_eq_vbuz1_then_la1 + lda.z music_play_next + beq __b13 + // splash_run::@15 + // (*musicPlay)() + // [597] call *musicPlay + //VICII->BG_COLOR=1; + jsr musicPlay + // music_play_next = 0 + // [598] music_play_next = 0 -- vbuz1=vbuc1 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13 + // splash_run::@9 + __b9: + // bobs_xcol[i] = 10 + // [599] bobs_xcol[splash_run::i2#2] = $a -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$a + sta bobs_xcol,x + // bobs_yfine[i] = 45 + // [600] bobs_yfine[splash_run::i2#2] = $2d -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$2d + sta bobs_yfine,x + // bobs_bob_id[i] = 0 + // [601] bobs_bob_id[splash_run::i2#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta bobs_bob_id,x + // for(char i=0;i<4;i++) + // [602] splash_run::i2#1 = ++ splash_run::i2#2 -- vbuxx=_inc_vbuxx + inx + // [572] phi from splash_run::@9 to splash_run::@8 [phi:splash_run::@9->splash_run::@8] + // [572] phi splash_run::i2#2 = splash_run::i2#1 [phi:splash_run::@9->splash_run::@8#0] -- register_copy + jmp __b8 + // splash_run::@6 + __b6: + // SPRITES_COLOR[i] = top_sprites_color + // [603] SPRITES_COLOR[splash_run::i1#2] = top_sprites_color -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z top_sprites_color + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + // [604] splash_run::i1#1 = ++ splash_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [569] phi from splash_run::@6 to splash_run::@5 [phi:splash_run::@6->splash_run::@5] + // [569] phi splash_run::i1#2 = splash_run::i1#1 [phi:splash_run::@6->splash_run::@5#0] -- register_copy + jmp __b5 + // splash_run::@2 + __b2: + // i*2 + // [605] splash_run::$34 = splash_run::i#2 << 1 -- vbuyy=vbuz1_rol_1 + lda.z i + asl + tay + // SPRITES_YPOS[i*2] = 7 + // [606] SPRITES_YPOS[splash_run::$34] = 7 -- pbuc1_derefidx_vbuyy=vbuc2 + lda #7 + sta SPRITES_YPOS,y + // xpos = sprites_xpos[i] + // [607] splash_run::xpos#0 = splash_run::sprites_xpos[splash_run::$34] -- vwuz1=pwuc1_derefidx_vbuyy + lda sprites_xpos,y + sta.z xpos + lda sprites_xpos+1,y + sta.z xpos+1 + // SPRITES_XPOS[i*2] = (char)xpos + // [608] SPRITES_XPOS[splash_run::$34] = (byte)splash_run::xpos#0 -- pbuc1_derefidx_vbuyy=_byte_vwuz1 + lda.z xpos + sta SPRITES_XPOS,y + // msb /= 2 + // [609] splash_run::msb#1 = splash_run::msb#10 >> 1 -- vbuxx=vbuxx_ror_1 + txa + lsr + tax + // >xpos + // [610] splash_run::$25 = > splash_run::xpos#0 -- vbuaa=_hi_vwuz1 + lda.z xpos+1 + // if((>xpos)) + // [611] if(0==splash_run::$25) goto splash_run::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b3 + // splash_run::@4 + // msb |=0x80 + // [612] splash_run::msb#2 = splash_run::msb#1 | $80 -- vbuxx=vbuxx_bor_vbuc1 + txa + ora #$80 + tax + // [613] phi from splash_run::@2 splash_run::@4 to splash_run::@3 [phi:splash_run::@2/splash_run::@4->splash_run::@3] + // [613] phi splash_run::msb#8 = splash_run::msb#1 [phi:splash_run::@2/splash_run::@4->splash_run::@3#0] -- register_copy + // splash_run::@3 + __b3: + // for(char i=0;i<8;i++) + // [614] splash_run::i#1 = ++ splash_run::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [547] phi from splash_run::@3 to splash_run::@1 [phi:splash_run::@3->splash_run::@1] + // [547] phi splash_run::msb#10 = splash_run::msb#8 [phi:splash_run::@3->splash_run::@1#0] -- register_copy + // [547] phi splash_run::i#2 = splash_run::i#1 [phi:splash_run::@3->splash_run::@1#1] -- register_copy + jmp __b1 + .segment Data + // Sprite positions + sprites_xpos: .word $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f +} +.segment Code + // gameplay_run +// Initialize all data for gameplay and runs the game. +// Exits when the user has won or lost +gameplay_run: { + .label __4 = $b + // gameplay_run::SEI1 + // asm + // asm { sei } + sei + // [617] phi from gameplay_run::SEI1 to gameplay_run::@1 [phi:gameplay_run::SEI1->gameplay_run::@1] + // [617] phi gameplay_run::i#2 = 0 [phi:gameplay_run::SEI1->gameplay_run::@1#0] -- vbuxx=vbuc1 + ldx #0 + // Stop any sound + // gameplay_run::@1 + __b1: + // for(char i=0;i<0x2f;i++) + // [618] if(gameplay_run::i#2<$2f) goto gameplay_run::@2 -- vbuxx_lt_vbuc1_then_la1 + cpx #$2f + bcs !__b2+ + jmp __b2 + !__b2: + // gameplay_run::@3 + // pacman_wins = 0 + // [619] pacman_wins = 0 -- vbuz1=vbuc1 + // Pacman has not won yet + lda #0 + sta.z pacman_wins + // pacman_lives = 3 + // [620] pacman_lives = 3 -- vbuz1=vbuc1 + // Pacman has 3 lives + lda #3 + sta.z pacman_lives + // VICII->SPRITES_MCOLOR1 = BLACK + // [621] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLACK -- _deref_pbuc1=vbuc2 + // During transition all sprites are black + lda #BLACK + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = BLACK + // [622] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = BLACK -- _deref_pbuc1=vbuc2 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // [623] phi from gameplay_run::@3 to gameplay_run::@4 [phi:gameplay_run::@3->gameplay_run::@4] + // [623] phi gameplay_run::i1#2 = 0 [phi:gameplay_run::@3->gameplay_run::@4#0] -- vbuxx=vbuc1 + ldx #0 + // gameplay_run::@4 + __b4: + // for(char i=0;i<8;i++) + // [624] if(gameplay_run::i1#2<8) goto gameplay_run::@5 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcs !__b5+ + jmp __b5 + !__b5: + // gameplay_run::@6 + // byteboozer_decrunch(LEVEL_TILES_CRUNCHED) + // [625] byteboozer_decrunch::crunched = LEVEL_TILES_CRUNCHED -- pbuz1=pbuc1 + lda #LEVEL_TILES_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [626] call byteboozer_decrunch + // decrunch level tiles + jsr byteboozer_decrunch + // [627] phi from gameplay_run::@6 to gameplay_run::@14 [phi:gameplay_run::@6->gameplay_run::@14] + // gameplay_run::@14 + // init_level_tile_directions() + // [628] call init_level_tile_directions + // Initialize tile directions + // [924] phi from gameplay_run::@14 to init_level_tile_directions [phi:gameplay_run::@14->init_level_tile_directions] + jsr init_level_tile_directions + // [629] phi from gameplay_run::@14 to gameplay_run::@15 [phi:gameplay_run::@14->gameplay_run::@15] + // gameplay_run::@15 + // init_sprite_pointers() + // [630] call init_sprite_pointers + // Set sprite pointers on all screens (in both graphics banks) + // [896] phi from gameplay_run::@15 to init_sprite_pointers [phi:gameplay_run::@15->init_sprite_pointers] + jsr init_sprite_pointers + // [631] phi from gameplay_run::@15 to gameplay_run::@16 [phi:gameplay_run::@15->gameplay_run::@16] + // gameplay_run::@16 + // level_show() + // [632] call level_show + // [966] phi from gameplay_run::@16 to level_show [phi:gameplay_run::@16->level_show] + jsr level_show + // level_show() + // [633] level_show::return#0 = level_show::count#12 + // gameplay_run::@17 + // [634] gameplay_run::$4 = level_show::return#0 + // pill_count = level_show() + // [635] pill_count = gameplay_run::$4 -- vwuz1=vwuz2 + // Show the level + lda.z __4 + sta.z pill_count + lda.z __4+1 + sta.z pill_count+1 + // top_sprites_mc = 0xff + // [636] top_sprites_mc = $ff -- vbuz1=vbuc1 + // During gameplay all sprites are MC. + lda #$ff + sta.z top_sprites_mc + // side_sprites_mc = 0xff + // [637] side_sprites_mc = $ff -- vbuz1=vbuc1 + sta.z side_sprites_mc + // bottom_sprites_mc = 0xff + // [638] bottom_sprites_mc = $ff -- vbuz1=vbuc1 + sta.z bottom_sprites_mc + // top_sprites_color = YELLOW + // [639] top_sprites_color = YELLOW -- vbuz1=vbuc1 + // During gameplay all sprites are yellow + lda #YELLOW + sta.z top_sprites_color + // side_sprites_color = YELLOW + // [640] side_sprites_color = YELLOW -- vbuz1=vbuc1 + sta.z side_sprites_color + // bottom_sprites_color = YELLOW + // [641] bottom_sprites_color = YELLOW -- vbuz1=vbuc1 + sta.z bottom_sprites_color + // VICII->SPRITES_MC = top_sprites_mc + // [642] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC) = top_sprites_mc -- _deref_pbuc1=vbuz1 + // Set the initial top colors/MC + lda.z top_sprites_mc + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC + // [643] phi from gameplay_run::@17 to gameplay_run::@7 [phi:gameplay_run::@17->gameplay_run::@7] + // [643] phi gameplay_run::i2#2 = 0 [phi:gameplay_run::@17->gameplay_run::@7#0] -- vbuxx=vbuc1 + ldx #0 + // Set initial Sprite Color + // gameplay_run::@7 + __b7: + // for(char i=0;i<8;i++) + // [644] if(gameplay_run::i2#2<8) goto gameplay_run::@8 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 + bcc __b8 + // gameplay_run::@9 + // VICII->SPRITES_MCOLOR1 = BLUE + // [645] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1) = BLUE -- _deref_pbuc1=vbuc2 + // Set sprite MC-colors for the game + lda #BLUE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 + // VICII->SPRITES_MCOLOR2 = RED + // [646] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2) = RED -- _deref_pbuc1=vbuc2 + lda #RED + sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 + // phase = 1 + // [647] phase = 1 -- vbuz1=vbuc1 + // Set phase to game + lda #1 + sta.z phase + // spawn_all() + // [648] call spawn_all + // Spawn pacman and all ghosts + jsr spawn_all + // [649] phi from gameplay_run::@9 to gameplay_run::@18 [phi:gameplay_run::@9->gameplay_run::@18] + // gameplay_run::@18 + // pacman_sound_init() + // [650] call pacman_sound_init + // Initialize the game sound + jsr pacman_sound_init + // gameplay_run::@19 + // game_playable = 1 + // [651] game_playable = 1 -- vbuz1=vbuc1 + // Start the game play + lda #1 + sta.z game_playable + // VICII->CONTROL1 = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + // [652] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM -- _deref_pbuc1=vbuc2 + // Turn on raster after transition + // Start a hyperscreen with no badlines and open borders + // Set screen height to 25 lines (preparing for the hyperscreen), enable display + lda #VICII_RSEL|VICII_DEN|VICII_ECM|VICII_BMM + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // Wait at least one frames for DEN to take effect + // gameplay_run::@10 + __b10: + // while(VICII->RASTER!=0xfb) + // [653] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fb) goto gameplay_run::@10 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fb + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b10 + // gameplay_run::@11 + __b11: + // while(VICII->RASTER!=0xfa) + // [654] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fa) goto gameplay_run::@11 -- _deref_pbuc1_neq_vbuc2_then_la1 + lda #$fa + cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + bne __b11 + // gameplay_run::@12 + // VICII->CONTROL1 &= ~(VICII_RST8|VICII_RSEL|VICII_DEN) + // [655] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & ~VICII_RST8|VICII_RSEL|VICII_DEN -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Open lower/upper border using RSEL - and disable all graphics (except sprites) + // Set up RASTER IRQ to start at irq_screen_top() (RST8=0) + lda #(VICII_RST8|VICII_RSEL|VICII_DEN)^$ff + and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1 + // VICII->RASTER = IRQ_SCREEN_TOP_LINE + // [656] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER) = IRQ_SCREEN_TOP_LINE -- _deref_pbuc1=vbuc2 + lda #IRQ_SCREEN_TOP_LINE + sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER + // *HARDWARE_IRQ = &irq_screen_top + // [657] *HARDWARE_IRQ = &irq_screen_top -- _deref_qprc1=pprc2 + lda #irq_screen_top + sta HARDWARE_IRQ+1 + // VICII->IRQ_ENABLE = IRQ_RASTER + // [658] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE + // asm + // asm { ldaCIA1_INTERRUPT } + // Acknowledge any timer IRQ + lda CIA1_INTERRUPT + // *IRQ_STATUS = 0x0f + // [660] *IRQ_STATUS = $f -- _deref_pbuc1=vbuc2 + // Acknowledge any VIC IRQ + lda #$f + sta IRQ_STATUS + // gameplay_run::CLI1 + // asm + // asm { cli } + cli + // gameplay_run::@13 + __b13: + // if(pacman_wins || pacman_lives==0) + // [662] if(0!=pacman_wins) goto gameplay_run::@return -- 0_neq_vbuz1_then_la1 + lda.z pacman_wins + bne __breturn + // gameplay_run::@20 + // [663] if(pacman_lives==0) goto gameplay_run::@return -- vbuz1_eq_0_then_la1 + lda.z pacman_lives + beq __breturn + jmp __b13 + // gameplay_run::@return + __breturn: + // } + // [664] return + rts + // gameplay_run::@8 + __b8: + // SPRITES_COLOR[i] = top_sprites_color + // [665] SPRITES_COLOR[gameplay_run::i2#2] = top_sprites_color -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z top_sprites_color + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + // [666] gameplay_run::i2#1 = ++ gameplay_run::i2#2 -- vbuxx=_inc_vbuxx + inx + // [643] phi from gameplay_run::@8 to gameplay_run::@7 [phi:gameplay_run::@8->gameplay_run::@7] + // [643] phi gameplay_run::i2#2 = gameplay_run::i2#1 [phi:gameplay_run::@8->gameplay_run::@7#0] -- register_copy + jmp __b7 + // gameplay_run::@5 + __b5: + // SPRITES_COLOR[i] = BLACK + // [667] SPRITES_COLOR[gameplay_run::i1#2] = BLACK -- pbuc1_derefidx_vbuxx=vbuc2 + lda #BLACK + sta SPRITES_COLOR,x + // for(char i=0;i<8;i++) + // [668] gameplay_run::i1#1 = ++ gameplay_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [623] phi from gameplay_run::@5 to gameplay_run::@4 [phi:gameplay_run::@5->gameplay_run::@4] + // [623] phi gameplay_run::i1#2 = gameplay_run::i1#1 [phi:gameplay_run::@5->gameplay_run::@4#0] -- register_copy + jmp __b4 + // gameplay_run::@2 + __b2: + // ((char*)SID)[i] = 0 + // [669] ((byte*)SID)[gameplay_run::i#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta SID,x + // for(char i=0;i<0x2f;i++) + // [670] gameplay_run::i#1 = ++ gameplay_run::i#2 -- vbuxx=_inc_vbuxx + inx + // [617] phi from gameplay_run::@2 to gameplay_run::@1 [phi:gameplay_run::@2->gameplay_run::@1] + // [617] phi gameplay_run::i#2 = gameplay_run::i#1 [phi:gameplay_run::@2->gameplay_run::@1#0] -- register_copy + jmp __b1 +} + // done_run +// Show Victory or Game Over Image +// Returns when the user clicks the joystick button +done_run: { + // Show the win graphics + .label gfx = $59 + .label ypos = 6 + .label xcol = 5 + // game_playable = 0 + // [671] game_playable = 0 -- vbuz1=vbuc1 + // Stop the game play + lda #0 + sta.z game_playable + // phase = 0 + // [672] phase = 0 -- vbuz1=vbuc1 + // Set phase to intro + sta.z phase + // [673] phi from done_run to done_run::@2 [phi:done_run->done_run::@2] + // [673] phi done_run::i#2 = 0 [phi:done_run->done_run::@2#0] -- vbuxx=vbuc1 + tax + // Stop any sound + // done_run::@2 + __b2: + // for(char i=0;i<0x2f;i++) + // [674] if(done_run::i#2<$2f) goto done_run::@3 -- vbuxx_lt_vbuc1_then_la1 + cpx #$2f + bcs !__b3+ + jmp __b3 + !__b3: + // [675] phi from done_run::@2 to done_run::@4 [phi:done_run::@2->done_run::@4] + // [675] phi done_run::i1#2 = 0 [phi:done_run::@2->done_run::@4#0] -- vbuxx=vbuc1 + ldx #0 + // Move the bobs to the center to avoid interference while rendering the level + // done_run::@4 + __b4: + // for(char i=0;i<4;i++) + // [676] if(done_run::i1#2<4) goto done_run::@5 -- vbuxx_lt_vbuc1_then_la1 + cpx #4 + bcc __b5 + // done_run::@6 + // asm + // asm { lda#0 } + // Init music + lda #0 + // (*musicInit)() + // [678] call *musicInit + jsr musicInit + // if(pacman_wins) + // [679] if(0!=pacman_wins) goto done_run::@1 -- 0_neq_vbuz1_then_la1 + lda.z pacman_wins + bne __b1 + // done_run::@7 + // byteboozer_decrunch(GAMEOVER_GFX_CRUNCHED) + // [680] byteboozer_decrunch::crunched = GAMEOVER_GFX_CRUNCHED -- pbuz1=pbuc1 + lda #GAMEOVER_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [681] call byteboozer_decrunch + // decrunch game over graphics + jsr byteboozer_decrunch + // [682] phi from done_run::@1 done_run::@7 to done_run::@8 [phi:done_run::@1/done_run::@7->done_run::@8] + __b6: + // [682] phi done_run::gfx#4 = WIN_GFX [phi:done_run::@1/done_run::@7->done_run::@8#0] -- pbuz1=pbuc1 + lda #WIN_GFX + sta.z gfx+1 + // [682] phi done_run::xcol#2 = 0 [phi:done_run::@1/done_run::@7->done_run::@8#1] -- vbuz1=vbuc1 + lda #0 + sta.z xcol + // done_run::@8 + __b8: + // for(char xcol=0;xcol<25;xcol++) + // [683] if(done_run::xcol#2<$19) goto done_run::@10 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b7 + // done_run::@9 + // music_play_next = 0 + // [684] music_play_next = 0 -- vbuz1=vbuc1 + // Wait for fire + lda #0 + sta.z music_play_next + // [685] phi from done_run::@14 done_run::@15 done_run::@9 to done_run::@13 [phi:done_run::@14/done_run::@15/done_run::@9->done_run::@13] + // done_run::@13 + __b13: + // joyfire() + // [686] call joyfire + jsr joyfire + // [687] joyfire::return#0 = joyfire::return#4 + // done_run::@17 + // [688] done_run::$8 = joyfire::return#0 + // while(!joyfire()) + // [689] if(0==done_run::$8) goto done_run::@14 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b14 + // done_run::@return + // } + // [690] return + rts + // done_run::@14 + __b14: + // if(music_play_next) + // [691] if(0==music_play_next) goto done_run::@13 -- 0_eq_vbuz1_then_la1 + lda.z music_play_next + beq __b13 + // done_run::@15 + // (*musicPlay)() + // [692] call *musicPlay + //VICII->BG_COLOR=1; + jsr musicPlay + // music_play_next = 0 + // [693] music_play_next = 0 -- vbuz1=vbuc1 + //VICII->BG_COLOR=0; + lda #0 + sta.z music_play_next + jmp __b13 + // [694] phi from done_run::@8 to done_run::@10 [phi:done_run::@8->done_run::@10] + __b7: + // [694] phi done_run::gfx#2 = done_run::gfx#4 [phi:done_run::@8->done_run::@10#0] -- register_copy + // [694] phi done_run::ypos#2 = 0 [phi:done_run::@8->done_run::@10#1] -- vbuz1=vbuc1 + lda #0 + sta.z ypos + // done_run::@10 + __b10: + // for(char ypos=0;ypos<25;ypos++) + // [695] if(done_run::ypos#2<$19) goto done_run::@11 -- vbuz1_lt_vbuc1_then_la1 + lda.z ypos + cmp #$19 + bcc __b11 + // done_run::@12 + // for(char xcol=0;xcol<25;xcol++) + // [696] done_run::xcol#1 = ++ done_run::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [682] phi from done_run::@12 to done_run::@8 [phi:done_run::@12->done_run::@8] + // [682] phi done_run::gfx#4 = done_run::gfx#2 [phi:done_run::@12->done_run::@8#0] -- register_copy + // [682] phi done_run::xcol#2 = done_run::xcol#1 [phi:done_run::@12->done_run::@8#1] -- register_copy + jmp __b8 + // done_run::@11 + __b11: + // pixels = *gfx++ + // [697] done_run::pixels#0 = *done_run::gfx#2 -- vbuxx=_deref_pbuz1 + // Render 8px x 1px + ldy #0 + lda (gfx),y + tax + // [698] done_run::gfx#1 = ++ done_run::gfx#2 -- pbuz1=_inc_pbuz1 + inc.z gfx + bne !+ + inc.z gfx+1 + !: + // render(xcol, ypos, pixels) + // [699] render::xcol#0 = done_run::xcol#2 + // [700] render::ypos#0 = done_run::ypos#2 + // [701] render::pixels#0 = done_run::pixels#0 -- vbuz1=vbuxx + stx.z render.pixels + // [702] call render + // [997] phi from done_run::@11 to render [phi:done_run::@11->render] + // [997] phi render::pixels#4 = render::pixels#0 [phi:done_run::@11->render#0] -- register_copy + // [997] phi render::xcol#2 = render::xcol#0 [phi:done_run::@11->render#1] -- register_copy + // [997] phi render::ypos#2 = render::ypos#0 [phi:done_run::@11->render#2] -- register_copy + jsr render + // done_run::@16 + // for(char ypos=0;ypos<25;ypos++) + // [703] done_run::ypos#1 = ++ done_run::ypos#2 -- vbuz1=_inc_vbuz1 + inc.z ypos + // [694] phi from done_run::@16 to done_run::@10 [phi:done_run::@16->done_run::@10] + // [694] phi done_run::gfx#2 = done_run::gfx#1 [phi:done_run::@16->done_run::@10#0] -- register_copy + // [694] phi done_run::ypos#2 = done_run::ypos#1 [phi:done_run::@16->done_run::@10#1] -- register_copy + jmp __b10 + // done_run::@1 + __b1: + // byteboozer_decrunch(WIN_GFX_CRUNCHED) + // [704] byteboozer_decrunch::crunched = WIN_GFX_CRUNCHED -- pbuz1=pbuc1 + lda #WIN_GFX_CRUNCHED + sta.z byteboozer_decrunch.crunched+1 + // [705] call byteboozer_decrunch + // decrunch win graphics + jsr byteboozer_decrunch + jmp __b6 + // done_run::@5 + __b5: + // bobs_xcol[i] = 10 + // [706] bobs_xcol[done_run::i1#2] = $a -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$a + sta bobs_xcol,x + // bobs_yfine[i] = 45 + // [707] bobs_yfine[done_run::i1#2] = $2d -- pbuc1_derefidx_vbuxx=vbuc2 + lda #$2d + sta bobs_yfine,x + // bobs_bob_id[i] = 0 + // [708] bobs_bob_id[done_run::i1#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta bobs_bob_id,x + // for(char i=0;i<4;i++) + // [709] done_run::i1#1 = ++ done_run::i1#2 -- vbuxx=_inc_vbuxx + inx + // [675] phi from done_run::@5 to done_run::@4 [phi:done_run::@5->done_run::@4] + // [675] phi done_run::i1#2 = done_run::i1#1 [phi:done_run::@5->done_run::@4#0] -- register_copy + jmp __b4 + // done_run::@3 + __b3: + // ((char*)SID)[i] = 0 + // [710] ((byte*)SID)[done_run::i#2] = 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta SID,x + // for(char i=0;i<0x2f;i++) + // [711] done_run::i#1 = ++ done_run::i#2 -- vbuxx=_inc_vbuxx + inx + // [673] phi from done_run::@3 to done_run::@2 [phi:done_run::@3->done_run::@2] + // [673] phi done_run::i#2 = done_run::i#1 [phi:done_run::@3->done_run::@2#0] -- register_copy + jmp __b2 +} + // spawn_all +// Spawn pacman and all ghosts +spawn_all: { + // ghosts_mode_count = 0 + // [712] ghosts_mode_count = 0 -- vbuz1=vbuc1 + lda #0 + sta.z ghosts_mode_count + // pacman_substep = 0 + // [713] pacman_substep = 0 -- vbuz1=vbuc1 + sta.z pacman_substep + // ghost1_substep = 0 + // [714] ghost1_substep = 0 -- vbuz1=vbuc1 + sta.z ghost1_substep + // ghost2_substep = 0 + // [715] ghost2_substep = 0 -- vbuz1=vbuc1 + sta.z ghost2_substep + // ghost3_substep = 0 + // [716] ghost3_substep = 0 -- vbuz1=vbuc1 + sta.z ghost3_substep + // ghost4_substep = 0 + // [717] ghost4_substep = 0 -- vbuz1=vbuc1 + sta.z ghost4_substep + // pacman_direction = STOP + // [718] pacman_direction = STOP -- vbuz1=vbuc1 + lda #STOP + sta.z pacman_direction + // ghost1_direction = STOP + // [719] ghost1_direction = STOP -- vbuz1=vbuc1 + sta.z ghost1_direction + // ghost2_direction = STOP + // [720] ghost2_direction = STOP -- vbuz1=vbuc1 + sta.z ghost2_direction + // ghost3_direction = STOP + // [721] ghost3_direction = STOP -- vbuz1=vbuc1 + sta.z ghost3_direction + // ghost4_direction = STOP + // [722] ghost4_direction = STOP -- vbuz1=vbuc1 + sta.z ghost4_direction + // pacman_xfine = 50 + // [723] pacman_xfine = $32 -- vbuz1=vbuc1 + lda #$32 + sta.z pacman_xfine + // ghost1_xfine = 50 + // [724] ghost1_xfine = $32 -- vbuz1=vbuc1 + sta.z ghost1_xfine + // ghost2_xfine = 50 + // [725] ghost2_xfine = $32 -- vbuz1=vbuc1 + sta.z ghost2_xfine + // ghost3_xfine = 50 + // [726] ghost3_xfine = $32 -- vbuz1=vbuc1 + sta.z ghost3_xfine + // ghost4_xfine = 50 + // [727] ghost4_xfine = $32 -- vbuz1=vbuc1 + sta.z ghost4_xfine + // ghost1_yfine = 35 + // [728] ghost1_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z ghost1_yfine + // ghost2_yfine = 35 + // [729] ghost2_yfine = $23 -- vbuz1=vbuc1 + sta.z ghost2_yfine + // ghost3_yfine = 35 + // [730] ghost3_yfine = $23 -- vbuz1=vbuc1 + sta.z ghost3_yfine + // ghost4_yfine = 35 + // [731] ghost4_yfine = $23 -- vbuz1=vbuc1 + sta.z ghost4_yfine + // pacman_yfine = 62 + // [732] pacman_yfine = $3e -- vbuz1=vbuc1 + lda #$3e + sta.z pacman_yfine + // ghost1_respawn = 10 + // [733] ghost1_respawn = $a -- vbuz1=vbuc1 + lda #$a + sta.z ghost1_respawn + // ghost2_respawn = 20 + // [734] ghost2_respawn = $14 -- vbuz1=vbuc1 + lda #$14 + sta.z ghost2_respawn + // ghost3_respawn = 30 + // [735] ghost3_respawn = $1e -- vbuz1=vbuc1 + lda #$1e + sta.z ghost3_respawn + // ghost4_respawn = 40 + // [736] ghost4_respawn = $28 -- vbuz1=vbuc1 + lda #$28 + sta.z ghost4_respawn + // spawn_all::@return + // } + // [737] return + rts +} + // level_tile_directions +// Get the open directions at a given (xtile, ytile) position +// Returns the open DIRECTIONs as bits +// If xtile of ytile is outside the legal range the empty tile (0) is returned +// level_tile_directions(byte register(X) xtile, byte register(A) ytile) +level_tile_directions: { + .label ytiles = $5b + // if(xtile>49 || ytile>36) + // [739] if(level_tile_directions::xtile#5>=$31+1) goto level_tile_directions::@return -- vbuxx_ge_vbuc1_then_la1 + cpx #$31+1 + bcs __b1 + // level_tile_directions::@2 + // [740] if(level_tile_directions::ytile#5>=$24+1) goto level_tile_directions::@return -- vbuaa_ge_vbuc1_then_la1 + cmp #$24+1 + bcs __b1 + // level_tile_directions::@1 + // LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile] + // [741] level_tile_directions::$5 = level_tile_directions::ytile#5 << 1 -- vbuaa=vbuaa_rol_1 + asl + // ytiles = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[ytile] + // [742] level_tile_directions::ytiles#0 = LEVEL_TILES_DIRECTIONS + LEVEL_YTILE_OFFSET[level_tile_directions::$5] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuaa + tay + clc + lda #LEVEL_TILES_DIRECTIONS + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // return ytiles[xtile]; + // [743] level_tile_directions::return#0 = level_tile_directions::ytiles#0[level_tile_directions::xtile#5] -- vbuaa=pbuz1_derefidx_vbuxx + txa + tay + lda (ytiles),y + // [744] phi from level_tile_directions::@1 to level_tile_directions::@return [phi:level_tile_directions::@1->level_tile_directions::@return] + // [744] phi level_tile_directions::return#2 = level_tile_directions::return#0 [phi:level_tile_directions::@1->level_tile_directions::@return#0] -- register_copy + rts + // [744] phi from level_tile_directions level_tile_directions::@2 to level_tile_directions::@return [phi:level_tile_directions/level_tile_directions::@2->level_tile_directions::@return] + __b1: + // [744] phi level_tile_directions::return#2 = 0 [phi:level_tile_directions/level_tile_directions::@2->level_tile_directions::@return#0] -- vbuaa=vbuc1 + lda #0 + // level_tile_directions::@return + // } + // [745] return + rts +} + // choose_direction +// Choose the open direction that brings the ghost closest to the target +// Uses Manhattan distance calculation +// choose_direction(byte zp($4f) open_directions, byte register(Y) ghost_xtile, byte zp(4) ghost_ytile, byte register(X) target_xtile, byte zp(3) target_ytile) +choose_direction: { + .label open_directions = $4f + .label ghost_ytile = 4 + .label target_ytile = 3 + .label xdiff = $5d + .label ydiff = 4 + .label dist_left = $50 + .label return = $53 + .label direction = $53 + .label dist_min = $50 + // xdiff = ghost_xtile-target_xtile + // [747] choose_direction::xdiff#0 = choose_direction::ghost_xtile#4 - choose_direction::target_xtile#4 -- vbuz1=vbuyy_minus_vbuxx + tya + stx.z $ff + sec + sbc.z $ff + sta.z xdiff + // ydiff = ghost_ytile-target_ytile + // [748] choose_direction::ydiff#0 = choose_direction::ghost_ytile#4 - choose_direction::target_ytile#4 -- vbuz1=vbuz1_minus_vbuz2 + lda.z ydiff + sec + sbc.z target_ytile + sta.z ydiff + // open_directions&UP + // [749] choose_direction::$2 = choose_direction::open_directions#10 & UP -- vbuaa=vbuz1_band_vbuc1 + lda #UP + and.z open_directions + // if(open_directions&UP) + // [750] if(0==choose_direction::$2) goto choose_direction::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b5 + // choose_direction::@5 + // ABS[xdiff] + ABS[ydiff-1] + // [751] choose_direction::dist_up#0 = ABS[choose_direction::xdiff#0] + (ABS+-1)[choose_direction::ydiff#0] -- vbuyy=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldy.z xdiff + lda ABS,y + ldy.z ydiff + clc + adc ABS+-1,y + tay + // if(dist_up=$ff) goto choose_direction::@1 -- vbuyy_ge_vbuc1_then_la1 + cpy #$ff + bcs __b5 + // [753] phi from choose_direction::@5 to choose_direction::@6 [phi:choose_direction::@5->choose_direction::@6] + // choose_direction::@6 + // [754] phi from choose_direction::@6 to choose_direction::@1 [phi:choose_direction::@6->choose_direction::@1] + // [754] phi choose_direction::direction#10 = UP [phi:choose_direction::@6->choose_direction::@1#0] -- vbuz1=vbuc1 + lda #UP + sta.z direction + // [754] phi choose_direction::dist_min#6 = choose_direction::dist_up#0 [phi:choose_direction::@6->choose_direction::@1#1] -- register_copy + jmp __b1 + // [754] phi from choose_direction choose_direction::@5 to choose_direction::@1 [phi:choose_direction/choose_direction::@5->choose_direction::@1] + __b5: + // [754] phi choose_direction::direction#10 = STOP [phi:choose_direction/choose_direction::@5->choose_direction::@1#0] -- vbuz1=vbuc1 + lda #STOP + sta.z direction + // [754] phi choose_direction::dist_min#6 = $ff [phi:choose_direction/choose_direction::@5->choose_direction::@1#1] -- vbuyy=vbuc1 + ldy #$ff + // choose_direction::@1 + __b1: + // open_directions&DOWN + // [755] choose_direction::$4 = choose_direction::open_directions#10 & DOWN -- vbuaa=vbuz1_band_vbuc1 + lda #DOWN + and.z open_directions + // if(open_directions&DOWN) + // [756] if(0==choose_direction::$4) goto choose_direction::@10 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b10 + // choose_direction::@7 + // ABS[xdiff] + ABS[ydiff+1] + // [757] choose_direction::dist_down#0 = ABS[choose_direction::xdiff#0] + (ABS+1)[choose_direction::ydiff#0] -- vbuxx=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldx.z xdiff + lda ABS,x + ldx.z ydiff + clc + adc ABS+1,x + tax + // if(dist_down=choose_direction::dist_min#6) goto choose_direction::@11 -- vbuxx_ge_vbuyy_then_la1 + sty.z $ff + cpx.z $ff + bcs __b11 + // [760] phi from choose_direction::@7 to choose_direction::@2 [phi:choose_direction::@7->choose_direction::@2] + // [760] phi choose_direction::direction#8 = DOWN [phi:choose_direction::@7->choose_direction::@2#0] -- vbuz1=vbuc1 + lda #DOWN + sta.z direction + // [760] phi choose_direction::dist_min#10 = choose_direction::dist_down#0 [phi:choose_direction::@7->choose_direction::@2#1] -- register_copy + jmp __b2 + // choose_direction::@11 + __b11: + // [759] choose_direction::dist_min#14 = choose_direction::dist_min#6 -- vbuxx=vbuyy + tya + tax + // [760] phi from choose_direction::@10 choose_direction::@11 to choose_direction::@2 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2] + // [760] phi choose_direction::direction#8 = choose_direction::direction#10 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2#0] -- register_copy + // [760] phi choose_direction::dist_min#10 = choose_direction::dist_min#13 [phi:choose_direction::@10/choose_direction::@11->choose_direction::@2#1] -- register_copy + // choose_direction::@2 + __b2: + // open_directions&LEFT + // [761] choose_direction::$6 = choose_direction::open_directions#10 & LEFT -- vbuaa=vbuz1_band_vbuc1 + lda #LEFT + and.z open_directions + // if(open_directions&LEFT) + // [762] if(0==choose_direction::$6) goto choose_direction::@12 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b12 + // choose_direction::@8 + // ABS[xdiff-1] + ABS[ydiff] + // [763] choose_direction::dist_left#0 = (ABS+-1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] -- vbuz1=pbuc1_derefidx_vbuz2_plus_pbuc2_derefidx_vbuz3 + ldy.z xdiff + lda ABS+-1,y + ldy.z ydiff + clc + adc ABS,y + sta.z dist_left + // if(dist_left=choose_direction::dist_min#10) goto choose_direction::@13 -- vbuz1_ge_vbuxx_then_la1 + stx.z $ff + cmp.z $ff + bcs __b13 + // [766] phi from choose_direction::@8 to choose_direction::@3 [phi:choose_direction::@8->choose_direction::@3] + // [766] phi choose_direction::dist_min#11 = choose_direction::dist_left#0 [phi:choose_direction::@8->choose_direction::@3#0] -- register_copy + // [766] phi choose_direction::direction#6 = LEFT [phi:choose_direction::@8->choose_direction::@3#1] -- vbuz1=vbuc1 + lda #LEFT + sta.z direction + jmp __b3 + // choose_direction::@13 + __b13: + // [765] choose_direction::dist_min#18 = choose_direction::dist_min#10 -- vbuz1=vbuxx + stx.z dist_min + // [766] phi from choose_direction::@12 choose_direction::@13 to choose_direction::@3 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3] + // [766] phi choose_direction::dist_min#11 = choose_direction::dist_min#17 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3#0] -- register_copy + // [766] phi choose_direction::direction#6 = choose_direction::direction#8 [phi:choose_direction::@12/choose_direction::@13->choose_direction::@3#1] -- register_copy + // choose_direction::@3 + __b3: + // open_directions&RIGHT + // [767] choose_direction::$8 = choose_direction::open_directions#10 & RIGHT -- vbuaa=vbuz1_band_vbuc1 + lda #RIGHT + and.z open_directions + // if(open_directions&RIGHT) + // [768] if(0==choose_direction::$8) goto choose_direction::@4 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b4 + // choose_direction::@9 + // ABS[xdiff+1] + ABS[ydiff] + // [769] choose_direction::dist_right#0 = (ABS+1)[choose_direction::xdiff#0] + ABS[choose_direction::ydiff#0] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc2_derefidx_vbuz2 + ldy.z xdiff + lda ABS+1,y + ldy.z ydiff + clc + adc ABS,y + // if(dist_right=choose_direction::dist_min#11) goto choose_direction::@14 -- vbuaa_ge_vbuz1_then_la1 + cmp.z dist_min + bcs __b4 + // [772] phi from choose_direction::@9 to choose_direction::@4 [phi:choose_direction::@9->choose_direction::@4] + // [772] phi choose_direction::return#10 = RIGHT [phi:choose_direction::@9->choose_direction::@4#0] -- vbuz1=vbuc1 + lda #RIGHT + sta.z return + rts + // [771] phi from choose_direction::@9 to choose_direction::@14 [phi:choose_direction::@9->choose_direction::@14] + // choose_direction::@14 + // [772] phi from choose_direction::@14 choose_direction::@3 to choose_direction::@4 [phi:choose_direction::@14/choose_direction::@3->choose_direction::@4] + // [772] phi choose_direction::return#10 = choose_direction::direction#6 [phi:choose_direction::@14/choose_direction::@3->choose_direction::@4#0] -- register_copy + // choose_direction::@4 + __b4: + // choose_direction::@return + // } + // [773] return + rts + // choose_direction::@12 + __b12: + // [774] choose_direction::dist_min#17 = choose_direction::dist_min#10 -- vbuz1=vbuxx + stx.z dist_min + jmp __b3 + // choose_direction::@10 + __b10: + // [775] choose_direction::dist_min#13 = choose_direction::dist_min#6 -- vbuxx=vbuyy + tya + tax + jmp __b2 +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zp($63) str, word zp($59) num) +memset: { + .label end = $59 + .label dst = $63 + .label num = $59 + .label str = $63 + // if(num>0) + // [777] if(memset::num#5<=0) goto memset::@return -- vwuz1_le_0_then_la1 + lda.z num + bne !+ + lda.z num+1 + beq __breturn + !: + // memset::@1 + // end = (char*)str + num + // [778] memset::end#0 = (byte*)memset::str#6 + memset::num#5 -- pbuz1=pbuz2_plus_vwuz1 + lda.z end + clc + adc.z str + sta.z end + lda.z end+1 + adc.z str+1 + sta.z end+1 + // [779] memset::dst#4 = (byte*)memset::str#6 + // [780] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2] + // [780] phi memset::dst#2 = memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy + // memset::@2 + __b2: + // for(char* dst = str; dst!=end; dst++) + // [781] if(memset::dst#2!=memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1 + lda.z dst+1 + cmp.z end+1 + bne __b3 + lda.z dst + cmp.z end + bne __b3 + // memset::@return + __breturn: + // } + // [782] return + rts + // memset::@3 + __b3: + // *dst = c + // [783] *memset::dst#2 = 0 -- _deref_pbuz1=vbuc1 + lda #0 + tay + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + // [784] memset::dst#1 = ++ memset::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + jmp __b2 +} + // byteboozer_decrunch +// Decrunch crunched data using ByteBoozer +// - crunched: Pointer to the start of the crunched data +// byteboozer_decrunch(byte* zp($57) crunched) +byteboozer_decrunch: { + .label crunched = $57 + // asm + // asm { ldycrunched ldxcrunched+1 jsrb2.Decrunch } + ldy crunched + ldx crunched+1 + jsr b2.Decrunch + // byteboozer_decrunch::@return + // } + // [786] return + rts +} + // merge_code +// Merge unrolled cycle-exact logic code into an unrolled cycle-exact raster code. +// The logic-code is merged into the raster code ensuring cycle-exact execution. If a logic-code block does not fit within the remaining cycle-budget of a raster-slot then NOPs/BIT $EA are used to reach the cycle-budget. +// If the logic-code runs out before the raster-code ends then the remaining raster-slots are filled with NOP/BIT$EA. +// If the raster-code runs out before the logic-code then the rest of the logic-code is added at the end. +// An RTS is added at the very end. +// +// Parameters: +// - dest_code: Address where the merged code is placed +// - raster_code: The unrolled raster code blocks with information about cycles to be filled. Format is decribed below. +// - logic_code: The unrolled logic code with information about cycles spent. Format is decribed below. +// +// Format of unrolled raster code. +// A number of blocks that have the following structure: +// * 0xff +// * : some bytes of code. any number of bytes are allowed. +// 0xff : signals the end of a block. +// : If is 00 then this is the last block of the unrolled raster code. +// If is non-zero it means that cycles must be spent here (the cycle budget of the slot). The merger merges logic code into the slot and fills with NOP's to match the number of cycles needed. +// +// Format of unrolled logic code. +// A number of blocks that has the following structure: +// * 0xff +// : If is 00 then this is the last block of the unrolled logic code. No more bytes are used. +// If is non-zero it holds the number of cycles used by the block of code. +// * : some bytes of code. any number of bytes are allowed. This code uses exactly the number of cycles specified by +// 0xff : signals the end of a block. +// merge_code(byte* zp($b) dest_code, byte* zp($63) raster_code, byte* zp($59) logic_code) +merge_code: { + // Cycle-count signalling the last block of the logic-code + .const LOGIC_EXIT = 0 + // Value signalling the end of a block of the logic-code + .const LOGIC_END = $ff + // Cycle-count signalling the last block of the raster-code + .const RASTER_EXIT = 0 + // Value signalling the end of a block of the raster-code + .const RASTER_END = $ff + .label dest_code = $b + .label raster_code = $63 + .label logic_cycles = $60 + .label logic_code = $59 + // [788] phi from merge_code to merge_code::@1 [phi:merge_code->merge_code::@1] + // [788] phi merge_code::logic_code#18 = LOGIC_CODE_UNMERGED [phi:merge_code->merge_code::@1#0] -- pbuz1=pbuc1 + lda #LOGIC_CODE_UNMERGED + sta.z logic_code+1 + // [788] phi merge_code::dest_code#14 = RASTER_CODE [phi:merge_code->merge_code::@1#1] -- pbuz1=pbuc1 + lda #RASTER_CODE + sta.z dest_code+1 + // [788] phi merge_code::raster_code#4 = RASTER_CODE_UNMERGED [phi:merge_code->merge_code::@1#2] -- pbuz1=pbuc1 + lda #RASTER_CODE_UNMERGED + sta.z raster_code+1 + // Output raster code until meeting RASTER_END signalling the end of a block + // merge_code::@1 + __b1: + // while(*raster_code!=RASTER_END) + // [789] if(*merge_code::raster_code#4!=merge_code::RASTER_END) goto merge_code::@2 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (raster_code),y + cmp #RASTER_END + beq !__b2+ + jmp __b2 + !__b2: + // merge_code::@3 + // raster_code++; + // [790] merge_code::raster_code#1 = ++ merge_code::raster_code#4 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // cycle_budget = *raster_code++ + // [791] merge_code::cycle_budget#0 = *merge_code::raster_code#1 -- vbuxx=_deref_pbuz1 + // Find the number of cycles + ldy #0 + lda (raster_code),y + tax + // [792] merge_code::raster_code#2 = ++ merge_code::raster_code#1 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + // if(cycle_budget==RASTER_EXIT) + // [793] if(merge_code::cycle_budget#0!=merge_code::RASTER_EXIT) goto merge_code::@4 -- vbuxx_neq_vbuc1_then_la1 + cpx #RASTER_EXIT + bne __b4 + // [794] phi from merge_code::@19 merge_code::@3 to merge_code::@14 [phi:merge_code::@19/merge_code::@3->merge_code::@14] + __b3: + // [794] phi merge_code::dest_code#12 = merge_code::dest_code#13 [phi:merge_code::@19/merge_code::@3->merge_code::@14#0] -- register_copy + // [794] phi merge_code::logic_code#12 = merge_code::logic_code#5 [phi:merge_code::@19/merge_code::@3->merge_code::@14#1] -- register_copy + // No more raster code - fill in the rest of the logic code + // merge_code::@14 + // while(*logic_code!=LOGIC_EXIT) + // [795] if(*merge_code::logic_code#12!=merge_code::LOGIC_EXIT) goto merge_code::@15 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_EXIT + bne __b15 + // merge_code::@16 + // *dest_code++ = 0x60 + // [796] *merge_code::dest_code#12 = $60 -- _deref_pbuz1=vbuc1 + // And add an RTS + lda #$60 + sta (dest_code),y + // merge_code::@return + // } + // [797] return + rts + // merge_code::@15 + __b15: + // logic_code++; + // [798] merge_code::logic_code#3 = ++ merge_code::logic_code#12 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // [799] phi from merge_code::@15 merge_code::@18 to merge_code::@17 [phi:merge_code::@15/merge_code::@18->merge_code::@17] + __b5: + // [799] phi merge_code::dest_code#13 = merge_code::dest_code#12 [phi:merge_code::@15/merge_code::@18->merge_code::@17#0] -- register_copy + // [799] phi merge_code::logic_code#14 = merge_code::logic_code#3 [phi:merge_code::@15/merge_code::@18->merge_code::@17#1] -- register_copy + // Fill in the logic-code + // merge_code::@17 + // while(*logic_code!=LOGIC_END) + // [800] if(*merge_code::logic_code#14!=merge_code::LOGIC_END) goto merge_code::@18 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b18 + // merge_code::@19 + // logic_code++; + // [801] merge_code::logic_code#5 = ++ merge_code::logic_code#14 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b3 + // merge_code::@18 + __b18: + // *dest_code++ = *logic_code++ + // [802] *merge_code::dest_code#13 = *merge_code::logic_code#14 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (logic_code),y + sta (dest_code),y + // *dest_code++ = *logic_code++; + // [803] merge_code::dest_code#6 = ++ merge_code::dest_code#13 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [804] merge_code::logic_code#4 = ++ merge_code::logic_code#14 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b5 + // Fit the cycle budget with logic-code + // [805] phi from merge_code::@3 merge_code::@8 to merge_code::@4 [phi:merge_code::@3/merge_code::@8->merge_code::@4] + // [805] phi merge_code::dest_code#21 = merge_code::dest_code#14 [phi:merge_code::@3/merge_code::@8->merge_code::@4#0] -- register_copy + // [805] phi merge_code::logic_code#17 = merge_code::logic_code#18 [phi:merge_code::@3/merge_code::@8->merge_code::@4#1] -- register_copy + // [805] phi merge_code::cycle_budget#13 = merge_code::cycle_budget#0 [phi:merge_code::@3/merge_code::@8->merge_code::@4#2] -- register_copy + // merge_code::@4 + __b4: + // while(cycle_budget>0) + // [806] if(merge_code::cycle_budget#13<=0) goto merge_code::@10 -- vbuxx_le_0_then_la1 + cpx #0 + beq __b6 + // merge_code::@5 + // logic_cycles = *logic_code + // [807] merge_code::logic_cycles#0 = *merge_code::logic_code#17 -- vbuz1=_deref_pbuz2 + // Find the number of logic code cycles + ldy #0 + lda (logic_code),y + sta.z logic_cycles + // cycle_budget-1 + // [808] merge_code::$5 = merge_code::cycle_budget#13 - 1 -- vbuyy=vbuxx_minus_1 + txa + tay + dey + // if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget)) + // [809] if(merge_code::logic_cycles#0!=merge_code::LOGIC_EXIT) goto merge_code::@20 -- vbuz1_neq_vbuc1_then_la1 + lda #LOGIC_EXIT + cmp.z logic_cycles + bne __b20 + // [810] phi from merge_code::@12 merge_code::@13 merge_code::@4 merge_code::@5 to merge_code::@10 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10] + __b6: + // [810] phi merge_code::dest_code#10 = merge_code::dest_code#3 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10#0] -- register_copy + // [810] phi merge_code::cycle_budget#10 = merge_code::cycle_budget#2 [phi:merge_code::@12/merge_code::@13/merge_code::@4/merge_code::@5->merge_code::@10#1] -- register_copy + // Fit the cycle budget with NOPs + // merge_code::@10 + __b10: + // while(cycle_budget>0) + // [811] if(merge_code::cycle_budget#10>0) goto merge_code::@11 -- vbuxx_gt_0_then_la1 + cpx #0 + bne __b11 + // [788] phi from merge_code::@10 merge_code::@2 to merge_code::@1 [phi:merge_code::@10/merge_code::@2->merge_code::@1] + // [788] phi merge_code::logic_code#18 = merge_code::logic_code#17 [phi:merge_code::@10/merge_code::@2->merge_code::@1#0] -- register_copy + // [788] phi merge_code::dest_code#14 = merge_code::dest_code#10 [phi:merge_code::@10/merge_code::@2->merge_code::@1#1] -- register_copy + // [788] phi merge_code::raster_code#4 = merge_code::raster_code#2 [phi:merge_code::@10/merge_code::@2->merge_code::@1#2] -- register_copy + jmp __b1 + // merge_code::@11 + __b11: + // if(cycle_budget==3) + // [812] if(merge_code::cycle_budget#10==3) goto merge_code::@12 -- vbuxx_eq_vbuc1_then_la1 + cpx #3 + beq __b12 + // merge_code::@13 + // *dest_code++ = 0xEA + // [813] *merge_code::dest_code#10 = $ea -- _deref_pbuz1=vbuc1 + lda #$ea + ldy #0 + sta (dest_code),y + // *dest_code++ = 0xEA; + // [814] merge_code::dest_code#4 = ++ merge_code::dest_code#10 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // cycle_budget -= 2 + // [815] merge_code::cycle_budget#3 = merge_code::cycle_budget#10 - 2 -- vbuxx=vbuxx_minus_2 + // NOP + dex + dex + jmp __b6 + // merge_code::@12 + __b12: + // *dest_code++ = 0x24 + // [816] *merge_code::dest_code#10 = $24 -- _deref_pbuz1=vbuc1 + lda #$24 + ldy #0 + sta (dest_code),y + // *dest_code++ = 0x24; + // [817] merge_code::dest_code#2 = ++ merge_code::dest_code#10 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // *dest_code++ = 0xEA + // [818] *merge_code::dest_code#2 = $ea -- _deref_pbuz1=vbuc1 + // BIT $EA + lda #$ea + ldy #0 + sta (dest_code),y + // *dest_code++ = 0xEA; + // [819] merge_code::dest_code#3 = ++ merge_code::dest_code#2 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // cycle_budget -= 3 + // [820] merge_code::cycle_budget#2 = merge_code::cycle_budget#10 - 3 -- vbuxx=vbuxx_minus_vbuc1 + txa + axs #3 + jmp __b6 + // merge_code::@20 + __b20: + // if(logic_cycles!=LOGIC_EXIT && (logic_cycles < cycle_budget-1 || logic_cycles==cycle_budget)) + // [821] if(merge_code::logic_cycles#0merge_code::@10] + jmp __b10 + // merge_code::@9 + __b9: + // logic_code++; + // [823] merge_code::logic_code#0 = ++ merge_code::logic_code#17 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // [824] phi from merge_code::@7 merge_code::@9 to merge_code::@6 [phi:merge_code::@7/merge_code::@9->merge_code::@6] + __b13: + // [824] phi merge_code::dest_code#15 = merge_code::dest_code#1 [phi:merge_code::@7/merge_code::@9->merge_code::@6#0] -- register_copy + // [824] phi merge_code::logic_code#10 = merge_code::logic_code#1 [phi:merge_code::@7/merge_code::@9->merge_code::@6#1] -- register_copy + // Fill in the logic-code + // merge_code::@6 + // while(*logic_code!=LOGIC_END) + // [825] if(*merge_code::logic_code#10!=merge_code::LOGIC_END) goto merge_code::@7 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (logic_code),y + cmp #LOGIC_END + bne __b7 + // merge_code::@8 + // logic_code++; + // [826] merge_code::logic_code#2 = ++ merge_code::logic_code#10 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + // cycle_budget -= logic_cycles + // [827] merge_code::cycle_budget#1 = merge_code::cycle_budget#13 - merge_code::logic_cycles#0 -- vbuxx=vbuxx_minus_vbuz1 + // Reduce the cycle budget + txa + sec + sbc.z logic_cycles + tax + jmp __b4 + // merge_code::@7 + __b7: + // *dest_code++ = *logic_code++ + // [828] *merge_code::dest_code#15 = *merge_code::logic_code#10 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (logic_code),y + sta (dest_code),y + // *dest_code++ = *logic_code++; + // [829] merge_code::dest_code#1 = ++ merge_code::dest_code#15 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [830] merge_code::logic_code#1 = ++ merge_code::logic_code#10 -- pbuz1=_inc_pbuz1 + inc.z logic_code + bne !+ + inc.z logic_code+1 + !: + jmp __b13 + // merge_code::@2 + __b2: + // *dest_code++ = *raster_code++ + // [831] *merge_code::dest_code#14 = *merge_code::raster_code#4 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (raster_code),y + sta (dest_code),y + // *dest_code++ = *raster_code++; + // [832] merge_code::dest_code#0 = ++ merge_code::dest_code#14 -- pbuz1=_inc_pbuz1 + inc.z dest_code + bne !+ + inc.z dest_code+1 + !: + // [833] merge_code::raster_code#0 = ++ merge_code::raster_code#4 -- pbuz1=_inc_pbuz1 + inc.z raster_code + bne !+ + inc.z raster_code+1 + !: + jmp __b1 +} + // init_render_index +// Initialize the RENDER_INDEX table from sub-tables +init_render_index: { + .label __10 = $61 + .label __11 = $61 + .label render_index_xcol = $59 + .label canvas_xcol = $5e + .label canvas = $61 + .label render_index = $59 + .label x_col = 5 + .label render_index_xcol_1 = $63 + .label y_pos = 6 + // Special column in sprite#9 + .label render_ypos_table = $b + .label __12 = $61 + // [835] phi from init_render_index to init_render_index::@1 [phi:init_render_index->init_render_index::@1] + // [835] phi init_render_index::render_index_xcol#0 = RENDER_INDEX [phi:init_render_index->init_render_index::@1#0] -- pbuz1=pbuc1 + lda #RENDER_INDEX + sta.z render_index_xcol+1 + // [835] phi init_render_index::x_col#2 = 0 [phi:init_render_index->init_render_index::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z x_col + // init_render_index::@1 + __b1: + // for(char x_col=0;x_col<26;x_col++) + // [836] if(init_render_index::x_col#2<$1a) goto init_render_index::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z x_col + cmp #$1a + bcc __b2 + // init_render_index::@3 + // (RENDER_INDEX+24*0x100)[RENDER_OFFSET_YPOS_INC] = 0 + // [837] *(RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC) = 0 -- _deref_pbuc1=vbuc2 + // Fix the first entry of the inc_offset in the last column (set it to point to 0,0,6,6...) + lda #0 + sta RENDER_INDEX+$18*$100+RENDER_OFFSET_YPOS_INC + // (RENDER_INDEX+25*0x100)[RENDER_OFFSET_YPOS_INC] = 0 + // [838] *(RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC) = 0 -- _deref_pbuc1=vbuc2 + sta RENDER_INDEX+$19*$100+RENDER_OFFSET_YPOS_INC + // init_render_index::@return + // } + // [839] return + rts + // init_render_index::@2 + __b2: + // if(x_col>=24) + // [840] if(init_render_index::x_col#2<$18) goto init_render_index::@4 -- vbuz1_lt_vbuc1_then_la1 + lda.z x_col + cmp #$18 + bcc __b3 + // [841] phi from init_render_index::@2 to init_render_index::@10 [phi:init_render_index::@2->init_render_index::@10] + // init_render_index::@10 + // [842] phi from init_render_index::@10 to init_render_index::@4 [phi:init_render_index::@10->init_render_index::@4] + // [842] phi init_render_index::ypos_inc_offset#7 = $b [phi:init_render_index::@10->init_render_index::@4#0] -- vbuxx=vbuc1 + ldx #$b + // [842] phi init_render_index::render_ypos_table#4 = RENDER_YPOS_9TH [phi:init_render_index::@10->init_render_index::@4#1] -- pwuz1=pwuc1 + lda #RENDER_YPOS_9TH + sta.z render_ypos_table+1 + jmp __b4 + // [842] phi from init_render_index::@2 to init_render_index::@4 [phi:init_render_index::@2->init_render_index::@4] + __b3: + // [842] phi init_render_index::ypos_inc_offset#7 = 0 [phi:init_render_index::@2->init_render_index::@4#0] -- vbuxx=vbuc1 + ldx #0 + // [842] phi init_render_index::render_ypos_table#4 = RENDER_YPOS [phi:init_render_index::@2->init_render_index::@4#1] -- pwuz1=pwuc1 + lda #RENDER_YPOS + sta.z render_ypos_table+1 + // init_render_index::@4 + __b4: + // canvas_xcol = RENDER_XCOLS[x_col] + // [843] init_render_index::$9 = init_render_index::x_col#2 << 1 -- vbuaa=vbuz1_rol_1 + lda.z x_col + asl + // [844] init_render_index::canvas_xcol#0 = RENDER_XCOLS[init_render_index::$9] -- pbuz1=qbuc1_derefidx_vbuaa + tay + lda RENDER_XCOLS,y + sta.z canvas_xcol + lda RENDER_XCOLS+1,y + sta.z canvas_xcol+1 + // [845] init_render_index::render_index_xcol#7 = init_render_index::render_index_xcol#0 -- pbuz1=pbuz2 + lda.z render_index_xcol + sta.z render_index_xcol_1 + lda.z render_index_xcol+1 + sta.z render_index_xcol_1+1 + // [846] phi from init_render_index::@4 to init_render_index::@5 [phi:init_render_index::@4->init_render_index::@5] + // [846] phi init_render_index::ypos_inc_offset#4 = init_render_index::ypos_inc_offset#7 [phi:init_render_index::@4->init_render_index::@5#0] -- register_copy + // [846] phi init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#7 [phi:init_render_index::@4->init_render_index::@5#1] -- register_copy + // [846] phi init_render_index::y_pos#2 = 0 [phi:init_render_index::@4->init_render_index::@5#2] -- vbuz1=vbuc1 + lda #0 + sta.z y_pos + // init_render_index::@5 + __b5: + // for(char y_pos=0;y_pos<148;y_pos+=2) + // [847] if(init_render_index::y_pos#2<$94) goto init_render_index::@6 -- vbuz1_lt_vbuc1_then_la1 + lda.z y_pos + cmp #$94 + bcc __b6 + // init_render_index::@7 + // render_index += 0x100 + // [848] init_render_index::render_index#1 = init_render_index::render_index_xcol#0 + $100 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z render_index + adc #<$100 + sta.z render_index + lda.z render_index+1 + adc #>$100 + sta.z render_index+1 + // for(char x_col=0;x_col<26;x_col++) + // [849] init_render_index::x_col#1 = ++ init_render_index::x_col#2 -- vbuz1=_inc_vbuz1 + inc.z x_col + // [835] phi from init_render_index::@7 to init_render_index::@1 [phi:init_render_index::@7->init_render_index::@1] + // [835] phi init_render_index::render_index_xcol#0 = init_render_index::render_index#1 [phi:init_render_index::@7->init_render_index::@1#0] -- register_copy + // [835] phi init_render_index::x_col#2 = init_render_index::x_col#1 [phi:init_render_index::@7->init_render_index::@1#1] -- register_copy + jmp __b1 + // init_render_index::@6 + __b6: + // canvas_xcol + render_ypos_table[(unsigned int)y_pos] + // [850] init_render_index::$11 = (word)init_render_index::y_pos#2 -- vwuz1=_word_vbuz2 + lda.z y_pos + sta.z __11 + lda #0 + sta.z __11+1 + // [851] init_render_index::$10 = init_render_index::$11 << 1 -- vwuz1=vwuz1_rol_1 + asl.z __10 + rol.z __10+1 + // canvas = canvas_xcol + render_ypos_table[(unsigned int)y_pos] + // [852] init_render_index::$12 = init_render_index::render_ypos_table#4 + init_render_index::$10 -- pwuz1=pwuz2_plus_vwuz1 + lda.z __12 + clc + adc.z render_ypos_table + sta.z __12 + lda.z __12+1 + adc.z render_ypos_table+1 + sta.z __12+1 + // [853] init_render_index::canvas#0 = init_render_index::canvas_xcol#0 + *init_render_index::$12 -- pbuz1=pbuz2_plus__deref_pwuz1 + ldy #0 + clc + lda (canvas),y + adc.z canvas_xcol + pha + iny + lda (canvas),y + adc.z canvas_xcol+1 + sta.z canvas+1 + pla + sta.z canvas + // canvas + // [856] init_render_index::$6 = > init_render_index::canvas#0 -- vbuaa=_hi_pbuz1 + lda.z canvas+1 + // render_index_xcol[RENDER_OFFSET_CANVAS_HI] = >canvas + // [857] init_render_index::render_index_xcol#2[RENDER_OFFSET_CANVAS_HI] = init_render_index::$6 -- pbuz1_derefidx_vbuc1=vbuaa + ldy #RENDER_OFFSET_CANVAS_HI + sta (render_index_xcol_1),y + // render_index_xcol[RENDER_OFFSET_YPOS_INC] = ypos_inc_offset + // [858] init_render_index::render_index_xcol#2[RENDER_OFFSET_YPOS_INC] = init_render_index::ypos_inc_offset#4 -- pbuz1_derefidx_vbuc1=vbuxx + ldy #RENDER_OFFSET_YPOS_INC + txa + sta (render_index_xcol_1),y + // ypos_inc_offset += 2 + // [859] init_render_index::ypos_inc_offset#2 = init_render_index::ypos_inc_offset#4 + 2 -- vbuxx=vbuxx_plus_2 + inx + inx + // if(ypos_inc_offset>=23) + // [860] if(init_render_index::ypos_inc_offset#2<$17) goto init_render_index::@8 -- vbuxx_lt_vbuc1_then_la1 + cpx #$17 + bcc __b8 + // init_render_index::@9 + // ypos_inc_offset-=21 + // [861] init_render_index::ypos_inc_offset#3 = init_render_index::ypos_inc_offset#2 - $15 -- vbuxx=vbuxx_minus_vbuc1 + txa + axs #$15 + // [862] phi from init_render_index::@6 init_render_index::@9 to init_render_index::@8 [phi:init_render_index::@6/init_render_index::@9->init_render_index::@8] + // [862] phi init_render_index::ypos_inc_offset#8 = init_render_index::ypos_inc_offset#2 [phi:init_render_index::@6/init_render_index::@9->init_render_index::@8#0] -- register_copy + // init_render_index::@8 + __b8: + // render_index_xcol++; + // [863] init_render_index::render_index_xcol#1 = ++ init_render_index::render_index_xcol#2 -- pbuz1=_inc_pbuz1 + inc.z render_index_xcol_1 + bne !+ + inc.z render_index_xcol_1+1 + !: + // y_pos+=2 + // [864] init_render_index::y_pos#1 = init_render_index::y_pos#2 + 2 -- vbuz1=vbuz1_plus_2 + lda.z y_pos + clc + adc #2 + sta.z y_pos + // [846] phi from init_render_index::@8 to init_render_index::@5 [phi:init_render_index::@8->init_render_index::@5] + // [846] phi init_render_index::ypos_inc_offset#4 = init_render_index::ypos_inc_offset#8 [phi:init_render_index::@8->init_render_index::@5#0] -- register_copy + // [846] phi init_render_index::render_index_xcol#2 = init_render_index::render_index_xcol#1 [phi:init_render_index::@8->init_render_index::@5#1] -- register_copy + // [846] phi init_render_index::y_pos#2 = init_render_index::y_pos#1 [phi:init_render_index::@8->init_render_index::@5#2] -- register_copy + jmp __b5 +} + // splash_show +// Show the splash screen +splash_show: { + // Show splash screen + .label splash = $63 + .label ypos = 6 + .label xcol = 5 + // [866] phi from splash_show to splash_show::@1 [phi:splash_show->splash_show::@1] + // [866] phi splash_show::splash#4 = SPLASH [phi:splash_show->splash_show::@1#0] -- pbuz1=pbuc1 + lda #SPLASH + sta.z splash+1 + // [866] phi splash_show::xcol#2 = 0 [phi:splash_show->splash_show::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z xcol + // splash_show::@1 + __b1: + // for(char xcol=0;xcol<25;xcol++) + // [867] if(splash_show::xcol#2<$19) goto splash_show::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b4 + // splash_show::@return + // } + // [868] return + rts + // [869] phi from splash_show::@1 to splash_show::@2 [phi:splash_show::@1->splash_show::@2] + __b4: + // [869] phi splash_show::splash#2 = splash_show::splash#4 [phi:splash_show::@1->splash_show::@2#0] -- register_copy + // [869] phi splash_show::ypos#2 = 0 [phi:splash_show::@1->splash_show::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z ypos + // splash_show::@2 + __b2: + // for(char ypos=0;ypos<147;ypos++) + // [870] if(splash_show::ypos#2<$93) goto splash_show::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z ypos + cmp #$93 + bcc __b3 + // splash_show::@4 + // for(char xcol=0;xcol<25;xcol++) + // [871] splash_show::xcol#1 = ++ splash_show::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [866] phi from splash_show::@4 to splash_show::@1 [phi:splash_show::@4->splash_show::@1] + // [866] phi splash_show::splash#4 = splash_show::splash#2 [phi:splash_show::@4->splash_show::@1#0] -- register_copy + // [866] phi splash_show::xcol#2 = splash_show::xcol#1 [phi:splash_show::@4->splash_show::@1#1] -- register_copy + jmp __b1 + // splash_show::@3 + __b3: + // pixels = *splash++ + // [872] splash_show::pixels#0 = *splash_show::splash#2 -- vbuxx=_deref_pbuz1 + // Render 8px x 1px + ldy #0 + lda (splash),y + tax + // [873] splash_show::splash#1 = ++ splash_show::splash#2 -- pbuz1=_inc_pbuz1 + inc.z splash + bne !+ + inc.z splash+1 + !: + // render(xcol, ypos, pixels) + // [874] render::xcol#1 = splash_show::xcol#2 + // [875] render::ypos#1 = splash_show::ypos#2 + // [876] render::pixels#1 = splash_show::pixels#0 -- vbuz1=vbuxx + stx.z render.pixels + // [877] call render + // [997] phi from splash_show::@3 to render [phi:splash_show::@3->render] + // [997] phi render::pixels#4 = render::pixels#1 [phi:splash_show::@3->render#0] -- register_copy + // [997] phi render::xcol#2 = render::xcol#1 [phi:splash_show::@3->render#1] -- register_copy + // [997] phi render::ypos#2 = render::ypos#1 [phi:splash_show::@3->render#2] -- register_copy + jsr render + // splash_show::@5 + // for(char ypos=0;ypos<147;ypos++) + // [878] splash_show::ypos#1 = ++ splash_show::ypos#2 -- vbuz1=_inc_vbuz1 + inc.z ypos + // [869] phi from splash_show::@5 to splash_show::@2 [phi:splash_show::@5->splash_show::@2] + // [869] phi splash_show::splash#2 = splash_show::splash#1 [phi:splash_show::@5->splash_show::@2#0] -- register_copy + // [869] phi splash_show::ypos#2 = splash_show::ypos#1 [phi:splash_show::@5->splash_show::@2#1] -- register_copy + jmp __b2 +} + // init_bobs_restore +// Initialize bobs_restore with data to prevent crash on the first call +init_bobs_restore: { + .label CANVAS_HIDDEN = $ea00 + .label bob_restore = $b + // [880] phi from init_bobs_restore to init_bobs_restore::@1 [phi:init_bobs_restore->init_bobs_restore::@1] + // [880] phi init_bobs_restore::bob_restore#5 = bobs_restore [phi:init_bobs_restore->init_bobs_restore::@1#0] -- pbuz1=pbuc1 + lda #bobs_restore + sta.z bob_restore+1 + // [880] phi init_bobs_restore::bob#2 = 0 [phi:init_bobs_restore->init_bobs_restore::@1#1] -- vbuxx=vbuc1 + ldx #0 + // init_bobs_restore::@1 + __b1: + // for(char bob=0;bobLEVEL_TILES+$40*$12+$c + sta.z logic_tile_ptr+1 + // logic_tile_xcol = 12 + // [883] logic_tile_xcol = $c -- vbuz1=vbuc1 + lda #$c + sta.z logic_tile_xcol + // logic_tile_yfine = 35 + // [884] logic_tile_yfine = $23 -- vbuz1=vbuc1 + lda #$23 + sta.z logic_tile_yfine + // init_bobs_restore::@return + // } + // [885] return + rts + // [886] phi from init_bobs_restore::@1 to init_bobs_restore::@3 [phi:init_bobs_restore::@1->init_bobs_restore::@3] + __b2: + // [886] phi init_bobs_restore::i#2 = 0 [phi:init_bobs_restore::@1->init_bobs_restore::@3#0] -- vbuyy=vbuc1 + ldy #0 + // init_bobs_restore::@3 + __b3: + // for(char i=0;iCANVAS_HIDDEN + // [889] init_bobs_restore::bob_restore#5[1] = >init_bobs_restore::CANVAS_HIDDEN -- pbuz1_derefidx_vbuc1=vbuc2 + lda #>CANVAS_HIDDEN + ldy #1 + sta (bob_restore),y + // bob_restore[3] = CANVAS_HIDDEN + // [891] init_bobs_restore::bob_restore#5[4] = >init_bobs_restore::CANVAS_HIDDEN -- pbuz1_derefidx_vbuc1=vbuc2 + lda #>CANVAS_HIDDEN + ldy #4 + sta (bob_restore),y + // bob_restore += SIZE_BOB_RESTORE + // [892] init_bobs_restore::bob_restore#1 = init_bobs_restore::bob_restore#5 + SIZE_BOB_RESTORE -- pbuz1=pbuz1_plus_vbuc1 + lda #SIZE_BOB_RESTORE + clc + adc.z bob_restore + sta.z bob_restore + bcc !+ + inc.z bob_restore+1 + !: + // for(char bob=0;bobinit_bobs_restore::@1] + // [880] phi init_bobs_restore::bob_restore#5 = init_bobs_restore::bob_restore#1 [phi:init_bobs_restore::@5->init_bobs_restore::@1#0] -- register_copy + // [880] phi init_bobs_restore::bob#2 = init_bobs_restore::bob#1 [phi:init_bobs_restore::@5->init_bobs_restore::@1#1] -- register_copy + jmp __b1 + // init_bobs_restore::@4 + __b4: + // bob_restore[i] = 0 + // [894] init_bobs_restore::bob_restore#5[init_bobs_restore::i#2] = 0 -- pbuz1_derefidx_vbuyy=vbuc1 + lda #0 + sta (bob_restore),y + // for(char i=0;iinit_bobs_restore::@3] + // [886] phi init_bobs_restore::i#2 = init_bobs_restore::i#1 [phi:init_bobs_restore::@4->init_bobs_restore::@3#0] -- register_copy + jmp __b3 +} + // init_sprite_pointers +// Initialize sprite pointers on all screens (in both graphics banks) +init_sprite_pointers: { + .const SPRITE_ID_0 = $ff&(SPRITES_1&$3fff)/$40 + .label sprites_ptr_1 = $b + .label sprites_ptr_2 = 9 + // [897] phi from init_sprite_pointers to init_sprite_pointers::@1 [phi:init_sprite_pointers->init_sprite_pointers::@1] + // [897] phi init_sprite_pointers::sprites_ptr_2#5 = SCREENS_2+OFFSET_SPRITE_PTRS [phi:init_sprite_pointers->init_sprite_pointers::@1#0] -- pbuz1=pbuc1 + lda #SCREENS_2+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_2+1 + // [897] phi init_sprite_pointers::sprites_ptr_1#5 = SCREENS_1+OFFSET_SPRITE_PTRS [phi:init_sprite_pointers->init_sprite_pointers::@1#1] -- pbuz1=pbuc1 + lda #SCREENS_1+OFFSET_SPRITE_PTRS + sta.z sprites_ptr_1+1 + // [897] phi init_sprite_pointers::screen#2 = 0 [phi:init_sprite_pointers->init_sprite_pointers::@1#2] -- vbuxx=vbuc1 + ldx #0 + // init_sprite_pointers::@1 + __b1: + // for(char screen=0;screen<14;screen++) + // [898] if(init_sprite_pointers::screen#2<$e) goto init_sprite_pointers::@2 -- vbuxx_lt_vbuc1_then_la1 + cpx #$e + bcc __b4 + // init_sprite_pointers::@return + // } + // [899] return + rts + // [900] phi from init_sprite_pointers::@1 to init_sprite_pointers::@2 [phi:init_sprite_pointers::@1->init_sprite_pointers::@2] + __b4: + // [900] phi init_sprite_pointers::sprite#2 = 0 [phi:init_sprite_pointers::@1->init_sprite_pointers::@2#0] -- vbuyy=vbuc1 + ldy #0 + // init_sprite_pointers::@2 + __b2: + // for(char sprite=0; sprite<8; sprite++) + // [901] if(init_sprite_pointers::sprite#2<8) goto init_sprite_pointers::@3 -- vbuyy_lt_vbuc1_then_la1 + cpy #8 + bcc __b3 + // init_sprite_pointers::@4 + // sprites_ptr_1 += 0x400 + // [902] init_sprite_pointers::sprites_ptr_1#1 = init_sprite_pointers::sprites_ptr_1#5 + $400 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z sprites_ptr_1 + adc #<$400 + sta.z sprites_ptr_1 + lda.z sprites_ptr_1+1 + adc #>$400 + sta.z sprites_ptr_1+1 + // sprites_ptr_2 += 0x400 + // [903] init_sprite_pointers::sprites_ptr_2#1 = init_sprite_pointers::sprites_ptr_2#5 + $400 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda.z sprites_ptr_2 + adc #<$400 + sta.z sprites_ptr_2 + lda.z sprites_ptr_2+1 + adc #>$400 + sta.z sprites_ptr_2+1 + // for(char screen=0;screen<14;screen++) + // [904] init_sprite_pointers::screen#1 = ++ init_sprite_pointers::screen#2 -- vbuxx=_inc_vbuxx + inx + // [897] phi from init_sprite_pointers::@4 to init_sprite_pointers::@1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1] + // [897] phi init_sprite_pointers::sprites_ptr_2#5 = init_sprite_pointers::sprites_ptr_2#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#0] -- register_copy + // [897] phi init_sprite_pointers::sprites_ptr_1#5 = init_sprite_pointers::sprites_ptr_1#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#1] -- register_copy + // [897] phi init_sprite_pointers::screen#2 = init_sprite_pointers::screen#1 [phi:init_sprite_pointers::@4->init_sprite_pointers::@1#2] -- register_copy + jmp __b1 + // init_sprite_pointers::@3 + __b3: + // SPRITE_ID_0 + screen + // [905] init_sprite_pointers::$2 = init_sprite_pointers::SPRITE_ID_0 + init_sprite_pointers::screen#2 -- vbuaa=vbuc1_plus_vbuxx + txa + clc + adc #SPRITE_ID_0 + // sprite_id = SPRITE_ID_0 + screen + sprites_id[sprite] + // [906] init_sprite_pointers::sprite_id#0 = init_sprite_pointers::$2 + init_sprite_pointers::sprites_id[init_sprite_pointers::sprite#2] -- vbuaa=vbuaa_plus_pbuc1_derefidx_vbuyy + clc + adc sprites_id,y + // sprites_ptr_1[sprite] = sprite_id + // [907] init_sprite_pointers::sprites_ptr_1#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 -- pbuz1_derefidx_vbuyy=vbuaa + sta (sprites_ptr_1),y + // sprites_ptr_2[sprite] = sprite_id + // [908] init_sprite_pointers::sprites_ptr_2#5[init_sprite_pointers::sprite#2] = init_sprite_pointers::sprite_id#0 -- pbuz1_derefidx_vbuyy=vbuaa + sta (sprites_ptr_2),y + // for(char sprite=0; sprite<8; sprite++) + // [909] init_sprite_pointers::sprite#1 = ++ init_sprite_pointers::sprite#2 -- vbuyy=_inc_vbuyy + iny + // [900] phi from init_sprite_pointers::@3 to init_sprite_pointers::@2 [phi:init_sprite_pointers::@3->init_sprite_pointers::@2] + // [900] phi init_sprite_pointers::sprite#2 = init_sprite_pointers::sprite#1 [phi:init_sprite_pointers::@3->init_sprite_pointers::@2#0] -- register_copy + jmp __b2 + .segment Data + sprites_id: .byte 0, $70, $60, $50, $40, $30, $20, $10 +} +.segment Code + // memcpy +// Copy block of memory (forwards) +// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination. +memcpy: { + .label destination = INTRO_MUSIC_CRUNCHED_UPPER + .label source = INTRO_MUSIC_CRUNCHED + .label src_end = source+INTRO_MUSIC_CRUNCHED_SIZE + .label dst = $b + .label src = 9 + // [911] phi from memcpy to memcpy::@1 [phi:memcpy->memcpy::@1] + // [911] phi memcpy::dst#2 = (byte*)memcpy::destination#0 [phi:memcpy->memcpy::@1#0] -- pbuz1=pbuc1 + lda #destination + sta.z dst+1 + // [911] phi memcpy::src#2 = (byte*)memcpy::source#0 [phi:memcpy->memcpy::@1#1] -- pbuz1=pbuc1 + lda #source + sta.z src+1 + // memcpy::@1 + __b1: + // while(src!=src_end) + // [912] if(memcpy::src#2!=memcpy::src_end#0) goto memcpy::@2 -- pbuz1_neq_pbuc1_then_la1 + lda.z src+1 + cmp #>src_end + bne __b2 + lda.z src + cmp #memcpy::@1] + // [911] phi memcpy::dst#2 = memcpy::dst#1 [phi:memcpy::@2->memcpy::@1#0] -- register_copy + // [911] phi memcpy::src#2 = memcpy::src#1 [phi:memcpy::@2->memcpy::@1#1] -- register_copy + jmp __b1 +} + // joyinit +// Prepare for joystick control +joyinit: { + // CIA1->PORT_A_DDR = 0x00 + // [917] *((byte*)CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) = 0 -- _deref_pbuc1=vbuc2 + // Joystick Read Mode + lda #0 + sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR + // joyinit::@return + // } + // [918] return + rts +} + // joyfire +// Return 1 if joy #2 fire is pressed +joyfire: { + // CIA1->PORT_A & 0x10 + // [919] joyfire::$0 = *((byte*)CIA1) & $10 -- vbuaa=_deref_pbuc1_band_vbuc2 + lda #$10 + and CIA1 + // if( (CIA1->PORT_A & 0x10) == 0 ) + // [920] if(joyfire::$0==0) goto joyfire::@1 -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b1 + // [922] phi from joyfire to joyfire::@return [phi:joyfire->joyfire::@return] + // [922] phi joyfire::return#4 = 0 [phi:joyfire->joyfire::@return#0] -- vbuaa=vbuc1 + lda #0 + rts + // [921] phi from joyfire to joyfire::@1 [phi:joyfire->joyfire::@1] + // joyfire::@1 + __b1: + // [922] phi from joyfire::@1 to joyfire::@return [phi:joyfire::@1->joyfire::@return] + // [922] phi joyfire::return#4 = 1 [phi:joyfire::@1->joyfire::@return#0] -- vbuaa=vbuc1 + lda #1 + // joyfire::@return + // } + // [923] return + rts +} + // init_level_tile_directions +// Initialize the LEVEL_TILES_DIRECTIONS table with bits representing all open (non-blocked) movement directions from a tile +init_level_tile_directions: { + .label directions = $b + .label ytile = 5 + .label open_directions = 7 + .label xtile = 6 + // [925] phi from init_level_tile_directions to init_level_tile_directions::@1 [phi:init_level_tile_directions->init_level_tile_directions::@1] + // [925] phi init_level_tile_directions::directions#7 = LEVEL_TILES_DIRECTIONS [phi:init_level_tile_directions->init_level_tile_directions::@1#0] -- pbuz1=pbuc1 + lda #LEVEL_TILES_DIRECTIONS + sta.z directions+1 + // [925] phi init_level_tile_directions::ytile#15 = 0 [phi:init_level_tile_directions->init_level_tile_directions::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z ytile + // init_level_tile_directions::@1 + __b1: + // for(char ytile=0;ytile<37;ytile++) + // [926] if(init_level_tile_directions::ytile#15<$25) goto init_level_tile_directions::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z ytile + cmp #$25 + bcc __b4 + // init_level_tile_directions::@return + // } + // [927] return + rts + // [928] phi from init_level_tile_directions::@1 to init_level_tile_directions::@2 [phi:init_level_tile_directions::@1->init_level_tile_directions::@2] + __b4: + // [928] phi init_level_tile_directions::xtile#10 = 0 [phi:init_level_tile_directions::@1->init_level_tile_directions::@2#0] -- vbuz1=vbuc1 + lda #0 + sta.z xtile + // init_level_tile_directions::@2 + __b2: + // for(char xtile=0; xtile<50; xtile++) + // [929] if(init_level_tile_directions::xtile#10<$32) goto init_level_tile_directions::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z xtile + cmp #$32 + bcc __b3 + // init_level_tile_directions::@4 + // directions += 0x40 + // [930] init_level_tile_directions::directions#1 = init_level_tile_directions::directions#7 + $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z directions + sta.z directions + bcc !+ + inc.z directions+1 + !: + // for(char ytile=0;ytile<37;ytile++) + // [931] init_level_tile_directions::ytile#1 = ++ init_level_tile_directions::ytile#15 -- vbuz1=_inc_vbuz1 + inc.z ytile + // [925] phi from init_level_tile_directions::@4 to init_level_tile_directions::@1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1] + // [925] phi init_level_tile_directions::directions#7 = init_level_tile_directions::directions#1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1#0] -- register_copy + // [925] phi init_level_tile_directions::ytile#15 = init_level_tile_directions::ytile#1 [phi:init_level_tile_directions::@4->init_level_tile_directions::@1#1] -- register_copy + jmp __b1 + // init_level_tile_directions::@3 + __b3: + // level_tile_get(xtile-1, ytile) + // [932] level_tile_get::xtile#0 = init_level_tile_directions::xtile#10 - 1 -- vbuxx=vbuz1_minus_1 + ldx.z xtile + dex + // [933] level_tile_get::ytile#0 = init_level_tile_directions::ytile#15 -- vbuaa=vbuz1 + lda.z ytile + // [934] call level_tile_get + // [1016] phi from init_level_tile_directions::@3 to level_tile_get [phi:init_level_tile_directions::@3->level_tile_get] + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#0 [phi:init_level_tile_directions::@3->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#0 [phi:init_level_tile_directions::@3->level_tile_get#1] -- register_copy + jsr level_tile_get + // level_tile_get(xtile-1, ytile) + // [935] level_tile_get::return#3 = level_tile_get::return#2 + // init_level_tile_directions::@13 + // [936] init_level_tile_directions::$3 = level_tile_get::return#3 -- vbuxx=vbuaa + tax + // if(TILES_TYPE[level_tile_get(xtile-1, ytile)]!=WALL) + // [937] if(TILES_TYPE[init_level_tile_directions::$3]==WALL) goto init_level_tile_directions::@5 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #WALL + beq __b9 + // [938] phi from init_level_tile_directions::@13 to init_level_tile_directions::@9 [phi:init_level_tile_directions::@13->init_level_tile_directions::@9] + // init_level_tile_directions::@9 + // [939] phi from init_level_tile_directions::@9 to init_level_tile_directions::@5 [phi:init_level_tile_directions::@9->init_level_tile_directions::@5] + // [939] phi init_level_tile_directions::open_directions#11 = LEFT [phi:init_level_tile_directions::@9->init_level_tile_directions::@5#0] -- vbuz1=vbuc1 + lda #LEFT + sta.z open_directions + jmp __b5 + // [939] phi from init_level_tile_directions::@13 to init_level_tile_directions::@5 [phi:init_level_tile_directions::@13->init_level_tile_directions::@5] + __b9: + // [939] phi init_level_tile_directions::open_directions#11 = 0 [phi:init_level_tile_directions::@13->init_level_tile_directions::@5#0] -- vbuz1=vbuc1 + lda #0 + sta.z open_directions + // init_level_tile_directions::@5 + __b5: + // level_tile_get(xtile+1, ytile) + // [940] level_tile_get::xtile#1 = init_level_tile_directions::xtile#10 + 1 -- vbuxx=vbuz1_plus_1 + ldx.z xtile + inx + // [941] level_tile_get::ytile#1 = init_level_tile_directions::ytile#15 -- vbuaa=vbuz1 + lda.z ytile + // [942] call level_tile_get + // [1016] phi from init_level_tile_directions::@5 to level_tile_get [phi:init_level_tile_directions::@5->level_tile_get] + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#1 [phi:init_level_tile_directions::@5->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#1 [phi:init_level_tile_directions::@5->level_tile_get#1] -- register_copy + jsr level_tile_get + // level_tile_get(xtile+1, ytile) + // [943] level_tile_get::return#4 = level_tile_get::return#2 + // init_level_tile_directions::@14 + // [944] init_level_tile_directions::$7 = level_tile_get::return#4 -- vbuxx=vbuaa + tax + // if(TILES_TYPE[level_tile_get(xtile+1, ytile)]!=WALL) + // [945] if(TILES_TYPE[init_level_tile_directions::$7]==WALL) goto init_level_tile_directions::@6 -- pbuc1_derefidx_vbuxx_eq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #WALL + beq __b6 + // init_level_tile_directions::@10 + // open_directions |= RIGHT + // [946] init_level_tile_directions::open_directions#2 = init_level_tile_directions::open_directions#11 | RIGHT -- vbuz1=vbuz1_bor_vbuc1 + lda #RIGHT + ora.z open_directions + sta.z open_directions + // [947] phi from init_level_tile_directions::@10 init_level_tile_directions::@14 to init_level_tile_directions::@6 [phi:init_level_tile_directions::@10/init_level_tile_directions::@14->init_level_tile_directions::@6] + // [947] phi init_level_tile_directions::open_directions#12 = init_level_tile_directions::open_directions#2 [phi:init_level_tile_directions::@10/init_level_tile_directions::@14->init_level_tile_directions::@6#0] -- register_copy + // init_level_tile_directions::@6 + __b6: + // level_tile_get(xtile, ytile-1) + // [948] level_tile_get::ytile#2 = init_level_tile_directions::ytile#15 - 1 -- vbuaa=vbuz1_minus_1 + lda.z ytile + sec + sbc #1 + // [949] level_tile_get::xtile#2 = init_level_tile_directions::xtile#10 -- vbuxx=vbuz1 + ldx.z xtile + // [950] call level_tile_get + // [1016] phi from init_level_tile_directions::@6 to level_tile_get [phi:init_level_tile_directions::@6->level_tile_get] + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#2 [phi:init_level_tile_directions::@6->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#2 [phi:init_level_tile_directions::@6->level_tile_get#1] -- register_copy + jsr level_tile_get + // level_tile_get(xtile, ytile-1) + // [951] level_tile_get::return#10 = level_tile_get::return#2 + // init_level_tile_directions::@15 + // [952] init_level_tile_directions::$11 = level_tile_get::return#10 + // if(TILES_TYPE[level_tile_get(xtile, ytile-1)]!=WALL) + // [953] if(TILES_TYPE[init_level_tile_directions::$11]==WALL) goto init_level_tile_directions::@7 -- pbuc1_derefidx_vbuaa_eq_vbuc2_then_la1 + tay + lda TILES_TYPE,y + cmp #WALL + beq __b7 + // init_level_tile_directions::@11 + // open_directions |= UP + // [954] init_level_tile_directions::open_directions#3 = init_level_tile_directions::open_directions#12 | UP -- vbuz1=vbuz1_bor_vbuc1 + lda #UP + ora.z open_directions + sta.z open_directions + // [955] phi from init_level_tile_directions::@11 init_level_tile_directions::@15 to init_level_tile_directions::@7 [phi:init_level_tile_directions::@11/init_level_tile_directions::@15->init_level_tile_directions::@7] + // [955] phi init_level_tile_directions::open_directions#13 = init_level_tile_directions::open_directions#3 [phi:init_level_tile_directions::@11/init_level_tile_directions::@15->init_level_tile_directions::@7#0] -- register_copy + // init_level_tile_directions::@7 + __b7: + // level_tile_get(xtile, ytile+1) + // [956] level_tile_get::ytile#3 = init_level_tile_directions::ytile#15 + 1 -- vbuaa=vbuz1_plus_1 + lda.z ytile + clc + adc #1 + // [957] level_tile_get::xtile#3 = init_level_tile_directions::xtile#10 -- vbuxx=vbuz1 + ldx.z xtile + // [958] call level_tile_get + // [1016] phi from init_level_tile_directions::@7 to level_tile_get [phi:init_level_tile_directions::@7->level_tile_get] + // [1016] phi level_tile_get::ytile#4 = level_tile_get::ytile#3 [phi:init_level_tile_directions::@7->level_tile_get#0] -- register_copy + // [1016] phi level_tile_get::xtile#4 = level_tile_get::xtile#3 [phi:init_level_tile_directions::@7->level_tile_get#1] -- register_copy + jsr level_tile_get + // level_tile_get(xtile, ytile+1) + // [959] level_tile_get::return#11 = level_tile_get::return#2 + // init_level_tile_directions::@16 + // [960] init_level_tile_directions::$15 = level_tile_get::return#11 + // if(TILES_TYPE[level_tile_get(xtile, ytile+1)]!=WALL) + // [961] if(TILES_TYPE[init_level_tile_directions::$15]==WALL) goto init_level_tile_directions::@8 -- pbuc1_derefidx_vbuaa_eq_vbuc2_then_la1 + tay + lda TILES_TYPE,y + cmp #WALL + beq __b8 + // init_level_tile_directions::@12 + // open_directions |= DOWN + // [962] init_level_tile_directions::open_directions#4 = init_level_tile_directions::open_directions#13 | DOWN -- vbuz1=vbuz1_bor_vbuc1 + lda #DOWN + ora.z open_directions + sta.z open_directions + // [963] phi from init_level_tile_directions::@12 init_level_tile_directions::@16 to init_level_tile_directions::@8 [phi:init_level_tile_directions::@12/init_level_tile_directions::@16->init_level_tile_directions::@8] + // [963] phi init_level_tile_directions::open_directions#8 = init_level_tile_directions::open_directions#4 [phi:init_level_tile_directions::@12/init_level_tile_directions::@16->init_level_tile_directions::@8#0] -- register_copy + // init_level_tile_directions::@8 + __b8: + // directions[xtile] = open_directions + // [964] init_level_tile_directions::directions#7[init_level_tile_directions::xtile#10] = init_level_tile_directions::open_directions#8 -- pbuz1_derefidx_vbuz2=vbuz3 + lda.z open_directions + ldy.z xtile + sta (directions),y + // for(char xtile=0; xtile<50; xtile++) + // [965] init_level_tile_directions::xtile#1 = ++ init_level_tile_directions::xtile#10 -- vbuz1=_inc_vbuz1 + inc.z xtile + // [928] phi from init_level_tile_directions::@8 to init_level_tile_directions::@2 [phi:init_level_tile_directions::@8->init_level_tile_directions::@2] + // [928] phi init_level_tile_directions::xtile#10 = init_level_tile_directions::xtile#1 [phi:init_level_tile_directions::@8->init_level_tile_directions::@2#0] -- register_copy + jmp __b2 +} + // level_show +// Show the level by rendering all tiles +// Returns the number of pills on the level +level_show: { + .label return = $b + .label level = 9 + .label ytile = 6 + .label tile_right = $60 + .label xtile = 8 + .label count = $b + .label xcol = 7 + // [967] phi from level_show to level_show::@1 [phi:level_show->level_show::@1] + // [967] phi level_show::level#8 = LEVEL_TILES [phi:level_show->level_show::@1#0] -- pbuz1=pbuc1 + lda #LEVEL_TILES + sta.z level+1 + // [967] phi level_show::count#12 = 0 [phi:level_show->level_show::@1#1] -- vwuz1=vwuc1 + lda #<0 + sta.z count + sta.z count+1 + // [967] phi level_show::ytile#2 = 0 [phi:level_show->level_show::@1#2] -- vbuz1=vbuc1 + sta.z ytile + // level_show::@1 + __b1: + // for(char ytile=0;ytile<37;ytile++) + // [968] if(level_show::ytile#2<$25) goto level_show::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z ytile + cmp #$25 + bcc __b4 + // level_show::@return + // } + // [969] return + rts + // [970] phi from level_show::@1 to level_show::@2 [phi:level_show::@1->level_show::@2] + __b4: + // [970] phi level_show::count#10 = level_show::count#12 [phi:level_show::@1->level_show::@2#0] -- register_copy + // [970] phi level_show::xtile#3 = 0 [phi:level_show::@1->level_show::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z xtile + // [970] phi level_show::xcol#2 = 0 [phi:level_show::@1->level_show::@2#2] -- vbuz1=vbuc1 + sta.z xcol + // level_show::@2 + __b2: + // for(char xcol=0, xtile=0; xcol<25; xcol++) + // [971] if(level_show::xcol#2<$19) goto level_show::@3 -- vbuz1_lt_vbuc1_then_la1 + lda.z xcol + cmp #$19 + bcc __b3 + // level_show::@4 + // level += 0x40 + // [972] level_show::level#1 = level_show::level#8 + $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z level + sta.z level + bcc !+ + inc.z level+1 + !: + // for(char ytile=0;ytile<37;ytile++) + // [973] level_show::ytile#1 = ++ level_show::ytile#2 -- vbuz1=_inc_vbuz1 + inc.z ytile + // [967] phi from level_show::@4 to level_show::@1 [phi:level_show::@4->level_show::@1] + // [967] phi level_show::level#8 = level_show::level#1 [phi:level_show::@4->level_show::@1#0] -- register_copy + // [967] phi level_show::count#12 = level_show::count#10 [phi:level_show::@4->level_show::@1#1] -- register_copy + // [967] phi level_show::ytile#2 = level_show::ytile#1 [phi:level_show::@4->level_show::@1#2] -- register_copy + jmp __b1 + // level_show::@3 + __b3: + // tile_left = level[xtile++] + // [974] level_show::tile_left#0 = level_show::level#8[level_show::xtile#3] -- vbuxx=pbuz1_derefidx_vbuz2 + ldy.z xtile + lda (level),y + tax + // [975] level_show::xtile#1 = ++ level_show::xtile#3 -- vbuyy=_inc_vbuz1 + iny + // if(TILES_TYPE[tile_left]==PILL) + // [976] if(TILES_TYPE[level_show::tile_left#0]!=PILL) goto level_show::@5 -- pbuc1_derefidx_vbuxx_neq_vbuc2_then_la1 + lda TILES_TYPE,x + cmp #PILL + bne __b5 + // level_show::@7 + // count++; + // [977] level_show::count#1 = ++ level_show::count#10 -- vwuz1=_inc_vwuz1 + inc.z count + bne !+ + inc.z count+1 + !: + // [978] phi from level_show::@3 level_show::@7 to level_show::@5 [phi:level_show::@3/level_show::@7->level_show::@5] + // [978] phi level_show::count#5 = level_show::count#10 [phi:level_show::@3/level_show::@7->level_show::@5#0] -- register_copy + // level_show::@5 + __b5: + // tile_right = level[xtile++] + // [979] level_show::tile_right#0 = level_show::level#8[level_show::xtile#1] -- vbuz1=pbuz2_derefidx_vbuyy + lda (level),y + sta.z tile_right + // [980] level_show::xtile#2 = ++ level_show::xtile#1 -- vbuz1=_inc_vbuyy + iny + sty.z xtile + // if(TILES_TYPE[tile_right]==PILL) + // [981] if(TILES_TYPE[level_show::tile_right#0]!=PILL) goto level_show::@6 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + lda #PILL + ldy.z tile_right + cmp TILES_TYPE,y + bne __b6 + // level_show::@8 + // count++; + // [982] level_show::count#2 = ++ level_show::count#5 -- vwuz1=_inc_vwuz1 + inc.z count + bne !+ + inc.z count+1 + !: + // [983] phi from level_show::@5 level_show::@8 to level_show::@6 [phi:level_show::@5/level_show::@8->level_show::@6] + // [983] phi level_show::count#11 = level_show::count#5 [phi:level_show::@5/level_show::@8->level_show::@6#0] -- register_copy + // level_show::@6 + __b6: + // render_tiles(xcol, ytile, tile_left, tile_right) + // [984] render_tiles::xcol#0 = level_show::xcol#2 + // [985] render_tiles::ytile#0 = level_show::ytile#2 + // [986] render_tiles::tile_left#0 = level_show::tile_left#0 + // [987] render_tiles::tile_right#0 = level_show::tile_right#0 -- vbuyy=vbuz1 + ldy.z tile_right + // [988] call render_tiles + jsr render_tiles + // level_show::@9 + // for(char xcol=0, xtile=0; xcol<25; xcol++) + // [989] level_show::xcol#1 = ++ level_show::xcol#2 -- vbuz1=_inc_vbuz1 + inc.z xcol + // [970] phi from level_show::@9 to level_show::@2 [phi:level_show::@9->level_show::@2] + // [970] phi level_show::count#10 = level_show::count#11 [phi:level_show::@9->level_show::@2#0] -- register_copy + // [970] phi level_show::xtile#3 = level_show::xtile#2 [phi:level_show::@9->level_show::@2#1] -- register_copy + // [970] phi level_show::xcol#2 = level_show::xcol#1 [phi:level_show::@9->level_show::@2#2] -- register_copy + jmp __b2 +} + // pacman_sound_init +// Sound effects for pacman +pacman_sound_init: { + // SID->VOLUME_FILTER_MODE = 0x0f + // [990] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) = $f -- _deref_pbuc1=vbuc2 + // Set master volume + lda #$f + sta SID+OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE + // SID->CH1_FREQ = 0 + // [991] *((word*)SID) = 0 -- _deref_pwuc1=vbuc2 + // Channel 1 is Pacman eating sound + lda #0 + sta SID+1 + sta SID + // SID->CH1_PULSE_WIDTH = 0 + // [992] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH) = 0 -- _deref_pwuc1=vbuc2 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH+1 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH + // SID->CH1_CONTROL = 0 + // [993] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL) = 0 -- _deref_pbuc1=vbuc2 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL + // SID->CH1_ATTACK_DECAY = 0 + // [994] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY) = 0 -- _deref_pbuc1=vbuc2 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY + // SID->CH1_SUSTAIN_RELEASE = 0xf0 + // [995] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE) = $f0 -- _deref_pbuc1=vbuc2 + lda #$f0 + sta SID+OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE + // pacman_sound_init::@return + // } + // [996] return + rts +} + // render +// Render graphic pixels into the 9 all-border sprites +// - xcol: x column (0-24). The x-column represents 8 bits of data, 4 mc pixels, 16 on-screen pixels (due to x-expanded sprites) +// - ypos: y position (0-145). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. +// - pixels: The pixel data to set +// render(byte zp(5) xcol, byte zp(6) ypos, byte zp(8) pixels) +render: { + .label render_index_xcol = $61 + .label canvas_offset = $b + .label canvas1 = 9 + .label canvas2 = $b + .label ypix = $60 + .label xcol = 5 + .label ypos = 6 + .label pixels = 8 + // ytile = ypos/4 + // [998] render::ytile#0 = render::ypos#2 >> 2 -- vbuyy=vbuz1_ror_2 + lda.z ypos + lsr + lsr + tay + // (>RENDER_INDEX) + xcol + // [999] render::$1 = >RENDER_INDEX + render::xcol#2 -- vbuxx=vbuc1_plus_vbuz1 + lax.z xcol + axs #-[>RENDER_INDEX] + // ytile*2 + // [1000] render::$2 = render::ytile#0 << 1 -- vbuaa=vbuyy_rol_1 + tya + asl + // render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 } + // [1001] render::render_index_xcol#0 = render::$1 w= render::$2 -- vwuz1=vbuxx_word_vbuaa + stx.z render_index_xcol+1 + sta.z render_index_xcol + // canvas_offset = { render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] } + // [1002] render::canvas_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render::render_index_xcol#0) -- vwuz1=pbuz2_derefidx_vbuc1_word__deref_pbuz2 + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // canvas1 = SPRITES_1 + canvas_offset + // [1003] render::canvas1#0 = SPRITES_1 + render::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz2 + clc + adc #SPRITES_1 + sta.z canvas1+1 + // canvas2 = SPRITES_2 + canvas_offset + // [1004] render::canvas2#0 = SPRITES_2 + render::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC] + // [1005] render::ypos_inc_offset#0 = ((byte*)render::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] -- vbuxx=pbuz1_derefidx_vbuc1 + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + // ypix = ypos&3 + // [1006] render::ypix#0 = render::ypos#2 & 3 -- vbuz1=vbuz2_band_vbuc1 + lda #3 + and.z ypos + sta.z ypix + // [1007] phi from render to render::@1 [phi:render->render::@1] + // [1007] phi render::canvas2#2 = render::canvas2#0 [phi:render->render::@1#0] -- register_copy + // [1007] phi render::ypos_inc_offset#2 = render::ypos_inc_offset#0 [phi:render->render::@1#1] -- register_copy + // [1007] phi render::canvas1#2 = render::canvas1#0 [phi:render->render::@1#2] -- register_copy + // [1007] phi render::i#2 = 0 [phi:render->render::@1#3] -- vbuyy=vbuc1 + ldy #0 + // render::@1 + __b1: + // for(char i=0;irender::@1] + // [1007] phi render::canvas2#2 = render::canvas2#1 [phi:render::@2->render::@1#0] -- register_copy + // [1007] phi render::ypos_inc_offset#2 = render::ypos_inc_offset#1 [phi:render::@2->render::@1#1] -- register_copy + // [1007] phi render::canvas1#2 = render::canvas1#1 [phi:render::@2->render::@1#2] -- register_copy + // [1007] phi render::i#2 = render::i#1 [phi:render::@2->render::@1#3] -- register_copy + jmp __b1 +} + // level_tile_get +// Get the level tile at a given (xtile, ytile) position +// Returns the TILE ID +// If xtile of ytile is outside the legal range the empty tile (0) is returned +// level_tile_get(byte register(X) xtile, byte register(A) ytile) +level_tile_get: { + .label ytiles = $61 + // if(xtile>49 || ytile>36) + // [1017] if(level_tile_get::xtile#4>=$31+1) goto level_tile_get::@return -- vbuxx_ge_vbuc1_then_la1 + cpx #$31+1 + bcs __b1 + // level_tile_get::@2 + // [1018] if(level_tile_get::ytile#4>=$24+1) goto level_tile_get::@return -- vbuaa_ge_vbuc1_then_la1 + cmp #$24+1 + bcs __b1 + // level_tile_get::@1 + // LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile] + // [1019] level_tile_get::$5 = level_tile_get::ytile#4 << 1 -- vbuaa=vbuaa_rol_1 + asl + // ytiles = LEVEL_TILES + LEVEL_YTILE_OFFSET[ytile] + // [1020] level_tile_get::ytiles#0 = LEVEL_TILES + LEVEL_YTILE_OFFSET[level_tile_get::$5] -- pbuz1=pbuc1_plus_pwuc2_derefidx_vbuaa + tay + clc + lda #LEVEL_TILES + adc LEVEL_YTILE_OFFSET+1,y + sta.z ytiles+1 + // return ytiles[xtile]; + // [1021] level_tile_get::return#0 = level_tile_get::ytiles#0[level_tile_get::xtile#4] -- vbuaa=pbuz1_derefidx_vbuxx + txa + tay + lda (ytiles),y + // [1022] phi from level_tile_get::@1 to level_tile_get::@return [phi:level_tile_get::@1->level_tile_get::@return] + // [1022] phi level_tile_get::return#2 = level_tile_get::return#0 [phi:level_tile_get::@1->level_tile_get::@return#0] -- register_copy + rts + // [1022] phi from level_tile_get level_tile_get::@2 to level_tile_get::@return [phi:level_tile_get/level_tile_get::@2->level_tile_get::@return] + __b1: + // [1022] phi level_tile_get::return#2 = 0 [phi:level_tile_get/level_tile_get::@2->level_tile_get::@return#0] -- vbuaa=vbuc1 + lda #0 + // level_tile_get::@return + // } + // [1023] return + rts +} + // render_tiles +// Renders 2x1 tiles on the canvas. +// Tiles are 4x4 px. This renders 8px x 4px. +// - xcol: The x column position (0-24) (a column is 8 pixels) +// - ytile: The y tile position (0-37). Tile y position 0 is a special half-tile at the top of the screen. +// - tile_left: The left tile ID. +// - tile_right: The right tile ID. +// render_tiles(byte zp(7) xcol, byte zp(6) ytile, byte register(X) tile_left, byte register(Y) tile_right) +render_tiles: { + .label tile_left_pixels = $61 + .label tile_right_pixels = $63 + .label render_index_xcol = $65 + .label canvas_offset = $5e + .label canvas1 = $59 + .label canvas2 = $5e + .label y = $60 + .label xcol = 7 + .label ytile = 6 + // tile_left*4 + // [1024] render_tiles::$0 = render_tiles::tile_left#0 << 2 -- vbuaa=vbuxx_rol_2 + txa + asl + asl + // tile_left_pixels = TILES_LEFT + tile_left*4 + // [1025] render_tiles::tile_left_pixels#0 = TILES_LEFT + render_tiles::$0 -- pbuz1=pbuc1_plus_vbuaa + clc + adc #TILES_LEFT + adc #0 + sta.z tile_left_pixels+1 + // tile_right*4 + // [1026] render_tiles::$2 = render_tiles::tile_right#0 << 2 -- vbuaa=vbuyy_rol_2 + tya + asl + asl + // tile_right_pixels = TILES_RIGHT + tile_right*4 + // [1027] render_tiles::tile_right_pixels#0 = TILES_RIGHT + render_tiles::$2 -- pbuz1=pbuc1_plus_vbuaa + clc + adc #TILES_RIGHT + adc #0 + sta.z tile_right_pixels+1 + // (>RENDER_INDEX) + xcol + // [1028] render_tiles::$4 = >RENDER_INDEX + render_tiles::xcol#0 -- vbuxx=vbuc1_plus_vbuz1 + lax.z xcol + axs #-[>RENDER_INDEX] + // ytile*2 + // [1029] render_tiles::$5 = render_tiles::ytile#0 << 1 -- vbuaa=vbuz1_rol_1 + lda.z ytile + asl + // render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 } + // [1030] render_tiles::render_index_xcol#0 = render_tiles::$4 w= render_tiles::$5 -- vwuz1=vbuxx_word_vbuaa + stx.z render_index_xcol+1 + sta.z render_index_xcol + // canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] } + // [1031] render_tiles::canvas_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_CANVAS_HI] w= *((byte*)render_tiles::render_index_xcol#0) -- vwuz1=pbuz2_derefidx_vbuc1_word__deref_pbuz2 + ldy #RENDER_OFFSET_CANVAS_HI + lda (render_index_xcol),y + sta.z canvas_offset+1 + ldy #0 + lda (render_index_xcol),y + sta.z canvas_offset + // canvas1 = SPRITES_1 + canvas_offset + // [1032] render_tiles::canvas1#0 = SPRITES_1 + render_tiles::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz2 + clc + adc #SPRITES_1 + sta.z canvas1+1 + // canvas2 = SPRITES_2 + canvas_offset + // [1033] render_tiles::canvas2#0 = SPRITES_2 + render_tiles::canvas_offset#0 -- pbuz1=pbuc1_plus_vwuz1 + clc + lda.z canvas2 + adc #SPRITES_2 + sta.z canvas2+1 + // ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC] + // [1034] render_tiles::ypos_inc_offset#0 = ((byte*)render_tiles::render_index_xcol#0)[RENDER_OFFSET_YPOS_INC] -- vbuxx=pbuz1_derefidx_vbuc1 + ldy #RENDER_OFFSET_YPOS_INC + lda (render_index_xcol),y + tax + // [1035] phi from render_tiles to render_tiles::@1 [phi:render_tiles->render_tiles::@1] + // [1035] phi render_tiles::ypos_inc_offset#2 = render_tiles::ypos_inc_offset#0 [phi:render_tiles->render_tiles::@1#0] -- register_copy + // [1035] phi render_tiles::canvas2#2 = render_tiles::canvas2#0 [phi:render_tiles->render_tiles::@1#1] -- register_copy + // [1035] phi render_tiles::canvas1#2 = render_tiles::canvas1#0 [phi:render_tiles->render_tiles::@1#2] -- register_copy + // [1035] phi render_tiles::y#2 = 0 [phi:render_tiles->render_tiles::@1#3] -- vbuz1=vbuc1 + lda #0 + sta.z y + // render_tiles::@1 + __b1: + // for(char y=0;y<4;y++) + // [1036] if(render_tiles::y#2<4) goto render_tiles::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z y + cmp #4 + bcc __b2 + // render_tiles::@return + // } + // [1037] return + rts + // render_tiles::@2 + __b2: + // pixels = tile_left_pixels[y] | tile_right_pixels[y] + // [1038] render_tiles::pixels#0 = render_tiles::tile_left_pixels#0[render_tiles::y#2] | render_tiles::tile_right_pixels#0[render_tiles::y#2] -- vbuaa=pbuz1_derefidx_vbuz2_bor_pbuz3_derefidx_vbuz2 + ldy.z y + lda (tile_left_pixels),y + ora (tile_right_pixels),y + // *canvas1 = pixels + // [1039] *render_tiles::canvas1#2 = render_tiles::pixels#0 -- _deref_pbuz1=vbuaa + ldy #0 + sta (canvas1),y + // *canvas2 = pixels + // [1040] *render_tiles::canvas2#2 = render_tiles::pixels#0 -- _deref_pbuz1=vbuaa + sta (canvas2),y + // canvas1 += RENDER_YPOS_INC[ypos_inc_offset] + // [1041] render_tiles::canvas1#1 = render_tiles::canvas1#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] -- pbuz1=pbuz1_plus_pbuc1_derefidx_vbuxx + lda RENDER_YPOS_INC,x + clc + adc.z canvas1 + sta.z canvas1 + bcc !+ + inc.z canvas1+1 + !: + // canvas2 += RENDER_YPOS_INC[ypos_inc_offset] + // [1042] render_tiles::canvas2#1 = render_tiles::canvas2#2 + RENDER_YPOS_INC[render_tiles::ypos_inc_offset#2] -- pbuz1=pbuz1_plus_pbuc1_derefidx_vbuxx + lda RENDER_YPOS_INC,x + clc + adc.z canvas2 + sta.z canvas2 + bcc !+ + inc.z canvas2+1 + !: + // ypos_inc_offset++; + // [1043] render_tiles::ypos_inc_offset#1 = ++ render_tiles::ypos_inc_offset#2 -- vbuxx=_inc_vbuxx + inx + // for(char y=0;y<4;y++) + // [1044] render_tiles::y#1 = ++ render_tiles::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // [1035] phi from render_tiles::@2 to render_tiles::@1 [phi:render_tiles::@2->render_tiles::@1] + // [1035] phi render_tiles::ypos_inc_offset#2 = render_tiles::ypos_inc_offset#1 [phi:render_tiles::@2->render_tiles::@1#0] -- register_copy + // [1035] phi render_tiles::canvas2#2 = render_tiles::canvas2#1 [phi:render_tiles::@2->render_tiles::@1#1] -- register_copy + // [1035] phi render_tiles::canvas1#2 = render_tiles::canvas1#1 [phi:render_tiles::@2->render_tiles::@1#2] -- register_copy + // [1035] phi render_tiles::y#2 = render_tiles::y#1 [phi:render_tiles::@2->render_tiles::@1#3] -- register_copy + jmp __b1 +} + // File Data +.segment Data + // The byteboozer decruncher +BYTEBOOZER: +.const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + + // Pacman eating sound + PACMAN_CH1_FREQ_HI: .byte $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 + PACMAN_CH1_CONTROL: .byte $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 + // Address of the first pixel each x column + RENDER_XCOLS: .word 0, 1, 2, $400, $401, $402, $800, $801, $802, $c00, $c01, $c02, $1000, $1001, $1002, $1400, $1401, $1402, $1800, $1801, $1802, $1c00, $1c01, $1c02, 0, 0 + // Offset for each y-position from the first pixel of an X column + RENDER_YPOS: .word 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, $40+3, $40+9, $40+$f, $40+$15, $40+$1b, $40+$21, $40+$27, $40+$2d, $40+$33, $40+$39, $80, $80+6, $80+$c, $80+$12, $80+$18, $80+$1e, $80+$24, $80+$2a, $80+$30, $80+$36, $80+$3c, $c0+3, $c0+9, $c0+$f, $c0+$15, $c0+$1b, $c0+$21, $c0+$27, $c0+$2d, $c0+$33, $c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39 + // Offset for each y-position from the first pixel of an X column in sprite#9 + RENDER_YPOS_9TH: .word 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, $40+6, $40+$c, $40+$12, $40+$18, $40+$1e, $40+$24, $40+$2a, $40+$30, $40+$36, $40+$3c, $80+3, $80+9, $80+$f, $80+$15, $80+$1b, $80+$21, $80+$27, $80+$2d, $80+$33, $80+$39, $c0, $c0+6, $c0+$c, $c0+$12, $c0+$18, $c0+$1e, $c0+$24, $c0+$2a, $c0+$30, $c0+$36, $c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c + // Increment for each y-position from the first pixel of an X column + .align $20 + RENDER_YPOS_INC: .byte 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 + // The BOB x column position (0-24) (a column is 8 pixels) + bobs_xcol: .byte $a, $a, $a, $a, $a + // The BOB y fine position (0-99). The y-position is a line on the screen. Since every second line is black each ypos represents a 2 pixel distance. + bobs_yfine: .byte $2d, $2d, $2d, $2d, $2d + // The BOB ID in the BOB data tables + bobs_bob_id: .byte 0, 0, 0, 0, 0 + // The BOB restore data: 18 bytes per BOB. Doubled for double-buffering. + // char * left_canvas; + // char left_ypos_inc_offset; + // char * right_canvas; + // char right_ypos_inc_offset; + // char[12] restore_pixels; + .align $100 + bobs_restore: .fill NUM_BOBS*SIZE_BOB_RESTORE*2, 0 +.segment Init + // The level represented as 4x4 px tiles. Each byte is the ID of a tile from the tile set. + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 50 tile IDs. +LEVEL_TILES_CRUNCHED: +.modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + + // BOB data: One table per bob byte (left/right, mask/pixels = 4 tables). The index into the table is the bob_id + row*BOB_ROW_SIZE. +BOB_GRAPHICS_CRUNCHED: +.modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + + // Splash screen 25 xcol * 147 ypos bytes +SPLASH_CRUNCHED: +.modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + + // Victory graphics 25 xcol * 25 ypos bytes +WIN_GFX_CRUNCHED: +.modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + + // Game Over graphics 25 xcol * 25 ypos bytes +GAMEOVER_GFX_CRUNCHED: +.modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + + // Renders the BOBs at the given positions + // The bob logic code will be merged with raster code using code-merger.c + // First restores the canvas from previously rendered bobs, and then renders the bobs at the given positions. + // BOBs are 16px*6px graphics (2 x-columns * 6px) with masks and pixels + // Uses the bobs_xcol, bobs_yfine, bobs_bob_id and bob_restore for data about the bobs + // Implemented in inline kick assembler +LOGIC_CODE_CRUNCHED: +.macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + + // Raster-code for displaying 9 sprites on the entire screen - with open side borders + // The uncrunched code will be merged with logic code using code-merger.c + // The unmerged raster-code is identical for both buffers! +RASTER_CODE_CRUNCHED: +.macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + + // SID tune + // Pacmania Shaun Southern https://csdb.dk/sid/?id=53795 + // Relocated using ./sidreloc-1.0/sidreloc -p30 c64src/borderline/Pacmania.sid c64src/borderline/Pacmania_3000.sid +INTRO_MUSIC_CRUNCHED: +.modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + +.segment Data + // Offset of the LEVEL_TILE data within the LEVEL_TILE data (each row is 64 bytes of data) + LEVEL_YTILE_OFFSET: .word 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 + // Used to choose a single direction when presented with multiple potential directions. + // Used to eliminate diagonal joy directions and convert them to a single direction + // Priority: (4)up, (8)down, (16)left, (32)right + .align $40 + DIRECTION_SINGLE: .byte 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 + // Used to eliminate a single direction (the one that the ghost came from) + // The value DIRECTION_ELIMINATE[current_direction] is ANDed onto the open directions to remove the current direction + .align $40 + DIRECTION_ELIMINATE: .byte $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef + // Used to reverse direction direction (when a ghost changes between chase and scatter) + .align $40 + DIRECTION_REVERSE: .byte 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 + // The animation frames for pacman. The index into this is DIRECTION + anim_frame_idx. + .align $40 + pacman_frames: .byte 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c + // The animation frames for ghost. The index into thos is DIRECTION + anim_frame_idx. + .align $80 + ghost_frames: .byte 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 + // Lookup the absolute value of a signed number + // PRE_ and POST_ are used to ensure lookup of ABS-1,y works for y=0 and ABS+1,y works for y=0xff + .align $100 + ABS_PRE: .byte 1 +ABS: +.for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + + ABS_POST: .byte 0 + diff --git a/src/test/ref/complex/borderline_pacman/pacman.sym b/src/test/ref/complex/borderline_pacman/pacman.sym new file mode 100644 index 000000000..fdab3f9bf --- /dev/null +++ b/src/test/ref/complex/borderline_pacman/pacman.sym @@ -0,0 +1,1741 @@ +const byte* ABS[$100] = kickasm {{ .for(var i=0;i<$100;i++) { + .var x = (i<$80)?i:($100-i); + .byte abs(x) + } + }} +const byte* ABS_POST[1] = { 0 } +const byte* ABS_PRE[1] = { 1 } +const nomodify byte* BANK_1 = (byte*) 16384 +const nomodify byte* BANK_2 = (byte*) 49152 +const nomodify byte BLACK = 0 +const nomodify byte BLUE = 6 +const byte* BOB_GRAPHICS_CRUNCHED[] = kickasm( uses BOB_MASK_LEFT) {{ .modify B2() { + .pc = BOB_MASK_LEFT "BOB GRAPHICS TABLES" + .var bobs_pic = LoadPicture("pacman-bobs.png", List().add($000000, $352879, $bfce72, $883932)) + // TABLE char BOB_MASK_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(0,48+scroll*6+row) + } + // TABLE char BOB_MASK_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,24+scroll*6+row) + .for(var blue=0; blue<8;blue++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(1,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_LEFT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(2+ghost*2,48+scroll*6+row) + } + // TABLE char BOB_PIXEL_RIGT[BOB_ROW_SIZE*6] + .for(var row=0; row<6;row++) { + .align BOB_ROW_SIZE + .for(var pac=0; pac<9;pac++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+pac*2,scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,24+scroll*6+row) + .for(var ghost=0; ghost<8;ghost++) + .for(var scroll=0; scroll<4;scroll++) + .byte bobs_pic.getMulticolorByte(3+ghost*2,48+scroll*6+row) + } + } + }} +const nomodify byte* BOB_MASK_LEFT = (byte*) 21504 +const nomodify byte* BOB_MASK_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*6 +const nomodify byte* BOB_PIXEL_LEFT = BOB_MASK_LEFT+BOB_ROW_SIZE*$c +const nomodify byte* BOB_PIXEL_RIGT = BOB_MASK_LEFT+BOB_ROW_SIZE*$12 +const nomodify byte BOB_ROW_SIZE = $80 +const nomodify byte* BORDER_COLOR = (byte*) 53280 +const byte* BYTEBOOZER[] = kickasm {{ .const B2_ZP_BASE = $fc + #import "byteboozer_decrunch.asm" + }} +const byte CHASE = 0 +const nomodify struct MOS6526_CIA* CIA1 = (struct MOS6526_CIA*) 56320 +const nomodify byte* CIA1_INTERRUPT = (byte*) 56333 +const nomodify struct MOS6526_CIA* CIA2 = (struct MOS6526_CIA*) 56576 +const nomodify byte CIA_INTERRUPT_CLEAR = $7f +const byte DIRECTION::DOWN = 8 +const byte DIRECTION::LEFT = $10 +const byte DIRECTION::RIGHT = $20 +const byte DIRECTION::STOP = 0 +const byte DIRECTION::UP = 4 +const byte* DIRECTION_ELIMINATE[$21] = { $ff, 0, 0, 0, $f7, 0, 0, 0, $fb, 0, 0, 0, 0, 0, 0, 0, $df, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $ef } +const byte* DIRECTION_REVERSE[$21] = { 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, $20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, $10 } +const byte* DIRECTION_SINGLE[$40] = { 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $20, $20, $20, $20, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4, $10, $10, $10, $10, 4, 4, 4, 4, 8, 8, 8, 8, 4, 4, 4, 4 } +const byte DOWN = 8 +const byte EMPTY = 0 +const byte FRIGHTENED = 2 +const nomodify byte* GAMEOVER_GFX = (byte*) 42752 +const byte* GAMEOVER_GFX_CRUNCHED[] = kickasm( uses GAMEOVER_GFX) {{ .modify B2() { + .pc = GAMEOVER_GFX "GAMEOVER GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_gameover = LoadPicture("pacman-gameover.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_gameover.getMulticolorByte(xcol,ypos) + } + } + } + }} +const byte GHOSTS_MODE::CHASE = 0 +const byte GHOSTS_MODE::FRIGHTENED = 2 +const byte GHOSTS_MODE::SCATTER = 1 +const nomodify void()** HARDWARE_IRQ = (void()**) 65534 +const nomodify byte* INTRO_MUSIC = (byte*) 12288 +const byte* INTRO_MUSIC_CRUNCHED[] = kickasm( uses INTRO_MUSIC) {{ .modify B2() { + .pc = INTRO_MUSIC "INTRO MUSIC" + .const music = LoadBinary("pacman-2chn-simpler.prg", BF_C64FILE) + .fill music.getSize(), music.get(i) + } + }} +const nomodify word INTRO_MUSIC_CRUNCHED_SIZE = $600 +const nomodify byte* INTRO_MUSIC_CRUNCHED_UPPER = (byte*) 42752 +const nomodify byte IRQ_RASTER = 1 +const nomodify byte IRQ_SCREEN_TOP_LINE = 5 +const nomodify byte* IRQ_STATUS = (byte*) 53273 +const byte LEFT = $10 +const nomodify byte* LEVEL_TILES = (byte*) 18432 +const byte* LEVEL_TILES_CRUNCHED[] = kickasm( uses LEVEL_TILES) {{ .modify B2() { + .pc = LEVEL_TILES "LEVEL TILE GRAPHICS" + .var pic_level = LoadPicture("pacman-tiled.png", List().add($000000, $352879, $bfce72, $883932)) + // Maps the tile pixels (a 16 bit number) to the tile ID + .var TILESET = Hashtable() + // Maps the tile ID to the pixels (a 16 bit number) + .var TILESET_BY_ID = Hashtable() + // Tile ID 0 is empty + .eval TILESET.put(0, 0) + .eval TILESET_BY_ID.put(0, 0) + + .align $100 + // TABLE LEVEL_TILES[64*37] + // The level is 50 tiles * 37 tiles. The first tile line are special half-tiles (where only the last 2 pixel rows are shown). + // The level data is organized as 37 rows of 64 bytes containing tile IDs. (the last 14 are unused to achieve 64-byte alignment) + .for(var ytile=0; ytile<37; ytile++) { + .for(var xtile=0; xtile<50; xtile++) { + // Find the tile pixels (4x4 px - 16 bits) + .var pixels = 0; + .for(var i=0; i<4; i++) { + .var pix = pic_level.getMulticolorByte(xtile/2,ytile*4+i) + .if((xtile&1)==0) { + // left nibble + .eval pix = floor(pix / $10) + } else { + // right nibble + .eval pix = pix & $0f + } + .eval pixels = pixels*$10 + pix + } + .var tile_id = 0 + .if(TILESET.containsKey(pixels)) { + .eval tile_id = TILESET.get(pixels) + } else { + .eval tile_id = TILESET.keys().size() + .eval TILESET.put(pixels, tile_id) + .eval TILESET_BY_ID.put(tile_id, pixels) +// .print "tile "+tile_id+" : "+toHexString(pixels,4) + } + // Output the tile ID + .byte tile_id + } + .fill 14, 0 + } + + .align $100 + // TABLE char TILES_LEFT[0x80] + // The left tile graphics. A tile is 4x4 px. The left tiles contain tile graphics for the 4 left bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix<<4 + .eval pixels = pixels << 4 + } + } + + .align $80 + // TABLE char TILES_RIGHT[0x80] + // The right tile graphics. A tile is 4x4 px. The right tiles contain tile graphics for the 4 right bits of a char. Each tile is 4 bytes. + .for(var tile_id=0;tile_id> 12 + .byte pix + .eval pixels = pixels << 4 + } + } + .align $80 + // TABLE char TILES_TYPE[0x20] + // 0: empty (all black), 1:pill, 2:powerup, 4: wall (contains blue pixels) + .for(var tile_id=0;tile_id> 12 + // Detect wall - any blue pixels (%01) + .if( (pix&%0100)==%0100) .eval tile_type = 4; // 4:wall + .if( (pix&%0001)==%0001) .eval tile_type = 4; // 4:wall + .eval pixels = pixels << 4 + } + .byte tile_type + //.print "tile "+tile_id+" gfx "+toHexString(TILESET_BY_ID.get(tile_id),4) + " type "+tile_type + } + + } + }} +const nomodify byte* LEVEL_TILES_DIRECTIONS = (byte*) 15872 +const word* LEVEL_YTILE_OFFSET[$25] = { 0, $40, $80, $c0, $100, $140, $180, $1c0, $200, $240, $280, $2c0, $300, $340, $380, $3c0, $400, $440, $480, $4c0, $500, $540, $580, $5c0, $600, $640, $680, $6c0, $700, $740, $780, $7c0, $800, $840, $880, $8c0, $900 } +const byte* LOGIC_CODE_CRUNCHED[] = kickasm( uses bobs_xcol uses bobs_yfine uses bobs_bob_id uses bobs_restore uses RENDER_INDEX uses RENDER_OFFSET_CANVAS_LO uses RENDER_OFFSET_CANVAS_HI uses RENDER_OFFSET_YPOS_INC uses SIZE_BOB_RESTORE uses BOB_ROW_SIZE uses NUM_BOBS uses left_render_index_xcol uses left_canvas uses left_ypos_inc_offset uses rigt_render_index_xcol uses rigt_canvas uses rigt_ypos_inc_offset uses BOB_MASK_LEFT uses BOB_PIXEL_LEFT uses BOB_MASK_RIGT uses BOB_PIXEL_RIGT uses canvas_base_hi uses bobs_restore_base uses RENDER_YPOS_INC uses logic_tile_ptr uses logic_tile_xcol uses logic_tile_yfine uses logic_tile_left_idx uses logic_tile_right_idx) {{ .macro LOGIC_BEGIN(cycles) { + .byte cycles + } + .macro LOGIC_END() { + .byte $ff + } + .modify B2() { + .pc = LOGIC_CODE_UNMERGED "LOGIC CODE UNMERGED" + LOGIC_BEGIN(2) + clc + LOGIC_END() + + // ****************************************** + // Restores the canvas under the rendered bobs + // ****************************************** + + .for(var bob=NUM_BOBS-1;bob>=0; bob--) { + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // char * volatile left_canvas = *((char**)&bob_restore[0]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+0,x + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+1,x + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = bob_restore[2]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+2,x + sta.z left_ypos_inc_offset + LOGIC_END() + // char * volatile rigt_canvas = *((char**)&bob_restore[3]); + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+3,x + sta.z rigt_canvas + LOGIC_END() + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+4,x + sta.z rigt_canvas+1 + LOGIC_END() + // char rigt_ypos_inc_offset = bob_restore[5]; + LOGIC_BEGIN(7) + lda bobs_restore+SIZE_BOB_RESTORE*bob+5,x + sta.z rigt_ypos_inc_offset + LOGIC_END() + + // Restore Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + // *left_canvas = bob_restore[6] ; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + sta (left_canvas),y + LOGIC_END() + // *rigt_canvas = bob_restore[7]; + LOGIC_BEGIN(10) + lda bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + sta (rigt_canvas),y + LOGIC_END() + } + } + + // ****************************************** + // Render two tiles on the canvas + // ****************************************** + + // y==0 from bob restore + LOGIC_BEGIN(12) + // char tile_left_idx = 4 * logic_tile_ptr[0]; + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_left_idx + LOGIC_END() + // char logic_tile_right_idx = 4 * logic_tile_ptr[1]; + LOGIC_BEGIN(2) + iny + LOGIC_END() + LOGIC_BEGIN(12) + lda (logic_tile_ptr),y + asl + asl + sta logic_tile_right_idx + LOGIC_END() + // char * render_index_xcol = (char*){ (>RENDER_INDEX) + xcol, ytile*2 }; + LOGIC_BEGIN(8) + lda #>RENDER_INDEX + adc logic_tile_xcol + sta.z left_render_index_xcol+1 + LOGIC_END() + LOGIC_BEGIN(6) + lda logic_tile_yfine + sta.z left_render_index_xcol + LOGIC_END() + + // unsigned int canvas_offset = {render_index_xcol[RENDER_OFFSET_CANVAS_HI], render_index_xcol[RENDER_OFFSET_CANVAS_LO] }; + // char * left_canvas = canvas_base_hi*$100 + canvas_offset; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_canvas + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(11) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + LOGIC_END() + // char left_ypos_inc_offset = render_index_xcol[RENDER_OFFSET_YPOS_INC]; + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(8) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + LOGIC_END() + + // Render Tile Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<4;row++) { + + // *left_canvas = tile_left_pixels[y] | tile_right_pixels[y]; + LOGIC_BEGIN(3) + ldx logic_tile_left_idx + LOGIC_END() + LOGIC_BEGIN(17) + lda TILES_LEFT+row,x + ldx logic_tile_right_idx + ora TILES_RIGHT+row,x + sta (left_canvas),y + LOGIC_END() + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + } + + // ****************************************** + // Renders the BOBs at the given positions + // ****************************************** + + .for(var bob=0;bobRENDER_INDEX) + xcol, yfine }; + // char * rigt_render_index_xcol = (char*){ (>RENDER_INDEX) + xcol+1, yfine }; + + //LOGIC_BEGIN(6) + //inc $d021 + //LOGIC_END() + + LOGIC_BEGIN(14) + lda #>RENDER_INDEX + adc bobs_xcol+bob + sta.z left_render_index_xcol+1 + adc #1 + sta.z rigt_render_index_xcol+1 + LOGIC_END() + + LOGIC_BEGIN(10) + lda bobs_yfine+bob + sta.z left_render_index_xcol + sta.z rigt_render_index_xcol + LOGIC_END() + + // char * left_canvas = (char*){ left_render_index_xcol[85], left_render_index_xcol[0] }; + // bob_restore[0] = left_canvas; + // char * rigt_canvas = (char*){ rigt_render_index_xcol[85], rigt_render_index_xcol[0] }; + // bob_restore[3] = rigt_canvas; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_LO + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+0,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_canvas + sta bobs_restore+SIZE_BOB_RESTORE*bob+3,x + LOGIC_END() + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_CANVAS_HI + LOGIC_END() + LOGIC_BEGIN(16) + lda (left_render_index_xcol),y + adc canvas_base_hi + sta.z left_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+1,x + LOGIC_END() + LOGIC_BEGIN(16) + lda (rigt_render_index_xcol),y + adc canvas_base_hi + sta.z rigt_canvas+1 + sta bobs_restore+SIZE_BOB_RESTORE*bob+4,x + LOGIC_END() + + // char left_ypos_inc_offset = left_render_index_xcol[170]; + // bob_restore[2] = left_ypos_inc_offset; + // char rigt_ypos_inc_offset = rigt_render_index_xcol[170]; + // bob_restore[5] = rigt_ypos_inc_offset; + + LOGIC_BEGIN(2) + ldy #RENDER_OFFSET_YPOS_INC + LOGIC_END() + LOGIC_BEGIN(13) + lda (left_render_index_xcol),y + sta.z left_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+2,x + LOGIC_END() + LOGIC_BEGIN(13) + lda (rigt_render_index_xcol),y + sta.z rigt_ypos_inc_offset + sta bobs_restore+SIZE_BOB_RESTORE*bob+5,x + LOGIC_END() + + // Render Bob Rows + LOGIC_BEGIN(2) + ldy #0 + LOGIC_END() + .for(var row=0;row<6;row++) { + + //left_canvas += RENDER_YPOS_INC[left_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z left_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z left_canvas + sta.z left_canvas + lda.z left_canvas+1 + adc #0 + sta.z left_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z left_ypos_inc_offset + LOGIC_END() + //rigt_canvas += RENDER_YPOS_INC[rigt_ypos_inc_offset++]; + LOGIC_BEGIN(3) + ldx.z rigt_ypos_inc_offset + LOGIC_END() + LOGIC_BEGIN(18) + lda RENDER_YPOS_INC,x + adc.z rigt_canvas + sta.z rigt_canvas + lda.z rigt_canvas+1 + adc #0 + sta.z rigt_canvas+1 + LOGIC_END() + LOGIC_BEGIN(5) + inc.z rigt_ypos_inc_offset + LOGIC_END() + + // bob_restore[6] = *left_canvas; + // *left_canvas = *left_canvas & BOB_MASK_LEFT_0[bob_id] | BOB_PIXEL_LEFT_0[bob_id]; + LOGIC_BEGIN(3) + ldx bobs_restore_base + LOGIC_END() + LOGIC_BEGIN(10) + lda (left_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+6+row,x + LOGIC_END() + LOGIC_BEGIN(10) + lda (rigt_canvas),y + sta bobs_restore+SIZE_BOB_RESTORE*bob+12+row,x + LOGIC_END() + + LOGIC_BEGIN(4) + ldx bobs_bob_id+bob + LOGIC_END() + LOGIC_BEGIN(19) + lda (left_canvas),y + and BOB_MASK_LEFT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_LEFT+row*BOB_ROW_SIZE,x + sta (left_canvas),y + LOGIC_END() + // bob_restore[7] = *rigt_canvas; + // *rigt_canvas = *rigt_canvas & BOB_MASK_RIGT_0[bob_id] | BOB_PIXEL_RIGT_0[bob_id]; + LOGIC_BEGIN(19) + lda (rigt_canvas),y + and BOB_MASK_RIGT+row*BOB_ROW_SIZE,x + ora BOB_PIXEL_RIGT+row*BOB_ROW_SIZE,x + sta (rigt_canvas),y + LOGIC_END() + } + } + //LOGIC_BEGIN(6) + //lda #0 + //sta $d021 + //LOGIC_END() + + LOGIC_BEGIN(0) // end of logic code + } + }} +const nomodify byte* LOGIC_CODE_UNMERGED = (byte*) 57344 +const nomodify byte NUM_BOBS = 5 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 +const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d +const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 +const byte OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21 +const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11 +const byte OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16 +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a +const byte OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19 +const byte OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18 +const byte OFFSET_STRUCT_MOS6569_VICII_RASTER = $12 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_COLOR = $27 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE0_Y = 1 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_COLOR = $28 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE1_Y = 3 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE2_Y = 5 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE3_Y = 7 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE4_Y = 9 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE5_Y = $b +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE6_Y = $d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITE7_Y = $f +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_EXPAND_X = $1d +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MC = $1c +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR1 = $25 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_MCOLOR2 = $26 +const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_ATTACK_DECAY = 5 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_CONTROL = 4 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_PULSE_WIDTH = 2 +const byte OFFSET_STRUCT_MOS6581_SID_CH1_SUSTAIN_RELEASE = 6 +const byte OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18 +const byte* PACMAN_CH1_CONTROL[] = { $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0, $21, $21, $21, $21, $21, $21, 0, 0, 0, 0, 0 } +const byte* PACMAN_CH1_FREQ_HI[] = { $23, $1d, $1a, $17, $15, $12, 0, 0, 0, 0, 0, $19, $1a, $1c, $1d, $20, $23, 0, 0, 0, 0, 0 } +const byte PILL = 1 +const byte POWERUP = 2 +const nomodify byte* PROCPORT = (byte*) 1 +const nomodify byte* PROCPORT_DDR = (byte*) 0 +const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 +const nomodify byte PROCPORT_RAM_ALL = 0 +const nomodify byte PROCPORT_RAM_IO = 5 +const nomodify byte* RASTER = (byte*) 53266 +const nomodify byte* RASTER_CODE = (byte*) 32768 +const byte* RASTER_CODE_CRUNCHED[] = kickasm( uses VICII_CONTROL2 uses BORDER_COLOR uses RASTER_CODE_UNMERGED uses side_sprites_color uses side_sprites_mc uses bottom_sprites_color uses bottom_sprites_mc) {{ .macro RASTER_CYCLES(cycles) { + .byte $ff, cycles + } + .modify B2() { + .pc = RASTER_CODE_UNMERGED "RASTER CODE UNMERGED" + RASTER_CYCLES(29) + // Line 7 cycle 44 + // Raster Line + .var raster_line = 7 + // Line in the sprite + .var sprite_line = 20 + // Current sprite ypos + .var sprite_ypos = 7 + // Current sprite screen (graphics bank not important since sprite layout in the banks is identical) + .var sprite_screen = SCREENS_1 + .var available_cycles = 0; + .for(var i=0;i<293;i++) { + // Line cycle count + .var line_cycles = 46 + .if(raster_line>=70 && raster_line<238) { + // Only 2 sprites on these lines - so more cycles available + .eval line_cycles = 58 + } + // Create 9th sprite by moving sprite 0 + .if(mod(raster_line,2)==0) { + lda #$6f + sta $d000 + } else { + lda #$e7 + sta $d000 + } + .eval line_cycles -= 6; + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + .eval line_cycles -= 12; + .eval raster_line++ + .eval sprite_line++ + .if(sprite_line==21) { + .eval sprite_line = 0 + .eval sprite_ypos += 21 + } + // Set sprite single-color mode on splash + .if(raster_line==53) { + lda side_sprites_mc + sta $d01c + lda side_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + } + // Set sprite multi-color mode on splash + .if(raster_line==248) { + lda bottom_sprites_mc + sta $d01c + lda bottom_sprites_color + sta $d027 + sta $d028 + .eval line_cycles -= 18 + //.print "raster:"+raster_line+" multi-color" + } + // Open top border + .if(raster_line==55) { + lda #VICII_RSEL|VICII_ECM|VICII_BMM|7 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" top border rsel=1" + } + // Open bottom border + .if(raster_line==250) { + lda #VICII_ECM|VICII_BMM|7 // DEN=0, RSEL=0 + sta VICII_CONTROL1 + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" bottom border rsel=0" + } + // Move sprites down + .if(sprite_line>=2 && sprite_line<=9) { + .if(sprite_ypos<300) { + .var sprite_id = sprite_line-2 + .if(sprite_id==0 || sprite_id==1 || sprite_ypos<=55 || sprite_ypos>=(246-21)) { + lda #sprite_ypos + sta SPRITES_YPOS+2*sprite_id + .eval line_cycles -= 6; + //.print "raster:"+raster_line+" sprite:"+sprite_id+" ypos:"+sprite_ypos + } + } + } + // Change sprite data + .if(sprite_line==20) { + .eval sprite_screen += $400 + lda #sprite_screen/$40 + sta VICII_MEMORY + .eval line_cycles -= 6 + //.print "raster:"+raster_line+" sprite data $"+toHexString(sprite_screen) + } + // Spend the rest of the cycles on NOPS + .if(line_cycles<0 || line_cycles==1) .error "Too many cycles spent on line "+raster_line + .if(line_cycles>0) { + //.print "raster:"+raster_line+" cycles $"+toHexString(line_cycles) + RASTER_CYCLES(line_cycles) + .eval line_cycles -= line_cycles + .eval available_cycles += line_cycles + } + } + //.print "Available cycles: "+available_cycles + + lda #$6f + sta $d000 + lda #$8 + // Cycle 50. LSR abs is a 6 cycle RWM instruction. + lsr VICII_CONTROL2 + sta VICII_CONTROL2 + RASTER_CYCLES(00) // End of raster code + } + }} +const nomodify byte* RASTER_CODE_UNMERGED = (byte*) 24576 +const nomodify byte RED = 2 +const nomodify byte* RENDER_INDEX = (byte*) 46592 +const nomodify byte RENDER_OFFSET_CANVAS_HI = $50 +const nomodify byte RENDER_OFFSET_CANVAS_LO = 0 +const nomodify byte RENDER_OFFSET_YPOS_INC = $a0 +const byte** RENDER_XCOLS[$1a] = { (byte*) 0, (byte*) 1, (byte*) 2, (byte*) 1024, (byte*) 1025, (byte*) 1026, (byte*) 2048, (byte*) 2049, (byte*) 2050, (byte*) 3072, (byte*) 3073, (byte*) 3074, (byte*) 4096, (byte*) 4097, (byte*) 4098, (byte*) 5120, (byte*) 5121, (byte*) 5122, (byte*) 6144, (byte*) 6145, (byte*) 6146, (byte*) 7168, (byte*) 7169, (byte*) 7170, (byte*) 0, (byte*) 0 } +const word* RENDER_YPOS[$95] = { 0, 0, 0, 6, $c, $12, $18, $1e, $24, $2a, $30, $36, $3c, (word)$40+3, (word)$40+9, (word)$40+$f, (word)$40+$15, (word)$40+$1b, (word)$40+$21, (word)$40+$27, (word)$40+$2d, (word)$40+$33, (word)$40+$39, $80, (word)$80+6, (word)$80+$c, (word)$80+$12, (word)$80+$18, (word)$80+$1e, (word)$80+$24, (word)$80+$2a, (word)$80+$30, (word)$80+$36, (word)$80+$3c, (word)$c0+3, (word)$c0+9, (word)$c0+$f, (word)$c0+$15, (word)$c0+$1b, (word)$c0+$21, (word)$c0+$27, (word)$c0+$2d, (word)$c0+$33, (word)$c0+$39, $100, $100+6, $100+$c, $100+$12, $100+$18, $100+$1e, $100+$24, $100+$2a, $100+$30, $100+$36, $100+$3c, $140+3, $140+9, $140+$f, $140+$15, $140+$1b, $140+$21, $140+$27, $140+$2d, $140+$33, $140+$39, $180, $180+6, $180+$c, $180+$12, $180+$18, $180+$1e, $180+$24, $180+$2a, $180+$30, $180+$36, $180+$3c, $1c0+3, $1c0+9, $1c0+$f, $1c0+$15, $1c0+$1b, $1c0+$21, $1c0+$27, $1c0+$2d, $1c0+$33, $1c0+$39, $200, $200+6, $200+$c, $200+$12, $200+$18, $200+$1e, $200+$24, $200+$2a, $200+$30, $200+$36, $200+$3c, $240+3, $240+9, $240+$f, $240+$15, $240+$1b, $240+$21, $240+$27, $240+$2d, $240+$33, $240+$39, $280, $280+6, $280+$c, $280+$12, $280+$18, $280+$1e, $280+$24, $280+$2a, $280+$30, $280+$36, $280+$3c, $2c0+3, $2c0+9, $2c0+$f, $2c0+$15, $2c0+$1b, $2c0+$21, $2c0+$27, $2c0+$2d, $2c0+$33, $2c0+$39, $300, $300+6, $300+$c, $300+$12, $300+$18, $300+$1e, $300+$24, $300+$2a, $300+$30, $300+$36, $300+$3c, $340+3, $340+9, $340+$f, $340+$15, $340+$1b, $340+$21, $340+$27, $340+$2d, $340+$33, $340+$39 } +const word* RENDER_YPOS_9TH[$95] = { 3, 3, 3, 9, $f, $15, $1b, $21, $27, $2d, $33, $39, $40, (word)$40+6, (word)$40+$c, (word)$40+$12, (word)$40+$18, (word)$40+$1e, (word)$40+$24, (word)$40+$2a, (word)$40+$30, (word)$40+$36, (word)$40+$3c, (word)$80+3, (word)$80+9, (word)$80+$f, (word)$80+$15, (word)$80+$1b, (word)$80+$21, (word)$80+$27, (word)$80+$2d, (word)$80+$33, (word)$80+$39, $c0, (word)$c0+6, (word)$c0+$c, (word)$c0+$12, (word)$c0+$18, (word)$c0+$1e, (word)$c0+$24, (word)$c0+$2a, (word)$c0+$30, (word)$c0+$36, (word)$c0+$3c, $100+3, $100+9, $100+$f, $100+$15, $100+$1b, $100+$21, $100+$27, $100+$2d, $100+$33, $100+$39, $140, $140+6, $140+$c, $140+$12, $140+$18, $140+$1e, $140+$24, $140+$2a, $140+$30, $140+$36, $140+$3c, $180+3, $180+9, $180+$f, $180+$15, $180+$1b, $180+$21, $180+$27, $180+$2d, $180+$33, $180+$39, $1c0, $1c0+6, $1c0+$c, $1c0+$12, $1c0+$18, $1c0+$1e, $1c0+$24, $1c0+$2a, $1c0+$30, $1c0+$36, $1c0+$3c, $200+3, $200+9, $200+$f, $200+$15, $200+$1b, $200+$21, $200+$27, $200+$2d, $200+$33, $200+$39, $240, $240+6, $240+$c, $240+$12, $240+$18, $240+$1e, $240+$24, $240+$2a, $240+$30, $240+$36, $240+$3c, $280+3, $280+9, $280+$f, $280+$15, $280+$1b, $280+$21, $280+$27, $280+$2d, $280+$33, $280+$39, $2c0, $2c0+6, $2c0+$c, $2c0+$12, $2c0+$18, $2c0+$1e, $2c0+$24, $2c0+$2a, $2c0+$30, $2c0+$36, $2c0+$3c, $300+3, $300+9, $300+$f, $300+$15, $300+$1b, $300+$21, $300+$27, $300+$2d, $300+$33, $300+$39, $340, $340+6, $340+$c, $340+$12, $340+$18, $340+$1e, $340+$24, $340+$2a, $340+$30, $340+$36, $340+$3c } +const byte* RENDER_YPOS_INC[$a0] = { 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7 } +const byte RIGHT = $20 +const byte SCATTER = 1 +const nomodify byte* SCREENS_1 = (byte*) 16384 +const nomodify byte* SCREENS_2 = (byte*) 49152 +const nomodify struct MOS6581_SID* SID = (struct MOS6581_SID*) 54272 +const nomodify byte* SID_CH1_FREQ_HI = (byte*) 54273 +const byte SIZEOF_BYTE = 1 +const nomodify byte SIZE_BOB_RESTORE = $12 +const nomodify byte* SPLASH = (byte*) 16384 +const byte* SPLASH_CRUNCHED[] = kickasm( uses SPLASH) {{ .modify B2() { + .pc = SPLASH "SPLASH SCREEN" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_splash_mc = LoadPicture("pacman-splash.png", List().add($000000, $352879, $bfce72, $883932)) + // 0:BLACK, 1:YELLOW + .var pic_splash_yellow = LoadPicture("pacman-splash.png", List().add($000000, $bfce72)) + // 0:BLACK, 1:BLUE + .var pic_splash_blue = LoadPicture("pacman-splash.png", List().add($000000, $352879)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<147; ypos++) { + .if(ypos>25 && ypos<123) { + // Sprites in the sides are in single color blue on splash screen + .byte pic_splash_blue.getSinglecolorByte(xcol,ypos) + } else .if(xcol>2 && xcol<21) { + // Sprites 2-7 are in single color yellow on splash screen + .byte pic_splash_yellow.getSinglecolorByte(xcol,ypos) + } else { + // Sprites 0&1 are in multi color on splash screen + .byte pic_splash_mc.getMulticolorByte(xcol,ypos) + } + } + } + } + }} +const nomodify byte* SPRITES_1 = (byte*) 24576 +const nomodify byte* SPRITES_2 = (byte*) 57344 +const nomodify byte* SPRITES_COLOR = (byte*) 53287 +const nomodify byte* SPRITES_XPOS = (byte*) 53248 +const nomodify byte* SPRITES_YPOS = (byte*) 53249 +const byte STOP = 0 +const nomodify byte* TILES_LEFT = LEVEL_TILES+$a00 +const nomodify byte* TILES_RIGHT = LEVEL_TILES+$a80 +const nomodify byte* TILES_TYPE = LEVEL_TILES+$b00 +const byte TILE_TYPE::EMPTY = 0 +const byte TILE_TYPE::PILL = 1 +const byte TILE_TYPE::POWERUP = 2 +const byte TILE_TYPE::WALL = 4 +const byte UP = 4 +const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 +const nomodify byte VICII_BMM = $20 +const nomodify byte* VICII_CONTROL1 = (byte*) 53265 +const nomodify byte* VICII_CONTROL2 = (byte*) 53270 +const nomodify byte VICII_DEN = $10 +const nomodify byte VICII_ECM = $40 +const nomodify byte* VICII_MEMORY = (byte*) 53272 +const nomodify byte VICII_RSEL = 8 +const nomodify byte VICII_RST8 = $80 +const byte WALL = 4 +const nomodify byte* WIN_GFX = (byte*) 42752 +const byte* WIN_GFX_CRUNCHED[] = kickasm( uses WIN_GFX) {{ .modify B2() { + .pc = WIN_GFX "WIN GRAPHICS" // 00:BLACK, 01:BLUE, 10:YELLOW, 11:RED + .var pic_win = LoadPicture("pacman-win.png", List().add($000000, $352879, $bfce72, $883932)) + .for(var xcol=0; xcol<25; xcol++) { + .for(var ypos=0; ypos<25; ypos++) { + .byte pic_win.getMulticolorByte(xcol,ypos) + } + } + } + }} +const nomodify byte YELLOW = 7 +void __start() +volatile byte anim_frame_idx loadstore zp[1]:46 0.9019607843137255 +const byte* bobs_bob_id[NUM_BOBS] = { 0, 0, 0, 0, 0 } +const byte* bobs_restore[NUM_BOBS*SIZE_BOB_RESTORE*2] = { fill( NUM_BOBS*SIZE_BOB_RESTORE*2, 0) } +volatile byte bobs_restore_base loadstore zp[1]:32 1070.0 +const byte* bobs_xcol[NUM_BOBS] = { $a, $a, $a, $a, $a } +const byte* bobs_yfine[NUM_BOBS] = { $2d, $2d, $2d, $2d, $2d } +volatile byte bottom_sprites_color loadstore zp[1]:37 11040.0 +volatile byte bottom_sprites_mc loadstore zp[1]:38 11040.0 +void byteboozer_decrunch(volatile byte* byteboozer_decrunch::crunched) +volatile byte* byteboozer_decrunch::crunched loadstore zp[2]:87 438.5 +volatile byte canvas_base_hi loadstore zp[1]:31 1070.0 +byte choose_direction(byte choose_direction::open_directions , byte choose_direction::ghost_xtile , byte choose_direction::ghost_ytile , byte choose_direction::target_xtile , byte choose_direction::target_ytile) +byte~ choose_direction::$2 reg byte a 202.0 +byte~ choose_direction::$4 reg byte a 202.0 +byte~ choose_direction::$6 reg byte a 202.0 +byte~ choose_direction::$8 reg byte a 202.0 +byte choose_direction::direction +byte choose_direction::direction#10 direction zp[1]:83 28.857142857142858 +byte choose_direction::direction#6 direction zp[1]:83 67.33333333333333 +byte choose_direction::direction#8 direction zp[1]:83 57.714285714285715 +byte choose_direction::dist_down +byte choose_direction::dist_down#0 reg byte x 151.5 +byte choose_direction::dist_left +byte choose_direction::dist_left#0 dist_left zp[1]:80 151.5 +byte choose_direction::dist_min +byte choose_direction::dist_min#10 reg byte x 121.2 +byte choose_direction::dist_min#11 dist_min zp[1]:80 101.0 +byte choose_direction::dist_min#13 reg byte x 202.0 +byte choose_direction::dist_min#14 reg byte x 202.0 +byte choose_direction::dist_min#17 dist_min zp[1]:80 202.0 +byte choose_direction::dist_min#18 dist_min zp[1]:80 202.0 +byte choose_direction::dist_min#6 reg byte y 80.8 +byte choose_direction::dist_right +byte choose_direction::dist_right#0 reg byte a 202.0 +byte choose_direction::dist_up +byte choose_direction::dist_up#0 reg byte y 101.0 +byte choose_direction::ghost_xtile +byte choose_direction::ghost_xtile#0 reg byte y 5.5 +byte choose_direction::ghost_xtile#1 reg byte y 5.5 +byte choose_direction::ghost_xtile#2 reg byte y 5.5 +byte choose_direction::ghost_xtile#3 reg byte y 5.5 +byte choose_direction::ghost_xtile#4 reg byte y 145.0 +byte choose_direction::ghost_ytile +byte choose_direction::ghost_ytile#0 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#1 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#2 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#3 ghost_ytile zp[1]:4 7.333333333333333 +byte choose_direction::ghost_ytile#4 ghost_ytile zp[1]:4 72.5 +byte choose_direction::open_directions +byte choose_direction::open_directions#0 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#1 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#10 open_directions zp[1]:79 19.478260869565215 +byte choose_direction::open_directions#2 open_directions zp[1]:79 4.4 +byte choose_direction::open_directions#3 open_directions zp[1]:79 4.4 +byte choose_direction::return +byte choose_direction::return#0 reg byte a 22.0 +byte choose_direction::return#1 reg byte a 22.0 +byte choose_direction::return#10 return zp[1]:83 41.0 +byte choose_direction::return#2 reg byte a 22.0 +byte choose_direction::return#3 reg byte a 22.0 +byte choose_direction::target_xtile +byte choose_direction::target_xtile#0 reg byte x 11.0 +byte choose_direction::target_xtile#1 reg byte x 11.0 +byte choose_direction::target_xtile#2 reg byte x 11.0 +byte choose_direction::target_xtile#3 reg byte x 11.0 +byte choose_direction::target_xtile#4 reg byte x 145.0 +byte choose_direction::target_ytile +byte choose_direction::target_ytile#0 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#1 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#2 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#3 target_ytile zp[1]:3 22.0 +byte choose_direction::target_ytile#4 target_ytile zp[1]:3 72.5 +byte choose_direction::xdiff +byte choose_direction::xdiff#0 xdiff zp[1]:93 21.041666666666664 +byte choose_direction::ydiff +byte choose_direction::ydiff#0 ydiff zp[1]:4 21.956521739130434 +void done_run() +byte~ done_run::$8 reg byte a 2000002.0 +byte* done_run::gfx +byte* done_run::gfx#1 gfx zp[2]:89 333333.6666666667 +byte* done_run::gfx#2 gfx zp[2]:89 800001.25 +byte* done_run::gfx#4 gfx zp[2]:89 100001.0 +byte done_run::i +byte done_run::i#1 reg byte x 200002.0 +byte done_run::i#2 reg byte x 133334.66666666666 +byte done_run::i1 +byte done_run::i1#1 reg byte x 200002.0 +byte done_run::i1#2 reg byte x 120001.2 +byte done_run::pixels +byte done_run::pixels#0 reg byte x 500000.5 +byte done_run::xcol +byte done_run::xcol#1 xcol zp[1]:5 200002.0 +byte done_run::xcol#2 xcol zp[1]:5 118182.18181818182 +byte done_run::ypos +byte done_run::ypos#1 ypos zp[1]:6 2000002.0 +byte done_run::ypos#2 ypos zp[1]:6 500000.5 +volatile byte frame loadstore zp[1]:45 0.5 +void game_logic() +byte~ game_logic::$119 reg byte a 22.0 +byte~ game_logic::$14 reg byte x 22.0 +byte~ game_logic::$140 reg byte a 22.0 +byte~ game_logic::$15 reg byte a 22.0 +byte~ game_logic::$161 reg byte a 22.0 +byte~ game_logic::$17 reg byte a 22.0 +byte~ game_logic::$18 reg byte x 22.0 +byte~ game_logic::$182 reg byte a 22.0 +byte~ game_logic::$19 reg byte x 11.0 +byte~ game_logic::$199 reg byte a 22.0 +byte~ game_logic::$2 reg byte x 22.0 +byte~ game_logic::$20 reg byte a 22.0 +byte~ game_logic::$200 reg byte a 22.0 +byte~ game_logic::$204 reg byte a 22.0 +byte~ game_logic::$21 reg byte a 22.0 +byte~ game_logic::$210 zp[1]:80 2.588235294117647 +byte~ game_logic::$220 reg byte x 11.0 +byte~ game_logic::$223 reg byte x 11.0 +byte~ game_logic::$226 reg byte x 11.0 +byte~ game_logic::$229 reg byte x 11.0 +byte~ game_logic::$232 reg byte x 11.0 +byte~ game_logic::$25 reg byte a 22.0 +byte~ game_logic::$26 reg byte x 22.0 +byte~ game_logic::$27 reg byte x 11.0 +byte~ game_logic::$28 reg byte a 22.0 +byte~ game_logic::$29 reg byte a 22.0 +byte~ game_logic::$3 reg byte a 22.0 +byte~ game_logic::$31 reg byte a 22.0 +byte~ game_logic::$32 reg byte x 22.0 +byte~ game_logic::$33 reg byte x 11.0 +byte~ game_logic::$34 reg byte a 22.0 +byte~ game_logic::$35 reg byte a 22.0 +byte~ game_logic::$37 reg byte a 22.0 +byte~ game_logic::$38 reg byte x 22.0 +byte~ game_logic::$39 reg byte x 11.0 +byte~ game_logic::$40 reg byte a 22.0 +byte~ game_logic::$41 reg byte a 22.0 +byte~ game_logic::$43 reg byte a 22.0 +byte~ game_logic::$44 reg byte x 22.0 +byte~ game_logic::$45 reg byte x 11.0 +byte~ game_logic::$46 reg byte a 22.0 +byte~ game_logic::$47 reg byte a 22.0 +byte~ game_logic::$65 reg byte a 22.0 +byte~ game_logic::$66 reg byte a 22.0 +byte*~ game_logic::$67 zp[2]:81 22.0 +byte~ game_logic::$68 reg byte a 22.0 +byte~ game_logic::$69 reg byte a 22.0 +byte~ game_logic::$70 reg byte a 22.0 +byte*~ game_logic::$71 zp[2]:81 22.0 +byte~ game_logic::$72 reg byte a 22.0 +byte~ game_logic::$75 reg byte x 11.0 +byte~ game_logic::$77 reg byte y 11.0 +byte~ game_logic::$80 reg byte x 11.0 +byte~ game_logic::$82 reg byte y 11.0 +byte~ game_logic::$85 reg byte x 11.0 +byte~ game_logic::$87 reg byte y 11.0 +byte~ game_logic::$90 reg byte x 11.0 +byte~ game_logic::$92 reg byte y 11.0 +byte game_logic::do_reverse +byte game_logic::do_reverse#4 reg byte a 11.0 +byte game_logic::ghost1_bob_xfine +byte game_logic::ghost1_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost1_xtile +byte game_logic::ghost1_xtile#0 ghost1_xtile zp[1]:86 2.357142857142857 +byte game_logic::ghost1_ytile +byte game_logic::ghost1_ytile#0 ghost1_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost2_bob_xfine +byte game_logic::ghost2_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost2_xtile +byte game_logic::ghost2_xtile#0 ghost2_xtile zp[1]:85 2.357142857142857 +byte game_logic::ghost2_ytile +byte game_logic::ghost2_ytile#0 ghost2_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost3_bob_xfine +byte game_logic::ghost3_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost3_xtile +byte game_logic::ghost3_xtile#0 ghost3_xtile zp[1]:84 2.357142857142857 +byte game_logic::ghost3_ytile +byte game_logic::ghost3_ytile#0 ghost3_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost4_bob_xfine +byte game_logic::ghost4_bob_xfine#0 reg byte y 5.5 +byte game_logic::ghost4_xtile +byte game_logic::ghost4_xtile#0 ghost4_xtile zp[1]:83 2.357142857142857 +byte game_logic::ghost4_ytile +byte game_logic::ghost4_ytile#0 ghost4_ytile zp[1]:4 2.357142857142857 +byte game_logic::ghost_frame_idx +byte game_logic::ghost_frame_idx#0 ghost_frame_idx zp[1]:2 16.5 +byte game_logic::ghost_frame_idx#1 ghost_frame_idx zp[1]:2 22.0 +byte game_logic::ghost_frame_idx#2 ghost_frame_idx zp[1]:2 1.9999999999999998 +byte game_logic::joy_directions +byte game_logic::joy_directions#0 reg byte a 16.5 +byte game_logic::new_direction +byte game_logic::new_direction#0 reg byte a 16.5 +byte game_logic::open_directions +byte game_logic::open_directions#0 reg byte a 22.0 +byte game_logic::open_directions#1 reg byte y 5.5 +byte game_logic::open_directions1 +byte game_logic::open_directions1#0 reg byte a 22.0 +byte game_logic::open_directions1#1 reg byte y 5.5 +byte game_logic::open_directions2 +byte game_logic::open_directions2#0 reg byte a 22.0 +byte game_logic::open_directions2#1 reg byte y 5.5 +byte game_logic::open_directions3 +byte game_logic::open_directions3#0 reg byte a 22.0 +byte game_logic::open_directions3#1 reg byte y 5.5 +byte game_logic::open_directions4 +byte game_logic::open_directions4#0 reg byte x 3.666666666666667 +byte game_logic::pacman_bob_xfine +byte game_logic::pacman_bob_xfine#0 reg byte y 5.5 +byte game_logic::pacman_xtile +byte game_logic::pacman_xtile#0 pacman_xtile zp[1]:79 6.769230769230768 +byte game_logic::pacman_xtile1 +byte game_logic::pacman_xtile1#0 reg byte x 11.0 +byte game_logic::pacman_ytile +byte game_logic::pacman_ytile#0 reg byte a 22.0 +byte game_logic::pacman_ytile1 +byte game_logic::pacman_ytile1#0 reg byte a 11.0 +byte game_logic::target_xtile +byte game_logic::target_xtile#2 reg byte x 11.0 +byte game_logic::target_xtile#3 reg byte x 5.5 +byte game_logic::target_xtile1 +byte game_logic::target_xtile1#2 reg byte x 11.0 +byte game_logic::target_xtile1#3 reg byte x 5.5 +byte game_logic::target_xtile2 +byte game_logic::target_xtile2#2 reg byte x 11.0 +byte game_logic::target_xtile2#3 reg byte x 5.5 +byte game_logic::target_xtile3 +byte game_logic::target_xtile3#2 reg byte x 11.0 +byte game_logic::target_xtile3#3 reg byte x 5.5 +byte game_logic::target_ytile +byte game_logic::target_ytile#2 target_ytile zp[1]:3 22.0 +byte game_logic::target_ytile#3 target_ytile zp[1]:3 4.4 +byte game_logic::target_ytile1 +byte game_logic::target_ytile1#2 target_ytile1 zp[1]:3 22.0 +byte game_logic::target_ytile1#3 target_ytile1 zp[1]:3 4.4 +byte game_logic::target_ytile2 +byte game_logic::target_ytile2#2 target_ytile2 zp[1]:3 22.0 +byte game_logic::target_ytile2#3 target_ytile2 zp[1]:3 4.4 +byte game_logic::target_ytile3 +byte game_logic::target_ytile3#2 target_ytile3 zp[1]:3 22.0 +byte game_logic::target_ytile3#3 target_ytile3 zp[1]:3 4.4 +byte game_logic::tile_id +byte game_logic::tile_id#0 reg byte x 16.5 +byte* game_logic::ytiles +byte* game_logic::ytiles#0 ytiles zp[2]:81 5.5 +volatile byte game_logic_substep loadstore zp[1]:77 2.947368421052632 +volatile byte game_playable loadstore zp[1]:78 69.48275862068965 +void gameplay_run() +word~ gameplay_run::$4 zp[2]:11 2002.0 +byte gameplay_run::i +byte gameplay_run::i#1 reg byte x 200002.0 +byte gameplay_run::i#2 reg byte x 133334.66666666666 +byte gameplay_run::i1 +byte gameplay_run::i1#1 reg byte x 200002.0 +byte gameplay_run::i1#2 reg byte x 133334.66666666666 +byte gameplay_run::i2 +byte gameplay_run::i2#1 reg byte x 200002.0 +byte gameplay_run::i2#2 reg byte x 133334.66666666666 +volatile byte ghost1_direction loadstore zp[1]:55 122.24096385542168 +volatile byte ghost1_respawn loadstore zp[1]:58 271.8378378378378 +volatile byte ghost1_reverse loadstore zp[1]:57 0.7291666666666666 +volatile byte ghost1_substep loadstore zp[1]:56 223.51111111111112 +volatile byte ghost1_xfine loadstore zp[1]:53 84.55 +volatile byte ghost1_yfine loadstore zp[1]:54 82.13008130081302 +volatile byte ghost2_direction loadstore zp[1]:61 110.28260869565217 +volatile byte ghost2_respawn loadstore zp[1]:64 264.6842105263158 +volatile byte ghost2_reverse loadstore zp[1]:63 0.7142857142857143 +volatile byte ghost2_substep loadstore zp[1]:62 218.65217391304347 +volatile byte ghost2_xfine loadstore zp[1]:59 76.28571428571428 +volatile byte ghost2_yfine loadstore zp[1]:60 74.27941176470588 +volatile byte ghost3_direction loadstore zp[1]:67 100.45544554455446 +volatile byte ghost3_respawn loadstore zp[1]:70 257.8974358974359 +volatile byte ghost3_reverse loadstore zp[1]:69 0.7 +volatile byte ghost3_substep loadstore zp[1]:68 214.0 +volatile byte ghost3_xfine loadstore zp[1]:65 69.4931506849315 +volatile byte ghost3_yfine loadstore zp[1]:66 67.7986577181208 +volatile byte ghost4_direction loadstore zp[1]:73 92.23636363636363 +volatile byte ghost4_respawn loadstore zp[1]:76 251.45000000000002 +volatile byte ghost4_reverse loadstore zp[1]:75 0.6862745098039216 +volatile byte ghost4_substep loadstore zp[1]:74 209.54166666666666 +volatile byte ghost4_xfine loadstore zp[1]:71 63.81132075471698 +volatile byte ghost4_yfine loadstore zp[1]:72 62.358024691358025 +const byte* ghost_frames[] = { 0, 0, 0, 0, $3c, $40, $3c, $40, $34, $38, $34, $38, 0, 0, 0, 0, $2c, $30, $2c, $30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $24, $28, $24, $28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $5c, $60, $5c, $60, $54, $58, $54, $58, 0, 0, 0, 0, $4c, $50, $4c, $50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $44, $48, $44, $48 } +volatile byte ghosts_mode loadstore zp[1]:51 1.1044776119402984 +volatile byte ghosts_mode_count loadstore zp[1]:52 234.93023255813955 +void init_bobs_restore() +const byte* init_bobs_restore::CANVAS_HIDDEN = (byte*) 59904 +byte init_bobs_restore::bob +byte init_bobs_restore::bob#1 reg byte x 20002.0 +byte init_bobs_restore::bob#2 reg byte x 2727.5454545454545 +byte* init_bobs_restore::bob_restore +byte* init_bobs_restore::bob_restore#1 bob_restore zp[2]:11 10001.0 +byte* init_bobs_restore::bob_restore#5 bob_restore zp[2]:11 16000.7 +byte init_bobs_restore::i +byte init_bobs_restore::i#1 reg byte y 200002.0 +byte init_bobs_restore::i#2 reg byte y 133334.66666666666 +void init_level_tile_directions() +byte~ init_level_tile_directions::$11 reg byte a 2.0000002E7 +byte~ init_level_tile_directions::$15 reg byte a 2.0000002E7 +byte~ init_level_tile_directions::$3 reg byte x 2.0000002E7 +byte~ init_level_tile_directions::$7 reg byte x 2.0000002E7 +byte* init_level_tile_directions::directions +byte* init_level_tile_directions::directions#1 directions zp[2]:11 1000001.0 +byte* init_level_tile_directions::directions#7 directions zp[2]:11 315789.55263157893 +byte init_level_tile_directions::open_directions +byte init_level_tile_directions::open_directions#11 open_directions zp[1]:7 2857143.1428571427 +byte init_level_tile_directions::open_directions#12 open_directions zp[1]:7 5714286.285714285 +byte init_level_tile_directions::open_directions#13 open_directions zp[1]:7 5714286.285714285 +byte init_level_tile_directions::open_directions#2 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#3 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#4 open_directions zp[1]:7 2.0000002E7 +byte init_level_tile_directions::open_directions#8 open_directions zp[1]:7 3.0000003E7 +byte init_level_tile_directions::xtile +byte init_level_tile_directions::xtile#1 xtile zp[1]:6 2.0000002E7 +byte init_level_tile_directions::xtile#10 xtile zp[1]:6 2285714.514285714 +byte init_level_tile_directions::ytile +byte init_level_tile_directions::ytile#1 ytile zp[1]:5 2000002.0 +byte init_level_tile_directions::ytile#15 ytile zp[1]:5 1102564.282051282 +void init_render_index() +word~ init_render_index::$10 zp[2]:97 200002.0 +word~ init_render_index::$11 zp[2]:97 200002.0 +word*~ init_render_index::$12 zp[2]:97 200002.0 +byte~ init_render_index::$5 reg byte a 200002.0 +byte~ init_render_index::$6 reg byte a 200002.0 +byte~ init_render_index::$9 reg byte a 20002.0 +byte* init_render_index::canvas +byte* init_render_index::canvas#0 canvas zp[2]:97 100001.0 +byte* init_render_index::canvas_xcol +byte* init_render_index::canvas_xcol#0 canvas_xcol zp[2]:94 5789.578947368421 +byte* init_render_index::render_index +byte* init_render_index::render_index#1 render_index zp[2]:89 10001.0 +byte* init_render_index::render_index_xcol +byte* init_render_index::render_index_xcol#0 render_index_xcol zp[2]:89 1200.1200000000001 +byte* init_render_index::render_index_xcol#1 render_index_xcol_1 zp[2]:99 100001.0 +byte* init_render_index::render_index_xcol#2 render_index_xcol_1 zp[2]:99 34000.4 +byte* init_render_index::render_index_xcol#7 render_index_xcol_1 zp[2]:99 20002.0 +word* init_render_index::render_ypos_table +word* init_render_index::render_ypos_table#4 render_ypos_table zp[2]:11 4761.952380952381 +byte init_render_index::x_col +byte init_render_index::x_col#1 x_col zp[1]:5 20002.0 +byte init_render_index::x_col#2 x_col zp[1]:5 1923.2692307692307 +byte init_render_index::y_pos +byte init_render_index::y_pos#1 y_pos zp[1]:6 200002.0 +byte init_render_index::y_pos#2 y_pos zp[1]:6 18750.1875 +byte init_render_index::ypos_inc_offset +byte init_render_index::ypos_inc_offset#2 reg byte x 200002.0 +byte init_render_index::ypos_inc_offset#3 reg byte x 200002.0 +byte init_render_index::ypos_inc_offset#4 reg byte x 28182.181818181816 +byte init_render_index::ypos_inc_offset#7 reg byte x 2500.25 +byte init_render_index::ypos_inc_offset#8 reg byte x 100001.0 +void init_sprite_pointers() +byte~ init_sprite_pointers::$2 reg byte a 2.0000002E7 +const nomodify byte init_sprite_pointers::SPRITE_ID_0 = (byte)SPRITES_1&$3fff/$40 +byte init_sprite_pointers::screen +byte init_sprite_pointers::screen#1 reg byte x 2000002.0 +byte init_sprite_pointers::screen#2 reg byte x 1181818.5454545454 +byte init_sprite_pointers::sprite +byte init_sprite_pointers::sprite#1 reg byte y 2.0000002E7 +byte init_sprite_pointers::sprite#2 reg byte y 1.0000001E7 +byte init_sprite_pointers::sprite_id +byte init_sprite_pointers::sprite_id#0 reg byte a 1.50000015E7 +const byte* init_sprite_pointers::sprites_id[] = { 0, $70, $60, $50, $40, $30, $20, $10 } +byte* init_sprite_pointers::sprites_ptr_1 +byte* init_sprite_pointers::sprites_ptr_1#1 sprites_ptr_1 zp[2]:11 666667.3333333334 +byte* init_sprite_pointers::sprites_ptr_1#5 sprites_ptr_1 zp[2]:11 1333333.6666666667 +byte* init_sprite_pointers::sprites_ptr_2 +byte* init_sprite_pointers::sprites_ptr_2#1 sprites_ptr_2 zp[2]:9 1000001.0 +byte* init_sprite_pointers::sprites_ptr_2#5 sprites_ptr_2 zp[2]:9 1200000.3 +__interrupt(hardware_clobber) void irq_screen_top() +byte~ irq_screen_top::$1 reg byte a 4.0 +byte~ irq_screen_top::$2 reg byte a 4.0 +byte* irq_screen_top::toD0181_gfx +byte irq_screen_top::toD0181_return +const byte irq_screen_top::toD0181_return#0 toD0181_return = 0 +byte* irq_screen_top::toD0181_screen +byte* irq_screen_top::toDd001_gfx +byte irq_screen_top::toDd001_return +const byte irq_screen_top::toDd001_return#0 toDd001_return = 0 +byte* irq_screen_top::toDd002_gfx +byte irq_screen_top::toDd002_return +const byte irq_screen_top::toDd002_return#0 toDd002_return = 3^>(word)SCREENS_1/$40 +byte joyfire() +byte~ joyfire::$0 reg byte a 2.0000002E7 +byte joyfire::return +byte joyfire::return#0 reg byte a 2000002.0 +byte joyfire::return#1 reg byte a 20002.0 +byte joyfire::return#4 reg byte a 252500.5 +void joyinit() +volatile byte* left_canvas loadstore zp[2]:23 20.0 +volatile byte* left_render_index_xcol loadstore zp[2]:21 20.0 +volatile byte left_ypos_inc_offset loadstore zp[1]:25 20.0 +word level_show() +word level_show::count +word level_show::count#1 count zp[2]:11 2.0000002E7 +word level_show::count#10 count zp[2]:11 4571429.285714285 +word level_show::count#11 count zp[2]:11 4285714.714285715 +word level_show::count#12 count zp[2]:11 500250.75 +word level_show::count#2 count zp[2]:11 2.0000002E7 +word level_show::count#5 count zp[2]:11 1.0000001E7 +byte* level_show::level +byte* level_show::level#1 level zp[2]:9 1000001.0 +byte* level_show::level#8 level zp[2]:9 1100000.2 +word level_show::return +word level_show::return#0 return zp[2]:11 2002.0 +byte level_show::tile_left +byte level_show::tile_left#0 reg byte x 2500000.25 +byte level_show::tile_right +byte level_show::tile_right#0 tile_right zp[1]:96 3750000.375 +byte level_show::xcol +byte level_show::xcol#1 xcol zp[1]:7 2.0000002E7 +byte level_show::xcol#2 xcol zp[1]:7 2352941.411764706 +byte level_show::xtile +byte level_show::xtile#1 reg byte y 6000000.6 +byte level_show::xtile#2 xtile zp[1]:8 2000000.2 +byte level_show::xtile#3 xtile zp[1]:8 1.0000001E7 +byte level_show::ytile +byte level_show::ytile#1 ytile zp[1]:6 2000002.0 +byte level_show::ytile#2 ytile zp[1]:6 619047.8095238095 +byte level_tile_directions(byte level_tile_directions::xtile , byte level_tile_directions::ytile) +byte~ level_tile_directions::$5 reg byte a 202.0 +byte level_tile_directions::return +byte level_tile_directions::return#0 reg byte a 202.0 +byte level_tile_directions::return#10 reg byte a 22.0 +byte level_tile_directions::return#11 reg byte a 22.0 +byte level_tile_directions::return#12 reg byte a 22.0 +byte level_tile_directions::return#13 reg byte a 22.0 +byte level_tile_directions::return#2 reg byte a 22.285714285714285 +byte level_tile_directions::return#3 reg byte a 22.0 +byte level_tile_directions::xtile +byte level_tile_directions::xtile#0 reg byte x 11.0 +byte level_tile_directions::xtile#1 reg byte x 11.0 +byte level_tile_directions::xtile#2 reg byte x 11.0 +byte level_tile_directions::xtile#3 reg byte x 11.0 +byte level_tile_directions::xtile#4 reg byte x 11.0 +byte level_tile_directions::xtile#5 reg byte x 51.4 +byte level_tile_directions::ytile +byte level_tile_directions::ytile#0 reg byte a 22.0 +byte level_tile_directions::ytile#1 reg byte a 22.0 +byte level_tile_directions::ytile#2 reg byte a 22.0 +byte level_tile_directions::ytile#3 reg byte a 22.0 +byte level_tile_directions::ytile#4 reg byte a 22.0 +byte level_tile_directions::ytile#5 reg byte a 85.66666666666666 +byte* level_tile_directions::ytiles +byte* level_tile_directions::ytiles#0 ytiles zp[2]:91 202.0 +byte level_tile_get(byte level_tile_get::xtile , byte level_tile_get::ytile) +byte~ level_tile_get::$5 reg byte a 2.00000002E8 +byte level_tile_get::return +byte level_tile_get::return#0 reg byte a 2.00000002E8 +byte level_tile_get::return#10 reg byte a 2.0000002E7 +byte level_tile_get::return#11 reg byte a 2.0000002E7 +byte level_tile_get::return#2 reg byte a 2.3333334166666668E7 +byte level_tile_get::return#3 reg byte a 2.0000002E7 +byte level_tile_get::return#4 reg byte a 2.0000002E7 +byte level_tile_get::xtile +byte level_tile_get::xtile#0 reg byte x 1.0000001E7 +byte level_tile_get::xtile#1 reg byte x 1.0000001E7 +byte level_tile_get::xtile#2 reg byte x 2.0000002E7 +byte level_tile_get::xtile#3 reg byte x 2.0000002E7 +byte level_tile_get::xtile#4 reg byte x 4.80000012E7 +byte level_tile_get::ytile +byte level_tile_get::ytile#0 reg byte a 2.0000002E7 +byte level_tile_get::ytile#1 reg byte a 2.0000002E7 +byte level_tile_get::ytile#2 reg byte a 1.0000001E7 +byte level_tile_get::ytile#3 reg byte a 1.0000001E7 +byte level_tile_get::ytile#4 reg byte a 8.0000002E7 +byte* level_tile_get::ytiles +byte* level_tile_get::ytiles#0 ytiles zp[2]:97 2.00000002E8 +volatile byte logic_tile_left_idx loadstore zp[1]:19 20.0 +volatile to_volatile byte* logic_tile_ptr loadstore zp[2]:15 10250.0 +volatile byte logic_tile_right_idx loadstore zp[1]:20 20.0 +volatile byte logic_tile_xcol loadstore zp[1]:17 10250.0 +volatile byte logic_tile_yfine loadstore zp[1]:18 10250.0 +void main() +void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num) +void* memcpy::destination +const void* memcpy::destination#0 destination = (void*)INTRO_MUSIC_CRUNCHED_UPPER +byte* memcpy::dst +byte* memcpy::dst#1 dst zp[2]:11 10001.0 +byte* memcpy::dst#2 dst zp[2]:11 10001.0 +word memcpy::num +void* memcpy::return +void* memcpy::source +const void* memcpy::source#0 source = (void*)INTRO_MUSIC_CRUNCHED +byte* memcpy::src +byte* memcpy::src#1 src zp[2]:9 20002.0 +byte* memcpy::src#2 src zp[2]:9 10001.0 +byte* memcpy::src_end +const byte* memcpy::src_end#0 src_end = (byte*)memcpy::source#0+INTRO_MUSIC_CRUNCHED_SIZE +void* memset(void* memset::str , byte memset::c , word memset::num) +byte memset::c +byte* memset::dst +byte* memset::dst#1 dst zp[2]:99 20002.0 +byte* memset::dst#2 dst zp[2]:99 13668.333333333332 +byte* memset::dst#4 dst zp[2]:99 2002.0 +byte* memset::end +byte* memset::end#0 end zp[2]:89 1833.6666666666665 +word memset::num +word memset::num#5 num zp[2]:89 1001.0 +void* memset::return +void* memset::str +void* memset::str#6 str zp[2]:99 +void merge_code(byte* merge_code::dest_code , byte* merge_code::raster_code , byte* merge_code::logic_code) +byte~ merge_code::$5 reg byte y 100001.0 +const nomodify byte merge_code::LOGIC_END = $ff +const nomodify byte merge_code::LOGIC_EXIT = 0 +const nomodify byte merge_code::RASTER_END = $ff +const nomodify byte merge_code::RASTER_EXIT = 0 +byte merge_code::cycle_budget +byte merge_code::cycle_budget#0 reg byte x 10001.0 +byte merge_code::cycle_budget#1 reg byte x 200002.0 +byte merge_code::cycle_budget#10 reg byte x 88889.77777777777 +byte merge_code::cycle_budget#13 reg byte x 50714.857142857145 +byte merge_code::cycle_budget#2 reg byte x 200002.0 +byte merge_code::cycle_budget#3 reg byte x 200002.0 +byte* merge_code::dest_code +byte* merge_code::dest_code#0 dest_code zp[2]:11 10001.0 +byte* merge_code::dest_code#1 dest_code zp[2]:11 1000001.0 +byte* merge_code::dest_code#10 dest_code zp[2]:11 180001.80000000002 +byte* merge_code::dest_code#12 dest_code zp[2]:11 10334.666666666666 +byte* merge_code::dest_code#13 dest_code zp[2]:11 80001.25 +byte* merge_code::dest_code#14 dest_code zp[2]:11 21429.428571428572 +byte* merge_code::dest_code#15 dest_code zp[2]:11 640001.0 +byte* merge_code::dest_code#2 dest_code zp[2]:11 150001.5 +byte* merge_code::dest_code#21 dest_code zp[2]:11 51250.625 +byte* merge_code::dest_code#3 dest_code zp[2]:11 100001.0 +byte* merge_code::dest_code#4 dest_code zp[2]:11 100001.0 +byte* merge_code::dest_code#6 dest_code zp[2]:11 100001.0 +byte* merge_code::logic_code +byte* merge_code::logic_code#0 logic_code zp[2]:89 200002.0 +byte* merge_code::logic_code#1 logic_code zp[2]:89 2000002.0 +byte* merge_code::logic_code#10 logic_code zp[2]:89 1050001.5 +byte* merge_code::logic_code#12 logic_code zp[2]:89 20002.0 +byte* merge_code::logic_code#14 logic_code zp[2]:89 105001.5 +byte* merge_code::logic_code#17 logic_code zp[2]:89 22778.055555555555 +byte* merge_code::logic_code#18 logic_code zp[2]:89 15556.111111111113 +byte* merge_code::logic_code#2 logic_code zp[2]:89 100001.0 +byte* merge_code::logic_code#3 logic_code zp[2]:89 20002.0 +byte* merge_code::logic_code#4 logic_code zp[2]:89 200002.0 +byte* merge_code::logic_code#5 logic_code zp[2]:89 20002.0 +byte merge_code::logic_cycles +byte merge_code::logic_cycles#0 logic_cycles zp[1]:96 41667.08333333333 +byte* merge_code::raster_code +byte* merge_code::raster_code#0 raster_code zp[2]:99 20002.0 +byte* merge_code::raster_code#1 raster_code zp[2]:99 15001.5 +byte* merge_code::raster_code#2 raster_code zp[2]:99 3928.6428571428573 +byte* merge_code::raster_code#4 raster_code zp[2]:99 37501.5 +const nomodify void()* musicInit = (void()*)INTRO_MUSIC +const nomodify void()* musicPlay = (void()*)INTRO_MUSIC+6 +volatile byte music_play_next loadstore zp[1]:43 69506.875 +volatile byte pacman_ch1_enabled loadstore zp[1]:13 0.08254716981132076 +volatile byte pacman_ch1_idx loadstore zp[1]:14 1.9428571428571428 +volatile byte pacman_direction loadstore zp[1]:49 132.92105263157893 +const byte* pacman_frames[] = { 8, 8, 8, 8, 8, $18, $14, $18, 8, $20, $1c, $20, 0, 0, 0, 0, 8, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, $c, $10, $c } +volatile byte pacman_lives loadstore zp[1]:42 656.4415584415585 +void pacman_sound_init() +void pacman_sound_play() +volatile byte pacman_substep loadstore zp[1]:50 233.39534883720933 +volatile byte pacman_wins loadstore zp[1]:41 1545.6969696969697 +volatile byte pacman_xfine loadstore zp[1]:47 47.719626168224295 +volatile byte pacman_yfine loadstore zp[1]:48 46.21818181818182 +volatile byte phase loadstore zp[1]:44 78.03703703703704 +volatile word pill_count loadstore zp[2]:39 14.191780821917808 +void render(byte render::xcol , byte render::ypos , byte render::pixels) +byte~ render::$1 reg byte x 1.0000001E7 +byte~ render::$2 reg byte a 2.0000002E7 +byte* render::canvas1 +byte* render::canvas1#0 canvas1 zp[2]:9 5000000.5 +byte* render::canvas1#1 canvas1 zp[2]:9 5.00000000005E10 +byte* render::canvas1#2 canvas1 zp[2]:9 1.00010000002E11 +byte* render::canvas2 +byte* render::canvas2#0 canvas2 zp[2]:11 6666667.333333333 +byte* render::canvas2#1 canvas2 zp[2]:11 6.6666666667333336E10 +byte* render::canvas2#2 canvas2 zp[2]:11 5.0005000001E10 +word render::canvas_offset +word render::canvas_offset#0 canvas_offset zp[2]:11 1.50000015E7 +byte render::i +byte render::i#1 reg byte y 2.00000000002E11 +byte render::i#2 reg byte y 6.0000000000600006E10 +byte render::pixels +byte render::pixels#0 pixels zp[1]:8 2000002.0 +byte render::pixels#1 pixels zp[1]:8 200002.0 +byte render::pixels#4 pixels zp[1]:8 1241176.705882353 +byte* render::render_index_xcol +word render::render_index_xcol#0 render_index_xcol zp[2]:97 2500000.25 +byte render::xcol +byte render::xcol#0 xcol zp[1]:5 666667.3333333334 +byte render::xcol#1 xcol zp[1]:5 66667.33333333333 +byte render::xcol#2 xcol zp[1]:5 5550001.5 +byte render::ypix +byte render::ypix#0 ypix zp[1]:96 1.4287142857428572E10 +byte render::ypos +byte render::ypos#0 ypos zp[1]:6 1000001.0 +byte render::ypos#1 ypos zp[1]:6 100001.0 +byte render::ypos#2 ypos zp[1]:6 2344444.888888889 +byte render::ypos_inc_offset +byte render::ypos_inc_offset#0 reg byte x 1.0000001E7 +byte render::ypos_inc_offset#1 reg byte x 1.00000000001E11 +byte render::ypos_inc_offset#2 reg byte x 1.0000250000125E11 +byte render::ytile +byte render::ytile#0 reg byte y 1.0000001E7 +void render_tiles(byte render_tiles::xcol , byte render_tiles::ytile , byte render_tiles::tile_left , byte render_tiles::tile_right) +byte~ render_tiles::$0 reg byte a 2.00000002E8 +byte~ render_tiles::$2 reg byte a 2.00000002E8 +byte~ render_tiles::$4 reg byte x 1.00000001E8 +byte~ render_tiles::$5 reg byte a 2.00000002E8 +byte* render_tiles::canvas1 +byte* render_tiles::canvas1#0 canvas1 zp[2]:89 6.6666667333333336E7 +byte* render_tiles::canvas1#1 canvas1 zp[2]:89 5.000000000005E11 +byte* render_tiles::canvas1#2 canvas1 zp[2]:89 6.000200000008E11 +byte* render_tiles::canvas2 +byte* render_tiles::canvas2#0 canvas2 zp[2]:94 1.00000001E8 +byte* render_tiles::canvas2#1 canvas2 zp[2]:94 6.666666666673334E11 +byte* render_tiles::canvas2#2 canvas2 zp[2]:94 5.000166666673334E11 +word render_tiles::canvas_offset +word render_tiles::canvas_offset#0 canvas_offset zp[2]:94 1.500000015E8 +byte render_tiles::pixels +byte render_tiles::pixels#0 reg byte a 1.5000000000015E12 +byte* render_tiles::render_index_xcol +word render_tiles::render_index_xcol#0 render_index_xcol zp[2]:101 2.500000025E7 +byte render_tiles::tile_left +byte render_tiles::tile_left#0 reg byte x 5.5000001E7 +byte* render_tiles::tile_left_pixels +byte* render_tiles::tile_left_pixels#0 tile_left_pixels zp[2]:97 5.2636842105368416E10 +byte render_tiles::tile_right +byte render_tiles::tile_right#0 reg byte y 3.6666667333333336E7 +byte* render_tiles::tile_right_pixels +byte* render_tiles::tile_right_pixels#0 tile_right_pixels zp[2]:99 5.882941176482353E10 +byte render_tiles::xcol +byte render_tiles::xcol#0 xcol zp[1]:7 1.375000025E7 +byte render_tiles::y +byte render_tiles::y#1 y zp[1]:96 2.000000000002E12 +byte render_tiles::y#2 y zp[1]:96 6.25000000000625E11 +byte render_tiles::ypos_inc_offset +byte render_tiles::ypos_inc_offset#0 reg byte x 2.00000002E8 +byte render_tiles::ypos_inc_offset#1 reg byte x 1.000000000001E12 +byte render_tiles::ypos_inc_offset#2 reg byte x 5.714428571435714E11 +byte render_tiles::ytile +byte render_tiles::ytile#0 ytile zp[1]:6 1.375000025E7 +volatile byte* rigt_canvas loadstore zp[2]:28 20.0 +volatile byte* rigt_render_index_xcol loadstore zp[2]:26 20.0 +volatile byte rigt_ypos_inc_offset loadstore zp[1]:30 20.0 +volatile byte side_sprites_color loadstore zp[1]:35 11040.0 +volatile byte side_sprites_mc loadstore zp[1]:36 11040.0 +void spawn_all() +void splash_run() +byte~ splash_run::$25 reg byte a 2002.0 +byte~ splash_run::$30 reg byte a 20002.0 +byte~ splash_run::$34 reg byte y 1334.6666666666667 +byte splash_run::i +byte splash_run::i#1 i zp[1]:5 2002.0 +byte splash_run::i#2 i zp[1]:5 364.0 +byte splash_run::i1 +byte splash_run::i1#1 reg byte x 2002.0 +byte splash_run::i1#2 reg byte x 1334.6666666666667 +byte splash_run::i2 +byte splash_run::i2#1 reg byte x 2002.0 +byte splash_run::i2#2 reg byte x 1201.2 +byte splash_run::msb +byte splash_run::msb#1 reg byte x 1001.0 +byte splash_run::msb#10 reg byte x 175.25 +byte splash_run::msb#2 reg byte x 2002.0 +byte splash_run::msb#8 reg byte x 1501.5 +const word* splash_run::sprites_xpos[] = { $1e7, $13f, $10f, $df, $af, $7f, $4f, $1f } +byte* splash_run::toD0181_gfx +byte splash_run::toD0181_return +const byte splash_run::toD0181_return#0 toD0181_return = 0 +byte* splash_run::toD0181_screen +byte* splash_run::toDd001_gfx +byte splash_run::toDd001_return +const byte splash_run::toDd001_return#0 toDd001_return = 3^>(word)SCREENS_1/$40 +word splash_run::xpos +word splash_run::xpos#0 xpos zp[2]:89 667.3333333333334 +void splash_show() +byte splash_show::pixels +byte splash_show::pixels#0 reg byte x 50000.5 +byte* splash_show::splash +byte* splash_show::splash#1 splash zp[2]:99 33333.666666666664 +byte* splash_show::splash#2 splash zp[2]:99 80001.25 +byte* splash_show::splash#4 splash zp[2]:99 10001.0 +byte splash_show::xcol +byte splash_show::xcol#1 xcol zp[1]:5 20002.0 +byte splash_show::xcol#2 xcol zp[1]:5 11818.545454545454 +byte splash_show::ypos +byte splash_show::ypos#1 ypos zp[1]:6 200002.0 +byte splash_show::ypos#2 ypos zp[1]:6 50000.5 +volatile byte top_sprites_color loadstore zp[1]:33 3403.666666666667 +volatile byte top_sprites_mc loadstore zp[1]:34 92.0 + +zp[1]:2 [ game_logic::ghost_frame_idx#2 game_logic::ghost_frame_idx#0 game_logic::ghost_frame_idx#1 ] +reg byte a [ game_logic::do_reverse#4 ] +reg byte x [ game_logic::target_xtile#3 game_logic::target_xtile#2 ] +zp[1]:3 [ game_logic::target_ytile#3 game_logic::target_ytile#2 choose_direction::target_ytile#4 choose_direction::target_ytile#2 choose_direction::target_ytile#3 choose_direction::target_ytile#0 choose_direction::target_ytile#1 game_logic::target_ytile1#3 game_logic::target_ytile1#2 game_logic::target_ytile2#3 game_logic::target_ytile2#2 game_logic::target_ytile3#3 game_logic::target_ytile3#2 ] +reg byte x [ game_logic::target_xtile1#3 game_logic::target_xtile1#2 ] +reg byte x [ game_logic::target_xtile2#3 game_logic::target_xtile2#2 ] +reg byte x [ game_logic::target_xtile3#3 game_logic::target_xtile3#2 ] +reg byte x [ splash_run::msb#10 splash_run::msb#8 splash_run::msb#1 splash_run::msb#2 ] +reg byte x [ splash_run::i1#2 splash_run::i1#1 ] +reg byte x [ splash_run::i2#2 splash_run::i2#1 ] +reg byte x [ gameplay_run::i#2 gameplay_run::i#1 ] +reg byte x [ gameplay_run::i1#2 gameplay_run::i1#1 ] +reg byte x [ gameplay_run::i2#2 gameplay_run::i2#1 ] +reg byte x [ done_run::i#2 done_run::i#1 ] +reg byte x [ done_run::i1#2 done_run::i1#1 ] +reg byte x [ level_tile_directions::xtile#5 level_tile_directions::xtile#1 level_tile_directions::xtile#2 level_tile_directions::xtile#3 level_tile_directions::xtile#4 level_tile_directions::xtile#0 ] +reg byte a [ level_tile_directions::ytile#5 level_tile_directions::ytile#1 level_tile_directions::ytile#2 level_tile_directions::ytile#3 level_tile_directions::ytile#4 level_tile_directions::ytile#0 ] +reg byte a [ level_tile_directions::return#2 level_tile_directions::return#0 ] +reg byte y [ choose_direction::ghost_xtile#4 choose_direction::ghost_xtile#2 choose_direction::ghost_xtile#3 choose_direction::ghost_xtile#0 choose_direction::ghost_xtile#1 ] +reg byte x [ choose_direction::target_xtile#4 choose_direction::target_xtile#2 choose_direction::target_xtile#3 choose_direction::target_xtile#0 choose_direction::target_xtile#1 ] +zp[1]:4 [ choose_direction::ghost_ytile#4 choose_direction::ghost_ytile#2 choose_direction::ghost_ytile#3 choose_direction::ghost_ytile#0 choose_direction::ghost_ytile#1 game_logic::ghost4_ytile#0 game_logic::ghost3_ytile#0 game_logic::ghost2_ytile#0 game_logic::ghost1_ytile#0 choose_direction::ydiff#0 ] +reg byte y [ choose_direction::dist_min#6 choose_direction::dist_up#0 ] +reg byte x [ choose_direction::dist_min#10 choose_direction::dist_min#13 choose_direction::dist_min#14 choose_direction::dist_down#0 ] +reg byte x [ merge_code::cycle_budget#10 merge_code::cycle_budget#2 merge_code::cycle_budget#3 merge_code::cycle_budget#13 merge_code::cycle_budget#0 merge_code::cycle_budget#1 ] +reg byte x [ init_render_index::ypos_inc_offset#4 init_render_index::ypos_inc_offset#7 init_render_index::ypos_inc_offset#8 init_render_index::ypos_inc_offset#2 init_render_index::ypos_inc_offset#3 ] +reg byte x [ init_bobs_restore::bob#2 init_bobs_restore::bob#1 ] +reg byte y [ init_bobs_restore::i#2 init_bobs_restore::i#1 ] +reg byte x [ init_sprite_pointers::screen#2 init_sprite_pointers::screen#1 ] +reg byte y [ init_sprite_pointers::sprite#2 init_sprite_pointers::sprite#1 ] +reg byte a [ joyfire::return#4 ] +zp[1]:5 [ init_level_tile_directions::ytile#15 init_level_tile_directions::ytile#1 splash_run::i#2 splash_run::i#1 init_render_index::x_col#2 init_render_index::x_col#1 done_run::xcol#2 done_run::xcol#1 render::xcol#2 render::xcol#0 render::xcol#1 splash_show::xcol#2 splash_show::xcol#1 ] +zp[1]:6 [ level_show::ytile#2 level_show::ytile#1 render_tiles::ytile#0 init_level_tile_directions::xtile#10 init_level_tile_directions::xtile#1 init_render_index::y_pos#2 init_render_index::y_pos#1 done_run::ypos#2 done_run::ypos#1 render::ypos#2 render::ypos#0 render::ypos#1 splash_show::ypos#2 splash_show::ypos#1 ] +zp[1]:7 [ level_show::xcol#2 level_show::xcol#1 render_tiles::xcol#0 init_level_tile_directions::open_directions#8 init_level_tile_directions::open_directions#4 init_level_tile_directions::open_directions#13 init_level_tile_directions::open_directions#3 init_level_tile_directions::open_directions#12 init_level_tile_directions::open_directions#2 init_level_tile_directions::open_directions#11 ] +zp[1]:8 [ render::pixels#4 render::pixels#0 render::pixels#1 level_show::xtile#3 level_show::xtile#2 ] +reg byte y [ render::i#2 render::i#1 ] +zp[2]:9 [ render::canvas1#2 render::canvas1#0 render::canvas1#1 level_show::level#8 level_show::level#1 memcpy::src#2 memcpy::src#1 init_sprite_pointers::sprites_ptr_2#5 init_sprite_pointers::sprites_ptr_2#1 ] +reg byte x [ render::ypos_inc_offset#2 render::ypos_inc_offset#0 render::ypos_inc_offset#1 ] +zp[2]:11 [ render::canvas2#2 render::canvas2#0 render::canvas2#1 render::canvas_offset#0 level_show::count#5 level_show::count#12 level_show::count#10 level_show::count#11 level_show::count#1 level_show::count#2 level_show::return#0 gameplay_run::$4 init_level_tile_directions::directions#7 init_level_tile_directions::directions#1 memcpy::dst#2 memcpy::dst#1 init_sprite_pointers::sprites_ptr_1#5 init_sprite_pointers::sprites_ptr_1#1 init_bobs_restore::bob_restore#5 init_bobs_restore::bob_restore#1 init_render_index::render_ypos_table#4 merge_code::dest_code#21 merge_code::dest_code#12 merge_code::dest_code#13 merge_code::dest_code#14 merge_code::dest_code#10 merge_code::dest_code#0 merge_code::dest_code#6 merge_code::dest_code#15 merge_code::dest_code#3 merge_code::dest_code#4 merge_code::dest_code#1 merge_code::dest_code#2 ] +reg byte x [ level_tile_get::xtile#4 level_tile_get::xtile#0 level_tile_get::xtile#1 level_tile_get::xtile#2 level_tile_get::xtile#3 ] +reg byte a [ level_tile_get::ytile#4 level_tile_get::ytile#0 level_tile_get::ytile#1 level_tile_get::ytile#2 level_tile_get::ytile#3 ] +reg byte a [ level_tile_get::return#2 level_tile_get::return#0 ] +reg byte x [ render_tiles::ypos_inc_offset#2 render_tiles::ypos_inc_offset#0 render_tiles::ypos_inc_offset#1 ] +zp[1]:13 [ pacman_ch1_enabled ] +zp[1]:14 [ pacman_ch1_idx ] +zp[2]:15 [ logic_tile_ptr ] +zp[1]:17 [ logic_tile_xcol ] +zp[1]:18 [ logic_tile_yfine ] +zp[1]:19 [ logic_tile_left_idx ] +zp[1]:20 [ logic_tile_right_idx ] +zp[2]:21 [ left_render_index_xcol ] +zp[2]:23 [ left_canvas ] +zp[1]:25 [ left_ypos_inc_offset ] +zp[2]:26 [ rigt_render_index_xcol ] +zp[2]:28 [ rigt_canvas ] +zp[1]:30 [ rigt_ypos_inc_offset ] +zp[1]:31 [ canvas_base_hi ] +zp[1]:32 [ bobs_restore_base ] +zp[1]:33 [ top_sprites_color ] +zp[1]:34 [ top_sprites_mc ] +zp[1]:35 [ side_sprites_color ] +zp[1]:36 [ side_sprites_mc ] +zp[1]:37 [ bottom_sprites_color ] +zp[1]:38 [ bottom_sprites_mc ] +zp[2]:39 [ pill_count ] +zp[1]:41 [ pacman_wins ] +zp[1]:42 [ pacman_lives ] +zp[1]:43 [ music_play_next ] +zp[1]:44 [ phase ] +zp[1]:45 [ frame ] +zp[1]:46 [ anim_frame_idx ] +zp[1]:47 [ pacman_xfine ] +zp[1]:48 [ pacman_yfine ] +zp[1]:49 [ pacman_direction ] +zp[1]:50 [ pacman_substep ] +zp[1]:51 [ ghosts_mode ] +zp[1]:52 [ ghosts_mode_count ] +zp[1]:53 [ ghost1_xfine ] +zp[1]:54 [ ghost1_yfine ] +zp[1]:55 [ ghost1_direction ] +zp[1]:56 [ ghost1_substep ] +zp[1]:57 [ ghost1_reverse ] +zp[1]:58 [ ghost1_respawn ] +zp[1]:59 [ ghost2_xfine ] +zp[1]:60 [ ghost2_yfine ] +zp[1]:61 [ ghost2_direction ] +zp[1]:62 [ ghost2_substep ] +zp[1]:63 [ ghost2_reverse ] +zp[1]:64 [ ghost2_respawn ] +zp[1]:65 [ ghost3_xfine ] +zp[1]:66 [ ghost3_yfine ] +zp[1]:67 [ ghost3_direction ] +zp[1]:68 [ ghost3_substep ] +zp[1]:69 [ ghost3_reverse ] +zp[1]:70 [ ghost3_respawn ] +zp[1]:71 [ ghost4_xfine ] +zp[1]:72 [ ghost4_yfine ] +zp[1]:73 [ ghost4_direction ] +zp[1]:74 [ ghost4_substep ] +zp[1]:75 [ ghost4_reverse ] +zp[1]:76 [ ghost4_respawn ] +zp[1]:77 [ game_logic_substep ] +zp[1]:78 [ game_playable ] +reg byte a [ irq_screen_top::$1 ] +reg byte a [ irq_screen_top::$2 ] +reg byte x [ game_logic::$2 ] +reg byte a [ game_logic::$3 ] +reg byte x [ game_logic::$14 ] +reg byte a [ game_logic::$15 ] +reg byte y [ game_logic::pacman_bob_xfine#0 ] +reg byte a [ game_logic::$17 ] +reg byte x [ game_logic::$18 ] +reg byte x [ game_logic::$19 ] +reg byte a [ game_logic::$20 ] +reg byte a [ game_logic::$21 ] +reg byte y [ game_logic::ghost1_bob_xfine#0 ] +reg byte a [ game_logic::$25 ] +reg byte x [ game_logic::$26 ] +reg byte x [ game_logic::$27 ] +reg byte a [ game_logic::$28 ] +reg byte a [ game_logic::$29 ] +reg byte y [ game_logic::ghost2_bob_xfine#0 ] +reg byte a [ game_logic::$31 ] +reg byte x [ game_logic::$32 ] +reg byte x [ game_logic::$33 ] +reg byte a [ game_logic::$34 ] +reg byte a [ game_logic::$35 ] +reg byte y [ game_logic::ghost3_bob_xfine#0 ] +reg byte a [ game_logic::$37 ] +reg byte x [ game_logic::$38 ] +reg byte x [ game_logic::$39 ] +reg byte a [ game_logic::$40 ] +reg byte a [ game_logic::$41 ] +reg byte y [ game_logic::ghost4_bob_xfine#0 ] +reg byte a [ game_logic::$43 ] +reg byte x [ game_logic::$44 ] +reg byte x [ game_logic::$45 ] +reg byte a [ game_logic::$46 ] +reg byte a [ game_logic::$47 ] +zp[1]:79 [ game_logic::pacman_xtile#0 choose_direction::open_directions#10 choose_direction::open_directions#2 choose_direction::open_directions#3 choose_direction::open_directions#0 choose_direction::open_directions#1 ] +reg byte a [ game_logic::pacman_ytile#0 ] +zp[1]:80 [ game_logic::$210 choose_direction::dist_min#11 choose_direction::dist_left#0 choose_direction::dist_min#17 choose_direction::dist_min#18 ] +zp[2]:81 [ game_logic::ytiles#0 game_logic::$67 game_logic::$71 ] +reg byte x [ game_logic::tile_id#0 ] +reg byte a [ game_logic::$65 ] +reg byte a [ game_logic::$66 ] +reg byte a [ game_logic::$68 ] +reg byte x [ game_logic::$75 ] +reg byte y [ game_logic::$77 ] +reg byte x [ game_logic::$80 ] +reg byte y [ game_logic::$82 ] +reg byte x [ game_logic::$85 ] +reg byte y [ game_logic::$87 ] +reg byte x [ game_logic::$90 ] +reg byte y [ game_logic::$92 ] +reg byte a [ game_logic::$69 ] +reg byte a [ game_logic::$70 ] +reg byte a [ game_logic::$72 ] +reg byte x [ game_logic::$220 ] +zp[1]:83 [ game_logic::ghost4_xtile#0 choose_direction::return#10 choose_direction::direction#6 choose_direction::direction#8 choose_direction::direction#10 ] +reg byte a [ level_tile_directions::return#3 ] +reg byte a [ game_logic::open_directions#0 ] +reg byte y [ game_logic::open_directions#1 ] +reg byte a [ choose_direction::return#0 ] +reg byte a [ game_logic::$119 ] +reg byte x [ game_logic::$223 ] +zp[1]:84 [ game_logic::ghost3_xtile#0 ] +reg byte a [ level_tile_directions::return#10 ] +reg byte a [ game_logic::open_directions1#0 ] +reg byte y [ game_logic::open_directions1#1 ] +reg byte a [ choose_direction::return#1 ] +reg byte a [ game_logic::$140 ] +reg byte x [ game_logic::$226 ] +zp[1]:85 [ game_logic::ghost2_xtile#0 ] +reg byte a [ level_tile_directions::return#11 ] +reg byte a [ game_logic::open_directions2#0 ] +reg byte y [ game_logic::open_directions2#1 ] +reg byte a [ choose_direction::return#2 ] +reg byte a [ game_logic::$161 ] +reg byte x [ game_logic::$229 ] +zp[1]:86 [ game_logic::ghost1_xtile#0 ] +reg byte a [ level_tile_directions::return#12 ] +reg byte a [ game_logic::open_directions3#0 ] +reg byte y [ game_logic::open_directions3#1 ] +reg byte a [ choose_direction::return#3 ] +reg byte a [ game_logic::$182 ] +reg byte x [ game_logic::$232 ] +reg byte x [ game_logic::pacman_xtile1#0 ] +reg byte a [ game_logic::pacman_ytile1#0 ] +reg byte a [ level_tile_directions::return#13 ] +reg byte x [ game_logic::open_directions4#0 ] +reg byte a [ game_logic::$199 ] +reg byte a [ game_logic::$200 ] +reg byte a [ game_logic::joy_directions#0 ] +reg byte a [ game_logic::$204 ] +reg byte a [ game_logic::new_direction#0 ] +zp[2]:87 [ byteboozer_decrunch::crunched ] +reg byte a [ joyfire::return#1 ] +reg byte a [ splash_run::$30 ] +reg byte y [ splash_run::$34 ] +zp[2]:89 [ splash_run::xpos#0 render_tiles::canvas1#2 render_tiles::canvas1#0 render_tiles::canvas1#1 init_render_index::render_index_xcol#0 init_render_index::render_index#1 merge_code::logic_code#12 merge_code::logic_code#5 merge_code::logic_code#18 merge_code::logic_code#17 merge_code::logic_code#2 merge_code::logic_code#14 merge_code::logic_code#3 merge_code::logic_code#4 merge_code::logic_code#10 merge_code::logic_code#1 merge_code::logic_code#0 memset::num#5 memset::end#0 done_run::gfx#4 done_run::gfx#2 done_run::gfx#1 ] +reg byte a [ splash_run::$25 ] +reg byte a [ joyfire::return#0 ] +reg byte a [ done_run::$8 ] +reg byte x [ done_run::pixels#0 ] +reg byte a [ level_tile_directions::$5 ] +zp[2]:91 [ level_tile_directions::ytiles#0 ] +zp[1]:93 [ choose_direction::xdiff#0 ] +reg byte a [ choose_direction::$2 ] +reg byte a [ choose_direction::$4 ] +reg byte a [ choose_direction::$6 ] +reg byte a [ choose_direction::$8 ] +reg byte a [ choose_direction::dist_right#0 ] +reg byte y [ merge_code::$5 ] +reg byte a [ init_render_index::$9 ] +zp[2]:94 [ init_render_index::canvas_xcol#0 render_tiles::canvas2#2 render_tiles::canvas2#0 render_tiles::canvas2#1 render_tiles::canvas_offset#0 ] +reg byte a [ init_render_index::$5 ] +reg byte a [ init_render_index::$6 ] +reg byte x [ splash_show::pixels#0 ] +reg byte a [ init_sprite_pointers::$2 ] +reg byte a [ init_sprite_pointers::sprite_id#0 ] +reg byte a [ joyfire::$0 ] +reg byte a [ level_tile_get::return#3 ] +reg byte x [ init_level_tile_directions::$3 ] +reg byte a [ level_tile_get::return#4 ] +reg byte x [ init_level_tile_directions::$7 ] +reg byte a [ level_tile_get::return#10 ] +reg byte a [ init_level_tile_directions::$11 ] +reg byte a [ level_tile_get::return#11 ] +reg byte a [ init_level_tile_directions::$15 ] +reg byte x [ level_show::tile_left#0 ] +reg byte y [ level_show::xtile#1 ] +reg byte x [ render_tiles::tile_left#0 ] +reg byte y [ render_tiles::tile_right#0 ] +reg byte y [ render::ytile#0 ] +reg byte x [ render::$1 ] +reg byte a [ render::$2 ] +zp[1]:96 [ render::ypix#0 level_show::tile_right#0 merge_code::logic_cycles#0 render_tiles::y#2 render_tiles::y#1 ] +reg byte a [ level_tile_get::$5 ] +reg byte a [ render_tiles::$0 ] +zp[2]:97 [ render_tiles::tile_left_pixels#0 level_tile_get::ytiles#0 render::render_index_xcol#0 init_render_index::$11 init_render_index::$10 init_render_index::$12 init_render_index::canvas#0 ] +reg byte a [ render_tiles::$2 ] +zp[2]:99 [ render_tiles::tile_right_pixels#0 splash_show::splash#4 splash_show::splash#2 splash_show::splash#1 init_render_index::render_index_xcol#2 init_render_index::render_index_xcol#7 init_render_index::render_index_xcol#1 merge_code::raster_code#4 merge_code::raster_code#2 merge_code::raster_code#0 merge_code::raster_code#1 memset::str#6 memset::dst#2 memset::dst#4 memset::dst#1 ] +reg byte x [ render_tiles::$4 ] +reg byte a [ render_tiles::$5 ] +zp[2]:101 [ render_tiles::render_index_xcol#0 ] +reg byte a [ render_tiles::pixels#0 ] diff --git a/src/test/ref/cordic-atan2-16-ref.asm b/src/test/ref/cordic-atan2-16-ref.asm index a01d29012..dac1abab3 100644 --- a/src/test/ref/cordic-atan2-16-ref.asm +++ b/src/test/ref/cordic-atan2-16-ref.asm @@ -53,14 +53,14 @@ main: { sta.z x __b2: // xw = (signed word)(word){ (byte)x, 0 } - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // yw = (signed word)(word){ (byte)y, 0 } - lda.z y - sta.z yw+1 - sty.z yw + ldy.z y + sty.z yw+1 + sta.z yw // atan2_16(xw, yw) jsr atan2_16 // angle_w = atan2_16(xw, yw) diff --git a/src/test/ref/cordic-atan2-16-ref.log b/src/test/ref/cordic-atan2-16-ref.log index 71970f558..596b29680 100644 --- a/src/test/ref/cordic-atan2-16-ref.log +++ b/src/test/ref/cordic-atan2-16-ref.log @@ -2074,10 +2074,6 @@ Allocated zp[1]:67 [ print_uchar::$0 ] Allocated zp[1]:68 [ print_uchar::$2 ] REGISTER UPLIFT POTENTIAL REGISTERS Statement [3] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::y#4 main::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::x#2 main::x#1 ] -Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [8] atan2_16::x#0 = (signed word)main::xw#0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::yw#0 atan2_16::x#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::y#4 main::y#1 ] Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::x#2 main::x#1 ] @@ -2086,6 +2082,8 @@ Statement [11] atan2_16::return#2 = atan2_16::return#0 [ main::y#4 main::x#2 mai Statement [12] main::angle_w#0 = atan2_16::return#2 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::angle_w#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::angle_w#0 ] { { diff::bb1#0 = main::ang_w#0 } { diff::return#0 = diff::return#1 } } ) always clobbers reg byte a Statement [13] main::$4 = main::angle_w#0 + $80 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::$4 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::$4 ] { { diff::bb1#0 = main::ang_w#0 } { diff::return#0 = diff::return#1 } } ) always clobbers reg byte a Statement [16] diff::bb2#0 = *main::screen_ref#2 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::ang_w#0 diff::bb1#0 diff::bb2#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::ang_w#0 diff::bb1#0 diff::bb2#0 ] { { diff::bb1#0 = main::ang_w#0 } { diff::return#0 = diff::return#1 } } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::y#4 main::y#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::x#2 main::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:53 [ main::ang_w#0 ] Removing always clobbered register reg byte y as potential for zp[1]:53 [ main::ang_w#0 ] Removing always clobbered register reg byte a as potential for zp[1]:54 [ diff::bb1#0 ] @@ -2146,8 +2144,8 @@ Statement [112] print_uchar::$2 = print_uchar::b#2 & $f [ print_char_cursor#20 p Statement [117] *print_char_cursor#19 = print_char::ch#2 [ print_char_cursor#19 ] ( print_uint:30::print_uchar:104::print_char:111 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#19 ] { { print_uint::w#0 = main::diff_sum#1 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#2 } { print_char_cursor#19 = print_char_cursor#26 } } print_uint:30::print_uchar:106::print_char:111 [ print_uchar::b#2 print_char_cursor#19 ] { { print_uint::w#0 = main::diff_sum#1 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#19 = print_char_cursor#26 print_char_cursor#20 } { print_char::ch#0 = print_char::ch#2 } } print_uint:30::print_uchar:104::print_char:114 [ print_uint::w#0 print_char_cursor#19 ] { { print_uint::w#0 = main::diff_sum#1 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#2 } { print_char_cursor#19 = print_char_cursor#20 } } print_uint:30::print_uchar:106::print_char:114 [ print_char_cursor#19 ] { { print_uint::w#0 = main::diff_sum#1 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#19 = print_char_cursor#26 print_char_cursor#20 } { print_char::ch#1 = print_char::ch#2 } } ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp[1]:35 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] Statement [3] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a reg byte y -Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a reg byte y +Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a +Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [8] atan2_16::x#0 = (signed word)main::xw#0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::yw#0 atan2_16::x#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 main::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [9] atan2_16::y#0 = (signed word)main::yw#0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [11] atan2_16::return#2 = atan2_16::return#0 [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 atan2_16::return#2 ] ( [ main::y#4 main::x#2 main::screen_ref#2 main::diff_sum#2 main::screen#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a @@ -2416,15 +2414,15 @@ main: { // main::@2 __b2: // [6] main::xw#0 = (byte)main::x#2 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // [7] main::yw#0 = (byte)main::y#4 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z y - ldy #0 - sta.z yw+1 - sty.z yw + lda #0 + ldy.z y + sty.z yw+1 + sta.z yw // [8] atan2_16::x#0 = (signed word)main::xw#0 // [9] atan2_16::y#0 = (signed word)main::yw#0 // [10] call atan2_16 @@ -3168,7 +3166,7 @@ Removing instruction jmp __breturn Removing instruction jmp __breturn Succesful ASM optimization Pass5NextJumpElimination Removing instruction lda #>0 -Removing instruction ldy #0 +Removing instruction lda #0 Removing instruction ldy #0 Replacing instruction ldy #0 with TAY Removing instruction ldy.z idx @@ -3563,15 +3561,15 @@ main: { __b2: // xw = (signed word)(word){ (byte)x, 0 } // [6] main::xw#0 = (byte)main::x#2 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // yw = (signed word)(word){ (byte)y, 0 } // [7] main::yw#0 = (byte)main::y#4 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z y - sta.z yw+1 - sty.z yw + ldy.z y + sty.z yw+1 + sta.z yw // atan2_16(xw, yw) // [8] atan2_16::x#0 = (signed word)main::xw#0 // [9] atan2_16::y#0 = (signed word)main::yw#0 diff --git a/src/test/ref/cordic-atan2-16.asm b/src/test/ref/cordic-atan2-16.asm index 32d8964d8..8606b42f7 100644 --- a/src/test/ref/cordic-atan2-16.asm +++ b/src/test/ref/cordic-atan2-16.asm @@ -42,14 +42,14 @@ main: { sta.z x __b2: // xw = (signed word)(word){ (byte)x, 0 } - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // yw = (signed word)(word){ (byte)y, 0 } - lda.z y - sta.z yw+1 - sty.z yw + ldy.z y + sty.z yw+1 + sta.z yw // atan2_16(xw, yw) jsr atan2_16 // angle_w = atan2_16(xw, yw) diff --git a/src/test/ref/cordic-atan2-16.log b/src/test/ref/cordic-atan2-16.log index 64fce24d6..013ce0ef6 100644 --- a/src/test/ref/cordic-atan2-16.log +++ b/src/test/ref/cordic-atan2-16.log @@ -1533,10 +1533,6 @@ Allocated zp[1]:49 [ atan2_16::$23 ] Allocated zp[1]:50 [ atan2_16::$22 ] REGISTER UPLIFT POTENTIAL REGISTERS Statement [3] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::y#4 main::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::x#2 main::x#1 ] -Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [8] atan2_16::x#0 = (signed word)main::xw#0 [ main::y#4 main::x#2 main::screen#2 main::yw#0 atan2_16::x#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::y#4 main::y#1 ] Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::x#2 main::x#1 ] @@ -1545,6 +1541,8 @@ Statement [11] atan2_16::return#2 = atan2_16::return#0 [ main::y#4 main::x#2 mai Statement [12] main::angle_w#0 = atan2_16::return#2 [ main::y#4 main::x#2 main::screen#2 main::angle_w#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::angle_w#0 ] { } ) always clobbers reg byte a Statement [13] main::$3 = main::angle_w#0 + $80 [ main::y#4 main::x#2 main::screen#2 main::$3 ] ( [ main::y#4 main::x#2 main::screen#2 main::$3 ] { } ) always clobbers reg byte a Statement [15] *main::screen#2 = main::ang_w#0 [ main::y#4 main::x#2 main::screen#2 ] ( [ main::y#4 main::x#2 main::screen#2 ] { } ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::y#4 main::y#1 ] +Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::x#2 main::x#1 ] Statement [25] *init_font_hex::charset#2 = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( init_font_hex:1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] { } ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte a as potential for zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ] Removing always clobbered register reg byte y as potential for zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ] @@ -1590,8 +1588,8 @@ Statement [84] atan2_16::yd#1 = atan2_16::yd#3 >> 2 [ atan2_16::x#0 atan2_16::y# Statement [86] atan2_16::xi#13 = atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] ( atan2_16:10 [ main::y#4 main::x#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [87] atan2_16::yi#16 = atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] ( atan2_16:10 [ main::y#4 main::x#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [3] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a reg byte y -Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a reg byte y +Statement [6] main::xw#0 = (byte)main::x#2 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a +Statement [7] main::yw#0 = (byte)main::y#4 w= 0 [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::xw#0 main::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [8] atan2_16::x#0 = (signed word)main::xw#0 [ main::y#4 main::x#2 main::screen#2 main::yw#0 atan2_16::x#0 ] ( [ main::y#4 main::x#2 main::screen#2 main::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [9] atan2_16::y#0 = (signed word)main::yw#0 [ main::y#4 main::x#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 ] ( [ main::y#4 main::x#2 main::screen#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [11] atan2_16::return#2 = atan2_16::return#0 [ main::y#4 main::x#2 main::screen#2 atan2_16::return#2 ] ( [ main::y#4 main::x#2 main::screen#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a @@ -1800,15 +1798,15 @@ main: { // main::@2 __b2: // [6] main::xw#0 = (byte)main::x#2 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // [7] main::yw#0 = (byte)main::y#4 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z y - ldy #0 - sta.z yw+1 - sty.z yw + lda #0 + ldy.z y + sty.z yw+1 + sta.z yw // [8] atan2_16::x#0 = (signed word)main::xw#0 // [9] atan2_16::y#0 = (signed word)main::yw#0 // [10] call atan2_16 @@ -2372,7 +2370,7 @@ Removing instruction jmp __b17 Removing instruction jmp __b20 Removing instruction jmp __b19 Succesful ASM optimization Pass5NextJumpElimination -Removing instruction ldy #0 +Removing instruction lda #0 Replacing instruction ldy #0 with TAY Removing instruction ldy.z idx Removing instruction lda #0 @@ -2664,15 +2662,15 @@ main: { __b2: // xw = (signed word)(word){ (byte)x, 0 } // [6] main::xw#0 = (byte)main::x#2 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z x - ldy #0 - sta.z xw+1 - sty.z xw + lda #0 + ldy.z x + sty.z xw+1 + sta.z xw // yw = (signed word)(word){ (byte)y, 0 } // [7] main::yw#0 = (byte)main::y#4 w= 0 -- vwuz1=vbuz2_word_vbuc1 - lda.z y - sta.z yw+1 - sty.z yw + ldy.z y + sty.z yw+1 + sta.z yw // atan2_16(xw, yw) // [8] atan2_16::x#0 = (signed word)main::xw#0 // [9] atan2_16::y#0 = (signed word)main::yw#0 diff --git a/src/test/ref/cordic-atan2-clear.log b/src/test/ref/cordic-atan2-clear.log index 20ff40c56..39f179051 100644 --- a/src/test/ref/cordic-atan2-clear.log +++ b/src/test/ref/cordic-atan2-clear.log @@ -1798,25 +1798,16 @@ Statement [42] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_ Removing always clobbered register reg byte a as potential for zp[1]:19 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:20 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [43] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [44] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:14 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:19 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:20 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [45] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [46] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [47] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [48] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [50] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [51] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [52] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [55] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:56 [ init_angle_screen::ang_w#0 ] Statement [56] init_angle_screen::$10 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:56 [ init_angle_screen::ang_w#0 ] -Statement [57] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [58] init_angle_screen::$11 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$11 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [59] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Statement [60] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte a reg byte y +Statement [60] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte a Statement [63] if(atan2_16::y#0>=0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [64] atan2_16::$2 = - atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [66] if(atan2_16::x#0>=0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a @@ -1862,21 +1853,16 @@ Statement [37] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [38] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [42] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [43] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [44] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [45] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [46] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [47] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [48] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [50] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [51] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [52] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a Statement [54] init_angle_screen::$9 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [55] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [56] init_angle_screen::$10 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [57] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [58] init_angle_screen::$11 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$11 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [59] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Statement [60] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte a reg byte y +Statement [60] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:4 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte a Statement [63] if(atan2_16::y#0>=0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [64] atan2_16::$2 = - atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [66] if(atan2_16::x#0>=0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( init_angle_screen:4::atan2_16:49 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a @@ -1912,11 +1898,11 @@ Potential registers zp[2]:9 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo# Potential registers zp[1]:11 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp[1]:11 , reg byte x , Potential registers zp[1]:12 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp[1]:12 , reg byte x , reg byte y , Potential registers zp[1]:13 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp[1]:13 , reg byte x , reg byte y , -Potential registers zp[1]:14 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:14 , reg byte x , +Potential registers zp[1]:14 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:14 , reg byte x , reg byte y , Potential registers zp[2]:15 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] : zp[2]:15 , Potential registers zp[2]:17 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] : zp[2]:17 , -Potential registers zp[1]:19 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:19 , reg byte x , -Potential registers zp[1]:20 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:20 , reg byte x , +Potential registers zp[1]:19 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:19 , reg byte x , reg byte y , +Potential registers zp[1]:20 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:20 , reg byte x , reg byte y , Potential registers zp[2]:21 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] : zp[2]:21 , Potential registers zp[2]:23 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] : zp[2]:23 , Potential registers zp[1]:25 [ atan2_16::i#2 atan2_16::i#1 ] : zp[1]:25 , reg byte x , reg byte y , @@ -1939,7 +1925,7 @@ Potential registers zp[2]:48 [ atan2_16::y#0 ] : zp[2]:48 , Potential registers zp[2]:50 [ atan2_16::return#2 ] : zp[2]:50 , Potential registers zp[2]:52 [ init_angle_screen::angle_w#0 ] : zp[2]:52 , Potential registers zp[2]:54 [ init_angle_screen::$7 ] : zp[2]:54 , -Potential registers zp[1]:56 [ init_angle_screen::ang_w#0 ] : zp[1]:56 , reg byte x , +Potential registers zp[1]:56 [ init_angle_screen::ang_w#0 ] : zp[1]:56 , reg byte x , reg byte y , Potential registers zp[1]:57 [ init_angle_screen::$9 ] : zp[1]:57 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:58 [ init_angle_screen::$10 ] : zp[1]:58 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:59 [ init_angle_screen::$11 ] : zp[1]:59 , reg byte a , reg byte x , reg byte y , @@ -1961,7 +1947,7 @@ Limited combination testing to 100 combinations of 144 possible. Uplifting [init_font_hex] best 1153159 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp[1]:13 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp[1]:35 [ init_font_hex::$0 ] zp[1]:38 [ init_font_hex::idx#3 ] zp[1]:11 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp[2]:7 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp[2]:9 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp[2]:4 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp[1]:6 [ init_font_hex::c#6 init_font_hex::c#1 ] Limited combination testing to 100 combinations of 6912 possible. Uplifting [init_angle_screen] best 1151559 combination zp[1]:20 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$5 ] zp[2]:52 [ init_angle_screen::angle_w#0 ] zp[2]:54 [ init_angle_screen::$7 ] zp[1]:57 [ init_angle_screen::$9 ] zp[1]:58 [ init_angle_screen::$10 ] zp[1]:59 [ init_angle_screen::$11 ] zp[1]:19 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp[1]:56 [ init_angle_screen::ang_w#0 ] zp[2]:44 [ init_angle_screen::yw#0 ] zp[2]:41 [ init_angle_screen::xw#0 ] zp[1]:14 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp[2]:17 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] zp[2]:15 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] -Limited combination testing to 100 combinations of 65536 possible. +Limited combination testing to 100 combinations of 331776 possible. Uplifting [main] best 1151559 combination zp[2]:2 [ main::clear_char#5 main::clear_char#1 ] Uplifting [MOS6526_CIA] best 1151559 combination Uplifting [MOS6569_VICII] best 1151559 combination diff --git a/src/test/ref/examples/mega65/dypp65.asm b/src/test/ref/examples/mega65/dypp65.asm index 9f637ad28..7ed3039e8 100644 --- a/src/test/ref/examples/mega65/dypp65.asm +++ b/src/test/ref/examples/mega65/dypp65.asm @@ -32,15 +32,15 @@ .const OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1 .const OFFSET_STRUCT_DMA_LIST_F018B_DEST_BANK = 8 .const OFFSET_STRUCT_F018_DMAGIC_ETRIG = 5 + .const OFFSET_STRUCT_MEGA65_VICIV_CONTROLB = $31 + .const OFFSET_STRUCT_MEGA65_VICIV_CONTROLC = $54 + .const OFFSET_STRUCT_MEGA65_VICIV_KEY = $2f .const OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO = $5c .const OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI = $5d .const OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO = $48 .const OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI = $49 .const OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO = $4a .const OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI = $4b - .const OFFSET_STRUCT_MEGA65_VICIV_CONTROLB = $31 - .const OFFSET_STRUCT_MEGA65_VICIV_CONTROLC = $54 - .const OFFSET_STRUCT_MEGA65_VICIV_KEY = $2f .const OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO = $58 .const OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_HI = $59 .const OFFSET_STRUCT_MEGA65_VICIV_TEXTXPOS_LO = $4c @@ -78,22 +78,6 @@ main: { // memoryRemap(0,0,0) // Map memory to BANK 0 : 0x00XXXX - giving access to I/O jsr memoryRemap - // VICIV->SIDBDRWD_LO = 0 - // Set sideborder width=0, disable raster delay and hot registers - lda #0 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO - // VICIV->SIDBDRWD_HI = 0 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI - // VICIV->TBDRPOS_LO = 0 - // Disable top/bottom borders - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO - // VICIV->TBDRPOS_HI = 0 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI - // VICIV->BBDRPOS_LO = 0 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO - // VICIV->BBDRPOS_HI = 2 - lda #2 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI // VICIV->CONTROLB |= 0x40 // Enable 48MHz fast mode lda #$40 @@ -110,6 +94,22 @@ main: { // VICIV->KEY = 0x53 lda #$53 sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY + // VICIV->SIDBDRWD_LO = 0 + // Set sideborder width=0, disable raster delay and hot registers + lda #0 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO + // VICIV->SIDBDRWD_HI = 0 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI + // VICIV->TBDRPOS_LO = 0 + // Disable top/bottom borders + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO + // VICIV->TBDRPOS_HI = 0 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI + // VICIV->BBDRPOS_LO = 0 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO + // VICIV->BBDRPOS_HI = 2 + lda #2 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI // VICIV->CONTROLC |= 1 // Enable Super Extended Attribute Mode lda #1 diff --git a/src/test/ref/examples/mega65/dypp65.cfg b/src/test/ref/examples/mega65/dypp65.cfg index 4653f65a1..ba0b08259 100644 --- a/src/test/ref/examples/mega65/dypp65.cfg +++ b/src/test/ref/examples/mega65/dypp65.cfg @@ -11,16 +11,16 @@ main::@11: scope:[main] from main::SEI1 [3] call memoryRemap to:main::@12 main::@12: scope:[main] from main::@11 - [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 - [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 - [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 - [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 - [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 - [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 - [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 - [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 - [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 - [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 + [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 + [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 + [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 + [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 + [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 + [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 + [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 + [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 + [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 + [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 [14] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 [15] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) & $7f [16] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = $5a diff --git a/src/test/ref/examples/mega65/dypp65.log b/src/test/ref/examples/mega65/dypp65.log index 5e5feccec..8f0e5adf6 100644 --- a/src/test/ref/examples/mega65/dypp65.log +++ b/src/test/ref/examples/mega65/dypp65.log @@ -141,16 +141,16 @@ main::@13: scope:[main] from main::SEI1 call memoryRemap to:main::@14 main::@14: scope:[main] from main::@13 + *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 + *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 + *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 + *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 - *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 - *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 - *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 - *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) & $7f *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = $5a @@ -491,16 +491,16 @@ Adding number conversion cast (unumber) 0 in *((byte*)DMA+OFFSET_STRUCT_F018_DMA Adding number conversion cast (unumber) 0 in memoryRemap::remapBlocks#0 = 0 Adding number conversion cast (unumber) 0 in memoryRemap::lowerPageOffset#0 = 0 Adding number conversion cast (unumber) 0 in memoryRemap::upperPageOffset#0 = 0 +Adding number conversion cast (unumber) $40 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 +Adding number conversion cast (unumber) $40 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 +Adding number conversion cast (unumber) $47 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 +Adding number conversion cast (unumber) $53 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 Adding number conversion cast (unumber) 0 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 Adding number conversion cast (unumber) 0 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 Adding number conversion cast (unumber) 0 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 Adding number conversion cast (unumber) 0 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 Adding number conversion cast (unumber) 0 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 Adding number conversion cast (unumber) 2 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 -Adding number conversion cast (unumber) $40 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 -Adding number conversion cast (unumber) $40 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 -Adding number conversion cast (unumber) $47 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 -Adding number conversion cast (unumber) $53 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 Adding number conversion cast (unumber) 1 in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 Adding number conversion cast (unumber) $7f in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) & $7f Adding number conversion cast (unumber) $5a in *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = $5a @@ -539,14 +539,14 @@ Inlining cast *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = (unumber)0 Inlining cast memoryRemap::remapBlocks#0 = (unumber)0 Inlining cast memoryRemap::lowerPageOffset#0 = (unumber)0 Inlining cast memoryRemap::upperPageOffset#0 = (unumber)0 +Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = (unumber)$47 +Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = (unumber)$53 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = (unumber)2 -Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = (unumber)$47 -Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = (unumber)$53 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = (unumber)$5a Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_HI) = (unumber)0 Inlining cast *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TEXTXPOS_LO) = (unumber)$28 @@ -585,16 +585,16 @@ Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 0 +Simplifying constant integer cast $40 +Simplifying constant integer cast $40 +Simplifying constant integer cast $47 +Simplifying constant integer cast $53 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 0 Simplifying constant integer cast 2 -Simplifying constant integer cast $40 -Simplifying constant integer cast $40 -Simplifying constant integer cast $47 -Simplifying constant integer cast $53 Simplifying constant integer cast 1 Simplifying constant integer cast $7f Simplifying constant integer cast $5a @@ -631,16 +631,16 @@ Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $47 +Finalized unsigned number type (byte) $53 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 2 -Finalized unsigned number type (byte) $40 -Finalized unsigned number type (byte) $40 -Finalized unsigned number type (byte) $47 -Finalized unsigned number type (byte) $53 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) $7f Finalized unsigned number type (byte) $5a @@ -958,16 +958,16 @@ main::@11: scope:[main] from main::SEI1 [3] call memoryRemap to:main::@12 main::@12: scope:[main] from main::@11 - [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 - [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 - [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 - [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 - [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 - [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 - [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 - [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 - [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 - [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 + [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 + [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 + [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 + [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 + [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 + [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 + [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 + [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 + [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 + [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 [14] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 [15] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) & $7f [16] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = $5a @@ -1206,16 +1206,16 @@ Allocated zp[1]:24 [ memset_dma::dmaMode#0 ] Allocated zp[1]:25 [ memset_dma256::dmaMode#0 ] Allocated mem[12] [ memset_dma_command ] REGISTER UPLIFT POTENTIAL REGISTERS -Statement [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a -Statement [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a +Statement [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a Statement [14] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a Statement [15] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) & $7f [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a Statement [16] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CHARSTEP_LO) = $5a [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a @@ -1271,16 +1271,16 @@ Statement [79] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memset_dma25 Statement [80] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a Statement [81] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >memset_dma_command256 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a Statement [82] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ETRIG) = SIDBDRWD_LO = 0 - // [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 -- _deref_pbuc1=vbuc2 - // Set sideborder width=0, disable raster delay and hot registers - lda #0 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO - // VICIV->SIDBDRWD_HI = 0 - // [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 -- _deref_pbuc1=vbuc2 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI - // VICIV->TBDRPOS_LO = 0 - // [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 -- _deref_pbuc1=vbuc2 - // Disable top/bottom borders - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO - // VICIV->TBDRPOS_HI = 0 - // [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 -- _deref_pbuc1=vbuc2 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI - // VICIV->BBDRPOS_LO = 0 - // [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 -- _deref_pbuc1=vbuc2 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO - // VICIV->BBDRPOS_HI = 2 - // [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 -- _deref_pbuc1=vbuc2 - lda #2 - sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI // VICIV->CONTROLB |= 0x40 - // [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB) | $40 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 // Enable 48MHz fast mode lda #$40 ora VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLB // VICIV->CONTROLC |= 0x40 - // [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [5] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | $40 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #$40 ora VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC // VICIV->KEY = 0x47 - // [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 -- _deref_pbuc1=vbuc2 + // [6] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $47 -- _deref_pbuc1=vbuc2 // Enable the VIC 4 lda #$47 sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY // VICIV->KEY = 0x53 - // [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 -- _deref_pbuc1=vbuc2 + // [7] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY) = $53 -- _deref_pbuc1=vbuc2 lda #$53 sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_KEY + // VICIV->SIDBDRWD_LO = 0 + // [8] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 -- _deref_pbuc1=vbuc2 + // Set sideborder width=0, disable raster delay and hot registers + lda #0 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO + // VICIV->SIDBDRWD_HI = 0 + // [9] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI) = 0 -- _deref_pbuc1=vbuc2 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_HI + // VICIV->TBDRPOS_LO = 0 + // [10] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO) = 0 -- _deref_pbuc1=vbuc2 + // Disable top/bottom borders + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_LO + // VICIV->TBDRPOS_HI = 0 + // [11] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI) = 0 -- _deref_pbuc1=vbuc2 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_TBDRPOS_HI + // VICIV->BBDRPOS_LO = 0 + // [12] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO) = 0 -- _deref_pbuc1=vbuc2 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_LO + // VICIV->BBDRPOS_HI = 2 + // [13] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI) = 2 -- _deref_pbuc1=vbuc2 + lda #2 + sta VICIV+OFFSET_STRUCT_MEGA65_VICIV_BBDRPOS_HI // VICIV->CONTROLC |= 1 // [14] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) = *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_CONTROLC) | 1 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 // Enable Super Extended Attribute Mode diff --git a/src/test/ref/inline-pointer-1.asm b/src/test/ref/inline-pointer-1.asm index 402ac0f3c..b9b5a997b 100644 --- a/src/test/ref/inline-pointer-1.asm +++ b/src/test/ref/inline-pointer-1.asm @@ -10,22 +10,22 @@ .segment Code main: { // puta(4, 0x00) - ldx #0 - lda #4 + lda #0 + ldx #4 jsr puta // puta(5, 0x18) - ldx #$18 - lda #5 + lda #$18 + ldx #5 jsr puta // } rts } -// puta(byte register(A) ph, byte register(X) pl) +// puta(byte register(X) ph, byte register(A) pl) puta: { .label screen = 2 // screen = (byte*) { ph, pl } - sta.z screen+1 - stx.z screen + stx.z screen+1 + sta.z screen // *screen = 'a' lda #'a' ldy #0 diff --git a/src/test/ref/inline-pointer-1.log b/src/test/ref/inline-pointer-1.log index 4aef82ef9..52c7c10c8 100644 --- a/src/test/ref/inline-pointer-1.log +++ b/src/test/ref/inline-pointer-1.log @@ -176,7 +176,7 @@ Uplift Scope [puta] 11: zp[1]:2 [ puta::ph#2 ] 11: zp[1]:3 [ puta::pl#2 ] 11: zp Uplift Scope [main] Uplift Scope [] -Uplifting [puta] best 57 combination reg byte a [ puta::ph#2 ] reg byte x [ puta::pl#2 ] zp[2]:4 [ puta::screen#0 ] +Uplifting [puta] best 57 combination reg byte x [ puta::ph#2 ] reg byte a [ puta::pl#2 ] zp[2]:4 [ puta::screen#0 ] Uplifting [main] best 57 combination Uplifting [] best 57 combination Allocated (was zp[2]:4) zp[2]:2 [ puta::screen#0 ] @@ -200,10 +200,10 @@ main: { // [1] call puta // [5] phi from main to puta [phi:main->puta] puta_from_main: - // [5] phi puta::pl#2 = 0 [phi:main->puta#0] -- vbuxx=vbuc1 - ldx #0 - // [5] phi puta::ph#2 = 4 [phi:main->puta#1] -- vbuaa=vbuc1 - lda #4 + // [5] phi puta::pl#2 = 0 [phi:main->puta#0] -- vbuaa=vbuc1 + lda #0 + // [5] phi puta::ph#2 = 4 [phi:main->puta#1] -- vbuxx=vbuc1 + ldx #4 jsr puta // [2] phi from main to main::@1 [phi:main->main::@1] __b1_from_main: @@ -213,10 +213,10 @@ main: { // [3] call puta // [5] phi from main::@1 to puta [phi:main::@1->puta] puta_from___b1: - // [5] phi puta::pl#2 = $18 [phi:main::@1->puta#0] -- vbuxx=vbuc1 - ldx #$18 - // [5] phi puta::ph#2 = 5 [phi:main::@1->puta#1] -- vbuaa=vbuc1 - lda #5 + // [5] phi puta::pl#2 = $18 [phi:main::@1->puta#0] -- vbuaa=vbuc1 + lda #$18 + // [5] phi puta::ph#2 = 5 [phi:main::@1->puta#1] -- vbuxx=vbuc1 + ldx #5 jsr puta jmp __breturn // main::@return @@ -225,12 +225,12 @@ main: { rts } // puta -// puta(byte register(A) ph, byte register(X) pl) +// puta(byte register(X) ph, byte register(A) pl) puta: { .label screen = 2 - // [6] puta::screen#0 = puta::ph#2 w= puta::pl#2 -- vwuz1=vbuaa_word_vbuxx - sta.z screen+1 - stx.z screen + // [6] puta::screen#0 = puta::ph#2 w= puta::pl#2 -- vwuz1=vbuxx_word_vbuaa + stx.z screen+1 + sta.z screen // [7] *((byte*)puta::screen#0) = 'a' -- _deref_pbuz1=vbuc1 lda #'a' ldy #0 @@ -261,14 +261,14 @@ FINAL SYMBOL TABLE void main() void puta(byte puta::ph , byte puta::pl) byte puta::ph -byte puta::ph#2 reg byte a 11.0 +byte puta::ph#2 reg byte x 11.0 byte puta::pl -byte puta::pl#2 reg byte x 11.0 +byte puta::pl#2 reg byte a 11.0 byte* puta::screen word puta::screen#0 screen zp[2]:2 11.0 -reg byte a [ puta::ph#2 ] -reg byte x [ puta::pl#2 ] +reg byte x [ puta::ph#2 ] +reg byte a [ puta::pl#2 ] zp[2]:2 [ puta::screen#0 ] @@ -293,20 +293,20 @@ main: { // puta(4, 0x00) // [1] call puta // [5] phi from main to puta [phi:main->puta] - // [5] phi puta::pl#2 = 0 [phi:main->puta#0] -- vbuxx=vbuc1 - ldx #0 - // [5] phi puta::ph#2 = 4 [phi:main->puta#1] -- vbuaa=vbuc1 - lda #4 + // [5] phi puta::pl#2 = 0 [phi:main->puta#0] -- vbuaa=vbuc1 + lda #0 + // [5] phi puta::ph#2 = 4 [phi:main->puta#1] -- vbuxx=vbuc1 + ldx #4 jsr puta // [2] phi from main to main::@1 [phi:main->main::@1] // main::@1 // puta(5, 0x18) // [3] call puta // [5] phi from main::@1 to puta [phi:main::@1->puta] - // [5] phi puta::pl#2 = $18 [phi:main::@1->puta#0] -- vbuxx=vbuc1 - ldx #$18 - // [5] phi puta::ph#2 = 5 [phi:main::@1->puta#1] -- vbuaa=vbuc1 - lda #5 + // [5] phi puta::pl#2 = $18 [phi:main::@1->puta#0] -- vbuaa=vbuc1 + lda #$18 + // [5] phi puta::ph#2 = 5 [phi:main::@1->puta#1] -- vbuxx=vbuc1 + ldx #5 jsr puta // main::@return // } @@ -314,13 +314,13 @@ main: { rts } // puta -// puta(byte register(A) ph, byte register(X) pl) +// puta(byte register(X) ph, byte register(A) pl) puta: { .label screen = 2 // screen = (byte*) { ph, pl } - // [6] puta::screen#0 = puta::ph#2 w= puta::pl#2 -- vwuz1=vbuaa_word_vbuxx - sta.z screen+1 - stx.z screen + // [6] puta::screen#0 = puta::ph#2 w= puta::pl#2 -- vwuz1=vbuxx_word_vbuaa + stx.z screen+1 + sta.z screen // *screen = 'a' // [7] *((byte*)puta::screen#0) = 'a' -- _deref_pbuz1=vbuc1 lda #'a' diff --git a/src/test/ref/inline-pointer-1.sym b/src/test/ref/inline-pointer-1.sym index 1d51ab1a3..aedfdb751 100644 --- a/src/test/ref/inline-pointer-1.sym +++ b/src/test/ref/inline-pointer-1.sym @@ -1,12 +1,12 @@ void main() void puta(byte puta::ph , byte puta::pl) byte puta::ph -byte puta::ph#2 reg byte a 11.0 +byte puta::ph#2 reg byte x 11.0 byte puta::pl -byte puta::pl#2 reg byte x 11.0 +byte puta::pl#2 reg byte a 11.0 byte* puta::screen word puta::screen#0 screen zp[2]:2 11.0 -reg byte a [ puta::ph#2 ] -reg byte x [ puta::pl#2 ] +reg byte x [ puta::ph#2 ] +reg byte a [ puta::pl#2 ] zp[2]:2 [ puta::screen#0 ] diff --git a/src/test/ref/inline-word.log b/src/test/ref/inline-word.log index db649612a..1cde534c3 100644 --- a/src/test/ref/inline-word.log +++ b/src/test/ref/inline-word.log @@ -173,11 +173,10 @@ Allocated zp[1]:2 [ main::h#4 main::h#1 ] Allocated zp[1]:3 [ main::l#2 main::l#1 ] Allocated zp[2]:4 [ main::w#0 ] REGISTER UPLIFT POTENTIAL REGISTERS -Statement [3] main::w#0 = main::his[main::h#4] w= main::l#2 [ main::h#4 main::l#2 main::w#0 ] ( [ main::h#4 main::l#2 main::w#0 ] { } ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::h#4 main::h#1 ] -Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::l#2 main::l#1 ] Statement [4] *((byte*)main::w#0) = '*' [ main::h#4 main::l#2 ] ( [ main::h#4 main::l#2 ] { } ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::h#4 main::h#1 ] Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::h#4 main::h#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::l#2 main::l#1 ] Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::l#2 main::l#1 ] Statement [3] main::w#0 = main::his[main::h#4] w= main::l#2 [ main::h#4 main::l#2 main::w#0 ] ( [ main::h#4 main::l#2 main::w#0 ] { } ) always clobbers reg byte a Statement [4] *((byte*)main::w#0) = '*' [ main::h#4 main::l#2 ] ( [ main::h#4 main::l#2 ] { } ) always clobbers reg byte a reg byte y diff --git a/src/test/ref/plasma-center.log b/src/test/ref/plasma-center.log index d9308f3be..623e4610f 100644 --- a/src/test/ref/plasma-center.log +++ b/src/test/ref/plasma-center.log @@ -4967,26 +4967,16 @@ Statement [79] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_ Removing always clobbered register reg byte a as potential for zp[1]:20 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:21 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [80] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [81] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:15 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:20 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:21 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [82] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [83] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [84] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [85] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [87] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [88] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [89] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [91] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:108 [ init_angle_screen::ang_w#0 ] Statement [92] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:108 [ init_angle_screen::ang_w#0 ] -Statement [93] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [94] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [95] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [96] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [101] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) = $ffff [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [102] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL) = SID_CONTROL_NOISE [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [106] if(make_plasma_charset::c#2<$100) goto make_plasma_charset::@2 [ make_plasma_charset::c#2 print_char_cursor#19 ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 make_plasma_charset::c#2 print_char_cursor#19 ] { } ) always clobbers reg byte a @@ -5121,21 +5111,16 @@ Statement [74] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [75] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [79] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [80] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [81] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [82] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [83] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [84] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [85] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [87] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [88] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [89] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [91] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [91] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [92] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [93] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [94] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [95] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [96] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [101] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) = $ffff [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [102] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL) = SID_CONTROL_NOISE [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [106] if(make_plasma_charset::c#2<$100) goto make_plasma_charset::@2 [ make_plasma_charset::c#2 print_char_cursor#19 ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 make_plasma_charset::c#2 print_char_cursor#19 ] { } ) always clobbers reg byte a @@ -5244,21 +5229,16 @@ Statement [74] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [75] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [79] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [80] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [81] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [82] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [83] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [84] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [85] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [87] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [88] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [89] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [91] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [91] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [92] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [93] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [94] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [95] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [96] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [101] *((word*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) = $ffff [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [102] *((byte*)SID+OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL) = SID_CONTROL_NOISE [ ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 ] { } ) always clobbers reg byte a Statement [106] if(make_plasma_charset::c#2<$100) goto make_plasma_charset::@2 [ make_plasma_charset::c#2 print_char_cursor#19 ] ( main:7::make_plasma_charset:18 [ SCREEN_DIST#0 SCREEN_ANGLE#0 make_plasma_charset::c#2 print_char_cursor#19 ] { } ) always clobbers reg byte a @@ -5345,11 +5325,11 @@ Potential registers zp[1]:11 [ init_dist_screen::yd#0 init_dist_screen::$7 init_ Potential registers zp[1]:12 [ init_dist_screen::x#2 init_dist_screen::x#1 ] : zp[1]:12 , reg byte x , Potential registers zp[1]:13 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] : zp[1]:13 , reg byte x , Potential registers zp[1]:14 [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y , -Potential registers zp[1]:15 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:15 , reg byte x , +Potential registers zp[1]:15 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:15 , reg byte x , reg byte y , Potential registers zp[2]:16 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] : zp[2]:16 , Potential registers zp[2]:18 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] : zp[2]:18 , -Potential registers zp[1]:20 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:20 , reg byte x , -Potential registers zp[1]:21 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:21 , reg byte x , +Potential registers zp[1]:20 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:20 , reg byte x , reg byte y , +Potential registers zp[1]:21 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:21 , reg byte x , reg byte y , Potential registers zp[2]:22 [ make_plasma_charset::c#2 make_plasma_charset::c#1 ] : zp[2]:22 , Potential registers zp[2]:24 [ print_char_cursor#19 print_char_cursor#32 print_char_cursor#0 ] : zp[2]:24 , Potential registers zp[1]:26 [ make_plasma_charset::i#2 make_plasma_charset::i#1 ] : zp[1]:26 , reg byte x , @@ -5403,7 +5383,7 @@ Potential registers zp[2]:100 [ atan2_16::y#0 ] : zp[2]:100 , Potential registers zp[2]:102 [ atan2_16::return#2 ] : zp[2]:102 , Potential registers zp[2]:104 [ init_angle_screen::angle_w#0 ] : zp[2]:104 , Potential registers zp[2]:106 [ init_angle_screen::$7 ] : zp[2]:106 , -Potential registers zp[1]:108 [ init_angle_screen::ang_w#0 ] : zp[1]:108 , reg byte x , +Potential registers zp[1]:108 [ init_angle_screen::ang_w#0 ] : zp[1]:108 , reg byte x , reg byte y , Potential registers zp[1]:109 [ init_angle_screen::$9 ] : zp[1]:109 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:110 [ init_angle_screen::$10 ] : zp[1]:110 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:111 [ init_angle_screen::$11 ] : zp[1]:111 , reg byte a , reg byte x , reg byte y , @@ -5469,7 +5449,7 @@ Uplifting [sqrt] best 1342197 combination zp[2]:141 [ sqrt::found#0 ] zp[2]:143 Uplifting [memset] best 1342181 combination zp[2]:32 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:123 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:29 [ memset::str#3 ] Uplifting [sqr] best 1341844 combination reg byte a [ sqr::$0 ] reg byte a [ sqr::val#2 sqr::val#1 sqr::val#0 ] zp[2]:135 [ sqr::return#0 ] zp[2]:81 [ sqr::return#3 ] zp[2]:76 [ sqr::return#2 ] Uplifting [init_angle_screen] best 1340244 combination zp[1]:21 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$5 ] zp[2]:104 [ init_angle_screen::angle_w#0 ] zp[2]:106 [ init_angle_screen::$7 ] zp[1]:109 [ init_angle_screen::$9 ] zp[1]:110 [ init_angle_screen::$10 ] zp[1]:111 [ init_angle_screen::$11 ] zp[1]:20 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp[1]:108 [ init_angle_screen::ang_w#0 ] zp[2]:96 [ init_angle_screen::yw#0 ] zp[2]:93 [ init_angle_screen::xw#0 ] zp[1]:15 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp[2]:18 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] zp[2]:16 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] zp[2]:73 [ init_angle_screen::screen#0 ] -Limited combination testing to 100 combinations of 65536 possible. +Limited combination testing to 100 combinations of 331776 possible. Uplifting [init_dist_screen] best 1337044 combination reg byte a [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] zp[1]:13 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] reg byte a [ init_dist_screen::x2#0 ] zp[2]:83 [ init_dist_screen::xds#0 ] zp[2]:85 [ init_dist_screen::ds#0 ] zp[1]:12 [ init_dist_screen::x#2 init_dist_screen::x#1 ] reg byte a [ init_dist_screen::d#0 ] zp[1]:11 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] zp[1]:75 [ init_dist_screen::y2#0 ] zp[1]:6 [ init_dist_screen::y#10 init_dist_screen::y#1 ] zp[2]:9 [ init_dist_screen::screen_bottomline#11 init_dist_screen::screen_bottomline#0 init_dist_screen::screen_bottomline#1 ] zp[2]:7 [ init_dist_screen::screen_topline#11 init_dist_screen::screen#0 init_dist_screen::screen_topline#1 ] zp[2]:78 [ init_dist_screen::yds#0 ] Limited combination testing to 100 combinations of 6144 possible. Uplifting [init_squares] best 1336844 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp[2]:47 [ init_squares::squares#2 init_squares::squares#1 init_squares::squares#0 ] zp[2]:45 [ init_squares::sqr#2 init_squares::sqr#1 ] diff --git a/src/test/ref/screen-center-angle.log b/src/test/ref/screen-center-angle.log index 341f7e9fc..62582f7ce 100644 --- a/src/test/ref/screen-center-angle.log +++ b/src/test/ref/screen-center-angle.log @@ -2319,26 +2319,16 @@ Statement [55] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_ Removing always clobbered register reg byte a as potential for zp[1]:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [56] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [57] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [58] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [59] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [60] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [61] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [63] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [64] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [65] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [67] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:80 [ init_angle_screen::ang_w#0 ] Statement [68] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:80 [ init_angle_screen::ang_w#0 ] -Statement [69] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [70] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [71] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [72] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [73] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [76] clock::return#0 = $ffffffff - *CIA2_TIMER_AB [ clock::return#0 ] ( clock:8 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a Statement [78] print_uint_at::w#0 = > print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( print_ulong_at:13 [ print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a Statement [80] print_uint_at::w#1 = < print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( print_ulong_at:13 [ print_uint_at::w#1 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } } ) always clobbers reg byte a @@ -2405,21 +2395,16 @@ Statement [50] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [51] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [55] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [56] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [57] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [58] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [59] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [60] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [61] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [63] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [64] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [65] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [67] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [67] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [68] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [69] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [70] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [71] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [72] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [73] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( init_angle_screen:6 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [76] clock::return#0 = $ffffffff - *CIA2_TIMER_AB [ clock::return#0 ] ( clock:8 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a Statement [78] print_uint_at::w#0 = > print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( print_ulong_at:13 [ print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a Statement [80] print_uint_at::w#1 = < print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( print_ulong_at:13 [ print_uint_at::w#1 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } } ) always clobbers reg byte a @@ -2464,11 +2449,11 @@ Potential registers zp[2]:7 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo# Potential registers zp[1]:9 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp[1]:9 , reg byte x , Potential registers zp[1]:10 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp[1]:10 , reg byte x , reg byte y , Potential registers zp[1]:11 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp[1]:11 , reg byte x , reg byte y , -Potential registers zp[1]:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:12 , reg byte x , +Potential registers zp[1]:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:12 , reg byte x , reg byte y , Potential registers zp[2]:13 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] : zp[2]:13 , Potential registers zp[2]:15 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] : zp[2]:15 , -Potential registers zp[1]:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:17 , reg byte x , -Potential registers zp[1]:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:18 , reg byte x , +Potential registers zp[1]:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:17 , reg byte x , reg byte y , +Potential registers zp[1]:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:18 , reg byte x , reg byte y , Potential registers zp[2]:19 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] : zp[2]:19 , Potential registers zp[2]:21 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] : zp[2]:21 , Potential registers zp[1]:23 [ atan2_16::i#2 atan2_16::i#1 ] : zp[1]:23 , reg byte x , reg byte y , @@ -2501,7 +2486,7 @@ Potential registers zp[2]:72 [ atan2_16::y#0 ] : zp[2]:72 , Potential registers zp[2]:74 [ atan2_16::return#2 ] : zp[2]:74 , Potential registers zp[2]:76 [ init_angle_screen::angle_w#0 ] : zp[2]:76 , Potential registers zp[2]:78 [ init_angle_screen::$7 ] : zp[2]:78 , -Potential registers zp[1]:80 [ init_angle_screen::ang_w#0 ] : zp[1]:80 , reg byte x , +Potential registers zp[1]:80 [ init_angle_screen::ang_w#0 ] : zp[1]:80 , reg byte x , reg byte y , Potential registers zp[1]:81 [ init_angle_screen::$9 ] : zp[1]:81 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:82 [ init_angle_screen::$10 ] : zp[1]:82 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:83 [ init_angle_screen::$11 ] : zp[1]:83 , reg byte a , reg byte x , reg byte y , @@ -2534,7 +2519,7 @@ Uplifting [init_font_hex] best 1138259 combination reg byte x [ init_font_hex::i Limited combination testing to 100 combinations of 6912 possible. Uplifting [print_char_at] best 1138252 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp[2]:41 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] Uplifting [init_angle_screen] best 1136652 combination zp[1]:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$5 ] zp[2]:76 [ init_angle_screen::angle_w#0 ] zp[2]:78 [ init_angle_screen::$7 ] zp[1]:81 [ init_angle_screen::$9 ] zp[1]:82 [ init_angle_screen::$10 ] zp[1]:83 [ init_angle_screen::$11 ] zp[1]:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp[1]:80 [ init_angle_screen::ang_w#0 ] zp[2]:68 [ init_angle_screen::yw#0 ] zp[2]:65 [ init_angle_screen::xw#0 ] zp[1]:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp[2]:15 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] zp[2]:13 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] -Limited combination testing to 100 combinations of 65536 possible. +Limited combination testing to 100 combinations of 331776 possible. Uplifting [print_uchar_at] best 1136644 combination reg byte a [ print_uchar_at::$0 ] reg byte y [ print_uchar_at::$2 ] zp[2]:38 [ print_uchar_at::at#2 print_uchar_at::at#0 print_uchar_at::at#1 ] zp[1]:37 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] Uplifting [print_uint_at] best 1136644 combination zp[2]:33 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] zp[2]:35 [ print_uint_at::at#2 ] Uplifting [clock] best 1136644 combination zp[4]:84 [ clock::return#0 ] zp[4]:43 [ clock::return#2 ] diff --git a/src/test/ref/screen-show-spiral-buckets.log b/src/test/ref/screen-show-spiral-buckets.log index ac2dc53cf..c19116ee8 100644 --- a/src/test/ref/screen-show-spiral-buckets.log +++ b/src/test/ref/screen-show-spiral-buckets.log @@ -4507,26 +4507,16 @@ Statement [106] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle Removing always clobbered register reg byte a as potential for zp[1]:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [107] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [108] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:22 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [109] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [110] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [111] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [112] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [114] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [115] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [116] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [118] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:124 [ init_angle_screen::ang_w#0 ] Statement [119] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:124 [ init_angle_screen::ang_w#0 ] -Statement [120] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [121] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [122] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [123] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [124] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [129] ((byte*)BUCKET_SIZES#0)[init_buckets::i#2] = 0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:29 [ init_buckets::i#2 init_buckets::i#1 ] Statement [132] init_buckets::dist#6 = init_buckets::screen#0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] { } ) always clobbers reg byte a @@ -4666,21 +4656,16 @@ Statement [101] init_angle_screen::screen_topline#1 = init_angle_screen::screen_ Statement [102] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [106] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [107] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [108] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [109] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [110] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [111] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [112] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [114] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [115] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [116] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [118] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [118] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [119] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [120] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [121] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [122] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [123] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [124] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [129] ((byte*)BUCKET_SIZES#0)[init_buckets::i#2] = 0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] { } ) always clobbers reg byte a Statement [132] init_buckets::dist#6 = init_buckets::screen#0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] { } ) always clobbers reg byte a Statement [134] ((byte*)BUCKET_SIZES#0)[*init_buckets::dist#4] = ++ ((byte*)BUCKET_SIZES#0)[*init_buckets::dist#4] [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#4 init_buckets::i1#2 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#4 init_buckets::i1#2 ] { } ) always clobbers reg byte a reg byte y @@ -4806,21 +4791,16 @@ Statement [101] init_angle_screen::screen_topline#1 = init_angle_screen::screen_ Statement [102] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [106] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [107] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [108] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [109] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [110] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [111] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [112] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [114] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [115] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [116] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [118] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [118] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [119] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [120] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [121] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [122] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [123] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [124] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:13::init_angle_screen:23 [ SCREEN_DIST#0 SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [129] ((byte*)BUCKET_SIZES#0)[init_buckets::i#2] = 0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::i#2 ] { } ) always clobbers reg byte a Statement [132] init_buckets::dist#6 = init_buckets::screen#0 [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#6 ] { } ) always clobbers reg byte a Statement [134] ((byte*)BUCKET_SIZES#0)[*init_buckets::dist#4] = ++ ((byte*)BUCKET_SIZES#0)[*init_buckets::dist#4] [ BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#4 init_buckets::i1#2 ] ( main:13::init_buckets:25 [ SCREEN_ANGLE#0 BUCKET_SIZES#0 BUCKETS#0 BUCKET_IDX#0 heap_head#0 init_buckets::screen#0 init_buckets::dist#4 init_buckets::i1#2 ] { } ) always clobbers reg byte a reg byte y @@ -4910,11 +4890,11 @@ Potential registers zp[1]:18 [ init_dist_screen::yd#0 init_dist_screen::$7 init_ Potential registers zp[1]:19 [ init_dist_screen::x#2 init_dist_screen::x#1 ] : zp[1]:19 , reg byte x , Potential registers zp[1]:20 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] : zp[1]:20 , reg byte x , Potential registers zp[1]:21 [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] : zp[1]:21 , reg byte a , reg byte x , reg byte y , -Potential registers zp[1]:22 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:22 , reg byte x , +Potential registers zp[1]:22 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:22 , reg byte x , reg byte y , Potential registers zp[2]:23 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] : zp[2]:23 , Potential registers zp[2]:25 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] : zp[2]:25 , -Potential registers zp[1]:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:27 , reg byte x , -Potential registers zp[1]:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:28 , reg byte x , +Potential registers zp[1]:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:27 , reg byte x , reg byte y , +Potential registers zp[1]:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:28 , reg byte x , reg byte y , Potential registers zp[1]:29 [ init_buckets::i#2 init_buckets::i#1 ] : zp[1]:29 , reg byte x , reg byte y , Potential registers zp[2]:30 [ init_buckets::dist#4 init_buckets::dist#6 init_buckets::dist#1 ] : zp[2]:30 , Potential registers zp[2]:32 [ init_buckets::i1#2 init_buckets::i1#1 ] : zp[2]:32 , @@ -4971,7 +4951,7 @@ Potential registers zp[2]:116 [ atan2_16::y#0 ] : zp[2]:116 , Potential registers zp[2]:118 [ atan2_16::return#2 ] : zp[2]:118 , Potential registers zp[2]:120 [ init_angle_screen::angle_w#0 ] : zp[2]:120 , Potential registers zp[2]:122 [ init_angle_screen::$7 ] : zp[2]:122 , -Potential registers zp[1]:124 [ init_angle_screen::ang_w#0 ] : zp[1]:124 , reg byte x , +Potential registers zp[1]:124 [ init_angle_screen::ang_w#0 ] : zp[1]:124 , reg byte x , reg byte y , Potential registers zp[1]:125 [ init_angle_screen::$9 ] : zp[1]:125 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:126 [ init_angle_screen::$10 ] : zp[1]:126 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:127 [ init_angle_screen::$11 ] : zp[1]:127 , reg byte a , reg byte x , reg byte y , @@ -5028,7 +5008,7 @@ Limited combination testing to 100 combinations of 144 possible. Uplifting [sqrt] best 1229098 combination zp[2]:159 [ sqrt::found#0 ] zp[2]:161 [ sqrt::$2 ] zp[2]:103 [ sqrt::val#0 ] zp[2]:163 [ sqrt::$1 ] reg byte a [ sqrt::return#0 ] reg byte a [ sqrt::return#2 ] Uplifting [sqr] best 1228761 combination reg byte a [ sqr::$0 ] reg byte a [ sqr::val#2 sqr::val#1 sqr::val#0 ] zp[2]:153 [ sqr::return#0 ] zp[2]:97 [ sqr::return#3 ] zp[2]:92 [ sqr::return#2 ] Uplifting [init_angle_screen] best 1227161 combination zp[1]:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$5 ] zp[2]:120 [ init_angle_screen::angle_w#0 ] zp[2]:122 [ init_angle_screen::$7 ] zp[1]:125 [ init_angle_screen::$9 ] zp[1]:126 [ init_angle_screen::$10 ] zp[1]:127 [ init_angle_screen::$11 ] zp[1]:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp[1]:124 [ init_angle_screen::ang_w#0 ] zp[2]:112 [ init_angle_screen::yw#0 ] zp[2]:109 [ init_angle_screen::xw#0 ] zp[1]:22 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp[2]:25 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] zp[2]:23 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] zp[2]:76 [ init_angle_screen::screen#0 ] -Limited combination testing to 100 combinations of 65536 possible. +Limited combination testing to 100 combinations of 331776 possible. Uplifting [init_dist_screen] best 1223961 combination reg byte a [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] zp[1]:20 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] reg byte a [ init_dist_screen::x2#0 ] zp[2]:99 [ init_dist_screen::xds#0 ] zp[2]:101 [ init_dist_screen::ds#0 ] zp[1]:19 [ init_dist_screen::x#2 init_dist_screen::x#1 ] reg byte a [ init_dist_screen::d#0 ] zp[1]:18 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] zp[1]:91 [ init_dist_screen::y2#0 ] zp[1]:13 [ init_dist_screen::y#10 init_dist_screen::y#1 ] zp[2]:16 [ init_dist_screen::screen_bottomline#11 init_dist_screen::screen_bottomline#0 init_dist_screen::screen_bottomline#1 ] zp[2]:14 [ init_dist_screen::screen_topline#11 init_dist_screen::screen#0 init_dist_screen::screen_topline#1 ] zp[2]:94 [ init_dist_screen::yds#0 ] Limited combination testing to 100 combinations of 6144 possible. Uplifting [init_squares] best 1223761 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp[2]:44 [ init_squares::squares#2 init_squares::squares#1 init_squares::squares#0 ] zp[2]:42 [ init_squares::sqr#2 init_squares::sqr#1 ] diff --git a/src/test/ref/screen-show-spiral.log b/src/test/ref/screen-show-spiral.log index 24b77a673..4a11d191f 100644 --- a/src/test/ref/screen-show-spiral.log +++ b/src/test/ref/screen-show-spiral.log @@ -3418,26 +3418,16 @@ Statement [85] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_ Removing always clobbered register reg byte a as potential for zp[1]:32 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Removing always clobbered register reg byte a as potential for zp[1]:33 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [86] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [87] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:27 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:32 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Removing always clobbered register reg byte y as potential for zp[1]:33 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Statement [88] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [89] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [90] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [91] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [93] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [94] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [95] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:98 [ init_angle_screen::ang_w#0 ] Statement [98] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:98 [ init_angle_screen::ang_w#0 ] -Statement [99] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [100] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [101] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [102] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [103] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [108] SQUARES#0 = (void*)malloc::mem#0 [ SQUARES#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 ] { } ) always clobbers reg byte a Statement [109] init_squares::squares#0 = (word*)SQUARES#0 [ SQUARES#0 init_squares::squares#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::squares#0 ] { } ) always clobbers reg byte a Statement [113] *init_squares::squares#2 = init_squares::sqr#2 [ SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] { } ) always clobbers reg byte a reg byte y @@ -3541,21 +3531,16 @@ Statement [80] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [81] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [85] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [86] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [87] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [88] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [89] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [90] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [91] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [93] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [94] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [95] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [98] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [99] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [100] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [101] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [102] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [103] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [108] SQUARES#0 = (void*)malloc::mem#0 [ SQUARES#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 ] { } ) always clobbers reg byte a Statement [109] init_squares::squares#0 = (word*)SQUARES#0 [ SQUARES#0 init_squares::squares#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::squares#0 ] { } ) always clobbers reg byte a Statement [113] *init_squares::squares#2 = init_squares::sqr#2 [ SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] { } ) always clobbers reg byte a reg byte y @@ -3649,21 +3634,16 @@ Statement [80] init_angle_screen::screen_topline#1 = init_angle_screen::screen_t Statement [81] init_angle_screen::screen_bottomline#1 = init_angle_screen::screen_bottomline#6 + $28 [ init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] { } ) always clobbers reg byte a Statement [85] init_angle_screen::$3 = init_angle_screen::x#2 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [86] init_angle_screen::$4 = $27 - init_angle_screen::$3 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$4 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [87] init_angle_screen::xw#0 = init_angle_screen::$4 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [88] init_angle_screen::$5 = init_angle_screen::y#5 << 1 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$5 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a -Statement [89] init_angle_screen::yw#0 = init_angle_screen::$5 w= 0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte y Statement [90] atan2_16::x#0 = (signed word)init_angle_screen::xw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [91] atan2_16::y#0 = (signed word)init_angle_screen::yw#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [93] atan2_16::return#2 = atan2_16::return#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] { { atan2_16::return#0 = atan2_16::return#2 } } ) always clobbers reg byte a Statement [94] init_angle_screen::angle_w#0 = atan2_16::return#2 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] { } ) always clobbers reg byte a Statement [95] init_angle_screen::$7 = init_angle_screen::angle_w#0 + $80 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$7 ] { } ) always clobbers reg byte a -Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a reg byte y +Statement [97] init_angle_screen::screen_bottomline#6[init_angle_screen::xb#2] = init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte a Statement [98] init_angle_screen::$9 = - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$9 ] { } ) always clobbers reg byte a -Statement [99] init_angle_screen::screen_topline#6[init_angle_screen::xb#2] = init_angle_screen::$9 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [100] init_angle_screen::$10 = $80 + init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$10 ] { } ) always clobbers reg byte a -Statement [101] init_angle_screen::screen_topline#6[init_angle_screen::x#2] = init_angle_screen::$10 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] { } ) always clobbers reg byte y Statement [102] init_angle_screen::$11 = $80 - init_angle_screen::ang_w#0 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$11 ] { } ) always clobbers reg byte a -Statement [103] init_angle_screen::screen_bottomline#6[init_angle_screen::x#2] = init_angle_screen::$11 [ init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:7::init_angle_screen:16 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_angle_screen::y#5 init_angle_screen::screen_topline#6 init_angle_screen::screen_bottomline#6 init_angle_screen::x#2 init_angle_screen::xb#2 ] { } ) always clobbers reg byte y Statement [108] SQUARES#0 = (void*)malloc::mem#0 [ SQUARES#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 ] { } ) always clobbers reg byte a Statement [109] init_squares::squares#0 = (word*)SQUARES#0 [ SQUARES#0 init_squares::squares#0 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::squares#0 ] { } ) always clobbers reg byte a Statement [113] *init_squares::squares#2 = init_squares::sqr#2 [ SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] ( main:7::init_dist_screen:14::init_squares:36 [ SCREEN_DIST#0 SCREEN_ANGLE#0 init_dist_screen::screen#0 SQUARES#0 init_squares::i#2 init_squares::sqr#2 init_squares::squares#2 ] { } ) always clobbers reg byte a reg byte y @@ -3731,11 +3711,11 @@ Potential registers zp[1]:23 [ init_dist_screen::yd#0 init_dist_screen::$7 init_ Potential registers zp[1]:24 [ init_dist_screen::x#2 init_dist_screen::x#1 ] : zp[1]:24 , reg byte x , Potential registers zp[1]:25 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] : zp[1]:25 , reg byte x , Potential registers zp[1]:26 [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y , -Potential registers zp[1]:27 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:27 , reg byte x , +Potential registers zp[1]:27 [ init_angle_screen::y#5 init_angle_screen::y#1 ] : zp[1]:27 , reg byte x , reg byte y , Potential registers zp[2]:28 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] : zp[2]:28 , Potential registers zp[2]:30 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] : zp[2]:30 , -Potential registers zp[1]:32 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:32 , reg byte x , -Potential registers zp[1]:33 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:33 , reg byte x , +Potential registers zp[1]:32 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp[1]:32 , reg byte x , reg byte y , +Potential registers zp[1]:33 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp[1]:33 , reg byte x , reg byte y , Potential registers zp[1]:34 [ init_squares::i#2 init_squares::i#1 ] : zp[1]:34 , reg byte x , Potential registers zp[2]:35 [ init_squares::sqr#2 init_squares::sqr#1 ] : zp[2]:35 , Potential registers zp[2]:37 [ init_squares::squares#2 init_squares::squares#1 init_squares::squares#0 ] : zp[2]:37 , @@ -3774,7 +3754,7 @@ Potential registers zp[2]:90 [ atan2_16::y#0 ] : zp[2]:90 , Potential registers zp[2]:92 [ atan2_16::return#2 ] : zp[2]:92 , Potential registers zp[2]:94 [ init_angle_screen::angle_w#0 ] : zp[2]:94 , Potential registers zp[2]:96 [ init_angle_screen::$7 ] : zp[2]:96 , -Potential registers zp[1]:98 [ init_angle_screen::ang_w#0 ] : zp[1]:98 , reg byte x , +Potential registers zp[1]:98 [ init_angle_screen::ang_w#0 ] : zp[1]:98 , reg byte x , reg byte y , Potential registers zp[1]:99 [ init_angle_screen::$9 ] : zp[1]:99 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:100 [ init_angle_screen::$10 ] : zp[1]:100 , reg byte a , reg byte x , reg byte y , Potential registers zp[1]:101 [ init_angle_screen::$11 ] : zp[1]:101 , reg byte a , reg byte x , reg byte y , @@ -3816,7 +3796,7 @@ Limited combination testing to 100 combinations of 144 possible. Uplifting [sqrt] best 1222383 combination zp[2]:113 [ sqrt::found#0 ] zp[2]:115 [ sqrt::$2 ] zp[2]:77 [ sqrt::val#0 ] zp[2]:117 [ sqrt::$1 ] reg byte a [ sqrt::return#0 ] reg byte a [ sqrt::return#2 ] Uplifting [sqr] best 1222046 combination reg byte a [ sqr::$0 ] reg byte a [ sqr::val#2 sqr::val#1 sqr::val#0 ] zp[2]:107 [ sqr::return#0 ] zp[2]:71 [ sqr::return#3 ] zp[2]:66 [ sqr::return#2 ] Uplifting [init_angle_screen] best 1220446 combination zp[1]:33 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$5 ] zp[2]:94 [ init_angle_screen::angle_w#0 ] zp[2]:96 [ init_angle_screen::$7 ] zp[1]:99 [ init_angle_screen::$9 ] zp[1]:100 [ init_angle_screen::$10 ] zp[1]:101 [ init_angle_screen::$11 ] zp[1]:32 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp[1]:98 [ init_angle_screen::ang_w#0 ] zp[2]:86 [ init_angle_screen::yw#0 ] zp[2]:83 [ init_angle_screen::xw#0 ] zp[1]:27 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp[2]:30 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 ] zp[2]:28 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#7 init_angle_screen::screen_topline#1 ] zp[2]:63 [ init_angle_screen::screen#0 ] -Limited combination testing to 100 combinations of 65536 possible. +Limited combination testing to 100 combinations of 331776 possible. Uplifting [init_dist_screen] best 1217246 combination reg byte a [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] zp[1]:25 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] reg byte a [ init_dist_screen::x2#0 ] zp[2]:73 [ init_dist_screen::xds#0 ] zp[2]:75 [ init_dist_screen::ds#0 ] zp[1]:24 [ init_dist_screen::x#2 init_dist_screen::x#1 ] reg byte a [ init_dist_screen::d#0 ] zp[1]:23 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] zp[1]:65 [ init_dist_screen::y2#0 ] zp[1]:18 [ init_dist_screen::y#10 init_dist_screen::y#1 ] zp[2]:21 [ init_dist_screen::screen_bottomline#11 init_dist_screen::screen_bottomline#0 init_dist_screen::screen_bottomline#1 ] zp[2]:19 [ init_dist_screen::screen_topline#11 init_dist_screen::screen#0 init_dist_screen::screen_topline#1 ] zp[2]:68 [ init_dist_screen::yds#0 ] Limited combination testing to 100 combinations of 6144 possible. Uplifting [init_squares] best 1217046 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp[2]:37 [ init_squares::squares#2 init_squares::squares#1 init_squares::squares#0 ] zp[2]:35 [ init_squares::sqr#2 init_squares::sqr#1 ]