MSX1 pages and slots

Pagina 4/7
1 | 2 | 3 | | 5 | 6 | 7

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

28-08-2006, 23:59

do you mean like this ?

; set pages and subslot

    in a,(0xA8)                  
    and 0xC0
    ld b,a                  ; which slot is for ram (page 3)?

    in a,(0xA8)              
    and 3                   ; which slot are we (page 0)?
    ld c,a     
    
    sla a
    sla a
    or c
    sla a
    sla a
    or c
    or b
    
    ld e,a                  ; page 0,1 & 2 are at the same primary slot of page 0
                            ; page 3 stay unchanged
    rrc c
    rrc c
    in a,(0xA8)                  
    and 0xC0
    or c
    out (0xA8),a            ; page 3 is set to the same primary slot of 0

    ld a,(-1)
    cpl
    and 0xC0                 ; which sub slot is page 3?
    ld b,a     
    
    ld a,(-1)
    cpl
    and 3                   ; which sub slot are we?
    ld c,a     
    
    sla a
    sla a
    or c
    sla a
    sla a
    or c
    or b
    ld (-1),a               ; page 0,1 & 2 are at the same secondary slot of page 0
                            ; page 3 has the same value of before
                            
    ld a,e
    out (0xA8),a            ; page 0,1 & 2 are at the same primary slot of page 0
                            ; page 3 stay unchanged

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

29-08-2006, 00:04

I cannot find if there is a bug of something I do not understand, but the code hangs...

Van DamageX

Master (217)

afbeelding van DamageX

30-08-2006, 04:04

there is a bug in this part:

rrc c
rrc c
in a,(0xA8)
and 0xC0
or c
out (0xA8),a ; page 3 is set to the same primary slot of 0

I think you want and 0x3F

Also, what if the slot is not even expanded?

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

30-08-2006, 13:22

I see...
I will try on friday

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

30-08-2006, 16:50

actually I do not see why i need and 0x3f
I was trying to get the same primary slot of page 0 in all pages 0 1 and 2
if I do and 0x3f I get the current address of the 3 pages ( that I do not need )
maybe I an missing something....

what sould I do in th power-up code to enable in page 1 and 2 the same slot and subslots I find o page zero ?

why this code does not work?

; set pages and subslot

in a,(0xA8)
and 0xC0
ld b,a ; which slot is for ram (page 3)?

in a,(0xA8)
and 3 ; which slot are we (page 0)?
ld c,a

sla a
sla a
or c
sla a
sla a
or c
or b

ld e,a ; page 0,1 & 2 are at the same primary slot of page 0
; page 3 stay unchanged
rrc c
rrc c
ld a,b
or c
out (0xA8),a ; page 3 is set to the same primary slot of 0

ld a,(-1)
cpl
and 3 ; which sub slot are we?
ld c,a

sla a
sla a
or c
sla a
sla a
or c
ld (-1),a ; page 0,1 & 2 are at the same secondary slot of page 0
; page 3 has the same value of before

ld a,e
out (0xA8),a ; page 0,1 & 2 are at the same primary slot of page 0
; page 3 is set to 0

Van DamageX

Master (217)

afbeelding van DamageX

31-08-2006, 06:00


rrc c
rrc c
ld a,b
or c
out (0xA8),a ; page 3 is set to the same primary slot of 0

This part again doesn't do what you say it does. After rrc c, you have the desired slot for page 0/1/2 in the top two bits of c. You want to write this to $A8 to get page 3 to the same slot, so you can access the register at $FFFF. But, you also need not to change the slot of page 0 where your code is running.

Try the change I suggested before or try the code I posted on the first page of this thread.

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

01-09-2006, 16:30

Unfortunately your code cannot work in my case as I heve the rom signature at 0000h (page 0)
while, AFAI undestand, your code expects to have AB at 4000h (page 1)

moreover I tryed you pach to my cone but it doesn't work...

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

01-09-2006, 17:00

this is the code I use currently


; set pages and subslot

     in a,(0xA8)
     and 0xC0
     ld b,a             ; which slot is for ram (page 3)?

     in a,(0xA8)
     and 3              ; which slot are we in (for page 0)?
     ld c,a

     sla a
     sla a
     or c
     sla a
     sla a
     or c
     or b

     ld e,a             ; page 0,1 & 2 are at the same primary slot of page 0
                        ; page 3 stay unchanged
     rrc c
     rrc c
     in a,(0xA8)
     and 0x3F
     or c
     out (0xA8),a       ; page 3 is set to the same primary slot that was of page 0

     ld a,(-1)
     cpl
     and 0xC0
     ld b,a             ; which sub slot is for ram (at page 3)?    

     ld a,(-1)
     cpl
     and 3              ; which sub slot are we in (for page 0)?
     ld c,a

     sla a
     sla a
     or c
     sla a
     sla a
     or c
     or b
     ld (-1),a          ; page 0,1 & 2 are at the same sub slot of page 0
                        ; page 3 has subslot unchanged

     ld a,e
     out (0xA8),a       ; page 0,1 & 2 are at the same primary slot of page 0
                        ; page 3 is unchanged

It runs only in CBIOS msx1 but not in any other configuration....

Van DamageX

Master (217)

afbeelding van DamageX

02-09-2006, 05:46

it looks correct now Question

Van ARTRAG

Enlighted (6550)

afbeelding van ARTRAG

02-09-2006, 10:22

What should I look for in the basic rom to undserstand if my rom is executed or not ?
I use the debugger of bluemsx, do you know how to put a breackpoint at an address of a given slot/subslot ?

Pagina 4/7
1 | 2 | 3 | | 5 | 6 | 7