Logicielsmoto.com
http://www.logicielsmoto.com/phpBB/

Mo6 - Running code at $b000-$efff
http://www.logicielsmoto.com/phpBB/viewtopic.php?f=13&t=547
Page 1 sur 1

Auteur:  W_oo_d [ 15 Déc 2016, 16:30 ]
Sujet du message:  Mo6 - Running code at $b000-$efff

Hello

I have this MO6 program that works on emulators(DCMOTO and MESS) but not on the real machine:

I load a program to bank5 that will be used in the rom banking area (I have formatted the data to be used from $b000-$efff as the ram bank data will not be shown sequentially there)

The program that calls the routine at $b004 is:

Code:
            orcc   #$50    ;Disable IRQ and FIRQ

            lda #$52    ;%01010010 RAM commutation active
            sta $a7e7
      
            lda #$65   ;%01100101  write enable and ram enable -> bank 5 at $b000
            sta $a7e6
            
            lda #$02
            sta $a7e5   ;bank 2 at $6000

            jmp $b004   


What might be wrong here? thanks

Auteur:  Prehisto [ 17 Déc 2016, 23:18 ]
Sujet du message:  Re: Mo6 - Running code at $b000-$efff

Sorry to give you an answer so late.

The #$52 value is not appropriate to activate the capability to switch RAM in direct mode. I think you should do instead :

Code:
            orcc   #$50    ;Disable IRQ and FIRQ
; Activate direct RAM switch mode
            lda $2081    ; Read read/write image of commutation register
            ora #$10     ; Activate direct RAM switch bit
            sta $2081    ; Update read/write image of commutation register
            sta $a7e7    ; Update commutation register
; Switch cartridge bank
            lda #$65   ;%01100101  write enable and ram enable -> bank 5 at $b000
            sta $a7e6
; Switch RAM bank
            lda #$02
            sta $a7e5   ;bank 2 at $6000

            jmp $b004   

Auteur:  W_oo_d [ 18 Déc 2016, 19:05 ]
Sujet du message:  Re: Mo6 - Running code at $b000-$efff

Hi Prehisto thank you for that I will try it out asap. :)

Page 1 sur 1 Heures au format UTC + 1 heure
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/