📄 lyricdeal.lst
字号:
################################################################################
# #
# IAR Systems Z80/64180 Assembler V3.03A/WIN 22/Sep/107 14:12:36 #
# #
# Target option = z80 #
# Source file = d:\sdk_i_913f\msrc\enhanced\lyricdeal.msa #
# List file = d:\sdk_i_913f\iar\mod\modules\list\lyricdeal.lst #
# Object file = d:\sdk_i_913f\lib\lyricdeal.r01 #
# Command line = -v0 -OD:\sdk_i_913f\lib\ -s+ -M<> -w+ -r #
# -DNAPDEBUG -LD:\sdk_i_913f\iar\mod\modules\List\ #
# -t8 -x -Id:\sdk_i_913f\inc\ #
# -Id:\sdk_i_913f\msrc\codec\ #
# d:\sdk_i_913f\MSRC\ENHANCED\lyricdeal.msa #
# #
# (c) Copyright IAR Systems 1996 #
################################################################################
1 000000 /*
2 000000 ****************************************************
***************************
3 000000 * lyric deal functions
4 000000 * enhanced module impletementation
5 000000 *
6 000000 * Sorting lyric time table, Divide lyr
ic page in content table, then save
time table into VRam
7 000000 *
8 000000 * (c) Copyright, Actions Co,Ld.
9 000000 * All Right Reserved
10 000000 *
11 000000 ****************************************************
***************************
12 000000 */
13 000000
14 000000 #include "ReadLyricFile.h"
15 000000 #include "mem.h"
16 000000
17 000000 // #include "filesys.h"
18 000000 // #include "debug.h"
19 000000 // #include "process.h"
20 000000
21 000000 name dealLyric
22 000000 public Sort_Div_Save
23 000000 // public SortLyricData
24 000000 // public LyricDivScreen
25 000000 // public SaveLyricInVRAM
26 000000
27 000000 extern LyricTimeAddrBuffer
28 000000 extern TimeRecordCounter
29 000000 extern TempRam
30 000000 extern SaveTheStartDivAddr
31 000000 extern DivScreenCounter
32 000000 extern DivScreenTimeTemp
33 000000 extern LyricStrBuffer
34 000000 extern DataBuffer
35 000000 extern OldExSramPage
36 000000 extern lyricPageMode
37 000000 extern lyricFileName
38 000000 extern NoLyricFileFlag
39 000000 extern lyricPageModeBak
40 000000 extern lyricFileNameBak
41 000000 extern ClearWD
42 000000 extern AddOffsetData//void AddOffsetData(LrcTime_t
*timetab, BYTE recordCNT)
43 000000
44 000000 RSEG MO_EHB_LRC
45 000000
46 000000 // 执行排序,分屏,存储歌词的主程序
47 000000 Sort_Div_Save:
48 000000 CD.... call LWRD HandleID3Overlap
49 000003 CD.... call LWRD HandleLastLyric
50 000006 CD.... call LWRD ClearWD
51 000009 CD.... call LWRD SortLyricData
52 00000C CD.... call LWRD ClearWD
53 00000F CD.... call LWRD LyricDivScreen
54 000012
55 000012 11.... ld de,LyricTimeAddrBuffer
56 000015 21.... ld hl,lwrd TimeRecordCounter
57 000018 4E ld c,(hl)
58 000019 CD.... call LWRD AddOffsetData
59 00001C
60 00001C CD.... call LWRD SaveLyricInVRAM
61 00001F C9 ret
62 000020
63 000020 //处理 ID3 与 lyric 在第一秒内覆盖的问题.
64 000020 HandleID3Overlap
65 000020 DD21.... ld IX, LyricTimeAddrBuffer + 5
66 000024
67 000024 060A ld B, 10
68 000026 _seek_lyric_loop:
69 000026 DD7E02 ld A, (IX+2)
70 000029 E6F0 and 0f0h
71 00002B 2808 jr z, _find_lyric
72 00002D 110500 ld DE, TIME_RECORD_SIZE
73 000030 DD19 add IX, DE
74 000032 10F2 djnz _seek_lyric_loop
75 000034 C9 ret
76 000035
77 000035 _find_lyric:
78 000035 060A ld B, 10
79 000037 _fix_lyric_loop:
80 000037 DD7E01 ld A, (IX+1)
81 00003A B7 or A
82 00003B 200C jr nz, _need_not_fix
83 00003D 3E01 ld A, 1
84 00003F DD7701 ld (IX+1), A //都将秒钟设为1
85 000042 110500 ld DE, TIME_RECORD_SIZE
86 000045 DD19 add IX, DE
87 000047 10EE djnz _fix_lyric_loop
88 000049
89 000049 _need_not_fix:
90 000049 C9 ret
91 00004A
92 00004A //处理最后行歌词分屏间隔太小的问题
93 00004A HandleLastLyric
94 00004A
95 00004A // (TimeRecordCounter+2)*5 is the size of time t
able
96 00004A 2A.... ld HL, (LWRD TimeRecordCounter)
97 00004D 2600 ld H, 0
98 00004F E5 push HL
99 000050 B7 or A
100 000051 CB15 rl L
101 000053 CB14 rl H
102 000055 B7 or A
103 000056 CB15 rl L
104 000058 CB14 rl H
105 00005A D1 pop DE
106 00005B 19 add HL, DE
107 00005C EB ex DE, HL
108 00005D DD21.... ld IX, LyricTimeAddrBuffer
109 000061 DD19 add IX, DE
110 000063
111 000063 // seek to page one of last lyric line
112 000063 0602 ld B, 2
113 000065 DD7E02 ld A, (IX+2)
114 000068 E6F0 and 0f0h
115 00006A 2809 jr z, _skip_inc_second1
116 00006C 78 ld A, B
117 00006D DD8601 add A, (IX+1)
118 000070 DD7701 ld (IX+1), A
119 000073 04 inc B
120 000074 04 inc B
121 000075 _skip_inc_second1:
122 000075
123 000075 DD7E07 ld A, (IX+7)
124 000078 FEAA cp 0aah
125 00007A 280B jr z, _direct_ret
126 00007C E6F0 and 0f0h
127 00007E 2807 jr z, _direct_ret
128 000080 78 ld A, B
129 000081 DD8606 add A, (IX+6)
130 000084 DD7706 ld (IX+6), A
131 000087 _direct_ret:
132 000087
133 000087 C9 ret
134 000088
135 000088
136 000088 //>>>>>>>>>>>>> 下面开始排序数据 >>>>>>>>>>>>>>>>>>
137 000088 SortLyricData:
138 000088 3A.... ld a,(LWRD TimeRecordCounter)
//读出时间记录计数器的值
139 00008B 4F ld c,a
140 00008C OutLoopForCompData:
141 00008C DD21.... ld ix,LyricTimeAddrBuffer
142 000090 3A.... ld a,(LWRD TimeRecordCounter)
//读出时间记录计数器的值
143 000093 47 ld b,a
144 000094 LoopForCompData:
145 000094 DD6600 ld h,(ix+0) //
146 000097 DD6E01 ld l,(ix+1) //读
入数据准备比较
147 00009A DD5605 ld d,(ix+5+0) //
148 00009D DD5E06 ld e,(ix+5+1) //
149 0000A0 B7 or a //
150 0000A1 ED52 sbc hl,de //比
较数据
151 0000A3 3846 jr c,NotExchangeData //
152 0000A5
153 0000A5 2008 jr nz,MustExchangeData //
154 0000A7 DD7E02 ld a,(ix+2) //当
分秒相等时比较毫秒值
155 0000AA DD9607 sub (ix+5+2) //
156 0000AD 383C jr c,NotExchangeData //
157 0000AF MustExchangeData:
158 0000AF DD5605 ld d,(ix+5+0) //
159 0000B2 DD5E06 ld e,(ix+5+1) //
160 0000B5 DD6600 ld h,(ix+0) //
161 0000B8 DD6E01 ld l,(ix+1) //
162 0000BB DD7405 ld (ix+5+0),h //
163 0000BE DD7506 ld (ix+5+1),l //
164 0000C1 DD7200 ld (ix+0),d //
165 0000C4 DD7301 ld (ix+1),e //
166 0000C7 //交
换数据
167 0000C7 DD5607 ld d,(ix+5+2) //
168 0000CA DD5E08 ld e,(ix+5+3) //
169 0000CD DD6602 ld h,(ix+2) //
170 0000D0 DD6E03 ld l,(ix+3) //
171 0000D3 DD7407 ld (ix+5+2),h //
172 0000D6 DD7508 ld (ix+5+3),l //
173 0000D9 DD7202 ld (ix+2),d //
174 0000DC DD7303 ld (ix+3),e //
175 0000DF //
176 0000DF DD5609 ld d,(ix+5+4) //
177 0000E2 DD6604 ld h,(ix+4) //
178 0000E5 DD7409 ld (ix+5+4),h //
179 0000E8 DD7204 ld (ix+4),d //
180 0000EB NotExchangeData:
181 0000EB 110500 ld de,05h
182 0000EE DD19 add ix,de
183 0000F0 10A2 djnz LoopForCompData
184 0000F2 0D dec c
185 0000F3 2097 jr nz,OutLoopForCompData
186 0000F5
187 0000F5 C9 ret
188 0000F6 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>
189 0000F6
190 0000F6
191 0000F6
192 0000F6
193 0000F6 //>>>>>>>>>>>>>>>>下面是处理分屏的情况>>>>>>>>>>>>>>
>
194 0000F6 LyricDivScreen:
195 0000F6 3A.... ld a,(LWRD TimeRecordCounter)
//读出时间记录计数器的值
196 0000F9 //ryan 当前时间记录条数是比实际条数少一,应不需要应再
减 dec a
197 0000F9 3C inc a //ry
an
198 0000FA // ld b,a //03
-10-3 11:45
199 0000FA 32.... ld (LWRD TempRam),a
//用来计数时间记录
的条数
200 0000FD
201 0000FD DD21.... ld ix,LyricTimeAddrBuffer //
歌词时间表首址
202 000101 LoopForFindDivScreen:
203 000101 CD.... call LWRD ClearWD
204 000104 3A.... ld a,(LWRD TempRam)
//读出时间记录计数器的值
205 000107 3D dec a
206 000108 32.... ld (LWRD TempRam),a
//计数器减一
207 00010B
208 00010B CA.... jp z,LWRD DivScreen_Ret
//如已读完所有时间记录就出
209 00010E
210 00010E DDE5 push ix //
211 000110
212 000110 DD22.... ld (LWRD SaveTheStartDivAddr),ix
//记住
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -