64 Mode and BankSwitch (or simulating it).

Started by Stephane Richard, October 11, 2006, 12:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stephane Richard

Basically, I don' remember where, but I do remember reading once (in a magazine probably) that though there weren't any "banks" per se in 64 mode.  that it was possible to simulate that somehow, or maybe even, with ASM, gain access to the 128's second bank.  

Back then I doubted it because I didn't know better and though there was a seperate CPU for 64 and 128 mode.  But now I tend to wonder because the 8502 is used in both modes.

So to those who happen to know, is this possible?  To gain access to some extra ram (even while sacrificing a few things in the process?

Thank you
When God created light, so too was born, the first Shadow!

MystikShadows

xlar54

Im not certain, but it has something to do with an IO address that is normally unused on the 64, but the 128 uses that specific address for something.  Ive seen programs that test that particular memory location to determine if its running on a 128 (in 64 mode) or an original 64.  I may have my wires crossed for what you are meaning though.

I also *think* Ive seen a program which will let the 64 mode-ed 128 access VDC RAM.  Maybe the ReRUN or Gazette disks have something like this. Top of my head Im not sure, but i think you are correct.  Back in the day, getting 64mode to do 128 things was pretty cool...like using the numeric keypad, etc.

Edwing

As far as I know, it's not possible to access both banks in C64 mode since that would require accessing the MMU which is invisible then. However, I have seen a program (and could try to look it up if that meant doing you a favour) that starts C64 mode in Bank 1 instead of 0, which means that you could have a prg in C128 mode, go to C64 mode for e.g. playing a game, and after a reset you still have the C128 prg in memory. (That is, you still would have to do an OLD if it's a BASIC prg for which there's some POKE A,B:POKE C,D:SYS X and you're done. BTW, I never realized how they could have left out OLD of Basic 7.0 - such an easy, handy, basic ;öP thing to implement.)

hydrophilic

Yeah, the only extra memory you can get is from the VDC.

I used to type in a short program (like Edwing was saying) all the time for cracking C=64 games because I didn't have a freezer cartridge.  Enter with built-in ML Monitor:

.10400 SEI  :just to be safe
 LDA #$40
 STA $FF00 :bank 15 with RAM Bank 1
 LDX #1
 STX $D50A :stack use Bank 1
 STX $D509 :stack use page 1
 STX $D508 :zp use Bank 1
 DEX
 STX $D507 :zp use page 0
 STA $D506 :VIC/REU use RAM Bank 1, no common RAM
 JMP $FF4D :KERNAL go 64

Then execute with G 10400

I also had a variation on this that did not change stack/zp pages and left common RAM intact... it's not as useful (all the important stuff below $400 would get wiped during reset) but is quicker to type:

.10400 SEI :play it safe
LDA #$40
STA $FF00 :bank 15 with RAM Bank 1
ORA $D506 :VIC/REU use RAM Bank 1
STA $D506 :keep 1ki Common RAM at bottom
JMP $FF4D :KERNAL go 64