Jump to content
IGNORED

MAME: Aquarius


Pernod

Recommended Posts

I've noticed other Aquarius emulators haven't seen any development in a number of years. Would there be interest here of providing technical detail for improving the Aquarius emulation in MAME?

 

I've just added support for CAQ cassette images which will be available in the MAME 0.226 release. Whilst researching the Aquarius there are a number of features I'd like to implement, but will need some support from the community if possible.

 

Features I'm interested in implementing:

- Improve support for RAM modules.

- Add the older non S2 ROM (need ROM image)

- Support Aquarius II (need ROM image and any technical detail)

- Implement the Mini Expander as a separate device to be pluggable, and add controllers.

- Emulate the Aquaricart (need ROM image and banking detail)

- Document all known cassette dumps in the software lists (currently only includes those distributed with Virtual Aquarius, are there more out there?)

- Anything else??

  • Like 2
Link to comment
Share on other sites

I too would love to see MAME/MESS offer more options for Aquarius emulation; the apparent lack of hand controller support in particular is an impediment for Aquarius game development.

 

The only difference between the Aquarius "S2" and Aquarius II OS ROM images is the added 4K Extended BASIC image in the reserved region from $2000 to $2FFF.  This image is available; adding support for it to the emulator should be relatively easy.  The original "S1" image has not yet been dumped, as far as I know, but this too should be fairly easy; at some point I just need to sit down and finish a quick ROM dumper for one of my "S1" machines.

 

The bankswitching implemented by the SuperCart (the cartridge board used in the Aquaricart) was described in detail in my SuperCart development thread; see here.  If emulator developers wish to add bankswitching support, they should find everything they need in the first few posts in that thread.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, jaybird3rd said:

The original "S1" image has not yet been dumped, as far as I know, but this too should be fairly easy; at some point I just need to sit down and finish a quick ROM dumper for one of my "S1" machines.

 

Jay.... We need that rom Dumped... there is one in the VAQU (tools directory) or - use  the one from here (https://archive.kontek.net/aqemu.classicgaming.gamespy.com/aq_rom.htm) to do it...
I'm thinking of adding some glue logic to 64k winbond in the Sysrom, so that we can have diff core boot roms - and having the S1 rom..... 

 

  • Thanks 1
Link to comment
Share on other sites

8 minutes ago, MackJsy said:

Jay.... We need that rom Dumped... there is one in the VAQU (tools directory) or - use  the one from here (https://archive.kontek.net/aqemu.classicgaming.gamespy.com/aq_rom.htm) to do it...
I'm thinking of adding some glue logic to 64k winbond in the Sysrom, so that we can have diff core boot roms - and having the S1 rom.....

Thank you, that's good to know!  It looks like he's dumping the ROM contents through the printer port, which is just how I was going to do it.  I'll give it a try just as soon as I have time.

Link to comment
Share on other sites

1 hour ago, jaybird3rd said:

I too would love to see MAME/MESS offer more options for Aquarius emulation; the apparent lack of hand controller support in particular is an impediment for Aquarius game development.

 

The only difference between the Aquarius "S2" and Aquarius II OS ROM images is the added 4K Extended BASIC image in the reserved region from $2000 to $2FFF.  This image is available; adding support for it to the emulator should be relatively easy.  The original "S1" image has not yet been dumped, as far as I know, but this too should be fairly easy; at some point I just need to sit down and finish a quick ROM dumper for one of my "S1" machines.

 

The bankswitching implemented by the SuperCart (the cartridge board used in the Aquaricart) was described in detail in my SuperCart development thread; see here.  If emulator developers wish to add bankswitching support, they should find everything they need in the first few posts in that thread.

Thanks, was hoping you'd reply :)

 

So where can I find the Aquarius II OS ROM image?

 

Is the Aquaricart ROM image also available for when I implement your SuperCart?

 

The current Aquarius OS ROM in MAME differs from the one used by Virtual Aquarius by a single byte, at offset 0x0F0C. In MAME it's 0x01 and in VA it's 0x5B, can anyone explain this, which is correct?

  • Thanks 1
Link to comment
Share on other sites

1 minute ago, Pernod said:

The current Aquarius OS ROM in MAME differs from the one used by Virtual Aquarius by a single byte, at offset 0x0F0C. In MAME it's 0x01 and in VA it's 0x5B, can anyone explain this, which is correct?

Does it have the string "by Microsoft Inc. S2" in it ?

if so then they are both S2 roms, but I don't know

  • Like 1
Link to comment
Share on other sites

7 minutes ago, Pernod said:

Thanks, was hoping you'd reply :)

 

So where can I find the Aquarius II OS ROM image?

 

Is the Aquaricart ROM image also available for when I implement your SuperCart?

 

The current Aquarius OS ROM in MAME differs from the one used by Virtual Aquarius by a single byte, at offset 0x0F0C. In MAME it's 0x01 and in VA it's 0x5B, can anyone explain this, which is correct?

My pleasure!  I have the Aquarius II ROM image on my bench workstation; I'll dig it out for you when I get home this evening.  (I don't remember if the person who sent it to me wanted it posted publicly, so I'll send it to you in a PM.)  I'll send you an Aquaricart image at the same time.

 

I just went to check that ROM byte on the Aquarius here in my office, but I just realized that it's one of my "S1" machines!  I can only assume that one of the "S2" images is a bad dump.  The Aquarius II ROM is a relatively new dump, and the region from $0000 to $1FFF should be identical to the original "S2" ROM.  I'll send you both portions (OS and Extended BASIC) of the Aquarius II ROM this evening as separate files; whatever appears in the OS portion should be the correct contents of this ROM.

  • Thanks 2
Link to comment
Share on other sites

3 minutes ago, jaybird3rd said:

My pleasure!  I have the Aquarius II ROM image on my bench workstation; I'll dig it out for you when I get home this evening.  (I don't remember if the person who sent it to me wanted it posted publicly, so I'll send it to you in a PM.)  I'll send you an Aquaricart image at the same time.

 

I just went to check that ROM byte on the Aquarius here in my office, but I just realized that it's one of my "S1" machines!  I can only assume that one of the "S2" images is a bad dump.  The Aquarius II ROM is a relatively new dump, and the region from $0000 to $1FFF should be identical to the original "S2" ROM.  I'll send you both portions (OS and Extended BASIC) of the Aquarius II ROM this evening as separate files; whatever appears in the OS portion should be the correct contents of this ROM.

can you copy me in on the AQU II rom please -- wondering if I can fit it, but I need to check what addresses PLA1 does for ROM - (if it's 0000 - 2000 or 0000 - 2FFF)

 

 

Edited by MackJsy
  • Like 1
Link to comment
Share on other sites

8 hours ago, MackJsy said:

can you copy me in on the AQU II rom please -- wondering if I can fit it, but I need to check what addresses PLA1 does for ROM - (if it's 0000 - 2000 or 0000 - 2FFF)

Will do!  The Aquarius II ROM is a total of 12K, from $0000 to $2FFF.  $0000 to $1FFF (the first 8K) is the same "S2" OS ROM from the original Aquarius, and $2000 to $2FFF is the 4K Extended BASIC ROM.  I've never had a close-up look at the inside of an Aquarius II, but I wouldn't be surprised if they were two different ROM chips, with their own chip select logic.

 

(As a test, I burned Aquarius II Extended BASIC to a 4K EPROM and mounted it on a cartridge board with some custom address decoding glue to map it to $2000, and it worked fine in my original Aquarius.  This effectively made it into an Aquarius II, just without the full-touch keyboard.)

Link to comment
Share on other sites

@Pernod: You now have the Aquarius II and my current Aquaricart ROM images.

 

6 hours ago, Pernod said:

The current Aquarius OS ROM in MAME differs from the one used by Virtual Aquarius by a single byte, at offset 0x0F0C. In MAME it's 0x01 and in VA it's 0x5B, can anyone explain this, which is correct?

 

I checked the byte at the offset you mentioned in the Aquarius II OS ROM, and it is in fact 0x5B, so it appears that it is the MAME ROM that is incorrect.

Link to comment
Share on other sites

12 hours ago, jaybird3rd said:

I checked the byte at the offset you mentioned in the Aquarius II OS ROM, and it is in fact 0x5B, so it appears that it is the MAME ROM that is incorrect.

I'm inclined to agree, but wish I could find out where it originated. Here's the difference:

0x01

0EFF: 28 0A    jr   z,$0F0B
0F01: 23       inc  hl
0F02: 7E       ld   a,(hl)
0F03: 23       inc  hl
0F04: B7       or   a
0F05: CD 35 0F call $0F35
0F08: 18 F0    jr   $0EFA
0F0A: C1       pop  bc
0F0B: ED       db   $ed
0F0C: 01 DA 38 ld   bc,$38DA
0F0F: E7       rst  $20
0F10: CA 57 0F jp   z,$0F57

0x5B

0EFF: 28 0A       jr   z,$0F0B
0F01: 23          inc  hl
0F02: 7E          ld   a,(hl)
0F03: 23          inc  hl
0F04: B7          or   a
0F05: CD 35 0F    call $0F35
0F08: 18 F0       jr   $0EFA
0F0A: C1          pop  bc
0F0B: ED 5B DA 38 ld   de,($38DA)
0F0F: E7          rst  $20
0F10: CA 57 0F    jp   z,$0F57

Not sure what it affects, but doesn't look good.

 

So the Aquarius II, marketed by Mattel or Radofin? And released in 1983 or 1984?

 

Could multiple RAM cartridges be used together, ie. 16K + 4K to give 20K, or would they conflict?

 

All current software cartridge dumps are single files, usually 16K apart from Zero-In which is 8K. Are these true representations of the cartridge contents, ie. single ROM, or were some split over multiple ROMs? The Extended BASIC dump is 16K but only contains 4K of code. Is there a list somewhere of the ROM configuration of each cartridge?

  • Like 1
Link to comment
Share on other sites

It's in the string handling code, so unless you're running a basic app that uses strings, then it's probably not going to make any difference.

as the value being read is the 

0x38DA
0x38DB
14554
14555
    Contains the end address of the BASIC & simple & array list.

So I guess if you are using strings, then a crash or array corruption as a min would be expected.

 

 

 

Edited by MackJsy
  • Thanks 2
Link to comment
Share on other sites

2 hours ago, Pernod said:

So the Aquarius II, marketed by Mattel or Radofin? And released in 1983 or 1984?

To the best of my knowledge, the Aquarius II was marketed only by Radofin (and in very limited quantities), after Mattel Electronics dropped the Aquarius.  According to the updated Aquarius FAQ, 1984 would be the most reasonable release date for the Aquarius II (see section 4.5 of the FAQ).

 

Quote

Could multiple RAM cartridges be used together, ie. 16K + 4K to give 20K, or would they conflict?

No, they would conflict.  The address decoding logic in the RAM modules always assumes a base address of $4000.  The memory map that I posted here depicts how the 4K, 16K, and 32K RAM modules are mapped into that space; as indicated there, they would overlap if they were to be used together.

 

Quote

All current software cartridge dumps are single files, usually 16K apart from Zero-In which is 8K. Are these true representations of the cartridge contents, ie. single ROM, or were some split over multiple ROMs? The Extended BASIC dump is 16K but only contains 4K of code. Is there a list somewhere of the ROM configuration of each cartridge?

I haven't yet written up a detailed list of the ROM configurations for every cartridge, but as I recall, Extended BASIC and the Mini Expander Diagnostic cartridge were the only officially produced 4K program cartridges; both used a single 4K ROM.  AD&D Treasure of Tarmin was 12K (two ROMs, 8K + 4K); all other Aquarius program cartridges were either 8K or 16K.  I've opened original samples of every (released) 16K cartridge, and without any exception that I can recall, they all used two 8K ROMs with extra chip select logic.  It seems that 16K ROM chips were not widely used until some time later (at least not by Mattel/Radofin).  The memory map I linked earlier depicts how ROMs of these various sizes would be mapped into the 16K cartridge space, starting at $C000.

 

(Of course, the reason the smaller ROMs appear to be "mirrored" inside a 16K image is that the cartridge chip enable signal generated by the Aquarius is active over the entire 16K cartridge space.  If you were to install a smaller ROM in this space, the top address line(s) would be disconnected, and the lower address lines would wrap around to zero again if you tried to read past the space the ROM actually occupies, causing its contents to appear "mirrored" over the entire region.  Some cartridge images have been trimmed to the original ROM size, while others are simply raw dumps which captured the entire 16K cartridge space as it would have appeared in the memory of a running Aquarius, probably because that is how they were originally dumped.  When preparing the cartridge images for the Aquaricart, I had to trim these ROMs down, unscramble them, and then concatenate them again to fill an entire 16K bank.)

Link to comment
Share on other sites

Aqu II was definitely Radofin only, as Mattel handed back the Aquarius before the II was released. I so wanted one back then as it looked so cool, shame I didn't get one (and have kept it!)

 

https://www.old-computers.com/museum/computer.asp?st=1&c=74

 

@jaybird3rd I don't suppose if you happen to know if the ram is encrypted by the software lock encryption (Port FF)  - I guess it doesn't matter if it is or isn't in reality, but I guess makes sense, to encrypt all external DBus access for MREQ, as then all cart address space is covered (and PLA1 doesn't have the CE signal that's passed to the expansion bus, only EXBE {External Bus Enable} - So there's no way it would know if it's RAM or ROM). <- reason I ask is I read it in a release note for Vaqu !

 

  • Like 1
Link to comment
Share on other sites

36 minutes ago, MackJsy said:

I don't suppose if you happen to know if the ram is encrypted by the software lock encryption (Port FF)  - I guess it doesn't matter if it is or isn't in reality, but I guess makes sense, to encrypt all external DBus access for MREQ, as then all cart address space is covered (and PLA1 doesn't have the CE signal that's passed to the expansion bus, only EXBE {External Bus Enable} - So there's no way it would know if it's RAM or ROM). <- reason I ask is I read it in a release note for Vaqu !

I believe that all memory interfaced through the cartridge port is encrypted, no matter where in the memory map it appears, including RAM.  In fact, now that you mention it, I seem to recall that I had to encrypt the Aquarius II Extended BASIC ROM in order to get it to work on my test cartridge board ... and that I had to encrypt it differently for "S1" and "S2" machines, since there is some difference in the way they initialize the software lock on startup.  I'll remember the specifics as soon as I look at the "S1" ROM again, after I finally dump it ...

  • Like 1
Link to comment
Share on other sites

2 hours ago, jaybird3rd said:

I haven't yet written up a detailed list of the ROM configurations for every cartridge, but as I recall, Extended BASIC and the Mini Expander Diagnostic cartridge were the only officially produced 4K program cartridges; both used a single 4K ROM. 

Sounds like I need to trim the existing dumps, and split others and update the software list to represent the actual cartridge contents. What is the Mini Expander Diagnostic cartridge? Not heard of this or seen a dump of it.

 

Unrelated, but is the memory mapper used for anything? Anything I can test it with?

Link to comment
Share on other sites

48 minutes ago, Pernod said:

Sounds like I need to trim the existing dumps, and split others and update the software list to represent the actual cartridge contents. What is the Mini Expander Diagnostic cartridge? Not heard of this or seen a dump of it.

I can send you a collection of trimmed ROMs; I'll just need a day or two to put them together.  The Mini Expander Diagnostic was an internal Radofin tool for testing the Mini Expander PSG and hand controllers, as well as RAM modules.  A dump of the original hasn't been made public, but it is available in the Aquaricart.

 

48 minutes ago, Pernod said:

Unrelated, but is the memory mapper used for anything? Anything I can test it with?

Which memory mapper are you referring to?

Link to comment
Share on other sites

1 hour ago, jaybird3rd said:

I can send you a collection of trimmed ROMs; I'll just need a day or two to put them together. 

That'll save me a task of going through them looking for mirroring.

1 hour ago, jaybird3rd said:

Which memory mapper are you referring to?

Where the upper and lower 16K of the memory map are swapped, for CP/M.

Link to comment
Share on other sites

Don't suppose you could send me that diag rom image as well (I don't have an aquaricart as I went the Mini-Expander route) - However it will be useful for testing the Mini-Expander boards we now have :)

Thinking on  the CP/M swap, that's because it needs RAM at the lower 0000+, so that would then put RAM into the C000 to be swapped.... so that would then put the internal screen up to 0F000H and colour to 0F400H - interesting 

Link to comment
Share on other sites

On 10/23/2020 at 5:36 PM, jaybird3rd said:

The bankswitching implemented by the SuperCart (the cartridge board used in the Aquaricart) was described in detail in my SuperCart development thread; see here.  If emulator developers wish to add bankswitching support, they should find everything they need in the first few posts in that thread.

Lots of development over the past couple of days, will go into detail when I'm done.

 

For now I have some of questions to clarify SuperCart behaviour:

- in 16K mode which bank is selected at startup, bank 0 or the last bank available? Aquaricart image will work with either selected.

- in 8K mode the last bank is the fixed primary bank, but at startup what is the secondary bank, bank 0 or last bank same as primary?

- the example bankswitch code sets MSB of the bank, but valid banks are 0-127. What's the reason for setting bit 7 of the bankswitch?

 

I have the Aquaricart working, the above are just for clarification, though I still need to implement the switch mode detection from the header.

 

Now that I have access to the Mini Expander Diagnostic I can implement and test the controllers. How do other emulators map the 16 directions and 6 buttons to a keyboard, or don't they?

  • Thanks 1
Link to comment
Share on other sites

Very exciting developments, thank you!  See my answers below ...

 

1 hour ago, Pernod said:

- in 16K mode which bank is selected at startup, bank 0 or the last bank available? Aquaricart image will work with either selected.

The SuperCart uses a 74LS374 flip-flop to control the bankswitching.  Its initial state on powerup is undefined (according to the datasheets), so theoretically, any bank could be selected as the initial bank when using 16K mode.  In practice, however, the '374s that I use in the Aquaricart almost always start at Bank 0, or (much more rarely) at the last bank; I strategically copied the Aquaricart startup code into both banks, just in case.  So, for emulation purposes, I think that Bank 0 would be a reasonable "default" choice.

 

Quote

- in 8K mode the last bank is the fixed primary bank, but at startup what is the secondary bank, bank 0 or last bank same as primary?

I think that Bank 0 would be a reasonable default for the secondary bank in 8K mode as well, for the same reason given earlier.  It isn't nearly as important in 8K mode: in this mode, the primary bank is always guaranteed to be the last bank, and the programmers have the ability to initialize the secondary bank to whatever number they wish before using it.  My intention is to use 8K mode exclusively for new bankswitched cartridge software; the 16K mode was enabled solely for the Aquaricart.

 

Quote

- the example bankswitch code sets MSB of the bank, but valid banks are 0-127. What's the reason for setting bit 7 of the bankswitch?

Ah, I had forgotten about that code.  Setting that bit is a leftover from the now-deprecated "lockout feature" that I initially added to the SuperCart design; in the absence of this feature, it would have no effect on real hardware.  Bit 7 of the '374 is unused, so my original idea was to use that bit as a software switch to enable/disable the bankswitching; as long as it was held high, bankswitching was allowed.  This feature would have created more problems than it would have fixed, and it was removed from the design before it was ever used, so it does not need to be emulated.

 

Quote

I have the Aquaricart working, the above are just for clarification, though I still need to implement the switch mode detection from the header.

Excellent!  I'll be excited to see it!  I'm especially looking forward to testing new cartridge software with it, which will be very convenient.

 

It occurs to me that the current Aquaricart ROM might still be using the secondary bank ($C000) instead of the primary bank ($E000) as the target write address for bank switches.  As I mentioned in the SuperCart thread, I later decided to restrict bank switches to writes in the primary bank only; I will be adding an EEPROM to the SuperCart II, so I wanted to leave the secondary bank available for writable memory.  It wouldn't make any difference on real hardware, but I should update the Aquaricart ROM to reflect this restriction, so that it can be reflected in the emulator also.  I'll send you a patched version of the ROM shortly.

 

Quote

Now that I have access to the Mini Expander Diagnostic I can implement and test the controllers. How do other emulators map the 16 directions and 6 buttons to a keyboard, or don't they?

You may not need it anymore, but I'll send you a copy of the standalone Mini Expander Diagnostic ROM also.  The only emulator (as far as I know) that emulates the hand controller is Virtual Aquarius.  As I recall, it emulates only the primary eight directions (N, E, S, W, NE, SE, SW, and NW), and the six hand controller keys are hard-coded to the first six controller buttons.  It will be very nice to be able to re-map these controls in MAME!

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...