It is currently Fri Oct 19, 2018 4:02 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sun Nov 10, 2013 5:50 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
Has anyone ever considered making a GB emulator for the NES? It would obviously not run anywhere near 60fps, since no matter how you approach rendering the graphics, just emulating a (slightly crippled) Z80 on a (slightly crippled) 6502 will be painfully slow. Still, I think this would be interesting to see, but I wonder what the best way to handle the graphics would be...

Considering that the NES can do almost everything the GB can, the logical solution would be to use the capabilities of the PPU directly. There are a couple of small problems that are easily solvable (or can be ignored!), like the 32x32 tile maps (which can be done by making all palettes the same and forcing the vertical scroll past 240) and the 10 sprites per scanline limit (the result will be more flickery than on a real GB). There is however something I consider a big problem, which is the inability to mask the sides of the screen. Having garbage around the game play area is too off-putting IMO. Another big problem is the window, which can't really overlap the screen.

The other approach, which would make things significantly slower, would be to do everything in software. Reserve 360 tiles (a split will be necessary) for drawing the 160x144 gameplay area and dynamically render everything there. In addition to the speed issue, there's also the fact that 8KB of CHR is not enough to hold a second 160x144 off-screen buffer, but nothing stops us from using more CHR, even though that's not very common in iNES ROMs.

What are your thoughts on this? There are many points to consider regarding the CPU and audio as well.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 8:24 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20673
Location: NE Indiana, USA (NTSC)
Perhaps the most viable solution is high level emulation (HLE). Rewrite the graphics and sound engines and statically recompile the game code. Chris Covell thinks this is how Balloon Kid was translated into Hello Kitty World. For example, both BK and HKW end up using the same music engine as the respective platform's version of Dr. Mario.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 8:33 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
But that's game-per-game conversion, I'm talking about actual emulation. Take any GB ROM and it will run with correctly represented graphics, no matter how slow (sound is most likely not necessary, because it will sound like crap at such low speeds). how would you approach that?


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 8:40 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20673
Location: NE Indiana, USA (NTSC)
By running the emulator on an N64 and doing everything in software. (See Pokemon Stadium.)

If you must stick with the NES to make your pure-software Wide Boy, you'd probably need to use software rendering and extra memory on the cart at $6000-$7FFF to represent the Game Boy's RAM and VRAM. The MMC5's window in SL mode may be flexible enough to represent the Game Boy's window for some games, but nowhere near for all games.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 8:59 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
tepples wrote:
By running the emulator on an N64 and doing everything in software. (See Pokemon Stadium.)

Doing things like this in a machine you KNOW can handle it is not fun, it's just convenient. The fun is all about trying the unusual. Emulating a GB on the NES is not about the goal (playing Game Boy games), but the means (NES simulating another machine). I thought of the Game Boy because it has slightly lower graphical capabilities than the NES, but other platforms with decent libraries of cool games would be interesting to see emulated as well.

Quote:
If you must stick with the NES to make your pure-software Wide Boy, you'd probably need to use software rendering and extra memory on the cart at $6000-$7FFF to represent the Game Boy's RAM and VRAM.

Yeah, to make things look right the video would have to be rendered in software. But I wonder if there's a way to make it look mostly correct while taking advantage of hardware graphics acceleration (i.e. make use of name tables and sprites instead of rendering pixel by pixel to a surface of 360 tiles).


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 9:23 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
I would think the best idea would be to statically recompile the code (difficult, ideas here: http://andrewkelley.me/post/jamulator.html ) outside of NES and on the NES, intercept hardware access with drivers ( maybe not as difficult, ideas here: viewtopic.php?p=101771#p101771 )


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 9:34 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
Does anyone have any ideas of other platforms that are relevant enough to be interesting to see emulated? I know there are many old text-only, monochrome or with hardwired tilesets that are easier to emulate but are incredibly uninteresting (no exciting software). Since the emulator itself would not be convenient at all, if the emulated platform isn't relevant, there's no point in considering this.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 9:45 am 
Offline
Formerly WhatULive4
User avatar

Joined: Fri Oct 30, 2009 4:43 am
Posts: 370
Well, I have a retrovision but that isn't exactly emulating.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 9:50 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
There were GB emulator for MSX, NES emulator for SMD, ZX Spectrum emulator for ZX Spectrum, and few more. They all aren't really usable to play games, just programmer's fun.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 9:55 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
Shiru wrote:
There were GB emulator for MSX, NES emulator for SMD, ZX Spectrum emulator for ZX Spectrum, and few more.

There's a NES emulator for GBC. It was incredibly slow.

Quote:
They all aren't really usable to play games, just programmer's fun.

That's the idea.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 10:26 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
I would think that anything 6502 based would be a good place to start. Atari 2600 or 800? Apple II? I know the Atari 800 line had a display list feature that seems it would be hard to emulate with the PPU, but perhaps games that stuck to a more compatible mode for the entire screen wouldn't be too hard to run. There is also the problem of dealing with the BIOS that a lot of software would utilize as well (and I would assume the same for the Apple II).


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 12:29 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20673
Location: NE Indiana, USA (NTSC)
I want to see Chip-8 on NES so that I can extend an emulator stack one higher. Imagine Chip-8 emulator in PocketNES in VisualBoyAdvance GX in Dolphin in Wine in Virtual PC or VMware.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 1:31 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
Movax12 wrote:
I would think that anything 6502 based would be a good place to start.

It doesn't make such a difference if you're not recompiling, because you can't simply let the CPU run free, you have to intercept reads and writes, count cycles, etc., so you need to look up the opcodes even if it's 6502 code emulated in a 6502.

Quote:
Atari 2600

The little amount of RAM makes it tempting, but the video system is too different. The whole screen is redrawn every frame, and colors change every scanline... not easy on the NES.

One that might work well is the Bally Astrocade. The graphics are pretty basic and within the limitations of the NES.

tepples wrote:
I want to see Chip-8 on NES so that I can extend an emulator stack one higher.

From what I've read, there's nothing about it that would be particularly hard to implement on the NES. This one is perfectly doable IMO.

Quote:
Imagine Chip-8 emulator in PocketNES in VisualBoyAdvance GX in Dolphin in Wine in Virtual PC or VMware.

Now there's an interesting idea! The only problem I see is the lack of interesting games, because the Chip-8 itself is a novelty.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 2:05 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 2092
Location: WhereverIparkIt, USA
tokumaru wrote:
But that's game-per-game conversion, I'm talking about actual emulation.


What if you cheated and did the conversion with the NES? Maybe just covert the main loop and put it into RAM and execute off of that. You could leave subroutines up to emulation though. That could probably go a long way to improving speed.

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 2:39 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
infiniteneslives wrote:
What if you cheated and did the conversion with the NES?

That would be dynamic recompilation, right? I'd be fine with that. I was against tepples' idea of rewriting the graphics and sound engines, because that would require human intervention for each game.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: russellsprouts and 8 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