Skip to content

Memory Map

Julian Brown edited this page Jun 11, 2024 · 11 revisions

Memory Map

By default the RevX4 maintains the original Dragon memory mapping. The computer boots into a RAM/ROM mixed memory mode and should be compatible with regular software. The SAMx4 must be switched from compatibility mode to expanded mode in order to access the advanced features

Map

Address Range Usage Notes
$0000 - $7FFF Lower 32K RAM page Can be remapped to the upper 32K using P1 under RAM/ROM memory map type
$8000 - $9FFF Lower system ROM (R0) The last 16 bytes are mapped to $FFF0 - $FFFF
$A000 - $BFFF Upper system ROM (R1)
$C000 - $FF00 External ROM (R2)
$C000 - $FF00 Upper 32K RAM page Under RAM only memory map type
$FF00 - $FFEF SAM registers and Peripheral IO
$FF00 - $FF1F PIA 0 & Serial port
$FF20 - $FF23 PIA 1
$FF24 - $FF27 PIA 1b video expansion slot
$FF28 - $FF2F PIA 1c and 1d audio expansion slot
$FF30 - $FF37 PIA 1e and 1f expansion slot 3
$FF38 - $FF3F PIA 1g and 1h expansion slot 4
$FF40 - $FF5F PIA 2 external
$FF60 - $FFBF reserved
$FF90 Set compatible mode bit 7 (1)
$FF91 Set task id bits 0 and 1 (2)
$FF92 IRQ control bits (3)
$FF93 FIRQ control bits (3)
$FF94 MSB of timer
$FF95 LSB of timer
$FFA0 Select RAM paging register Registers are selected for the current task only
$FFA1 Upper byte of page register
$FFA2 Lower byte of page register Writing to the lower byte commits changes to the selected register
$FFA8 Select ROM paging register Registers are selected for the current task only
$FFA9 ROM page address 1-255, a value of 0 designates the page as RAM (4)
$FFC0 - $FFDF SAM see SAMx4 Registers
$FFE0 - $FFEF reserved
$FFF0 - $FFFF CPU vectors

(1) Compatibility mode forces the SAMx4 to behave as an original MC6883 SAM. Setting the bit to 1 turns compatibility on, clearing the bit enables the additional SAMx4 features. The other bits of the register are unused.

(2) Tasks are identified by 2 bits - bits 0 and 1, 00 = task 0 (typically reserved for the operating system), 01 = task 1, 10 = task 2, 11 = task 3. Bit 5 is used to specify the resolution of the timer, clearing the bit used a slow timer, setting the bit uses a fast timer.

(3) The SAMx4 can generate interrupts according to the bit masks set for IRQ and FIRQ. The only bit defined at the moment is bit 5 and is triggered by the timer (counting down to 0). If the bit is cleared the SAMx4 will not generate an interrupt, if set the interrupt will be generated against the chosen interrupt line ($FF92 for IRQ, $FF93 for FIRQ). It is currently possible to specify an interrupt on both lines, in this situation FIRQ will be used.

(4) In the RAM type memory map the paging for any of the registers can be set to bank of the ROM, in the RAM/ROM type memory map the R0 and R1 blocks need to behave differently. R0 at $8000 is mapped in 4 blocks to $00000 of the ROM by default, R1 is mapped to $A000 in 4 blocks at $02000. R2 is bound exclusively to the cartridge port ROM space at $C000, there is no mechanism to map this to a ROM bank. In RAM mode R2 can be mapped to a RAM or ROM bank but if a cartridge is fitted the paging is ignored and the cartridge ROM is used instead.

Expanded Memory Map

Address Range Notes
$000000 - $00FFFF CPU and VDG addressable range
$000000 - $01FFFF VDG addressable range in expanded mode
$010000 - $3FFFFF Maximum onboard paged RAM
$400000 - $7FFFFF RAM bound to expansion slot 2
$800000 - $BFFFFF RAM bound to expansion slot 3
$C00000 - $FFFFFF RAM bound to expansion slot 4 (not on flex-atx board)

Clone this wiki locally