It is currently Sat Aug 18, 2018 7:12 pm

All times are UTC - 7 hours





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

Joined: Wed Mar 09, 2005 9:08 am
Posts: 410
Frankly I'm not sure I see what there is to discuss? Of course a NES, extended with enough RAM, can run GB code. That ability is pretty much the definition of Turing completeness. So yeah, it's fully doable and not even difficult: Just compile any GB emulator's C code on a C compiler that supports the NES target for sufficiently big programs... or write the emulator from scratch in 6502 assembly if you have the time for it.

The real challenge would be to get any speed that gives a decent emulation experience... but if you've already sacrificed that criteria, then it's a no-brainer. So what are you trying to get at here? :)


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 5:24 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 2082
Location: WhereverIparkIt, USA
Bananmos wrote:
Frankly I'm not sure I see what there is to discuss?


Quote:
So yeah, it's fully doable and not even difficult: Just compile any GB emulator's C code on a C compiler that supports the NES target for sufficiently big programs...


Well, we could discuss how this will obviously not work, or is at a minimum not nearly as simple as you're suggesting...

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


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:01 pm 
Offline
User avatar

Joined: Wed Oct 15, 2008 11:50 am
Posts: 939
There aren't any C compilers that support sufficiently large non-linear program spaces. But the point is quite valid. If the only requirement is to accomplish X without regard to efficiency or accuracy, then it becomes a fairly mundane problem.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:13 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10714
Location: Rio de Janeiro - Brazil
Even though I don't think efficiency has the highest priority in an experiment like this (getting games running is the real goal), anyone attempting it should aim for the highest efficiency possible, so there's definitely room for discussion.

For example, the Game Boy has 8 KB of main RAM and 8KB of VRAM. If you implement that as 2 PRG-RAM pages on the NES, you'll spend a lot of time just bankswitching when the emulated CPU is copying data to VRAM. And then there would even be a third step, when the contents of the emulated VRAM are used to render tiles to CHR-RAM. Is there any way to optimize this process?


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:14 pm 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
tokumaru wrote:
The only problem I see is the lack of interesting games, because the Chip-8 itself is a novelty.

Chip-8 was released in 1977. I thought 'novelty' means a 'new thing', 'recently created', am I wrong?


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:29 pm 
Offline
User avatar

Joined: Wed Oct 15, 2008 11:50 am
Posts: 939
Perhaps "curiosity" would have been the better term.


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:35 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10714
Location: Rio de Janeiro - Brazil
Shiru wrote:
Chip-8 was released in 1977. I thought 'novelty' means a 'new thing', 'recently created', am I wrong?

Yes, but it also means "unusual", AFAIK. But yeah, I might have used the word wrong and it might not be a novelty now, but I bet it was back when it was created!

What I meant is that the Chip-8 is a weird little thing that's mildly interesting but doesn't really capture people's attention for long, and since a sluggish emulator will certainly not have many fans either it will probably not even be noticed outside the circle of NES programmers... but a Game Boy running inside the NES CPU? That's big (even if it's unplayable)!


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 7:57 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 2082
Location: WhereverIparkIt, USA
tokumaru wrote:
For example, the Game Boy has 8 KB of main RAM and 8KB of VRAM. If you implement that as 2 PRG-RAM pages on the NES, you'll spend a lot of time just bankswitching when the emulated CPU is copying data to VRAM. And then there would even be a third step, when the contents of the emulated VRAM are used to render tiles to CHR-RAM. Is there any way to optimize this process?


Well a custom mapper would be able to lend a hand. Having a full 16KB of PRG-RAM visible at once perhaps. One trick/cheat would be to use dual ported RAM for VRAM.

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


Top
 Profile  
 
PostPosted: Sun Nov 10, 2013 8:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20417
Location: NE Indiana, USA (NTSC)
You'd need to bankswitch the ROM image too though. And the limit of "help from the mapper" is obviously Wide Boy or Retrovision.


Top
 Profile  
 
PostPosted: Mon Nov 11, 2013 5:02 am 
Offline

Joined: Tue Jun 28, 2011 2:39 pm
Posts: 155
I think, unless you use something fancy like VRC7, emulated sound would be crap here... Better would be to write GB Emu for C64 (6502 as well), since GB sound is closer to SID really, in terms how it sound like, than 2A03.


Top
 Profile  
 
PostPosted: Mon Nov 11, 2013 6:39 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10714
Location: Rio de Janeiro - Brazil
The emulated sound will be crap no matter what you do, because it won't play at full speed. =)


Top
 Profile  
 
PostPosted: Mon Nov 11, 2013 11:18 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3541
Location: Indianapolis
This thread reminded me of an emulation approach I thought of a while back, if you want to hear my weird mapper-assisted idea. I always thought a Colecovision emu for NES would be amusing, so on with my Squeedo mapper I wondered how well it would work if the on-board PIC emulated the Z80. When doing video/sound/controller I/O it would trigger an IRQ for the NES to handle it. This PIC (18F family) has up to 64kB of ROM, and 3.9kB of RAM. One problem I can forsee is if the game does a lot of VRAM reading, the PIC would have to request it from the NES and that could bog down. I don't know how frequently, obviously it would vary widely. We all know that's almost never done on NES, but Coleco has 1kB of RAM and 16kB of VRAM, so it's not hard to imagine how it'd be useful. And it sorta helps that it can access VRAM during rendering, heh.

Can't say I ever wanted to write a Z80 emu for PIC, but I would probably try to use it if it existed (maybe compiling a C version could work, I never really considered that). I know someone who wrote a 6502 emulator for PIC, I've been telling him he should make it available for this kind of fun stuff. Then one could run their code on a faster emulated CPU, on the NES.

Also funny to note in this thread, is that the CopyNES debugger "Microbug" emulates a 6502 on the 6502. It's pretty nifty to see it in action.


Top
 Profile  
 
PostPosted: Tue Nov 12, 2013 1:31 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7392
Location: Seattle
Memblers wrote:
I know someone who wrote a 6502 emulator for PIC, I've been telling him he should make it available for this kind of fun stuff.
Doynax's NSF-on-a-PIC project does that, and he released his source...


Top
 Profile  
 
PostPosted: Tue Nov 12, 2013 3:20 am 
Offline
User avatar

Joined: Tue Aug 07, 2012 12:27 pm
Posts: 59
I made GB emulator for PlayStation 1 some time ago. It was twice as slow as original GB (if not more).

http://psxdev.narod.ru/download/GBEMU_psx_bin.rar

Not sure you can even emulate it on NES, since GB use different memory mapping and RAM size. NES just have not enough RAM to emulate 8+8 KB of GameBoy's RAM and VRAM.

Although GB CPU can be emulated easily, just for fun.


Top
 Profile  
 
PostPosted: Tue Nov 12, 2013 5:44 am 
Offline

Joined: Tue Jun 28, 2011 2:39 pm
Posts: 155
Well, NES has 32kb of RAM, isn't it? And 8+8kb = 16kb. Dedicating first (or last) 16kb of NES RAM for GB and using only first (or last) 16 for actual emulation (perhaps with custom mapper) we could do it. Granted 16kb isn't much, but so is 32kb (even if it is twice as large).


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: lidnariq and 4 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