Heroes & Shadows Posted November 6, 2018 Share Posted November 6, 2018 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 Here is what I mean: 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 Quote Link to comment Share on other sites More sharing options...
Heroes & Shadows Posted November 8, 2018 Author Share Posted November 8, 2018 (edited) Update: Fixed the playfield color issue. Still having issues with the playfield coming up messed up as shown in the screenshot above. Tried align 256 to no avail. Edited November 8, 2018 by Heroes & Shadows Quote Link to comment Share on other sites More sharing options...
bluswimmer Posted November 8, 2018 Share Posted November 8, 2018 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. Quote Link to comment Share on other sites More sharing options...
Heroes & Shadows Posted November 10, 2018 Author Share Posted November 10, 2018 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 Quote Link to comment Share on other sites More sharing options...
bluswimmer Posted November 10, 2018 Share Posted November 10, 2018 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? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 10, 2018 Share Posted November 10, 2018 (edited) lda #BLUE Constants require the # symbol. Otherwise, the assembler misinterprets them as addresses. Edited November 10, 2018 by Nukey Shay Quote Link to comment Share on other sites More sharing options...
Heroes & Shadows Posted November 10, 2018 Author Share Posted November 10, 2018 (edited) 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 November 10, 2018 by Heroes & Shadows Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted November 10, 2018 Share Posted November 10, 2018 # 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". Quote Link to comment Share on other sites More sharing options...
tokumaru Posted November 11, 2018 Share Posted November 11, 2018 Some assemblers do allow you to define symbols whose values start with a #, and the # will in fact be honored when the symbols are used, but that greatly hurts the readability of your code. Quote Link to comment Share on other sites More sharing options...
tokumaru Posted November 11, 2018 Share Posted November 11, 2018 (edited) Double posted due to Wi-Fi trouble. Edited November 11, 2018 by tokumaru Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.