castlevania 2 simon's quest graphics jumpy virt, horz ok

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
castlevania 2 simon's quest graphics jumpy virt, horz ok
by on (#18584)
problems with castlevania 2. the title screen is ok, the start/password screen is jumpy virticaly but about 5 tiles (and several inbetween). also, the background is wrong too ( i think that might be a mapper problem ?)

after i hit start, the town is all jumpy, again about 5 tiles with a few inbetween. walking right will stablize it. the sprites are fine.

i was watching the ppu address at the beginning of the render frame and it was eratic. the lower 3 bits of the virtical tile were eratic, and the lower 2 of the fine virtical were eratic.

i was messing with the vram address registers and the virtical increment durning rendering and didnt find the problem. i tried changing some code around to break it (thinking i would get closer to the problem); that did mess up the graphics but the garbage graphics would jump up and down the same.

at the moment i am at a loss. any idea's

thanks

matt

by on (#18586)
It could theoratically all be due to improper MMC1 emulation. Try getting the simple mapper games to run good first. (mapper 0, UNROM)

by on (#19050)
i have some of the simple mappers working. and i dont think its a mapper problem. the pages the mapper switches are larger than what seems to be wrong. i was watching the reads and writes to the ppu registers and i see it writing to 2006 twice and 2005. same value all the time. so the play field should be constant. however, it writes to it on the first few scan lines while the ppu is rendering. like scanline 0, 1, 3, 5. i know the hardware nes doesnt show these lines, dont think its right since its still rendering and not the same line. not sure whats up with that. any idea's ?

also, all (except mmc3 and apu) pass except vbl_clear_time. can not get that to pass. and pputime2 only shows a black screen. i think a long time ago it showed a white square like it should.

matt

by on (#19063)
Sorry, can't help you much here..
Quote:
it writes to it on the first few scan lines while the ppu is rendering. like scanline 0, 1, 3, 5. i know the hardware nes doesnt show these lines, dont think its right since its still rendering and not the same line.
It writes inside vblank here.
Quote:
except vbl_clear_time
That shouldn't matter for Castlevania 2, breaking vblank flag clear (or set) timing here doesn't break that game.

by on (#19071)
hap wrote:
Quote:
it writes to it on the first few scan lines while the ppu is rendering. like scanline 0, 1, 3, 5. i know the hardware nes doesnt show these lines, dont think its right since its still rendering and not the same line.

It writes inside vblank here.


sorry, perhaps i didnt post that well, i meant it was writing on scanline 0, 1, 3, and 5 of rendering. when i watched my debug of ppu register reads and writes, it would set the ppu address on right at the beginning of the pre render line. then the next render frame it would set the ppu address on scanline 3 or 5 after the pre render line.

i wasnt sure why it was setting the ppu address so late, and inconsistenly on different scan lines resulting in a different ppu address used since setting it late would mess up the counters on it.

thanks

matt

by on (#19075)
Is your VBLANK duration correct? Is Sprite DMA taking the right number of cycles? Have you verified that your CPU core's timing is correct?

Any of these could be causing the problems you describe.

by on (#19077)
i update my cpu cycle counter with this and the instruction gets incremented separately
Code:
cpu_cc += 15 * 513;

here is a dump of the ppu register reads and writes for the last few render frames. http://zark.homelinux.org/~matt/nes/dump.castlevania2 the line number is the line while rendering, meaningless in vblank. cpu cc is the cpu cylce or tick * 15

i noticed that it does the sprite dma twice. does anyone have a dump of the reads and write to the ppu registers or familiar with castlevania 2 ? does this game use nmi interrupts or polling for vblank?

all of blarggs timing test pass except vbl_clear_time.nes and kevtris pputime2 does not work.

i thought the cpu was good on timing. not sure how else to test it.

thanks

matt

by on (#19084)
i didnt have monochrome coded for pputime2, now it works. shown here http://zark.homelinux.org/~matt/nes/putime2.nes.png it vibrates left and right by about 3 pixels as suggested in the source. so i assume the timing is ok, still stuck on castlevania 2.

thanks

matt

by on (#19100)
mattmatteh wrote:
i noticed that it does the sprite dma twice.


This is likely your problem. Having quickly checked, it should only be writing to $4014 once per VBlank when the main game is running.

Quote:
does this game use nmi interrupts or polling for vblank?


Virtually all commercial games use NMIs because $2002 polling is unreliable.

by on (#19102)
As I understand it, games poll PPUSTATUS ($2002) in only two places:
  1. while waiting two frames for the PPU to warm up after reset, and
  2. while waiting for sprite 0 overlap.