From f60c94a374cb213f37b4c211bae1e0b05d250ad7 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Thu, 21 Jan 2021 12:51:17 +0100 Subject: [PATCH] Cleaning the code a bit --- .../cache/fragment-cache-wdc65c02.asm | 84 +++++++++++++++++++ .../kc/examples/cx16/tilemap_4bpp_8_x_8.c | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/src/main/fragment/cache/fragment-cache-wdc65c02.asm b/src/main/fragment/cache/fragment-cache-wdc65c02.asm index a65aa895b..5216ceb6d 100644 --- a/src/main/fragment/cache/fragment-cache-wdc65c02.asm +++ b/src/main/fragment/cache/fragment-cache-wdc65c02.asm @@ -3189,3 +3189,87 @@ sta {z1}+3 //FRAGMENT vbuz1=vbuaa_bor_vbuz1 ora {z1} sta {z1} +//FRAGMENT vbuz1=vbuz1_plus_2 +lda {z1} +clc +adc #2 +sta {z1} +//FRAGMENT vbuxx=vbuxx_plus_2 +inx +inx +//FRAGMENT vbuz1=vbuz1_plus_1 +inc {z1} +//FRAGMENT vduz1=vbuc1 +lda #{c1} +sta {z1} +lda #0 +sta {z1}+1 +sta {z1}+2 +sta {z1}+3 +//FRAGMENT pbuc1_derefidx_vbuz1=pbuc1_derefidx_vbuz1_plus_1 +ldy {z1} +lda {c1},y +inc +sta {c1},y +//FRAGMENT vwuz1=vwuz1_plus_vwuc1 +clc +lda {z1} +adc #<{c1} +sta {z1} +lda {z1}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vbuz1=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +sta {z1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuz1 +lda {c1} +and {z1} +sta {c1} +//FRAGMENT pbuc1_derefidx_vbuaa=pbuc1_derefidx_vbuaa_plus_1 +tay +lda {c1},y +inc +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuxx=pbuc1_derefidx_vbuxx_plus_1 +lda {c1},x +inc +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuyy=pbuc1_derefidx_vbuyy_plus_1 +lda {c1},y +inc +sta {c1},y +//FRAGMENT vbuaa=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +//FRAGMENT vbuxx=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +tax +//FRAGMENT vbuyy=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +tay +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuaa +and {c1} +sta {c1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuxx +txa +and {c1} +sta {c1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuyy +tya +and {c1} +sta {c1} +//FRAGMENT vbuyy_neq_0_then_la1 +cpy #0 +bne {la1} +//FRAGMENT vwuz1=vwuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: diff --git a/src/test/kc/examples/cx16/tilemap_4bpp_8_x_8.c b/src/test/kc/examples/cx16/tilemap_4bpp_8_x_8.c index 9fe021fcc..ae9e7eaac 100644 --- a/src/test/kc/examples/cx16/tilemap_4bpp_8_x_8.c +++ b/src/test/kc/examples/cx16/tilemap_4bpp_8_x_8.c @@ -2,7 +2,7 @@ // Demonstrates the usage of the VERA tile map modes and layering. // Author: Sven Van de Velde -ยต + #include #include