Tuesday 18 March 2014

New Release, (Build 14)


I have upgraded it to Build 14. The changes since the last one are :
  • Added checksums for all known cartridges that are dumped in their current state. If this changes because dump errors turn up, the paddles will work differently.
  • Sea Duel now displays the flag properly (see the 2nd picture from the left - it's meant to be the Stars and Stripes ....). The LCD latency trackers do not change when there are no addressable->output latches in a frame - static displays with only one row/column pair.
  • Sea Duel now plays the tune (albeit it sounds terribly stuttery on Windows XP/Virtualbox, though it seems fine on Mac ?).  Might be a VirtualBox issue.
  • Sea Duel assumed TMS Data Memory was all zeroes on start up, the spec doesn't say this, but it probably is in practice. I suspect this is because they aren't cleared on reset, which isn't quite the same things cleared on power up - you can reset a TMS1100 mid program, but you can't do this with Microvision games.
  • The CPU speed now is correct for some programs (Sea Duel sounded squeaky because its clock is half the speed)
  • The Paddle controls are calibrated for known cartridges, so it is possible to play Baseball which has a way-out range. Other new games (e.g. Connect 4, Super Block Buster) now enable the paddles when loaded.
  • It now starts in run mode. To run in debug mode, prefix the name with an @ (e.g. mvem @sbb.bin)
  • The screen size can be changed by adding wwwxhhh e.g. mvem mind.bin 320x200

Windows and OSX executables are downloadable from the sidebar on the right. The source is in the OSX executable (and is the same for Windows, save for the build process).

Sunday 2 February 2014

Composite Instructions

The various how tos are all over the blog, I thought I would summarise them here.

Stuff is downloaded from the link bar on the right. It all is open source - do what you wish with it, please keep attributions however.

The Emulator

to run the emulator either ./mvem <binary> or mvem <binary>. It requires SDL2 - for Windows the DLL is included, for others you will have to go to www.sdl.org. It doesn't use anything else. The mouse control on Windows does not appear to work properly, and this appears to be a Windows problem. 

The currently available binary images are in both archives. The osx file contains the source files as well (the work was done on a Mac)

If there is an overlay bitmap file - in windows .bmp format, because this is the only format that SDL can read directly.

it boots up in debug mode - the keys are :

0-9A-F  change displayed address
G run program until broken (with M)
K set breakpoint at current address
S single step
V step over
M return to monitor (if running)
Esc exits the debugger

When running, O & P control the paddle,  and 123QWEASDZXC are the Microvision keys. If you write home-brews on it that use the paddle, or have the reversed output as Vegas Slots does, you will have to hard code this in the emulator - each ROM image has a checksum which determines whether it has the paddle hardware or not, what the charging times are (best way to do this is trial and error) and whether the output to the LCD driver is back to front or not. 
 
The Assembler
    
The Assembler is a lua file called tmsasm.lua , which assembles TMS1100 assembler - it is basic but it works. There are plenty of sample codes to see, but the basic differences to some others are :

there are no expressions  - you cannot write tcmiy label+1 for example
ldp, br and call extract the right bit from the address used, you do not have to modulo 64, or divide by 64 modulo 16. 
No support is provided for chapter bits outside comc, obviously. High chapter usage is shown in the space invaders source, which is mostly in the upper chapter.
lbr and lcall are shorthands for ldp x; br x and ldp x;call x respectively.
 
The hardware version

The hardware version requires a directory with the .ino file, the header files copied from the OSX emulator and absolute links to include the C code from the OSX emulator version. Relative links don't work. You can see this in the .ino file. It is designed for a 328 based Arduino (e.g. Duenamolive in this case) but it should work okay on most Arduinos or other MCUs really , all it does is scan the various hardware bits. The .ino code just translates hardware calls into Arduino compatible ones. 

The wiring is very basic. It uses a LCD4884 shield, available from most of the usual suspects. The buzzer is connected to Pin 8 via a 100R resistor , and the keypad as follows:

Arduino 13 -> Keyboard 3 (C0)
Arduino 12 -> Keyboard 1 (C1)
Arduino 11 -> Keyboard 5 (C2)
Arduino A5 -> Keyboard 2 (R0)
Arduino A4 -> Keyboard 7 (R1)
Arduino A3 -> Keyboard 6 (R2)
Arduino A2 -> Keyboard 4 (R3)

The keypad is one of those stock 3 x 4 keypads available cheaply from most suppliers with rows : 123 456 789 *0#


Saturday 1 February 2014

Next up .... this

In the ever moving down the game system coding ladder, this is my next target.

It's called the 'Entex Select-A-Game'. This one is colour, sort of, on a 16 x 7 Grid - so it is half the resolution of the Microvision.

Wednesday 29 January 2014

Round Up

Overall, I'm quite pleased with this RetroChallenge, after the mess of the last one anyway, which never really got restarted when I went on holiday.

I achieved most of what I planned - emulator, new game (actually two) and an Arduino version.

The 8021 was about 3/4 completed, but I never really went anywhere with it. It's more challenging to write for a TMS1100, and it's supposed to be a challenge.

It went a bit sideways in the middle, when the ROMs turned up. People have been thinking about home-brew Microvision games and emulators for years, but nobody dumped the ROMs even though it was known to be possible, and then two came along at once.

Thanks especially go to : Sean Riddle, Kevin Horton and Dan Boris.


Final Code Release

Must be a boring film....
So, another Retrochallenge month comes to an end.

I've updated everything and rebuilt everything. The emulator has changed slightly, not bug fixes but changes to work with the Microvision / Arduino in the source, mainly to do with types (I forgot Arduino ints are 16 bits, longs 32 etc.). The main problem was that the rotary control only worked about 2/3 off the screen (due to wrap-around in the integer).

One mistake was that I put the rotary control checking stuff in the SDL hardware driver, so that came out and went where it belonged in the shared code.

Microvision.ino is a new upload. This is the Arduino file and is the extra bit you need besides the original source. Arduino doesn't really like complex project structures (not that this is complex) so you have to copy the header files from the source in and include the two shared files as a direct address link (e.g. the full path). It doesn't seem to work otherwise.

The last upload is a big one, 66Mb in size, it is the complete project tree off my machine, which contains everything.

I really must learn to use github and so on for the next project.


Sunday 26 January 2014

Saturday 25 January 2014

Hardware Version, progress report #4

10k Pot added to the breadboard
Well, I think I've pretty much finished.

I found a 10k Pot in my box, from memory it was one of a batch I bought to repair a Microvision unit where the rotary controller was broken, and wired it into the remaining analogue port, and it plays fine.

Sound and Graphics work okay. There are a few minor graphic problems which relate to the incomplete emulation of the LCD.

Tomorrow I'll try the full LCD latency emulation and see how it works, it might well still be quick enough.

I will pinch our camera and make a video of some sort of the game being played, so you can see it is for real :)

One thing I forgot is that gcc-avr and gcc-x86 have different ideas about how big ints, longs and so on are - this was causing an overflow on the potentiometer calculations on the AVR, but it now all seems fixed and running nicely.