Browse Source

Merge pull request #278 from b1ackmai1er/dev

VGMPLAY Updates
pull/283/head
Wayne Warthen 4 years ago
committed by GitHub
parent
commit
9e3787b0a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 47
      Source/Apps/VGM/VGMPLAY.ASM

47
Source/Apps/VGM/VGMPLAY.ASM

@ -5,7 +5,8 @@
; ;
; Enhanced with multi-chip support by Marco Maccaferri ; Enhanced with multi-chip support by Marco Maccaferri
; ;
; YM2162/YM3484, GD3 support, VGM Chip identification added by Phil Summers
; YM2162/YM3484, GD3 support, VGM Chip identification,
; default file type, basic file size checking added by Phil Summers
; ;
; Compile with: ; Compile with:
; ;
@ -79,6 +80,7 @@ BDOS .EQU 0005H ; bdos entry point
FCB .EQU 005CH ; file control block FCB .EQU 005CH ; file control block
FCBCR .EQU FCB + 20H ; fcb current record FCBCR .EQU FCB + 20H ; fcb current record
BUFF .EQU 0080H ; DMA buffer BUFF .EQU 0080H ; DMA buffer
TOPM .EQU 0002H ; Top of memory
PRINTF .EQU 9 ; BDOS print string function PRINTF .EQU 9 ; BDOS print string function
OPENF .EQU 15 ; BDOS open file function OPENF .EQU 15 ; BDOS open file function
@ -97,17 +99,37 @@ EOS .EQU '$' ; end of string marker
LD DE,MSG_WELC ; Welcome Message LD DE,MSG_WELC ; Welcome Message
CALL PRTSTR CALL PRTSTR
LD C,OPENF
LD A,(FCB+1) ; Get first char of filename
CP ' ' ; Compare to blank
JP Z,ERR ; If so, missing filename
LD A,(FCB+9) ; If the filetype
CP ' ' ; is blanks
JR NZ,HASEXT ; then assume
LD A,'V' ; type VGM.
LD (FCB+9),A
LD A,'G' ; Fill in
LD (FCB+10),A ; the file
LD A,'M' ; extension
LD (FCB+11),A
HASEXT: LD C,OPENF ; Open File
LD DE,FCB LD DE,FCB
CALL BDOS CALL BDOS
INC A INC A
JP Z, ERR
JP Z,ERR
XOR A ; Read VGM file into memory XOR A ; Read VGM file into memory
LD (FCBCR), A LD (FCBCR), A
LD DE, VGMDATA LD DE, VGMDATA
LD (VGMPOS), DE LD (VGMPOS), DE
RLOOP LD C, READF
RLOOP
; LD A,(TOPM) ; CBIOS start
; SUB 10h ; Less BDOS = Top Memory Page
LD A,$D6 ; Hardcoded top of memory
CP D
LD DE,MSG_MEM
JP Z,EXIT_ERR ; Exit top of memory reached
LD C, READF
LD DE, FCB LD DE, FCB
CALL BDOS CALL BDOS
OR A OR A
@ -251,11 +273,13 @@ EXIT
AND %00000011 AND %00000011
srl a srl a
ADC A,'0' ADC A,'0'
CP '0'
JR Z,NOSN
CALL PRTCHR CALL PRTCHR
LD DE,MSG_SN LD DE,MSG_SN
CALL PRTSTR CALL PRTSTR
POP AF
NOSN: POP AF
srl a srl a
srl a srl a
PUSH AF PUSH AF
@ -263,11 +287,13 @@ EXIT
AND %00000011 AND %00000011
srl a srl a
ADC A,'0' ADC A,'0'
CP '0'
JR Z,NOAY
CALL PRTCHR CALL PRTCHR
LD DE,MSG_AY LD DE,MSG_AY
CALL PRTSTR CALL PRTSTR
POP AF
NOAY: POP AF
srl a srl a
srl a srl a
PUSH AF PUSH AF
@ -275,11 +301,13 @@ EXIT
AND %00000011 AND %00000011
srl a srl a
ADC A,'0' ADC A,'0'
CP '0'
JR Z,NOYM
CALL PRTCHR CALL PRTCHR
LD DE,MSG_YM LD DE,MSG_YM
CALL PRTSTR CALL PRTSTR
LD A, 9FH ; Mute all channels on psg
NOYM: LD A, 9FH ; Mute all channels on psg
OUT (PSGREG), A OUT (PSGREG), A
OUT (PSG2REG), A OUT (PSG2REG), A
LD A, 0BFH LD A, 0BFH
@ -335,7 +363,8 @@ ERR LD C, PRINTF
CALL BDOS CALL BDOS
RST 00H RST 00H
NOFILE .DB "File not found", CR, LF, EOS
NOFILE .DB "File not found", CR, LF, EOS
MSG_MEM .DB "File to big", CR, LF, EOS
MSG_EXIT .DB "FINISHED.",CR,LF,0 MSG_EXIT .DB "FINISHED.",CR,LF,0
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -497,7 +526,7 @@ FASTIO:
#INCLUDE "printing.inc" #INCLUDE "printing.inc"
MSG_WELC: .DB "VGM Player for RomWBW v0.1, 8-Nov-2021",CR,LF
MSG_WELC: .DB "VGM Player for RomWBW v0.2, 27-Nov-2021",CR,LF
; .DB "J.B. Langston/Marco Maccaferri/Phil Summers",CR,LF ; .DB "J.B. Langston/Marco Maccaferri/Phil Summers",CR,LF
.DB 0 .DB 0
MSG_BADF: .DB "Not a VGM file",CR,LF,0 MSG_BADF: .DB "Not a VGM file",CR,LF,0

Loading…
Cancel
Save