Previous Thread
Next Thread
Print Thread
Page 18 of 26 1 2 16 17 18 19 20 25 26
Joined: May 2007
Posts: 566
Likes: 2
M
Senior Member
Offline
Senior Member
M
Joined: May 2007
Posts: 566
Likes: 2
Hello all,

trying some application cases:

I assume we have the cartridge location in CPU address space at 0x6000 to 0x7fff, and we have three slots ("slot0", "slot1", "slot2"). The cartridge has two sockets with parallel ROM banks; i.e. we have to take care of a two-layer banking.

In the driver we find this declaration:

Code:
#define CARTBANK 10

static const ROMMapper PCB_ROM2_ONLY[] =
{
 { "socket1", "program1", SOMEFLAGS }
 { "socket2", "program2", SOMEFLAGS }
};

static ADDRESS_MAP_START(memmap, ADDRESS_SPACE_PROGRAM, 16)
        ADDRESS_MAP_GLOBAL_MASK(0xffff)
        ...
        AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(CARTBANK) AM_NAMEDSLOTREGION("slot0", "program1")
        ...
ADDRESS_MAP_END


In order to switch the inner-cartridge banks or the slots, some function in the driver could look like this:

Code:
   static const char *const slotname[] =
   {
      "slot0", "slot1", "slot2"
   };

   static const char *const bankname[] =
   {
      "program1", "program2"
   };

   static void switch_slot_and_bank(int slotno, int bankno)
   {
        memory_set_named_bank(CARTBANK, slotname[slotno], bankname[bankno]);
   }



(I'm still not quite sure whether that suffices for the driver to plug in the correct slot.)

In the case where you do not want to use the standard ROM/RAM handler (e.g. in the ti99 system the external read/writes get additional wait states), we use custom handlers and set the bank from within the machine implementation:

Code:
   (driver)
   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(cart_r, cart_w)

   (machine)
   UINT8* curr = memory_named_region(machine, "slot0", "program1");
   memory_set_bankptr(CARTBANK, curr);


Could make sense ... what do you think?

Michael

Joined: May 2007
Posts: 566
Likes: 2
M
Senior Member
Offline
Senior Member
M
Joined: May 2007
Posts: 566
Likes: 2
Well, if no one's complaining, this proposal can't be too bad. :-)

So let's keep that in mind; I'll put a copy on the DevWiki. Who'll be in charge of adding the support in the core?

In the meantime I'll start with rewriting some code in the ti99 driver so that it utilizes the existing banking mechanism of the core. Currently banking is done by moving pointers in the region, so I guess using banks would be a first step in the right direction.

Michael

Joined: Apr 2004
Posts: 1,555
J
Very Senior Member
Offline
Very Senior Member
J
Joined: Apr 2004
Posts: 1,555
I'm reading your updates with interest, just have not taken the time to really dig into it.

Joined: Mar 2001
Posts: 16,806
Likes: 32
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,806
Likes: 32
I'm on vacation and don't have the time to devote to ripping apart the latest proposal. Do not interpret silence as acceptance wink

PS: Aaron is changing CPUs, sound chips, and regions to have names instead of numbers right now so wait a few versions and you'll just inherit named region support.

Joined: May 2007
Posts: 566
Likes: 2
M
Senior Member
Offline
Senior Member
M
Joined: May 2007
Posts: 566
Likes: 2
Originally Posted By R. Belmont
I'm on vacation and don't have the time to devote to ripping apart the latest proposal. Do not interpret silence as acceptance wink


Sure ... just trying to keep the process going. :-)

If it takes some more time I can surely move up some other issues in the meantime. I'd just like to see that we soon come to an agreed solution here.

Michael

Joined: Dec 2007
Posts: 23
T
Member
Offline
Member
T
Joined: Dec 2007
Posts: 23
Well this might sound a little late. But why XML and not another format? What does XML offer that no other way of storing this data does?


Joined: May 2004
Posts: 949
Likes: 14
D
Senior Member
Offline
Senior Member
D
Joined: May 2004
Posts: 949
Likes: 14
1. There's already an XML parser integrated into MESS
2. It's human readable
3. It's extensible

Joined: Jun 2007
Posts: 34
F
Member
Offline
Member
F
Joined: Jun 2007
Posts: 34
I have been busy but I have read the thread, when I have time want to make some example with tape, cartridge, two cartridges, different floppies,360Kb, 180Kb, etc.

If this is not only cartridges two systems that come to my mind that differentiate their slots could be the apple 2 and the Amiga with the zorro bus.

Last edited by F. Valero; 07/25/08 12:34 PM.
Joined: Dec 2007
Posts: 23
T
Member
Offline
Member
T
Joined: Dec 2007
Posts: 23
Originally Posted By Duke
1. There's already an XML parser integrated into MESS
2. It's human readable
3. It's extensible


Okay thanks.

Imho the format should be easy to use for every emulator, and i hear a lot of resistance to using XML to build the file.

Would a simple plain text ini file limit the wanted results in any way?

Joined: Feb 2004
Posts: 2,273
Likes: 14
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,273
Likes: 14
ini files have no structure

Page 18 of 26 1 2 16 17 18 19 20 25 26

Link Copied to Clipboard
Who's Online Now
4 members (mixmaster, R. Belmont, 2 invisible), 27 guests, and 8 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,973
Posts117,882
Members5,001
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com