StartUp sound, fixes with atapi detects, new in settings
This commit is contained in:
parent
a3aef23cd6
commit
5069c5941e
@ -1 +1 @@
|
||||
Subproject commit 83c2b69b4af0a36475fa42378000fb6e57c59021
|
||||
Subproject commit 63faf9f0823649cfb52e9fcaad430170a05b31a7
|
||||
Binary file not shown.
@ -624,18 +624,20 @@ EXEC_PACKET_COMMAND:
|
||||
POP BC
|
||||
OUT (C),B
|
||||
; pause
|
||||
LD B,0
|
||||
DJNZ $
|
||||
; LD B,0
|
||||
; DJNZ $
|
||||
; DJNZ $
|
||||
;
|
||||
EX AF,AF'
|
||||
LD XH,A ; áâà ¨æ ¤«ï R/W_LONG
|
||||
LD XL,0
|
||||
EX AF,AF'
|
||||
;A=0
|
||||
LD XL,A
|
||||
EX DE,HL
|
||||
;
|
||||
.AP_LOOP: ;LD B,128
|
||||
;DJNZ $
|
||||
.AP_LOOP: ;CALL ATAPI_WAITPRT.wait_NZ
|
||||
LD B,128
|
||||
DJNZ $
|
||||
CALL ATAPI_CHECK_DRV
|
||||
JP C,.error;_APLOOP
|
||||
RET Z
|
||||
@ -680,12 +682,19 @@ EXEC_PACKET_COMMAND:
|
||||
JR NZ,.write_loop
|
||||
JR .return_rw
|
||||
; ;
|
||||
.END_BUFFER: CALL ATAPI_CHECK_DRV
|
||||
.END_BUFFER: ;CALL ATAPI_WAITPRT.wait_NZ
|
||||
LD B,128
|
||||
DJNZ $
|
||||
CALL ATAPI_CHECK_DRV
|
||||
JP C,.error
|
||||
JR NZ,ATAPI_IdlePasses.Enter
|
||||
RET
|
||||
;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
ATAPI_IdlePasses:
|
||||
;CALL ATAPI_WAITPRT.wait_NZ
|
||||
LD B,128
|
||||
DJNZ $
|
||||
CALL ATAPI_CHECK_DRV
|
||||
JP C,EXEC_PACKET_COMMAND.error
|
||||
JP Z,EXEC_PACKET_COMMAND.error_fail
|
||||
@ -712,8 +721,6 @@ ATAPI_IdlePasses:
|
||||
JR NZ,.write_loop
|
||||
JR ATAPI_IdlePasses
|
||||
;
|
||||
|
||||
|
||||
; ¢ë室:
|
||||
; CF,ZF ATAPI_WAITPRT Error ¨«¨ Check Condition á® ¢¥è¥© ®¡à ¡®âª®©
|
||||
; ZF No errors, no data request
|
||||
@ -838,13 +845,14 @@ ATAPI_GET_ERROR_REG:
|
||||
; !!! ¥ª®â®àë¥ äãªæ¨¨ ¤¥îâáï, çâ® ¢ë室¥ ¢á¥£¤ ZF
|
||||
; ¥ ¤®«¦ âண âì ॣ. C
|
||||
ATAPI_WAITPRT: LD DE,256*IDE.CtrlByte.Busy + 0
|
||||
.Custom: LD B,6 ; 3 = ®¡é ï § ¤¥à¦ª ®ª®«® ᥪã¤ë
|
||||
.Custom: LD B,9 ; 3 = ®¡é ï § ¤¥à¦ª ®ª®«® ᥪã¤ë
|
||||
LD HL,#0000
|
||||
; 4ÿ128ÿ768
|
||||
.LOOP: LD A,high IDE.Read.Status
|
||||
IN A,(low IDE.Read.Status)
|
||||
CP #FF
|
||||
JR Z,.error
|
||||
SCF
|
||||
RET Z
|
||||
;
|
||||
AND D
|
||||
CP E
|
||||
@ -871,10 +879,96 @@ ATAPI_WAITPRT: LD DE,256*IDE.CtrlByte.Busy + 0
|
||||
; RET Z
|
||||
;
|
||||
LD A,BIOS.Error.Busy
|
||||
SCF
|
||||
RET
|
||||
;
|
||||
.error: SCF
|
||||
RET
|
||||
; .wait_NZ: LD B,2 ; 50 - § ¤¥à¦ª ®¯à¥¤¥«ñ ï â¥áâ ¬¨ IOMEGA ZIP Drive
|
||||
; .NZ_loop: LD A,high IDE.Read.Status
|
||||
; IN A,(low IDE.Read.Status)
|
||||
; LD C,A
|
||||
; AND A
|
||||
; CALL NZ,PutHexNumb
|
||||
; ;INC A
|
||||
; ;RET NZ
|
||||
; ;AND IDE.CtrlByte.Busy + IDE.CtrlByte.DataRequest + IDE.CtrlByte.CheckCondition
|
||||
; ;INC A
|
||||
; ;AND A
|
||||
; ;RET NZ
|
||||
; DJNZ .NZ_loop
|
||||
; RET
|
||||
;----------------------------------------------------------------------;
|
||||
|
||||
|
||||
;----------------------------------------------------------------------;
|
||||
;<3B>à®æ¥¤ãà ¯à¥®¡à §®¢ ¨ï 8¡¨â®¢ëå ç¨á¥« ¢ è¥áâ ¤æ. ⥪áâ
|
||||
;<3B> ¢å®¤:
|
||||
; HL - ¤à¥á ¡ãä¥à
|
||||
; € - ¡ ©â
|
||||
;<3B> ¢ë室:
|
||||
; DE - ¤¢ ¡ ©â è¥áâ ¤æ â¥à¨ç®£® ⥪áâ
|
||||
; PutHexNumb: PUSH IX
|
||||
; PUSH IY
|
||||
; PUSH AF
|
||||
; EX AF,AF'
|
||||
; PUSH AF
|
||||
; EX AF,AF'
|
||||
; PUSH DE
|
||||
; PUSH HL
|
||||
; PUSH BC
|
||||
; LD A,C
|
||||
; EXX
|
||||
; PUSH DE
|
||||
; PUSH HL
|
||||
; PUSH BC
|
||||
; ;
|
||||
; PUSH AF
|
||||
; RRCA
|
||||
; RRCA
|
||||
; RRCA
|
||||
; RRCA
|
||||
; AND #0F
|
||||
; ADD A,#90
|
||||
; DAA
|
||||
; ADC A,#40
|
||||
; DAA
|
||||
; LD E,A
|
||||
; POP AF
|
||||
; AND #0F
|
||||
; ADD A,#90
|
||||
; DAA
|
||||
; ADC A,#40
|
||||
; DAA
|
||||
; LD D,A
|
||||
; ;
|
||||
; LD HL," "
|
||||
; PUSH HL
|
||||
; PUSH DE
|
||||
; LD L,0
|
||||
; ADD HL,SP
|
||||
; ;
|
||||
; SCF
|
||||
; LD B,COLORS.CGA.INK.LGRAY + COLORS.CGA.PAPER.BLACK
|
||||
; EX AF,AF'
|
||||
; AND A
|
||||
; LD A,B
|
||||
; CALL LP_PR_LINE_DIR.START
|
||||
; POP HL
|
||||
; POP HL
|
||||
; ;
|
||||
; POP BC
|
||||
; POP HL
|
||||
; POP DE
|
||||
; EXX
|
||||
; POP BC
|
||||
; POP HL
|
||||
; POP DE
|
||||
; POP AF
|
||||
; EX AF,AF'
|
||||
; POP AF
|
||||
; POP IY
|
||||
; POP IX
|
||||
; RET
|
||||
;
|
||||
;----------------------------------------------------------------------;
|
||||
|
||||
|
||||
|
||||
@ -476,7 +476,7 @@ PARSE_IdentifyDevice:
|
||||
;
|
||||
; ¢á直© á«ãç ©
|
||||
LD (IY+IDE.HDD_INIT_TABLE.MediaParameters),%0000'0001
|
||||
LD B,100 ; áçñâ稪 ¯®¯ë⮪ (1 ¯®¯ë⪠- 1 HALT)
|
||||
LD B,200 ; áçñâ稪 ¯®¯ë⮪ (1 ¯®¯ë⪠- 1 HALT)
|
||||
.get_error_loop: PUSH BC
|
||||
;LD HL,ATAPI_CMD_PACKET.TEST_UNIT_READY
|
||||
;CALL EXEC_PACKET_COMMAND.start
|
||||
@ -486,10 +486,10 @@ PARSE_IdentifyDevice:
|
||||
;
|
||||
CP BIOS.Error.ATAPI.UnitAttention
|
||||
JR Z,PARSE_IdentifyDevice.END ;!TEST ;!FIXIT ZIP bug
|
||||
;JR Z,.TEST_SET
|
||||
|
||||
;
|
||||
CP BIOS.Error.ATAPI.NotReady
|
||||
HALT
|
||||
JR Z,.get_error_loop
|
||||
DJNZ .get_error_loop
|
||||
;
|
||||
; [ ] sector size ATAPI
|
||||
|
||||
@ -865,9 +865,10 @@ setInt: ld a,CMOS_CELL.ScreenSET
|
||||
;
|
||||
;-----------------------------------------------------------------------;
|
||||
;!FIXIT ¯à¨¡à âìáï âãâ
|
||||
MEMTEST EQU #80
|
||||
SAVERAM EQU #40
|
||||
EXTBIOS EQU #20
|
||||
SETBOOTSOUND EQU high CMOS_CELL.BootUpParams.Mask.BootSound
|
||||
MEMTEST EQU high CMOS_CELL.BootUpParams.Mask.MemTest
|
||||
SAVERAM EQU high CMOS_CELL.BootUpParams.Mask.SaveRAMdisks
|
||||
EXTBIOS EQU high CMOS_CELL.BootUpParams.Mask.UpdBios
|
||||
|
||||
SDELAY2 EQU #10
|
||||
SDELAY1 EQU #08
|
||||
@ -1009,9 +1010,9 @@ STYLES:
|
||||
DB COLORS.CGA.PAPER.LGRAY + COLORS.CGA.INK.RED
|
||||
DB COLORS.CGA.PAPER.BLACK + COLORS.CGA.INK.RED
|
||||
|
||||
DEFVAL: DB SAVERAM + EXTBIOS + SDELAY1 ;#0E - OPTIONS
|
||||
DEFVAL: DB SAVERAM + SETBOOTSOUND + SDELAY1 ;#0E - OPTIONS
|
||||
DB TDL250 + TRATE30 ;#0F - KEYBOARD
|
||||
DB SDIDE1 + SDFDD1 ;#10 - SYSTEM DISKS
|
||||
DB SDIDE1 + ASDFDD1 ;#10 - SYSTEM DISKS
|
||||
DB FD1720 + FD2720+HD1AUTO+HD2AUTO ;#11 - FDD & Primary HDD's
|
||||
DB 0 ;#12 - CYLINDERS LOW MASTER
|
||||
DB 0 ;#13 - CYLINDERS HIGH MASTER
|
||||
@ -1036,9 +1037,9 @@ DEFVAL: DB SAVERAM + EXTBIOS + SDELAY1 ;#0E - OPTIONS
|
||||
CMOSARE:
|
||||
DS 14
|
||||
;
|
||||
DB SAVERAM+EXTBIOS ;#0E - OPTIONS
|
||||
DB SAVERAM + SETBOOTSOUND + SDELAY1 ;#0E - OPTIONS
|
||||
DB TDL250+TRATE30 ;#0F - KEYBOARD
|
||||
DB SDIDE1+ASDFDD2 ;#10 - SYSTEM DISKS
|
||||
DB SDIDE1 + ASDFDD1 ;#10 - SYSTEM DISKS
|
||||
DB FD1720+FD2720+HD1AUTO+HD2AUTO ;#11 - FDD & HDD
|
||||
DB 0 ;#12 - CYLINDERS LOW MASTER
|
||||
DB 0 ;#13 - CYLINDERS HIGH MASTER
|
||||
|
||||
@ -296,6 +296,10 @@ LOGOTYPE: CALL SHOW_LOGO
|
||||
RLA
|
||||
JR NC,.noSound
|
||||
;
|
||||
LD BC,CMOS_CELL.BootUpParams.Mask.BootSound
|
||||
CALL GET_CMOS_VALUE
|
||||
OR A
|
||||
JR Z,.noSound
|
||||
LD A,#37 ; opcode SCF, play sound on
|
||||
LD (INT_HANDLER.sndSwitch),A
|
||||
.noSound: ;
|
||||
@ -337,6 +341,7 @@ LOGOTYPE: CALL SHOW_LOGO
|
||||
IF STARTUP_SND
|
||||
LD A,#3F ; opcode CCF, play sound off
|
||||
LD (INT_HANDLER.sndSwitch),A
|
||||
CALL STARTUP_SOUND.mute
|
||||
ENDIF
|
||||
;
|
||||
LD DE,0
|
||||
|
||||
403
src/bios/rom/SETUP/ayfxplay.asm
Executable file
403
src/bios/rom/SETUP/ayfxplay.asm
Executable file
@ -0,0 +1,403 @@
|
||||
; -Minimal ayFX player (Improved) v2.05 25/01/21--------------;
|
||||
; https://github.com/Threetwosevensixseven/ayfxedit-improved ;
|
||||
; Zeus format (http://www.desdes.com/products/oldfiles) ;
|
||||
; ;
|
||||
; Forked from v0.15 06/05/06 ;
|
||||
; https://shiru.untergrund.net/software.shtml ;
|
||||
; ;
|
||||
; The simplest effects player. Plays effects on one AY, ;
|
||||
; without music in the background. ;
|
||||
; Priority of the choice of channels: if there are free ;
|
||||
; channels, one of them is selected if free. ;
|
||||
; If there are are no free channels, the longest-sounding ;
|
||||
; one is selected. ;
|
||||
; Procedure plays registers AF, BC, DE, HL, IX. ;
|
||||
; ;
|
||||
; Initialization: ;
|
||||
; ld hl, the address of the effects bank ;
|
||||
; call AFXInit ;
|
||||
; ;
|
||||
; Start the effect: ;
|
||||
; ld a, the number of the effect (0..255) ;
|
||||
; call AFXPlay ;
|
||||
; ;
|
||||
; In the interrupt handler: ;
|
||||
; call AFXFrame ;
|
||||
; ;
|
||||
; Start the effect on a specified channel: ;
|
||||
; ld a, the number of the effect (0..255) ;
|
||||
; ld e, the number of the channel (A=0, B=1, C=2) ;
|
||||
; call AFXPlayChannel ;
|
||||
; ;
|
||||
; Start the effect with sustain loop enabled: ;
|
||||
; ld a, the number of the effect (0..255) ;
|
||||
; ld e, the number of the channel (A=0, B=1, C=2) ;
|
||||
; ld bc, the bank address + the release address offset ;
|
||||
; call AFXPlayChannel ;
|
||||
; ;
|
||||
; Notify AFX.Frame that the should be should be looped back to ;
|
||||
; the sustain point once the release point has been reached: ;
|
||||
; ld a, the number of the effect (0..255) ;
|
||||
; ld e, the number of the channel (A=0, B=1, C=2) ;
|
||||
; ld bc, the bank address + the sustain address offset ;
|
||||
; call AFXSustain ;
|
||||
; ;
|
||||
; Change log:
|
||||
; v2.05 25/01/21 Bug fix: AFXInit was overwriting itself ;
|
||||
; the first time it was called, so it ;
|
||||
; couldn't ever be called a second time. ; ;
|
||||
; v2.04 22/10/17 Bug fix: EffectTime was not fully ;
|
||||
; initialised. ;
|
||||
; v2.03 22/10/17 Bug fix: disabled loop markers should have ;
|
||||
; MSB $00, as $FF could be a valid address. ;
|
||||
; Backported Zeus player to Pasmo format. ;
|
||||
; v2.02 21/10/17 Added the ability to loop a sound while ;
|
||||
; receiving sustain messages. ;
|
||||
; v2.01 21/10/17 Added the ability to play a sound on a ;
|
||||
; specific channel. ;
|
||||
; v2.00 27/08/17 Converted Z80 player to Zeus format. ;
|
||||
; --------------------------------------------------------------;
|
||||
|
||||
; Channel descriptors, 4 bytes per channel:
|
||||
; +0 (2) current address (channel is free if high byte=$00)
|
||||
; +2 (2) sound effect time
|
||||
; +2 (2) start address of sustain loop (disabled if high byte=$00)
|
||||
; +2 (2) end address of sustain loop (disabled if high byte=$00)
|
||||
afxChDescCount equ 3
|
||||
afxChDesc DS afxChDescCount*8
|
||||
AFXSMC equ 0
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Initialize the effects player. ;
|
||||
; Turns off all channels, sets variables. ;
|
||||
; ;
|
||||
; Input: HL = bank address with effects ;
|
||||
; --------------------------------------------------------------;
|
||||
|
||||
AFXInit:
|
||||
inc hl
|
||||
ld (afxBnkAdr1+1), hl ; Save the address of the table of offsets
|
||||
ld (afxBnkAdr2+1), hl ; Save the address of the table of offsets
|
||||
ld hl, afxChDesc ; Mark all channels as empty
|
||||
ld de, $00ff
|
||||
ld bc, afxChDescCount*256+$fd
|
||||
afxInit0:
|
||||
ld (hl), d
|
||||
inc hl
|
||||
ld (hl), d
|
||||
inc hl
|
||||
ld (hl), e
|
||||
inc hl
|
||||
ld (hl), e
|
||||
inc hl
|
||||
ld (hl), d
|
||||
inc hl
|
||||
ld (hl), d
|
||||
inc hl
|
||||
ld (hl), d
|
||||
inc hl
|
||||
ld (hl), d
|
||||
inc hl
|
||||
djnz afxInit0
|
||||
|
||||
ld hl, $ffbf ; Initialize AY
|
||||
ld e, $15
|
||||
afxInit1:
|
||||
dec e
|
||||
ld b, h
|
||||
out (c), e
|
||||
ld b,l
|
||||
out (c), d
|
||||
jr nz, afxInit1
|
||||
|
||||
ld (afxNseMix+1), de ; Reset the player variables
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Play the current frame. ;
|
||||
; ;
|
||||
; No parameters. ;
|
||||
; --------------------------------------------------------------;
|
||||
AFXFrame:
|
||||
ld bc, $03fd
|
||||
ld ix, afxChDesc
|
||||
afxFrame0:
|
||||
push bc
|
||||
|
||||
ld a,11
|
||||
ld h,(ix+1) ; Compare high-order byte of address to <11
|
||||
cp h
|
||||
jr nc, afxFrame7 ; The channel does not play, we skip
|
||||
ld l, (ix+0)
|
||||
ld e, (hl) ; We take the value of the information byte
|
||||
inc hl
|
||||
|
||||
sub b ; Select the volume register:
|
||||
ld d, b ; (11-3=8, 11-2=9, 11-1=10)
|
||||
|
||||
ld b, $ff ; Output the volume value
|
||||
out (c), a
|
||||
ld b, $bf
|
||||
ld a, e
|
||||
and $0f
|
||||
out (c), a
|
||||
|
||||
bit 5, e ; Will the tone change?
|
||||
jr z, afxFrame1 ; Tone does not change
|
||||
|
||||
ld a, 3 ; Select the tone registers:
|
||||
sub d ; 3-3=0, 3-2=1, 3-1=2
|
||||
add a, a ; 0*2=0, 1*2=2, 2*2=4
|
||||
|
||||
ld b, $ff ; Output the tone values
|
||||
out (c), a
|
||||
ld b, $bf
|
||||
ld d, (hl)
|
||||
inc hl
|
||||
out (c), d
|
||||
ld b, $ff
|
||||
inc a
|
||||
out (c), a
|
||||
ld b, $bf
|
||||
ld d, (hl)
|
||||
inc hl
|
||||
out (c), d
|
||||
|
||||
afxFrame1:
|
||||
bit 6, e ; Will the noise change?
|
||||
jr z, afxFrame3 ; Noise does not change
|
||||
|
||||
ld a, (hl) ; Read the meaning of noise
|
||||
sub $20
|
||||
jr c, afxFrame2 ; Less than $20, play on
|
||||
ld h, a ; Otherwise the end of the effect
|
||||
ld c,$ff
|
||||
ld b, c ; In BC we record the most time
|
||||
jr afxFrame6
|
||||
|
||||
afxFrame2:
|
||||
inc hl
|
||||
ld (afxNseMix+1), a ; Keep the noise value
|
||||
|
||||
afxFrame3:
|
||||
pop bc ; Restore the value of the cycle in B
|
||||
push bc
|
||||
inc b ; Number of shifts for flags TN
|
||||
|
||||
ld a, %01101111 ; Mask for flags TN
|
||||
afxFrame4:
|
||||
rrc e ; Shift flags and mask
|
||||
rrca
|
||||
djnz afxFrame4
|
||||
ld d, a
|
||||
|
||||
ld bc, afxNseMix+2 ; Store the values of the flags
|
||||
ld a, (bc)
|
||||
xor e
|
||||
and d
|
||||
xor e ; E is masked with D
|
||||
ld (bc), a
|
||||
|
||||
afxFrame5:
|
||||
ld c, (ix+2) ; Increase the time counter
|
||||
ld b, (ix+3)
|
||||
inc bc
|
||||
|
||||
afxFrame6:
|
||||
ld (ix+2), c
|
||||
ld (ix+3), b
|
||||
|
||||
ld (ix+0), l ; Save the changed address
|
||||
ld (ix+1), h
|
||||
|
||||
call CheckRelease
|
||||
afxFrame7:
|
||||
ld bc, 8 ; Go to the next channel
|
||||
add ix, bc
|
||||
pop bc
|
||||
djnz afxFrame0
|
||||
|
||||
ld hl, $ffbf ; Output the value of noise and mixer
|
||||
afxNseMix:
|
||||
ld de, 0 ; +1(E)=noise, +2(D)=mixer
|
||||
ld a, 6
|
||||
ld b, h
|
||||
out (c), a
|
||||
ld b, l
|
||||
out (c), e
|
||||
inc a
|
||||
ld b, h
|
||||
out (c), a
|
||||
ld b, l
|
||||
out (c), d
|
||||
ret
|
||||
CheckRelease:
|
||||
ld a, (ix+6) ; get release LSB
|
||||
cp l
|
||||
ret nz ; Carry on if no MLB match
|
||||
ld a, (ix+7) ; get release MSB
|
||||
or a
|
||||
ret z ; Carry on if release disabled
|
||||
cp h
|
||||
ret nz ; Carry on if no MSB match
|
||||
push bc
|
||||
ld a, (ix+4)
|
||||
or a
|
||||
jp z, NoLoop
|
||||
ld a, (ix+5) ; Set CurrentAddrCh[N] back
|
||||
ld (ix+1), a ; to SustainAddrCh[N] LSB
|
||||
ld a, (ix+4) ;
|
||||
ld (ix+0), a ; and MSB
|
||||
xor a
|
||||
ld (ix+4), a ; then toggle off the sustain
|
||||
ld (ix+5), a ; to require it to be resent
|
||||
NoLoop:
|
||||
pop bc
|
||||
ret
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Launch the effect on a specific channel. Any sound currently ;
|
||||
; playing on that channel is terminated next frame. ;
|
||||
; ;
|
||||
; Input: A = Effect number 0..255 ;
|
||||
; E = Channel (A=0, B=1, C=2) ;
|
||||
; --------------------------------------------------------------;
|
||||
AFXPlayChannel:
|
||||
ld bc, $0000
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Launch the effect on a specific channel. Any sound currently ;
|
||||
; playing on that channel is terminated next frame. ;
|
||||
; During playback, when reaching ReleaseAddrCh[N], if an ;
|
||||
; AFXSustain call has been received since this AFXPlayLooped ;
|
||||
; returned, the playback time frame will loop back to ;
|
||||
; SustainAddrCh[N]. ;
|
||||
; ;
|
||||
; Input: A = Effect number 0..255 ;
|
||||
; E = Channel (A=0, B=1, C=2) ;
|
||||
; BC = ReleaseAddrCh[N] ;
|
||||
; --------------------------------------------------------------;
|
||||
AFXPlayLooped:
|
||||
push af
|
||||
ld a, c
|
||||
ld (ReleaseLoSMC), a ; SMC>
|
||||
ld a, b
|
||||
ld (ReleaseHiSMC), a ; SMC>
|
||||
ld a, e
|
||||
add a, a
|
||||
add a, a
|
||||
add a, a
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld ix, afxChDesc
|
||||
add ix, de
|
||||
ld e, 3
|
||||
add ix, de
|
||||
pop af
|
||||
ld de, 0 ; In DE the longest time in search
|
||||
ld h, e
|
||||
ld l, a
|
||||
add hl, hl
|
||||
afxBnkAdr2:
|
||||
ld bc, 0 ; Address of the effect offsets table
|
||||
add hl, bc
|
||||
ld c, (hl)
|
||||
inc hl
|
||||
ld b, (hl)
|
||||
add hl, bc ; The effect address is obtained in hl
|
||||
push hl ; Save the effect address on the stack
|
||||
jp DoPlay
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Launch the effect on a free channel. If no free channels, ;
|
||||
; the longest sounding is selected. ;
|
||||
; ;
|
||||
; Input: A = Effect number 0..255 ;
|
||||
; --------------------------------------------------------------;
|
||||
AFXPlay:
|
||||
push af
|
||||
ld a, c
|
||||
ld (ReleaseLoSMC), a ; SMC>
|
||||
ld a, b
|
||||
ld (ReleaseHiSMC), a ; SMC>
|
||||
pop af
|
||||
ld de, 0 ; In DE the longest time in search
|
||||
ld h, e
|
||||
ld l, a
|
||||
add hl, hl
|
||||
afxBnkAdr1:
|
||||
ld bc, 0 ; Address of the effect offsets table
|
||||
add hl, bc
|
||||
ld c, (hl)
|
||||
inc hl
|
||||
ld b, (hl)
|
||||
add hl, bc ; The effect address is obtained in hl
|
||||
push hl ; Save the effect address on the stack
|
||||
ld hl, afxChDesc ; Empty channel search
|
||||
ld b, 3
|
||||
afxPlay0:
|
||||
inc hl
|
||||
inc hl
|
||||
ld a, (hl) ; Compare the channel time with the largest
|
||||
inc hl
|
||||
cp e
|
||||
jr c, afxPlay1
|
||||
ld c, a
|
||||
ld a, (hl)
|
||||
cp d
|
||||
jr c, afxPlay1
|
||||
ld e, c ; Remember the longest time
|
||||
ld d, a
|
||||
push hl ; Remember the channel address+3 in IX
|
||||
pop ix
|
||||
afxPlay1:
|
||||
ld a, 5
|
||||
add a, l ; Add(hl, a) }
|
||||
ld l, a ; }
|
||||
adc a, h ; }
|
||||
sub l ; }
|
||||
ld h, a ; }
|
||||
djnz afxPlay0
|
||||
DoPlay:
|
||||
pop de ; Take the effect address from the stack
|
||||
ld (ix-3), e ; Put in the channel descriptor
|
||||
ld (ix-2), d
|
||||
ld (ix-1), b ; Zero the playing time
|
||||
ld (ix-0), b
|
||||
ReleaseLoSMC equ $+3
|
||||
ld (ix+3), AFXSMC ; <SMC Release LSB
|
||||
ReleaseHiSMC equ $+3
|
||||
ld (ix+4), AFXSMC ; <SMC Release MSB
|
||||
xor a
|
||||
ld (ix+1), a ; Reset sustain LSB
|
||||
ld (ix+2), a ; Reset sustain MSB
|
||||
ret
|
||||
|
||||
; --------------------------------------------------------------;
|
||||
; Notify AFX.Frame that the sound in channel E should be looped ;
|
||||
; back to SustainAddrCh[N] once ReleaseAddrCh[N] has been ;
|
||||
; reached,provided playback was started with AFX.PlayLooped ;
|
||||
; ;
|
||||
; Input: E = Channel (A=0, B=1, C=2) ;
|
||||
; BC = SustainAddrCh[N] ;
|
||||
; --------------------------------------------------------------;
|
||||
AFXSustain:
|
||||
ld a, e
|
||||
add a, a
|
||||
add a, a
|
||||
add a, a
|
||||
ld e, 4
|
||||
add a, e
|
||||
ld hl, afxChDesc
|
||||
add a, l ; Add(hl, a) }
|
||||
ld l, a ; }
|
||||
adc a, h ; }
|
||||
sub l ; }
|
||||
ld h, a ; }
|
||||
ld (hl), c
|
||||
inc hl
|
||||
ld (hl), b
|
||||
ret
|
||||
@ -50,16 +50,16 @@
|
||||
"TypDelay", -- DEFINES.INC --> UnusedSettingsFeatures
|
||||
},
|
||||
[2]={
|
||||
"LoadZXroms", -- 1
|
||||
"QS_SetUpHardware", -- 2
|
||||
"QS_SetUpZxRom", -- 3
|
||||
"TrDosA", -- 4
|
||||
"TrDosB", -- 5
|
||||
"TrDosC", -- 6
|
||||
"TrDosD", -- 7
|
||||
"SetTime", -- 8 DEFINES.INC --> NEW_FEATURE
|
||||
--"HddWrPr", -- 9 DEFINES.INC --> HDDwriteProtect
|
||||
-- 10
|
||||
"PlayStartUpSound", -- 1
|
||||
"LoadZXroms", -- 2
|
||||
"QS_SetUpHardware", -- 3
|
||||
"QS_SetUpZxRom", -- 4
|
||||
"TrDosA", -- 5
|
||||
"TrDosB", -- 6
|
||||
"TrDosC", -- 7
|
||||
"TrDosD", -- 8
|
||||
"SetTime", -- 9 DEFINES.INC --> NEW_FEATUREDEFINES.INC --> HDDwriteProtect
|
||||
--"HddWrPr", -- 10 DEFINES.INC --> HDDwriteProtect
|
||||
-- 11
|
||||
-- 12
|
||||
-- 13
|
||||
@ -504,6 +504,15 @@ SettingsItemsTabs:
|
||||
DB msgStrings.valLoadZXromsFlag
|
||||
DB msgStrings.valLoadZXromsCAD
|
||||
|
||||
_mSETitemParams PlayStartUpSound
|
||||
DW OnChangeAction.nothing
|
||||
IF NEW_FEATURE : DB paramLine : ENDIF
|
||||
DB columnNum,lineNum
|
||||
DB paramName
|
||||
DW CMOS_CELL.BootUpParams.Mask.BootSound : DB %0000'0010
|
||||
DB msgStrings.valDisabled
|
||||
DB msgStrings.valEnabled
|
||||
|
||||
IF NEW_FEATURE
|
||||
_mSETitemParams SetTime
|
||||
DW OnChangeAction.SetTime
|
||||
@ -689,6 +698,7 @@ msgStrings:
|
||||
_mSetStr parTrDosB, tmp_Counter : DZ 'TR DOS B:> : '
|
||||
_mSetStr parTrDosC, tmp_Counter : DZ 'TR DOS C:> : '
|
||||
_mSetStr parTrDosD, tmp_Counter : DZ 'TR DOS D:> : '
|
||||
_mSetStr parPlayStartUpSound, tmp_Counter : DZ 'Startup sound : '
|
||||
_mSetStr parLoadZXroms, tmp_Counter : DZ 'Load ZX ROMs : '
|
||||
_mSetStr valLoadZXromsManually, tmp_Counter : DZ 'Manually '
|
||||
_mSetStr valLoadZXromsFlag, tmp_Counter : DZ 'By ZX flag'
|
||||
@ -865,6 +875,7 @@ msgRusStrings:
|
||||
_mSetStrRus parTrDosB, tmp_Counter : DZ 'TR DOS B:> : '
|
||||
_mSetStrRus parTrDosC, tmp_Counter : DZ 'TR DOS C:> : '
|
||||
_mSetStrRus parTrDosD, tmp_Counter : DZ 'TR DOS D:> : '
|
||||
_mSetStrRus parPlayStartUpSound, tmp_Counter : DZ '‘â àâ®¢ë© §¢ãª : '
|
||||
_mSetStrRus parLoadZXroms, tmp_Counter : DZ '‡ £à㦠âì ZX <EFBFBD>‡“ : '
|
||||
_mSetStrRus valLoadZXromsManually, tmp_Counter : DZ '‚àãçãî '
|
||||
_mSetStrRus valLoadZXromsFlag, tmp_Counter : DZ '<EFBFBD>® ä« £ã ZX '
|
||||
|
||||
BIN
src/bios/rom/SETUP/netherworld_8.afx
Executable file
BIN
src/bios/rom/SETUP/netherworld_8.afx
Executable file
Binary file not shown.
@ -4,212 +4,161 @@
|
||||
STARTUP_SOUND: LD HL,.BYTE_POS
|
||||
LD A,(HL)
|
||||
LD C,SP_SND.AY
|
||||
CP .toneDataSize + 1
|
||||
JR C,.play
|
||||
;-- mus off
|
||||
XOR A
|
||||
LD E,A
|
||||
.offLp: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
INC A
|
||||
CP 15
|
||||
JR NZ,.offLp
|
||||
RET
|
||||
;
|
||||
.play: LD DE,#0700+56
|
||||
AND A
|
||||
JR NZ,.no_init
|
||||
;
|
||||
LD DE,7*256 + %0011'1011
|
||||
LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),D
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
CP 33
|
||||
JR NC,.playVol
|
||||
AND 3
|
||||
JR NZ,.playVol
|
||||
;--- play tone
|
||||
;
|
||||
.no_init: CP .volDataSize
|
||||
JR C,.play
|
||||
;-- mus off
|
||||
.mute: XOR A
|
||||
LD E,A
|
||||
.offLp: CALL .set_regs
|
||||
CP 14
|
||||
JR NZ,.offLp
|
||||
;
|
||||
LD A,7
|
||||
DEC E
|
||||
CALL .set_regs
|
||||
RET
|
||||
;
|
||||
.play: ;
|
||||
;--- set tone
|
||||
LD HL,(.WORD_TONE)
|
||||
;A=0
|
||||
LD A,4 ;REG C
|
||||
.playToneLp: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,high SP_SND.AY.DATA
|
||||
LD B,high SP_SND.AY.DATA + 1
|
||||
OUTI
|
||||
INC A
|
||||
CP 6
|
||||
JR NZ,.playToneLp
|
||||
;
|
||||
LD (.WORD_TONE),HL
|
||||
;--- set volume
|
||||
.playVol: LD HL,(.WORD_VOL)
|
||||
LD A,8
|
||||
LD A,10
|
||||
LD E,(HL)
|
||||
INC HL
|
||||
.playVolLp: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
INC A
|
||||
CP 11
|
||||
JR NZ,.playVolLp
|
||||
.playVolLp: CALL .set_regs
|
||||
;
|
||||
LD (.WORD_VOL),HL
|
||||
LD HL,.BYTE_POS
|
||||
INC (HL)
|
||||
RET
|
||||
; ;
|
||||
.set_regs: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
INC A
|
||||
RET
|
||||
;-----------------------------------------------------------------------
|
||||
.BYTE_POS: DB 0
|
||||
.WORD_VOL: DW .volData
|
||||
.WORD_TONE: DW .toneData
|
||||
;-----------------------------------------------------------------------
|
||||
.volData: ;DB 11,10,08,06,08,07,06,05
|
||||
;DB 12,11,09,07,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 12,12,10,08,07,06,05,04
|
||||
DB 07,06,05,04,03,02,01,00
|
||||
DB 05,04,03,02,01,00,00,00
|
||||
DB 04,03,02,02,01,00,00,00
|
||||
DB 02,02,01,01,00,00,00,00
|
||||
|
||||
.toneData: DB 68,3,136,6,162,1
|
||||
DB 136,6,136,6,68,3
|
||||
DB 57,1,229,4,114,2
|
||||
;DB 68,3,229,4,162,1
|
||||
;DB 46,2,92,4,23,1
|
||||
;DB 57,1,92,4,114,2
|
||||
;DB 209,0,68,3,162,1
|
||||
;DB 46,2,68,3,23,1
|
||||
;DB 209,0,68,3,162,1
|
||||
.toneDataSize EQU $ - .toneData
|
||||
.toneData: DW #022, #044, #088, #110, #220, #440
|
||||
DW #880, #440, #220, #110, #088, #044
|
||||
DW #022, #044, #088, #110, #220, #440
|
||||
DW #880, #440, #220, #110, #088, #044
|
||||
DW #022
|
||||
.volData: DB #02, #04, #06, #08, #0A, #0C
|
||||
DB #0E, #0D, #0C, #0B, #0A, #09
|
||||
DB #08, #07, #06, #05, #04, #03
|
||||
DB #02, #06, #08, #0A, #0C, #0E
|
||||
DB #0F
|
||||
.volDataSize EQU $ - .volData
|
||||
|
||||
.codeEnd: DISPLAY "StartUp Sound size: ",/A,.codeEnd - STARTUP_SOUND
|
||||
|
||||
; savesna "startup_sound.sna", #8000
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
MODULE STARTUP_SOUND
|
||||
DEFINE SND_VARIANT 2 ; 0, 1, 2
|
||||
|
||||
IF SND_VARIANT == 0
|
||||
DEFINE SND_Const1 15
|
||||
DEFINE SND_Const2 7
|
||||
; CODE BY €«¥ªá ¤à -=TmK deMarche=-
|
||||
; play frame
|
||||
; use: af,hl,de,bc 251
|
||||
STARTUP_SOUND: LD HL,.BYTE_POS
|
||||
LD A,(HL)
|
||||
LD C,SP_SND.AY
|
||||
;
|
||||
ELSEIF SND_VARIANT == 1
|
||||
DEFINE SND_Const1 15
|
||||
DEFINE SND_Const2 7
|
||||
AND A
|
||||
JR NZ,.no_init
|
||||
;
|
||||
ELSEIF SND_VARIANT == 2
|
||||
DEFINE SND_Const1 14
|
||||
DEFINE SND_Const2 6
|
||||
ENDIF
|
||||
|
||||
codeBegin: LD A,SND_Const1
|
||||
LD HL,.volData
|
||||
LD DE,.sndData
|
||||
.lp: CALL .snd
|
||||
CALL .vol
|
||||
CALL .vol
|
||||
CALL .vol
|
||||
DEC A
|
||||
JP NZ,.lp
|
||||
;--
|
||||
LD DE,#07ff
|
||||
LD B,E
|
||||
LD DE,7*256 + %0011'1011
|
||||
LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),D
|
||||
LD B,#bf
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
RET
|
||||
;----------------
|
||||
.snd: CALL .vol
|
||||
CP SND_Const2
|
||||
RET C
|
||||
;
|
||||
.sndEnd: EX AF,AF
|
||||
EX DE,HL
|
||||
PUSH DE
|
||||
XOR A
|
||||
.sndLp: LD B,#ff
|
||||
.no_init: CP .volDataSize
|
||||
JR C,.play
|
||||
;-- mus off
|
||||
.mute: XOR A
|
||||
LD E,A
|
||||
.offLp: CALL .set_regs
|
||||
CP 14
|
||||
JR NZ,.offLp
|
||||
;
|
||||
LD A,7
|
||||
DEC E
|
||||
CALL .set_regs
|
||||
RET
|
||||
;
|
||||
.play: ;
|
||||
;--- set tone
|
||||
LD HL,(.WORD_TONE)
|
||||
;A=0
|
||||
LD A,4 ;REG C
|
||||
.playToneLp: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,#bf
|
||||
LD B,high SP_SND.AY.DATA + 1
|
||||
OUTI
|
||||
INC A
|
||||
CP 6
|
||||
JR NZ,.sndLp
|
||||
POP DE
|
||||
EX DE,HL
|
||||
EX AF,AF
|
||||
RET
|
||||
;----------------
|
||||
.vol: ;EI
|
||||
;HALT
|
||||
EX AF,AF
|
||||
PUSH DE
|
||||
LD BC,#fffd
|
||||
LD DE,#0700+56
|
||||
OUT (C),D
|
||||
LD B,#bf
|
||||
OUT (C),E
|
||||
LD A,8
|
||||
JR NZ,.playToneLp
|
||||
;
|
||||
LD (.WORD_TONE),HL
|
||||
;--- set volume
|
||||
.playVol: LD HL,(.WORD_VOL)
|
||||
LD A,10
|
||||
LD E,(HL)
|
||||
INC HL
|
||||
.volLp: LD B,#ff
|
||||
.playVolLp: CALL .set_regs
|
||||
;
|
||||
LD (.WORD_VOL),HL
|
||||
LD HL,.BYTE_POS
|
||||
INC (HL)
|
||||
RET
|
||||
; ;
|
||||
.set_regs: LD B,high SP_SND.AY.CTRL
|
||||
OUT (C),A
|
||||
LD B,#bf
|
||||
LD B,high SP_SND.AY.DATA
|
||||
OUT (C),E
|
||||
INC A
|
||||
CP 11
|
||||
JR NZ,.volLp
|
||||
POP DE
|
||||
EX AF,AF
|
||||
RET
|
||||
;----------------
|
||||
.volData:
|
||||
IF SND_VARIANT == 0
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 12,12,10,08,07,06,05,04
|
||||
DB 07,06,05,04,03,02,01,00
|
||||
DB 05,04,03,02,01,00,00,00
|
||||
DB 04,03,02,02,01,00,00,00
|
||||
DB 02,02,01,01,00,00,00,00
|
||||
;
|
||||
ELSEIF SND_VARIANT == 1
|
||||
DB 11,10,08,06,08,07,06,05
|
||||
DB 12,11,09,07,09,08,07,06
|
||||
DB 13,12,10,08,09,08,07,06
|
||||
DB 13,12,10,08,07,06,05,04
|
||||
DB 08,07,06,05,04,03,02,01
|
||||
DB 06,05,04,03,02,01,00,00
|
||||
DB 04,04,03,02,01,00,00,00
|
||||
DB 02,02,01,01,00,00,00,00
|
||||
;
|
||||
ELSEIF SND_VARIANT == 2
|
||||
DB 15,14,13,10,10,09,09,07
|
||||
DB 15,14,13,10,10,09,09,07
|
||||
DB 15,14,13,10,10,09,09,07
|
||||
DB 15,14,13,10,07,06,05,04
|
||||
DB 08,07,06,05,04,03,02,01
|
||||
DB 06,05,04,03,02,01,00,00
|
||||
DB 04,03,02,01,00,00,00,00
|
||||
ENDIF
|
||||
;-----------------------------------------------------------------------
|
||||
.BYTE_POS: DB 0
|
||||
.WORD_VOL: DW .volData
|
||||
.WORD_TONE: DW .toneData
|
||||
;-----------------------------------------------------------------------
|
||||
.toneData: DW #022, #044, #088, #110, #220, #440
|
||||
DW #880, #440, #220, #110, #088, #044
|
||||
DW #022, #044, #088, #110, #220, #440
|
||||
DW #880, #440, #220, #110, #088, #044
|
||||
DW #022
|
||||
.volData: DB #02, #04, #06, #08, #0A, #0C
|
||||
DB #0E, #0D, #0C, #0B, #0A, #09
|
||||
DB #08, #07, #06, #05, #04, #03
|
||||
DB #02, #06, #08, #0A, #0C, #0E
|
||||
DB #0F
|
||||
.volDataSize EQU $ - .volData
|
||||
|
||||
|
||||
.sndData: DB 68,3,136,6,162,1
|
||||
DB 136,6,136,6,68,3
|
||||
DB 57,1,229,4,114,2
|
||||
DB 68,3,229,4,162,1
|
||||
DB 46,2,92,4,23,1
|
||||
DB 57,1,92,4,114,2
|
||||
DB 209,0,68,3,162,1
|
||||
DB 46,2,68,3,23,1
|
||||
DB 209,0,68,3,162,1
|
||||
|
||||
codeEnd: DISPLAY "StartUp Sound size: ",/A,codeEnd-codeBegin
|
||||
|
||||
ENDMODULE
|
||||
.codeEnd: DISPLAY "StartUp Sound size: ",/A,.codeEnd - STARTUP_SOUND
|
||||
*/
|
||||
Loading…
Reference in New Issue
Block a user