MSX Audio Sample RAM Snippet

Door Fudeba

Expert (113)

afbeelding van Fudeba

21-12-2011, 02:32

  Hi there,

  It is the first time I am trying to program something using MSX Audio, but I am having some serious trouble in the initial steps. I've been trying to write some data to MSX Audio (Philips Music Module with 32KB) sample RAM but all I could get was a crash. I'am following this sequence:

; Initial flags register configuration
LD A,04h
LD E, 000h
CALL WRMAR
LD A,04h
LD E, 080h
CALL WRMAR
; Enable Write Mode
LD A,07h
LD E, 060h
CALL WRMAR
; RAM Type: 002h for 64K RAM... 000h for 256K RAM
LD A,08h
LD E, 002h
CALL WRMAR
; Initial Address
LD A,09h
LD E, 000h  ; Low
CALL WRMAR
LD A,0Ah
LD E, 000h  ; High
CALL WRMAR
; End Address
LD A,0Bh
LD E, 000h  ; Low
CALL WRMAR
LD A,0Ch
LD E, 000h  ; High
CALL WRMAR
; Memory Write
LD A,0Fh
LD E,080h  ; Data
CALL WRMAR
; Whatever
JP 0
 
; Writes the value of E into MSX Audio register pointed by A
WRMAR:
OUT (0C0h),A
NOP
LD A,E
OUT (0C1h),A
NOP
RET

  It doesn't matter what I do after the memory write: MSX just hangs when executing the write on 0Fh register.

  Any clues?

  Regards,

  DJC

Aangemeld of registreer om reacties te plaatsen

Van Jorito

Mr. Ambassadors (1762)

afbeelding van Jorito

21-12-2011, 08:43

Hi Fudeba, I don't have a clue, but I wanted to point out the 'code' button in our WYSIWYG editor. It's the icon that looks like a small document, next to the "quotes" button. It'll make the code better to read and will prevent page breaks if you have long lines.

For convenience, I copy/pasted it in a code block for you Wink

; Initial flags register configuration
    LD A,04h
    LD E, 000h
    CALL WRMAR
    LD A,04h
    LD E, 080h
    CALL WRMAR
    ; Enable Write Mode
    LD A,07h
    LD E, 060h
    CALL WRMAR
    ; RAM Type: 002h for 64K RAM... 000h for 256K RAM
    LD A,08h
    LD E, 002h
    CALL WRMAR
    ; Initial Address
    LD A,09h
    LD E, 000h  ; Low
    CALL WRMAR
    LD A,0Ah
    LD E, 000h  ; High
    CALL WRMAR
    ; End Address
    LD A,0Bh
    LD E, 000h  ; Low
    CALL WRMAR
    LD A,0Ch
    LD E, 000h  ; High
    CALL WRMAR
    ; Memory Write
    LD A,0Fh
    LD E,080h  ; Data
    CALL WRMAR
    ; Whatever
    JP 0
    
    ; Writes the value of E into MSX Audio register pointed by A
    WRMAR:
    OUT (0C0h),A
    NOP
    LD A,E
    OUT (0C1h),A
    NOP
    RET