Saturday 11 January 2014

In which I make a stupid mistake.

Vegas Slots running
I've solved the puzzle of the difference between the manual and the code, and a couple of things that nearly but didn't quite work.

I noticed when running BlockBuster there appeared to be a second ball image running in parallel with the first one. I wondered if this was a feature of the rendering rather than the actual code, but it appears not.  So I did a review of the TMS1100 Code.

There's two dumb errors there. On TMS1100 with operands, some operands are reversed. So YNEC 4 is actually

0101 0010

where 0010 is the operand, backwards (e.g. 0100, 4 in binary). What I've only just noticed is that the bit test operands (RBIT, SBIT and TBIT1) and the Load X immediate LDX also have backwards 3 bit and 2 bit operands respectively. The only ones that aren't reversed at Branch and Call, with their 6 bit operands.

This explains much. I thought it strange that LDX 4 was used when according to the documentation it shouldn't work. But it was right, because LDX 4 was actually LDX 1 (e.g. it is 00101 100 - I interpreted 100 as 4 but it's actually 001 , e.g. 1) - so X was in the range 0-3, so the book is right (and the Microvision emulation in MESS is wrong).  Apart from this it didn't matter, it just put the rows in the wrong order because LDX is the only way you can load the X register, you can't increment it, decrement it, load it from memory or accumulator, all you can do is put a constant in it.

The bits were worse, it's remarkable anything worked at all. These are also reversed, so I was interpreting SBIT 1 (which is 001100 10) as SBIT 2 (e.g. the 10 should have been reversed), hence it set the wrong bit.

This was the cause of the spurious ball in Block Buster and also the weird cocked up display in MindBuster, which now looks right.

Of course there are still problems. Phaser Strike works perfectly except that the keypad is upside down - the setup keys are at the bottom rather than the top. It's possible that this might be because in Phaser Strike the cartridges are wired differently. Vegas Slots too works perfectly except it has the same problem that Block Buster did originally, viz. all the graphics or back to front and upside down. This might be simply because the 32 x 8 bit O mask ROM is wired differently. Or it might be another bug. I will have to investigate more closely.

Anyhow, I'm going to try to emulate the rotary control, then I will release another emulator so you can have a go at playing the Microvision games for real.

5 comments:

  1. Here's the Vegas Slots output PLA - not much there!
    www.seanriddle.com/vegasslotsopla.jpg
    I don't have any other carts to decap and compare this to.

    ReplyDelete
  2. Ranger Lannier scanned carts, boxes and instructions. Different carts have different overlays that are important for game play.

    Carts and system:

    http://www.mediafire.com/?6fge7fr5j2k6e6d

    Boxes 1 of 2:

    http://www.mediafire.com/?jxez8wlyln40vhz

    Boxes 2 of 2:

    http://www.mediafire.com/?7slp80ph4e6vux3

    Instructions 1 of 2:

    http://www.mediafire.com/?zhxnbguv7ch9s6k

    Instructions 2 of 2:

    http://www.mediafire.com/?ix4nil4ipm7a5g6

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Cheers - Looking at the PLA diagram on page 2-21 of the TMS1x00 book this suggests that the bottom lines coming in are A1,!A1,A2,!A2,A4,!A4,A8,!A8 (the ones that go off the bottom of the pic) and that SL/!SL are connected (at the top). The left hand side must go to the chip pins - so it looks like A1/O0 A2/O1 A4/O2 and A8/O3 are connected e.g. the PLA is doing a 1:1 write out. This is the sensible thing to do, it's designed for binary->7 segment decoding for calculators. Microvision development it gives you nothing.

    I did initially think that Block Buster was wired backwards - this was the first cart I tested and it came out as if it was - it might be that Slots is wired the right way round and the others aren't. I do have BlockBuster and Slots cartridges (real ones) so I might have to check the wiring by hand. Some carts do appear just to be different wiring.

    Can't find anything wrong with the code/emulator - it's much simpler than the MESS one which seems to be emulating the instruction PLA, it just emulates the actual functionality.

    ReplyDelete
  5. Here's the Blockbuster output PLA. As expected, it is the reverse of Vegas Slots.
    www.seanriddle.com/blockbusteropla.jpg

    ReplyDelete