Jump to content
IGNORED

MAME: Aquarius


Pernod

Recommended Posts

On 6/30/2021 at 12:24 PM, jaybird3rd said:

Yes, it was added only recently, with version 0.227.  In case you need it, I posted an updated ROM set here.

Why am I having such a hard time with Mame.  I have it configured and I can run it to basic, but can't for the life of me figure out how to open any of my custom .BIN files.  I know I am missing something easy.  Is there a key that opens a menu or something?

Link to comment
Share on other sites

1 hour ago, chjmartin2 said:

Why am I having such a hard time with Mame.  I have it configured and I can run it to basic, but can't for the life of me figure out how to open any of my custom .BIN files.  I know I am missing something easy.  Is there a key that opens a menu or something?

Do you mean cartridge binaries?  You can attach them through the main menu.  Press SCROLL LOCK to toggle the MAME UI, then press TAB to open the menu.  I don't have a MAME machine within reach at the moment, but I believe that the cartridge port is configured as a slot device.

Link to comment
Share on other sites

20 hours ago, jaybird3rd said:

Do you mean cartridge binaries?  You can attach them through the main menu.  Press SCROLL LOCK to toggle the MAME UI, then press TAB to open the menu.  I don't have a MAME machine within reach at the moment, but I believe that the cartridge port is configured as a slot device.

Scroll lock is what I was missing... thank you.

Link to comment
Share on other sites

2 minutes ago, chjmartin2 said:

Scroll lock is what I was missing... thank you.

I can't get MAME to run a custom ROM to save my life.  I have several that work in Virtual Aquarius that are saying invalid ROM size in MAME.  This is why I can't stand Mame - it does so much but it isn't really good at computers.  Do you have an example Supercart ROM that I can try that you know works?

Link to comment
Share on other sites

3 minutes ago, chjmartin2 said:

I can't get MAME to run a custom ROM to save my life.  I have several that work in Virtual Aquarius that are saying invalid ROM size in MAME.  This is why I can't stand Mame - it does so much but it isn't really good at computers.  Do you have an example Supercart ROM that I can try that you know works?

I'm away from my development workstation, so at the moment I'm afraid I don't.  What size are the ROM images you are trying?

Link to comment
Share on other sites

40 minutes ago, chjmartin2 said:

I'll work on it... they are 8k roms... 

I don't think I've ever tried ROMs of that size in MAME, so it might require the ROM images to be at least 16K (since that's the size of the cartridge window in the Aquarius memory map).  You might try concatenating copies of the ROMs together to make a 16K image.

Link to comment
Share on other sites

1 hour ago, chjmartin2 said:

I can't get MAME to run a custom ROM to save my life.  I have several that work in Virtual Aquarius that are saying invalid ROM size in MAME.  This is why I can't stand Mame - it does so much but it isn't really good at computers. 

It will only complain of invalid ROM size if it's not a multiple of 4K.

 

1 hour ago, chjmartin2 said:

I'll work on it... they are 8k roms... 

Really? So the file size is 8192 bytes?

Link to comment
Share on other sites

22 minutes ago, Pernod said:

It will only complain of invalid ROM size if it's not a multiple of 4K.

 

Really? So the file size is 8192 bytes?

Nope - wasn't exactly 8192... I did pad it to 8192 and got one thing to run!   Let's see if the 4K ROMs will run!

Link to comment
Share on other sites

11 minutes ago, chjmartin2 said:

Ok, so I have a 1 megabyte Supercart ROM Image I am trying to get to run.  The ROM Image is in the format needed for the cartridge.  The data in the banks is all first and then the program data is in the last 8K.  Is that the format MAME needs?

Yes, that sounds like the correct ROM layout; in the 8K bank switching mode, the SuperCart always maps the last 8K bank of the ROM into the $E000-$FFFF range.

 

(If it doesn't seem to work, check to make sure you are using the correct cartridge header in the last bank for 8K bank switching.  On real hardware, it wouldn't make any difference as long as it's a valid header, since the jumper settings on the cartridge board determine the bank switching mode.  The emulator must use the header to determine the mode, as documented here.)

Link to comment
Share on other sites

7 minutes ago, jaybird3rd said:

(If it doesn't seem to work, check to make sure you are using the correct cartridge header in the last bank for 8K bank switching.  On real hardware, it wouldn't make any difference as long as it's a valid header, since the jumper settings on the cartridge board determine the bank switching mode.  The emulator must use the header to determine the mode, as documented here.)

For sure it is because I am not using the proper header.  I tried to Hex Edit it in, but now will go back and add it as data to the code before assembling.

Link to comment
Share on other sites

22 minutes ago, chjmartin2 said:

For sure it is because I am not using the proper header.  I tried to Hex Edit it in, but now will go back and add it as data to the code before assembling.

Using a hex editor should work also (as long as you are editing the correct bytes!).

 

While you're revisiting your code, however, you should also check to make sure that you are performing the bank switching by writing the bank number into a target address in the upper 8K bank, at $E000 or above.  The original SuperCart permitted bank switching writes into either bank, but that range is restricted to the upper bank with the SuperCart II, which MAME emulates (because I wanted to make the lower bank available for writable storage).  So, if you're writing to a target address in the lower bank, simply change the code to write to the upper bank instead; this should only require changing one byte for each occurrence of the target address.

Link to comment
Share on other sites

Just now, jaybird3rd said:

Using a hex editor should work also (as long as you are editing the correct bytes!).

 

While you're revisiting your code, however, you should also check to make sure that you are performing the bank switching by writing the bank number into a target address in the upper 8K bank, at $E000 or above.  The original SuperCart permitted bank switching writes into either bank, but that range is restricted to the upper bank with the SuperCart II, which MAME emulates (because I wanted to make the lower bank available for writable storage).  If you're writing to a target address in the lower bank, simply change the code to write to the upper bank instead; this should only require changing one byte for each occurrence of the target address.

I just figured that out the hard way I believe.  Here is my bankswitching code:

 

 bankmain:
    ld  de, $c000                     ; load the target address into register DE
    ld  a, 0                                  ; load the target bank number into the accumulator
        ld  (de), a                                ; write the bank number into the cartridge space
    call main                ; call the drawing program
    ld  de, $c000                 ; load the target address into register DE
    ld  a, 1                         ; load the target bank number into the accumulator
        ld  (de), a                        ; write the bank number into the cartridge space
    call main                ; call the drawing program[/CODE]

 

So, when you say I have to go into a target at $E000 or above I can't use $C000?  My program code is .org $E000.  Anyway, what am I missing because right now it doesn't appear the bank switching is working in MAME.  If I bankswitch into $E000 doesn't that mean that I lose my program code and execution because I write over it?

Link to comment
Share on other sites

3 minutes ago, jaybird3rd said:

Yes, you should change each occurrence of $C000 to $E000, because MAME will disregard bank switching writes below $E000.  Since your code resides in ROM, you don't have to worry about overwriting it.

It is running but clearly not bank switching or somehow has some other reset.  Program code loads, draws picture, outputs some sound but then repeats.  It doesn't look like it is resetting and redrawing the picture... We are sure that .org $E000 doesn't conflict at bank switching $E000?  

Link to comment
Share on other sites

1 minute ago, chjmartin2 said:

It is running but clearly not bank switching or somehow has some other reset.  Program code loads, draws picture, outputs some sound but then repeats.  It doesn't look like it is resetting and redrawing the picture... We are sure that .org $E000 doesn't conflict at bank switching $E000?  

Yes, the ORG directive simply tells the assembler the starting address of the assembled code.  The code at that address is burned to the cartridge ROM on the real hardware, and it is not possible to overwrite it in your program, and MAME should not permit this either.  (Even if it did, it would only change the first byte of the header, at address $E000.  This would not affect your program anyway, because by the time your program is running, the header has already been validated by the Aquarius OS, and is not used again after that.)

Link to comment
Share on other sites

Just now, jaybird3rd said:

Yes, the ORG directive simply tells the assembler the starting address of the assembled code.  The code at that address is burned to the cartridge ROM on the real hardware, and it is not possible to overwrite it in your program, and MAME should not permit this either.  (Even if it did, it would only change the first byte of the header, at address $E000.  This would not affect your program anyway, because by the time your program is running, the header has already been validated by the Aquarius OS, and is not used again after that.)

Yeah when I tried to change it, the emulator just went into Basic.  Can't figure out why it isn't bankswitching...

Link to comment
Share on other sites

Just now, jaybird3rd said:

Yes, the ORG directive simply tells the assembler the starting address of the assembled code.  The code at that address is burned to the cartridge ROM on the real hardware, and it is not possible to overwrite it in your program, and MAME should not permit this either.  (Even if it did, it would only change the first byte of the header, at address $E000.  This would not affect your program anyway, because by the time your program is running, the header has already been validated by the Aquarius OS, and is not used again after that.)

Is this the right code to bankswitch:

 

bankmain:
    ld  de, $E000                     ; load the target address into register DE
    ld  a, 0                                  ; load the target bank number into the accumulator
    ld  (de), a                                ; write the bank number into the cartridge space[/CODE]

 

So loading the target bank into $E000 is what will trigger the bank switch?

Link to comment
Share on other sites

27 minutes ago, chjmartin2 said:

So loading the target bank into $E000 is what will trigger the bank switch?

Yes.  (If the old $C000 target address appears elsewhere in your code, just be sure to change it there, too.)

 

29 minutes ago, chjmartin2 said:

Yeah when I tried to change it, the emulator just went into Basic.  Can't figure out why it isn't bankswitching...

When you tried to change the $C000 target address to $E000?  That in itself shouldn't prevent the cartridge image from loading.  If the emulator dropped back to BASIC, assuming that the fixed bank is in the correct place in the image, it probably means that the cartridge header failed the OS's validation check.  (Or, that the image was somehow not loaded successfully into MAME.)

Link to comment
Share on other sites

13 hours ago, jaybird3rd said:

(If you still can't get it working, feel free to post a copy of the image here, whether it's the one that isn't loading at all and/or the last one that loaded but was not switching banks properly.)

I still can't get it to work.  Here is the code I am using to bankswitch:

 

bankmain:

	    ld  de, $E000                     ; load the target address into register DE

	    ld  a, 0                                  ; load the target bank number into the accumulator

	    ld  (de), a                                ; write the bank number into the cartridge space

 

Here is where I grab the bankswitched data:

 



main:

    ld bc, 8191        ; (10) number of bytes of samples
    ld hl, $E000    ; (10) Memory Location to ROM Sample

    ld a, (hl)        ; (7) load first sample set into A
    rlc b            ; (8) set up b to be rotated

[/CODE]

 

The rest of the code plays audio, grabs data, decrements a counter and wastes cycles to keep the t-states equal between audio output.  Code all worked on the actual aquarius but doesn't seem to be working in the emulator.  

Link to comment
Share on other sites

In the code where you are loading the sample data, I notice that you are starting at address $E000:

 

ld hl, $E000   ; (10) Memory Location to ROM Sample
ld a, (hl)     ; (7) load first sample set into A

 

Is this where you intend to be loading your data from?  I was under the impression that your data is in the switchable banks, which start at $C000, while the code is in the fixed bank starting at $E000.  Loading from $E000 will cause the bytes of the cartridge header and your assembled code to be treated as if they were sample data, which is probably not what you meant to do.

 

(Remember, the only instances of $C000 that you need to change are the ones where you are writing the bank number to perform the bank switching.  If you're referring to location $C000 elsewhere for other purposes, those references should be kept.)

Link to comment
Share on other sites

33 minutes ago, jaybird3rd said:

In the code where you are loading the sample data, I notice that you are starting at address $E000:

 


ld hl, $E000   ; (10) Memory Location to ROM Sample
ld a, (hl)     ; (7) load first sample set into A

 

Is this where you intend to be loading your data from?  I was under the impression that your data is in the switchable banks, which start at $C000, while the code is in the fixed bank starting at $E000.  Loading from $E000 will cause the bytes of the cartridge header and your assembled code to be treated as if they were sample data, which is probably not what you meant to do.

 

(Remember, the only instances of $C000 that you need to change are the ones where you are writing the bank number to perform the bank switching.  If you're referring to location $C000 elsewhere for other purposes, those references should be kept.)

BOOM!  Ok, now I understand fully.  So I send the bankswitch instruction to $E000 but it still switches the $C000 area!!!  Let me fix!!!!  Yes, for sure it was reading the $E000 over and over and over.... stay tuned.  I may have a new thread soon!

  • Like 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...