Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!topaz!uwvax!puff!lishka From: lishka@puff.UUCP (Christopher Lishka) Newsgroups: net.micro.cbm Subject: Re: Turning BASIC ROM into RAM... Message-ID: <904@puff.UUCP> Date: Tue, 6-May-86 13:23:32 EDT Article-I.D.: puff.904 Posted: Tue May 6 13:23:32 1986 Date-Received: Thu, 8-May-86 08:03:18 EDT References: <2167@caip.RUTGERS.EDU> Organization: U of Wisconsin CS Dept Lines: 62 Summary: yes, it is, but you must copy the rom to ram In article <2167@caip.RUTGERS.EDU>, KOCYAN@BLUE.RUTGERS.EDU writes: > From: KOCYAN@BLUE.RUTGERS.EDU > > On the Commodore 64, is it possible to turn the BASIC ROM between addresses > $A000 and $BFFF into RAM, and yet keep the BASIC routines there so that they > can be modified? > I've tried changing the data-direction-register (location $0000), but that > didn't seem to help at all. > Any advise would be greatly appreciated. Thanks in advance. Yes, it is possible to do this. However, the Ram that lies beneath the BASIC Rom is empty...i.e. if you flip out BASIC ROM you have nothing below it to tell the machine what to do! The solution is pretty simple...before you flip out the BASIC Rom, make sure you copy the Rom to Ram. This will work by just peeking and poking because of a funny quirk (which was intentional) in the c-64: when there is Rom on top of Ram, any peek to a location in tha area yeilds what is in Rom; however, if you poke to the same location the value will be stored in the Ram underneath the Rom, even though you can't 'see' it while the Rom is still there. The practical value of this nifty trick is that you can transfer any Rom to the Ram beneath it (and there is Ram beneath ALL Rom on the c-64) by just: a) making sure that Rom is flipped in b) performing the following operation in BASIC (although this will work in PASCAL and C and ML): poke x, peek(x): rem x is memory location After you have copied the range you want (with a loop), just flip out the Rom and...VOILA! You now have what was in Rom encoded in Ram, just waiting to be changed! (Isn't this fun?) Anyways, this can be done with the KERNAL and character sets too. To flip in/out the Rom you need to poke to location 1 in memory...consult your handy reference manual for more details (I don't have mine here with me). If you have any other problems, just email to me (using reply or the addresses below...hopefully they'll work). lishka@rsch.wisc.edu or talcott!uwvax!puff.wisc.edu!lishka@rsch.wisc.edu or uwvax!puff.wisc.edu!lishka@rsch.wisc.edu p.s. my apologies if those pathes don't work...I'm still trying to desperately make sense out of this mailing sytem (and I don't have any documentation) -- Chri Lishka U.W. Madison -my views are not my own; rather, they are those of my pets.