/
FMPAC_Memo.txt
94 lines (82 loc) · 1.8 KB
/
FMPAC_Memo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
■ FMPACのバンク選択
レジスタ: 7FF7h
http://bifi.msxnet.org/msxnet/utils/saverom
SAVEROM FMPAC.ROM⏎
Select Type: Custom
Switch Address: 7FF7
Save Address: 4000
Block Size: 4000
First Block: 0
Last Block: 3
■ FMPACの曲データ
RAM 0CBF4H(環境による)へ転送して再生される
(ROMイメージ先頭から)
$8080 曲データアドレスリスト
(2byte*5)
$408A 1曲目
$478C 2曲目
$590E 3曲目
$5B90 4曲目
$6612 5曲目
$808A 1曲目 サイズ $0700 ($808A),データ($808C-$878B)
$878C 2曲目 サイズ $1180 ($878C),データ($878E-$990D)
$990E 3曲目 サイズ $0280 ($990E),データ($9910-$9B8F)
$9B90 4曲目 サイズ $0A80 ($9B90),データ($9B92-$A611)
$A612 5曲目 サイズ $0580 ($A612),データ($A614-$AB93)
■ カートリッジからデータを取り出すプログラム
https://github.com/uniskie/MSX_MISC_TOOLS/tree/main/OPLDRV_BGM_EXTRACT
■ 曲再生呼び出し処理
(bank 0)
64e6 push af ;a = BGM No.
cp #ff
jp z,#654c
ld hl,#0100
push af ;save af (a = BGM No.)
call #73d3
inc hl
ld a,l
and #fe
ld l,a
ld (#8323),hl ;#d2f8 ?
pop hl ;hl = saved af (h = BGM No.)
ld l,h
ld h,0
add hl,hl
ld bc,#4080 ; data adr. list (2*5)
add hl,bc ;
ld e,2
call #402c ;read hl,(hl) #bank e
ld e,2
ld (#832b),hl ;src adr. #0408a
call #402c ;read hl,(hl) #bank e
ld (#832d),hl ;(src adr.) = size #0700
call #73d3
ld (#8325),hl ;dest adr. #cbf4
ld c,2
push bc
ld hl,(#832d) ;size #0700
ld c,l
ld b,h ;bc = size #0700
ld hl,(#832b) ;src #0408a
inc hl
inc hl
ex de,hl ;hl = src + 2 #0408c
ld hl,(#8325) ;dst #cbf4
652b call #4026
....
4026 jp #4048
....
4048 ld a,(#7ff7) ;a = current bank
ex af,af'
exx
push hl
pop de
push de
push hl
exx
4053 ld (#7ff7),a ;(bank 1)
ex de,hl
4057 ldir
ex af,af'
ld (#7ff7),a ;(bank 0)
ret