Saturday, August 26, 2017

Getting the Third Millenium Arcade Board MLDEMOS to run

I loaded up the MLDEMOS on the Third Millenium arcade board and took a look at where it was hanging up.

./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug


It was spinning in a loop around 088e and proceeding no further.

I set a break point at 088e with "bpset 088e" and after it hit the breakpoint, did a "history".

It was obviously writing data to $c0c1 and $c0c0.



I also did a disassembly from 800 to 1800 with "dasm mldemo.asm,800,1000" to take a look at.


less mldemo.asm | grep '$c0c1'
08E4: AD C1 C0 lda $c0c1
0990: 8D C1 C0 sta $c0c1
0993: 8E C1 C0 stx $c0c1
0A80: 8D C1 C0 sta $c0c1
0A83: 8C C1 C0 sty $c0c1



less mldemo.asm | grep '$c0c0'
0859: 8D C0 C0 sta $c0c0
09B3: 8D C0 C0 sta $c0c0
09DE: 8D C0 C0 sta $c0c0
0A09: 8D C0 C0 sta $c0c0
0A3B: 8D C0 C0 sta $c0c0
0A68: 8D C0 C0 sta $c0c0


The arcade board is supposed to be in slot#4 which maps to the $c0cx memory space, and the code in a2arcade.cpp looks like this:

======================================================


/*
    C0nx map:
    0 - TMS read vram
    1 - TMS read status
    2 - TMS write vram
    3 - TMS write register
    5 - AY register select
    6 - AY data
*/


void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data)
{
 switch (offset)
 {
  case 2:
   m_tms->vram_write(space, 0, data);
   break;

  case 3:
   m_tms->register_write(space, 0, data);
   break;

  case 5:
   m_ay->address_w(space, 0, data);
   break;

  case 6:
   m_ay->data_w(space, 0, data);
   break;
 }
}






So if it's writing c0c0 and c0c1, nothing is happening since we've got no cases for that.

So let's add case 0 and case 1: (assuming they're just like case 2 and 3)
=================================



void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data)
{
 switch (offset)
 {
  case 0:
   m_tms->vram_write(space, 0, data);
   break;
  case 1:
   m_tms->register_write(space, 0, data);
   break;
  case 2:
   m_tms->vram_write(space, 0, data);
   break;

  case 3:
   m_tms->register_write(space, 0, data);
   break;

  case 5:
   m_ay->address_w(space, 0, data);
   break;

  case 6:
   m_ay->data_w(space, 0, data);
   break;
 }
}



And things start working!








Happy guy from the MLDEMO hotel scene:

Friday, August 25, 2017

Playing with the Arcade Board on Apple2e

I thought I'd see what the Arcade Board would do on the apple2e driver. If you didn't know what it is, it's a card that has a tms9918 graphics chip and a sound chip.

So the arcade board prefers to be in slot 4.

./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do


and once it boots, you can run the basic demos.




But just for fun, let's see what modifying the TMS9918 memory will do, so we launch mame with the debug.

./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug


If you CTRL+C the basic demo, the animation stops.

So let's open a memory window and choose the TMS9918 vram space:



and I've written bytes 68 6A to memory positions 00 and 01
and 69 6B to memory positions 20 and 21, which has the effect of changing the tiles to the letter M.



and you can see the M in the upper left:




Thursday, August 24, 2017

Getting 80 column BASIC listing on apple2e

So I was disappointed that I could only get a 40 column wide printout from my basic listing, so I tried PR#3 to activate the 80 column card but once you activate the printer with PR#1, that brings it back to 40 columns.

Thinking about it, I remembered that Beagle's Double-take would let me do listings in any column width.

Launching mame with the double take floppy:

./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile8.bin -flop1 Double\ Take.zip












Booting double-take and then

CTRL+F shift+1 /80 will get you 80 columns
CTRL+F shift+1 /255 will get you 255 columns

Interestingly, mame's -printout function won't wipe out your previous printout file if it has the same name, it just overwrites the data in the existing file.




Wednesday, August 23, 2017

Getting a BASIC listing from mame's apple2e driver

So after much much fiddling, I've figured out how to get my basic listing out of the apple2e driver in mame 0.188.


I launch mame with the following command line:


./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile.bin


and then I ctrl+reset (ctrl+f12) to get to a command prompt, type

PR#1
PRINT "HELLO THERE"
PR#0

and then drop out of mame with ESC.


But I look at the output file and it's not right.

hexdump -C myprintfile.bin 
00000000  8d 8a dd d0 d2 c9 ce d4  a0 a2 c8 c5 cc cc cf a0  |................|
00000010  d4 c8 c5 d2 c5 a2 8d 8a  c8 c5 cc cc cf a0 d4 c8  |................|
00000020  c5 d2 c5 8d 8a 8d 8a dd  d0 d2 a3 b0 8d 8a        |..............|
0000002e
So I use unix tr to get rid of the high bit, and the text is there.

tr '\200-\377' '\000-\177' translates characters 128-255 to 0-127.

cat myprintfile.bin | tr '\200-\377' '\000-\177' | hexdump -C
00000000  0d 0a 5d 50 52 49 4e 54  20 22 48 45 4c 4c 4f 20  |..]PRINT "HELLO |
00000010  54 48 45 52 45 22 0d 0a  48 45 4c 4c 4f 20 54 48  |THERE"..HELLO TH|
00000020  45 52 45 0d 0a 0d 0a 5d  50 52 23 30 0d 0a        |ERE....]PR#0..|
0000002e
So now I can get my listing, hooray!

I suppose that I could just set the SSC card to 7 bits.




Saturday, August 19, 2017

Checker King for apple 2

I've been playing a bunch of apple 2 games lately, and rather enjoying the "classics".

I fired up this game disk called "The Black Sage" and interestingly, after running a catalog, finding a Checkers game called Checker King.












You type N to put numbers on the squares (so you know what square is what)

P to pass (though I thought you weren't allowed to pass)
R to reset everything
C to clear everything
M to change the pieces
IQ8 to set the computer's intelligence to level 8, can set from level 1 to 8



and a typical move will be something like:

22-18

and if you can do multiple jumps just put dashes between each step

25-18-9