It is currently Wed Dec 13, 2017 12:06 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Some questions here..
PostPosted: Sun Apr 10, 2005 7:54 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
Hi all, some questions here.. I've been out of Nesdev boards for quite a long time, so some of these questions may have already been answered before. If so, just point me out to the corresponding threads. Lots of thanks in advance.

1.- I've added to my emu that sprite stuff discovered by Quietust, reads to PPU reg 3 and such, and this has made disappear almost all black lines in Micromachines. Not all of them, cause my emu still renders a 3 or 4 pixel black line on "Select Game" screen, and a thin 1 pixel one on the screen preceeding every race. The rest of the game is rendered correctly. Should I change something else apart from adding that "if" statement on SPR reads? Am I missing something?

2.- On my emu, "Multidirectional scrolling test" status bar shakes up and down a little while the main screen scrolls, and gets filled with some random tiles. Any idea of what could be causing that? Could this "missing feature" make any other programs not to work? Guardian Legend status bar flikers a lot after playing it for a while, but all the other comercial scrollers I've tested so far seem to work properly, apart from those which rely on IRQ interrupts emulation to run (Amagon slows down while getting in game, Antartic Adventure doesn't boot, Bomberman hangs on title screen, Archong hangs while getting in game, etc..).

3.- Does emulating PPU bus states/cycling make any difference with any game/demo?

4.- What would be a good starting point to learn how to emulate the APU, knowing that I've never done any sound programming before? I know the digital sound basics, I just dunno how to turn them in code..

As always, thanks for your atention.


Top
 Profile  
 
PostPosted: Sun Apr 10, 2005 9:23 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
1. Micro Machines (and some other Camerica games, like Bee 52) do some visual tricks with the background color. They turn off BG and sprites, then fiddle with the palette so that the color that gets drawn changes every scanline or so. If you're getting black lines, it's probably because you're not rendering the right BG color when bg/sprites are switched off.

I'm not 100% sure on the color you're supposed to use for the BG when redering is off (couldn't get a solid answer), but it's based on the last palette entry accessed by the software. What I do (not 100% sure on this, would love confirmation), is I check the PPU address after $2006 and $2007 writes, as well as $2007 reads (whenever the PPU Address changes). If the PPU address is pointing to palette space ($3F00-$3F1F or any mirrored area of that), I set a BG color var to the PPU Address AND $0C:

Code:
if((nPPUAddr & 0x3F00) == 0x3F00)
  nBGColor = nPPUAddr & 0x0C;


Then nBGColor is the palette entry (00, 04, 08, or 0C) I use for the BG color when BG/Sprites are switched off. When either BG or sprites are flipped on, I use palette entry $00 regardless of nBGColor.

I'm still not 100% sure if this is right -- I would love confirmation. Doing it this way seems to have gotten it working. Below are pics of Micro Machines and Bee52 as they run in my emu. See the the fancy color bar beneath the "Micro Machines Challenge" logo -- if you zoom in you can see it's a different color every scanline. Bee52 has a less fancy border at the top of its status bar, but it's done with the same effect.

http://www.geocities.com/disch_/palettepics.png

2. Don't know about your scrolling problem, but the Guardian Legend uses DMC IRQs somehow to keep its screen from shaking like that. If you're having problems it's likely because you're not doing DMC IRQs properly. Bee52, FireHawk, and Mig-29 Soviet Fighters are other games to test for this, since they all rely somehwat heavily on DMC IRQs (especially Mig-29!)

4. BT and Blargg's docs are both very very good. When I first got started I must have re-read BT's doc like 10 times before I really understood it -- after that I just messed around until I got things working. Getting sound playing is the first step -- if I were you I woudn't worry about quality downsampling methods and just worry about getting sound playing so that you grasp the concept. Once you understand it a little better you can go back and write better sound code (you'll probably have to rewrite most of it -- but it's worth it. It's important to have a learning project or two before having your real deal.)

If there's more specific questiosn about sound generating you can post them. Personally I love talking about NES sound so I'll want to help out as much as I can. I'm sure blargg and others will step in and help as well =).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 10, 2005 11:58 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
1.- Yey, that solved the problem. Thank you very much for you explanation.

2.- Well, actually I'm not handling DMC IRQs, so I guess that's the main reason (I'm sure it is on 3 games I mentioned before). Anyway, that "multidirectional scrolling" demo does not use IRQ AFAIK, so.. no idea (if anyone could confirm this one, I'd be grateful). Anyway, I'm not too worried about this, it does not seem to affect any other program.

4.- And thanks for this one. I'll have a look at BT and Blargg's docs after doing one or two sound miniprojects, so I can understand what I do. I surely post lots of questions about this topic in a few days, heh..


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 10, 2005 7:18 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
My advice for sound programming is to go slowly, be sure you understand what's happening before you move on, and have a sound editor to examine the output of your code (don't try to simply listen to debug it).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 8:45 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
Thanks for your advice, blargg, I'll make (and wanna be) sure to understand every step I do before moving to the next one.

By the way, I've managed to solve (almost) the problem in point 2, it was just a problem of updating scroll regs at the proper time. The only thing I'm missing here (I hope) is the little delay between when a NMI is signaled and the time when it is actually served. I read somewhere that it's just a few PPU cycles, anybody can tell me for sure how many?

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 12:22 pm 
Offline

Joined: Fri Nov 12, 2004 5:02 am
Posts: 40
Muchaserres wrote:
The only thing I'm missing here (I hope) is the little delay between when a NMI is signaled and the time when it is actually served. I read somewhere that it's just a few PPU cycles, anybody can tell me for sure how many?

An interrupt will get serviced right after the CPU finishes its current instruction or the one after that depending on the time of occurrence and how long it takes for the CPU to notice the falling input. Too late would be somewhere around the last one or two cycles in an instruction.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 7:00 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
Wow, impressive! Thank you all, now everything works perfectly. I'm just having one problem with MMC1, every game I've tried works fine except Romancia (J). All tiles are messed up. Is it using any MMC1 special feature that any other game uses or something?

And this one.. heh, any ideas on what is that?

Image

Thx in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 8:03 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
Muchaserres wrote:
And this one.. heh, any ideas on what is that?

Image


I'm not quite sure; I feel asleep.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 9:03 am 
Offline

Joined: Fri Nov 12, 2004 5:02 am
Posts: 40
Muchaserres wrote:
And this one.. heh, any ideas on what is that?
Thx in advance.

Just some wacko obviously..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 10:56 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
Marty wrote:
Muchaserres wrote:
And this one.. heh, any ideas on what is that?
Thx in advance.

Just some wacko obviously..


HAhahahahh! Cool stuff! xDD


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 9:15 pm 
Offline

Joined: Wed Feb 09, 2005 9:31 am
Posts: 418
Is that in the real game on a real NES, or is it a hack or emulator bug? I all of a sudden want to play Zelda 2, even though I have never done so to begin with (it isn't true to the Zelda series IMO).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 9:47 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
yes Error is a real guy in the real game. First time you meet him he says "I am Error" but in another town later in the game another person says "Error knows something or other" and if you talk to him again he gives you new info (although it's not really very important info -- it's been a while since I actually triggered those events).


Top
 Profile  
 
 Post subject: Engrish for Errol?
PostPosted: Wed Apr 20, 2005 6:25 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19341
Location: NE Indiana, USA (NTSC)
It shows up on the real hardware. It could have been a mistranslation, or did I see a 90 minute documentary on TCM last night about Error Flynn?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2005 12:59 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Or "Error" is just the name of the guy, or he would say something like "I'm a bug of the matrix".

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 22, 2005 8:49 am 
Offline

Joined: Sat Nov 13, 2004 6:25 am
Posts: 96
Hi all,

Some more questions.. While adding some new mappers to my emu, I've encountered a problem with my write handler. Some mappers (Nina-1 #34, MMC5 #05, FFE F4xxx #06,...) write to their registers on addresses lower than 0x8000. So now, instead of having a "if(address>=0x8000){writetomapper(address,byte);}" I have to "writetomapper(address,byte);" every time a write occurs. My question here is: how are you dealing with this problem? or, is it there a better/faster/smarter way of doing this?

On the other hand, I'm still having problems with Romancia_(J). It shows garbage on title screen.. but I'm almost sure that my MMC1 implementation is oK. Suggestions? Also still having trouble with Bee_52_(U).. may it be missing IRQ handling?

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group