Page 1 of 7

Simulating the MECB

Posted: Thu Aug 22, 2024 8:51 pm
by epaell
I've been working on simulating parts of the MECB (and potential future MECB CPUs) using MAME and thought it would be useful to create a dedicated thread on this for those are interested in it. I have a tentative version that works on my computer (and old MacBook Pro, Intel processor) but in theory it should work on any platform that MAME supports. I've posted my code over here:

https://github.com/epaell/MECB

It includes versions for the 6502 and 6809 boards and also "hypothetical" Z80 and 68008 boards. At the moment it only emulates the 6850 (ACIA) and 6840 (PTM).

Re: Simulating the MECB

Posted: Thu Aug 22, 2024 9:36 pm
by djrm
Hi,
My system:

Code: Select all

david@I7MINT:/opt/mame-mame0268$ inxi -Sxxx
System:
  Host: I7MINT Kernel: 6.8.0-40-generic x86_64 bits: 64 compiler: N/A
    Desktop: Cinnamon 6.0.4 tk: GTK 3.24.33 wm: muffin vt: 7 dm: LightDM 1.30.0
    Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy
When I run mame I got this error

Code: Select all

david@I7MINT:/opt/mame-mame0268$ ./mecb6809
System media audit failed:
mecb6809.bin (16128 bytes) - INCORRECT CHECKSUM:
EXPECTED: CRC(fbbd6038) SHA1(da9092a9e0c78605cfdd7c424c455422b6aaf052)
   FOUND: CRC(3bd8acaa)
The system told me the crc and sha1 values eventually after fixing the crc

Code: Select all

david@I7MINT:/opt/mame-mame0268$ ./mecb6809
mecb6809.bin WRONG CHECKSUMS:
    EXPECTED: CRC(3bd8acaa) SHA1(da9092a9e0c78605cfdd7c424c455422b6aaf052)
       FOUND: CRC(3bd8acaa) SHA1(5f76b8e1e554a3dddcaebd63f6ccf7e545948546)
WARNING: the machine might not run correctly.
Average speed: 97.41% (9 seconds)
allowing me to fix the sha1 as well, no checksum fault after that.

Code: Select all

ROM_START(mecb6809)
	ROM_REGION(0x10000, "maincpu",0)
//	ROM_LOAD("mecb6809.bin",   0xC100, 0x3F00, CRC(fbbd6038) SHA1(da9092a9e0c78605cfdd7c424c455422b6aaf052))
	ROM_LOAD("mecb6809.bin",   0xC100, 0x3F00, CRC(3bd8acaa) SHA1(5f76b8e1e554a3dddcaebd63f6ccf7e545948546))
ROM_END

I think the missing rom in 6502 is the monitor, biosev.rom
Screenshot from 2024-08-22 22-24-51.png
hth David.

Re: Simulating the MECB

Posted: Thu Aug 22, 2024 9:40 pm
by epaell
Thanks David,

That gives me some useful clues - I'll try to see what's going on there.

Emil.

Re: Simulating the MECB

Posted: Thu Aug 22, 2024 10:08 pm
by djrm
Hi Emil, you're welcome.
I tried connecting with a tcp socket but the results are similar, i.e. funny mixture of characters on the screen.
"./mecb6502 -window -resolution 640x480 mecb6502b -rs232 null_modem -bitb socket.localhost:1234"
googling around it seems I can change the mame baudrate but I cant find the menu to do this either
Best regards, David.

Re: Simulating the MECB

Posted: Fri Aug 23, 2024 12:01 am
by epaell
Hi David,

I've cleaned up the code to more consistently update the checksums in the source files. The version in GitHub should hopefully fix the problem with that. The bioscv rom issue was my fault - it was a left-over from some of my experiments in simulating the creativision system - I've removed that from the code.

Regarding the baud rate problem ... I wonder if it is a setting with MAME? If you press Fn-delete and then Tab it should bring up the setting menu. In there, on my system, when I look at the Machine Configuration it appears to be set up for 8 bits, no parity, 115200 RX and TX baud 1 stop bit. I'm not sure if that helps? I'm not sure what else would affect this.

Cheers,

Emil.

Re: Simulating the MECB

Posted: Fri Aug 23, 2024 6:12 am
by djrm
Hi Emil, being new to MAME I was unaware of the setting menu required magic key presses, I found the rs232 settings and applying 115200 to Tx and Rx speeds has cured the serial connection problem, default was both set to 9600 bps.
Getting the latest from GH has cured the other problems with checksum and missing rom.
Thanks for your help, much appreciated, David.

Re: Simulating the MECB

Posted: Fri Aug 23, 2024 7:16 am
by epaell
LOL, yes, those "magic" key presses took a lot of Googling to find so I recorded them in my personal notes so I never have to do that again! Anyway, I'm very happy to hear that it is working for you now - it's a great way to end the week (and also receiving more MECB boards in the mail).

Re: Simulating the MECB

Posted: Sun Aug 25, 2024 8:29 pm
by djrm
Now I have the build system working nicely, although a bit slow for an initial build of everything. I am copying and modifying the sources to mimic my old system by adding a 6551 and hd44680, my room is included and it's building but not quite right yet. The debugger is handy. Hopefully get some good results shortly ...

Re: Simulating the MECB

Posted: Sun Aug 25, 2024 8:54 pm
by epaell
Nice! Agree, the debugger is really useful - it really helped me to get some of the not-yet-"real" systems running with software made for different systems. I look forward to seeing your results.

Re: Simulating the MECB

Posted: Sun Aug 25, 2024 9:34 pm
by djrm
First run using old rom contents in mame simulation:
Screenshot from 2024-08-25 22-31-11.png
A bit rough around the edges, now need to see if the ACIA is working.