Jump to content

Photo

Session 15 - Playfield top wall displaying 2x as large


3 replies to this topic

#1 samcan OFFLINE  

samcan

    Combat Commando

  • 1 posts

Posted Sun Apr 7, 2019 4:40 PM

Hi, I tried the exercise from Sessions 14-15 to draw a box around the playfield. But my code is rendering funky in both Stella and z26. In Stella, the top wall is rendering twice as thick as the horizontal walls, while the bottom wall is the same thickness as the horizontal walls. (My understanding is that the top wall should be the same thickness.) In z26, the top wall is roughly 4x thicker than the horizontal walls, with a corresponding black gap at the bottom of the screen with a thin red line below that.  I tried Andrew Davie's exercise code provided in Session 15, and the output looks very similar to mine in both Stella and z26, not matching what the screenshot shows. Though his has a black background (mine has the rainbow background), he still has the extra thick top wall, and in z26, the black gap on the bottom.

 

I'm using z26 3.02.01, and Stella 6.0. I'm compiling my code with dasm 2.20.11:

dasm.exe "..\..\Documents\Docs\@Inbox\atari\playfield-3.asm" -lplayfield-3.txt -f3 -v5 -oplayfield-3.bin

My code follows:

				processor 6502
				include "vcs.h"

PAT_PF0_THICK			= %11110000
PAT_PF0_THIN			= %00010000
PAT_PF_THICK			= %11111111
PAT_PF_NONE			= %00000000

				SEG
				ORG $f000


; Clear RAM and all TIA registers
Reset
				ldx #0
				lda #0
Clear
				sta 0,x
				inx
				bne Clear


				; once-only initialization
				lda #$45
				sta COLUPF
				
				; mirror the playfield
				lda #%00000001
				sta CTRLPF

				ldy #0


StartOfFrame
				; vertical sync
				lda #0
				sta VBLANK

				lda #2
				sta VSYNC

				sta WSYNC
				sta WSYNC
				sta WSYNC

				lda #0
				sta VSYNC


				; vertical blank
				ldx #0
VerticalBlank			sta WSYNC
				inx
				cpx #37
				bne VerticalBlank


				; start drawing picture
				ldx #0

				; start drawing top wall
				lda #PAT_PF0_THICK
				sta PF0
				
				lda #PAT_PF_THICK
				sta PF1
				sta PF2

PictureTop			sta WSYNC
				inx
				cpx #8
				bne PictureTop

				
				
				; start drawing main area
				lda #PAT_PF0_THIN
				sta PF0
				
				lda #PAT_PF_NONE
				sta PF1
				sta PF2
			
PictureMain			stx COLUBK
				sta WSYNC
				inx
				cpx #184
				bne PictureMain



				; start drawing bottom wall
				lda #PAT_PF0_THICK
				sta PF0
				
				lda #PAT_PF_THICK
				sta PF1
				sta PF2

PictureBottom			stx COLUBK
				sta WSYNC
				inx
				cpx #192
				bne PictureBottom




				; overscan area
				lda #%01000010
				sta VBLANK
				ldx #0
Overscan			sta WSYNC
				inx
				cpx #30
				bne Overscan

				jmp StartOfFrame



				ORG $FFFA
InterruptVectors
				.word Reset
				.word Reset
				.word Reset

				END

Thank you.

Attached Thumbnails

  • Stella.png
  • z26.png


#2 stephena OFFLINE  

stephena

    River Patroller

  • 3,390 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Sun Apr 7, 2019 5:02 PM

I just tried this code on an actual console, and the output matches Stella 6.0 exactly (well, except the colours are slightly different, but that's to be expected).  z26 hasn't been updated in many years, and I recommend to do all further testing in Stella.



#3 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,933 posts
  • Location:The land of Gorch

Posted Mon Apr 8, 2019 1:50 PM

Aside from not being updated in (nearly) a couple of decades, z26 was only useful for producing a detailed trace file...but that isn't needed with Stella's current version, since the time machine function is more convenient.  Plus you get real-time results when altering things on-the-fly, which is impossible to do with z26.



#4 Andrew Davie OFFLINE  

Andrew Davie

    Stargunner

  • 1,837 posts
  • Dr.Boo
  • Location:Tasmania

Posted Tue Apr 9, 2019 5:43 AM

Try setting PF0, PF1 and PF2 to 0 after the PictureBottom loop


Edited by Andrew Davie, Tue Apr 9, 2019 5:44 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users