Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.
Hello, everybody. If you played 'Nuts & Milk', you may notice a little white
scratch on the top of the screen in NTSC mode. And in PAL emulation it becomes smthng like big arrow... Well, I assume, that it's attrib table data, and maybe it's connected with loopy's document about scrolling:
you can think of bits 5,6,7,8,9 as the "y scroll"(*8). this functions
slightly different from the X. it wraps to 0 and bit 11 is switched when
it's incremented from _29_ instead of 31. there are some odd side effects
from this.. if you manually set the value above 29 (from either 2005 or
2006), the wrapping from 29 obviously won't happen, and attrib data will be used as name table data.
So, the question is: could this white thing be removed?
Ah, I've mistaken: I mean, the problem is garbage pixel line on top of the screen. And arrow=sprite- it's all right with it.
Hmm. Thanks, but how can it be done? I mean, I can't believe, that Game Developers just forgot to make proper scrolling...
Anyway, sorry for that, but can anybody tell me how to start from line 224 of the other nametable?
griever wrote:Ah, I've mistaken: I mean, the problem is garbage pixel line on top of the screen. And arrow=sprite- it's all right with it.
If it's a sprite, then that means the problem is with the way the RAM copy of OAM is being cleared. Clearing OAM to 0 will result in a bunch of overlapping sprites whose upper left corner is (0, 1). These will often (but not always) be hidden by the NTSC overscan. The proper method is to clear OAM to the value $F0, which positions the unused sprites below the screen.
Hmm. Thanks, but how can it be done? I mean, I can't believe, that Game Developers just forgot to make proper scrolling...
Anyway, sorry for that, but can anybody tell me how to start from line 224 of the other nametable?
PPUCTRL = $2000
PPUSCROLL = $2005
lda lastPPUCTRL ; you should have a variable like this
eor #$02 ; toggle the vertical nametable selection bit
sta PPUCTRL
lda #0 ; or whatever other X-scroll value you want
sta PPUSCROLL
lda #232 ; or whatever other X-scroll value you want
sta PPUSCROLL
Graphical glitches at the top (and bottom) of the screen can go unnoticed because these edges are often cut off due to NTSC overscan. In fact, there are some situations where glitches are unavoidable (for instance, sprites cannot scroll smoothly off the top of the screen).
Developers often do screw things up, causing glitches that are unnecessary. An example is Legend of Zelda's vertical scrolling engine, which (a) doesn't write to $2006 with the correct value (causing a small vertical "shake" at the start/end of the scroll) and (b) writes to $2006 too early, causing a small graphical glitch in the lower-right corner of the status bar. The game also reads twice from $2007 after writing to $2006, which suggests that they really didn't know how the trick worked to begin with.
"Last version was better," says Floyd. "More bugs. Bugs make game fun."
So, this code must be executed every scroll refresh? Well, I've made a little hack, but nothing changed...
Plus this sprite - even if it's coordinates=F0 or > it doesn't disappear!
I think, it's just another sprite with same index appeared.
Ah, damn. Well, nevermind - I guess it's just not for my knowledge. Thanks for anwers!
griever wrote:So, this code must be executed every scroll refresh? Well, I've made a little hack, but nothing changed...
A graphics engine that draws a varying number of sprites in the scene usually clears out the rest of the display list before sending it to the PPU. For example, Tetramino does this at the end of each frame:
What the hell? STA $2007 = #$00 A:10 <--!!! where did this 'A=$10' come from :shock:
Zero Page,X mode wraps to zero page if the addition of X causes it to exceed $00FF. The debugger here is showing an incorrect read address (and thus, an incorrect read value). That LDA is actually reading from $0044... which apparently contains $10.