Search found 53 matches

by tineras
Mon Sep 12, 2011 2:04 pm
Forum: NESemdev
Topic: Problem with rectangle (pulse) channel in SMB (RESOLVED)
Replies: 7
Views: 5133

ReaperSMS wrote:and checkSweepSilence is something along the lines of:

Code: Select all

checkSweepSilence()
{
		if (sweepNegFlag)
				sweepSilence = (period < 8);
		else
				sweepSilence = ((period + (period >> sweepShift)) > 0x7FF);
}
?
I updated the previous post with the checkSweepSilence code.
by tineras
Mon Sep 12, 2011 1:48 pm
Forum: NESemdev
Topic: Problem with rectangle (pulse) channel in SMB (RESOLVED)
Replies: 7
Views: 5133

What does your sweep code look like? Some of my APU code is similar to the MyNES emulator. My sweep function is more or less identical. Below is my sweep function along with my $4001 write code. /** SWEEP **/ void APU_rect1::updateSweep() { if(sweepEnable && !sweepSilence) { if(sweepCount >...
by tineras
Mon Sep 12, 2011 11:55 am
Forum: NESemdev
Topic: Problem with rectangle (pulse) channel in SMB (RESOLVED)
Replies: 7
Views: 5133

...Sweep sounds a bit slow, do you have the frame sequencer implemented right? ... You are right. Now that I have fixed the typo I had, it produces a similar (sweeping upward) sound, but the duration is shorter (and cleaner). However, it is still much longer than it should be and there is still an ...
by tineras
Mon Sep 12, 2011 5:41 am
Forum: NESemdev
Topic: Problem with rectangle (pulse) channel in SMB (RESOLVED)
Replies: 7
Views: 5133

Problem with rectangle (pulse) channel in SMB (RESOLVED)

UPDATE 2: I resolved this issue by setting the length counter to 0 if the channel is ever set to disabled during the $4015 write. -------------------------------------------------------- UPDATE: Shortly after typing this, I thought of a possible typo that I could have made. Sure enough, I checked an...
by tineras
Tue Aug 09, 2011 6:42 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

Zepper wrote:Yeah, I could reproduce your bug in my emulator. It's "cool". :) Anyway, you said that your emu gets a "Passed" in the CPU test ROM. Well, I get the error:

Code: Select all

unknown opcode FF trapped at PC 0200!
Which CPU test rom is that from?
by tineras
Tue Aug 09, 2011 7:40 am
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

At first, this is what I thought: SMB1 decodes its maps to a 32x13-metatile sliding window. The left half is at $500-$5CF (which corresponds to PPU $2000-$23FF) and the right half at $5D0-$69F (which corresponds to PPU $2400-$27FF). It might decide which half to start at based on uninitialized memo...
by tineras
Mon Aug 08, 2011 9:23 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

Maybe there's a typo in you're code where it adds ram offsets or something. It's just odd because the other data is in the correct place. Like what is seen at 0x5B0. Also, my reads and writes are very straight forward. if (addr < 0x2000) { // Write memCPU[addr & 0x07FF] = data; } if (addr < 0x2...
by tineras
Mon Aug 08, 2011 9:16 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

SMB1 checks if the high score consists of valid digits as its way of detecting a warm start. If it's a warm start, it keeps the high score, second quest flag, and continue world (A+START world). But I'm far more interested in a trace log starting with an A button press from the ground, than from bo...
by tineras
Mon Aug 08, 2011 7:30 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

In memory, the PRG-ROM is read from 8000-FFFF. This is just reading from RAM. And what it's reading from in that is just RAM. RAM is data exactly like ROM except the program its self changes it. I expect that, but there is nowhere before that point that the program has changed the data at that addr...
by tineras
Mon Aug 08, 2011 7:21 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

FCEUX does it, it's called the "Trace Logger", under the debug menu. I changed my formatting to look similar *enough* to that of FCEUX. As I follow the logging in SMB, this is what I get: $8000:78 SEI A:00 X:00 Y:00 S:00 P:nvubdIzc $8001:D8 CLD A:00 X:00 Y:00 S:00 P:nvubdIzc $8002:A9 10 L...
by tineras
Mon Aug 08, 2011 7:10 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

Did you try the CPU test roms to see if those report errors? Do other games experience weird problems or do they run ok? I tried these as I mentioned and maybe some other one-off tests: "nestest, nestress and the 'official_only.nes'" <- They all pass There are quite a few games that work ...
by tineras
Mon Aug 08, 2011 3:43 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

Add trace logging, then compare with another emulator's trace. Then see where they differ. I think it's probably the most painless way to diagnose such a problem. Just register content tracing should be good enough (PC, A, X, Y, S, Flags). But if you're a fan of using diff software (like WinMerge),...
by tineras
Mon Aug 08, 2011 1:41 pm
Forum: NESemdev
Topic: Sanity check on my CPU code (resolved)
Replies: 21
Views: 8581

Sanity check on my CPU code (resolved)

RESOLVED: I have found the error for what was going on below. There was one instruction (STA 0x91) where I was adding the Y register value only to the low byte (bLow + Y) instead of adding Y to the adjusted value ( ( bLow + bHigh << 8 ) + Y). Whoops!! That problem has been haunting me for months and...
by tineras
Fri Sep 24, 2010 2:47 pm
Forum: NESemdev
Topic: problems with mapper 1, and scrolling is backwards.
Replies: 5
Views: 10788

It sounds like you need to stop skipping steps and get your core elements working properly. Is your CPU working properly? If not, try to get some of the test roms to pass first. (Like nestest, NEStress, and Blargg's individual cpu tests). http://wiki.nesdev.com/w/index.php/Emulator_tests There is no...
by tineras
Sat Sep 11, 2010 7:54 pm
Forum: NESemdev
Topic: Yet another question about scrolling
Replies: 7
Views: 3923

Dwedit wrote:Those look like CPU bugs.
I am able to pass all of the Kevtris' nestest tests and all but one of the NEStress CPU tests (Fail: CPU RAM Mirror <-- not sure why).

Do you have any suggestions on which tests I could move on to? Or should I just start going through Blargg's tests one by one?