Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 7497de643dd4 src/Player.asm
- --- a/src/Player.asm Fri Feb 09 00:09:20 2018 +0100
- +++ b/src/Player.asm Tue Apr 24 20:26:45 2018 +0000
- @@ -554,7 +554,7 @@
- dw Player_Skip3 ; A7H
- dw Player_Skip3 ; A8H
- dw Player_Skip3 ; A9H
- - dw Player_Skip3 ; AAH
- + dw YM3812_instance.ProcessCommandDual ; AAH
- dw Player_Skip3 ; ABH
- dw Player_Skip3 ; ACH
- dw Player_Skip3 ; ADH
- diff -r 7497de643dd4 src/chips/YM3812.asm
- --- a/src/chips/YM3812.asm Fri Feb 09 00:09:20 2018 +0100
- +++ b/src/chips/YM3812.asm Tue Apr 24 20:26:45 2018 +0000
- @@ -11,6 +11,12 @@
- jp System_Return
- writeRegister: equ $ - 2
- ENDP
- +
- + ProcessCommandDual: PROC
- + call Reader_ReadWord_IY
- + jp System_Return
- + writeRegister: equ $ - 2
- + ENDP
- ENDM
- ; ix = this
- @@ -24,12 +30,22 @@
- ; ix = this
- YM3812_Connect:
- call Drivers_TryCreateMoonSound_IY
- - ret nc
- + jr nc, TryMoonSoundC0
- call Chip_SetDriver
- ld hl,MoonSound.SafeWriteRegister
- add hl,de
- ld (ix + YM3812.ProcessCommand.writeRegister),l
- ld (ix + YM3812.ProcessCommand.writeRegister + 1),h
- + call Chip_IsDualChip
- + ret z
- +TryMoonSoundC0:
- + call Drivers_TryCreateMoonSoundC0_IY
- + ret nc
- + call Chip_SetDriver2
- + ld hl,MoonSoundC0.SafeWriteRegister
- + add hl,de
- + ld (ix + YM3812.ProcessCommandDual.writeRegister),l
- + ld (ix + YM3812.ProcessCommandDual.writeRegister + 1),h
- ret
- ;
- diff -r 7497de643dd4 src/drivers/Drivers.asm
- --- a/src/drivers/Drivers.asm Fri Feb 09 00:09:20 2018 +0100
- +++ b/src/drivers/Drivers.asm Tue Apr 24 20:26:45 2018 +0000
- @@ -9,6 +9,7 @@
- INCLUDE "MSXMusic.asm"
- INCLUDE "MSXAudio.asm"
- INCLUDE "MoonSound.asm"
- + INCLUDE "MoonSoundC0.asm"
- INCLUDE "SCC.asm"
- INCLUDE "SCCPlus.asm"
- INCLUDE "Franky.asm"
- @@ -36,6 +37,8 @@
- dw 0
- moonSound:
- dw 0
- + moonSoundC0:
- + dw 0
- scc:
- dw 0
- sccPlus:
- @@ -96,6 +99,10 @@
- call nz,MoonSound_Destruct
- pop ix
- push ix
- + call Drivers_GetMoonSoundC0
- + call nz,MoonSoundC0_Destruct
- + pop ix
- + push ix
- call Drivers_GetSCC
- call nz,SCC_Destruct
- pop ix
- @@ -266,6 +273,28 @@
- ret
- ; ix = this
- +; de <- MoonSound at C0 driver
- +; f <- c: succeeded
- +Drivers_TryCreateMoonSoundC0_IY:
- + ld a,(iy + Drivers.moonSoundC0)
- + or (iy + Drivers.moonSoundC0 + 1)
- + ret nz
- + call MoonSoundC0_Detect
- + ret nc
- + push ix
- + ld ix,MoonSoundC0_instance
- + call MoonSoundC0_Construct
- + ld e,ixl
- + ld d,ixh
- + pop ix
- + ld (iy + Drivers.moonSoundC0),e
- + ld (iy + Drivers.moonSoundC0 + 1),d
- + scf
- + ret
- +
- +
- +
- +; ix = this
- ; de <- SCC driver
- ; f <- c: succeeded
- Drivers_TryCreateSCC_IY:
- @@ -596,6 +625,19 @@
- ret
- ; ix = this
- +; de <- MoonSound at C0 driver
- +; ix <- MoonSound at C0 driver
- +; f <- z: not set
- +Drivers_GetMoonSoundC0:
- + ld e,(ix + Drivers.moonSoundC0)
- + ld d,(ix + Drivers.moonSoundC0 + 1)
- + ld ixl,e
- + ld ixh,d
- + ld a,e
- + or d
- + ret
- +
- +; ix = this
- ; de <- SCC driver
- ; ix <- SCC driver
- ; f <- z: not set
- diff -r 7497de643dd4 src/drivers/MoonSound.asm
- --- a/src/drivers/MoonSound.asm Fri Feb 09 00:09:20 2018 +0100
- +++ b/src/drivers/MoonSound.asm Tue Apr 24 20:26:45 2018 +0000
- @@ -1,11 +1,14 @@
- ;
- ; MoonSound YMF278B OPL4
- ;
- -MoonSound_STATUS: equ 0C4H
- -MoonSound_FM_ADDRESS: equ 0C4H
- -MoonSound_FM_DATA: equ 0C5H
- -MoonSound_FM2_ADDRESS: equ 0C6H
- -MoonSound_FM2_DATA: equ 0C7H
- +
- +MoonSound_BASE_PORT: equ 0C4H
- +
- +MoonSound_STATUS: equ 00H
- +MoonSound_FM_ADDRESS: equ 00H
- +MoonSound_FM_DATA: equ 01H
- +MoonSound_FM2_ADDRESS: equ 02H
- +MoonSound_FM2_DATA: equ 03H
- MoonSound_WAVE_ADDRESS: equ 07EH
- MoonSound_WAVE_DATA: equ 07FH
- MoonSound_FM2_NEW: equ 05H
- @@ -16,7 +19,7 @@
- MoonSound_WAVE_MEMORY_DATA: equ 06H
- MoonSound_FREQUENCY: equ 33868800
- -MoonSound: MACRO
- +MoonSound: MACRO ?moonsound_base_port
- this:
- super: Driver Driver_PrintInfoImpl
- waveNumberMap:
- @@ -33,10 +36,10 @@
- ; a = register
- ; d = value
- WriteRegister:
- - out (MoonSound_FM_ADDRESS),a
- + out (MoonSound_FM_ADDRESS + ?moonsound_base_port),a
- nop ; wait 56 cycles (5.9 bus cycles)
- ld a,d
- - out (MoonSound_FM_DATA),a
- + out (MoonSound_FM_DATA + ?moonsound_base_port),a
- ret
- MaskControl:
- cp 8H
- @@ -50,10 +53,10 @@
- ; a = register
- ; d = value
- WriteRegister2:
- - out (MoonSound_FM2_ADDRESS),a
- + out (MoonSound_FM2_ADDRESS + ?moonsound_base_port),a
- nop ; wait 56 cycles (5.9 bus cycles)
- ld a,d
- - out (MoonSound_FM2_DATA),a
- + out (MoonSound_FM2_DATA + ?moonsound_base_port),a
- ret
- ; e = register
- @@ -505,7 +508,7 @@
- ; f <- c: Found
- MoonSound_Detect:
- - in a,(MoonSound_STATUS)
- + in a,(MoonSound_STATUS + MoonSound_BASE_PORT)
- and 11111101B ; sometimes LD is set
- sub 00H
- and a
- @@ -519,6 +522,6 @@
- SECTION RAM
- -MoonSound_instance: MoonSound
- +MoonSound_instance: MoonSound MoonSound_BASE_PORT
- ENDS
- diff -r 7497de643dd4 src/drivers/MoonSoundC0.asm
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/src/drivers/MoonSoundC0.asm Tue Apr 24 20:26:45 2018 +0000
- @@ -0,0 +1,39 @@
- +;
- +; MoonSound YMF278B OPL4 in C0 I/O port base (configured DalSoRi R2)
- +;
- +
- +MoonSoundC0_BASE_PORT: equ 0C0H
- +
- +
- +MoonSoundC0: equ MoonSound
- +
- +; ix = this
- +MoonSoundC0_Destruct: equ MoonSound_Destruct
- +MoonSoundC0_SafeWriteRegister: equ MoonSound_SafeWriteRegister
- +
- +; ix = this
- +MoonSoundC0_Construct:
- + call MoonSound_Construct
- + ld bc, MoonSoundC0_name
- + ld (ix + Driver.name),c
- + ld (ix + Driver.name + 1),b
- + ret
- +
- +; f <- c: Found
- +MoonSoundC0_Detect:
- + in a,(MoonSound_STATUS + MoonSoundC0_BASE_PORT)
- + and 11111101B ; sometimes LD is set
- + sub 00H
- + and a
- + ret nz
- + scf
- + ret
- +
- +MoonSoundC0_name:
- + db "MoonSound (at C0H)",0
- +
- + SECTION RAM
- +
- +MoonSoundC0_instance: MoonSound MoonSoundC0_BASE_PORT
- +
- + ENDS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement