Suggested amendment to MMU16 subroutine in nextlib.bas
Quote from dbolli on 9th August 2019, 12:19 amHi There,
I suggest the following amendment to MMU16 based on https://specnext.dev/wiki/Memory_map
Sub MMU16(byval memorybank as ubyte)
' changes 16kb 128k style bank @ $c000, supports full ram
IF memorybank <= 46 THEN' Works for unexpanded Next <= 1MB
' doesnt work correctly yet
asm
ld a,(IX+5); bank 16-31 32-95 96-159 169-223
;BREAK
AND %00000111
ld bc,$7ffd
out (c),a
ld a,(IX+5)
AND %11110000
srl a
srl a
srl a
srl a
srl a; Uncommented
ld bc,$dffd
out (c),a
end asm
ELSE' Works for expanded Next > 1MB
MMU8( 6, memorybank * 2 )
MMU8( 7, ( memorybank * 2 ) + 1 )
ENDIF
end sub
Regards,
Derek.
Hi There,
I suggest the following amendment to MMU16 based on https://specnext.dev/wiki/Memory_map
Sub MMU16(byval memorybank as ubyte)
' changes 16kb 128k style bank @ $c000, supports full ram
IF memorybank <= 46 THEN' Works for unexpanded Next <= 1MB
' doesnt work correctly yet
asm
ld a,(IX+5); bank 16-31 32-95 96-159 169-223
;BREAK
AND %00000111
ld bc,$7ffd
out (c),a
ld a,(IX+5)
AND %11110000
srl a
srl a
srl a
srl a
srl a; Uncommented
ld bc,$dffd
out (c),a
end asm
ELSE' Works for expanded Next > 1MB
MMU8( 6, memorybank * 2 )
MMU8( 7, ( memorybank * 2 ) + 1 )
ENDIF
end sub
Regards,
Derek.