Jump to content
IGNORED

Session 15 - Playfield top wall displaying 2x as large


Recommended Posts

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.

post-68101-0-56234800-1554676791.png

post-68101-0-57507700-1554676797.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...