Re: Wireless - switchless kernal mod

From: Mia Magnusson <mia_at_plea.se>
Date: Fri, 30 Mar 2018 07:47:13 +0200
Message-ID: <20180330074713.000019b4@plea.se>
Den Thu, 29 Mar 2018 23:20:19 +0300 skrev Nejat Dilek
<imruon@gmail.com>:
> On Thu, Mar 29, 2018 at 7:12 PM, Mia Magnusson <mia@plea.se> wrote:
> > With a circuit that replaces a combined kernal+basic rom (later C64,
> > and afaik all C128 in C64 mode) you could perhaps use the
> > "MICROSOFT" obfuscated string in basic rom near the arithmetic
> > table?
> 
> You mean accessing that data in a way that creates a pattern for the
> attiny to understand? Sorry I didn't understand this.

My idea is that you recognize if the 6510 is running code from the ROM
by detecting that it is accessing the rom for two cycles directly after
each other. When this is detected, you check which adress the CPU is
running from. If it is in the area where you find tables for
the SIN/COS/ATN functions (and the obfuscated string MICROSOFT!) you
can be sure that this is no normal code path of either the standard
roms or any existing C64 software. In that case you switch in a special
rom which has a few NOPs in this area, and then has code that
reinitializes all C64 hardware to a known state (i.e. like the startup
procedure in a standard KERNAL), displays a ROM selection menu, and
when the user selects a ROM the code reads from one in a group of
adresses that tells your hardware which ROM to select. Then the code
jumps to $FFFB which your hardware detects by feeding a JMP instruction
and after that your hardware switches to normal mode, i.e. letting the
6510 see the selected ROM and hides all special selection code.

It would probably require some programmable logic instead of, or in
addition to, the microcontroller.

The nice thing about this is that you could have the menu system buildt
in, just starting it with a SYS statement in basic no matter which ROM
is already selected. (The only special case exception is if you also
allow switching different BASIC versions and some version actually has
real runnable code in the area where the standard BASIC has data).

Btw I haven't checked how the tables actually looks like in a real C64
BASIC rom, but in the source code from Microsoft it seems like there
are nothing that could be interpreted like some kind of jump ($*0
opcodes) or freeze the CPU (a bunch of the $*2 opcodes), so there is a
high chance of this to actually work.

In theory you could do the same thing with tables in KERNAL but that
won't be reliable if you want to have different KERNALs where some
might have code where another have data.

Btw if you do this, you could also use it to extend the maximum amount
of ROM, i.e. jumping to certain places trigger switching between
different ROM images. This is btw used in disk/microdrive interfaces for
Sinclair ZX Spectrum. They detect a jump to the "syntax error" handler
and switches in an expansion rom instead of the standard rom, and then
the standard rom i switched back by detecting code running at some
other addresses. So my idea isn't exactly new, Sinclair thought about
it back in the 80's :)

-- 
(\_/) Copy the bunny to your mails to help
(O.o) him achieve world domination.
(> <) Come join the dark side.
/_|_\ We have cookies.
Received on 2018-03-30 08:00:02

Archive generated by hypermail 2.2.0.