c128lib Base
Base macros for C128
Loading...
Searching...
No Matches
mmu.asm File Reference

Mmu module. More...

Functions

macro SetMMUConfiguration (config)
 Macro for Mmu configuration.
 
macro SetMMULoadConfiguration (config)
 Macro for Mmu configuration. Uses $FF00 instead of $D500.
 
macro SetBankConfiguration (id)
 Set banking. Only main banking are available.
 
macro SetModeConfig (config)
 Set mode configuration register.
 
macro SetCommonRAM (config)
 Configure common RAM amount.
 

Detailed Description

Mmu module.

Simple macros for the Commodore 128.

Author
Raffaele Intorcia raffa.nosp@m.ele..nosp@m.intor.nosp@m.cia@.nosp@m.gmail.nosp@m..com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Date
2024

Function Documentation

◆ SetMMUConfiguration()

macro SetMMUConfiguration ( config )

Macro for Mmu configuration.

I/O block selection

  • Mmu.IO_ROM set I/O block visible on $D000-$DFFF
  • Mmu.IO_RAM set area on $D000-$DFFF dependant from Mmu.ROM_HI selection

If omitted, Mmu.IO_ROM will be used.

Low-ram selection

  • Mmu.ROM_LOW_ROM set rom active for low BASIC ($4000-$7FFF)
  • Mmu.ROM_LOW_RAM set ram active on $4000-$7FFF

If omitted, Mmu.ROM_LOW_ROM will be used.

Mid-ram selection

  • Mmu.ROM_MID_RAM set ram active on $8000-$AFFF and $B000-$BFFF
  • Mmu.ROM_MID_EXT set external function ROM
  • Mmu.ROM_MID_INT set internal function ROM
  • Mmu.ROM_MID_ROM set rom active for BASIC ($8000-$AFFF) and monitor ($B000-$BFFF)

If omitted, Mmu.ROM_MID_ROM will be used.

Hi-ram selection

  • Mmu.ROM_HI_RAM set ram active on $C000-$CFFF, $D000-$DFFF and $E000-$FFFF
  • Mmu.ROM_HI_EXT set external function ROM
  • Mmu.ROM_HI_INT set internal function ROM
  • Mmu.ROM_HI set rom active for Screen editor ($C000-$CFFF), character ($D000-$DFFF), Kernal ($E000-$FFFF)

If omitted, Mmu.ROM_HI will be used.

Bank selection

  • Mmu.RAM0 or Mmu.RAM1 can be used to set ram bank 0 or 1. If omitted, bank 0 will be selected.
Parameters
[in]configValues for Mmu confiuration
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_SetMMUConfiguration in mmu-global.asm
Since
1.1.0

◆ SetMMULoadConfiguration()

macro SetMMULoadConfiguration ( config )

Macro for Mmu configuration. Uses $FF00 instead of $D500.

I/O block selection

  • Mmu.IO_ROM set I/O block visible on $D000-$DFFF
  • Mmu.IO_RAM set area on $D000-$DFFF dependant from Mmu.ROM_HI selection

If omitted, Mmu.IO_ROM will be used.

Low-ram selection

  • Mmu.ROM_LOW_ROM set rom active for low BASIC ($4000-$7FFF)
  • Mmu.ROM_LOW_RAM set ram active on $4000-$7FFF

If omitted, Mmu.ROM_LOW_ROM will be used.

Mid-ram selection

  • Mmu.ROM_MID_RAM set ram active on $8000-$AFFF and $B000-$BFFF
  • Mmu.ROM_MID_EXT set external function ROM
  • Mmu.ROM_MID_INT set internal function ROM
  • Mmu.ROM_MID_ROM set rom active for BASIC ($8000-$AFFF) and monitor ($B000-$BFFF)

If omitted, Mmu.ROM_MID_ROM will be used.

Hi-ram selection

  • Mmu.ROM_HI_RAM set ram active on $C000-$CFFF, $D000-$DFFF and $E000-$FFFF
  • Mmu.ROM_HI_EXT set external function ROM
  • Mmu.ROM_HI_INT set internal function ROM
  • Mmu.ROM_HI set rom active for Screen editor ($C000-$CFFF), character ($D000-$DFFF), Kernal ($E000-$FFFF)

If omitted, Mmu.ROM_HI will be used.

Bank selection

  • Mmu.RAM0 or Mmu.RAM1 can be used to set ram bank 0 or 1. If omitted, bank 0 will be selected.
Parameters
[in]configValues for Mmu confiuration
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Since
1.1.0

◆ SetBankConfiguration()

macro SetBankConfiguration ( id )

Set banking. Only main banking are available.

Parameters
[in]configValues for Mmu confiuration
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use Basic banking, see reference https://c128lib.github.io/Reference/MemoryMap Only banking 0, 1, 4, 5, 12, 13, 14 and 15 are supported.
Use c128lib_SetBankConfiguration in mmu-global.asm
Since
1.2.0

◆ SetModeConfig()

macro SetModeConfig ( config )

Set mode configuration register.

Parameters
[in]configValues for configuration register
Note
Config parameter can be filled with Mmu.CPU_*, Mmu.FASTSERIAL*, Mmu.GAME_*, Mmu.EXROM_*, Mmu.KERNAL_*, Mmu.COLS_*
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Use c128lib_SetModeConfig in mmu-global.asm
Since
1.2.0

◆ SetCommonRAM()

macro SetCommonRAM ( config )

Configure common RAM amount.

RAM Bank 0 is always the visible RAM bank. Valid values are 1,4,8 and 16. For ex. if you choose 4K common ram at top and bottom you'll have 4K up and 4K bottom.

Parameters
[in]configValues for common ram configuration
Remarks
Register .A will be modified.
Flags N and Z will be affected.
Note
Config parameter can be filled with Mmu.COMMON_RAM_*
Use c128lib_SetCommonRAM in mmu-global.asm
Since
1.2.0