[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vr/ - Retro Games

Search:


View post   

>> No.8064685 [View]
File: 86 KB, 1692x772, smb2_dma.png [View same] [iqdb] [saucenao] [google]
8064685

>>8064607
> sprite X/Y position registers
There aren't any. What you do is reserve a page in RAM as the sprite table (usually $200-$2FF) and copy it over to OAM every frame in vBlank with the sprite DMA function.
https://wiki.nesdev.com/w/index.php/PPU_OAM
Each byte in your page is Y position, Tile, Attributes (palette, flip, BG overlap), and X position; these 4 bytes are repeated 64 times and those are your available sprites.
To copy it over, do the following in Vertical Blank:
LDA $#00
STA $2003 (OAM addr)
LDA #$02
STA $4014 (OAM DMA initialize)
After you do this, the next 512 cycles will copy that page ($200-$2FF) of RAM into OAM memory and your sprites will be where you tell them to be.
I hope that makes sense, let me know if it doesn't.

>> No.7334061 [View]
File: 86 KB, 1692x772, smb2_dma.png [View same] [iqdb] [saucenao] [google]
7334061

>>7333995
Well, first things first, you can use the step through debugger on a frame when the graphics screw up to see if it is running past vBlank. If you can verify that's the issue, then maybe you can rework it.

>> No.7301769 [View]
File: 86 KB, 1692x772, smb2_dma.png [View same] [iqdb] [saucenao] [google]
7301769

>>7301749
> YYCHR
godlike
> FCEUX
i used it too for a long time, it was the best emulator for hacking; Mesen really does improve on what it can do though, the step through debugger (especially), RAM / ROM / CHR viewing tools, and scripting are on another level though. I'd give it a fair shot.

>> No.6967408 [View]
File: 86 KB, 1692x772, smb2_dma.png [View same] [iqdb] [saucenao] [google]
6967408

>>6967116
>>6967370
That is a different issue. Sprite DMA occurs (usually) every frame and takes roughly 4 of the 20 scanlines of vBlank (512 CPU cyc) to copy every sprite from CPU ram to OAM ram. A copy of the entire sprite table is usually stored in $200-$2FF for easy manipulation. Here is it happening in SMB2.

Navigation
View posts[+24][+48][+96]