It is currently Thu Oct 19, 2017 2:18 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Apr 25, 2014 2:12 am 
Offline

Joined: Sat Mar 29, 2014 10:01 pm
Posts: 107
Location: Australia
An EEPROM/EPROM/PROM/Flash would be far superior to a 74xx138. The amount of discrete logic requried to decode up to 256 different addresses for ANY address on the bus (16bit), would be enormous. And as we're not considering CPLD's or FPGA's, an EPROM as an address decoder would save much board space, at a speed that would surpass any MCU. An EPROM could also do the job of an MBC quite easily, with additional address lines used to select modes of operation. Very Fancy.


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 8:59 am 
Offline

Joined: Tue Feb 11, 2014 7:12 am
Posts: 44
I did not want to use either CPLD, FPGA or discrete logic, I wanted to use only an AVR for this job. I actually wanted to use an arduino Mega(Atmega 2560), because I happen to own one and it has enough IOs to do all the decoding on its own.
Now, i did not know about these latencies, seems like these would make it near impossible to do the emulation due to speed issues...


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 11:30 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
BennVenn wrote:
The amount of discrete logic requried to decode up to 256 different addresses for ANY address on the bus (16bit), would be enormous.
But we don't need to fully decode anything... and a ROM can only get us 8 (or 16, I guess) generated signals as a function of N inputs. So it would let us decode 8 independent and arbitrary groups of addresses ... but since the historical MBCs don't have any regions finer than 4 KiB (other than the Datel one), I don't see how that benefits us? It doesn't help us create a 512-address nybble-wide RAM.
SNgamer wrote:
I wanted to use only an AVR for this job
Sorry for hijacking your thread. I still think you can do it with an arbitrary AVR and two 74'08s. (Or one, if you only want to emulate games ≤ 256KiB)


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 3:02 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
SNgamer wrote:
I did not want to use either CPLD, FPGA or discrete logic, I wanted to use only an AVR for this job. I actually wanted to use an arduino Mega(Atmega 2560), because I happen to own one and it has enough IOs to do all the decoding on its own.

Any particular reason for this, other than the fact that you already have it? I mean, maybe it might be possible, but you're trying to shoehorn together a solution out of hardware that just isn't designed for the job. You might as well be trying to accomplish it on a Raspberry Pi, heck it'd be half the price, and just as unsuited for the job, though the extra power might get the job done, especially since you could buffer the entire ROM/SRAM into RAM to speed up the access times. An Arduino Mega is complete overkill in all the wrong places.

If this is just for fun to see if you can do it, don't let me dissuade you from that, but if you're actually wanting to build a reasonable replacement for the MBC chips, the first step is choosing the right tool for the job, and the right tool for replacing an ASIC comprised of logic and registers is a chip containing logic and registers, i.e. a PLD. Emulating simple logic using a microprocessor is like wall-mounting a laptop to use it as a light switch.


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 3:30 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19099
Location: NE Indiana, USA (NTSC)
On a Raspberry Pi, I'd just emulate the whole damn Game Boy.


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 3:51 pm 
Offline

Joined: Tue Feb 11, 2014 7:12 am
Posts: 44
qwertymodo wrote:
Any particular reason for this, other than the fact that you already have it? I mean, maybe it might be possible, but you're trying to shoehorn together a solution out of hardware that just isn't designed for the job. You might as well be trying to accomplish it on a Raspberry Pi, heck it'd be half the price, and just as unsuited for the job, though the extra power might get the job done, especially since you could buffer the entire ROM/SRAM into RAM to speed up the access times. An Arduino Mega is complete overkill in all the wrong places.

If this is just for fun to see if you can do it, don't let me dissuade you from that, but if you're actually wanting to build a reasonable replacement for the MBC chips, the first step is choosing the right tool for the job, and the right tool for replacing an ASIC comprised of logic and registers is a chip containing logic and registers, i.e. a PLD.


It was just a thought that ran through my mind while programming the Cartridge dumper for Arduino, it's not like that I want to do such thing because I own one or I need one, but more out of interest, in order to see what else can be done with an arduino, as no one has even attempted to ask if such thing like MBC emulation would be possible with an arduino (at least i have not found anything searching the web). And even if it was a waste of the hardware's capabilities, I mean, other than the time I would use to find out if it was capable of doing the emulation, nothing is lost by this :D


Top
 Profile  
 
PostPosted: Fri Apr 25, 2014 4:42 pm 
Offline

Joined: Mon Jul 02, 2012 7:46 am
Posts: 759
tepples wrote:
On a Raspberry Pi, I'd just emulate the whole damn Game Boy.

Exactly what I mean by overkill in all the wrong places. A RPi could easily emulate the entire GB, but I'm not sure if the GPIO latency could support emulating the MBC chips, for the same reason as with the Arduino, except with the added abstraction and overhead of an entire OS.

SNgamer wrote:
And even if it was a waste of the hardware's capabilities, I mean, other than the time I would use to find out if it was capable of doing the emulation, nothing is lost by this :D

Fair enough.


Top
 Profile  
 
PostPosted: Fri May 22, 2015 5:36 pm 
Offline
User avatar

Joined: Sun May 17, 2015 2:14 pm
Posts: 6
Location: seattle
qwertymodo wrote:
Exactly what I mean by overkill in all the wrong places. A RPi could easily emulate the entire GB, but I'm not sure if the GPIO latency could support emulating the MBC chips, for the same reason as with the Arduino, except with the added abstraction and overhead of an entire OS.


I was thinking about trying exactly this on the RPi. Has anyone else tried it yet? Can anyone provide some reference material to help me get started?

_________________
My first gameboy emulator


Top
 Profile  
 
PostPosted: Fri May 22, 2015 8:04 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6280
Location: Seattle
... Emulating an MBC on the RPi? Well, you're not going to be running linux on it, that's for sure.

Nevermind that the power budget is daft: the DMC/CGB/GBA consumes about one half to one fifth the power the RPi does. Also the RPi isn't 5V tolerant, and the DMG/CGB are only 5V.

Assuming that you don't want to add the several AND gates, you'll need to have a loop that can always determine what the CPU is doing, and react within 1 microsecond. This should¹ be doable—after all, the Atari 2600 Harmony Cart emulates a ROM using a 70MHz ARM—but using RPi for it is rather like using a smartphone as a hammer... sure, it might work, but you're as likely to hurt yourself or break something as drive the nail.


¹: "should" because the RPi will have some amount of instruction/data caching latency that could screw up your budget. Who knows!


Top
 Profile  
 
PostPosted: Tue May 26, 2015 7:23 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1305
You can use an Atmega or another MCU, but it is the wrong tool for the job and the gains from doing it that way are not clear. This would be a great VHDL or Verilog learning project, though this can even be done with a graphical schematic capture.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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