It is currently Thu Dec 14, 2017 8:48 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Sep 21, 2009 11:55 am 
Offline

Joined: Mon Mar 23, 2009 12:11 pm
Posts: 140
Location: Katoomba, Australia
Howdy

Is there any way to have an RR cart image that occupies the range from $8000..$BFFF (i.e. where a normal 16KB cart image would go?).

I have tried using up a 16KB image and then during cart initialisation, setting $de00 to $01 (i.e. set GAME and EXROM both to 0). But then I ended up with $A000..$BFFF being a copy of $8000..$9FFF. (i.e. i get the same 8KB image in to locations, not a 16KB image).


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 21, 2009 4:31 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 1:52 am
Posts: 203
Location: Denmark
Well.. not that simple..

The RR only allows 8K ROM banked in at a time. In 16K (GAME+EXROM=LOW) mode, the ROM at $8000 is simply mirrored at $A000. RR does however allow you to map in both RR RAM and ROM at the same time, thus giving you 16K.

If you e.g. have 2*8K and want the lower 8K (bank0) at $8000, and the upper 8K (bank1) at $A000, you could copy the lower 8K ROM of Bank0 to the lower 8K RR RAM at bank1 and then switch to RR Bank1 upon completion. This would give you the desired result.
To write to the RR RAM however, you need to switch to Ultimax mode and you would have to switch between banks 0 and 1 all the time, so your "copy code" would need to be located somewhere <$1000 in C64 RAM or you could use the AllowBank Bit and stuff it in e.g. $deXX.
An example:

Code:
$0800:
   lda #$ff
   sta $fc
   lda #$9f
   sta $fe
   lda #0
   sta $fb
   sta $fd
   tay
   ldx #$1f
$0812:
   lda #$23   ;RR-RAM at $8000, Bank0, Ultimax
   sta $de00
   lda ($fb),y   ;Read from RR-Bank0 ROM
   sta $02
   lda #$2b   ;RR-RAM at $8000, Bank1, Ultimax
   sta $de00
   lda $02
   sta ($fd),y   ;Write to RR-Bank1 RAM
   iny
   bne :-
   dec $fc
   dec $fe
   dex
   bpl :-
   lda #$29   ;RR-RAM at $8000, Bank1, + RR-ROM Bank1 at $A000
   sta $de00

   jmp FANCY_CART_CODE


There are of course a million variations to complete the same task, and probably a lot smarter ones than this, but if you get the idea, I think you're good to go ,-)


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 22, 2009 3:58 am 
Offline

Joined: Mon Mar 23, 2009 12:11 pm
Posts: 140
Location: Katoomba, Australia
Thanks for the info Devia.

Rather than roll my own, I'll stick to Doc's implementation : CRT8040

I was actually using CRT8040 originally and got 16KB carts running in Vice's emulation of a Retro Replay, but very shortly after trying it in my MMC Replay, my MMC Replay reported (by blinking the red led) it's BIOS was toast. Probably just coincidence, but it made me nervous anyway so I thought I'd see if there was a different way. Seems there's not. (and in fact the relevant info is there in Doc's page "Unfortunately the rr can just map in $2000 bytes of rom at once" but I'd obviously missed it)

Cheers anyway.

Jonno


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 22, 2009 9:09 am 
Offline
User avatar

Joined: Thu Jan 12, 2006 1:52 am
Posts: 203
Location: Denmark
I also forgot about the "timing issues" of RR in the above code... to make it more resilient one would need to read back the banking bits to confirm bank switches:

After the first STA $de00 add:
Code:
lda $de00
and #$80
bne *-5


and after the second STA $de00 add:
Code:
lda $de00
and #$80
beq *-5


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 25, 2009 2:46 pm 
Offline

Joined: Thu Jan 12, 2006 11:47 am
Posts: 111
Quote:
but very shortly after trying it in my MMC Replay,


if you are doing it on mmcr - this CAN bank in 16k at once, check the docs.

_________________
http://hitmen.c02.at/html/tools_rr.html


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group