NES on Wii

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
teaguecl
Posts: 210
Joined: Thu Oct 21, 2004 4:02 pm
Location: San Diego

Post by teaguecl »

Results of my testing of FCEUGX version 2.0.3c
Mega Man 4 - sound seemed fine to me. Crap that game is hard.

Blargg's CPU Timing Test (12 seconds)
Fail OP: $E2
Emulator: 3
Correct: 2

Blargg's PPU timing tests
palette_ram: FAIL, code 3
power_up_palette: FAIL, code 2
sprite_ram: FAIL, code 2
vbl_clear_time: PASS
vram_access: PASS

Blargg's APU tests:
Series of 8 tests, must be run sequentially.
FCEUGX 2.0.3c fails test 2 with this result: $70 $1C $1A $02
tests 3-8 cannot be run with a failing test 2.

Blargg's Branch Timing tests:
basics - pass
backward - pass
forward - pass

Blargg's CPU Timing Test 4 (16 seconds)
Pass

Blargg's CPU Timing Test 5 (16 seconds)
Pass

Blargg's CPU Timing Test 6 (16 seconds)
Pass
User avatar
teaguecl
Posts: 210
Joined: Thu Oct 21, 2004 4:02 pm
Location: San Diego

Post by teaguecl »

Based on the test results above, and the comments by others - it seems like porting a more accurate emulator might be the way to go. Nestopia has been suggested. I think the important factors are (in order)

1. Speed - it must play the games full speed on Wii HW, or else why bother.
2. Accuracy - obviously as close as we can get to Nestopia/Nintendulator accuracy. Doing this on Wii HW may be tough.
3. Code quality - how maintainable is the code base? I don't want to deal with spaghetti code forever.

What is the consensus here - fix FCEUGX or start over with a Wii port of a more accurate emulator?
User avatar
BMF54123
Posts: 410
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 »

Well, the good thing about the Wii--or most any console--is that the hardware is constant. You can pretty much tweak and optimize the code to your heart's content without having to worry about it failing on someone else's system (unless it runs afoul of some hardware mod that changes the system's core behavior).
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

teaguecl wrote:Nestopia has been suggested. I think the important factors are (in order)

1. Speed - it must play the games full speed on Wii HW, or else why bother.
Nestopia consistently runs at full speed with NTSC filtering on a nearly eight-year-old Dell Dimension PC with an 866 MHz Pentium III CPU. Though the Wii's "Broadway" PowerPC CPU is thought to run at 729 MHz, I still remember Apple's "snail" commercial about how the PowerPC G3 core (used in Broadway) is up to twice as fast as the P6 core of the Pentium II/III at equal MHz.

But how much of Nestopia is in assembly language, which would have to be rewritten from scratch to run on a PowerPC CPU?
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

In my experience, most emulators are written in a way that runs poorly on RISC machines. They tend to use lots of non-local variables as temporaries, causing lots of memory accesses which are generally bad on RISC. A compiler usually can't prove that these aren't modified by other memory accesses and function calls, so it's forced to constantly move these back and forth between memory and registers. The RISC-friendly emulators use lots of local variables which an be kept in registers (the PowerPC has 32 general-purpose registers).

On the bright side, at least the NTSC filter is quite RISC-friendly.
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

Does the Wii have 240p output or must emulators use 480p / 480i (and drop fields)?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

I haven't tried any Virtual Console NES or Super NES games, but Toejam and Earl 2 (Genesis) and Dungeon Explorer (PC Engine) appear to use 240p or 480p depending on whether progressive scan is turned on in Wii Menu.

A couple GameCube games use 240p, such as Mega Man X Collection, and when I run them through my Wii's component cable, my Vizio HDTV glitches the same way it does for the majority of PS1 games through my PS2. I have to switch back to an S-video cable to run them.

Wii Remote support for Zapper games is a must, as is Wii Wheel support for Rad Racer (it's so bad).
atari2600a
Posts: 324
Joined: Fri Jun 29, 2007 10:25 pm
Location: Earth, Milkyway Galaxy, The Universe, M-Theory
Contact:

Post by atari2600a »

I believe one of the emulators already has zapper support. & indeed Rad Racer is so bad. (but only if it involves a Power Glove)

Code: Select all

          *=$0000
loop      JMP loop
          .eof
User avatar
teaguecl
Posts: 210
Joined: Thu Oct 21, 2004 4:02 pm
Location: San Diego

Post by teaguecl »

OK, it looks like Nestopia is a good candidate. I have some reservations about a couple of things. First, it's written in C++ and I would much prefer ANSI C. Though maybe I could live with it. Second, it is very accurate and therefore requires a lot of processing power. My biggest fear with that is that we spend a lot of effort on the port - only to discover the Wii cannot handle it. So I was thinking...
Any ideas on an easy to code benchmark to help us guesstimate if this is going to work? I'm thinking something we could run on low end x86 which is still capable of running Nestopia, and see how it does on Wii. That way we can avoid doing the full port before having some idea of whether we have the horsepower.
I'm pretty sure the PPU rendering is the most intensive task in NES emulation, any suggestions on a simple way to simulate that kind of task?

EDIT: Maybe we can just gauge FCEUGX's performance on Wii hardware vs. FCEUX 0.98.12 on a older x86 to get some insight?
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Much better to see how it performs on a PowerPC machine. Find someone with Linux on a ~700 MHz PowerPC to see how Nestopia runs on it.
Last edited by blargg on Wed Oct 15, 2008 5:51 pm, edited 1 time in total.
User avatar
clueless
Posts: 496
Joined: Sun Sep 07, 2008 7:27 am
Location: Seatlle, WA, USA

Post by clueless »

(somewhat useless post)


I know that this isn't what you are looking for (in fact, it is almost the exact opposite) (and it has no sound), but I thought that it was cool.

http://members.aol.com/autismuk/nesasrc.zip

This little NES emulator is written in x86 assembly. It can run Metroid on a 486 DX2 66 (I know, I had one when I was in college).
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Post by lidnariq »

I have a friend w/ a 1.25GHz G4 laptop i could probably persuade him to let me borrow to test -- but it's markedly faster.

It's also worth noting that my 1GHz linux athlon system can't keep up with nestopia using the ntsc filter -- although it's probably X or my gpu's fault.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

lidnariq wrote:I have a friend w/ a 1.25GHz G4 laptop i could probably persuade him to let me borrow to test -- but it's markedly faster.
Then the test becomes how many Nestopia instances can you run side by side at full speed. Still, a G3 might be a fairer test, as that's the same microarchitecture in Gekko and its successor Broadway.
Post Reply