Propeller Powered Gameboy
Vaati
Posts: 712
Has there been a project for the prop that emulates the Z80?· I think I recall seeing something long ago about it...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
Post Edited (Vaati) : 2/15/2010 3:34:48 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
Post Edited (Vaati) : 2/15/2010 3:34:48 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler Largos - upcoming nano operating system
Awesome!! Thanks for the link...
Jazzed,
Yes, technically speaking. I have ventured beyond these forum pages into the vast interwebz in search of game development links...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
Las - Large model assembler Largos - upcoming nano operating system
There are at least 4 active threads and I'm most grateful to the patience of those on the forum who might think that the retro computer fraternity is taking over! But in defence, I think that the concepts in the Z80 emulation are spawning other interesting things, eg pasm overlays for bigger code than 2k in a cog, 300kilobyte programs in C, more memory and the concept of 'Big Spin' programs. And there is huge potential for games that hasn't been exploited yet.
I have three propeller Z80 emulator boards on my desk all chatting via wireless. What is the problem that you need solving?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Ok--the original gameboy actually emulates the Z80, and the boot rom file was extracted some time ago. I am putting together a text file of the asm code right now, and then you can see if it runs on the z80.
So, what are the limits on the z80 prop? can it run z80 asm?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
The lack of IN and OUT is interesting. I am wondering how it gets key press input and also how it draws graphics. Maybe with direct writes to graphic memory.
I think all the building blocks are there, and I think the hardware may well be up to this with one propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 2/8/2010 12:46:17 AM GMT
http://gbdev.gg8.se/wiki/articles/Gameboy_Bootstrap_ROM
So, do you think that it is possible?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
ZiCog (Z80 emulator)· http://forums.parallax.com/showthread.php?p=788511
TriBlade (hardware)· http://forums.parallax.com/showthread.php?p=786418
RamBlade (hardware)· http://forums.parallax.com/showthread.php?p=849265
DracBlade (hardware)· http://forums.parallax.com/showthread.php?p=860453
Note that currently ZiCog does not do all the Z80 instructions as most programs never used the extra instructions. Wordstar, assemblers,·and the like run. Also, note that there is a lot of software discussions in the hardware threads mentioned as well.
You may also be interested in the 1-pin versions of the PS2 Keyboard and TV (composite video - B&W of course)
1-pin Keyboard· http://forums.parallax.com/showthread.php?p=862504
1-pin TV· (can't find at the moment but it is in the OBEX)
Sphinx (SphinxOS) is an OS under development for the propeller
Sphinx· http://forums.parallax.com/showthread.php?p=819353
Hope these links help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
As for a screen, I think I may just go with the good old original gameboy screen...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
devrs.com/gb/files/gameboy1.gif
and the addon
devrs.com/gb/files/mbc1.gif
Let's see.
The 8k video ram can be internal hub ram.
The external up to 64k game cartridge can be the standard 512k solutions on the ramblade/dracblade.
The keypads can be a standard keyboard for the moment as the software exists but down the track could be a HC244 buffer or similar
The programs can all be stored on an sd card.
The Zicog needs a few opcodes added but probably could be the 8080 version rather than the Z80 version as there are no alternate registers needed
The display can be either vga or TV. Cluso has one pin TV. Otherwise VGA which is 8 pins.
Next decision is hardware. Even though I make the dracblade, I think it may not be the best solution as it is fractionally slow (3.5Mhz emulation vs just over 4 for the gameboy) and also there are no tried and tested VGA drivers (though Bean is getting close with Propbasic). So...
I'm going to suggest Cluso's new board with the 1 pin TV driver and the 1 pin keyboard and onboard micro sd and 512k ram.
I think there are a number of TV objects which will be just plugin solutions.
I think the hardware is all done which greatly simplifies things.
I think the sd card is going to be the easiest place to store games.
Stitching it all together is going to be like the dracblade was - ie everything is pretty much written but you have to join it all together - eg feed the keypresses to the right place.
And there will be the tedious job of emulating about 10 new instructions in pasm.
Addit: Hmm - you probably want color, don't you. Ok, need to decide 1 pin or 3 pin TV or 8 pin VGA as it affects how many pins you use and that affects some other decisions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 2/8/2010 1:30:46 AM GMT
TV!!! I now have a mini tv, and I hate VGA....
I can't wait to get this working... Imagine--the GBDSO running on a prop.... It would be a Propeller driven oscilloscope!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
If this is to be a gameboy, I guess that means small. And that might mean a PC keyboard is not quite in the spirit of the game. I see 8 buttons on that controller and there must be a cunning way of getting that down to less pins with resistor networks.
Ok, 4 pins for sd, 2 for eeprom to boot, 3 for TV, maybe 4 -6 for some buttons. That still leaves more than 15 pins free.
Let's think outside the square a bit. Maybe you don't need external ram at all? Maybe the core of a program can fit into hub ram as well?
Or at the very worst, you certainly don't need 512k and maybe you don't even need 64k, as you could page things in and out. And if you did have 64k, well there could be solutions that don't need many latches - maybe at worst one or two.
Looking at that add-on board, I see a micro, 512k of eprom and 8k of ram. Well, the micro is the propeller, the eprom is an sd card, and does that mean you only need 8k of working memory (plus 8k display ram)?
This might end up being a quite simple board. sd ram replaces eeprom. ram (if at all possible) is hub ram, and try to reclaim bytes used by cog code eg the zicog emulation.
zicog's I/O is IN and OUT instructions and these are trapped in spin code in the hub, but it ought to be possible to add instructions that write directly to a hub display buffer. sd code largely sits in its own cog and just handles loading a program into memory. The TV driver code is in another cog. There are some cogs free, so one could be dedicated to reading the buttons. Put the button status somewhere and issue an interrupt flag that the zicog can check each instruction (and/or other software solutions).
That bootrom code is most interesting. It reads an initial 256 byte program which then does other things, and this is almost identical to the ramblade/dracblade solution where a small 256 byte record is read off the sd card and this kick starts the process. The opcodes and that program are straightforward except for those unique instructions like LD (HL+),A ; $00a3. You can either write the code to trap those opcode bytes and run compiled programs as they are, or, if you are hacking programs at the source code level, maybe a new compiler that splits that opcode into two z80 opcodes? But it would be neater not to have to recompile anything.
I'm pondering a new design or a hacked current board that evolves into a single prop plus sd plus switches and maybe external ram if needed.
How big is the biggest gameboy program?
Also, do you have any examples of code to drive the display. Is it just a matter of writing a byte value to the display ram? If so then that will be quite easy to emulate in pasm.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 2/8/2010 2:10:15 AM GMT
I think that it would be best to use an SD game cart and have a multi rom menu (there's a program that does this, I just have to find it and download it) so multiple games can be on one 2GB uSD card.
I think I am going to merge the thread titled "parallel flash?" with this one, so all the stuff is in one spot...
Another thing I could do is just ditch the cartridges and make the PropBoy (this is what I have dubbed the project ) read the games directly from an SD card... It would be loads easier, because I wouldn't have to deal with all of the reminiscent "parallel excessive pin"-ness...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
Ok, 4096 for the program, and 8k for the ram and I think we should be able to shoehorn some glue code into the propeller without any external ram. This frees up a lot of pins - so the keypad is much simpler.
There is sd card code out there to run a simple operating system
(as an aside, @Jazzed, yes of course much of this is already thought of. And done. My mistake).
Maybe start with propdos, but hmm, you don't have a keyboard so scrolling has to be done via those buttons. This might involve some custom code. Suffice to say, talking to sd cards is pretty easy with existing code. At the very least print on the screen a list of files on the sd card with a number next to each one then print a number and you push a button and the number increments and then you push another key to select that game. That then loads the file into hub ram, and if the file is always 4096 bytes, it really could be as simple as one line of spin.
If the aim is to run unaltered gameboy code, there will be opcodes in there that need the correct offset as they might want to access a byte at location 256 but in hub it exists at location 5256. So there will be a tiny bit of code in the driver that adds the offset to whereever the working ram is.
This ends up very similar to heaters original zicog which runs CP/M in a propeller with no external ram.
So, original zicog, use the 8080 opcode set, add a few custom instructions, add TV object, add sd card object, write a driver to talk to some pins, map byte output from gameboy writes to display ram to real display ram that TV object is using.
Complex. But each step is manageable.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 2/8/2010 2:24:14 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
Specifically, where is it getting 32k of data out of a game running in 4k ?
Am thinking in terms of 'fast ram' with lots of reads and writes vs 'slow ram' with fewer reads and writes and which can now be on the sd card.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Oh!! I think I mis-typed something.... The game roms are up to 4MB...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
But how big is the working memory for the game in terms of ram. I see two 8k rams on that schematic so am presuming 8k for video ram and 8k for working program ram?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
I will browse devrs to find out...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
The keypad interface is the hardest bit, since we have no pins (well we can use the serial in pin). Simplest would be to use another prop, or you could use a cheaper micro. Otherwise you could use a latch or serial decoder.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
8k video ram and 8k working ram. That could well fit internally in a propeller, although you may need to reclaim space after loading cogs. A number of people are working on ways of doing this. It depends on how big the glue spin code is but I am thinking fairly small.
Worst case scenario might be an external 6264 but even that is one latch and might ?? even be possible with no latches.
No - on thinking some more, no external ram. Put a whole lot of startup code (eg load cogs, launch sd card) in lower memory, run it, then jump to a higher memory location in spin and keep running in higher ram for the glue code, and then make all of the bottom 8k of ram the video ram. That overwrites bootup code but it isn't needed any more.
I think 1 pin would be needed for sound.
Looking at how it works, there are 8 buttons, but one of those is a group of 4 for the direction pad controller, and that is only going to have one of 4 pushed at any one time, so that could reduce down to some dividing resistors and get it into one propeller pin I think. The other group ditto unless you might be pushing two buttons at once.
I'm still very optimistic this fits in one propeller chip with no external ram. Just a prop, with a TV, sound, sd card and some spare pins for buttons. Hardware wise, I think that is pretty close to a prop demo board.
And pondering the zicog code, well if there is an instruction that loads A from location (HL) and increments HL, then just capture that in the opcode list, then call the code for LD A,(HL) and then the code for INC HL. So it is a matter of modifying existing code a little rather than writing too much new code.
The wiki article says an 8080 with some bit operations from the Z80. I'm pretty sure almost every instruction therefore already exists on the zicog.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
SO, I think your issues will be just getting the software running.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
I think it would work, and drivers are already written...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
Looking at the list of changed opcodes for the gameboy processor by Pat Fagan above it looks like a bit of work is required to make those changes to ZiCog. Better to fork ZiCog into a gameboy project, throw away all the CP/M stuff and hack the emulation into gameboy shape.
Good news here is that all the I/O instructions and a bunch of other ops are to be removed so we might gain some COG space to play in.
Bad news is that there are a hand full of Z80 ops that ZiCog does not handle just now. We are running out of room to squeeze them in. Mostly we don't worry as the CP/M systems we have running don't use Z80 ops.
But if we can delete some ops for the gameboy version then maybe it will make it easier to get those missing ops working
If you get serious about doing this I'll dig out our Z80 exerciser test results again and pinpoint what is missing in ZiCog just now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Sorry about the long wait--it would be great if you could check what needs to be done to make it happen.
Also, I think I remember someone asking what is in a sav file. I got a basic overview here on sav files in general: http://www.computerfileextensions.com/file-extensions.php/SAV
I will look around google to see if there is information specifically on gameboy sav files and how they work. I might also run an emulator on my computer and take apart the game... [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
The ROM (the game code itself) is not part of the snapshot of course, because it will never change anyway.
When you load a save file, the emulator just "fills" the hardware with the snapshot data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!