This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Emulator FCEUXDSP not showing sprite coordinates correctly!

Emulator FCEUXDSP not showing sprite coordinates correctly!
by on (#55980)
I am using 2 emulators: FCEUXDSP and NesTen. fexuxdsp is not giving me the correct Y coordinates value of sprite0. When I see the value of Y coordinate of sprite0(i.e. $0200) in fceuxdsp's Hex editor, it is not showing the correct value. for example if the correct value of Y should be $20 then its showing $1D .

This is creating inaccuracy in my collision detection process.

Any suggestions???

by on (#55981)
I'm not sure I understand your problem. Anything at $0200 (supposing that's the page you use for sprite DMA) onwards is placed there by you, so if something is wrong it's you who placed the wrong value there, the NES doesn't modify those RAM locations in any way.

You probably understood something wrong about how the NES works. Please explain better what you are trying to do and how so that we can understand each other.

by on (#56002)
tokumaru wrote:
I'm not sure I understand your problem. Anything at $0200 (supposing that's the page you use for sprite DMA) onwards is placed there by you, so if something is wrong it's you who placed the wrong value there, the NES doesn't modify those RAM locations in any way.

You probably understood something wrong about how the NES works. Please explain better what you are trying to do and how so that we can understand each other.


Please see the sceenshot http://i951.photobucket.com/albums/ad35 ... d_pic1.jpg

The blue square is my character.It has 4 sprites labelled with their respective sprite numbers 0,1,2 and 3. As per my understanding the left top at the moment is at Y=$20 but $0200 in Hex editor is showing Y=$1E.

It's quite possible that I have misunderstood something. But at the moment i have no clue to spot what's wrong with my knowledge. Perhaps this screenshot will help you understand my question better.

by on (#56004)
Either that or the Y value is in fact $1E but the background is scrolled to (0, 2). What are you writing to PPUSCROLL ($2005) twice before you turn on rendering? When you load map data into VRAM, it corrupts the scroll position, and you need to reset it (lda #0 sta $2005 sta $2005).

by on (#56007)
tepples wrote:
Either that or the Y value is in fact $1E but the background is scrolled to (0, 2). What are you writing to PPUSCROLL ($2005) twice before you turn on rendering? When you load map data into VRAM, it corrupts the scroll position, and you need to reset it (lda #0 sta $2005 sta $2005).


Indeed!
I was not resetting $2005 to $00 twice. Now I am doing that and am getting expected coordinates.

What is the best place in the program where this code can be put?

by on (#56009)
You should reset the scroll every VBlank, right after you're done writing data to the PPU, so that the next frame can start rendering from the position you specify. Remember to not only write to $2005 twice, but also write to $2000 once to select which name table you want to display.