Re: Another file question (PET)

From: Marko Mäkelä (marko.makela_at_hut.fi)
Date: 2002-11-20 08:14:16

On Wed, Nov 20, 2002 at 12:31:32AM +0100, Andre Fachat wrote:
> yes, peeking certain ROM locations was a well known technique to
> detect the ROM versions, and one I think was the IRQ address at $fffe/f
> or even the Reset vector (don't remember though whether one byte suffices).

If I remember my test results from last night correctly, it doesn't.  But
I think I found a fairly simple technique for restoring the IRQ redirection
vector, which can be at $90 or $219, depending on ROM version.  Search for
the JSR opcode ($20) in the ROM code, starting at the beginning of the reset
routine.  It appears that the first JSR initialises the VDC and sets the IRQ
vector.  So, just copy the JSR routine address to your code and invoke the
routine.  I didn't test this trick yet.

It seems that my cassette fastloader needs four different versions for the
PET series, as there appear to be two distinct cassette buffer locations
(for port #1 and port #2) and two distinct IRQ redirection vector addresses
(for pre-4.0 and 4.0).

Another thing that might work for detecting the ROM version would be to call
the machine language with the SYS statement.  Then, in the code, do
PLA:TAX:PLA to find the address of the SYS routine.  I think that doing the
equivalent of PEEK and POKE in machine language saves lots of memory space.

	Marko

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.4.