The bits of hardware that will go (hopefully) to make a Hardware version of the Microvision Emulator - An Arduino Leonardo, A 3 x 4 keypad, and a 128x160 TFT Screen.
Seems a shame to take a Colour LCD Screen and reduce it to 16 x 16 monochrome, but that's what I had in the box, I'd probably be better off with one of those Nokia LCDs.
Missing ; a Piezoelectric Buzzer. There's a couple in my junk box somewhere :)
Thursday, 2 January 2014
Now working......
Well, partly. The TMS1100 emulator is up and running and seems to be working okay, and you can control it from the keyboard - set breakpoints, single step and so on.
It has been running this code.
start
ldx 0
nextdigit
tcy 0 // point to start
carryforward
imac // increment and load digit
tam // write it back
ac6ac // add 6
br carryout // if carry set, then carry out
br nextdigit // else start again.
carryout
cla // clear the current one
tam
iyc // increment Y
cla // in case of carry out, unlikely !
br carryforward
All this does is increment each memory location one at a time till 10, carrying forwards, so it works like a giant counter with one digit in each memory location.
The point of this is to speed test (alternatively, to check it runs at the right speed). On my machine it was executing about 0.96 million loops a second, which equates to about 6.4Mhz clock speed (on the TMS series 1 instruction = 1 clock cycle*) . The TMS1100 runs at 50Khz or so, so it's going to be quick enough :)
It doesn't emulate any of the other hardware - LCD, Keyboard and Speaker (I'm not going to code for the rotary controller) - yet.
* note: for the pedantic, the clock speed is six times this, and it runs at 300Khz, every instruction being 6 clock cycles in length.
It has been running this code.
start
ldx 0
nextdigit
tcy 0 // point to start
carryforward
imac // increment and load digit
tam // write it back
ac6ac // add 6
br carryout // if carry set, then carry out
br nextdigit // else start again.
carryout
cla // clear the current one
tam
iyc // increment Y
cla // in case of carry out, unlikely !
br carryforward
All this does is increment each memory location one at a time till 10, carrying forwards, so it works like a giant counter with one digit in each memory location.
The point of this is to speed test (alternatively, to check it runs at the right speed). On my machine it was executing about 0.96 million loops a second, which equates to about 6.4Mhz clock speed (on the TMS series 1 instruction = 1 clock cycle*) . The TMS1100 runs at 50Khz or so, so it's going to be quick enough :)
It doesn't emulate any of the other hardware - LCD, Keyboard and Speaker (I'm not going to code for the rotary controller) - yet.
* note: for the pedantic, the clock speed is six times this, and it runs at 300Khz, every instruction being 6 clock cycles in length.
Emulator in Progress .....
Microvision Emulator main Screen |
Whilst the code is written though, the emulator commands aren't implemented yet, so it doesn't do anything at all.
It uses the SDL2 library so it should port to Linux and Windows. The alert reader will note I'm now developing on a Macintosh.
Some documents 'n' stuff
I've uploaded some documents and some things I did yesterday, see the link box on the right.
These are:
The next thing is to clarify the Hughes document, and to get the emulator working. This will be done in 'C' not Lua, not because Lua isn't fast enough, but because I want to port it to the Arduino which uses C.
These are:
- The Datasheet for the Hughes 0488 LCD Driver. This isn't the clearest document on the planet, but there is sufficient information there to figure out how it works. I will rewrite it more clearly in a day or two, as it is stupendously unclear how it works. It's actually quite simple but it appears to have been written when drunk.
- The TMS1x00 Databook which covers TMS1100 in some detail.
- Circuits from the Pinball Cartridge, and the main bit of the Cartridge, which were done by Dan Boris. Other cartridges are similar except for the rotary circuit (the LM741), (though I think this circuit is probably wrong because I can't see how the rotary control signal gets into the CPU - I'll probably use keys).
- A Definition File and Preprocessor script (in lua) - these are used to generate C code for the emulator, it's like a specialist macro processor.
- An Assembler for the TMS1100 and a simple test file, also in Lua. It's a very basic assembler, but then it's a very basic processor.
The next thing is to clarify the Hughes document, and to get the emulator working. This will be done in 'C' not Lua, not because Lua isn't fast enough, but because I want to port it to the Arduino which uses C.
Subscribe to:
Posts (Atom)