From 22d12dc34f644bbbae4c39cf87ee51130d97c269 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Mon, 3 Jul 2017 07:54:40 -0700 Subject: [PATCH] Fixed push/pull framework. Works on page1 --- HiSprite.py | 13 ++++++++----- multitest.dsk | Bin 143360 -> 143360 bytes multitest.s | 14 ++++++-------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/HiSprite.py b/HiSprite.py index 7ab1b5a..92bad48 100755 --- a/HiSprite.py +++ b/HiSprite.py @@ -412,11 +412,15 @@ class Sprite(Listing): return cycleCount, optimizationCount def rowStartCalculatorCode(self, row, baselabel): + if self.double_buffer: + first = self.height - 1 + else: + first = 0 self.out() self.comment_line("row %d" % row) if self.double_buffer: - if row == self.height - 1: - label = "%s_pageloop" % (baselabel) + if row == first: + label = "%s_PAGELOOP" % (baselabel) self.asm("ldx PARAM1") self.asm("ldy #%d" % self.height) self.label(label) @@ -425,11 +429,10 @@ class Sprite(Listing): self.asm("inx") self.asm("dey") self.asm("bne %s" % label) - self.asm("dex") + self.asm("ldx PARAM1") self.asm("pla") cycles = 3 else: - self.asm("dex") self.asm("pla") cycles = 4 else: @@ -443,7 +446,7 @@ class Sprite(Listing): self.asm("sta SCRATCH1") self.asm("lda HGRROWS_L+%d,x" % row) self.asm("sta SCRATCH0") - if row == 0: + if row == first: self.asm("ldy PARAM0") self.asm("lda DIV%d_%d,y" % (self.screen.numShifts, self.screen.bitsPerPixel)) self.asm("sta PARAM2") # save the mod lookup; it doesn't change diff --git a/multitest.dsk b/multitest.dsk index 77a4af986d041f8069cda09dadc8f0def2e8a21f..6c5a7109b96fd4dcc4d2f8f172929c88f1c15cac 100644 GIT binary patch literal 143360 zcmeI%e{7Xk8Nl(|AN1ZcP&$yotz}%sx)#=LI0aERDZ;j*Z0nGUZaUw$gAFEhT+kQ^wnv@iu41X2)LN5gW|png@q+?+um^IqkSDPi)!x{Y4m__kElz~9=XDQBBrG)?bZx#_QkriksO-}nbSUuc?o zz;lJBsnZ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Q0*~0R#|0009ILKmY**5I_I{ z1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009IL zKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~ z0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY** z5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0 z009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{ N1Q0*~fls=?e*uF;pTPhC diff --git a/multitest.s b/multitest.s index 93f1bac..c684ef1 100644 --- a/multitest.s +++ b/multitest.s @@ -22,8 +22,7 @@ SCRATCH1 = $1a SPRITEPTR_L = $1b SPRITEPTR_H = $1c RENDERCOUNT = $ce -FRAMECOUNT = $cf ; used to determine page currently displayed: even -> page1, odd -> page2 -VISIBLEPAGE = $d7 +DRAWPAGE = $d7 ; pos = page1, neg = page2 BGSTORE = $fa TEMPADDR = $fc @@ -63,7 +62,7 @@ fasttoggle initonce lda #0 - sta FRAMECOUNT + sta DRAWPAGE rts @@ -72,11 +71,10 @@ initsprites rts pageflip - inc FRAMECOUNT - lda FRAMECOUNT - and #1 - sta VISIBLEPAGE - beq pageflip1 + lda DRAWPAGE + eor #$80 + sta DRAWPAGE + bpl pageflip1 bit TXTPAGE2 rts pageflip1