MAME: Click (and other large ROMs)

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Sun Feb 10, 2019 12:48 am

Pernod wrote:
Thu Jan 03, 2019 1:13 am
SpellMaster and Mega3 both use the same carrier board, switching zones are:

Code: Select all

/* switching zones for SpellMaster */
if (offset == 0x3f00 && m_bank == 0) m_bank = 7;
if (offset == 0x3f20 && m_bank == 0) m_bank = 6;
if (offset == 0x3f40 && m_bank == 0) m_bank = 5;
if (offset == 0x3f60 && m_bank == 0) m_bank = 4;
if (offset == 0x3f80 && m_bank == 0) m_bank = 3;
if (offset == 0x3fa0 && m_bank == 0) m_bank = 2;
if (offset == 0x3fc0 && m_bank == 0) m_bank = 1;
if (offset == 0x3fe0) m_bank = 0;
It seems to only be able to switch into higher banks from bank 0, without that condition it runs code in the switching zones which causes havoc.
Great work decoding this. I was looking to RE the PALs in the carriers of my Spellmaster and InterWord, but it's a bit difficult due to the fact the PALs are registered, so the info you've provided is a big help. The logic you describe above would be quite simple to implement in the PAL.

I notice from your code that you've only applied this logic (to only switch to higher bank if already in bank 0) to the ccispell ROM type. I wonder if this logic should also apply to the other CC PALs (eg ccibase)?

I've traced the wiring of the cciword carrier board, and note that nOE & nCE are both wire into the PAL. I also note that the CLK input is wired to output pin 19 of the PAL (I've called this CLKO). On this basis, I'm guessing the PAL coding would be something like this:

Code: Select all

	OPALjr Example
	Copyright National Semiconductor Corp, 1993.

	Computer Concepts - 32K PALPROM

CHIP CCPALPROM GAL16V8

A12=2 A7=3 A6=4 A8=5 A9=6 A5=7 A11=8 A10=9 GND=10
nCE=12 nOE=13 A14=17 A13=18 CLKO=19 VCC=20 

@define 0x8040  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6* /A5"
@define 0x8060  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6*  A5"


EQUATIONS

A14 :=  0x8040* /nCE* /nOE

CLKO =  0x8040* /A14
     +  0x8060
     +  nCE
     +  nOE
where CLKO is the PAL output that is wired back to the PAL CLK input, and the /A14 term in the '0x8040* /A14' line is there to check that switching is always done from bank 0. I'll test this out once I build up a prototype carrier board.

Thoughts?

User avatar
Pernod
Posts: 1461
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: Click (and other large ROMs)

Post by Pernod » Sun Feb 10, 2019 3:14 am

KenLowe wrote:
Sun Feb 10, 2019 12:48 am
I notice from your code that you've only applied this logic (to only switch to higher bank if already in bank 0) to the ccispell ROM type. I wonder if this logic should also apply to the other CC PALs (eg ccibase)?
Applying the same logic to Inter-Base does not work, but is definitely required for SpellMaster/Mega3.
KenLowe wrote:
Sun Feb 10, 2019 12:48 am
I've traced the wiring of the cciword carrier board, and note that nOE & nCE are both wire into the PAL. I also note that the CLK input is wired to output pin 19 of the PAL (I've called this CLKO). On this basis, I'm guessing the PAL coding would be something like this:

Code: Select all

	OPALjr Example
	Copyright National Semiconductor Corp, 1993.

	Computer Concepts - 32K PALPROM

CHIP CCPALPROM GAL16V8

A12=2 A7=3 A6=4 A8=5 A9=6 A5=7 A11=8 A10=9 GND=10
nCE=12 nOE=13 A14=17 A13=18 CLKO=19 VCC=20 

@define 0x8040  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6* /A5"
@define 0x8060  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6*  A5"


EQUATIONS

A14 :=  0x8040* /nCE* /nOE

CLKO =  0x8040* /A14
     +  0x8060
     +  nCE
     +  nOE
where CLKO is the PAL output that is wired back to the PAL CLK input, and the /A14 term in the '0x8040* /A14' line is there to check that switching is always done from bank 0. I'll test this out once I build up a prototype carrier board.

Thoughts?
I should note that I'm not 100% convinced on the Inter-Word logic, seems to only work in a Master, whereas in a B you cannot Escape into the editor which doesn't make sense. The Inter-Word logic is the least obvious out of all the PALPROMS. All the others perform a BIT operation on the switching zones but Inter-Word runs code through them, which meant the addresses didn't stand out when tracing the code.

I'd be interested to see how you get on replicating the carrier boards, and glad my findings are useful as considerable time went into it.
- Nigel

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

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Sun Feb 10, 2019 12:58 pm

Pernod wrote:
Sun Feb 10, 2019 3:14 am
I should note that I'm not 100% convinced on the Inter-Word logic, seems to only work in a Master, whereas in a B you cannot Escape into the editor which doesn't make sense. The Inter-Word logic is the least obvious out of all the PALPROMS. All the others perform a BIT operation on the switching zones but Inter-Word runs code through them, which meant the addresses didn't stand out when tracing the code.

I'd be interested to see how you get on replicating the carrier boards, and glad my findings are useful as considerable time went into it.
I might actually pull the PAL from the InterWord carrier board and do some logic testing. It should be easier to do that than trying to check it in line. With what we already know, I'm hoping it should be fairly straight forward to verify exactly what's happening.

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 5:34 pm

It appears that the InterWord PAL has additional switching as follows:

offset 0x3FC0 (switches in bank 0)
offset 0x3FA0 (switches in bank 1)
offset 0x3FE0 (switches in bank 1)

I think this might be why you're seeing issues with the BBC. I saw similar issues when just using the 0x40 and 0x60 switches. I've added in the 0x3FC0 switch into my GAL and I'm getting a bit further. I need to work out how best to add the additional bank 1 switches into my GAL!

Edit: Success, I think!

Code: Select all

Computer Concepts - 32K PALPROM

CHIP CCPALPROM GAL16V8

A12=2 A7=3 A6=4 A8=5 A9=6 A5=7 A11=8 A10=9 GND=10
nCE=12 nOE=13 /Q=15 /A14=17 A13=18 /CLKO=19 VCC=20 

@define 0x8040  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6* /A5"
@define 0x8060  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6*  A5"
@define 0xBFC0  "A13* A12* A11* A10* A9* A8* A7*  A6*  /A5"
@define 0xBFA0  "A13* A12* A11* A10* A9* A8* A7*  /A6*  A5"
@define 0xBFE0  "A13* A12* A11* A10* A9* A8* A7*  A6*  A5"


EQUATIONS

A14  :=  0x8060
      +  0xBFC0
      +  A14* /Q

Q    :=  0x8040
      +  0xBFA0
      +  0xBFE0
     
CLKO  =  /nCE* /nOE
Last edited by KenLowe on Mon Feb 11, 2019 5:45 pm, edited 2 times in total.

User avatar
Pernod
Posts: 1461
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: Click (and other large ROMs)

Post by Pernod » Mon Feb 11, 2019 5:51 pm

KenLowe wrote:
Mon Feb 11, 2019 5:34 pm
It appears that the InterWord PAL has additional switching as follows:

offset 0x3FC0 (switches in bank 0)
offset 0x3FA0 (switches in bank 1)
offset 0x3FE0 (switches in bank 1)

I think this might be why you're seeing issues with the BBC. I saw similar issues when just using the 0x40 and 0x60 switches. I've added in the 0x3FC0 switch into my GAL and I'm getting a bit further. I need to work out how best to add the additional bank 1 switches into my GAL!
Thanks, I've amended my code to:

Code: Select all

/* switching zones for Inter-Word */
switch (offset & 0x3fe0)
{
case 0x0060:
case 0x3fc0: m_bank = 0; break;
case 0x0040:
case 0x3fa0:
case 0x3fe0: m_bank = 1; break;
}
and I can now switch into the editor when running in a B, maybe it takes a different path in the Master? I'd not previously considered there may be multiple zones to select each bank.

I can't imagine there'd be five switching zones, more likely 4. As the other Computer Concepts PAL all switch in page &3F I'm tempted to see if removing my original switches and adding 0x3f80 to bank 0 will work.
- Nigel

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

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 5:56 pm

Pernod wrote:
Mon Feb 11, 2019 5:51 pm
Thanks, I've amended my code to:

Code: Select all

/* switching zones for Inter-Word */
switch (offset & 0x3fe0)
{
case 0x0060:
case 0x3fc0: m_bank = 0; break;
case 0x0040:
case 0x3fa0:
case 0x3fe0: m_bank = 1; break;
}
and I can now switch into the editor when running in a B, maybe it takes a different path in the Master? I'd not previously considered there may be multiple zones to select each bank.

I can't imagine there'd be five switching zones, more likely 4. As the other Computer Concepts PAL all switch in page &3F I'm tempted to see if removing my original switches and adding 0x3f80 to bank 0 will work.
It may well work. However, the 0x40 & 0x60 zones definitely exist in the PAL. I'll also try removing them from the PAL, and see what happens.

Edit: Definitely didn't like the 0x40 & 0x60 switches removed.
Last edited by KenLowe on Mon Feb 11, 2019 6:08 pm, edited 1 time in total.

User avatar
Pernod
Posts: 1461
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: Click (and other large ROMs)

Post by Pernod » Mon Feb 11, 2019 6:08 pm

KenLowe wrote:
Mon Feb 11, 2019 5:56 pm
It may well work. However, the 0x40 & 0x60 zones definitely exist in the PAL. I'll also try removing them from the PAL, and see what happens.
Seems to work with only:

Code: Select all

/* switching zones for Inter-Word */
switch (offset & 0x3fe0)
{
case 0x0060:
case 0x3fc0: m_bank = 0; break;
case 0x0040:
case 0x3fa0: m_bank = 1; break;
}
- Nigel

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

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 6:46 pm

Yes. that also seems to work for me:

Code: Select all

Computer Concepts - 32K PALPROM

CHIP CCPALPROM GAL16V8

A12=2 A7=3 A6=4 A8=5 A9=6 A5=7 A11=8 A10=9 GND=10
nCE=12 nOE=13 /Q=15 /A14=17 A13=18 /CLKO=19 VCC=20 

@define 0x8040  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6* /A5"
@define 0x8060  "/A13* /A12* /A11* /A10* /A9* /A8* /A7*  A6*  A5"
@define 0xBFC0  "A13* A12* A11* A10* A9* A8* A7*  A6*  /A5"
@define 0xBFA0  "A13* A12* A11* A10* A9* A8* A7*  /A6*  A5"


EQUATIONS

A14  :=  0x8060
      +  0xBFC0
      +  A14* /Q

Q    :=  0x8040
      +  0xBFA0
     
CLKO  =  /nCE* /nOE
For those who are interested, here's my little test rig with the PAL from my InterWord carrier board:
20190211_183555.jpg
Annoyingly, when I removed the PAL from the carrier board, I discovered that the thru holes are not the standard size, and I couldn't install a socket, so instead I installed two rows of SIL sockets. The newly programmed GAL is sitting in those sockets. I then had to add extension pins onto the EPROM so the EPROM wouldn't clash with GAL. A carrier on the carrier!
20190211_183541.jpg

User avatar
Pernod
Posts: 1461
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: Click (and other large ROMs)

Post by Pernod » Mon Feb 11, 2019 7:43 pm

So does the original PAL switch on 0x3fe0, just wondering where this came from?

If you decide to replicate any of the other PALs, you can be confident that my switching zones are correct. Just note that the Watford ROMs only switch the top 8K. You may have a customer for TED if pixelblip likes it.
- Nigel

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

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 8:02 pm

Pernod wrote:
Mon Feb 11, 2019 7:43 pm
So does the original PAL switch on 0x3fe0, just wondering where this came from?
Yes. The PAL I extracted from the InterWord carrier board has a switch at 0x3fe0 (in addition to the other's we've noted).
Pernod wrote:
Mon Feb 11, 2019 7:43 pm
If you decide to replicate any of the other PALs, you can be confident that my switching zones are correct. Just note that the Watford ROMs only switch the top 8K. You may have a customer for TED if pixelblip likes it.
My main ambition was to replicate the SpellMaster ROM, but I could have a go at some of the Watford ROMs too.

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 10:06 pm

Pernod wrote:
Mon Dec 31, 2018 5:08 pm
I have your JED file for Inter-Word but did you actually work out what it was doing? Still struggling with the Computer Concepts boards, but since I have original Inter-Word and Mega3 am thinking I could write something to read from each location and check a fixed byte to report when it changes.
I've been looking all over for a copy of the Mega 3 ROM. Any chance you could share this, please? I'd like to test this on my SpellMaster carrier board.

User avatar
Pernod
Posts: 1461
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: MAME: Click (and other large ROMs)

Post by Pernod » Mon Feb 11, 2019 11:08 pm

KenLowe wrote:
Mon Feb 11, 2019 10:06 pm
I've been looking all over for a copy of the Mega 3 ROM. Any chance you could share this, please? I'd like to test this on my SpellMaster carrier board.
It's at viewtopic.php?f=32&t=16179
- Nigel

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

User avatar
KenLowe
Posts: 530
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: MAME: Click (and other large ROMs)

Post by KenLowe » Mon Feb 11, 2019 11:18 pm

Duh! Don't know how I missed that one!

That's working perfectly in my SpellMaster carrier (with a SST39SF020A flash).
Last edited by KenLowe on Mon Feb 11, 2019 11:35 pm, edited 1 time in total.

Post Reply