Posted By
   Haplo on 2022-04-03 03:17:05
  |   Help with bank switching
  I've been working on the extended version of my game Tenebra (https://h4plo.itch.io/tenebra) and with the new levels I need more memory. The game is written in assembly by the way. I'd like to use one of the two areas below:
  $8000 ROM BANK LOW (BASIC) $C000 BASIC expansions
  What is the correct way to switch them out and see them as RAM? All the answers I have found on the net have been more confusing than helpful. Thanks.
  P.S. Is the whole region of $4000-$7fff available to assembly programs without any bank switching? I have noticed I can use from $4000 to around $6800, but after that my stuff gets corrupted.
  |   
 | 
Posted By
   Haplo on 2022-04-03 03:24:13
  |   Re: Help with bank switching
  Please ignore the "P.S." bit, it was my mistake. I can see that I can use the whole $4000-$7fff without any issues.
  Still any help with switching out the ROM at $8000 will be appreciated.
  |   
 | 
Posted By
   gerliczer on 2022-04-03 03:28:23
  |   Re: Help with bank switching
 
 SEI STA $FF3F ; page out ROM LDA #ISR.low STA $FFFE LDA #ISR.high STA $FFFF CLI 
  You cannot page out part of the ROM area but only the whole memory range.
  |   
 | 
Posted By
   Haplo on 2022-04-03 03:33:55
  |   Re: Help with bank switching
  Thanks.
  I just want to use $8000-$BFFF as RAM. What is the value you are putting in $FF3F? I think the LDA is missing from your snippet. Also my code is not interrupt driven (SEI at the beginning and no CLI), so thankfully I don't need to worry about setting up the vectors.
  |   
 | 
Posted By
   Haplo on 2022-04-03 03:42:23
  |   Re: Help with bank switching
  I just found this:
  $FF3E: This so called "shadow register" controls RAM/ROM paging with register $FF3F. Writing an arbitrary value to $FF3E will page in the currently configured ROMs to the upper memory area ($8000..$FFFF).
 
  $FF3F: This so called "shadow register" controls RAM/ROM paging with register $FF3E. Writing an arbitrary value to $FF3F will page in the RAM to the upper memory area ($8000..$FFFF).
 
  So the actual value written is not important. I'll give it a go now.
  |   
 | 
Posted By
   Haplo on 2022-04-03 03:49:19
  |   Re: Help with bank switching
  It works, thanks!
  |   
 | 
Posted By
   gerliczer on 2022-04-03 03:51:28
  |   Re: Help with bank switching
  You should study SVS' excellent Ultimate Map and the source codes available on this site to learn more about the 264 series machines.
  |   
 | 
Posted By
   Haplo on 2022-04-03 18:08:53
  |   Re: Help with bank switching
  Seems like a very good source, thanks.
  |   
 |