TRACKERS MB SRC NL LOADER

From MSX MUSIC WIKI
Jump to: navigation, search
*q-,u+
	db	0feh
	dw	start
	dw	einde
	dw	start
	org	0e000h

sngpag	equ	1
edtpag	equ	2
dskpag	equ	3
em1pag	equ	4
em2pag	equ	5
vocpag	equ	6
smppag	equ	7

xpos	equ 08000h	;->in song maar 200 lang!
xleng	equ xpos+200	;->last position
xuser1	equ xleng+1	;->usercode #1
xmmvoc	equ xuser1+2	;->module instrumenten
xmmsti	equ xmmvoc+16*9	;->instrumenten module
xpasti	equ xmmsti+16	;->instrumenten/volumes pac
xstpr	equ xpasti+32	;->stereo-instellingen
xtempo	equ xstpr+10	;->begintempo
xsust	equ xtempo+1	;->modulation depth
xnaam	equ xsust+1	;->songnaam
xchip	equ xnaam+40	;->voorkeurchip
xbegvm	equ xchip+1	;->begininstrumenten module
xbegvp	equ xbegvm+9	;->begininstrumenten pac
xorgp1	equ xbegvp+9	;->data van softwarevoices pac
xorgnr	equ xorgp1+6*8	;->nummers van software voices
xsmpkt	equ xorgnr+6	;->samplekitnaam
xdrblk	equ xsmpkt+8	;->drumblokken pac
xdrvol	equ xdrblk+15	;->volumes drum pac
xdrfrq	equ xdrvol+3	;->frequenties drum pac
xuser2	equ xdrfrq+3*6	;->usercode#2 (=1 op met andere codering)
xrever	equ xuser2+2	;->reverb instellingen
xloop	equ xrever+9	;->loop position

xbegmd	equ 08240h
ownvdt	equ 0c400h+176*25
smpnr	equ 0f975h
loaded	equ 0f976h
notvcm	equ 0f977h
notvcp	equ 0f977h+9
smpadr	equ notvcp+9
smknam	equ smpadr+56
vcenr	equ smknam+8
fkndat	equ vcenr+1
keybdt	equ fkndat+1
midint	equ keybdt+1	;0=musmod   1=turbo-r   2=vak
usrdat	equ midint+1
us2dat	equ usrdat+2
naudat	equ us2dat+2
scandt	equ naudat+1

subs	equ	0d900h
subs2	equ	0d914h
subs3	equ	0d928h
decdat          equ   0c000h


dosprog	equ	1=0
grpprog	equ	1=0

	include mybios

start:

	xor	a
	ld	(0f3dbh),a	;@ ;key click off
	ld	a,1
	ld	(smpnr),a
	ld	a,1
	ld	(midint),a
	ld	(fkndat),a
	ld	(keybdt),a

	ld	hl,0	;@
	ld	(0f3eah),hl	;@
	ld	a,15	;@
	ld	(0f3e9h),a	;@
	bios	062h	;@

	width 80
	fkeyoff
	ld	a,011110000b
	out	(099h),a
	ld	a,13+128
	out	(099h),a

	ld	a,0100011b
	out	(099h),a
	ld	a,12+128
	out	(099h),a


;	 vdpreg 13,011110000B
;	 vdpreg 12,0100011B

	call	wiscol

	ld	a,2
	ld	de,07006h
	call	change_color
	ld	a,3
	ld	de,05000h
	call	change_color

	ld	a,edtpag
	ld	hl,fil1
	call	load2

	ld	a,vocpag
	ld	hl,fil2
	call	load2

	ld	a,dskpag
	ld	hl,fil3
	call	load2

	ld	a,smppag
	ld	hl,fil4
	call	load2

	ld	a,sngpag
	ld	hl,fil5
	call	load2

	ld	hl,fil8
	call	load

	ld	hl,fil6
	call	load

	ld	hl,fil7
	call	load
	jp	0d93dh


load2:	out	(0feh),a
load:	ld	de,fcbsav+1
	ld	bc,11
	ldir
	ld	de,fcbsav
	bdos	open	;open de file
	ld	hl,1
	ld	(groot),hl	;blokgrootte = 1
	dec	hl
	ld	(blok),hl
	ld	(blok+2),hl	;bloknummer = 0

	ld	de,0f975h
	bdos	setdma
	ld	hl,7
	ld	de,fcbsav
	bdos	read
	ld	de,(0f976h)
	bdos	setdma

	ld	hl,(bleng)
	ld	de,-7
	add	hl,de
	ld	de,fcbsav
	bdos	read		      ;lees file
	ld	de,fcbsav
	bdos	close
	ret

wiscol:	ld	hl,0800h
	ld	bc,256
	xor	a
	bios	016bh
	ret

change_color:	out	(099h),a
	ld	a,090h
	out	(099h),a
	ld	a,d
	out	(09ah),a
	ld	a,e
	out	(09ah),a
                ret

fcbsav:	db	0,"           "
	dw	0
groot:	dw	0
bleng:	dw	0
	db	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
blok:	dw	0
	dw	0

fil1:	db	"MOONBLASCOM"
fil2:	db	"VOICMENUCOM"
fil3:	db	"DISKMENUCOM"
fil4:	db	"SAMPLER COM"
fil5:	db	"EXAMPDATCOM"
fil6:	db	"VOICES  COM"
fil7:	db	"INSTALL COM"
fil8:	db	"DECDAT  COM"



einde:	end