summaryrefslogtreecommitdiff
path: root/apps/codecs/libasap
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-11-05 13:30:58 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-11-05 13:30:58 +0000
commit45bd7e024603ba47207e5cc64c61e4116e8f1261 (patch)
treecf789bb0ce99eb8b153c5445c535ef5c4e4ead62 /apps/codecs/libasap
parent7ec9ceeaaabb75adaa790b41eba6dec020232fa6 (diff)
downloadrockbox-45bd7e024603ba47207e5cc64c61e4116e8f1261.tar.gz
rockbox-45bd7e024603ba47207e5cc64c61e4116e8f1261.zip
Codec lib directories renamed, except for demac.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19018 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libasap')
-rw-r--r--apps/codecs/libasap/CREDITS37
-rw-r--r--apps/codecs/libasap/Makefile44
-rw-r--r--apps/codecs/libasap/README59
-rw-r--r--apps/codecs/libasap/README.rockbox25
-rw-r--r--apps/codecs/libasap/SOURCES3
-rw-r--r--apps/codecs/libasap/acpu.c1262
-rw-r--r--apps/codecs/libasap/apokeysnd.c538
-rw-r--r--apps/codecs/libasap/asap.c2010
-rw-r--r--apps/codecs/libasap/asap.h299
-rw-r--r--apps/codecs/libasap/asap_internal.h93
-rw-r--r--apps/codecs/libasap/players.h947
11 files changed, 5317 insertions, 0 deletions
diff --git a/apps/codecs/libasap/CREDITS b/apps/codecs/libasap/CREDITS
new file mode 100644
index 0000000000..97d41067fe
--- /dev/null
+++ b/apps/codecs/libasap/CREDITS
@@ -0,0 +1,37 @@
1People who have contributed to ASAP
2-----------------------------------
3
4Atari800 Development Team (http://atari800.sourceforge.net)
5* 6502 and POKEY emulation used in 0.x.y versions of ASAP
6
7Zdenek Eisenhammer <pg@pinknet.cz>
8* testing
9
10Piotr Fusik <fox@scene.pl>
11* author and maintainer of ASAP
12
13Maciek Konecki <maciusk1@wp.pl>
14* porting to C#
15
16Marcin Lewandowski <jaskier@atari8.info>
17* 6502 routines for playing CMC, MPT, TMC and TM2
18
19Perry McFarlane <perry_m@fastmail.fm>
20* POKEY reverse-engineering
21
22Kostas Nakos <knakos@gmail.com>
23* compilation for Windows CE
24
25Slawomir Sledz <slaves@scene.pl>
26* testing
27
28Radek Sterba <raster@infos.cz>
29* 6502 routine for playing RMT
30* testing
31
32Lukasz Sychowicz <xray@scene.pl>
33* Windows icons
34* testing
35
36Michal Szpilowski <miker@atari.pl>
37* testing
diff --git a/apps/codecs/libasap/Makefile b/apps/codecs/libasap/Makefile
new file mode 100644
index 0000000000..d20f2393e4
--- /dev/null
+++ b/apps/codecs/libasap/Makefile
@@ -0,0 +1,44 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id: Makefile 13920 2007-07-16 21:16:52Z jethead71 $
8#
9
10INCLUDES=-I$(APPSDIR) -I.. -I../lib -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
12
13ifdef APPEXTRA
14 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
15endif
16
17SPCOPTS = -O -DROCKBOX
18
19CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPCOPTS) $(TARGET) \
20$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1
21
22# This sets up 'SRC' based on the files mentioned in SOURCES
23include $(TOOLSDIR)/makesrc.inc
24
25SOURCES = $(SRC)
26OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DEPFILE = $(OBJDIR)/dep-spc
29DIRS =
30
31all: $(OUTPUT)
32
33$(OUTPUT): $(OBJS)
34 $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
35 $(SILENT)$(RANLIB) $@
36
37include $(TOOLSDIR)/make.inc
38
39clean:
40 $(call PRINTS,cleaning spc)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
41
42ifneq ($(MAKECMDGOALS),clean)
43-include $(DEPFILE)
44endif
diff --git a/apps/codecs/libasap/README b/apps/codecs/libasap/README
new file mode 100644
index 0000000000..d43a872b25
--- /dev/null
+++ b/apps/codecs/libasap/README
@@ -0,0 +1,59 @@
1ASAP - Another Slight Atari Player
2----------------------------------
3
4ASAP is a player of Atari 8-bit music for modern computers.
5It emulates the POKEY sound chip and the 6502 processor.
6The project was initially based on the routines from the Atari800 emulator,
7but the current version has a completely new original emulation core.
8
9The ASAP project includes the following programs:
10* ASAP2WAV - portable command-line utility that generates WAV files
11* WASAP - tiny player for Windows
12* plugin for Apollo
13* plugin for foobar2000 0.9
14* plugin for GSPlayer
15* plugin for MOC
16* plugin for Winamp
17* plugin for XMMS
18* DirectShow source filter (for Windows Media Player)
19* Java version of ASAP2WAV
20* Java applet
21* Java midlet
22* C# version of ASAP2WAV
23
24The following input formats are supported:
25* SAP (Slight Atari Player - standard file format for playing Atari 8-bit
26 music on modern computers)
27* CMC (Chaos Music Composer)
28* CMR (CMC Rzog)
29* DMC (DoublePlay CMC)
30* MPT (Music ProTracker)
31* MPD (MPT DoublePlay)
32* RMT (Raster Music Tracker)
33* TMC, TM8 (Theta Music Composer 1.x)
34* TM2 (Theta Music Composer 2.x)
35
36If you are looking for Atari 8-bit music, there is a single big collection
37of it called Atari SAP Music Archive (http://asma.atari.org).
38
39If you are interested in the ASAP project, please subscribe its mailing list:
40https://lists.sourceforge.net/lists/listinfo/asap-users
41As in the Atari800 project, this is a combined list for end users
42and for developers. Once you subscribe, you can post comments, ideas
43and questions about ASAP. They will be answered ASAP. ;-)
44
45If, for some reason, you do not want to subscribe the mailing list,
46but have a bug report, feature request or a small code patch, you can use
47the sf.net tracker. Use "Bugs", "Feature Requests" or "Patches" link
48on this page:
49http://sourceforge.net/projects/asap/
50
51ASAP is free software; you can redistribute it and/or modify it
52under the terms of the GNU General Public License as published
53by the Free Software Foundation; either version 2 of the License,
54or (at your option) any later version.
55
56ASAP is distributed in the hope that it will be useful,
57but WITHOUT ANY WARRANTY; without even the implied warranty
58of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
59See the included GNU General Public License for more details.
diff --git a/apps/codecs/libasap/README.rockbox b/apps/codecs/libasap/README.rockbox
new file mode 100644
index 0000000000..322c130358
--- /dev/null
+++ b/apps/codecs/libasap/README.rockbox
@@ -0,0 +1,25 @@
1Library: asap-1.2.0
2Imported: 2008-26-07 by Dominik Wenger
3
4This directory contains a local version of asap (http://asap.sourceforge.net/) for decoding Atari 8bit .sap
5audio streams.
6
7LICENSING INFORMATION
8
9Asap is available under the terms of the GPL v2 or later
10license, which is both an open source and free software license.
11The Licence is the same as the rest of Rockbox.
12
13
14IMPORT DETAILS
15
16The .[ch] files in apps/codec/asap are copied from ASAP.
17Some #defines were added, so it uses the ci-> Pointer.
18
19A small modification was needed in asap.h Line 120.
20(changed the delta buffer to signed char)
21
22Also players.h (contains binarys of players) was generated and copied
23into Rockbox.
24
25
diff --git a/apps/codecs/libasap/SOURCES b/apps/codecs/libasap/SOURCES
new file mode 100644
index 0000000000..0d1f1f46fa
--- /dev/null
+++ b/apps/codecs/libasap/SOURCES
@@ -0,0 +1,3 @@
1acpu.c
2asap.c
3apokeysnd.c
diff --git a/apps/codecs/libasap/acpu.c b/apps/codecs/libasap/acpu.c
new file mode 100644
index 0000000000..a4def24371
--- /dev/null
+++ b/apps/codecs/libasap/acpu.c
@@ -0,0 +1,1262 @@
1/*
2 * acpu.c - another 6502 CPU emulator
3 *
4 * Copyright (C) 2007-2008 Piotr Fusik
5 *
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
8 *
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
13 *
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include "asap_internal.h"
25
26CONST_LOOKUP(int, opcode_cycles) =
27{
28/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
29 7, 6, 2, 8, 3, 3, 5, 5, 3, 2, 2, 2, 4, 4, 6, 6, /* 0x */
30 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* 1x */
31 6, 6, 2, 8, 3, 3, 5, 5, 4, 2, 2, 2, 4, 4, 6, 6, /* 2x */
32 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* 3x */
33 6, 6, 2, 8, 3, 3, 5, 5, 3, 2, 2, 2, 3, 4, 6, 6, /* 4x */
34 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* 5x */
35 6, 6, 2, 8, 3, 3, 5, 5, 4, 2, 2, 2, 5, 4, 6, 6, /* 6x */
36 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* 7x */
37 2, 6, 2, 6, 3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, /* 8x */
38 2, 6, 2, 6, 4, 4, 4, 4, 2, 5, 2, 5, 5, 5, 5, 5, /* 9x */
39 2, 6, 2, 6, 3, 3, 3, 3, 2, 2, 2, 2, 4, 4, 4, 4, /* Ax */
40 2, 5, 2, 5, 4, 4, 4, 4, 2, 4, 2, 4, 4, 4, 4, 4, /* Bx */
41 2, 6, 2, 8, 3, 3, 5, 5, 2, 2, 2, 2, 4, 4, 6, 6, /* Cx */
42 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* Dx */
43 2, 6, 2, 8, 3, 3, 5, 5, 2, 2, 2, 2, 4, 4, 6, 6, /* Ex */
44 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7 /* Fx */
45};
46
47#define DO_ADC \
48 if ((vdi & D_FLAG) == 0) { \
49 /* binary mode */ \
50 int tmp = a + data + c; \
51 c = tmp >> 8; \
52 vdi &= D_FLAG | I_FLAG; \
53 if (((a ^ data) & 0x80) == 0 && ((data ^ tmp) & 0x80) != 0) \
54 vdi += V_FLAG; \
55 nz = a = tmp & 0xff; \
56 } \
57 else { \
58 /* decimal mode */ \
59 int tmp = (a & 0x0f) + (data & 0x0f) + c; \
60 if (tmp >= 10) \
61 tmp = (tmp - 10) | 0x10; \
62 tmp += (a & 0xf0) + (data & 0xf0); \
63 nz = ((tmp & 0x80) << 1) + ((a + data + c) & 0xff); \
64 vdi &= D_FLAG | I_FLAG; \
65 if (((a ^ data) & 0x80) == 0 && ((data ^ tmp) & 0x80) != 0) \
66 vdi += V_FLAG; \
67 if (tmp > 0x9f) \
68 tmp += 0x60; \
69 c = (tmp > 0xff) ? 1 : 0; \
70 a = tmp & 0xff; \
71 }
72
73#define DO_SBC \
74 if ((vdi & D_FLAG) == 0) { \
75 /* binary mode */ \
76 int tmp = a - data - 1 + c; \
77 c = (tmp >= 0) ? 1 : 0; \
78 vdi &= D_FLAG | I_FLAG; \
79 if (((a ^ tmp) & 0x80) != 0 && ((a ^ data) & 0x80) != 0) \
80 vdi += V_FLAG; \
81 nz = a = tmp & 0xff; \
82 } \
83 else { \
84 /* decimal mode */ \
85 int tmp = a - data - 1 + c; \
86 int al = (a & 0x0f) - (data & 0x0f) - 1 + c; \
87 int ah = (a >> 4) - (data >> 4); \
88 if ((al & 0x10) != 0) { \
89 al -= 6; \
90 ah--; \
91 } \
92 if ((ah & 0x10) != 0) \
93 ah -= 6; \
94 c = tmp >= 0 ? 1 : 0; \
95 vdi &= D_FLAG | I_FLAG; \
96 if (((a ^ tmp) & 0x80) != 0 && ((a ^ data) & 0x80) != 0) \
97 vdi += V_FLAG; \
98 nz = tmp & 0xff; \
99 a = ((ah & 0xf) << 4) + (al & 0x0f); \
100 }
101
102#define zGetByte(addr) dGetByte((addr) & 0xff)
103
104#define PEEK dGetByte(pc)
105#define FETCH dGetByte(pc++)
106
107#define ABSOLUTE addr = FETCH; addr += FETCH << 8
108#define ABSOLUTE_X addr = FETCH; addr = (addr + (FETCH << 8) + x) & 0xffff
109#define ABSOLUTE_Y addr = FETCH; addr = (addr + (FETCH << 8) + y) & 0xffff
110#define ZPAGE addr = FETCH
111#define ZPAGE_X addr = (FETCH + x) & 0xff
112#define ZPAGE_Y addr = (FETCH + y) & 0xff
113#define INDIRECT_X addr = (FETCH + x) & 0xff; addr = dGetByte(addr) + (zGetByte(addr + 1) << 8)
114#define INDIRECT_Y addr = FETCH; addr = (dGetByte(addr) + (zGetByte(addr + 1) << 8) + y) & 0xffff
115#define NCYCLES_X if ((addr & 0xff) < x) AST cycle++
116#define NCYCLES_Y if ((addr & 0xff) < y) AST cycle++
117
118#define PL(dest) s = (s + 1) & 0xff; dest = dGetByte(0x0100 + s)
119#define PLP PL(vdi); nz = ((vdi & 0x80) << 1) + (~vdi & Z_FLAG); c = vdi & 1; vdi &= V_FLAG | D_FLAG | I_FLAG
120#define PH(data) dPutByte(0x0100 + s, data); s = (s - 1) & 0xff
121#define PHW(data) PH((data) >> 8); PH(data)
122#define PHP(bflag) PH(((nz | (nz >> 1)) & 0x80) + vdi + ((nz & 0xff) == 0 ? Z_FLAG : 0) + c + bflag)
123#define PHPB0 PHP(0x20) /* push flags with B flag clear (NMI, IRQ) */
124#define PHPB1 PHP(0x30) /* push flags with B flag set (PHP, BRK) */
125#define PHPC PHW(pc)
126
127#define LDA nz = a = GetByte(addr)
128#define LDA_ZP nz = a = dGetByte(addr)
129#define LDX nz = x = GetByte(addr)
130#define LDX_ZP nz = x = dGetByte(addr)
131#define LDY nz = y = GetByte(addr)
132#define LDY_ZP nz = y = dGetByte(addr)
133#define LAX nz = x = a = GetByte(addr)
134#define LAX_ZP nz = x = a = dGetByte(addr)
135#define STA PutByte(addr, a)
136#define STA_ZP dPutByte(addr, a)
137#define STX PutByte(addr, x)
138#define STX_ZP dPutByte(addr, x)
139#define STY PutByte(addr, y)
140#define STY_ZP dPutByte(addr, y)
141#define SAX data = a & x; PutByte(addr, data)
142#define SAX_ZP data = a & x; dPutByte(addr, data)
143#define CMP nz = GetByte(addr); c = (a >= nz) ? 1 : 0; nz = (a - nz) & 0xff
144#define CMP_ZP nz = dGetByte(addr); c = (a >= nz) ? 1 : 0; nz = (a - nz) & 0xff
145#define CPX nz = GetByte(addr); c = (x >= nz) ? 1 : 0; nz = (x - nz) & 0xff
146#define CPX_ZP nz = dGetByte(addr); c = (x >= nz) ? 1 : 0; nz = (x - nz) & 0xff
147#define CPY nz = GetByte(addr); c = (y >= nz) ? 1 : 0; nz = (y - nz) & 0xff
148#define CPY_ZP nz = dGetByte(addr); c = (y >= nz) ? 1 : 0; nz = (y - nz) & 0xff
149#define AND nz = a &= GetByte(addr)
150#define AND_ZP nz = a &= dGetByte(addr)
151#define ORA nz = a |= GetByte(addr)
152#define ORA_ZP nz = a |= dGetByte(addr)
153#define EOR nz = a ^= GetByte(addr)
154#define EOR_ZP nz = a ^= dGetByte(addr)
155#define ADC data = GetByte(addr); DO_ADC
156#define ADC_ZP data = dGetByte(addr); DO_ADC
157#define SBC data = GetByte(addr); DO_SBC
158#define SBC_ZP data = dGetByte(addr); DO_SBC
159
160#define ASL RMW_GetByte(nz, addr); c = nz >> 7; nz = (nz << 1) & 0xff; PutByte(addr, nz)
161#define ASL_ZP nz = dGetByte(addr); c = nz >> 7; nz = (nz << 1) & 0xff; dPutByte(addr, nz)
162#define ROL RMW_GetByte(nz, addr); nz = (nz << 1) + c; c = nz >> 8; nz &= 0xff; PutByte(addr, nz)
163#define ROL_ZP nz = dGetByte(addr); nz = (nz << 1) + c; c = nz >> 8; nz &= 0xff; dPutByte(addr, nz)
164#define LSR RMW_GetByte(nz, addr); c = nz & 1; nz >>= 1; PutByte(addr, nz)
165#define LSR_ZP nz = dGetByte(addr); c = nz & 1; nz >>= 1; dPutByte(addr, nz)
166#define ROR \
167 RMW_GetByte(nz, addr); \
168 if (c == 0) { \
169 c = nz & 1; \
170 nz >>= 1; \
171 } \
172 else { \
173 c = nz & 1; \
174 nz = (nz >> 1) + 128; \
175 } \
176 PutByte(addr, nz)
177#define ROR_ZP \
178 nz = dGetByte(addr); \
179 if (c == 0) { \
180 c = nz & 1; \
181 nz >>= 1; \
182 } \
183 else { \
184 c = nz & 1; \
185 nz = (nz >> 1) + 128; \
186 } \
187 dPutByte(addr, nz)
188#define DEC RMW_GetByte(nz, addr); nz = (nz - 1) & 0xff; PutByte(addr, nz)
189#define DEC_ZP nz = dGetByte(addr); nz = (nz - 1) & 0xff; dPutByte(addr, nz)
190#define INC RMW_GetByte(nz, addr); nz = (nz + 1) & 0xff; PutByte(addr, nz)
191#define INC_ZP nz = dGetByte(addr); nz = (nz + 1) & 0xff; dPutByte(addr, nz)
192
193#define ASO ASL; nz = a |= nz
194#define ASO_ZP ASL_ZP; nz = a |= nz
195#define RLA ROL; nz = a &= nz
196#define RLA_ZP ROL_ZP; nz = a &= nz
197#define LSE LSR; nz = a ^= nz
198#define LSE_ZP LSR_ZP; nz = a ^= nz
199#define RRA ROR; data = nz; DO_ADC
200#define RRA_ZP ROR_ZP; data = nz; DO_ADC
201#define DCM DEC; c = (a >= nz) ? 1 : 0; nz = (a - nz) & 0xff
202#define DCM_ZP DEC_ZP; c = (a >= nz) ? 1 : 0; nz = (a - nz) & 0xff
203#define INS INC; data = nz; DO_SBC
204#define INS_ZP INC_ZP; data = nz; DO_SBC
205
206#define BRANCH(cond) \
207 if (cond) { \
208 addr = SBYTE(FETCH); \
209 addr += pc; \
210 if (((addr ^ pc) & 0xff00) != 0) \
211 AST cycle++; \
212 AST cycle++; \
213 pc = addr; \
214 break; \
215 } \
216 pc++; \
217 break
218
219#define CHECK_IRQ \
220 if ((vdi & I_FLAG) == 0 && AST irqst != 0xff) { \
221 PHPC; \
222 PHPB0; \
223 vdi |= I_FLAG; \
224 pc = dGetWord(0xfffe); \
225 AST cycle += 7; \
226 }
227
228ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
229{
230 int pc;
231 int nz;
232 int a;
233 int x;
234 int y;
235 int c;
236 int s;
237 int vdi;
238 int next_event_cycle;
239 int cycle_limit;
240 pc = AST cpu_pc;
241 nz = AST cpu_nz;
242 a = AST cpu_a;
243 x = AST cpu_x;
244 y = AST cpu_y;
245 c = AST cpu_c;
246 s = AST cpu_s;
247 vdi = AST cpu_vdi;
248 AST next_scanline_cycle = 114;
249 next_event_cycle = 114;
250 cycle_limit = 114 * scanlines;
251 if (next_event_cycle > AST timer1_cycle)
252 next_event_cycle = AST timer1_cycle;
253 if (next_event_cycle > AST timer2_cycle)
254 next_event_cycle = AST timer2_cycle;
255 if (next_event_cycle > AST timer4_cycle)
256 next_event_cycle = AST timer4_cycle;
257 AST nearest_event_cycle = next_event_cycle;
258 for (;;) {
259 int cycle;
260 int addr;
261 int data;
262 cycle = AST cycle;
263 if (cycle >= AST nearest_event_cycle) {
264 if (cycle >= AST next_scanline_cycle) {
265 if (++AST scanline_number == 312)
266 AST scanline_number = 0;
267 AST cycle = cycle += 9;
268 AST next_scanline_cycle += 114;
269 if (--scanlines <= 0)
270 break;
271 }
272 next_event_cycle = AST next_scanline_cycle;
273#define CHECK_TIMER_IRQ(ch) \
274 if (cycle >= AST timer##ch##_cycle) { \
275 AST irqst &= ~ch; \
276 AST timer##ch##_cycle = NEVER; \
277 } \
278 else if (next_event_cycle > AST timer##ch##_cycle) \
279 next_event_cycle = AST timer##ch##_cycle;
280 CHECK_TIMER_IRQ(1);
281 CHECK_TIMER_IRQ(2);
282 CHECK_TIMER_IRQ(4);
283 AST nearest_event_cycle = next_event_cycle;
284 CHECK_IRQ;
285 }
286#ifdef ASAPSCAN
287 if (cpu_trace)
288 print_cpu_state(as, pc, a, x, y, s, nz, vdi, c);
289#endif
290 data = FETCH;
291 AST cycle += opcode_cycles[data];
292 switch (data) {
293 case 0x00: /* BRK */
294 pc++;
295 PHPC;
296 PHPB1;
297 vdi |= I_FLAG;
298 pc = dGetWord(0xfffe);
299 break;
300 case 0x01: /* ORA (ab,x) */
301 INDIRECT_X;
302 ORA;
303 break;
304 case 0x02: /* CIM [unofficial] */
305 case 0x12:
306 case 0x22:
307 case 0x32:
308 case 0x42:
309 case 0x52:
310 case 0x62:
311 case 0x72:
312 case 0x92:
313 case 0xb2:
314 case 0xd2:
315 case 0xf2:
316 AST scanline_number = (AST scanline_number + scanlines - 1) % 312;
317 scanlines = 1;
318 AST cycle = cycle_limit;
319 break;
320 case 0x03: /* ASO (ab,x) [unofficial] */
321 INDIRECT_X;
322 ASO;
323 break;
324 case 0x04: /* NOP ab [unofficial] */
325 case 0x44:
326 case 0x64:
327 case 0x14: /* NOP ab,x [unofficial] */
328 case 0x34:
329 case 0x54:
330 case 0x74:
331 case 0xd4:
332 case 0xf4:
333 case 0x80: /* NOP #ab [unofficial] */
334 case 0x82:
335 case 0x89:
336 case 0xc2:
337 case 0xe2:
338 pc++;
339 break;
340 case 0x05: /* ORA ab */
341 ZPAGE;
342 ORA_ZP;
343 break;
344 case 0x06: /* ASL ab */
345 ZPAGE;
346 ASL_ZP;
347 break;
348 case 0x07: /* ASO ab [unofficial] */
349 ZPAGE;
350 ASO_ZP;
351 break;
352 case 0x08: /* PHP */
353 PHPB1;
354 break;
355 case 0x09: /* ORA #ab */
356 nz = a |= FETCH;
357 break;
358 case 0x0a: /* ASL */
359 c = a >> 7;
360 nz = a = (a << 1) & 0xff;
361 break;
362 case 0x0b: /* ANC #ab [unofficial] */
363 case 0x2b:
364 nz = a &= FETCH;
365 c = nz >> 7;
366 break;
367 case 0x0c: /* NOP abcd [unofficial] */
368 pc += 2;
369 break;
370 case 0x0d: /* ORA abcd */
371 ABSOLUTE;
372 ORA;
373 break;
374 case 0x0e: /* ASL abcd */
375 ABSOLUTE;
376 ASL;
377 break;
378 case 0x0f: /* ASO abcd [unofficial] */
379 ABSOLUTE;
380 ASO;
381 break;
382 case 0x10: /* BPL */
383 BRANCH(nz < 0x80);
384 case 0x11: /* ORA (ab),y */
385 INDIRECT_Y;
386 NCYCLES_Y;
387 ORA;
388 break;
389 case 0x13: /* ASO (ab),y [unofficial] */
390 INDIRECT_Y;
391 ASO;
392 break;
393 case 0x15: /* ORA ab,x */
394 ZPAGE_X;
395 ORA_ZP;
396 break;
397 case 0x16: /* ASL ab,x */
398 ZPAGE_X;
399 ASL_ZP;
400 break;
401 case 0x17: /* ASO ab,x [unofficial] */
402 ZPAGE_X;
403 ASO_ZP;
404 break;
405 case 0x18: /* CLC */
406 c = 0;
407 break;
408 case 0x19: /* ORA abcd,y */
409 ABSOLUTE_Y;
410 NCYCLES_Y;
411 ORA;
412 break;
413 case 0x1b: /* ASO abcd,y [unofficial] */
414 ABSOLUTE_Y;
415 ASO;
416 break;
417 case 0x1c: /* NOP abcd,x [unofficial] */
418 case 0x3c:
419 case 0x5c:
420 case 0x7c:
421 case 0xdc:
422 case 0xfc:
423 if (FETCH + x >= 0x100)
424 AST cycle++;
425 pc++;
426 break;
427 case 0x1d: /* ORA abcd,x */
428 ABSOLUTE_X;
429 NCYCLES_X;
430 ORA;
431 break;
432 case 0x1e: /* ASL abcd,x */
433 ABSOLUTE_X;
434 ASL;
435 break;
436 case 0x1f: /* ASO abcd,x [unofficial] */
437 ABSOLUTE_X;
438 ASO;
439 break;
440 case 0x20: /* JSR abcd */
441 addr = FETCH;
442 PHPC;
443 pc = addr + (PEEK << 8);
444 break;
445 case 0x21: /* AND (ab,x) */
446 INDIRECT_X;
447 AND;
448 break;
449 case 0x23: /* RLA (ab,x) [unofficial] */
450 INDIRECT_X;
451 RLA;
452 break;
453 case 0x24: /* BIT ab */
454 ZPAGE;
455 nz = dGetByte(addr);
456 vdi = (vdi & (D_FLAG | I_FLAG)) + (nz & V_FLAG);
457 nz = ((nz & 0x80) << 1) + (nz & a);
458 break;
459 case 0x25: /* AND ab */
460 ZPAGE;
461 AND_ZP;
462 break;
463 case 0x26: /* ROL ab */
464 ZPAGE;
465 ROL_ZP;
466 break;
467 case 0x27: /* RLA ab [unofficial] */
468 ZPAGE;
469 RLA_ZP;
470 break;
471 case 0x28: /* PLP */
472 PLP;
473 CHECK_IRQ;
474 break;
475 case 0x29: /* AND #ab */
476 nz = a &= FETCH;
477 break;
478 case 0x2a: /* ROL */
479 a = (a << 1) + c;
480 c = a >> 8;
481 nz = a &= 0xff;
482 break;
483 case 0x2c: /* BIT abcd */
484 ABSOLUTE;
485 nz = GetByte(addr);
486 vdi = (vdi & (D_FLAG | I_FLAG)) + (nz & V_FLAG);
487 nz = ((nz & 0x80) << 1) + (nz & a);
488 break;
489 case 0x2d: /* AND abcd */
490 ABSOLUTE;
491 AND;
492 break;
493 case 0x2e: /* ROL abcd */
494 ABSOLUTE;
495 ROL;
496 break;
497 case 0x2f: /* RLA abcd [unofficial] */
498 ABSOLUTE;
499 RLA;
500 break;
501 case 0x30: /* BMI */
502 BRANCH(nz >= 0x80);
503 case 0x31: /* AND (ab),y */
504 INDIRECT_Y;
505 NCYCLES_Y;
506 AND;
507 break;
508 case 0x33: /* RLA (ab),y [unofficial] */
509 INDIRECT_Y;
510 RLA;
511 break;
512 case 0x35: /* AND ab,x */
513 ZPAGE_X;
514 AND_ZP;
515 break;
516 case 0x36: /* ROL ab,x */
517 ZPAGE_X;
518 ROL_ZP;
519 break;
520 case 0x37: /* RLA ab,x [unofficial] */
521 ZPAGE_X;
522 RLA_ZP;
523 break;
524 case 0x38: /* SEC */
525 c = 1;
526 break;
527 case 0x39: /* AND abcd,y */
528 ABSOLUTE_Y;
529 NCYCLES_Y;
530 AND;
531 break;
532 case 0x3b: /* RLA abcd,y [unofficial] */
533 ABSOLUTE_Y;
534 RLA;
535 break;
536 case 0x3d: /* AND abcd,x */
537 ABSOLUTE_X;
538 NCYCLES_X;
539 AND;
540 break;
541 case 0x3e: /* ROL abcd,x */
542 ABSOLUTE_X;
543 ROL;
544 break;
545 case 0x3f: /* RLA abcd,x [unofficial] */
546 ABSOLUTE_X;
547 RLA;
548 break;
549 case 0x40: /* RTI */
550 PLP;
551 PL(pc);
552 PL(addr);
553 pc += addr << 8;
554 CHECK_IRQ;
555 break;
556 case 0x41: /* EOR (ab,x) */
557 INDIRECT_X;
558 EOR;
559 break;
560 case 0x43: /* LSE (ab,x) [unofficial] */
561 INDIRECT_X;
562 LSE;
563 break;
564 case 0x45: /* EOR ab */
565 ZPAGE;
566 EOR_ZP;
567 break;
568 case 0x46: /* LSR ab */
569 ZPAGE;
570 LSR_ZP;
571 break;
572 case 0x47: /* LSE ab [unofficial] */
573 ZPAGE;
574 LSE_ZP;
575 break;
576 case 0x48: /* PHA */
577 PH(a);
578 break;
579 case 0x49: /* EOR #ab */
580 nz = a ^= FETCH;
581 break;
582 case 0x4a: /* LSR */
583 c = a & 1;
584 nz = a >>= 1;
585 break;
586 case 0x4b: /* ALR #ab [unofficial] */
587 a &= FETCH;
588 c = a & 1;
589 nz = a >>= 1;
590 break;
591 case 0x4c: /* JMP abcd */
592 addr = FETCH;
593 pc = addr + (PEEK << 8);
594 break;
595 case 0x4d: /* EOR abcd */
596 ABSOLUTE;
597 EOR;
598 break;
599 case 0x4e: /* LSR abcd */
600 ABSOLUTE;
601 LSR;
602 break;
603 case 0x4f: /* LSE abcd [unofficial] */
604 ABSOLUTE;
605 LSE;
606 break;
607 case 0x50: /* BVC */
608 BRANCH((vdi & V_FLAG) == 0);
609 case 0x51: /* EOR (ab),y */
610 INDIRECT_Y;
611 NCYCLES_Y;
612 EOR;
613 break;
614 case 0x53: /* LSE (ab),y [unofficial] */
615 INDIRECT_Y;
616 LSE;
617 break;
618 case 0x55: /* EOR ab,x */
619 ZPAGE_X;
620 EOR_ZP;
621 break;
622 case 0x56: /* LSR ab,x */
623 ZPAGE_X;
624 LSR_ZP;
625 break;
626 case 0x57: /* LSE ab,x [unofficial] */
627 ZPAGE_X;
628 LSE_ZP;
629 break;
630 case 0x58: /* CLI */
631 vdi &= V_FLAG | D_FLAG;
632 CHECK_IRQ;
633 break;
634 case 0x59: /* EOR abcd,y */
635 ABSOLUTE_Y;
636 NCYCLES_Y;
637 EOR;
638 break;
639 case 0x5b: /* LSE abcd,y [unofficial] */
640 ABSOLUTE_Y;
641 LSE;
642 break;
643 case 0x5d: /* EOR abcd,x */
644 ABSOLUTE_X;
645 NCYCLES_X;
646 EOR;
647 break;
648 case 0x5e: /* LSR abcd,x */
649 ABSOLUTE_X;
650 LSR;
651 break;
652 case 0x5f: /* LSE abcd,x [unofficial] */
653 ABSOLUTE_X;
654 LSE;
655 break;
656 case 0x60: /* RTS */
657 PL(pc);
658 PL(addr);
659 pc += (addr << 8) + 1;
660 break;
661 case 0x61: /* ADC (ab,x) */
662 INDIRECT_X;
663 ADC;
664 break;
665 case 0x63: /* RRA (ab,x) [unofficial] */
666 INDIRECT_X;
667 RRA;
668 break;
669 case 0x65: /* ADC ab */
670 ZPAGE;
671 ADC_ZP;
672 break;
673 case 0x66: /* ROR ab */
674 ZPAGE;
675 ROR_ZP;
676 break;
677 case 0x67: /* RRA ab [unofficial] */
678 ZPAGE;
679 RRA_ZP;
680 break;
681 case 0x68: /* PLA */
682 PL(a);
683 nz = a;
684 break;
685 case 0x69: /* ADC #ab */
686 data = FETCH;
687 DO_ADC;
688 break;
689 case 0x6a: /* ROR */
690 nz = (c << 7) + (a >> 1);
691 c = a & 1;
692 a = nz;
693 break;
694 case 0x6b: /* ARR #ab [unofficial] */
695 data = a & FETCH;
696 nz = a = (data >> 1) + (c << 7);
697 vdi = (vdi & (D_FLAG | I_FLAG)) + ((a ^ data) & V_FLAG);
698 if ((vdi & D_FLAG) == 0)
699 c = data >> 7;
700 else {
701 if ((data & 0xf) + (data & 1) > 5)
702 a = (a & 0xf0) + ((a + 6) & 0xf);
703 if (data + (data & 0x10) >= 0x60) {
704 a += 0x60;
705 c = 1;
706 }
707 else
708 c = 0;
709 a &= 0xff;
710 }
711 break;
712 case 0x6c: /* JMP (abcd) */
713 ABSOLUTE;
714 if ((addr & 0xff) == 0xff)
715 pc = (dGetByte(addr - 0xff) << 8) + dGetByte(addr);
716 else
717 pc = dGetWord(addr);
718 break;
719 case 0x6d: /* ADC abcd */
720 ABSOLUTE;
721 ADC;
722 break;
723 case 0x6e: /* ROR abcd */
724 ABSOLUTE;
725 ROR;
726 break;
727 case 0x6f: /* RRA abcd [unofficial] */
728 ABSOLUTE;
729 RRA;
730 break;
731 case 0x70: /* BVS */
732 BRANCH((vdi & V_FLAG) != 0);
733 case 0x71: /* ADC (ab),y */
734 INDIRECT_Y;
735 NCYCLES_Y;
736 ADC;
737 break;
738 case 0x73: /* RRA (ab),y [unofficial] */
739 INDIRECT_Y;
740 RRA;
741 break;
742 case 0x75: /* ADC ab,x */
743 ZPAGE_X;
744 ADC_ZP;
745 break;
746 case 0x76: /* ROR ab,x */
747 ZPAGE_X;
748 ROR_ZP;
749 break;
750 case 0x77: /* RRA ab,x [unofficial] */
751 ZPAGE_X;
752 RRA_ZP;
753 break;
754 case 0x78: /* SEI */
755 vdi |= I_FLAG;
756 break;
757 case 0x79: /* ADC abcd,y */
758 ABSOLUTE_Y;
759 NCYCLES_Y;
760 ADC;
761 break;
762 case 0x7b: /* RRA abcd,y [unofficial] */
763 ABSOLUTE_Y;
764 RRA;
765 break;
766 case 0x7d: /* ADC abcd,x */
767 ABSOLUTE_X;
768 NCYCLES_X;
769 ADC;
770 break;
771 case 0x7e: /* ROR abcd,x */
772 ABSOLUTE_X;
773 ROR;
774 break;
775 case 0x7f: /* RRA abcd,x [unofficial] */
776 ABSOLUTE_X;
777 RRA;
778 break;
779 case 0x81: /* STA (ab,x) */
780 INDIRECT_X;
781 STA;
782 break;
783 case 0x83: /* SAX (ab,x) [unofficial] */
784 INDIRECT_X;
785 SAX;
786 break;
787 case 0x84: /* STY ab */
788 ZPAGE;
789 STY_ZP;
790 break;
791 case 0x85: /* STA ab */
792 ZPAGE;
793 STA_ZP;
794 break;
795 case 0x86: /* STX ab */
796 ZPAGE;
797 STX_ZP;
798 break;
799 case 0x87: /* SAX ab [unofficial] */
800 ZPAGE;
801 SAX_ZP;
802 break;
803 case 0x88: /* DEY */
804 nz = y = (y - 1) & 0xff;
805 break;
806 case 0x8a: /* TXA */
807 nz = a = x;
808 break;
809 case 0x8b: /* ANE #ab [unofficial] */
810 data = FETCH;
811 a &= x;
812 nz = a & data;
813 a &= data | 0xef;
814 break;
815 case 0x8c: /* STY abcd */
816 ABSOLUTE;
817 STY;
818 break;
819 case 0x8d: /* STA abcd */
820 ABSOLUTE;
821 STA;
822 break;
823 case 0x8e: /* STX abcd */
824 ABSOLUTE;
825 STX;
826 break;
827 case 0x8f: /* SAX abcd [unofficial] */
828 ABSOLUTE;
829 SAX;
830 break;
831 case 0x90: /* BCC */
832 BRANCH(c == 0);
833 case 0x91: /* STA (ab),y */
834 INDIRECT_Y;
835 STA;
836 break;
837 case 0x93: /* SHA (ab),y [unofficial, unstable] */
838 ZPAGE;
839 data = zGetByte(addr + 1);
840 addr = (dGetByte(addr) + (data << 8) + y) & 0xffff;
841 data = a & x & (data + 1);
842 PutByte(addr, data);
843 break;
844 case 0x94: /* STY ab,x */
845 ZPAGE_X;
846 STY_ZP;
847 break;
848 case 0x95: /* STA ab,x */
849 ZPAGE_X;
850 STA_ZP;
851 break;
852 case 0x96: /* STX ab,y */
853 ZPAGE_Y;
854 STX_ZP;
855 break;
856 case 0x97: /* SAX ab,y [unofficial] */
857 ZPAGE_Y;
858 SAX_ZP;
859 break;
860 case 0x98: /* TYA */
861 nz = a = y;
862 break;
863 case 0x99: /* STA abcd,y */
864 ABSOLUTE_Y;
865 STA;
866 break;
867 case 0x9a: /* TXS */
868 s = x;
869 break;
870 case 0x9b: /* SHS abcd,y [unofficial, unstable] */
871 /* S seems to be stable, only memory values vary */
872 addr = FETCH;
873 data = FETCH;
874 addr = (addr + (data << 8) + y) & 0xffff;
875 s = a & x;
876 data = s & (data + 1);
877 PutByte(addr, data);
878 break;
879 case 0x9c: /* SHY abcd,x [unofficial] */
880 addr = FETCH;
881 data = FETCH;
882 addr = (addr + (data << 8) + x) & 0xffff;
883 data = y & (data + 1);
884 PutByte(addr, data);
885 break;
886 case 0x9d: /* STA abcd,x */
887 ABSOLUTE_X;
888 STA;
889 break;
890 case 0x9e: /* SHX abcd,y [unofficial] */
891 addr = FETCH;
892 data = FETCH;
893 addr = (addr + (data << 8) + y) & 0xffff;
894 data = x & (data + 1);
895 PutByte(addr, data);
896 break;
897 case 0x9f: /* SHA abcd,y [unofficial, unstable] */
898 addr = FETCH;
899 data = FETCH;
900 addr = (addr + (data << 8) + y) & 0xffff;
901 data = a & x & (data + 1);
902 PutByte(addr, data);
903 break;
904 case 0xa0: /* LDY #ab */
905 nz = y = FETCH;
906 break;
907 case 0xa1: /* LDA (ab,x) */
908 INDIRECT_X;
909 LDA;
910 break;
911 case 0xa2: /* LDX #ab */
912 nz = x = FETCH;
913 break;
914 case 0xa3: /* LAX (ab,x) [unofficial] */
915 INDIRECT_X;
916 LAX;
917 break;
918 case 0xa4: /* LDY ab */
919 ZPAGE;
920 LDY_ZP;
921 break;
922 case 0xa5: /* LDA ab */
923 ZPAGE;
924 LDA_ZP;
925 break;
926 case 0xa6: /* LDX ab */
927 ZPAGE;
928 LDX_ZP;
929 break;
930 case 0xa7: /* LAX ab [unofficial] */
931 ZPAGE;
932 LAX_ZP;
933 break;
934 case 0xa8: /* TAY */
935 nz = y = a;
936 break;
937 case 0xa9: /* LDA #ab */
938 nz = a = FETCH;
939 break;
940 case 0xaa: /* TAX */
941 nz = x = a;
942 break;
943 case 0xab: /* ANX #ab [unofficial] */
944 nz = x = a &= FETCH;
945 break;
946 case 0xac: /* LDY abcd */
947 ABSOLUTE;
948 LDY;
949 break;
950 case 0xad: /* LDA abcd */
951 ABSOLUTE;
952 LDA;
953 break;
954 case 0xae: /* LDX abcd */
955 ABSOLUTE;
956 LDX;
957 break;
958 case 0xaf: /* LAX abcd [unofficial] */
959 ABSOLUTE;
960 LAX;
961 break;
962 case 0xb0: /* BCS */
963 BRANCH(c != 0);
964 case 0xb1: /* LDA (ab),y */
965 INDIRECT_Y;
966 NCYCLES_Y;
967 LDA;
968 break;
969 case 0xb3: /* LAX (ab),y [unofficial] */
970 INDIRECT_Y;
971 NCYCLES_Y;
972 LAX;
973 break;
974 case 0xb4: /* LDY ab,x */
975 ZPAGE_X;
976 LDY_ZP;
977 break;
978 case 0xb5: /* LDA ab,x */
979 ZPAGE_X;
980 LDA_ZP;
981 break;
982 case 0xb6: /* LDX ab,y */
983 ZPAGE_Y;
984 LDX_ZP;
985 break;
986 case 0xb7: /* LAX ab,y [unofficial] */
987 ZPAGE_Y;
988 LAX_ZP;
989 break;
990 case 0xb8: /* CLV */
991 vdi &= D_FLAG | I_FLAG;
992 break;
993 case 0xb9: /* LDA abcd,y */
994 ABSOLUTE_Y;
995 NCYCLES_Y;
996 LDA;
997 break;
998 case 0xba: /* TSX */
999 nz = x = s;
1000 break;
1001 case 0xbb: /* LAS abcd,y [unofficial] */
1002 ABSOLUTE_Y;
1003 NCYCLES_Y;
1004 nz = x = a = s &= GetByte(addr);
1005 break;
1006 case 0xbc: /* LDY abcd,x */
1007 ABSOLUTE_X;
1008 NCYCLES_X;
1009 LDY;
1010 break;
1011 case 0xbd: /* LDA abcd,x */
1012 ABSOLUTE_X;
1013 NCYCLES_X;
1014 LDA;
1015 break;
1016 case 0xbe: /* LDX abcd,y */
1017 ABSOLUTE_Y;
1018 NCYCLES_Y;
1019 LDX;
1020 break;
1021 case 0xbf: /* LAX abcd,y [unofficial] */
1022 ABSOLUTE_Y;
1023 NCYCLES_Y;
1024 LAX;
1025 break;
1026 case 0xc0: /* CPY #ab */
1027 nz = FETCH;
1028 c = (y >= nz) ? 1 : 0;
1029 nz = (y - nz) & 0xff;
1030 break;
1031 case 0xc1: /* CMP (ab,x) */
1032 INDIRECT_X;
1033 CMP;
1034 break;
1035 case 0xc3: /* DCM (ab,x) [unofficial] */
1036 INDIRECT_X;
1037 DCM;
1038 break;
1039 case 0xc4: /* CPY ab */
1040 ZPAGE;
1041 CPY_ZP;
1042 break;
1043 case 0xc5: /* CMP ab */
1044 ZPAGE;
1045 CMP_ZP;
1046 break;
1047 case 0xc6: /* DEC ab */
1048 ZPAGE;
1049 DEC_ZP;
1050 break;
1051 case 0xc7: /* DCM ab [unofficial] */
1052 ZPAGE;
1053 DCM_ZP;
1054 break;
1055 case 0xc8: /* INY */
1056 nz = y = (y + 1) & 0xff;
1057 break;
1058 case 0xc9: /* CMP #ab */
1059 nz = FETCH;
1060 c = (a >= nz) ? 1 : 0;
1061 nz = (a - nz) & 0xff;
1062 break;
1063 case 0xca: /* DEX */
1064 nz = x = (x - 1) & 0xff;
1065 break;
1066 case 0xcb: /* SBX #ab [unofficial] */
1067 nz = FETCH;
1068 x &= a;
1069 c = (x >= nz) ? 1 : 0;
1070 nz = x = (x - nz) & 0xff;
1071 break;
1072 case 0xcc: /* CPY abcd */
1073 ABSOLUTE;
1074 CPY;
1075 break;
1076 case 0xcd: /* CMP abcd */
1077 ABSOLUTE;
1078 CMP;
1079 break;
1080 case 0xce: /* DEC abcd */
1081 ABSOLUTE;
1082 DEC;
1083 break;
1084 case 0xcf: /* DCM abcd [unofficial] */
1085 ABSOLUTE;
1086 DCM;
1087 break;
1088 case 0xd0: /* BNE */
1089 BRANCH((nz & 0xff) != 0);
1090 case 0xd1: /* CMP (ab),y */
1091 INDIRECT_Y;
1092 NCYCLES_Y;
1093 CMP;
1094 break;
1095 case 0xd3: /* DCM (ab),y [unofficial] */
1096 INDIRECT_Y;
1097 DCM;
1098 break;
1099 case 0xd5: /* CMP ab,x */
1100 ZPAGE_X;
1101 CMP_ZP;
1102 break;
1103 case 0xd6: /* DEC ab,x */
1104 ZPAGE_X;
1105 DEC_ZP;
1106 break;
1107 case 0xd7: /* DCM ab,x [unofficial] */
1108 ZPAGE_X;
1109 DCM_ZP;
1110 break;
1111 case 0xd8: /* CLD */
1112 vdi &= V_FLAG | I_FLAG;
1113 break;
1114 case 0xd9: /* CMP abcd,y */
1115 ABSOLUTE_Y;
1116 NCYCLES_Y;
1117 CMP;
1118 break;
1119 case 0xdb: /* DCM abcd,y [unofficial] */
1120 ABSOLUTE_Y;
1121 DCM;
1122 break;
1123 case 0xdd: /* CMP abcd,x */
1124 ABSOLUTE_X;
1125 NCYCLES_X;
1126 CMP;
1127 break;
1128 case 0xde: /* DEC abcd,x */
1129 ABSOLUTE_X;
1130 DEC;
1131 break;
1132 case 0xdf: /* DCM abcd,x [unofficial] */
1133 ABSOLUTE_X;
1134 DCM;
1135 break;
1136 case 0xe0: /* CPX #ab */
1137 nz = FETCH;
1138 c = (x >= nz) ? 1 : 0;
1139 nz = (x - nz) & 0xff;
1140 break;
1141 case 0xe1: /* SBC (ab,x) */
1142 INDIRECT_X;
1143 SBC;
1144 break;
1145 case 0xe3: /* INS (ab,x) [unofficial] */
1146 INDIRECT_X;
1147 INS;
1148 break;
1149 case 0xe4: /* CPX ab */
1150 ZPAGE;
1151 CPX_ZP;
1152 break;
1153 case 0xe5: /* SBC ab */
1154 ZPAGE;
1155 SBC_ZP;
1156 break;
1157 case 0xe6: /* INC ab */
1158 ZPAGE;
1159 INC_ZP;
1160 break;
1161 case 0xe7: /* INS ab [unofficial] */
1162 ZPAGE;
1163 INS_ZP;
1164 break;
1165 case 0xe8: /* INX */
1166 nz = x = (x + 1) & 0xff;
1167 break;
1168 case 0xe9: /* SBC #ab */
1169 case 0xeb: /* SBC #ab [unofficial] */
1170 data = FETCH;
1171 DO_SBC;
1172 break;
1173 case 0xea: /* NOP */
1174 case 0x1a: /* NOP [unofficial] */
1175 case 0x3a:
1176 case 0x5a:
1177 case 0x7a:
1178 case 0xda:
1179 case 0xfa:
1180 break;
1181 case 0xec: /* CPX abcd */
1182 ABSOLUTE;
1183 CPX;
1184 break;
1185 case 0xed: /* SBC abcd */
1186 ABSOLUTE;
1187 SBC;
1188 break;
1189 case 0xee: /* INC abcd */
1190 ABSOLUTE;
1191 INC;
1192 break;
1193 case 0xef: /* INS abcd [unofficial] */
1194 ABSOLUTE;
1195 INS;
1196 break;
1197 case 0xf0: /* BEQ */
1198 BRANCH((nz & 0xff) == 0);
1199 case 0xf1: /* SBC (ab),y */
1200 INDIRECT_Y;
1201 NCYCLES_Y;
1202 SBC;
1203 break;
1204 case 0xf3: /* INS (ab),y [unofficial] */
1205 INDIRECT_Y;
1206 INS;
1207 break;
1208 case 0xf5: /* SBC ab,x */
1209 ZPAGE_X;
1210 SBC_ZP;
1211 break;
1212 case 0xf6: /* INC ab,x */
1213 ZPAGE_X;
1214 INC_ZP;
1215 break;
1216 case 0xf7: /* INS ab,x [unofficial] */
1217 ZPAGE_X;
1218 INS_ZP;
1219 break;
1220 case 0xf8: /* SED */
1221 vdi |= D_FLAG;
1222 break;
1223 case 0xf9: /* SBC abcd,y */
1224 ABSOLUTE_Y;
1225 NCYCLES_Y;
1226 SBC;
1227 break;
1228 case 0xfb: /* INS abcd,y [unofficial] */
1229 ABSOLUTE_Y;
1230 INS;
1231 break;
1232 case 0xfd: /* SBC abcd,x */
1233 ABSOLUTE_X;
1234 NCYCLES_X;
1235 SBC;
1236 break;
1237 case 0xfe: /* INC abcd,x */
1238 ABSOLUTE_X;
1239 INC;
1240 break;
1241 case 0xff: /* INS abcd,x */
1242 ABSOLUTE_X;
1243 INS;
1244 break;
1245 }
1246 }
1247 AST cpu_pc = pc;
1248 AST cpu_nz = nz;
1249 AST cpu_a = a;
1250 AST cpu_x = x;
1251 AST cpu_y = y;
1252 AST cpu_c = c;
1253 AST cpu_s = s;
1254 AST cpu_vdi = vdi;
1255 AST cycle -= cycle_limit;
1256 if (AST timer1_cycle != NEVER)
1257 AST timer1_cycle -= cycle_limit;
1258 if (AST timer2_cycle != NEVER)
1259 AST timer2_cycle -= cycle_limit;
1260 if (AST timer4_cycle != NEVER)
1261 AST timer4_cycle -= cycle_limit;
1262}
diff --git a/apps/codecs/libasap/apokeysnd.c b/apps/codecs/libasap/apokeysnd.c
new file mode 100644
index 0000000000..1d48bc20d2
--- /dev/null
+++ b/apps/codecs/libasap/apokeysnd.c
@@ -0,0 +1,538 @@
1/*
2 * apokeysnd.c - another POKEY sound emulator
3 *
4 * Copyright (C) 2007-2008 Piotr Fusik
5 *
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
8 *
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
13 *
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23#include "codeclib.h"
24#if !defined(JAVA) && !defined(CSHARP)
25#include <string.h>
26#endif
27
28#include "asap_internal.h"
29
30#define memset ci->memset
31#define ULTRASOUND_CYCLES 112
32
33#define MUTE_FREQUENCY 1
34#define MUTE_INIT 2
35#define MUTE_USER 4
36
37CONST_LOOKUP(byte, poly4_lookup) =
38 { 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1 };
39CONST_LOOKUP(byte, poly5_lookup) =
40 { 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1,
41 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1 };
42
43FILE_FUNC void init_state(PokeyState PTR pst)
44{
45 PST audctl = 0;
46 PST init = FALSE;
47 PST poly_index = 15 * 31 * 131071;
48 PST div_cycles = 28;
49 PST mute1 = MUTE_FREQUENCY | MUTE_USER;
50 PST mute2 = MUTE_FREQUENCY | MUTE_USER;
51 PST mute3 = MUTE_FREQUENCY | MUTE_USER;
52 PST mute4 = MUTE_FREQUENCY | MUTE_USER;
53 PST audf1 = 0;
54 PST audf2 = 0;
55 PST audf3 = 0;
56 PST audf4 = 0;
57 PST audc1 = 0;
58 PST audc2 = 0;
59 PST audc3 = 0;
60 PST audc4 = 0;
61 PST tick_cycle1 = NEVER;
62 PST tick_cycle2 = NEVER;
63 PST tick_cycle3 = NEVER;
64 PST tick_cycle4 = NEVER;
65 PST period_cycles1 = 28;
66 PST period_cycles2 = 28;
67 PST period_cycles3 = 28;
68 PST period_cycles4 = 28;
69 PST reload_cycles1 = 28;
70 PST reload_cycles3 = 28;
71 PST out1 = 0;
72 PST out2 = 0;
73 PST out3 = 0;
74 PST out4 = 0;
75 PST delta1 = 0;
76 PST delta2 = 0;
77 PST delta3 = 0;
78 PST delta4 = 0;
79 PST skctl = 3;
80 ZERO_ARRAY(PST delta_buffer);
81}
82
83ASAP_FUNC void PokeySound_Initialize(ASAP_State PTR ast)
84{
85 int i;
86 int reg;
87 reg = 0x1ff;
88 for (i = 0; i < 511; i++) {
89 reg = ((((reg >> 5) ^ reg) & 1) << 8) + (reg >> 1);
90 AST poly9_lookup[i] = (byte) reg;
91 }
92 reg = 0x1ffff;
93 for (i = 0; i < 16385; i++) {
94 reg = ((((reg >> 5) ^ reg) & 0xff) << 9) + (reg >> 8);
95 AST poly17_lookup[i] = (byte) (reg >> 1);
96 }
97 AST sample_offset = 0;
98 AST sample_index = 0;
99 AST samples = 0;
100 AST iir_acc_left = 0;
101 AST iir_acc_right = 0;
102 init_state(ADDRESSOF AST base_pokey);
103 init_state(ADDRESSOF AST extra_pokey);
104}
105
106#define CYCLE_TO_SAMPLE(cycle) (((cycle) * ASAP_SAMPLE_RATE + AST sample_offset) / ASAP_MAIN_CLOCK)
107
108#define DO_TICK(ch) \
109 if (PST init) { \
110 switch (PST audc##ch >> 4) { \
111 case 10: \
112 case 14: \
113 PST out##ch ^= 1; \
114 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta##ch = -PST delta##ch; \
115 break; \
116 default: \
117 break; \
118 } \
119 } \
120 else { \
121 int poly = cycle + PST poly_index - (ch - 1); \
122 int newout = PST out##ch; \
123 switch (PST audc##ch >> 4) { \
124 case 0: \
125 if (poly5_lookup[poly % 31] != 0) { \
126 if ((PST audctl & 0x80) != 0) \
127 newout = AST poly9_lookup[poly % 511] & 1; \
128 else { \
129 poly %= 131071; \
130 newout = (AST poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \
131 } \
132 } \
133 break; \
134 case 2: \
135 case 6: \
136 newout ^= poly5_lookup[poly % 31]; \
137 break; \
138 case 4: \
139 if (poly5_lookup[poly % 31] != 0) \
140 newout = poly4_lookup[poly % 15]; \
141 break; \
142 case 8: \
143 if ((PST audctl & 0x80) != 0) \
144 newout = AST poly9_lookup[poly % 511] & 1; \
145 else { \
146 poly %= 131071; \
147 newout = (AST poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \
148 } \
149 break; \
150 case 10: \
151 case 14: \
152 newout ^= 1; \
153 break; \
154 case 12: \
155 newout = poly4_lookup[poly % 15]; \
156 break; \
157 default: \
158 break; \
159 } \
160 if (newout != PST out##ch) { \
161 PST out##ch = newout; \
162 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta##ch = -PST delta##ch; \
163 } \
164 }
165
166FILE_FUNC void generate(ASAP_State PTR ast, PokeyState PTR pst, int current_cycle)
167{
168 for (;;) {
169 int cycle = current_cycle;
170 if (cycle > PST tick_cycle1)
171 cycle = PST tick_cycle1;
172 if (cycle > PST tick_cycle2)
173 cycle = PST tick_cycle2;
174 if (cycle > PST tick_cycle3)
175 cycle = PST tick_cycle3;
176 if (cycle > PST tick_cycle4)
177 cycle = PST tick_cycle4;
178 if (cycle == current_cycle)
179 break;
180 if (cycle == PST tick_cycle3) {
181 PST tick_cycle3 += PST period_cycles3;
182 if ((PST audctl & 4) != 0 && PST delta1 > 0 && PST mute1 == 0)
183 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta1 = -PST delta1;
184 DO_TICK(3);
185 }
186 if (cycle == PST tick_cycle4) {
187 PST tick_cycle4 += PST period_cycles4;
188 if ((PST audctl & 8) != 0)
189 PST tick_cycle3 = cycle + PST reload_cycles3;
190 if ((PST audctl & 2) != 0 && PST delta2 > 0 && PST mute2 == 0)
191 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta2 = -PST delta2;
192 DO_TICK(4);
193 }
194 if (cycle == PST tick_cycle1) {
195 PST tick_cycle1 += PST period_cycles1;
196 if ((PST skctl & 0x88) == 8)
197 PST tick_cycle2 = cycle + PST period_cycles2;
198 DO_TICK(1);
199 }
200 if (cycle == PST tick_cycle2) {
201 PST tick_cycle2 += PST period_cycles2;
202 if ((PST audctl & 0x10) != 0)
203 PST tick_cycle1 = cycle + PST reload_cycles1;
204 else if ((PST skctl & 8) != 0)
205 PST tick_cycle1 = cycle + PST period_cycles1;
206 DO_TICK(2);
207 }
208 }
209}
210
211#define MUTE_CHANNEL(ch, cond, mask) \
212 if (cond) { \
213 PST mute##ch |= mask; \
214 PST tick_cycle##ch = NEVER; \
215 } \
216 else { \
217 PST mute##ch &= ~mask; \
218 if (PST tick_cycle##ch == NEVER && PST mute##ch == 0) \
219 PST tick_cycle##ch = AST cycle; \
220 }
221
222#define DO_ULTRASOUND(ch) \
223 MUTE_CHANNEL(ch, PST period_cycles##ch <= ULTRASOUND_CYCLES && (PST audc##ch >> 4 == 10 || PST audc##ch >> 4 == 14), MUTE_FREQUENCY)
224
225#define DO_AUDC(ch) \
226 if (data == PST audc##ch) \
227 break; \
228 generate(ast, pst, AST cycle); \
229 PST audc##ch = data; \
230 if ((data & 0x10) != 0) { \
231 data &= 0xf; \
232 if ((PST mute##ch & MUTE_USER) == 0) \
233 PST delta_buffer[CYCLE_TO_SAMPLE(AST cycle)] \
234 += PST delta##ch > 0 ? data - PST delta##ch : data; \
235 PST delta##ch = data; \
236 } \
237 else { \
238 data &= 0xf; \
239 DO_ULTRASOUND(ch); \
240 if (PST delta##ch > 0) { \
241 if ((PST mute##ch & MUTE_USER) == 0) \
242 PST delta_buffer[CYCLE_TO_SAMPLE(AST cycle)] \
243 += data - PST delta##ch; \
244 PST delta##ch = data; \
245 } \
246 else \
247 PST delta##ch = -data; \
248 } \
249 break;
250
251#define DO_INIT(ch, cond) \
252 MUTE_CHANNEL(ch, PST init && cond, MUTE_INIT)
253
254ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data)
255{
256 PokeyState PTR pst = (addr & AST extra_pokey_mask) != 0
257 ? ADDRESSOF AST extra_pokey : ADDRESSOF AST base_pokey;
258 switch (addr & 0xf) {
259 case 0x00:
260 if (data == PST audf1)
261 break;
262 generate(ast, pst, AST cycle);
263 PST audf1 = data;
264 switch (PST audctl & 0x50) {
265 case 0x00:
266 PST period_cycles1 = PST div_cycles * (data + 1);
267 break;
268 case 0x10:
269 PST period_cycles2 = PST div_cycles * (data + 256 * PST audf2 + 1);
270 PST reload_cycles1 = PST div_cycles * (data + 1);
271 DO_ULTRASOUND(2);
272 break;
273 case 0x40:
274 PST period_cycles1 = data + 4;
275 break;
276 case 0x50:
277 PST period_cycles2 = data + 256 * PST audf2 + 7;
278 PST reload_cycles1 = data + 4;
279 DO_ULTRASOUND(2);
280 break;
281 }
282 DO_ULTRASOUND(1);
283 break;
284 case 0x01:
285 DO_AUDC(1)
286 case 0x02:
287 if (data == PST audf2)
288 break;
289 generate(ast, pst, AST cycle);
290 PST audf2 = data;
291 switch (PST audctl & 0x50) {
292 case 0x00:
293 case 0x40:
294 PST period_cycles2 = PST div_cycles * (data + 1);
295 break;
296 case 0x10:
297 PST period_cycles2 = PST div_cycles * (PST audf1 + 256 * data + 1);
298 break;
299 case 0x50:
300 PST period_cycles2 = PST audf1 + 256 * data + 7;
301 break;
302 }
303 DO_ULTRASOUND(2);
304 break;
305 case 0x03:
306 DO_AUDC(2)
307 case 0x04:
308 if (data == PST audf3)
309 break;
310 generate(ast, pst, AST cycle);
311 PST audf3 = data;
312 switch (PST audctl & 0x28) {
313 case 0x00:
314 PST period_cycles3 = PST div_cycles * (data + 1);
315 break;
316 case 0x08:
317 PST period_cycles4 = PST div_cycles * (data + 256 * PST audf4 + 1);
318 PST reload_cycles3 = PST div_cycles * (data + 1);
319 DO_ULTRASOUND(4);
320 break;
321 case 0x20:
322 PST period_cycles3 = data + 4;
323 break;
324 case 0x28:
325 PST period_cycles4 = data + 256 * PST audf4 + 7;
326 PST reload_cycles3 = data + 4;
327 DO_ULTRASOUND(4);
328 break;
329 }
330 DO_ULTRASOUND(3);
331 break;
332 case 0x05:
333 DO_AUDC(3)
334 case 0x06:
335 if (data == PST audf4)
336 break;
337 generate(ast, pst, AST cycle);
338 PST audf4 = data;
339 switch (PST audctl & 0x28) {
340 case 0x00:
341 case 0x20:
342 PST period_cycles4 = PST div_cycles * (data + 1);
343 break;
344 case 0x08:
345 PST period_cycles4 = PST div_cycles * (PST audf3 + 256 * data + 1);
346 break;
347 case 0x28:
348 PST period_cycles4 = PST audf3 + 256 * data + 7;
349 break;
350 }
351 DO_ULTRASOUND(4);
352 break;
353 case 0x07:
354 DO_AUDC(4)
355 case 0x08:
356 if (data == PST audctl)
357 break;
358 generate(ast, pst, AST cycle);
359 PST audctl = data;
360 PST div_cycles = ((data & 1) != 0) ? 114 : 28;
361 /* TODO: tick_cycles */
362 switch (data & 0x50) {
363 case 0x00:
364 PST period_cycles1 = PST div_cycles * (PST audf1 + 1);
365 PST period_cycles2 = PST div_cycles * (PST audf2 + 1);
366 break;
367 case 0x10:
368 PST period_cycles1 = PST div_cycles * 256;
369 PST period_cycles2 = PST div_cycles * (PST audf1 + 256 * PST audf2 + 1);
370 PST reload_cycles1 = PST div_cycles * (PST audf1 + 1);
371 break;
372 case 0x40:
373 PST period_cycles1 = PST audf1 + 4;
374 PST period_cycles2 = PST div_cycles * (PST audf2 + 1);
375 break;
376 case 0x50:
377 PST period_cycles1 = 256;
378 PST period_cycles2 = PST audf1 + 256 * PST audf2 + 7;
379 PST reload_cycles1 = PST audf1 + 4;
380 break;
381 }
382 DO_ULTRASOUND(1);
383 DO_ULTRASOUND(2);
384 switch (data & 0x28) {
385 case 0x00:
386 PST period_cycles3 = PST div_cycles * (PST audf3 + 1);
387 PST period_cycles4 = PST div_cycles * (PST audf4 + 1);
388 break;
389 case 0x08:
390 PST period_cycles3 = PST div_cycles * 256;
391 PST period_cycles4 = PST div_cycles * (PST audf3 + 256 * PST audf4 + 1);
392 PST reload_cycles3 = PST div_cycles * (PST audf3 + 1);
393 break;
394 case 0x20:
395 PST period_cycles3 = PST audf3 + 4;
396 PST period_cycles4 = PST div_cycles * (PST audf4 + 1);
397 break;
398 case 0x28:
399 PST period_cycles3 = 256;
400 PST period_cycles4 = PST audf3 + 256 * PST audf4 + 7;
401 PST reload_cycles3 = PST audf3 + 4;
402 break;
403 }
404 DO_ULTRASOUND(3);
405 DO_ULTRASOUND(4);
406 break;
407 case 0x09:
408 /* TODO: STIMER */
409 break;
410 case 0x0f:
411 PST skctl = data;
412 PST init = ((data & 3) == 0);
413 DO_INIT(1, (PST audctl & 0x40) == 0);
414 DO_INIT(2, (PST audctl & 0x50) != 0x50);
415 DO_INIT(3, (PST audctl & 0x20) == 0);
416 DO_INIT(4, (PST audctl & 0x28) != 0x28);
417 break;
418 default:
419 break;
420 }
421}
422
423ASAP_FUNC int PokeySound_GetRandom(ASAP_State PTR ast, int addr)
424{
425 PokeyState PTR pst = (addr & AST extra_pokey_mask) != 0
426 ? ADDRESSOF AST extra_pokey : ADDRESSOF AST base_pokey;
427 int i;
428 if (PST init)
429 return 0xff;
430 i = AST cycle + PST poly_index;
431 if ((PST audctl & 0x80) != 0)
432 return AST poly9_lookup[i % 511];
433 else {
434 int j;
435 i %= 131071;
436 j = i >> 3;
437 i &= 7;
438 return ((AST poly17_lookup[j] >> i) + (AST poly17_lookup[j + 1] << (8 - i))) & 0xff;
439 }
440}
441
442FILE_FUNC void end_frame(ASAP_State PTR ast, PokeyState PTR pst, int cycle_limit)
443{
444 int m;
445 generate(ast, pst, cycle_limit);
446 PST poly_index += cycle_limit;
447 m = ((PST audctl & 0x80) != 0) ? 15 * 31 * 511 : 15 * 31 * 131071;
448 if (PST poly_index >= 2 * m)
449 PST poly_index -= m;
450 if (PST tick_cycle1 != NEVER)
451 PST tick_cycle1 -= cycle_limit;
452 if (PST tick_cycle2 != NEVER)
453 PST tick_cycle2 -= cycle_limit;
454 if (PST tick_cycle3 != NEVER)
455 PST tick_cycle3 -= cycle_limit;
456 if (PST tick_cycle4 != NEVER)
457 PST tick_cycle4 -= cycle_limit;
458}
459
460ASAP_FUNC void PokeySound_StartFrame(ASAP_State PTR ast)
461{
462 ZERO_ARRAY(AST base_pokey.delta_buffer);
463 if (AST extra_pokey_mask != 0)
464 ZERO_ARRAY(AST extra_pokey.delta_buffer);
465}
466
467ASAP_FUNC void PokeySound_EndFrame(ASAP_State PTR ast, int current_cycle)
468{
469 end_frame(ast, ADDRESSOF AST base_pokey, current_cycle);
470 if (AST extra_pokey_mask != 0)
471 end_frame(ast, ADDRESSOF AST extra_pokey, current_cycle);
472 AST sample_offset += current_cycle * ASAP_SAMPLE_RATE;
473 AST sample_index = 0;
474 AST samples = AST sample_offset / ASAP_MAIN_CLOCK;
475 AST sample_offset %= ASAP_MAIN_CLOCK;
476}
477
478ASAP_FUNC int PokeySound_Generate(ASAP_State PTR ast, byte ARRAY buffer, int buffer_offset, int blocks, ASAP_SampleFormat format)
479{
480 int i = AST sample_index;
481 int samples = AST samples;
482 int acc_left = AST iir_acc_left;
483 int acc_right = AST iir_acc_right;
484 if (blocks < samples - i)
485 samples = i + blocks;
486 else
487 blocks = samples - i;
488 for (; i < samples; i++) {
489 int sample;
490 acc_left += (AST base_pokey.delta_buffer[i] << 20) - (acc_left * 3 >> 10);
491 sample = acc_left >> 10;
492#define STORE_SAMPLE \
493 if (sample < -32767) \
494 sample = -32767; \
495 else if (sample > 32767) \
496 sample = 32767; \
497 switch (format) { \
498 case ASAP_FORMAT_U8: \
499 buffer[buffer_offset++] = (byte) ((sample >> 8) + 128); \
500 break; \
501 case ASAP_FORMAT_S16_LE: \
502 buffer[buffer_offset++] = (byte) sample; \
503 buffer[buffer_offset++] = (byte) (sample >> 8); \
504 break; \
505 case ASAP_FORMAT_S16_BE: \
506 buffer[buffer_offset++] = (byte) (sample >> 8); \
507 buffer[buffer_offset++] = (byte) sample; \
508 break; \
509 }
510 STORE_SAMPLE;
511 if (AST extra_pokey_mask != 0) {
512 acc_right += (AST extra_pokey.delta_buffer[i] << 20) - (acc_right * 3 >> 10);
513 sample = acc_right >> 10;
514 STORE_SAMPLE;
515 }
516 }
517 if (i == AST samples) {
518 acc_left += AST base_pokey.delta_buffer[i] << 20;
519 acc_right += AST extra_pokey.delta_buffer[i] << 20;
520 }
521 AST sample_index = i;
522 AST iir_acc_left = acc_left;
523 AST iir_acc_right = acc_right;
524 return blocks;
525}
526
527ASAP_FUNC abool PokeySound_IsSilent(const PokeyState PTR pst)
528{
529 return ((PST audc1 | PST audc2 | PST audc3 | PST audc4) & 0xf) == 0;
530}
531
532ASAP_FUNC void PokeySound_Mute(const ASAP_State PTR ast, PokeyState PTR pst, int mask)
533{
534 MUTE_CHANNEL(1, (mask & 1) != 0, MUTE_USER);
535 MUTE_CHANNEL(2, (mask & 2) != 0, MUTE_USER);
536 MUTE_CHANNEL(3, (mask & 4) != 0, MUTE_USER);
537 MUTE_CHANNEL(4, (mask & 8) != 0, MUTE_USER);
538}
diff --git a/apps/codecs/libasap/asap.c b/apps/codecs/libasap/asap.c
new file mode 100644
index 0000000000..31de730d93
--- /dev/null
+++ b/apps/codecs/libasap/asap.c
@@ -0,0 +1,2010 @@
1/*
2 * asap.c - ASAP engine
3 *
4 * Copyright (C) 2005-2008 Piotr Fusik
5 *
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
8 *
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
13 *
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23#include "codeclib.h"
24#if !defined(JAVA) && !defined(CSHARP)
25#include <string.h>
26#endif
27
28#include "asap_internal.h"
29#if !defined(JAVA) && !defined(CSHARP)
30#include "players.h"
31#endif
32
33#define memcpy ci->memcpy
34#define memcmp ci->memcmp
35#define memset ci->memset
36#define strcpy ci->strcpy
37#define strcmp ci->strcmp
38#define strstr ci->strcasestr
39
40
41#define CMR_BASS_TABLE_OFFSET 0x70f
42
43CONST_LOOKUP(byte, cmr_bass_table) = {
44 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x41, 0x3E,
45 0x38, 0x35, (byte) 0x88, 0x7F, 0x79, 0x73, 0x6C, 0x67,
46 0x60, 0x5A, 0x55, 0x51, 0x4C, 0x48, 0x43, 0x3F,
47 0x3D, 0x39, 0x34, 0x33, 0x30, 0x2D, 0x2A, 0x28,
48 0x25, 0x24, 0x21, 0x1F, 0x1E
49};
50
51ASAP_FUNC int ASAP_GetByte(ASAP_State PTR ast, int addr)
52{
53 switch (addr & 0xff0f) {
54 case 0xd20a:
55 return PokeySound_GetRandom(ast, addr);
56 case 0xd20e:
57 if ((addr & AST extra_pokey_mask) != 0)
58 return 0xff;
59 return AST irqst;
60 case 0xd20f:
61 return 0xff;
62 case 0xd40b:
63 return AST scanline_number >> 1;
64 default:
65 return dGetByte(addr);
66 }
67}
68
69ASAP_FUNC void ASAP_PutByte(ASAP_State PTR ast, int addr, int data)
70{
71 if ((addr >> 8) == 0xd2) {
72 if ((addr & (AST extra_pokey_mask + 0xf)) == 0xe) {
73 AST irqst |= data ^ 0xff;
74#define SET_TIMER_IRQ(ch) \
75 if ((data & AST irqst & ch) != 0) { \
76 if (AST timer##ch##_cycle == NEVER) { \
77 int t = AST base_pokey.tick_cycle##ch; \
78 while (t < AST cycle) \
79 t += AST base_pokey.period_cycles##ch; \
80 AST timer##ch##_cycle = t; \
81 if (AST nearest_event_cycle > t) \
82 AST nearest_event_cycle = t; \
83 } \
84 } \
85 else \
86 AST timer##ch##_cycle = NEVER;
87 SET_TIMER_IRQ(1);
88 SET_TIMER_IRQ(2);
89 SET_TIMER_IRQ(4);
90 }
91 else
92 PokeySound_PutByte(ast, addr, data);
93 }
94 else if ((addr & 0xff0f) == 0xd40a) {
95 if (AST cycle <= AST next_scanline_cycle - 8)
96 AST cycle = AST next_scanline_cycle - 8;
97 else
98 AST cycle = AST next_scanline_cycle + 106;
99 }
100 else
101 dPutByte(addr, data);
102}
103
104#define MAX_SONGS 32
105
106CONST_LOOKUP(int, perframe2fastplay) = { 312, 312 / 2, 312 / 3, 312 / 4 };
107
108FILE_FUNC abool load_native(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
109 const byte ARRAY module, int module_len, ASAP_OBX player)
110{
111#if defined(JAVA) || defined(CSHARP)
112 try
113#endif
114 {
115 int player_last_byte;
116 int block_len;
117 if (UBYTE(module[0]) != 0xff || UBYTE(module[1]) != 0xff)
118 return FALSE;
119#ifdef JAVA
120 try {
121 player.read();
122 player.read();
123 MODULE_INFO player = player.read();
124 MODULE_INFO player += player.read() << 8;
125 player_last_byte = player.read();
126 player_last_byte += player.read() << 8;
127 } catch (IOException e) {
128 throw new RuntimeException();
129 }
130#elif defined(CSHARP)
131 player.ReadByte();
132 player.ReadByte();
133 MODULE_INFO player = player.ReadByte();
134 MODULE_INFO player += player.ReadByte() << 8;
135 player_last_byte = player.ReadByte();
136 player_last_byte += player.ReadByte() << 8;
137#else
138 MODULE_INFO player = UBYTE(player[2]) + (UBYTE(player[3]) << 8);
139 player_last_byte = UBYTE(player[4]) + (UBYTE(player[5]) << 8);
140#endif
141 MODULE_INFO music = UBYTE(module[2]) + (UBYTE(module[3]) << 8);
142 if (MODULE_INFO music <= player_last_byte)
143 return FALSE;
144 block_len = UBYTE(module[4]) + (UBYTE(module[5]) << 8) + 1 - MODULE_INFO music;
145 if (6 + block_len != module_len) {
146 int info_addr;
147 int info_len;
148 if (MODULE_INFO type != 'r' || 11 + block_len > module_len)
149 return FALSE;
150 /* allow optional info for Raster Music Tracker */
151 info_addr = UBYTE(module[6 + block_len]) + (UBYTE(module[7 + block_len]) << 8);
152 if (info_addr != MODULE_INFO music + block_len)
153 return FALSE;
154 info_len = UBYTE(module[8 + block_len]) + (UBYTE(module[9 + block_len]) << 8) + 1 - info_addr;
155 if (10 + block_len + info_len != module_len)
156 return FALSE;
157 }
158 if (ast != NULL) {
159 COPY_ARRAY(AST memory, MODULE_INFO music, module, 6, block_len);
160#ifdef JAVA
161 int addr = MODULE_INFO player;
162 do {
163 int i;
164 try {
165 i = player.read(AST memory, addr, player_last_byte + 1 - addr);
166 } catch (IOException e) {
167 throw new RuntimeException();
168 }
169 if (i <= 0)
170 throw new RuntimeException();
171 addr += i;
172 } while (addr <= player_last_byte);
173#elif defined(CSHARP)
174 int addr = MODULE_INFO player;
175 do {
176 int i = player.Read(AST memory, addr, player_last_byte + 1 - addr);
177 if (i <= 0)
178 throw new Exception();
179 addr += i;
180 } while (addr <= player_last_byte);
181#else
182 COPY_ARRAY(AST memory, MODULE_INFO player, player, 6, player_last_byte + 1 - MODULE_INFO player);
183#endif
184 }
185 return TRUE;
186 }
187#ifdef JAVA
188 finally {
189 try {
190 player.close();
191 } catch (IOException e) {
192 throw new RuntimeException();
193 }
194 }
195#elif defined(CSHARP)
196 finally {
197 player.Close();
198 }
199#endif
200}
201
202FILE_FUNC void set_song_duration(ASAP_ModuleInfo PTR module_info, int player_calls)
203{
204 MODULE_INFO durations[MODULE_INFO songs] = (int) (player_calls * MODULE_INFO fastplay * 114000.0 / 1773447);
205 MODULE_INFO songs++;
206}
207
208#define SEEN_THIS_CALL 1
209#define SEEN_BEFORE 2
210#define SEEN_REPEAT 3
211
212FILE_FUNC void parse_cmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos)
213{
214 int tempo = UBYTE(module[0x19]);
215 int player_calls = 0;
216 int rep_start_pos = 0;
217 int rep_end_pos = 0;
218 int rep_times = 0;
219 NEW_ARRAY(byte, seen, 0x55);
220 INIT_ARRAY(seen);
221 while (pos >= 0 && pos < 0x55) {
222 int p1;
223 int p2;
224 int p3;
225 if (pos == rep_end_pos && rep_times > 0) {
226 for (p1 = 0; p1 < 0x55; p1++)
227 if (seen[p1] == SEEN_THIS_CALL || seen[p1] == SEEN_REPEAT)
228 seen[p1] = 0;
229 rep_times--;
230 pos = rep_start_pos;
231 }
232 if (seen[pos] != 0) {
233 if (seen[pos] != SEEN_THIS_CALL)
234 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
235 break;
236 }
237 seen[pos] = SEEN_THIS_CALL;
238 p1 = UBYTE(module[0x206 + pos]);
239 p2 = UBYTE(module[0x25b + pos]);
240 p3 = UBYTE(module[0x2b0 + pos]);
241 if (p1 == 0xfe || p2 == 0xfe || p3 == 0xfe) {
242 pos++;
243 continue;
244 }
245 p1 >>= 4;
246 if (p1 == 8)
247 break;
248 if (p1 == 9) {
249 pos = p2;
250 continue;
251 }
252 if (p1 == 0xa) {
253 pos -= p2;
254 continue;
255 }
256 if (p1 == 0xb) {
257 pos += p2;
258 continue;
259 }
260 if (p1 == 0xc) {
261 tempo = p2;
262 pos++;
263 continue;
264 }
265 if (p1 == 0xd) {
266 pos++;
267 rep_start_pos = pos;
268 rep_end_pos = pos + p2;
269 rep_times = p3 - 1;
270 continue;
271 }
272 if (p1 == 0xe) {
273 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
274 break;
275 }
276 p2 = rep_times > 0 ? SEEN_REPEAT : SEEN_BEFORE;
277 for (p1 = 0; p1 < 0x55; p1++)
278 if (seen[p1] == SEEN_THIS_CALL)
279 seen[p1] = (byte) p2;
280 player_calls += tempo << 6;
281 pos++;
282 }
283 set_song_duration(module_info, player_calls);
284}
285
286FILE_FUNC abool parse_cmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
287 const byte ARRAY module, int module_len, abool cmr)
288{
289 int last_pos;
290 int pos;
291 if (module_len < 0x306)
292 return FALSE;
293 MODULE_INFO type = cmr ? 'z' : 'c';
294 if (!load_native(ast, module_info, module, module_len, GET_OBX(cmc)))
295 return FALSE;
296 if (ast != NULL && cmr)
297 COPY_ARRAY(AST memory, 0x500 + CMR_BASS_TABLE_OFFSET, cmr_bass_table, 0, sizeof(cmr_bass_table));
298 /* auto-detect number of subsongs */
299 last_pos = 0x54;
300 while (--last_pos >= 0) {
301 if (UBYTE(module[0x206 + last_pos]) < 0xb0
302 || UBYTE(module[0x25b + last_pos]) < 0x40
303 || UBYTE(module[0x2b0 + last_pos]) < 0x40)
304 break;
305 }
306 MODULE_INFO songs = 0;
307 parse_cmc_song(module_info, module, 0);
308 for (pos = 0; pos < last_pos && MODULE_INFO songs < MAX_SONGS; pos++)
309 if (UBYTE(module[0x206 + pos]) == 0x8f || UBYTE(module[0x206 + pos]) == 0xef)
310 parse_cmc_song(module_info, module, pos + 1);
311 return TRUE;
312}
313
314FILE_FUNC void parse_mpt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module,
315 abool ARRAY global_seen, int song_len, int pos)
316{
317 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6;
318 int tempo = UBYTE(module[0x1cf]);
319 int player_calls = 0;
320 NEW_ARRAY(byte, seen, 256);
321 NEW_ARRAY(int, pattern_offset, 4);
322 NEW_ARRAY(int, blank_rows, 4);
323 NEW_ARRAY(int, blank_rows_counter, 4);
324 INIT_ARRAY(seen);
325 INIT_ARRAY(blank_rows);
326 while (pos < song_len) {
327 int i;
328 int ch;
329 int pattern_rows;
330 if (seen[pos] != 0) {
331 if (seen[pos] != SEEN_THIS_CALL)
332 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
333 break;
334 }
335 seen[pos] = SEEN_THIS_CALL;
336 global_seen[pos] = TRUE;
337 i = UBYTE(module[0x1d0 + pos * 2]);
338 if (i == 0xff) {
339 pos = UBYTE(module[0x1d1 + pos * 2]);
340 continue;
341 }
342 for (ch = 3; ch >= 0; ch--) {
343 i = UBYTE(module[0x1c6 + ch]) + (UBYTE(module[0x1ca + ch]) << 8) - addr_to_offset;
344 i = UBYTE(module[i + pos * 2]);
345 if (i >= 0x40)
346 break;
347 i <<= 1;
348 i = UBYTE(module[0x46 + i]) + (UBYTE(module[0x47 + i]) << 8);
349 pattern_offset[ch] = i == 0 ? 0 : i - addr_to_offset;
350 blank_rows_counter[ch] = 0;
351 }
352 if (ch >= 0)
353 break;
354 for (i = 0; i < song_len; i++)
355 if (seen[i] == SEEN_THIS_CALL)
356 seen[i] = SEEN_BEFORE;
357 for (pattern_rows = UBYTE(module[0x1ce]); --pattern_rows >= 0; ) {
358 for (ch = 3; ch >= 0; ch--) {
359 if (pattern_offset[ch] == 0 || --blank_rows_counter[ch] >= 0)
360 continue;
361 for (;;) {
362 i = UBYTE(module[pattern_offset[ch]++]);
363 if (i < 0x40 || i == 0xfe)
364 break;
365 if (i < 0x80)
366 continue;
367 if (i < 0xc0) {
368 blank_rows[ch] = i - 0x80;
369 continue;
370 }
371 if (i < 0xd0)
372 continue;
373 if (i < 0xe0) {
374 tempo = i - 0xcf;
375 continue;
376 }
377 pattern_rows = 0;
378 }
379 blank_rows_counter[ch] = blank_rows[ch];
380 }
381 player_calls += tempo;
382 }
383 pos++;
384 }
385 if (player_calls > 0)
386 set_song_duration(module_info, player_calls);
387}
388
389FILE_FUNC abool parse_mpt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
390 const byte ARRAY module, int module_len)
391{
392 int track0_addr;
393 int pos;
394 int song_len;
395 /* seen[i] == TRUE if the track position i has been processed */
396 NEW_ARRAY(abool, global_seen, 256);
397 if (module_len < 0x1d0)
398 return FALSE;
399 MODULE_INFO type = 'm';
400 if (!load_native(ast, module_info, module, module_len, GET_OBX(mpt)))
401 return FALSE;
402 track0_addr = UBYTE(module[2]) + (UBYTE(module[3]) << 8) + 0x1ca;
403 if (UBYTE(module[0x1c6]) + (UBYTE(module[0x1ca]) << 8) != track0_addr)
404 return FALSE;
405 /* Calculate the length of the first track. Address of the second track minus
406 address of the first track equals the length of the first track in bytes.
407 Divide by two to get number of track positions. */
408 song_len = (UBYTE(module[0x1c7]) + (UBYTE(module[0x1cb]) << 8) - track0_addr) >> 1;
409 if (song_len > 0xfe)
410 return FALSE;
411 INIT_ARRAY(global_seen);
412 MODULE_INFO songs = 0;
413 for (pos = 0; pos < song_len && MODULE_INFO songs < MAX_SONGS; pos++) {
414 if (!global_seen[pos]) {
415 MODULE_INFO song_pos[MODULE_INFO songs] = (byte) pos;
416 parse_mpt_song(module_info, module, global_seen, song_len, pos);
417 }
418 }
419 return MODULE_INFO songs != 0;
420}
421
422CONST_LOOKUP(byte, rmt_volume_silent) = { 16, 8, 4, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 };
423
424FILE_FUNC int rmt_instrument_frames(const byte ARRAY module, int instrument, int volume, int volume_frame, abool extra_pokey)
425{
426 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6;
427 int per_frame = module[0xc];
428 int player_call;
429 int player_calls;
430 int index;
431 int index_end;
432 int index_loop;
433 int volume_slide_depth;
434 int volume_min;
435 abool looping;
436 int volume_slide;
437 abool silent_loop;
438 instrument = UBYTE(module[0xe]) + (UBYTE(module[0xf]) << 8) - addr_to_offset + (instrument << 1);
439 if (module[instrument + 1] == 0)
440 return 0;
441 instrument = UBYTE(module[instrument]) + (UBYTE(module[instrument + 1]) << 8) - addr_to_offset;
442 player_calls = player_call = volume_frame * per_frame;
443 index = UBYTE(module[instrument]) + 1 + player_call * 3;
444 index_end = UBYTE(module[instrument + 2]) + 3;
445 index_loop = UBYTE(module[instrument + 3]);
446 if (index_loop >= index_end)
447 return 0; /* error */
448 volume_slide_depth = UBYTE(module[instrument + 6]);
449 volume_min = UBYTE(module[instrument + 7]);
450 looping = index >= index_end;
451 if (looping)
452 index = (index - index_end) % (index_end - index_loop) + index_loop;
453 else {
454 do {
455 int vol = module[instrument + index];
456 if (extra_pokey)
457 vol >>= 4;
458 if ((vol & 0xf) >= rmt_volume_silent[volume])
459 player_calls = player_call + 1;
460 player_call++;
461 index += 3;
462 } while (index < index_end);
463 }
464 if (volume_slide_depth == 0)
465 return player_calls / per_frame;
466 volume_slide = 128;
467 silent_loop = FALSE;
468 for (;;) {
469 int vol;
470 if (index >= index_end) {
471 if (silent_loop)
472 break;
473 silent_loop = TRUE;
474 index = index_loop;
475 }
476 vol = module[instrument + index];
477 if (extra_pokey)
478 vol >>= 4;
479 if ((vol & 0xf) >= rmt_volume_silent[volume]) {
480 player_calls = player_call + 1;
481 silent_loop = FALSE;
482 }
483 player_call++;
484 index += 3;
485 volume_slide -= volume_slide_depth;
486 if (volume_slide < 0) {
487 volume_slide += 256;
488 if (--volume <= volume_min)
489 break;
490 }
491 }
492 return player_calls / per_frame;
493}
494
495FILE_FUNC void parse_rmt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module,
496 abool ARRAY global_seen, int song_len, int pos_shift, int pos)
497{
498 int ch;
499 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6;
500 int tempo = UBYTE(module[0xb]);
501 int frames = 0;
502 int song_offset = UBYTE(module[0x14]) + (UBYTE(module[0x15]) << 8) - addr_to_offset;
503 int pattern_lo_offset = UBYTE(module[0x10]) + (UBYTE(module[0x11]) << 8) - addr_to_offset;
504 int pattern_hi_offset = UBYTE(module[0x12]) + (UBYTE(module[0x13]) << 8) - addr_to_offset;
505 int instrument_frames;
506 NEW_ARRAY(byte, seen, 256);
507 NEW_ARRAY(int, pattern_begin, 8);
508 NEW_ARRAY(int, pattern_offset, 8);
509 NEW_ARRAY(int, blank_rows, 8);
510 NEW_ARRAY(int, instrument_no, 8);
511 NEW_ARRAY(int, instrument_frame, 8);
512 NEW_ARRAY(int, volume_value, 8);
513 NEW_ARRAY(int, volume_frame, 8);
514 INIT_ARRAY(seen);
515 INIT_ARRAY(instrument_no);
516 INIT_ARRAY(instrument_frame);
517 INIT_ARRAY(volume_value);
518 INIT_ARRAY(volume_frame);
519 while (pos < song_len) {
520 int i;
521 int pattern_rows;
522 if (seen[pos] != 0) {
523 if (seen[pos] != SEEN_THIS_CALL)
524 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
525 break;
526 }
527 seen[pos] = SEEN_THIS_CALL;
528 global_seen[pos] = TRUE;
529 if (UBYTE(module[song_offset + (pos << pos_shift)]) == 0xfe) {
530 pos = UBYTE(module[song_offset + (pos << pos_shift) + 1]);
531 continue;
532 }
533 for (ch = 0; ch < 1 << pos_shift; ch++) {
534 i = UBYTE(module[song_offset + (pos << pos_shift) + ch]);
535 if (i == 0xff)
536 blank_rows[ch] = 256;
537 else {
538 pattern_offset[ch] = pattern_begin[ch] = UBYTE(module[pattern_lo_offset + i])
539 + (UBYTE(module[pattern_hi_offset + i]) << 8) - addr_to_offset;
540 blank_rows[ch] = 0;
541 }
542 }
543 for (i = 0; i < song_len; i++)
544 if (seen[i] == SEEN_THIS_CALL)
545 seen[i] = SEEN_BEFORE;
546 for (pattern_rows = UBYTE(module[0xa]); --pattern_rows >= 0; ) {
547 for (ch = 0; ch < 1 << pos_shift; ch++) {
548 if (--blank_rows[ch] > 0)
549 continue;
550 for (;;) {
551 i = UBYTE(module[pattern_offset[ch]++]);
552 if ((i & 0x3f) < 62) {
553 i += UBYTE(module[pattern_offset[ch]++]) << 8;
554 if ((i & 0x3f) != 61) {
555 instrument_no[ch] = i >> 10;
556 instrument_frame[ch] = frames;
557 }
558 volume_value[ch] = (i >> 6) & 0xf;
559 volume_frame[ch] = frames;
560 break;
561 }
562 if (i == 62) {
563 blank_rows[ch] = UBYTE(module[pattern_offset[ch]++]);
564 break;
565 }
566 if ((i & 0x3f) == 62) {
567 blank_rows[ch] = i >> 6;
568 break;
569 }
570 if ((i & 0xbf) == 63) {
571 tempo = UBYTE(module[pattern_offset[ch]++]);
572 continue;
573 }
574 if (i == 0xbf) {
575 pattern_offset[ch] = pattern_begin[ch] + UBYTE(module[pattern_offset[ch]]);
576 continue;
577 }
578 /* assert(i == 0xff); */
579 pattern_rows = -1;
580 break;
581 }
582 if (pattern_rows < 0)
583 break;
584 }
585 if (pattern_rows >= 0)
586 frames += tempo;
587 }
588 pos++;
589 }
590 instrument_frames = 0;
591 for (ch = 0; ch < 1 << pos_shift; ch++) {
592 int frame = instrument_frame[ch];
593 frame += rmt_instrument_frames(module, instrument_no[ch], volume_value[ch], volume_frame[ch] - frame, ch >= 4);
594 if (instrument_frames < frame)
595 instrument_frames = frame;
596 }
597 if (frames > instrument_frames) {
598 if (frames - instrument_frames > 100)
599 MODULE_INFO loops[MODULE_INFO songs] = FALSE;
600 frames = instrument_frames;
601 }
602 if (frames > 0)
603 set_song_duration(module_info, frames);
604}
605
606FILE_FUNC abool parse_rmt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
607 const byte ARRAY module, int module_len)
608{
609 int per_frame;
610 int pos_shift;
611 int song_len;
612 int pos;
613 NEW_ARRAY(abool, global_seen, 256);
614 if (module_len < 0x30 || module[6] != 'R' || module[7] != 'M'
615 || module[8] != 'T' || module[0xd] != 1)
616 return FALSE;
617 switch ((char) module[9]) {
618 case '4':
619 pos_shift = 2;
620 break;
621 case '8':
622 MODULE_INFO channels = 2;
623 pos_shift = 3;
624 break;
625 default:
626 return FALSE;
627 }
628 per_frame = module[0xc];
629 if (per_frame < 1 || per_frame > 4)
630 return FALSE;
631 MODULE_INFO type = 'r';
632 if (!load_native(ast, module_info, module, module_len,
633 MODULE_INFO channels == 2 ? GET_OBX(rmt8) : GET_OBX(rmt4)))
634 return FALSE;
635 song_len = UBYTE(module[4]) + (UBYTE(module[5]) << 8) + 1
636 - UBYTE(module[0x14]) - (UBYTE(module[0x15]) << 8);
637 if (pos_shift == 3 && (song_len & 4) != 0
638 && UBYTE(module[6 + UBYTE(module[4]) + (UBYTE(module[5]) << 8)
639 - UBYTE(module[2]) - (UBYTE(module[3]) << 8) - 3]) == 0xfe)
640 song_len += 4;
641 song_len >>= pos_shift;
642 if (song_len >= 0x100)
643 return FALSE;
644 INIT_ARRAY(global_seen);
645 MODULE_INFO songs = 0;
646 for (pos = 0; pos < song_len && MODULE_INFO songs < MAX_SONGS; pos++) {
647 if (!global_seen[pos]) {
648 MODULE_INFO song_pos[MODULE_INFO songs] = (byte) pos;
649 parse_rmt_song(module_info, module, global_seen, song_len, pos_shift, pos);
650 }
651 }
652 /* must set fastplay after song durations calculations, so they assume 312 */
653 MODULE_INFO fastplay = perframe2fastplay[per_frame - 1];
654 MODULE_INFO player = 0x600;
655 return MODULE_INFO songs != 0;
656}
657
658FILE_FUNC void parse_tmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos)
659{
660 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6;
661 int tempo = UBYTE(module[0x24]) + 1;
662 int frames = 0;
663 NEW_ARRAY(int, pattern_offset, 8);
664 NEW_ARRAY(int, blank_rows, 8);
665 while (UBYTE(module[0x1a6 + 15 + pos]) < 0x80) {
666 int ch;
667 int pattern_rows;
668 for (ch = 7; ch >= 0; ch--) {
669 int pat = UBYTE(module[0x1a6 + 15 + pos - 2 * ch]);
670 pattern_offset[ch] = UBYTE(module[0xa6 + pat]) + (UBYTE(module[0x126 + pat]) << 8) - addr_to_offset;
671 blank_rows[ch] = 0;
672 }
673 for (pattern_rows = 64; --pattern_rows >= 0; ) {
674 for (ch = 7; ch >= 0; ch--) {
675 if (--blank_rows[ch] >= 0)
676 continue;
677 for (;;) {
678 int i = UBYTE(module[pattern_offset[ch]++]);
679 if (i < 0x40) {
680 pattern_offset[ch]++;
681 break;
682 }
683 if (i == 0x40) {
684 i = UBYTE(module[pattern_offset[ch]++]);
685 if ((i & 0x7f) == 0)
686 pattern_rows = 0;
687 else
688 tempo = (i & 0x7f) + 1;
689 if (i >= 0x80)
690 pattern_offset[ch]++;
691 break;
692 }
693 if (i < 0x80) {
694 i = module[pattern_offset[ch]++] & 0x7f;
695 if (i == 0)
696 pattern_rows = 0;
697 else
698 tempo = i + 1;
699 pattern_offset[ch]++;
700 break;
701 }
702 if (i < 0xc0)
703 continue;
704 blank_rows[ch] = i - 0xbf;
705 break;
706 }
707 }
708 frames += tempo;
709 }
710 pos += 16;
711 }
712 if (UBYTE(module[0x1a6 + 14 + pos]) < 0x80)
713 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
714 set_song_duration(module_info, frames);
715}
716
717FILE_FUNC abool parse_tmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
718 const byte ARRAY module, int module_len)
719{
720 int i;
721 int last_pos;
722 if (module_len < 0x1d0)
723 return FALSE;
724 MODULE_INFO type = 't';
725 if (!load_native(ast, module_info, module, module_len, GET_OBX(tmc)))
726 return FALSE;
727 MODULE_INFO channels = 2;
728 i = 0;
729 /* find first instrument */
730 while (module[0x66 + i] == 0) {
731 if (++i >= 64)
732 return FALSE; /* no instrument */
733 }
734 last_pos = (UBYTE(module[0x66 + i]) << 8) + UBYTE(module[0x26 + i])
735 - UBYTE(module[2]) - (UBYTE(module[3]) << 8) - 0x1b0;
736 if (0x1b5 + last_pos >= module_len)
737 return FALSE;
738 /* skip trailing jumps */
739 do {
740 if (last_pos <= 0)
741 return FALSE; /* no pattern to play */
742 last_pos -= 16;
743 } while (UBYTE(module[0x1b5 + last_pos]) >= 0x80);
744 MODULE_INFO songs = 0;
745 parse_tmc_song(module_info, module, 0);
746 for (i = 0; i < last_pos && MODULE_INFO songs < MAX_SONGS; i += 16)
747 if (UBYTE(module[0x1b5 + i]) >= 0x80)
748 parse_tmc_song(module_info, module, i + 16);
749 /* must set fastplay after song durations calculations, so they assume 312 */
750 i = module[0x25];
751 if (i < 1 || i > 4)
752 return FALSE;
753 if (ast != NULL)
754 AST tmc_per_frame = module[0x25];
755 MODULE_INFO fastplay = perframe2fastplay[i - 1];
756 return TRUE;
757}
758
759FILE_FUNC void parse_tm2_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos)
760{
761 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6;
762 int tempo = UBYTE(module[0x24]) + 1;
763 int player_calls = 0;
764 NEW_ARRAY(int, pattern_offset, 8);
765 NEW_ARRAY(int, blank_rows, 8);
766 for (;;) {
767 int ch;
768 int pattern_rows = UBYTE(module[0x386 + 16 + pos]);
769 if (pattern_rows == 0)
770 break;
771 if (pattern_rows >= 0x80) {
772 MODULE_INFO loops[MODULE_INFO songs] = TRUE;
773 break;
774 }
775 for (ch = 7; ch >= 0; ch--) {
776 int pat = UBYTE(module[0x386 + 15 + pos - 2 * ch]);
777 pattern_offset[ch] = UBYTE(module[0x106 + pat]) + (UBYTE(module[0x206 + pat]) << 8) - addr_to_offset;
778 blank_rows[ch] = 0;
779 }
780 while (--pattern_rows >= 0) {
781 for (ch = 7; ch >= 0; ch--) {
782 if (--blank_rows[ch] >= 0)
783 continue;
784 for (;;) {
785 int i = UBYTE(module[pattern_offset[ch]++]);
786 if (i == 0) {
787 pattern_offset[ch]++;
788 break;
789 }
790 if (i < 0x40) {
791 if (UBYTE(module[pattern_offset[ch]++]) >= 0x80)
792 pattern_offset[ch]++;
793 break;
794 }
795 if (i < 0x80) {
796 pattern_offset[ch]++;
797 break;
798 }
799 if (i == 0x80) {
800 blank_rows[ch] = UBYTE(module[pattern_offset[ch]++]);
801 break;
802 }
803 if (i < 0xc0)
804 break;
805 if (i < 0xd0) {
806 tempo = i - 0xbf;
807 continue;
808 }
809 if (i < 0xe0) {
810 pattern_offset[ch]++;
811 break;
812 }
813 if (i < 0xf0) {
814 pattern_offset[ch] += 2;
815 break;
816 }
817 if (i < 0xff) {
818 blank_rows[ch] = i - 0xf0;
819 break;
820 }
821 blank_rows[ch] = 64;
822 break;
823 }
824 }
825 player_calls += tempo;
826 }
827 pos += 17;
828 }
829 set_song_duration(module_info, player_calls);
830}
831
832FILE_FUNC abool parse_tm2(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
833 const byte ARRAY module, int module_len)
834{
835 int i;
836 int last_pos;
837 int c;
838 if (module_len < 0x3a4)
839 return FALSE;
840 MODULE_INFO type = 'T';
841 if (!load_native(ast, module_info, module, module_len, GET_OBX(tm2)))
842 return FALSE;
843 i = module[0x25];
844 if (i < 1 || i > 4)
845 return FALSE;
846 MODULE_INFO fastplay = perframe2fastplay[i - 1];
847 MODULE_INFO player = 0x500;
848 if (module[0x1f] != 0)
849 MODULE_INFO channels = 2;
850 last_pos = 0xffff;
851 for (i = 0; i < 0x80; i++) {
852 int instr_addr = UBYTE(module[0x86 + i]) + (UBYTE(module[0x306 + i]) << 8);
853 if (instr_addr != 0 && instr_addr < last_pos)
854 last_pos = instr_addr;
855 }
856 for (i = 0; i < 0x100; i++) {
857 int pattern_addr = UBYTE(module[0x106 + i]) + (UBYTE(module[0x206 + i]) << 8);
858 if (pattern_addr != 0 && pattern_addr < last_pos)
859 last_pos = pattern_addr;
860 }
861 last_pos -= UBYTE(module[2]) + (UBYTE(module[3]) << 8) + 0x380;
862 if (0x386 + last_pos >= module_len)
863 return FALSE;
864 /* skip trailing stop/jump commands */
865 do {
866 if (last_pos <= 0)
867 return FALSE;
868 last_pos -= 17;
869 c = UBYTE(module[0x386 + 16 + last_pos]);
870 } while (c == 0 || c >= 0x80);
871 MODULE_INFO songs = 0;
872 parse_tm2_song(module_info, module, 0);
873 for (i = 0; i < last_pos && MODULE_INFO songs < MAX_SONGS; i += 17) {
874 c = UBYTE(module[0x386 + 16 + i]);
875 if (c == 0 || c >= 0x80)
876 parse_tm2_song(module_info, module, i + 17);
877 }
878 return TRUE;
879}
880
881#if !defined(JAVA) && !defined(CSHARP)
882
883static abool parse_hex(int *retval, const char *p)
884{
885 int r = 0;
886 do {
887 char c = *p;
888 if (r > 0xfff)
889 return FALSE;
890 r <<= 4;
891 if (c >= '0' && c <= '9')
892 r += c - '0';
893 else if (c >= 'A' && c <= 'F')
894 r += c - 'A' + 10;
895 else if (c >= 'a' && c <= 'f')
896 r += c - 'a' + 10;
897 else
898 return FALSE;
899 } while (*++p != '\0');
900 *retval = r;
901 return TRUE;
902}
903
904static abool parse_dec(int *retval, const char *p, int minval, int maxval)
905{
906 int r = 0;
907 do {
908 char c = *p;
909 if (c >= '0' && c <= '9')
910 r = 10 * r + c - '0';
911 else
912 return FALSE;
913 if (r > maxval)
914 return FALSE;
915 } while (*++p != '\0');
916 if (r < minval)
917 return FALSE;
918 *retval = r;
919 return TRUE;
920}
921
922static abool parse_text(char *retval, const char *p)
923{
924 int i;
925 if (*p != '"')
926 return FALSE;
927 p++;
928 if (p[0] == '<' && p[1] == '?' && p[2] == '>' && p[3] == '"')
929 return TRUE;
930 i = 0;
931 while (*p != '"') {
932 if (i >= 127)
933 return FALSE;
934 if (*p == '\0')
935 return FALSE;
936 retval[i++] = *p++;
937 }
938 retval[i] = '\0';
939 return TRUE;
940}
941
942int ASAP_ParseDuration(const char *s)
943{
944 int r;
945 if (*s < '0' || *s > '9')
946 return -1;
947 r = *s++ - '0';
948 if (*s >= '0' && *s <= '9')
949 r = 10 * r + *s++ - '0';
950 if (*s == ':') {
951 s++;
952 if (*s < '0' || *s > '5')
953 return -1;
954 r = 60 * r + (*s++ - '0') * 10;
955 if (*s < '0' || *s > '9')
956 return -1;
957 r += *s++ - '0';
958 }
959 r *= 1000;
960 if (*s != '.')
961 return r;
962 s++;
963 if (*s < '0' || *s > '9')
964 return r;
965 r += 100 * (*s++ - '0');
966 if (*s < '0' || *s > '9')
967 return r;
968 r += 10 * (*s++ - '0');
969 if (*s < '0' || *s > '9')
970 return r;
971 r += *s - '0';
972 return r;
973}
974
975static char *two_digits(char *s, int x)
976{
977 s[0] = '0' + x / 10;
978 s[1] = '0' + x % 10;
979 return s + 2;
980}
981
982void ASAP_DurationToString(char *s, int duration)
983{
984 if (duration >= 0) {
985 int seconds = duration / 1000;
986 int minutes = seconds / 60;
987 s = two_digits(s, minutes);
988 *s++ = ':';
989 s = two_digits(s, seconds % 60);
990 duration %= 1000;
991 if (duration != 0) {
992 *s++ = '.';
993 s = two_digits(s, duration / 10);
994 duration %= 10;
995 if (duration != 0)
996 *s++ = '0' + duration;
997 }
998 }
999 *s = '\0';
1000}
1001
1002#endif /* !defined(JAVA) && !defined(CSHARP) */
1003
1004FILE_FUNC abool parse_sap_header(ASAP_ModuleInfo PTR module_info,
1005 const byte ARRAY module, int module_len)
1006{
1007 int module_index = 0;
1008 abool sap_signature = FALSE;
1009 int duration_index = 0;
1010 for (;;) {
1011 NEW_ARRAY(char, line, 256);
1012 int i;
1013#if !defined(JAVA) && !defined(CSHARP)
1014 char *p;
1015#endif
1016 if (module_index + 8 >= module_len)
1017 return FALSE;
1018 if (UBYTE(module[module_index]) == 0xff)
1019 break;
1020 i = 0;
1021 while (module[module_index] != 0x0d) {
1022 line[i++] = (char) module[module_index++];
1023 if (module_index >= module_len || (unsigned)i >= sizeof(line) - 1)
1024 return FALSE;
1025 }
1026 if (++module_index >= module_len || module[module_index++] != 0x0a)
1027 return FALSE;
1028
1029#ifdef JAVA
1030 String tag = new String(line, 0, i);
1031 String arg = null;
1032 i = tag.indexOf(' ');
1033 if (i >= 0) {
1034 arg = tag.substring(i + 1);
1035 tag = tag.substring(0, i);
1036 }
1037#define TAG_IS(t) tag.equals(t)
1038#define CHAR_ARG arg.charAt(0)
1039#define SET_HEX(v) v = Integer.parseInt(arg, 16)
1040#define SET_DEC(v, min, max) do { v = Integer.parseInt(arg); if (v < min || v > max) return FALSE; } while (FALSE)
1041#define SET_TEXT(v) v = arg.substring(1, arg.length() - 1)
1042#define DURATION_ARG parseDuration(arg)
1043#define ARG_CONTAINS(t) (arg.indexOf(t) >= 0)
1044#elif defined(CSHARP)
1045 string tag = new string(line, 0, i);
1046 string arg = null;
1047 i = tag.IndexOf(' ');
1048 if (i >= 0) {
1049 arg = tag.Substring(i + 1);
1050 tag = tag.Substring(0, i);
1051 }
1052#define TAG_IS(t) tag == t
1053#define CHAR_ARG arg[0]
1054#define SET_HEX(v) v = int.Parse(arg, System.Globalization.NumberStyles.HexNumber)
1055#define SET_DEC(v, min, max) do { v = int.Parse(arg); if (v < min || v > max) return FALSE; } while (FALSE)
1056#define SET_TEXT(v) v = arg.Substring(1, arg.Length - 1)
1057#define DURATION_ARG ParseDuration(arg)
1058#define ARG_CONTAINS(t) (arg.IndexOf(t) >= 0)
1059#else
1060 line[i] = '\0';
1061 for (p = line; *p != '\0'; p++) {
1062 if (*p == ' ') {
1063 *p++ = '\0';
1064 break;
1065 }
1066 }
1067#define TAG_IS(t) (strcmp(line, t) == 0)
1068#define CHAR_ARG *p
1069#define SET_HEX(v) do { if (!parse_hex(&v, p)) return FALSE; } while (FALSE)
1070#define SET_DEC(v, min, max) do { if (!parse_dec(&v, p, min, max)) return FALSE; } while (FALSE)
1071#define SET_TEXT(v) do { if (!parse_text(v, p)) return FALSE; } while (FALSE)
1072#define DURATION_ARG ASAP_ParseDuration(p)
1073#define ARG_CONTAINS(t) (strstr(p, t) != NULL)
1074#endif
1075
1076 if (TAG_IS("SAP"))
1077 sap_signature = TRUE;
1078 if (!sap_signature)
1079 return FALSE;
1080 if (TAG_IS("AUTHOR"))
1081 SET_TEXT(MODULE_INFO author);
1082 else if (TAG_IS("NAME"))
1083 SET_TEXT(MODULE_INFO name);
1084 else if (TAG_IS("DATE"))
1085 SET_TEXT(MODULE_INFO date);
1086 else if (TAG_IS("SONGS"))
1087 SET_DEC(MODULE_INFO songs, 1, MAX_SONGS);
1088 else if (TAG_IS("DEFSONG"))
1089 SET_DEC(MODULE_INFO default_song, 0, MAX_SONGS - 1);
1090 else if (TAG_IS("STEREO"))
1091 MODULE_INFO channels = 2;
1092 else if (TAG_IS("TIME")) {
1093 int duration = DURATION_ARG;
1094 if (duration < 0 || duration_index >= MAX_SONGS)
1095 return FALSE;
1096 MODULE_INFO durations[duration_index] = duration;
1097 if (ARG_CONTAINS("LOOP"))
1098 MODULE_INFO loops[duration_index] = TRUE;
1099 duration_index++;
1100 }
1101 else if (TAG_IS("TYPE"))
1102 MODULE_INFO type = CHAR_ARG;
1103 else if (TAG_IS("FASTPLAY"))
1104 SET_DEC(MODULE_INFO fastplay, 1, 312);
1105 else if (TAG_IS("MUSIC"))
1106 SET_HEX(MODULE_INFO music);
1107 else if (TAG_IS("INIT"))
1108 SET_HEX(MODULE_INFO init);
1109 else if (TAG_IS("PLAYER"))
1110 SET_HEX(MODULE_INFO player);
1111 }
1112 if (MODULE_INFO default_song >= MODULE_INFO songs)
1113 return FALSE;
1114 switch (MODULE_INFO type) {
1115 case 'B':
1116 case 'D':
1117 if (MODULE_INFO player < 0 || MODULE_INFO init < 0)
1118 return FALSE;
1119 break;
1120 case 'C':
1121 if (MODULE_INFO player < 0 || MODULE_INFO music < 0)
1122 return FALSE;
1123 break;
1124 case 'S':
1125 if (MODULE_INFO init < 0)
1126 return FALSE;
1127 MODULE_INFO fastplay = 78;
1128 break;
1129 default:
1130 return FALSE;
1131 }
1132 if (UBYTE(module[module_index + 1]) != 0xff)
1133 return FALSE;
1134 MODULE_INFO header_len = module_index;
1135 return TRUE;
1136}
1137
1138FILE_FUNC abool parse_sap(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
1139 const byte ARRAY module, int module_len)
1140{
1141 int module_index;
1142 if (!parse_sap_header(module_info, module, module_len))
1143 return FALSE;
1144 if (ast == NULL)
1145 return TRUE;
1146 ZERO_ARRAY(AST memory);
1147 module_index = MODULE_INFO header_len + 2;
1148 while (module_index + 5 <= module_len) {
1149 int start_addr = UBYTE(module[module_index]) + (UBYTE(module[module_index + 1]) << 8);
1150 int block_len = UBYTE(module[module_index + 2]) + (UBYTE(module[module_index + 3]) << 8) + 1 - start_addr;
1151 if (block_len <= 0 || module_index + block_len > module_len)
1152 return FALSE;
1153 module_index += 4;
1154 COPY_ARRAY(AST memory, start_addr, module, module_index, block_len);
1155 module_index += block_len;
1156 if (module_index == module_len)
1157 return TRUE;
1158 if (module_index + 7 <= module_len
1159 && UBYTE(module[module_index]) == 0xff && UBYTE(module[module_index + 1]) == 0xff)
1160 module_index += 2;
1161 }
1162 return FALSE;
1163}
1164
1165#define ASAP_EXT(c1, c2, c3) (((c1) + ((c2) << 8) + ((c3) << 16)) | 0x202020)
1166
1167FILE_FUNC int get_packed_ext(STRING filename)
1168{
1169#ifdef JAVA
1170 int i = filename.length();
1171 int ext = 0;
1172 while (--i > 0) {
1173 if (filename.charAt(i) == '.')
1174 return ext | 0x202020;
1175 ext = (ext << 8) + filename.charAt(i);
1176 }
1177 return 0;
1178#elif defined(CSHARP)
1179 int i = filename.Length;
1180 int ext = 0;
1181 while (--i > 0) {
1182 if (filename[i] == '.')
1183 return ext | 0x202020;
1184 ext = (ext << 8) + filename[i];
1185 }
1186 return 0;
1187#else
1188 const char *p;
1189 int ext;
1190 for (p = filename; *p != '\0'; p++);
1191 ext = 0;
1192 for (;;) {
1193 if (--p <= filename || *p <= ' ')
1194 return 0; /* no filename extension or invalid character */
1195 if (*p == '.')
1196 return ext | 0x202020;
1197 ext = (ext << 8) + (*p & 0xff);
1198 }
1199#endif
1200}
1201
1202FILE_FUNC abool is_our_ext(int ext)
1203{
1204 switch (ext) {
1205 case ASAP_EXT('C', 'M', 'C'):
1206 case ASAP_EXT('C', 'M', 'R'):
1207 case ASAP_EXT('D', 'M', 'C'):
1208 case ASAP_EXT('M', 'P', 'D'):
1209 case ASAP_EXT('M', 'P', 'T'):
1210 case ASAP_EXT('R', 'M', 'T'):
1211 case ASAP_EXT('S', 'A', 'P'):
1212 case ASAP_EXT('T', 'M', '2'):
1213 case ASAP_EXT('T', 'M', '8'):
1214 case ASAP_EXT('T', 'M', 'C'):
1215 return TRUE;
1216 default:
1217 return FALSE;
1218 }
1219}
1220
1221ASAP_FUNC abool ASAP_IsOurFile(STRING filename)
1222{
1223 int ext = get_packed_ext(filename);
1224 return is_our_ext(ext);
1225}
1226
1227ASAP_FUNC abool ASAP_IsOurExt(STRING ext)
1228{
1229#ifdef JAVA
1230 return ext.length() == 3
1231 && is_our_ext(ASAP_EXT(ext.charAt(0), ext.charAt(1), ext.charAt(2)));
1232#else
1233 return ext[0] > ' ' && ext[1] > ' ' && ext[2] > ' ' && ext[3] == '\0'
1234 && is_our_ext(ASAP_EXT(ext[0], ext[1], ext[2]));
1235#endif
1236}
1237
1238FILE_FUNC abool parse_file(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
1239 STRING filename, const byte ARRAY module, int module_len)
1240{
1241 int i;
1242#ifdef JAVA
1243 int basename = 0;
1244 int ext = -1;
1245 for (i = 0; i < filename.length(); i++) {
1246 int c = filename.charAt(i);
1247 if (c == '/' || c == '\\')
1248 basename = i + 1;
1249 else if (c == '.')
1250 ext = i;
1251 }
1252 if (ext < 0)
1253 ext = i;
1254 module_info.author = "";
1255 module_info.name = filename.substring(basename, ext);
1256 module_info.date = "";
1257#elif defined(CSHARP)
1258 int basename = 0;
1259 int ext = -1;
1260 for (i = 0; i < filename.Length; i++) {
1261 int c = filename[i];
1262 if (c == '/' || c == '\\')
1263 basename = i + 1;
1264 else if (c == '.')
1265 ext = i;
1266 }
1267 if (ext < 0)
1268 ext = i;
1269 module_info.author = string.Empty;
1270 module_info.name = filename.Substring(basename, ext - basename);
1271 module_info.date = string.Empty;
1272#else
1273 const char *p;
1274 const char *basename = filename;
1275 const char *ext = NULL;
1276 for (p = filename; *p != '\0'; p++) {
1277 if (*p == '/' || *p == '\\')
1278 basename = p + 1;
1279 else if (*p == '.')
1280 ext = p;
1281 }
1282 if (ext == NULL)
1283 ext = p;
1284 module_info->author[0] = '\0';
1285 i = ext - basename;
1286 memcpy(module_info->name, basename, i);
1287 module_info->name[i] = '\0';
1288 module_info->date[0] = '\0';
1289#endif
1290 MODULE_INFO channels = 1;
1291 MODULE_INFO songs = 1;
1292 MODULE_INFO default_song = 0;
1293 for (i = 0; i < MAX_SONGS; i++) {
1294 MODULE_INFO durations[i] = -1;
1295 MODULE_INFO loops[i] = FALSE;
1296 }
1297 MODULE_INFO type = '?';
1298 MODULE_INFO fastplay = 312;
1299 MODULE_INFO music = -1;
1300 MODULE_INFO init = -1;
1301 MODULE_INFO player = -1;
1302 switch (get_packed_ext(filename)) {
1303 case ASAP_EXT('C', 'M', 'C'):
1304 return parse_cmc(ast, module_info, module, module_len, FALSE);
1305 case ASAP_EXT('C', 'M', 'R'):
1306 return parse_cmc(ast, module_info, module, module_len, TRUE);
1307 case ASAP_EXT('D', 'M', 'C'):
1308 MODULE_INFO fastplay = 156;
1309 return parse_cmc(ast, module_info, module, module_len, FALSE);
1310 case ASAP_EXT('M', 'P', 'D'):
1311 MODULE_INFO fastplay = 156;
1312 return parse_mpt(ast, module_info, module, module_len);
1313 case ASAP_EXT('M', 'P', 'T'):
1314 return parse_mpt(ast, module_info, module, module_len);
1315 case ASAP_EXT('R', 'M', 'T'):
1316 return parse_rmt(ast, module_info, module, module_len);
1317 case ASAP_EXT('S', 'A', 'P'):
1318 return parse_sap(ast, module_info, module, module_len);
1319 case ASAP_EXT('T', 'M', '2'):
1320 return parse_tm2(ast, module_info, module, module_len);
1321 case ASAP_EXT('T', 'M', '8'):
1322 case ASAP_EXT('T', 'M', 'C'):
1323 return parse_tmc(ast, module_info, module, module_len);
1324 default:
1325 return FALSE;
1326 }
1327}
1328
1329ASAP_FUNC abool ASAP_GetModuleInfo(ASAP_ModuleInfo PTR module_info, STRING filename,
1330 const byte ARRAY module, int module_len)
1331{
1332 return parse_file(NULL, module_info, filename, module, module_len);
1333}
1334
1335ASAP_FUNC abool ASAP_Load(ASAP_State PTR ast, STRING filename,
1336 const byte ARRAY module, int module_len)
1337{
1338 AST silence_cycles = 0;
1339 return parse_file(ast, ADDRESSOF AST module_info, filename, module, module_len);
1340}
1341
1342ASAP_FUNC void ASAP_DetectSilence(ASAP_State PTR ast, int seconds)
1343{
1344 AST silence_cycles = seconds * ASAP_MAIN_CLOCK;
1345}
1346
1347FILE_FUNC void call_6502(ASAP_State PTR ast, int addr, int max_scanlines)
1348{
1349 AST cpu_pc = addr;
1350 /* put a CIM at 0xd20a and a return address on stack */
1351 dPutByte(0xd20a, 0xd2);
1352 dPutByte(0x01fe, 0x09);
1353 dPutByte(0x01ff, 0xd2);
1354 AST cpu_s = 0xfd;
1355 Cpu_RunScanlines(ast, max_scanlines);
1356}
1357
1358/* 50 Atari frames for the initialization routine - some SAPs are self-extracting. */
1359#define SCANLINES_FOR_INIT (50 * 312)
1360
1361FILE_FUNC void call_6502_init(ASAP_State PTR ast, int addr, int a, int x, int y)
1362{
1363 AST cpu_a = a & 0xff;
1364 AST cpu_x = x & 0xff;
1365 AST cpu_y = y & 0xff;
1366 call_6502(ast, addr, SCANLINES_FOR_INIT);
1367}
1368
1369ASAP_FUNC void ASAP_PlaySong(ASAP_State PTR ast, int song, int duration)
1370{
1371 AST current_song = song;
1372 AST current_duration = duration;
1373 AST blocks_played = 0;
1374 AST silence_cycles_counter = AST silence_cycles;
1375 AST extra_pokey_mask = AST module_info.channels > 1 ? 0x10 : 0;
1376 PokeySound_Initialize(ast);
1377 AST cycle = 0;
1378 AST cpu_nz = 0;
1379 AST cpu_c = 0;
1380 AST cpu_vdi = 0;
1381 AST scanline_number = 0;
1382 AST next_scanline_cycle = 0;
1383 AST timer1_cycle = NEVER;
1384 AST timer2_cycle = NEVER;
1385 AST timer4_cycle = NEVER;
1386 AST irqst = 0xff;
1387 switch (AST module_info.type) {
1388 case 'B':
1389 call_6502_init(ast, AST module_info.init, song, 0, 0);
1390 break;
1391 case 'C':
1392 case 'c':
1393 case 'z':
1394 call_6502_init(ast, AST module_info.player + 3, 0x70, AST module_info.music, AST module_info.music >> 8);
1395 call_6502_init(ast, AST module_info.player + 3, 0x00, song, 0);
1396 break;
1397 case 'D':
1398 case 'S':
1399 AST cpu_a = song;
1400 AST cpu_x = 0x00;
1401 AST cpu_y = 0x00;
1402 AST cpu_s = 0xff;
1403 AST cpu_pc = AST module_info.init;
1404 break;
1405 case 'm':
1406 call_6502_init(ast, AST module_info.player, 0x00, AST module_info.music >> 8, AST module_info.music);
1407 call_6502_init(ast, AST module_info.player, 0x02, AST module_info.song_pos[song], 0);
1408 break;
1409 case 'r':
1410 call_6502_init(ast, AST module_info.player, AST module_info.song_pos[song], AST module_info.music, AST module_info.music >> 8);
1411 break;
1412 case 't':
1413 case 'T':
1414 call_6502_init(ast, AST module_info.player, 0x70, AST module_info.music >> 8, AST module_info.music);
1415 call_6502_init(ast, AST module_info.player, 0x00, song, 0);
1416 AST tmc_per_frame_counter = 1;
1417 break;
1418 }
1419 ASAP_MutePokeyChannels(ast, 0);
1420}
1421
1422ASAP_FUNC void ASAP_MutePokeyChannels(ASAP_State PTR ast, int mask)
1423{
1424 PokeySound_Mute(ast, ADDRESSOF AST base_pokey, mask);
1425 PokeySound_Mute(ast, ADDRESSOF AST extra_pokey, mask >> 4);
1426}
1427
1428ASAP_FUNC abool call_6502_player(ASAP_State PTR ast)
1429{
1430 int s;
1431 PokeySound_StartFrame(ast);
1432 switch (AST module_info.type) {
1433 case 'B':
1434 call_6502(ast, AST module_info.player, AST module_info.fastplay);
1435 break;
1436 case 'C':
1437 case 'c':
1438 case 'z':
1439 call_6502(ast, AST module_info.player + 6, AST module_info.fastplay);
1440 break;
1441 case 'D':
1442 s = AST cpu_s;
1443#define PUSH_ON_6502_STACK(x) dPutByte(0x100 + s, x); s = (s - 1) & 0xff
1444#define RETURN_FROM_PLAYER_ADDR 0xd200
1445 /* save 6502 state on 6502 stack */
1446 PUSH_ON_6502_STACK(AST cpu_pc >> 8);
1447 PUSH_ON_6502_STACK(AST cpu_pc & 0xff);
1448 PUSH_ON_6502_STACK(((AST cpu_nz | (AST cpu_nz >> 1)) & 0x80) + AST cpu_vdi + \
1449 ((AST cpu_nz & 0xff) == 0 ? Z_FLAG : 0) + AST cpu_c + 0x20);
1450 PUSH_ON_6502_STACK(AST cpu_a);
1451 PUSH_ON_6502_STACK(AST cpu_x);
1452 PUSH_ON_6502_STACK(AST cpu_y);
1453 /* RTS will jump to 6502 code that restores the state */
1454 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) >> 8);
1455 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) & 0xff);
1456 AST cpu_s = s;
1457 dPutByte(RETURN_FROM_PLAYER_ADDR, 0x68); /* PLA */
1458 dPutByte(RETURN_FROM_PLAYER_ADDR + 1, 0xa8); /* TAY */
1459 dPutByte(RETURN_FROM_PLAYER_ADDR + 2, 0x68); /* PLA */
1460 dPutByte(RETURN_FROM_PLAYER_ADDR + 3, 0xaa); /* TAX */
1461 dPutByte(RETURN_FROM_PLAYER_ADDR + 4, 0x68); /* PLA */
1462 dPutByte(RETURN_FROM_PLAYER_ADDR + 5, 0x40); /* RTI */
1463 AST cpu_pc = AST module_info.player;
1464 Cpu_RunScanlines(ast, AST module_info.fastplay);
1465 break;
1466 case 'S':
1467 Cpu_RunScanlines(ast, AST module_info.fastplay);
1468 {
1469 int i = dGetByte(0x45) - 1;
1470 dPutByte(0x45, i);
1471 if (i == 0)
1472 dPutByte(0xb07b, dGetByte(0xb07b) + 1);
1473 }
1474 break;
1475 case 'm':
1476 case 'r':
1477 case 'T':
1478 call_6502(ast, AST module_info.player + 3, AST module_info.fastplay);
1479 break;
1480 case 't':
1481 if (--AST tmc_per_frame_counter <= 0) {
1482 AST tmc_per_frame_counter = AST tmc_per_frame;
1483 call_6502(ast, AST module_info.player + 3, AST module_info.fastplay);
1484 }
1485 else
1486 call_6502(ast, AST module_info.player + 6, AST module_info.fastplay);
1487 break;
1488 }
1489 PokeySound_EndFrame(ast, AST module_info.fastplay * 114);
1490 if (AST silence_cycles > 0) {
1491 if (PokeySound_IsSilent(ADDRESSOF AST base_pokey)
1492 && PokeySound_IsSilent(ADDRESSOF AST extra_pokey)) {
1493 AST silence_cycles_counter -= AST module_info.fastplay * 114;
1494 if (AST silence_cycles_counter <= 0)
1495 return FALSE;
1496 }
1497 else
1498 AST silence_cycles_counter = AST silence_cycles;
1499 }
1500 return TRUE;
1501}
1502
1503FILE_FUNC int milliseconds_to_blocks(int milliseconds)
1504{
1505 return milliseconds * (ASAP_SAMPLE_RATE / 100) / 10;
1506}
1507
1508ASAP_FUNC void ASAP_Seek(ASAP_State PTR ast, int position)
1509{
1510 int block = milliseconds_to_blocks(position);
1511 if (block < AST blocks_played)
1512 ASAP_PlaySong(ast, AST current_song, AST current_duration);
1513 while (AST blocks_played + AST samples - AST sample_index < block) {
1514 AST blocks_played += AST samples - AST sample_index;
1515 call_6502_player(ast);
1516 }
1517 AST sample_index += block - AST blocks_played;
1518 AST blocks_played = block;
1519}
1520
1521ASAP_FUNC int ASAP_Generate(ASAP_State PTR ast, VOIDPTR buffer, int buffer_len,
1522 ASAP_SampleFormat format)
1523{
1524 int block_shift;
1525 int buffer_blocks;
1526 int block;
1527 if (AST silence_cycles > 0 && AST silence_cycles_counter <= 0)
1528 return 0;
1529 block_shift = (AST module_info.channels - 1) + (format != ASAP_FORMAT_U8 ? 1 : 0);
1530 buffer_blocks = buffer_len >> block_shift;
1531 if (AST current_duration > 0) {
1532 int total_blocks = milliseconds_to_blocks(AST current_duration);
1533 if (buffer_blocks > total_blocks - AST blocks_played)
1534 buffer_blocks = total_blocks - AST blocks_played;
1535 }
1536 block = 0;
1537 do {
1538 int blocks = PokeySound_Generate(ast, buffer, block << block_shift, buffer_blocks - block, format);
1539 AST blocks_played += blocks;
1540 block += blocks;
1541 } while (block < buffer_blocks && call_6502_player(ast));
1542 return block << block_shift;
1543}
1544
1545#if !defined(JAVA) && !defined(CSHARP)
1546
1547abool ASAP_ChangeExt(char *filename, const char *ext)
1548{
1549 char *dest = NULL;
1550 while (*filename != '\0') {
1551 if (*filename == '/' || *filename == '\\')
1552 dest = NULL;
1553 else if (*filename == '.')
1554 dest = filename + 1;
1555 filename++;
1556 }
1557 if (dest == NULL)
1558 return FALSE;
1559 strcpy(dest, ext);
1560 return TRUE;
1561}
1562
1563abool ASAP_CanSetModuleInfo(const char *filename)
1564{
1565 int ext = get_packed_ext(filename);
1566 return ext == ASAP_EXT('S', 'A', 'P');
1567}
1568
1569static byte *put_string(byte *dest, const char *str)
1570{
1571 while (*str != '\0')
1572 *dest++ = *str++;
1573 return dest;
1574}
1575
1576static byte *put_dec(byte *dest, int value)
1577{
1578 if (value >= 10) {
1579 dest = put_dec(dest, value / 10);
1580 value %= 10;
1581 }
1582 *dest++ = '0' + value;
1583 return dest;
1584}
1585
1586static byte *put_text_tag(byte *dest, const char *tag, const char *value)
1587{
1588 dest = put_string(dest, tag);
1589 *dest++ = ' ';
1590 *dest++ = '"';
1591 if (*value == '\0')
1592 value = "<?>";
1593 while (*value != '\0') {
1594 if (*value < ' ' || *value > 'z' || *value == '"' || *value == '`')
1595 return NULL;
1596 *dest++ = *value++;
1597 }
1598 *dest++ = '"';
1599 *dest++ = '\r';
1600 *dest++ = '\n';
1601 return dest;
1602}
1603
1604static byte *put_hex_tag(byte *dest, const char *tag, int value)
1605{
1606 int i;
1607 if (value < 0)
1608 return dest;
1609 dest = put_string(dest, tag);
1610 *dest++ = ' ';
1611 for (i = 12; i >= 0; i -= 4) {
1612 int digit = (value >> i) & 0xf;
1613 *dest++ = (byte) (digit + (digit < 10 ? '0' : 'A' - 10));
1614 }
1615 *dest++ = '\r';
1616 *dest++ = '\n';
1617 return dest;
1618}
1619
1620static byte *put_dec_tag(byte *dest, const char *tag, int value)
1621{
1622 dest = put_string(dest, tag);
1623 *dest++ = ' ';
1624 dest = put_dec(dest, value);
1625 *dest++ = '\r';
1626 *dest++ = '\n';
1627 return dest;
1628}
1629
1630static byte *start_sap_header(byte *dest, const ASAP_ModuleInfo *module_info)
1631{
1632 dest = put_string(dest, "SAP\r\n");
1633 dest = put_text_tag(dest, "AUTHOR", module_info->author);
1634 if (dest == NULL)
1635 return NULL;
1636 dest = put_text_tag(dest, "NAME", module_info->name);
1637 if (dest == NULL)
1638 return NULL;
1639 dest = put_text_tag(dest, "DATE", module_info->date);
1640 if (dest == NULL)
1641 return NULL;
1642 if (module_info->songs > 1) {
1643 dest = put_dec_tag(dest, "SONGS", module_info->songs);
1644 if (module_info->default_song > 0)
1645 dest = put_dec_tag(dest, "DEFSONG", module_info->default_song);
1646 }
1647 if (module_info->channels > 1)
1648 dest = put_string(dest, "STEREO\r\n");
1649 return dest;
1650}
1651
1652static byte *put_durations(byte *dest, const ASAP_ModuleInfo *module_info)
1653{
1654 int song;
1655 for (song = 0; song < module_info->songs; song++) {
1656 if (module_info->durations[song] < 0)
1657 break;
1658 dest = put_string(dest, "TIME ");
1659 ASAP_DurationToString((char *) dest, module_info->durations[song]);
1660 while (*dest != '\0')
1661 dest++;
1662 if (module_info->loops[song])
1663 dest = put_string(dest, " LOOP");
1664 *dest++ = '\r';
1665 *dest++ = '\n';
1666 }
1667 return dest;
1668}
1669
1670static byte *put_sap_header(byte *dest, const ASAP_ModuleInfo *module_info, char type, int music, int init, int player)
1671{
1672 dest = start_sap_header(dest, module_info);
1673 if (dest == NULL)
1674 return NULL;
1675 dest = put_string(dest, "TYPE ");
1676 *dest++ = type;
1677 *dest++ = '\r';
1678 *dest++ = '\n';
1679 if (module_info->fastplay != 312)
1680 dest = put_dec_tag(dest, "FASTPLAY", module_info->fastplay);
1681 dest = put_hex_tag(dest, "MUSIC", music);
1682 dest = put_hex_tag(dest, "INIT", init);
1683 dest = put_hex_tag(dest, "PLAYER", player);
1684 dest = put_durations(dest, module_info);
1685 return dest;
1686}
1687
1688int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const byte ARRAY module,
1689 int module_len, byte ARRAY out_module)
1690{
1691 byte *dest;
1692 int i;
1693 if (memcmp(module, "SAP\r\n", 5) != 0)
1694 return -1;
1695 dest = start_sap_header(out_module, module_info);
1696 if (dest == NULL)
1697 return -1;
1698 i = 5;
1699 while (i < module_len && module[i] != 0xff) {
1700 if (memcmp(module + i, "AUTHOR ", 7) == 0
1701 || memcmp(module + i, "NAME ", 5) == 0
1702 || memcmp(module + i, "DATE ", 5) == 0
1703 || memcmp(module + i, "SONGS ", 6) == 0
1704 || memcmp(module + i, "DEFSONG ", 8) == 0
1705 || memcmp(module + i, "STEREO", 6) == 0
1706 || memcmp(module + i, "TIME ", 5) == 0) {
1707 while (i < module_len && module[i++] != 0x0a);
1708 }
1709 else {
1710 int b;
1711 do {
1712 b = module[i++];
1713 *dest++ = b;
1714 } while (i < module_len && b != 0x0a);
1715 }
1716 }
1717 dest = put_durations(dest, module_info);
1718 module_len -= i;
1719 memcpy(dest, module + i, module_len);
1720 dest += module_len;
1721 return dest - out_module;
1722}
1723
1724#define RMT_INIT 0x0c80
1725#define TM2_INIT 0x1080
1726
1727const char *ASAP_CanConvert(const char *filename, const ASAP_ModuleInfo *module_info,
1728 const byte ARRAY module, int module_len)
1729{
1730 (void)filename;
1731 switch (module_info->type) {
1732 case 'B':
1733 if (module_info->init == 0x4f3 || module_info->init == 0xf4f3 || module_info->init == 0x4ef)
1734 return module_info->fastplay == 156 ? "mpd" : "mpt";
1735 if (module_info->init == RMT_INIT)
1736 return "rmt";
1737 if ((module_info->init == 0x4f5 || module_info->init == 0xf4f5 || module_info->init == 0x4f2)
1738 || ((module_info->init == 0x4e7 || module_info->init == 0xf4e7 || module_info->init == 0x4e4) && module_info->fastplay == 156)
1739 || ((module_info->init == 0x4e5 || module_info->init == 0xf4e5 || module_info->init == 0x4e2) && (module_info->fastplay == 104 || module_info->fastplay == 78)))
1740 return "tmc";
1741 if (module_info->init == TM2_INIT)
1742 return "tm2";
1743 break;
1744 case 'C':
1745 if (module_info->player == 0x500 || module_info->player == 0xf500) {
1746 if (module_info->fastplay == 156)
1747 return "dmc";
1748 return module[module_len - 170] == 0x1e ? "cmr" : "cmc";
1749 }
1750 break;
1751 case 'c':
1752 case 'z':
1753 case 'm':
1754 case 'r':
1755 case 't':
1756 case 'T':
1757 return "sap";
1758 default:
1759 break;
1760 }
1761 return NULL;
1762}
1763
1764int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
1765 const byte ARRAY module, int module_len, byte ARRAY out_module)
1766{
1767 (void) filename;
1768 int out_len;
1769 byte *dest;
1770 int addr;
1771 int player;
1772 static const int tmc_player[4] = { 3, -9, -10, -10 };
1773 static const int tmc_init[4] = { -14, -16, -17, -17 };
1774 switch (module_info->type) {
1775 case 'B':
1776 case 'C':
1777 out_len = module[module_info->header_len + 4] + (module[module_info->header_len + 5] << 8)
1778 - module[module_info->header_len + 2] - (module[module_info->header_len + 3] << 8) + 7;
1779 if (out_len < 7 || module_info->header_len + out_len >= module_len)
1780 return -1;
1781 memcpy(out_module, module + module_info->header_len, out_len);
1782 return out_len;
1783 case 'c':
1784 case 'z':
1785 dest = put_sap_header(out_module, module_info, 'C', module_info->music, -1, module_info->player);
1786 if (dest == NULL)
1787 return -1;
1788 memcpy(dest, module, module_len);
1789 dest += module_len;
1790 memcpy(dest, cmc_obx + 2, sizeof(cmc_obx) - 2);
1791 if (module_info->type == 'z')
1792 memcpy(dest + 4 + CMR_BASS_TABLE_OFFSET, cmr_bass_table, sizeof(cmr_bass_table));
1793 dest += sizeof(cmc_obx) - 2;
1794 return dest - out_module;
1795 case 'm':
1796 if (module_info->songs != 1) {
1797 addr = module_info->player - 17 - module_info->songs;
1798 dest = put_sap_header(out_module, module_info, 'B', -1, module_info->player - 17, module_info->player + 3);
1799 }
1800 else {
1801 addr = module_info->player - 13;
1802 dest = put_sap_header(out_module, module_info, 'B', -1, addr, module_info->player + 3);
1803 }
1804 if (dest == NULL)
1805 return -1;
1806 memcpy(dest, module, module_len);
1807 dest += module_len;
1808 *dest++ = (byte) addr;
1809 *dest++ = (byte) (addr >> 8);
1810 *dest++ = mpt_obx[4];
1811 *dest++ = mpt_obx[5];
1812 if (module_info->songs != 1) {
1813 memcpy(dest, module_info->song_pos, module_info->songs);
1814 dest += module_info->songs;
1815 *dest++ = 0x48; /* pha */
1816 }
1817 *dest++ = 0xa0; /* ldy #<music */
1818 *dest++ = (byte) module_info->music;
1819 *dest++ = 0xa2; /* ldx #>music */
1820 *dest++ = (byte) (module_info->music >> 8);
1821 *dest++ = 0xa9; /* lda #0 */
1822 *dest++ = 0;
1823 *dest++ = 0x20; /* jsr player */
1824 *dest++ = (byte) module_info->player;
1825 *dest++ = (byte) (module_info->player >> 8);
1826 if (module_info->songs != 1) {
1827 *dest++ = 0x68; /* pla */
1828 *dest++ = 0xa8; /* tay */
1829 *dest++ = 0xbe; /* ldx song2pos,y */
1830 *dest++ = (byte) addr;
1831 *dest++ = (byte) (addr >> 8);
1832 }
1833 else {
1834 *dest++ = 0xa2; /* ldx #0 */
1835 *dest++ = 0;
1836 }
1837 *dest++ = 0xa9; /* lda #2 */
1838 *dest++ = 2;
1839 memcpy(dest, mpt_obx + 6, sizeof(mpt_obx) - 6);
1840 dest += sizeof(mpt_obx) - 6;
1841 return dest - out_module;
1842 case 'r':
1843 dest = put_sap_header(out_module, module_info, 'B', -1, RMT_INIT, module_info->player + 3);
1844 if (dest == NULL)
1845 return -1;
1846 memcpy(dest, module, module_len);
1847 dest += module_len;
1848 *dest++ = (byte) RMT_INIT;
1849 *dest++ = (byte) (RMT_INIT >> 8);
1850 if (module_info->songs != 1) {
1851 addr = RMT_INIT + 10 + module_info->songs;
1852 *dest++ = (byte) addr;
1853 *dest++ = (byte) (addr >> 8);
1854 *dest++ = 0xa8; /* tay */
1855 *dest++ = 0xb9; /* lda song2pos,y */
1856 *dest++ = (byte) (RMT_INIT + 11);
1857 *dest++ = (byte) ((RMT_INIT + 11) >> 8);
1858 }
1859 else {
1860 *dest++ = (byte) (RMT_INIT + 8);
1861 *dest++ = (byte) ((RMT_INIT + 8) >> 8);
1862 *dest++ = 0xa9; /* lda #0 */
1863 *dest++ = 0;
1864 }
1865 *dest++ = 0xa2; /* ldx #<music */
1866 *dest++ = (byte) module_info->music;
1867 *dest++ = 0xa0; /* ldy #>music */
1868 *dest++ = (byte) (module_info->music >> 8);
1869 *dest++ = 0x4c; /* jmp player */
1870 *dest++ = (byte) module_info->player;
1871 *dest++ = (byte) (module_info->player >> 8);
1872 if (module_info->songs != 1) {
1873 memcpy(dest, module_info->song_pos, module_info->songs);
1874 dest += module_info->songs;
1875 }
1876 if (module_info->channels == 1) {
1877 memcpy(dest, rmt4_obx + 2, sizeof(rmt4_obx) - 2);
1878 dest += sizeof(rmt4_obx) - 2;
1879 }
1880 else {
1881 memcpy(dest, rmt8_obx + 2, sizeof(rmt8_obx) - 2);
1882 dest += sizeof(rmt8_obx) - 2;
1883 }
1884 return dest - out_module;
1885 case 't':
1886 player = module_info->player + tmc_player[module[0x25] - 1];
1887 addr = player + tmc_init[module[0x25] - 1];
1888 if (module_info->songs != 1)
1889 addr -= 3;
1890 dest = put_sap_header(out_module, module_info, 'B', -1, addr, player);
1891 if (dest == NULL)
1892 return -1;
1893 memcpy(dest, module, module_len);
1894 dest += module_len;
1895 *dest++ = (byte) addr;
1896 *dest++ = (byte) (addr >> 8);
1897 *dest++ = tmc_obx[4];
1898 *dest++ = tmc_obx[5];
1899 if (module_info->songs != 1)
1900 *dest++ = 0x48; /* pha */
1901 *dest++ = 0xa0; /* ldy #<music */
1902 *dest++ = (byte) module_info->music;
1903 *dest++ = 0xa2; /* ldx #>music */
1904 *dest++ = (byte) (module_info->music >> 8);
1905 *dest++ = 0xa9; /* lda #$70 */
1906 *dest++ = 0x70;
1907 *dest++ = 0x20; /* jsr player */
1908 *dest++ = (byte) module_info->player;
1909 *dest++ = (byte) (module_info->player >> 8);
1910 if (module_info->songs != 1) {
1911 *dest++ = 0x68; /* pla */
1912 *dest++ = 0xaa; /* tax */
1913 *dest++ = 0xa9; /* lda #0 */
1914 *dest++ = 0;
1915 }
1916 else {
1917 *dest++ = 0xa9; /* lda #$60 */
1918 *dest++ = 0x60;
1919 }
1920 switch (module[0x25]) {
1921 case 2:
1922 *dest++ = 0x06; /* asl 0 */
1923 *dest++ = 0;
1924 *dest++ = 0x4c; /* jmp player */
1925 *dest++ = (byte) module_info->player;
1926 *dest++ = (byte) (module_info->player >> 8);
1927 *dest++ = 0xa5; /* lda 0 */
1928 *dest++ = 0;
1929 *dest++ = 0xe6; /* inc 0 */
1930 *dest++ = 0;
1931 *dest++ = 0x4a; /* lsr @ */
1932 *dest++ = 0x90; /* bcc player+3 */
1933 *dest++ = 5;
1934 *dest++ = 0xb0; /* bcs player+6 */
1935 *dest++ = 6;
1936 break;
1937 case 3:
1938 case 4:
1939 *dest++ = 0xa0; /* ldy #1 */
1940 *dest++ = 1;
1941 *dest++ = 0x84; /* sty 0 */
1942 *dest++ = 0;
1943 *dest++ = 0xd0; /* bne player */
1944 *dest++ = 10;
1945 *dest++ = 0xc6; /* dec 0 */
1946 *dest++ = 0;
1947 *dest++ = 0xd0; /* bne player+6 */
1948 *dest++ = 12;
1949 *dest++ = 0xa0; /* ldy #3 */
1950 *dest++ = module[0x25];
1951 *dest++ = 0x84; /* sty 0 */
1952 *dest++ = 0;
1953 *dest++ = 0xd0; /* bne player+3 */
1954 *dest++ = 3;
1955 break;
1956 default:
1957 break;
1958 }
1959 memcpy(dest, tmc_obx + 6, sizeof(tmc_obx) - 6);
1960 dest += sizeof(tmc_obx) - 6;
1961 return dest - out_module;
1962 case 'T':
1963 dest = put_sap_header(out_module, module_info, 'B', -1, TM2_INIT, module_info->player + 3);
1964 if (dest == NULL)
1965 return -1;
1966 memcpy(dest, module, module_len);
1967 dest += module_len;
1968 *dest++ = (byte) TM2_INIT;
1969 *dest++ = (byte) (TM2_INIT >> 8);
1970 if (module_info->songs != 1) {
1971 *dest++ = (byte) (TM2_INIT + 16);
1972 *dest++ = (byte) ((TM2_INIT + 16) >> 8);
1973 *dest++ = 0x48; /* pha */
1974 }
1975 else {
1976 *dest++ = (byte) (TM2_INIT + 14);
1977 *dest++ = (byte) ((TM2_INIT + 14) >> 8);
1978 }
1979 *dest++ = 0xa0; /* ldy #<music */
1980 *dest++ = (byte) module_info->music;
1981 *dest++ = 0xa2; /* ldx #>music */
1982 *dest++ = (byte) (module_info->music >> 8);
1983 *dest++ = 0xa9; /* lda #$70 */
1984 *dest++ = 0x70;
1985 *dest++ = 0x20; /* jsr player */
1986 *dest++ = (byte) module_info->player;
1987 *dest++ = (byte) (module_info->player >> 8);
1988 if (module_info->songs != 1) {
1989 *dest++ = 0x68; /* pla */
1990 *dest++ = 0xaa; /* tax */
1991 *dest++ = 0xa9; /* lda #0 */
1992 *dest++ = 0;
1993 }
1994 else {
1995 *dest++ = 0xa9; /* lda #0 */
1996 *dest++ = 0;
1997 *dest++ = 0xaa; /* tax */
1998 }
1999 *dest++ = 0x4c; /* jmp player */
2000 *dest++ = (byte) module_info->player;
2001 *dest++ = (byte) (module_info->player >> 8);
2002 memcpy(dest, tm2_obx + 2, sizeof(tm2_obx) - 2);
2003 dest += sizeof(tm2_obx) - 2;
2004 return dest - out_module;
2005 default:
2006 return -1;
2007 }
2008}
2009
2010#endif /* !defined(JAVA) && !defined(CSHARP) */
diff --git a/apps/codecs/libasap/asap.h b/apps/codecs/libasap/asap.h
new file mode 100644
index 0000000000..783d628019
--- /dev/null
+++ b/apps/codecs/libasap/asap.h
@@ -0,0 +1,299 @@
1/*
2 * asap.h - public interface of the ASAP engine
3 *
4 * Copyright (C) 2005-2008 Piotr Fusik
5 *
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
8 *
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
13 *
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef _ASAP_H_
25#define _ASAP_H_
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* ASAP version. */
32#define ASAP_VERSION_MAJOR 1
33#define ASAP_VERSION_MINOR 2
34#define ASAP_VERSION_MICRO 0
35#define ASAP_VERSION "1.2.0"
36
37/* Short credits of the ASAP engine. */
38#define ASAP_YEARS "2005-2008"
39#define ASAP_CREDITS \
40 "Another Slight Atari Player (C) 2005-2008 Piotr Fusik\n" \
41 "CMC, MPT, TMC players (C) 1994-2005 Marcin Lewandowski\n" \
42 "RMT player (C) 2002-2005 Radek Sterba\n"
43
44/* Short GPL notice.
45 Display after the credits. */
46#define ASAP_COPYRIGHT \
47 "This program is free software; you can redistribute it and/or modify\n" \
48 "it under the terms of the GNU General Public License as published\n" \
49 "by the Free Software Foundation; either version 2 of the License,\n" \
50 "or (at your option) any later version."
51
52/* Useful type definitions. */
53#ifndef FALSE
54#define FALSE 0
55#endif
56#ifndef TRUE
57#define TRUE 1
58#endif
59typedef int abool;
60typedef unsigned char byte;
61
62/* Information about a file. */
63typedef struct {
64 char author[128]; /* author's name */
65 char name[128]; /* title */
66 char date[128]; /* creation date */
67 int channels; /* 1 for mono or 2 for stereo */
68 int songs; /* number of subsongs */
69 int default_song; /* 0-based index of the "main" subsong */
70 int durations[32]; /* lengths of songs, in milliseconds, -1 = unspecified */
71 abool loops[32]; /* whether songs repeat or not */
72 /* the following technical information should not be used outside ASAP. */
73 char type;
74 int fastplay;
75 int music;
76 int init;
77 int player;
78 int header_len;
79 byte song_pos[128];
80} ASAP_ModuleInfo;
81
82/* POKEY state.
83 Not for use outside the ASAP engine. */
84typedef struct {
85 int audctl;
86 abool init;
87 int poly_index;
88 int div_cycles;
89 int mute1;
90 int mute2;
91 int mute3;
92 int mute4;
93 int audf1;
94 int audf2;
95 int audf3;
96 int audf4;
97 int audc1;
98 int audc2;
99 int audc3;
100 int audc4;
101 int tick_cycle1;
102 int tick_cycle2;
103 int tick_cycle3;
104 int tick_cycle4;
105 int period_cycles1;
106 int period_cycles2;
107 int period_cycles3;
108 int period_cycles4;
109 int reload_cycles1;
110 int reload_cycles3;
111 int out1;
112 int out2;
113 int out3;
114 int out4;
115 int delta1;
116 int delta2;
117 int delta3;
118 int delta4;
119 int skctl;
120 signed char delta_buffer[888];
121} PokeyState;
122
123/* Player state.
124 Only module_info is meant to be read outside the ASAP engine. */
125typedef struct {
126 int cycle;
127 int cpu_pc;
128 int cpu_a;
129 int cpu_x;
130 int cpu_y;
131 int cpu_s;
132 int cpu_nz;
133 int cpu_c;
134 int cpu_vdi;
135 int scanline_number;
136 int nearest_event_cycle;
137 int next_scanline_cycle;
138 int timer1_cycle;
139 int timer2_cycle;
140 int timer4_cycle;
141 int irqst;
142 int extra_pokey_mask;
143 PokeyState base_pokey;
144 PokeyState extra_pokey;
145 int sample_offset;
146 int sample_index;
147 int samples;
148 int iir_acc_left;
149 int iir_acc_right;
150 ASAP_ModuleInfo module_info;
151 int tmc_per_frame;
152 int tmc_per_frame_counter;
153 int current_song;
154 int current_duration;
155 int blocks_played;
156 int silence_cycles;
157 int silence_cycles_counter;
158 byte poly9_lookup[511];
159 byte poly17_lookup[16385];
160 byte memory[65536];
161} ASAP_State;
162
163/* Maximum length of a "mm:ss.xxx" string including the terminator. */
164#define ASAP_DURATION_CHARS 10
165
166/* Maximum length of a supported input file.
167 You can assume that files longer than this are not supported by ASAP. */
168#define ASAP_MODULE_MAX 65000
169
170/* Output sample rate. */
171#define ASAP_SAMPLE_RATE 44100
172
173/* Output formats. */
174typedef enum {
175 ASAP_FORMAT_U8 = 8, /* unsigned char */
176 ASAP_FORMAT_S16_LE = 16, /* signed short, little-endian */
177 ASAP_FORMAT_S16_BE = -16 /* signed short, big-endian */
178} ASAP_SampleFormat;
179
180/* Parses the string in the "mm:ss.xxx" format
181 and returns the number of milliseconds or -1 if an error occurs. */
182int ASAP_ParseDuration(const char *s);
183
184/* Converts number of milliseconds to a string in the "mm:ss.xxx" format. */
185void ASAP_DurationToString(char *s, int duration);
186
187/* Checks whether the extension of the passed filename is known to ASAP. */
188abool ASAP_IsOurFile(const char *filename);
189
190/* Checks whether the filename extension is known to ASAP. */
191abool ASAP_IsOurExt(const char *ext);
192
193/* Changes the filename extension, returns true on success. */
194abool ASAP_ChangeExt(char *filename, const char *ext);
195
196/* Gets information about a module.
197 "module_info" is the structure where the information is returned.
198 "filename" determines file format.
199 "module" is the music data (contents of the file).
200 "module_len" is the number of data bytes.
201 ASAP_GetModuleInfo() returns true on success. */
202abool ASAP_GetModuleInfo(ASAP_ModuleInfo *module_info, const char *filename,
203 const byte module[], int module_len);
204
205/* Loads music data.
206 "as" is the destination structure.
207 "filename" determines file format.
208 "module" is the music data (contents of the file).
209 "module_len" is the number of data bytes.
210 ASAP does not make copies of the passed pointers. You can overwrite
211 or free "filename" and "module" once this function returns.
212 ASAP_Load() returns true on success.
213 If false is returned, the structure is invalid and you cannot
214 call the following functions. */
215abool ASAP_Load(ASAP_State *as, const char *filename,
216 const byte module[], int module_len);
217
218/* Enables silence detection.
219 Makes ASAP finish playing after the specified period of silence.
220 "as" is ASAP state initialized by ASAP_Load().
221 "seconds" is the minimum length of silence that ends playback. */
222void ASAP_DetectSilence(ASAP_State *as, int seconds);
223
224/* Prepares ASAP to play the specified song of the loaded module.
225 "as" is ASAP state initialized by ASAP_Load().
226 "song" is a zero-based index which must be less than the "songs" field
227 of the ASAP_ModuleInfo structure.
228 "duration" is playback time in milliseconds - use durations[song]
229 unless you want to override it. -1 means indefinitely. */
230void ASAP_PlaySong(ASAP_State *as, int song, int duration);
231
232/* Mutes the selected POKEY channels.
233 This is only useful for people who want to grab samples of individual
234 instruments.
235 "as" is ASAP state after calling ASAP_PlaySong().
236 "mask" is a bit mask which selects POKEY channels to be muted.
237 Bits 0-3 control the base POKEY channels,
238 bits 4-7 control the extra POKEY channels. */
239void ASAP_MutePokeyChannels(ASAP_State *as, int mask);
240
241/* Rewinds the current song.
242 "as" is ASAP state initialized by ASAP_PlaySong().
243 "position" is the requested absolute position in milliseconds. */
244void ASAP_Seek(ASAP_State *as, int position);
245
246/* Fills the specified buffer with generated samples.
247 "as" is ASAP state initialized by ASAP_PlaySong().
248 "buffer" is the destination buffer.
249 "buffer_len" is the length of this buffer in bytes.
250 "format" is the format of samples.
251 ASAP_Generate() returns number of bytes actually written
252 (less than buffer_len if reached the end of the song).
253 Normally you use a buffer of a few kilobytes or less,
254 and call ASAP_Generate() in a loop or via a callback. */
255int ASAP_Generate(ASAP_State *as, void *buffer, int buffer_len,
256 ASAP_SampleFormat format);
257
258/* Checks whether information in the specified file can be edited. */
259abool ASAP_CanSetModuleInfo(const char *filename);
260
261/* Updates the specified module with author, name, date, stereo
262 and song durations as specified in "module_info".
263 "module_info" contains the new module information.
264 "module" is the source file contents.
265 "module_len" is the source file length.
266 "out_module" is the destination buffer of size ASAP_MODULE_MAX.
267 ASAP_SetModuleInfo() returns the resulting file length (number of bytes
268 written to "out_module") or -1 if illegal characters were found. */
269int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const byte module[],
270 int module_len, byte out_module[]);
271
272/* Checks whether the specified module can be converted to another format.
273 "filename" determines the source format.
274 "module_info" contains the information about the source module,
275 with possibly modified public fields.
276 "module" is the source file contents.
277 "module_len" is the source file length.
278 ASAP_CanConvert() returns the extension of the target format
279 or NULL if there's no possible conversion. */
280const char *ASAP_CanConvert(const char *filename, const ASAP_ModuleInfo *module_info,
281 const byte module[], int module_len);
282
283/* Converts the specified module to the format returned by ASAP_CanConvert().
284 "filename" determines the source format.
285 "module_info" contains the information about the source module,
286 with possibly modified public fields.
287 "module" is the source file contents.
288 "module_len" is the source file length.
289 "out_module" is the destination buffer of size ASAP_MODULE_MAX.
290 ASAP_Convert() returns the resulting file length (number of bytes
291 written to "out_module") or -1 on error. */
292int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
293 const byte module[], int module_len, byte out_module[]);
294
295#ifdef __cplusplus
296}
297#endif
298
299#endif
diff --git a/apps/codecs/libasap/asap_internal.h b/apps/codecs/libasap/asap_internal.h
new file mode 100644
index 0000000000..1385215f37
--- /dev/null
+++ b/apps/codecs/libasap/asap_internal.h
@@ -0,0 +1,93 @@
1/*
2 * asap_internal.h - private interface of the ASAP engine
3 *
4 * Copyright (C) 2005-2008 Piotr Fusik
5 *
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
8 *
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
13 *
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef _ASAP_INTERNAL_H_
25#define _ASAP_INTERNAL_H_
26
27#if !defined(JAVA) && !defined(CSHARP)
28
29#include "asap.h"
30
31#define CONST_LOOKUP(type, name) \
32 static const type name[]
33#define FILE_FUNC static
34#define ASAP_FUNC
35#define PTR *
36#define ADDRESSOF &
37#define ARRAY *
38#define VOIDPTR void *
39#define UBYTE(data) (data)
40#define SBYTE(data) (signed char) (data)
41#define STRING const char *
42#define ZERO_ARRAY(array) memset(array, 0, sizeof(array))
43#define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
44 memcpy(dest + dest_offset, src + src_offset, len)
45#define NEW_ARRAY(type, name, size) \
46 type name[size]
47#define INIT_ARRAY(array) memset(array, 0, sizeof(array))
48
49#define AST ast->
50#define PST pst->
51#define MODULE_INFO module_info->
52#define ASAP_OBX const byte *
53#define GET_OBX(name) name##_obx
54
55int ASAP_GetByte(ASAP_State *ast, int addr);
56void ASAP_PutByte(ASAP_State *ast, int addr, int data);
57
58void Cpu_RunScanlines(ASAP_State *ast, int scanlines);
59
60void PokeySound_Initialize(ASAP_State *ast);
61void PokeySound_StartFrame(ASAP_State *ast);
62void PokeySound_PutByte(ASAP_State *ast, int addr, int data);
63int PokeySound_GetRandom(ASAP_State *ast, int addr);
64void PokeySound_EndFrame(ASAP_State *ast, int cycle_limit);
65int PokeySound_Generate(ASAP_State *ast, byte buffer[], int buffer_offset, int blocks, ASAP_SampleFormat format);
66abool PokeySound_IsSilent(const PokeyState *pst);
67void PokeySound_Mute(const ASAP_State *ast, PokeyState *pst, int mask);
68
69#ifdef ASAPSCAN
70abool call_6502_player(ASAP_State *ast);
71extern abool cpu_trace;
72void print_cpu_state(const ASAP_State *ast, int pc, int a, int x, int y, int s, int nz, int vdi, int c);
73#endif
74
75#endif /* !defined(JAVA) && !defined(CSHARP) */
76
77#define ASAP_MAIN_CLOCK 1773447
78
79#define V_FLAG 0x40
80#define D_FLAG 0x08
81#define I_FLAG 0x04
82#define Z_FLAG 0x02
83
84#define NEVER 0x800000
85
86#define dGetByte(addr) UBYTE(AST memory[addr])
87#define dPutByte(addr, data) AST memory[addr] = (byte) (data)
88#define dGetWord(addr) (dGetByte(addr) + (dGetByte((addr) + 1) << 8))
89#define GetByte(addr) (((addr) & 0xf900) == 0xd000 ? ASAP_GetByte(ast, addr) : dGetByte(addr))
90#define PutByte(addr, data) do { if (((addr) & 0xf900) == 0xd000) ASAP_PutByte(ast, addr, data); else dPutByte(addr, data); } while (FALSE)
91#define RMW_GetByte(dest, addr) do { if (((addr) >> 8) == 0xd2) { dest = ASAP_GetByte(ast, addr); AST cycle--; ASAP_PutByte(ast, addr, dest); AST cycle++; } else dest = dGetByte(addr); } while (FALSE)
92
93#endif /* _ASAP_INTERNAL_H_ */
diff --git a/apps/codecs/libasap/players.h b/apps/codecs/libasap/players.h
new file mode 100644
index 0000000000..ac94f66d49
--- /dev/null
+++ b/apps/codecs/libasap/players.h
@@ -0,0 +1,947 @@
1static const unsigned char cmc_obx[] = {
2 0xFF, 0xFF, 0x00, 0x05, 0xDC, 0x0C, 0x4C, 0x0F, 0x0B, 0x4C, 0x78, 0x05, 0x4C, 0xCB, 0x07, 0x00,
3 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xE3, 0xED, 0xE3, 0xA0, 0xF0, 0xEC, 0xE1,
4 0xF9, 0xE5, 0xF2, 0xA0, 0xF6, 0xA0, 0xB2, 0xAE, 0xB1, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
6 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
9 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0x6E,
10 0x05, 0x8E, 0x6F, 0x05, 0x8C, 0x70, 0x05, 0x29, 0x70, 0x4A, 0x4A, 0x4A, 0xAA, 0xBD, 0x91, 0x0B,
11 0x8D, 0xA9, 0x05, 0xBD, 0x92, 0x0B, 0x8D, 0xAA, 0x05, 0xA9, 0x03, 0x8D,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DB,
23 0x0A, 0x8C, 0xF1, 0x0A, 0x8C, 0x00, 0x0B, 0x60, 0x8E, 0x72, 0x05, 0x86, 0xFE, 0x8C, 0x73, 0x05,
24 0x84, 0xFF, 0x18, 0x8A, 0x69, 0x14, 0x8D, 0x74, 0x05, 0x98, 0x69, 0x00, 0x8D, 0x75, 0x05, 0x8E,
25 0x76, 0x05, 0xC8, 0xC8, 0x8C, 0x77, 0x05, 0xA0, 0x13, 0xB1, 0xFE, 0x8D, 0x6C, 0x05, 0x8D, 0x6D,
26 0x05, 0xA2, 0x08, 0xA9, 0x00, 0x8D, 0x71, 0x05, 0x9D, 0x00, 0xD2, 0xE0, 0x03, 0xB0, 0x08, 0x9D,
27 0x09, 0x05, 0xA9, 0xFF, 0x9D, 0x39, 0x05, 0xCA, 0x10, 0xE9, 0xA9, 0x80, 0xA2, 0x03, 0x9D, 0x4B,
28 0x05, 0xCA, 0x10, 0xFA, 0x60, 0xA9, 0x01, 0x8D, 0x71, 0x05, 0xA9, 0x00, 0xF0, 0xEE, 0x29, 0x03,
29 0xC9, 0x03, 0xF0, 0xF0, 0xE0, 0x40, 0xB0, 0xEC, 0xC0, 0x1A, 0xB0, 0xE8, 0xAA, 0xA9, 0x80, 0x9D,
30 0x4B, 0x05, 0xA9, 0x00, 0x9D, 0x39, 0x05, 0x9D, 0x3C, 0x05, 0x9D, 0x3F, 0x05, 0xAD, 0x6F, 0x05,
31 0x9D, 0x0C, 0x05, 0xAD, 0x70, 0x05, 0x0A, 0x0A, 0x0A, 0x85, 0xFE, 0x18, 0xAD, 0x72, 0x05, 0x69,
32 0x30, 0x48, 0xAD, 0x73, 0x05, 0x69, 0x01, 0xA8, 0x68, 0x18, 0x65, 0xFE, 0x9D, 0x61, 0x05, 0x98,
33 0x69, 0x00, 0x9D, 0x64, 0x05, 0x18, 0xAD, 0x72, 0x05, 0x69, 0x94, 0x85, 0xFE, 0xAD, 0x73, 0x05,
34 0x69, 0x00, 0x85, 0xFF, 0xAD, 0x70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BD, 0x52, 0x05, 0x4A, 0x4A,
91 0x4A, 0x4A, 0x90, 0x01, 0x88, 0x4A, 0x90, 0x01, 0xC8, 0x18, 0x98, 0x7D, 0x2D, 0x05, 0x9D, 0x2D,
92 0x05, 0xBD, 0x30, 0x05, 0xC9, 0xFF, 0xD0, 0x02, 0xA0, 0x00, 0x18, 0x98, 0x7D, 0x30, 0x05, 0x9D,
93 0x30, 0x05, 0xCA, 0x30, 0x03, 0x4C, 0x96, 0x09, 0xAD, 0x28, 0x05, 0x8D, 0x2B, 0x05, 0xAD, 0x52,
94 0x05, 0x29, 0x07, 0xAA, 0xA0, 0x03, 0xAD, 0x6E, 0x05, 0xF0, 0x03, 0xBC, 0xD5, 0x0C, 0x98, 0x48,
95 0xB9, 0xB9, 0x0C, 0x08, 0x29, 0x7F, 0xAA, 0x98, 0x29, 0x03, 0x0A, 0xA8, 0xBD, 0x24, 0x05, 0x99,
96 0x00, 0xD2, 0xC8, 0xBD, 0x09, 0x05, 0xE0, 0x03, 0xD0, 0x03, 0xAD, 0x09, 0x05, 0x1D, 0x28, 0x05,
97 0x28, 0x10, 0x02, 0xA9, 0x00, 0x99, 0x00, 0xD2, 0x68, 0xA8, 0x88, 0x29, 0x03, 0xD0, 0xCF, 0xA0,
98 0x08, 0xAD, 0x2C, 0x05, 0x99, 0x00, 0xD2, 0x18, 0x68, 0x85, 0xFF, 0x68, 0x85, 0xFE, 0x68, 0x85,
99 0xFD, 0x68, 0x85, 0xFC, 0x60, 0x68, 0xAA, 0xF0, 0x4E, 0xC9, 0x02, 0xF0, 0x06, 0x68, 0x68, 0xCA,
100 0xD0, 0xFB, 0x60, 0xA5, 0x14, 0xC5, 0x14, 0xF0, 0xFC, 0xAD, 0x24, 0x02, 0xC9, 0x86, 0xD0, 0x07,
101 0xAD, 0x25, 0x02, 0xC9, 0x0B, 0xF0, 0xE6, 0xAD, 0x24, 0x02, 0x8D, 0x8F, 0x0B, 0xAD, 0x25, 0x02,
102 0x8D, 0x90, 0x0B, 0xA9, 0x86, 0x8D, 0x24, 0x02, 0xA9, 0x0B, 0x8D, 0x25, 0x02, 0x68, 0x68, 0xF0,
103 0x03, 0x38, 0xE9, 0x01, 0x8D, 0x5D, 0x0B, 0x68, 0xA8, 0x68, 0xAA, 0xA9, 0x70, 0x20, 0x78, 0x05,
104 0xA9, 0x00, 0xA2, 0x00, 0x4C, 0x78, 0x05, 0xA5, 0x14, 0xC5, 0x14, 0xF0, 0xFC, 0xAD, 0x24, 0x02,
105 0xC9, 0x86, 0xD0, 0xAE, 0xAD, 0x25, 0x02, 0xC9, 0x0B, 0xD0, 0xA7, 0xAD, 0x8F, 0x0B, 0x8D, 0x24,
106 0x02, 0xAD, 0x90, 0x0B, 0x8D, 0x25, 0x02, 0xA9, 0x40, 0x4C, 0x78, 0x05, 0x20, 0xCB, 0x07, 0x90,
107 0x03, 0x20, 0x75, 0x0B, 0x4C, 0xFF, 0xFF, 0xB2, 0x05, 0xDD, 0x05, 0xA8, 0x06, 0x3B, 0x06, 0x7B,
108 0x06, 0x94, 0x06, 0x9F, 0x06, 0x52, 0x06, 0x93, 0x08, 0x99, 0x08, 0x9D, 0x08, 0xA5, 0x08, 0xAD,
109 0x08, 0xB7, 0x08, 0xCD, 0x08, 0xB9, 0x0B, 0xFA, 0x0B, 0x3B, 0x0C, 0x80, 0xA0, 0x20, 0x40, 0xFF,
110 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98, 0x8F, 0x87, 0x7F, 0x78, 0x72, 0x6B, 0x65,
111 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2C, 0x2A, 0x27,
112 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F,
113 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00,
114 0x00, 0x00, 0x00, 0x00, 0xF2, 0xE9, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80,
115 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x00, 0x56, 0x50, 0x67, 0x60, 0x5A, 0x55, 0x51, 0x4C, 0x48, 0x43,
116 0x3F, 0x3D, 0x39, 0x34, 0x33, 0x39, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x00, 0x00,
117 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
118 0x00, 0x38, 0x0B, 0x8C, 0x0A, 0x00, 0x0A, 0x6A, 0x09, 0xE8, 0x08, 0x6A, 0x08, 0xEF, 0x07, 0x80,
119 0x07, 0x08, 0x07, 0xAE, 0x06, 0x46, 0x06, 0xE6, 0x05, 0x95, 0x05, 0x41, 0x05, 0xF6, 0x04, 0xB0,
120 0x04, 0x6E, 0x04, 0x30, 0x04, 0xF6, 0x03, 0xBB, 0x03, 0x84, 0x03, 0x52, 0x03, 0x22, 0x03, 0xF4,
121 0x02, 0xC8, 0x02, 0xA0, 0x02, 0x7A, 0x02, 0x55, 0x02, 0x34, 0x02, 0x14, 0x02, 0xF5, 0x01, 0xD8,
122 0x01, 0xBD, 0x01, 0xA4, 0x01, 0x8D, 0x01, 0x77, 0x01, 0x60, 0x01, 0x4E, 0x01, 0x38, 0x01, 0x27,
123 0x01, 0x15, 0x01, 0x06, 0x01, 0xF7, 0x00, 0xE8, 0x00, 0xDB, 0x00, 0xCF, 0x00, 0xC3, 0x00, 0xB8,
124 0x00, 0xAC, 0x00, 0xA2, 0x00, 0x9A, 0x00, 0x90, 0x00, 0x88, 0x00, 0x7F, 0x00, 0x78, 0x00, 0x70,
125 0x00, 0x6A, 0x00, 0x64, 0x00, 0x5E, 0x00, 0x57, 0x00, 0x52, 0x00, 0x32, 0x00, 0x0A, 0x00, 0x00,
126 0x01, 0x02, 0x83, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x83, 0x01, 0x00, 0x02, 0x03, 0x01,
127 0x02, 0x80, 0x03, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x03, 0x03, 0x03, 0x03, 0x07,
128 0x0B, 0x0F, 0x13
129};
130static const unsigned char mpt_obx[] = {
131 0xFF, 0xFF, 0x00, 0x05, 0xB2, 0x0D, 0x4C, 0xCD, 0x0B, 0xAD, 0x2E, 0x07, 0xD0, 0x01, 0x60, 0xA9,
132 0x00, 0x8D, 0x1C, 0x0E, 0xEE, 0x1D, 0x0E, 0xAD, 0x17, 0x0E, 0xCD, 0xBB, 0x0D, 0x90, 0x50, 0xCE,
133 0x15, 0x0E, 0xF0, 0x03, 0x4C, 0xC5, 0x05, 0xA2, 0x00, 0x8E, 0x17, 0x0E, 0xA9, 0x00, 0x9D, 0xED,
134 0x0D, 0x9D, 0xF5, 0x0D, 0xBD, 0xB3, 0x0D, 0x85, 0xEC, 0xBD, 0xB7, 0x0D, 0x85, 0xED, 0xAC, 0x16,
135 0x0E, 0xB1, 0xEC, 0xC8, 0xC9, 0xFF, 0xF0, 0x07, 0xC9, 0xFE, 0xD0, 0x0F, 0x4C, 0x2A, 0x0C, 0xB1,
136 0xEC, 0x30, 0xF9, 0x0A, 0xA8, 0x8C, 0x16, 0x0E, 0x4C, 0x3B, 0x05, 0x9D, 0xE9, 0x0D, 0xB1, 0xEC,
137 0x9D, 0xD5, 0x0D, 0xE8, 0xE0, 0x04, 0xD0, 0xC4, 0xC8, 0x8C, 0x16, 0x0E, 0x4C, 0xC5, 0x05, 0xCE,
138 0x15, 0x0E, 0x10, 0x57, 0xAD, 0xBC, 0x0D, 0x8D, 0x15, 0x0E, 0xA2, 0x03, 0xDE, 0xF5, 0x0D, 0x10,
139 0x44,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0D, 0x9D, 0xE1, 0x0D, 0x20, 0x75, 0x09, 0x9D, 0xC9, 0x0D, 0x60, 0x9D, 0xC9, 0x0D, 0xBD, 0x8D,
206 0x09, 0x10, 0x0C, 0x9D, 0xC9, 0x0D, 0xA9, 0x80, 0xD0, 0x05, 0x9D, 0xC9, 0x0D, 0xA9, 0x01, 0x0D,
207 0x1C, 0x0E, 0x8D, 0x1C, 0x0E, 0x60, 0x2D, 0x0A, 0xD2, 0x9D, 0xC9, 0x0D, 0x60, 0xF2, 0x33, 0x96,
208 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6,
209 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5,
210 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3,
211 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x0D, 0x0D, 0x0C, 0x0B,
212 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04,
213 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01,
214 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18,
216 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x16, 0x16, 0x17, 0x17, 0x17,
217 0x17, 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19, 0x1A, 0x15, 0x15, 0x16, 0x16, 0x16,
218 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1A, 0x1B, 0x14, 0x15, 0x15, 0x16, 0x16,
219 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x14, 0x14, 0x15, 0x15, 0x16,
220 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1C, 0x13, 0x14, 0x14, 0x15, 0x16,
221 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1C, 0x13, 0x13, 0x14, 0x15, 0x15,
222 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x12, 0x13, 0x14, 0x14, 0x15,
223 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1B, 0x1C, 0x1C, 0x1D, 0x12, 0x13, 0x13, 0x14, 0x15,
224 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1D, 0x12, 0x12, 0x13, 0x14, 0x15,
225 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x15,
226 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x15,
227 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x14,
228 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x13, 0x14,
229 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1D, 0x1E, 0x11, 0x12, 0x12, 0x13, 0x14,
230 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1E, 0x10, 0x11, 0x12, 0x13, 0x14,
231 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x22, 0x24, 0x26, 0x29,
232 0x2B, 0x2E, 0x30, 0x33, 0x37, 0x3A, 0x3D, 0x41, 0x45, 0x49, 0x4D, 0x52, 0x57, 0x5C, 0x61, 0x67,
233 0x6E, 0x74, 0x7B, 0x82, 0x8A, 0x92, 0x9B, 0xA4, 0xAE, 0xB8, 0xC3, 0xCF, 0xDC, 0xE9, 0xF6, 0x05,
234 0x15, 0x25, 0x37, 0x49, 0x5D, 0x71, 0x87, 0x9F, 0xB8, 0xD2, 0xED, 0x0B, 0x2A, 0x4B, 0x6E, 0x93,
235 0xBA, 0xE3, 0x0F, 0x3E, 0x70, 0xA4, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01,
238 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03,
239 0x03, 0x03, 0x03, 0xE5, 0x2A, 0x40, 0x59, 0x64, 0xEE, 0x08, 0xA6, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C,
240 0x0C, 0x0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0x0D, 0xAE, 0x0B, 0xD4, 0xB1, 0xFC, 0x4A, 0x4A, 0x4A, 0x4A, 0x09, 0x10, 0x8D, 0x07,
263 0xD2, 0x20, 0x75, 0x0D, 0xEC, 0x0B, 0xD4, 0xF0, 0xFB, 0x8D, 0x05, 0xD2, 0xAE, 0x0B, 0xD4, 0xB1,
264 0xFC, 0xE6, 0xFC, 0xD0, 0x10, 0xE6, 0xFD, 0xC6, 0xF8, 0xD0, 0x0A, 0xA9, 0xAD, 0x8D, 0x61, 0x0D,
265 0x8D, 0x38, 0x0D, 0xA9, 0x08, 0x09, 0x10, 0x8D, 0x07, 0xD2, 0x20, 0x75, 0x0D, 0xEC, 0x0B, 0xD4,
266 0xF0, 0xFB, 0x8D, 0x05, 0xD2, 0xAD, 0x1B, 0x0E, 0xD0, 0xB9, 0x60, 0x18, 0xA5, 0xF9, 0x69, 0x00,
267 0x85, 0xF9, 0xA5, 0xFA, 0x69, 0x00, 0x85, 0xFA, 0x90, 0x0F, 0xE6, 0xFB, 0xA5, 0xFB, 0xC9, 0x00,
268 0xD0, 0x07, 0x8C, 0x79, 0x0D, 0x8C, 0x7F, 0x0D, 0x60, 0xB1, 0xFA, 0x24, 0xF9, 0x30, 0x04, 0x4A,
269 0x4A, 0x4A, 0x4A, 0x29, 0x0F, 0xA8, 0xB9, 0x45, 0x0A, 0xA0, 0x00, 0x60, 0xA0, 0x00, 0x8C, 0x1B,
270 0x0E, 0x8C, 0x1A, 0x0E, 0x88, 0x8C, 0x19, 0x0E, 0x60
271};
272static const unsigned char rmt4_obx[] = {
273 0xFF, 0xFF, 0x90, 0x03, 0x60, 0x0B, 0x80, 0x00, 0x80, 0x20, 0x80, 0x40, 0x00, 0xC0, 0x80, 0x80,
274 0x80, 0xA0, 0x00, 0xC0, 0x40, 0xC0, 0x00, 0x01, 0x05, 0x0B, 0x15, 0x00, 0x01, 0xFF, 0xFF, 0x01,
275 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x01,
276 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A,
277 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52,
278 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E,
279 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F,
280 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x00, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0xF2, 0xE6,
281 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C,
282 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23,
283 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D,
284 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99,
285 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C,
286 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17,
287 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06,
288 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90,
289 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39,
290 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16,
291 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05,
292 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08,
293 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03,
294 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
295 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
296 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
298 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
299 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
300 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
301 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03,
302 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04,
303 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
304 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05,
305 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05,
306 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06,
307 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07,
308 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07,
309 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
310 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08,
311 0x09, 0x0A, 0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03, 0x29, 0x0F, 0xF0, 0x1F, 0xAC, 0x11, 0x03, 0xB9,
390 0xC0, 0x03, 0x8D, 0x18, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x19, 0x03, 0xAD, 0x1C, 0x03, 0x29, 0x10,
391 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x1C, 0x03, 0x8A, 0x09, 0x50, 0xAA, 0xAD, 0x0F, 0x03, 0x29, 0x0E,
392 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x1F, 0x03, 0x29, 0x0F, 0xF0, 0x1F, 0xAC, 0x13, 0x03, 0xB9, 0xC0,
393 0x03, 0x8D, 0x1A, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x1B, 0x03, 0xAD, 0x1E, 0x03, 0x29, 0x10, 0xD0,
394 0x05, 0xA9, 0x00, 0x8D, 0x1E, 0x03, 0x8A, 0x09, 0x28, 0xAA, 0x8E, 0x2C, 0x0B, 0xAD, 0x26, 0x03,
395 0x60, 0xA0, 0xFF, 0xAD, 0x18, 0x03, 0xAE, 0x1C, 0x03, 0x8D, 0x00, 0xD2, 0x8E, 0x01, 0xD2, 0xAD,
396 0x19, 0x03, 0xAE, 0x1D, 0x03, 0x8D, 0x02, 0xD2, 0x8E, 0x03, 0xD2, 0xAD, 0x1A, 0x03, 0xAE, 0x1E,
397 0x03, 0x8D, 0x04, 0xD2, 0x8E, 0x05, 0xD2, 0xAD, 0x1B, 0x03, 0xAE, 0x1F, 0x03, 0x8D, 0x06, 0xD2,
398 0x8E, 0x07, 0xD2, 0x8C, 0x08, 0xD2, 0x60
399};
400static const unsigned char rmt8_obx[] = {
401 0xFF, 0xFF, 0x90, 0x03, 0x6C, 0x0C, 0x80, 0x00, 0x80, 0x20, 0x80, 0x40, 0x00, 0xC0, 0x80, 0x80,
402 0x80, 0xA0, 0x00, 0xC0, 0x40, 0xC0, 0x00, 0x01, 0x05, 0x0B, 0x15, 0x00, 0x01, 0xFF, 0xFF, 0x01,
403 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x01,
404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A,
405 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52,
406 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E,
407 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F,
408 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x00, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0xF2, 0xE6,
409 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C,
410 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23,
411 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D,
412 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99,
413 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C,
414 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17,
415 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06,
416 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90,
417 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39,
418 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16,
419 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05,
420 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08,
421 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03,
422 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
423 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
424 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
426 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
427 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
428 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
429 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03,
430 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04,
431 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
432 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05,
433 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05,
434 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06,
435 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07,
436 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07,
437 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
438 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08,
439 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
440 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x4C, 0x0F, 0x06, 0x4C, 0x09, 0x08, 0x4C, 0x2E, 0x08, 0x4C,
441 0x5C, 0x06, 0x4C, 0x02, 0x0C, 0x86, 0xD3, 0x84, 0xD4, 0x48, 0xA0, 0x00, 0x98, 0x99, 0x00, 0x02,
442 0x99, 0x4C, 0x02, 0xC8, 0xD0, 0xF7, 0xA0, 0x04, 0xB1, 0xD3, 0x8D, 0x22, 0x08, 0xC8, 0xB1, 0xD3,
443 0x8D, 0x48, 0x03, 0xC8, 0xB1, 0xD3, 0x8D, 0x12, 0x08, 0x8D, 0x4A, 0x03, 0xA0, 0x08, 0xB1, 0xD3,
444 0x99, 0xC3, 0x00, 0xC8, 0xC0, 0x10, 0xD0, 0xF6, 0x68, 0x48, 0x0A, 0x0A, 0x0A, 0x18, 0x65, 0xD1,
445 0x85, 0xD1, 0x68, 0x08, 0x29, 0xE0, 0x0A, 0x2A, 0x2A, 0x2A, 0x28, 0x65, 0xD2, 0x85, 0xD2, 0x20,
446 0x7B, 0x06, 0xA9, 0x00, 0x8D, 0x08, 0xD2, 0x8D, 0x18, 0xD2, 0xA0, 0x03, 0x8C, 0x0F, 0xD2, 0x8C,
447 0x1F, 0xD2, 0xA0, 0x08, 0x99, 0x00, 0xD2, 0x99, 0x10, 0xD2, 0x88, 0x10, 0xF7, 0xAD, 0x12, 0x08,
448 0x60, 0xA2, 0x00, 0x8E, 0x4B, 0x03, 0x8A, 0xA8, 0xB1, 0xD1, 0xC9, 0xFE, 0xB0, 0x2D, 0xA8, 0xB1,
449 0xCD, 0x9D, 0x00, 0x02, 0xB1, 0xCF, 0x9D, 0x08, 0x02, 0xA9, 0x00, 0x9D, 0x10, 0x02, 0xA9, 0x01,
450 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x4C, 0xB9, 0x08, 0xDE, 0xB8, 0x02, 0xBC,
484 0x00, 0x03, 0xC0, 0x0D, 0x90, 0x3C, 0xBD, 0x10, 0x03, 0x10, 0x31, 0x98, 0xDD, 0xF8, 0x02, 0xD0,
485 0x08, 0xBD, 0x08, 0x03, 0x9D, 0xF8, 0x02, 0xD0, 0x03, 0xFE, 0xF8, 0x02, 0xBD, 0x70, 0x02, 0x85,
486 0xD7, 0xBD, 0x78, 0x02, 0x85, 0xD8, 0xBC, 0xF8, 0x02, 0xB1, 0xD7, 0xBC, 0xE8, 0x02, 0xF0, 0x04,
487 0x18, 0x7D, 0xF0, 0x02, 0x9D, 0xF0, 0x02, 0xBD, 0xE0, 0x02, 0x29, 0x3F, 0x38, 0xE9, 0x01, 0x9D,
488 0x10, 0x03, 0xBD, 0x98, 0x02, 0x10, 0x1F, 0xBD, 0x28, 0x02, 0xF0, 0x1A, 0xDD, 0xB0, 0x02, 0xF0,
489 0x15, 0x90, 0x13, 0xA8, 0xBD, 0xA8, 0x02, 0x18, 0x7D, 0xA0, 0x02, 0x9D, 0xA8, 0x02, 0x90, 0x06,
490 0x98, 0xE9, 0x10, 0x9D, 0x28, 0x02, 0xA9, 0x00, 0x85, 0xDD, 0xA5, 0xDA, 0x9D, 0x18, 0x03, 0x29,
491 0x70, 0x4A, 0x4A, 0x8D, 0x31, 0x09, 0x90, 0xFE, 0x4C, 0xE7, 0x09, 0xEA, 0x4C, 0x51, 0x09, 0xEA,
492 0x4C, 0x56, 0x09, 0xEA, 0x4C, 0x60, 0x09, 0xEA, 0x4C, 0x6C, 0x09, 0xEA, 0x4C, 0x7B, 0x09, 0xEA,
493 0x4C, 0xBE, 0x09, 0xEA, 0x4C, 0xCD, 0x09, 0xA5, 0xDB, 0x4C, 0x2A, 0x0A, 0xA5, 0xDB, 0x85, 0xDD,
494 0xBD, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD, 0x20, 0x02, 0x18, 0x65, 0xDB, 0x9D, 0x20, 0x02, 0x4C,
495 0xED, 0x09, 0xBD, 0x38, 0x02, 0x18, 0x65, 0xDB, 0x9D, 0x38, 0x02, 0xBD, 0x20, 0x02, 0x4C, 0xED,
496 0x09, 0xBD, 0xE0, 0x02, 0x10, 0x0C, 0xBC, 0x20, 0x02, 0xB1, 0xD5, 0x18, 0x7D, 0xF0, 0x02, 0x4C,
497 0x9C, 0x09, 0xBD, 0x20, 0x02, 0x18, 0x7D, 0xF0, 0x02, 0xC9, 0x3D, 0x90, 0x02, 0xA9, 0x3F, 0xA8,
498 0xB1, 0xD5, 0x9D, 0x40, 0x02, 0xA4, 0xDB, 0xD0, 0x03, 0x9D, 0x48, 0x02, 0x98, 0x4A, 0x4A, 0x4A,
499 0x4A, 0x9D, 0x50, 0x02, 0x9D, 0x58, 0x02, 0xA5, 0xDB, 0x29, 0x0F, 0x9D, 0x60, 0x02, 0xBD, 0x20,
500 0x02, 0x4C, 0xED, 0x09, 0xA5, 0xDB, 0x18, 0x7D, 0x28, 0x03, 0x9D, 0x28, 0x03, 0xBD, 0x20, 0x02,
501 0x4C, 0xED, 0x09, 0xA5, 0xDB, 0xC9, 0x80, 0xF0, 0x06, 0x9D, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD,
502 0x38, 0x03, 0x09, 0xF0, 0x9D, 0x38, 0x03, 0xBD, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD, 0x20, 0x02,
503 0x18, 0x65, 0xDB, 0xBC, 0xE0, 0x02, 0x30, 0x1F, 0x18, 0x7D, 0xF0, 0x02, 0xC9, 0x3D, 0x90, 0x07,
504 0xA9, 0x00, 0x9D, 0x38, 0x03, 0xA9, 0x3F, 0x9D, 0x20, 0x03, 0xA8, 0xB1, 0xD5, 0x18, 0x7D, 0x38,
505 0x02, 0x18, 0x65, 0xDD, 0x4C, 0x2A, 0x0A, 0xC9, 0x3D, 0x90, 0x07, 0xA9, 0x00, 0x9D, 0x38, 0x03,
506 0xA9, 0x3F, 0xA8, 0xBD, 0x38, 0x02, 0x18, 0x7D, 0xF0, 0x02, 0x18, 0x71, 0xD5, 0x18, 0x65, 0xDD,
507 0x9D, 0x30, 0x03, 0xBD, 0x58, 0x02, 0xF0, 0x32, 0xDE, 0x58, 0x02, 0xD0, 0x2D, 0xBD, 0x50, 0x02,
508 0x9D, 0x58, 0x02, 0xBD, 0x48, 0x02, 0xDD, 0x40, 0x02, 0xF0, 0x1F, 0xB0, 0x0D, 0x7D, 0x60, 0x02,
509 0xB0, 0x12, 0xDD, 0x40, 0x02, 0xB0, 0x0D, 0x4C, 0x61, 0x0A, 0xFD, 0x60, 0x02, 0x90, 0x05, 0xDD,
510 0x40, 0x02, 0xB0, 0x03, 0xBD, 0x40, 0x02, 0x9D, 0x48, 0x02, 0xA5, 0xDA, 0x29, 0x01, 0xF0, 0x0A,
511 0xBD, 0x48, 0x02, 0x18, 0x7D, 0x38, 0x02, 0x9D, 0x30, 0x03, 0xCA, 0x30, 0x03, 0x4C, 0x34, 0x08,
512 0xAD, 0x40, 0x03, 0x0D, 0x41, 0x03, 0x0D, 0x42, 0x03, 0x0D, 0x43, 0x03, 0xAA, 0x8E, 0x65, 0x0C,
513 0xAD, 0x18, 0x03, 0x10, 0x21, 0xAD, 0x38, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x30, 0x03, 0x18,
514 0x6D, 0x28, 0x03, 0x8D, 0x32, 0x03, 0xAD, 0x3A, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D,
515 0x3A, 0x03, 0x8A, 0x09, 0x04, 0xAA, 0xAD, 0x19, 0x03, 0x10, 0x21, 0xAD, 0x39, 0x03, 0x29, 0x0F,
516 0xF0, 0x1A, 0xAD, 0x31, 0x03, 0x18, 0x6D, 0x29, 0x03, 0x8D, 0x33, 0x03, 0xAD, 0x3B, 0x03, 0x29,
517 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3B, 0x03, 0x8A, 0x09, 0x02, 0xAA, 0xEC, 0x65, 0x0C, 0xD0,
518 0x5E, 0xAD, 0x19, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x39, 0x03, 0x29, 0x0F, 0xF0,
519 0x1F, 0xAC, 0x21, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x30, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x31, 0x03,
520 0xAD, 0x38, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x38, 0x03, 0x8A, 0x09, 0x50, 0xAA,
521 0xAD, 0x1B, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3B, 0x03, 0x29, 0x0F, 0xF0, 0x1F,
522 0xAC, 0x23, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x32, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x33, 0x03, 0xAD,
523 0x3A, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3A, 0x03, 0x8A, 0x09, 0x28, 0xAA, 0x8E,
524 0x65, 0x0C, 0xAD, 0x44, 0x03, 0x0D, 0x45, 0x03, 0x0D, 0x46, 0x03, 0x0D, 0x47, 0x03, 0xAA, 0x8E,
525 0x03, 0x0C, 0xAD, 0x1C, 0x03, 0x10, 0x21, 0xAD, 0x3C, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x34,
526 0x03, 0x18, 0x6D, 0x2C, 0x03, 0x8D, 0x36, 0x03, 0xAD, 0x3E, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9,
527 0x00, 0x8D, 0x3E, 0x03, 0x8A, 0x09, 0x04, 0xAA, 0xAD, 0x1D, 0x03, 0x10, 0x21, 0xAD, 0x3D, 0x03,
528 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x35, 0x03, 0x18, 0x6D, 0x2D, 0x03, 0x8D, 0x37, 0x03, 0xAD, 0x3F,
529 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3F, 0x03, 0x8A, 0x09, 0x02, 0xAA, 0xEC, 0x03,
530 0x0C, 0xD0, 0x5E, 0xAD, 0x1D, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3D, 0x03, 0x29,
531 0x0F, 0xF0, 0x1F, 0xAC, 0x25, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x34, 0x03, 0xB9, 0xC0, 0x04, 0x8D,
532 0x35, 0x03, 0xAD, 0x3C, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3C, 0x03, 0x8A, 0x09,
533 0x50, 0xAA, 0xAD, 0x1F, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3F, 0x03, 0x29, 0x0F,
534 0xF0, 0x1F, 0xAC, 0x27, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x36, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x37,
535 0x03, 0xAD, 0x3E, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3E, 0x03, 0x8A, 0x09, 0x28,
536 0xAA, 0x8E, 0x03, 0x0C, 0xAD, 0x4A, 0x03, 0x60, 0xA0, 0xFF, 0xAD, 0x34, 0x03, 0xAE, 0x30, 0x03,
537 0x8D, 0x10, 0xD2, 0x8E, 0x00, 0xD2, 0xAD, 0x3C, 0x03, 0xAE, 0x38, 0x03, 0x8D, 0x11, 0xD2, 0x8E,
538 0x01, 0xD2, 0xAD, 0x35, 0x03, 0xAE, 0x31, 0x03, 0x8D, 0x12, 0xD2, 0x8E, 0x02, 0xD2, 0xAD, 0x3D,
539 0x03, 0xAE, 0x39, 0x03, 0x8D, 0x13, 0xD2, 0x8E, 0x03, 0xD2, 0xAD, 0x36, 0x03, 0xAE, 0x32, 0x03,
540 0x8D, 0x14, 0xD2, 0x8E, 0x04, 0xD2, 0xAD, 0x3E, 0x03, 0xAE, 0x3A, 0x03, 0x8D, 0x15, 0xD2, 0x8E,
541 0x05, 0xD2, 0xAD, 0x37, 0x03, 0xAE, 0x33, 0x03, 0x8D, 0x16, 0xD2, 0x8E, 0x06, 0xD2, 0xAD, 0x3F,
542 0x03, 0xAE, 0x3B, 0x03, 0x8D, 0x17, 0xD2, 0x8E, 0x07, 0xD2, 0xA9, 0xFF, 0x8C, 0x18, 0xD2, 0x8D,
543 0x08, 0xD2, 0x60
544};
545static const unsigned char tmc_obx[] = {
546 0xFF, 0xFF, 0x00, 0x05, 0x68, 0x0F, 0x4C, 0xCE, 0x0D, 0x4C, 0xD0, 0x08, 0x4C, 0xEF, 0x09, 0x0F,
547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
552 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
553 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03,
554 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
555 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04,
556 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05,
557 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06,
558 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07,
559 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08,
560 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09,
561 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A,
562 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0A,
563 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B,
564 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
565 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
566 0x0E, 0x0F, 0x00, 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98, 0x8F, 0x87, 0x7F, 0x78,
567 0x72, 0x6B, 0x65, 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C, 0x38, 0x35, 0x32, 0x2F,
568 0x2C, 0x2A, 0x27, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12,
569 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02,
570 0x01, 0x00, 0x00, 0xF2, 0xE6, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A,
571 0x71, 0x6B, 0x65, 0x5F, 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F,
572 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12,
573 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02,
574 0x01, 0x00, 0x00, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99, 0x8E, 0x87, 0x7F,
575 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C, 0x39, 0x37, 0x33,
576 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17, 0x16, 0x15, 0x13,
577 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03,
578 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90, 0x88, 0x80, 0x79,
579 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39, 0x35, 0x32, 0x2F,
580 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12,
581 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02,
582 0x01, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08,
583 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8,
584 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15,
585 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A,
586 0x64, 0x5E, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,
587 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02,
588 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
589 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
590 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
591 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
593 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
596 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
598 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
603 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05,
606 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x10,
607 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0xAD, 0xB7, 0x08, 0xF0, 0x5E, 0xAD, 0xB6, 0x08, 0xC9, 0x40,
608 0x90, 0x5A, 0xCE, 0xB5, 0x08, 0xF0, 0x03, 0x4C, 0xEF, 0x09, 0xA2, 0x07, 0xA9, 0x00, 0x9D, 0xC4,
609 0x07, 0x9D, 0xCC, 0x07, 0xCA, 0x10, 0xF7, 0x8D, 0xB6, 0x08, 0xAA, 0xA0, 0x0F, 0xB1, 0xFE, 0x10,
610 0x20, 0x88, 0xB1, 0xFE, 0x10, 0x03, 0x4C, 0x5F, 0x0E, 0x86, 0xFC, 0x0A, 0x0A, 0x26, 0xFC, 0x0A,
611 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x69, 0x00, 0x85, 0xFE, 0xA5, 0xFC, 0x69, 0x00, 0x85, 0xFF, 0x90,
612 0xDA, 0x9D, 0xD4, 0x07, 0x88, 0xB1, 0xFE, 0x9D, 0xDC, 0x07, 0xE8, 0x88, 0x10, 0xCF, 0x18, 0xA5,
613 0xFE, 0x69, 0x10, 0x85, 0xFE, 0x90, 0x02, 0xE6, 0xFF, 0x4C, 0xEF, 0x09, 0xCE, 0xB5, 0x08, 0x10,
614 0xF8, 0xEE, 0xB6, 0x08, 0xAD, 0xB4, 0x08, 0x8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, 0xE8, 0x8E, 0xCB,
693 0x0E, 0x18, 0x69, 0x40, 0x8D, 0x52, 0x09, 0x90, 0x01, 0xE8, 0x8E, 0x53, 0x09, 0x18, 0x69, 0x80,
694 0x8D, 0x57, 0x09, 0x90, 0x01, 0xE8, 0x8E, 0x58, 0x09, 0x18, 0x69, 0x80, 0x85, 0xFE, 0x8D, 0x10,
695 0x09, 0x8D, 0x88, 0x0D, 0x8D, 0xB7, 0x0D, 0x90, 0x01, 0xE8, 0x86, 0xFF, 0x8E, 0x16, 0x09, 0x8E,
696 0x8C, 0x0D, 0x8E, 0xBD, 0x0D, 0xA0, 0x07, 0xA9, 0x00, 0x8D, 0xB7, 0x08, 0x99, 0x00, 0xD2, 0x99,
697 0x10, 0xD2, 0x99, 0x0A, 0x05, 0x99, 0xFC, 0x07, 0x99, 0x04, 0x08, 0x99, 0x32, 0x05, 0x99, 0xBC,
698 0x07, 0x88, 0x10, 0xE8, 0x8D, 0x08, 0xD2, 0x8D, 0x18, 0xD2, 0x8D, 0x3A, 0x05, 0x8D, 0x3B, 0x05,
699 0x60, 0x9D, 0xFC, 0x07, 0x9D, 0x04, 0x08, 0x9D, 0x32, 0x05, 0xBD, 0xE4, 0x07, 0x9D, 0x22, 0x05,
700 0x60, 0x98, 0x49, 0xF0, 0x4A, 0x4A, 0x4A, 0x4A, 0x9D, 0x0C, 0x08, 0x98, 0x29, 0x0F, 0x49, 0x0F,
701 0x9D, 0x14, 0x08, 0x60, 0x29, 0x07, 0x85, 0xFC, 0x8A, 0xA6, 0xFC, 0x29, 0x3F, 0xF0, 0xE2, 0x9D,
702 0xE4, 0x07, 0xA9, 0x00, 0x9D, 0xBC, 0x07, 0xB9, 0xFF, 0xFF, 0x9D, 0x1C, 0x08, 0x85, 0xFC, 0xB9,
703 0xFF, 0xFF, 0x9D, 0x24, 0x08, 0x85, 0xFD, 0x05, 0xFC, 0xF0, 0xB6, 0xA0, 0x4A, 0xB1, 0xFC, 0x9D,
704 0x34, 0x08, 0x9D, 0x44, 0x08, 0xC8, 0xB1, 0xFC, 0x9D, 0x3C, 0x08, 0x9D, 0x4C, 0x08, 0xC8, 0xB1,
705 0xFC, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x54, 0x08, 0xB1, 0xFC, 0x29, 0x0F, 0x9D, 0x5C, 0x08, 0xB1,
706 0xFC, 0x10, 0x0B, 0xBD, 0x5C, 0x08, 0x49, 0xFF, 0x18, 0x69, 0x01, 0x9D, 0x5C, 0x08, 0xC8, 0xB1,
707 0xFC, 0x9D, 0x74, 0x08, 0xC8, 0xB1, 0xFC, 0x29, 0x3F, 0x9D, 0x7C, 0x08, 0x9D, 0x84, 0x08, 0xC8,
708 0xB1, 0xFC, 0x29, 0x80, 0xF0, 0x02, 0xA9, 0x01, 0x9D, 0xAC, 0x08, 0xB1, 0xFC, 0x29, 0x70, 0x4A,
709 0x4A, 0x4A, 0x4A, 0x9D, 0x8C, 0x08, 0xD0, 0x03, 0x9D, 0xAC, 0x08, 0xB1, 0xFC, 0x29, 0x0F, 0x9D,
710 0x9C, 0x08, 0x9D, 0xA4, 0x08, 0x88, 0xB1, 0xFC, 0x29, 0xC0, 0x18, 0x7D, 0xE4, 0x07, 0x9D, 0xE4,
711 0x07, 0x9D, 0x22, 0x05, 0xA8, 0xB9, 0x3C, 0x06, 0x9D, 0xF4, 0x07, 0xA9, 0x00, 0x9D, 0x2C, 0x08,
712 0x9D, 0x64, 0x08, 0x9D, 0x6C, 0x08, 0x9D, 0x94, 0x08, 0xA9, 0x01, 0x9D, 0xBC, 0x07, 0x60
713};
714static const unsigned char tm2_obx[] = {
715 0xFF, 0xFF, 0x00, 0x02, 0x6B, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
716 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
717 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
718 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
719 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
720 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03,
721 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04,
722 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04,
723 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05,
724 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05,
725 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06,
726 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07,
727 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07,
728 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
729 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08,
730 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
731 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98,
732 0x8F, 0x87, 0x7F, 0x78, 0x72, 0x6B, 0x65, 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C,
733 0x38, 0x35, 0x32, 0x2F, 0x2C, 0x2A, 0x27, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17,
734 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06,
735 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0xF2, 0xE9, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98,
736 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C,
737 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17,
738 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06,
739 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2,
740 0x99, 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F,
741 0x3C, 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19,
742 0x17, 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07,
743 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99,
744 0x90, 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C,
745 0x39, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17,
746 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06,
747 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08,
748 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8,
749 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15,
750 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A,
751 0x64, 0x5E, 0x57, 0x52, 0x32, 0x0A, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8,
752 0x6A, 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84,
753 0x52, 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60,
754 0x4E, 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88,
755 0x7F, 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,
756 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02,
757 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
758 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
759 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08,
760 0x08, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03,
761 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
762 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
763 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0xE4, 0x0D, 0x4C, 0xE3, 0x06, 0x4C, 0x9F, 0x08, 0x01,
764 0x10, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
765 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
766 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
767 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
768 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
769 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
771 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
774 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
775 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
776 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
777 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
778 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
782 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
783 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
784 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
787 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
788 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05,
789 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x10,
790 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0x85, 0xD3, 0x81, 0xA9, 0x85, 0xD3, 0x81, 0xA9, 0x88, 0xB1,
791 0xFA, 0x8D, 0x17, 0x05, 0xA2, 0x00, 0x86, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26,
792 0xFC, 0x0A, 0x26, 0xFC, 0x6D, 0x17, 0x05, 0x90, 0x02, 0xE6, 0xFC, 0x18, 0x69, 0x00, 0x85, 0xFA,
793 0xA5, 0xFC, 0x69, 0x00, 0x85, 0xFB, 0x4C, 0x07, 0x07, 0x20, 0xB5, 0x09, 0xAD, 0x16, 0x05, 0xF0,
794 0x05, 0xCE, 0x1C, 0x05, 0x30, 0x03, 0x4C, 0xA2, 0x08, 0xCE, 0x1D, 0x05, 0xD0, 0x52, 0xA2, 0x00,
795 0xEE, 0x17, 0x05, 0xAD, 0x19, 0x05, 0x85, 0xFA, 0xAD, 0x1A, 0x05, 0x85, 0xFB, 0xA0, 0x10, 0xB1,
796 0xFA, 0x30, 0xAB, 0xD0, 0x03, 0x4C, 0x2C, 0x0F, 0x8D, 0x1D, 0x05, 0x88, 0xB1, 0xFA, 0x88, 0x84,
797 0xFC, 0xA8, 0xB9, 0xFF, 0xFF, 0x9D, 0x50, 0x05, 0xB9, 0xFF, 0xFF, 0x9D, 0x58, 0x05, 0xA9, 0x00,
798 0x9D, 0x70, 0x05, 0x9D, 0x60, 0x05, 0xA4, 0xFC, 0xB1, 0xFA, 0x9D, 0x68, 0x05, 0xE8, 0x88, 0x10,
799 0xDB, 0xA9, 0x11, 0x18, 0x65, 0xFA, 0x8D, 0x19, 0x05, 0xA9, 0x00, 0x65, 0xFB, 0x8D, 0x1A, 0x05,
800 0xAD, 0x1B, 0x05, 0x8D, 0x1C, 0x05, 0xA2, 0x07, 0xDE, 0x70, 0x05, 0x30, 0x06, 0xCA, 0x10, 0xF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 0x09, 0xA4, 0xFD, 0xB9, 0x00, 0x03, 0x18, 0x65, 0xFC, 0x9D, 0x38, 0x05,
824 0x98, 0x9D, 0xA0, 0x05, 0xBD, 0xB0, 0x05, 0x3D, 0xA8, 0x06, 0xF0, 0x28, 0xA5, 0xFD, 0x29, 0x7F,
825 0xA8, 0xB9, 0x00, 0x04, 0x18, 0x65, 0xFC, 0x9D, 0x37, 0x05, 0xB9, 0x80, 0x04, 0x69, 0x00, 0x9D,
826 0x38, 0x05, 0xA9, 0x00, 0x9D, 0x1F, 0x05, 0xBC, 0x98, 0x06, 0x99, 0x27, 0x05, 0xCA, 0xCA, 0x10,
827 0xA9, 0x4C, 0x1F, 0x09, 0xBD, 0xB0, 0x05, 0x3D, 0xA0, 0x06, 0xF0, 0x16, 0xBD, 0x68, 0x06, 0x18,
828 0x65, 0xFD, 0x9D, 0xA2, 0x05, 0xA8, 0xB9, 0x00, 0x03, 0x18, 0x65, 0xFC, 0x38, 0x65, 0xFE, 0x9D,
829 0x3A, 0x05, 0xCA, 0x10, 0x85, 0xE8, 0x86, 0xFC, 0xA2, 0x03, 0xAD, 0x09, 0x05, 0xF0, 0x06, 0x29,
830 0x40, 0xD0, 0x3C, 0xA2, 0x07, 0x8A, 0xA8, 0xB9, 0x20, 0x05, 0xD0, 0x0C, 0xBC, 0x98, 0x06, 0xB9,
831 0x28, 0x05, 0xD0, 0x04, 0x8A, 0xA8, 0xA9, 0x00, 0x19, 0xA8, 0x05, 0x9D, 0x30, 0x05, 0xB9, 0x38,
832 0x05, 0x9D, 0x48, 0x05, 0xB9, 0xA0, 0x05, 0x9D, 0x40, 0x05, 0xB9, 0xB0, 0x05, 0x05, 0xFC, 0x85,
833 0xFC, 0xE0, 0x04, 0xD0, 0x03, 0x8D, 0x1F, 0x05, 0xCA, 0x10, 0xCA, 0x8D, 0x1E, 0x05, 0x60, 0xBD,
834 0x20, 0x05, 0x1D, 0xA8, 0x05, 0x9D, 0x30, 0x05, 0xBD, 0x2C, 0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22, 0xD2,
846 0xBD, 0x21, 0x05, 0x8D, 0x23, 0xD2, 0xB9, 0x3A, 0x05, 0x8D, 0x24, 0xD2, 0xBD, 0x22, 0x05, 0x8D,
847 0x25, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x26, 0xD2, 0xBD, 0x23, 0x05, 0x8D, 0x27, 0xD2, 0xAD, 0x0B,
848 0x05, 0xAA, 0x4A, 0x4A, 0x29, 0x01, 0xA8, 0xB9, 0x1E, 0x05, 0x8D, 0x18, 0xD2, 0x8A, 0xAC, 0x09,
849 0x05, 0x10, 0x02, 0x29, 0x04, 0xA8, 0xB9, 0x38, 0x05, 0x8D, 0x10, 0xD2, 0xBD, 0x20, 0x05, 0x8D,
850 0x11, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x12, 0xD2, 0xBD, 0x21, 0x05, 0x8D, 0x13, 0xD2, 0xB9, 0x3A,
851 0x05, 0x8D, 0x14, 0xD2, 0xBD, 0x22, 0x05, 0x8D, 0x15, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x16, 0xD2,
852 0xBD, 0x23, 0x05, 0x8D, 0x17, 0xD2, 0xAD, 0x0A, 0x05, 0xAA, 0x4A, 0x4A, 0x29, 0x01, 0xA8, 0xB9,
853 0x1E, 0x05, 0x8D, 0x08, 0xD2, 0x8A, 0xAC, 0x09, 0x05, 0x10, 0x02, 0x29, 0x04, 0xA8, 0xB9, 0x38,
854 0x05, 0x8D, 0x00, 0xD2, 0xBD, 0x20, 0x05, 0x8D, 0x01, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x02, 0xD2,
855 0xBD, 0x21, 0x05, 0x8D, 0x03, 0xD2, 0xB9, 0x3A, 0x05, 0x8D, 0x04, 0xD2, 0xBD, 0x22, 0x05, 0x8D,
856 0x05, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x06, 0xD2, 0xBD, 0x23, 0x05, 0x8D, 0x07, 0xD2, 0x60, 0xBD,
857 0x80, 0x05, 0x85, 0xFA, 0xBD, 0x88, 0x05, 0x85, 0xFB, 0xBD, 0x80, 0x06, 0x85, 0xFC, 0xBD, 0x88,
858 0x06, 0x85, 0xFD, 0xBD, 0x90, 0x06, 0x85, 0xFE, 0xBD, 0xB8, 0x05, 0xDD, 0xC0, 0x05, 0x90, 0x0C,
859 0x9D, 0x08, 0x06, 0xBD, 0xC8, 0x05, 0x9D, 0xB8, 0x05, 0x4C, 0x0B, 0x0B, 0xBD, 0x08, 0x06, 0xF0,
860 0x30, 0xBD, 0xE8, 0x05, 0xF0, 0x13, 0xDE, 0xF8, 0x05, 0xD0, 0x0E, 0x9D, 0xF8, 0x05, 0xBD, 0xD8,
861 0x05, 0xF0, 0x06, 0x38, 0xE9, 0x10, 0x9D, 0xD8, 0x05, 0xBD, 0xF0, 0x05, 0xF0, 0x13, 0xDE, 0x00,
862 0x06, 0xD0, 0x0E, 0x9D, 0x00, 0x06, 0xBD, 0xE0, 0x05, 0xF0, 0x06, 0x38, 0xE9, 0x10, 0x9D, 0xE0,
863 0x05, 0xBC, 0x48, 0x06, 0xB1, 0xFA, 0x18, 0x7D, 0x98, 0x05, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0xDE,
864 0x58, 0x06, 0x10, 0x39, 0xBD, 0x50, 0x06, 0x9D, 0x58, 0x06, 0xBD, 0x60, 0x06, 0xF0, 0x1E, 0x18,
865 0x7D, 0x48, 0x06, 0x9D, 0x48, 0x06, 0xF0, 0x0D, 0xDD, 0x40, 0x06, 0x90, 0x20, 0xA9, 0xFF, 0x9D,
866 0x60, 0x06, 0x4C, 0x87, 0x0B, 0xA9, 0x01, 0x9D, 0x60, 0x06, 0x4C, 0x87, 0x0B, 0xFE, 0x48, 0x06,
867 0xBD, 0x40, 0x06, 0xDD, 0x48, 0x06, 0xB0, 0x05, 0xA9, 0x00, 0x9D, 0x48, 0x06, 0xA9, 0x13, 0x18,
868 0x65, 0xFA, 0x85, 0xFA, 0x90, 0x02, 0xE6, 0xFB, 0xBC, 0x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 0x88, 0x06, 0xB1,
880 0xFA, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0x4C, 0xAC, 0x08, 0x7D, 0x90, 0x06, 0x9D, 0x90, 0x06, 0xB1,
881 0xFA, 0x18, 0x65, 0xFE, 0x85, 0xFE, 0x4C, 0xAC, 0x08, 0x85, 0xFC, 0xA9, 0x00, 0x85, 0xFD, 0x4C,
882 0xAC, 0x08, 0xBD, 0x20, 0x06, 0x29, 0x03, 0x4A, 0x90, 0x0A, 0xD0, 0x19, 0xBD, 0x18, 0x06, 0x18,
883 0x65, 0xFC, 0x85, 0xFC, 0xDE, 0x38, 0x06, 0x10, 0x4E, 0xFE, 0x20, 0x06, 0xBD, 0x30, 0x06, 0x9D,
884 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xA5, 0xFC, 0xFD, 0x18, 0x06, 0x85, 0xFC, 0xDE, 0x38, 0x06, 0x10,
885 0x36, 0xFE, 0x20, 0x06, 0xBD, 0x30, 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBC, 0x20, 0x06,
886 0xBD, 0x18, 0x06, 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0xDE, 0x38,
887 0x06, 0x10, 0x14, 0x98, 0x9D, 0x20, 0x06, 0xDD, 0x18, 0x06, 0xD0, 0x05, 0x49, 0xFF, 0x9D, 0x18,
888 0x06, 0xBD, 0x30, 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBC, 0x20, 0x06, 0xBD, 0x18, 0x06,
889 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0xDE, 0x38, 0x06, 0x10, 0xE7,
890 0x98, 0x9D, 0x20, 0x06, 0xDD, 0x18, 0x06, 0xD0, 0xD8, 0x49, 0xFF, 0x9D, 0x18, 0x06, 0xBD, 0x30,
891 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBD, 0x20, 0x06, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0xDE,
892 0x38, 0x06, 0x10, 0xC3, 0xBD, 0x18, 0x06, 0x18, 0x7D, 0x20, 0x06, 0x9D, 0x20, 0x06, 0xBD, 0x30,
893 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xA5, 0xFD, 0x38, 0xFD, 0x20, 0x06, 0x85, 0xFD, 0xDE,
894 0x38, 0x06, 0x10, 0xA3, 0xBD, 0x18, 0x06, 0x18, 0x7D, 0x20, 0x06, 0x9D, 0x20, 0x06, 0xBD, 0x30,
895 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBD, 0x18, 0x06, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0x4C,
896 0xF7, 0x0B, 0xA0, 0x10, 0xA9, 0x00, 0x85, 0xFA, 0xA9, 0x00, 0x85, 0xFB, 0xA9, 0x00, 0x8D, 0x17,
897 0x05, 0x8A, 0xF0, 0x3F, 0xB1, 0xFA, 0xF0, 0x02, 0x10, 0x01, 0xCA, 0xA9, 0x11, 0x18, 0x65, 0xFA,
898 0x85, 0xFA, 0x90, 0x02, 0xE6, 0xFB, 0xEE, 0x17, 0x05, 0xD0, 0xE6, 0xA2, 0x00, 0xA9, 0x00, 0x85,
899 0xFC, 0x8A, 0x8D, 0x17, 0x05, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26,
900 0xFC, 0x6D, 0x17, 0x05, 0x90, 0x02, 0xE6, 0xFC, 0x18, 0x69, 0x00, 0x85, 0xFA, 0xA5, 0xFC, 0x69,
901 0x00, 0x85, 0xFB, 0x20, 0x2C, 0x0F, 0xA5, 0xFA, 0x8D, 0x19, 0x05, 0xA5, 0xFB, 0x8D, 0x1A, 0x05,
902 0xA2, 0x07, 0xA9, 0xFF, 0x9D, 0xD0, 0x05, 0xA9, 0xF0, 0x9D, 0xD8, 0x05, 0x9D, 0xE0, 0x05, 0xCA,
903 0x10, 0xF0, 0xA9, 0x03, 0x8D, 0x0F, 0xD2, 0x8D, 0x1F, 0xD2, 0x8D, 0x2F, 0xD2, 0x8D, 0x3F, 0xD2,
904 0xCE, 0x17, 0x05, 0xE8, 0x8E, 0x1C, 0x05, 0xE8, 0x8E, 0x1D, 0x05, 0x8E, 0x16, 0x05, 0x60, 0x8A,
905 0x29, 0x0F, 0x8D, 0x1B, 0x05, 0x60, 0x8E, 0x16, 0x05, 0x60, 0xC9, 0x10, 0xB0, 0x03, 0x4C, 0x4C,
906 0x0D, 0xC9, 0x20, 0x90, 0x88, 0xC9, 0x30, 0xB0, 0x03, 0x4C, 0x85, 0x0F, 0xC9, 0x40, 0x90, 0xDF,
907 0xC9, 0x50, 0xB0, 0x03, 0x4C, 0x2C, 0x0F, 0xC9, 0x60, 0x90, 0xDB, 0xC9, 0x70, 0x90, 0x03, 0x4C,
908 0xB4, 0x0E, 0x84, 0xFD, 0x29, 0x0F, 0x0A, 0x8D, 0x17, 0x0E, 0xA5, 0xFD, 0x90, 0xFE, 0x90, 0x1E,
909 0x90, 0x38, 0x90, 0x59, 0x90, 0x60, 0x90, 0x1A, 0x90, 0x1C, 0x90, 0x1E, 0x90, 0x20, 0x90, 0x22,
910 0x90, 0x24, 0x90, 0x0D, 0x90, 0x0B, 0x90, 0x09, 0x90, 0x07, 0x90, 0x05, 0x90, 0x03, 0x8D, 0x18,
911 0x05, 0x60, 0x9D, 0x68, 0x06, 0x60, 0x9D, 0x70, 0x06, 0x60, 0x9D, 0x78, 0x06, 0x60, 0x9D, 0x90,
912 0x06, 0x60, 0x9D, 0x80, 0x06, 0x60, 0x9D, 0x88, 0x06, 0x60, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x10,
913 0x06, 0x29, 0x30, 0xD0, 0x03, 0x9D, 0x20, 0x06, 0xA5, 0xFD, 0x30, 0x06, 0x29, 0x0F, 0x9D, 0x18,
914 0x06, 0x60,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C8, 0x9D, 0x78, 0x06, 0xB1, 0xFA, 0xC8,
937 0x9D, 0xE8, 0x05, 0x9D, 0xF8, 0x05, 0xB1, 0xFA, 0xC8, 0x9D, 0xF0, 0x05, 0x9D, 0x00, 0x06, 0xB1,
938 0xFA, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x10, 0x06, 0xB1, 0xFA, 0xC8, 0x30, 0x08, 0x29, 0x0F, 0x9D,
939 0x18, 0x06, 0x4C, 0x09, 0x10, 0x29, 0x0F, 0x49, 0xFF, 0x18, 0x69, 0x01, 0x9D, 0x18, 0x06, 0xB1,
940 0xFA, 0xC8, 0x9D, 0x28, 0x06, 0xB1, 0xFA, 0xC8, 0x29, 0x3F, 0x9D, 0x30, 0x06, 0x9D, 0x38, 0x06,
941 0xB1, 0xFA, 0x29, 0x80, 0x0A, 0x2A, 0x9D, 0x60, 0x06, 0xB1, 0xFA, 0x29, 0x70, 0x4A, 0x4A, 0x4A,
942 0x4A, 0x9D, 0x40, 0x06, 0xD0, 0x03, 0x9D, 0x60, 0x06, 0xB1, 0xFA, 0x88, 0x29, 0x0F, 0x9D, 0x50,
943 0x06, 0x9D, 0x58, 0x06, 0xB1, 0xFA, 0x29, 0xC0, 0x1D, 0x98, 0x05, 0x9D, 0x98, 0x05, 0xA8, 0xB9,
944 0x00, 0x03, 0x9D, 0x38, 0x05, 0xA9, 0x00, 0x9D, 0xB8, 0x05, 0x9D, 0x20, 0x06, 0x9D, 0x08, 0x06,
945 0x9D, 0x48, 0x06, 0x9D, 0x80, 0x06, 0x9D, 0x88, 0x06, 0x9D, 0x90, 0x06, 0xA9, 0x01, 0x9D, 0x78,
946 0x05, 0x60
947};