PDA

Просмотр полной версии : ATM TURBO - RAM PAGING



VELESOFT
24.09.2010, 22:00
I need access on ATM TURBO 2+ from ZX basic to system port #xx77, but writing to this port is dibable. Why ?

I need switch ram pages in area #4000-#7FFF and #8000-#BFFF. But access to port #7FF7 and #BFF7 is ignored...

Please help. Ideal with example. :v2_conf2:

VELESOFT
26.09.2010, 20:09
I test it in UNREAL SPECCY emulator.

I am in ZX mode:
1) push to stack adress for return
2) push to stack adress of instruction OUT (C),A in TR-DOS rom
3) set BC register to #0277 and register A to 0
4) set 48 rom via paging port #7FFD
5) CALL #3D2F
After return are enabled all shadow ports for controll memory ports

Is this correct ? :v2_conf2:

Keeper
26.09.2010, 21:02
http://atmturbo.nedopc.com/inf/books/nedopc/atm_hard.zip


CALL SHADOW
…..
SHADOW LD BC,#2A53 ; OUT (C),A in TR-DOS address space
PUSH BC ; Putting on stack
LD BC,#nnnn ; Address of the shadow port
LD A,#nn ; Data to out
JP #3D2F ; Jump to RET in TR-DOS space



out #FFF7 = %xx11111111110111 (#3FF7,#7FF7,#BFF7,#FFF7)
(A0=A2=A4=A7=1; A3=0)

Bits description:

D0–D5 – inverted page number, RAM or ROM (#00-#3F). If you want to setup page #05 (%00000101) then you should out its inverted value %11111010
D6 – defines ROM or RAM page
D6=0 – ROM page defined by bits D0-D5
D6=1 – RAM page defined by bits D0-D5

D7 – Defines what memory manager`s ports and bits are used to form page number
D7=0 – Page number defined by port #xFF7 only
D7=1 – Use not inverted bits D0-D2 of port #7FFd instead of inverted bits in port #xFF7 If RAM selected by D6: inverted bits D0-D2 replaced with not inverted bits of port #7FFD


LD A, #2B ;PAge number is 43 dec
PUSH AF
SCF ;invert if for port #xFF7
AND %11111000 ;D7=1 – use port #7FFD
LD BC, #FFF7 ;window 3 (#C000)
OUT (C), A ;set bits 3-5 of the page number
POP AF ;restore page number
AND %00000111 ;cut off higher bits
LD BC, #7FFD
OUT (C), A ;set bits 0-2 of the page number


<<cut>>

Bits on address bus : A14-A15 - selects window in address space:

A14 A15 window port
0 0 #0000-#3FFF (port #3FF7)
1 0 #4000-#7FFF (port #7FF7)
0 1 #8000-#BFFF (port #BFF7)
1 1 #C000-#FFFF (port #FFF7)


P.S.: Fast and lazy translation after hard day... :v2_blush: