TRACKERS MB SRC JP 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	;->ソング中ではたった200。
xleng	equ xpos+200	;->最後のポジション
xuser1	equ xleng+1	;->ユーザーコード#1
xmmvoc	equ xuser1+2	;->モジュール楽器。
xmmsti	equ xmmvoc+16*9	;->楽器モジュール。
xpasti	equ xmmsti+16	;->楽器/ボリュームパック
xstpr	equ xpasti+32	;->ステレオ設定
xtempo	equ xstpr+10	;->開始テンポ。
xsust	equ xtempo+1	;->モジュレーションデプス。
xnaam	equ xsust+1	;->曲名
xchip	equ xnaam+40	;->優先チップ
xbegvm	equ xchip+1	;->開始時の楽器モジュール。
xbegvp	equ xbegvm+9	;->開始時の楽器パック。
xorgp1	equ xbegvp+9	;->ソフトウェアのボイスからのデータパック。
xorgnr	equ xorgp1+6*8	;->ソフトウェアのボイスの数。
xsmpkt	equ xorgnr+6	;->サンプルキット名
xdrblk	equ xsmpkt+8	;->パックドラムブロック。
xdrvol	equ xdrblk+15	;->ボリュームドラムパック。
xdrfrq	equ xdrvol+3	;->周波数ドラムパック。
xuser2	equ xdrfrq+3*6	;->ユーザーコード#2(= 1は他のコードと一緒に)
xrever	equ xuser2+2	;->リバーブ設定
xloop	equ xrever+9	;->ループポジション

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	;ファイルをオープンする
	ld	hl,1
	ld	(groot),hl	;ブロックサイズ = 1
	dec	hl
	ld	(blok),hl
	ld	(blok+2),hl	;ブロック番号 = 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		      ;ファイルを読む
	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