Writing to OAM without dma

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Writing to OAM without dma
by on (#25923)
Does this ever actually happen?
Re: Writing to OAM without dma
by on (#25924)
Dwedit wrote:
Does this ever actually happen?


I actually tried this using my PowerPak (before I sent it back for fixing) and obviously it works but it seems to be required to do this every frame since the sprites disappear otherwise. :) This is a behaviour that doesn't seem to be handled by most emulators(?) by the way...
If only a few sprites should be updated, this would be the way to go since it doesn't take 513(?) cycles as sprite-DMA does.

by on (#25925)
Are you sure about the disappearing sprites?
Metal Max does not update the OAM while the dialog windows are visible.

by on (#25926)
Dwedit wrote:
Are you sure about the disappearing sprites?
Metal Max does not update the OAM while the dialog windows are visible.


I only did a simple test where I copied the sprites only once using $2004 and I never saw any sprites on the screen at all. However the same ROM looks good in Nintendulator so I guess that behaviour isn't emulated.

by on (#25927)
Have the exact conditions/implications been determined for this phenomenon? I mean, would every NES in the world behave the same way? In that case, I guess it wouldn't be a major pain to implement this in an emulator..

By the way, is it there any comercial prog relying on such a phenomenon?

by on (#25931)
As I understand it, OAM will start to decay only if you leave the rendering turned off for at least a frame.

As for timing, I see about 45 cycles per sprite:
Code:
:
  lda $200,x
  sta OAMDATA
  inx
  lda $200,x
  sta OAMDATA
  inx
  lda $200,x
  sta OAMDATA
  inx
  lda $200,x
  sta OAMDATA
  inx
  dey
  bne :-

So if you have more than about 11 sprites, DMA is faster, unless you really need a rock-solid real-time loop for $4011 audio playback.