What's new

Nes

aprentice

Moderator
Surely I could ;)

If i remember correctly, last time i made an nes emu it ran more commercial than yours >:p You should give it a go, im getting kinda lonely being the only one on this forum working on one, im not doing crazy optimizations this time because i want to focus more on accuracy and everyones cpu has a few cores nowadays so it doesnt matter lol
 

hap

New member
I recently started working on my NES emu again after a few months of doing hardly any programming at all. Hard for me to get into it after a long break but I'll get there =]
 

ShizZy

Emulator Developer
Indeed, same here, it's been a while since I've seriously dabbled with any emulation programming.
 

aprentice

Moderator
I recently started working on my NES emu again after a few months of doing hardly any programming at all. Hard for me to get into it after a long break but I'll get there =]

hap, what are you returning if a game tries to read for example location 0x2000 a write only register?
 

hap

New member
For the PPU area, I don't know if I'm 100% correct at that, but I return the last value on the PPU databus, this includes reading the PPU status register unused bits. So.. if a game reads or writes to a PPU register, I set a variable to the value written/read. If a game reads an undefined PPU location, like $2000, I return that value.

For any other area, it's the CPU databus, simply the high byte of the address read, like reading from $4000 returns $40, reading from $6000-$7FFF if the game doesn't have a RAM chip returns $60-$7F (I think Low G Man relies on that). The unused bits of the game controller register returns part of the previous databus value too, so if a game reads from $4016/$4017, simply OR with $40, Paperboy is uncontrollable otherwise.
 
Last edited:

aprentice

Moderator
For the PPU area, I don't know if I'm 100% correct at that, but I return the last value on the PPU databus, this includes reading the PPU status register unused bits. So.. if a game reads or writes to a PPU register, I set a variable to the value written/read. If a game reads an undefined PPU location, like $2000, I return that value.

For any other area, it's the CPU databus, simply the high byte of the address read, like reading from $4000 returns $40, reading from $6000-$7FFF if the game doesn't have a RAM chip returns $60-$7F (I think Low G Man relies on that). The unused bits of the game controller register returns part of the previous databus value too, so if a game reads from $4016/$4017, simply OR with $40, Paperboy is uncontrollable otherwise.

thanks for the info, got almost all sprite and ppu io done, just kind of stuck on 2005h and 2006h, my implamentation is poor since i don't really understand loopys doc. are there any better docs for these registers? I know these registers arent critical to get games running but im gonna need scrolling eventually :p
 

yosh64

New member
hey

Yea I understand loopy's doc fine now days :), but originally I had no clue, hehe.

Anyhows I can handle $2005/$2006/$2007 fine on the cpu side of things, just when it comes to rendering a scanline... I can't figure out what I'm meant todo with them, and how to update them.

Well all my attempts at implementing tile scrolling and such have had issues, so I dunno :\.

BTW, in loopy's doc, the 1's represent the affected bits.

edit
Ohh, I just remembered that the rom I used for testing scrolling used a mapper that I didn't support. But I didn't realise cause it was working to a point, hehe. Anyhows might have to find another rom for testing scrolling or something, or maybe I already did and don't remember.

another...
Well I read through that forum post, and things make more sense when it comes to rendering now :).

Anyhows I see that between rendering each pixel I think it would be possible to change the scroll value and such? so I think I will make an array for each pixel of a scanline, and record the scroll values and such when each pixel is to be drawn (hmm, I guess I'd have to simulate a read from ppu to update the scroll values or whatever between each pixel also), so when it comes to rendering I can still render a complete scanline at a time, and refer to my array for the true scroll values.

Hmm, or maybe I could use some sorta stack instead, I dunno.

cyas
 
Last edited:

yosh64

New member
hey

I read in that forum post (and maybe simular things elsewhere) that $2005/$2006/loopyV is constantly updated as the ppu fetches tiles to render.

But it's not very specific about things...

Anyhows I find that there are at least 5 reads from memory to draw a tile. Firstly 1 to read the background tile index, then 2 to read the pattern data, then 1 to read the attribute byte, and finally 1 more to lookup the color.

Hmm, and there could be more depending on whether there are sprites within the scanline/pixel.

So won't all these reads screw things? as for each read $2005/$2006/loopV is incremented by 1.

Another thing I don't get, is where does looking up the name table address and such from $2000 come into play?

cyas
 
Last edited:

aprentice

Moderator
any game title screens showing yet? :D

close to none, i have a bug somewhere thats crippling a lot of games from even showing gfx, heres a screen from zelda simulator which shows the most and doesnt even display right but i guess its better than a black screen :p

zel_demo.jpg
 
Last edited:

aprentice

Moderator
ok heres an updated shot from the emu, this is probably the only game that shows this much gfx but hopefully im not far off from commercial :)

zel_demo2.gif
 

Exophase

Emulator Developer
You should start one too, Exophase!

I don't think so, I only do emulators when I think there's a need for a new one somewhere. Almost every platform that can do NES well already is. I released my PC-Engine emulator though. Maybe I should post this in that thread no one cared about ;D
 

Top