Jump to content
IGNORED

Playfield Error


Recommended Posts

I am trying to create a very simple playfield, however, for some reason, the playfield seems to come out incorrectly. First off the playfield color is wrong but, that's a fix for later. The issue is the playfield seems to be rotated, like the TV fell on its side :twisted: Here is what I mean:

6hza1Ve.png

Here's the latest version of my source code: https://www.dropbox.com/s/ko4gksqoplxl6ir/has_10-5-18.zip?dl=0

Also here's a link to the binary: https://www.dropbox.com/s/auqkkwoecu6bvn9/has.bin?dl=0

Link to comment
Share on other sites

Currently your code only updates the playfield if PlayerY is equal to whatever's in the Y register. Every other time, it skips over the playfield update. I'd move the playfield updates to just after you store PlayerBuffer into GRP0.

Moved the code as suggested and still am having issues. The playfield should be brown at the very bottom and blue at the top. Instead, the playfield is split between the top and bottom of the screen. Also, the background color is not being set properly despite:

BLUE               equ                 #$80

   lda BLUE                                                                    ; color code for blue
   sta COLUBK                                                                  ; set background color

Any ideas?

 

Source: https://www.dropbox.com/s/od8a0w4ezayx4zg/Source_11-9-18.zip?dl=0

Link to comment
Share on other sites

There's two things going with the playfield.

 

First, the Playfield registers are still set to non-zero values when the next frame shows up. Try setting the playfield registers to zero in the overscan.

 

Secondly, while you have 192 values in each PlayfieldData list, when the Y register is set to 192 it's actually looking for the 193rd value when you load PF0Data,y into the A register, so it loads in some funky values.

 

Not entirely sure what's going on with the background. Have you tried it without the constant to see if anything changes?

Link to comment
Share on other sites

There's two things going with the playfield.

 

First, the Playfield registers are still set to non-zero values when the next frame shows up. Try setting the playfield registers to zero in the overscan.

 

Secondly, while you have 192 values in each PlayfieldData list, when the Y register is set to 192 it's actually looking for the 193rd value when you load PF0Data,y into the A register, so it loads in some funky values.

 

Not entirely sure what's going on with the background. Have you tried it without the constant to see if anything changes?

Ok I will try reducing the loop to 191, and set the playfield registers to 0 on overscan. thanks.

lda #BLUE

 

Constants require the # symbol. Otherwise, the assembler misinterprets them as addresses.

Even if they already have a #'s in them?

 

Heroes & Shadows

https://heroesandshadowsgame.neocities.org

Edited by Heroes & Shadows
Link to comment
Share on other sites

# tags are superfluous in equate tables (they aren't needed in data tables, either). The assembler only knows that BLUE = $80. By using the LDA instruction without the tag causes it to be translated to "fetch the accumulator from the address $80" instead of "put the value of #$80 into the accumulator".

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...