Switchless ROMs

classic Classic list List threaded Threaded
63 messages Options
1234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Switchless ROMs

Jim Brain

Though it would seem otherwise, I'm not a fan of drilling holes in cases to install KERNAL switches.  On the other hand, I'm not a huge fan of putting lots of test clip wires inside my 64 either.

It seems like those are the only two options.  I looked at the switchless ROM circuits (basically, a '74 hooked up to RESET as CLK and RESTORE as D, and I thought a small uC or GAL might also work. Still, it requires 2 wires.  But, then I wondered if one could have the 64 or 128 act as the uC, and make the ROM switch.

On boot, have the ROM set to bank 2 (for example).  a special KERNAL would jump to $f000, checking for a key.  If found, it would jump to one routine in the ROM ($f100), which would then start the machine.  If not found, jump to another routine ($f200), which would also start the machine.  A circuit on the PCB would detect a fetch to address $fffe, seting bank=2.  It would then watch for bit 8 or 9 in the address.  If bit 8 active, then set bank=1.  If bit 9, set bank=0.

Does the idea have merit? Or, am I missing something?

If the idea hold water, it offer a lot of other possibilities (multiple kernals, putting some diagnostics in the "base kernal", offering a set of "IO" pins folks could use to enable/disable items, etc.).

Jim

--
Jim Brain
[hidden email] 
www.jbrain.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

MindFlareRetro
Hi Jim,

Very interesting, indeed. Have you seen bwack's (his YouTube handle) project, "C64 Switchless Quad Kernal Switch series", https://goo.gl/oRSC2n?  Great minds, I guess. I'm not sure if he's on this mailing list. I'll give him a heads-ups ad see if he's interested in participating here.

Regards,
Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Per Olofsson-2
In reply to this post by Jim Brain
To answer your question first: yes, it sounds like a good solution to the problem, I'd be interested to see a prototype.

Henning Bekel has a different take on it, I have one of these waiting for me when I get home:


--
  Per Olofsson


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Jim Brain
On 12/21/2016 9:39 PM, Per Olofsson wrote:
To answer your question first: yes, it sounds like a good solution to the problem, I'd be interested to see a prototype.
If I can get my desk cleared of previous work, I'll take a go at it.

Henning Bekel has a different take on it, I have one of these waiting for me when I get home:


--
  Per Olofsson



I think I read about that.  Good for him.


-- 
Jim Brain
[hidden email] 
www.jbrain.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Jim Brain
In reply to this post by MindFlareRetro
On 12/21/2016 8:53 PM, MindFlareRetro wrote:
> Hi Jim,
>
> Very interesting, indeed. Have you seen bwack's (his YouTube handle)
> project, "C64 Switchless Quad Kernal Switch series", https://goo.gl/oRSC2n?
> Great minds, I guess. I'm not sure if he's on this mailing list. I'll give
> him a heads-ups ad see if he's interested in participating here.
His solution is a bit different.  He uses the RESET/RESTORE wire option,
but replaced the Flip Flop with a uC.

Jim


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Pasi Lassila
On 22 December 2016 at 08:49, Jim Brain <[hidden email]> wrote:
On 12/21/2016 8:53 PM, MindFlareRetro wrote:
Hi Jim,

Very interesting, indeed. Have you seen bwack's (his YouTube handle)
project, "C64 Switchless Quad Kernal Switch series", https://goo.gl/oRSC2n?
Great minds, I guess. I'm not sure if he's on this mailing list. I'll give
him a heads-ups ad see if he's interested in participating here.
His solution is a bit different.  He uses the RESET/RESTORE wire option, but replaced the Flip Flop with a uC.

Jim


Interesting idea with the bank switching custom Kernal. The HW would only need one logic IC and a ROM chip.

-Pasi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Francesco Messineo
In reply to this post by Jim Brain
On Thu, Dec 22, 2016 at 3:54 AM, Jim Brain <[hidden email]> wrote:

> Though it would seem otherwise, I'm not a fan of drilling holes in cases to
> install KERNAL switches.  On the other hand, I'm not a huge fan of putting
> lots of test clip wires inside my 64 either.
>
> It seems like those are the only two options.  I looked at the switchless
> ROM circuits (basically, a '74 hooked up to RESET as CLK and RESTORE as D,
> and I thought a small uC or GAL might also work. Still, it requires 2 wires.
> But, then I wondered if one could have the 64 or 128 act as the uC, and make
> the ROM switch.
>
> On boot, have the ROM set to bank 2 (for example).  a special KERNAL would
> jump to $f000, checking for a key.  If found, it would jump to one routine
> in the ROM ($f100), which would then start the machine.  If not found, jump
> to another routine ($f200), which would also start the machine.  A circuit
> on the PCB would detect a fetch to address $fffe, seting bank=2.  It would
> then watch for bit 8 or 9 in the address.  If bit 8 active, then set bank=1.
> If bit 9, set bank=0.
>
> Does the idea have merit? Or, am I missing something?

This means that a random fetch at $FFFE by a program would bring you
back to the switching ROM mechanism... It would only happen on purpose
I think, but still would change the behaviour of your machine with
respect to a "stock" or switch(less) one.
How do you know the fetch to $FFFE is because of /RST or just because
of LDA $FFFE? Think of a few PEEKs in basic: "hey, let's see what's
the RST vector of this 6502 machine".
Also, the bank switching circuit would probably need phi0 signal to
switch the bank at the right time (but I should really first make a
little tentative schematic, then run some simulation to be sure).
Or did I miss something in this mechanism?

F

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Michał Pleban
In reply to this post by Jim Brain
Hello!

Jim Brain wrote:

> It seems like those are the only two options.  I looked at the
> switchless ROM circuits (basically, a '74 hooked up to RESET as CLK and
> RESTORE as D, and I thought a small uC or GAL might also work. Still, it
> requires 2 wires.  But, then I wondered if one could have the 64 or 128
> act as the uC, and make the ROM switch.

I designed something similar few years ago, though it was more
complicated beacuse it was meant to be reprogrammable from the C64 side.
But some ideas can be reused in a simple project like this.

Basically what I did was to remove the SID (as I recall, it is always
socketed in a C64), and put it back on a small PCB that goes to the SID
socket, but also steals the SID "chip enable", PHI0, R/W and RESET
signals and routes them to the second PCB that is inserted into the
KERNAL socket.

Using these signals, you can create a simple latch which resides
somewhere in the SID address space and is used to select the appropriate
KERNAL. Upon reset, the latch would be reset to 0 to select the "KERNAL
selection KERNAL", which would write the desired KERNAL number to the
latch as well as a special bit to disable the latch until next RESET.

This is exactly the same thing that our MultiMAX cartridge does - the
latch is set to bank 0 upon reset, then the software in bank 0 writes
the bank number to the latch, setting also bit 7 which means "disable
the latch". You can do that with a 74LS273 plus some simple glue logic
- you should have MultiMAX the schematic somewhere as you drew it
yourself ;-)

Regards,
Michau.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Gerrit Heitsch
On 12/22/2016 11:16 AM, Michał Pleban wrote:
>
> Basically what I did was to remove the SID (as I recall, it is always
> socketed in a C64)

Unfortunatly no... There are a number of 250407 boards where SID is
soldered. I have one.

The only IC in a C64 that is always socketed is VIC.

  Gerrit



       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

hegedusis
In reply to this post by Michał Pleban
Hi,

That switching mechanism is a brilliant idea! In my FPGATED based Plus4
implementation I was just thinking on how to do the ROM switching. I am
using the Papilio Pro board's SDRAM for the ROM images and as it has
relatively large space I designed it to be able to keep 16 variants of each
ROM (Kernal, Basic, Function, Cartridge1 and Cartridge2). My sdram
controller has an address extension for it and by setting the correct
variant version for each we can change ROMs (ROMs are uploaded to SDRAM from
the FPGA's flash chip during boot). I have planned to use a register for it
in the IO space and startup the computer with the stock ROMs. A Boot kernal
is a good idea, the FPGA can check a pressed key during power on and set the
ROM choosing Kernal then reset!

Regards
Istvan


-----Original Message-----
From: Michał Pleban
Sent: Thursday, December 22, 2016 11:16 AM
To: [hidden email]
Subject: Re: Switchless ROMs

Hello!

Jim Brain wrote:

> It seems like those are the only two options.  I looked at the
> switchless ROM circuits (basically, a '74 hooked up to RESET as CLK and
> RESTORE as D, and I thought a small uC or GAL might also work. Still, it
> requires 2 wires.  But, then I wondered if one could have the 64 or 128
> act as the uC, and make the ROM switch.

I designed something similar few years ago, though it was more
complicated beacuse it was meant to be reprogrammable from the C64 side.
But some ideas can be reused in a simple project like this.

Basically what I did was to remove the SID (as I recall, it is always
socketed in a C64), and put it back on a small PCB that goes to the SID
socket, but also steals the SID "chip enable", PHI0, R/W and RESET
signals and routes them to the second PCB that is inserted into the
KERNAL socket.

Using these signals, you can create a simple latch which resides
somewhere in the SID address space and is used to select the appropriate
KERNAL. Upon reset, the latch would be reset to 0 to select the "KERNAL
selection KERNAL", which would write the desired KERNAL number to the
latch as well as a special bit to disable the latch until next RESET.

This is exactly the same thing that our MultiMAX cartridge does - the
latch is set to bank 0 upon reset, then the software in bank 0 writes
the bank number to the latch, setting also bit 7 which means "disable
the latch". You can do that with a 74LS273 plus some simple glue logic
- you should have MultiMAX the schematic somewhere as you drew it
yourself ;-)

Regards,
Michau.

       Message was sent through the cbm-hackers mailing list


       Message was sent through the cbm-hackers mailing list
smf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

smf
In reply to this post by Michał Pleban
On 22/12/2016 10:16, Michał Pleban wrote:
> Using these signals, you can create a simple latch which resides
> somewhere in the SID address space and is used to select the appropriate
> KERNAL. Upon reset, the latch would be reset to 0 to select the "KERNAL
> selection KERNAL", which would write the desired KERNAL number to the
> latch as well as a special bit to disable the latch until next RESET.

Another method you can use is magic read sequences. i.e. come up with a
sequence of rom reads that wouldn't happen in normal circumstances, long
enough to make accidental activation so unlikely that it's practically
impossible for there to be a collision. Then have the next read after
this sequence use the address bits as data lines for writing the new bank.

I've also seen this used in a battery backed real time clock that can be
placed in a ROM socket, writing to the date/time registers was done
using reads.


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

André Fachat


Am 24. Dezember 2016 1:19:09 AM schrieb smf <[hidden email]>:

> I've also seen this used in a battery backed real time clock that can be
> placed in a ROM socket, writing to the date/time registers was done
> using reads.

Oh the old days...  My Atari ST IEEE488 interface used the ROM port in
exactly this way. Data was written using the lower 8 address lines of a
read in a specific 256 byte address range...

André




       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Michał Pleban
In reply to this post by smf
Hello!

smf wrote:

> Another method you can use is magic read sequences. i.e. come up with a
> sequence of rom reads that wouldn't happen in normal circumstances, long
> enough to make accidental activation so unlikely that it's practically
> impossible for there to be a collision. Then have the next read after
> this sequence use the address bits as data lines for writing the new bank.

In this scenario, you don't have the RESET line, so once you select a
KERNAL, you are stuck with it until the computer is switched off. Unless
you can somehow detect the actual reset sequence of the 6510 just by
looking at KERNAL accesses, but I am not sure if it is ever possible.

If you accept this limitation, then you actually don't need any magic
sequence at all. You just boot into the menu, the user selects the
KERNAL from the menu, then a single read from e.g. $E0xx selects the
KERNAL and disables further selections.

Regards,
Michau.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Michał Pleban
In reply to this post by hegedusis
Hello!

Hegedűs István wrote:

> (ROMs are uploaded to SDRAM from the FPGA's flash chip during boot).

I understand they are uploaded from some Flash chip that is on the
development board, not from the FPGA itself? Because otherwise, why the
FPGA itself could not act as a ROM chip?

Regards,
Michau.

       Message was sent through the cbm-hackers mailing list
smf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

smf
In reply to this post by Michał Pleban
On 26/12/2016 22:51, Michał Pleban wrote:
> If you accept this limitation, then you actually don't need any magic
> sequence at all. You just boot into the menu, the user selects the
> KERNAL from the menu, then a single read from e.g. $E0xx selects the
> KERNAL and disables further selections.

You do need to guarantee that your bank switch register powers up in the
correct state. Which might be a little tricky with only the standard rom
signals.

But yeah if you're only allowing a switch in your special kernel then
you don't need any magic sequences, but I quite like the idea of being
able to switch. It would for example allow you to create a kernel that
has both tape and jiffydos routines in, with automatic switching between
the two 8k images.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Michał Pleban
Hello!

smf wrote:

> You do need to guarantee that your bank switch register powers up in the
> correct state. Which might be a little tricky with only the standard rom
> signals.

A small RC circuit will do the trick of supplying a reset signal upon
power up. Or, if you use a more complex circuit like CPLD, they always
power up in a known state. But...

> But yeah if you're only allowing a switch in your special kernel then
> you don't need any magic sequences, but I quite like the idea of being
> able to switch. It would for example allow you to create a kernel that
> has both tape and jiffydos routines in, with automatic switching between
> the two 8k images.

... but what I said is that you cannot switch KERNALs if you do not tap
into the RESET line. You power up into the switching KERNAL, you switch
once, and that's it until you power off. Magic sequences will not help here.

Regards,
Michau.

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Jim Brain
On 12/26/2016 5:23 PM, Michał Pleban wrote:
> Hello!
>
>
> ... but what I said is that you cannot switch KERNALs if you do not tap
> into the RESET line. You power up into the switching KERNAL, you switch
> once, and that's it until you power off. Magic sequences will not help here.
I don't understand why that would be.

If you power up into the switching KERNAL, enter a set of magic values
to select a new KERNAL, you can always enter the magic sequence again to
select a new KERNAL.

JIm

>
> Regards,
> Michau.
>
>         Message was sent through the cbm-hackers mailing list


--
Jim Brain
[hidden email]
www.jbrain.com


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Michał Pleban
Hello!

Jim Brain wrote:

> I don't understand why that would be.
> If you power up into the switching KERNAL, enter a set of magic values
> to select a new KERNAL, you can always enter the magic sequence again to
> select a new KERNAL.

Technically yes, but only from some user software (perhaps loaded as a
PRG) since you cannot re-boot into the switching KERNAL.

Regards,
Michau.




       Message was sent through the cbm-hackers mailing list
smf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

smf
On 26/12/2016 23:39, Michał Pleban wrote:
> Technically yes, but only from some user software (perhaps loaded as a
> PRG) since you cannot re-boot into the switching KERNAL.

If you use a magic sequence then there is no need for a special
switching kernel. You can use one if you wish, but you could boot
straight into your preferred one. Which could be a modified kernel that
switches using a command, or automatically when certain features are
used. It's way more flexible, but of course needs more complex switching.


       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switchless ROMs

Jim Brain
In reply to this post by Michał Pleban
On 12/26/2016 5:39 PM, Michał Pleban wrote:
Technically yes, but only from some user software (perhaps loaded as a
PRG) since you cannot re-boot into the switching KERNAL.

Regards,
Michau.




       Message was sent through the cbm-hackers mailing list

I still think you can trigger on the reset vector pull to get back to the original ROM. 


I guess I'll need to try to prototype something to test the theory.


1234
Loading...