Trash80 going prop
pullmoll
Posts: 817
Here's an emulation of the Tandy TRS80.
It works on a DracBlade. I can't get a RamBlade to do anything at all, because most probably the code to access external RAM is broken. It might work on a TriBladeProp #2, but I haven't tried. If you have another platform with external memory and want to run it, please contact me with the specifications or better yet code snippets to read and to write a byte from/to that external memory.
You need a SD card with any FAT filesystem, the file TRS80.ROM and any number of TRS80 command files (*.CMD).
The video is monochrome and output on the default pin(s) per target platform - if any.
The keyboard driver is based off of the standard PS/2 keyboard object, emulating the 64 key TRS80 keyboard.
The latest version now includes the rewritten qZ80 core which makes the TRS80 run a tad faster than the original on a 80MHz DracBlade.
That's all for now. Have fun!
v0.2.1: Saved some longs moving 8 functions and using jmps instead of calls followed rets
v0.2.2: Optimized qz80 core
v0.2.3: Moved qz80 core to ./lib directory. Got rid of separate XMM handler in favor of the combined SD SPI + XMM cog
v0.2.4: Add VGA graphics (default). Add support for subdirectories on the SD card.
v0.2.5: Fixed FAT32 mount. Now SD cards formatted with FAT32 should be working again. Also fixed video RAM characters < $20 issue in VGA driver.
v0.2.6: Incorporate the new qZ80 code for other emulations.
v0.2.7: Add detection of Ctrl+Alt+Delete to reset the Propeller. Lower volume to 0.46V and 0.85V of 3.3V, so the output is closer to the volume of the AY-3-891x emulation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 6/5/2010 4:59:32 PM GMT
It works on a DracBlade. I can't get a RamBlade to do anything at all, because most probably the code to access external RAM is broken. It might work on a TriBladeProp #2, but I haven't tried. If you have another platform with external memory and want to run it, please contact me with the specifications or better yet code snippets to read and to write a byte from/to that external memory.
You need a SD card with any FAT filesystem, the file TRS80.ROM and any number of TRS80 command files (*.CMD).
The video is monochrome and output on the default pin(s) per target platform - if any.
The keyboard driver is based off of the standard PS/2 keyboard object, emulating the 64 key TRS80 keyboard.
The latest version now includes the rewritten qZ80 core which makes the TRS80 run a tad faster than the original on a 80MHz DracBlade.
That's all for now. Have fun!
v0.2.1: Saved some longs moving 8 functions and using jmps instead of calls followed rets
v0.2.2: Optimized qz80 core
v0.2.3: Moved qz80 core to ./lib directory. Got rid of separate XMM handler in favor of the combined SD SPI + XMM cog
v0.2.4: Add VGA graphics (default). Add support for subdirectories on the SD card.
v0.2.5: Fixed FAT32 mount. Now SD cards formatted with FAT32 should be working again. Also fixed video RAM characters < $20 issue in VGA driver.
v0.2.6: Incorporate the new qZ80 code for other emulations.
v0.2.7: Add detection of Ctrl+Alt+Delete to reset the Propeller. Lower volume to 0.46V and 0.85V of 3.3V, so the output is closer to the volume of the AY-3-891x emulation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 6/5/2010 4:59:32 PM GMT
Comments
I ran out of cogs for the first time [noparse]:)[/noparse] The cog required for the keyboard is that which the sdspiFemto uses while loading the ROM image and a game.
BTW this is running on a DracBlade. The speed is somewhat faster than the original TRS-80 if I can trust my memory. It's just about the right speed for gaming. I had feared the overhead of checking every memory read/write address for special handling would cause more slowdown.
The keyboard.spin in the zip is patched to set a long to non-zero whenever a key is pressed or released. The io handler detects this and polls the state bits to update the 8 keyboard matrix bytes for the TRS-80.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/3/2010 10:10:03 PM GMT
My first exposure to computers was the TRS80 Model 1. wow.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Are you Propeller Powered? PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
Same here. No, actually it was a TRS80 clone, the Video Genie 3003. Except for the double width mode bit on port $ff it was compatible and so we could run all those nifty Big Five games...
BTW the keyboard LEDs keep on blinking, that is certainly no good sign. Is there any functio that I have to call except start?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/25/2010 10:03:14 PM GMT
(Yes, I know the Atari came two years after)
Still it seem to be on par with many other systems from that time.
You have developed an almost complete emulation of a system in a couple of weeks, that's impresssive.
Even though it's a very limited system, it's still an achievement.
Hehe, yes, the Trash80 is dead simple compared to the computers with colours. I don't exactly know when it came out. I first saw it here in a Tandy shop in 1980.
If it wasn't that simple, I would not have tried to emulate it. I don't think the guys here who are aiming at the Spectrum will have it all too easy.
When youtube finishes conversion, here is a little bit of Robot Attack
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
A couple of the games were finished and others were works in progress. The ones that are done will go into a demo mode and play themselves.
The Time Pilot ones weren't finished but you can start it by pressing 0, 1, 2, etc for the time period to start...
Robert
Post Edited (RobotWorkshop) : 3/25/2010 11:28:36 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module
Special Olympics Polar Bear Plunge, Mar 20, 2010
One of the dracblade boards had a TV socket on it (not the latest one as I didn't think anyone would use it). But it just uses 4 lines instead of the 8 vga lines and then there are 4 spare.
But I suppose the first question - is the computer you are emulating in color?
Running out of cogs? Yes, that happens...
That is why the vt100 and VGA code is combined together. I'm sure other things could be combined ? the keyboard and the ram driver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Robert
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
It should work on the TriBlade and the RamBlade as well.
I'll put your files on an SD and try them. Right now I have to recompile it to change the game.
Since the keyboard isn't working yet, I can only see the screens a program is presenting in its attract mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
No, I used the 1pinTV driver as the base and that means no color. Doesn't hurt, because the TRS80 was monochome.
I have populated the resistors and a cinch jack. I have no spare VGA monitor right now. All my older LCDs I've given away to friends who had none...
Nope.
Well, I don't need much more. Sound would be neat, since the sound effects played through the cassette port of the TRS80 were neat and of course a game without sound is only half as cool. I can shutdown the FullDuplexSerial cog after booting.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Are there other Z80 computers of around that vintage (early 80s) that can be emulated that have color?
Then there is always the gameboy with its approx 10 unique opcodes...
This is all moving so fast.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Not needed IMO, we have board designs that are perfectly fit for the task. I only have to find out why the keyboard object won't work on the DracBlade and/or try the 1pin keyboard instead. Of course you could make dedicated RamBlade sized ancient computer emulations and sell them to nostalgic old bums [noparse]:)[/noparse]
A gazillion, yes. Z80 was a widely used CPU for homecomputers. The Sinclair Spectrum comes to mind, the Schneider CPC464/64128, the later MSX computers (mostly sold in Japan) were all Z80. A list of "some" computers is here. Not all of them are Z80, of course. The 6502 was also widely used, and the 6809 a little less often.
That CPU would better be based off the 8085. I could do it, but I'm not too interested, because I never had a Gameboy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/26/2010 5:44:29 AM GMT
Perhaps we can get the mono 1-pin TV back to 1 cog and have the font in hub (8x12 displayed as 6x12 by only displaying 6 of the 8 pixels). It will be tight for timing but perhaps I can do it. Is inverse video used or what is done with the upper 128 characters (bit8=1)?
As you say, you can recover the serial port cog for the keyboard cog.
Sound was usualy done with 1pin (when present) on the old computers. Perhaps we can do this in one of the existing cogs using the counter and a pin.
This project has moved extremely fast. Congratulations once again. We will have to get some timings on the various boards plus the original Z80 for comparisons.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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 have the font in hubRAM now, because the renderer was too slow in distinguishing block from character graphics and generating block graphics by code. So I extended the font to full 256 characters and do nothing but collect 6 bits into a 32 bit accu that, whenever reaching more than 15 bits, stores a word in the scanline bitmap. It syncs with the emitter cog for double buffering, i.e. renders one scan line while the emitter displays the other.
I somehow doubt it will be possible to fetch data fast enough at a 6 pixel frame. I tried to do it in one cog and didn't get the video signal to make my monitor sync.
Right now the video emitter cog is pulling 32 bit longs from hub RAM at each waitvid.
I've done that already.
Yes. The TRS80 cassette port had 3 discrete levels of output which were controlled by 2 bits on output port $ff. I think a PWM would suffice? That could probably be done in my i/o cog.
I have just implemented the cycle counts in yaz80. They are, of course, optionally compiled in. With that and the Propeller's CNT you can get very good numbers of the real speed it runs at. You could e.g. just let it run for 1 million cycles (= 1MHz) and see how much below or above a real time second it comes out. The fetch loop would have to check for a cycle count underflow and whenever it happens subtract the underflow from 1_000_000 and store that away, and also store the delta CNT, so another cog or Spin could calculate the effective Z80 clock.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/26/2010 7:16:42 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
I can try to use the original code, but I don't think my 2-3 lines of change are causing it. It's more probable my keyboard is is deviant from the standard. Cheapest thing I could get. I write keyboards into pieces within a half to one year... [noparse]:)[/noparse]
The code is obviously trying to initialize the keyboard over and over, because the LEDs keep flashing once, just as on power up of a PC, then stay on for some time and flash again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
because it had everything all together and was working out of the box.
I know some people had derogatory names for it in the USA at that
time, they were jealous people and mfg competition, but we always
used the correct name here and didn't slander it, and even the local
competition computer stores that were other brand dealers
that sprung up after had respect for it. Calling it by
its real name will give it respect along with respecting
computer history that paved the way for more technology.
The work to bring a TRS-80 emulator to the Prop is a great
project, but will need some more work. I remember the screen
was so crystal clear you could see a perfectly formed raster
character. I regulated the position of those text font dots to
position points of light for reading by phototransistors.
But maybe this is a photo fault in the picture here and not
so clear. After the TRS-80, they came out with a color computer,
CoCo so that could be the next emulation. [noparse]:)[/noparse] Don't forget to
emulate the language too. The BASIC Level II was one of the
most sophisticated versions of BASIC that had advanced
string and arrays and many useful features.
I wrote many interesting computer programs on
the TRS-80 that moved a two ton HVAC robot, tracked and guided a
28,000 pound telescope for viewing the Moon, planets and DSOs, and
a speech recognition circuit, and a phoneme voice generator
made from a VOTRAX chip. The scope could track a marathon runner
holding up a dime at 5-miles away running across the width of a
football field. The TRS-80 also was the instrument that did all the
calculations for the 6-foot machine that did grinding and polishing
for a 40-inch diameter reflector telescope. When it wasn't doing
that, it was a controller with the Optoelectronic Interface and
the Thermodynamic Equalizer to regulate observatory robots,
instrumentation control panels, maintain temperatures, and
attend to astro imaging, time exposures, dome rotation,
telescope guiding, etc. I also wrote OPTICS language on the
TRS-80, a language later converted to Apple 6502 and now
I'm working on a Prop version.
It was the one and only computer I had that could quickly boot
up in a second, (it had the OS and language in ROMs) and was
instantly ready for program writing. I really miss that feature on
my Windows machine etc. If you could take a prop chip, store the
Level II language and emulator inside, have it boot in a second,
now that would be a great project!
humanoido
Anyway, the figures of the CP/M main loop waiting for keyboard input are 56_320_008 Propeller cycles per 1_000_000 Z80 cycles. Assuming a second would measure 80_000_000 Prop cycles, we have a factor of 1.42 and that means the Z80 runs at 1.42 MHz. Did I do the math right?
Of course counting cycles alone takes up some speed, 2 opcodes more in the fetch loop, 1 opcode more per instruction. And this is the DracBlade with the rather complicated latching going on for every memory access. The RamBlad will probably be faster.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Edit: Hmm.. works with your cpm archive, so it has to be on my side. I'll copy that one again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/26/2010 10:45:05 AM GMT
Juergen, I have to ask, do you ever sleep?
Re humanoido - that is a great bit of history there. Well, if a TRS80 can do all those things then an emulation ought to be able to as well. This is an exciting project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Funny. It works in the DracBlade CP/M environment, and the same driver, same pins, just not calling startx, but the default start, keeps flashing the LEDs and does nothing. I'll try your startx parameters next.
It's noon here now. I slept from abt. 12 hours ago until abt. 6 hours ago.. don't need much more than 6 hours.
Wait until you see some of the games. They may have had chunky graphics, but therefore their programmers spent a lot of time adding some other excitement to them. Galaxy Invasion can take it up with the colorful arcade version any time [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
I think CP/M was the serious business operating system, with spreadsheets and wordprocessors and programming languages. For me that was more interesting (the languages keep my brain active, the wordprocessor got me through medical school as no-one can read a doctor's handwriting!). Not many games in CP/M. Hmm - Chess. Zork. Pacman.
But the games machines are much more fun. I think there is a whole sub-culture of games enthusiasts for the propeller - some post here, but some seem to be over at the Hydra forum.
Just a thought - if you are short of cogs, do you really need serial ports on a 'games' machine?
I'm thinking about a generic board that can do the games machine and the serious CP/M machine. It needs TV or VGA (which we have) and it needs keyboard, and serial ports and sd card and the large ram chip.
And sound, it must have sound, even if it is awful square wave sound!
And does it need analog input for a joystick??
If so, that could be the option for VGA 8 pins, or TV 3 pins plus joystick plus sound??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
The RAM chip doesn't have to be 512K. That was way beyond what most machines had. I added 256K to my Schneider CPC464, which was years after the TRS80, and that memory was huge back then.
I think TV is actually better suited for gaming, especially those old games look better with scan lines and raster than on a clean LCD.
Sound is one thing I want to try. I am yet clueless how to do pulse width modulation, but it can't be all that difficult. I hope PWM doesn't require active intervention of a cog, because then it would probably need another dedicated cog... unless I can tweak the i/o cog to execute two tasks.
Analog joysticks were rare on homecomputers. Most had the simple Atari 4 direction, 1 button sticks.
BTW I see what this was good for! The shift/rotate instructions are broken, or at least one of them. Some games do weird things and I remember these effects from my other platform Z80 emulators. I'll make another yaz80 release, though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Not to get into a "religious war", but it got (maybe earned)·the nickname by not evolving fast enough as other alternatives came out.
In its time, it was indeed an impressive machine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John R.
Click here to see my Nomad Build Log
Older computers generally used either simple digital controls, with just a PIA type part, or potentiometers. Apple, and color computer used pots.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
Sorry to say that Chopper and Robotron both fail to start, probably because of the uninitialized memory at 4000..41xy. I start the game at its entry point right at the first jump in the TRS80 BASIC ROM. The games that work don't rely on the "BIOS area" being initialized.
The Timepilot files both show an initial screen, once with a horizontal line and once without. Since I didn't find the reason why the Keyboard.spin isn't working in this environment, I can't start them.
I will improve the startup by waiting for the moment when the ROM has finished its basic setup of the RAM areas and only then jump to the loaded program.
Attached is the most recent code, still with a major bug lurking somewhere that most probably clobbers the code or data ranges of the keyboard driver in some way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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