[MAME] Emulating the MTX

Pernod
Posts: 27
Joined: 21 May 2017 17:26
Location: Croydon, UK

[MAME] Emulating the MTX

Post by Pernod »

The MTX machines have been in MAME (MESS) for a number of years and were marked as working. I recently tried the MTX512 and found the emulation was actually very preliminary, ie. the machine started and entered BASIC but you couldn't do much else.

I'm more familiar with the Acorn BBC range of machines but have recently been making improvements to other machines in MAME such as Dragon, Camputers Lynx, Z88, and am now looking at the MTX range.

I started this discussion over on Facebook, and appreciate the replies from Dave and Andy, and will continue to seek technical assistance here.

So I currently have both ROM and RAM based memory maps implemented, and can optionally load a ROM extension board containing either Pascal or NewWord, both of which seem to work so the ROM 2 subpages are also working.

I'm now trying to add floppy support with either the FDX or SDX boot ROMs. Whilst booting the FDX ROM (in ROM 3) it's trying to write, what look like vectors, to the ROM area 3FFC-3FFF, then jumps to D140 where no code exists. The SDX ROM that I tried also wants to write to the ROM region.
Here's some logging, where bankswitch are writes to IOBYTE, the rest should be self explanatory. If the memory map should be RAM based at this point then I'd expect to see a bankswitch 8x. Anyone any idea what could be wrong?

Code: Select all

Soft reset
[:exp:fdx:fdc] cmd: seek 1 0 (track=0)
[:] bankswitch 00
[:] bankswitch 01
[:] bankswitch 20
[:] bankswitch 30
[:z80] ':z80' (FD52): unmapped program memory write to 3FFE = 52 & FF
[:z80] ':z80' (FD52): unmapped program memory write to 3FFF = FD & FF
[:z80] ':z80' (FDD0): unmapped program memory write to 3FFC = D0 & FF
[:z80] ':z80' (FDD0): unmapped program memory write to 3FFD = FD & FF
[:z80] Z80 ill. opcode $ea $ff ($d140)
[:z80] Z80 ill. opcode $ea $ff ($d144)
[:z80] Z80 ill. opcode $ea $ff ($d148)
[:z80] Z80 ill. opcode $ea $ff ($d14c)
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: [MAME] Emulating the MTX

Post by Martin A »

I can decode the memory mapping

Where it does bank 00 then bank 01: That's the RAM test it only checks &4000 to &4007. The MTX 512 at boot has ram in page 00 at that point, but not page 1. so stops there.

Where it moves to bank 20 then 30: That's the paged rom auto run detection. It's finding a bootable room in rom page 3 and runs it.

Dave sent me a copy of (one of) his FDX's boot rom a while back to help with the development of the CPM boot rom in the MTXplus. That normally lives in rom 5, and not rom 3, however there's nothing in there that would stop it running in rom slop 3.

Once an auto-boot rom is detected, the OS jumps to &2010. Where the rom Dave supplied does the following:

The FDX's 80 column video card is initialised by setting up the 6845 on ports &38 and &39.
The Hardware drivers are then copied into high memory at &EC00 with a block move
The start-up code is entered at &EC01
The Keyboard is then set up which requires rom 0 being paged in
THEN finally the rom is paged out and the CPM boot sequence is started.

There aren't any vectors at FFF0 upwards in CPM mode, that's where the entry points are for the disc drive drivers.

There ARE vectors there however in ROM mode for the CTC
Pernod
Posts: 27
Joined: 21 May 2017 17:26
Location: Croydon, UK

Re: [MAME] Emulating the MTX

Post by Pernod »

Martin A wrote:The Hardware drivers are then copied into high memory at &EC00 with a block move
The start-up code is entered at &EC01
The FDX ROM was being paged out between these two steps so never jumped to &EC01. Fixed this and I now have the initial bootstrap screen. My 80 column implementation is only preliminary, no attribute handling, so will work on this before trying to read a floppy image.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
User avatar
1024MAK
Posts: 757
Joined: 24 Dec 2012 03:01
Location: Looking forward to summer, in Somerset, UK

Re: [MAME] Emulating the MTX

Post by 1024MAK »

Hello Pernod

Welcome to Memorum :D

I'm glad that you are working on getting MAME to better emulate the MTX.

There are a number of people here who will be more than happy to help.

Unlike on StarDot, traffic here can be rather light at times, so please be patient.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer in Somerset later in the year :D

Not as many MTXs as Dave! :lol:
User avatar
Dave
Posts: 1280
Joined: 11 Aug 2012 18:16
Contact:

Re: [MAME] Emulating the MTX

Post by Dave »

"Unlike on StarDot, traffic here can be rather light at times, so please be patient."

But, it's quality, not quantity, that's important :-)
Pernod
Posts: 27
Joined: 21 May 2017 17:26
Location: Croydon, UK

Re: [MAME] Emulating the MTX

Post by Pernod »

Thanks, appreciate the help. I couldn't even sign up to the Dragon forums, and no forum exists for the Camputers Lynx so here we are :)

As far as I know I'm using a proper dump from the 80 column character ROM and noticed the @ is different from photos and MEMU.
fdxboot.JPG
fdxboot.JPG (14.88 KiB) Viewed 12767 times
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
User avatar
Dave
Posts: 1280
Joined: 11 Aug 2012 18:16
Contact:

Re: [MAME] Emulating the MTX

Post by Dave »

Looking Good !

I guess the "@" appearance depends on the character set you have configured in your 80 column card.

As you've said, on a real FDX/SDX, the characters are stored in character ROMs on the 80 column boards

The character sets are shown in the FDX Technical Manual on my site

regards
Dave
Pernod
Posts: 27
Joined: 21 May 2017 17:26
Location: Croydon, UK

Re: [MAME] Emulating the MTX

Post by Pernod »

I'm kinda struggling with the FDX, here's my current logging:

Code: Select all

[:exp:fdx:fdc] cmd: seek 1 0 (track=0)
[:] bankswitch 00
[:] bankswitch 01
[:] bankswitch 20
[:] bankswitch 30
[:] bankswitch 40
[:] bankswitch 50
[:] bankswitch 00
[:] bankswitch 80
[:exp:fdx] drive control 00
[:exp:fdx:fdc] cmd: seek 3 0 (track=0)
[:exp:fdx] drive select ff
[:exp:fdx] drive control 04
[:exp:fdx] drive 00 selected, motor on
[:exp:fdx] drive status 4c
[:exp:fdx] drive control 0c
[:exp:fdx] drive 00 selected, motor on
[:exp:fdx] drive control 1c
[:exp:fdx] drive 00 selected, motor on
[:exp:fdx] 5" drive mode
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 5c
[:exp:fdx] drive status 4c
[:exp:fdx] drive control 1c
[:exp:fdx] drive 00 selected, motor on
[:exp:fdx] 5" drive mode
[:exp:fdx] set dma address 0000
[:exp:fdx] set dma address f300
[:exp:fdx] drive status 4c
[:exp:fdx:fdc] cmd: read track (c=e7) t=0
[:exp:fdx] drive status 5c
[:exp:fdx] drive status 4c
[:exp:fdx] drive status 4c
[:exp:fdx] drive control 18
[:exp:fdx] 5" drive mode
There are a few points I'm not sure about:
- when exactly should I select a drive? The control byte determines the drive number 0-3 but do we only actually select it when drive select enable is HI? Then there's drive select at IO 0x45, I see 0xff being written here but don't yet do anything with it.
- I see the DMA address being set to &FC00, really have no idea when I need to use this.
- At the end of my logging it's stuck in a loop checking the drive status at IO 0x40
- My drive status usually shows drive_ready and intrq, but no drq yet, may be a clue.

I'll return to the SDX until I get some clarification on the FDX.
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: [MAME] Emulating the MTX

Post by Martin A »

I'm not sure if this will be any help, it looks like it's an almost complete disassembly of the disc driver code from the FDX.

According to the original file date, I'd not touched it since 1994 ! It's just been moved from hard drive to hard drive since then.

Since our current projects - CFX and MTXplus use compact flash for storage the old floppy code was the one part I didn't need to look at, as it was replace in it's entirety by the CF code.

FDXdis.zip
(5.37 KiB) Downloaded 554 times
Pernod
Posts: 27
Joined: 21 May 2017 17:26
Location: Croydon, UK

Re: [MAME] Emulating the MTX

Post by Pernod »

Finally got around to taking another look at implementing the SDX in MAME. It seems I was a little hasty in giving up, once I set the dipswitches correctly it booted into CP/M.

These are using SDXCPM ROM, with the original CP/M System Disc in IMD format:
sdxcpm.png
sdxcpm.png (78.66 KiB) Viewed 10646 times
cpmbbc.png
cpmbbc.png (123.96 KiB) Viewed 10646 times
I see that MEMU uses fabricated PROM images for the character set, derived from the FDX manual. I'm currently using what is thought to be a genuine PROM dump but from my previous screenshots the @ is incorrect and only appears in the alternate character set. Does anyone have the 80 column board and is able to dump the two PROMs, or are they already available somewhere?

In CP/M mode I've implemented the 512K Silicon Disc. When I do FORMAT F: I don't see any attempt to access it on IO ports &50-&53, so no idea if it's working. How can I test it?

And with the normal SDX ROM:
0002.png
0002.png (43.79 KiB) Viewed 10646 times
I'm currently using the sdx-type07.rom from the MEMU distribution, is this a genuine dump or has it been patched in any way? I ask as according to the SDX manual I need to ROM 3 to initialise it but don't seem to need to.

Is there a collection anywhere of all known SDX ROM dumps, that haven't been patched in any way?

In addition to supporting the usual floppy formats IMD, HFE, etc., I've also added support for the MFLOPPY format.

Not floppy related but I also now support loading .RUN files from the internal MAMEUI.

Now that I can load a decent amount of software can anyone suggest some good test cases to give the memory banking a good workout?
- Nigel

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Post Reply