Skip to content

title: "SetMemoryConfig" description: TRSE built-in method (from IDE help)


SetMemoryConfig

Systems: C64, MEGA65, VIC20, PET, NES
Parameters: b,b,b


C64

On the C64, this method configures the current memory setup.
  • Parameter 1: Enables/disables IO
  • Parameter 2: Enables/disables Kernal
  • Parameter 3: Enables/disables BASIC
For instance, if you wish to disable Kernal and basic but keep IO, use SetMemoryConfig(1,0,0); Valid combinations are: SetMemoryConfig(1,1,1); // IO area visible at $D000-$DFFF, BASIC ROM visible at $A000-$BFFF and KERNAL ROM visible at $E000-$FFFF. This is the default memory configuration on the C64. SetMemoryConfig(1,1,0); // IO area visible at $D000-$DFFF, RAM visible at $A000-$BFFF (NO BASIC) and KERNAL ROM visible at $E000-$FFFF SetMemoryConfig(1,0,0); // IO area visible at $D000-$DFFF, RAM visible at $A000-$BFFF (NO BASIC) and RAM visible at $E000-$FFFF (NO KERNAL). This is the typical memory configuration for demo/game development. SetMemoryConfig(0,0,0); // RAM visible in all three areas: $A000-$BFFF, $D000-$DFFF and $E000-$FFFF

C128

On the C128, this method takes in 5 numerical parameters and changes the C128 MMU ( Memory Management Unit, address $FF00) to enable/disable various parts of the memory to be visible memory or ROM. The parameters are:
  • Parameter 1: $D000-$DFFF IO (0) or RAM (1)
  • Parameter 2: $4000-$7FFF System ROM (0) or RAM (1)
  • Parameter 3: $8000-$BFFF System ROM (0) or RAM (1)
  • Parameter 4: $C000-$FFFF System ROM (0) or RAM (1)
  • Parameter 5: Ram bank 0 (0) or bank 1 (1)
For instance: Make all ram except IO visible, and use the "other" memory bank: SetMemoryConfig(0,1,1,1,1);